ModuleBuilder/dist/module/Username In Author.js
2021-01-23 21:36:01 +00:00

3 lines
No EOL
4.4 KiB
JavaScript

parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"index.js":[function(require,module,exports) {
"use strict";function e(e,n,t,r,o,a,u){try{var i=e[a](u),s=i.value}catch(c){return void t(c)}i.done?n(s):Promise.resolve(s).then(r,o)}function n(n){return function(){var t=this,r=arguments;return new Promise(function(o,a){var u=n.apply(t,r);function i(n){e(u,o,a,i,s,"next",n)}function s(n){e(u,o,a,i,s,"throw",n)}i(void 0)})}}function t(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=r(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,i=!0,s=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){s=!0,u=e},f:function(){try{i||null==t.return||t.return()}finally{if(s)throw u}}}}function r(e,n){if(e){if("string"==typeof e)return o(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,n):void 0}}function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var a,u,i,s,c,l="1.0.3",f=function(){var e,n=t(document.getElementsByClassName("username-1A8OIy"));try{var r=function(){var n=e.value;if(n.classList.contains("username-added"))return"continue";var t=n.textContent,r=s.find(function(e){return e.nick===t});if(!r)return"continue";var o=a.getUser(r.userId),u=document.createElement("span");u.style.filter="brightness(0.5)",u.style.marginLeft="5px",u.className="author-username",u.textContent="(".concat(o.username,")"),n.appendChild(u),n.classList.add("username-added")};for(n.s();!(e=n.n()).done;)r()}catch(o){n.e(o)}finally{n.f()}},d=function(){s=u.getMembers(i.getGuildId())},m={goosemodHandlers:{onImport:function(){var e=n(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:c=[],a=goosemodScope.webpackModules.findByProps("getUser"),u=goosemodScope.webpackModules.findByProps("getNick"),i=goosemodScope.webpackModules.findByProps("getGuildId","getLastSelectedGuildId"),c.push(setInterval(f,300),setInterval(d,5e3)),d();case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),onLoadingFinished:function(){var e=n(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),onRemove:function(){var e=n(regeneratorRuntime.mark(function e(){var n,r,o,a,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=t(c);try{for(n.s();!(r=n.n()).done;)o=r.value,clearInterval(o)}catch(i){n.e(i)}finally{n.f()}s=null,a=t(document.getElementsByClassName("author-username"));try{for(a.s();!(u=a.n()).done;)u.value.remove()}catch(i){a.e(i)}finally{a.f()}case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),logRegionColor:"darkred"}};exports.default=m;
},{}]},{},["index.js"], null);parcelRequire('index.js').default