From 04861a82ef1f094a2d253f3048777ea50171bea8 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Wed, 25 Mar 2020 18:45:48 -0400 Subject: [PATCH] repoutils replacement --- .eslintrc | 17 +- css/main.css | 248 +++++++++++++++++++++-- css/main.min.css | 2 +- js/main.js | 134 ++++++++++++- js/main.min.js | 2 +- package-lock.json | 347 +++++++++++++++++++++++++-------- package.json | 1 + src/modules/contentManager.js | 4 + src/modules/pluginModule.js | 21 ++ src/modules/settingsPanel.js | 33 +++- src/modules/themeModule.js | 19 ++ src/ui/addoncard.jsx | 229 ++++++++++++++++++++++ src/ui/addonlist.jsx | 160 +++++++++++++++ src/ui/components/dropdown.jsx | 66 +++++++ src/ui/components/search.jsx | 13 ++ src/ui/components/switch.jsx | 25 +++ src/ui/icons/delete.jsx | 13 ++ src/ui/icons/downarrow.jsx | 12 ++ src/ui/icons/edit.jsx | 13 ++ src/ui/icons/search.jsx | 13 ++ src/ui/pluginCard.js | 188 ++++++++++++------ src/ui/themeCard.js | 4 +- src/ui/tooltip.js | 176 +++++++++++++++++ src/ui/tooltipWrap.js | 84 +++----- 24 files changed, 1589 insertions(+), 235 deletions(-) create mode 100644 src/ui/addoncard.jsx create mode 100644 src/ui/addonlist.jsx create mode 100644 src/ui/components/dropdown.jsx create mode 100644 src/ui/components/search.jsx create mode 100644 src/ui/components/switch.jsx create mode 100644 src/ui/icons/delete.jsx create mode 100644 src/ui/icons/downarrow.jsx create mode 100644 src/ui/icons/edit.jsx create mode 100644 src/ui/icons/search.jsx create mode 100644 src/ui/tooltip.js diff --git a/.eslintrc b/.eslintrc index 7488ace1..00f55a4c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,8 @@ { - "extends": "eslint:recommended", + "extends": ["eslint:recommended", "plugin:react/recommended"], + "plugins": [ + "react" + ], "env": { "browser": true, "node": true, @@ -7,7 +10,10 @@ }, "parserOptions": { "ecmaVersion": 8, - "sourceType": "module" + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + } }, "rules": { "semi": 2, @@ -24,7 +30,12 @@ "quote-props": ["error", "consistent-as-needed", {"keywords": true}], "object-curly-spacing": ["error", "never", { "objectsInObjects": false }], "no-var": "error", - "prefer-const": "error" + "prefer-const": "error", + "react/jsx-uses-react": "error", + "react/jsx-uses-vars": "error", + "react/prop-types": "off", + "react/jsx-no-target-blank": "error", + "react/jsx-key": "off" }, "globals": { "webpackJsonp": false, diff --git a/css/main.css b/css/main.css index edfff83a..3feab3ab 100644 --- a/css/main.css +++ b/css/main.css @@ -1074,11 +1074,11 @@ body .ace_closeButton:active { display: flex; } -.bda-slist { +.bd-addon-list { user-select: text; } -.bda-slist li { +.bd-addon-list .bd-addon-card { max-height: 175px; margin-bottom: 20px; padding: 5px 8px; @@ -1086,23 +1086,23 @@ body .ace_closeButton:active { border-radius: 5px; overflow: hidden; } -.theme-dark .bda-slist li { +.theme-dark .bd-addon-list .bd-addon-card { background-color: rgba(32,34,37,.6); color: #f6f6f7; border-color: #202225; } -.theme-light .bda-slist li { +.theme-light .bd-addon-list .bd-addon-card { background-color: #f8f9f9; color: #4f545c; border-color: #dcddde; } -.bda-slist li.settings-open { +.bd-addon-list .bd-addon-card.settings-open { max-height: 800px; overflow-y: auto; } -.bda-slist .bda-header { +.bd-addon-list .bda-header { font-size: 12px; font-weight: 700; display: flex; @@ -1112,36 +1112,36 @@ body .ace_closeButton:active { border-bottom: 1px solid transparent; overflow: hidden; } -.theme-dark .bda-slist .bda-header { +.theme-dark .bd-addon-list .bda-header { color: #f6f6f7; border-bottom-color: rgba(114,118,125,.3); } -.theme-light .bda-slist .bda-header { +.theme-light .bd-addon-list .bda-header { color: #4f545c; border-bottom-color: rgba(185,187,190,.3); } -.bda-slist .bda-description { +.bd-addon-list .bda-description { word-break: break-word; max-height: 100px; margin: 5px 0; padding: 5px 0; overflow-y: auto; } -.theme-dark .bda-slist .bda-description { +.theme-dark .bd-addon-list .bda-description { color: #b9bbbe; } -.theme-light .bda-slist .bda-description { +.theme-light .bd-addon-list .bda-description { color: #72767d; } -.bda-slist .scroller::-webkit-scrollbar-track-piece, -.bda-slist .scroller::-webkit-scrollbar-thumb { +.bd-addon-list .scroller::-webkit-scrollbar-track-piece, +.bd-addon-list .scroller::-webkit-scrollbar-thumb { border-radius:0 !important; border-color:transparent; } -.bda-slist .bda-footer { +.bd-addon-list .bda-footer { font-size: 12px; font-weight: 700; display: flex; @@ -1151,14 +1151,14 @@ body .ace_closeButton:active { border-top: 1px solid transparent; overflow: hidden; } -.theme-dark .bda-slist .bda-footer { +.theme-dark .bd-addon-list .bda-footer { border-top-color: rgba(114,118,125,.3); } -.theme-light .bda-slist .bda-footer { +.theme-light .bd-addon-list .bda-footer { border-top-color: rgba(185,187,190,.3); } -.bda-slist .bda-footer button { +.bd-addon-list .bda-footer button { background: #7289da; color: #FFF; border-radius: 5px; @@ -1168,15 +1168,15 @@ body .ace_closeButton:active { transition: opacity 250ms ease; } -.bda-slist .bda-footer button:disabled { +.bd-addon-list .bda-footer button:disabled { opacity: 0.4; } -.bda-slist .bda-footer a { +.bd-addon-list .bda-footer a { color: #7289da; } -.bda-slist .bda-footer a:hover { +.bd-addon-list .bda-footer a:hover { text-decoration: underline; } /* ======================= */ @@ -1834,3 +1834,211 @@ body .ace_closeButton:active { /* =============== */ /* END DARK MODE */ + + + +.bd-switch { + background-color: #72767d; + border-radius: 14px; + width: 42px; + height: 24px; + opacity: 1; + overflow: hidden; + user-select: none; + position: relative; + display: block; + flex: 0 0 auto; + transition: background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out,opacity .15s ease-in-out; + margin-left: 10px; + box-shadow: inset 0 1px 1px rgba(0,0,0,.15); +} + +.bd-switch::before { + content: ""; + display: block; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + z-index: 0; + opacity: 0; + background-color: #000; +} + +.bd-switch::after { + content: ""; + display: block; + position: absolute; + background-color: #fff; + z-index: 1; + width: 18px; + margin: 3px; + border-radius: 9px; + height: 18px; + left: 0; + transition: transform .15s ease-in-out,width .1s ease-in-out,left .1s ease-in-out; + box-shadow: 0 2px 4px rgba(0,0,0,.3); +} + +.bd-switch .bd-checkbox { + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + padding: 0; + margin: 0; + z-index: 2; + cursor: pointer; +} + +.bd-switch-checked { + background-color: #3E82E5; +} + +.bd-switch-checked::after { + transform: translate3d(18px,0,0); +} + +.bd-switch-disabled { + opacity: .3; + cursor: not-allowed; +} + + + + + + + + + + + +.bd-addon-button { + cursor: pointer; +} + +.bd-addon-button + .bd-addon-button { + margin-left: 5px; +} + + +.bd-addon-controls { + display: flex; + align-items: center; + justify-content: space-between; +} + +.bd-addon-controls .bd-search { + font-size: 13px; + margin: 0; + width: 200px; +} + +.bd-addon-dropdowns { + display: flex; +} + +.bd-select-wrapper + .bd-select-wrapper { + margin-left: 10px; +} + +.bd-select-wrapper { + color: #f6f6f7; + font-size: 13px; + display: flex; + align-items: center; +} + +.bd-select-wrapper label { + opacity: .3; + margin-right: 5px; +} + +.bd-select { + position: relative; + cursor: pointer; + color: #f6f6f7; + font-size: 13px; + display: flex; + align-items: center; + justify-content: space-between; + background-color: rgba(0, 0, 0, 0.1); + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 3px; + padding: 5px 5px 5px 0; +} + +.bd-select.bd-select-transparent { + background: none; + border: none; + padding: 0; +} + +.bd-select-value { + padding-left: 12px; +} + +.bd-select-arrow { + margin-left: 10px; +} + +.bd-select .bd-select-options { + position: absolute; + background: #2F3136; + border-radius: 0 0 3px 3px; + max-height: 300px; + min-width: calc(100% + 2px); + overflow-y: auto; + box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 5px 0px; + border: 1px solid rgba(0, 0, 0, 0.3); + border-top: 0; + margin-top: -1px; + margin-left: -1px; + z-index: 3; + top: 100%; +} + +.bd-select-transparent .bd-select-options { + border: 1px solid rgba(0, 0, 0, 0.3); + margin-top: 3px; + border-radius: 3px; +} + +.bd-select .bd-select-option { + padding: 8px 12px; + cursor: pointer; + white-space: pre; +} + +.bd-select .bd-select-option:hover, +.bd-select .bd-select-option.selected { + background: #26272B; +} + + + + +.bd-search-wrapper { + padding: 3px; + border-radius: 3px; + outline: none; + border: 0; + background-color: #202225; + color: #fff; + display: flex; + align-items: center; +} + +.bd-search { + padding: 2px 3px; + background: none; + border: 0; + color: #fff; + flex: 1; +} + +.bd-search-wrapper > svg { + margin-right: 2px; +} \ No newline at end of file diff --git a/css/main.min.css b/css/main.min.css index 2a81aa53..3ee74ef2 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -.bd-loaderv2{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+IDwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyBoZWlnaHQ9IjEwMCUiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7IiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWw6c3BhY2U9InByZXNlcnZlIiB3aWR0aD0iMTAwJSIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMjAwMCAyMDAwIj4gICAgPG1ldGFkYXRhIC8+ICAgIDxkZWZzPiAgICAgICAgPGZpbHRlciBpZD0ic2hhZG93MSI+ICAgICAgICA8ZmVEcm9wU2hhZG93IGR4PSIyMCIgZHk9IjAiIHN0ZERldmlhdGlvbj0iMjAiIGZsb29kLWNvbG9yPS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uNDQyKzgyNi42NSsxMzUuNDQyTDEzNS40NSsxMzUuNDQyTDEzNS40NSsxMDA0QzEzNS40NSsxMDA0KzEzNS40MjcrMTI1NS4yMSszNTUuNjI2KzEyNTUuMjFDNTc1LjgyNSsxMjU1LjIxKzU3NS44NDgrMTAwNCs1NzUuODQ4KzEwMDRMNTc3LjQ1KzQ5MC40NDJMODM0LjQ1KzQ5MC40NDJDMTEwOC45NSs0OTAuNDQyKzExMDguOTUrODM1LjM0Mis4MzQuNDUrODM1LjM0Mkw2NjQuNjUrODM1LjM0Mkw2NjQuNjUrMTE2NC44NEw4MzQuNDUrMTE2NC44NEM5MjMuOTMyKzExNjQuODQrOTg0LjI0NCsxMjAxLjQ4KzEwMTUuMzkrMTI1MC44N0MxMDc5Ljc4KzEzNTMrMTAxOS40NysxNTA5LjY0KzgzNC40NSsxNTA5LjY0TDEzNS40NSsxNTA5LjY0TDEzNS40NSsxODY0LjU0TDgyNi42NSsxODY0LjU0QzExODIuOTUrMTg2NC41NCsxNDU5LjQ1KzE3MjEuOTQrMTQ2OS4yNSsxMzY4LjU0QzE0NjkuMjUrMTIwNS45NCsxNDI0Ljc1KzEwODQuNDQrMTM0Ni4zNSs5OTkuOTQyQzE0MjQuNzUrOTE1LjU0MisxNDY5LjI1Kzc5NC4wNDIrMTQ2OS4yNSs2MzEuNDQyWiIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMSIvPiAgICA8L2c+PC9zdmc+)}.bd-loaderv2{position:fixed;bottom:5px;right:5px;z-index:2147483647;display:block;width:20px;height:20px;background-size:100% 100%;animation:bd-loaderv2-animation 1.5s ease-in-out infinite}@keyframes bd-loaderv2-animation{0%{opacity:.05}50%{opacity:.6}to{opacity:.05}}#emote-container{padding:10px}.emote-container{display:inline-block;padding:2px;border-radius:5px;width:30px;height:30px;position:relative}.emote-icon{max-width:100%;max-height:100%;position:absolute;margin:auto;top:0;right:0;bottom:0;left:0;cursor:pointer}.emote.stop-animation{animation:none!important}.emote-container:hover{background:rgba(123,123,123,.37)}.emoteflip,.emotespinflip{transform:scaleX(-1)}.emotespin{animation:1s emote-spin infinite linear}.emote1spin{animation:1s emote-spin-reverse infinite linear}.emotespin2{animation:.5s emote-spin infinite linear}.emote2spin{animation:.5s emote-spin-reverse infinite linear}.emotespin3{animation:.2s emote-spin infinite linear}.emote3spin{animation:.2s emote-spin-reverse infinite linear}.emotepulse{animation:1s emote-pulse infinite linear}.emotetr{transform:translateX(-3px)}.emotebl{transform:translateY(-3px)}.emotebr{transform:translate(-3px,-3px)}.emoteshake{animation:1s emote-shake infinite linear}.emoteflap{transform:scaleY(-1)!important}.emoteshake2{animation:emote-shake2 .3s linear infinite}.emoteshake3{animation:emote-shake3 .1s linear infinite}@keyframes emote-shake2{25%{transform:translate(-1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}75%{transform:translate(1px,-1px)}}@keyframes emote-shake3{25%{transform:translate(-1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}75%{transform:translate(1px,-1px)}}@keyframes emote-spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes emote-spin-reverse{0%{transform:rotate(0deg)}to{transform:rotate(-360deg)}}@keyframes emote-pulse{0%{-webkit-transform:scale(1,1)}50%{-webkit-transform:scale(1.2,1.2)}to{-webkit-transform:scale(1,1)}}@keyframes emote-shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}#removemenu{width:auto;background:#505050;position:absolute;z-index:999999;display:none;box-shadow:0 0 2px #000;padding:2px;left:25px;display:block!important;cursor:pointer;color:#fff;position:fixed}#removemenu ul a{text-decoration:none;color:#fff;padding:3px}.emotewrapper{position:relative;display:inline-flex;object-fit:contain;margin:-.1em .05em -.2em .1em;vertical-align:top}.emotewrapper.jumboable{margin-bottom:0;margin-top:.2em;vertical-align:-.3em}.emote{height:1.45em}.emote.jumboable{height:2rem}.emotewrapper:hover .fav{display:block}.fav{display:none;position:absolute;width:15px;height:15px;right:-7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAzFBMVEUAAABQUFBMTExLS0tNTU1MTExNTU1NTU1MTExMTExNTU1LS0tEREBEREBEREBEREBJSUhLS0tLS0tEREBNTU1NTU1NTU1EREArKyhNTU1NTU0AAABMTExKSklMTExNTU1NTU1NTU1KSkpMTExKSkhNTU1KSkpISEZNTU1LS0tAQDxOTk5KSkpLS0tNTU1MTExMTEx/f39MTExMTExLS0pLS0tMTExNTU1NTU1LS0pNTU1NTU1NTU1NTU1NTU1NTUxNTU1NTU1NTUxMTEzB8C/5AAAAOnRSTlMAI8X96oWAgYSF68QBAg0PMCb9BIuLgQUD4N0Bh0mKhZSOQ4gcrKscaW8QRE6fmJyjAshASceG7cIpqQOxTQAAALVJREFUGFddx6FOA0EYAOGZvd07Qm6vVCAAgUUgQEDfX/YZMAigqaFN7iC5tsmPqGPUN/AvUVeoEbGOCElJz08Uzeixqu4AqomVVSNngOVjTqDGZSl3UFtPGV2ot2zaq96YM9p5Ddzcf/nTTAlj+/sNtNu8OcwkIsbPBtrUfMQeEhGQmHbmGIFMwLPzu6UMIwBNgToshgq8Nr2ki+Oy7ebDHp70LRPWB6OZgfWLWei7fJonOOsPCGA9kVlssOoAAAAASUVORK5CYII=);border:0;background-size:100% 100%;background-repeat:no-repeat;background-color:#303030;border-radius:5px;top:-7px;cursor:pointer}.fav.active{background-color:#ff0}.emojiPicker-3m1S-j{box-shadow:none;border-top:none;border-radius:0 0 5px 5px}#bda-qem{border-radius:5px 5px 0 0;background:#2f3136;border-bottom:1px solid rgba(0,0,0,.1)!important;height:30px;display:flex;flex-direction:row;padding-right:1px!important}.theme-light #bda-qem{background:#f2f3f5}#bda-qem button{border-left:1px solid #202225;background:#2f3136;box-shadow:rgba(0,0,0,.1) 1px 0 0 0;flex-grow:1;color:#fff}.theme-light #bda-qem button{border-left:1px solid #efefef;background:0 0;box-shadow:#cecece 1px 0 0 0;color:#000}#bda-qem button:first-child{border-left-color:transparent}#bda-qem button:hover{background:rgba(79,84,92,.16)}.theme-light #bda-qem button:hover{background:#ececec}#bda-qem-twitch{border-radius:5px 0 0 0;order:2}#bda-qem-emojis{border-radius:0 5px 0 0;order:3}#bda-qem-favourite{order:3}#bda-qem button.active,#bda-qem button.active:hover{background-color:#7289da}.theme-light #bda-qem button.active,.theme-light #bda-qem button.active:hover{color:#fff}#bda-qem-twitch-container,#bda-qem-favourite-container{width:384px;height:424px;background-color:#2f3136;border-radius:0 0 5px 5px}.theme-light #bda-qem-twitch-container,.theme-light #bda-qem-favourite-container{background-color:#f2f3f5}#bda-qem-twitch-container .scroller-wrap,#bda-qem-favourite-container .scroller-wrap{height:100%}.emote-menu-inner{padding:5px 0 0 15px}.bda-qme-hidden #bda-qem-emojis{display:none}#bd-pub-li{height:20px;margin-bottom:10px;overflow:hidden}#bd-pub-button{border-radius:4px;background-color:#2f3136;color:#b9bbbe;text-align:center;font-size:12px;line-height:20px;height:20px}.bd-server-card .bd-server-tags{flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:0;line-height:24px;font-size:12px;color:#b9bbbe;font-weight:700;margin-right:10px}.ui-card.ui-card-primary.bd-server-card:first-child{margin-bottom:13px}.ui-card.ui-card-primary.bd-server-card:first-child:after{border:3px solid #7289da;content:"";display:block;position:absolute;left:0;right:0;margin-top:4px}.bd-server-card.bd-server-card-pinned{margin-bottom:15px}.bd-server-card.bd-server-card-pinned:after{background:#3a71c1;content:"";height:3px;width:100%;display:block;margin-top:7px;position:absolute;top:100%}.bd-server-description-container{color:#b9bbbe;min-height:65px;max-height:65px;border-top:1px solid #3f4146;border-bottom:1px solid #3f4146;padding-top:5px;font-size:13px}.bd-server-header{justify-content:space-between;font-weight:600}.bd-server-card{display:flex}.bd-server-content{padding:5px 10px;flex:1}.bd-server-image{min-width:115px;min-height:115px;max-width:115px;max-height:115px}.bd-server-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-right:15px;max-width:330px;flex:1 1 50%}.bd-layer{-ms-flex-direction:column;-webkit-box-direction:normal;-webkit-box-orient:vertical;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:column;left:0;position:absolute;right:0;top:0}#pubslayer .ui-tab-bar-item{color:#b9bbbe;padding-top:6px;padding-bottom:6px;margin-bottom:2px;padding:6px 10px;position:relative;font-size:16px;line-height:20px;border-radius:3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0;font-weight:500;cursor:pointer}#pubslayer .ui-tab-bar-item:hover{color:#f6f6f7;background-color:rgba(186,188,191,.1)}#pubslayer .ui-tab-bar-item.selected{color:#fff;background-color:#7289da}#pubslayer .ui-tab-bar-header{color:#72767d;padding:6px 10px;font-size:12px;line-height:16px;text-transform:uppercase;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0;font-weight:500}#pubslayer #bd-settings-sidebar .ui-tab-bar-separator{background-color:rgba(114,118,126,.3);margin-left:10px;margin-right:10px;height:1px;margin-bottom:8px;margin-top:8px}#pubslayer h2.ui-form-title{color:#f6f6f7;text-transform:uppercase;font-weight:600}#pubslayer h5.ui-form-title{color:#f6f6f7}#pubslayer button{background:#7289da;color:#fff;font-size:14px;font-weight:500;line-height:16px;padding:2px 16px;border:0;border-radius:3px;transition:background-color .17s ease}#pubslayer button:hover{background-color:#677bc4}#pubslayer input{color:#f6f6f7;background-color:rgba(0,0,0,.1);border-color:rgba(0,0,0,.3);padding:10px;height:30px;border-width:1px;border-style:solid;border-radius:3px;outline:0;transition:background-color .15s ease,border .15s ease}.standardSidebarView-3F1I7i #bd-customcss-attach-controls button,.bd-detached-css-editor #bd-customcss-attach-controls button{margin:0;width:100px;background:#31332b;color:#fff;height:26px;font-weight:600;margin-top:5px;border-radius:3px}.standardSidebarView-3F1I7i #bd-customcss-attach-controls button:hover,.bd-detached-css-editor #bd-customcss-attach-controls button:hover{background:#3b3e44}.contentRegion-3nDuYy #bd-customcss-attach-controls,#bd-customcss-detach-container #bd-customcss-attach-controls{background:#272822;color:#fff;border:0;box-shadow:0 1px 0 0 #2f3129 inset}.contentRegion-3nDuYy #bd-customcss-pane,.contentRegion-3nDuYy #bd-customcss-innerpane,#bd-customcss-detach-container #bd-customcss-pane,#bd-customcss-detach-container #bd-customcss-innerpane{min-height:calc(80vh - 165px)}.standardSidebarView-3F1I7i #editor-detached h3{color:#87909c;font-weight:600;font-size:22px}.standardSidebarView-3F1I7i #editor-detached button{margin:auto;margin-left:calc(50% - 100px);margin-top:20px;background:#7289da;color:#fff;font-weight:600;border-radius:5px;font-size:20px}.editor-wrapper{display:flex}.line-numbers,.ace_editor{line-height:normal;font-family:Consolas,monospace;box-sizing:border-box;height:calc(100vh - 250px);font-size:14px}.line-numbers{white-space:pre;color:gray;padding:10px 5px 0 5px;background:#24262a;overflow:hidden}.ace_editor{width:100%;background:#292b2f;outline:0;color:#fff;padding:10px;resize:none}#bd-customcss-detach-container .editor-wrapper,#bd-customcss-detach-container .line-numbers,#bd-customcss-detach-container .ace_editor{height:100%}.bd-detached-editor .app-2rEoOp{width:70%}.bd-detached-editor #bd-customcss-detach-container{display:block}#bd-customcss-detach-container{display:none;position:absolute;width:30%;top:0;right:0;bottom:0;background-color:#36393e}#bd-customcss-detach-editor{height:calc(100% - 87px)}#bd-customcss-detach-editor #bd-customcss-innerpane,#bd-customcss-detach-editor .CodeMirror{height:100%}#bd-customcss-detach-controls{background:#e8e8e8;border-top:1px solid #adadad;box-shadow:inset 0 1px 0 0 #fff;height:100%;padding:5px}#bd-customcss-detach-controls .checkbox-group li{margin-top:5px;display:inline-block}#bd-customcss-detach-controls button{width:90px;height:30px;margin-top:8px;background-color:#738bd7;color:#fff;font-size:19px}#bd-customcss-detach-controls-buttons{bottom:5px}#editor-detached{margin-top:50px}#editor-detached h3{text-align:center;font-size:30px}#editor-detached .btn{left:50%;margin-left:-100px;margin-top:10px;width:200px;height:60px}#bd-customcss-attach-controls{background:#e8e8e8;border:1px solid #fff;border-top:1px solid #adadad;box-shadow:inset 0 1px 0 0 #fff;height:100%;padding:5px}#bd-customcss-attach-controls .checkbox-group{margin-bottom:0}#bd-customcss-attach-controls .checkbox-group li{margin-top:5px;display:inline-block}#bd-customcss-attach-controls button{margin:0;width:100px}#bd-customcss-detach-container #bd-customcss-detach-controls-buttons button{width:90px;height:30px;margin-top:8px;background-color:#738bd7;color:#fff;font-size:19px}#ace_settingsmenu_container{background:rgba(0,0,0,.7)!important}body #ace_settingsmenu{padding-top:35px}body .ace_closeButton{position:absolute;top:8px;right:12px;z-index:10000;padding:0;cursor:pointer;background:0 0;border:0}body .ace_closeButton::before{content:"✖";color:#36393f}body .ace_closeButton:active{transform:translateY(2px)}.theme-dark div #ace_settingsmenu{color:#f6f6f7;background:#36393f;box-shadow:0 0 0 1px rgba(32,34,37,.6),0 2px 10px 0 rgba(0,0,0,.2)}.theme-dark div #ace_settingsmenu select,.theme-dark div #ace_settingsmenu input[type=text]{color:#f6f6f7;background:#2f3136;border:1px solid #484b52}.theme-dark div .ace_closeButton::before{color:#f6f6f7}#bd-customcss-attach-controls .help-text{margin-top:8px;margin-bottom:3px;font-size:14px}#bd-customcss-attach-controls .help-text .inline{background:#31332b;padding:.2em;margin:-.2em 0;border-radius:3px}.bd-social-logo{opacity:.6}.bd-social-link:hover .bd-social-logo{opacity:1}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper{bottom:0;left:0;position:fixed;background:inherit;right:0;padding:5px}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper span{color:#b9bbbe;font-weight:600;font-size:11px}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper a{font-size:11px}.bd-pfbtn{background:#7289da;color:#fff;border-radius:5px;margin-left:10px}#bd-settings-sidebar .ui-tab-bar-item{font-size:16px;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;flex-shrink:0;padding:6px 10px;border-radius:3px;position:relative;overflow:hidden}#bd-settings-sidebar .ui-tab-bar-item.selected{cursor:default}.theme-dark #bd-settings-sidebar .ui-tab-bar-item{color:#b9bbbe}.theme-dark #bd-settings-sidebar .ui-tab-bar-item:hover{background-color:rgba(185,187,190,.1);color:#f6f6f7}.theme-dark #bd-settings-sidebar .ui-tab-bar-item.selected{background-color:#7289da;color:#fff}.theme-light #bd-settings-sidebar .ui-tab-bar-item{color:#72767d}.theme-light #bd-settings-sidebar .ui-tab-bar-item:hover{background-color:rgba(79,84,92,.1);color:#4f545c}.theme-light #bd-settings-sidebar .ui-tab-bar-item.selected{background-color:#7289da;color:#fff}#bd-settings-sidebar .ui-tab-bar-header{font-size:12px;font-weight:700;line-height:16px;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0;padding:6px 10px;overflow:hidden}.theme-dark #bd-settings-sidebar .ui-tab-bar-header{color:#72767d}.theme-light #bd-settings-sidebar .ui-tab-bar-header{color:#b9bbbe}#bd-settings-sidebar .ui-tab-bar-separator{height:1px;margin:8px 10px}.theme-dark #bd-settings-sidebar .ui-tab-bar-separator{background-color:rgba(114,118,125,.3)}.theme-light #bd-settings-sidebar .ui-tab-bar-separator{background-color:rgba(185,187,190,.3)}.ui-flex{display:flex}#bd-settingspane-container h2.ui-form-title{font-size:16px;font-weight:600;line-height:20px;text-transform:uppercase;display:inline-block;margin-bottom:20px}.theme-dark #bd-settingspane-container h2.ui-form-title{color:#f6f6f7}.theme-light #bd-settingspane-container h2.ui-form-title{color:#4f545c}#bd-settingspane-container .ui-switch-item{flex-direction:column;margin-top:8px}#bd-settingspane-container .ui-switch-item h3{font-size:16px;font-weight:500;line-height:24px;flex:1}.theme-dark #bd-settingspane-container .ui-switch-item h3{color:#f6f6f7}.theme-light #bd-settingspane-container .ui-switch-item h3{color:#4f545c}#bd-settingspane-container .ui-switch-item .style-description{font-size:14px;font-weight:500;line-height:20px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid rgba(114,118,126,.3)}.theme-dark #bd-settingspane-container .ui-switch-item .style-description{color:#72767d}.theme-light #bd-settingspane-container .ui-switch-item .style-description{color:rgba(114,118,125,.6)}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;width:44px;height:24px;display:block;flex:0 0 auto}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper input{position:absolute;opacity:0;cursor:pointer;width:100%;height:100%;z-index:1}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch{background:#7289da;position:absolute;top:0;right:0;bottom:0;left:0;background:#72767d;border-radius:14px;transition:background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch:before{content:"";display:block;width:18px;height:18px;position:absolute;top:3px;left:3px;bottom:3px;background:#f6f6f7;border-radius:10px;transition:all .15s ease;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05)}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch.checked{background:#7289da}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch.checked:before{transform:translateX(20px)}#bd-settingspane-container .scroller-wrap{height:100%}#bd-settingspane-container .scroller-wrap .scroller{display:flex}.content-column .ui-form-title:first-child{margin-top:0}.bd-reload{cursor:pointer;vertical-align:top;fill:#dcddde}.bd-reload:hover{fill:#fff}.bd-reload-header{margin-left:5px}.bd-reload-card{margin-right:5px}.bda-controls{display:flex}.bda-slist{user-select:text}.bda-slist li{max-height:175px;margin-bottom:20px;padding:5px 8px;border:1px solid transparent;border-radius:5px;overflow:hidden}.theme-dark .bda-slist li{background-color:rgba(32,34,37,.6);color:#f6f6f7;border-color:#202225}.theme-light .bda-slist li{background-color:#f8f9f9;color:#4f545c;border-color:#dcddde}.bda-slist li.settings-open{max-height:800px;overflow-y:auto}.bda-slist .bda-header{font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;padding-bottom:5px;border-bottom:1px solid transparent;overflow:hidden}.theme-dark .bda-slist .bda-header{color:#f6f6f7;border-bottom-color:rgba(114,118,125,.3)}.theme-light .bda-slist .bda-header{color:#4f545c;border-bottom-color:rgba(185,187,190,.3)}.bda-slist .bda-description{word-break:break-word;max-height:100px;margin:5px 0;padding:5px 0;overflow-y:auto}.theme-dark .bda-slist .bda-description{color:#b9bbbe}.theme-light .bda-slist .bda-description{color:#72767d}.bda-slist .scroller::-webkit-scrollbar-track-piece,.bda-slist .scroller::-webkit-scrollbar-thumb{border-radius:0!important;border-color:transparent}.bda-slist .bda-footer{font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;padding-top:5px;border-top:1px solid transparent;overflow:hidden}.theme-dark .bda-slist .bda-footer{border-top-color:rgba(114,118,125,.3)}.theme-light .bda-slist .bda-footer{border-top-color:rgba(185,187,190,.3)}.bda-slist .bda-footer button{background:#7289da;color:#fff;border-radius:5px;display:block;margin-left:auto;padding:2px 16px;transition:opacity 250ms ease}.bda-slist .bda-footer button:disabled{opacity:.4}.bda-slist .bda-footer a{color:#7289da}.bda-slist .bda-footer a:hover{text-decoration:underline}@keyframes bd-backdrop{to{opacity:.85}}@keyframes bd-modal-wrapper{to{transform:scale(1);opacity:1}}@keyframes bd-backdrop-closing{to{opacity:0}}@keyframes bd-modal-wrapper-closing{to{transform:scale(.7);opacity:0}}.bd-backdrop{animation:bd-backdrop 250ms ease;animation-fill-mode:forwards;opacity:0;background-color:#000;transform:translateZ(0)}.bd-modal-wrapper.closing .bd-backdrop{animation:bd-backdrop-closing 200ms linear;animation-fill-mode:forwards;animation-delay:50ms;opacity:.85}.bd-modal-wrapper.closing .bd-modal{animation:bd-modal-wrapper-closing 250ms cubic-bezier(.19,1,.22,1);animation-fill-mode:forwards;opacity:1;transform:scale(1)}.bd-modal-wrapper .bd-modal{animation:bd-modal-wrapper 250ms cubic-bezier(.175,.885,.32,1.275);animation-fill-mode:forwards;transform:scale(.7);transform-origin:50% 50%;display:flex;align-items:center;box-sizing:border-box;contain:content;justify-content:center;top:0;left:0;bottom:0;right:0;opacity:0;pointer-events:none;position:absolute;z-index:1000}.bd-modal-wrapper .bd-modal-inner{display:flex;contain:layout;flex-direction:column;pointer-events:auto;border:1px solid rgba(28,36,43,.6);border-radius:5px;box-shadow:0 2px 10px 0 rgba(0,0,0,.2);overflow:hidden;max-height:660px;min-height:200px;width:440px;user-select:text}.bd-modal-wrapper .bd-content-modal .bd-modal-inner{height:500px;width:700px}.bd-modal-wrapper .header{background-color:#35393e;box-shadow:0 2px 3px 0 rgba(0,0,0,.2);padding:12px 20px;z-index:1;color:#fff;font-size:16px;font-weight:700;line-height:19px}.bd-modal-wrapper .bd-modal-body{background-color:#36393f;color:#fff;flex-direction:row;overflow:hidden;display:flex;flex-direction:column;flex:1;contain:layout;position:relative}.bd-modal-wrapper .scroller{padding:10px}.bd-modal-wrapper .bd-content-modal .bd-modal-body{padding:0}.bd-modal-wrapper .scroller{overflow-y:auto}.bd-modal-wrapper .footer{display:flex;justify-content:flex-end;padding:10px 20px}.bd-modal-wrapper .footer button{background-color:#7289da;color:#fff;min-height:32px;min-width:60px;align-items:center;border-radius:3px;display:flex;font-size:14px;font-weight:500;justify-content:center;line-height:16px;padding:2px 16px;user-select:none}.bd-modal-wrapper .footer button:hover{background-color:#677bc4}.bd-modal-wrapper .footer button:active{background-color:#5f6fb9}.bd-modal-wrapper .tab-bar-container{align-items:center;border-bottom:0;background:rgba(0,0,0,.2);box-shadow:0 2px 3px 0 rgba(0,0,0,.1);display:flex;flex-direction:row;justify-content:space-between;margin-bottom:15px}.bd-modal-wrapper .tab-bar.TOP{margin:0;border:0;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.bd-modal-wrapper .tab-bar-container .tab-bar-item{margin:0 15px;padding:15px 0;color:#fff!important;opacity:.5;transition:opacity 200ms ease;border-bottom:2px solid transparent}.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover{border-color:#fff;cursor:pointer}.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected{opacity:1;border-color:#fff}.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item{margin:0}.bd-modal-wrapper .table-header{display:flex;justify-content:space-between;color:#fff;font-weight:700;padding-bottom:10px;margin:3px 15px 0 15px;border-bottom:1px solid #fff;font-size:14px}.bd-modal-wrapper .table-column{width:25%}.bd-modal-wrapper .table-column.column-error{width:50%}.bd-modal-wrapper .table-column{word-wrap:break-word}.bd-modal-wrapper .errors{display:flex;flex-direction:column;padding:0;font-size:14px;padding:0 5px}.bd-modal-wrapper .error{display:flex;color:#fff;border-bottom:1px solid rgba(255,255,255,.25);padding:15px 0;align-items:center}.bd-modal-wrapper .bd-content-modal .scroller{padding-top:0}.bd-toasts{position:fixed;display:flex;top:0;flex-direction:column;align-items:center;justify-content:flex-end;pointer-events:none;z-index:4000}@keyframes bd-toast-up{0%{transform:translateY(0);opacity:0}}.bd-toast{animation:bd-toast-up 300ms ease;transform:translateY(-10px);background:#36393f;padding:10px;border-radius:5px;box-shadow:0 0 0 1px rgba(32,34,37,.6),0 2px 10px 0 rgba(0,0,0,.2);font-weight:500;color:#fff;user-select:text;font-size:14px;opacity:1;margin-top:10px;pointer-events:none;user-select:none}@keyframes bd-toast-down{to{transform:translateY(0);opacity:0}}.bd-toast.closing{animation:bd-toast-down 200ms ease;animation-fill-mode:forwards;opacity:1;transform:translateY(-10px)}.bd-toast.icon{padding-left:30px;background-size:20px 20px;background-repeat:no-repeat;background-position:6px 50%}.bd-toast.toast-info{background-color:#4a90e2}.bd-toast.toast-info.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtNmgydjZ6bTAtOGgtMlY3aDJ2MnoiLz48L3N2Zz4=)}.bd-toast.toast-success{background-color:#43b581}.bd-toast.toast-success.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}.bd-toast.toast-danger,.bd-toast.toast-error{background-color:#f04747}.bd-toast.toast-danger.icon,.bd-toast.toast-error.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTEyIDJDNi40NyAyIDIgNi40NyAyIDEyczQuNDcgMTAgMTAgMTAgMTAtNC40NyAxMC0xMFMxNy41MyAyIDEyIDJ6bTUgMTMuNTlMMTUuNTkgMTcgMTIgMTMuNDEgOC40MSAxNyA3IDE1LjU5IDEwLjU5IDEyIDcgOC40MSA4LjQxIDcgMTIgMTAuNTkgMTUuNTkgNyAxNyA4LjQxIDEzLjQxIDEyIDE3IDE1LjU5eiIvPiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+)}.bd-toast.toast-warning,.bd-toast.toast-warn{background-color:#ffa600;color:#fff}.bd-toast.toast-warning.icon,.bd-toast.toast-warn.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMSAyMWgyMkwxMiAyIDEgMjF6bTEyLTNoLTJ2LTJoMnYyem0wLTRoLTJ2LTRoMnY0eiIvPjwvc3ZnPg==)}.bd-minimal .divider-32i8lo{opacity:0}.bd-minimal .large-3ChYtB{max-width:20px;max-height:20px;background-size:100%;margin-right:2px;margin-top:0;border-radius:0}.bd-minimal .content-3dzVd8{border-left:2px solid #ebebeb;padding-left:2px}.bd-minimal .theme-dark .content-3dzVd8{border-left:2px solid #303030}.bd-minimal .username-_4ZSMR{font-size:small}.bd-minimal .container-1YxwTf{padding:5px}.bd-minimal .embed-IeVjo6{padding:2px}.bd-minimal .membersWrap-2h-GB4{min-width:0}.bd-minimal .members-1998pB .small-5Os1Bb{max-width:15px;max-height:15px;background-size:15px 15px}.bd-minimal .members-1998pB .small-5Os1Bb .status-oxiHuE{height:5px;width:5px}.bd-minimal .members-1998pB .member-3W1lQa{padding:5px}.bd-minimal .members-1998pB .memberInner-2CPc3V{transform:scale(.9)}.bd-minimal .members-1998pB .membersGroup-v9BXpm{margin-top:3px;transform:scale(.9)}.bd-minimal.bd-minimal-chan .channels-Ie2l6A{display:none}.bd-minimal .channels-Ie2l6A header span{font-size:12px}.bd-minimal .channels-Ie2l6A{width:160px}.bd-minimal .containerDefault-3GGEv_{transform:scale(.9)}.bd-minimal .content-3at_AU{transform:scale(.9)}.bd-minimal .icon-1_QxNX{width:14px;height:14px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px;margin:0 12.5px 8px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .wrapper-25eVIn a,.bd-minimal .listItem-2P_4kh .wrapper-25eVIn .icon-27yU2q{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .listItem-2P_4kh .wrapper-25eVIn{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .listItem-2P_4kh svg,.bd-minimal .listItem-2P_4kh foreignObject[mask]{mask:none}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .homeIcon-tEMBK1{width:10px;height:10px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .circleIconButton-jET_ig{height:20px;width:20px}.bd-minimal .circleIconButton-jET_ig svg{height:14px;width:14px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .friendsOnline-_wi_fM{margin-left:-15px;font-size:7px}.bd-minimal #bd-pub-li{height:16px}.bd-minimal #bd-pub-button{font-size:8px;line-height:16px;height:16px}.bd-minimal .wrapper-1Rf91z,.bd-minimal .wrapper-1Rf91z .scrollerWrap-1IAIlv,.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG{width:45px}.bd-minimal .wrapper-1Rf91z .guildSeparator-3s64Iy{margin-left:-15px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh .wrapper-sa6paO{height:20px;margin-top:0;margin-left:-12.5px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .iconBadge-2wi9r4{width:12px;height:12px;background-size:12px}.bd-minimal .container-2Thooq .avatarSmall-3ACRaI{width:15px;height:15px;background-size:15px 15px}.bd-minimal .container-2Thooq .avatarSmall-3ACRaI .status-oxiHuE{height:5px;width:5px}.bd-minimal .container-2Thooq .accountDetails-3k9g4n{transform:scale(.8)}.bd-minimal .container-2Thooq .button-2b6hmh{height:14px;width:14px;background-size:14px 14px;margin-left:3px}.bd-minimal .container-2Thooq .button-2b6hmh svg{height:14px;width:14px}.bda-dark .theme-dark .root-1gCeng,.bda-dark .theme-dark .theme-light .slide-2pHaq5{background:#36393f}.bda-dark .root-1gCeng .input-1mgnkM{color:#e3e5e8;border-bottom-color:#292b2f}.bda-dark .theme-dark .theme-dark .action-1lSjCi,.bda-dark .theme-dark .theme-light .action-1lSjCi{background:#2f3136}.bda-dark .theme-dark .theme-light .footer-3rDWdC{background:#2f3136;box-shadow:none}.bda-dark .theme-dark .theme-dark .or-3THJsp,.bda-dark .theme-dark .theme-light .or-3THJsp{background:#2f3136;order:2;height:56px;width:56px;top:103px;line-height:56px;left:calc(50% - 29px);border-radius:50%;border:2px solid #484b52}.bda-dark .theme-dark .create-3jownz{order:1}.bda-dark .theme-dark .join-33Tr-7{order:3}.bda-dark .theme-dark .theme-dark .actionIcon-2IISM_,.bda-dark .theme-dark .theme-light .actionIcon-2IISM_{filter:grayscale(100%) brightness(60%)}.bda-dark .theme-dark .theme-light .footer-2yfCgX{background:#2f3136}.bda-dark .theme-dark .regionSelectModal-12e-57{background:#36393f}.bda-dark .theme-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3{background:#2f3136;border:2px solid #484b52} \ No newline at end of file +.bd-loaderv2{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+IDwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyBoZWlnaHQ9IjEwMCUiIHN0eWxl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MjUrMTIwNS45NCsxNDI0Ljc1KzEwODQuNDQrMTM0Ni4zNSs5OTkuOTQyQzE0MjQuNzUrOTE1LjU0MisxNDY5LjI1Kzc5NC4wNDIrMTQ2OS4yNSs2MzEuNDQyWiIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMSIvPiAgICA8L2c+PC9zdmc+)}.bd-loaderv2{position:fixed;bottom:5px;right:5px;z-index:2147483647;display:block;width:20px;height:20px;background-size:100% 100%;animation:bd-loaderv2-animation 1.5s ease-in-out infinite}@keyframes bd-loaderv2-animation{0%{opacity:.05}50%{opacity:.6}to{opacity:.05}}#emote-container{padding:10px}.emote-container{display:inline-block;padding:2px;border-radius:5px;width:30px;height:30px;position:relative}.emote-icon{max-width:100%;max-height:100%;position:absolute;margin:auto;top:0;right:0;bottom:0;left:0;cursor:pointer}.emote.stop-animation{animation:none!important}.emote-container:hover{background:rgba(123,123,123,.37)}.emoteflip,.emotespinflip{transform:scaleX(-1)}.emotespin{animation:1s emote-spin infinite linear}.emote1spin{animation:1s emote-spin-reverse infinite linear}.emotespin2{animation:.5s emote-spin infinite linear}.emote2spin{animation:.5s emote-spin-reverse infinite linear}.emotespin3{animation:.2s emote-spin infinite linear}.emote3spin{animation:.2s emote-spin-reverse infinite linear}.emotepulse{animation:1s emote-pulse infinite linear}.emotetr{transform:translateX(-3px)}.emotebl{transform:translateY(-3px)}.emotebr{transform:translate(-3px,-3px)}.emoteshake{animation:1s emote-shake infinite linear}.emoteflap{transform:scaleY(-1)!important}.emoteshake2{animation:emote-shake2 .3s linear infinite}.emoteshake3{animation:emote-shake3 .1s linear infinite}@keyframes emote-shake2{25%{transform:translate(-1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}75%{transform:translate(1px,-1px)}}@keyframes emote-shake3{25%{transform:translate(-1px,-1px)}50%{transform:translate(-1px,1px)}75%{transform:translate(1px,1px)}75%{transform:translate(1px,-1px)}}@keyframes emote-spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes emote-spin-reverse{0%{transform:rotate(0deg)}to{transform:rotate(-360deg)}}@keyframes emote-pulse{0%{-webkit-transform:scale(1,1)}50%{-webkit-transform:scale(1.2,1.2)}to{-webkit-transform:scale(1,1)}}@keyframes emote-shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}#removemenu{width:auto;background:#505050;position:absolute;z-index:999999;display:none;box-shadow:0 0 2px #000;padding:2px;left:25px;display:block!important;cursor:pointer;color:#fff;position:fixed}#removemenu ul a{text-decoration:none;color:#fff;padding:3px}.emotewrapper{position:relative;display:inline-flex;object-fit:contain;margin:-.1em .05em -.2em .1em;vertical-align:top}.emotewrapper.jumboable{margin-bottom:0;margin-top:.2em;vertical-align:-.3em}.emote{height:1.45em}.emote.jumboable{height:2rem}.emotewrapper:hover .fav{display:block}.fav{display:none;position:absolute;width:15px;height:15px;right:-7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAzFBMVEUAAABQUFBMTExLS0tNTU1MTExNTU1NTU1MTExMTExNTU1LS0tEREBEREBEREBEREBJSUhLS0tLS0tEREBNTU1NTU1NTU1EREArKyhNTU1NTU0AAABMTExKSklMTExNTU1NTU1NTU1KSkpMTExKSkhNTU1KSkpISEZNTU1LS0tAQDxOTk5KSkpLS0tNTU1MTExMTEx/f39MTExMTExLS0pLS0tMTExNTU1NTU1LS0pNTU1NTU1NTU1NTU1NTU1NTUxNTU1NTU1NTUxMTEzB8C/5AAAAOnRSTlMAI8X96oWAgYSF68QBAg0PMCb9BIuLgQUD4N0Bh0mKhZSOQ4gcrKscaW8QRE6fmJyjAshASceG7cIpqQOxTQAAALVJREFUGFddx6FOA0EYAOGZvd07Qm6vVCAAgUUgQEDfX/YZMAigqaFN7iC5tsmPqGPUN/AvUVeoEbGOCElJz08Uzeixqu4AqomVVSNngOVjTqDGZSl3UFtPGV2ot2zaq96YM9p5Ddzcf/nTTAlj+/sNtNu8OcwkIsbPBtrUfMQeEhGQmHbmGIFMwLPzu6UMIwBNgToshgq8Nr2ki+Oy7ebDHp70LRPWB6OZgfWLWei7fJonOOsPCGA9kVlssOoAAAAASUVORK5CYII=);border:0;background-size:100% 100%;background-repeat:no-repeat;background-color:#303030;border-radius:5px;top:-7px;cursor:pointer}.fav.active{background-color:#ff0}.emojiPicker-3m1S-j{box-shadow:none;border-top:none;border-radius:0 0 5px 5px}#bda-qem{border-radius:5px 5px 0 0;background:#2f3136;border-bottom:1px solid rgba(0,0,0,.1)!important;height:30px;display:flex;flex-direction:row;padding-right:1px!important}.theme-light #bda-qem{background:#f2f3f5}#bda-qem button{border-left:1px solid #202225;background:#2f3136;box-shadow:rgba(0,0,0,.1) 1px 0 0 0;flex-grow:1;color:#fff}.theme-light #bda-qem button{border-left:1px solid #efefef;background:0 0;box-shadow:#cecece 1px 0 0 0;color:#000}#bda-qem button:first-child{border-left-color:transparent}#bda-qem button:hover{background:rgba(79,84,92,.16)}.theme-light #bda-qem button:hover{background:#ececec}#bda-qem-twitch{border-radius:5px 0 0 0;order:2}#bda-qem-emojis{border-radius:0 5px 0 0;order:3}#bda-qem-favourite{order:3}#bda-qem button.active,#bda-qem button.active:hover{background-color:#7289da}.theme-light #bda-qem button.active,.theme-light #bda-qem button.active:hover{color:#fff}#bda-qem-twitch-container,#bda-qem-favourite-container{width:384px;height:424px;background-color:#2f3136;border-radius:0 0 5px 5px}.theme-light #bda-qem-twitch-container,.theme-light #bda-qem-favourite-container{background-color:#f2f3f5}#bda-qem-twitch-container .scroller-wrap,#bda-qem-favourite-container .scroller-wrap{height:100%}.emote-menu-inner{padding:5px 0 0 15px}.bda-qme-hidden #bda-qem-emojis{display:none}#bd-pub-li{height:20px;margin-bottom:10px;overflow:hidden}#bd-pub-button{border-radius:4px;background-color:#2f3136;color:#b9bbbe;text-align:center;font-size:12px;line-height:20px;height:20px}.bd-server-card .bd-server-tags{flex:1 1 auto;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:0;line-height:24px;font-size:12px;color:#b9bbbe;font-weight:700;margin-right:10px}.ui-card.ui-card-primary.bd-server-card:first-child{margin-bottom:13px}.ui-card.ui-card-primary.bd-server-card:first-child:after{border:3px solid #7289da;content:"";display:block;position:absolute;left:0;right:0;margin-top:4px}.bd-server-card.bd-server-card-pinned{margin-bottom:15px}.bd-server-card.bd-server-card-pinned:after{background:#3a71c1;content:"";height:3px;width:100%;display:block;margin-top:7px;position:absolute;top:100%}.bd-server-description-container{color:#b9bbbe;min-height:65px;max-height:65px;border-top:1px solid #3f4146;border-bottom:1px solid #3f4146;padding-top:5px;font-size:13px}.bd-server-header{justify-content:space-between;font-weight:600}.bd-server-card{display:flex}.bd-server-content{padding:5px 10px;flex:1}.bd-server-image{min-width:115px;min-height:115px;max-width:115px;max-height:115px}.bd-server-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-right:15px;max-width:330px;flex:1 1 50%}.bd-layer{-ms-flex-direction:column;-webkit-box-direction:normal;-webkit-box-orient:vertical;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;flex-direction:column;left:0;position:absolute;right:0;top:0}#pubslayer .ui-tab-bar-item{color:#b9bbbe;padding-top:6px;padding-bottom:6px;margin-bottom:2px;padding:6px 10px;position:relative;font-size:16px;line-height:20px;border-radius:3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0;font-weight:500;cursor:pointer}#pubslayer .ui-tab-bar-item:hover{color:#f6f6f7;background-color:rgba(186,188,191,.1)}#pubslayer .ui-tab-bar-item.selected{color:#fff;background-color:#7289da}#pubslayer .ui-tab-bar-header{color:#72767d;padding:6px 10px;font-size:12px;line-height:16px;text-transform:uppercase;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:0;font-weight:500}#pubslayer #bd-settings-sidebar .ui-tab-bar-separator{background-color:rgba(114,118,126,.3);margin-left:10px;margin-right:10px;height:1px;margin-bottom:8px;margin-top:8px}#pubslayer h2.ui-form-title{color:#f6f6f7;text-transform:uppercase;font-weight:600}#pubslayer h5.ui-form-title{color:#f6f6f7}#pubslayer button{background:#7289da;color:#fff;font-size:14px;font-weight:500;line-height:16px;padding:2px 16px;border:0;border-radius:3px;transition:background-color .17s ease}#pubslayer button:hover{background-color:#677bc4}#pubslayer input{color:#f6f6f7;background-color:rgba(0,0,0,.1);border-color:rgba(0,0,0,.3);padding:10px;height:30px;border-width:1px;border-style:solid;border-radius:3px;outline:0;transition:background-color .15s ease,border .15s ease}.standardSidebarView-3F1I7i #bd-customcss-attach-controls button,.bd-detached-css-editor #bd-customcss-attach-controls button{margin:0;width:100px;background:#31332b;color:#fff;height:26px;font-weight:600;margin-top:5px;border-radius:3px}.standardSidebarView-3F1I7i #bd-customcss-attach-controls button:hover,.bd-detached-css-editor #bd-customcss-attach-controls button:hover{background:#3b3e44}.contentRegion-3nDuYy #bd-customcss-attach-controls,#bd-customcss-detach-container #bd-customcss-attach-controls{background:#272822;color:#fff;border:0;box-shadow:0 1px 0 0 #2f3129 inset}.contentRegion-3nDuYy #bd-customcss-pane,.contentRegion-3nDuYy #bd-customcss-innerpane,#bd-customcss-detach-container #bd-customcss-pane,#bd-customcss-detach-container #bd-customcss-innerpane{min-height:calc(80vh - 165px)}.standardSidebarView-3F1I7i #editor-detached h3{color:#87909c;font-weight:600;font-size:22px}.standardSidebarView-3F1I7i #editor-detached button{margin:auto;margin-left:calc(50% - 100px);margin-top:20px;background:#7289da;color:#fff;font-weight:600;border-radius:5px;font-size:20px}.editor-wrapper{display:flex}.line-numbers,.ace_editor{line-height:normal;font-family:Consolas,monospace;box-sizing:border-box;height:calc(100vh - 250px);font-size:14px}.line-numbers{white-space:pre;color:gray;padding:10px 5px 0 5px;background:#24262a;overflow:hidden}.ace_editor{width:100%;background:#292b2f;outline:0;color:#fff;padding:10px;resize:none}#bd-customcss-detach-container .editor-wrapper,#bd-customcss-detach-container .line-numbers,#bd-customcss-detach-container .ace_editor{height:100%}.bd-detached-editor .app-2rEoOp{width:70%}.bd-detached-editor #bd-customcss-detach-container{display:block}#bd-customcss-detach-container{display:none;position:absolute;width:30%;top:0;right:0;bottom:0;background-color:#36393e}#bd-customcss-detach-editor{height:calc(100% - 87px)}#bd-customcss-detach-editor #bd-customcss-innerpane,#bd-customcss-detach-editor .CodeMirror{height:100%}#bd-customcss-detach-controls{background:#e8e8e8;border-top:1px solid #adadad;box-shadow:inset 0 1px 0 0 #fff;height:100%;padding:5px}#bd-customcss-detach-controls .checkbox-group li{margin-top:5px;display:inline-block}#bd-customcss-detach-controls button{width:90px;height:30px;margin-top:8px;background-color:#738bd7;color:#fff;font-size:19px}#bd-customcss-detach-controls-buttons{bottom:5px}#editor-detached{margin-top:50px}#editor-detached h3{text-align:center;font-size:30px}#editor-detached .btn{left:50%;margin-left:-100px;margin-top:10px;width:200px;height:60px}#bd-customcss-attach-controls{background:#e8e8e8;border:1px solid #fff;border-top:1px solid #adadad;box-shadow:inset 0 1px 0 0 #fff;height:100%;padding:5px}#bd-customcss-attach-controls .checkbox-group{margin-bottom:0}#bd-customcss-attach-controls .checkbox-group li{margin-top:5px;display:inline-block}#bd-customcss-attach-controls button{margin:0;width:100px}#bd-customcss-detach-container #bd-customcss-detach-controls-buttons button{width:90px;height:30px;margin-top:8px;background-color:#738bd7;color:#fff;font-size:19px}#ace_settingsmenu_container{background:rgba(0,0,0,.7)!important}body #ace_settingsmenu{padding-top:35px}body .ace_closeButton{position:absolute;top:8px;right:12px;z-index:10000;padding:0;cursor:pointer;background:0 0;border:0}body .ace_closeButton::before{content:"✖";color:#36393f}body .ace_closeButton:active{transform:translateY(2px)}.theme-dark div #ace_settingsmenu{color:#f6f6f7;background:#36393f;box-shadow:0 0 0 1px rgba(32,34,37,.6),0 2px 10px 0 rgba(0,0,0,.2)}.theme-dark div #ace_settingsmenu select,.theme-dark div #ace_settingsmenu input[type=text]{color:#f6f6f7;background:#2f3136;border:1px solid #484b52}.theme-dark div .ace_closeButton::before{color:#f6f6f7}#bd-customcss-attach-controls .help-text{margin-top:8px;margin-bottom:3px;font-size:14px}#bd-customcss-attach-controls .help-text .inline{background:#31332b;padding:.2em;margin:-.2em 0;border-radius:3px}.bd-social-logo{opacity:.6}.bd-social-link:hover .bd-social-logo{opacity:1}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper{bottom:0;left:0;position:fixed;background:inherit;right:0;padding:5px}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper span{color:#b9bbbe;font-weight:600;font-size:11px}.standardSidebarView-3F1I7i .bd-versioninfo-wrapper a{font-size:11px}.bd-pfbtn{background:#7289da;color:#fff;border-radius:5px;margin-left:10px}#bd-settings-sidebar .ui-tab-bar-item{font-size:16px;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;flex-shrink:0;padding:6px 10px;border-radius:3px;position:relative;overflow:hidden}#bd-settings-sidebar .ui-tab-bar-item.selected{cursor:default}.theme-dark #bd-settings-sidebar .ui-tab-bar-item{color:#b9bbbe}.theme-dark #bd-settings-sidebar .ui-tab-bar-item:hover{background-color:rgba(185,187,190,.1);color:#f6f6f7}.theme-dark #bd-settings-sidebar .ui-tab-bar-item.selected{background-color:#7289da;color:#fff}.theme-light #bd-settings-sidebar .ui-tab-bar-item{color:#72767d}.theme-light #bd-settings-sidebar .ui-tab-bar-item:hover{background-color:rgba(79,84,92,.1);color:#4f545c}.theme-light #bd-settings-sidebar .ui-tab-bar-item.selected{background-color:#7289da;color:#fff}#bd-settings-sidebar .ui-tab-bar-header{font-size:12px;font-weight:700;line-height:16px;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0;padding:6px 10px;overflow:hidden}.theme-dark #bd-settings-sidebar .ui-tab-bar-header{color:#72767d}.theme-light #bd-settings-sidebar .ui-tab-bar-header{color:#b9bbbe}#bd-settings-sidebar .ui-tab-bar-separator{height:1px;margin:8px 10px}.theme-dark #bd-settings-sidebar .ui-tab-bar-separator{background-color:rgba(114,118,125,.3)}.theme-light #bd-settings-sidebar .ui-tab-bar-separator{background-color:rgba(185,187,190,.3)}.ui-flex{display:flex}#bd-settingspane-container h2.ui-form-title{font-size:16px;font-weight:600;line-height:20px;text-transform:uppercase;display:inline-block;margin-bottom:20px}.theme-dark #bd-settingspane-container h2.ui-form-title{color:#f6f6f7}.theme-light #bd-settingspane-container h2.ui-form-title{color:#4f545c}#bd-settingspane-container .ui-switch-item{flex-direction:column;margin-top:8px}#bd-settingspane-container .ui-switch-item h3{font-size:16px;font-weight:500;line-height:24px;flex:1}.theme-dark #bd-settingspane-container .ui-switch-item h3{color:#f6f6f7}.theme-light #bd-settingspane-container .ui-switch-item h3{color:#4f545c}#bd-settingspane-container .ui-switch-item .style-description{font-size:14px;font-weight:500;line-height:20px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid rgba(114,118,126,.3)}.theme-dark #bd-settingspane-container .ui-switch-item .style-description{color:#72767d}.theme-light #bd-settingspane-container .ui-switch-item .style-description{color:rgba(114,118,125,.6)}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;width:44px;height:24px;display:block;flex:0 0 auto}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper input{position:absolute;opacity:0;cursor:pointer;width:100%;height:100%;z-index:1}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch{background:#7289da;position:absolute;top:0;right:0;bottom:0;left:0;background:#72767d;border-radius:14px;transition:background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch:before{content:"";display:block;width:18px;height:18px;position:absolute;top:3px;left:3px;bottom:3px;background:#f6f6f7;border-radius:10px;transition:all .15s ease;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05)}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch.checked{background:#7289da}#bd-settingspane-container .ui-switch-item .ui-switch-wrapper .ui-switch.checked:before{transform:translateX(20px)}#bd-settingspane-container .scroller-wrap{height:100%}#bd-settingspane-container .scroller-wrap .scroller{display:flex}.content-column .ui-form-title:first-child{margin-top:0}.bd-reload{cursor:pointer;vertical-align:top;fill:#dcddde}.bd-reload:hover{fill:#fff}.bd-reload-header{margin-left:5px}.bd-reload-card{margin-right:5px}.bda-controls{display:flex}.bd-addon-list{user-select:text}.bd-addon-list .bd-addon-card{max-height:175px;margin-bottom:20px;padding:5px 8px;border:1px solid transparent;border-radius:5px;overflow:hidden}.theme-dark .bd-addon-list .bd-addon-card{background-color:rgba(32,34,37,.6);color:#f6f6f7;border-color:#202225}.theme-light .bd-addon-list .bd-addon-card{background-color:#f8f9f9;color:#4f545c;border-color:#dcddde}.bd-addon-list .bd-addon-card.settings-open{max-height:800px;overflow-y:auto}.bd-addon-list .bda-header{font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;padding-bottom:5px;border-bottom:1px solid transparent;overflow:hidden}.theme-dark .bd-addon-list .bda-header{color:#f6f6f7;border-bottom-color:rgba(114,118,125,.3)}.theme-light .bd-addon-list .bda-header{color:#4f545c;border-bottom-color:rgba(185,187,190,.3)}.bd-addon-list .bda-description{word-break:break-word;max-height:100px;margin:5px 0;padding:5px 0;overflow-y:auto}.theme-dark .bd-addon-list .bda-description{color:#b9bbbe}.theme-light .bd-addon-list .bda-description{color:#72767d}.bd-addon-list .scroller::-webkit-scrollbar-track-piece,.bd-addon-list .scroller::-webkit-scrollbar-thumb{border-radius:0!important;border-color:transparent}.bd-addon-list .bda-footer{font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;padding-top:5px;border-top:1px solid transparent;overflow:hidden}.theme-dark .bd-addon-list .bda-footer{border-top-color:rgba(114,118,125,.3)}.theme-light .bd-addon-list .bda-footer{border-top-color:rgba(185,187,190,.3)}.bd-addon-list .bda-footer button{background:#7289da;color:#fff;border-radius:5px;display:block;margin-left:auto;padding:2px 16px;transition:opacity 250ms ease}.bd-addon-list .bda-footer button:disabled{opacity:.4}.bd-addon-list .bda-footer a{color:#7289da}.bd-addon-list .bda-footer a:hover{text-decoration:underline}@keyframes bd-backdrop{to{opacity:.85}}@keyframes bd-modal-wrapper{to{transform:scale(1);opacity:1}}@keyframes bd-backdrop-closing{to{opacity:0}}@keyframes bd-modal-wrapper-closing{to{transform:scale(.7);opacity:0}}.bd-backdrop{animation:bd-backdrop 250ms ease;animation-fill-mode:forwards;opacity:0;background-color:#000;transform:translateZ(0)}.bd-modal-wrapper.closing .bd-backdrop{animation:bd-backdrop-closing 200ms linear;animation-fill-mode:forwards;animation-delay:50ms;opacity:.85}.bd-modal-wrapper.closing .bd-modal{animation:bd-modal-wrapper-closing 250ms cubic-bezier(.19,1,.22,1);animation-fill-mode:forwards;opacity:1;transform:scale(1)}.bd-modal-wrapper .bd-modal{animation:bd-modal-wrapper 250ms cubic-bezier(.175,.885,.32,1.275);animation-fill-mode:forwards;transform:scale(.7);transform-origin:50% 50%;display:flex;align-items:center;box-sizing:border-box;contain:content;justify-content:center;top:0;left:0;bottom:0;right:0;opacity:0;pointer-events:none;position:absolute;z-index:1000}.bd-modal-wrapper .bd-modal-inner{display:flex;contain:layout;flex-direction:column;pointer-events:auto;border:1px solid rgba(28,36,43,.6);border-radius:5px;box-shadow:0 2px 10px 0 rgba(0,0,0,.2);overflow:hidden;max-height:660px;min-height:200px;width:440px;user-select:text}.bd-modal-wrapper .bd-content-modal .bd-modal-inner{height:500px;width:700px}.bd-modal-wrapper .header{background-color:#35393e;box-shadow:0 2px 3px 0 rgba(0,0,0,.2);padding:12px 20px;z-index:1;color:#fff;font-size:16px;font-weight:700;line-height:19px}.bd-modal-wrapper .bd-modal-body{background-color:#36393f;color:#fff;flex-direction:row;overflow:hidden;display:flex;flex-direction:column;flex:1;contain:layout;position:relative}.bd-modal-wrapper .scroller{padding:10px}.bd-modal-wrapper .bd-content-modal .bd-modal-body{padding:0}.bd-modal-wrapper .scroller{overflow-y:auto}.bd-modal-wrapper .footer{display:flex;justify-content:flex-end;padding:10px 20px}.bd-modal-wrapper .footer button{background-color:#7289da;color:#fff;min-height:32px;min-width:60px;align-items:center;border-radius:3px;display:flex;font-size:14px;font-weight:500;justify-content:center;line-height:16px;padding:2px 16px;user-select:none}.bd-modal-wrapper .footer button:hover{background-color:#677bc4}.bd-modal-wrapper .footer button:active{background-color:#5f6fb9}.bd-modal-wrapper .tab-bar-container{align-items:center;border-bottom:0;background:rgba(0,0,0,.2);box-shadow:0 2px 3px 0 rgba(0,0,0,.1);display:flex;flex-direction:row;justify-content:space-between;margin-bottom:15px}.bd-modal-wrapper .tab-bar.TOP{margin:0;border:0;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.bd-modal-wrapper .tab-bar-container .tab-bar-item{margin:0 15px;padding:15px 0;color:#fff!important;opacity:.5;transition:opacity 200ms ease;border-bottom:2px solid transparent}.bd-modal-wrapper .tab-bar-container .tab-bar-item:hover{border-color:#fff;cursor:pointer}.bd-modal-wrapper .tab-bar-container .tab-bar-item.selected{opacity:1;border-color:#fff}.bd-modal-wrapper .tab-bar.TOP .tab-bar-item+.tab-bar-item{margin:0}.bd-modal-wrapper .table-header{display:flex;justify-content:space-between;color:#fff;font-weight:700;padding-bottom:10px;margin:3px 15px 0 15px;border-bottom:1px solid #fff;font-size:14px}.bd-modal-wrapper .table-column{width:25%}.bd-modal-wrapper .table-column.column-error{width:50%}.bd-modal-wrapper .table-column{word-wrap:break-word}.bd-modal-wrapper .errors{display:flex;flex-direction:column;padding:0;font-size:14px;padding:0 5px}.bd-modal-wrapper .error{display:flex;color:#fff;border-bottom:1px solid rgba(255,255,255,.25);padding:15px 0;align-items:center}.bd-modal-wrapper .bd-content-modal .scroller{padding-top:0}.bd-toasts{position:fixed;display:flex;top:0;flex-direction:column;align-items:center;justify-content:flex-end;pointer-events:none;z-index:4000}@keyframes bd-toast-up{0%{transform:translateY(0);opacity:0}}.bd-toast{animation:bd-toast-up 300ms ease;transform:translateY(-10px);background:#36393f;padding:10px;border-radius:5px;box-shadow:0 0 0 1px rgba(32,34,37,.6),0 2px 10px 0 rgba(0,0,0,.2);font-weight:500;color:#fff;user-select:text;font-size:14px;opacity:1;margin-top:10px;pointer-events:none;user-select:none}@keyframes bd-toast-down{to{transform:translateY(0);opacity:0}}.bd-toast.closing{animation:bd-toast-down 200ms ease;animation-fill-mode:forwards;opacity:1;transform:translateY(-10px)}.bd-toast.icon{padding-left:30px;background-size:20px 20px;background-repeat:no-repeat;background-position:6px 50%}.bd-toast.toast-info{background-color:#4a90e2}.bd-toast.toast-info.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtNmgydjZ6bTAtOGgtMlY3aDJ2MnoiLz48L3N2Zz4=)}.bd-toast.toast-success{background-color:#43b581}.bd-toast.toast-success.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}.bd-toast.toast-danger,.bd-toast.toast-error{background-color:#f04747}.bd-toast.toast-danger.icon,.bd-toast.toast-error.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTEyIDJDNi40NyAyIDIgNi40NyAyIDEyczQuNDcgMTAgMTAgMTAgMTAtNC40NyAxMC0xMFMxNy41MyAyIDEyIDJ6bTUgMTMuNTlMMTUuNTkgMTcgMTIgMTMuNDEgOC40MSAxNyA3IDE1LjU5IDEwLjU5IDEyIDcgOC40MSA4LjQxIDcgMTIgMTAuNTkgMTUuNTkgNyAxNyA4LjQxIDEzLjQxIDEyIDE3IDE1LjU5eiIvPiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+PC9zdmc+)}.bd-toast.toast-warning,.bd-toast.toast-warn{background-color:#ffa600;color:#fff}.bd-toast.toast-warning.icon,.bd-toast.toast-warn.icon{background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNMSAyMWgyMkwxMiAyIDEgMjF6bTEyLTNoLTJ2LTJoMnYyem0wLTRoLTJ2LTRoMnY0eiIvPjwvc3ZnPg==)}.bd-minimal .divider-32i8lo{opacity:0}.bd-minimal .large-3ChYtB{max-width:20px;max-height:20px;background-size:100%;margin-right:2px;margin-top:0;border-radius:0}.bd-minimal .content-3dzVd8{border-left:2px solid #ebebeb;padding-left:2px}.bd-minimal .theme-dark .content-3dzVd8{border-left:2px solid #303030}.bd-minimal .username-_4ZSMR{font-size:small}.bd-minimal .container-1YxwTf{padding:5px}.bd-minimal .embed-IeVjo6{padding:2px}.bd-minimal .membersWrap-2h-GB4{min-width:0}.bd-minimal .members-1998pB .small-5Os1Bb{max-width:15px;max-height:15px;background-size:15px 15px}.bd-minimal .members-1998pB .small-5Os1Bb .status-oxiHuE{height:5px;width:5px}.bd-minimal .members-1998pB .member-3W1lQa{padding:5px}.bd-minimal .members-1998pB .memberInner-2CPc3V{transform:scale(.9)}.bd-minimal .members-1998pB .membersGroup-v9BXpm{margin-top:3px;transform:scale(.9)}.bd-minimal.bd-minimal-chan .channels-Ie2l6A{display:none}.bd-minimal .channels-Ie2l6A header span{font-size:12px}.bd-minimal .channels-Ie2l6A{width:160px}.bd-minimal .containerDefault-3GGEv_{transform:scale(.9)}.bd-minimal .content-3at_AU{transform:scale(.9)}.bd-minimal .icon-1_QxNX{width:14px;height:14px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px;margin:0 12.5px 8px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .wrapper-25eVIn a,.bd-minimal .listItem-2P_4kh .wrapper-25eVIn .icon-27yU2q{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .listItem-2P_4kh .wrapper-25eVIn{width:20px;height:20px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .listItem-2P_4kh svg,.bd-minimal .listItem-2P_4kh foreignObject[mask]{mask:none}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .homeIcon-tEMBK1{width:10px;height:10px;background-size:100%;font-size:15px;line-height:20px}.bd-minimal .circleIconButton-jET_ig{height:20px;width:20px}.bd-minimal .circleIconButton-jET_ig svg{height:14px;width:14px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .friendsOnline-_wi_fM{margin-left:-15px;font-size:7px}.bd-minimal #bd-pub-li{height:16px}.bd-minimal #bd-pub-button{font-size:8px;line-height:16px;height:16px}.bd-minimal .wrapper-1Rf91z,.bd-minimal .wrapper-1Rf91z .scrollerWrap-1IAIlv,.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG{width:45px}.bd-minimal .wrapper-1Rf91z .guildSeparator-3s64Iy{margin-left:-15px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .listItem-2P_4kh .wrapper-sa6paO{height:20px;margin-top:0;margin-left:-12.5px}.bd-minimal .wrapper-1Rf91z .scroller-2FKFPG .iconBadge-2wi9r4{width:12px;height:12px;background-size:12px}.bd-minimal .container-2Thooq .avatarSmall-3ACRaI{width:15px;height:15px;background-size:15px 15px}.bd-minimal .container-2Thooq .avatarSmall-3ACRaI .status-oxiHuE{height:5px;width:5px}.bd-minimal .container-2Thooq .accountDetails-3k9g4n{transform:scale(.8)}.bd-minimal .container-2Thooq .button-2b6hmh{height:14px;width:14px;background-size:14px 14px;margin-left:3px}.bd-minimal .container-2Thooq .button-2b6hmh svg{height:14px;width:14px}.bda-dark .theme-dark .root-1gCeng,.bda-dark .theme-dark .theme-light .slide-2pHaq5{background:#36393f}.bda-dark .root-1gCeng .input-1mgnkM{color:#e3e5e8;border-bottom-color:#292b2f}.bda-dark .theme-dark .theme-dark .action-1lSjCi,.bda-dark .theme-dark .theme-light .action-1lSjCi{background:#2f3136}.bda-dark .theme-dark .theme-light .footer-3rDWdC{background:#2f3136;box-shadow:none}.bda-dark .theme-dark .theme-dark .or-3THJsp,.bda-dark .theme-dark .theme-light .or-3THJsp{background:#2f3136;order:2;height:56px;width:56px;top:103px;line-height:56px;left:calc(50% - 29px);border-radius:50%;border:2px solid #484b52}.bda-dark .theme-dark .create-3jownz{order:1}.bda-dark .theme-dark .join-33Tr-7{order:3}.bda-dark .theme-dark .theme-dark .actionIcon-2IISM_,.bda-dark .theme-dark .theme-light .actionIcon-2IISM_{filter:grayscale(100%) brightness(60%)}.bda-dark .theme-dark .theme-light .footer-2yfCgX{background:#2f3136}.bda-dark .theme-dark .regionSelectModal-12e-57{background:#36393f}.bda-dark .theme-dark .regionSelectModal-12e-57 .regionSelectModalOption-2DSIZ3{background:#2f3136;border:2px solid #484b52}.bd-switch{background-color:#72767d;border-radius:14px;width:42px;height:24px;opacity:1;overflow:hidden;user-select:none;position:relative;display:block;flex:0 0 auto;transition:background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out,opacity .15s ease-in-out;margin-left:10px;box-shadow:inset 0 1px 1px rgba(0,0,0,.15)}.bd-switch::before{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;z-index:0;opacity:0;background-color:#000}.bd-switch::after{content:"";display:block;position:absolute;background-color:#fff;z-index:1;width:18px;margin:3px;border-radius:9px;height:18px;left:0;transition:transform .15s ease-in-out,width .1s ease-in-out,left .1s ease-in-out;box-shadow:0 2px 4px rgba(0,0,0,.3)}.bd-switch .bd-checkbox{position:absolute;width:100%;height:100%;opacity:0;padding:0;margin:0;z-index:2;cursor:pointer}.bd-switch-checked{background-color:#3e82e5}.bd-switch-checked::after{transform:translate3d(18px,0,0)}.bd-switch-disabled{opacity:.3;cursor:not-allowed}.bd-addon-button{cursor:pointer}.bd-addon-button+.bd-addon-button{margin-left:5px}.bd-addon-controls{display:flex;align-items:center;justify-content:space-between}.bd-addon-controls .bd-search{font-size:13px;margin:0;width:200px}.bd-addon-dropdowns{display:flex}.bd-select-wrapper+.bd-select-wrapper{margin-left:10px}.bd-select-wrapper{color:#f6f6f7;font-size:13px;display:flex;align-items:center}.bd-select-wrapper label{opacity:.3;margin-right:5px}.bd-select{position:relative;cursor:pointer;color:#f6f6f7;font-size:13px;display:flex;align-items:center;justify-content:space-between;background-color:rgba(0,0,0,.1);border:1px solid rgba(0,0,0,.3);border-radius:3px;padding:5px 5px 5px 0}.bd-select.bd-select-transparent{background:0 0;border:0;padding:0}.bd-select-value{padding-left:12px}.bd-select-arrow{margin-left:10px}.bd-select .bd-select-options{position:absolute;background:#2f3136;border-radius:0 0 3px 3px;max-height:300px;min-width:calc(100% + 2px);overflow-y:auto;box-shadow:rgba(0,0,0,.3) 0 1px 5px 0;border:1px solid rgba(0,0,0,.3);border-top:0;margin-top:-1px;margin-left:-1px;z-index:3;top:100%}.bd-select-transparent .bd-select-options{border:1px solid rgba(0,0,0,.3);margin-top:3px;border-radius:3px}.bd-select .bd-select-option{padding:8px 12px;cursor:pointer;white-space:pre}.bd-select .bd-select-option:hover,.bd-select .bd-select-option.selected{background:#26272b}.bd-search-wrapper{padding:3px;border-radius:3px;outline:0;border:0;background-color:#202225;color:#fff;display:flex;align-items:center}.bd-search{padding:2px 3px;background:0 0;border:0;color:#fff;flex:1}.bd-search-wrapper>svg{margin-right:2px} \ No newline at end of file diff --git a/js/main.js b/js/main.js index a9d5ff1b..b5579dd8 100644 --- a/js/main.js +++ b/js/main.js @@ -203,7 +203,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0gl /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n\n\nconst path = __webpack_require__(/*! path */ \"path\");\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst Module = __webpack_require__(/*! module */ \"module\").Module;\n\nModule.globalPaths.push(path.resolve(__webpack_require__(/*! electron */ \"electron\").remote.app.getAppPath(), \"node_modules\"));\n\nclass MetaError extends Error {\n constructor(message) {\n super(message);\n this.name = \"MetaError\";\n }\n\n}\n\nconst originalJSRequire = Module._extensions[\".js\"];\nconst originalCSSRequire = Module._extensions[\".css\"] ? Module._extensions[\".css\"] : () => {\n return null;\n};\nconst splitRegex = /[^\\S\\r\\n]*?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class ContentManager {\n constructor() {\n this.timeCache = {};\n this.watchers = {};\n Module._extensions[\".js\"] = this.getContentRequire(\"plugin\");\n Module._extensions[\".css\"] = this.getContentRequire(\"theme\");\n }\n\n get pluginsFolder() {\n return this._pluginsFolder || (this._pluginsFolder = fs.realpathSync(path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath + \"plugins/\")));\n }\n\n get themesFolder() {\n return this._themesFolder || (this._themesFolder = fs.realpathSync(path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath + \"themes/\")));\n }\n\n watchContent(contentType) {\n if (this.watchers[contentType]) return;\n const isPlugin = contentType === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n this.watchers[contentType] = fs.watch(baseFolder, {\n persistent: false\n }, async (eventType, filename) => {\n if (!eventType || !filename || !filename.endsWith(fileEnding)) return;\n await new Promise(r => setTimeout(r, 50));\n\n try {\n fs.statSync(path.resolve(baseFolder, filename));\n } catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete this.timeCache[filename];\n if (isPlugin) return _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadPlugin(filename);\n return _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].unloadTheme(filename);\n }\n\n if (!fs.statSync(path.resolve(baseFolder, filename)).isFile()) return;\n const stats = fs.statSync(path.resolve(baseFolder, filename));\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof stats.mtime.getTime() !== \"number\") return;\n if (this.timeCache[filename] == stats.mtime.getTime()) return;\n this.timeCache[filename] = stats.mtime.getTime();\n\n if (eventType == \"rename\") {\n if (isPlugin) _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadPlugin(filename);else _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadTheme(filename);\n }\n\n if (eventType == \"change\") {\n if (isPlugin) _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadPlugin(filename);else _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reloadTheme(filename);\n }\n });\n }\n\n unwatchContent(contentType) {\n if (!this.watchers[contentType]) return;\n this.watchers[contentType].close();\n delete this.watchers[contentType];\n }\n\n extractMeta(content) {\n const firstLine = content.split(\"\\n\")[0];\n const hasOldMeta = firstLine.includes(\"//META\");\n if (hasOldMeta) return this.parseOldMeta(content);\n const hasNewMeta = firstLine.includes(\"/**\");\n if (hasNewMeta) return this.parseNewMeta(content);\n throw new MetaError(\"META was not found.\");\n }\n\n parseOldMeta(content) {\n const meta = content.split(\"\\n\")[0];\n const rawMeta = meta.substring(meta.lastIndexOf(\"//META\") + 6, meta.lastIndexOf(\"*//\"));\n if (meta.indexOf(\"META\") < 0) throw new MetaError(\"META was not found.\");\n const parsed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].testJSON(rawMeta);\n if (!parsed) throw new MetaError(\"META could not be parsed.\");\n if (!parsed.name) throw new MetaError(\"META missing name data.\");\n parsed.format = \"json\";\n return parsed;\n }\n\n parseNewMeta(content) {\n const block = content.split(\"/**\", 2)[1].split(\"*/\", 1)[0];\n const out = {};\n let field = \"\";\n let accum = \"\";\n\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n out[field] = accum;\n const l = line.indexOf(\" \");\n field = line.substr(1, l - 1);\n accum = line.substr(l + 1);\n } else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n\n out[field] = accum.trim();\n delete out[\"\"];\n out.format = \"jsdoc\";\n return out;\n }\n\n getContentRequire(type) {\n const isPlugin = type === \"plugin\";\n const self = this;\n const originalRequire = isPlugin ? originalJSRequire : originalCSSRequire;\n return function (module, filename) {\n const baseFolder = isPlugin ? self.pluginsFolder : self.themesFolder;\n const possiblePath = path.resolve(baseFolder, path.basename(filename));\n if (!fs.existsSync(possiblePath) || filename !== fs.realpathSync(possiblePath)) return Reflect.apply(originalRequire, this, arguments);\n let content = fs.readFileSync(filename, \"utf8\");\n content = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].stripBOM(content);\n const meta = self.extractMeta(content);\n meta.filename = path.basename(filename);\n\n if (!isPlugin) {\n meta.css = content;\n if (meta.format == \"json\") meta.css = meta.css.split(\"\\n\").slice(1).join(\"\\n\");\n content = `module.exports = ${JSON.stringify(meta)};`;\n }\n\n if (isPlugin) {\n module._compile(content, module.filename);\n\n const didExport = !_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isEmpty(module.exports);\n\n if (didExport) {\n meta.type = module.exports;\n module.exports = meta;\n content = \"\";\n } else {\n content += `\\nmodule.exports = ${JSON.stringify(meta)};\\nmodule.exports.type = ${meta.exports || meta.name};`;\n }\n }\n\n module._compile(content, filename);\n };\n }\n\n makePlaceholderPlugin(data) {\n return {\n plugin: {\n start: () => {},\n getName: () => {\n return data.name || data.filename;\n },\n getAuthor: () => {\n return \"???\";\n },\n getDescription: () => {\n return data.message ? data.message : \"This plugin was unable to be loaded. Check the author's page for updates.\";\n },\n getVersion: () => {\n return \"???\";\n }\n },\n name: data.name || data.filename,\n filename: data.filename,\n source: data.source ? data.source : \"\",\n website: data.website ? data.website : \"\"\n };\n }\n\n loadContent(filename, type) {\n if (typeof filename === \"undefined\" || typeof type === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n require(path.resolve(baseFolder, filename));\n } catch (error) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be compiled.\",\n error: {\n message: error.message,\n stack: error.stack\n }\n };\n }\n\n const content = require(path.resolve(baseFolder, filename));\n\n content.id = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].escapeID(content.name);\n\n if (isPlugin) {\n if (!content.type) return;\n\n try {\n content.plugin = new content.type();\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][content.plugin.getName()];\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][content.plugin.getName()] = content;\n } catch (error) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be constructed.\",\n error: {\n message: error.message,\n stack: error.stack\n }\n };\n }\n } else {\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][content.name];\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][content.name] = content;\n }\n }\n\n unloadContent(filename, type) {\n if (typeof filename === \"undefined\" || typeof type === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n delete require.cache[require.resolve(path.resolve(baseFolder, filename))];\n } catch (err) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be unloaded.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n };\n }\n }\n\n isLoaded(filename, type) {\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n require.cache[require.resolve(path.resolve(baseFolder, filename))];\n } catch (err) {\n return false;\n }\n\n return true;\n }\n\n reloadContent(filename, type) {\n const cantUnload = this.unloadContent(filename, type);\n if (cantUnload) return cantUnload;\n return this.loadContent(filename, type);\n }\n\n loadNewContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const files = fs.readdirSync(basedir);\n const contentList = Object.values(isPlugin ? _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"] : _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n const removed = contentList.filter(t => !files.includes(t.filename)).map(c => isPlugin ? c.plugin.getName() : c.name);\n const added = files.filter(f => !contentList.find(t => t.filename == f) && f.endsWith(fileEnding) && fs.statSync(path.resolve(basedir, f)).isFile());\n return {\n added,\n removed\n };\n }\n\n loadAllContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const errors = [];\n const files = fs.readdirSync(basedir);\n\n for (const filename of files) {\n if (!fs.statSync(path.resolve(basedir, filename)).isFile() || !filename.endsWith(fileEnding)) continue;\n const error = this.loadContent(filename, type);\n if (error) errors.push(error);\n }\n\n return errors;\n }\n\n loadPlugins() {\n return this.loadAllContent(\"plugin\");\n }\n\n loadThemes() {\n return this.loadAllContent(\"theme\");\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9jb250ZW50TWFuYWdlci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvbW9kdWxlcy9jb250ZW50TWFuYWdlci5qcz80ZWIwIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGJkQ29uZmlnLCBiZHBsdWdpbnMsIGJkdGhlbWVzIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgcGx1Z2luTW9kdWxlIGZ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webpack-internal:///./src/modules/contentManager.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n\n\nconst path = __webpack_require__(/*! path */ \"path\");\n\nconst fs = __webpack_require__(/*! fs */ \"fs\");\n\nconst Module = __webpack_require__(/*! module */ \"module\").Module;\n\nModule.globalPaths.push(path.resolve(__webpack_require__(/*! electron */ \"electron\").remote.app.getAppPath(), \"node_modules\"));\n\nclass MetaError extends Error {\n constructor(message) {\n super(message);\n this.name = \"MetaError\";\n }\n\n}\n\nconst originalJSRequire = Module._extensions[\".js\"];\nconst originalCSSRequire = Module._extensions[\".css\"] ? Module._extensions[\".css\"] : () => {\n return null;\n};\nconst splitRegex = /[^\\S\\r\\n]*?(?:\\r\\n|\\n)[^\\S\\r\\n]*?\\*[^\\S\\r\\n]?/;\nconst escapedAtRegex = /^\\\\@/;\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class ContentManager {\n constructor() {\n this.timeCache = {};\n this.watchers = {};\n Module._extensions[\".js\"] = this.getContentRequire(\"plugin\");\n Module._extensions[\".css\"] = this.getContentRequire(\"theme\");\n }\n\n get pluginsFolder() {\n return this._pluginsFolder || (this._pluginsFolder = fs.realpathSync(path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath + \"plugins/\")));\n }\n\n get themesFolder() {\n return this._themesFolder || (this._themesFolder = fs.realpathSync(path.resolve(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdConfig\"].dataPath + \"themes/\")));\n }\n\n watchContent(contentType) {\n if (this.watchers[contentType]) return;\n const isPlugin = contentType === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n this.watchers[contentType] = fs.watch(baseFolder, {\n persistent: false\n }, async (eventType, filename) => {\n if (!eventType || !filename || !filename.endsWith(fileEnding)) return;\n await new Promise(r => setTimeout(r, 50));\n\n try {\n fs.statSync(path.resolve(baseFolder, filename));\n } catch (err) {\n if (err.code !== \"ENOENT\") return;\n delete this.timeCache[filename];\n if (isPlugin) return _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadPlugin(filename);\n return _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].unloadTheme(filename);\n }\n\n if (!fs.statSync(path.resolve(baseFolder, filename)).isFile()) return;\n const stats = fs.statSync(path.resolve(baseFolder, filename));\n if (!stats || !stats.mtime || !stats.mtime.getTime()) return;\n if (typeof stats.mtime.getTime() !== \"number\") return;\n if (this.timeCache[filename] == stats.mtime.getTime()) return;\n this.timeCache[filename] = stats.mtime.getTime();\n\n if (eventType == \"rename\") {\n if (isPlugin) _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadPlugin(filename);else _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].loadTheme(filename);\n }\n\n if (eventType == \"change\") {\n if (isPlugin) _pluginModule__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadPlugin(filename);else _themeModule__WEBPACK_IMPORTED_MODULE_2__[\"default\"].reloadTheme(filename);\n }\n });\n }\n\n unwatchContent(contentType) {\n if (!this.watchers[contentType]) return;\n this.watchers[contentType].close();\n delete this.watchers[contentType];\n }\n\n extractMeta(content) {\n const firstLine = content.split(\"\\n\")[0];\n const hasOldMeta = firstLine.includes(\"//META\");\n if (hasOldMeta) return this.parseOldMeta(content);\n const hasNewMeta = firstLine.includes(\"/**\");\n if (hasNewMeta) return this.parseNewMeta(content);\n throw new MetaError(\"META was not found.\");\n }\n\n parseOldMeta(content) {\n const meta = content.split(\"\\n\")[0];\n const rawMeta = meta.substring(meta.lastIndexOf(\"//META\") + 6, meta.lastIndexOf(\"*//\"));\n if (meta.indexOf(\"META\") < 0) throw new MetaError(\"META was not found.\");\n const parsed = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].testJSON(rawMeta);\n if (!parsed) throw new MetaError(\"META could not be parsed.\");\n if (!parsed.name) throw new MetaError(\"META missing name data.\");\n parsed.format = \"json\";\n return parsed;\n }\n\n parseNewMeta(content) {\n const block = content.split(\"/**\", 2)[1].split(\"*/\", 1)[0];\n const out = {};\n let field = \"\";\n let accum = \"\";\n\n for (const line of block.split(splitRegex)) {\n if (line.length === 0) continue;\n\n if (line.charAt(0) === \"@\" && line.charAt(1) !== \" \") {\n out[field] = accum;\n const l = line.indexOf(\" \");\n field = line.substr(1, l - 1);\n accum = line.substr(l + 1);\n } else {\n accum += \" \" + line.replace(\"\\\\n\", \"\\n\").replace(escapedAtRegex, \"@\");\n }\n }\n\n out[field] = accum.trim();\n delete out[\"\"];\n out.format = \"jsdoc\";\n return out;\n }\n\n getContentRequire(type) {\n const isPlugin = type === \"plugin\";\n const self = this;\n const originalRequire = isPlugin ? originalJSRequire : originalCSSRequire;\n return function (module, filename) {\n const baseFolder = isPlugin ? self.pluginsFolder : self.themesFolder;\n const possiblePath = path.resolve(baseFolder, path.basename(filename));\n if (!fs.existsSync(possiblePath) || filename !== fs.realpathSync(possiblePath)) return Reflect.apply(originalRequire, this, arguments);\n let content = fs.readFileSync(filename, \"utf8\");\n content = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].stripBOM(content);\n const stats = fs.statSync(filename);\n const meta = self.extractMeta(content);\n meta.filename = path.basename(filename);\n meta.added = stats.atimeMs;\n meta.modified = stats.mtimeMs;\n meta.size = stats.size;\n\n if (!isPlugin) {\n meta.css = content;\n if (meta.format == \"json\") meta.css = meta.css.split(\"\\n\").slice(1).join(\"\\n\");\n content = `module.exports = ${JSON.stringify(meta)};`;\n }\n\n if (isPlugin) {\n module._compile(content, module.filename);\n\n const didExport = !_utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isEmpty(module.exports);\n\n if (didExport) {\n meta.type = module.exports;\n module.exports = meta;\n content = \"\";\n } else {\n content += `\\nmodule.exports = ${JSON.stringify(meta)};\\nmodule.exports.type = ${meta.exports || meta.name};`;\n }\n }\n\n module._compile(content, filename);\n };\n }\n\n makePlaceholderPlugin(data) {\n return {\n plugin: {\n start: () => {},\n getName: () => {\n return data.name || data.filename;\n },\n getAuthor: () => {\n return \"???\";\n },\n getDescription: () => {\n return data.message ? data.message : \"This plugin was unable to be loaded. Check the author's page for updates.\";\n },\n getVersion: () => {\n return \"???\";\n }\n },\n name: data.name || data.filename,\n filename: data.filename,\n source: data.source ? data.source : \"\",\n website: data.website ? data.website : \"\"\n };\n }\n\n loadContent(filename, type) {\n if (typeof filename === \"undefined\" || typeof type === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n require(path.resolve(baseFolder, filename));\n } catch (error) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be compiled.\",\n error: {\n message: error.message,\n stack: error.stack\n }\n };\n }\n\n const content = require(path.resolve(baseFolder, filename));\n\n content.id = _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].escapeID(content.name);\n\n if (isPlugin) {\n if (!content.type) return;\n\n try {\n content.plugin = new content.type();\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][content.plugin.getName()];\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][content.plugin.getName()] = content;\n } catch (error) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be constructed.\",\n error: {\n message: error.message,\n stack: error.stack\n }\n };\n }\n } else {\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][content.name];\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][content.name] = content;\n }\n }\n\n unloadContent(filename, type) {\n if (typeof filename === \"undefined\" || typeof type === \"undefined\") return;\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n delete require.cache[require.resolve(path.resolve(baseFolder, filename))];\n } catch (err) {\n return {\n name: filename,\n file: filename,\n message: \"Could not be unloaded.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n };\n }\n }\n\n isLoaded(filename, type) {\n const isPlugin = type === \"plugin\";\n const baseFolder = isPlugin ? this.pluginsFolder : this.themesFolder;\n\n try {\n require.cache[require.resolve(path.resolve(baseFolder, filename))];\n } catch (err) {\n return false;\n }\n\n return true;\n }\n\n reloadContent(filename, type) {\n const cantUnload = this.unloadContent(filename, type);\n if (cantUnload) return cantUnload;\n return this.loadContent(filename, type);\n }\n\n loadNewContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const files = fs.readdirSync(basedir);\n const contentList = Object.values(isPlugin ? _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"] : _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n const removed = contentList.filter(t => !files.includes(t.filename)).map(c => isPlugin ? c.plugin.getName() : c.name);\n const added = files.filter(f => !contentList.find(t => t.filename == f) && f.endsWith(fileEnding) && fs.statSync(path.resolve(basedir, f)).isFile());\n return {\n added,\n removed\n };\n }\n\n loadAllContent(type) {\n const isPlugin = type === \"plugin\";\n const fileEnding = isPlugin ? \".plugin.js\" : \".theme.css\";\n const basedir = isPlugin ? this.pluginsFolder : this.themesFolder;\n const errors = [];\n const files = fs.readdirSync(basedir);\n\n for (const filename of files) {\n if (!fs.statSync(path.resolve(basedir, filename)).isFile() || !filename.endsWith(fileEnding)) continue;\n const error = this.loadContent(filename, type);\n if (error) errors.push(error);\n }\n\n return errors;\n }\n\n loadPlugins() {\n return this.loadAllContent(\"plugin\");\n }\n\n loadThemes() {\n return this.loadAllContent(\"theme\");\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9jb250ZW50TWFuYWdlci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0NvcmUvLi9zcmMvbW9kdWxlcy9jb250ZW50TWFuYWdlci5qcz80ZWIwIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGJkQ29uZmlnLCBiZHBsdWdpbnMsIGJkdGhlbWVzIH0gZnJvbSBcIi4uLzBnbG9iYWxzXCI7XG5pbXBvcnQgcGx1Z2luTW9kdWxlIGZyb20gXCIuL3BsdWdpbk1vZHVsZVwiO1xuaW1wb3J0IHRoZW1lTW9kdWxlIGZyb20gXCIuL3RoZW1lTW9kdWxlXCI7XG5pbXBvcnQgVXRpbHMgZnJvbSBcIi4vdXRpbHNcIjtcblxuY29uc3QgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xuXG5jb25zdCBmcyA9IHJlcXVpcmUoXCJmc1wiKTtcblxuY29uc3QgTW9kdWxlID0gcmVxdWlyZShcIm1vZHVsZVwiKS5Nb2R1bGU7XG5cbk1vZHVsZS5nbG9iYWxQYXRocy5wdXNoKHBhdGgucmVzb2x2ZShyZXF1aXJlKFwiZWxlY3Ryb25cIikucmVtb3RlLmFwcC5nZXRBcHBQYXRoKCksIFwibm9kZV9tb2R1bGVzXCIpKTtcblxuY2xhc3MgTWV0YUVycm9yIGV4dGVuZHMgRXJyb3Ige1xuICBjb25zdHJ1Y3RvcihtZXNzYWdlKSB7XG4gICAgc3VwZXIobWVzc2FnZSk7XG4gICAgdGhpcy5uYW1lID0gXCJNZXRhRXJyb3JcIjtcbiAgfVxuXG59XG5cbmNvbnN0IG9ya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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/contentManager.js\n"); /***/ }), @@ -263,7 +263,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0gl /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n\n\n\nfunction PluginModule() {}\n\nPluginModule.prototype.loadPlugins = function () {\n this.loadPluginData();\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].concat(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadPlugins());\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n let plugin, name;\n\n try {\n plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n name = plugin.getName();\n if (plugin.load && typeof plugin.load == \"function\") plugin.load();\n } catch (err) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", name + \" could not be loaded.\", err);\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].push({\n name: name,\n file: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].filename,\n message: \"load() could not be fired.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n });\n continue;\n }\n\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name]) _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name]) {\n try {\n plugin.start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin.getName()} v${plugin.getVersion()} has started.`);\n } catch (err) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", name + \" could not be started.\", err);\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].push({\n name: name,\n file: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].filename,\n message: \"start() could not be fired.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n });\n }\n }\n }\n\n this.savePluginData();\n\n __webpack_require__(/*! electron */ \"electron\").remote.getCurrentWebContents().on(\"did-navigate-in-page\", this.channelSwitch.bind(this)); // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"plugin\");\n\n};\n\nPluginModule.prototype.startPlugin = function (plugin, reload = false) {\n try {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} has started.`);\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} could not be started.`, {\n type: \"error\"\n });\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = false;\n this.savePluginData();\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", plugin + \" could not be started.\", err);\n }\n};\n\nPluginModule.prototype.stopPlugin = function (plugin, reload = false) {\n try {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.stop();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} has stopped.`);\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} could not be stopped.`, {\n type: \"error\"\n });\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName() + \" could not be stopped.\", err);\n }\n};\n\nPluginModule.prototype.enablePlugin = function (plugin, reload = false) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) return;\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = true;\n this.savePluginData();\n this.startPlugin(plugin, reload);\n};\n\nPluginModule.prototype.enable = function (plugin, reload = false) {\n return this.enablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.disablePlugin = function (plugin, reload = false) {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) return;\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = false;\n this.savePluginData();\n this.stopPlugin(plugin, reload);\n};\n\nPluginModule.prototype.disable = function (plugin, reload = false) {\n return this.disablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.togglePlugin = function (plugin) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) this.disablePlugin(plugin);else this.enablePlugin(plugin);\n};\n\nPluginModule.prototype.loadPlugin = function (filename) {\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadContent(filename, \"plugin\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${filename} could not be loaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n\n const plugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filename).plugin;\n\n try {\n if (plugin.load && typeof plugin.load == \"function\") plugin.load();\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [err]\n });\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin.getName()} v${plugin.getVersion()} was loaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin.getName()} v${plugin.getVersion()} was loaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-loaded\", plugin.getName());\n};\n\nPluginModule.prototype.unloadPlugin = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n const plugin = bdplugin.plugin.getName();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) this.disablePlugin(plugin, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].filename, \"plugin\");\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin];\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} could not be unloaded. It may have not been loaded yet.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${plugin} could not be unloaded. It may have not been loaded yet.`, error);\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin} was unloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} was unloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-unloaded\", plugin);\n};\n\nPluginModule.prototype.reloadPlugin = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return this.loadPlugin(filenameOrName);\n const plugin = bdplugin.plugin.getName();\n const enabled = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin];\n if (enabled) this.stopPlugin(plugin, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].filename, \"plugin\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} could not be reloaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${plugin} could not be reloaded.`, error);\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load && typeof _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load == \"function\") _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load();\n if (enabled) this.startPlugin(plugin, true);\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} was reloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} was reloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-reloaded\", plugin);\n};\n\nPluginModule.prototype.reload = function (name) {\n return this.reloadPlugin(name);\n};\n\nPluginModule.prototype.updatePluginList = function () {\n const results = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadNewContent(\"plugin\");\n\n for (const filename of results.added) this.loadPlugin(filename);\n\n for (const name of results.removed) this.unloadPlugin(name);\n};\n\nPluginModule.prototype.loadPluginData = function () {\n const saved = _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSettingGroup(\"plugins\");\n\n if (saved) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"], saved);\n }\n};\n\nPluginModule.prototype.savePluginData = function () {\n _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setSettingGroup(\"plugins\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"]);\n};\n\nPluginModule.prototype.newMessage = function () {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.onMessage === \"function\") {\n try {\n plugin.onMessage();\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire onMessage for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\nPluginModule.prototype.channelSwitch = function () {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.onSwitch === \"function\") {\n try {\n plugin.onSwitch();\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire onSwitch for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\nPluginModule.prototype.rawObserver = function (e) {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.observer === \"function\") {\n try {\n plugin.observer(e);\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire observer for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new PluginModule());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9wbHVnaW5Nb2R1bGUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvcGx1Z2luTW9kdWxlLmpzP2FhN2YiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgYmRwbHVnaW5FcnJvcnMsIHBsdWdpbkNvb2tpZSwgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2lucyB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IENvbnRlbnRNYW5hZ2VyIGZyb20gXCIuL2NvbnRlbnRNYW5hZ2VyXCI7XG5pbXBvcnQgRGF0YVN0b3JlIGZyb20gXCIuL2RhdGFTdG9yZVwiO1xuaW1wb3J0IEJERXZlbnRzIGZyb20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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/pluginModule.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n\n\n\nfunction PluginModule() {}\n\nPluginModule.prototype.loadPlugins = function () {\n this.loadPluginData();\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].concat(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadPlugins());\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n let plugin, name;\n\n try {\n plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n name = plugin.getName();\n if (plugin.load && typeof plugin.load == \"function\") plugin.load();\n } catch (err) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", name + \" could not be loaded.\", err);\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].push({\n name: name,\n file: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].filename,\n message: \"load() could not be fired.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n });\n continue;\n }\n\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name]) _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name]) {\n try {\n plugin.start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin.getName()} v${plugin.getVersion()} has started.`);\n } catch (err) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][name] = false;\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", name + \" could not be started.\", err);\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdpluginErrors\"].push({\n name: name,\n file: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].filename,\n message: \"start() could not be fired.\",\n error: {\n message: err.message,\n stack: err.stack\n }\n });\n }\n }\n }\n\n this.savePluginData();\n\n __webpack_require__(/*! electron */ \"electron\").remote.getCurrentWebContents().on(\"did-navigate-in-page\", this.channelSwitch.bind(this)); // if (settingsCookie[\"fork-ps-5\"]) ContentManager.watchContent(\"plugin\");\n\n};\n\nPluginModule.prototype.startPlugin = function (plugin, reload = false) {\n try {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.start();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} has started.`);\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} could not be started.`, {\n type: \"error\"\n });\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = false;\n this.savePluginData();\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", plugin + \" could not be started.\", err);\n }\n};\n\nPluginModule.prototype.stopPlugin = function (plugin, reload = false) {\n try {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.stop();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} has stopped.`);\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"] && !reload) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName()} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} could not be stopped.`, {\n type: \"error\"\n });\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getName() + \" could not be stopped.\", err);\n }\n};\n\nPluginModule.prototype.enablePlugin = function (plugin, reload = false) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) return;\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = true;\n this.savePluginData();\n this.startPlugin(plugin, reload);\n};\n\nPluginModule.prototype.enable = function (plugin, reload = false) {\n return this.enablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.disablePlugin = function (plugin, reload = false) {\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) return;\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin] = false;\n this.savePluginData();\n this.stopPlugin(plugin, reload);\n};\n\nPluginModule.prototype.disable = function (plugin, reload = false) {\n return this.disablePlugin(plugin, reload);\n};\n\nPluginModule.prototype.togglePlugin = function (plugin) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) this.disablePlugin(plugin);else this.enablePlugin(plugin);\n};\n\nPluginModule.prototype.toggle = function (plugin, reload = false) {\n return this.togglePlugin(plugin, reload);\n};\n\nPluginModule.prototype.loadPlugin = function (filename) {\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadContent(filename, \"plugin\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${filename} could not be loaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${filename} could not be loaded.`, error);\n }\n\n const plugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filename).plugin;\n\n try {\n if (plugin.load && typeof plugin.load == \"function\") plugin.load();\n } catch (err) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [err]\n });\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin.getName()} v${plugin.getVersion()} was loaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin.getName()} v${plugin.getVersion()} was loaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-loaded\", plugin.getName());\n};\n\nPluginModule.prototype.unloadPlugin = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n const plugin = bdplugin.plugin.getName();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin]) this.disablePlugin(plugin, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].unloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].filename, \"plugin\");\n delete _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin];\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} could not be unloaded. It may have not been loaded yet.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${plugin} could not be unloaded. It may have not been loaded yet.`, error);\n }\n\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin} was unloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} was unloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-unloaded\", plugin);\n};\n\nPluginModule.prototype.delete = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n this.unloadPlugin(bdplugin.filename);\n\n const fullPath = __webpack_require__(/*! path */ \"path\").resolve(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pluginsFolder, bdplugin.filename);\n\n __webpack_require__(/*! fs */ \"fs\").unlinkSync(fullPath);\n};\n\nPluginModule.prototype.reloadPlugin = function (filenameOrName) {\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return this.loadPlugin(filenameOrName);\n const plugin = bdplugin.plugin.getName();\n const enabled = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin];\n if (enabled) this.stopPlugin(plugin, true);\n const error = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].reloadContent(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].filename, \"plugin\");\n\n if (error) {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-1\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showContentErrors({\n plugins: [error]\n });\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} could not be reloaded.`, {\n type: \"error\"\n });\n return _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"ContentManager\", `${plugin} could not be reloaded.`, error);\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load && typeof _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load == \"function\") _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.load();\n if (enabled) this.startPlugin(plugin, true);\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].log(\"ContentManager\", `${plugin} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} was reloaded.`);\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-2\"]) _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].showToast(`${plugin} v${_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugin].plugin.getVersion()} was reloaded.`, {\n type: \"success\"\n });\n _bdEvents__WEBPACK_IMPORTED_MODULE_3__[\"default\"].dispatch(\"plugin-reloaded\", plugin);\n};\n\nPluginModule.prototype.reload = function (name) {\n return this.reloadPlugin(name);\n};\n\nPluginModule.prototype.edit = function (filenameOrName) {\n console.log(\"Edit \" + filenameOrName);\n const bdplugin = Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).find(p => p.filename == filenameOrName) || _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][filenameOrName];\n if (!bdplugin) return;\n\n const fullPath = __webpack_require__(/*! path */ \"path\").resolve(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pluginsFolder, bdplugin.filename);\n\n console.log(\"Edit \" + fullPath);\n\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(`${fullPath}`);\n};\n\nPluginModule.prototype.updatePluginList = function () {\n const results = _contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadNewContent(\"plugin\");\n\n for (const filename of results.added) this.loadPlugin(filename);\n\n for (const name of results.removed) this.unloadPlugin(name);\n};\n\nPluginModule.prototype.loadPluginData = function () {\n const saved = _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSettingGroup(\"plugins\");\n\n if (saved) {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"], saved);\n }\n};\n\nPluginModule.prototype.savePluginData = function () {\n _dataStore__WEBPACK_IMPORTED_MODULE_2__[\"default\"].setSettingGroup(\"plugins\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"]);\n};\n\nPluginModule.prototype.newMessage = function () {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.onMessage === \"function\") {\n try {\n plugin.onMessage();\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire onMessage for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\nPluginModule.prototype.channelSwitch = function () {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.onSwitch === \"function\") {\n try {\n plugin.onSwitch();\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire onSwitch for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\nPluginModule.prototype.rawObserver = function (e) {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]);\n\n for (let i = 0; i < plugins.length; i++) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][plugins[i]].plugin;\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"pluginCookie\"][plugin.getName()]) continue;\n\n if (typeof plugin.observer === \"function\") {\n try {\n plugin.observer(e);\n } catch (err) {\n _utils__WEBPACK_IMPORTED_MODULE_4__[\"default\"].err(\"Plugins\", \"Unable to fire observer for \" + plugin.getName() + \".\", err);\n }\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new PluginModule());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9wbHVnaW5Nb2R1bGUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9Db3JlLy4vc3JjL21vZHVsZXMvcGx1Z2luTW9kdWxlLmpzP2FhN2YiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgYmRwbHVnaW5FcnJvcnMsIHBsdWdpbkNvb2tpZSwgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2lucyB9IGZyb20gXCIuLi8wZ2xvYmFsc1wiO1xuaW1wb3J0IENvbnRlbnRNYW5hZ2VyIGZyb20gXCIuL2NvbnRlbnRNYW5hZ2VyXCI7XG5pbXBvcnQgRGF0YVN0b3JlIGZyb20gXCIuL2RhdGFTdG9yZVwiO1xuaW1wb3J0IEJERXZlbnRzIGZyb20gXCIuL2JkRXZlbnRzXCI7XG5pbXBvcnQgVXRpbHMgZnJvbSBcIi4vdXRpbHNcIjtcblxuZnVuY3Rpb24gUGx1Z2luTW9kdWxlKCkge31cblxuUGx1Z2luTW9kdWxlLnByb3RvdHlwZS5sb2FkUGx1Z2lucyA9IGZ1bmN0aW9uICgpIHtcbiAgdGhpcy5sb2FkUGx1Z2luRGF0YSgpO1xuICBiZHBsdWdpbkVycm9ycy5jb25jYXQoQ29udGVudE1hbmFnZXIubG9hZFBsdWdpbnMoKSk7XG4gIGNvbnN0IHBsdWdpbnMgPSBPYmplY3Qua2V5cyhiZHBsdWdpbnMpO1xuXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgcGx1Z2lucy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBwbHVnaW4sIG5hbWU7XG5cbiAgICB0cnkge1xuICAgICAgcGx1Z2luID0gYmRwbHVnaW5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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/pluginModule.js\n"); /***/ }), @@ -299,7 +299,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0gl /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _settingsPanelSidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsPanelSidebar */ \"./src/modules/settingsPanelSidebar.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _coloredText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./coloredText */ \"./src/modules/coloredText.js\");\n/* harmony import */ var _24hour__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./24hour */ \"./src/modules/24hour.js\");\n/* harmony import */ var _publicServers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./publicServers */ \"./src/modules/publicServers.js\");\n/* harmony import */ var _voiceMode__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./voiceMode */ \"./src/modules/voiceMode.js\");\n/* harmony import */ var _emoteModule__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./emoteModule */ \"./src/modules/emoteModule.js\");\n/* harmony import */ var _classNormalizer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./classNormalizer */ \"./src/modules/classNormalizer.js\");\n/* harmony import */ var _devMode__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./devMode */ \"./src/modules/devMode.js\");\n/* harmony import */ var _quickEmoteMenu__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./quickEmoteMenu */ \"./src/modules/quickEmoteMenu.js\");\n/* harmony import */ var _ui_tools__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../ui/tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _ui_reloadIcon__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../ui/reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../ui/tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n/* harmony import */ var _ui_scroller__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../ui/scroller */ \"./src/ui/scroller.js\");\n/* harmony import */ var _ui_list__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../ui/list */ \"./src/ui/list.js\");\n/* harmony import */ var _ui_pluginCard__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../ui/pluginCard */ \"./src/ui/pluginCard.js\");\n/* harmony import */ var _ui_themeCard__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../ui/themeCard */ \"./src/ui/themeCard.js\");\n/* harmony import */ var _ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../ui/sectionedSettingsPanel */ \"./src/ui/sectionedSettingsPanel.js\");\n/* harmony import */ var _ui_settingsPanel__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../ui/settingsPanel */ \"./src/ui/settingsPanel.js\");\n/* harmony import */ var _ui_cssEditor__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../ui/cssEditor */ \"./src/ui/cssEditor.js\");\n/* harmony import */ var _ui_contentColumn__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../ui/contentColumn */ \"./src/ui/contentColumn.js\");\n/* harmony import */ var _ui_errorBoundary__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../ui/errorBoundary */ \"./src/ui/errorBoundary.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2_SettingsPanel {\n constructor() {\n const self = this;\n self.sideBarOnClick = self.sideBarOnClick.bind(self);\n self.onChange = self.onChange.bind(self);\n self.updateSettings = this.updateSettings.bind(self);\n self.sidebar = new _settingsPanelSidebar__WEBPACK_IMPORTED_MODULE_2__[\"default\"](self.sideBarOnClick);\n }\n\n get root() {\n const _root = $(\"#bd-settingspane-container\");\n\n if (!_root.length) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root[0];\n }\n\n injectRoot() {\n if (!$(\".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view\").length) return false;\n const root = $(\"
\", {\n \"class\": \"contentRegion-3nDuYy content-region\",\n \"id\": \"bd-settingspane-container\"\n });\n $(\".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view\").append(root);\n _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].onRemoved(root[0], () => {\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.unmountComponentAtNode(root[0]);\n });\n return true;\n }\n\n get coreSettings() {\n const settings = this.getSettings(\"core\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {\n return {\n title: c,\n settings: settings.filter(s => s.category == c)\n };\n });\n return sections;\n }\n\n get emoteSettings() {\n return this.getSettings(\"emote\");\n }\n\n getSettings(category) {\n return Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"]).reduce((arr, key) => {\n const setting = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"][key];\n\n if (setting.cat === category && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n }\n\n return arr;\n }, []);\n }\n\n sideBarOnClick(id) {\n const self = this;\n $(\".contentRegion-3nDuYy, .content-region\").first().hide();\n $(self.root).show();\n\n switch (id) {\n case \"core\":\n self.renderCoreSettings();\n break;\n\n case \"emotes\":\n self.renderEmoteSettings();\n break;\n\n case \"customcss\":\n self.renderCustomCssEditor();\n break;\n\n case \"plugins\":\n self.renderPluginPane();\n break;\n\n case \"themes\":\n self.renderThemePane();\n break;\n }\n }\n\n onClick() {}\n\n onChange(id, checked) {\n this.updateSettings(id, checked);\n }\n\n updateSettings(id, enabled) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][id] = enabled; // if (id == \"bda-gs-b\") {\n // if (enabled) $(\"body\").addClass(\"bd-blue\");\n // else $(\"body\").removeClass(\"bd-blue\");\n // }\n\n if (id == \"bda-gs-2\") {\n if (enabled) $(\"body\").addClass(\"bd-minimal\");else $(\"body\").removeClass(\"bd-minimal\");\n }\n\n if (id == \"bda-gs-3\") {\n if (enabled) $(\"body\").addClass(\"bd-minimal-chan\");else $(\"body\").removeClass(\"bd-minimal-chan\");\n }\n\n if (id == \"bda-gs-1\") {\n if (enabled) _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addButton();else _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].removeButton();\n }\n\n if (id == \"bda-gs-4\") {\n if (enabled) _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].enable();else _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].disable();\n }\n\n if (id == \"bda-gs-5\") {\n if (enabled) $(\"#app-mount\").addClass(\"bda-dark\");else $(\"#app-mount\").removeClass(\"bda-dark\");\n }\n\n if (enabled && id == \"bda-gs-6\") _24hour__WEBPACK_IMPORTED_MODULE_10__[\"default\"].inject24Hour();\n\n if (id == \"bda-gs-7\") {\n if (enabled) _coloredText__WEBPACK_IMPORTED_MODULE_9__[\"default\"].injectColoredText();else _coloredText__WEBPACK_IMPORTED_MODULE_9__[\"default\"].removeColoredText();\n }\n\n if (id == \"bda-es-4\") {\n if (enabled) _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].autoCapitalize();else _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].disableAutoCapitalize();\n }\n\n if (id == \"fork-ps-4\") {\n if (enabled) _classNormalizer__WEBPACK_IMPORTED_MODULE_14__[\"default\"].start();else _classNormalizer__WEBPACK_IMPORTED_MODULE_14__[\"default\"].stop();\n }\n\n if (id == \"fork-ps-5\") {\n if (enabled) {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"theme\");\n } else {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].unwatchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].unwatchContent(\"theme\");\n }\n }\n\n if (id == \"fork-wp-1\") {} // BdApi.setWindowPreference(\"transparent\", enabled);\n // if (enabled) BdApi.setWindowPreference(\"backgroundColor\", null);\n // else BdApi.setWindowPreference(\"backgroundColor\", \"#2f3136\");\n\n /*if (_c[\"fork-wp-2\"]) {\r\n const current = BdApi.getWindowPreference(\"frame\");\r\n if (current != _c[\"fork-wp-2\"]) BdApi.setWindowPreference(\"frame\", _c[\"fork-wp-2\"]);\r\n }*/\n\n\n if (id == \"bda-gs-8\") {\n if (enabled) _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].enable(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-dm-1\"]);else _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].disable();\n }\n\n if (id == \"fork-dm-1\") {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-8\"]) _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].enable(enabled);\n }\n\n this.saveSettings();\n }\n\n async initializeSettings() {\n // if (settingsCookie[\"bda-gs-b\"]) $(\"body\").addClass(\"bd-blue\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-2\"]) $(\"body\").addClass(\"bd-minimal\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-3\"]) $(\"body\").addClass(\"bd-minimal-chan\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-1\"]) _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addButton();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-4\"]) _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].enable();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-5\"]) $(\"#app-mount\").addClass(\"bda-dark\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-6\"]) _24hour__WEBPACK_IMPORTED_MODULE_10__[\"default\"].inject24Hour();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-7\"]) _coloredText__WEBPACK_IMPORTED_MODULE_9__[\"default\"].injectColoredText();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-es-4\"]) _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].autoCapitalize();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-4\"]) _classNormalizer__WEBPACK_IMPORTED_MODULE_14__[\"default\"].start();\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"]) {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"theme\");\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-8\"]) _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].enable(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-dm-1\"]);\n this.saveSettings();\n }\n\n saveSettings() {\n _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setSettingGroup(\"settings\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"]);\n }\n\n loadSettings() {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"], _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSettingGroup(\"settings\"));\n }\n\n renderSidebar() {\n const self = this;\n $(\"[class*='side-'] > [class*='item-']\").off(\"click.v2settingspanel\").on(\"click.v2settingspanel\", () => {\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.unmountComponentAtNode(self.root);\n $(self.root).hide();\n $(\".contentRegion-3nDuYy, .content-region\").first().show();\n });\n self.sidebar.render();\n }\n\n get coreComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_24__[\"default\"], {\n key: \"cspanel\",\n onChange: this.onChange,\n sections: this.coreSettings\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n get emoteComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_settingsPanel__WEBPACK_IMPORTED_MODULE_25__[\"default\"], {\n key: \"espanel\",\n title: \"Emote Settings\",\n onChange: this.onChange,\n settings: this.emoteSettings,\n button: {\n title: \"Clear Emote Cache\",\n onClick: () => {\n _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].clearEmoteData();\n _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].init();\n _quickEmoteMenu__WEBPACK_IMPORTED_MODULE_16__[\"default\"].init();\n }\n }\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n get customCssComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_cssEditor__WEBPACK_IMPORTED_MODULE_26__[\"default\"], {\n key: \"csseditor\"\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n contentComponent(type) {\n const componentElement = type == \"plugins\" ? this.pluginsComponent : this.themesComponent;\n const prefix = type.replace(\"s\", \"\");\n const settingsList = this;\n\n class ContentList extends _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.Component {\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n }\n\n componentDidMount() {\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${prefix}-reloaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${prefix}-loaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${prefix}-unloaded`, this.onChange);\n }\n\n componentWillUnmount() {\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${prefix}-reloaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${prefix}-loaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${prefix}-unloaded`, this.onChange);\n }\n\n onChange() {\n settingsList.sideBarOnClick(type);\n }\n\n render() {\n return componentElement;\n }\n\n }\n\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(ContentList);\n }\n\n get pluginsComponent() {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())).reduce((arr, key) => {\n arr.push(_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_errorBoundary__WEBPACK_IMPORTED_MODULE_28__[\"default\"], null, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_pluginCard__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n key: key,\n plugin: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][key].plugin\n })));\n return arr;\n }, []);\n const list = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_list__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n key: \"plugin-list\",\n className: \"bda-slist\",\n children: plugins\n });\n const refreshIcon = !_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"] && _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(Object(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_19__[\"default\"])(_ui_reloadIcon__WEBPACK_IMPORTED_MODULE_18__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Reload Plugin List\"\n }), {\n className: \"bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n _pluginModule__WEBPACK_IMPORTED_MODULE_7__[\"default\"].updatePluginList();\n this.sideBarOnClick(\"plugins\");\n }\n });\n const pfBtn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-pfbtn\",\n onClick: () => {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(_contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].pluginsFolder);\n }\n }, \"Open Plugin Folder\");\n const contentColumn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_contentColumn__WEBPACK_IMPORTED_MODULE_27__[\"default\"], {\n key: \"pcolumn\",\n title: \"Plugins\",\n children: [refreshIcon, pfBtn, list]\n });\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [contentColumn, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n get themesComponent() {\n const themes = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())).reduce((arr, key) => {\n arr.push(_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_errorBoundary__WEBPACK_IMPORTED_MODULE_28__[\"default\"], null, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_themeCard__WEBPACK_IMPORTED_MODULE_23__[\"default\"], {\n key: key,\n theme: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][key]\n })));\n return arr;\n }, []);\n const list = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_list__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n key: \"theme-list\",\n className: \"bda-slist\",\n children: themes\n });\n const refreshIcon = !_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"] && _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(Object(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_19__[\"default\"])(_ui_reloadIcon__WEBPACK_IMPORTED_MODULE_18__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Reload Theme List\"\n }), {\n className: \"bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n _themeModule__WEBPACK_IMPORTED_MODULE_8__[\"default\"].updateThemeList();\n this.sideBarOnClick(\"themes\");\n }\n });\n const tfBtn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-pfbtn\",\n onClick: () => {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(_contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].themesFolder);\n }\n }, \"Open Theme Folder\");\n const contentColumn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_contentColumn__WEBPACK_IMPORTED_MODULE_27__[\"default\"], {\n key: \"tcolumn\",\n title: \"Themes\",\n children: [refreshIcon, tfBtn, list]\n });\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [contentColumn, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n renderCoreSettings() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.coreComponent, root);\n }\n\n renderEmoteSettings() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.emoteComponent, root);\n }\n\n renderCustomCssEditor() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.customCssComponent, root);\n }\n\n renderPluginPane() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.contentComponent(\"plugins\"), root);\n }\n\n renderThemePane() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.contentComponent(\"themes\"), root);\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9zZXR0aW5nc1BhbmVsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQ29yZS8uL3NyYy9tb2R1bGVzL3NldHRpbmdzUGFuZWwuanM/NTdiMCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5ncywgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2lucywgYmR0aGVtZXMgfSBmcm9tIFwiLi4vMGdsb2JhbHNcIjtcbmltcG9ydCBEYXRhU3RvcmUgZnJvbSBcIi4vZGF0YVN0b3JlXCI7XG5pbXBvcnQgVjJfU2V0dGluZ3NQYW5lbF9TaWRlYmFyIGZyb20gXCIuL3NldHRpbmdzUGFuZWxTaWRlYmFyXCI7XG5pbXBvcnQgVXRpbHMgZnJvbSBcIi4vdXRpbHNcIjtcbmltcG9ydCBCRFYyIGZyb20gXCIuL3YyXCI7XG5pbXBvcnQgQ29udGVudE1hbmFnZXIgZnJvbSBcIi4vY29udGVudE1hbmFnZXJcIjt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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/modules/settingsPanel.js\n"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _settingsPanelSidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./settingsPanelSidebar */ \"./src/modules/settingsPanelSidebar.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./v2 */ \"./src/modules/v2.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _pluginModule__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pluginModule */ \"./src/modules/pluginModule.js\");\n/* harmony import */ var _themeModule__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./themeModule */ \"./src/modules/themeModule.js\");\n/* harmony import */ var _coloredText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./coloredText */ \"./src/modules/coloredText.js\");\n/* harmony import */ var _24hour__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./24hour */ \"./src/modules/24hour.js\");\n/* harmony import */ var _publicServers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./publicServers */ \"./src/modules/publicServers.js\");\n/* harmony import */ var _voiceMode__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./voiceMode */ \"./src/modules/voiceMode.js\");\n/* harmony import */ var _emoteModule__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./emoteModule */ \"./src/modules/emoteModule.js\");\n/* harmony import */ var _classNormalizer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./classNormalizer */ \"./src/modules/classNormalizer.js\");\n/* harmony import */ var _devMode__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./devMode */ \"./src/modules/devMode.js\");\n/* harmony import */ var _quickEmoteMenu__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./quickEmoteMenu */ \"./src/modules/quickEmoteMenu.js\");\n/* harmony import */ var _ui_tools__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../ui/tools */ \"./src/ui/tools.js\");\n/* harmony import */ var _ui_reloadIcon__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../ui/reloadIcon */ \"./src/ui/reloadIcon.js\");\n/* harmony import */ var _ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../ui/tooltipWrap */ \"./src/ui/tooltipWrap.js\");\n/* harmony import */ var _ui_scroller__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../ui/scroller */ \"./src/ui/scroller.js\");\n/* harmony import */ var _ui_list__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../ui/list */ \"./src/ui/list.js\");\n/* harmony import */ var _ui_pluginCard__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../ui/pluginCard */ \"./src/ui/pluginCard.js\");\n/* harmony import */ var _ui_themeCard__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../ui/themeCard */ \"./src/ui/themeCard.js\");\n/* harmony import */ var _ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../ui/sectionedSettingsPanel */ \"./src/ui/sectionedSettingsPanel.js\");\n/* harmony import */ var _ui_settingsPanel__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../ui/settingsPanel */ \"./src/ui/settingsPanel.js\");\n/* harmony import */ var _ui_cssEditor__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../ui/cssEditor */ \"./src/ui/cssEditor.js\");\n/* harmony import */ var _ui_contentColumn__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../ui/contentColumn */ \"./src/ui/contentColumn.js\");\n/* harmony import */ var _ui_errorBoundary__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../ui/errorBoundary */ \"./src/ui/errorBoundary.js\");\n/* harmony import */ var _ui_addonlist__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../ui/addonlist */ \"./src/ui/addonlist.jsx\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (new class V2_SettingsPanel {\n constructor() {\n const self = this;\n self.sideBarOnClick = self.sideBarOnClick.bind(self);\n self.onChange = self.onChange.bind(self);\n self.updateSettings = this.updateSettings.bind(self);\n self.sidebar = new _settingsPanelSidebar__WEBPACK_IMPORTED_MODULE_2__[\"default\"](self.sideBarOnClick);\n this.buildPluginProps = this.buildPluginProps.bind(this);\n }\n\n get root() {\n const _root = $(\"#bd-settingspane-container\");\n\n if (!_root.length) {\n if (!this.injectRoot()) return null;\n return this.root;\n }\n\n return _root[0];\n }\n\n injectRoot() {\n if (!$(\".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view\").length) return false;\n const root = $(\"
\", {\n \"class\": \"contentRegion-3nDuYy content-region\",\n \"id\": \"bd-settingspane-container\"\n });\n $(\".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view\").append(root);\n _utils__WEBPACK_IMPORTED_MODULE_3__[\"default\"].onRemoved(root[0], () => {\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.unmountComponentAtNode(root[0]);\n });\n return true;\n }\n\n get coreSettings() {\n const settings = this.getSettings(\"core\");\n const categories = [...new Set(settings.map(s => s.category))];\n const sections = categories.map(c => {\n return {\n title: c,\n settings: settings.filter(s => s.category == c)\n };\n });\n return sections;\n }\n\n get emoteSettings() {\n return this.getSettings(\"emote\");\n }\n\n getSettings(category) {\n return Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"]).reduce((arr, key) => {\n const setting = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settings\"][key];\n\n if (setting.cat === category && setting.implemented && !setting.hidden) {\n setting.text = key;\n arr.push(setting);\n }\n\n return arr;\n }, []);\n }\n\n sideBarOnClick(id) {\n const self = this;\n $(\".contentRegion-3nDuYy, .content-region\").first().hide();\n $(self.root).show();\n\n switch (id) {\n case \"core\":\n self.renderCoreSettings();\n break;\n\n case \"emotes\":\n self.renderEmoteSettings();\n break;\n\n case \"customcss\":\n self.renderCustomCssEditor();\n break;\n\n case \"plugins\":\n self.renderPluginPane();\n break;\n\n case \"themes\":\n self.renderThemePane();\n break;\n }\n }\n\n onClick() {}\n\n onChange(id, checked) {\n this.updateSettings(id, checked);\n }\n\n updateSettings(id, enabled) {\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][id] = enabled; // if (id == \"bda-gs-b\") {\n // if (enabled) $(\"body\").addClass(\"bd-blue\");\n // else $(\"body\").removeClass(\"bd-blue\");\n // }\n\n if (id == \"bda-gs-2\") {\n if (enabled) $(\"body\").addClass(\"bd-minimal\");else $(\"body\").removeClass(\"bd-minimal\");\n }\n\n if (id == \"bda-gs-3\") {\n if (enabled) $(\"body\").addClass(\"bd-minimal-chan\");else $(\"body\").removeClass(\"bd-minimal-chan\");\n }\n\n if (id == \"bda-gs-1\") {\n if (enabled) _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addButton();else _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].removeButton();\n }\n\n if (id == \"bda-gs-4\") {\n if (enabled) _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].enable();else _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].disable();\n }\n\n if (id == \"bda-gs-5\") {\n if (enabled) $(\"#app-mount\").addClass(\"bda-dark\");else $(\"#app-mount\").removeClass(\"bda-dark\");\n }\n\n if (enabled && id == \"bda-gs-6\") _24hour__WEBPACK_IMPORTED_MODULE_10__[\"default\"].inject24Hour();\n\n if (id == \"bda-gs-7\") {\n if (enabled) _coloredText__WEBPACK_IMPORTED_MODULE_9__[\"default\"].injectColoredText();else _coloredText__WEBPACK_IMPORTED_MODULE_9__[\"default\"].removeColoredText();\n }\n\n if (id == \"bda-es-4\") {\n if (enabled) _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].autoCapitalize();else _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].disableAutoCapitalize();\n }\n\n if (id == \"fork-ps-4\") {\n if (enabled) _classNormalizer__WEBPACK_IMPORTED_MODULE_14__[\"default\"].start();else _classNormalizer__WEBPACK_IMPORTED_MODULE_14__[\"default\"].stop();\n }\n\n if (id == \"fork-ps-5\") {\n if (enabled) {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"theme\");\n } else {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].unwatchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].unwatchContent(\"theme\");\n }\n }\n\n if (id == \"fork-wp-1\") {} // BdApi.setWindowPreference(\"transparent\", enabled);\n // if (enabled) BdApi.setWindowPreference(\"backgroundColor\", null);\n // else BdApi.setWindowPreference(\"backgroundColor\", \"#2f3136\");\n\n /*if (_c[\"fork-wp-2\"]) {\r\n const current = BdApi.getWindowPreference(\"frame\");\r\n if (current != _c[\"fork-wp-2\"]) BdApi.setWindowPreference(\"frame\", _c[\"fork-wp-2\"]);\r\n }*/\n\n\n if (id == \"bda-gs-8\") {\n if (enabled) _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].enable(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-dm-1\"]);else _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].disable();\n }\n\n if (id == \"fork-dm-1\") {\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-8\"]) _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].enable(enabled);\n }\n\n this.saveSettings();\n }\n\n async initializeSettings() {\n // if (settingsCookie[\"bda-gs-b\"]) $(\"body\").addClass(\"bd-blue\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-2\"]) $(\"body\").addClass(\"bd-minimal\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-3\"]) $(\"body\").addClass(\"bd-minimal-chan\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-1\"]) _publicServers__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addButton();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-4\"]) _voiceMode__WEBPACK_IMPORTED_MODULE_12__[\"default\"].enable();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-5\"]) $(\"#app-mount\").addClass(\"bda-dark\");\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-6\"]) _24hour__WEBPACK_IMPORTED_MODULE_10__[\"default\"].inject24Hour();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-7\"]) _coloredText__WEBPACK_IMPORTED_MODULE_9__[\"default\"].injectColoredText();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-es-4\"]) _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].autoCapitalize();\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-4\"]) _classNormalizer__WEBPACK_IMPORTED_MODULE_14__[\"default\"].start();\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"]) {\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"plugin\");\n _contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].watchContent(\"theme\");\n }\n\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"bda-gs-8\"]) _devMode__WEBPACK_IMPORTED_MODULE_15__[\"default\"].enable(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-dm-1\"]);\n this.saveSettings();\n }\n\n saveSettings() {\n _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setSettingGroup(\"settings\", _0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"]);\n }\n\n loadSettings() {\n Object.assign(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"], _dataStore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSettingGroup(\"settings\"));\n }\n\n renderSidebar() {\n const self = this;\n $(\"[class*='side-'] > [class*='item-']\").off(\"click.v2settingspanel\").on(\"click.v2settingspanel\", () => {\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.unmountComponentAtNode(self.root);\n $(self.root).hide();\n $(\".contentRegion-3nDuYy, .content-region\").first().show();\n });\n self.sidebar.render();\n }\n\n get coreComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_sectionedSettingsPanel__WEBPACK_IMPORTED_MODULE_24__[\"default\"], {\n key: \"cspanel\",\n onChange: this.onChange,\n sections: this.coreSettings\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n get emoteComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_settingsPanel__WEBPACK_IMPORTED_MODULE_25__[\"default\"], {\n key: \"espanel\",\n title: \"Emote Settings\",\n onChange: this.onChange,\n settings: this.emoteSettings,\n button: {\n title: \"Clear Emote Cache\",\n onClick: () => {\n _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].clearEmoteData();\n _emoteModule__WEBPACK_IMPORTED_MODULE_13__[\"default\"].init();\n _quickEmoteMenu__WEBPACK_IMPORTED_MODULE_16__[\"default\"].init();\n }\n }\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n get customCssComponent() {\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_scroller__WEBPACK_IMPORTED_MODULE_20__[\"default\"], {\n contentColumn: true,\n fade: true,\n dark: true,\n children: [_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_cssEditor__WEBPACK_IMPORTED_MODULE_26__[\"default\"], {\n key: \"csseditor\"\n }), _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_tools__WEBPACK_IMPORTED_MODULE_17__[\"default\"], {\n key: \"tools\"\n })]\n });\n }\n\n contentComponent(type) {\n const componentElement = this.getAddonList(type);\n const prefix = type.replace(\"s\", \"\");\n const settingsList = this;\n\n class ContentList extends _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.Component {\n constructor(props) {\n super(props);\n this.onChange = this.onChange.bind(this);\n }\n\n componentDidMount() {\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${prefix}-reloaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${prefix}-loaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].on(`${prefix}-unloaded`, this.onChange);\n }\n\n componentWillUnmount() {\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${prefix}-reloaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${prefix}-loaded`, this.onChange);\n _bdEvents__WEBPACK_IMPORTED_MODULE_6__[\"default\"].off(`${prefix}-unloaded`, this.onChange);\n }\n\n onChange() {\n settingsList.sideBarOnClick(type);\n }\n\n render() {\n return componentElement;\n }\n\n }\n\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(ContentList);\n }\n\n getString(value) {\n if (!value) return \"???\";\n return typeof value == \"string\" ? value : value.toString();\n }\n\n buildPluginProps(key) {\n const plugin = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][key].plugin;\n return Object.assign({}, {\n name: this.getString(plugin.getName()),\n author: this.getString(plugin.getAuthor()),\n description: this.getString(plugin.getDescription()),\n version: this.getString(plugin.getVersion()),\n getSettingsPanel: plugin.getSettingsPanel && plugin.getSettingsPanel.bind(plugin)\n }, _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][key]);\n }\n\n getAddonList(type) {\n const isPlugins = type === \"plugins\";\n const list = isPlugins ? Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).map(this.buildPluginProps) : Object.values(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_addonlist__WEBPACK_IMPORTED_MODULE_29__[\"default\"], {\n type,\n list\n });\n }\n\n get pluginsComponent() {\n const plugins = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"]).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())).reduce((arr, key) => {\n arr.push(_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_errorBoundary__WEBPACK_IMPORTED_MODULE_28__[\"default\"], null, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_pluginCard__WEBPACK_IMPORTED_MODULE_22__[\"default\"], {\n key: key,\n plugin: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdplugins\"][key].plugin\n })));\n return arr;\n }, []);\n const list = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_list__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n key: \"plugin-list\",\n className: \"bda-slist\",\n children: plugins\n });\n const refreshIcon = !_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"] && _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(Object(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_19__[\"default\"])(_ui_reloadIcon__WEBPACK_IMPORTED_MODULE_18__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Reload Plugin List\"\n }), {\n className: \"bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n _pluginModule__WEBPACK_IMPORTED_MODULE_7__[\"default\"].updatePluginList();\n this.sideBarOnClick(\"plugins\");\n }\n });\n const pfBtn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-pfbtn\",\n onClick: () => {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(_contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].pluginsFolder);\n }\n }, \"Open Plugin Folder\");\n const contentColumn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_contentColumn__WEBPACK_IMPORTED_MODULE_27__[\"default\"], {\n key: \"pcolumn\",\n title: \"Plugins\",\n children: [refreshIcon, pfBtn, list]\n }); // return BDV2.react.createElement(Scroller, {contentColumn: true, fade: true, dark: true, children: [contentColumn, BDV2.react.createElement(Tools, {key: \"tools\"})]});\n\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_addonlist__WEBPACK_IMPORTED_MODULE_29__[\"default\"], {\n type: \"plugins\"\n });\n }\n\n get themesComponent() {\n const themes = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]).sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())).reduce((arr, key) => {\n arr.push(_v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_errorBoundary__WEBPACK_IMPORTED_MODULE_28__[\"default\"], null, _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_themeCard__WEBPACK_IMPORTED_MODULE_23__[\"default\"], {\n key: key,\n theme: _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][key]\n })));\n return arr;\n }, []);\n const list = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_list__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n key: \"theme-list\",\n className: \"bda-slist\",\n children: themes\n });\n const refreshIcon = !_0globals__WEBPACK_IMPORTED_MODULE_0__[\"settingsCookie\"][\"fork-ps-5\"] && _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(Object(_ui_tooltipWrap__WEBPACK_IMPORTED_MODULE_19__[\"default\"])(_ui_reloadIcon__WEBPACK_IMPORTED_MODULE_18__[\"default\"], {\n color: \"black\",\n side: \"top\",\n text: \"Reload Theme List\"\n }), {\n className: \"bd-reload-header\",\n size: \"18px\",\n onClick: async () => {\n _themeModule__WEBPACK_IMPORTED_MODULE_8__[\"default\"].updateThemeList();\n this.sideBarOnClick(\"themes\");\n }\n });\n const tfBtn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(\"button\", {\n key: \"folder-button\",\n className: \"bd-pfbtn\",\n onClick: () => {\n __webpack_require__(/*! electron */ \"electron\").shell.openItem(_contentManager__WEBPACK_IMPORTED_MODULE_5__[\"default\"].themesFolder);\n }\n }, \"Open Theme Folder\");\n const contentColumn = _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_contentColumn__WEBPACK_IMPORTED_MODULE_27__[\"default\"], {\n key: \"tcolumn\",\n title: \"Themes\",\n children: [refreshIcon, tfBtn, list]\n }); // return BDV2.react.createElement(Scroller, {contentColumn: true, fade: true, dark: true, children: [contentColumn, BDV2.react.createElement(Tools, {key: \"tools\"})]});\n\n return _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].react.createElement(_ui_addonlist__WEBPACK_IMPORTED_MODULE_29__[\"default\"], {\n type: \"themes\"\n });\n }\n\n renderCoreSettings() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.coreComponent, root);\n }\n\n renderEmoteSettings() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.emoteComponent, root);\n }\n\n renderCustomCssEditor() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.customCssComponent, root);\n }\n\n renderPluginPane() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.contentComponent(\"plugins\"), root);\n }\n\n renderThemePane() {\n const root = this.root;\n\n if (!root) {\n console.log(\"FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i\");\n return;\n }\n\n _v2__WEBPACK_IMPORTED_MODULE_4__[\"default\"].reactDom.render(this.contentComponent(\"themes\"), root);\n }\n\n}());//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbW9kdWxlcy9zZXR0aW5nc1BhbmVsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vQ29yZS8uL3NyYy9tb2R1bGVzL3NldHRpbmdzUGFuZWwuanM/NTdiMCJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzZXR0aW5ncywgc2V0dGluZ3NDb29raWUsIGJkcGx1Z2lucywgYmR0aGVtZXMgfSBmcm9tIFwiLi4vMGdsb2JhbHNcIjtcbmltcG9ydCBEYXRhU3RvcmUgZnJvbSBcIi4vZGF0YVN0b3JlXCI7XG5pbXBvcnQgVjJfU2V0dGluZ3NQYW5lbF9TaWRlYmFyIGZyb20gXCIuL3NldHRpbmdzUGFuZWxTaWRlYmFyXCI7XG5pbXBvcnQgVXRpbHMgZnJvbSBcIi4vdXRpbHNcIjtcbmltcG9ydCBCRFYyIGZyb20gXCIuL3YyXCI7XG5pbXBvcnQgQ29udGVudE1hbmFnZXIgZnJvbSBcIi4vY29udGVudE1hbmFnZXJcIjtcbmltcG9ydCBCREV2ZW50cyBmcm9tIFwiLi9iZEV2ZW50c1wiO1xuaW1wb3J0IHBsdWdpbk1vZHVsZSBmcm9tIFwiLi9wbHVnaW5Nb2R1bGVcIjtcbmltcG9ydCB0aGVtZU1vZHVsZSBmcm9tIFwiLi90aGVtZU1vZHVsZVwiO1xuaW1wb3J0IGNvbG9yZWRUZXh0IGZyb20gXCIuL2NvbG9yZWRUZXh0XCI7XG5pbXBvcnQgdGZIb3VyIGZyb20gXCIuLzI0aG91clwiO1xuaW1wb3J0IHB1YmxpY1NlcnZlcnNNb2R1bGUgZnJvbSBcIi4vcHVibGljU2VydmVyc1wiO1x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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/modules/settingsPanel.js\n"); /***/ }), @@ -323,7 +323,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../0globals */ \"./src/0globals.js\");\n/* harmony import */ var _contentManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentManager */ \"./src/modules/contentManager.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataStore */ \"./src/modules/dataStore.js\");\n/* harmony import */ var _bdEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bdEvents */ \"./src/modules/bdEvents.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./src/modules/utils.js\");\n\n\n\n\n\n\nfunction ThemeModule() {}\n\nThemeModule.prototype.loadThemes = function () {\n this.loadThemeData();\n _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemeErrors\"].concat(_contentManager__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loadThemes());\n const themes = Object.keys(_0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"]);\n\n for (let i = 0; i < themes.length; i++) {\n const theme = _0globals__WEBPACK_IMPORTED_MODULE_0__[\"bdthemes\"][themes[i]];\n if (!_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme.name]) _0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme.name] = false;\n if (_0globals__WEBPACK_IMPORTED_MODULE_0__[\"themeCookie\"][theme.name]) $(\"head\").append($(\"'),$("#customcss").text(this.editor.session.getValue()).detach().appendTo(document.head)}saveCss(){z.setBDData("bdcustomcss",btoa(this.editor.session.getValue()))}}class Ae extends V.reactComponent{constructor(e){super(e);this.props.lines=0,this.setInitialState(),this.attach=this.attach.bind(this),this.detachedEditor=V.react.createElement(Le,{attach:this.attach}),this.onClick=this.onClick.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.detach=this.detach.bind(this)}setInitialState(){this.state={detached:this.props.detached||V.editorDetached}}componentDidMount(){this.editor=ace.edit("bd-customcss-editor"),this.editor.setTheme("ace/theme/monokai"),this.editor.session.setMode("ace/mode/css"),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(14),this.editor.on("change",()=>{l["bda-css-0"]&&(this.saveCss(),this.updateCss())})}componentWillUnmount(){this.editor.destroy()}componentDidUpdate(e,t){const n=this;t.detached&&!n.state.detached&&V.reactDom.unmountComponentAtNode(n.detachedRoot)}codeMirror(){}get options(){return{lineNumbers:!0,mode:"css",indentUnit:4,theme:"material",scrollbarStyle:"simple"}}get css(){const e=z.getBDData("bdcustomcss");let t="";return e&&""!==e&&(t=atob(e)),t}updateLineCount(){const e=this.refs.editor.value.split("\n").length;e!=this.props.lines&&(this.refs.lines.textContent=Array.from(new Array(e),(e,t)=>t+1).join(".\n")+".",this.props.lines=e)}render(){const e=this,{detached:t}=e.state;return V.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default",style:{padding:"60px 40px 0px"}},t&&V.react.createElement("div",{id:"editor-detached"},V.react.createElement(fe,{text:"Custom CSS Editor"}),V.react.createElement("h3",null,"Editor Detached"),V.react.createElement("button",{className:"btn btn-primary",onClick:()=>{e.attach()}},"Attach")),!t&&V.react.createElement("div",null,V.react.createElement(fe,{text:"Custom CSS Editor"}),V.react.createElement("div",{className:"editor-wrapper"},V.react.createElement("div",{id:"bd-customcss-editor",className:"editor",ref:"editor"},e.css)),V.react.createElement("div",{id:"bd-customcss-attach-controls"},V.react.createElement("ul",{className:"checkbox-group"},V.react.createElement(Fe,{id:"live-update",text:"Live Update",onChange:this.onChange,checked:l["bda-css-0"]})),V.react.createElement("div",{id:"bd-customcss-detach-controls-button"},V.react.createElement("button",{style:{borderRadius:"3px 0 0 3px",borderRight:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("update")}},"Update"),V.react.createElement("button",{style:{borderRadius:"0",borderLeft:"1px solid #2d2d2d",borderRight:"1px solid #2d2d2d"},className:"btn btn-primary",onClick:()=>{e.onClick("save")}},"Save"),V.react.createElement("button",{style:{borderRadius:"0 3px 3px 0",borderLeft:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("detach")}},"Detach"),V.react.createElement("span",{style:{fontSize:"10px",marginLeft:"5px"}},"Unsaved changes are lost on detach"),V.react.createElement("div",{className:"help-text"},"Press ",V.react.createElement("code",{className:"inline"},"ctrl"),"+",V.react.createElement("span",{className:"inline"},",")," with the editor focused to access the editor's settings.")))))}onClick(e){const t=this;switch(e){case"update":t.updateCss();break;case"save":t.saveCss();break;case"detach":t.detach()}}onChange(e,t){switch(e){case"live-update":l["bda-css-0"]=t,_e.saveSettings()}}updateCss(){0==$("#customcss").length&&$("head").append(''),$("#customcss").text(this.editor.session.getValue()).detach().appendTo(document.head)}saveCss(){z.setBDData("bdcustomcss",btoa(this.editor.session.getValue()))}detach(){this.setState({detached:!0});const e=this.detachedRoot;e?V.reactDom.render(this.detachedEditor,e):console.log("FAILED TO INJECT ROOT: .app")}get detachedRoot(){const e=$("#bd-customcss-detach-container");return e.length?e[0]:this.injectDetachedRoot()?this.detachedRoot:null}injectDetachedRoot(){return!!$(".app, .app-2rEoOp").length&&($("
",{id:"bd-customcss-detach-container"}).insertAfter($(".app, .app-2rEoOp")),!0)}attach(){this.setState({detached:!1})}}class Ie extends V.reactComponent{constructor(e){super(e)}static get displayName(){return"ContentColumn"}render(){return V.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},V.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20"},this.props.title),this.props.children)}}class Re extends V.reactComponent{constructor(e){super(e),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?V.react.createElement("div",{className:"react-error"},"Component Error"):this.props.children}}var _e=new class{constructor(){this.sideBarOnClick=this.sideBarOnClick.bind(this),this.onChange=this.onChange.bind(this),this.updateSettings=this.updateSettings.bind(this),this.sidebar=new ne(this.sideBarOnClick)}get root(){const e=$("#bd-settingspane-container");return e.length?e[0]:this.injectRoot()?this.root:null}injectRoot(){if(!$(".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view").length)return!1;const e=$("
",{class:"contentRegion-3nDuYy content-region",id:"bd-settingspane-container"});return $(".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view").append(e),S.onRemoved(e[0],()=>{V.reactDom.unmountComponentAtNode(e[0])}),!0}get coreSettings(){const e=this.getSettings("core");return[...new Set(e.map(e=>e.category))].map(t=>({title:t,settings:e.filter(e=>e.category==t)}))}get emoteSettings(){return this.getSettings("emote")}getSettings(e){return Object.keys(i).reduce((t,n)=>{const s=i[n];return s.cat===e&&s.implemented&&!s.hidden&&(s.text=n,t.push(s)),t},[])}sideBarOnClick(e){const t=this;switch($(".contentRegion-3nDuYy, .content-region").first().hide(),$(t.root).show(),e){case"core":t.renderCoreSettings();break;case"emotes":t.renderEmoteSettings();break;case"customcss":t.renderCustomCssEditor();break;case"plugins":t.renderPluginPane();break;case"themes":t.renderThemePane()}}onClick(){}onChange(e,t){this.updateSettings(e,t)}updateSettings(e,t){l[e]=t,"bda-gs-2"==e&&(t?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal")),"bda-gs-3"==e&&(t?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan")),"bda-gs-1"==e&&(t?ye.addButton():ye.removeButton()),"bda-gs-4"==e&&(t?ke.enable():ke.disable()),"bda-gs-5"==e&&(t?$("#app-mount").addClass("bda-dark"):$("#app-mount").removeClass("bda-dark")),t&&"bda-gs-6"==e&&oe.inject24Hour(),"bda-gs-7"==e&&(t?se.injectColoredText():se.removeColoredText()),"bda-es-4"==e&&(t?Y.autoCapitalize():Y.disableAutoCapitalize()),"fork-ps-4"==e&&(t?Ee.start():Ee.stop()),"fork-ps-5"==e&&(t?(q.watchContent("plugin"),q.watchContent("theme")):(q.unwatchContent("plugin"),q.unwatchContent("theme"))),"bda-gs-8"==e&&(t?Se.enable(l["fork-dm-1"]):Se.disable()),"fork-dm-1"==e&&l["bda-gs-8"]&&Se.enable(t),this.saveSettings()}async initializeSettings(){l["bda-gs-2"]&&$("body").addClass("bd-minimal"),l["bda-gs-3"]&&$("body").addClass("bd-minimal-chan"),l["bda-gs-1"]&&ye.addButton(),l["bda-gs-4"]&&ke.enable(),l["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),l["bda-gs-6"]&&oe.inject24Hour(),l["bda-gs-7"]&&se.injectColoredText(),l["bda-es-4"]&&Y.autoCapitalize(),l["fork-ps-4"]&&Ee.start(),l["fork-ps-5"]&&(q.watchContent("plugin"),q.watchContent("theme")),l["bda-gs-8"]&&Se.enable(l["fork-dm-1"]),this.saveSettings()}saveSettings(){z.setSettingGroup("settings",l)}loadSettings(){Object.assign(l,z.getSettingGroup("settings"))}renderSidebar(){const e=this;$("[class*='side-'] > [class*='item-']").off("click.v2settingspanel").on("click.v2settingspanel",()=>{V.reactDom.unmountComponentAtNode(e.root),$(e.root).hide(),$(".contentRegion-3nDuYy, .content-region").first().show()}),e.sidebar.render()}get coreComponent(){return V.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[V.react.createElement(Be,{key:"cspanel",onChange:this.onChange,sections:this.coreSettings}),V.react.createElement(he,{key:"tools"})]})}get emoteComponent(){return V.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[V.react.createElement(Oe,{key:"espanel",title:"Emote Settings",onChange:this.onChange,settings:this.emoteSettings,button:{title:"Clear Emote Cache",onClick:()=>{Y.clearEmoteData(),Y.init(),J.init()}}}),V.react.createElement(he,{key:"tools"})]})}get customCssComponent(){return V.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[V.react.createElement(Ae,{key:"csseditor"}),V.react.createElement(he,{key:"tools"})]})}contentComponent(e){const t="plugins"==e?this.pluginsComponent:this.themesComponent,n=e.replace("s",""),s=this;class o extends V.react.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this)}componentDidMount(){D.on(`${n}-reloaded`,this.onChange),D.on(`${n}-loaded`,this.onChange),D.on(`${n}-unloaded`,this.onChange)}componentWillUnmount(){D.off(`${n}-reloaded`,this.onChange),D.off(`${n}-loaded`,this.onChange),D.off(`${n}-unloaded`,this.onChange)}onChange(){s.sideBarOnClick(e)}render(){return t}}return V.react.createElement(o)}get pluginsComponent(){const e=Object.keys(w).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).reduce((e,t)=>(e.push(V.react.createElement(Re,null,V.react.createElement(Ne,{key:t,plugin:w[t].plugin}))),e),[]),t=V.react.createElement(De,{key:"plugin-list",className:"bda-slist",children:e}),s=!l["fork-ps-5"]&&V.react.createElement($e(Te,{color:"black",side:"top",text:"Reload Plugin List"}),{className:"bd-reload-header",size:"18px",onClick:async()=>{P.updatePluginList(),this.sideBarOnClick("plugins")}}),o=V.react.createElement("button",{key:"folder-button",className:"bd-pfbtn",onClick:()=>{n(1).shell.openItem(q.pluginsFolder)}},"Open Plugin Folder"),r=V.react.createElement(Ie,{key:"pcolumn",title:"Plugins",children:[s,o,t]});return V.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[r,V.react.createElement(he,{key:"tools"})]})}get themesComponent(){const e=Object.keys(k).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).reduce((e,t)=>(e.push(V.react.createElement(Re,null,V.react.createElement(Pe,{key:t,theme:k[t]}))),e),[]),t=V.react.createElement(De,{key:"theme-list",className:"bda-slist",children:e}),s=!l["fork-ps-5"]&&V.react.createElement($e(Te,{color:"black",side:"top",text:"Reload Theme List"}),{className:"bd-reload-header",size:"18px",onClick:async()=>{j.updateThemeList(),this.sideBarOnClick("themes")}}),o=V.react.createElement("button",{key:"folder-button",className:"bd-pfbtn",onClick:()=>{n(1).shell.openItem(q.themesFolder)}},"Open Theme Folder"),r=V.react.createElement(Ie,{key:"tcolumn",title:"Themes",children:[s,o,t]});return V.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[r,V.react.createElement(he,{key:"tools"})]})}renderCoreSettings(){const e=this.root;e?V.reactDom.render(this.coreComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderEmoteSettings(){const e=this.root;e?V.reactDom.render(this.emoteComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderCustomCssEditor(){const e=this.root;e?V.reactDom.render(this.customCssComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderPluginPane(){const e=this.root;e?V.reactDom.render(this.contentComponent("plugins"),e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderThemePane(){const e=this.root;e?V.reactDom.render(this.contentComponent("themes"),e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}};class qe extends V.reactComponent{render(){return V.react.createElement("svg",{height:"100%",width:this.props.size||"16px",className:"bd-logo "+this.props.className,style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},viewBox:"0 0 2000 2000"},V.react.createElement("metadata",null),V.react.createElement("defs",null,V.react.createElement("filter",{id:"shadow1"},V.react.createElement("feDropShadow",{dx:"20",dy:"0",stdDeviation:"20","flood-color":"rgba(0,0,0,0.35)"})),V.react.createElement("filter",{id:"shadow2"},V.react.createElement("feDropShadow",{dx:"15",dy:"0",stdDeviation:"20","flood-color":"rgba(255,255,255,0.15)"})),V.react.createElement("filter",{id:"shadow3"},V.react.createElement("feDropShadow",{dx:"10",dy:"0",stdDeviation:"20","flood-color":"rgba(0,0,0,0.35)"}))),V.react.createElement("g",null,V.react.createElement("path",{style:{filter:"url(#shadow3)"},d:"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z",fill:"#171717",opacity:"1"}),V.react.createElement("path",{style:{filter:"url(#shadow2)"},d:"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z",fill:"#3E82E5",opacity:"1"}),V.react.createElement("path",{style:{filter:"url(#shadow1)"},d:"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z",fill:"#FFFFFF",opacity:"1"})))}}function Ge(e){Object.assign(h,e)}Ge.prototype.init=async function(){if(h.version
Please download the latest version from GitHub");if(window.ED)return void S.alert("Not Supported","BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.");if(window.WebSocket&&window.WebSocket.name&&window.WebSocket.name.includes("Patched"))return void S.alert("Not Supported","BandagedBD does not work with Powercord. Please uninstall one of them.");const e=h.updater?h.updater.LatestVersion:h.latestVersion;e>h.version&&S.alert("Update Available",`\n An update for BandagedBD is available (${e})! Please Reinstall!

\n Download Installer\n `),S.log("Startup","Initializing Settings"),this.initSettings(),S.log("Startup","Initializing EmoteModule"),window.emotePromise=Y.init().then(()=>{Y.initialized=!0,S.log("Startup","Initializing QuickEmoteMenu"),J.init()}),this.injectExternals(),await this.checkForGuilds(),V.initialize(),S.log("Startup","Updating Settings"),_e.initializeSettings(),S.log("Startup","Loading Plugins"),P.loadPlugins(),S.log("Startup","Loading Themes"),j.loadThemes(),$("#customcss").detach().appendTo(document.head),window.addEventListener("beforeunload",(function(){l["bda-dc-0"]&&document.querySelector(".btn.btn-disconnect").click()})),Y.autoCapitalize(),S.log("Startup","Removing Loading Icon"),document.getElementsByClassName("bd-loaderv2").length&&document.getElementsByClassName("bd-loaderv2")[0].remove(),S.log("Startup","Initializing Main Observer"),this.initObserver(),l["fork-ps-1"]&&(S.log("Startup","Collecting Startup Errors"),S.showContentErrors({plugins:d,themes:u}));const t=z.getBDData("version");r>t&&(a&&this.showChangelogModal(a),z.setBDData("version",r)),S.suppressErrors(this.patchSocial.bind(this),"BD Social Patch")(),S.suppressErrors(this.patchGuildPills.bind(this),"BD Guild Pills Patch")(),S.suppressErrors(this.patchGuildListItems.bind(this),"BD Guild List Items Patch")(),S.suppressErrors(this.patchGuildSeparator.bind(this),"BD Guild Separator Patch")()},Ge.prototype.checkForGuilds=function(){let e=0;return new Promise(t=>{const n=function(){const s=V.guildClasses.wrapper.split(" ")[0];document.querySelectorAll(`.${s}`).length>0&&e++;const o=V.guildClasses.listItem.split(" ")[0],r=V.guildClasses.blobContainer.split(" ")[0];return document.querySelectorAll(`.${s} .${o} .${r}`).length>0||e>=50?t(h.deferLoaded=!0):void setTimeout(n,100)};$(document).ready((function(){setTimeout(n,100)}))})},Ge.prototype.injectExternals=async function(){await S.injectJs("https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"),window.require.original&&(window.require=window.require.original)},Ge.prototype.initSettings=function(){if(z.initialize(),z.getSettingGroup("settings")){_e.loadSettings(),$(''),$("#customcss").text(this.editor.session.getValue()).detach().appendTo(document.head)}saveCss(){H.setBDData("bdcustomcss",btoa(this.editor.session.getValue()))}}class Ve extends U.reactComponent{constructor(e){super(e);this.props.lines=0,this.setInitialState(),this.attach=this.attach.bind(this),this.detachedEditor=U.react.createElement(Ue,{attach:this.attach}),this.onClick=this.onClick.bind(this),this.updateCss=this.updateCss.bind(this),this.saveCss=this.saveCss.bind(this),this.detach=this.detach.bind(this)}setInitialState(){this.state={detached:this.props.detached||U.editorDetached}}componentDidMount(){this.editor=ace.edit("bd-customcss-editor"),this.editor.setTheme("ace/theme/monokai"),this.editor.session.setMode("ace/mode/css"),this.editor.setShowPrintMargin(!1),this.editor.setFontSize(14),this.editor.on("change",()=>{l["bda-css-0"]&&(this.saveCss(),this.updateCss())})}componentWillUnmount(){this.editor.destroy()}componentDidUpdate(e,t){const n=this;t.detached&&!n.state.detached&&U.reactDom.unmountComponentAtNode(n.detachedRoot)}codeMirror(){}get options(){return{lineNumbers:!0,mode:"css",indentUnit:4,theme:"material",scrollbarStyle:"simple"}}get css(){const e=H.getBDData("bdcustomcss");let t="";return e&&""!==e&&(t=atob(e)),t}updateLineCount(){const e=this.refs.editor.value.split("\n").length;e!=this.props.lines&&(this.refs.lines.textContent=Array.from(new Array(e),(e,t)=>t+1).join(".\n")+".",this.props.lines=e)}render(){const e=this,{detached:t}=e.state;return U.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default",style:{padding:"60px 40px 0px"}},t&&U.react.createElement("div",{id:"editor-detached"},U.react.createElement(fe,{text:"Custom CSS Editor"}),U.react.createElement("h3",null,"Editor Detached"),U.react.createElement("button",{className:"btn btn-primary",onClick:()=>{e.attach()}},"Attach")),!t&&U.react.createElement("div",null,U.react.createElement(fe,{text:"Custom CSS Editor"}),U.react.createElement("div",{className:"editor-wrapper"},U.react.createElement("div",{id:"bd-customcss-editor",className:"editor",ref:"editor"},e.css)),U.react.createElement("div",{id:"bd-customcss-attach-controls"},U.react.createElement("ul",{className:"checkbox-group"},U.react.createElement(He,{id:"live-update",text:"Live Update",onChange:this.onChange,checked:l["bda-css-0"]})),U.react.createElement("div",{id:"bd-customcss-detach-controls-button"},U.react.createElement("button",{style:{borderRadius:"3px 0 0 3px",borderRight:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("update")}},"Update"),U.react.createElement("button",{style:{borderRadius:"0",borderLeft:"1px solid #2d2d2d",borderRight:"1px solid #2d2d2d"},className:"btn btn-primary",onClick:()=>{e.onClick("save")}},"Save"),U.react.createElement("button",{style:{borderRadius:"0 3px 3px 0",borderLeft:"1px solid #3f4146"},className:"btn btn-primary",onClick:()=>{e.onClick("detach")}},"Detach"),U.react.createElement("span",{style:{fontSize:"10px",marginLeft:"5px"}},"Unsaved changes are lost on detach"),U.react.createElement("div",{className:"help-text"},"Press ",U.react.createElement("code",{className:"inline"},"ctrl"),"+",U.react.createElement("span",{className:"inline"},",")," with the editor focused to access the editor's settings.")))))}onClick(e){const t=this;switch(e){case"update":t.updateCss();break;case"save":t.saveCss();break;case"detach":t.detach()}}onChange(e,t){switch(e){case"live-update":l["bda-css-0"]=t,mt.saveSettings()}}updateCss(){0==$("#customcss").length&&$("head").append(''),$("#customcss").text(this.editor.session.getValue()).detach().appendTo(document.head)}saveCss(){H.setBDData("bdcustomcss",btoa(this.editor.session.getValue()))}detach(){this.setState({detached:!0});const e=this.detachedRoot;e?U.reactDom.render(this.detachedEditor,e):console.log("FAILED TO INJECT ROOT: .app")}get detachedRoot(){const e=$("#bd-customcss-detach-container");return e.length?e[0]:this.injectDetachedRoot()?this.detachedRoot:null}injectDetachedRoot(){return!!$(".app, .app-2rEoOp").length&&($("
",{id:"bd-customcss-detach-container"}).insertAfter($(".app, .app-2rEoOp")),!0)}attach(){this.setState({detached:!1})}}class Je extends U.reactComponent{constructor(e){super(e)}static get displayName(){return"ContentColumn"}render(){return U.react.createElement("div",{className:"contentColumn-2hrIYH contentColumnDefault-1VQkGM content-column default"},U.react.createElement("h2",{className:"ui-form-title h2 margin-reset margin-bottom-20"},this.props.title),this.props.children)}}class Ze extends U.reactComponent{constructor(e){super(e),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?U.react.createElement("div",{className:"react-error"},"Component Error"):this.props.children}}const Qe=U.React;class Ye extends Qe.Component{render(){const e=this.props.size||"24px";return Qe.createElement("svg",{viewBox:"0 0 24 24",fill:"#FFFFFF",style:{width:e,height:e},onClick:this.props.onClick},Qe.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),Qe.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}}const Ke=U.React;class Xe extends Ke.Component{render(){const e=this.props.size||"24px";return Ke.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e},onClick:this.props.onClick},Ke.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Ke.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),Ke.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}))}}const et=U.React;class tt extends U.reactComponent{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.showSettings=this.showSettings.bind(this),this.setInitialState(),this.hasSettings="function"==typeof this.props.addon.getSettingsPanel,this.settingsPanel="",this.edit=this.edit.bind(this),this.delete=this.delete.bind(this),this.reload=this.reload.bind(this)}setInitialState(){this.state={checked:this.props.enabled,settings:!1,reloads:0}}showSettings(){this.hasSettings&&this.setState({settings:!0})}closeSettings(){this.panelRef.current.innerHTML="",this.setState({settingsOpen:!1})}componentDidUpdate(){if(!this.state.settings)return;if("object"==typeof this.settingsPanel&&this.refs.settingspanel.appendChild(this.settingsPanel),!l["fork-ps-3"])return;const e=$(U.reactDom.findDOMNode(this)),t=e.parents(".scroller");((e,t)=>{const n=e.scrollTop,s=n+e.clientHeight,o=t.offsetTop,i=o+t.clientHeight;return os})(t[0],e[0])&&t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()-30},300)}getString(e){return e?"string"==typeof e?e:e.toString():"???"}get settingsComponent(){const e=this.getString(this.props.addon.name);try{this.settingsPanel=this.props.addon.getSettingsPanel()}catch(e){x.err("Plugins","Unable to get settings panel for "+this.props.addon.name+".",e)}return U.react.createElement("div",{className:"bd-card bd-addon-card settings-open ui-switch-item"},U.react.createElement("div",{style:{float:"right",cursor:"pointer"},onClick:()=>{this.refs.settingspanel.innerHTML="",this.setState({settings:!1})}},U.react.createElement(he,null)),"object"==typeof this.settingsPanel&&U.react.createElement("div",{id:`plugin-settings-${e}`,className:"plugin-settings",ref:"settingspanel"}),"object"!=typeof this.settingsPanel&&U.react.createElement("div",{id:`plugin-settings-${e}`,className:"plugin-settings",ref:"settingspanel",dangerouslySetInnerHTML:{__html:this.settingsPanel}}))}buildTitle(e,t,n){const s="{{name}} v{{version}} by {{author}}".split(/({{[A-Za-z]+}})/),o=s.findIndex(e=>"{{name}}"==e);o&&(s[o]=et.createElement("span",{className:"name bda-name"},e));const i=s.findIndex(e=>"{{version}}"==e);o&&(s[i]=et.createElement("span",{className:"version bda-version"},t));const r=s.findIndex(e=>"{{author}}"==e);if(o){const e={className:"author bda-author"};(n.link||n.id)&&(e.className+=` ${U.anchorClasses.anchor} ${U.anchorClasses.anchorUnderlineOnHover}`,e.target="_blank",n.link&&(e.href=n.link),n.id&&(e.onClick=()=>{U.LayerStack.popLayer(),U.openDM(n.id)})),s[r]=et.createElement(n.link||n.id?"a":"span",e,n.name)}return s.flat()}makeLink(e,t){const n={className:"bda-link bda-link-website",target:"_blank"};return"string"==typeof t&&(n.href=t),"function"==typeof t&&(n.onClick=e=>{e.preventDefault(),e.stopPropagation(),t()}),U.react.createElement("a",n,e)}makeButton(e,t,n){return et.createElement(Le,{color:"black",side:"top",text:e},et.createElement("div",{className:"bd-addon-button",onClick:n},t))}get links(){const e=[],t=this.props.addon;return t.website&&e.push(this.makeLink("Website",t.website)),t.source&&e.push(this.makeLink("Source",t.source)),t.invite&&e.push(this.makeLink("Support Server",()=>{const e=/\.gg\/(.*)$/;let n=t.invite;e.test(n)&&(n=n.match(e)[1]),U.LayerStack.popLayer(),U.InviteActions.acceptInviteAndTransitionToInviteChannel(n)})),t.donate&&e.push(this.makeLink("Donate",t.donate)),t.patreon&&e.push(this.makeLink("Patreon",t.patreon)),e}get footer(){const e=this.links;return(e.length||this.hasSettings)&&U.react.createElement("div",{className:"bd-card-footer bda-footer"},U.react.createElement("span",{className:"bd-addon-links bda-links"},...e.map((t,n)=>n{document.addEventListener("click",this.hideMenu)})}hideMenu(){this.setState({open:!1},()=>{document.removeEventListener("click",this.hideMenu)})}onChange(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)}get selected(){return this.props.options.find(e=>e.value==this.state.value)}get options(){const e=this.selected;return ot.createElement("div",{className:"bd-select-options"},this.props.options.map(t=>ot.createElement("div",{className:`bd-select-option${e.value==t.value?" selected":""}`,onClick:this.onChange.bind(this,t.value)},t.label)))}render(){const e="transparent"==this.props.style?" bd-select-transparent":"",t=this.state.open?" menu-open":"";return ot.createElement("div",{className:`bd-select${e}${t}`,onClick:this.showMenu,ref:this.dropdown},ot.createElement("div",{className:"bd-select-value"},this.selected.label),ot.createElement(st,{className:"bd-select-arrow"}),this.state.open&&this.options)}}const rt=U.React;class at extends rt.Component{render(){const e=this.props.size||"16px";return rt.createElement("svg",{className:this.props.className||"",fill:"#FFFFFF",viewBox:"0 0 24 24",style:{width:e,height:e}},rt.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),rt.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))}}const ct=U.React;class lt extends ct.Component{render(){return ct.createElement("div",{className:"bd-search-wrapper"},ct.createElement("input",{onChange:this.props.onChange,onKeyDown:this.props.onKeyDown,type:"text",className:"bd-search",placeholder:this.props.placeholder,maxLength:"50"}),ct.createElement(at,null))}}function dt(){return(dt=Object.assign||function(e){for(var t=1;t{Ct.showConfirmationModal("Are You Sure?",`Are you sure you want to delete ${e}?`,{danger:!0,confirmText:"Delete",onConfirm:()=>{t(!0)},onCancel:()=>{t(!1)}})})}get sortOptions(){return[{label:"Name",value:"name"},{label:"Author",value:"author"},{label:"Version",value:"version"},{label:"Recently Added",value:"added"},{label:"Last Modified",value:"modified"},{label:"File Size",value:"size"}]}get directions(){return[{label:"Ascending",value:!0},{label:"Descending",value:!1}]}reverse(e){this.setState({ascending:e})}sort(e){this.setState({sort:e})}search(e){this.setState({query:e.target.value.toLocaleLowerCase()})}getProps(e){return{key:e.name,enabled:this.cookie[e.name],toggle:this.manager.toggle.bind(this.manager),edit:this.edit.bind(this),remove:this.delete.bind(this),addon:e}}getAddons(){const e=this.props.list.sort((e,t)=>{const n=e[this.state.sort],s=t[this.state.sort];return"string"==typeof n?n.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase()):n>s?1:s>n?-1:0});return this.state.ascending||e.reverse(),e.map(e=>{if(this.state.query){let t=e.name.toLocaleLowerCase().includes(this.state.query);if(t=t||e.author.toLocaleLowerCase().includes(this.state.query),t=t||e.description.toLocaleLowerCase().includes(this.state.query),t=t||e.version.toLocaleLowerCase().includes(this.state.query),!t)return null}const t=this.getProps(e);return pt.createElement(Ze,null,pt.createElement(tt,dt({},t,{reload:!l["fork-ps-5"]&&this.manager.reload.bind(this.manager)})))})}render(){const e=pt.createElement(ht,{color:"black",position:"top",text:"Reload List"},e=>pt.createElement(Ne,dt({},e,{className:"bd-icon bd-reload bd-reload-header",size:"18px",onClick:async()=>{this.isPlugins?D.updatePluginList():F.updateThemeList(),this.forceUpdate()}}))),t=this.getAddons().filter(e=>e);return pt.createElement(me,{contentColumn:!0,fade:!0,dark:!0},pt.createElement(Je,{title:`${this.props.type.toUpperCase()}—${t.length}`},pt.createElement("button",{key:"folder-button",className:"bd-button bd-pfbtn",onClick:this.openFolder.bind(this)},"Open ",this.isPlugins?"Plugin":"Theme"," Folder"),!l["fork-ps-5"]&&e,pt.createElement("div",{className:"bd-controls bd-addon-controls"},pt.createElement(lt,{onChange:this.search,placeholder:`Search ${this.props.type}...`}),pt.createElement("div",{className:"bd-addon-dropdowns"},pt.createElement("div",{className:"bd-select-wrapper"},pt.createElement("label",{className:"bd-label"},"Sort by:"),pt.createElement(it,{options:this.sortOptions,onChange:this.sort,style:"transparent"})),pt.createElement("div",{className:"bd-select-wrapper"},pt.createElement("label",{className:"bd-label"},"Order:"),pt.createElement(it,{options:this.directions,onChange:this.reverse,style:"transparent"})))),pt.createElement("div",{className:"bda-slist bd-addon-list"},t)),pt.createElement(pe,{key:"tools"}))}}var mt=new class{constructor(){this.sideBarOnClick=this.sideBarOnClick.bind(this),this.onChange=this.onChange.bind(this),this.updateSettings=this.updateSettings.bind(this),this.sidebar=new ne(this.sideBarOnClick),this.buildPluginProps=this.buildPluginProps.bind(this)}get root(){const e=$("#bd-settingspane-container");return e.length?e[0]:this.injectRoot()?this.root:null}injectRoot(){if(!$(".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view").length)return!1;const e=$("
",{class:"contentRegion-3nDuYy content-region",id:"bd-settingspane-container"});return $(".layer-3QrUeG .standardSidebarView-3F1I7i, .layer-3QrUeG .ui-standard-sidebar-view").append(e),x.onRemoved(e[0],()=>{U.reactDom.unmountComponentAtNode(e[0])}),!0}get coreSettings(){const e=this.getSettings("core");return[...new Set(e.map(e=>e.category))].map(t=>({title:t,settings:e.filter(e=>e.category==t)}))}get emoteSettings(){return this.getSettings("emote")}getSettings(e){return Object.keys(a).reduce((t,n)=>{const s=a[n];return s.cat===e&&s.implemented&&!s.hidden&&(s.text=n,t.push(s)),t},[])}sideBarOnClick(e){const t=this;switch($(".contentRegion-3nDuYy, .content-region").first().hide(),$(t.root).show(),e){case"core":t.renderCoreSettings();break;case"emotes":t.renderEmoteSettings();break;case"customcss":t.renderCustomCssEditor();break;case"plugins":t.renderPluginPane();break;case"themes":t.renderThemePane()}}onClick(){}onChange(e,t){this.updateSettings(e,t)}updateSettings(e,t){l[e]=t,"bda-gs-2"==e&&(t?$("body").addClass("bd-minimal"):$("body").removeClass("bd-minimal")),"bda-gs-3"==e&&(t?$("body").addClass("bd-minimal-chan"):$("body").removeClass("bd-minimal-chan")),"bda-gs-1"==e&&(t?ye.addButton():ye.removeButton()),"bda-gs-4"==e&&(t?ke.enable():ke.disable()),"bda-gs-5"==e&&(t?$("#app-mount").addClass("bda-dark"):$("#app-mount").removeClass("bda-dark")),t&&"bda-gs-6"==e&&oe.inject24Hour(),"bda-gs-7"==e&&(t?se.injectColoredText():se.removeColoredText()),"bda-es-4"==e&&(t?Y.autoCapitalize():Y.disableAutoCapitalize()),"fork-ps-4"==e&&(t?Ee.start():Ee.stop()),"fork-ps-5"==e&&(t?(q.watchContent("plugin"),q.watchContent("theme")):(q.unwatchContent("plugin"),q.unwatchContent("theme"))),"bda-gs-8"==e&&(t?xe.enable(l["fork-dm-1"]):xe.disable()),"fork-dm-1"==e&&l["bda-gs-8"]&&xe.enable(t),this.saveSettings()}async initializeSettings(){l["bda-gs-2"]&&$("body").addClass("bd-minimal"),l["bda-gs-3"]&&$("body").addClass("bd-minimal-chan"),l["bda-gs-1"]&&ye.addButton(),l["bda-gs-4"]&&ke.enable(),l["bda-gs-5"]&&$("#app-mount").addClass("bda-dark"),l["bda-gs-6"]&&oe.inject24Hour(),l["bda-gs-7"]&&se.injectColoredText(),l["bda-es-4"]&&Y.autoCapitalize(),l["fork-ps-4"]&&Ee.start(),l["fork-ps-5"]&&(q.watchContent("plugin"),q.watchContent("theme")),l["bda-gs-8"]&&xe.enable(l["fork-dm-1"]),this.saveSettings()}saveSettings(){H.setSettingGroup("settings",l)}loadSettings(){Object.assign(l,H.getSettingGroup("settings"))}renderSidebar(){const e=this;$("[class*='side-'] > [class*='item-']").off("click.v2settingspanel").on("click.v2settingspanel",()=>{U.reactDom.unmountComponentAtNode(e.root),$(e.root).hide(),$(".contentRegion-3nDuYy, .content-region").first().show()}),e.sidebar.render()}get coreComponent(){return U.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[U.react.createElement(We,{key:"cspanel",onChange:this.onChange,sections:this.coreSettings}),U.react.createElement(pe,{key:"tools"})]})}get emoteComponent(){return U.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[U.react.createElement(Ge,{key:"espanel",title:"Emote Settings",onChange:this.onChange,settings:this.emoteSettings,button:{title:"Clear Emote Cache",onClick:()=>{Y.clearEmoteData(),Y.init(),J.init()}}}),U.react.createElement(pe,{key:"tools"})]})}get customCssComponent(){return U.react.createElement(me,{contentColumn:!0,fade:!0,dark:!0,children:[U.react.createElement(Ve,{key:"csseditor"}),U.react.createElement(pe,{key:"tools"})]})}contentComponent(e){const t=this.getAddonList(e),n=e.replace("s",""),s=this;class o extends U.react.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this)}componentDidMount(){P.on(`${n}-reloaded`,this.onChange),P.on(`${n}-loaded`,this.onChange),P.on(`${n}-unloaded`,this.onChange)}componentWillUnmount(){P.off(`${n}-reloaded`,this.onChange),P.off(`${n}-loaded`,this.onChange),P.off(`${n}-unloaded`,this.onChange)}onChange(){s.sideBarOnClick(e)}render(){return t}}return U.react.createElement(o)}getString(e){return e?"string"==typeof e?e:e.toString():"???"}buildPluginProps(e){const t=w[e].plugin;return Object.assign({},{name:this.getString(t.getName()),author:this.getString(t.getAuthor()),description:this.getString(t.getDescription()),version:this.getString(t.getVersion()),getSettingsPanel:t.getSettingsPanel&&t.getSettingsPanel.bind(t)},w[e])}getAddonList(e){const t="plugins"===e?Object.keys(w).map(this.buildPluginProps):Object.values(k);return U.react.createElement(ut,{type:e,list:t})}get pluginsComponent(){const e=Object.keys(w).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).reduce((e,t)=>(e.push(U.react.createElement(Ze,null,U.react.createElement(Ie,{key:t,plugin:w[t].plugin}))),e),[]),t=U.react.createElement(Be,{key:"plugin-list",className:"bda-slist",children:e}),s=!l["fork-ps-5"]&&U.react.createElement(Le(Ne,{color:"black",side:"top",text:"Reload Plugin List"}),{className:"bd-reload-header",size:"18px",onClick:async()=>{D.updatePluginList(),this.sideBarOnClick("plugins")}}),o=U.react.createElement("button",{key:"folder-button",className:"bd-pfbtn",onClick:()=>{n(0).shell.openItem(q.pluginsFolder)}},"Open Plugin Folder");U.react.createElement(Je,{key:"pcolumn",title:"Plugins",children:[s,o,t]});return U.react.createElement(ut,{type:"plugins"})}get themesComponent(){const e=Object.keys(k).sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase())).reduce((e,t)=>(e.push(U.react.createElement(Ze,null,U.react.createElement(_e,{key:t,theme:k[t]}))),e),[]),t=U.react.createElement(Be,{key:"theme-list",className:"bda-slist",children:e}),s=!l["fork-ps-5"]&&U.react.createElement(Le(Ne,{color:"black",side:"top",text:"Reload Theme List"}),{className:"bd-reload-header",size:"18px",onClick:async()=>{F.updateThemeList(),this.sideBarOnClick("themes")}}),o=U.react.createElement("button",{key:"folder-button",className:"bd-pfbtn",onClick:()=>{n(0).shell.openItem(q.themesFolder)}},"Open Theme Folder");U.react.createElement(Je,{key:"tcolumn",title:"Themes",children:[s,o,t]});return U.react.createElement(ut,{type:"themes"})}renderCoreSettings(){const e=this.root;e?U.reactDom.render(this.coreComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderEmoteSettings(){const e=this.root;e?U.reactDom.render(this.emoteComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderCustomCssEditor(){const e=this.root;e?U.reactDom.render(this.customCssComponent,e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderPluginPane(){const e=this.root;e?U.reactDom.render(this.contentComponent("plugins"),e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}renderThemePane(){const e=this.root;e?U.reactDom.render(this.contentComponent("themes"),e):console.log("FAILED TO LOCATE ROOT: .layer-3QrUeG .standardSidebarView-3F1I7i")}};class gt extends U.reactComponent{render(){return U.react.createElement("svg",{height:"100%",width:this.props.size||"16px",className:"bd-logo "+this.props.className,style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},viewBox:"0 0 2000 2000"},U.react.createElement("metadata",null),U.react.createElement("defs",null,U.react.createElement("filter",{id:"shadow1"},U.react.createElement("feDropShadow",{dx:"20",dy:"0",stdDeviation:"20","flood-color":"rgba(0,0,0,0.35)"})),U.react.createElement("filter",{id:"shadow2"},U.react.createElement("feDropShadow",{dx:"15",dy:"0",stdDeviation:"20","flood-color":"rgba(255,255,255,0.15)"})),U.react.createElement("filter",{id:"shadow3"},U.react.createElement("feDropShadow",{dx:"10",dy:"0",stdDeviation:"20","flood-color":"rgba(0,0,0,0.35)"}))),U.react.createElement("g",null,U.react.createElement("path",{style:{filter:"url(#shadow3)"},d:"M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z",fill:"#171717",opacity:"1"}),U.react.createElement("path",{style:{filter:"url(#shadow2)"},d:"M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z",fill:"#3E82E5",opacity:"1"}),U.react.createElement("path",{style:{filter:"url(#shadow1)"},d:"M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z",fill:"#FFFFFF",opacity:"1"})))}}function ft(e){Object.assign(p,e)}ft.prototype.init=async function(){if(p.version
Please download the latest version from GitHub");if(window.ED)return void x.alert("Not Supported","BandagedBD does not work with EnhancedDiscord. Please uninstall one of them.");if(window.WebSocket&&window.WebSocket.name&&window.WebSocket.name.includes("Patched"))return void x.alert("Not Supported","BandagedBD does not work with Powercord. Please uninstall one of them.");const e=p.updater?p.updater.LatestVersion:p.latestVersion;e>p.version&&x.alert("Update Available",`\n An update for BandagedBD is available (${e})! Please Reinstall!

\n Download Installer\n `),x.log("Startup","Initializing Settings"),this.initSettings(),x.log("Startup","Initializing EmoteModule"),window.emotePromise=Y.init().then(()=>{Y.initialized=!0,x.log("Startup","Initializing QuickEmoteMenu"),J.init()}),this.injectExternals(),await this.checkForGuilds(),U.initialize(),x.log("Startup","Updating Settings"),mt.initializeSettings(),x.log("Startup","Loading Plugins"),D.loadPlugins(),x.log("Startup","Loading Themes"),F.loadThemes(),$("#customcss").detach().appendTo(document.head),window.addEventListener("beforeunload",(function(){l["bda-dc-0"]&&document.querySelector(".btn.btn-disconnect").click()})),Y.autoCapitalize(),x.log("Startup","Removing Loading Icon"),document.getElementsByClassName("bd-loaderv2").length&&document.getElementsByClassName("bd-loaderv2")[0].remove(),x.log("Startup","Initializing Main Observer"),this.initObserver(),l["fork-ps-1"]&&(x.log("Startup","Collecting Startup Errors"),x.showContentErrors({plugins:d,themes:h}));const t=H.getBDData("version");i>t&&(r&&this.showChangelogModal(r),H.setBDData("version",i)),x.suppressErrors(this.patchSocial.bind(this),"BD Social Patch")(),x.suppressErrors(this.patchGuildPills.bind(this),"BD Guild Pills Patch")(),x.suppressErrors(this.patchGuildListItems.bind(this),"BD Guild List Items Patch")(),x.suppressErrors(this.patchGuildSeparator.bind(this),"BD Guild Separator Patch")()},ft.prototype.checkForGuilds=function(){let e=0;return new Promise(t=>{const n=function(){const s=U.guildClasses.wrapper.split(" ")[0];document.querySelectorAll(`.${s}`).length>0&&e++;const o=U.guildClasses.listItem.split(" ")[0],i=U.guildClasses.blobContainer.split(" ")[0];return document.querySelectorAll(`.${s} .${o} .${i}`).length>0||e>=50?t(p.deferLoaded=!0):void setTimeout(n,100)};$(document).ready((function(){setTimeout(n,100)}))})},ft.prototype.injectExternals=async function(){await x.injectJs("https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js"),window.require.original&&(window.require=window.require.original)},ft.prototype.initSettings=function(){if(H.initialize(),H.getSettingGroup("settings")){mt.loadSettings(),$('