Untitled

 avatar
unknown
plain_text
2 years ago
124 kB
6
Indexable
// ==UserScript==
// @name         Ritsu x Emerald
// @version      0.11.3.3
// @description  Custom Emerald Chat themes and fixes.
// @author       Atsos/Ritsu, Aqua, Strawberry.
// @icon         https://i.imgur.com/KLtVhho.png
// @match        *://emeraldchat.com/app
// @match        *://www.emeraldchat.com/app
// @namespace    Emerald Bot - Ritsu Project
// @run-at       document-end
// @grant        GM_getValue
// @grant        GM_deleteValue
// @grant        unsafeWindow
// ==/UserScript==
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=44)}([function(e,t){e.exports=React},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var i=(a=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),r=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[n].concat(r).concat([i]).join("\n")}var a,s,c;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,o){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);o&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},function(e,t){e.exports=ReactDOM},,,function(e,t,n){"use strict";var o=n(1),i=n.n(o)()(!0);i.push([e.i,'.vkijM9js5qD40n7Lxa8Z5Q\\=\\={margin:2em;text-align:center;color:#e33}.FAVDrTTj78xCOQQ0afY-3Q\\=\\={height:calc(100% - 46px);overflow:auto}.wko3KsMuRizugS2G1lpo9g\\=\\={padding-top:1em}.L0iyDASY7iJqc13r5Q-Mzg\\=\\={width:80px;height:80px}.L0iyDASY7iJqc13r5Q-Mzg\\=\\=:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:6px solid #8ac;border-color:#8ac transparent #8ac transparent;animation:L0iyDASY7iJqc13r5Q-Mzg\\=\\= 1.2s linear infinite}@keyframes L0iyDASY7iJqc13r5Q-Mzg\\=\\={0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.qdUyv9EVJbNAGAWRZbfH1Q\\=\\={margin-left:.5em;cursor:pointer}',"",{version:3,sources:["webpack://src/components/style.module.scss"],names:[],mappings:"AAAA,4BACE,UAAA,CACA,iBAAA,CACA,UAAA,CAGF,4BACE,wBAAA,CACA,aAAA,CAGF,4BACE,eAAA,CAIF,4BACE,UAAA,CACA,WAAA,CAEF,kCACE,WAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,UAAA,CACA,iBAAA,CACA,qBAAA,CACA,8CAAA,CACA,yDAAA,CAEF,sCACE,GACE,sBAAA,CAEF,KACE,wBAAA,CAAA,CAIJ,4BACE,gBAAA,CACA,cAAA",sourcesContent:['.reload-warning {\n  margin: 2em;\n  text-align: center;\n  color: #e33;\n}\n\n.ritsu-menu-container {\n  height: calc(100% - 46px);\n  overflow: auto;\n}\n\n.settings-section {\n  padding-top: 1em;\n}\n\n// spinner thingy\n.lds-dual-ring {\n  width: 80px;\n  height: 80px;\n}\n.lds-dual-ring:after {\n  content: " ";\n  display: block;\n  width: 64px;\n  height: 64px;\n  margin: 8px;\n  border-radius: 50%;\n  border: 6px solid #8ac;\n  border-color: #8ac transparent #8ac transparent;\n  animation: lds-dual-ring 1.2s linear infinite;\n}\n@keyframes lds-dual-ring {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n.permamute-list {\n  margin-left: 0.5em;\n  cursor: pointer;\n}\n'],sourceRoot:""}]),i.locals={reloadWarning:"vkijM9js5qD40n7Lxa8Z5Q==",ritsuMenuContainer:"FAVDrTTj78xCOQQ0afY-3Q==",settingsSection:"wko3KsMuRizugS2G1lpo9g==",ldsDualRing:"L0iyDASY7iJqc13r5Q-Mzg==",permamuteList:"qdUyv9EVJbNAGAWRZbfH1Q=="},t.a=i},function(e,t,n){var o=n(36);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(28);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(29);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(30);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(31);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(32);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(33);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(34);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},o=[],i=0;i<e.length;i++){var r=e[i],c=t.base?r[0]+t.base:r[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var d=s(u),m={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(m)):a.push({identifier:u,updater:g(m,t),references:1}),o.push(u)}return o}function l(e){var t=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(e){t.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(t);else{var a=r(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function m(e,t,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=d(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function f(e,t,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var p=null,h=0;function g(e,t){var n,o,i;if(t.singleton){var r=h++;n=p||(p=l(t)),o=m.bind(null,n,r,!1),i=m.bind(null,n,r,!0)}else n=l(t),o=f.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=c(e,t),l=0;l<n.length;l++){var u=s(n[l]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(e,t,n){var o=n(35);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(37);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(38);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(39);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(40);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(41);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(42);e.exports="string"==typeof o?o:o.toString()},function(e,t,n){var o=n(43);e.exports="string"==typeof o?o:o.toString()},,,,,,function(e,t,n){var o=n(1)(!1);o.push([e.i,"html.adBlocker .emerald-jumbotron-message{display:none}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,'.picture-upload-info{font-size:14px;font-weight:400;color:"#adb6c7"}.picture-upload-info div{margin-bottom:1em}.picture-upload-error{color:red;font-weight:bold}.picture-upload-error-reason{font-weight:initial}.upload-thing{vertical-align:middle;margin-right:5px}',""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,".top-message{position:absolute;top:2px;font-size:1.5em;font-weight:bold;padding:6px;margin:auto;border:solid 4px #800;border-radius:8px;background-color:#f88;color:#300;cursor:pointer}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,"html.imgBlur div.ritsu-would-blur>img{filter:blur(7px);transition:filter 1s ease}html.imgBlur div:hover.ritsu-would-blur>img{filter:blur(0px)}.room-component-message-text.room-component-message-text,.notification-unit-body.notification-unit-body{overflow:visible}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,"html.showGender .room-component-message-avatar,html.showGender .navigation-notification-unit-image{border-color:#fff;border:2px inset;width:36px;height:36px;margin:-2px 10px -2px -2px}html.showGender .room-component-message-avatar[data-gender=m],html.showGender .navigation-notification-unit-image[data-gender=m]{border-color:#0070ff}html.showGender .room-component-message-avatar[data-gender=f],html.showGender .navigation-notification-unit-image[data-gender=f]{border-color:#ff80ea}html.showGender .room-component-message-avatar{width:42px;height:42px}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,".karma-tracker,.karma-delta{display:none}html.trackKarma .karma-tracker{display:inline-block;line-height:14px;height:32px;vertical-align:middle;font-size:1.3em;padding-left:1.5em;color:var(--menu-fg-color)}html.trackKarma .karma-delta{display:block;position:absolute;top:50%;left:50%;opacity:1;transform:translateX(-50%) translateY(-50%) scale(0.1);transition:all 2s ease-out;pointer-events:none}html.trackKarma .karma-delta.positive{color:green}html.trackKarma .karma-delta.negative{color:red}html.trackKarma .karma-delta.zoom{opacity:0;transform:translateX(-50%) translateY(-50%) scale(20)}html.trackKarma .notification-unit-body.down{background:#ff808080}html.trackKarma .notification-unit-body.up{background:#80ff8080}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,".room-component-message-right{flex-direction:row;justify-content:flex-start;align-items:baseline}.user-badge-container{align-self:center}.user-badge-tick{display:flex;position:static}.room-component-flair{max-width:100%}.jumbo-message:not(.ritsu-message-hidden>*){font-size:5em}.user-extra{padding:0 .5em}html.imgBlur .ritsu-would-blur{filter:blur(4px);transition:filter .3s}html.imgBlur .ritsu-would-blur-heavy{filter:blur(8px);transition:filter .3s}html.imgBlur .ritsu-would-blur:hover,html.imgBlur .ritsu-would-blur-heavy:hover{filter:blur(0px)}.text-only{max-height:8em;overflow:auto !important}div.ritsu-avatar-hidden{color:var(--app-fg-color);font-size:32px;padding:3px}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,'.main-logo.main-logo{height:38px}.room-component-message-picture-container{position:relative}.picture-control{display:none;position:absolute;top:0;font-size:2em;font-weight:900}.room-component-message-picture:hover+.picture-control,.picture-control:hover{display:block;cursor:pointer}.picture-button{padding:.5em;border:1px solid var(--app-fg-color);border-radius:2px;background:var(--app-bg-color);color:var(--app-fg-color)}.picture-button.block:hover{color:red}.picture-button.save:hover{color:green}.image-grid div{display:inline-block;width:6em;height:6em;margin:5px;background-size:contain;background-repeat:no-repeat;background-position:center;cursor:pointer}.image-grid div>div{width:unset;height:unset;zoom:.6}.disable-after::after{content:"";display:none}.picker-flair-select{height:3em !important;vertical-align:bottom}.navigation-dropdown-ritsu{color:#f965fec4}.main-logo-text{display:inline-block;line-height:14px;height:32px;vertical-align:middle;font-size:1.3em;padding-left:.5em}@media screen and (max-width: 640px){.main-logo-text{display:none}}body.themeChange *{transition:background-color .3s,color .3s,border-color .3s}@media screen and (min-width: 640px){body{overflow:hidden}}body.tmp-message span.room-component-print:last-of-type{margin:-1em 0}.user-profile-micro.user-profile-micro{width:auto}.navigation-notification-badge{position:absolute}.channel-expand-icon{padding:8px}.ritsu-icon-network-unavail{color:red !important}html:not(.network-unavail) .ritsu-icon-network-unavail{display:none}.navigation-notification-unit-message{margin-left:8px}',""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,":root{--ritsu-hair-color: #f965fec4;--ritsu-hair-dark-color: #b821bd}html>body{background:var(--app-bg-color)}body>div>nav{background:var(--header-bg-color)}.room-component-left.room-component-left{background:var(--roomlist-bg-color)}.room-component-center.room-component-center{background:var(--chat-bg-color)}.room-component-right.room-component-right{background:var(--userlist-bg-color)}.room-component-messages{background:var(--chat-bg-color)}.room-notification.room-notification{background:var(--chat-bg-color)}.room-component-print.room-component-print{color:var(--message-fg-color)}.room-component-input{background:var(--input-bg-color)}.room-component-input-textarea.room-component-input-textarea{color:var(--input-fg-color)}.ui-button-match{background:var(--input-bg-color)}#container{background:var(--app-bg-color)}.room-component-container.room-component-container{color:var(--app-fg-color)}.dashboard-button.animated.zoomIn{background:var(--dashboard-button-bg-color)}.navigation-notification-icons.navigation-notification-icons{background:transparent}.ui-search-box{background:var(--search-bg-color);color:var(--search-fg-color)}.side-panel.side-panel{background:var(--panel-bg-color)}.actionicon-mega.actionicon-mega{color:var(--panel-fg-color)}.actionicon-mega.actionicon-mega:hover{background:var(--item-hover-bg-color)}.ui-bg.ui-bg{background:var(--dialog-overlay-bg-color)}.ui-menu.ui-menu,.notification-unit.notification-unit{background:var(--dialog-bg-color);color:var(--dialog-fg-color)}.ui-interests-bg.ui-interests-bg{background:var(--interests-bg-color) !important}.navigation-notification-unit.navigation-notification-unit:hover{background:var(--header-hover-bg-color);color:var(--header-hover-fg-color)}.navigation-notification-unit{color:var(--header-fg-color)}:last-child>.navigation-notification-unit{color:var(--header-hover-fg-color)}.navigation-dropdown-content.navigation-dropdown-content{background:var(--menu-bg-color);color:var(--menu-fg-color)}.dashboard-icon.dashboard-icon{color:var(--dashboard-icon-fg-color)}.dashboard-button.dashboard-button:hover{color:var(--dashboard-hover-fg-color);background:var(--dashboard-hover-bg-color)}.actionicon-icon.actionicon-icon{color:var(--dashboard-icon-fg-color)}.main-hamburger.main-hamburger{color:var(--header-fg-color)}.main-hamburger.main-hamburger:hover,.main-logo.main-logo:hover{background:var(--header-hover-bg-color) !important;color:var(--header-hover-fg-color)}.user-profile-menu.user-profile-menu{background:var(--dialog-bg-color)}.user-micropost-input-background.user-micropost-input-background{background:var(--dialog-input-bg-color)}.user-micropost-input.user-micropost-input{color:var(--dialog-input-fg-color)}.ui-button-micro.ui-button-micro{background:var(--dialog-button-bg-color);color:var(--dialog-button-fg-color)}.user-profile-tab.user-profile-tab,.ui-tab.ui-tab{color:var(--tab-fg-color)}.user-profile-tab-active.user-profile-tab-active,.ui-tab-active.ui-tab-active{color:var(--tab-active-fg-color)}.ui-button-mega.ui-button-mega:hover{background:var(--dialog-button-hover-bg-color);color:var(--dialog-button-hover-fg-color)}.ui-button-mega.ui-button-mega{background:var(--dialog-button-bg-color);color:var(--dialog-button-fg-color)}.ui-input.ui-input{background:var(--dialog-input-bg-color) !important}.dashboard-card-image.dashboard-card-image{border-color:var(--dashboard-icon-fg-color)}.user-comment-input-background.user-comment-input-background{background:var(--dialog-input-bg-color)}.user-comment-input.user-comment-input{color:var(--dialog-input-fg-color)}.room-component-left .room-user-label{color:var(--roomlist-title-fg-color)}.room-component-right .room-user-label{color:var(--userlist-title-fg-color)}.picture-upload-button.picture-upload-button+label{background:var(--upload-button-bg-color);color:var(--upload-button-fg-color)}.main-logo-text{color:var(--menu-fg-color)}.navigation-dropdown-ritsu{color:var(--ritsu-menu-fg-color)}.navigation-dropdown-ritsu:hover{color:var(--ritsu-menu-hover-fg-color)}.notification-menu-container-text{color:var(--dialog-fg-color)}.notification-menu-container-text span{text-shadow:#000 0 0 3px}.user-flair.user-flair,.user-extra-gender{text-shadow:-0.05em -0.05em #fff5}.user-profile-picture-wrapper .btn{margin-top:.2rem;margin-bottom:.5rem;color:var(--upload-button-fg-color);border:solid;border-color:#26292f;border-width:2px;background-color:var(--dashboard-icon-bg-color)}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,":root{--header-bg-color: #100f10;--header-alt-bg-color: #232529;--header-hover-bg-color: #3d4046;--app-bg-color: black;--dialog-bg-color: #111;--dialog-overlay-bg-color: rgba(0, 0, 0, 0.93);--dialog-button-bg-color: #17191b;--dialog-button-hover-bg-color: #151515;--dialog-input-bg-color: #17191b;--dashboard-button-bg-color: #100f10;--dashboard-hover-bg-color: #33323270;--roomlist-bg-color: black;--chat-bg-color: black;--userlist-bg-color: black;--input-bg-color: #211f21;--search-bg-color: #0b0b0b;--panel-bg-color: #0c0c0c;--item-hover-bg-color: #35383e;--interests-bg-color: #2c2f35;--menu-bg-color: #0a0a0a;--upload-button-bg-color: #41444a;--header-fg-color: white;--header-hover-fg-color: var(--ritsu-hair-color);--app-fg-color: #bebfc5;--dialog-fg-color: #f1f1f2;--dialog-button-fg-color: #d5dcec;--dialog-button-hover-fg-color: var(--ritsu-hair-color);--dialog-input-fg-color: #d7dfec;--dashboard-icon-fg-color: var(--ritsu-hair-color);--dashboard-hover-fg-color: var(--ritsu-hair-color);--roomlist-title-fg-color: #99a3b4;--userlist-title-fg-color: #99a3b4;--tab-fg-color: #c2c8d6;--tab-active-fg-color: var(--ritsu-hair-color);--message-fg-color: #afbacd;--input-fg-color: #caccd0;--search-fg-color: #f0f0f1;--panel-fg-color: white;--menu-fg-color: white;--upload-button-fg-color: #b4bccc;--ritsu-menu-fg-color: var(--ritsu-hair-color);--ritsu-menu-hover-fg-color: var(--ritsu-hair-color)}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,":root{--header-bg-color: #bbb;--header-alt-bg-color: #ccc;--header-hover-bg-color: #aaa;--app-bg-color: #ddd;--dialog-bg-color: #ddd;--dialog-overlay-bg-color: rgba(0, 0, 0, 0.5);--dialog-button-bg-color: #cfdeec;--dialog-button-hover-bg-color: #f0f0f0;--dialog-input-bg-color: #cfdeec;--dashboard-button-bg-color: #f0e4f0;--dashboard-hover-bg-color: #cfcdcd70;--roomlist-bg-color: #ccc;--chat-bg-color: #ddd;--userlist-bg-color: #ccc;--input-bg-color: #fff;--search-bg-color: #f7f7f7;--panel-bg-color: #ccc;--item-hover-bg-color: #a3adc0;--interests-bg-color: #aab6ce;--menu-bg-color: #aaa;--upload-button-bg-color: #ccc;--header-fg-color: #333;--header-hover-fg-color: var(--ritsu-hair-dark-color);--app-fg-color: #333;--dialog-fg-color: #333;--dialog-button-fg-color: #000;--dialog-button-hover-fg-color: var(--ritsu-hair-dark-color);--dialog-input-fg-color: #000;--dashboard-icon-fg-color: var(--ritsu-hair-dark-color);--dashboard-hover-fg-color: var(--ritsu-hair-dark-color);--roomlist-title-fg-color: #555;--userlist-title-fg-color: #555;--tab-fg-color: #444;--tab-active-fg-color: var(--ritsu-hair-dark-color);--message-fg-color: #666;--input-fg-color: #222;--search-fg-color: #222;--panel-fg-color: #333;--menu-fg-color: #333;--upload-button-fg-color: #444;--ritsu-menu-fg-color: var(--ritsu-hair-dark-color);--ritsu-menu-hover-fg-color: var(--ritsu-hair-color)}.user-flair.user-flair,.user-extra-gender{text-shadow:1px 1px 1px #000}.actionicon-mega.actionicon-mega:hover{background:#aaa}.ui-button-text.ui-button-text:hover{color:#666}.user-profile-menu.user-profile-menu{background:#ddd;color:#333}.user-micropost-unit.user-micropost-unit{color:#333}.ritsu-menu-container li{color:#666}.ritsu-menu-container li.selected{color:#222}.ritsu-menu-container li:hover{background:#fff}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,'.lookup-button{border:0;padding:0;background:none;margin-right:.5em;margin-top:-4px}.sort-button{width:20px;height:20px;font-weight:normal;text-transform:none}.sort-button>span{padding:0;margin-top:-4px}.sort-button>div.navigation-dropdown-content{text-align:left;width:180px;top:92px}.sort-button>div.navigation-dropdown-content>div{padding:7px;font-weight:500}.sort-button>div.navigation-dropdown-content>li{display:list-item;list-style:"   "}.sort-button>div.navigation-dropdown-content>li.selected{list-style:"✓"}',""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,".user-profile-bottom{width:100%;height:100%;overflow:clip;max-height:480px}.user-profile-menu{max-height:700px;height:700px;position:relative}.user-comment-input-background{height:75px}.user-comment-input{resize:none;height:75px;line-height:normal}.user-micropost-input{max-height:133px;min-height:35px}.user-microposts{height:auto;max-height:400px}.room-component-input-textarea{bottom:0;max-height:133px}.room-component-input{bottom:0;height:auto;max-height:133px;min-height:35px;padding-top:4px;padding-bottom:4px}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,".user-profile-picture-wrapper:hover .user-profile-picture-hover{display:inline-flex}.user-profile-picture-wrapper .user-profile-picture-hover{flex-direction:column;padding:0;justify-content:center;align-items:center}.room-component-message-avatar{color:transparent}#ritsu-profile-picture-upload{display:none}.ritsu-avatar-karma-warning{position:absolute;top:116px;left:0px}html.hidePfp .room-component-message-left,html.hidePfp .navigation-notification-unit-image{display:none}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,"a.ritsu-message-anchor{text-decoration:underline}.material-icons-inline{font-size:inherit}.material-icons{user-select:none}html.largerText .room-component-message-text{font-size:1.3rem}.bio-image{padding:.3em;margin:.5em;background-color:var(--ritsu-hair-color);color:#000;display:inline-block;user-select:none;border-radius:.3em;font-size:.8em}.bio-expand{color:#00abf3;font-weight:bold;cursor:pointer}",""]),e.exports=o},function(e,t,n){var o=n(1)(!1);o.push([e.i,".embed{width:auto !important;height:auto !important;object-fit:contain;margin-top:2px}.img-fluid{width:100%;height:100%;max-width:300px;max-height:300px;object-fit:contain}.spotify{width:100%;max-width:300px;border-radius:6px;frameborder:0}",""]),e.exports=o},function(e,t,n){"use strict";n.r(t);var o={};n.r(o),n.d(o,"setPrefix",(function(){return f})),n.d(o,"setLogger",(function(){return p})),n.d(o,"log",(function(){return h})),n.d(o,"info",(function(){return g})),n.d(o,"warning",(function(){return v})),n.d(o,"error",(function(){return b}));var i={};n.r(i),n.d(i,"subscriptable",(function(){return y})),n.d(i,"loggingResponseHandler",(function(){return w})),n.d(i,"noopResponseHandler",(function(){return R}));var r={};n.r(r),n.d(r,"unpack",(function(){return Lt})),n.d(r,"compress",(function(){return Bt})),n.d(r,"parse",(function(){return zt}));var a="ritsu-emerald",s="Ritsu x Emerald",c="RxE",l="0.11.3.3",u="https://i.imgur.com/KLtVhho.png";let d="",m=console;function f(e){d=e}function p(e){m=e}function h(e){m.log(d,e)}function g(e){m.info(d,e)}function v(e){m.warn(d,e)}function b(e){m.error(d,e)}function y(e){const t=new Set;return{subscribe:e=>{t.add(e)},unsubscribe:e=>{t.delete(e)},handler:(n,o)=>("set"===n.action&&t.forEach(e=>e(n.preference)),e(n,o))}}function w(e,t){const n=e.response;switch(n.status){case 0:return n;case 1:return"get"===e.action&&(v(`The saved value for preference '${e.preference.key}' (${JSON.stringify(n.saved)}) was invalid. Replacing it with ${JSON.stringify(n.value)}.`),t.set(e.preference,n.value)),"set"===e.action&&v(`Could not set value ${JSON.stringify(n.value)} for preference '${e.preference.key}' because it was invalid.`),n;case 2:return"get"===e.action&&(v(`The saved value for preference '${e.preference.key}' had the wrong type. Replacing it with ${JSON.stringify(n.value)}.`),t.set(e.preference,n.value)),n;case 3:return"get"===e.action&&(v(`The saved value for preference '${e.preference.key}' could not be parsed. Replacing it with ${JSON.stringify(n.value)}.`),t.set(e.preference,n.value)),n;case 4:switch(e.action){case"get":b(`Could not read preference '${e.preference.key}' because localStorage could not be accessed. Using value ${JSON.stringify(e.preference.default)}.`);break;case"set":b(`Could not save value ${JSON.stringify(e.response.value)} for preference '${e.preference.key}' because localStorage could not be accessed.`);break;default:A(e.action)}return n;default:return A(n.status)}}function R(e,t){return e.response}function A(e){throw new Error("assertUnreachable: "+e)}var k="undefined"!=typeof unsafeWindow?unsafeWindow:window;function C(e,t){return void 0===t?e:t}function x(e,t){switch(!0){case Number.isNaN(t):return"NaN";case t===1/0:return"Infinity";case t===-1/0:return"-Infinity";default:return t}}function M(e){return JSON.stringify(e,x)}const N=[function(e){return"boolean"==typeof e},function(e){return"number"==typeof e},E,function(e){return"symbol"==typeof e},U,function(e){return void 0===e}];function E(e){return"string"==typeof e}function U(e){return null===e}function S(e){return N.some(t=>t(e))}function P(e,t,n){return o=`${e.name}(${t.name})`,i=n,Object.defineProperty(i,"name",{value:o,writable:!1});var o,i}function _(e){return S(e)?e=>!1:P(_,e,t=>t instanceof e)}function O(e,t){t.constraints=e.concat(C([],t.constraints))}class j{constructor(e){if(""===e.key)throw new TypeError(`Empty preference key in this ${this.getClassName()}:\n${M(e)}`);this.key=e.key,this.default=e.default,this.label=e.label,this.description=C("",e.description),this.constraints=C([],e.constraints),this.dependencies=C([],e.dependencies),this.extras=C({},e.extras);const t=this.validate(e.default);E(t)&&this.invalidValue(e.default,t)}validate(e){const t=this.constraints;for(let n=0,o=t.length;n<o;n++){const o=t[n];if(!o.requirement(e))return o.message(e)}return{value:e}}toValid(e){return E(this.validate(e))?this.default:e}toString(){return`${this.getClassName()} '${this.key}'`}invalidValue(e,t){throw new Error(`${M(e)} is not a valid value for ${this}. Reason: ${t}`)}}class T extends j{constructor(e){const t=C(0,e.minLength),n=C(1/0,e.maxLength),o=[];if(e.multiline||o.push({requirement:e=>!e.includes("\n"),message:e=>"Line breaks are not allowed."}),t>0&&o.push({requirement:e=>e.length>=t,message:e=>`Minimum length is ${t} characters.`}),n<1/0&&o.push({requirement:e=>e.length<=n,message:e=>`Maximum length ${n} exceeded.`}),O(o,e),super(e),t<0)throw new Error(`Parameter 'minLength' cannot be negative, but it was ${t} in ${this}.`);this.multiline=e.multiline,this.maxLength=n,this.minLength=t}getClassName(){return"StringPreference"}toValid(e){const t=e.substring(0,this.maxLength);return super.toValid(this.multiline?t:t.replace(T.REGEX_LINE_BREAKS," "))}fromString(e){return this.validate(e)}}T.REGEX_LINE_BREAKS=/\n+/g;class I extends j{getClassName(){return"BooleanPreference"}}class D extends j{getClassName(){return"ListPreference"}}class F extends j{constructor(e){const t=e.options;if(O([{requirement:e=>t.some(t=>t.value===e),message:e=>M(e)+" is not among the available options."}],e),super(e),t.length<2)throw new Error(`Parameter 'options' has less than two elements in ${this}.`);const n=[];t.forEach(e=>{const t=this.validate(e.value);if(E(t))throw new Error(`Option value ${M(e.value)} in ${this} is invalid. Reason: ${t}`);if(n.indexOf(e.value)>-1)throw new Error(`Multiple options with value ${M(e.value)} in ${this}.`);n.push(e.value)}),this.options=t}getClassName(){return"MultichoicePreference"}toValid(e){return this.default}}class L extends j{static postParse(e,t){return E(t)?t:e.validate(t.value)}constructor(e){O([{requirement:Number.isFinite,message:e=>e+" is not a finite number."}],e),super(e)}}class B extends L{constructor(e){O([B.CONSTRAINT_INTEGER],e),super(e)}getClassName(){return"IntegerPreference"}static parse(e){const t=parseInt(e,10);return Number.isNaN(t)?`"${e}" is not an integer.`:{value:t}}toValid(e){return super.toValid(Math.round(e))}fromString(e){return L.postParse(this,B.parse(e))}}var z;B.CONSTRAINT_INTEGER={requirement:Number.isInteger,message:e=>e+" is not an integer."},function(e){e.OK="OK",e.ABSENT="ABSENT",e.TYPE_ERROR="TYPE_ERROR",e.JSON_ERROR="JSON_ERROR",e.STORAGE_ERROR="STORAGE_ERROR",e.NUMBER_ERROR="NUMBER_ERROR"}(z||(z={}));const G=()=>localStorage;function V(e,t,n){try{const o=function(e,t,n){if(null===e)throw new DOMException;const o=e.getItem(t);if(U(o))return null;const i=JSON.parse(o);if(function e(t){for(const e of N)if(e(t))return t=>e(t);if(_(Array)(t)){const n=t;return t=>_(Array)(t)&&(!(n.length>0)||t.every(e(n[0])))}if(t.constructor===Object)return n=>![void 0,null].includes(n)&&Object.keys(t).every(o=>e(t[o])(n[o]));if(t.constructor instanceof Function)return _(t.constructor);throw new TypeError(e.name+" cannot use this object as reference because it has no constructor: "+JSON.stringify(t))}(n)(i))return i;throw new TypeError("Saved value had wrong type.")}(e(),t,n);return U(o)?{status:"ABSENT",value:n}:{status:"OK",value:o}}catch(e){return{status:_(SyntaxError)(e)?"JSON_ERROR":_(TypeError)(e)?"TYPE_ERROR":"STORAGE_ERROR",value:n}}}function K(e,t,n){try{return function(e,t,n){const o=JSON.stringify(n,(e,t)=>{if("number"==typeof t&&!Number.isFinite(t))throw new RangeError(t.toString());return t});if(null===e)throw new DOMException;e.setItem(t,o)}(e(),t,n),{status:"OK",value:n}}catch(e){return{status:_(RangeError)(e)?"NUMBER_ERROR":_(SyntaxError)(e)||_(TypeError)(e)?"JSON_ERROR":"STORAGE_ERROR",value:n}}}function q(e,t){try{return e().removeItem(t),{status:"OK",value:!0}}catch(e){return{status:"STORAGE_ERROR",value:!1}}}var J;!function(e){e[e.OK=0]="OK",e[e.INVALID_VALUE=1]="INVALID_VALUE",e[e.TYPE_ERROR=2]="TYPE_ERROR",e[e.JSON_ERROR=3]="JSON_ERROR",e[e.STORAGE_ERROR=4]="STORAGE_ERROR"}(J||(J={}));const H=(e,t)=>e.response;function W(e){return`Unknown preference:\n\n${M(e)}.`}function Y(e){switch(e){case"OK":case"ABSENT":return 0;case"NUMBER_ERROR":return 1;case"TYPE_ERROR":return 2;case"JSON_ERROR":return 3;case"STORAGE_ERROR":return 4}}var Q=Object.assign(Object.assign(Object.assign(Object.assign({title:`${s} ${l}`,themeTitle:"Choose your theme"},!1),{generalTitle:"General Settings",imagesTitle:"Image Settings",messageTitle:"Message Settings",mutelistTitle:"Permanent Mutes",advancedTitle:"Advanced Settings",preferences:Object.assign(Object.assign({theme:{label:"Theme",description:"Reskin the chat"}},!1),{adBlocker:{label:"Remove ads and nags"},fancyColors:{label:"Choose your own flair color"},imgControl:{label:"Block and favorite images"},imgProtect:{label:"Hide images from low karma accounts"},imgBlur:{label:"Blur user images"},hidePfp:{label:"Hide profile pictures in chat"},showInfo:{label:"Show extra user info"},antiSpam:{label:"Mute spammers automatically"},showGender:{label:"Show gender on profile pictures"},trackKarma:{label:"Show live karma & flash changes"},mutelist:{label:"Perma mute list"},userSort:{label:"Sort users by..","name.asc":"Name Asc.","name.desc":"Name Desc.","age.asc":"Account age Asc.","age.desc":"Account age Desc."},blockReqs:{label:"Block friend requests from new accounts"},highlightMentions:{label:"Highlight your name when you're mentioned"},altpfpBackground:{label:"Choose the background colour for transparent pictures"},bigEmoji:{label:"Jumbo-sized emoji"},hideImageFallback:{label:"Hide your images from non-RxE users"},ignoreURLBlacklist:{label:"Ignore URL blacklist"},imgurAPIKey:{placeholder:"Imgur API Key",label:"Leave blank for default"},muteRegexes:{label:"Mute users matching"},toggleEmbeds:{label:"Show embeds"},largerText:{label:"Increase text size"},showAnimatedImages:{label:"Show GIFs"}}),hiddenChannels:"hidden channels",WFAF:"WFAF ⌛",privateRooms:"Private Rooms 🔒",privateRoomsPrompt:"Enter a private room key:\nOnly people with the key can enter this room.",privateRoomsWarning:"Chat history and user list is not available in unlisted rooms."}),!1),{introduction:{title:"Welcome to RxE.",content:"How do you want to use Emerald?",presetsTitle:"Choose your preset",presets:{safe:{title:"Safe",content:"Block requests from new accounts. Images from low karma accounts are hidden, all others blurred. GIFs and embeds are not shown."},normal:{title:"Normal",content:"Anyone can add you. Images from low karma accounts are hidden. GIFs and embeds are shown."},unsafe:{title:"Wild West",content:"Anyone can add you. No restrictions on images or profile pictures."}}}});const Z=null;var X;!function(e){e[e.None=0]="None",e[e.Hide=1]="Hide",e[e.Reject=2]="Reject"}(X||(X={}));const ee={theme:new T({key:"theme",label:Q.preferences.theme.label,description:Q.preferences.theme.description,default:"ritsu",multiline:!1}),adBlocker:new I({key:"adBlocker",label:Q.preferences.adBlocker.label,default:!0}),fancyColors:new I({key:"fancyColors",label:Q.preferences.fancyColors.label,default:!0}),imgControl:new I({key:"imgControl",label:Q.preferences.imgControl.label,default:!0}),imgProtect:new I({key:"imgProtect",label:Q.preferences.imgProtect.label,default:!0}),imgBlur:new I({key:"imgBlur",label:Q.preferences.imgBlur.label,default:!1}),hidePfp:new I({key:"hidePfP",label:Q.preferences.hidePfp.label,default:!1}),showInfo:new I({key:"showInfo",label:Q.preferences.showInfo.label,default:!0}),antiSpam:new I({key:"antiSpam",label:Q.preferences.antiSpam.label,default:!0}),permaMuteList:new D({key:"permaMuteList",label:Q.preferences.mutelist.label,default:[]}),showGender:new I({key:"showGender",label:Q.preferences.showGender.label,default:!0}),trackKarma:new I({key:"trackKarma",label:Q.preferences.trackKarma.label,default:!0}),blockedHashes:new D({key:"blockedHashes",label:"blockedHashes",default:[]}),savedPictures:new D({key:"savedPictures",label:"savedPictures",default:[]}),userSort:new T({key:"userSort",label:Q.preferences.userSort.label,default:"name.asc",multiline:!1}),blockReqs:new F({key:"blockReqs",label:Q.preferences.blockReqs.label,default:0,options:[{value:X.None,label:"Off"},{value:X.Hide,label:"Hide"},{value:X.Reject,label:"Reject"}]}),highlightMentions:new I({key:"highlightMentions",label:Q.preferences.highlightMentions.label,default:!0}),altpfpBackground:new T({key:"altpfpBackground",label:Q.preferences.altpfpBackground.label,default:"#fff",multiline:!1}),bigEmoji:new I({key:"bigEmoji",label:Q.preferences.bigEmoji.label,default:!0}),toggleEmbeds:new I({key:"toggleEmbeds",label:Q.preferences.toggleEmbeds.label,default:!0}),largerText:new I({key:"largerText",label:Q.preferences.largerText.label,default:!1}),imgurLastUploadTimes:new D({key:"imgurLastUploadTimes",label:"imgurLastUploadTimes",default:[]}),imgurPfpAlbum:new D({key:"imgurPfpAlbum",label:"imgurPfpAlbum",default:[]}),hideImageFallback:new I({key:"hideImageFallback",label:Q.preferences.hideImageFallback.label,default:!1}),imgurDeleteHashes:new D({key:"imgurDeleteHashes",label:"imgurDeleteHashes",default:[]}),ignoreURLBlacklist:new I({key:"ignoreURLBlacklist",label:Q.preferences.ignoreURLBlacklist.label,default:!1}),imgurAPIKey:new T({key:"imgurAPIKey",label:Q.preferences.imgurAPIKey.label,default:"",multiline:!1}),muteRegexes:new D({key:"muteRegexes",label:Q.preferences.muteRegexes.label,default:[]}),showAnimatedImages:new I({key:"showAnimatedImages",label:Q.preferences.showAnimatedImages.label,default:!0}),introductionCompletedVersion:new B({key:"introductionCompletedVersion",label:"introductionCompletedVersion",default:0})},te=Object.assign(Object.assign({},ee),Z),ne=new class{constructor(e,t,n=H){this.localStoragePrefix=t,this.responseHandler=n,this.cache=new Map;const o=[],i=function e(t){return Object.values(t).reduce((t,n)=>t.concat(_(j)(n)?n:e(n.h)),[])}(e);i.forEach(e=>{const t=e.key;if(o.includes(t))throw new Error(`Duplicate preference key ${M(t)}.`);this.cache.set(e,e.default),o.push(t)}),i.forEach(e=>{e.dependencies.forEach(t=>{if(void 0===this.cache.get(t.preference))throw new Error(`Dependency error in ${e}: ${W(t.preference)}`)})})}get(e){return this.getWith(this.responseHandler,e)}set(e,t){this.setWith(this.responseHandler,e,t)}getWith(e,t){return e({action:"get",preference:t,response:this.getRaw(t)},this).value}setWith(e,t,n){e({action:"set",preference:t,response:this.setRaw(t,n)},this)}reset(e){var t;this.getFromCacheOrThrowIfUnknown(e),t=this.localStoragePrefix+e.key,q(G,t)}resetAll(){for(const e of this.cache.keys())this.reset(e)}shouldBeAvailable(e){return e.dependencies.every(e=>e.condition(this.getRaw(e.preference).value))}getRaw(e){const t=this.getFromCacheOrThrowIfUnknown(e),n=(o=this.localStoragePrefix+e.key,i=e.default,V(G,o,i));var o,i;if("OK"===n.status){const t=n.value;return E(e.validate(t))?{status:1,value:e.toValid(t),saved:t}:{status:0,value:t}}return{status:Y(n.status),value:t}}setRaw(e,t){if(this.getFromCacheOrThrowIfUnknown(e),E(e.validate(t)))return{status:1,value:t};this.cache.set(e,t);const n=function(e,t){return K(G,e,t)}(this.localStoragePrefix+e.key,t);return{status:Y(n.status),value:n.value}}getFromCacheOrThrowIfUnknown(e){const t=this.cache.get(e);if(void 0===t)throw new Error(W(e));return t}}(te,a+"-preference-",i.loggingResponseHandler);var oe=n(0),ie=n.n(oe);const{max:re,min:ae}=Math,se=(e,t={})=>Object.assign(document.createElement(e),t),ce=[];function le(e){ce.push(e),Promise.resolve().then(()=>{if(!ce.length)return;const e=ce.join("\n");ce.length=0,document.head.append(se("style",{type:"text/css",textContent:e}))})}function ue(e,t,n,o=!1){const i=e[t];e[t]=function(...e){const t=o&&n.apply(this,e);let r=null;return o&&!1===t||(r=i.apply(this,e)),o||n.apply(this,e),r}}function de(e,t){return function(e,t){const n=[];for(let o=0;o<e.length;o+=t){const i=e.slice(o,o+t);n.push(i)}return n}(e.split(""),t).map(e=>e.join(""))}let me;function fe(e){clearTimeout(me),Promise.resolve().then(()=>null===RoomClient||void 0===RoomClient?void 0:RoomClient.print_append(ie.a.createElement("div",null,e)))}function pe(e){fe(e),document.body.classList.add("tmp-message"),me=+setTimeout(()=>{null===RoomClient||void 0===RoomClient||RoomClient.print_append(),document.body.classList.remove("tmp-message")},5e3)}const he=(e=0)=>new Promise(t=>setTimeout(t,e));var ge;function ve(e){return(t,n)=>e(n,t)}!function(e){e.string=(e,t)=>e.localeCompare(t),e.numeric=(e,t)=>e-t}(ge||(ge={}));function be(e,t,n,o,i=!1){return function(e,t,n,o=!1){const i=o?e:Array.from(e),r="asc"===n?t:ve(t);return i.sort(r),i}(e,(r=t,a=n,(e,t)=>a(e[r],t[r])),o,i);var r,a}const ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",we=Array.from({length:65},(e,t)=>String.fromCodePoint(t+917536)).join("");function Re(e){const t=btoa(e);let n="";for(let e=0;e<t.length;e+=1){const o=ye.indexOf(t[e]);if(-1===o)return null;n+=we[2*o]+we[2*o+1]}return n}function Ae(e){return null==e?[]:e.filter(e=>null!=e)}function ke(e){return+new Date-+new Date(e)}function Ce(e,t,n){let o=!1;return e.flatMap(e=>{o=!o;const i=o?t(e):n(e);return null===i?[]:i instanceof Array?i:[i]})}function xe(e,t,n){if(0===t.length)return[e];const o=t.flatMap(e=>{if("number"==typeof e){if(void 0===n)throw new Error("Length must not be undefined if matches is of type number[]");return[e,e+n]}const[t,o]=e;return[t,t+o]});o.push(void 0);return o.map((t,n,{[n-1]:o})=>e.slice(null!=o?o:0,t))}function Me(e,t,n,o){const i=Array.from(e.matchAll(t)).map(e=>{if(void 0===e.index)throw new Error("So TypeScript really was right about match.index");return[e.index,e[0].length]});return Ce(xe(e,i),o,n)}function Ne(e,t,n,o,i=!1){const r=function(e,t,n=!1){let o=n?e:e.toLowerCase();const i=n?t:t.toLowerCase(),r=[];let a=0;for(;o.length>0;){if(a=o.indexOf(i),-1===a)return r;r.push(a+e.length-o.length),o=o.slice(a+Math.max(i.length,1))}return r}(e,t,i);return Ce(xe(e,r,Math.max(t.length,1)),o,n)}function Ee(e){const t=Math.abs(e)>=1e3?(e/1e3).toPrecision(3)+"K":""+e;return e>=0?"+"+t:""+t}function Ue(e,t=""){const n=e.split(t).sort(),o=n.length;return n.filter((e,t,n)=>e!==n[t-1]).map(e=>n.reduce((t,n)=>n===e?t+1:t,0)).map(e=>e/o).reduce((e,t)=>e+-t*Math.log2(t),0)}function Se(e){const t=(e+e).indexOf(e,1);return t>-1&&t!==e.length?e.length/t:0}const $e={allowSpace:!1,otherKeysPreventDefault:!1,otherKeysStopPropagation:!1};function Pe(e,{allowSpace:t,otherKeysStopPropagation:n,otherKeysPreventDefault:o}=$e){return{onClick:e,onKeyUp:i=>{"Enter"===i.key||t&&""===i.key?e(i):(n&&i.stopPropagation(),o&&i.preventDefault())}}}function _e(...e){if(0===e.length)throw new Error("Must supply at least one RegExp");const t=e[e.length-1],n="string"==typeof t,o=e.slice(0,n?-1:0),i="string"==typeof t?t:t.flags;return new RegExp(o.map(e=>"string"==typeof e?e:e.source).join(""),i)}class Oe extends Error{}function je(e){if("number"!=typeof e)return e}function Te(e){return null===e?NaN:"number"==typeof e?e:e.id}function Ie(e){return Array.isArray(e)?e:[e]}var De=n(7),Fe=n.n(De);const Le=["captcha","youtube","about:blank","open.spotify.com","i.redd.it","ibb.co"];function Be(){if(!ne.get(ee.adBlocker))return;Array.from(document.querySelectorAll("iframe")).forEach(e=>{const{src:t}=e;t&&!Le.some(e=>t.includes(e))&&e.remove()})}function ze(e){var t;return null!==(t=Array.from(e.matchAll(/\[?rxe-pfp:?([A-Za-z0-9+/=\u{E0020}-\u{E005F}]+)\]?/gu)).map(e=>e[1]).slice(-1)[0])&&void 0!==t?t:null}function Ge(e){const t=Array.from(e.matchAll(/\[?rxe-pfp:?([A-Za-z0-9+/=\u{E0020}-\u{E005F}]+)\]?/gu)).map(e=>e.index).filter(e=>void 0!==e).slice(-1)[0];return e.slice(0,t)}async function Ve(e,t){return new Promise((n,o)=>{const i={display_name:e.display_name,bio:t,flair:{color:e.flair.color},gender:e.gender};$.ajax({type:"GET",url:"/update_profile?"+$.param(i),dataType:"json",success(){null===UserProfileReact||void 0===UserProfileReact||UserProfileReact.load(e.id),Qt(t),n()},error:()=>o()})})}async function Ke(e,t){await Ve(e,function(e,t){const n=Ge(e);return n+("\n"===n[n.length-1]?"":"\n")+(e=>`[rxe-pfp:${e}]`)(t)}(e.bio,t))}var qe;!function(e){e[e.Created=0]="Created",e[e.Alive=1]="Alive",e[e.Destroyed=2]="Destroyed"}(qe||(qe={}));const Je=new Map;class He{constructor(e,t=!1){this.state=qe.Created,this.preference=e,t&&this.load()}assertAlive(){if(this.state===qe.Destroyed)throw new Error("Attempted to use destroyed ListPreferenceCache object");if(this.state===qe.Created)throw new Error("Attempted to use uninitialized ListPreferenceCache object")}get store(){return this.assertAlive(),this.realStore}set store(e){this.assertAlive(),this.realStore=e}destroy(){this.assertAlive(),this.state=qe.Destroyed,this.preference&&Je.delete(this.preference.key)}load(){const{preference:e}=this;if(Je.has(e.key)&&Je.get(e.key)!==this)throw new Error(He.ERR_PREF_IN_USE);Je.set(e.key,this),this.state=qe.Alive,this.loadFrom(ne.get(this.preference))}save(){ne.set(this.preference,this.asSaved())}}He.ERR_PREF_IN_USE="Cannot create multiple ListPreferenceCache instances     linked to the same preference. Hint: .destroy() the previous instance";class We extends He{setItem(e,t){this._setItem(e,t),this.save()}addItem(e,t){this.setItem(e,t)}removeItem(e){const t=this._removeItem(e);return this.save(),t}}class Ye extends He{add(e){this._add(e),this.save()}remove(e){const t=this._remove(e);return this.save(),t}}class Qe extends Ye{hasItem(e){return this.store.has(e)}hasKey(e){return!1}values(){return[...this.store.values()]}entries(){return this.values()}_add(e){this.store.add(e)}_remove(e){return this.store.delete(e)}asSaved(){return this.values()}loadFrom(e){this.store=new Set(e)}}class Ze extends We{hasKey(e){return this.store.has(e)}hasItem(e){return this.values().some(t=>t===e)}getItem(e){return this.store.get(e)}_removeItem(e){return this.store.delete(e)}_setItem(e,t){return this.store.set(e,t)}values(){return[...this.store.values()]}entries(){return[...this.store.entries()]}asSaved(){return[...this.store.entries()]}loadFrom(e){this.store=new Map(e)}static just(e,t){const n=new Ze(t,!0);e(n),n.destroy()}static addItem({key:e,item:t},n){return Ze.just(n=>n.addItem(e,t),n)}static removeItem({key:e},t){return Ze.just(t=>t.removeItem(e),t)}}const Xe=e=>`\n\t · ${JSON.stringify(e)} (U+${e.charCodeAt(0).toString(16).padStart(4,"0").toUpperCase()})`;function et(e){return e.replace(/(\S)\.([a-z][a-z])/gi,"$1%2E$2").replace(/https?:\/\//gi,"")}const tt=e=>e.replace(/%2E/gi,".").replace(/\s?\(\s?(\.|dot)\s?\)\s?/g,".").replace(/\.\u200b/g,"."),nt=_e("(?:",["%2E","dot",/\./.source,/ ?\( ?(?:\.|dot) ?\) ?/.source].join("|"),")","").source,ot=/(https?:\/\/)?/.source,it=/[-a-z0-9@:%_+[\]~#?&=]/.source,rt=()=>_e(...[/\bi\.ibb\.co\/[a-z0-9]+\/[^\s.]+\.[a-z0-9]+\b/gi,/\bi\.redd\.it\/[a-z0-9]+\.[a-z0-9]+\b/gi,/\bi\.imgur\.com\/[a-z0-9]+\.[a-z0-9]+\b/gi].map(e=>`(${e.source})`).join("|"),"gi"),at=()=>ne.get(ee.imgurLastUploadTimes),st=()=>at().filter(e=>ke(new Date(e))<=108e5),ct=()=>st().length<50;function lt(){var e;e=[...at(),+new Date].slice(-50),ne.set(ee.imgurLastUploadTimes,e)}const ut=`You can upload 50 new images per ${$.timeago(+new Date-108e5)}.`,dt=()=>ne.get(ee.hideImageFallback),mt="https://api.imgur.com/3/image/",ft=Re("rxe-imgur:"),pt=()=>new RegExp(`imgur${nt}com/([a-z0-9]+)`,"i"),ht=e=>`https://i.imgur.com/${e}.png`,gt=()=>({Authorization:"Client-ID "+(ne.get(ee.imgurAPIKey)||"b8f69bdcc4d1373")});function vt({id:e,payload:t}){return{url:ht(e),payload:t,version:"0.11.0"}}function bt(e){return dt()?`${ft}${Re(e)}`:et(ht(e))}async function yt(e){const t=new FormData;t.append("image",e);const n=await fetch(mt,{method:"POST",headers:gt(),body:t});if(!n.ok)throw new Error(n.statusText);const{data:o}=await n.json(),{id:i,deletehash:r}=o;return Ze.addItem({key:i,item:r},ee.imgurDeleteHashes),lt(),{id:i,payload:bt(i)}}function wt(e,t=!0){const n=e.match(pt());return n&&vt({payload:t?bt(n[1]):et(n[0]),id:n[1]})}function Rt(e){var t;const n=wt(e,!1);if(n)return n;const o=null===(t=e.match(new RegExp(ft+"(\\S*)")))||void 0===t?void 0:t[1];if(void 0===o)return null;return vt({id:function(e){let t="";for(let n=1;n<e.length;n+=2){const o=we.indexOf(e[n]);if(-1===o)throw new Error("bad image path");t+=ye[(o-1)/2]}return atob(t)}(o),payload:o})}const At=["You are uploading your image to ",ie.a.createElement("a",{href:"https://imgurinc.com/privacy"},"Imgur"),". Anyone with the link can save or share it."];var kt=n(2),Ct=n.n(kt);const xt="https://github.com/Ritsu-Projects/Public-Releases/",Mt=et(xt),Nt=(e,t)=>`${t} · ${dt()?"Can't see it":"See just a link"}? Get RxE ${e}+: ${Mt}`;function Et(e){const t=/\w/.test(e.payload)?"Image: "+e.payload:`[Image${e.payload}]`;return Math.random()<.5?Nt(e.version,t):t}function Ut({url:e}){return ie.a.createElement(MessagePicture,{picture:{url:e}})}function St({url:e},t=App.user){return{user:t,messages:[],picture:{url:e}}}function $t(e){return Rt(e)}async function Pt(e){return async function(e){return vt(await yt(e))}(e)}const _t={ratelimit:ut,destination:At,lowKarma:"Warning: Due to low karma, images sent by you may be hidden from other users."};var Ot=n(8),jt=n.n(Ot);const Tt=()=>ie.a.createElement(MenuMicro,null,ie.a.createElement(PictureUpload,null));function It(e){const{text:t}=e;return ie.a.createElement("div",null,ie.a.createElement("b",null,"Note"),": ",t)}function Dt(e){const{failureReason:t}=e;return ie.a.createElement("div",{className:"picture-upload-error"},ie.a.createElement("div",null,"We couldn't upload your picture."),ie.a.createElement("div",null,"Reason: ",ie.a.createElement("span",{className:"picture-upload-error-reason"},t)))}function Ft(){le(jt.a),Room.prototype.room_input=function(){return ie.a.createElement("div",{className:"room-component-input"},ie.a.createElement("textarea",{id:"room-input",className:"room-component-input-textarea",onMouseDown:()=>this.scroll(),onKeyDown:e=>this.input(e),placeholder:"Say Something..."}),ie.a.createElement("span",{className:"room-component-input-icon material-icons",title:"Attach image",onMouseDown:()=>this.upload_picture(),role:"button",tabIndex:0},"photo_camera"))},PictureUpload.prototype.body=function(){const{failureReason:e}=this.state,t=ct(),n=ie.a.createElement("div",{className:"picture-upload-info"},ie.a.createElement(It,{text:_t.destination}),ie.a.createElement(It,{text:_t.ratelimit}),App.user._karma<10&&ie.a.createElement(It,{text:_t.lowKarma}),e&&ie.a.createElement(Dt,{failureReason:e})),o=t?" Choose a file":` Wait ${$.timeago(function(){const e=st().slice(0,-49);if(0===e.length)return 0;const t=Math.max(...e);return+new Date+(108e5-ke(new Date(t)))}())} before uploading again.`,i=ie.a.createElement("label",{htmlFor:"image"},ie.a.createElement("span",{className:"material-icons upload-thing",style:{cursor:t?"pointer":"not-allowed"}},t?"cloud_upload":"hourglass_top"),o),r=ie.a.createElement("input",{id:"image",className:"picture-upload-button",name:"image",type:"file",accept:"image/*",disabled:!t,onChange:()=>{var e;return t&&(null===(e=this.uploadImage)||void 0===e?void 0:e.call(this))}});return ie.a.createElement("form",{id:"picture_upload",name:"picture_upload","data-remote":"true",method:"post",action:mt},r,i,n)}}function Lt(){throw new Error("Format0 support removed")}async function Bt(){throw new Error("Format0 support removed")}function zt(e){return e}const Gt="0",Vt="i";const Kt={0:r,i:{unpack:e=>ht(e),compress:async e=>(await yt(e)).id,parse:e=>function(e){const t=e.match(pt());return t?t[1]:null}(e)}};function qt(e,t){if(!(t in Kt))throw new Error(`Format '${t}' not implemented`);const n=Kt[t].parse(e);return null===n?null:t+n}const Jt={feed:{name:"Feed"},info:{name:"Info"},pictures:{name:"My Album"}};function Ht(){const{id:e}=App.user;MenuReactMicro.close(),null===UserProfileReact||void 0===UserProfileReact||UserProfileReact.load(e)}function Wt(...e){return e.map(e=>{return t=e,n=(null===UserProfileReact||void 0===UserProfileReact?void 0:UserProfileReact.state.tab)===e,ie.a.createElement("div",{onMouseDown:null===UserProfileReact||void 0===UserProfileReact?void 0:UserProfileReact.switch_tab.bind(UserProfileReact,t),className:n?"user-profile-tab user-profile-tab-active":"user-profile-tab"},Jt[t].name);var t,n})}function Yt(){PictureAlbum.prototype.set_display_picture=function(e){const t=qt(e.url,Vt);t&&(Ke(App.user,t),Ht())},PictureAlbum.prototype.delete_picture=function(e){const t=qt(e.url,Vt),n=[...ne.get(ee.imgurPfpAlbum)];t&&n.includes(t)&&(n.splice(n.indexOf(t),1),ne.set(ee.imgurPfpAlbum,n),Ht())},UserProfile.prototype.tabs=function(){const e=["feed","info"];return this.state.data.user.id===App.user.id&&e.push("pictures"),ie.a.createElement("div",null,...Wt(...e))},PictureAlbum.prototype.add_to_album=function(){PictureUploader.onUploaded=function(e){const{url:t}=e;Qt(t),Ht()}},PictureAlbum.prototype.upload_picture=function(){Ct.a.render(Tt(),document.getElementById("ui-hatch-2"))},PictureAlbum.prototype.componentDidMount=function(){const e=ne.get(ee.imgurPfpAlbum).map(e=>({url:7===e.length?ht(e):ht(e.substring(1))}));this.setState({pictures:e,loaded:!0})}}function Qt(e){let t=ze(e);const n=e.match(pt());7!==(null==t?void 0:t.length)&&n&&(t="i"+n[1]);const o=ne.get(ee.imgurPfpAlbum);o&&t&&!o.includes(t)&&(ne.set(ee.imgurPfpAlbum,[...o,t]),null===UserProfileReact||void 0===UserProfileReact||UserProfileReact.load(App.user.id))}n(9);function Zt(e){const t=e instanceof Array?e.join(""):e;return{message:t,uppercase:t.split("").filter(e=>e.toLowerCase()!==e),entropySplit:Ue(t,/\s+/),entropy:Ue(t),repeating:Se(t),noLowerCase:t.toUpperCase()===t}}function Xt(e){var t,n,o;const i=null===(t=je(e))||void 0===t?void 0:t.created_at;return{accountCreated:i?new Date(i):new Date,id:Te(e),displayName:null!==(o=null===(n=je(e))||void 0===n?void 0:n.display_name)&&void 0!==o?o:""}}var en,tn;(tn=en||(en={})).legacy=function(e,{messages:t}){const n=Date.now(),{message:o,uppercase:i}=Zt(t);e.scoreLegacy+=(1e3/(ke(e.lastMessageTime)||n))**.2,e.scoreLegacy/=Math.max(1/Math.E,Math.E-Math.log(10+o.length+i.length)/4)},tn.strikeBased=function(e,t){const{max:n,log10:o}=Math,i=Date.now(),{accountCreated:r}=Xt(t.user),{message:a,entropySplit:s,noLowerCase:c,repeating:l}=Zt(t.messages),u=i-e.lastMessageTime||1500;if(u<=1e3?e.scoreStrikes+=1:u>2e3&&(e.scoreStrikes=n(0,e.scoreStrikes-o(u))),ke(r)<6e5){const t=a.length>200;(s<2||l>3)&&t&&(e.scoreStrikes+=1),e.scoreStrikes*=c?3:2}},tn.experimental=function(e,t){const{max:n,abs:o}=Math,{accountCreated:i}=Xt(t.user),r=Zt(t.messages),{entropy:a,uppercase:s}=r,c=r.message.trim(),{length:l}=c,u=l?l**-.2:1,d=l?l/n(s.length+l-3,l):1,m=.75*(ke(i||new Date)/864e5)**.1,f=a*d*u*m,p=(f+function(e){const{message:t}=Zt(e),n=t.toLowerCase(),i=Ue(n)-Ue(n+c);return o(i)}(e.lastMessage)*f)/2,h=n(ke(e.lastMessageTime||i||new Date),500);e.scoreExperimental/=h/2e3,e.scoreExperimental+=1-p,e.scoreExperimental=n(0,e.scoreExperimental)};const nn=[19364487,19422865,11427049,16008266,21550262,21541886,14267520],on={},rn={};function an(e){var t;const{messages:n,user:o}=e;if(void 0===n)return;const i=Te(o),r=Date.now();on[i]=null!==(t=on[i])&&void 0!==t?t:{scoreLegacy:1,scoreStrikes:0,scoreExperimental:1,lastMessageTime:0,lastMessage:""};const a=on[i];en.legacy(a,e),en.strikeBased(a,e),en.experimental(a,e),a.lastMessageTime=r,a.lastMessage=n.join(""),function(e,t){const{id:n,displayName:o}=Xt(t),{room:i}=App,r=e.scoreStrikes,a=nn.includes(n),s=i.muted.includes(n),c=!a&&r>=3&&!s&&ne.get(ee.antiSpam),l=r<1&&s&&rn[n];if(c){if(n===App.user.id)return pe("AutoMute: You would have gotten muted"),void console.log("User would be muted here");rn[n]=!0,i.mute(n,o,"spam"),pe(`AutoMute: Muted user ${o}.`)}l&&(delete rn[n],i.unmute(n),pe(`AutoMute: Unmuted user ${o}.`))}(a,o)}function sn(e){const t=Te(e);delete on[t]}function cn(e){if(null==(null===RoomClient||void 0===RoomClient?void 0:RoomClient.state.id)||"private"===(null===RoomClient||void 0===RoomClient?void 0:RoomClient.state.mode))return;const{user:t}=e;"number"!=typeof t&&(t.display_name=t.display_name.replace(/[\u061C\u200E-\u200F\u202A-\u202E\u2066-\u2069]/g,"")),function({user:e,user_disconnected:t}){if(!("state"in RoomChannelMembersClient)||"number"==typeof e)return;if(t)return void pe(`User ${e.display_name} left the chat.`);const n=Te(e),{members:o}=RoomChannelMembersClient.state;o.map(Te).includes(n)||pe(`User ${e.display_name} joined the chat.`),RoomChannelMembersClient.add_member(e)}(e),an(e)}var ln=n(10),un=n.n(ln);function dn(){["room-component-message-picture","navigation-notification-unit-image"].forEach(e=>{document.querySelectorAll("."+e).forEach(e=>{e.src.includes("robohash")||e.classList.contains("ritsu-would-blur")||e.classList.add("ritsu-would-blur")})})}const mn={};var fn;function pn(e){e.onerror||(e.onerror=async()=>{switch(function(e){return(e=>e.classList.contains("room-component-message-picture"))(e)?fn.NoFallbackAvailable:e.src.startsWith("https://robohash.org/")||e.src.startsWith("data:image")?fn.AviconFallback:e.src.includes("/avicons_strict/")?fn.NoFallbackAvailable:fn.RobohashFallback}(e)){case fn.RobohashFallback:e.src=`https://robohash.org/yay${e.src}.png?set=set4`;break;case fn.AviconFallback:e.src="https://emeraldchat.com/avicons_strict/1.png"}})}function hn(e,t){return!0===mn[e.src]?(t&&(e.src=t),!1):!1===mn[e.src]&&(e.src="https://emeraldchat.com/avicons_strict/1.png",!0)}function gn(e){if(e.classList.contains("zoomIn"))return;if(!rt().test(e.src))return;const{src:t}=e;hn(e)||async function(e){const t=await fetch(e),n=await t.arrayBuffer(),o=new Uint8Array(n.slice(0,4)),i=Array.from(o).map(e=>e.toString(16)).join("");if(i.startsWith("424d"))return"image/bmp";switch(i){case"89504e47":return"image/png";case"47494638":return"image/gif";case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":return"image/jpeg";case"25504446":return"application/pdf";default:return}}(t).then(n=>{mn[t]="image/gif"!==n,hn(e,t)})}function vn(){document.querySelectorAll('img[src*="/badges/tick.svg"]').forEach(e=>{var t;const n=e.parentElement;e.outerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 147.1 146.8">\n<path d="M140 59l-5-5c-2-2-3-3-2-6V39v-1c0-12-10-21-21-22h-11c-2 0-4 0-6-3l-7-7c-4-3-9-5-15-5-5 0-10 2-14 6-3 1-5 3-6 5-3 4-5 5-9 4h-9a25 25 0 00-21 33v1c0 2 0 3-2 5l-5 5-1 2a26 26 0 00-2 29c1 4 4 7 7 10l3 3-1 4c0 15 12 26 26 26h6c3-1 5 0 7 2 3 4 6 7 10 9a22 22 0 0023-1c4-1 8-4 10-8l6-3 6 1c15 0 26-11 26-25v-3c0-2 1-4 3-5l7-9c2-4 4-9 4-14 0-7-2-13-7-18zm-29-9l-37 55c-2 2-3 4-5 4-4 0-6-1-8-3L42 86c-3-3-4-7-1-10s7-3 10 1l13 12c2 2 3 2 4-1l31-46c3-4 6-6 11-3 4 3 3 7 1 11z" fill="#1da0f1"/>\n<path d="M110 39c-4-3-8-1-11 3L68 89c-1 2-2 2-4 0L51 77c-3-4-7-4-10-1s-2 7 1 10l20 20c1 2 3 3 7 3 2 0 3-2 5-4l37-55c2-4 3-8-1-11z" fill="#fefefe"/>\n</svg>',null===(t=null==n?void 0:n.querySelector("svg"))||void 0===t||t.classList.add("user-badge-tick")}),Array.from(document.images).forEach(e=>{var t;pn(e),e.complete&&0===e.naturalHeight&&(null===(t=e.onerror)||void 0===t||t.call(e,"")),ne.get(ee.showAnimatedImages)||gn(e)})}function bn(){var e,t;if(!ne.get(ee.fancyColors))return;const n=document.querySelector('label.ui-select[for="flair-select"]');if(!n||"flair-select"!==(null===(e=n.firstElementChild)||void 0===e?void 0:e.id))return;n.htmlFor="flair-select-old";const o=new Event("change",{bubbles:!0}),i=n.cloneNode();i.classList.add("disable-after"),n.firstElementChild.id="flair-select-old",n.style.display="none";const r=se("input",{id:"flair-select",className:"alt-flair-select",value:App.user.flair.color}),a=se("input",{id:"flair-select",type:"color",className:"picker-flair-select",value:App.user.flair.color,oninput:()=>{var e;r.value=a.value,null===(e=n.firstChild)||void 0===e||e.dispatchEvent(o)}});i.append(r,a),null===(t=n.parentElement)||void 0===t||t.insertBefore(i,n.nextSibling),r.oninput=()=>{var e;a.value=r.value,null===(e=n.firstChild)||void 0===e||e.dispatchEvent(o)}}!function(e){e[e.RobohashFallback=0]="RobohashFallback",e[e.AviconFallback=1]="AviconFallback",e[e.NoFallbackAvailable=2]="NoFallbackAvailable"}(fn||(fn={}));var yn=n(11),wn=n.n(yn);function Rn(e){var t;let n,o=e.apply(this);if(!this.props.data)return o;if((null===(t=this.props.data.data)||void 0===t?void 0:t.sender)&&(n=this.props.data.data.sender.gender),this.props.data.gender&&(n=this.props.data.gender),o.props.children){const{children:e}=o.props;e[0].props["data-gender"]=n;const t=o.props;t.children=e,o=ie.a.cloneElement(o,t)}return o=ie.a.cloneElement(o,{"data-gender":n}),o}function An(e){var t,n,o;const i=(null!==(n=null!==(t=e._karma)&&void 0!==t?t:e.karma)&&void 0!==n?n:0)<10,r=!(null===(o=null==e?void 0:e.display_picture)||void 0===o?void 0:o.includes("emeraldchat.com/uploads"))||i?`https://robohash.org/yay${e.id}.png?set=set4`:e.display_picture;const a=Te(App.user)===Te(e);if(i&&!a&&ne.get(ee.imgProtect))return"https://emeraldchat.com/avicons_strict/1.png";if(void 0===e.bio)return console.warn("user.bio is undefined"),r;const s=ze(e.bio);if(!s)return r;return function(e){const t=e[0];return t in Kt?Kt[t].unpack(e.slice(1)):(console.error(`could not unpack image: ${e} (unknown format '${t}')`),null)}(s)||r}function kn(e,t,n){const o=e.prototype;ue(o,t,(function(...e){n(this,...e).forEach(e=>{void 0!==e&&(function(e){return e&&"object"==typeof e&&"display_picture"in e&&void 0!==e.display_picture&&void 0!==e.bio}(e)?e.display_picture=An(e):function(e,t,n){var o,i,r;const a=null!==(i=null===(o=null==e?void 0:e.constructor)||void 0===o?void 0:o.displayName)&&void 0!==i?i:null===(r=null==e?void 0:e.construct)||void 0===r?void 0:r.name,s=a?a+".prototype":"(???)",c=t+"()";console.warn(`[interceptDebug] ${s}.${c} got user = `,n)}(o,t,e))})}),!0)}function Cn(){const e=document.querySelector(".main-logo");e&&(function(){const e=document.querySelector(".navigation-notification-icons"),t=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);if(null==e?void 0:e.children){if(document.fullscreenEnabled&&!e.querySelector(".ritsu-button-fullscreen")&&!t){const t=se("span",{className:"material-icons navigation-notification-unit ritsu-button-fullscreen",textContent:"open_in_full",tabIndex:-1,role:"button",onmousedown:async()=>{document.fullscreenElement?(document.exitFullscreen(),t.textContent="open_in_full"):(await document.body.requestFullscreen(),t.textContent="close_fullscreen")}}),n=se("span");n.append(t),e.prepend(n)}if(!e.querySelector(".ritsu-icon-network-unavail")){const t="Emerald is not responding - switching chats is not recommended.",n=se("span",{className:"material-icons navigation-notification-unit ritsu-icon-network-unavail",textContent:"signal_cellular_alt",tabIndex:-1,role:"button",title:t,onmousedown:()=>alert(t)}),o=se("span");o.append(n),e.prepend(o)}}}(),function(e){const t=An(App.user);e instanceof HTMLImageElement&&e.src!==t&&(e.src=t)}(e),function(){if(document.head.querySelector(`link[rel="icon"][href="${u}"]`))return;document.head.querySelectorAll('link[rel="icon"]').forEach(e=>e.remove());const e=se("link",{rel:"icon",href:u});document.head.prepend(e)}(),function(e){var t;if(document.querySelector(".karma-tracker"))return;const n=se("div",{className:"karma-tracker"});null===(t=null==e?void 0:e.parentElement)||void 0===t||t.insertBefore(n,null==e?void 0:e.nextSibling)}(e),function(e){const t=`${App.user.display_name||"(...)"} - ${c} ${l}`;document.title!==t&&(document.title=t);const n=document.querySelector(".main-logo-text");if(!n){const n=se("div",{className:"main-logo-text",textContent:t});e.parentElement&&e.parentElement.insertBefore(n,e.nextSibling)}n&&n.textContent!==t&&(n.textContent=t)}(e))}var xn=n(12),Mn=n.n(xn);let Nn=null;function En(e){500===e.status&&(App.room&&App.room.leave(App.room.id),k.location.href="/")}function Un(e){const t=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);if(e===Nn)return;null!==Nn&&function(e){const t=se("div",{className:"karma-delta "+(e>0?"positive":"negative"),textContent:Ee(e)});document.body.append(t),setTimeout(()=>t.classList.add("zoom"),250),setTimeout(()=>t.remove(),5e3)}(e-Nn),Nn=e;const n=document.querySelector(".karma-tracker");if(n)if(t){if(!e)return void(n.textContent="");e>0?n.textContent="+"+e:e<=0&&(n.textContent=""+e),n.style.color=e>0?"#3ec435":"#eb3b3b"}else n.textContent=e?"Karma: "+e:""}function Sn(){const{id:e}=App.user;e?$.ajax({type:"GET",url:"/profile_json?id="+e,dataType:"json",success:e=>Un(e.user.karma),error:e=>En(e)}):setTimeout(Sn,500)}function $n(){const e=RoomChannelMembers.prototype.setState;RoomChannelMembers.prototype.setState=function(t){t&&"members"in t&&function(e,t){const n=Ae(e);Ae(t).forEach(e=>{!function(e,t){t.delta=e?t.karma-e.karma:0}(n.find(({id:t})=>t===e.id),e)})}(this.state.members,t.members),e.call(this,t)};const t=UserUnit.prototype.body;UserUnit.prototype.body=function(){const e=t.call(this),n=this.props.data;return n.delta<0&&(e.props.className+=" down"),n.delta>0&&(e.props.className+=" up"),e}}function Pn(e){var t,n,o;if(!(null===(o=null===(n=null===(t=App.room)||void 0===t?void 0:t.id)||void 0===n?void 0:n.startsWith)||void 0===o?void 0:o.call(n,"channel")))return!1;if(!(RoomChannelMembersClient instanceof ie.a.Component))return!1;const i=+App.room.id.slice(7),r=e.find(({channel:e})=>e.id===i);if(!r)return!1;const a=Ae(RoomChannelMembersClient.state.members);Ae(r.members).forEach(e=>{const t=a.findIndex(({id:t})=>t===e.id);t>-1?a[t]=e:a.push(e)});const s=function(e){const t=RoomChannelMembersClient.state.members_persistent||[],n=e.filter(e=>!t.find(t=>(null==t?void 0:t.id)===e.id)),o=[...t,...n];return o.length>100&&o.splice(0,o.length-100),o}(a);RoomChannelMembersClient.setState({members:a,members_persistent:s});const c=r.members.find(e=>(null==e?void 0:e.id)===App.user.id);return!!c&&(Un(c.karma),!0)}function _n(e){const t=(n=e.text_channels,RoomChannelSelectClient.state.text_channels.map(e=>{const t=n.find(({channel:t})=>t.id===e.channel.id);if(!t)return e;const{members:o}=t;return Object.assign(Object.assign({},e),{members:o})}));var n;RoomChannelSelectClient.setState({text_channels:t});Pn(t)||Sn()}function On(){const{id:e}=App.user;e?(setTimeout(On,6e4),RoomChannelMembersClient instanceof ie.a.Component&&$.ajax({type:"GET",url:"channels_default",dataType:"json",success:_n,error:En})):setTimeout(On,500)}const jn=/^(?:spotify:|https:\/\/[a-z]+\.spotify\.com\/(track\/|user\/(.*)\/|playlist\/))([a-zA-Z0-9]+)(.*)$/,Tn=/^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube(-nocookie)?\.com|youtu.be))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,In=e=>Tn.test(e),Dn=e=>jn.test(e),Fn=e=>{const t=Tn.exec(e);return t?t[6]:null},Ln=e=>{const t=jn.exec(e);return t?t[1]+t[3]:null};function Bn(e){return In(e)&&Fn(e)?(e=>`<div class="ritsu-youtube-embed embed"> <iframe class="embed-responsive-item" \n  loading="lazy"\n  src="https://www.youtube.com/embed/${Fn(e)}"\n  frameborder="0" allowfullscreen></iframe></div>`)(e):Dn(e)&&Ln(e)?((e,t)=>`<div class="ritsu-spotify-embed spotify embed"><iframe \n  src="https://open.spotify.com/embed/${Ln(e)}?utm_source=generator"\n  loading="lazy"\n  height="${t} !important" frameBorder="0" allowfullscreen="" \n  allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture">\n  </iframe></div>`)(e,(e=>e.includes("playlist")?380:80)(e)):null}class zn extends ie.a.Component{render(){const{href:e}=this.props,t=(e=>/^https?:\/\//.test(e)?e:"https://"+e)(e);try{const o=new URL(t),r=(i=o.host,Array.from(i.matchAll(/[^-._a-zA-Z0-9~]/g)).map(e=>e[0])),a=r.length>0,s=`⚠ Are you sure you want to open this link? ⚠\nNote that shady sites can guess your location and earmark your browser. Beware URLs on safe domains that look like redirects. The site you're about to visit is hosted by ${o.host}.`+((n=r).length>0?"\n⚠ Type this link yourself instead if you don't want to be fooled. ⚠\nThe following characters in the link look suspicious:\n"+n.map(Xe):"");return o.protocol.toLowerCase().startsWith("javascript")?e:ie.a.createElement("a",{className:"ritsu-message-anchor",href:a?"#":o.href,target:"_blank",onClick:e=>{confirm(s)&&!a||e.nativeEvent.preventDefault()},rel:"noreferrer"},t)}catch(t){return t instanceof Error&&o.error(t.message),e}var n,i}}const Gn=e=>t=>e().some(e=>e.test(t)),Vn=Gn(()=>[/\//g,/[^.]+?\.[^.]+?\.[^.]+?/g,/\.com|\.org|\.net|\.co\.uk|\.eu|\.us|\.gov|\.io/]),Kn=Gn(()=>[/emeraldchat/gi,/grabify/gi,/ip-puller/gi,/hackingvision/gi,/iplogger/gi,/bit\.ly/gi,/blasze/gi,/ps3CFW/gi,/powercut/gi,/whatstheirip/gi,/\.gift/gi,/(^|https?:\/\/)\w{3}\.\w{2}(\/|$)/gi]),qn=Gn(()=>[/(^|https?:\/\/)(i\.)?ibb\.co(\/|$)/gi]),Jn=e=>{const t=tt(e),n=e||null;if(!Vn(t))return n;if(t.match(/^[^\s@]+@[^\s@]+(\.|(%2E))\u200b?[^\s@]+$/gi))return t;const o=ne.get(ee.ignoreURLBlacklist);return qn(t)||!Kn(t)||o?ie.a.createElement(zn,{href:t}):n};function Hn(e,t){return Me(e,_e(ot,`(${nt}|${it}){2,256}`,nt+"[a-z]{2,}",`\\b(\\/(${nt}|${it}|\\/)*)?`,"gi"),Jn,t)}var Wn=n(13),Yn=n.n(Wn);function Qn(e){const t="channel"===this.state.mode?50:5e3,{messages:n}=this.state;e.forEach(e=>{0===e.messages.length&&e.messages.push(""),n.length>t&&n.shift();const o=n[n.length-1];if(o&&Te(o.user)===Te(e.user)&&!o.picture&&!e.picture&&o.messages.length<16){const t=o.messages,r=t[t.length-1];if(e.messages[0]===r)return;(In(i=r)||Dn(i))&&n.push(e),n[n.length-1].messages.push(e.messages[0])}else n.push(e);var i}),1===e.length?this.state.messages=n:this.setState({messages:n})}function Zn(e){const{user:t,karma:n,colour:o,textShadow:i,timeago:r}=e;return ie.a.createElement("span",{className:"user-extra"},ie.a.createElement("b",null,"(",n,")")," / ",ie.a.createElement("span",{style:{color:o,textShadow:i,whiteSpace:"nowrap"}},r),t.master&&!t.proxy&&ie.a.createElement("b",{style:{color:"#f00"}}," CALLAN "),t.mod&&!t.proxy&&ie.a.createElement("b",{style:{color:"#f00"}}," MOD "))}function Xn(){le(Yn.a),Message.prototype.content=function(){var e,t,n;const{picture:o,messages:i,user:r}=this.props.data,a=Te(this.props.data.user)===Te(App.user),s=ne.get(ee.imgProtect),c=(null===(e=je(r))||void 0===e?void 0:e.temp)||(null!==(n=null===(t=je(r))||void 0===t?void 0:t.karma)&&void 0!==n?n:0)<10;return o&&!(!a&&c&&s)?ie.a.createElement(MessagePicture,{picture:o}):o?[ie.a.createElement("div",null,"(Image) ",Hn(o.url,e=>e))]:i.map(e=>ie.a.createElement("div",{key:JSON.stringify(e)},this.process(e)))},Message.prototype.render=function(){var e,t,n,o,i,r,a,s,c,l,u;this.props.data.user||console.warn("this.props.data.user may be falsy despite declaration");const d=null!==(e=function(e){if(!("state"in RoomChannelMembersClient))return;const{members:t,members_persistent:n}=RoomChannelMembersClient.state;return(t||n).find(t=>(null==t?void 0:t.id)===e)}(Te(this.props.data.user))||je(this.props.data.user))&&void 0!==e?e:null,m=Te(this.props.data.user)===Te(App.user);let f=!1;App.room.muted.includes(Te(d))&&(f=!0);try{const e=ne.get(ee.muteRegexes)[0];if(e&&(null==d?void 0:d.display_name)){const{source:t,flags:n}=e,o=new RegExp(t,n),i=["","(?:)"].includes(t);o.test(d.display_name)&&!i&&(f=!0)}}catch(e){}const p={string:(null===(t=null==d?void 0:d.display_name)||void 0===t?void 0:t.trim())||"(no name)",flair:null!==(n=null==d?void 0:d.flair)&&void 0!==n?n:{color:""}},h=Ee(null!==(i=null!==(o=null==d?void 0:d._karma)&&void 0!==o?o:null==d?void 0:d.karma)&&void 0!==i?i:0),g=ne.get(ee.imgProtect),v=(null===(r=je(d))||void 0===r?void 0:r.temp)||(null!==(s=null===(a=je(d))||void 0===a?void 0:a.karma)&&void 0!==s?s:0)<10,b=d?function(e){const t=Math.log(+new Date-+new Date(e.created_at)+1);return Math.min(t/Math.log(5e11),1)}(d):0,y=(null==d?void 0:d.created_at)&&new Date(null==d?void 0:d.created_at),w=y&&!Number.isNaN(y.getTime())?$.timeago(y):null,R=`hsl(${256*b}, 50%, 50%)`,A=["room-component-message-text"],{picture:k}=this.props.data;k&&A.push("ritsu-would-blur-heavy"),f&&A.push("ritsu-message-hidden");const C=(null===(c=null==d?void 0:d.display_picture)||void 0===c?void 0:c.startsWith("https://robohash.org/"))||(null===(l=null==d?void 0:d.display_picture)||void 0===l?void 0:l.startsWith("https://emeraldchat.com/avicons_strict/"))||m,x=["room-component-message-avatar"];C||x.push("ritsu-would-blur");const M=!C&&(f||v&&g),N=d?ie.a.createElement(Zn,{user:d,karma:h,timeago:w,color:R,textShadow:"0.005em 0.005em #FFF5"}):null,E=e=>d&&UserViewGenerator.generate({event:e,user:d}),U=ie.a.createElement("div",{className:"material-icons room-component-message-avatar ritsu-avatar-hidden",title:"User avatar hidden due to image settings",onMouseDown:E,role:"button",tabIndex:-1},"visibility_off"),S=ie.a.createElement("img",{className:x.join(" "),alt:"User display avatar",src:null==d?void 0:d.display_picture,onMouseDown:E}),P=ie.a.createElement("div",{className:"room-component-flair",onMouseDown:E,role:"button",tabIndex:-1},ie.a.createElement(Flair,{data:p}));return ie.a.createElement("div",{className:"room-component-message-container","data-id":null==d?void 0:d.id},ie.a.createElement("div",{className:"room-component-message-left"},M?U:S),ie.a.createElement("div",{className:"room-component-message-right"},P,ie.a.createElement(Badge,{badge:null!==(u=null==d?void 0:d.badge)&&void 0!==u?u:null}),ne.get(ee.showInfo)&&N,ie.a.createElement("div",{className:A.join(" ")},f?ie.a.createElement("i",null,"Blocked message"):this.content())))},Room.prototype.received=function(e){var t,n,o,i;Te(e.user)!==App.user.id&&e.messages&&(App.room.play_sound("/sfx/simple_alert.wav"),this.append(e),PushNotifications.idle()&&PushNotifications.send(null!==(n=null===(t=je(e.user))||void 0===t?void 0:t.display_name)&&void 0!==n?n:"",{icon:null!==(i=null===(o=je(e.user))||void 0===o?void 0:o.display_picture)&&void 0!==i?i:"",body:e.messages[0]}))}}function eo(){var e,t;const n=document.querySelectorAll(".room-component-message-container"),o=null===(e=null===RoomClient||void 0===RoomClient?void 0:RoomClient.state)||void 0===e?void 0:e.messages;if(null==o?void 0:o.length)for(let e=0;e<o.length;e+=1){const i=null===(t=n[e])||void 0===t?void 0:t.querySelector(".room-component-message-text");if(!i||i.classList.contains("ritsu-message-hidden"))continue;const{messages:r}=o[e],a=i.childNodes;for(;a&&a.length>r.length;)a[0].remove();if(!a||!a[0].classList)return;ne.get(ee.bigEmoji)&&1===r.length&&/^\p{Extended_Pictographic}{1,5}$/u.test(r[0])?a[0].classList.add("jumbo-message"):a[0].classList.remove("jumbo-message")}}const to=(()=>{let e=0;return()=>"key-"+ ++e})();function no(){Room.prototype.room_messages=function(e="room-component-messages"){let t=null,n="",o=0;return this.state.messages.forEach(e=>{o+=e.messages.length}),this.state.messages_count>o&&this.state.messages.length>0&&(t=ie.a.createElement("div",{role:"button",tabIndex:0,onMouseDown:()=>this.load_messages(o),className:"room-component-load-button"},"Load More (",o," of ",this.state.messages_count,")")),"private"===this.state.mode&&this.state.messages.length<1&&(n=ie.a.createElement("div",{className:"room-notification"},"No messages here yet. Start a conversation!")),RoomChannelSelectClient.state&&"channel"===this.state.mode&&this.state.messages.length<1&&(n=ie.a.createElement("div",{className:"room-notification"},"No messages here yet!")),ie.a.createElement("div",{id:"messages",className:e},ie.a.createElement(MuteButton,null),this.state.print,n,t,this.state.messages.map(e=>(e.user=function(e){var t;const n=null===(t=null===RoomChannelMembersClient||void 0===RoomChannelMembersClient?void 0:RoomChannelMembersClient.state)||void 0===t?void 0:t.members_persistent;return n?(n.forEach(t=>{(null==t?void 0:t.id)===e.user.id&&(e.user=t)}),e.user):e.user}(e),e.key||(e.key=to()),ie.a.createElement(Message,{data:e,key:e.key}))),this.state.print_append)},Room.prototype.append=function(e){Qn.call(this,[e])}}function oo(){document.querySelectorAll(".room-component-message-text").forEach(e=>{e.childNodes.forEach(e=>{e.classList.contains("text-only")&&(e.querySelector(".embed")||e.querySelector(".room-component-message-picture-container")||e.querySelector(".room-component-message-picture"))&&e.classList.remove("text-only"),e.classList.contains("text-only")||e.classList.contains("room-component-message-picture-container")||e.querySelector(".room-component-message-picture-container")||e.querySelector(".embed")||e.querySelector(".room-component-message-picture")||e.classList.add("text-only")})})}function io(e,t){const n=Object.assign({success:async e=>e,error:async(e,t,n)=>{throw new Error(n)}},t);e.success=function(e,{success:t}){const n=Ae(Ie(e.success)),o=Ae(Ie(e.error));return(e,...i)=>{(async()=>{try{const o=await t(e,...i);n.forEach(e=>e(o,...i))}catch(e){const t=i[1],n=e instanceof Error?e.message:"";o.forEach(e=>e(t,"error",n))}})()}}(e,n),e.error=function(e,{error:t}){const n=Ae(Ie(e.success)),o=Ae(Ie(e.error));return(e,...i)=>{(async()=>{try{const o=await t(e,...i);n.forEach(t=>t(o,"success",e))}catch(t){t instanceof Error&&(i[1]=t.message),o.forEach(t=>t(e,...i))}})()}}(e,n)}const ro=new EventTarget;let ao=[];function so(e){const t=new CustomEvent(e?"connected":"disconnected");ro.dispatchEvent(t)}function co(){(function(e,t,n="Timed out"){return Promise.race([e,he(t).then(()=>Promise.reject(new Error(n)))])})(new Promise(e=>ao.push(e)),5e3).catch(()=>{so(!1)})}function lo(){ao.forEach(e=>e()),ao=[],so(!0)}var uo;function mo(e,t){const{SendRequest:n,AbortRequest:o}=uo;return n}function fo(){const e=$.ajax;$.ajax=function(t,n){const o="string"==typeof t?Object.assign(Object.assign({},n),{url:t}):t;return void 0===(null==o?void 0:o.url)?e(o):mo(o.url)===uo.SendRequest?(function(e){co(),io(e,{success:async e=>(lo(),e),async error(e,t,n){throw lo(),new Error(n)}})}(o),e(Object.assign({},o))):void 0},ro.addEventListener("connected",()=>{document.documentElement.classList.remove("network-unavail")}),ro.addEventListener("disconnected",()=>{document.documentElement.classList.add("network-unavail")})}!function(e){e[e.AbortRequest=0]="AbortRequest",e[e.SendRequest=1]="SendRequest"}(uo||(uo={}));var po=n(14),ho=n.n(po),go=n(5),vo={insert:"head",singleton:!1},bo=(ho()(go.a,vo),go.a.locals||{});function yo(){return ie.a.createElement("div",{className:bo.ldsDualRing})}function wo(){this.setState({right_panel:!0,left_panel:!0,print:""})}function Ro(e){App.room.join(this.props.data.id),Qn.call(this,e.messages),this.setState({messages_count:e.messages_count,id:this.props.data.id}),this.scroll()}function Ao(){wo.call(this),$.ajax({type:"GET",url:"/default_private_messages?id="+this.props.data.id,dataType:"json",success:Ro.bind(this)})}function ko(e){this.setState({print:ie.a.createElement(MatchMenu,{data:{queue:e}})})}function Co(){const e={match:"text",match_video:"video",match_voice:"voice",channel:"",private:""};function t(e){const{channel:t}=e;this.setState({current_channel:t}),"voice"===t.channel_type&&this.voice_connect(e),null===RoomClient||void 0===RoomClient||RoomClient.clear_messages(),$.ajax({type:"GET",url:"channel_json?id="+t.id,dataType:"json",success(e){const{messages:t}=e;RoomChannelMembersClient.setState({members:e.members}),RoomClient&&Qn.call(RoomClient,t),null===RoomClient||void 0===RoomClient||RoomClient.scroll()}}),App.room.join("channel"+t.id),RoomClient.state.last_message=null,null===RoomClient||void 0===RoomClient||RoomClient.scroll()}Room.prototype.componentDidMount=function(){this.clear_print();const{mode:t}=this.state,n=e[t];n?ko.call(this,n):"channel"===t?wo.call(this):"private"===t&&Ao.call(this)},Room.prototype.trim_messages=function(){const e="channel"===this.state.mode?100:5e3,{messages:t}=this.state;t.length>e&&t.shift(),this.setState({messages:t})},Room.prototype.start_typing=function(e){var t;if(e.id===App.user.id)return;let n;n=null===(t=RoomChannelMembersClient.state.members.find(t=>(null==t?void 0:t.id)===e.id))||void 0===t?void 0:t.display_name,n||(n=e.display_name),this.setState({typing:n}),k.typing_timer=setTimeout(()=>{this.stop_typing()},1e4)},RoomChannelSelect.prototype.join=function(e){App.webrtc.client&&this.voice_disconnect(),this.expand(!1),this.setState({messages:[]}),this.updated=t.bind(this),this.updated(e),this.updated=function(){}}}function xo(){k.MenuReactMicroStatic||(k.MenuReactMicroStatic={close:()=>null===MenuReactMicro||void 0===MenuReactMicro?void 0:MenuReactMicro.close()}),k.DashboardClient||(k.DashboardClient={setState:()=>{}}),$(k).off("resize").on("resize",()=>{const e=document.getElementById("messages");e&&(e.scrollTop=e.scrollHeight)}),Dashboard.prototype.ads=function(){return ie.a.createElement("div",{})},function(){function e(e){if(!e.updater.isMounted(e))return;const t=Ct.a.findDOMNode(e);t&&Ct.a.unmountComponentAtNode(t.parentNode)}function t(t){$(t[0]).removeClass("animated fadeIn"),$(t[0]).removeClass("animated fadeOut"),$(t[1]).addClass("animated zoomOut"),setTimeout(e.bind(null,this),70)}function n(){t.call(this,["#menu-micro-bg","#menu-micro"])}function o(t){e(this),t.nativeEvent.stopImmediatePropagation()}Menu.prototype.close=function(){t.call(this,[".ui-bg",".ui-menu"])},UserProfile.prototype.close=function(){t.call(this,[".ui-bg",".user-profile-menu"]),setTimeout(()=>{UserProfileReact=null})},FriendsMenu.prototype.componentDidMount=function(){$.ajax({type:"GET",url:"/friends_json",dataType:"json",success:function(e){const{friends:t}=e;e.friends=t.filter(e=>null!==e);const n=this.state.skippedMissing||0,o=t.filter(e=>null===e);this.setState({friends:e.friends,count:e.count,skippedMissing:n+o.length})}.bind(this)})},FriendsMenu.prototype.load_friends=function(){const e=this.state.skippedMissing||0,t=this.state.friends.length+e;$.ajax({type:"GET",url:"/load_friends_json?offset="+t,dataType:"json",success:function(t){if(0===t.length)return;const n=t.filter(e=>null===e),o=t.filter(e=>!n.includes(e)),i={skippedMissing:e+n.length,search:[],friends:[...this.state.friends,...o],count:this.state.count};this.setState(i)}.bind(this)})},MenuMicro.prototype.close=n,MenuMicroStatic.prototype.close=n,UserView.prototype.close=function(){document.removeEventListener("mousedown",this.exit_click,!1),e(this)},UserView.prototype.view_profile=function(){const{id:t}=this.state.user;UserProfileReact?UserProfileReact.switch(t):Ct.a.render(ie.a.createElement(UserProfile,{key:t,id:t}),document.getElementById("ui-hatch")),e(this)},Popup.prototype.close=o,Picture.prototype.close=o,UserView.prototype.exit_click=function(e){e.target instanceof HTMLElement&&(e.target.matches(".user-profile-micro, .user-profile-micro *")||this.close())},UserProfile.prototype.componentDidMount=function(){$.ajax({type:"GET",url:"/profile_json?id="+this.props.id,dataType:"json",success:e=>this.setState({data:e}),error:()=>this.close()})},NotificationUnit.prototype.action=function(e){var t,n,o,i,r,a,s,c,l,u,d,m;const{target:f}=e;if(!(f instanceof Node))return;const p=f instanceof Element?f:f.parentElement;if(!p)return;if(p.matches(".notification-button, .notification-button *"))return;const h=this.props.data,g=null!==(t=h.data.sender)&&void 0!==t?t:h.data.user;if(!("unit"in h.data)||"friend_request"===h.tier)return void(g?UserViewGenerator.generate({event:e,user:g}):console.error("Could not get notification user for UserView."));"unit"in h.data&&(App.params=h.data.unit);const v=null!==(m=null!==(l=null!==(s=null!==(r=null!==(o=null===(n=h.data.unit)||void 0===n?void 0:n.post.user_id)&&void 0!==o?o:null===(i=h.data.unit)||void 0===i?void 0:i.author.id)&&void 0!==r?r:null===(a=h.data.unit)||void 0===a?void 0:a.post.author_id)&&void 0!==s?s:null===(c=h.data.unit)||void 0===c?void 0:c.comment.author_id)&&void 0!==l?l:null===(d=null===(u=h.data)||void 0===u?void 0:u.sender)||void 0===d?void 0:d.id)&&void 0!==m?m:h.sender_id;UserProfileReact&&UserProfileReact.load(v);const b=ie.a.createElement(UserProfile,{id:v});Ct.a.render(b,document.getElementById("ui-hatch"))},NotificationUnit.prototype.image=function(){var e,t,n;return ie.a.createElement("img",{className:"navigation-notification-unit-image",src:null===(n=null===(t=null===(e=this.props.data)||void 0===e?void 0:e.data)||void 0===t?void 0:t.sender)||void 0===n?void 0:n.display_picture})},NotificationUnit.prototype.content=function(){var e,t;const{content:n,sender:o}=this.props.data.data,i={string:null!==(e=null==o?void 0:o.display_name)&&void 0!==e?e:"(no name)",flair:null!==(t=null==o?void 0:o.flair)&&void 0!==t?t:{color:""}},r=ie.a.createElement(Flair,{data:i}),a=n.length>64?n.substring(0,64)+"...":n,s=ie.a.createElement("span",{className:"navigation-notification-unit-message"},a);return ie.a.createElement("span",null,r,s)}}(),App.karma.data[0].range[1]=-1/0,App.temp.check=()=>{},Flair.prototype.render=function(){const{data:{flair:e,string:t},onClick:n}=this.props;return ie.a.createElement("span",{className:"user-flair",style:null!=e?e:{color:""},onClick:n},t)},UserProfile.prototype.render=function(){const e=this.state.data?[this.top(),this.bottom()]:[ie.a.createElement(yo)];return ie.a.createElement("div",{className:"ui-menu-container"},ie.a.createElement("div",{onMouseDown:this.close.bind(this),className:"animated fadeIn ui-bg"}),ie.a.createElement("div",{className:"animated zoomIn user-profile-menu"},...e))},CommentSettings.prototype.authorized=function(){var e;const t=this.props.parent,{micropost_data:n,comment_data:o}=t.state,{wall:i,current_user:r}=n;return r.mod||r.master||null!=i&&(null===(e=null==o?void 0:o.user)||void 0===e?void 0:e.id)===r.id},Co()}const Mo=new Qe(ee.blockedHashes),No=new Qe(ee.savedPictures);const Eo=function(e){const t={};return async n=>{const o="number"==typeof n?n.toString():n;return Object.prototype.hasOwnProperty.call(t,o)||(t[o]=await e(o)),t[o]}}(async e=>{const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")});async function Uo(){var e;document.querySelectorAll(".room-component-message-picture-container").forEach(async e=>{if(ne.get(ee.imgControl)&&!e.querySelector(".picture-control")){const t=se("div",{className:"picture-control"});t.append(se("div",{className:"picture-button block material-icons",textContent:"delete_forever",title:"Block this image",onmousedown:e=>{var t,n;if(!(e.target instanceof HTMLElement))return;const o=null===(n=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.firstChild;!async function(e){if(!e)return;const t=await Eo(e);Mo.add(t),Uo()}(null==o?void 0:o.src)}})),t.append(se("div",{className:"picture-button save material-icons",textContent:"bookmark_border",title:"Bookmark this image",onmousedown:e=>{var t,n;if(!(e.target instanceof HTMLElement))return;const o=null===(n=null===(t=e.target.parentElement)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.firstChild;!function(e){e&&No.add(e)}(null==o?void 0:o.src)}})),e.append(t)}if(!(e.firstChild instanceof HTMLImageElement))return;const{src:t}=e.firstChild,n=await Eo(t);Mo.hasItem(n)&&(e.firstChild.src="")});const t=document.querySelector("form#picture_upload");if(!t)return;const n=t.parentElement,o=n.querySelector(".ui-menu-text");"B"===(null===(e=null==o?void 0:o.firstElementChild)||void 0===e?void 0:e.tagName)?o.style.display="none":o&&(o.style.display="");if(n.querySelector(".image-grid"))return;const i=n.querySelector(".ui-menu-buttons"),r=se("div",{className:"image-grid"});No.values().forEach(e=>{const t=se("div",{style:`background-image: url(${encodeURI(e)}), url(${encodeURI("https://emeraldchat.com/avicons_strict/1.png")})`,onmousedown:()=>{!function(e){const t=(new Date).toISOString(),n={author_id:App.user.id,created_at:t,description:null,id:955e4+~~(1e6*Math.random()),image:{thumb:{url:e},url:e},image_processing:!1,image_tmp:null,micropost_id:null,picture_album_id:null,temporary:!1,title:null,updated_at:t,url:e};PictureUploader.onUploaded(n)}(e),MenuReactMicro.close()}});t.append(se("div",{className:"picture-button material-icons",textContent:"bookmark_remove",title:"Unbookmark this image",onmousedown:n=>{n.stopPropagation(),confirm("Are you sure you want to unbookmark this image?")&&(No.remove(e),t.remove())}})),r.append(t)}),n.insertBefore(r,i)}function So(){return`${s} ${l}`}const $o={};function Po(e,t){$o[e]||($o[e]=[]),$o[e].push(t)}function _o(e,t){$o[e]||($o[e]=[]);const n=$o[e].indexOf(t);n>-1&&$o[e].splice(n,1)}function Oo(e,t){$o[e]||($o[e]=[]);let n=!1;const o=Object.assign(Object.assign({},t),{type:e,preventDefault(){n=!0}});return $o[e].forEach(e=>e(o)),n}function jo(){const e={version:So,addEventListener:Po,removeEventListener:_o,dispatchEvent:Oo};ue(App.room,"join",e=>{Oo("room.join",{room:e}),ue(App.room.client,"received",e=>{var t;Oo("room.received",e),e.user&&e.user_disconnected&&Oo("user.left",e),e.user&&e.user_connected&&Oo("user.joined",e),e.messages&&e.messages.length&&Oo("user.message",e),(t=e).typing?null===RoomClient||void 0===RoomClient||RoomClient.start_typing(t.user):null===RoomClient||void 0===RoomClient||RoomClient.stop_typing()})}),ue(App.room,"leave",e=>{Oo("room.leave",{room:e})}),k.RxE=e}function To(){var e;const t=document.evaluate("//li[text()='Emerald Gold']",document).iterateNext();ne.get(ee.adBlocker)&&t instanceof HTMLElement?t.remove():t&&(null===(e=null==t?void 0:t.parentElement)||void 0===e?void 0:e.firstChild)===t&&t.parentElement.append(t)}function Io(e){const{id:t,value:n,onChange:o,children:i}=e;return ie.a.createElement("div",null,ie.a.createElement("input",{type:"checkbox",id:t,checked:n,onChange:o}),ie.a.createElement("label",{htmlFor:t},t in te?te[t].label:null!=i?i:null))}function Do(e){const{id:t,value:n,onChange:o,inline:i}=e,r=te[t];if(!(r instanceof F))throw new Error("RadioSetting can only be used with MultichoicePreference");return ie.a.createElement("div",{className:"ritsu-radio-setting-root"},ie.a.createElement("label",{htmlFor:t,className:"m1 "+bo.settingsSection},r.label),ie.a.createElement("div",{id:t,style:{display:"flex",flexDirection:i?"row":"column"}},r.options.map(({value:e,label:i})=>ie.a.createElement("div",{className:"ritsu-radio-setting-option"},ie.a.createElement("input",{type:"radio",id:`${t}-option-${e}`,name:t,value:e,checked:n===e,onChange:()=>o(e)}),ie.a.createElement("label",{htmlFor:`${t}-option-${e}`},i)))))}function Fo(e){const{id:t,value:n,onChange:o,placeholder:i,children:r}=e;return ie.a.createElement("div",null,ie.a.createElement("input",{id:t,value:n,placeholder:i,onChange:o}),ie.a.createElement("label",{htmlFor:t},t in te?te[t].label:null!=r?r:null))}function Lo(e){const t=new Set(e.map(e=>e[0])),n=new Set(ne.get(ee.permaMuteList).map(e=>e[0])),{added:o,removed:i}=function(e,t){const n=new Set,o=new Set;return Array.from(e.values()).forEach(e=>{t.has(e)||n.add(e)}),Array.from(t.values()).forEach(t=>{e.has(t)||o.add(t)}),{added:n,removed:o}}(n,t);o.forEach(e=>App.room.mute(e)),i.forEach(e=>App.room.unmute(e))}class Bo extends ie.a.Component{constructor(e){super(e),this.state={items:Array.from(e.value)}}handleItemRemoval(e){const{onChange:t,removeItem:n}=this.props,o=n(e,this.items());this.setState({items:o}),t(o)}items(){const{items:e}=this.state;return Array.from(e)}itemJSX(e){const{renderItem:t}=this.props;return ie.a.createElement("div",null,ie.a.createElement("span",Object.assign({className:"ui-button-text",style:{margin:"0 0.5em 0 0",padding:"0 0.5em",borderRadius:"0.25em",backgroundColor:"#e00000"}},Pe(()=>this.handleItemRemoval(e),{allowSpace:!0}),{role:"button",tabIndex:0}),"×"),ie.a.createElement("span",{style:{display:"inline-flex",alignItems:"center"}},t(e)))}render(){const{id:e,children:t}=this.props,{items:n}=this.state;if(!(te[e]instanceof D))throw new Error("ListSetting can only be used with ListPreference");return ie.a.createElement("div",null,ie.a.createElement("div",{id:e,style:{display:"block"}},0===n.length?t:n.map(this.itemJSX.bind(this))))}}function zo(e,t){const{[e]:n}=t,o="applySettings"in t?t.applySettings:t.applyHacks;return ie.a.createElement(Io,{id:e,value:n,onChange:()=>o({[e]:!n})})}function Go(e,t){return ie.a.createElement("div",{className:"m1 "+e},t)}function Vo(e){const t=ie.a.createElement(UserProfile,{id:e});Ct.a.render(t,document.getElementById("ui-hatch"))}const Ko={g:"Global",i:"Case insensitive",m:"Multiline",u:"Unicode"};function qo(e){var t,n;const{id:o,value:i,onChange:r,flagsAllowed:a,children:s}=e;let c=null!==(t=null==i?void 0:i.source)&&void 0!==t?t:"",l=null!==(n=null==i?void 0:i.flags)&&void 0!==n?n:"";const u=(e,t)=>{if(null!=e&&(c=e),null!=t&&(l=t.join("")),""!==c)try{r(new RegExp(c,l))}catch(e){r({source:c,flags:l})}else r({source:c,flags:l})};return ie.a.createElement("div",null,ie.a.createElement(Fo,{id:o+"-text",value:c,placeholder:"Regular expression",onChange:({currentTarget:e})=>u(e.value)},o in te?te[o].label:s),a.split("").map(e=>Object.prototype.hasOwnProperty.call(Ko,e)?ie.a.createElement(Io,{id:`${o}-flag-${e}`,value:l.includes(e),onChange:({currentTarget:t})=>{const n=(o=e,l.split("").filter(e=>e!==o));var o;const i=[...n,e];u(null,t.checked?i:n)}},Ko[e]):null))}function Jo(e){var t;const{muteRegexes:n,applySettings:o}=e;return ie.a.createElement("div",{className:bo.settings},Go(bo.settingsSection,Q.generalTitle),zo("adBlocker",e),zo("trackKarma",e),zo("fancyColors",e),function(e,t){const{applySettings:n,[e]:o}=t;return ie.a.createElement(Do,{id:e,value:o,onChange:t=>n({[e]:t}),inline:!1})}("blockReqs",e),Go(bo.settingsSection,Q.imagesTitle),zo("imgBlur",e),zo("imgProtect",e),zo("hidePfp",e),zo("showAnimatedImages",e),zo("imgControl",e),zo("hideImageFallback",e),Go(bo.settingsSection,Q.messageTitle),zo("antiSpam",e),zo("showGender",e),zo("showInfo",e),zo("highlightMentions",e),zo("bigEmoji",e),zo("toggleEmbeds",e),zo("largerText",e),Go(bo.settingsSection,Q.advancedTitle),zo("ignoreURLBlacklist",e),function(e,t,n){const{applySettings:o,[e]:i}=t;return ie.a.createElement(Fo,{id:e,value:i,onChange:t=>o({[e]:t.target.value}),placeholder:n})}("imgurAPIKey",e,Q.preferences.imgurAPIKey.placeholder),ie.a.createElement(qo,{id:"muteRegexes",value:null!==(t=n[0])&&void 0!==t?t:{source:"",flags:""},onChange:({source:e,flags:t})=>o({muteRegexes:[{source:e,flags:t}]}),flagsAllowed:"i"}),function(e){const{applySettings:t,permaMuteList:n}=e;return ie.a.createElement(Bo,{id:"permaMuteList",value:n,removeItem:([e],t)=>t.filter(t=>t[0]!==e),renderItem:([e,t])=>[ie.a.createElement("span",{className:"ritsu-permamutelist-user-name"},t),ie.a.createElement("span",{className:"material-icons permamute-list",onClick:()=>Vo(e),onKeyDown:()=>Vo(e),role:"button",tabIndex:0},"account_circle")],onChange:e=>{Lo(e),t({permaMuteList:e}),null===NotificationsReact||void 0===NotificationsReact||NotificationsReact.update()}},"No mutes active")}(e))}var Ho=n(15),Wo=n.n(Ho),Yo=n(6),Qo=n.n(Yo),Zo=n(16),Xo=n.n(Zo),ei=n(17),ti=n.n(ei);const ni=["default","ritsu","light"];function oi(){const e=ne.get(ee.theme);let t=document.head.querySelector(".custom-theme");t||(document.head.append(se("style",{className:"custom-theme",type:"text/css"})),t=document.head.querySelector(".custom-theme"));const n=[Wo.a];switch(e){case"default":default:break;case"ritsu":n.push(Qo.a,Xo.a);break;case"light":n.push(Qo.a,ti.a)}t.textContent=n.join("\n")}function ii(e){const{theme:t,applyTheme:n}=e;return ie.a.createElement("div",null,ie.a.createElement("div",{className:"m1 "+bo.settingsSection},Q.themeTitle),ni.map(e=>ie.a.createElement("div",null,ie.a.createElement("input",{type:"radio",id:e,name:"theme",value:e,checked:t===e,onChange:()=>n(e)}),ie.a.createElement("label",{htmlFor:e},e[0].toUpperCase()+e.slice(1)))))}class ri extends ie.a.Component{constructor(){super({}),this.applySettings=e=>{const{settings:t}=this.state,n=Object.assign(Object.assign({},t),e);Object.keys(e).forEach(t=>ne.set(ee[t],e[t])),li(),this.setState({settings:n,needsReload:!0})},this.applyTheme=e=>{ne.set(ee.theme,e),document.body.classList.add("themeChange"),oi(),this.setState({theme:e}),setTimeout(()=>document.body.classList.remove("themeChange"),1e3)},this.v=e=>{},this.state=Object.assign(Object.assign({},ci()),{needsReload:!1})}render(){const{theme:e,settings:t,R:n,needsReload:o}=this.state;return ie.a.createElement("div",null,ie.a.createElement(ii,{theme:e,applyTheme:this.applyTheme}),ie.a.createElement(Jo,Object.assign({},t,{applySettings:this.applySettings})),!1,o&&ie.a.createElement("div",{className:bo.reloadWarning},"You may need to reload the app for your changes to take effect."))}}function ai(){return ie.a.createElement(Menu,null,ie.a.createElement("div",{key:"custom_menu",className:bo.ritsuMenuContainer},"Ritsu Settings",ie.a.createElement("br",null),ie.a.createElement("br",null),ie.a.createElement(ri,null),ie.a.createElement("div",{className:"ui-menu-buttons"},ie.a.createElement("div",{role:"button",tabIndex:0,className:"ui-button-text",onMouseDown:()=>MenuReact.close()},"Close"))))}function si(e){return function(e,t){const n=Object.getOwnPropertyNames(e).map(n=>[n,t(n,e[n])]);return Object.fromEntries(n)}(function(e,t){const n=Object.getOwnPropertyNames(e).filter(n=>e[n]instanceof t).map(t=>[t,e[t]]);return Object.fromEntries(n)}(e,I),(e,t)=>ne.get(t))}function ci(){return Object.assign(Object.assign({theme:ne.get(ee.theme)},!1),{settings:Object.assign(Object.assign({},si(ee)),{muteRegexes:ne.get(ee.muteRegexes),imgurAPIKey:ne.get(ee.imgurAPIKey),blockReqs:ne.get(ee.blockReqs),permaMuteList:ne.get(ee.permaMuteList)})})}function li(){const e=ci().settings;Object.keys(e).forEach(t=>{"boolean"==typeof e[t]&&document.documentElement.classList.toggle(t,e[t])}),oi()}function ui(){Ct.a.render(ie.a.createElement(ai,null),document.getElementById("ui-hatch"))}function di(){const e=document.querySelector(".navigation-dropdown-ritsu"),t=document.querySelector(".navigation-dropdown-content");!e&&t&&t.prepend(se("li",{className:"navigation-dropdown-ritsu",textContent:"Ritsu Menu",onmousedown:ui}))}var mi=n(18),fi=n.n(mi);const pi=ie.a.createElement("button",{className:"material-icons navigation-notification-unit lookup-button",onClick:function(){if("undefined"==typeof UserViewReact&&(UserViewGenerator.generate({event:{preventDefault:()=>{},clientX:100,clientY:100},user:{karma:100,id:2}}),UserViewReact.close(),"undefined"==typeof UserViewReact))return;const e=prompt("Enter a user id",""+UserViewReact.state.user.id);if(null===e)return;const t=parseInt(e,10);Number.isNaN(t)||(UserViewReact.state.user.id=t,UserViewReact.view_profile())},type:"button"},"face"),hi=ie.a.createElement("div",{className:"navigation-dropdown-content"},ie.a.createElement("div",null,Q.preferences.userSort.label),["name.asc","name.desc","age.asc","age.desc"].map(e=>ie.a.createElement("li",{className:ne.get(ee.userSort)===e?"selected":"",onClick:()=>function(e){ne.set(ee.userSort,e),RoomChannelMembersClient instanceof RoomChannelMembers&&RoomChannelMembersClient.setState(RoomChannelMembersClient.state)}(e)},Q.preferences.userSort[e]))),gi=ie.a.createElement("div",{className:"navigation-dropdown sort-button"},ie.a.createElement("span",{className:"material-icons navigation-notification-unit"},"arrow_drop_down"),hi);let vi;function bi(e,t){var n;"setState"in RoomChannelMembersClient&&(null===RoomClient||void 0===RoomClient||RoomClient.setState({messages:[],current_channel:e}),RoomChannelMembersClient.setState({members:[]}),App.room.join(e),document.querySelectorAll(".channel-unit").forEach(e=>e.classList.remove("channel-unit-active")),null===(n=document.querySelector(t))||void 0===n||n.classList.add("channel-unit-active"),null===RoomClient||void 0===RoomClient||RoomClient.print(ie.a.createElement("div",null,Q.privateRoomsWarning)),vi=e)}function yi(){document.querySelector(".wfaf.channel-unit-active")||bi("",".wfaf")}function wi(){const e=prompt(Q.privateRoomsPrompt);null!=e&&bi(e,".private-rooms")}function Ri(e){const{type:t}=e||{},{action:n}=e||{},{text:o}=e||{};return ie.a.createElement("div",{className:"channel-unit "+t,onClick:()=>n(),onKeyPress:()=>n(),role:"button",tabIndex:0},o)}function Ai(){RoomChannelSelect.prototype.body=function(){const{text_channels:e}=this.state;return ie.a.createElement("div",{className:"room-component-module"},ie.a.createElement("div",{className:"room-user-label"},"text channels"),e.map(e=>this.channel_button(e)),ie.a.createElement("div",{className:"room-user-label"},Q.hiddenChannels),ie.a.createElement(Ri,{type:"wfaf",action:yi,text:Q.WFAF}),ie.a.createElement(Ri,{type:"private-rooms",action:wi,text:Q.privateRooms}))},function(){const e=ActionCable.Subscriptions.prototype.reject;ActionCable.Subscriptions.prototype.reject=function(t){t===App.room.client.identifier&&App.room.id===vi&&fe("ERROR: You could not join room "+(vi||"WFAF")),e.call(this,t)}}()}function ki(){function e(e){null===RoomClient||void 0===RoomClient||RoomClient.trim_messages();const t=null===RoomClient||void 0===RoomClient?void 0:RoomClient.state.messages;t&&(e.forEach(e=>{0===t.length&&t.unshift(e);const n=t[0],o=Te(n.user)===Te(e.user),i=n.picture||e.picture,r=n.messages.length>=16;if(!o||i||r)return void t.unshift(e);const a=e.messages[0];n.messages[0]===a||n.messages.unshift(e.messages[0])}),null===RoomClient||void 0===RoomClient||RoomClient.setState({messages:t}))}Room.prototype.load_messages=function(t){const n=(o=t)+20<=RoomClient.state.messages_count?-o-20:-RoomClient.state.messages_count;var o;$.ajax({type:"GET",url:`/room_load_more?loaded=${n}&id=${this.state.id}`,dataType:"json",success:t=>e.call(this,t.reverse())})},Room.prototype.switch=function(e){this.clear_print();const{id:t}=e;App.room.join(t),this.state.last_message=null,this.setState({id:t,messages:[],messages_count:0,typing:null,mode:e.mode||"default"}),"private"===e.mode&&$.ajax({type:"GET",url:"/default_private_messages?id="+t,dataType:"json",success:e=>{Qn.call(this,e.messages),this.setState({messages_count:e.messages_count}),this.scroll()}})}}var Ci=n(19),xi=n.n(Ci);const Mi=e=>"Enter"===e.key&&!e.shiftKey;function Ni(e){if(!e.clipboardData)return;const{items:t}=e.clipboardData;Array.from(t).forEach(e=>{!async function(e){var t;if("file"!==e.kind)return;const n=e.getAsFile();if(!n||!confirm("Are you sure you want to upload this image in chat?"))return;const o=await Pt(n);RoomClient&&(null===(t=RoomClient.sendRitsuPicture)||void 0===t||t.call(RoomClient,o))}(e)})}var Ei=n(20),Ui=n.n(Ei);const{round:Si}=Math,$i={none:(e,[t,n])=>e(Si(t),Si(n))},Pi=Gt;async function _i(e,t,n){const o=await async function(e){for(let t=0;t<e.length;t+=1)try{return await e[t]()}catch(n){if(!(n instanceof Oe&&t!==e.length-1))throw n;console.log(`Item ${t} threw: `,n.message)}throw new Error("funcs cannot be empty")}([128,96,64,48].map(t=>()=>async function(e,t,n){if(!(t in Kt))throw new Error(`Format '${t}' not implemented`);return Kt[t].compress(e,n).then(e=>t+e)}(e,n,(e=>({interpolator:$i.none,width:e,height:e}))(t))));console.log(`compressed: ${o.length} chars`),await Ke(t,o)}async function Oi(e,t,n){if(e)if(e.type.startsWith("image"))try{await _i(e,t,n)}catch(e){e instanceof Error&&alert(e.message)}else alert("File is not an image or its format is not supported.");else alert("No file uploaded.")}const ji="Due to low karma, some users may not see your avatar in chat.",Ti=(e,t)=>n=>{var o;const{currentTarget:i}=n,r=null===(o=i.files)||void 0===o?void 0:o[0];try{Oi(r,e,t)}catch(e){alert("Image loading failed: "+e)}},Ii=(e,t)=>()=>{const n=prompt("Paste URL:","");if(null===n)return;const o=qt(n,t);null!==o?Ke(e,o):alert("Invalid URL")};function Fi(e){const t=ne.get(ee.blockReqs);e.friend_requests=e.friend_requests.filter(e=>{const n=new Date(e.data.sender.created_at),o=t!==X.None&&ke(n)<864e5,i=App?App.room.muted.includes(e.sender_id):e.seen;return!o&&!i||(t!==X.Reject||$.ajax({type:"GET",url:`/friends_decline?friend_id=${e.sender_id}&notification_id=${e.id}`,dataType:"json"}),!1)})}function Li(){return $.ajax({type:"GET",url:"/notifications_json",dataType:"json",success:function(e){Fi(e),NotificationsReact.setState({data:e})}}),"updated"}const Bi=e=>e?ie.a.createElement(Flair,{data:{string:e,flair:App.user.flair}}):null;function zi(){const e=Message.prototype.process;Message.prototype.process=function(t){const n=e.bind(this),o=null===(a=null===(r=null===(i=App.user)||void 0===i?void 0:i.display_name)||void 0===r?void 0:r.replace(/[^\w\s]/g,""))||void 0===a?void 0:a.trim();var i,r,a;if(!o||!ne.get(ee.highlightMentions))return n(t);return Ne(t,o,Bi,e=>Ne(e,App.user.display_name,Bi,n))}}const Gi=e=>e.split(""),Vi=e=>de(e,2),Ki={none:Gi("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"),italic:Vi("𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡"),bold:Vi("𝗮𝗯𝗰𝗱𝗲𝗳𝗴𝗵𝗶𝗷𝗸𝗹𝗺𝗻𝗼𝗽𝗾𝗿𝘀𝘁𝘂𝘃𝘄𝘅𝘆𝘇𝗔𝗕𝗖𝗗𝗘𝗙𝗚𝗛𝗜𝗝𝗞𝗟𝗠𝗡𝗢𝗣𝗤𝗥𝗦𝗧𝗨𝗩𝗪𝗫𝗬𝗭𝟬𝟭𝟮𝟯𝟰𝟱𝟲𝟳𝟴𝟵"),boldItalic:Vi("𝙖𝙗𝙘𝙙𝙚𝙛𝙜𝙝𝙞𝙟𝙠𝙡𝙢𝙣𝙤𝙥𝙦𝙧𝙨𝙩𝙪𝙫𝙬𝙭𝙮𝙯𝘼𝘽𝘾𝘿𝙀𝙁𝙂𝙃𝙄𝙅𝙆𝙇𝙈𝙉𝙊𝙋𝙌𝙍𝙎𝙏𝙐𝙑𝙒𝙓𝙔𝙕"),underline:Vi("a͟b͟c͟d͟e͟f͟g͟h͟i͟j͟k͟l͟m͟n͟o͟p͟q͟r͟s͟t͟u͟v͟w͟x͟y͟z͟A͟B͟C͟D͟E͟F͟G͟H͟I͟J͟K͟L͟M͟N͟O͟P͟Q͟R͟S͟T͟U͟V͟W͟X͟Y͟Z͟0͟1͟2͟3͟4͟5͟6͟7͟8͟9͟"),squared:Vi("🄰🄱🄲🄳🄴🄵🄶🄷🄸🄹🄺🄻🄼🄽🄾🄿🅀🅁🅂🅃🅄🅅🅆🅇🅈🅉🄰🄱🄲🄳🄴🄵🄶🄷🄸🄹🄺🄻🄼🄽🄾🄿🅀🅁🅂🅃🅄🅅🅆🅇🅈🅉"),squaredFull:Vi("🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉"),circled:Gi("ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ⓪①②③④⑤⑥⑦⑧⑨"),superscript:Gi("ᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖᵠʳˢᵗᵘᵛʷˣʸᶻᴬᴮᶜᴰᴱᶠᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᵠᴿˢᵀᵁⱽᵂˣʸᶻ⁰¹²³⁴⁵⁶⁷⁸⁹"),medieval:Vi("𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅"),cursive:Vi("𝒶𝒷𝒸𝒹𝑒𝒻𝑔𝒽𝒾𝒿𝓀𝓁𝓂𝓃𝑜𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏𝒜𝐵𝒞𝒟𝐸𝐹𝒢𝐻𝐼𝒥𝒦𝐿𝑀𝒩𝒪𝒫𝒬𝑅𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵"),cursiveBold:Vi("𝓪𝓫𝓬𝓭𝓮𝓯𝓰𝓱𝓲𝓳𝓴𝓵𝓶𝓷𝓸𝓹𝓺𝓻𝓼𝓽𝓾𝓿𝔀𝔁𝔂𝔃𝓐𝓑𝓒𝓓𝓔𝓕𝓖𝓗𝓘𝓙𝓚𝓛𝓜𝓝𝓞𝓟𝓠𝓡𝓢𝓣𝓤𝓥𝓦𝓧𝓨𝓩"),monospace:Gi("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"),smallcaps:Gi("ᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘQʀꜱᴛᴜᴠᴡxʏᴢᴀʙᴄᴅᴇꜰɢʜɪᴊᴋʟᴍɴᴏᴘQʀꜱᴛᴜᴠᴡxʏᴢ"),hooked:Gi("αႦƈԃҽϝɠԋιʝƙʅɱɳσρϙɾʂƚυʋɯxყȥ"),boldSerif:Vi("𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗")};const qi=e=>e;function Ji(e){const t=e.toLocaleLowerCase();return ie.a.createElement("span",Object.assign({},{className:"material-icons",title:t}),e.slice(2,-1))}function Hi({length:e}){return e>1?[ie.a.createElement("br",null),ie.a.createElement("br",null)]:ie.a.createElement("br",null)}const Wi={"[[":"squaredFull","((":"circled","{{":"medieval","*":"italic",h:"italic","**":"bold",A:"underline","***":"boldItalic","`":"monospace","^^":"superscript",",,":"hooked","<":"cursive","<<":"cursiveBold","~":"smallcaps"},Yi=Object.getOwnPropertyNames(Wi);function Qi(e){const t=Yi.find(t=>e.startsWith(t)&&e.endsWith(function(e){return"[["===e?"]]":"(("===e?"))":"{{"===e?"}}":"*//"===e?"//*":"<<"===e?">>":"<"===e?">":e}(t)));if(void 0===t)return e;const n=e.slice(t.length,-t.length),o=t.slice(-1)[0];return n.split("").every(e=>e===o)?e:function(e,t){return t.split("").map(t=>{var n;const o=Ki.none.indexOf(t);return null!==(n=Ki[e][o])&&void 0!==n?n:t}).join("")}(Wi[t],n)}function Zi(e,t=qi){return function(e,t=qi){return Me(e.replace(/^[\s\n]+|[\s\n]+$/g,""),/\n+/g,Hi,t)}(e,e=>function(e,t=qi){return Me(e,/m:[-_a-z]+:/gi,Ji,t)}(e,e=>Hn(e,t)))}Yi.sort((e,t)=>t.length-e.length);const Xi={shrug:"¯\\_(ツ)_/¯",tableflip:"(╯°□°)╯︵ ┻━┻",tableflip2:"(ノಠ益ಠ)ノ彡┻━┻",unflip:"┬──┬ ノ( ゜-゜ノ)"},er={all:{rxelink:()=>RoomClient.send("Link to RxE extension for Emerald: "+xt)},on:e=>({run:t=>(er.all[e]=t,er)}),prefix:".",process(e){if(!e.startsWith(er.prefix))return!1;const t=e.slice(er.prefix.length).split(" "),n=er.findCommand(t[0]);return null==n||n(...t.slice(1)),!!n},findCommand(e){const t=Object.getOwnPropertyNames(er.all).find(t=>t===e);return t?er.all[t]:void 0},checkMail:e=>/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}/gi.test(e),processMail:e=>e.replace(/\./gi,".​")};function tr(){var e;e=Xi,Object.entries(e).forEach(([e,t])=>er.on(e).run(()=>RoomClient.send(t))),Room.prototype.send=function(e){const t=this.process?this.process(e):e;null!==t&&(this.append({messages:[t],user:App.user}),App.room.client.speak({message:t}),this.scroll())},Room.prototype.process=function(e){return er.process(e)?null:er.checkMail(e)?er.processMail(e):et(function(e,t=qi){return Me(e,/(?<=\s|^|\.,;!\?)(\*{1,3}|_{1,2}|~{1,2}|<{1,2}|`|\^\^|,,|\[{2}|\({2}|\{{2})\S(?:.*?\S)?(?:\1|\]{2}|\){2}|\}{2}|>{1,2})(?=\s|$|\.,;!\?)/g,Qi,t).join("")}(e))}}function nr({raw:e,onRemove:t}){const n=t&&(()=>{confirm("Are you sure you want to remove your profile picture?")&&t()});return ie.a.createElement("div",{title:e,className:"bio-image"},"Profile picture (",function(e){switch(e){case Gt:return"format0";case Vt:return"imgur";default:return"unknown"}}(e[0]),", ",e.length," chars)",!!n&&[" ",ie.a.createElement("b",Object.assign({},Pe(n)),"×")])}function or(e,t,n){const o=e.split(/ +/g);if(o.length>36&&t){const e=o.slice(0,36).join(" ");return ie.a.createElement("span",null,Zi(e)," ...",ie.a.createElement("span",Object.assign({className:"user-micropost-text-button"},Pe(n))," More"))}return Zi(e,Micropost.prototype.youtube_process)}var ir=n(21),rr=n.n(ir);function ar(){le(rr.a);const e=Message.prototype.process;Message.prototype.process=function(t){const n=e.bind(this);return t.includes("youtu.be")||t.includes("youtube.com")?n(t):function(e,t=qi){if(rt().test(e))return Me(e,rt(),e=>Ut({url:"https://"+e}),()=>"");const n=$t(e);return null!==n?Ut(n):t(e)}(tt(t),e=>Zi(e,n))},UserProfile.prototype.bio=function(){const{compact_bio:e,data:{user:t}}=this.state,n=e&&t.bio.length>202,o=ze(t.bio),i=Ge(t.bio),r=o&&ie.a.createElement(nr,{raw:o,onRemove:t.id===App.user.id?()=>Ve(t,i):null}),a=i.slice(0,202)+"... ",s=n?a:i;return ie.a.createElement("span",null,Zi(s),n&&ie.a.createElement("span",{role:"button",tabIndex:0,onMouseDown:()=>this.bio_expand(),className:"bio-expand"},"Show More"),!n&&r)},Micropost.prototype.content=function(){const{data:e,compact:t}=this.state;if(!e)return null;const{content:n}=e.micropost;return ie.a.createElement("div",{style:{width:"100%"}},or(n,t,()=>this.more()))},Comment.prototype.content=function(){const{comment_data:e,compact:t}=this.state;if(!e)return null;const{content:n}=e.comment;return ie.a.createElement("div",{style:{width:"100%"}},or(n,t,()=>this.more()))}}const sr=[[Room,"Room"],[UserProfile,"UserProfile"],[FriendUnit,"FriendUnit"],[Micropost,"Micropost"],[MessageNotificationUnit,"MessageNotificationUnit"],[Message,"Message"],[RoomUserUnit,"RoomUserUnit"],[UserUnit,"UserUnit"],[UserView,"UserView"],[Dashboard,"Dashboard"]];var cr=n(22),lr=n.n(cr);function ur(e){const t=ne.get(ee.toggleEmbeds),n=document.querySelectorAll("."+e);t&&n&&n.forEach(e=>{const t=Array.from(e.children);t&&t.forEach(e=>{if(e.querySelectorAll(".embed").length)return;const t=tt(e.innerText);if(!In(t)&&!Dn(t))return;const n=document.createElement("div");n.classList.add("embed"),n.innerHTML="<br>"+Bn(t),e.appendChild(n)})})}function dr(){le(lr.a),ur("user-comment-right"),ur("user-micropost-right"),ur("room-component-message-text")}const mr=["safe","normal","unsafe"];function fr({preset:e,applyPreset:t}){return ie.a.createElement("div",null,ie.a.createElement("div",{className:"m1 "+bo.settingsSection},Q.introduction.presetsTitle),mr.map(n=>ie.a.createElement("div",null,ie.a.createElement("input",{type:"radio",id:"ritsu-preset-"+n,name:"preset",value:n,checked:n===e,onChange:()=>t(n)}),ie.a.createElement("label",{htmlFor:"ritsu-preset-"+n},Q.introduction.presets[n].title,ie.a.createElement("br",null)),ie.a.createElement("div",{className:"notification-menu-container-text"},Q.introduction.presets[n].content),ie.a.createElement("br",null))))}class pr extends ie.a.Component{constructor(){super({}),this.applyTheme=e=>{ne.set(ee.theme,e),document.body.classList.add("themeChange"),oi(),this.setState({theme:e}),setTimeout(()=>document.body.classList.remove("themeChange"),1e3)},this.applyPreset=e=>{"safe"===e?(ne.set(ee.blockReqs,X.Reject),ne.set(ee.imgBlur,!0),ne.set(ee.imgProtect,!0),ne.set(ee.showAnimatedImages,!1),ne.set(ee.toggleEmbeds,!1)):"normal"===e?(ne.set(ee.blockReqs,X.None),ne.set(ee.imgBlur,!1),ne.set(ee.imgProtect,!0),ne.set(ee.showAnimatedImages,!0),ne.set(ee.toggleEmbeds,!0)):"unsafe"===e&&(ne.set(ee.blockReqs,X.None),ne.set(ee.imgBlur,!1),ne.set(ee.imgProtect,!1),ne.set(ee.showAnimatedImages,!0),ne.set(ee.toggleEmbeds,!0)),this.setState({preset:e})};const{theme:e}=ci();this.state={theme:e,preset:"normal"}}render(){const{theme:e,preset:t}=this.state;return ie.a.createElement(Menu,null,ie.a.createElement("div",{key:"custom_menu",className:bo.ritsuMenuContainer},Q.introduction.title,ie.a.createElement("br",null),ie.a.createElement("br",null),Q.introduction.content,ie.a.createElement(ii,{theme:e,applyTheme:this.applyTheme}),ie.a.createElement(fr,{preset:t,applyPreset:this.applyPreset}),ie.a.createElement("div",{className:"ui-menu-buttons"},ie.a.createElement("div",{role:"button",tabIndex:0,className:"ui-button",onMouseDown:()=>{ne.set(ee.introductionCompletedVersion,1),MenuReact.close()}},"Save"))))}}function hr(){ne.get(te.introductionCompletedVersion)<1&&Ct.a.render(ie.a.createElement(pr,null),document.getElementById("ui-hatch"))}!async function(){const e=`(${[]})`;o.log(`${s} Version ${l} ${e}`),async function(){Notifications.prototype.update=Li,NotificationsReact&&(NotificationsReact.update=Li,NotificationsReact.state&&NotificationsReact.state.data?Fi(NotificationsReact.state.data):console.warn("failed to filter friend requests early"))}(),await(async e=>{for(;!e();)await he()})(()=>!!k.App),sr.forEach(([e,t])=>{e.displayName=t}),xo(),function(){if("undefined"==typeof GM_getValue)return;const e=GM_getValue("theme",!1);e&&(ne.set(ee.theme,e),o.log("Migrated THEME"),GM_deleteValue("theme"));const t=GM_getValue("hacks",!1);t&&(ne.set(ee.adBlocker,!!t.disableNags),ne.set(ee.fancyColors,!!t.fancyColors),o.log("Migrated HACKS"),GM_deleteValue("hacks"));const n=GM_getValue("settings",!1);n&&(ne.set(ee.imgControl,!!n.imgControl),ne.set(ee.imgProtect,!!n.imgProtect),ne.set(ee.showInfo,!!n.showInfo),o.log("Migrated SETTINGS"),GM_deleteValue("settings"));const i=GM_getValue("blockedPictures",!1);if(i instanceof Array){const e=[...ne.get(ee.blockedHashes)];i.forEach(t=>{e.includes(t)||e.push(t)}),ne.set(ee.blockedHashes,e),o.log("Migrated BLOCKED PICTURES"),GM_deleteValue("blockedPictures")}const r=GM_getValue("savedPictures",!1);if(r instanceof Array){const e=[...ne.get(ee.savedPictures)];r.forEach(t=>{e.includes(t)||e.push(t)}),ne.set(ee.savedPictures,e),o.log("Migrated SAVED PICTURES"),GM_deleteValue("savedPictures")}}(),jo(),fo(),le(Fe.a),document.body.addEventListener("mouseup",({target:e})=>{e instanceof HTMLElement&&e.classList.contains("mute-button")&&Cookies.set("muted",MuteButtonClient.state.muted?"t":"")}),MuteButton.prototype.componentDidMount=function(){const e=Cookies.get("muted");this.setState({muted:"t"===e||void 0===e})},li(),Xn(),Mo.load(),No.load(),le(un.a),Yt(),$n(),On(),le(Mn.a),function(){const e=RoomChannelSelect.prototype.join;RoomChannelSelect.prototype.join=function(t){t.members&&(t.members=Ae(t.members)),e.call(this,t)};const t=RoomPrivate.prototype.setState;function n(){var e,t;null===(e=document.querySelector(".wfaf"))||void 0===e||e.classList.remove("channel-unit-active"),null===(t=document.querySelector(".private-rooms"))||void 0===t||t.classList.remove("channel-unit-active"),ue(App.room.client,"received",cn,!0)}RoomPrivate.prototype.setState=function(e){return e&&"online"in e&&(e.online=Ae(e.online)),e&&"offline"in e&&(e.offline=Ae(e.offline)),t.call(this,e)},ue(App.room,"join",n),App.room.client&&n()}(),function(){const e=ne.get(ee.showGender);document.documentElement.classList.toggle("showGender",e),le(wn.a);const t=MessageNotificationUnit.prototype.image;MessageNotificationUnit.prototype.image=function(){return Rn.call(this,t)};const n=NotificationUnit.prototype.image;NotificationUnit.prototype.image=function(){return Rn.call(this,n)};const o=SearchUnit.prototype.body;SearchUnit.prototype.body=function(){return Rn.call(this,o)};const i=UserUnit.prototype.body;UserUnit.prototype.body=function(){return Rn.call(this,i)};const r=FriendUnit.prototype.body;FriendUnit.prototype.body=function(){return Rn.call(this,r)};const a=RoomUserUnit.prototype.body;RoomUserUnit.prototype.body=function(){return Rn.call(this,a)};const s=Message.prototype.render;Message.prototype.render=function(){var e,t;const n=s.apply(this);return n&&"object"==typeof n&&"props"in n&&(n.props.children[0].props.children=ie.a.cloneElement(n.props.children[0].props.children,{"data-gender":null!==(t=null===(e=je(this.props.data.user))||void 0===e?void 0:e.gender)&&void 0!==t?t:""})),n}}(),no(),ki(),function(){RoomChannelMembers.prototype.body=function(){const{members:e}=this.state;if(!e)return null;if(e.length<1)return ie.a.createElement("div",{className:"room-component-module"},ie.a.createElement("div",{className:"room-user-label"},pi));const t=Ae(e).map(e=>ie.a.createElement(UserUnit,{key:e.id,data:e}));return ie.a.createElement("div",{className:"room-component-module"},ie.a.createElement("div",{className:"room-user-label"},pi,"online — "+e.length,gi),t)};const e=RoomChannelMembers.prototype.setState;RoomChannelMembers.prototype.setState=function(t){var n;if(!t||!("members"in t))return;this.state.members||console.warn("this.state.members is falsy despite declaration");const o=Ae(null!==(n=this.state.members)&&void 0!==n?n:[]).map(e=>e.id),i=Ae(t.members),[r,a]=ne.get(ee.userSort).split("."),s="asc"===a?"asc":"desc";"age"===r?be(i,"id",ve(ge.numeric),s,!0):be(i,"display_name",ge.string,s,!0),i.forEach(e=>{var t;o.some((t=e.id,e=>t===e))||k.RxE.dispatchEvent("room.userlist",e)}),t.members=i,e.call(this,t)},Room.prototype.disconnected=function(e){"channel"===this.state.mode&&RoomChannelMembersClient.remove_member(e.user)},le(fi.a)}(),function(){function e(){NotificationsReact.update(),null===UserViewReact||void 0===UserViewReact||UserViewReact.forceUpdate(),null===RoomClient||void 0===RoomClient||RoomClient.forceUpdate()}App.room.muted.push(...ne.get(ee.permaMuteList).map(e=>e[0])),UserView.prototype.bottom=function(){const{id:e}=this.state.user,t=App.room.muted.includes(e),n=ne.get(ee.permaMuteList).map(e=>e[0]).includes(e);return ie.a.createElement("div",{className:"user-profile-micro-bottom"},ie.a.createElement("div",{onMouseDown:this.view_profile.bind(this),className:"user-profile-micro-button"},"View Profile"),ie.a.createElement("div",{onMouseDown:this.message.bind(this),className:"user-profile-micro-button"},"Message"),this.mod_button(),ie.a.createElement("div",{onMouseDown:t?this.unmute.bind(this):this.mute.bind(this),className:"user-profile-micro-button",disabled:n},t?"Unmute":"Mute"),ie.a.createElement("div",{onMouseDown:n?this.permaunmute.bind(this):this.permamute.bind(this),className:"user-profile-micro-button"},n?"Perma Unmute":"Perma Mute"),ie.a.createElement("div",{onMouseDown:this.close.bind(this),className:"user-profile-micro-button"},"Close"))},UserView.prototype.permamute=function(){const{id:t,display_name:n}=this.state.user;Ze.addItem({key:t,item:n},ee.permaMuteList),App.room.mute(t,n,"Permamuted by user"),e()},UserView.prototype.permaunmute=function(){const{id:t}=this.state.user;Ze.removeItem({key:t},ee.permaMuteList),App.room.unmute(t),e(),sn(t)},UserView.prototype.mute=function(){App.room.mute(this.state.user.id),this.setState({muted:!0}),e()},UserView.prototype.unmute=function(){const{id:t}=this.state.user;App.room.unmute(t),this.setState({muted:!1}),e(),sn(t)}}(),function(){Ft(),Room.prototype.upload_picture=function(){Ct.a.render(Tt(),document.getElementById("ui-hatch-2")),PictureUploader.onUploaded=function(e){var t;if(!RoomClient)return;const n=wt(e.url,!0);n&&(null===(t=RoomClient.sendRitsuPicture)||void 0===t||t.call(RoomClient,n))}},Room.prototype.sendRitsuPicture=function(e){this.append(St(e)),App.room.client.speak({message:Et(e)}),this.scroll()},PictureUpload.prototype.uploadImage=async function(){var e,t;if(!ct())return;const n=null===(e=document.querySelector(".picture-upload-button").files)||void 0===e?void 0:e[0];if(n)try{const e=await Pt(n);this.close(),UserProfileReact?Qt(e.url):RoomClient&&(null===(t=RoomClient.sendRitsuPicture)||void 0===t||t.call(RoomClient,e))}catch(e){this.setState({failureReason:e instanceof Error?e.message:""+e})}};const e=Room.prototype.received;Room.prototype.received=function(t){var n;const i=e.bind(this),r=null===(n=t.messages)||void 0===n?void 0:n[0];if(!r)return;const a=$t(r);if(a)try{return void i(St(a,t.user))}catch(e){e instanceof Error&&o.error(e.message)}else i(t)}}(),function(){function e(e){const{data:t}=this.state;void 0!==t&&(t.comments.unshift(e.comment.id),this.setState({data:t,compact:this.state.compact,reply:!0}))}function t(e){const t=this.state.data||{microposts:[]};this.setState({data:{microposts:[e.micropost.id,...t.microposts]}})}function n(){return this.state.reply?ie.a.createElement("div",{className:"animated zoomIn user-comment-input-background"},ie.a.createElement("textarea",{className:"user-comment-input",onKeyDown:this.comment_input.bind(this),id:"comment-input",placeholder:"Comment..."})):null}le(xi.a),Room.prototype.input=function(e){const t=$(e.target),n=""+t.val(),o="ArrowUp"===e.key&&this.state.last_message;Mi(e)?(this.send(n),this.setState({last_message:n}),t.val(""),t.css("height","34px")):o&&t.val(this.state.last_message),0!==n.length&&n.includes("\n")||t.css("height","34px");const i=t.get(0);i.style.height=i.scrollHeight+"px",document.onpaste=Ni,null===RoomClient||void 0===RoomClient||RoomClient.scroll(),(Mi(e)||o)&&e.preventDefault(),Mi(e)||App.room.client.typing()},Micropost.prototype.comment_input=function(t){var n;if(!Mi(t))return;const o=$(t.target),i=encodeURIComponent(""+o.val());this.setState({data:this.state.data,reply:!1,compact:this.state.compact}),o.val(""),t.preventDefault(),o.trigger("blur");const r=null===(n=this.state.data)||void 0===n?void 0:n.micropost.id;void 0!==r&&$.ajax({type:"GET",url:`/comments_create?id=${r}&content=${i}`,dataType:"json",success:e.bind(this)})},Microposts.prototype.micropost_input=function(e){if(e.target instanceof HTMLInputElement)return;const n=$(e.target),o=encodeURIComponent(""+n.val());if(!Mi(e))return;n.val(""),n.trigger("blur"),e.preventDefault();const i=this.props.data.wall_id;$.ajax({type:"GET",url:`/microposts_create?id=${i}&content=${o}`,dataType:"json",success:t.bind(this)})},Microposts.prototype.render=function(){const e=this.state.data?this.state.data.microposts:[],t=ie.a.createElement("div",{className:"user-microposts"},e.map(e=>ie.a.createElement(Micropost,{key:e,data:{id:e}}))),n=ie.a.createElement("div",{className:"user-micropost-input-background"},ie.a.createElement("textarea",{className:"user-micropost-input",onKeyDown:this.micropost_input.bind(this),id:"micropost-input",placeholder:"Say Something..."}));return ie.a.createElement("span",{key:this.props.data.wall_id},n,t)},Micropost.prototype.write_comment=n,Comment.prototype.write_comment=n}(),function(){le(Ui.a),UserProfile.prototype.profile_picture=Di;const{Comment:e}=k,t=MessageNotificationUnit;kn(Room,"received",(e,{user:t})=>[je(t)]),kn(Room,"append",(e,{user:t})=>[je(t)]),kn(RoomChannelMembers,"setState",(e,t)=>t&&"members"in t?Ae(t.members):[]),kn(UserProfile,"profile_picture",({state:e})=>[e.data.user]),kn(FriendUnit,"body",e=>[e.props.data]),kn(e,"render",e=>{var t;return[null===(t=e.state.comment_data)||void 0===t?void 0:t.user]}),kn(Micropost,"render",e=>{var t;return[null===(t=e.state.data)||void 0===t?void 0:t.author]}),kn(t,"image",e=>Ae([e.props.data.data.sender])),kn(Message,"render",e=>[je(e.props.data.user)]),kn(NotificationUnit,"render",e=>[je(e.props.data.data.sender)]),kn(RoomUserUnit,"body",e=>[e.props.data]),kn(UserUnit,"body",e=>[e.props.data]),kn(UserView,"top",e=>[e.state.user]),ue(Dashboard.prototype,"render",(function(){App.user.bio&&(this.state.user.display_picture=An(App.user))}),!0)}(),zi(),ar(),tr(),hr(),function(e){function t(){e.forEach(e=>e())}let n;new MutationObserver(()=>{cancelAnimationFrame(n),n=requestAnimationFrame(t)}).observe(document.body,{subtree:!0,childList:!0}),t()}([dn,oo,dr,To,di,Cn,Uo,bn,eo,Be,vn,Ai])}()}]);
Editor is loading...