This repository has been archived on 2022-09-21. You can view files and clone it, but cannot push or open issues or pull requests.
converse.js-dist/dist/converse.min.js

3 lines
1003 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see converse.min.js.LICENSE.txt */
(()=>{var e,t,n,s,i={9494:(e,t,n)=>{"use strict";const s=n(7672),i=n(4817);e.exports={atob:s,btoa:i}},7672:e=>{"use strict";function t(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e);return t<0?void 0:t}e.exports=function(e){if((e=(e=`${e}`).replace(/[ \t\n\f\r]/g,"")).length%4==0&&(e=e.replace(/==?$/,"")),e.length%4==1||/[^+/0-9A-Za-z]/.test(e))return null;let n="",s=0,i=0;for(let r=0;r<e.length;r++)s<<=6,s|=t(e[r]),i+=6,24===i&&(n+=String.fromCharCode((16711680&s)>>16),n+=String.fromCharCode((65280&s)>>8),n+=String.fromCharCode(255&s),s=i=0);return 12===i?(s>>=4,n+=String.fromCharCode(s)):18===i&&(s>>=2,n+=String.fromCharCode((65280&s)>>8),n+=String.fromCharCode(255&s)),n}},4817:e=>{"use strict";function t(e){if(e>=0&&e<64)return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[e]}e.exports=function(e){let n;for(e=`${e}`,n=0;n<e.length;n++)if(e.charCodeAt(n)>255)return null;let s="";for(n=0;n<e.length;n+=3){const i=[void 0,void 0,void 0,void 0];i[0]=e.charCodeAt(n)>>2,i[1]=(3&e.charCodeAt(n))<<4,e.length>n+1&&(i[1]|=e.charCodeAt(n+1)>>4,i[2]=(15&e.charCodeAt(n+1))<<2),e.length>n+2&&(i[2]|=e.charCodeAt(n+2)>>6,i[3]=63&e.charCodeAt(n+2));for(let e=0;e<i.length;e++)void 0===i[e]?s+="=":s+=t(i[e])}return s}},4457:(e,t,n)=>{var s;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(e){return a(l(e),arguments)}function o(e,t){return r.apply(null,[e].concat(t||[]))}function a(e,t){var n,s,o,a,c,l,u,d,h,f=1,g=e.length,m="";for(s=0;s<g;s++)if("string"==typeof e[s])m+=e[s];else if("object"==typeof e[s]){if((a=e[s]).keys)for(n=t[f],o=0;o<a.keys.length;o++){if(null==n)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[o],a.keys[o-1]));n=n[a.keys[o]]}else n=a.param_no?t[a.param_no]:t[f++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&n instanceof Function&&(n=n()),i.numeric_arg.test(a.type)&&"number"!=typeof n&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %T",n));switch(i.number.test(a.type)&&(d=n>=0),a.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a.width?parseInt(a.width):0);break;case"e":n=a.precision?parseFloat(n).toExponential(a.precision):parseFloat(n).toExponential();break;case"f":n=a.precision?parseFloat(n).toFixed(a.precision):parseFloat(n);break;case"g":n=a.precision?String(Number(n.toPrecision(a.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a.precision?n.substring(0,a.precision):n;break;case"t":n=String(!!n),n=a.precision?n.substring(0,a.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a.precision?n.substring(0,a.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a.precision?n.substring(0,a.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?m+=n:(!i.number.test(a.type)||d&&!a.sign?h="":(h=d?"+":"-",n=n.toString().replace(i.sign,"")),l=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(h+n).length,c=a.width&&u>0?l.repeat(u):"",m+=a.align?h+n+c:"0"===l?h+c+n:c+h+n)}return m}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,s=[],r=0;n;){if(null!==(t=i.text.exec(n)))s.push(t[0]);else if(null!==(t=i.modulo.exec(n)))s.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){r|=1;var o=[],a=t[2],l=[];if(null===(l=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(l[1]);""!==(a=a.substring(l[0].length));)if(null!==(l=i.key_access.exec(a)))o.push(l[1]);else{if(null===(l=i.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(l[1])}t[2]=o}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");s.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=s}t.sprintf=r,t.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=r,window.vsprintf=o,void 0===(s=function(){return{sprintf:r,vsprintf:o}}.call(t,n,t,e))||(e.exports=s))}()},1059:function(e,t,n){var s,i;!function(r,o){"use strict";e.exports?e.exports=o():void 0===(i="function"==typeof(s=o)?s.call(t,n,t,e):s)||(e.exports=i)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,n,s=e.toLowerCase().split(":"),i=s.length,r=8;for(""===s[0]&&""===s[1]&&""===s[2]?(s.shift(),s.shift()):""===s[0]&&""===s[1]?s.shift():""===s[i-1]&&""===s[i-2]&&s.pop(),-1!==s[(i=s.length)-1].indexOf(".")&&(r=7),t=0;t<i&&""!==s[t];t++);if(t<r)for(s.splice(t,1,"0000");s.length<r;)s.splice(t,0,"0000");for(var o=0;o<r;o++){n=s[o].split("");for(var a=0;a<3&&"0"===n[0]&&n.length>1;a++)n.splice(0,1);s[o]=n.join("")}var c=-1,l=0,u=0,d=-1,h=!1;for(o=0;o<r;o++)h?"0"===s[o]?u+=1:(h=!1,u>l&&(c=d,l=u)):"0"===s[o]&&(h=!0,d=o,u=1);u>l&&(c=d,l=u),l>1&&s.splice(c,l,""),i=s.length;var f="";for(""===s[0]&&(f=":"),o=0;o<i&&(f+=s[o],o!==i-1);o++)f+=":";return""===s[i-1]&&(f+=":"),f},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))},4463:function(e,t,n){var s,i;!function(r,o){"use strict";e.exports?e.exports=o():void 0===(i="function"==typeof(s=o)?s.call(t,n,t,e):s)||(e.exports=i)}(0,(function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var s=e.lastIndexOf(".",t-1);if(s<=0||s>=t-1)return!1;var i=n.list[e.slice(t+1)];return!!i&&i.indexOf(" "+e.slice(s+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var s=n.list[e.slice(t+1)];return!!s&&s.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var s=e.lastIndexOf(".",t-1);if(s<=0||s>=t-1)return null;var i=n.list[e.slice(t+1)];return i?i.indexOf(" "+e.slice(s+1,t)+" ")<0?null:e.slice(s+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n}))},2369:function(e,t,n){var s,i,r;!function(o,a){"use strict";e.exports?e.exports=a(n(6635),n(1059),n(4463)):(i=[n(6635),n(1059),n(4463)],void 0===(r="function"==typeof(s=a)?s.apply(t,i):s)||(e.exports=r))}(0,(function(e,t,n,s){"use strict";var i=s&&s.URI;function r(e,t){var n=arguments.length>=1,s=arguments.length>=2;if(!(this instanceof r))return n?s?new r(e,t):new r(e):new r;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}r.version="1.19.6";var o=r.prototype,a=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function u(e){return"Array"===l(e)}function d(e,t){var n,s,i={};if("RegExp"===l(t))i=null;else if(u(t))for(n=0,s=t.length;n<s;n++)i[t[n]]=!0;else i[t]=!0;for(n=0,s=e.length;n<s;n++)(i&&void 0!==i[e[n]]||!i&&t.test(e[n]))&&(e.splice(n,1),s--,n--);return e}function h(e,t){var n,s;if(u(t)){for(n=0,s=t.length;n<s;n++)if(!h(e,t[n]))return!1;return!0}var i=l(t);for(n=0,s=e.length;n<s;n++)if("RegExp"===i){if("string"==typeof e[n]&&e[n].match(t))return!0}else if(e[n]===t)return!0;return!1}function f(e,t){if(!u(e)||!u(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var n=0,s=e.length;n<s;n++)if(e[n]!==t[n])return!1;return!0}function g(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function p(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return r.domAttributes[t]}},r.encode=p,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=p,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(e,t){var n=r.encode(e+"");return void 0===t&&(t=r.escapeQuerySpace),t?n.replace(/%20/g,"+"):n},r.decodeQuery=function(e,t){e+="",void 0===t&&(t=r.escapeQuerySpace);try{return r.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var v,b={encode:"encode",decode:"decode"},y=function(e,t){return function(n){try{return r[t](n+"").replace(r.characters[e][t].expression,(function(n){return r.characters[e][t].map[n]}))}catch(e){return n}}};for(v in b)r[v+"PathSegment"]=y("pathname",b[v]),r[v+"UrnPathSegment"]=y("urnpath",b[v]);var _=function(e,t,n){return function(s){var i;i=n?function(e){return r[t](r[n](e))}:r[t];for(var o=(s+"").split(e),a=0,c=o.length;a<c;a++)o[a]=i(o[a]);return o.join(e)}};function w(e){return function(t,n){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!n),this)}}function S(e,t){return function(n,s){return void 0===n?this._parts[e]||"":(null!==n&&(n+="").charAt(0)===t&&(n=n.substring(1)),this._parts[e]=n,this.build(!s),this)}}r.decodePath=_("/","decodePathSegment"),r.decodeUrnPath=_(":","decodeUrnPathSegment"),r.recodePath=_("/","encodePathSegment","decode"),r.recodeUrnPath=_(":","encodeUrnPathSegment","decode"),r.encodeReserved=y("reserved","encode"),r.parse=function(e,t){var n;return t||(t={preventInvalidHostname:r.preventInvalidHostname}),(n=e.indexOf("#"))>-1&&(t.fragment=e.substring(n+1)||null,e=e.substring(0,n)),(n=e.indexOf("?"))>-1&&(t.query=e.substring(n+1)||null,e=e.substring(0,n)),"//"===e.substring(0,2)?(t.protocol=null,e=e.substring(2),e=r.parseAuthority(e,t)):(n=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,n)||null,t.protocol&&!t.protocol.match(r.protocol_expression)?t.protocol=void 0:"//"===e.substring(n+1,n+3).replace(/\\/g,"/")?(e=e.substring(n+3),e=r.parseAuthority(e,t)):(e=e.substring(n+1),t.urn=!0)),t.path=e,t},r.parseHost=function(e,t){e||(e="");var n,s,i=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===i&&(i=e.length),"["===e.charAt(0))n=e.indexOf("]"),t.hostname=e.substring(1,n)||null,t.port=e.substring(n+2,i)||null,"/"===t.port&&(t.port=null);else{var o=e.indexOf(":"),a=e.indexOf("/"),c=e.indexOf(":",o+1);-1!==c&&(-1===a||c<a)?(t.hostname=e.substring(0,i)||null,t.port=null):(s=e.substring(0,i).split(":"),t.hostname=s[0]||null,t.port=s[1]||null)}return t.hostname&&"/"!==e.substring(i).charAt(0)&&(i++,e="/"+e),t.preventInvalidHostname&&r.ensureValidHostname(t.hostname,t.protocol),t.port&&r.ensureValidPort(t.port),e.substring(i)||"/"},r.parseAuthority=function(e,t){return e=r.parseUserinfo(e,t),r.parseHost(e,t)},r.parseUserinfo=function(e,t){var n=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var s,i=e.indexOf("/"),o=e.lastIndexOf("@",i>-1?i:e.length-1);return o>-1&&(-1===i||o<i)?(s=e.substring(0,o).split(":"),t.username=s[0]?r.decode(s[0]):null,s.shift(),t.password=s[0]?r.decode(s.join(":")):null,e=n.substring(o+1)):(t.username=null,t.password=null),e},r.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var n,s,i,o={},c=e.split("&"),l=c.length,u=0;u<l;u++)n=c[u].split("="),s=r.decodeQuery(n.shift(),t),i=n.length?r.decodeQuery(n.join("="),t):null,a.call(o,s)?("string"!=typeof o[s]&&null!==o[s]||(o[s]=[o[s]]),o[s].push(i)):o[s]=i;return o},r.build=function(e){var t="",n=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",n=!0),t+=r.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&n&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},r.buildHost=function(e){var t="";return e.hostname?(r.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},r.buildAuthority=function(e){return r.buildUserinfo(e)+r.buildHost(e)},r.buildUserinfo=function(e){var t="";return e.username&&(t+=r.encode(e.username)),e.password&&(t+=":"+r.encode(e.password)),t&&(t+="@"),t},r.buildQuery=function(e,t,n){var s,i,o,c,l="";for(i in e)if(a.call(e,i))if(u(e[i]))for(s={},o=0,c=e[i].length;o<c;o++)void 0!==e[i][o]&&void 0===s[e[i][o]+""]&&(l+="&"+r.buildQueryParameter(i,e[i][o],n),!0!==t&&(s[e[i][o]+""]=!0));else void 0!==e[i]&&(l+="&"+r.buildQueryParameter(i,e[i],n));return l.substring(1)},r.buildQueryParameter=function(e,t,n){return r.encodeQuery(e,n)+(null!==t?"="+r.encodeQuery(t,n):"")},r.addQuery=function(e,t,n){if("object"==typeof t)for(var s in t)a.call(t,s)&&r.addQuery(e,s,t[s]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=n);"string"==typeof e[t]&&(e[t]=[e[t]]),u(n)||(n=[n]),e[t]=(e[t]||[]).concat(n)}},r.setQuery=function(e,t,n){if("object"==typeof t)for(var s in t)a.call(t,s)&&r.setQuery(e,s,t[s]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===n?null:n}},r.removeQuery=function(e,t,n){var s,i,o;if(u(t))for(s=0,i=t.length;s<i;s++)e[t[s]]=void 0;else if("RegExp"===l(t))for(o in e)t.test(o)&&(e[o]=void 0);else if("object"==typeof t)for(o in t)a.call(t,o)&&r.removeQuery(e,o,t[o]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==n?"RegExp"===l(n)?!u(e[t])&&n.test(e[t])?e[t]=void 0:e[t]=d(e[t],n):e[t]!==String(n)||u(n)&&1!==n.length?u(e[t])&&(e[t]=d(e[t],n)):e[t]=void 0:e[t]=void 0}},r.hasQuery=function(e,t,n,s){switch(l(t)){case"String":break;case"RegExp":for(var i in e)if(a.call(e,i)&&t.test(i)&&(void 0===n||r.hasQuery(e,i,n)))return!0;return!1;case"Object":for(var o in t)if(a.call(t,o)&&!r.hasQuery(e,o,t[o]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(n)){case"Undefined":return t in e;case"Boolean":return n===Boolean(u(e[t])?e[t].length:e[t]);case"Function":return!!n(e[t],t,e);case"Array":return!!u(e[t])&&(s?h:f)(e[t],n);case"RegExp":return u(e[t])?!!s&&h(e[t],n):Boolean(e[t]&&e[t].match(n));case"Number":n=String(n);case"String":return u(e[t])?!!s&&h(e[t],n):e[t]===n;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var e=[],t=[],n=0,s=0;s<arguments.length;s++){var i=new r(arguments[s]);e.push(i);for(var o=i.segment(),a=0;a<o.length;a++)"string"==typeof o[a]&&t.push(o[a]),o[a]&&n++}if(!t.length||!n)return new r("");var c=new r("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||c.path("/"+c.path()),c.normalize()},r.commonPath=function(e,t){var n,s=Math.min(e.length,t.length);for(n=0;n<s;n++)if(e.charAt(n)!==t.charAt(n)){n--;break}return n<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(n)&&"/"===t.charAt(n)||(n=e.substring(0,n).lastIndexOf("/")),e.substring(0,n+1))},r.withinString=function(e,t,n){n||(n={});var s=n.start||r.findUri.start,i=n.end||r.findUri.end,o=n.trim||r.findUri.trim,a=n.parens||r.findUri.parens,c=/[a-z0-9-]=["']?$/i;for(s.lastIndex=0;;){var l=s.exec(e);if(!l)break;var u=l.index;if(n.ignoreHtml){var d=e.slice(Math.max(u-3,0),u);if(d&&c.test(d))continue}for(var h=u+e.slice(u).search(i),f=e.slice(u,h),g=-1;;){var m=a.exec(f);if(!m)break;var p=m.index+m[0].length;g=Math.max(g,p)}if(!((f=g>-1?f.slice(0,g)+f.slice(g).replace(o,""):f.replace(o,"")).length<=l[0].length||n.ignore&&n.ignore.test(f))){var v=t(f,u,h=u+f.length,e);void 0!==v?(v=String(v),e=e.slice(0,u)+v+e.slice(h),s.lastIndex=u+v.length):s.lastIndex=h}}return s.lastIndex=0,e},r.ensureValidHostname=function(t,n){var s=!!t,i=!1;if(!!n&&(i=h(r.hostProtocols,n)),i&&!s)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(t&&t.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},r.noConflict=function(e){if(e){var t={URI:this.noConflict()};return s.URITemplate&&"function"==typeof s.URITemplate.noConflict&&(t.URITemplate=s.URITemplate.noConflict()),s.IPv6&&"function"==typeof s.IPv6.noConflict&&(t.IPv6=s.IPv6.noConflict()),s.SecondLevelDomains&&"function"==typeof s.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=s.SecondLevelDomains.noConflict()),t}return s.URI===this&&(s.URI=i),this},o.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},o.clone=function(){return new r(this)},o.valueOf=o.toString=function(){return this.build(!1)._string},o.protocol=w("protocol"),o.username=w("username"),o.password=w("password"),o.hostname=w("hostname"),o.port=w("port"),o.query=S("query","?"),o.fragment=S("fragment","#"),o.search=function(e,t){var n=this.query(e,t);return"string"==typeof n&&n.length?"?"+n:n},o.hash=function(e,t){var n=this.fragment(e,t);return"string"==typeof n&&n.length?"#"+n:n},o.pathname=function(e,t){if(void 0===e||!0===e){var n=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?r.decodeUrnPath:r.decodePath)(n):n}return this._parts.urn?this._parts.path=e?r.recodeUrnPath(e):"":this._parts.path=e?r.recodePath(e):"/",this.build(!t),this},o.path=o.pathname,o.href=function(e,t){var n;if(void 0===e)return this.toString();this._string="",this._parts=r._parts();var s=e instanceof r,i="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[r.getDomAttribute(e)]||"",i=!1),!s&&i&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=r.parse(String(e),this._parts);else{if(!s&&!i)throw new TypeError("invalid input");var o=s?e._parts:e;for(n in o)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=o[n]);o.query&&this.query(o.query,!1)}return this.build(!t),this},o.is=function(e){var t=!1,s=!1,i=!1,o=!1,a=!1,c=!1,l=!1,u=!this._parts.urn;switch(this._parts.hostname&&(u=!1,s=r.ip4_expression.test(this._parts.hostname),i=r.ip6_expression.test(this._parts.hostname),a=(o=!(t=s||i))&&n&&n.has(this._parts.hostname),c=o&&r.idn_expression.test(this._parts.hostname),l=o&&r.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return u;case"absolute":return!u;case"domain":case"name":return o;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return s;case"ip6":case"ipv6":case"inet6":return i;case"idn":return c;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var x=o.protocol,E=o.port,j=o.hostname;o.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(r.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},o.scheme=o.protocol,o.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),r.ensureValidPort(e))),E.call(this,e,t))},o.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==r.parseHost(e,n))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=n.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(e,this._parts.protocol)}return j.call(this,e,t)},o.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var s=r(e);return this.protocol(s.protocol()).authority(s.authority()).build(!t),this},o.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?r.buildHost(this._parts):"";if("/"!==r.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},o.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?r.buildAuthority(this._parts):"";if("/"!==r.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},o.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var n=r.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==e[e.length-1]&&(e+="@"),r.parseUserinfo(e,this._parts),this.build(!t),this},o.resource=function(e,t){var n;return void 0===e?this.path()+this.search()+this.hash():(n=r.parse(e),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!t),this)},o.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var s=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,s),o=new RegExp("^"+c(i));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&r.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(o,e),this.build(!t),this},o.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var s=this._parts.hostname.length-this.tld(t).length-1;return s=this._parts.hostname.lastIndexOf(".",s-1)+1,this._parts.hostname.substring(s)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var i=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},o.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var s=this._parts.hostname.lastIndexOf("."),i=this._parts.hostname.substring(s+1);return!0!==t&&n&&n.list[i.toLowerCase()]&&n.get(this._parts.hostname)||i}var r;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');r=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");r=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(r,e)}return this.build(!t),this},o.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,s=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return e?r.decodePath(s):s}var i=this._parts.path.length-this.filename().length,o=this._parts.path.substring(0,i),a=new RegExp("^"+c(o));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=r.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},o.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),s=this._parts.path.substring(n+1);return e?r.decodePathSegment(s):s}var i=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(i=!0);var o=new RegExp(c(this.filename())+"$");return e=r.recodePath(e),this._parts.path=this._parts.path.replace(o,e),i?this.normalizePath(t):this.build(!t),this},o.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var n,s,i=this.filename(),o=i.lastIndexOf(".");return-1===o?"":(n=i.substring(o+1),s=/^[a-z0-9%]+$/i.test(n)?n:"",e?r.decodePathSegment(s):s)}"."===e.charAt(0)&&(e=e.substring(1));var a,l=this.suffix();if(l)a=e?new RegExp(c(l)+"$"):new RegExp(c("."+l)+"$");else{if(!e)return this;this._parts.path+="."+r.recodePath(e)}return a&&(e=r.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},o.segment=function(e,t,n){var s=this._parts.urn?":":"/",i=this.path(),r="/"===i.substring(0,1),o=i.split(s);if(void 0!==e&&"number"!=typeof e&&(n=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(r&&o.shift(),e<0&&(e=Math.max(o.length+e,0)),void 0===t)return void 0===e?o:o[e];if(null===e||void 0===o[e])if(u(t)){o=[];for(var a=0,c=t.length;a<c;a++)(t[a].length||o.length&&o[o.length-1].length)&&(o.length&&!o[o.length-1].length&&o.pop(),o.push(g(t[a])))}else(t||"string"==typeof t)&&(t=g(t),""===o[o.length-1]?o[o.length-1]=t:o.push(t));else t?o[e]=g(t):o.splice(e,1);return r&&o.unshift(""),this.path(o.join(s),n)},o.segmentCoded=function(e,t,n){var s,i,o;if("number"!=typeof e&&(n=t,t=e,e=void 0),void 0===t){if(u(s=this.segment(e,t,n)))for(i=0,o=s.length;i<o;i++)s[i]=r.decode(s[i]);else s=void 0!==s?r.decode(s):void 0;return s}if(u(t))for(i=0,o=t.length;i<o;i++)t[i]=r.encode(t[i]);else t="string"==typeof t||t instanceof String?r.encode(t):t;return this.segment(e,t,n)};var A=o.query;return o.query=function(e,t){if(!0===e)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var n=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),s=e.call(this,n);return this._parts.query=r.buildQuery(s||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=r.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):A.call(this,e,t)},o.setQuery=function(e,t,n){var s=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)s[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var i in e)a.call(e,i)&&(s[i]=e[i])}return this._parts.query=r.buildQuery(s,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},o.addQuery=function(e,t,n){var s=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(s,e,void 0===t?null:t),this._parts.query=r.buildQuery(s,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},o.removeQuery=function(e,t,n){var s=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(s,e,t),this._parts.query=r.buildQuery(s,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(n=t),this.build(!n),this},o.hasQuery=function(e,t,n){var s=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(s,e,t,n)},o.setSearch=o.setQuery,o.addSearch=o.addQuery,o.removeSearch=o.removeQuery,o.hasSearch=o.hasQuery,o.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},o.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},o.normalizeHostname=function(n){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},o.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},o.normalizePath=function(e){var t,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var s,i,o="";for("/"!==(n=r.recodePath(n)).charAt(0)&&(t=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(o=n.substring(1).match(/^(\.\.\/)+/)||"")&&(o=o[0]);-1!==(s=n.search(/\/\.\.(\/|$)/));)0!==s?(-1===(i=n.substring(0,s).lastIndexOf("/"))&&(i=s),n=n.substring(0,i)+n.substring(s+3)):n=n.substring(3);return t&&this.is("relative")&&(n=o+n.substring(1)),this._parts.path=n,this.build(!e),this},o.normalizePathname=o.normalizePath,o.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},o.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},o.normalizeSearch=o.normalizeQuery,o.normalizeHash=o.normalizeFragment,o.iso8859=function(){var e=r.encode,t=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=e,r.decode=t}return this},o.unicode=function(){var e=r.encode,t=r.decode;r.encode=p,r.decode=unescape;try{this.normalize()}finally{r.encode=e,r.decode=t}return this},o.readable=function(){var t=this.clone();t.username("").password("").normalize();var n="";if(t._parts.protocol&&(n+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(n+=e.toUnicode(t._parts.hostname),t._parts.port&&(n+=":"+t._parts.port)):n+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(n+="/"),n+=t.path(!0),t._parts.query){for(var s="",i=0,o=t._parts.query.split("&"),a=o.length;i<a;i++){var c=(o[i]||"").split("=");s+="&"+r.decodeQuery(c[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==c[1]&&(s+="="+r.decodeQuery(c[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+s.substring(1)}return n+r.decodeQuery(t.hash(),!0)},o.absoluteTo=function(e){var t,n,s,i=this.clone(),o=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof r||(e=new r(e)),i._parts.protocol)return i;if(i._parts.protocol=e._parts.protocol,this._parts.hostname)return i;for(n=0;s=o[n];n++)i._parts[s]=e._parts[s];return i._parts.path?(".."===i._parts.path.substring(-2)&&(i._parts.path+="/"),"/"!==i.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),i._parts.path=(t?t+"/":"")+i._parts.path,i.normalizePath())):(i._parts.path=e._parts.path,i._parts.query||(i._parts.query=e._parts.query)),i.build(),i},o.relativeTo=function(e){var t,n,s,i,o,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new r(e).normalize(),t=a._parts,n=e._parts,i=a.path(),o=e.path(),"/"!==i.charAt(0))throw new Error("URI is already relative");if("/"!==o.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===n.protocol&&(t.protocol=null),t.username!==n.username||t.password!==n.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==n.hostname||t.port!==n.port)return a.build();if(t.hostname=null,t.port=null,i===o)return t.path="",a.build();if(!(s=r.commonPath(i,o)))return a.build();var c=n.path.substring(s.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=c+t.path.substring(s.length)||"./",a.build()},o.equals=function(e){var t,n,s,i,o,c=this.clone(),l=new r(e),d={};if(c.normalize(),l.normalize(),c.toString()===l.toString())return!0;if(s=c.query(),i=l.query(),c.query(""),l.query(""),c.toString()!==l.toString())return!1;if(s.length!==i.length)return!1;for(o in t=r.parseQuery(s,this._parts.escapeQuerySpace),n=r.parseQuery(i,this._parts.escapeQuerySpace),t)if(a.call(t,o)){if(u(t[o])){if(!f(t[o],n[o]))return!1}else if(t[o]!==n[o])return!1;d[o]=!0}for(o in n)if(a.call(n,o)&&!d[o])return!1;return!0},o.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},o.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},o.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},r}))},6635:function(e,t,n){var s;e=n.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var r="object"==typeof n.g&&n.g;r.global!==r&&r.window!==r&&r.self;var o,a=2147483647,c=36,l=/^xn--/,u=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,g=String.fromCharCode;function m(e){throw new RangeError(h[e])}function p(e,t){for(var n=e.length,s=[];n--;)s[n]=t(e[n]);return s}function v(e,t){var n=e.split("@"),s="";return n.length>1&&(s=n[0]+"@",e=n[1]),s+p((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t,n,s=[],i=0,r=e.length;i<r;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<r?56320==(64512&(n=e.charCodeAt(i++)))?s.push(((1023&t)<<10)+(1023&n)+65536):(s.push(t),i--):s.push(t);return s}function y(e){return p(e,(function(e){var t="";return e>65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+g(e)})).join("")}function _(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var s=0;for(e=n?f(e/700):e>>1,e+=f(e/t);e>455;s+=c)e=f(e/35);return f(s+36*e/(e+38))}function S(e){var t,n,s,i,r,o,l,u,d,h,g,p=[],v=e.length,b=0,_=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),s=0;s<n;++s)e.charCodeAt(s)>=128&&m("not-basic"),p.push(e.charCodeAt(s));for(i=n>0?n+1:0;i<v;){for(r=b,o=1,l=c;i>=v&&m("invalid-input"),((u=(g=e.charCodeAt(i++))-48<10?g-22:g-65<26?g-65:g-97<26?g-97:c)>=c||u>f((a-b)/o))&&m("overflow"),b+=u*o,!(u<(d=l<=S?1:l>=S+26?26:l-S));l+=c)o>f(a/(h=c-d))&&m("overflow"),o*=h;S=w(b-r,t=p.length+1,0==r),f(b/t)>a-_&&m("overflow"),_+=f(b/t),b%=t,p.splice(b++,0,_)}return y(p)}function x(e){var t,n,s,i,r,o,l,u,d,h,p,v,y,S,x,E=[];for(v=(e=b(e)).length,t=128,n=0,r=72,o=0;o<v;++o)(p=e[o])<128&&E.push(g(p));for(s=i=E.length,i&&E.push("-");s<v;){for(l=a,o=0;o<v;++o)(p=e[o])>=t&&p<l&&(l=p);for(l-t>f((a-n)/(y=s+1))&&m("overflow"),n+=(l-t)*y,t=l,o=0;o<v;++o)if((p=e[o])<t&&++n>a&&m("overflow"),p==t){for(u=n,d=c;!(u<(h=d<=r?1:d>=r+26?26:d-r));d+=c)x=u-h,S=c-h,E.push(g(_(h+x%S,0))),u=f(x/S);E.push(g(_(u,0))),r=w(n,y,s==i),n=0,++s}++n,++t}return E.join("")}o={version:"1.3.2",ucs2:{decode:b,encode:y},decode:S,encode:x,toASCII:function(e){return v(e,(function(e){return u.test(e)?"xn--"+x(e):e}))},toUnicode:function(e){return v(e,(function(e){return l.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(s=function(){return o}.call(t,n,t,e))||(e.exports=s)}()},9598:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>oC});const s=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},i=function(e,t){return e===t||e!=e&&t!=t},r=function(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1};var o=Array.prototype.splice;function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}a.prototype.clear=function(){this.__data__=[],this.size=0},a.prototype.delete=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))},a.prototype.get=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]},a.prototype.has=function(e){return r(this.__data__,e)>-1},a.prototype.set=function(e,t){var n=this.__data__,s=r(n,e);return s<0?(++this.size,n.push([e,t])):n[s][1]=t,this};const c=a,l="object"==typeof global&&global&&global.Object===Object&&global;var u="object"==typeof self&&self&&self.Object===Object&&self;const d=l||u||Function("return this")(),h=d.Symbol;var f=Object.prototype,g=f.hasOwnProperty,m=f.toString,p=h?h.toStringTag:void 0;var v=Object.prototype.toString;var b=h?h.toStringTag:void 0;const y=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":b&&b in Object(e)?function(e){var t=g.call(e,p),n=e[p];try{e[p]=void 0;var s=!0}catch(e){}var i=m.call(e);return s&&(t?e[p]=n:delete e[p]),i}(e):function(e){return v.call(e)}(e)},_=function(e){if(!s(e))return!1;var t=y(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},w=d["__core-js_shared__"];var S,x=(S=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"";var E=Function.prototype.toString;const j=function(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var A=/^\[object .+?Constructor\]$/,C=Function.prototype,k=Object.prototype,O=C.toString,T=k.hasOwnProperty,N=RegExp("^"+O.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const I=function(e){return!(!s(e)||(t=e,x&&x in t))&&(_(e)?N:A).test(j(e));var t},M=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return I(n)?n:void 0},R=M(d,"Map"),D=M(Object,"create");var z=Object.prototype.hasOwnProperty;var L=Object.prototype.hasOwnProperty;function P(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}P.prototype.clear=function(){this.__data__=D?D(null):{},this.size=0},P.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},P.prototype.get=function(e){var t=this.__data__;if(D){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return z.call(t,e)?t[e]:void 0},P.prototype.has=function(e){var t=this.__data__;return D?void 0!==t[e]:L.call(t,e)},P.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=D&&void 0===t?"__lodash_hash_undefined__":t,this};const F=P,B=function(e,t){var n,s,i=e.__data__;return("string"==(s=typeof(n=t))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function U(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var s=e[t];this.set(s[0],s[1])}}U.prototype.clear=function(){this.size=0,this.__data__={hash:new F,map:new(R||c),string:new F}},U.prototype.delete=function(e){var t=B(this,e).delete(e);return this.size-=t?1:0,t},U.prototype.get=function(e){return B(this,e).get(e)},U.prototype.has=function(e){return B(this,e).has(e)},U.prototype.set=function(e,t){var n=B(this,e),s=n.size;return n.set(e,t),this.size+=n.size==s?0:1,this};const q=U;function H(e){var t=this.__data__=new c(e);this.size=t.size}H.prototype.clear=function(){this.__data__=new c,this.size=0},H.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},H.prototype.get=function(e){return this.__data__.get(e)},H.prototype.has=function(e){return this.__data__.has(e)},H.prototype.set=function(e,t){var n=this.__data__;if(n instanceof c){var s=n.__data__;if(!R||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new q(s)}return n.set(e,t),this.size=n.size,this};const $=H,G=function(){try{var e=M(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),V=function(e,t,n){"__proto__"==t&&G?G(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},W=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&V(e,t,n)},J=function(e,t,n){for(var s=-1,i=Object(e),r=n(e),o=r.length;o--;){var a=r[++s];if(!1===t(i[a],a,i))break}return e};var Q="object"==typeof exports&&exports&&!exports.nodeType&&exports,Y=Q&&"object"==typeof module&&module&&!module.nodeType&&module,K=Y&&Y.exports===Q?d.Buffer:void 0,X=K?K.allocUnsafe:void 0;const Z=function(e,t){if(t)return e.slice();var n=e.length,s=X?X(n):new e.constructor(n);return e.copy(s),s},ee=d.Uint8Array,te=function(e){var t=new e.constructor(e.byteLength);return new ee(t).set(new ee(e)),t},ne=function(e,t){var n=t?te(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},se=function(e,t){var n=-1,s=e.length;for(t||(t=Array(s));++n<s;)t[n]=e[n];return t};var ie=Object.create;const re=function(){function e(){}return function(t){if(!s(t))return{};if(ie)return ie(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),oe=function(e,t){return function(n){return e(t(n))}},ae=oe(Object.getPrototypeOf,Object);var ce=Object.prototype;const le=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ce)},ue=function(e){return"function"!=typeof e.constructor||le(e)?{}:re(ae(e))},de=function(e){return null!=e&&"object"==typeof e},he=function(e){return de(e)&&"[object Arguments]"==y(e)};var fe=Object.prototype,ge=fe.hasOwnProperty,me=fe.propertyIsEnumerable;const pe=he(function(){return arguments}())?he:function(e){return de(e)&&ge.call(e,"callee")&&!me.call(e,"callee")},ve=Array.isArray,be=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ye=function(e){return null!=e&&be(e.length)&&!_(e)},_e=function(e){return de(e)&&ye(e)};var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Se=we&&"object"==typeof module&&module&&!module.nodeType&&module,xe=Se&&Se.exports===we?d.Buffer:void 0;const Ee=(xe?xe.isBuffer:void 0)||function(){return!1};var je=Function.prototype,Ae=Object.prototype,Ce=je.toString,ke=Ae.hasOwnProperty,Oe=Ce.call(Object);const Te=function(e){if(!de(e)||"[object Object]"!=y(e))return!1;var t=ae(e);if(null===t)return!0;var n=ke.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ce.call(n)==Oe};var Ne={};Ne["[object Float32Array]"]=Ne["[object Float64Array]"]=Ne["[object Int8Array]"]=Ne["[object Int16Array]"]=Ne["[object Int32Array]"]=Ne["[object Uint8Array]"]=Ne["[object Uint8ClampedArray]"]=Ne["[object Uint16Array]"]=Ne["[object Uint32Array]"]=!0,Ne["[object Arguments]"]=Ne["[object Array]"]=Ne["[object ArrayBuffer]"]=Ne["[object Boolean]"]=Ne["[object DataView]"]=Ne["[object Date]"]=Ne["[object Error]"]=Ne["[object Function]"]=Ne["[object Map]"]=Ne["[object Number]"]=Ne["[object Object]"]=Ne["[object RegExp]"]=Ne["[object Set]"]=Ne["[object String]"]=Ne["[object WeakMap]"]=!1;const Ie=function(e){return function(t){return e(t)}};var Me="object"==typeof exports&&exports&&!exports.nodeType&&exports,Re=Me&&"object"==typeof module&&module&&!module.nodeType&&module,De=Re&&Re.exports===Me&&l.process;const ze=function(){try{return Re&&Re.require&&Re.require("util").types||De&&De.binding&&De.binding("util")}catch(e){}}();var Le=ze&&ze.isTypedArray;const Pe=Le?Ie(Le):function(e){return de(e)&&be(e.length)&&!!Ne[y(e)]},Fe=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var Be=Object.prototype.hasOwnProperty;const Ue=function(e,t,n){var s=e[t];Be.call(e,t)&&i(s,n)&&(void 0!==n||t in e)||V(e,t,n)},qe=function(e,t,n,s){var i=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var a=t[r],c=s?s(n[a],e[a],a,n,e):void 0;void 0===c&&(c=e[a]),i?V(n,a,c):Ue(n,a,c)}return n};var He=/^(?:0|[1-9]\d*)$/;const $e=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&He.test(e))&&e>-1&&e%1==0&&e<t};var Ge=Object.prototype.hasOwnProperty;const Ve=function(e,t){var n=ve(e),s=!n&&pe(e),i=!n&&!s&&Ee(e),r=!n&&!s&&!i&&Pe(e),o=n||s||i||r,a=o?function(e,t){for(var n=-1,s=Array(e);++n<e;)s[n]=t(n);return s}(e.length,String):[],c=a.length;for(var l in e)!t&&!Ge.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||$e(l,c))||a.push(l);return a};var We=Object.prototype.hasOwnProperty;const Je=function(e){if(!s(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var i in e)("constructor"!=i||!t&&We.call(e,i))&&n.push(i);return n},Qe=function(e){return ye(e)?Ve(e,!0):Je(e)},Ye=function(e,t,n,i,r,o,a){var c,l=Fe(e,n),u=Fe(t,n),d=a.get(u);if(d)W(e,n,d);else{var h=o?o(l,u,n+"",e,t,a):void 0,f=void 0===h;if(f){var g=ve(u),m=!g&&Ee(u),p=!g&&!m&&Pe(u);h=u,g||m||p?ve(l)?h=l:_e(l)?h=se(l):m?(f=!1,h=Z(u,!0)):p?(f=!1,h=ne(u,!0)):h=[]:Te(u)||pe(u)?(h=l,pe(l)?h=qe(c=l,Qe(c)):s(l)&&!_(l)||(h=ue(u))):f=!1}f&&(a.set(u,h),r(h,u,i,o,a),a.delete(u)),W(e,n,h)}},Ke=function e(t,n,i,r,o){t!==n&&J(n,(function(a,c){if(o||(o=new $),s(a))Ye(t,n,c,i,e,r,o);else{var l=r?r(Fe(t,c),a,c+"",t,n,o):void 0;void 0===l&&(l=a),W(t,c,l)}}),Qe)},Xe=function(e){return e},Ze=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var et=Math.max;const tt=function(e,t,n){return t=et(void 0===t?e.length-1:t,0),function(){for(var s=arguments,i=-1,r=et(s.length-t,0),o=Array(r);++i<r;)o[i]=s[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=s[i];return a[t]=n(o),Ze(e,this,a)}},nt=function(e){return function(){return e}},st=G?function(e,t){return G(e,"toString",{configurable:!0,enumerable:!1,value:nt(t),writable:!0})}:Xe;var it=Date.now;const rt=(ot=st,at=0,ct=0,function(){var e=it(),t=16-(e-ct);if(ct=e,t>0){if(++at>=800)return arguments[0]}else at=0;return ot.apply(void 0,arguments)});var ot,at,ct;const lt=function(e,t){return rt(tt(e,t,Xe),e+"")},ut=function(e,t,n){if(!s(n))return!1;var r=typeof t;return!!("number"==r?ye(n)&&$e(t,n.length):"string"==r&&t in n)&&i(n[t],e)},dt=function(e){return lt((function(t,n){var s=-1,i=n.length,r=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(i--,r):void 0,o&&ut(n[0],n[1],o)&&(r=i<3?void 0:r,i=1),t=Object(t);++s<i;){var a=n[s];a&&e(t,a,s,r)}return t}))},ht=dt((function(e,t,n){Ke(e,t,n)})),ft=dt((function(e,t,n,s){Ke(e,t,n,s)})),gt=function(){return d.Date.now()};var mt=/\s/;var pt=/^\s+/;const vt=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&mt.test(e.charAt(t)););return t}(e)+1).replace(pt,""):e},bt=function(e){return"symbol"==typeof e||de(e)&&"[object Symbol]"==y(e)};var yt=/^[-+]0x[0-9a-f]+$/i,_t=/^0b[01]+$/i,wt=/^0o[0-7]+$/i,St=parseInt;const xt=function(e){if("number"==typeof e)return e;if(bt(e))return NaN;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=vt(e);var n=_t.test(e);return n||wt.test(e)?St(e.slice(2),n?2:8):yt.test(e)?NaN:+e};function Et(){const e={isResolved:!1,isPending:!0,isRejected:!1},t=new Promise(((t,n)=>{e.resolve=t,e.reject=n}));return Object.assign(t,e),t.then((function(e){return t.isResolved=!0,t.isPending=!1,t.isRejected=!1,e}),(function(e){throw t.isResolved=!1,t.isPending=!1,t.isRejected=!0,e})),t}const jt=Math.max,At=Math.min,Ct=function(e,t,n={}){let i,r,o,a,c,l=[],u=0,d=!1,h=n.promise?Et():null;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){const s=l,r=i;return l=[],i=void 0,u=t,o=e.apply(r,s),n.promise&&(h.resolve(o),h=Et()),n.promise?h:o}function g(e){return u=e,a=setTimeout(p,t),n.promise?h:o}function m(e){const n=e-c;return void 0===c||n>=t||n<0||d&&e-u>=r}function p(){const e=gt();if(m(e))return v(e);a=setTimeout(p,function(e){const n=t-(e-c);return d?At(n,r-(e-u)):n}(e))}function v(e){return a=void 0,l?f(e):(l=[],i=void 0,n.promise?h:o)}function b(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.concat(t)}function y(e){return l.length?e.length?(null==n?void 0:n.concatArrays)?ft(l,e,b):ht(l,e):l:e.length?e:[]}function _(){const e=gt(),s=m(e);if(l=y(Array.from(arguments)),i=this,c=e,s){if(void 0===a)return g(c);if(d)return clearTimeout(a),a=setTimeout(p,t),f(c)}return void 0===a&&(a=setTimeout(p,t)),n.promise?h:o}return t=xt(t)||0,s(n)&&(d="maxWait"in n,r=d?jt(xt(n.maxWait)||0,t):r),_.cancel=function(){void 0!==a&&clearTimeout(a),u=0,l=[],c=i=a=void 0},_.flush=function(){return void 0===a?o:v(gt())},_};var kt=n(9483),Ot=n(3245);const Tt=oe(Object.keys,Object);var Nt=Object.prototype.hasOwnProperty;const It=function(e){if(!le(e))return Tt(e);var t=[];for(var n in Object(e))Nt.call(e,n)&&"constructor"!=n&&t.push(n);return t},Mt=function(e){return ye(e)?Ve(e):It(e)},Rt=function(e,t){return e&&qe(t,Mt(t),e)},Dt=function(){return[]};var zt=Object.prototype.propertyIsEnumerable,Lt=Object.getOwnPropertySymbols;const Pt=Lt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,s=null==e?0:e.length,i=0,r=[];++n<s;){var o=e[n];t(o,n,e)&&(r[i++]=o)}return r}(Lt(e),(function(t){return zt.call(e,t)})))}:Dt,Ft=function(e,t){for(var n=-1,s=t.length,i=e.length;++n<s;)e[i+n]=t[n];return e},Bt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ft(t,Pt(e)),e=ae(e);return t}:Dt,Ut=function(e,t,n){var s=t(e);return ve(e)?s:Ft(s,n(e))},qt=function(e){return Ut(e,Mt,Pt)},Ht=function(e){return Ut(e,Qe,Bt)},$t=M(d,"DataView"),Gt=M(d,"Promise"),Vt=M(d,"Set"),Wt=M(d,"WeakMap");var Jt="[object Map]",Qt="[object Promise]",Yt="[object Set]",Kt="[object WeakMap]",Xt="[object DataView]",Zt=j($t),en=j(R),tn=j(Gt),nn=j(Vt),sn=j(Wt),rn=y;($t&&rn(new $t(new ArrayBuffer(1)))!=Xt||R&&rn(new R)!=Jt||Gt&&rn(Gt.resolve())!=Qt||Vt&&rn(new Vt)!=Yt||Wt&&rn(new Wt)!=Kt)&&(rn=function(e){var t=y(e),n="[object Object]"==t?e.constructor:void 0,s=n?j(n):"";if(s)switch(s){case Zt:return Xt;case en:return Jt;case tn:return Qt;case nn:return Yt;case sn:return Kt}return t});const on=rn;var an=Object.prototype.hasOwnProperty;var cn=/\w*$/;var ln=h?h.prototype:void 0,un=ln?ln.valueOf:void 0;const dn=function(e,t,n){var s,i,r,o=e.constructor;switch(t){case"[object ArrayBuffer]":return te(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?te(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ne(e,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(r=new(i=e).constructor(i.source,cn.exec(i))).lastIndex=i.lastIndex,r;case"[object Set]":return new o;case"[object Symbol]":return s=e,un?Object(un.call(s)):{}}};var hn=ze&&ze.isMap;const fn=hn?Ie(hn):function(e){return de(e)&&"[object Map]"==on(e)};var gn=ze&&ze.isSet;const mn=gn?Ie(gn):function(e){return de(e)&&"[object Set]"==on(e)};var pn="[object Arguments]",vn="[object Function]",bn={};bn[pn]=bn["[object Array]"]=bn["[object ArrayBuffer]"]=bn["[object DataView]"]=bn["[object Boolean]"]=bn["[object Date]"]=bn["[object Float32Array]"]=bn["[object Float64Array]"]=bn["[object Int8Array]"]=bn["[object Int16Array]"]=bn["[object Int32Array]"]=bn["[object Map]"]=bn["[object Number]"]=bn["[object Object]"]=bn["[object RegExp]"]=bn["[object Set]"]=bn["[object String]"]=bn["[object Symbol]"]=bn["[object Uint8Array]"]=bn["[object Uint8ClampedArray]"]=bn["[object Uint16Array]"]=bn["[object Uint32Array]"]=!0,bn["[object Error]"]=bn[vn]=bn["[object WeakMap]"]=!1;const yn=function e(t,n,i,r,o,a){var c,l=1&n,u=2&n,d=4&n;if(i&&(c=o?i(t,r,o,a):i(t)),void 0!==c)return c;if(!s(t))return t;var h=ve(t);if(h){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&an.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!l)return se(t,c)}else{var f=on(t),g=f==vn||"[object GeneratorFunction]"==f;if(Ee(t))return Z(t,l);if("[object Object]"==f||f==pn||g&&!o){if(c=u||g?{}:ue(t),!l)return u?function(e,t){return qe(e,Bt(e),t)}(t,function(e,t){return e&&qe(t,Qe(t),e)}(c,t)):function(e,t){return qe(e,Pt(e),t)}(t,Rt(c,t))}else{if(!bn[f])return o?t:{};c=dn(t,f,l)}}a||(a=new $);var m=a.get(t);if(m)return m;a.set(t,c),mn(t)?t.forEach((function(s){c.add(e(s,n,i,s,t,a))})):fn(t)&&t.forEach((function(s,r){c.set(r,e(s,n,i,r,t,a))}));var p=h?void 0:(d?u?Ht:qt:u?Qe:Mt)(t);return function(e,t){for(var n=-1,s=null==e?0:e.length;++n<s&&!1!==t(e[n],n,e););}(p||t,(function(s,r){p&&(s=t[r=s]),Ue(c,r,e(s,n,i,r,t,a))})),c},_n=function(e){return"string"==typeof e||!ve(e)&&de(e)&&"[object String]"==y(e)},wn=function(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))};function Sn(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function xn(e){return"string"!=typeof e&&(console.warn("".concat(e," used as a key, but it is not a string.")),e=String(e)),e}var En="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jn=/^~~local_forage_type~([^~]+)~/,An="__lfsc__:",Cn=An.length,kn="arbf",On="blob",Tn="si08",Nn="ui08",In="uic8",Mn="si16",Rn="si32",Dn="ur16",zn="ui32",Ln="fl32",Pn="fl64",Fn=Cn+kn.length,Bn=Object.prototype.toString;function Un(e){var t,n,s,i,r,o=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var l=new ArrayBuffer(o),u=new Uint8Array(l);for(t=0;t<a;t+=4)n=En.indexOf(e[t]),s=En.indexOf(e[t+1]),i=En.indexOf(e[t+2]),r=En.indexOf(e[t+3]),u[c++]=n<<2|s>>4,u[c++]=(15&s)<<4|i>>2,u[c++]=(3&i)<<6|63&r;return l}function qn(e){var t,n=new Uint8Array(e),s="";for(t=0;t<n.length;t+=3)s+=En[n[t]>>2],s+=En[(3&n[t])<<4|n[t+1]>>4],s+=En[(15&n[t+1])<<2|n[t+2]>>6],s+=En[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}var Hn={serialize:function(e,t){var n="";if(e&&(n=Bn.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===Bn.call(e.buffer))){var s,i=An;e instanceof ArrayBuffer?(s=e,i+=kn):(s=e.buffer,"[object Int8Array]"===n?i+=Tn:"[object Uint8Array]"===n?i+=Nn:"[object Uint8ClampedArray]"===n?i+=In:"[object Int16Array]"===n?i+=Mn:"[object Uint16Array]"===n?i+=Dn:"[object Int32Array]"===n?i+=Rn:"[object Uint32Array]"===n?i+=zn:"[object Float32Array]"===n?i+=Ln:"[object Float64Array]"===n?i+=Pn:t(new Error("Failed to get type for BinaryArray"))),t(i+qn(s))}else if("[object Blob]"===n){var r=new FileReader;r.onload=function(){var n="~~local_forage_type~"+e.type+"~"+qn(this.result);t("__lfsc__:blob"+n)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,Cn)!==An)return JSON.parse(e);var t,n=e.substring(Fn),s=e.substring(Cn,Fn);if(s===On&&jn.test(n)){var i=n.match(jn);t=i[1],n=n.substring(i[0].length)}var r=Un(n);switch(s){case kn:return r;case On:return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),s=0;s<e.length;s+=1)n.append(e[s]);return n.getBlob(t.type)}}([r],{type:t});case Tn:return new Int8Array(r);case Nn:return new Uint8Array(r);case In:return new Uint8ClampedArray(r);case Mn:return new Int16Array(r);case Dn:return new Uint16Array(r);case Rn:return new Int32Array(r);case zn:return new Uint32Array(r);case Ln:return new Float32Array(r);case Pn:return new Float64Array(r);default:throw new Error("Unkown type: "+s)}},stringToBuffer:Un,bufferToString:qn};function $n(e,t){let n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}const Gn={serializer:{serialize:Hn.serialize,deserialize:Hn.deserialize}},Vn={_driver:"sessionStorageWrapper",_initStorage:function(e){if(Gn.keyPrefix=$n(e,this._defaultConfig),e)for(const t in e)Gn[t]=e[t]},_support:function(){try{if(sessionStorage&&"setItem"in sessionStorage)return!0}catch(e){console.log(e)}return!1}(),iterate:function(e,t){const n=this.ready().then((function(){const t=Gn.keyPrefix,n=t.length,s=sessionStorage.length;let i=1;for(let r=0;r<s;r++){const s=sessionStorage.key(r);if(0!==s.indexOf(t))continue;let o=sessionStorage.getItem(s);if(o&&(o=Gn.serializer.deserialize(o)),o=e(o,s.substring(n),i++),void 0!==o)return o}}));return wn(n,t),n},getItem:function(e,t){e=xn(e);const n=this.ready().then((function(){let t=sessionStorage.getItem(Gn.keyPrefix+e);return t&&(t=Gn.serializer.deserialize(t)),t}));return wn(n,t),n},setItem:function(e,t,n){e=xn(e);const s=this.ready().then((function(){void 0===t&&(t=null);const n=t;return new Promise((function(s,i){Gn.serializer.serialize(t,(function(t,r){if(r)i(r);else try{sessionStorage.setItem(Gn.keyPrefix+e,t),s(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return wn(s,n),s},removeItem:function(e,t){e=xn(e);const n=this.ready().then((function(){sessionStorage.removeItem(Gn.keyPrefix+e)}));return wn(n,t),n},clear:function(e){const t=this.ready().then((function(){const e=Gn.keyPrefix;for(let t=sessionStorage.length-1;t>=0;t--){const n=sessionStorage.key(t);0===n.indexOf(e)&&sessionStorage.removeItem(n)}}));return wn(t,e),t},length:function(e){const t=this.keys().then((function(e){return e.length}));return wn(t,e),t},key:function(e,t){const n=this.ready().then((function(){let t;try{t=sessionStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(Gn.keyPrefix.length)),t}));return wn(n,t),n},keys:function(e){const t=this.ready().then((function(){const e=sessionStorage.length,t=[];for(let n=0;n<e;n++){const e=sessionStorage.key(n);0===e.indexOf(Gn.keyPrefix)&&t.push(e.substring(Gn.keyPrefix.length))}return t}));return wn(t,e),t},dropInstance:function(e,t){if(t=Sn.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){const t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}const n=this;let s;return s=e.name?new Promise((function(t){e.storeName?t($n(e,n._defaultConfig)):t("".concat(e.name,"/"))})).then((function(e){for(let t=sessionStorage.length-1;t>=0;t--){const n=sessionStorage.key(t);0===n.indexOf(e)&&sessionStorage.removeItem(n)}})):Promise.reject(new Error("Invalid arguments")),wn(s,t),s}};var Wn=n(1459);const Jn=Ot._driver;function Qn(){return(65536*(1+Math.random())|0).toString(16).substring(1)}kt.defineDriver(Ot),(0,Wn.extendPrototype)(kt);class Yn{constructor(e,t,n=!1){if("local"===t&&!window.localStorage)throw new Error("Skeletor.storage: Environment does not support localStorage.");if("session"===t&&!window.sessionStorage)throw new Error("Skeletor.storage: Environment does not support sessionStorage.");_n(t)?this.storeInitialized=this.initStore(t,n):(this.store=t,n&&(this.store.debouncedSetItems=Ct((e=>this.store.setItems(e)),50,{promise:!0})),this.storeInitialized=Promise.resolve()),this.name=e}async initStore(e,t){if("session"===e)kt.setDriver(Vn._driver);else if("local"===e)await kt.config({driver:kt.LOCALSTORAGE});else if("in_memory"===e)kt.config({driver:Jn});else if("indexed"!==e)throw new Error("Skeletor.storage: No storage type was specified");this.store=kt,t&&(this.store.debouncedSetItems=Ct((e=>this.store.setItems(e)),50,{promise:!0}))}flush(){var e;return null===(e=this.store.debouncedSetItems)||void 0===e?void 0:e.flush()}async clear(){await this.store.removeItem(this.name).catch((e=>console.error(e)));const e=new RegExp("^".concat(this.name,"-")),t=(await this.store.keys()).filter((t=>e.test(t)));await Promise.all(t.map((e=>this.store.removeItem(e).catch((e=>console.error(e))))))}sync(e){const t=this;async function n(e,n,s){let i,r,o,a;const c=n.collection;var l;["patch","update"].includes(e)&&(l=n.attributes,a=yn(l,5)),await t.storeInitialized;try{const r=n.attributes;switch(e){case"read":i=void 0!==n.id?await t.find(n):await t.findAll();break;case"create":i=await t.create(n,s);break;case"patch":case"update":s.wait&&(n.attributes=a),o=t.update(n,s),s.wait&&(n.attributes=r),i=await o;break;case"delete":i=await t.destroy(n,c)}}catch(e){r=22===e.code&&0===t.getStorageSize()?"Private browsing is unsupported":e.message}if(i){if(s&&s.success){const t="read"===e?i:null;s.success(t,s)}}else r=r||"Record Not Found",s&&s.error&&s.error(r)}return n.__name__="localSync",n}removeCollectionReference(e,t){if(!t)return;const n=t.filter((t=>t.id!==e.id)).map((e=>this.getItemName(e.id)));return this.store.setItem(this.name,n)}addCollectionReference(e,t){if(!t)return;const n=t.map((e=>this.getItemName(e.id))),s=this.getItemName(e.id);return n.includes(s)||n.push(s),this.store.setItem(this.name,n)}getCollectionReferenceData(e){if(!e.collection)return{};const t=e.collection.map((e=>this.getItemName(e.id))),n=this.getItemName(e.id);t.includes(n)||t.push(n);const s={};return s[this.name]=t,s}async save(e){if(this.store.setItems){const t={};return t[this.getItemName(e.id)]=e.toJSON(),Object.assign(t,this.getCollectionReferenceData(e)),this.store.debouncedSetItems?this.store.debouncedSetItems(t):this.store.setItems(t)}{const t=this.getItemName(e.id),n=await this.store.setItem(t,e.toJSON());return await this.addCollectionReference(e,e.collection),n}}create(e,t){return e.id||(e.id=Qn()+Qn()+"-"+Qn()+"-"+Qn()+"-"+Qn()+"-"+Qn()+Qn()+Qn(),e.set(e.idAttribute,e.id,t)),this.save(e)}update(e){return this.save(e)}find(e){return this.store.getItem(this.getItemName(e.id))}async findAll(){const e=await this.store.getItem(this.name);return e&&e.length?Promise.all(e.map((e=>this.store.getItem(e)))):[]}async destroy(e,t){return await this.flush(),await this.store.removeItem(this.getItemName(e.id)),await this.removeCollectionReference(e,t),e}getStorageSize(){return this.store.length}getItemName(e){return this.name+"-"+e}}Yn.sessionStorageInitialized=kt.defineDriver(Vn),Yn.localForage=kt;const Kn=Yn;var Xn=n(4457);const Zn={initialize(){},__:(...e)=>(0,Xn.sprintf)(...e)},es=function(e){return de(e)&&1===e.nodeType&&!Te(e)};var ts,ns,ss,is;const rs={debug:0,info:1,warn:2,error:3,fatal:4},os=Object.assign({debug:(null===(ts=console)||void 0===ts?void 0:ts.log)?console.log.bind(console):function(){},error:(null===(ns=console)||void 0===ns?void 0:ns.log)?console.log.bind(console):function(){},info:(null===(ss=console)||void 0===ss?void 0:ss.log)?console.log.bind(console):function(){},warn:(null===(is=console)||void 0===is?void 0:is.log)?console.log.bind(console):function(){}},console),as={setLogLevel(e){if(!["debug","info","warn","error","fatal"].includes(e))throw new Error("Invalid loglevel: ".concat(e));this.loglevel=e},log(e,t,n=""){if(rs[t]<rs[this.loglevel])return;"error"===t||"fatal"===t?n=n||"color: maroon":"debug"===t&&(n=n||"color: green"),e instanceof Error?e=e.stack:es(e)&&(e=e.outerHTML);const s=n?"%c":"";"error"===t?os.error("".concat(s," ERROR: ").concat(e),n):"warn"===t?os.warn("".concat(s," ").concat((new Date).toISOString()," WARNING: ").concat(e),n):"fatal"===t?os.error("".concat(s," FATAL: ").concat(e),n):"debug"===t?os.debug("".concat(s," ").concat((new Date).toISOString()," DEBUG: ").concat(e),n):os.info("".concat(s," ").concat((new Date).toISOString()," INFO: ").concat(e),n)},debug(e,t){this.log(e,"debug",t)},error(e,t){this.log(e,"error",t)},info(e,t){this.log(e,"info",t)},warn(e,t){this.log(e,"warn",t)},fatal(e,t){this.log(e,"fatal",t)}},cs=function(){let e=n.g.WebSocket;if(void 0===e)try{e=n(7026)}catch(e){throw new Error('You must install the "ws" package to use Strophe in nodejs.')}return e}(),ls=function(){let e=n.g.DOMParser;if(void 0===e)try{e=n(647).a}catch(e){throw new Error('You must install the "xmldom" package to use Strophe in nodejs.')}return e}();const us=function(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},ds=function(e){if("string"!=typeof e)throw new Error("str2binl was passed a non-string");const t=[];for(let n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<n%32;return t},hs=function(e,t,n,s,i,r){return us((o=us(us(t,e),us(s,r)))<<(a=i)|o>>>32-a,n);var o,a},fs=function(e,t,n,s,i,r,o){return hs(t&n|~t&s,e,t,i,r,o)},gs=function(e,t,n,s,i,r,o){return hs(t&s|n&~s,e,t,i,r,o)},ms=function(e,t,n,s,i,r,o){return hs(t^n^s,e,t,i,r,o)},ps=function(e,t,n,s,i,r,o){return hs(n^(t|~s),e,t,i,r,o)},vs=function(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let n,s,i,r,o=1732584193,a=-271733879,c=-1732584194,l=271733878;for(let t=0;t<e.length;t+=16)n=o,s=a,i=c,r=l,o=fs(o,a,c,l,e[t+0],7,-680876936),l=fs(l,o,a,c,e[t+1],12,-389564586),c=fs(c,l,o,a,e[t+2],17,606105819),a=fs(a,c,l,o,e[t+3],22,-1044525330),o=fs(o,a,c,l,e[t+4],7,-176418897),l=fs(l,o,a,c,e[t+5],12,1200080426),c=fs(c,l,o,a,e[t+6],17,-1473231341),a=fs(a,c,l,o,e[t+7],22,-45705983),o=fs(o,a,c,l,e[t+8],7,1770035416),l=fs(l,o,a,c,e[t+9],12,-1958414417),c=fs(c,l,o,a,e[t+10],17,-42063),a=fs(a,c,l,o,e[t+11],22,-1990404162),o=fs(o,a,c,l,e[t+12],7,1804603682),l=fs(l,o,a,c,e[t+13],12,-40341101),c=fs(c,l,o,a,e[t+14],17,-1502002290),a=fs(a,c,l,o,e[t+15],22,1236535329),o=gs(o,a,c,l,e[t+1],5,-165796510),l=gs(l,o,a,c,e[t+6],9,-1069501632),c=gs(c,l,o,a,e[t+11],14,643717713),a=gs(a,c,l,o,e[t+0],20,-373897302),o=gs(o,a,c,l,e[t+5],5,-701558691),l=gs(l,o,a,c,e[t+10],9,38016083),c=gs(c,l,o,a,e[t+15],14,-660478335),a=gs(a,c,l,o,e[t+4],20,-405537848),o=gs(o,a,c,l,e[t+9],5,568446438),l=gs(l,o,a,c,e[t+14],9,-1019803690),c=gs(c,l,o,a,e[t+3],14,-187363961),a=gs(a,c,l,o,e[t+8],20,1163531501),o=gs(o,a,c,l,e[t+13],5,-1444681467),l=gs(l,o,a,c,e[t+2],9,-51403784),c=gs(c,l,o,a,e[t+7],14,1735328473),a=gs(a,c,l,o,e[t+12],20,-1926607734),o=ms(o,a,c,l,e[t+5],4,-378558),l=ms(l,o,a,c,e[t+8],11,-2022574463),c=ms(c,l,o,a,e[t+11],16,1839030562),a=ms(a,c,l,o,e[t+14],23,-35309556),o=ms(o,a,c,l,e[t+1],4,-1530992060),l=ms(l,o,a,c,e[t+4],11,1272893353),c=ms(c,l,o,a,e[t+7],16,-155497632),a=ms(a,c,l,o,e[t+10],23,-1094730640),o=ms(o,a,c,l,e[t+13],4,681279174),l=ms(l,o,a,c,e[t+0],11,-358537222),c=ms(c,l,o,a,e[t+3],16,-722521979),a=ms(a,c,l,o,e[t+6],23,76029189),o=ms(o,a,c,l,e[t+9],4,-640364487),l=ms(l,o,a,c,e[t+12],11,-421815835),c=ms(c,l,o,a,e[t+15],16,530742520),a=ms(a,c,l,o,e[t+2],23,-995338651),o=ps(o,a,c,l,e[t+0],6,-198630844),l=ps(l,o,a,c,e[t+7],10,1126891415),c=ps(c,l,o,a,e[t+14],15,-1416354905),a=ps(a,c,l,o,e[t+5],21,-57434055),o=ps(o,a,c,l,e[t+12],6,1700485571),l=ps(l,o,a,c,e[t+3],10,-1894986606),c=ps(c,l,o,a,e[t+10],15,-1051523),a=ps(a,c,l,o,e[t+1],21,-2054922799),o=ps(o,a,c,l,e[t+8],6,1873313359),l=ps(l,o,a,c,e[t+15],10,-30611744),c=ps(c,l,o,a,e[t+6],15,-1560198380),a=ps(a,c,l,o,e[t+13],21,1309151649),o=ps(o,a,c,l,e[t+4],6,-145523070),l=ps(l,o,a,c,e[t+11],10,-1120210379),c=ps(c,l,o,a,e[t+2],15,718787259),a=ps(a,c,l,o,e[t+9],21,-343485551),o=us(o,n),a=us(a,s),c=us(c,i),l=us(l,r);return[o,a,c,l]},bs={hexdigest:function(e){return function(e){const t="0123456789abcdef";let n="";for(let s=0;s<4*e.length;s++)n+=t.charAt(e[s>>2]>>s%4*8+4&15)+t.charAt(e[s>>2]>>s%4*8&15);return n}(vs(ds(e),8*e.length))},hash:function(e){return function(e){let t="";for(let n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>n%32&255);return t}(vs(ds(e),8*e.length))}};class ys{constructor(e,t,n){this.mechname=e,this.isClientFirst=t,this.priority=n}test(){return!0}onStart(e){this._connection=e}onChallenge(e,t){throw new Error("You should implement challenge handling!")}clientChallenge(e){if(!this.isClientFirst)throw new Error("clientChallenge should not be called if isClientFirst is false!");return this.onChallenge(e)}onFailure(){this._connection=null}onSuccess(){this._connection=null}}const _s=function(e){var t,n,s="",i=e.length;for(t=0;t<i;t++)(n=e.charCodeAt(t))>=0&&n<=127?s+=e.charAt(t):n>2047?(s+=String.fromCharCode(224|n>>12&15),s+=String.fromCharCode(128|n>>6&63),s+=String.fromCharCode(128|n>>0&63)):(s+=String.fromCharCode(192|n>>6&31),s+=String.fromCharCode(128|n>>0&63));return s};function ws(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;var n,s,i,r,o,a,c,l,u=new Array(80),d=1732584193,h=-271733879,f=-1732584194,g=271733878,m=-1009589776;for(n=0;n<e.length;n+=16){for(r=d,o=h,a=f,c=g,l=m,s=0;s<80;s++)u[s]=s<16?e[n+s]:As(u[s-3]^u[s-8]^u[s-14]^u[s-16],1),i=js(js(As(d,5),Ss(s,h,f,g)),js(js(m,u[s]),xs(s))),m=g,g=f,f=As(h,30),h=d,d=i;d=js(d,r),h=js(h,o),f=js(f,a),g=js(g,c),m=js(m,l)}return[d,h,f,g,m]}function Ss(e,t,n,s){return e<20?t&n|~t&s:e<40?t^n^s:e<60?t&n|t&s|n&s:t^n^s}function xs(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function Es(e,t){var n=Cs(e);n.length>16&&(n=ws(n,8*e.length));for(var s=new Array(16),i=new Array(16),r=0;r<16;r++)s[r]=909522486^n[r],i[r]=1549556828^n[r];var o=ws(s.concat(Cs(t)),512+8*t.length);return ws(i.concat(o),672)}function js(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function As(e,t){return e<<t|e>>>32-t}function Cs(e){for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}function ks(e){for(var t,n,s="",i=0;i<4*e.length;i+=3)for(t=(e[i>>2]>>8*(3-i%4)&255)<<16|(e[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|e[i+2>>2]>>8*(3-(i+2)%4)&255,n=0;n<4;n++)8*i+6*n>32*e.length?s+="=":s+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t>>6*(3-n)&63);return s}function Os(e){for(var t="",n=0;n<32*e.length;n+=8)t+=String.fromCharCode(e[n>>5]>>>24-n%32&255);return t}const Ts={b64_hmac_sha1:function(e,t){return ks(Es(e,t))},b64_sha1:function(e){return ks(ws(Cs(e),8*e.length))},binb2str:Os,core_hmac_sha1:Es,str_hmac_sha1:function(e,t){return Os(Es(e,t))},str_sha1:function(e){return Os(ws(Cs(e),8*e.length))}};var Ns=n(9494);function Is(e,t){return new zs.Builder(e,t)}function Ms(e){return new zs.Builder("message",e)}function Rs(e){return new zs.Builder("iq",e)}function Ds(e){return new zs.Builder("presence",e)}const zs={VERSION:"1.4.2",NS:{HTTPBIND:"http://jabber.org/protocol/httpbind",BOSH:"urn:xmpp:xbosh",CLIENT:"jabber:client",AUTH:"jabber:iq:auth",ROSTER:"jabber:iq:roster",PROFILE:"jabber:iq:profile",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",MUC:"http://jabber.org/protocol/muc",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",STREAM:"http://etherx.jabber.org/streams",FRAMING:"urn:ietf:params:xml:ns:xmpp-framing",BIND:"urn:ietf:params:xml:ns:xmpp-bind",SESSION:"urn:ietf:params:xml:ns:xmpp-session",VERSION:"jabber:iq:version",STANZAS:"urn:ietf:params:xml:ns:xmpp-stanzas",XHTML_IM:"http://jabber.org/protocol/xhtml-im",XHTML:"http://www.w3.org/1999/xhtml"},XHTML:{tags:["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul","body"],attributes:{a:["href"],blockquote:["style"],br:[],cite:["style"],em:[],img:["src","alt","style","height","width"],li:["style"],ol:["style"],p:["style"],span:["style"],strong:[],ul:["style"],body:[]},css:["background-color","color","font-family","font-size","font-style","font-weight","margin-left","margin-right","text-align","text-decoration"],validTag(e){for(let t=0;t<zs.XHTML.tags.length;t++)if(e===zs.XHTML.tags[t])return!0;return!1},validAttribute(e,t){if(void 0!==zs.XHTML.attributes[e]&&zs.XHTML.attributes[e].length>0)for(let n=0;n<zs.XHTML.attributes[e].length;n++)if(t===zs.XHTML.attributes[e][n])return!0;return!1},validCSS(e){for(let t=0;t<zs.XHTML.css.length;t++)if(e===zs.XHTML.css[t])return!0;return!1}},Status:{ERROR:0,CONNECTING:1,CONNFAIL:2,AUTHENTICATING:3,AUTHFAIL:4,CONNECTED:5,DISCONNECTED:6,DISCONNECTING:7,ATTACHED:8,REDIRECT:9,CONNTIMEOUT:10,BINDREQUIRED:11,ATTACHFAIL:12},ErrorCondition:{BAD_FORMAT:"bad-format",CONFLICT:"conflict",MISSING_JID_NODE:"x-strophe-bad-non-anon-jid",NO_AUTH_MECH:"no-auth-mech",UNKNOWN_REASON:"unknown"},LogLevel:{DEBUG:0,INFO:1,WARN:2,ERROR:3,FATAL:4},ElementType:{NORMAL:1,TEXT:3,CDATA:4,FRAGMENT:11},TIMEOUT:1.1,SECONDARY_TIMEOUT:.1,addNamespace(e,t){zs.NS[e]=t},forEachChild(e,t,n){for(let s=0;s<e.childNodes.length;s++){const i=e.childNodes[s];i.nodeType!==zs.ElementType.NORMAL||t&&!this.isTagEqual(i,t)||n(i)}},isTagEqual:(e,t)=>e.tagName===t,_xmlGenerator:null,xmlGenerator:()=>(zs._xmlGenerator||(zs._xmlGenerator=function(){if("undefined"==typeof document)try{return(new(0,n(647).DOMImplementation)).createDocument("jabber:client","strophe",null)}catch(e){throw new Error('You must install the "xmldom" package to use Strophe in nodejs.')}if(void 0===document.implementation.createDocument||document.implementation.createDocument&&document.documentMode&&document.documentMode<10){const e=function(){const e=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];for(let t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(e){}}();return e.appendChild(e.createElement("strophe")),e}return document.implementation.createDocument("jabber:client","strophe",null)}()),zs._xmlGenerator),xmlElement(e){if(!e)return null;const t=zs.xmlGenerator().createElement(e);for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)if("string"==typeof n||"number"==typeof n)t.appendChild(zs.xmlTextNode(n));else if("object"==typeof n&&"function"==typeof n.sort)for(let e=0;e<n.length;e++){const s=n[e];"object"==typeof s&&"function"==typeof s.sort&&void 0!==s[1]&&null!==s[1]&&t.setAttribute(s[0],s[1])}else if("object"==typeof n)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&void 0!==n[e]&&null!==n[e]&&t.setAttribute(e,n[e])}return t},xmlescape:e=>(e=(e=(e=(e=e.replace(/\&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/'/g,"&apos;")).replace(/"/g,"&quot;"),xmlunescape:e=>(e=(e=(e=(e=e.replace(/\&amp;/g,"&")).replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/&apos;/g,"'")).replace(/&quot;/g,'"'),xmlTextNode:e=>zs.xmlGenerator().createTextNode(e),xmlHtmlNode(e){let t;return ls?t=(new ls).parseFromString(e,"text/xml"):(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)),t},getText(e){if(!e)return null;let t="";0===e.childNodes.length&&e.nodeType===zs.ElementType.TEXT&&(t+=e.nodeValue);for(let n=0;n<e.childNodes.length;n++)e.childNodes[n].nodeType===zs.ElementType.TEXT&&(t+=e.childNodes[n].nodeValue);return zs.xmlescape(t)},copyElement(e){let t;if(e.nodeType===zs.ElementType.NORMAL){t=zs.xmlElement(e.tagName);for(let n=0;n<e.attributes.length;n++)t.setAttribute(e.attributes[n].nodeName,e.attributes[n].value);for(let n=0;n<e.childNodes.length;n++)t.appendChild(zs.copyElement(e.childNodes[n]))}else e.nodeType===zs.ElementType.TEXT&&(t=zs.xmlGenerator().createTextNode(e.nodeValue));return t},createHtml(e){let t;if(e.nodeType===zs.ElementType.NORMAL){const n=e.nodeName.toLowerCase();if(zs.XHTML.validTag(n))try{t=zs.xmlElement(n);for(let s=0;s<zs.XHTML.attributes[n].length;s++){const i=zs.XHTML.attributes[n][s];let r=e.getAttribute(i);if(null!=r&&""!==r&&!1!==r&&0!==r)if("style"===i&&"object"==typeof r&&void 0!==r.cssText&&(r=r.cssText),"style"===i){const e=[],n=r.split(";");for(let t=0;t<n.length;t++){const s=n[t].split(":"),i=s[0].replace(/^\s*/,"").replace(/\s*$/,"").toLowerCase();if(zs.XHTML.validCSS(i)){const t=s[1].replace(/^\s*/,"").replace(/\s*$/,"");e.push(i+": "+t)}}e.length>0&&(r=e.join("; "),t.setAttribute(i,r))}else t.setAttribute(i,r)}for(let n=0;n<e.childNodes.length;n++)t.appendChild(zs.createHtml(e.childNodes[n]))}catch(e){t=zs.xmlTextNode("")}else{t=zs.xmlGenerator().createDocumentFragment();for(let n=0;n<e.childNodes.length;n++)t.appendChild(zs.createHtml(e.childNodes[n]))}}else if(e.nodeType===zs.ElementType.FRAGMENT){t=zs.xmlGenerator().createDocumentFragment();for(let n=0;n<e.childNodes.length;n++)t.appendChild(zs.createHtml(e.childNodes[n]))}else e.nodeType===zs.ElementType.TEXT&&(t=zs.xmlTextNode(e.nodeValue));return t},escapeNode:e=>"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"").replace(/\\/g,"\\5c").replace(/ /g,"\\20").replace(/\"/g,"\\22").replace(/\&/g,"\\26").replace(/\'/g,"\\27").replace(/\//g,"\\2f").replace(/:/g,"\\3a").replace(/</g,"\\3c").replace(/>/g,"\\3e").replace(/@/g,"\\40"),unescapeNode:e=>"string"!=typeof e?e:e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\"),getNodeFromJid:e=>e.indexOf("@")<0?null:e.split("@")[0],getDomainFromJid(e){const t=zs.getBareJidFromJid(e);if(t.indexOf("@")<0)return t;{const e=t.split("@");return e.splice(0,1),e.join("@")}},getResourceFromJid(e){if(!e)return null;const t=e.split("/");return t.length<2?null:(t.splice(0,1),t.join("/"))},getBareJidFromJid:e=>e?e.split("/")[0]:null,_handleError(e){void 0!==e.stack&&zs.fatal(e.stack),e.sourceURL?zs.fatal("error: "+this.handler+" "+e.sourceURL+":"+e.line+" - "+e.name+": "+e.message):e.fileName?zs.fatal("error: "+this.handler+" "+e.fileName+":"+e.lineNumber+" - "+e.name+": "+e.message):zs.fatal("error: "+e.message)},log(e,t){var n;e===this.LogLevel.FATAL&&(null===(n=console)||void 0===n||n.error(t))},debug(e){this.log(this.LogLevel.DEBUG,e)},info(e){this.log(this.LogLevel.INFO,e)},warn(e){this.log(this.LogLevel.WARN,e)},error(e){this.log(this.LogLevel.ERROR,e)},fatal(e){this.log(this.LogLevel.FATAL,e)},serialize(e){if(!e)return null;"function"==typeof e.tree&&(e=e.tree());const t=[...Array(e.attributes.length).keys()].map((t=>e.attributes[t].nodeName));t.sort();let n=t.reduce(((t,n)=>"".concat(t," ").concat(n,'="').concat(zs.xmlescape(e.attributes.getNamedItem(n).value),'"')),"<".concat(e.nodeName));if(e.childNodes.length>0){n+=">";for(let t=0;t<e.childNodes.length;t++){const s=e.childNodes[t];switch(s.nodeType){case zs.ElementType.NORMAL:n+=zs.serialize(s);break;case zs.ElementType.TEXT:n+=zs.xmlescape(s.nodeValue);break;case zs.ElementType.CDATA:n+="<![CDATA["+s.nodeValue+"]]>"}}n+="</"+e.nodeName+">"}else n+="/>";return n},_requestId:0,_connectionPlugins:{},addConnectionPlugin(e,t){zs._connectionPlugins[e]=t},Builder:class{constructor(e,t){"presence"!==e&&"message"!==e&&"iq"!==e||(t&&!t.xmlns?t.xmlns=zs.NS.CLIENT:t||(t={xmlns:zs.NS.CLIENT})),this.nodeTree=zs.xmlElement(e,t),this.node=this.nodeTree}tree(){return this.nodeTree}toString(){return zs.serialize(this.nodeTree)}up(){return this.node=this.node.parentNode,this}root(){return this.node=this.nodeTree,this}attrs(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(void 0===e[t]?this.node.removeAttribute(t):this.node.setAttribute(t,e[t]));return this}c(e,t,n){const s=zs.xmlElement(e,t,n);return this.node.appendChild(s),"string"!=typeof n&&"number"!=typeof n&&(this.node=s),this}cnode(e){let t;const n=zs.xmlGenerator();try{t=void 0!==n.importNode}catch(e){t=!1}const s=t?n.importNode(e,!0):zs.copyElement(e);return this.node.appendChild(s),this.node=s,this}t(e){const t=zs.xmlTextNode(e);return this.node.appendChild(t),this}h(e){const t=zs.xmlGenerator().createElement("body");t.innerHTML=e;const n=zs.createHtml(t);for(;n.childNodes.length>0;)this.node.appendChild(n.childNodes[0]);return this}},Handler:function(e,t,n,s,i,r,o){this.handler=e,this.ns=t,this.name=n,this.type=s,this.id=i,this.options=o||{matchBareFromJid:!1,ignoreNamespaceFragment:!1},this.options.matchBare&&(zs.warn('The "matchBare" option is deprecated, use "matchBareFromJid" instead.'),this.options.matchBareFromJid=this.options.matchBare,delete this.options.matchBare),this.options.matchBareFromJid?this.from=r?zs.getBareJidFromJid(r):null:this.from=r,this.user=!0}};zs.Handler.prototype={getNamespace(e){let t=e.getAttribute("xmlns");return t&&this.options.ignoreNamespaceFragment&&(t=t.split("#")[0]),t},namespaceMatch(e){let t=!1;return!this.ns||(zs.forEachChild(e,null,(e=>{this.getNamespace(e)===this.ns&&(t=!0)})),t||this.getNamespace(e)===this.ns)},isMatch(e){let t=e.getAttribute("from");this.options.matchBareFromJid&&(t=zs.getBareJidFromJid(t));const n=e.getAttribute("type");return!(!this.namespaceMatch(e)||this.name&&!zs.isTagEqual(e,this.name)||this.type&&(Array.isArray(this.type)?-1===this.type.indexOf(n):n!==this.type)||this.id&&e.getAttribute("id")!==this.id||this.from&&t!==this.from)},run(e){let t=null;try{t=this.handler(e)}catch(e){throw zs._handleError(e),e}return t},toString(){return"{Handler: "+this.handler+"("+this.name+","+this.id+","+this.ns+")}"}},zs.TimedHandler=class{constructor(e,t){this.period=e,this.handler=t,this.lastCalled=(new Date).getTime(),this.user=!0}run(){return this.lastCalled=(new Date).getTime(),this.handler()}reset(){this.lastCalled=(new Date).getTime()}toString(){return"{TimedHandler: "+this.handler+"("+this.period+")}"}},zs.Connection=class{constructor(e,t){this.service=e,this.options=t||{},this.setProtocol(),this.jid="",this.domain=null,this.features=null,this._sasl_data={},this.do_bind=!1,this.do_session=!1,this.mechanisms={},this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.protocolErrorHandlers={HTTP:{},websocket:{}},this._idleTimeout=null,this._disconnectTimeout=null,this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.do_authentication=!0,this.paused=!1,this.restored=!1,this._data=[],this._uniqueId=0,this._sasl_success_handler=null,this._sasl_failure_handler=null,this._sasl_challenge_handler=null,this.maxRetries=5,this._idleTimeout=setTimeout((()=>this._onIdle()),100),function(e){e=e||{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n="",s="",i="";const r=e[t],o="object"==typeof r,a=escape(unescape(o?r.value:r));o&&(n=r.expires?";expires="+r.expires:"",s=r.domain?";domain="+r.domain:"",i=r.path?";path="+r.path:""),document.cookie=t+"="+a+n+s+i}}(this.options.cookies),this.registerSASLMechanisms(this.options.mechanisms);for(const e in zs._connectionPlugins)if(Object.prototype.hasOwnProperty.call(zs._connectionPlugins,e)){const t=function(){};t.prototype=zs._connectionPlugins[e],this[e]=new t,this[e].init(this)}}setProtocol(){const e=this.options.protocol||"";this.options.worker?this._proto=new zs.WorkerWebsocket(this):0===this.service.indexOf("ws:")||0===this.service.indexOf("wss:")||0===e.indexOf("ws")?this._proto=new zs.Websocket(this):this._proto=new zs.Bosh(this)}reset(){this._proto._reset(),this.do_session=!1,this.do_bind=!1,this.timedHandlers=[],this.handlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this.authenticated=!1,this.connected=!1,this.disconnecting=!1,this.restored=!1,this._data=[],this._requests=[],this._uniqueId=0}pause(){this.paused=!0}resume(){this.paused=!1}getUniqueId(e){const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));return"string"==typeof e||"number"==typeof e?t+":"+e:t+""}addProtocolErrorHandler(e,t,n){this.protocolErrorHandlers[e][t]=n}connect(e,t,n,s,i,r,o){this.jid=e,this.authzid=zs.getBareJidFromJid(this.jid),this.authcid=o||zs.getNodeFromJid(this.jid),this.pass=t,this.connect_callback=n,this.disconnecting=!1,this.connected=!1,this.authenticated=!1,this.restored=!1,this.domain=zs.getDomainFromJid(this.jid),this._changeConnectStatus(zs.Status.CONNECTING,null),this._proto._connect(s,i,r)}attach(e,t,n,s,i,r,o){if(this._proto._attach)return this._proto._attach(e,t,n,s,i,r,o);{const e=new Error('The "attach" method is not available for your connection protocol');throw e.name="StropheSessionError",e}}restore(e,t,n,s,i){if(!this._sessionCachingSupported()){const e=new Error('The "restore" method can only be used with a BOSH connection.');throw e.name="StropheSessionError",e}this._proto._restore(e,t,n,s,i)}_sessionCachingSupported(){if(this._proto instanceof zs.Bosh){if(!JSON)return!1;try{sessionStorage.setItem("_strophe_","_strophe_"),sessionStorage.removeItem("_strophe_")}catch(e){return!1}return!0}return!1}xmlInput(e){}xmlOutput(e){}rawInput(e){}rawOutput(e){}nextValidRid(e){}send(e){if(null!==e){if("function"==typeof e.sort)for(let t=0;t<e.length;t++)this._queueData(e[t]);else"function"==typeof e.tree?this._queueData(e.tree()):this._queueData(e);this._proto._send()}}flush(){clearTimeout(this._idleTimeout),this._onIdle()}sendPresence(e,t,n,s){let i=null;"function"==typeof e.tree&&(e=e.tree());let r=e.getAttribute("id");if(r||(r=this.getUniqueId("sendPresence"),e.setAttribute("id",r)),"function"==typeof t||"function"==typeof n){const e=this.addHandler((e=>{i&&this.deleteTimedHandler(i),"error"===e.getAttribute("type")?n&&n(e):t&&t(e)}),null,"presence",null,r);s&&(i=this.addTimedHandler(s,(()=>(this.deleteHandler(e),n&&n(null),!1))))}return this.send(e),r}sendIQ(e,t,n,s){let i=null;"function"==typeof e.tree&&(e=e.tree());let r=e.getAttribute("id");if(r||(r=this.getUniqueId("sendIQ"),e.setAttribute("id",r)),"function"==typeof t||"function"==typeof n){const e=this.addHandler((e=>{i&&this.deleteTimedHandler(i);const s=e.getAttribute("type");if("result"===s)t&&t(e);else{if("error"!==s){const e=new Error("Got bad IQ type of ".concat(s));throw e.name="StropheError",e}n&&n(e)}}),null,"iq",["error","result"],r);s&&(i=this.addTimedHandler(s,(()=>(this.deleteHandler(e),n&&n(null),!1))))}return this.send(e),r}_queueData(e){if(null===e||!e.tagName||!e.childNodes){const e=new Error("Cannot queue non-DOMElement.");throw e.name="StropheError",e}this._data.push(e)}_sendRestart(){this._data.push("restart"),this._proto._sendRestart(),this._idleTimeout=setTimeout((()=>this._onIdle()),100)}addTimedHandler(e,t){const n=new zs.TimedHandler(e,t);return this.addTimeds.push(n),n}deleteTimedHandler(e){this.removeTimeds.push(e)}addHandler(e,t,n,s,i,r,o){const a=new zs.Handler(e,t,n,s,i,r,o);return this.addHandlers.push(a),a}deleteHandler(e){this.removeHandlers.push(e);const t=this.addHandlers.indexOf(e);t>=0&&this.addHandlers.splice(t,1)}registerSASLMechanisms(e){this.mechanisms={},(e=e||[zs.SASLAnonymous,zs.SASLExternal,zs.SASLOAuthBearer,zs.SASLXOAuth2,zs.SASLPlain,zs.SASLSHA1]).forEach((e=>this.registerSASLMechanism(e)))}registerSASLMechanism(e){const t=new e;this.mechanisms[t.mechname]=t}disconnect(e){if(this._changeConnectStatus(zs.Status.DISCONNECTING,e),e?zs.warn("Disconnect was called because: "+e):zs.info("Disconnect was called"),this.connected){let e=!1;this.disconnecting=!0,this.authenticated&&(e=Ds({xmlns:zs.NS.CLIENT,type:"unavailable"})),this._disconnectTimeout=this._addSysTimedHandler(3e3,this._onDisconnectTimeout.bind(this)),this._proto._disconnect(e)}else zs.warn("Disconnect was called before Strophe connected to the server"),this._proto._abortAllRequests(),this._doDisconnect()}_changeConnectStatus(e,t,n){for(const n in zs._connectionPlugins)if(Object.prototype.hasOwnProperty.call(zs._connectionPlugins,n)){const s=this[n];if(s.statusChanged)try{s.statusChanged(e,t)}catch(e){zs.error("".concat(n," plugin caused an exception changing status: ").concat(e))}}if(this.connect_callback)try{this.connect_callback(e,t,n)}catch(e){zs._handleError(e),zs.error("User connection callback caused an exception: ".concat(e))}}_doDisconnect(e){"number"==typeof this._idleTimeout&&clearTimeout(this._idleTimeout),null!==this._disconnectTimeout&&(this.deleteTimedHandler(this._disconnectTimeout),this._disconnectTimeout=null),zs.debug("_doDisconnect was called"),this._proto._doDisconnect(),this.authenticated=!1,this.disconnecting=!1,this.restored=!1,this.handlers=[],this.timedHandlers=[],this.removeTimeds=[],this.removeHandlers=[],this.addTimeds=[],this.addHandlers=[],this._changeConnectStatus(zs.Status.DISCONNECTED,e),this.connected=!1}_dataRecv(e,t){const n=this._proto._reqToData(e);if(null===n)return;for(this.xmlInput!==zs.Connection.prototype.xmlInput&&(n.nodeName===this._proto.strip&&n.childNodes.length?this.xmlInput(n.childNodes[0]):this.xmlInput(n)),this.rawInput!==zs.Connection.prototype.rawInput&&(t?this.rawInput(t):this.rawInput(zs.serialize(n)));this.removeHandlers.length>0;){const e=this.removeHandlers.pop(),t=this.handlers.indexOf(e);t>=0&&this.handlers.splice(t,1)}for(;this.addHandlers.length>0;)this.handlers.push(this.addHandlers.pop());if(this.disconnecting&&this._proto._emptyQueue())return void this._doDisconnect();const s=n.getAttribute("type");if(null!==s&&"terminate"===s){if(this.disconnecting)return;let e=n.getAttribute("condition");const t=n.getElementsByTagName("conflict");return null!==e?("remote-stream-error"===e&&t.length>0&&(e="conflict"),this._changeConnectStatus(zs.Status.CONNFAIL,e)):this._changeConnectStatus(zs.Status.CONNFAIL,zs.ErrorCondition.UNKOWN_REASON),void this._doDisconnect(e)}zs.forEachChild(n,null,(e=>{const t=this.handlers;this.handlers=[];for(let n=0;n<t.length;n++){const s=t[n];try{(!s.isMatch(e)||!this.authenticated&&s.user||s.run(e))&&this.handlers.push(s)}catch(e){zs.warn("Removing Strophe handlers due to uncaught exception: "+e.message)}}}))}_connect_cb(e,t,n){let s,i;zs.debug("_connect_cb was called"),this.connected=!0;try{s=this._proto._reqToData(e)}catch(e){if(e.name!==zs.ErrorCondition.BAD_FORMAT)throw e;this._changeConnectStatus(zs.Status.CONNFAIL,zs.ErrorCondition.BAD_FORMAT),this._doDisconnect(zs.ErrorCondition.BAD_FORMAT)}if(!s)return;if(this.xmlInput!==zs.Connection.prototype.xmlInput&&(s.nodeName===this._proto.strip&&s.childNodes.length?this.xmlInput(s.childNodes[0]):this.xmlInput(s)),this.rawInput!==zs.Connection.prototype.rawInput&&(n?this.rawInput(n):this.rawInput(zs.serialize(s))),this._proto._connect_cb(s)===zs.Status.CONNFAIL)return;if(i=s.getElementsByTagNameNS?s.getElementsByTagNameNS(zs.NS.STREAM,"features").length>0:s.getElementsByTagName("stream:features").length>0||s.getElementsByTagName("features").length>0,!i)return void this._proto._no_auth_received(t);const r=Array.from(s.getElementsByTagName("mechanism")).map((e=>this.mechanisms[e.textContent])).filter((e=>e));0!==r.length||0!==s.getElementsByTagName("auth").length?!1!==this.do_authentication&&this.authenticate(r):this._proto._no_auth_received(t)}sortMechanismsByPriority(e){for(let t=0;t<e.length-1;++t){let n=t;for(let s=t+1;s<e.length;++s)e[s].priority>e[n].priority&&(n=s);if(n!==t){const s=e[t];e[t]=e[n],e[n]=s}}return e}authenticate(e){this._attemptSASLAuth(e)||this._attemptLegacyAuth()}_attemptSASLAuth(e){e=this.sortMechanismsByPriority(e||[]);let t=!1;for(let n=0;n<e.length;++n){if(!e[n].test(this))continue;this._sasl_success_handler=this._addSysHandler(this._sasl_success_cb.bind(this),null,"success",null,null),this._sasl_failure_handler=this._addSysHandler(this._sasl_failure_cb.bind(this),null,"failure",null,null),this._sasl_challenge_handler=this._addSysHandler(this._sasl_challenge_cb.bind(this),null,"challenge",null,null),this._sasl_mechanism=e[n],this._sasl_mechanism.onStart(this);const s=Is("auth",{xmlns:zs.NS.SASL,mechanism:this._sasl_mechanism.mechname});if(this._sasl_mechanism.isClientFirst){const e=this._sasl_mechanism.clientChallenge(this);s.t((0,Ns.btoa)(e))}this.send(s.tree()),t=!0;break}return t}_sasl_challenge_cb(e){const t=(0,Ns.atob)(zs.getText(e)),n=this._sasl_mechanism.onChallenge(this,t),s=Is("response",{xmlns:zs.NS.SASL});return""!==n&&s.t((0,Ns.btoa)(n)),this.send(s.tree()),!0}_attemptLegacyAuth(){null===zs.getNodeFromJid(this.jid)?(this._changeConnectStatus(zs.Status.CONNFAIL,zs.ErrorCondition.MISSING_JID_NODE),this.disconnect(zs.ErrorCondition.MISSING_JID_NODE)):(this._changeConnectStatus(zs.Status.AUTHENTICATING,null),this._addSysHandler(this._onLegacyAuthIQResult.bind(this),null,null,null,"_auth_1"),this.send(Rs({type:"get",to:this.domain,id:"_auth_1"}).c("query",{xmlns:zs.NS.AUTH}).c("username",{}).t(zs.getNodeFromJid(this.jid)).tree()))}_onLegacyAuthIQResult(e){const t=Rs({type:"set",id:"_auth_2"}).c("query",{xmlns:zs.NS.AUTH}).c("username",{}).t(zs.getNodeFromJid(this.jid)).up().c("password").t(this.pass);return zs.getResourceFromJid(this.jid)||(this.jid=zs.getBareJidFromJid(this.jid)+"/strophe"),t.up().c("resource",{}).t(zs.getResourceFromJid(this.jid)),this._addSysHandler(this._auth2_cb.bind(this),null,null,null,"_auth_2"),this.send(t.tree()),!1}_sasl_success_cb(e){if(this._sasl_data["server-signature"]){let t;const n=/([a-z]+)=([^,]+)(,|$)/,s=(0,Ns.atob)(zs.getText(e)).match(n);if("v"===s[1]&&(t=s[2]),t!==this._sasl_data["server-signature"])return this.deleteHandler(this._sasl_failure_handler),this._sasl_failure_handler=null,this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null),this._sasl_data={},this._sasl_failure_cb(null)}zs.info("SASL authentication succeeded."),this._sasl_mechanism&&this._sasl_mechanism.onSuccess(),this.deleteHandler(this._sasl_failure_handler),this._sasl_failure_handler=null,this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null);const t=[],n=(e,t)=>{for(;e.length;)this.deleteHandler(e.pop());return this._onStreamFeaturesAfterSASL(t),!1};return t.push(this._addSysHandler((e=>n(t,e)),null,"stream:features",null,null)),t.push(this._addSysHandler((e=>n(t,e)),zs.NS.STREAM,"features",null,null)),this._sendRestart(),!1}_onStreamFeaturesAfterSASL(e){this.features=e;for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];"bind"===n.nodeName&&(this.do_bind=!0),"session"===n.nodeName&&(this.do_session=!0)}return this.do_bind?(this.options.explicitResourceBinding?this._changeConnectStatus(zs.Status.BINDREQUIRED,null):this.bind(),!1):(this._changeConnectStatus(zs.Status.AUTHFAIL,null),!1)}bind(){if(!this.do_bind)return void zs.log(zs.LogLevel.INFO,'Strophe.Connection.prototype.bind called but "do_bind" is false');this._addSysHandler(this._onResourceBindResultIQ.bind(this),null,null,null,"_bind_auth_2");const e=zs.getResourceFromJid(this.jid);e?this.send(Rs({type:"set",id:"_bind_auth_2"}).c("bind",{xmlns:zs.NS.BIND}).c("resource",{}).t(e).tree()):this.send(Rs({type:"set",id:"_bind_auth_2"}).c("bind",{xmlns:zs.NS.BIND}).tree())}_onResourceBindResultIQ(e){if("error"===e.getAttribute("type")){let t;return zs.warn("Resource binding failed."),e.getElementsByTagName("conflict").length>0&&(t=zs.ErrorCondition.CONFLICT),this._changeConnectStatus(zs.Status.AUTHFAIL,t,e),!1}const t=e.getElementsByTagName("bind");if(!(t.length>0))return zs.warn("Resource binding failed."),this._changeConnectStatus(zs.Status.AUTHFAIL,null,e),!1;{const e=t[0].getElementsByTagName("jid");e.length>0&&(this.authenticated=!0,this.jid=zs.getText(e[0]),this.do_session?this._establishSession():this._changeConnectStatus(zs.Status.CONNECTED,null))}}_establishSession(){if(!this.do_session)throw new Error("Strophe.Connection.prototype._establishSession "+"called but apparently ".concat(zs.NS.SESSION," wasn't advertised by the server"));this._addSysHandler(this._onSessionResultIQ.bind(this),null,null,null,"_session_auth_2"),this.send(Rs({type:"set",id:"_session_auth_2"}).c("session",{xmlns:zs.NS.SESSION}).tree())}_onSessionResultIQ(e){if("result"===e.getAttribute("type"))this.authenticated=!0,this._changeConnectStatus(zs.Status.CONNECTED,null);else if("error"===e.getAttribute("type"))return this.authenticated=!1,zs.warn("Session creation failed."),this._changeConnectStatus(zs.Status.AUTHFAIL,null,e),!1;return!1}_sasl_failure_cb(e){return this._sasl_success_handler&&(this.deleteHandler(this._sasl_success_handler),this._sasl_success_handler=null),this._sasl_challenge_handler&&(this.deleteHandler(this._sasl_challenge_handler),this._sasl_challenge_handler=null),this._sasl_mechanism&&this._sasl_mechanism.onFailure(),this._changeConnectStatus(zs.Status.AUTHFAIL,null,e),!1}_auth2_cb(e){return"result"===e.getAttribute("type")?(this.authenticated=!0,this._changeConnectStatus(zs.Status.CONNECTED,null)):"error"===e.getAttribute("type")&&(this._changeConnectStatus(zs.Status.AUTHFAIL,null,e),this.disconnect("authentication failed")),!1}_addSysTimedHandler(e,t){const n=new zs.TimedHandler(e,t);return n.user=!1,this.addTimeds.push(n),n}_addSysHandler(e,t,n,s,i){const r=new zs.Handler(e,t,n,s,i);return r.user=!1,this.addHandlers.push(r),r}_onDisconnectTimeout(){return zs.debug("_onDisconnectTimeout was called"),this._changeConnectStatus(zs.Status.CONNTIMEOUT,null),this._proto._onDisconnectTimeout(),this._doDisconnect(),!1}_onIdle(){for(;this.addTimeds.length>0;)this.timedHandlers.push(this.addTimeds.pop());for(;this.removeTimeds.length>0;){const e=this.removeTimeds.pop(),t=this.timedHandlers.indexOf(e);t>=0&&this.timedHandlers.splice(t,1)}const e=(new Date).getTime(),t=[];for(let n=0;n<this.timedHandlers.length;n++){const s=this.timedHandlers[n];!this.authenticated&&s.user||(s.lastCalled+s.period-e<=0?s.run()&&t.push(s):t.push(s))}this.timedHandlers=t,clearTimeout(this._idleTimeout),this._proto._onIdle(),this.connected&&(this._idleTimeout=setTimeout((()=>this._onIdle()),100))}},zs.SASLMechanism=ys,zs.SASLAnonymous=class extends ys{constructor(e="ANONYMOUS",t=!1,n=20){super(e,t,n)}test(e){return null===e.authcid}},zs.SASLPlain=class extends ys{constructor(e="PLAIN",t=!0,n=50){super(e,t,n)}test(e){return null!==e.authcid}onChallenge(e){const{authcid:t,authzid:n,domain:s,pass:i}=e;if(!s)throw new Error("SASLPlain onChallenge: domain is not defined!");let r=n!=="".concat(t,"@").concat(s)?n:"";return r+="\0",r+=t,r+="\0",r+=i,_s(r)}},zs.SASLSHA1=class extends ys{constructor(e="SCRAM-SHA-1",t=!0,n=60){super(e,t,n)}test(e){return null!==e.authcid}onChallenge(e,t){let n,s,i,r,o,a,c,l,u="c=biws,",d="".concat(e._sasl_data["client-first-message-bare"],",").concat(t,",");const h=e._sasl_data.cnonce,f=/([a-z]+)=([^,]+)(,|$)/;for(;t.match(f);){const e=t.match(f);switch(t=t.replace(e[0],""),e[1]){case"r":n=e[2];break;case"s":s=e[2];break;case"i":i=e[2]}}if(n.substr(0,h.length)!==h)return e._sasl_data={},e._sasl_failure_cb();u+="r="+n,d+=u,s=atob(s),s+="\0\0\0";const g=_s(e.pass);for(r=a=Ts.core_hmac_sha1(g,s),c=1;c<i;c++){for(o=Ts.core_hmac_sha1(g,Ts.binb2str(a)),l=0;l<5;l++)r[l]^=o[l];a=o}r=Ts.binb2str(r);const m=Ts.core_hmac_sha1(r,"Client Key"),p=Ts.str_hmac_sha1(r,"Server Key"),v=Ts.core_hmac_sha1(Ts.str_sha1(Ts.binb2str(m)),d);for(e._sasl_data["server-signature"]=Ts.b64_hmac_sha1(p,d),l=0;l<5;l++)m[l]^=v[l];return u+=",p="+btoa(Ts.binb2str(m)),u}clientChallenge(e,t){const n=t||bs.hexdigest(""+1234567890*Math.random());let s="n="+_s(e.authcid);return s+=",r=",s+=n,e._sasl_data.cnonce=n,e._sasl_data["client-first-message-bare"]=s,s="n,,"+s,s}},zs.SASLOAuthBearer=class extends ys{constructor(e="OAUTHBEARER",t=!0,n=40){super(e,t,n)}test(e){return null!==e.pass}onChallenge(e){let t="n,";return null!==e.authcid&&(t=t+"a="+e.authzid),t+=",",t+="",t+="auth=Bearer ",t+=e.pass,t+="",t+="",_s(t)}},zs.SASLExternal=class extends ys{constructor(e="EXTERNAL",t=!0,n=10){super(e,t,n)}onChallenge(e){return e.authcid===e.authzid?"":e.authzid}},zs.SASLXOAuth2=class extends ys{constructor(e="X-OAUTH2",t=!0,n=30){super(e,t,n)}test(e){return null!==e.pass}onChallenge(e){let t="\0";return null!==e.authcid&&(t+=e.authzid),t+="\0",t+=e.pass,_s(t)}};const Ls={Strophe:zs,$build:Is,$iq:Rs,$msg:Ms,$pres:Ds,SHA1:Ts,MD5:bs,b64_hmac_sha1:Ts.b64_hmac_sha1,b64_sha1:Ts.b64_sha1,str_hmac_sha1:Ts.str_hmac_sha1,str_sha1:Ts.str_sha1};zs.Request=class{constructor(e,t,n,s){this.id=++zs._requestId,this.xmlData=e,this.data=zs.serialize(e),this.origFunc=t,this.func=t,this.rid=n,this.date=NaN,this.sends=s||0,this.abort=!1,this.dead=null,this.age=function(){return this.date?(new Date-this.date)/1e3:0},this.timeDead=function(){return this.dead?(new Date-this.dead)/1e3:0},this.xhr=this._newXHR()}getResponse(){let e=null;if(this.xhr.responseXML&&this.xhr.responseXML.documentElement){if(e=this.xhr.responseXML.documentElement,"parsererror"===e.tagName)throw zs.error("invalid response received"),zs.error("responseText: "+this.xhr.responseText),zs.error("responseXML: "+zs.serialize(this.xhr.responseXML)),new Error("parsererror")}else if(this.xhr.responseText){if(zs.debug("Got responseText but no responseXML; attempting to parse it with DOMParser..."),e=(new ls).parseFromString(this.xhr.responseText,"application/xml").documentElement,!e)throw new Error("Parsing produced null node");if(e.querySelector("parsererror")){zs.error("invalid response received: "+e.querySelector("parsererror").textContent),zs.error("responseText: "+this.xhr.responseText);const t=new Error;throw t.name=zs.ErrorCondition.BAD_FORMAT,t}}return e}_newXHR(){let e=null;return window.XMLHttpRequest?(e=new XMLHttpRequest,e.overrideMimeType&&e.overrideMimeType("text/xml; charset=utf-8")):window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLHTTP")),e.onreadystatechange=this.func.bind(null,this),e}},zs.Bosh=class e{constructor(e){this._conn=e,this.rid=Math.floor(4294967295*Math.random()),this.sid=null,this.hold=1,this.wait=60,this.window=5,this.errors=0,this.inactivity=null,this.lastResponseHeaders=null,this._requests=[]}_buildBody(){const e=Is("body",{rid:this.rid++,xmlns:zs.NS.HTTPBIND});return null!==this.sid&&e.attrs({sid:this.sid}),this._conn.options.keepalive&&this._conn._sessionCachingSupported()&&this._cacheSession(),e}_reset(){this.rid=Math.floor(4294967295*Math.random()),this.sid=null,this.errors=0,this._conn._sessionCachingSupported()&&window.sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)}_connect(e,t,n){this.wait=e||this.wait,this.hold=t||this.hold,this.errors=0;const s=this._buildBody().attrs({to:this._conn.domain,"xml:lang":"en",wait:this.wait,hold:this.hold,content:"text/xml; charset=utf-8",ver:"1.6","xmpp:version":"1.0","xmlns:xmpp":zs.NS.BOSH});n&&s.attrs({route:n});const i=this._conn._connect_cb;this._requests.push(new zs.Request(s.tree(),this._onRequestStateChange.bind(this,i.bind(this._conn)),s.tree().getAttribute("rid"))),this._throttledRequestHandler()}_attach(e,t,n,s,i,r,o){this._conn.jid=e,this.sid=t,this.rid=n,this._conn.connect_callback=s,this._conn.domain=zs.getDomainFromJid(this._conn.jid),this._conn.authenticated=!0,this._conn.connected=!0,this.wait=i||this.wait,this.hold=r||this.hold,this.window=o||this.window,this._conn._changeConnectStatus(zs.Status.ATTACHED,null)}_restore(e,t,n,s,i){const r=JSON.parse(window.sessionStorage.getItem("strophe-bosh-session"));if(!(null!=r&&r.rid&&r.sid&&r.jid&&(null==e||zs.getBareJidFromJid(r.jid)===zs.getBareJidFromJid(e)||null===zs.getNodeFromJid(e)&&zs.getDomainFromJid(r.jid)===e))){const e=new Error("_restore: no restoreable session.");throw e.name="StropheSessionError",e}this._conn.restored=!0,this._attach(r.jid,r.sid,r.rid,t,n,s,i)}_cacheSession(){this._conn.authenticated?this._conn.jid&&this.rid&&this.sid&&window.sessionStorage.setItem("strophe-bosh-session",JSON.stringify({jid:this._conn.jid,rid:this.rid,sid:this.sid})):window.sessionStorage.removeItem("strophe-bosh-session")}_connect_cb(e){const t=e.getAttribute("type");if(null!==t&&"terminate"===t){let t=e.getAttribute("condition");zs.error("BOSH-Connection failed: "+t);const n=e.getElementsByTagName("conflict");return null!==t?("remote-stream-error"===t&&n.length>0&&(t="conflict"),this._conn._changeConnectStatus(zs.Status.CONNFAIL,t)):this._conn._changeConnectStatus(zs.Status.CONNFAIL,"unknown"),this._conn._doDisconnect(t),zs.Status.CONNFAIL}this.sid||(this.sid=e.getAttribute("sid"));const n=e.getAttribute("requests");n&&(this.window=parseInt(n,10));const s=e.getAttribute("hold");s&&(this.hold=parseInt(s,10));const i=e.getAttribute("wait");i&&(this.wait=parseInt(i,10));const r=e.getAttribute("inactivity");r&&(this.inactivity=parseInt(r,10))}_disconnect(e){this._sendTerminate(e)}_doDisconnect(){this.sid=null,this.rid=Math.floor(4294967295*Math.random()),this._conn._sessionCachingSupported()&&window.sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)}_emptyQueue(){return 0===this._requests.length}_callProtocolErrorHandlers(t){const n=e._getRequestStatus(t),s=this._conn.protocolErrorHandlers.HTTP[n];s&&s.call(this,n)}_hitError(e){this.errors++,zs.warn("request errored, status: "+e+", number of errors: "+this.errors),this.errors>4&&this._conn._onDisconnectTimeout()}_no_auth_received(e){zs.warn("Server did not yet offer a supported authentication mechanism. Sending a blank poll request."),e=e?e.bind(this._conn):this._conn._connect_cb.bind(this._conn);const t=this._buildBody();this._requests.push(new zs.Request(t.tree(),this._onRequestStateChange.bind(this,e),t.tree().getAttribute("rid"))),this._throttledRequestHandler()}_onDisconnectTimeout(){this._abortAllRequests()}_abortAllRequests(){for(;this._requests.length>0;){const e=this._requests.pop();e.abort=!0,e.xhr.abort(),e.xhr.onreadystatechange=function(){}}}_onIdle(){const e=this._conn._data;if(this._conn.authenticated&&0===this._requests.length&&0===e.length&&!this._conn.disconnecting&&(zs.debug("no requests during idle cycle, sending blank request"),e.push(null)),!this._conn.paused){if(this._requests.length<2&&e.length>0){const t=this._buildBody();for(let n=0;n<e.length;n++)null!==e[n]&&("restart"===e[n]?t.attrs({to:this._conn.domain,"xml:lang":"en","xmpp:restart":"true","xmlns:xmpp":zs.NS.BOSH}):t.cnode(e[n]).up());delete this._conn._data,this._conn._data=[],this._requests.push(new zs.Request(t.tree(),this._onRequestStateChange.bind(this,this._conn._dataRecv.bind(this._conn)),t.tree().getAttribute("rid"))),this._throttledRequestHandler()}if(this._requests.length>0){const e=this._requests[0].age();null!==this._requests[0].dead&&this._requests[0].timeDead()>Math.floor(zs.SECONDARY_TIMEOUT*this.wait)&&this._throttledRequestHandler(),e>Math.floor(zs.TIMEOUT*this.wait)&&(zs.warn("Request "+this._requests[0].id+" timed out, over "+Math.floor(zs.TIMEOUT*this.wait)+" seconds since last activity"),this._throttledRequestHandler())}}}static _getRequestStatus(e,t){let n;if(4===e.xhr.readyState)try{n=e.xhr.status}catch(e){zs.error("Caught an error while retrieving a request's status, reqStatus: "+n)}return void 0===n&&(n="number"==typeof t?t:0),n}_onRequestStateChange(t,n){if(zs.debug("request id "+n.id+"."+n.sends+" state changed to "+n.xhr.readyState),n.abort)return void(n.abort=!1);if(4!==n.xhr.readyState)return;const s=e._getRequestStatus(n);if(this.lastResponseHeaders=n.xhr.getAllResponseHeaders(),this._conn.disconnecting&&s>=400)return this._hitError(s),void this._callProtocolErrorHandlers(n);const i=s>0&&s<500,r=n.sends>this._conn.maxRetries;if((i||r)&&(this._removeRequest(n),zs.debug("request id "+n.id+" should now be removed")),200===s){const e=this._requests[0]===n;(this._requests[1]===n||e&&this._requests.length>0&&this._requests[0].age()>Math.floor(zs.SECONDARY_TIMEOUT*this.wait))&&this._restartRequest(0),this._conn.nextValidRid(Number(n.rid)+1),zs.debug("request id "+n.id+"."+n.sends+" got 200"),t(n),this.errors=0}else 0===s||s>=400&&s<600||s>=12e3?(zs.error("request id "+n.id+"."+n.sends+" error "+s+" happened"),this._hitError(s),this._callProtocolErrorHandlers(n),s>=400&&s<500&&(this._conn._changeConnectStatus(zs.Status.DISCONNECTING,null),this._conn._doDisconnect())):zs.error("request id "+n.id+"."+n.sends+" error "+s+" happened");i||r?r&&!this._conn.connected&&this._conn._changeConnectStatus(zs.Status.CONNFAIL,"giving-up"):this._throttledRequestHandler()}_processRequest(t){let n=this._requests[t];const s=e._getRequestStatus(n,-1);if(n.sends>this._conn.maxRetries)return void this._conn._onDisconnectTimeout();const i=n.age(),r=!isNaN(i)&&i>Math.floor(zs.TIMEOUT*this.wait),o=null!==n.dead&&n.timeDead()>Math.floor(zs.SECONDARY_TIMEOUT*this.wait),a=4===n.xhr.readyState&&(s<1||s>=500);if((r||o||a)&&(o&&zs.error("Request ".concat(this._requests[t].id," timed out (secondary), restarting")),n.abort=!0,n.xhr.abort(),n.xhr.onreadystatechange=function(){},this._requests[t]=new zs.Request(n.xmlData,n.origFunc,n.rid,n.sends),n=this._requests[t]),0===n.xhr.readyState){zs.debug("request id "+n.id+"."+n.sends+" posting");try{const e=this._conn.options.contentType||"text/xml; charset=utf-8";n.xhr.open("POST",this._conn.service,!this._conn.options.sync),void 0!==n.xhr.setRequestHeader&&n.xhr.setRequestHeader("Content-Type",e),this._conn.options.withCredentials&&(n.xhr.withCredentials=!0)}catch(e){return zs.error("XHR open failed: "+e.toString()),this._conn.connected||this._conn._changeConnectStatus(zs.Status.CONNFAIL,"bad-service"),void this._conn.disconnect()}const e=()=>{if(n.date=new Date,this._conn.options.customHeaders){const e=this._conn.options.customHeaders;for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.xhr.setRequestHeader(t,e[t])}n.xhr.send(n.data)};if(n.sends>1){const t=1e3*Math.min(Math.floor(zs.TIMEOUT*this.wait),Math.pow(n.sends,3));setTimeout((function(){e()}),t)}else e();n.sends++,this._conn.xmlOutput!==zs.Connection.prototype.xmlOutput&&(n.xmlData.nodeName===this.strip&&n.xmlData.childNodes.length?this._conn.xmlOutput(n.xmlData.childNodes[0]):this._conn.xmlOutput(n.xmlData)),this._conn.rawOutput!==zs.Connection.prototype.rawOutput&&this._conn.rawOutput(n.data)}else zs.debug("_processRequest: "+(0===t?"first":"second")+" request has readyState of "+n.xhr.readyState)}_removeRequest(e){zs.debug("removing request");for(let t=this._requests.length-1;t>=0;t--)e===this._requests[t]&&this._requests.splice(t,1);e.xhr.onreadystatechange=function(){},this._throttledRequestHandler()}_restartRequest(e){const t=this._requests[e];null===t.dead&&(t.dead=new Date),this._processRequest(e)}_reqToData(e){try{return e.getResponse()}catch(e){if("parsererror"!==e.message)throw e;this._conn.disconnect("strophe-parsererror")}}_sendTerminate(e){zs.debug("_sendTerminate was called");const t=this._buildBody().attrs({type:"terminate"});e&&t.cnode(e.tree());const n=new zs.Request(t.tree(),this._onRequestStateChange.bind(this,this._conn._dataRecv.bind(this._conn)),t.tree().getAttribute("rid"));this._requests.push(n),this._throttledRequestHandler()}_send(){clearTimeout(this._conn._idleTimeout),this._throttledRequestHandler(),this._conn._idleTimeout=setTimeout((()=>this._conn._onIdle()),100)}_sendRestart(){this._throttledRequestHandler(),clearTimeout(this._conn._idleTimeout)}_throttledRequestHandler(){this._requests?zs.debug("_throttledRequestHandler called with "+this._requests.length+" requests"):zs.debug("_throttledRequestHandler called with undefined requests"),this._requests&&0!==this._requests.length&&(this._requests.length>0&&this._processRequest(0),this._requests.length>1&&Math.abs(this._requests[0].rid-this._requests[1].rid)<this.window&&this._processRequest(1))}},zs.Bosh.prototype.strip=null,zs.Websocket=class{constructor(e){this._conn=e,this.strip="wrapper";const t=e.service;if(0!==t.indexOf("ws:")&&0!==t.indexOf("wss:")){let n="";"ws"===e.options.protocol&&"https:"!==window.location.protocol?n+="ws":n+="wss",n+="://"+window.location.host,0!==t.indexOf("/")?n+=window.location.pathname+t:n+=t,e.service=n}}_buildStream(){return Is("open",{xmlns:zs.NS.FRAMING,to:this._conn.domain,version:"1.0"})}_checkStreamError(e,t){let n;if(n=e.getElementsByTagNameNS?e.getElementsByTagNameNS(zs.NS.STREAM,"error"):e.getElementsByTagName("stream:error"),0===n.length)return!1;const s=n[0];let i="",r="";for(let e=0;e<s.childNodes.length;e++){const t=s.childNodes[e];if("urn:ietf:params:xml:ns:xmpp-streams"!==t.getAttribute("xmlns"))break;"text"===t.nodeName?r=t.textContent:i=t.nodeName}let o="WebSocket stream error: ";return o+=i||"unknown",r&&(o+=" - "+r),zs.error(o),this._conn._changeConnectStatus(t,i),this._conn._doDisconnect(),!0}_reset(){}_connect(){this._closeSocket(),this.socket=new cs(this._conn.service,"xmpp"),this.socket.onopen=()=>this._onOpen(),this.socket.onerror=e=>this._onError(e),this.socket.onclose=e=>this._onClose(e),this.socket.onmessage=e=>this._onInitialMessage(e)}_connect_cb(e){if(this._checkStreamError(e,zs.Status.CONNFAIL))return zs.Status.CONNFAIL}_handleStreamStart(e){let t=!1;const n=e.getAttribute("xmlns");"string"!=typeof n?t="Missing xmlns in <open />":n!==zs.NS.FRAMING&&(t="Wrong xmlns in <open />: "+n);const s=e.getAttribute("version");return"string"!=typeof s?t="Missing version in <open />":"1.0"!==s&&(t="Wrong version in <open />: "+s),!t||(this._conn._changeConnectStatus(zs.Status.CONNFAIL,t),this._conn._doDisconnect(),!1)}_onInitialMessage(e){if(0===e.data.indexOf("<open ")||0===e.data.indexOf("<?xml")){const t=e.data.replace(/^(<\?.*?\?>\s*)*/,"");if(""===t)return;const n=(new ls).parseFromString(t,"text/xml").documentElement;this._conn.xmlInput(n),this._conn.rawInput(e.data),this._handleStreamStart(n)&&this._connect_cb(n)}else if(0===e.data.indexOf("<close ")){const t=(new ls).parseFromString(e.data,"text/xml").documentElement;this._conn.xmlInput(t),this._conn.rawInput(e.data);const n=t.getAttribute("see-other-uri");if(n){const e=this._conn.service;(e.indexOf("wss:")>=0&&n.indexOf("wss:")>=0||e.indexOf("ws:")>=0)&&(this._conn._changeConnectStatus(zs.Status.REDIRECT,"Received see-other-uri, resetting connection"),this._conn.reset(),this._conn.service=n,this._connect())}else this._conn._changeConnectStatus(zs.Status.CONNFAIL,"Received closing stream"),this._conn._doDisconnect()}else{this._replaceMessageHandler();const t=this._streamWrap(e.data),n=(new ls).parseFromString(t,"text/xml").documentElement;this._conn._connect_cb(n,null,e.data)}}_replaceMessageHandler(){this.socket.onmessage=e=>this._onMessage(e)}_disconnect(e){if(this.socket&&this.socket.readyState!==cs.CLOSED){e&&this._conn.send(e);const t=Is("close",{xmlns:zs.NS.FRAMING});this._conn.xmlOutput(t.tree());const n=zs.serialize(t);this._conn.rawOutput(n);try{this.socket.send(n)}catch(e){zs.warn("Couldn't send <close /> tag.")}}setTimeout((()=>this._conn._doDisconnect),0)}_doDisconnect(){zs.debug("WebSockets _doDisconnect was called"),this._closeSocket()}_streamWrap(e){return"<wrapper>"+e+"</wrapper>"}_closeSocket(){if(this.socket)try{this.socket.onclose=null,this.socket.onerror=null,this.socket.onmessage=null,this.socket.close()}catch(e){zs.debug(e.message)}this.socket=null}_emptyQueue(){return!0}_onClose(e){this._conn.connected&&!this._conn.disconnecting?(zs.error("Websocket closed unexpectedly"),this._conn._doDisconnect()):e&&1006===e.code&&!this._conn.connected&&this.socket?(zs.error("Websocket closed unexcectedly"),this._conn._changeConnectStatus(zs.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._conn._doDisconnect()):zs.debug("Websocket closed")}_no_auth_received(e){zs.error("Server did not offer a supported authentication mechanism"),this._conn._changeConnectStatus(zs.Status.CONNFAIL,zs.ErrorCondition.NO_AUTH_MECH),e&&e.call(this._conn),this._conn._doDisconnect()}_onDisconnectTimeout(){}_abortAllRequests(){}_onError(e){zs.error("Websocket error "+e),this._conn._changeConnectStatus(zs.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._disconnect()}_onIdle(){const e=this._conn._data;if(e.length>0&&!this._conn.paused){for(let t=0;t<e.length;t++)if(null!==e[t]){let n;n="restart"===e[t]?this._buildStream().tree():e[t];const s=zs.serialize(n);this._conn.xmlOutput(n),this._conn.rawOutput(s),this.socket.send(s)}this._conn._data=[]}}_onMessage(e){let t;const n='<close xmlns="urn:ietf:params:xml:ns:xmpp-framing" />';if(e.data===n)return this._conn.rawInput(n),this._conn.xmlInput(e),void(this._conn.disconnecting||this._conn._doDisconnect());if(0===e.data.search("<open ")){if(t=(new ls).parseFromString(e.data,"text/xml").documentElement,!this._handleStreamStart(t))return}else{const n=this._streamWrap(e.data);t=(new ls).parseFromString(n,"text/xml").documentElement}return this._checkStreamError(t,zs.Status.ERROR)?void 0:this._conn.disconnecting&&"presence"===t.firstChild.nodeName&&"unavailable"===t.firstChild.getAttribute("type")?(this._conn.xmlInput(t),void this._conn.rawInput(zs.serialize(t))):void this._conn._dataRecv(t,e.data)}_onOpen(){zs.debug("Websocket open");const e=this._buildStream();this._conn.xmlOutput(e.tree());const t=zs.serialize(e);this._conn.rawOutput(t),this.socket.send(t)}_reqToData(e){return e}_send(){this._conn.flush()}_sendRestart(){clearTimeout(this._conn._idleTimeout),this._conn._onIdle.bind(this._conn)()}};const Ps={};Ps.debug=zs.LogLevel.DEBUG,Ps.info=zs.LogLevel.INFO,Ps.warn=zs.LogLevel.WARN,Ps.error=zs.LogLevel.ERROR,Ps.fatal=zs.LogLevel.FATAL,zs.WorkerWebsocket=class extends zs.Websocket{constructor(e){super(e),this._conn=e,this.worker=new SharedWorker(this._conn.options.worker,"Strophe XMPP Connection"),this.worker.onerror=e=>{var t;null===(t=console)||void 0===t||t.error(e),zs.log(zs.LogLevel.ERROR,"Shared Worker Error: ".concat(e))}}get socket(){return{send:e=>this.worker.port.postMessage(["send",e])}}_connect(){this._messageHandler=e=>this._onInitialMessage(e),this.worker.port.start(),this.worker.port.onmessage=e=>this._onWorkerMessage(e),this.worker.port.postMessage(["_connect",this._conn.service,this._conn.jid])}_attach(e){this._messageHandler=e=>this._onMessage(e),this._conn.connect_callback=e,this.worker.port.start(),this.worker.port.onmessage=e=>this._onWorkerMessage(e),this.worker.port.postMessage(["_attach",this._conn.service])}_attachCallback(e,t){e===zs.Status.ATTACHED?(this._conn.jid=t,this._conn.authenticated=!0,this._conn.connected=!0,this._conn.restored=!0,this._conn._changeConnectStatus(zs.Status.ATTACHED)):e===zs.Status.ATTACHFAIL&&(this._conn.authenticated=!1,this._conn.connected=!1,this._conn.restored=!1,this._conn._changeConnectStatus(zs.Status.ATTACHFAIL))}_disconnect(e,t){t&&this._conn.send(t);const n=Is("close",{xmlns:zs.NS.FRAMING});this._conn.xmlOutput(n.tree());const s=zs.serialize(n);this._conn.rawOutput(s),this.worker.port.postMessage(["send",s]),this._conn._doDisconnect()}_onClose(e){this._conn.connected&&!this._conn.disconnecting?(zs.error("Websocket closed unexpectedly"),this._conn._doDisconnect()):e&&1006===e.code&&!this._conn.connected?(zs.error("Websocket closed unexcectedly"),this._conn._changeConnectStatus(zs.Status.CONNFAIL,"The WebSocket connection could not be established or was disconnected."),this._conn._doDisconnect()):zs.debug("Websocket closed")}_closeSocket(){this.worker.port.postMessage(["_closeSocket"])}_replaceMessageHandler(){this._messageHandler=e=>this._onMessage(e)}_onWorkerMessage(e){const{data:t}=e,n=t[0];if("_onMessage"===n)this._messageHandler(t[1]);else if(n in this)try{this[n].apply(this,e.data.slice(1))}catch(e){zs.log(zs.LogLevel.ERROR,e)}else if("log"===n){const e=t[1],n=t[2];zs.log(Ps[e],n)}else zs.log(zs.LogLevel.ERROR,"Found unhandled service worker message: ".concat(t))}},n.g.$build=Ls.$build,n.g.$iq=Ls.$iq,n.g.$msg=Ls.$msg,n.g.$pres=Ls.$pres,n.g.Strophe=Ls.Strophe;const{b64_sha1:Fs}=Ts,Bs={};Bs[zs.Status.ATTACHED]="ATTACHED",Bs[zs.Status.AUTHENTICATING]="AUTHENTICATING",Bs[zs.Status.AUTHFAIL]="AUTHFAIL",Bs[zs.Status.CONNECTED]="CONNECTED",Bs[zs.Status.CONNECTING]="CONNECTING",Bs[zs.Status.CONNFAIL]="CONNFAIL",Bs[zs.Status.DISCONNECTED]="DISCONNECTED",Bs[zs.Status.DISCONNECTING]="DISCONNECTING",Bs[zs.Status.ERROR]="ERROR",Bs[zs.Status.RECONNECTING]="RECONNECTING",Bs[zs.Status.REDIRECT]="REDIRECT";const Us=dt((function(e,t){qe(t,Qe(t),e)})),qs=function(e,t){for(var n=-1,s=null==e?0:e.length;++n<s;)if(t(e[n],n,e))return!0;return!1};function Hs(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new q;++t<n;)this.add(e[t])}Hs.prototype.add=Hs.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Hs.prototype.has=function(e){return this.__data__.has(e)};const $s=Hs,Gs=function(e,t){return e.has(t)},Vs=function(e,t,n,s,i,r){var o=1&n,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=r.get(e),u=r.get(t);if(l&&u)return l==t&&u==e;var d=-1,h=!0,f=2&n?new $s:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var g=e[d],m=t[d];if(s)var p=o?s(m,g,d,t,e,r):s(g,m,d,e,t,r);if(void 0!==p){if(p)continue;h=!1;break}if(f){if(!qs(t,(function(e,t){if(!Gs(f,t)&&(g===e||i(g,e,n,s,r)))return f.push(t)}))){h=!1;break}}else if(g!==m&&!i(g,m,n,s,r)){h=!1;break}}return r.delete(e),r.delete(t),h},Ws=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,s){n[++t]=[s,e]})),n},Js=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Qs=h?h.prototype:void 0,Ys=Qs?Qs.valueOf:void 0;var Ks=Object.prototype.hasOwnProperty;var Xs="[object Arguments]",Zs="[object Array]",ei="[object Object]",ti=Object.prototype.hasOwnProperty;const ni=function(e,t,n,s,r,o){var a=ve(e),c=ve(t),l=a?Zs:on(e),u=c?Zs:on(t),d=(l=l==Xs?ei:l)==ei,h=(u=u==Xs?ei:u)==ei,f=l==u;if(f&&Ee(e)){if(!Ee(t))return!1;a=!0,d=!1}if(f&&!d)return o||(o=new $),a||Pe(e)?Vs(e,t,n,s,r,o):function(e,t,n,s,r,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new ee(e),new ee(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var c=Ws;case"[object Set]":var l=1&s;if(c||(c=Js),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;s|=2,a.set(e,t);var d=Vs(c(e),c(t),s,r,o,a);return a.delete(e),d;case"[object Symbol]":if(Ys)return Ys.call(e)==Ys.call(t)}return!1}(e,t,l,n,s,r,o);if(!(1&n)){var g=d&&ti.call(e,"__wrapped__"),m=h&&ti.call(t,"__wrapped__");if(g||m){var p=g?e.value():e,v=m?t.value():t;return o||(o=new $),r(p,v,n,s,o)}}return!!f&&(o||(o=new $),function(e,t,n,s,i,r){var o=1&n,a=qt(e),c=a.length;if(c!=qt(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:Ks.call(t,u)))return!1}var d=r.get(e),h=r.get(t);if(d&&h)return d==t&&h==e;var f=!0;r.set(e,t),r.set(t,e);for(var g=o;++l<c;){var m=e[u=a[l]],p=t[u];if(s)var v=o?s(p,m,u,t,e,r):s(m,p,u,e,t,r);if(!(void 0===v?m===p||i(m,p,n,s,r):v)){f=!1;break}g||(g="constructor"==u)}if(f&&!g){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(f=!1)}return r.delete(e),r.delete(t),f}(e,t,n,s,r,o))},si=function e(t,n,s,i,r){return t===n||(null==t||null==n||!de(t)&&!de(n)?t!=t&&n!=n:ni(t,n,s,i,e,r))},ii=function(e,t,n,s){var i=n.length,r=i,o=!s;if(null==e)return!r;for(e=Object(e);i--;){var a=n[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<r;){var c=(a=n[i])[0],l=e[c],u=a[1];if(o&&a[2]){if(void 0===l&&!(c in e))return!1}else{var d=new $;if(s)var h=s(l,u,c,e,t,d);if(!(void 0===h?si(u,l,3,s,d):h))return!1}}return!0},ri=function(e){return e==e&&!s(e)},oi=function(e){for(var t=Mt(e),n=t.length;n--;){var s=t[n],i=e[s];t[n]=[s,i,ri(i)]}return t},ai=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}};var ci=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,li=/^\w*$/;const ui=function(e,t){if(ve(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!bt(e))||li.test(e)||!ci.test(e)||null!=t&&e in Object(t)};function di(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var s=arguments,i=t?t.apply(this,s):s[0],r=n.cache;if(r.has(i))return r.get(i);var o=e.apply(this,s);return n.cache=r.set(i,o)||r,o};return n.cache=new(di.Cache||q),n}di.Cache=q;var hi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fi=/\\(\\)?/g;const gi=(mi=di((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(hi,(function(e,n,s,i){t.push(s?i.replace(fi,"$1"):n||e)})),t}),(function(e){return 500===pi.size&&pi.clear(),e})),pi=mi.cache,mi);var mi,pi;const vi=function(e,t){for(var n=-1,s=null==e?0:e.length,i=Array(s);++n<s;)i[n]=t(e[n],n,e);return i};var bi=h?h.prototype:void 0,yi=bi?bi.toString:void 0;const _i=function e(t){if("string"==typeof t)return t;if(ve(t))return vi(t,e)+"";if(bt(t))return yi?yi.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},wi=function(e){return null==e?"":_i(e)},Si=function(e,t){return ve(e)?e:ui(e,t)?[e]:gi(wi(e))},xi=function(e){if("string"==typeof e||bt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ei=function(e,t){for(var n=0,s=(t=Si(t,e)).length;null!=e&&n<s;)e=e[xi(t[n++])];return n&&n==s?e:void 0},ji=function(e,t){return null!=e&&t in Object(e)},Ai=function(e,t,n){for(var s=-1,i=(t=Si(t,e)).length,r=!1;++s<i;){var o=xi(t[s]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++s!=i?r:!!(i=null==e?0:e.length)&&be(i)&&$e(o,i)&&(ve(e)||pe(e))},Ci=function(e,t){return null!=e&&Ai(e,t,ji)},ki=function(e,t){return ui(e)&&ri(t)?ai(xi(e),t):function(n){var s=function(e,t,n){var s=null==e?void 0:Ei(e,t);return void 0===s?n:s}(n,e);return void 0===s&&s===t?Ci(n,e):si(t,s,3)}},Oi=function(e){return ui(e)?(t=xi(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Ei(t,e)}}(e);var t},Ti=function(e){return"function"==typeof e?e:null==e?Xe:"object"==typeof e?ve(e)?ki(e[0],e[1]):1==(n=oi(t=e)).length&&n[0][2]?ai(n[0][0],n[0][1]):function(e){return e===t||ii(e,t,n)}:Oi(e);var t,n},Ni=function(e,t){return e&&J(e,t,Mt)},Ii=(Mi=Ni,function(e,t){if(null==e)return e;if(!ye(e))return Mi(e,t);for(var n=e.length,s=-1,i=Object(e);++s<n&&!1!==t(i[s],s,i););return e});var Mi;const Ri=function(e,t){var n;return Ii(e,(function(e,s,i){return!(n=t(e,s,i))})),!!n},Di=function(e,t,n){var s=ve(e)?qs:Ri;return n&&ut(e,t,n)&&(t=void 0),s(e,Ti(t))};var zi=Object.prototype.hasOwnProperty;const Li=function(e){if(null==e)return!0;if(ye(e)&&(ve(e)||"string"==typeof e||"function"==typeof e.splice||Ee(e)||Pe(e)||pe(e)))return!e.length;var t=on(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(le(e))return!It(e).length;for(var n in e)if(zi.call(e,n))return!1;return!0};const Pi=function(e){return e?Infinity===(e=xt(e))||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0},Fi=function(e){var t=Pi(e),n=t%1;return t==t?n?t-n:t:0},Bi=function(e){return function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=Fi(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}(2,e)};var Ui=0;const qi=function(e){var t=++Ui;return wi(e)+t},Hi={},$i=/\s+/;let Gi;const Vi=function(e,t,n,s,i){let r,o=0;if(n&&"object"==typeof n){void 0!==s&&"context"in i&&void 0===i.context&&(i.context=s);for(r=Mt(n);o<r.length;o++)t=Vi(e,t,r[o],n[r[o]],i)}else if(n&&$i.test(n))for(r=n.split($i);o<r.length;o++)t=e(t,r[o],s,i);else t=e(t,n,s,i);return t};Hi.on=function(e,t,n){return this._events=Vi(Wi,this._events||{},e,t,{context:n,ctx:this,listening:Gi}),Gi&&((this._listeners||(this._listeners={}))[Gi.id]=Gi,Gi.interop=!1),this},Hi.listenTo=function(e,t,n){if(!e)return this;const s=e._listenId||(e._listenId=qi("l")),i=this._listeningTo||(this._listeningTo={});let r=Gi=i[s];r||(this._listenId||(this._listenId=qi("l")),r=Gi=i[s]=new Zi(this,e));const o=Ji(e,t,n,this);if(Gi=void 0,o)throw o;return r.interop&&r.on(t,n),this};const Wi=function(e,t,n,s){if(n){const i=e[t]||(e[t]=[]),r=s.context,o=s.ctx,a=s.listening;a&&a.count++,i.push({callback:n,context:r,ctx:r||o,listening:a})}return e},Ji=function(e,t,n,s){try{e.on(t,n,s)}catch(e){return e}};Hi.off=function(e,t,n){return this._events?(this._events=Vi(Qi,this._events,e,t,{context:n,listeners:this._listeners}),this):this},Hi.stopListening=function(e,t,n){const s=this._listeningTo;if(!s)return this;const i=e?[e._listenId]:Mt(s);for(let e=0;e<i.length;e++){const r=s[i[e]];if(!r)break;r.obj.off(t,n,this),r.interop&&r.off(t,n)}return Li(s)&&(this._listeningTo=void 0),this};const Qi=function(e,t,n,s){if(!e)return;const i=s.context,r=s.listeners;let o,a=0;if(t||i||n){for(o=t?[t]:Mt(e);a<o.length;a++){const s=e[t=o[a]];if(!s)break;const r=[];for(let e=0;e<s.length;e++){const o=s[e];if(n&&n!==o.callback&&n!==o.callback._callback||i&&i!==o.context)r.push(o);else{const e=o.listening;e&&e.off(t,n)}}r.length?e[t]=r:delete e[t]}return e}for(o=Mt(r);a<o.length;a++)r[o[a]].cleanup()};Hi.once=function(e,t,n){const s=Vi(Yi,{},e,t,this.off.bind(this));return"string"==typeof e&&null==n&&(t=void 0),this.on(s,t,n)},Hi.listenToOnce=function(e,t,n){const s=Vi(Yi,{},t,n,this.stopListening.bind(this,e));return this.listenTo(e,s)};const Yi=function(e,t,n,s){if(n){const i=e[t]=Bi((function(){s(t,i),n.apply(this,arguments)}));i._callback=n}return e};Hi.trigger=function(e){if(!this._events)return this;const t=Math.max(0,arguments.length-1),n=Array(t);for(let e=0;e<t;e++)n[e]=arguments[e+1];return Vi(Ki,this._events,e,void 0,n),this};const Ki=function(e,t,n,s){if(e){const n=e[t];let i=e.all;n&&i&&(i=i.slice()),n&&Xi(n,s),i&&Xi(i,[t].concat(s))}return e},Xi=function(e,t){let n,s=-1;const i=e.length,r=t[0],o=t[1],a=t[2];switch(t.length){case 0:for(;++s<i;)(n=e[s]).callback.call(n.ctx);return;case 1:for(;++s<i;)(n=e[s]).callback.call(n.ctx,r);return;case 2:for(;++s<i;)(n=e[s]).callback.call(n.ctx,r,o);return;case 3:for(;++s<i;)(n=e[s]).callback.call(n.ctx,r,o,a);return;default:for(;++s<i;)(n=e[s]).callback.apply(n.ctx,t);return}},Zi=function(e,t){this.id=e._listenId,this.listener=e,this.obj=t,this.interop=!0,this.count=0,this._events=void 0};Zi.prototype.on=Hi.on,Zi.prototype.off=function(e,t){let n;this.interop?(this._events=Vi(Qi,this._events,e,t,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},Zi.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},Hi.bind=Hi.on,Hi.unbind=Hi.off;var er=Object.prototype.hasOwnProperty;const tr=function(e,t){return null!=e&&er.call(e,t)},nr=function(e,t){return null!=e&&Ai(e,t,tr)},sr=function(e,t,n){var s=-1,i=(t=Si(t,e)).length;for(i||(i=1,e=void 0);++s<i;){var r=null==e?void 0:e[xi(t[s])];void 0===r&&(s=i,r=n),e=_(r)?r.call(e):r}return e};function ir(e,t){const n=this;let s;return s=e&&nr(e,"constructor")?e.constructor:function(){return n.apply(this,arguments)},Us(s,n,t),s.prototype=function(e,t){var n=re(e);return null==t?n:Rt(n,t)}(n.prototype,e),s.prototype.constructor=s,s.__super__=n.prototype,s}function rr(){const e={isResolved:!1,isPending:!0,isRejected:!1},t=new Promise(((t,n)=>{e.resolve=t,e.reject=n}));return Object.assign(t,e),t.then((function(e){return t.isResolved=!0,t.isPending=!1,t.isRejected=!1,e}),(function(e){throw t.isResolved=!1,t.isPending=!1,t.isRejected=!0,e})),t}function or(){throw new Error('A "url" property or function must be specified')}function ar(e,t){const n=t.error;t.error=function(s){n&&n.call(t.context,e,s,t),e.trigger("error",e,s,t)}}Error;const cr={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};function lr(e){const t=sr(e,"browserStorage")||sr(e.collection,"browserStorage");return t?t.sync():ur}function ur(e,t,n={}){const s={type:cr[e],dataType:"json"};n.url||(s.url=sr(t,"url")||or()),null!=n.data||!t||"create"!==e&&"update"!==e&&"patch"!==e||(s.contentType="application/json",s.data=JSON.stringify(n.attrs||t.toJSON(n))),"GET"!==s.type&&(s.processData=!1);const i=n.error;n.error=function(e,t,s){n.textStatus=t,n.errorThrown=s,i&&i.call(n.context,e,t,s)};const r=n.xhr=function(){return fetch.apply(this,arguments)}(Us(s,n));return t.trigger("request",t,r,n),r}const dr=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)};dr.extend=ir;const hr=/^[#\/]|\s+$/g,fr=/^\/+|\/+$/g,gr=/#.*$/;dr.started=!1,Object.assign(dr.prototype,Hi,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){const e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){const t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){const e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(hr,"")},start:function(e){if(dr.started)throw new Error("history has already been started");if(dr.started=!0,this.options=Us({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(fr,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){const e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;const e=document.body,t=e.insertBefore(this.iframe,e.firstChild).contentWindow;t.document.open(),t.document.close(),t.location.hash="#"+this.fragment}if(this._usePushState?addEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?addEventListener("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){this._usePushState?removeEventListener("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&removeEventListener("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),dr.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){let t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),Di(this.handlers,(function(t){if(t.route.test(e))return t.callback(e),!0})))},navigate:function(e,t){if(!dr.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");let n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");const s=n+e;e=e.replace(gr,"");const i=this.decodeFragment(e);if(this.fragment!==i){if(this.fragment=i,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,s);else{if(!this._wantsHashChange)return this.location.assign(s);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){const n=this.iframe.contentWindow;t.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){const n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}});const mr=dr;var pr=ze&&ze.isRegExp;const vr=pr?Ie(pr):function(e){return de(e)&&"[object RegExp]"==y(e)},br=function(e={}){this.history=e.history||new mr,this.preinitialize.apply(this,arguments),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};br.extend=ir;const yr=/\((.*?)\)/g,_r=/(\(\?)?:\w+/g,wr=/\*\w+/g,Sr=/[\-{}\[\]+?.,\\\^$|#\s]/g;Object.assign(br.prototype,Hi,{preinitialize:function(){},initialize:function(){},route:function(e,t,n){return vr(e)||(e=this._routeToRegExp(e)),_(t)&&(n=t,t=""),n||(n=this[t]),this.history.route(e,(s=>{const i=this._extractParameters(e,s);!1!==this.execute(n,i,t)&&(this.trigger.apply(this,["route:"+t].concat(i)),this.trigger("route",t,i),this.history.trigger("route",this,t,i))})),this},execute:function(e,t,n){e&&e.apply(this,t)},navigate:function(e,t){return this.history.navigate(e,t),this},_bindRoutes:function(){if(!this.routes)return;let e;this.routes=sr(this,"routes");const t=Mt(this.routes);for(;null!=(e=t.pop());)this.route(e,this.routes[e])},_routeToRegExp:function(e){return e=e.replace(Sr,"\\$&").replace(yr,"(?:$1)?").replace(_r,(function(e,t){return t?e:"([^/?]+)"})).replace(wr,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){const n=e.exec(t).slice(1);return n.map((function(e,t){return t===n.length-1?e||null:e?decodeURIComponent(e):null}))}});class xr extends Error{}var Er=n(6632);function jr(){return So.config.get("trusted")?"sessionStorage"===Cc.settings.get("persistent_store")?"session":"persistent":"session"}function Ar(e,t){const n=t||jr(),s=So.storage[n];if(void 0===s)throw new TypeError("createStore: Could not find store for ".concat(e));return new Kn(e,s,"IndexedDB"===Cc.settings.get("persistent_store"))}function Cr(e,t,n){const s=n||jr();if(e.browserStorage=So.createStore(t,s),"persistent"===s&&"IndexedDB"===Cc.settings.get("persistent_store")){const t=()=>e.browserStorage.flush();window.addEventListener(So.unloadevent,t),e.on("destroy",(()=>window.removeEventListener(So.unloadevent,t))),e.listenTo(So,"beforeLogout",t)}}function kr(e){const t=So.promises[e];if(!t)throw new Error("Tried to replace non-existing promise: ".concat(e));if(t.replace){const n=Et();n.replace=t.replace,So.promises[e]=n}else as.debug('Not replacing promise "'.concat(e,'"'))}const Or=document.createElement("div");function Tr(e){return e&&"string"==typeof e&&(Or.innerHTML=Er.filterXSS(e),e=Or.textContent,Or.textContent=""),e}const Nr=function(e,t,n,i){if(!s(e))return e;for(var r=-1,o=(t=Si(t,e)).length,a=o-1,c=e;null!=c&&++r<o;){var l=xi(t[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(r!=a){var d=c[l];void 0===(u=i?i(d,l,c):void 0)&&(u=s(d)?d:$e(t[r+1])?[]:{})}Ue(c,l,u),c=c[l]}return e},Ir=function(e,t){return function(e,t,n){for(var s=-1,i=t.length,r={};++s<i;){var o=t[s],a=Ei(e,o);n(a,o)&&Nr(r,Si(o,e),a)}return r}(e,t,(function(t,n){return Ci(e,n)}))};var Mr=h?h.isConcatSpreadable:void 0;const Rr=function(e){return ve(e)||pe(e)||!!(Mr&&e&&e[Mr])},Dr=function e(t,n,s,i,r){var o=-1,a=t.length;for(s||(s=Rr),r||(r=[]);++o<a;){var c=t[o];n>0&&s(c)?n>1?e(c,n-1,s,i,r):Ft(r,c):i||(r[r.length]=c)}return r},zr=function(e){return null!=e&&e.length?Dr(e,1):[]},Lr=function(e){return rt(tt(e,void 0,zr),e+"")},Pr=Lr((function(e,t){return null==e?{}:Ir(e,t)})),Fr=function(e){for(var t=-1,n=null==e?0:e.length,s=0,i=[];++t<n;){var r=e[t];r&&(i[s++]=r)}return i},Br=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var Ur=n(1271),qr=n.n(Ur);const Hr=function(e){return yn(e,4)};var $r=Object.prototype,Gr=$r.hasOwnProperty;const Vr=lt((function(e,t){e=Object(e);var n=-1,s=t.length,r=s>2?t[2]:void 0;for(r&&ut(t[0],t[1],r)&&(s=1);++n<s;)for(var o=t[n],a=Qe(o),c=-1,l=a.length;++c<l;){var u=a[c],d=e[u];(void 0===d||i(d,$r[u])&&!Gr.call(e,u))&&(e[u]=o[u])}return e})),Wr=lt((function(e,t){return function(e,t,n){if("function"!=typeof e)throw new TypeError("Expected a function");return setTimeout((function(){e.apply(void 0,n)}),t)}(e,1,t)})),Jr=(Qr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},function(e){return null==Qr?void 0:Qr[e]});var Qr,Yr=/[&<>"']/g,Kr=RegExp(Yr.source);var Xr=Object.prototype.toString;const Zr=(eo=function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Xr.call(t)),e[t]=n},to=nt(Xe),function(e,t){return function(e,t,n,s){return Ni(e,(function(e,i,r){t(s,n(e),i,r)})),s}(e,eo,to(t),{})});var eo,to;const no=function(e,t){return si(e,t)},so=function(e,t){return t.length<2?e:Ei(e,function(e,t,n){var s=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(i);++s<i;)r[s]=e[s+t];return r}(t,0,-1))},io=function(e,t){return t=Si(t,e),null==(e=so(e,t))||delete e[xi(Br(t))]},ro=function(e){return Te(e)?void 0:e},oo=Lr((function(e,t){var n={};if(null==e)return n;var s=!1;t=vi(t,(function(t){return t=Si(t,e),s||(s=t.length>1),t})),qe(e,Ht(e),n),s&&(n=yn(n,7,ro));for(var i=t.length;i--;)io(n,t[i]);return n})),ao=function(e,t){let n=e||{};t||(t={}),this.preinitialize.apply(this,arguments),this.cid=qi(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(n=this.parse(n,t)||{});const s=sr(this,"defaults");n=Vr(Us({},s,n),s),this.set(n,t),this.changed={},this.initialize.apply(this,arguments)};ao.extend=ir,Object.assign(ao.prototype,Hi,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(e){return Hr(this.attributes)},sync:function(e,t,n){return lr(this)(e,t,n)},get:function(e){return this.attributes[e]},keys:function(){return Object.keys(this.attributes)},values:function(){return Object.values(this.attributes)},pairs:function(){return this.entries()},entries:function(){return Object.entries(this.attributes)},invert:function(){return Zr(this.attributes)},pick:function(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),Pr(this.attributes,e)},omit:function(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),oo(this.attributes,e)},isEmpty:function(){return Li(this.attributes)},escape:function(e){return t=this.get(e),(t=wi(t))&&Kr.test(t)?t.replace(Yr,Jr):t;var t},has:function(e){return null!=this.get(e)},matches:function(e){return!!function(e){return Ti("function"==typeof e?e:yn(e,1))}(e)(this.attributes)},set:function(e,t,n){if(null==e)return this;let s;if("object"==typeof e?(s=e,n=t):(s={})[e]=t,n||(n={}),!this._validate(s,n))return!1;const i=n.unset,r=n.silent,o=[],a=this._changing;this._changing=!0,a||(this._previousAttributes=Hr(this.attributes),this.changed={});const c=this.attributes,l=this.changed,u=this._previousAttributes;for(const e in s)t=s[e],no(c[e],t)||o.push(e),no(u[e],t)?delete l[e]:l[e]=t,i?delete c[e]:c[e]=t;if(this.idAttribute in s&&(this.id=this.get(this.idAttribute)),!r){o.length&&(this._pending=n);for(let e=0;e<o.length;e++)this.trigger("change:"+o[e],this,c[o[e]],n)}if(a)return this;if(!r)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,Us({},t,{unset:!0}))},clear:function(e){const t={};for(const e in this.attributes)t[e]=void 0;return this.set(t,Us({},e,{unset:!0}))},hasChanged:function(e){return null==e?!Li(this.changed):nr(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&Hr(this.changed);const t=this._changing?this._previousAttributes:this.attributes,n={};let s;for(const i in e){const r=e[i];no(t[i],r)||(n[i]=r,s=!0)}return!!s&&n},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return Hr(this._previousAttributes)},fetch:function(e){e=Us({parse:!0},e);const t=this,n=e.success;return e.success=function(s){const i=e.parse?t.parse(s,e):s;if(!t.set(i,e))return!1;n&&n.call(e.context,t,s,e),t.trigger("sync",t,s,e)},ar(this,e),this.sync("read",this,e)},save:function(e,t,n){let s;null==e||"object"==typeof e?(s=e,n=t):(s={})[e]=t;const i=(n=Us({validate:!0,parse:!0},n)).wait,r=n.promise,o=r&&rr();if(s&&!i){if(!this.set(s,n))return!1}else if(!this._validate(s,n))return!1;const a=this,c=n.success,l=n.error,u=this.attributes;n.success=function(e){a.attributes=u;let t=n.parse?a.parse(e,n):e;if(i&&(t=Us({},s,t)),t&&!a.set(t,n))return!1;c&&c.call(n.context,a,e,n),a.trigger("sync",a,e,n),r&&o.resolve()},n.error=function(e,t,n){l&&l.call(n.context,e,t,n),r&&o.reject(t)},ar(this,n),s&&i&&(this.attributes=Us({},u,s));const d=this.isNew()?"create":n.patch?"patch":"update";"patch"!==d||n.attrs||(n.attrs=s);const h=this.sync(d,this,n);return this.attributes=u,r?o:h},destroy:function(e){e=e?Hr(e):{};const t=this,n=e.success,s=e.wait,i=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(r){s&&i(),n&&n.call(e.context,t,r,e),t.isNew()||t.trigger("sync",t,r,e)};let r=!1;return this.isNew()?Wr(e.success):(ar(this,e),r=this.sync("delete",this,e)),s||i(),r},url:function(){const e=sr(this,"urlRoot")||sr(this.collection,"url")||or();if(this.isNew())return e;const t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},Us({},e,{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=Us({},this.attributes,e);const n=this.validationError=this.validate(e,t)||null;return!n||(this.trigger("invalid",this,n,Us(t,{validationError:n})),!1)}});const co={isTagEqual:function(e,t){if(e.nodeTree)return co.isTagEqual(e.nodeTree,t);if(e instanceof Element)return zs.isTagEqual(e,t);throw Error("isTagEqual called with value which isn't an element or Strophe.Builder instance")}},lo=new DOMParser,uo=lo.parseFromString("invalid","text/xml").getElementsByTagName("parsererror")[0].namespaceURI;function ho(e,t,n){co.isPersistableModel(e)?e.save(t,n):e.set(t,n)}function fo(e,t){clearTimeout(e),clearInterval(t)}co.getJIDFromURI=function(e){return e.startsWith("xmpp:")&&e.endsWith("?join")?e.replace(/^xmpp:/,"").replace(/\?join$/,""):e},co.toStanza=function(e){const t=lo.parseFromString(e,"text/xml");if(t.getElementsByTagNameNS(uo,"parsererror").length)throw new Error("Parser Error: ".concat(e));return t.firstElementChild},co.getLongestSubstring=function(e,t){return t.reduce((function(t,n){return e.startsWith(n)&&n.length>t.length?n:t}),"")},co.prefixMentions=function(e){let t=e.get("message");return(e.get("references")||[]).sort(((e,t)=>t.begin-e.begin)).forEach((e=>{t="".concat(t.slice(0,e.begin),"@").concat(t.slice(e.begin))})),t},co.isValidJID=function(e){return"string"==typeof e&&2===Fr(e.split("@")).length&&!e.startsWith("@")&&!e.endsWith("@")},co.isValidMUCJID=function(e){return!e.startsWith("@")&&!e.endsWith("@")},co.isSameBareJID=function(e,t){return"string"==typeof e&&"string"==typeof t&&zs.getBareJidFromJid(e).toLowerCase()===zs.getBareJidFromJid(t).toLowerCase()},co.isSameDomain=function(e,t){return"string"==typeof e&&"string"==typeof t&&zs.getDomainFromJid(e).toLowerCase()===zs.getDomainFromJid(t).toLowerCase()},co.isNewMessage=function(e){return e instanceof Element?!(qr()('result[xmlns="'.concat(zs.NS.MAM,'"]'),e).length&&qr()('delay[xmlns="'.concat(zs.NS.DELAY,'"]'),e).length):(e instanceof ao&&(e=e.attributes),!(e.is_delayed&&e.is_archived))},co.shouldCreateMessage=function(e){return e.retracted||!co.isEmptyMessage(e)},co.shouldCreateGroupchatMessage=function(e){return e.nick&&(co.shouldCreateMessage(e)||e.is_tombstone)},co.isEmptyMessage=function(e){return e instanceof ao&&(e=e.attributes),!(e.oob_url||e.file||e.is_encrypted&&e.plaintext||e.message)},co.isOnlyChatStateNotification=function(e){return e instanceof Element?null===e.querySelector("body")&&(null!==e.querySelector("active")||null!==e.querySelector("composing")||null!==e.querySelector("inactive")||null!==e.querySelector("paused")||null!==e.querySelector("gone")):(e instanceof ao&&(e=e.attributes),e.chat_state&&co.isEmptyMessage(e))},co.isOnlyMessageDeliveryReceipt=function(e){return e instanceof Element?null===e.querySelector("body")&&null!==e.querySelector("received"):(e instanceof ao&&(e=e.attributes),e.received&&co.isEmptyMessage(e))},co.isChatRoom=function(e){return e&&"chatroom"===e.get("type")},co.isErrorObject=function(e){return e instanceof Error},co.isErrorStanza=function(e){return!!es(e)&&"error"===e.getAttribute("type")},co.isForbiddenError=function(e){return!!es(e)&&qr()('error[type="auth"] forbidden[xmlns="'.concat(zs.NS.STANZAS,'"]'),e).length>0},co.isServiceUnavailableError=function(e){return!!es(e)&&qr()('error[type="cancel"] service-unavailable[xmlns="'.concat(zs.NS.STANZAS,'"]'),e).length>0},co.merge=function e(t,n){for(const i in n)s(t[i])?e(t[i],n[i]):t[i]=n[i]},co.getOuterWidth=function(e,t=!1){let n=e.offsetWidth;if(!t)return n;const s=window.getComputedStyle(e);return n+=parseInt(s.marginLeft?s.marginLeft:0,10)+parseInt(s.marginRight?s.marginRight:0,10),n},co.stringToElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild},co.matchesSelector=function(e,t){const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return!!n&&n.call(e,t)},co.queryChildren=function(e,t){return Array.from(e.childNodes).filter((e=>co.matchesSelector(e,t)))},co.contains=function(e,t){const n=(e,n)=>e.get(n).toLowerCase().includes(t.toLowerCase());return function(t){if("object"==typeof e)return Object.keys(e).reduce(((e,s)=>e||n(t,s)),!1);if("string"==typeof e)return n(t,e);throw new TypeError("contains: wrong attribute type. Must be string or array.")}},co.isOfType=function(e,t){return t.get("type")==e},co.isInstance=function(e,t){return t instanceof e},co.getAttribute=function(e,t){return t.get(e)},co.contains.not=function(e,t){return function(n){return!co.contains(e,t)(n)}},co.rootContains=function(e,t){return e!==document||e.contains?e.contains?e.contains(t):window.HTMLElement.prototype.contains.call(e,t):document.head.contains(t)||document.body.contains(t)},co.createFragmentFromText=function(e){var t,n=document.createDocumentFragment(),s=document.createElement("body");for(s.innerHTML=e;t=s.firstChild;)n.appendChild(t);return n},co.isPersistableModel=function(e){return e.collection&&e.collection.browserStorage},co.getResolveablePromise=Et,co.getOpenPromise=Et,co.interpolate=function(e,t){return e.replace(/{{{([^{}]*)}}}/g,((e,n)=>{var s=t[n];return"string"==typeof s||"number"==typeof s?s:e}))},co.onMultipleEvents=function(e=[],t){let n=[];function s(s){n.push(s),e.length===n.length&&(t(n),n=[])}e.forEach((e=>e.object.on(e.event,s)))},co.safeSave=ho,co.siblingIndex=function(e){for(var t=0;e=e.previousElementSibling;t++);return t},co.getCurrentWord=function(e,t,n){t||(t=e.selectionEnd||void 0);let[s]=e.value.slice(0,t).split(/\s/).slice(-1);return n&&([s]=s.split(n).slice(-1)),s},co.isMentionBoundary=e=>"@"!==e&&RegExp("(\\p{Z}|\\p{P})","u").test(e),co.replaceCurrentWord=function(e,t){const n=e.selectionEnd||void 0,s=Br(e.value.slice(0,n).split(/\s/)),i=e.value,r=co.isMentionBoundary(s[0])?s[0]:"";e.value=i.slice(0,n-s.length)+r+"".concat(t," ")+i.slice(n);const o=n-s.length+t.length+1;e.selectionEnd=r?o+1:o},co.triggerEvent=function(e,t,n="Event",s=!0,i=!0){const r=document.createEvent(n);r.initEvent(t,s,i),e.dispatchEvent(r)},co.getSelectValues=function(e){const t=[],n=e&&e.options;for(var s=0,i=n.length;s<i;s++){const e=n[s];e.selected&&t.push(e.value||e.text)}return t},co.formatFingerprint=function(e){e=e.replace(/^05/,"");for(let t=1;t<8;t++){const n=8*t+t-1;e=e.slice(0,n)+" "+e.slice(n)}return e},co.appendArrayBuffer=function(e,t){const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer},co.arrayBufferToHex=function(e){return Array.prototype.map.call(new Uint8Array(e),(e=>("00"+e.toString(16)).slice(-2))).join("")},co.arrayBufferToString=function(e){return new TextDecoder("utf-8").decode(e)},co.stringToArrayBuffer=function(e){return new TextEncoder("utf-8").encode(e).buffer},co.arrayBufferToBase64=function(e){return btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),""))},co.base64ToArrayBuffer=function(e){const t=window.atob(e),n=t.length,s=new Uint8Array(n);for(let e=0;e<n;e++)s[e]=t.charCodeAt(e);return s.buffer},co.getRandomInt=function(e){return Math.floor(Math.random()*Math.floor(e))},co.placeCaretAtEnd=function(e){e!==document.activeElement&&e.focus();const t=2*e.value.length;setTimeout((()=>e.setSelectionRange(t,t)),1),this.scrollTop=999999},co.getUniqueId=function(e){const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));return"string"==typeof e||"number"==typeof e?t+":"+e:t},co.httpToGeoUri=function(e,t){return e.replace(t.api.settings.get("geouri_regex"),"geo:$1,$2")},co.waitUntil=function(e,t=300,n=3){try{const t=e();if(t)return Promise.resolve(t)}catch(e){return Promise.reject(e)}const s=Et(),i=new Error,r=setInterval((function(){try{const t=e();t&&(fo(o,r),s.resolve(t))}catch(e){fo(o,r),s.reject(e)}}),n),o=setTimeout((function(){fo(o,r);const e="Wait until promise timed out: \n\n".concat(i.stack);console.trace(),as.error(e),s.reject(new Error(e))}),t);return s};const go=co;let mo,po={},vo={};const bo={allow_non_roster_messaging:!1,allow_url_history_change:!0,assets_path:"/dist",authentication:"login",auto_login:!1,auto_reconnect:!0,blacklisted_plugins:[],clear_cache_on_logout:!1,connection_options:{},credentials_url:null,discover_connection_methods:!0,geouri_regex:/https\:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,geouri_replacement:"https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2",i18n:void 0,idle_presence_timeout:300,jid:void 0,keepalive:!0,loglevel:"info",locales:["af","ar","bg","ca","cs","da","de","el","eo","es","eu","en","fa","fi","fr","gl","he","hi","hu","id","it","ja","lt","nb","nl","mr","oc","pl","pt","pt_BR","ro","ru","sv","th","tr","uk","vi","zh_CN","zh_TW"],nickname:void 0,password:void 0,persistent_store:"localStorage",rid:void 0,root:window.document,sid:void 0,singleton:!1,strict_plugin_dependencies:!1,view_mode:"overlayed",websocket_url:void 0,whitelisted_plugins:[]};function yo(){var e;if(!So.bare_jid){const e="No JID to fetch user settings for";throw as.error(e),Error(e)}if(!(null===(e=mo)||void 0===e?void 0:e.fetched)){const e="converse.user-settings.".concat(So.bare_jid);mo=new ao({id:e}),Cr(mo,e),mo.fetched=mo.fetch({promise:!0})}return mo.fetched}async function _o(){return await yo(),mo}async function wo(e,t){return await yo(),mo.save(e,t)}const So={log:as,CONNECTION_STATUS:Bs,templates:{},promises:{initialized:Et()},STATUS_WEIGHTS:{offline:6,unavailable:5,xa:4,away:3,dnd:2,chat:1,online:1},ANONYMOUS:"anonymous",CLOSED:"closed",EXTERNAL:"external",LOGIN:"login",LOGOUT:"logout",OPENED:"opened",PREBIND:"prebind",STANZA_TIMEOUT:1e4,SUCCESS:"success",FAILURE:"failure",DEFAULT_IMAGE_TYPE:"image/svg+xml",DEFAULT_IMAGE:"PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+CiA8cmVjdCB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgZmlsbD0iIzU1NSIvPgogPGNpcmNsZSBjeD0iNjQiIGN5PSI0MSIgcj0iMjQiIGZpbGw9IiNmZmYiLz4KIDxwYXRoIGQ9Im0yOC41IDExMiB2LTEyIGMwLTEyIDEwLTI0IDI0LTI0IGgyMyBjMTQgMCAyNCAxMiAyNCAyNCB2MTIiIGZpbGw9IiNmZmYiLz4KPC9zdmc+Cg==",TIMEOUTS:{PAUSED:1e4,INACTIVE:9e4},INACTIVE:"inactive",ACTIVE:"active",COMPOSING:"composing",PAUSED:"paused",GONE:"gone",PRIVATE_CHAT_TYPE:"chatbox",CHATROOMS_TYPE:"chatroom",HEADLINES_TYPE:"headline",CONTROLBOX_TYPE:"controlbox",default_connection_options:{explicitResourceBinding:!0},router:new br,TimeoutError:xr,isTestEnv:()=>"montague.lit/http-bind"===po.bosh_service_url,getDefaultStore:jr,createStore:Ar,__:(...e)=>Zn.__(...e),___:e=>e};var xo=n(8734),Eo=n.n(xo),jo=n(7484),Ao=n.n(jo),Co=Math.max,ko=Math.min;const Oo=function(e,t,n){var i,r,o,a,c,l,u=0,d=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=i,s=r;return i=r=void 0,u=t,a=e.apply(s,n)}function m(e){return u=e,c=setTimeout(v,t),d?g(e):a}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=o}function v(){var e=gt();if(p(e))return b(e);c=setTimeout(v,function(e){var n=t-(e-l);return h?ko(n,o-(e-u)):n}(e))}function b(e){return c=void 0,f&&i?g(e):(i=r=void 0,a)}function y(){var e=gt(),n=p(e);if(i=arguments,r=this,l=e,n){if(void 0===c)return m(l);if(h)return clearTimeout(c),c=setTimeout(v,t),g(l)}return void 0===c&&(c=setTimeout(v,t)),a}return t=xt(t)||0,s(n)&&(d=!!n.leading,o=(h="maxWait"in n)?Co(xt(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==c&&clearTimeout(c),u=0,i=l=r=c=void 0},y.flush=function(){return void 0===c?a:b(gt())},y},To=function(e,t,n){t=Si(t,e);var s=null==(e=so(e,t))?e:e[xi(Br(t))];return null==s?void 0:Ze(s,e,n)},No=lt(To);var Io=n(7002);function Mo(e,t,n,s,...i){return"function"==typeof n&&(void 0===this.__super__&&(this.__super__=s),this.__super__[e]=n.bind(this)),t.apply(this,i)}class Ro{constructor(e,t){this.name=t,this.plugged=e,void 0===this.plugged.__super__?this.plugged.__super__={}:"string"==typeof this.plugged.__super__&&(this.plugged.__super__={__string__:this.plugged.__super__}),this.plugged.__super__[t]=this.plugged,this.plugins={},this.initialized_plugins=[]}_overrideAttribute(e,t){const n=t.overrides[e];if("function"==typeof n){const t={};t[this.name]=this.plugged;const s=this.plugged[e];this.plugged[e]=function(...i){return Mo.apply(this,[e,n,s,t,...i])}}else this.plugged[e]=n}_extendObject(e,t){e.prototype.__super__||(e.prototype.__super__={},e.prototype.__super__[this.name]=this.plugged);for(const[n,s]of Object.entries(t))if("events"===n)e.prototype[n]=Object.assign(s,e.prototype[n]);else if("function"==typeof s){const t={};t[this.name]=this.plugged;const i=e.prototype[n];e.prototype[n]=function(...e){return Mo.apply(this,[n,s,i,t,...e])}}else e.prototype[n]=s}loadPluginDependencies(e){var t;null===(t=e.dependencies)||void 0===t||t.forEach((t=>{const n=this.plugins[t];if(n){var s;if(null===(s=n.dependencies)||void 0===s?void 0:s.includes(e.__name__))throw'Found a circular dependency between the plugins "'+e.__name__+'" and "'+t+'"';this.initializePlugin(n)}else this.throwUndefinedDependencyError('Could not find dependency "'+t+'" for the plugin "'+e.__name__+"\". If it's needed, make sure it's loaded by require.js")}))}throwUndefinedDependencyError(e){if(this.plugged.strict_plugin_dependencies)throw e;console.warn?console.warn(e):console.log(e)}applyOverrides(e){Object.keys(e.overrides||{}).forEach((t=>{const n=e.overrides[t];"object"==typeof n?void 0===this.plugged[t]?this.throwUndefinedDependencyError('Plugin "'.concat(e.__name__,'" tried to override "').concat(t,"\" but it's not found.")):this._extendObject(this.plugged[t],n):this._overrideAttribute(t,e)}))}initializePlugin(e){var t;Object.keys(this.allowed_plugins).includes(e.__name__)&&(this.initialized_plugins.includes(e.__name__)||("boolean"==typeof e.enabled&&e.enabled||(null===(t=e.enabled)||void 0===t?void 0:t.call(e,this.plugged))||null==e.enabled)&&(Object.assign(e,this.properties),e.dependencies&&this.loadPluginDependencies(e),this.applyOverrides(e),"function"==typeof e.initialize&&e.initialize.bind(e)(this),this.initialized_plugins.push(e.__name__)))}registerPlugin(e,t){if(e in this.plugins)throw new Error("Error: Plugin name "+e+" is already taken");t.__name__=e,this.plugins[e]=t}initializePlugins(e={},t=[],n=[]){if(Object.keys(this.plugins).length){this.properties=e,this.allowed_plugins={};for(const[e,s]of Object.entries(this.plugins))t.length&&!t.includes(e)||n.includes(e)||(this.allowed_plugins[e]=s);Object.values(this.allowed_plugins).forEach((e=>this.initializePlugin(e)))}}}const Do=function(e,t,n){return void 0===n&&(n="pluginSocket"),void 0===t&&(t="plugged"),e[n]=new Ro(e,t),e};var zo=n(1063);const Lo=function(e,t,n,s){for(var i=-1,r=null==e?0:e.length;++i<r;){var o=e[i];t(s,o,n(o),e)}return s},Po=function(e,t,n,s){return Ii(e,(function(e,i,r){t(s,e,n(e),r)})),s},Fo=function(e,t){return function(n,s){var i=ve(n)?Lo:Po,r=t?t():{};return i(n,e,Ti(s),r)}};var Bo=Object.prototype.hasOwnProperty;const Uo=Fo((function(e,t,n){Bo.call(e,n)?++e[n]:V(e,n,1)})),qo=function(e,t,n,s){for(var i=e.length,r=n+(s?1:-1);s?r--:++r<i;)if(t(e[r],r,e))return r;return-1},Ho=function(e){return e!=e},$o=function(e,t,n){return t==t?function(e,t,n){for(var s=n-1,i=e.length;++s<i;)if(e[s]===t)return s;return-1}(e,t,n):qo(e,Ho,n)},Go=function(e,t){return!(null==e||!e.length)&&$o(e,t,0)>-1},Vo=function(e,t,n){for(var s=-1,i=null==e?0:e.length;++s<i;)if(n(t,e[s]))return!0;return!1},Wo=lt((function(e,t){return _e(e)?function(e,t,n,s){var i=-1,r=Go,o=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=vi(t,Ie(n))),s?(r=Vo,o=!1):t.length>=200&&(r=Gs,o=!1,t=new $s(t));e:for(;++i<a;){var u=e[i],d=null==n?u:n(u);if(u=s||0!==u?u:0,o&&d==d){for(var h=l;h--;)if(t[h]===d)continue e;c.push(u)}else r(t,d,s)||c.push(u)}return c}(e,Dr(t,1,_e,!0)):[]})),Jo=function(e,t){for(var n=-1,s=null==e?0:e.length;++n<s;)if(!t(e[n],n,e))return!1;return!0},Qo=function(e,t){var n=!0;return Ii(e,(function(e,s,i){return n=!!t(e,s,i)})),n};var Yo=Math.max;var Ko=Math.max,Xo=Math.min;var Zo=Object.prototype.hasOwnProperty;const ea=Fo((function(e,t,n){Zo.call(e,n)?e[n].push(t):V(e,n,[t])}));var ta=Math.max;const na=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var i=null==n?0:Fi(n);return i<0&&(i=ta(s+i,0)),$o(e,t,i)},sa=Fo((function(e,t,n){V(e,n,t)}));var ia=Math.max,ra=Math.min;const oa=function(e,t){if(e!==t){var n=void 0!==e,s=null===e,i=e==e,r=bt(e),o=void 0!==t,a=null===t,c=t==t,l=bt(t);if(!a&&!l&&!r&&e>t||r&&o&&c&&!a&&!l||s&&o&&c||!n&&c||!i)return 1;if(!s&&!r&&!l&&e<t||l&&n&&i&&!s&&!r||a&&n&&i||!o&&i||!c)return-1}return 0},aa=function(e,t,n){t=t.length?vi(t,(function(e){return ve(e)?function(t){return Ei(t,1===e.length?e[0]:e)}:e})):[Xe];var s=-1;return t=vi(t,Ie(Ti)),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(function(e,t){var n=-1,s=ye(e)?Array(e.length):[];return Ii(e,(function(e,i,r){s[++n]=t(e,i,r)})),s}(e,(function(e,n,i){return{criteria:vi(t,(function(t){return t(e)})),index:++s,value:e}})),(function(e,t){return function(e,t,n){for(var s=-1,i=e.criteria,r=t.criteria,o=i.length,a=n.length;++s<o;){var c=oa(i[s],r[s]);if(c)return s>=a?c:c*("desc"==n[s]?-1:1)}return e.index-t.index}(e,t,n)}))},ca=lt((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ut(e,t[0],t[1])?t=[]:n>2&&ut(t[0],t[1],t[2])&&(t=[t[0]]),aa(e,Dr(t,1),[])})),la=Array.prototype.slice,ua=function(e,t){t||(t={}),this.preinitialize.apply(this,arguments),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,Us({silent:!0},t))};ua.extend=ir;const da={add:!0,remove:!0,merge:!0},ha={add:!0,remove:!1},fa=function(e,t,n){n=Math.min(Math.max(n,0),e.length);const s=Array(e.length-n),i=t.length;let r;for(r=0;r<s.length;r++)s[r]=e[r+n];for(r=0;r<i;r++)e[r+n]=t[r];for(r=0;r<s.length;r++)e[r+i+n]=s[r]};Object.assign(ua.prototype,Hi,{model:ao,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map((function(t){return t.toJSON(e)}))},sync:function(e,t,n){return lr(this)(e,t,n)},add:function(e,t){return this.set(e,Us({merge:!1},t,ha))},remove:function(e,t){t=Us({},t);const n=!Array.isArray(e);e=n?[e]:e.slice();const s=this._removeModels(e,t);return!t.silent&&s.length&&(t.changes={added:[],merged:[],removed:s},this.trigger("update",this,t)),n?s[0]:s},set:function(e,t){if(null==e)return;(t=Us({},da,t)).parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);const n=!Array.isArray(e);e=n?[e]:e.slice();let s=t.at;null!=s&&(s=+s),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);const i=[],r=[],o=[],a=[],c={},l=t.add,u=t.merge,d=t.remove;let h=!1;const f=this.comparator&&null==s&&!1!==t.sort,g=_n(this.comparator)?this.comparator:null;let m,p;for(p=0;p<e.length;p++){m=e[p];const n=this.get(m);if(n){if(u&&m!==n){let e=this._isModel(m)?m.attributes:m;t.parse&&(e=n.parse(e,t)),n.set(e,t),o.push(n),f&&!h&&(h=n.hasChanged(g))}c[n.cid]||(c[n.cid]=!0,i.push(n)),e[p]=n}else l&&(m=e[p]=this._prepareModel(m,t),m&&(r.push(m),this._addReference(m,t),c[m.cid]=!0,i.push(m)))}if(d){for(p=0;p<this.length;p++)m=this.models[p],c[m.cid]||a.push(m);a.length&&this._removeModels(a,t)}let v=!1;const b=!f&&l&&d;if(i.length&&b?(v=this.length!==i.length||Di(this.models,((e,t)=>e!==i[t])),this.models.length=0,fa(this.models,i,0),this.length=this.models.length):r.length&&(f&&(h=!0),fa(this.models,r,null==s?this.length:s),this.length=this.models.length),h&&this.sort({silent:!0}),!t.silent){for(p=0;p<r.length;p++)null!=s&&(t.index=s+p),m=r[p],m.trigger("add",m,this,t);(h||v)&&this.trigger("sort",this,t),(r.length||a.length||o.length)&&(t.changes={added:r,removed:a,merged:o},this.trigger("update",this,t))}return n?e[0]:e},clearStore:async function(e={},t=(e=>e)){await Promise.all(this.models.filter(t).map((t=>new Promise((n=>{t.destroy(Object.assign(e,{success:n,error:(e,t)=>{console.error(t),n()}}))}))))),await this.browserStorage.clear(),this.reset()},reset:function(e,t){t=t?Hr(t):{};for(let e=0;e<this.models.length;e++)this._removeReference(this.models[e],t);return t.previousModels=this.models,this._reset(),e=this.add(e,Us({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,Us({at:this.length},t))},pop:function(e){const t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,Us({at:0},t))},shift:function(e){const t=this.at(0);return this.remove(t,e)},slice:function(){return la.apply(this.models,arguments)},filter:function(e,t){return this.models.filter(_(e)?e:t=>t.matches(e),t)},every:function(e){return function(e,t,n){var s=ve(e)?Jo:Qo;return n&&ut(e,t,n)&&(t=void 0),s(e,Ti(t))}(this.models.map((e=>e.attributes)),e)},difference:function(e){return Wo(this.models,e)},max:function(){return Math.max.apply(Math,this.models)},min:function(){return Math.min.apply(Math,this.models)},drop:function(e=1){return this.models.slice(e)},some:function(e){return Di(this.models.map((e=>e.attributes)),e)},sortBy:function(e){return ca(this.models,_(e)?e:t=>_n(e)?t.get(e):t.matches(e))},isEmpty:function(){return Li(this.models)},keyBy:function(e){return sa(this.models,e)},each:function(e,t){return this.forEach(e,t)},forEach:function(e,t){return this.models.forEach(e,t)},includes:function(e){return this.models.includes(e)},size:function(){return this.models.length},countBy:function(e){return Uo(this.models,_(e)?e:t=>_n(e)?t.get(e):t.matches(e))},groupBy:function(e){return ea(this.models,_(e)?e:t=>_n(e)?t.get(e):t.matches(e))},indexOf:function(e){return na(this.models,e)},findLastIndex:function(e,t){return function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var i=s-1;return void 0!==n&&(i=Fi(n),i=n<0?Ko(s+i,0):Xo(i,s-1)),qo(e,Ti(t),i,!0)}(this.models,_(e)?e:t=>_n(e)?t.get(e):t.matches(e),t)},lastIndexOf:function(e){return function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var i=s;return void 0!==n&&(i=(i=Fi(n))<0?ia(s+i,0):ra(i,s-1)),t==t?function(e,t,n){for(var s=n+1;s--;)if(e[s]===t)return s;return s}(e,t,i):qo(e,Ho,i,!0)}(this.models,e)},findIndex:function(e){return function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var i=null==n?0:Fi(n);return i<0&&(i=Yo(s+i,0)),qo(e,Ti(t),i)}(this.models,_(e)?e:t=>_n(e)?t.get(e):t.matches(e))},last:function(){const e=null==this.models?0:this.models.length;return e?this.models[e-1]:void 0},head:function(){return this.models[0]},first:function(){return this.head()},map:function(e,t){return this.models.map(_(e)?e:t=>_n(e)?t.get(e):t.matches(e),t)},reduce:function(e,t){return this.models.reduce(e,t||this.models[0])},reduceRight:function(e,t){return this.models.reduceRight(e,t||this.models[0])},toArray:function(){return Array.from(this.models)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(this._isModel(e)?e.attributes:e)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?"find":"filter"](e)},findWhere:function(e){return this.where(e,!0)},find:function(e,t){const n=_(e)?e:t=>t.matches(e);return this.models.find(n,t)},sort:function(e){let t=this.comparator;if(!t)throw new Error("Cannot sort a set without a comparator");e||(e={});const n=t.length;return _(t)&&(t=t.bind(this)),1===n||_n(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return this.map(e+"")},fetch:function(e){const t=(e=Us({parse:!0},e)).success,n=this,s=e.promise&&rr();return e.success=function(i){const r=e.reset?"reset":"set";n[r](i,e),t&&t.call(e.context,n,i,e),s&&s.resolve(),n.trigger("sync",n,i,e)},ar(this,e),s||this.sync("read",this,e)},create:function(e,t){const n=(t=t?Hr(t):{}).wait,s=t.promise,i=s&&rr();if(!(e=this._prepareModel(e,t)))return!1;n||this.add(e,t);const r=this,o=t.success,a=t.error;return t.success=function(e,t,a){n&&r.add(e,a),o&&o.call(a.context,e,t,a),s&&i.resolve(e)},t.error=function(e,t,n){a&&a.call(n.context,e,t,n),s&&i.reject(t)},e.save(null,Object.assign(t,{promise:!1})),s?i:e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){var t;return e[(null===(t=this.model.prototype)||void 0===t?void 0:t.idAttribute)||"id"]},values:function(){return new ma(this,pa)},keys:function(){return new ma(this,va)},entries:function(){return new ma(this,ba)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;(t=t?Hr(t):{}).collection=this;const n=new this.model(e,t);return n.validationError?(this.trigger("invalid",this,n.validationError,t),!1):n},_removeModels:function(e,t){const n=[];for(let s=0;s<e.length;s++){const i=this.get(e[s]);if(!i)continue;const r=this.indexOf(i);this.models.splice(r,1),this.length--,delete this._byId[i.cid];const o=this.modelId(i.attributes);null!=o&&delete this._byId[o],t.silent||(t.index=r,i.trigger("remove",i,this,t)),n.push(i),this._removeReference(i,t)}return n},_isModel:function(e){return e instanceof ao},_addReference:function(e,t){this._byId[e.cid]=e;const n=this.modelId(e.attributes);null!=n&&(this._byId[n]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];const n=this.modelId(e.attributes);null!=n&&delete this._byId[n],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,s){if(t){if(("add"===e||"remove"===e)&&n!==this)return;if("destroy"===e&&this.remove(t,s),"change"===e){const e=this.modelId(t.previousAttributes()),n=this.modelId(t.attributes);e!==n&&(null!=e&&delete this._byId[e],null!=n&&(this._byId[n]=t))}}this.trigger.apply(this,arguments)}});const ga="function"==typeof Symbol&&Symbol.iterator;ga&&(ua.prototype[ga]=ua.prototype.values);const ma=function(e,t){this._collection=e,this._kind=t,this._index=0},pa=1,va=2,ba=3;ga&&(ma.prototype[ga]=function(){return this}),ma.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){const e=this._collection.at(this._index);let t;if(this._index++,this._kind===pa)t=e;else{const n=this._collection.modelId(e.attributes);t=this._kind===va?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};class ya extends zs.Connection{constructor(e,t){super(e,t),this.debouncedReconnect=Oo(this.reconnect,2e3)}static generateResource(){return"/converse.js-".concat(Math.floor(139749528*Math.random()).toString())}async bind(){await Cc.trigger("beforeResourceBinding",{synchronous:!0}),super.bind()}async onDomainDiscovered(e){const t=await e.text(),n=(new window.DOMParser).parseFromString(t,"text/xml").firstElementChild;if("XRD"!=n.nodeName||"http://docs.oasis-open.org/ns/xri/xrd-1.0"!=n.namespaceURI)return as.warn("Could not discover XEP-0156 connection methods");const s=qr()('Link[rel="urn:xmpp:alt-connections:xbosh"]',n),i=qr()('Link[rel="urn:xmpp:alt-connections:websocket"]',n),r=s.map((e=>e.getAttribute("href"))),o=i.map((e=>e.getAttribute("href")));0===r.length&&0===o.length?as.warn("Neither BOSH nor WebSocket connection methods have been specified with XEP-0156."):(Cc.settings.set("websocket_url",o.pop()),Cc.settings.set("bosh_service_url",r.pop()),this.service=Cc.settings.get("websocket_url")||Cc.settings.get("bosh_service_url"),this.setProtocol())}async discoverConnectionMethods(e){const t={mode:"cors",headers:{Accept:"application/xrd+xml, text/xml"}},n="https://".concat(e,"/.well-known/host-meta");let s;try{s=await fetch(n,t)}catch(e){return as.error("Failed to discover alternative connection methods at ".concat(n)),void as.error(e)}s.status>=200&&s.status<400?await this.onDomainDiscovered(s):as.warn("Could not discover XEP-0156 connection methods")}async connect(e,t,n){if(Cc.settings.get("discover_connection_methods")){const t=zs.getDomainFromJid(e);await this.discoverConnectionMethods(t)}super.connect(e,t,n||this.onConnectStatusChanged,59)}async reconnect(){const{__:e}=So;return as.debug("RECONNECTING: the connection has dropped, attempting to reconnect."),this.setConnectionStatus(zs.Status.RECONNECTING,e("The connection has dropped, attempting to reconnect.")),Cc.trigger("will-reconnect"),this.reconnecting=!0,await kc(),Cc.user.login()}async onConnected(e){delete this.reconnecting,this.flush(),await So.setUserJID(this.jid),await Cc.trigger("afterResourceBinding",e,{synchronous:!0}),e?Cc.trigger("reconnected"):Cc.trigger("connected")}setDisconnectionCause(e,t,n){void 0===e?(delete this.disconnection_cause,delete this.disconnection_reason):(void 0===this.disconnection_cause||n)&&(this.disconnection_cause=e,this.disconnection_reason=t)}setConnectionStatus(e,t){this.status=e,So.connfeedback.set({connection_status:e,message:t})}async finishDisconnection(){as.debug("DISCONNECTED"),delete this.reconnecting,this.reset(),kc(),await Tc(),delete So.connection,Cc.trigger("disconnected")}onDisconnected(){if(!Cc.settings.get("auto_reconnect"))return this.finishDisconnection();{const e=this.disconnection_reason;if(this.disconnection_cause===zs.Status.AUTHFAIL)return Cc.settings.get("credentials_url")||Cc.settings.get("authentication")===So.ANONYMOUS?Cc.connection.reconnect():this.finishDisconnection();if(this.disconnection_cause===So.LOGOUT||e===zs.ErrorCondition.NO_AUTH_MECH||"host-unknown"===e||"remote-connection-failed"===e)return this.finishDisconnection();Cc.connection.reconnect()}}onConnectStatusChanged(e,t){const{__:n}=So;var s;if(as.debug("Status changed to: ".concat(So.CONNECTION_STATUS[e])),e===zs.Status.ATTACHFAIL)this.setConnectionStatus(e),null===(s=this.worker_attach_promise)||void 0===s||s.resolve(!1);else if(e===zs.Status.CONNECTED||e===zs.Status.ATTACHED){var i,r;if((null===(i=this.worker_attach_promise)||void 0===i?void 0:i.isResolved)&&this.status===zs.Status.ATTACHED)return;this.setConnectionStatus(e),null===(r=this.worker_attach_promise)||void 0===r||r.resolve(!0),So.send_initial_presence=!0,this.setDisconnectionCause(),this.reconnecting?(as.debug(e===zs.Status.CONNECTED?"Reconnected":"Reattached"),this.onConnected(!0)):(as.debug(e===zs.Status.CONNECTED?"Connected":"Attached"),this.restored&&(So.send_initial_presence=!1),this.onConnected())}else if(e===zs.Status.DISCONNECTED)this.setDisconnectionCause(e,t),this.onDisconnected();else if(e===zs.Status.BINDREQUIRED)this.bind();else if(e===zs.Status.ERROR)this.setConnectionStatus(e,n("An error occurred while connecting to the chat server."));else if(e===zs.Status.CONNECTING)this.setConnectionStatus(e);else if(e===zs.Status.AUTHENTICATING)this.setConnectionStatus(e);else if(e===zs.Status.AUTHFAIL)t||(t=n("Your XMPP address and/or password is incorrect. Please try again.")),this.setConnectionStatus(e,t),this.setDisconnectionCause(e,t,!0),this.onDisconnected();else if(e===zs.Status.CONNFAIL){var o;let s=t;"host-unknown"===t||"remote-connection-failed"==t?s=n("Sorry, we could not connect to the XMPP host with domain: %1$s",'"'.concat(zs.getDomainFromJid(this.jid),'"')):void 0!==t&&t===(null==zs||null===(o=zs.ErrorCondition)||void 0===o?void 0:o.NO_AUTH_MECH)&&(s=n("The XMPP server did not offer a supported authentication mechanism")),this.setConnectionStatus(e,s),this.setDisconnectionCause(e,t)}else e===zs.Status.DISCONNECTING&&this.setDisconnectionCause(e,t)}isType(e){return"websocket"===e.toLowerCase()?this._proto instanceof zs.Websocket:"bosh"===e.toLowerCase()?zs.Bosh&&this._proto instanceof zs.Bosh:void 0}hasResumed(){var e;return(null===(e=Cc.settings.get("connection_options"))||void 0===e?void 0:e.worker)||this.isType("bosh")?So.connfeedback.get("connection_status")===zs.Status.ATTACHED:!this.do_bind}restoreWorkerSession(){return this.attach(this.onConnectStatusChanged),this.worker_attach_promise=Et(),this.worker_attach_promise}}class _a extends ya{constructor(e,t){super(e,t),this.sent_stanzas=[],this.IQ_stanzas=[],this.IQ_ids=[],this.features=zs.xmlHtmlNode('<stream:features xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"><ver xmlns="urn:xmpp:features:rosterver"/><csi xmlns="urn:xmpp:csi:0"/><this xmlns="http://jabber.org/protocol/caps" ver="UwBpfJpEt3IoLYfWma/o/p3FFRo=" hash="sha-1" node="http://prosody.im"/><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><required/></bind><sm xmlns=\'urn:xmpp:sm:3\'/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"><optional/></session></stream:features>').firstChild,this._proto._processRequest=()=>{},this._proto._disconnect=()=>this._onDisconnectTimeout(),this._proto._onDisconnectTimeout=()=>{},this._proto._connect=()=>{this.connected=!0,this.mock=!0,this.jid="romeo@montague.lit/orchard",this._changeConnectStatus(zs.Status.BINDREQUIRED)}}_processRequest(){}sendIQ(e,t,n){es(e)||(e=e.nodeTree),this.IQ_stanzas.push(e);const s=super.sendIQ(e,t,n);return this.IQ_ids.push(s),s}send(e){return es(e)?this.sent_stanzas.push(e):this.sent_stanzas.push(e.nodeTree),super.send(e)}async bind(){await Cc.trigger("beforeResourceBinding",{synchronous:!0}),this.authenticated=!0,So.no_connection_on_bind||this._changeConnectStatus(zs.Status.CONNECTED)}}var wa,Sa,xa,Ea;const ja=globalThis.trustedTypes,Aa=ja?ja.createPolicy("lit-html",{createHTML:e=>e}):void 0,Ca="lit$".concat((Math.random()+"").slice(9),"$"),ka="?"+Ca,Oa="<".concat(ka,">"),Ta=document,Na=(e="")=>Ta.createComment(e),Ia=e=>null===e||"object"!=typeof e&&"function"!=typeof e,Ma=Array.isArray,Ra=e=>{var t;return Ma(e)||"function"==typeof(null===(t=e)||void 0===t?void 0:t[Symbol.iterator])},Da=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,za=/-->/g,La=/>/g,Pa=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,Fa=/'/g,Ba=/"/g,Ua=/^(?:script|style|textarea)$/i,qa=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Ha=qa(1),$a=(qa(2),Symbol.for("lit-noChange")),Ga=Symbol.for("lit-nothing"),Va=new WeakMap,Wa=(e,t,n)=>{var s,i;const r=null!==(s=null==n?void 0:n.renderBefore)&&void 0!==s?s:t;let o=r._$litPart$;if(void 0===o){const e=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;r._$litPart$=o=new Za(t.insertBefore(Na(),e),e,void 0,n)}return o.I(e),o},Ja=Ta.createTreeWalker(Ta,129,null,!1),Qa=(e,t)=>{const n=e.length-1,s=[];let i,r=2===t?"<svg>":"",o=Da;for(let t=0;t<n;t++){const n=e[t];let a,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),null!==c);)u=o.lastIndex,o===Da?"!--"===c[1]?o=za:void 0!==c[1]?o=La:void 0!==c[2]?(Ua.test(c[2])&&(i=RegExp("</"+c[2],"g")),o=Pa):void 0!==c[3]&&(o=Pa):o===Pa?">"===c[0]?(o=null!=i?i:Da,l=-1):void 0===c[1]?l=-2:(l=o.lastIndex-c[2].length,a=c[1],o=void 0===c[3]?Pa:'"'===c[3]?Ba:Fa):o===Ba||o===Fa?o=Pa:o===za||o===La?o=Da:(o=Pa,i=void 0);const d=o===Pa&&e[t+1].startsWith("/>")?" ":"";r+=o===Da?n+Oa:l>=0?(s.push(a),n.slice(0,l)+"$lit$"+n.slice(l)+Ca+d):n+Ca+(-2===l?(s.push(void 0),t):d)}const a=r+(e[n]||"<?>")+(2===t?"</svg>":"");return[void 0!==Aa?Aa.createHTML(a):a,s]};class Ya{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let i=0,r=0;const o=e.length-1,a=this.parts,[c,l]=Qa(e,t);if(this.el=Ya.createElement(c,n),Ja.currentNode=this.el.content,2===t){const e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(s=Ja.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const e=[];for(const t of s.getAttributeNames())if(t.endsWith("$lit$")||t.startsWith(Ca)){const n=l[r++];if(e.push(t),void 0!==n){const e=s.getAttribute(n.toLowerCase()+"$lit$").split(Ca),t=/([.?@])?(.*)/.exec(n);a.push({type:1,index:i,name:t[2],strings:e,ctor:"."===t[1]?tc:"?"===t[1]?nc:"@"===t[1]?sc:ec})}else a.push({type:6,index:i})}for(const t of e)s.removeAttribute(t)}if(Ua.test(s.tagName)){const e=s.textContent.split(Ca),t=e.length-1;if(t>0){s.textContent=ja?ja.emptyScript:"";for(let n=0;n<t;n++)s.append(e[n],Na()),Ja.nextNode(),a.push({type:2,index:++i});s.append(e[t],Na())}}}else if(8===s.nodeType)if(s.data===ka)a.push({type:2,index:i});else{let e=-1;for(;-1!==(e=s.data.indexOf(Ca,e+1));)a.push({type:7,index:i}),e+=Ca.length-1}i++}}static createElement(e,t){const n=Ta.createElement("template");return n.innerHTML=e,n}}function Ka(e,t,n=e,s){var i,r,o,a;if(t===$a)return t;let c=void 0!==s?null===(i=n.Σi)||void 0===i?void 0:i[s]:n.Σo;const l=Ia(t)?void 0:t._$litDirective$;return(null==c?void 0:c.constructor)!==l&&(null===(r=null==c?void 0:c.O)||void 0===r||r.call(c,!1),void 0===l?c=void 0:(c=new l(e),c.T(e,n,s)),void 0!==s?(null!==(o=(a=n).Σi)&&void 0!==o?o:a.Σi=[])[s]=c:n.Σo=c),void 0!==c&&(t=Ka(e,c.S(e,t.values),c,s)),t}class Xa{constructor(e,t){this.l=[],this.N=void 0,this.D=e,this.M=t}u(e){var t;const{el:{content:n},parts:s}=this.D,i=(null!==(t=null==e?void 0:e.creationScope)&&void 0!==t?t:Ta).importNode(n,!0);Ja.currentNode=i;let r=Ja.nextNode(),o=0,a=0,c=s[0];for(;void 0!==c;){if(o===c.index){let t;2===c.type?t=new Za(r,r.nextSibling,this,e):1===c.type?t=new c.ctor(r,c.name,c.strings,this,e):6===c.type&&(t=new ic(r,this,e)),this.l.push(t),c=s[++a]}o!==(null==c?void 0:c.index)&&(r=Ja.nextNode(),o++)}return i}v(e){let t=0;for(const n of this.l)void 0!==n&&(void 0!==n.strings?(n.I(e,n,t),t+=n.strings.length-2):n.I(e[t])),t++}}class Za{constructor(e,t,n,s){this.type=2,this.N=void 0,this.A=e,this.B=t,this.M=n,this.options=s}setConnected(e){var t;null===(t=this.P)||void 0===t||t.call(this,e)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(e,t=this){e=Ka(this,e,t),Ia(e)?e===Ga||null==e||""===e?(this.H!==Ga&&this.R(),this.H=Ga):e!==this.H&&e!==$a&&this.m(e):void 0!==e._$litType$?this._(e):void 0!==e.nodeType?this.$(e):Ra(e)?this.g(e):this.m(e)}k(e,t=this.B){return this.A.parentNode.insertBefore(e,t)}$(e){this.H!==e&&(this.R(),this.H=this.k(e))}m(e){const t=this.A.nextSibling;null!==t&&3===t.nodeType&&(null===this.B?null===t.nextSibling:t===this.B.previousSibling)?t.data=e:this.$(Ta.createTextNode(e)),this.H=e}_(e){var t;const{values:n,_$litType$:s}=e,i="number"==typeof s?this.C(e):(void 0===s.el&&(s.el=Ya.createElement(s.h,this.options)),s);if((null===(t=this.H)||void 0===t?void 0:t.D)===i)this.H.v(n);else{const e=new Xa(i,this),t=e.u(this.options);e.v(n),this.$(t),this.H=e}}C(e){let t=Va.get(e.strings);return void 0===t&&Va.set(e.strings,t=new Ya(e)),t}g(e){Ma(this.H)||(this.H=[],this.R());const t=this.H;let n,s=0;for(const i of e)s===t.length?t.push(n=new Za(this.k(Na()),this.k(Na()),this,this.options)):n=t[s],n.I(i),s++;s<t.length&&(this.R(n&&n.B.nextSibling,s),t.length=s)}R(e=this.A.nextSibling,t){var n;for(null===(n=this.P)||void 0===n||n.call(this,!1,!0,t);e&&e!==this.B;){const t=e.nextSibling;e.remove(),e=t}}}class ec{constructor(e,t,n,s,i){this.type=1,this.H=Ga,this.N=void 0,this.V=void 0,this.element=e,this.name=t,this.M=s,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this.H=Array(n.length-1).fill(Ga),this.strings=n):this.H=Ga}get tagName(){return this.element.tagName}I(e,t=this,n,s){const i=this.strings;let r=!1;if(void 0===i)e=Ka(this,e,t,0),r=!Ia(e)||e!==this.H&&e!==$a,r&&(this.H=e);else{const s=e;let o,a;for(e=i[0],o=0;o<i.length-1;o++)a=Ka(this,s[n+o],t,o),a===$a&&(a=this.H[o]),r||(r=!Ia(a)||a!==this.H[o]),a===Ga?e=Ga:e!==Ga&&(e+=(null!=a?a:"")+i[o+1]),this.H[o]=a}r&&!s&&this.W(e)}W(e){e===Ga?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=e?e:"")}}class tc extends ec{constructor(){super(...arguments),this.type=3}W(e){this.element[this.name]=e===Ga?void 0:e}}class nc extends ec{constructor(){super(...arguments),this.type=4}W(e){e&&e!==Ga?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class sc extends ec{constructor(){super(...arguments),this.type=5}I(e,t=this){var n;if((e=null!==(n=Ka(this,e,t,0))&&void 0!==n?n:Ga)===$a)return;const s=this.H,i=e===Ga&&s!==Ga||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==Ga&&(s===Ga||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this.H=e}handleEvent(e){var t,n;"function"==typeof this.H?this.H.call(null!==(n=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==n?n:this.element,e):this.H.handleEvent(e)}}class ic{constructor(e,t,n){this.element=e,this.type=6,this.N=void 0,this.V=void 0,this.M=t,this.options=n}I(e){Ka(this,e)}}const rc={Z:"$lit$",U:Ca,Y:ka,q:1,X:Qa,tt:Xa,it:Ra,st:Ka,et:Za,ot:ec,nt:nc,rt:sc,lt:tc,ht:ic};null===(Sa=(wa=globalThis).litHtmlPlatformSupport)||void 0===Sa||Sa.call(wa,Ya,Za),(null!==(xa=(Ea=globalThis).litHtmlVersions)&&void 0!==xa?xa:Ea.litHtmlVersions=[]).push("2.0.0-rc.3");const oc=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ac=Symbol();class cc{constructor(e,t){if(t!==ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return oc&&void 0===this.t&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const lc=new Map,uc=oc?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return(e=>new cc(e+"",ac))(t)})(e):e;var dc,hc,fc,gc;const mc={toAttribute(e,t){switch(t){case Boolean:e=e?"":null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=null!==e;break;case Number:n=null===e?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch(e){n=null}}return n}},pc=(e,t)=>t!==e&&(t==t||e==e),vc={attribute:!0,type:String,converter:mc,reflect:!1,hasChanged:pc};class bc extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u()}static addInitializer(e){var t;null!==(t=this.v)&&void 0!==t||(this.v=[]),this.v.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach(((t,n)=>{const s=this.Πp(n,t);void 0!==s&&(this.Πm.set(s,n),e.push(s))})),e}static createProperty(e,t=vc){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n="symbol"==typeof e?Symbol():"__"+e,s=this.getPropertyDescriptor(e,n,t);void 0!==s&&Object.defineProperty(this.prototype,e,s)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(s){const i=this[e];this[t]=s,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||vc}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const n of t)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const e of n)t.unshift(uc(e))}else void 0!==e&&t.push(uc(e));return t}static Πp(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this.Πg=new Promise((e=>this.enableUpdating=e)),this.L=new Map,this.Π_(),this.requestUpdate(),null===(e=this.constructor.v)||void 0===e||e.forEach((e=>e(this)))}addController(e){var t,n;(null!==(t=this.ΠU)&&void 0!==t?t:this.ΠU=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(n=e.hostConnected)||void 0===n||n.call(e))}removeController(e){var t;null===(t=this.ΠU)||void 0===t||t.splice(this.ΠU.indexOf(e)>>>0,1)}Π_(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this.Πi.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;const t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{oc?e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):t.forEach((t=>{const n=document.createElement("style");n.textContent=t.cssText,e.appendChild(n)}))})(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this.ΠU)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0)}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this.ΠU)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})),this.Πo=new Promise((e=>this.Πl=e))}attributeChangedCallback(e,t,n){this.K(e,n)}Πj(e,t,n=vc){var s,i;const r=this.constructor.Πp(e,n);if(void 0!==r&&!0===n.reflect){const o=(null!==(i=null===(s=n.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==i?i:mc.toAttribute)(t,n.type);this.Πh=e,null==o?this.removeAttribute(r):this.setAttribute(r,o),this.Πh=null}}K(e,t){var n,s,i;const r=this.constructor,o=r.Πm.get(e);if(void 0!==o&&this.Πh!==o){const e=r.getPropertyOptions(o),a=e.converter,c=null!==(i=null!==(s=null===(n=a)||void 0===n?void 0:n.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==i?i:mc.fromAttribute;this.Πh=o,this[o]=c(t,e.type),this.Πh=null}}requestUpdate(e,t,n){let s=!0;void 0!==e&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||pc)(this[e],t)?(this.L.has(e)||this.L.set(e,t),!0===n.reflect&&this.Πh!==e&&(void 0===this.Πk&&(this.Πk=new Map),this.Πk.set(e,n))):s=!1),!this.isUpdatePending&&s&&(this.Πg=this.Πq())}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo}catch(e){Promise.reject(e)}const e=this.performUpdate();return null!=e&&await e,!this.isUpdatePending}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach(((e,t)=>this[t]=e)),this.Πi=void 0);let t=!1;const n=this.L;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),null===(e=this.ΠU)||void 0===e||e.forEach((e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)})),this.update(n)):this.Π$()}catch(e){throw t=!1,this.Π$(),e}t&&this.E(n)}willUpdate(e){}E(e){var t;null===(t=this.ΠU)||void 0===t||t.forEach((e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}Π$(){this.L=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(e){return!0}update(e){void 0!==this.Πk&&(this.Πk.forEach(((e,t)=>this.Πj(t,this[t],e))),this.Πk=void 0),this.Π$()}updated(e){}firstUpdated(e){}}var yc,_c,wc,Sc,xc,Ec;bc.finalized=!0,bc.shadowRootOptions={mode:"open"},null===(hc=(dc=globalThis).reactiveElementPlatformSupport)||void 0===hc||hc.call(dc,{ReactiveElement:bc}),(null!==(fc=(gc=globalThis).reactiveElementVersions)&&void 0!==fc?fc:gc.reactiveElementVersions=[]).push("1.0.0-rc.1"),(null!==(yc=(Ec=globalThis).litElementVersions)&&void 0!==yc?yc:Ec.litElementVersions=[]).push("3.0.0-rc.1");class jc extends bc{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var e,t;const n=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=n.firstChild),n}update(e){const t=this.render();super.update(e),this.Φt=Wa(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this.Φt)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.Φt)||void 0===e||e.setConnected(!1)}render(){return $a}}jc.finalized=!0,jc._$litElement$=!0,null===(wc=(_c=globalThis).litElementHydrateSupport)||void 0===wc||wc.call(_c,{LitElement:jc}),null===(xc=(Sc=globalThis).litElementPlatformSupport)||void 0===xc||xc.call(Sc,{LitElement:jc}),Ao().extend(Eo()),zs.addNamespace("CARBONS","urn:xmpp:carbons:2"),zs.addNamespace("CHATSTATES","http://jabber.org/protocol/chatstates"),zs.addNamespace("CSI","urn:xmpp:csi:0"),zs.addNamespace("DELAY","urn:xmpp:delay"),zs.addNamespace("FASTEN","urn:xmpp:fasten:0"),zs.addNamespace("FORWARD","urn:xmpp:forward:0"),zs.addNamespace("HINTS","urn:xmpp:hints"),zs.addNamespace("HTTPUPLOAD","urn:xmpp:http:upload:0"),zs.addNamespace("IDLE","urn:xmpp:idle:1"),zs.addNamespace("MAM","urn:xmpp:mam:2"),zs.addNamespace("MARKERS","urn:xmpp:chat-markers:0"),zs.addNamespace("MENTIONS","urn:xmpp:mmn:0"),zs.addNamespace("MESSAGE_CORRECT","urn:xmpp:message-correct:0"),zs.addNamespace("MODERATE","urn:xmpp:message-moderate:0"),zs.addNamespace("NICK","http://jabber.org/protocol/nick"),zs.addNamespace("OMEMO","eu.siacs.conversations.axolotl"),zs.addNamespace("OUTOFBAND","jabber:x:oob"),zs.addNamespace("PUBSUB","http://jabber.org/protocol/pubsub"),zs.addNamespace("RAI","urn:xmpp:rai:0"),zs.addNamespace("RECEIPTS","urn:xmpp:receipts"),zs.addNamespace("REFERENCE","urn:xmpp:reference:0"),zs.addNamespace("REGISTER","jabber:iq:register"),zs.addNamespace("RETRACT","urn:xmpp:message-retract:0"),zs.addNamespace("ROSTERX","http://jabber.org/protocol/rosterx"),zs.addNamespace("RSM","http://jabber.org/protocol/rsm"),zs.addNamespace("SID","urn:xmpp:sid:0"),zs.addNamespace("SPOILER","urn:xmpp:spoiler:0"),zs.addNamespace("STANZAS","urn:ietf:params:xml:ns:xmpp-stanzas"),zs.addNamespace("STYLING","urn:xmpp:styling:0"),zs.addNamespace("VCARD","vcard-temp"),zs.addNamespace("VCARDUPDATE","vcard-temp:x:update"),zs.addNamespace("XFORM","jabber:x:data"),zs.addNamespace("XHTML","http://www.w3.org/1999/xhtml");const Ac=["converse-adhoc","converse-bookmarks","converse-bosh","converse-caps","converse-carbons","converse-chat","converse-chatboxes","converse-disco","converse-emoji","converse-headlines","converse-mam","converse-muc","converse-ping","converse-pubsub","converse-roster","converse-smacks","converse-status","converse-vcard"];So.VERSION_NAME="v7.0.3dev",Object.assign(So,Hi),Do(So,"_converse","pluggable");const Cc=So.api={connection:{connected(){var e;return(null==So||null===(e=So.connection)||void 0===e?void 0:e.connected)&&!0},disconnect(){So.connection&&So.connection.disconnect()},async reconnect(){var e;const t=So.connfeedback.get("connection_status");if(Cc.settings.get("authentication")===So.ANONYMOUS&&(await kc(),await Tc()),t===zs.Status.CONNFAIL?Cc.connection.isType("websocket")&&Cc.settings.get("bosh_service_url")?(await So.setUserJID(So.bare_jid),So.connection._proto._doDisconnect(),So.connection._proto=new zs.Bosh(So.connection),So.connection.service=Cc.settings.get("bosh_service_url")):Cc.connection.isType("bosh")&&Cc.settings.get("websocket_url")&&(Cc.settings.get("authentication")===So.ANONYMOUS?await So.setUserJID(Cc.settings.get("jid")):await So.setUserJID(So.bare_jid),So.connection._proto._doDisconnect(),So.connection._proto=new zs.Websocket(So.connection),So.connection.service=Cc.settings.get("websocket_url")):t===zs.Status.AUTHFAIL&&Cc.settings.get("authentication")===So.ANONYMOUS&&await So.setUserJID(Cc.settings.get("jid")),!(null===(e=So.connection)||void 0===e?void 0:e.reconnecting))return So.connection.reconnect();So.connection.debouncedReconnect()},isType:e=>So.connection.isType(e)},async trigger(e){if(!So._events)return;const t=Array.from(arguments),n=t.pop();if(n&&n.synchronous){const n=So._events[e]||[],s=t.splice(1);await Promise.all(n.map((e=>e.callback.apply(e.ctx,s))))}else So.trigger.apply(So,arguments);const s=So.promises[e];void 0!==s&&s.resolve()},hook(e,t,n){const s=So._events[e]||[];if(s.length){const e=s.reduce(((e,n)=>e.then((e=>n.callback(t,e)))),Promise.resolve(n));return e.catch((e=>{throw as.error(e),e})),e}return n},user:{jid:()=>So.connection.jid,async login(e,t,n=!1){var s,i;if(e=e||So.jid,(!(null===(s=So.connection)||void 0===s?void 0:s.jid)||e&&!go.isSameDomain(So.connection.jid,e))&&await So.initConnection(),(null===(i=Cc.settings.get("connection_options"))||void 0===i?void 0:i.worker)&&await So.connection.restoreWorkerSession())return;e&&(e=await So.setUserJID(e));const r=So.pluggable.plugins["converse-bosh"];if(r&&r.enabled()){if(await So.restoreBOSHSession())return;if(Cc.settings.get("authentication")===So.PREBIND&&(!n||Cc.settings.get("auto_login")))return So.startNewPreboundBOSHSession()}t=t||Cc.settings.get("password"),async function(e,t){const{api:n}=So;n.settings.get("authentication")===So.LOGIN?e?Oc(e):So.api.settings.get("credentials_url")?Oc(await async function(){let e,t=0;for(;!e;){try{e=await Ic(t)}catch(e){as.error("Could not fetch login credentials"),as.error(e)}t=2e3}return e}()):So.jid&&(So.api.settings.get("password")||So.connection.pass)?Oc():!So.isTestEnv()&&"credentials"in navigator?Oc(await async function(){try{const e=await navigator.credentials.get({password:!0});if(e&&"password"==e.type&&go.isValidJID(e.id))return await So.setUserJID(e.id),{jid:e.id,password:e.password}}catch(e){as.error(e)}}()):!So.isTestEnv()&&as.warn("attemptNonPreboundSession: Couldn't find credentials to log in with"):![So.ANONYMOUS,So.EXTERNAL].includes(So.api.settings.get("authentication"))||t&&!So.api.settings.get("auto_login")||Oc()}(e&&t?{jid:e,password:t}:null,n)},async logout(){await Cc.trigger("beforeLogout",{synchronous:!0});const e=Et(),t=()=>{Object.keys(So.promises).forEach(kr),delete So.jid,Cc.trigger("logout"),e.resolve()};return So.connection.setDisconnectionCause(So.LOGOUT,void 0,!0),void 0!==So.connection?(Cc.listen.once("disconnected",(()=>t())),So.connection.disconnect()):t(),e},settings:{getModel:()=>_o(),async get(e,t){const n=await _o();return void 0===n.get(e)?t:n.get(e)},set(e,t){if(s(e))return wo(e,{promise:!0});{const n={};return n[e]=t,wo(n,{promise:!0})}},clear:()=>async function(){return await yo(),mo.clear()}()}},settings:{extend:e=>function(e){go.merge(bo,e);const t=Object.keys(Pr(e,Object.keys(bo))),n=Pr(po,t),s=Us(Pr(e,t),n);go.merge(vo,s),go.merge(So,s)}(e),update(e){return as.warn("The api.settings.update method has been deprecated and will be removed. Please use api.settings.extend instead."),this.extend(e)},get:e=>function(e){if(Object.keys(bo).includes(e))return vo[e]}(e),set(e,t){!function(e,t){const n={};s(e)?(Us(So,Pr(e,Object.keys(bo))),Us(vo,Pr(e,Object.keys(bo)))):"string"==typeof e&&(n[e]=t,Us(So,Pr(n,Object.keys(bo))),Us(vo,Pr(n,Object.keys(bo))))}(e,t)}},promises:{add(e,t=!0){(e=Array.isArray(e)?e:[e]).forEach((e=>{const n=Et();n.replace=t,So.promises[e]=n}))}},listen:{once:So.once.bind(So),on:So.on.bind(So),not:So.off.bind(So),stanza(e,t,n){_(t)?(n=t,t={}):t=t||{},So.connection.addHandler(n,t.ns,e,t.type,t.id,t.from,t)}},waitUntil(e){if(_(e))return go.waitUntil(e);{const t=So.promises[e];return void 0===t?null:t}},send(e){var t;return Cc.connection.connected()?("string"==typeof e?e=go.toStanza(e):(null===(t=e)||void 0===t?void 0:t.nodeTree)&&(e=e.nodeTree),"iq"===e.tagName?Cc.sendIQ(e):(So.connection.send(e),void Cc.trigger("send",e))):(as.warn("Not sending stanza because we're not connected!"),void as.warn(zs.serialize(e)))},sendIQ(e,t=So.STANZA_TIMEOUT,n=!0){var s,i;let r;return e=null!==(s=null===(i=e)||void 0===i?void 0:i.nodeTree)&&void 0!==s?s:e,["get","set"].includes(e.getAttribute("type"))?(t=t||So.STANZA_TIMEOUT,n?(r=new Promise(((n,s)=>So.connection.sendIQ(e,n,s,t))),r.catch((n=>{if(null===n)throw new xr("Timeout error after ".concat(t,"ms for the following IQ stanza: ").concat(zs.serialize(e)))}))):r=new Promise((n=>So.connection.sendIQ(e,n,n,t)))):(So.connection.sendIQ(e),r=Promise.resolve()),Cc.trigger("send",e),r}};async function kc(){return await So.api.trigger("beforeTearDown",{synchronous:!0}),window.removeEventListener("click",So.onUserActivity),window.removeEventListener("focus",So.onUserActivity),window.removeEventListener("keypress",So.onUserActivity),window.removeEventListener("mousemove",So.onUserActivity),window.removeEventListener(So.unloadevent,So.onUserActivity),window.clearInterval(So.everySecondTrigger),So.api.trigger("afterTearDown"),So}function Oc(e){if([So.ANONYMOUS,So.EXTERNAL].includes(So.api.settings.get("authentication"))){if(!So.jid)throw new Error("Config Error: when using anonymous login you need to provide the server's domain via the 'jid' option. Either when calling converse.initialize, or when calling _converse.api.user.login.");So.connection.reconnecting||So.connection.reset(),So.connection.connect(So.jid.toLowerCase())}else if(So.api.settings.get("authentication")===So.LOGIN){var t;const n=e?e.password:(null===(t=So.connection)||void 0===t?void 0:t.pass)||So.api.settings.get("password");if(!n){if(So.api.settings.get("auto_login"))throw new Error("autoLogin: If you use auto_login and authentication='login' then you also need to provide a password.");return So.connection.setDisconnectionCause(zs.Status.AUTHFAIL,void 0,!0),void So.api.connection.disconnect()}So.connection.reconnecting||So.connection.reset(),So.connection.connect(So.jid,n)}}function Tc(){var e;return null===(e=So.session)||void 0===e||e.destroy(),delete So.session,So.shouldClearCache()&&So.api.user.settings.clear(),So.api.trigger("clearSession",{synchronous:!0})}function Nc(e){e=So.session.get("jid")||e,So.api.settings.get("authentication")===So.ANONYMOUS||zs.getResourceFromJid(e)||(e=e.toLowerCase()+ya.generateResource()),So.jid=e,So.bare_jid=zs.getBareJidFromJid(e),So.resource=zs.getResourceFromJid(e),So.domain=zs.getDomainFromJid(e),So.session.save({jid:e,bare_jid:So.bare_jid,resource:So.resource,domain:So.domain,active:!0}),So.connection.jid=e}function Ic(e=0){return new Promise(Oo(((e,t)=>{const n=new XMLHttpRequest;n.open("GET",Cc.settings.get("credentials_url"),!0),n.setRequestHeader("Accept","application/json, text/javascript"),n.onload=()=>{if(n.status>=200&&n.status<400){const t=JSON.parse(n.responseText);So.setUserJID(t.jid).then((()=>{e({jid:t.jid,password:t.password})}))}else t(new Error("".concat(n.status,": ").concat(n.responseText)))},n.onerror=t,n.send()}),e))}So.isUniView=function(){return["mobile","fullscreen","embedded"].includes(Cc.settings.get("view_mode"))},So.shouldClearCache=()=>!So.config.get("trusted")||Cc.settings.get("clear_cache_on_logout")||So.isTestEnv(),So.initConnection=function(){const e=So.api;if(!e.settings.get("bosh_service_url")){if(e.settings.get("authentication")===So.PREBIND)throw new Error("authentication is set to 'prebind' but we don't have a BOSH connection");if(!e.settings.get("websocket_url"))throw new Error("initConnection: you must supply a value for either the bosh_service_url or websocket_url or both.")}const t=So.isTestEnv()?_a:ya;if(("WebSocket"in window||"MozWebSocket"in window)&&e.settings.get("websocket_url"))So.connection=new t(e.settings.get("websocket_url"),Object.assign(So.default_connection_options,e.settings.get("connection_options")));else{if(!e.settings.get("bosh_service_url"))throw new Error("initConnection: this browser does not support websockets and bosh_service_url wasn't specified.");So.connection=new t(e.settings.get("bosh_service_url"),Object.assign(So.default_connection_options,e.settings.get("connection_options"),{keepalive:e.settings.get("keepalive")}))}!function(){const e={};e[zs.LogLevel.DEBUG]="debug",e[zs.LogLevel.INFO]="info",e[zs.LogLevel.WARN]="warn",e[zs.LogLevel.ERROR]="error",e[zs.LogLevel.FATAL]="fatal",zs.log=(t,n)=>as.log(n,e[t]),zs.error=e=>as.error(e),So.connection.xmlInput=e=>as.debug(e.outerHTML,"color: darkgoldenrod"),So.connection.xmlOutput=e=>as.debug(e.outerHTML,"color: darkcyan")}(),e.trigger("connectionInitialized")},So.setUserJID=async function(e){return await async function(e){var t;const n=Cc.settings.get("connection_options").worker,s=zs.getBareJidFromJid(e).toLowerCase(),i="converse.session-".concat(s);(null===(t=So.session)||void 0===t?void 0:t.get("id"))!==i?(function(){if("sessionStorage"===Cc.settings.get("persistent_store"))return;if("BrowserExtLocal"===So.api.settings.get("persistent_store"))return Kn.localForage.defineDriver(Io.Z).then((()=>Kn.localForage.setDriver("webExtensionLocalStorage"))),void(So.storage.persistent=Kn.localForage);if("BrowserExtSync"===So.api.settings.get("persistent_store"))return Kn.localForage.defineDriver(zo.Z).then((()=>Kn.localForage.setDriver("webExtensionSyncStorage"))),void(So.storage.persistent=Kn.localForage);const e={name:So.isTestEnv()?"converse-test-persistent":"converse-persistent",storeName:So.bare_jid};"localStorage"===So.api.settings.get("persistent_store")?(e.description="localStorage instance",e.driver=[Kn.localForage.LOCALSTORAGE]):"IndexedDB"===So.api.settings.get("persistent_store")&&(e.description="indexedDB instance",e.driver=[Kn.localForage.INDEXEDDB]),So.storage.persistent=Kn.localForage.createInstance(e)}(),So.session=new ao({id:i}),Cr(So.session,i,n?"persistent":"session"),await new Promise((e=>So.session.fetch({success:e,error:e}))),!n&&So.session.get("active")&&(So.session.clear(),So.session.save({id:i})),Nc(e),So.api.trigger("userSessionInitialized")):Nc(e)}(e),So.api.trigger("setUserJID"),e},So.saveWindowState=function(e){let t;const n={focus:"visible",focusin:"visible",pageshow:"visible",blur:"hidden",focusout:"hidden",pagehide:"hidden"};t=(e=e||document.createEvent("Events")).type in n?n[e.type]:document.hidden?"hidden":"visible",So.windowState=t,Cc.trigger("windowStateChanged",{state:t})},So.ConnectionFeedback=ao.extend({defaults:{connection_status:zs.Status.DISCONNECTED,message:""},initialize(){this.on("change",(()=>Cc.trigger("connfeedback",So.connfeedback)))}});const Mc=window.converse||{};Object.assign(Mc,{CHAT_STATES:["active","composing","gone","inactive","paused"],keycodes:{TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESCAPE:27,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,FORWARD_SLASH:47,AT:50,META:91,META_RIGHT:93},async initialize(e){if(await async function(){var e;await Cc.trigger("cleanup",{synchronous:!0}),So.router.history.stop(),document.removeEventListener("visibilitychange",So.saveWindowState),Cc.trigger("unregisteredGlobalEventHandlers"),null===(e=So.connection)||void 0===e||e.reset(),So.stopListening(),So.off(),So.promises.initialized.isResolved&&Cc.promises.add("initialized")}(),"onpagehide"in window?So.unloadevent="pagehide":"onbeforeunload"in window?So.unloadevent="beforeunload":"onunload"in window&&(So.unloadevent="unload"),function(e){po=e,vo={};const t=Pr(e,Object.keys(bo));Us(So,bo,t),Us(vo,bo,t)}(e),So.strict_plugin_dependencies=e.strict_plugin_dependencies,as.setLogLevel(Cc.settings.get("loglevel")),Cc.settings.get("authentication")===So.ANONYMOUS&&Cc.settings.get("auto_login")&&!Cc.settings.get("jid"))throw new Error("Config Error: you need to provide the server's domain via the 'jid' option when using anonymous authentication with auto_login.");So.router.route(/^converse\?loglevel=(debug|info|warn|error|fatal)$/,"loglevel",(e=>as.setLogLevel(e))),So.connfeedback=new So.ConnectionFeedback,So.send_initial_presence=!0,await async function(){await Kn.sessionStorageInitialized,So.storage={session:Kn.localForage.createInstance({name:So.isTestEnv()?"converse-test-session":"converse-session",description:"sessionStorage instance",driver:["sessionStorageWrapper"]})}}(),await async function(){const e="converse.client-config";So.config=new ao({id:e,trusted:!0}),So.config.browserStorage=Ar(e,"session"),await new Promise((e=>So.config.fetch({success:e,error:e}))),So.api.trigger("clientConfigInitialized")}(),await Zn.initialize(),function(){So.pluggable.initialized_plugins=[];const e=Ac.concat(So.api.settings.get("whitelisted_plugins"));So.api.settings.get("singleton")&&["converse-bookmarks","converse-controlbox","converse-headline","converse-register"].forEach((e=>So.api.settings.get("blacklisted_plugins").push(e))),So.pluggable.initializePlugins({_converse:So},e,So.api.settings.get("blacklisted_plugins")),So.api.trigger("pluginsInitialized")}(),document.addEventListener("visibilitychange",So.saveWindowState),So.saveWindowState({type:document.hidden?"blur":"focus"}),Cc.trigger("registeredGlobalEventHandlers");try{!History.started&&So.router.history.start()}catch(e){as.error(e)}Cc.settings.get("idle_presence_timeout")>0&&Cc.listen.on("addClientFeatures",(()=>Cc.disco.own.features.add(zs.NS.IDLE)));const t=So.pluggable.plugins;if((Cc.settings.get("auto_login")||Cc.settings.get("keepalive")&&No(t["converse-bosh"],"enabled"))&&await Cc.user.login(null,null,!0),Cc.trigger("initialized"),So.isTestEnv())return So},plugins:{add(e,t){if(t.__name__=e,void 0!==So.pluggable.plugins[e])throw new TypeError('Error: plugin with name "'.concat(e,'" has already been ')+"registered!");So.pluggable.plugins[e]=t}},env:{$build:Is,$iq:Rs,$msg:Ms,$pres:Ds,utils:go,Collection:ua,Model:ao,Promise,Strophe:zs,dayjs:Ao(),html:Ha,log:as,sizzle:qr(),sprintf:Xn.sprintf,u:go}});const Rc=Mc.env.utils;function Dc(e,t){Cc.send(Ms({to:e.getAttribute("from"),type:"error",id:e.getAttribute("id")}).c("error",{type:"cancel"}).c("not-allowed",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).up().c("text",{xmlns:"urn:ietf:params:xml:ns:xmpp-stanzas"}).t(t)),as.warn("Rejecting message stanza with the following reason: ".concat(t)),as.warn(e)}function zc(e,t,n,s){const i=Ms({from:So.connection.jid,id:Rc.getUniqueId(),to:e,type:s||"chat"}).c(n,{xmlns:zs.NS.MARKERS,id:t});Cc.send(i)}const{NS:Lc}=zs;class Pc extends Error{constructor(e,t){super(e,t),this.name="StanzaParseError",this.stanza=t}}function Fc(e,t){const n={},s=qr()('stanza-id[xmlns="'.concat(zs.NS.SID,'"]'),e).reduce(((e,t)=>(e["stanza_id ".concat(t.getAttribute("by"))]=t.getAttribute("id"),e)),{});Object.assign(n,s);const i=qr()('message > result[xmlns="'.concat(zs.NS.MAM,'"]'),t).pop();if(i){const e=t.getAttribute("from")||So.bare_jid;n["stanza_id ".concat(e)]=i.getAttribute("id")}const r=qr()('origin-id[xmlns="'.concat(zs.NS.SID,'"]'),e).pop();return r&&(n.origin_id=r.getAttribute("id")),n}function Bc(e,t){var n;const s=qr()('encrypted[xmlns="'.concat(zs.NS.OMEMO,'"]'),e).pop(),i={is_encrypted:!!s};if(!s||Cc.settings.get("clear_cache_on_logout"))return i;const r=s.querySelector("header");i.encrypted={device_id:r.getAttribute("sid")};const o=null===(n=t.omemo_store)||void 0===n?void 0:n.get("device_id"),a=o&&qr()('key[rid="'.concat(o,'"]'),s).pop();var c;return a&&Object.assign(i.encrypted,{iv:r.querySelector("iv").textContent,key:a.textContent,payload:(null===(c=s.querySelector("payload"))||void 0===c?void 0:c.textContent)||null,prekey:["true","1"].includes(a.getAttribute("prekey"))}),i}function Uc(e,t){const n=qr()('> apply-to[xmlns="'.concat(zs.NS.FASTEN,'"]'),e).pop();if(n){const e=n.getAttribute("id");if(qr()('> retract[xmlns="'.concat(zs.NS.RETRACT,'"]'),n).pop()){const n=qr()('delay[xmlns="'.concat(zs.NS.DELAY,'"]'),t).pop();return{editable:!1,retracted:n?Ao()(n.getAttribute("stamp")).toISOString():(new Date).toISOString(),retracted_id:e}}}else{const t=qr()('> retracted[xmlns="'.concat(zs.NS.RETRACT,'"]'),e).pop();if(t)return{editable:!1,is_tombstone:!0,retracted:t.getAttribute("stamp")}}return{}}function qc(e,t){const n=qr()('replace[xmlns="'.concat(zs.NS.MESSAGE_CORRECT,'"]'),e).pop();if(n){const e=n.getAttribute("id"),s=e;if(e){const n=qr()('delay[xmlns="'.concat(zs.NS.DELAY,'"]'),t).pop();return{msgid:s,replace_id:e,edited:n?Ao()(n.getAttribute("stamp")).toISOString():(new Date).toISOString()}}}return{}}function Hc(e){const t=qr()('spoiler[xmlns="'.concat(zs.NS.SPOILER,'"]'),e).pop();return{is_spoiler:!!t,spoiler_hint:null==t?void 0:t.textContent}}function $c(e){const t=qr()('x[xmlns="'.concat(zs.NS.OUTOFBAND,'"]'),e).pop();var n,s;return t?{oob_url:null===(n=t.querySelector("url"))||void 0===n?void 0:n.textContent,oob_desc:null===(s=t.querySelector("desc"))||void 0===s?void 0:s.textContent}:{}}function Gc(e){if("error"===e.getAttribute("type")){const t=e.querySelector("error"),n=qr()('text[xmlns="'.concat(zs.NS.STANZAS,'"]'),t).pop();return{is_error:!0,error_text:null==n?void 0:n.textContent,error_type:t.getAttribute("type"),error_condition:t.firstElementChild.nodeName}}return{}}function Vc(e){var t;const n=null===(t=e.querySelector("body"))||void 0===t?void 0:t.textContent;return qr()('reference[xmlns="'.concat(zs.NS.REFERENCE,'"]'),e).map((e=>{const t=e.getAttribute("begin"),s=e.getAttribute("end");return{begin:t,end:s,type:e.getAttribute("type"),value:n.slice(t,s),uri:e.getAttribute("uri")}}))}function Wc(e){const t=qr()('received[xmlns="'.concat(zs.NS.RECEIPTS,'"]'),e).pop();return null==t?void 0:t.getAttribute("id")}function Jc(e){const t=zs.NS.CARBONS;return qr()('message > received[xmlns="'.concat(t,'"]'),e).length>0||qr()('message > sent[xmlns="'.concat(t,'"]'),e).length>0}function Qc(e){var t;return null===(t=qr()('\n composing[xmlns="'.concat(Lc.CHATSTATES,'"],\n paused[xmlns="').concat(Lc.CHATSTATES,'"],\n inactive[xmlns="').concat(Lc.CHATSTATES,'"],\n active[xmlns="').concat(Lc.CHATSTATES,'"],\n gone[xmlns="').concat(Lc.CHATSTATES,'"]'),e).pop())||void 0===t?void 0:t.nodeName}function Yc(e,t){return"me"!==t.sender&&!t.is_carbon&&!t.is_archived&&qr()('request[xmlns="'.concat(zs.NS.RECEIPTS,'"]'),e).length}function Kc(e){if(qr()('message > forwarded[xmlns="'.concat(zs.NS.FORWARD,'"]'),e).length){Dc(e,"Forwarded messages not part of an encapsulating protocol are not supported");const t=e.getAttribute("from");return new Pc("Ignoring unencapsulated forwarded message from ".concat(t),e)}}function Xc(e){return qr()('\n acknowledged[xmlns="'.concat(zs.NS.MARKERS,'"],\n displayed[xmlns="').concat(zs.NS.MARKERS,'"],\n received[xmlns="').concat(zs.NS.MARKERS,'"]'),e).pop()}function Zc(e){return"headline"===e.getAttribute("type")}function el(e){if(qr()('mentions[xmlns="'.concat(zs.NS.MENTIONS,'"]'),e).pop())return!1;const t=e.getAttribute("from");return!("error"===e.getAttribute("type")||!t||t.includes("@"))}function tl(e){return!!qr()('message > result[xmlns="'.concat(zs.NS.MAM,'"]'),e).pop()}function nl(e){return e.getAttributeNames().reduce(((t,n)=>(t[n]=zs.xmlunescape(e.getAttribute(n)),t)),{})}const{Strophe:sl}=Mc.env;let il,rl;sl.addNamespace("ADHOC","http://jabber.org/protocol/commands");const ol={adhoc:{async getCommands(e){let t=[];try{n=await rl.disco.items(e,sl.NS.ADHOC),t=qr()('query[xmlns="'.concat(sl.NS.DISCO_ITEMS,'"][node="').concat(sl.NS.ADHOC,'"] item'),n).map(nl)}catch(t){null===t?as.error("Error: timeout while fetching ad-hoc commands for ".concat(e)):(as.error("Error while fetching ad-hoc commands for ".concat(e)),as.error(t))}var n;return t}}};Mc.plugins.add("converse-adhoc",{dependencies:["converse-disco"],initialize(){il=this._converse,rl=il.api,Object.assign(rl,ol)}});const al=ao.extend({initialize(){this.rosterContactAdded=Et()},async setRosterContact(e){const t=await Cc.contacts.get(e);t&&(this.contact=t,this.set("nickname",t.get("nickname")),this.rosterContactAdded.resolve())}});var cl=n(4009),ll=n.n(cl);const{Strophe:ul,sizzle:dl}=Mc.env;async function hl(e,t){var n,s,i,r,o,a;const c=Kc(e);if(c)return c;let l=e.getAttribute("to");const u=ul.getResourceFromJid(l);if(Cc.settings.get("filter_by_resource")&&u&&u!==t.resource)return new Pc("Ignoring incoming message intended for a different resource: ".concat(l),e);const d=e;let h=e.getAttribute("from")||t.bare_jid;if(Jc(e)){if(h!==t.bare_jid)return Dc(e,"Rejecting carbon from invalid JID"),new Pc("Rejecting carbon from invalid JID ".concat(l),e);{const t='[xmlns="'.concat(ul.NS.CARBONS,'"] > forwarded[xmlns="').concat(ul.NS.FORWARD,'"] > message');l=(e=dl(t,e).pop()).getAttribute("to"),h=e.getAttribute("from")}}const f=tl(e);if(f){if(h!==t.bare_jid)return new Pc("Invalid Stanza: alleged MAM message from ".concat(e.getAttribute("from")),e);{const t='[xmlns="'.concat(ul.NS.MAM,'"] > forwarded[xmlns="').concat(ul.NS.FORWARD,'"] > message');l=(e=dl(t,e).pop()).getAttribute("to"),h=e.getAttribute("from")}}const g=ul.getBareJidFromJid(h),m=g===t.bare_jid;if(m&&null===l)return new Pc("Don't know how to handle message stanza without 'to' attribute. ".concat(e.outerHTML),e);const p=Zc(e),v=el(e);let b,y;if(!p&&!v&&(y=m?ul.getBareJidFromJid(l):g,b=await Cc.contacts.get(y),void 0===b&&!Cc.settings.get("allow_non_roster_messaging")))return as.error(e),new Pc("Blocking messaging with a JID not in our roster because allow_non_roster_messaging is false.",e);const _=dl('delay[xmlns="'.concat(ul.NS.DELAY,'"]'),d).pop(),w=Xc(e),S=(new Date).toISOString();let x=Object.assign({contact_jid:y,is_archived:f,is_headline:p,is_server_message:v,body:null===(n=e.querySelector("body"))||void 0===n||null===(s=n.textContent)||void 0===s?void 0:s.trim(),chat_state:Qc(e),from:ul.getBareJidFromJid(e.getAttribute("from")),is_carbon:Jc(d),is_delayed:!!_,is_markable:!!dl('markable[xmlns="'.concat(ul.NS.MARKERS,'"]'),e).length,is_marker:!!w,is_unstyled:!!dl('unstyled[xmlns="'.concat(ul.NS.STYLING,'"]'),e).length,marker_id:w&&w.getAttribute("id"),msgid:e.getAttribute("id")||d.getAttribute("id"),nick:null===(i=b)||void 0===i||null===(r=i.attributes)||void 0===r?void 0:r.nickname,receipt_id:Wc(e),received:(new Date).toISOString(),references:Vc(e),sender:m?"me":"them",subject:null===(o=e.querySelector("subject"))||void 0===o?void 0:o.textContent,thread:null===(a=e.querySelector("thread"))||void 0===a?void 0:a.textContent,time:_?Ao()(_.getAttribute("stamp")).toISOString():S,to:e.getAttribute("to"),type:e.getAttribute("type")},Gc(e),$c(e),Hc(e),qc(e,d),Fc(e,d),Uc(e,d),Bc(e,t));if(x.is_archived){const n=d.getAttribute("from");if(n&&n!==t.bare_jid)return new Pc("Invalid Stanza: Forged MAM message from ".concat(n),e)}return await Cc.emojis.initialize(),x=Object.assign({message:x.body||x.error,is_only_emojis:!!x.body&&go.isOnlyEmojis(x.body),is_valid_receipt_request:Yc(e,x)},x),x.id=x.origin_id||x["stanza_id ".concat(x.from)]||go.getUniqueId(),Cc.hook("parseMessage",e,x)}const{Strophe:fl,$msg:gl}=Mc.env,ml=Mc.env.utils,pl=al.extend({defaults(){return{bookmarked:!1,chat_state:void 0,hidden:So.isUniView()&&!Cc.settings.get("singleton"),message_type:"chat",nickname:void 0,num_unread:0,time_sent:new Date(0).toISOString(),time_opened:this.get("time_opened")||(new Date).getTime(),type:So.PRIVATE_CHAT_TYPE,url:""}},async initialize(){this.initialized=Et(),al.prototype.initialize.apply(this,arguments);const e=this.get("jid");e&&(this.set({box_id:"box-".concat(e)}),this.initNotifications(),this.initMessages(),this.initUI(),this.get("type")===So.PRIVATE_CHAT_TYPE&&(this.presence=So.presences.findWhere({jid:e})||So.presences.create({jid:e}),await this.setRosterContact(e),this.presence.on("change:show",(e=>this.onPresenceChanged(e)))),this.on("change:chat_state",this.sendChatState,this),this.on("change:scrolled",(()=>!this.get("scrolled")&&this.clearUnreadMsgCounter())),await this.fetchMessages(),await Cc.trigger("chatBoxInitialized",this,{Synchronous:!0}),this.initialized.resolve())},getMessagesCollection:()=>new So.Messages,getMessagesCacheKey(){return"converse.messages-".concat(this.get("jid"),"-").concat(So.bare_jid)},initMessages(){this.messages=this.getMessagesCollection(),this.messages.fetched=Et(),this.messages.fetched.then((()=>{Cc.trigger("afterMessagesFetched",this)})),this.messages.chatbox=this,Cr(this.messages,this.getMessagesCacheKey()),this.listenTo(this.messages,"change:upload",(e=>{e.get("upload")===So.SUCCESS&&Cc.send(this.createMessageStanza(e))}))},initUI(){this.ui=new ao},initNotifications(){this.notifications=new ao},getNotificationsText(){var e,t,n;const{__:s}=So;return(null===(e=this.notifications)||void 0===e?void 0:e.get("chat_state"))===So.COMPOSING?s("%1$s is typing",this.getDisplayName()):(null===(t=this.notifications)||void 0===t?void 0:t.get("chat_state"))===So.PAUSED?s("%1$s has stopped typing",this.getDisplayName()):(null===(n=this.notifications)||void 0===n?void 0:n.get("chat_state"))===So.GONE?s("%1$s has gone away",this.getDisplayName()):""},afterMessagesFetched(e){this.most_recent_cached_message=e?this.getMostRecentMessage(e):null,Cc.trigger("afterMessagesFetched",this)},fetchMessages(){if(this.messages.fetched_flag)return void as.info("Not re-fetching messages for ".concat(this.get("jid")));this.most_recent_cached_message=null,this.messages.fetched_flag=!0;const e=this.messages.fetched.resolve;return this.messages.fetch({add:!0,success:t=>{this.afterMessagesFetched(t),e()},error:()=>{this.afterMessagesFetched(),e()}}),this.messages.fetched},async handleErrorMessageStanza(e){const{__:t}=So,n=await hl(e,So);if(!await this.shouldShowErrorMessage(n))return;const s=this.getMessageReferencedByError(n);if(s){const e={error:n.error,error_condition:n.error_condition,error_text:n.error_text,error_type:n.error_type,editable:!1};n.msgid===s.get("retraction_id")?(e.retraction_id=void 0,n.error||("forbidden"===n.error_condition?e.error=t("You're not allowed to retract your message."):e.error=t("Sorry, an error occurred while trying to retract your message."))):n.error||("forbidden"===n.error_condition?e.error=t("You're not allowed to send a message."):e.error=t("Sorry, an error occurred while trying to send your message.")),s.save(e)}else this.createMessage(n)},queueMessage(e){return this.msg_chain=(this.msg_chain||this.messages.fetched).then((()=>this.onMessage(e))).catch((e=>as.error(e))),this.msg_chain},async onMessage(e){if(e=await e,ml.isErrorObject(e))return e.stanza&&as.error(e.stanza),as.error(e.message);const t=this.getDuplicateMessage(e);if(t)this.updateMessage(t,e);else if(!this.handleReceipt(e)&&!this.handleChatMarker(e)&&!await this.handleRetraction(e)&&(this.setEditable(e,e.time),e.chat_state&&"them"===e.sender&&this.notifications.set("chat_state",e.chat_state),ml.shouldCreateMessage(e))){const t=this.handleCorrection(e)||await this.createMessage(e);this.notifications.set({chat_state:null}),this.handleUnreadMessage(t)}},async clearMessages(){try{await this.messages.clearStore()}catch(e){this.messages.trigger("reset"),as.error(e)}finally{delete this.msg_chain,delete this.messages.fetched_flag,this.messages.fetched=Et()}},async close(){Cc.connection.connected()&&(this.setChatState(So.INACTIVE),this.sendChatState());try{await new Promise(((e,t)=>this.destroy({success:e,error:(e,n)=>t(n)})))}catch(e){as.error(e)}finally{Cc.settings.get("clear_messages_on_reconnection")&&await this.clearMessages()}Cc.trigger("chatBoxClosed",this)},announceReconnection(){Cc.trigger("chatReconnected",this)},async onReconnection(){Cc.settings.get("clear_messages_on_reconnection")&&await this.clearMessages(),this.announceReconnection()},onPresenceChanged(e){const{__:t}=So,n=e.get("show"),s=this.getDisplayName();let i;"offline"===n?i=t("%1$s has gone offline",s):"away"===n?i=t("%1$s has gone away",s):"dnd"===n?i=t("%1$s is busy",s):"online"===n&&(i=t("%1$s is online",s)),i&&this.createMessage({message:i,type:"info"})},validate(e){if(!e.jid)return"Ignored ChatBox without JID";const t=Cc.settings.get("auto_join_rooms").map((e=>s(e)?e.jid:e)),n=Cc.settings.get("auto_join_private_chats").concat(t);if(Cc.settings.get("singleton")&&!n.includes(e.jid)&&!Cc.settings.get("auto_join_on_invite")){const t="".concat(e.jid," is not allowed because singleton is true and it's not being auto_joined");return as.warn(t),t}},getDisplayName(){return this.contact?this.contact.getDisplayName():this.vcard?this.vcard.getDisplayName():this.get("jid")},async createMessageFromError(e){e instanceof So.TimeoutError&&((await this.createMessage({type:"error",message:e.message,retry_event_id:e.retry_event_id})).error=e)},editEarlierMessage(){let e,t=this.messages.findLastIndex("correcting");if(t>=0)for(this.messages.at(t).save("correcting",!1);t>0;){t-=1;const n=this.messages.at(t);if(n.get("editable")){e=n;break}}e=e||this.messages.filter({sender:"me"}).reverse().find((e=>e.get("editable"))),e&&e.save("correcting",!0)},editLaterMessage(){let e,t=this.messages.findLastIndex("correcting");if(t>=0)for(this.messages.at(t).save("correcting",!1);t<this.messages.length-1;){t+=1;const n=this.messages.at(t);if(n.get("editable")){e=n,e.save("correcting",!0);break}}return e},getOldestMessage(){for(let e=0;e<this.messages.length;e++){const t=this.messages.at(e);if(t.get("type")===this.get("message_type"))return t}},getMostRecentMessage(e){for(let t=(e=e||this.messages).length-1;t>=0;t--){const n=e.at(t);if(n.get("type")===this.get("message_type"))return n}},getUpdatedMessageAttributes:(e,t)=>(({is_archived:e})=>({is_archived:e}))(t),updateMessage(e,t){const n=this.getUpdatedMessageAttributes(e,t);n&&e.save(n)},setChatState(e,t){return void 0!==this.chat_state_timeout&&(window.clearTimeout(this.chat_state_timeout),delete this.chat_state_timeout),e===So.COMPOSING?this.chat_state_timeout=window.setTimeout(this.setChatState.bind(this),So.TIMEOUTS.PAUSED,So.PAUSED):e===So.PAUSED&&(this.chat_state_timeout=window.setTimeout(this.setChatState.bind(this),So.TIMEOUTS.INACTIVE,So.INACTIVE)),this.set("chat_state",e,t),this},getMessageReferencedByError(e){const t=e.msgid;return t&&this.messages.models.find((e=>[e.get("msgid"),e.get("retraction_id")].includes(t)))},shouldShowErrorMessage(e){if(this.getMessageReferencedByError(e)||e.body)return!0},isSameUser:(e,t)=>ml.isSameBareJID(e,t),findDanglingRetraction(e){if(!e.origin_id||!this.messages.length)return null;if(this.messages.last().get("time")>e.time){const t=Array.from(this.messages.models);return t.reverse(),t.find((({attributes:t})=>t.retracted_id===e.origin_id&&t.from===e.from&&!t.moderated_by))}},async handleRetraction(e){const t=["retracted","retracted_id","editable"];if(e.retracted){if(e.is_tombstone)return!1;const n=this.messages.findWhere({origin_id:e.retracted_id,from:e.from});return n?(n.save(Pr(e,t)),!0):(e.dangling_retraction=!0,await this.createMessage(e),!0)}{const n=this.findDanglingRetraction(e);if(n){const s=Pr(n.attributes,t),i=Object.assign({dangling_retraction:!1},e,s);return delete i.id,n.save(i),!0}}return!1},handleCorrection(e){if(!e.replace_id||!e.from)return;const t=this.messages.findWhere({msgid:e.replace_id,from:e.from});if(!t)return;const n=t.get("older_versions")||{};return e.time<t.get("time")&&t.get("edited")?(n[e.time]=e.message,t.save({older_versions:n})):(Object.keys(n).length?n[t.get("edited")]=t.get("message"):n[t.get("time")]=t.get("message"),delete(e=Object.assign(e,{older_versions:n})).id,e.time=t.get("time"),t.save(e)),t},getDuplicateMessage(e){const t=[...this.getStanzaIdQueryAttrs(e),this.getOriginIdQueryAttrs(e),this.getMessageBodyQueryAttrs(e)].filter((e=>e));return this.messages.models.find((e=>t.reduce(((t,n)=>t||function(e,t){return e===t||ii(e,t,oi(t))}(e.attributes,n)),!1)))},getOriginIdQueryAttrs:e=>e.origin_id&&{origin_id:e.origin_id,from:e.from},getStanzaIdQueryAttrs:e=>Object.keys(e).filter((e=>e.startsWith("stanza_id "))).map((t=>{const n=t.replace(/^stanza_id /,""),s={};return s["stanza_id ".concat(n)]=e[t],s})),getMessageBodyQueryAttrs(e){if(e.message&&e.msgid){const t={from:e.from,msgid:e.msgid};return e.is_encrypted||(t.message=e.message),t}},retractOwnMessage(e){this.sendRetractionMessage(e),e.save({retracted:(new Date).toISOString(),retracted_id:e.get("origin_id"),retraction_id:e.get("id"),is_ephemeral:!0,editable:!1})},sendRetractionMessage(e){const t=e.get("origin_id");if(!t)throw new Error("Can't retract message without a XEP-0359 Origin ID");const n=gl({id:ml.getUniqueId(),to:this.get("jid"),type:"chat"}).c("store",{xmlns:fl.NS.HINTS}).up().c("apply-to",{id:t,xmlns:fl.NS.FASTEN}).c("retract",{xmlns:fl.NS.RETRACT});return So.connection.send(n)},sendMarkerForLastMessage(e="displayed",t=!1){const n=Array.from(this.messages.models);n.reverse();const s=n.find((e=>"them"===e.get("sender")&&(t||e.get("is_markable"))));s&&this.sendMarkerForMessage(s,e,t)},sendMarkerForMessage(e,t="displayed",n=!1){e&&Cc.settings.get("send_chat_markers").includes(t)&&((null==e?void 0:e.get("is_markable"))||n)&&zc(fl.getBareJidFromJid(e.get("from")),e.get("msgid"),t,e.get("type"))},handleChatMarker(e){if(fl.getBareJidFromJid(e.to)!==So.bare_jid)return!1;if(e.is_markable)return!this.contact||e.is_archived||e.is_carbon||zc(e.from,e.msgid,"received"),!1;if(e.marker_id){const t=this.messages.findWhere({msgid:e.marker_id}),n="marker_".concat(e.marker);return t&&!t.get(n)&&t.save({field_name:(new Date).toISOString()}),!0}},sendReceiptStanza(e,t){const n=gl({from:So.connection.jid,id:ml.getUniqueId(),to:e,type:"chat"}).c("received",{xmlns:fl.NS.RECEIPTS,id:t}).up().c("store",{xmlns:fl.NS.HINTS}).up();Cc.send(n)},handleReceipt(e){if("them"===e.sender)if(e.is_valid_receipt_request)this.sendReceiptStanza(e.from,e.msgid);else if(e.receipt_id){const t=this.messages.findWhere({msgid:e.receipt_id});return t&&!t.get("received")&&t.save({received:(new Date).toISOString()}),!0}return!1},createMessageStanza(e){const t=gl({from:So.connection.jid,to:this.get("jid"),type:this.get("message_type"),id:e.get("edited")&&ml.getUniqueId()||e.get("msgid")}).c("body").t(e.get("message")).up().c(So.ACTIVE,{xmlns:fl.NS.CHATSTATES}).root();return"chat"===e.get("type")&&t.c("request",{xmlns:fl.NS.RECEIPTS}).root(),e.get("is_spoiler")&&(e.get("spoiler_hint")?t.c("spoiler",{xmlns:fl.NS.SPOILER},e.get("spoiler_hint")).root():t.c("spoiler",{xmlns:fl.NS.SPOILER}).root()),(e.get("references")||[]).forEach((e=>{const n={xmlns:fl.NS.REFERENCE,begin:e.begin,end:e.end,type:e.type};e.uri&&(n.uri=e.uri),t.c("reference",n).root()})),e.get("oob_url")&&t.c("x",{xmlns:fl.NS.OUTOFBAND}).c("url").t(e.get("oob_url")).root(),e.get("edited")&&t.c("replace",{xmlns:fl.NS.MESSAGE_CORRECT,id:e.get("msgid")}).root(),e.get("origin_id")&&t.c("origin-id",{xmlns:fl.NS.SID,id:e.get("origin_id")}).root(),t},getOutgoingMessageAttributes(e,t){const n=this.get("composing_spoiler"),s=ml.getUniqueId(),i=e?ml.httpToGeoUri(ml.shortnamesToUnicode(e),So):void 0;return{from:So.bare_jid,fullname:So.xmppstatus.get("fullname"),id:s,is_only_emojis:!!e&&ml.isOnlyEmojis(e),jid:this.get("jid"),message:i,msgid:s,nickname:this.get("nickname"),sender:"me",spoiler_hint:n?t:void 0,time:(new Date).toISOString(),type:this.get("message_type"),body:i,is_spoiler:n,origin_id:s}},setEditable(e,t){if(!e.is_headline&&!ml.isEmptyMessage(e)&&"me"===e.sender)if("all"===Cc.settings.get("allow_message_corrections"))e.editable=!(e.file||e.retracted||"oob_url"in e);else if("last"===Cc.settings.get("allow_message_corrections")&&t>this.get("time_sent")){this.set({time_sent:t});const n=this.messages.findWhere({editable:!0});n&&n.save({editable:!1}),e.editable=!(e.file||e.retracted||"oob_url"in e)}},async createMessage(e,t){return e.time=e.time||(new Date).toISOString(),await this.messages.fetched,this.messages.create(e,t)},async sendMessage(e,t){const n=this.getOutgoingMessageAttributes(e,t);let s=this.messages.findWhere("correcting");if(s){const e=s.get("older_versions")||{};e[s.get("time")]=s.get("message"),s.save({correcting:!1,edited:(new Date).toISOString(),message:n.message,older_versions:e,references:n.references,is_only_emojis:n.is_only_emojis,origin_id:ml.getUniqueId(),received:void 0})}else this.setEditable(n,(new Date).toISOString()),s=await this.createMessage(n);return Cc.send(this.createMessageStanza(s)),Cc.trigger("sendMessage",{chatbox:this,message:s}),s},sendChatState(){if(Cc.settings.get("send_chat_state_notifications")&&this.get("chat_state")){const e=Cc.settings.get("send_chat_state_notifications");if(Array.isArray(e)&&!e.includes(this.get("chat_state")))return;Cc.send(gl({id:ml.getUniqueId(),to:this.get("jid"),type:"chat"}).c(this.get("chat_state"),{xmlns:fl.NS.CHATSTATES}).up().c("no-store",{xmlns:fl.NS.HINTS}).up().c("no-permanent-store",{xmlns:fl.NS.HINTS}))}},async sendFiles(e){var t;const{__:n}=So,s=(await Cc.disco.features.get(fl.NS.HTTPUPLOAD,So.domain)).pop();if(!s)return void this.createMessage({message:n("Sorry, looks like file upload is not supported by your server."),type:"error",is_ephemeral:!0});const i=s.dataforms.where({FORM_TYPE:{value:fl.NS.HTTPUPLOAD,type:"hidden"}}).pop(),r=window.parseInt(null===(t=((null==i?void 0:i.attributes)||{})["max-file-size"])||void 0===t?void 0:t.value),o=null==s?void 0:s.id;o?Array.from(e).forEach((async e=>{if(!window.isNaN(r)&&window.parseInt(e.size)>r)return this.createMessage({message:n("The size of your file, %1$s, exceeds the maximum allowed by your server, which is %2$s.",e.name,ll()(r)),type:"error",is_ephemeral:!0});{const t=Object.assign(this.getOutgoingMessageAttributes(),{file:!0,progress:0,slot_request_url:o});this.setEditable(t,(new Date).toISOString());const n=await this.createMessage(t,{silent:!0});n.file=e,this.messages.trigger("add",n),n.getRequestSlotURL()}})):this.createMessage({message:n("Sorry, looks like file upload is not supported by your server."),type:"error",is_ephemeral:!0})},maybeShow(e){if(!So.isUniView())return ml.safeSave(this,{hidden:!1}),this.trigger("show"),this;{const t=e=>!e.get("hidden")&&e.get("jid")!==this.get("jid")&&"controlbox"!==e.get("id"),n=So.chatboxes.filter(t);(e||0===n.length)&&(n.forEach((e=>ml.safeSave(e,{hidden:!0}))),ml.safeSave(this,{hidden:!1}))}},isHidden(){return So.isUniView()&&this.get("hidden")||this.isScrolledUp()||"hidden"===So.windowState},handleUnreadMessage(e){if((null==e?void 0:e.get("body"))&&ml.isNewMessage(e))if("me"===e.get("sender"))this.model.set("scrolled",!1);else if(this.isHidden()||this.get("scrolled")){const t={num_unread:this.get("num_unread")+1};0===this.get("num_unread")&&(t.first_unread_id=e.get("id")),this.save(t)}else this.sendMarkerForMessage(e)},clearUnreadMsgCounter(){this.get("num_unread")>0&&this.sendMarkerForMessage(this.messages.last()),ml.safeSave(this,{num_unread:0})},isScrolledUp(){return this.get("scrolled")}}),vl=Mc.env.utils,{Strophe:bl}=Mc.env,yl={defaults:()=>({msgid:vl.getUniqueId(),time:(new Date).toISOString(),is_ephemeral:!1}),async initialize(){this.checkValidity()&&(this.initialized=Et(),"chat"===this.get("type")&&(al.prototype.initialize.apply(this,arguments),this.setRosterContact(bl.getBareJidFromJid(this.get("from")))),this.get("file")&&this.on("change:put",this.uploadFile,this),this.setTimerForEphemeralMessage(),await Cc.trigger("messageInitialized",this,{Synchronous:!0}),this.initialized.resolve())},setTimerForEphemeralMessage(){const e=()=>{this.ephemeral_timer=window.setTimeout(this.safeDestroy.bind(this),1e4)};return this.isEphemeral()?(e(),!0):(this.on("change:is_ephemeral",(()=>this.isEphemeral()?e():clearTimeout(this.ephemeral_timer))),!1)},checkValidity(){return 3!==Object.keys(this.attributes).length||(this.validationError="Empty message",this.safeDestroy(),!1)},mayBeRetracted(){const e="me"===this.get("sender"),t="cancel"!==this.get("error_type");return e&&t&&["all","own"].includes(Cc.settings.get("allow_message_retraction"))},safeDestroy(){try{this.destroy()}catch(e){as.error(e)}},isEphemeral(){return this.get("is_ephemeral")},getDisplayName(){return"groupchat"===this.get("type")?this.get("nick"):this.contact?this.contact.getDisplayName():this.vcard?this.vcard.getDisplayName():this.get("from")},getMessageText(){const{__:e}=So;return this.get("is_encrypted")?this.get("plaintext")||this.get("body")||e("Undecryptable OMEMO message"):this.get("message")},isMeCommand(){const e=this.getMessageText();return!!e&&e.startsWith("/me ")},sendSlotRequestStanza(){if(!this.file)return Promise.reject(new Error("file is undefined"));const e=Mc.env.$iq({from:So.jid,to:this.get("slot_request_url"),type:"get"}).c("request",{xmlns:bl.NS.HTTPUPLOAD,filename:this.file.name,size:this.file.size,"content-type":this.file.type});return Cc.sendIQ(e)},async getRequestSlotURL(){const{__:e}=So;let t;try{t=await this.sendSlotRequestStanza()}catch(t){return as.error(t),this.save({type:"error",message:e("Sorry, could not determine upload URL."),is_ephemeral:!0})}const n=t.querySelector("slot");if(!n)return this.save({type:"error",message:e("Sorry, could not determine file upload URL."),is_ephemeral:!0});this.save({get:n.querySelector("get").getAttribute("url"),put:n.querySelector("put").getAttribute("url")})},uploadFile(){const e=new XMLHttpRequest;e.onreadystatechange=()=>{e.readyState===XMLHttpRequest.DONE&&(as.info("Status: "+e.status),200===e.status||201===e.status?this.save({upload:So.SUCCESS,oob_url:this.get("get"),message:this.get("get")}):e.onerror())},e.upload.addEventListener("progress",(e=>{e.lengthComputable&&this.set("progress",e.loaded/e.total)}),!1),e.onerror=()=>{const{__:t}=So;let n;n=e.responseText?t('Sorry, could not succesfully upload your file. Your servers response: "%1$s"',e.responseText):t("Sorry, could not succesfully upload your file."),this.save({type:"error",upload:So.FAILURE,message:n,is_ephemeral:!0})},e.open("PUT",this.get("put"),!0),e.setRequestHeader("Content-type",this.file.type),e.send(this.file)}},_l={chats:{async create(e,t){if("string"==typeof e){if(t&&!(null==t?void 0:t.fullname)){var n;const s=await Cc.contacts.get(e);t.fullname=null==s||null===(n=s.attributes)||void 0===n?void 0:n.fullname}return Cc.chats.get(e,t,!0)||void as.error("Could not open chatbox for JID: "+e)}return Array.isArray(e)?Promise.all(e.forEach((async n=>{var s;const i=await Cc.contacts.get(e);return t.fullname=null==i||null===(s=i.attributes)||void 0===s?void 0:s.fullname,Cc.chats.get(n,t,!0).maybeShow()}))):(as.error("chats.create: You need to provide at least one JID"),null)},async open(e,t,n){if("string"==typeof e){const s=await Cc.chats.get(e,t,!0);return s?s.maybeShow(n):s}if(Array.isArray(e))return Promise.all(e.map((e=>Cc.chats.get(e,t,!0).then((e=>e&&e.maybeShow(n))))).filter((e=>e)));const s="chats.open: You need to provide at least one JID";throw as.error(s),new Error(s)},async get(e,t={},n=!1){async function s(e){let s=await Cc.chatboxes.get(e);return!s&&n?s=await Cc.chatboxes.create(e,t,So.ChatBox):(s=s&&s.get("type")===So.PRIVATE_CHAT_TYPE?s:null,s&&Object.keys(t).length&&s.save(t)),s}return await Cc.waitUntil("chatBoxesFetched"),void 0===e?(await Cc.chatboxes.get()).filter((e=>e.get("type")===So.PRIVATE_CHAT_TYPE)):"string"==typeof e?s(e):Promise.all(e.map((e=>s(e))))}}},{Strophe:wl,sizzle:Sl,utils:xl}=Mc.env,El=Mc.env.utils;Mc.plugins.add("converse-chat",{dependencies:["converse-chatboxes","converse-disco"],initialize(){Object.assign(Cc,_l),Cc.settings.extend({allow_message_corrections:"all",allow_message_retraction:"all",allow_message_styling:!0,auto_join_private_chats:[],clear_messages_on_reconnection:!1,filter_by_resource:!1,send_chat_markers:["received","displayed","acknowledged"],send_chat_state_notifications:!0}),So.Message=al.extend(yl),So.Messages=ua.extend({model:So.Message,comparator:"time"}),So.ChatBox=pl,So.handleMessageStanza=async function(e){if(el(e)){const t=e.getAttribute("from");return as.info("handleMessageStanza: Ignoring incoming server message from JID: ".concat(t))}const t=await hl(e,So);if(El.isErrorObject(t))return t.stanza&&as.error(t.stanza),as.error(t.message);const n=!!Sl('body, encrypted[xmlns="'.concat(wl.NS.OMEMO,'"]'),e).length,s=await Cc.chats.get(t.contact_jid,{nickname:t.nick},n);await(null==s?void 0:s.queueMessage(t));const i={stanza:e,attrs:t,chatbox:s};Cc.trigger("message",i)},So.router.route("converse/chat?jid=:jid",(function(e){if(!xl.isValidJID(e))return as.warn('Invalid JID "'.concat(e,'" provided in URL fragment'));Cc.chats.open(e)})),Cc.listen.on("chatBoxesFetched",(function(){Cc.settings.get("auto_join_private_chats").forEach((e=>{So.chatboxes.where({jid:e}).length||("string"==typeof e?Cc.chats.open(e):as.error('Invalid jid criteria specified for "auto_join_private_chats"'))})),Cc.trigger("privateChatsAutoJoined")})),Cc.listen.on("presencesInitialized",(function(){So.connection.addHandler((e=>Sl('message > result[xmlns="'.concat(wl.NS.MAM,'"]'),e).pop()?(as.warn('Received a MAM message with type "chat".'),!0):(So.handleMessageStanza(e),!0)),null,"message","chat"),So.connection.addHandler((e=>(null!==e.getAttribute("type")||So.handleMessageStanza(e),!0)),wl.NS.RECEIPTS,"message"),So.connection.addHandler((e=>(async function(e){const t=wl.getBareJidFromJid(e.getAttribute("from"));if(xl.isSameBareJID(t,So.bare_jid))return;const n=await Cc.chatboxes.get(t);null==n||n.handleErrorMessageStanza(e)}(e),!0)),null,"message","error")})),Cc.listen.on("clearSession",(async()=>{if(So.shouldClearCache()){await Promise.all(So.chatboxes.map((e=>e.messages&&e.messages.clearStore({silent:!0}))));const e=e=>e.get("type")!==So.CONTROLBOX_TYPE;So.chatboxes.clearStore({silent:!0},e)}}))}});const{Strophe:jl}=Mc.env,Al=ao.extend({idAttribute:"jid",initialize(e,t){this.waitUntilFeaturesDiscovered=Et(),this.dataforms=new ua;let n="converse.dataforms-".concat(this.get("jid"));this.dataforms.browserStorage=So.createStore(n,"session"),this.features=new ua,n="converse.features-".concat(this.get("jid")),this.features.browserStorage=So.createStore(n,"session"),this.listenTo(this.features,"add",this.onFeatureAdded),this.fields=new ua,n="converse.fields-".concat(this.get("jid")),this.fields.browserStorage=So.createStore(n,"session"),this.listenTo(this.fields,"add",this.onFieldAdded),this.identities=new ua,n="converse.identities-".concat(this.get("jid")),this.identities.browserStorage=So.createStore(n,"session"),this.fetchFeatures(t),this.items=new So.DiscoEntities,n="converse.disco-items-".concat(this.get("jid")),this.items.browserStorage=So.createStore(n,"session"),this.items.fetch()},async getIdentity(e,t){return await this.waitUntilFeaturesDiscovered,this.identities.findWhere({category:e,type:t})},async hasFeature(e){if(await this.waitUntilFeaturesDiscovered,this.features.findWhere({var:e}))return this},onFeatureAdded(e){e.entity=this,Cc.trigger("serviceDiscovered",e)},onFieldAdded(e){e.entity=this,Cc.trigger("discoExtensionFieldDiscovered",e)},async fetchFeatures(e){if(e.ignore_cache)this.queryInfo();else{const e=this.features.browserStorage.name,t=await this.features.browserStorage.store.getItem(e);t&&0===t.length||null===t?this.queryInfo():(this.features.fetch({add:!0,success:()=>{this.waitUntilFeaturesDiscovered.resolve(this),this.trigger("featuresDiscovered")}}),this.identities.fetch({add:!0}))}},async queryInfo(){let e;try{e=await Cc.disco.info(this.get("jid"),null)}catch(e){return null===e?as.error("Timeout for disco#info query for ".concat(this.get("jid"))):as.error(e),void this.waitUntilFeaturesDiscovered.resolve(this)}this.onInfo(e)},onDiscoItems(e){qr()('query[xmlns="'.concat(jl.NS.DISCO_ITEMS,'"] item'),e).forEach((e=>{if(e.getAttribute("node"))return;const t=e.getAttribute("jid");if(void 0===this.items.get(t)){const e=So.disco_entities.get(t);e?this.items.add(e):this.items.create({jid:t})}}))},async queryForItems(){if(0===this.identities.where({category:"server"}).length)return;const e=await Cc.disco.items(this.get("jid"));this.onDiscoItems(e)},onInfo(e){Array.from(e.querySelectorAll("identity")).forEach((e=>{this.identities.create({category:e.getAttribute("category"),type:e.getAttribute("type"),name:e.getAttribute("name")})})),qr()('x[type="result"][xmlns="'.concat(jl.NS.XFORM,'"]'),e).forEach((e=>{const t={};qr()("field",e).forEach((e=>{var n;t[e.getAttribute("var")]={value:null===(n=e.querySelector("value"))||void 0===n?void 0:n.textContent,type:e.getAttribute("type")}})),this.dataforms.create(t)})),e.querySelector('feature[var="'.concat(jl.NS.DISCO_ITEMS,'"]'))&&this.queryForItems(),Array.from(e.querySelectorAll("feature")).forEach((t=>{this.features.create({var:t.getAttribute("var"),from:e.getAttribute("from")})})),qr()('x[type="result"][xmlns="jabber:x:data"] field',e).forEach((t=>{var n;this.fields.create({var:t.getAttribute("var"),value:null===(n=t.querySelector("value"))||void 0===n?void 0:n.textContent,from:e.getAttribute("from")})})),this.waitUntilFeaturesDiscovered.resolve(this),this.trigger("featuresDiscovered")}}),Cl=ua.extend({model:Al,fetchEntities(){return new Promise(((e,t)=>{this.fetch({add:!0,success:e,error(e,n){as.error(n),t(new Error("Could not fetch disco entities"))}})}))}}),{Strophe:kl,$iq:Ol}=Mc.env;async function Tl(){Cc.disco.own.identities.add("client","web","Converse"),Cc.disco.own.features.add(kl.NS.CHATSTATES),Cc.disco.own.features.add(kl.NS.DISCO_INFO),Cc.disco.own.features.add(kl.NS.ROSTERX),Cc.settings.get("message_carbons")&&Cc.disco.own.features.add(kl.NS.CARBONS),Cc.trigger("addClientFeatures"),So.connection.addHandler((e=>function(e){const t=e.getElementsByTagName("query")[0].getAttribute("node"),n={xmlns:kl.NS.DISCO_INFO};t&&(n.node=t);const s=Ol({type:"result",id:e.getAttribute("id")}),i=e.getAttribute("from");return null!==i&&s.attrs({to:i}),s.c("query",n),So.disco._identities.forEach((e=>{const t={category:e.category,type:e.type};e.name&&(t.name=e.name),e.lang&&(t["xml:lang"]=e.lang),s.c("identity",t).up()})),So.disco._features.forEach((e=>s.c("feature",{var:e}).up())),Cc.send(s.tree()),!0}(e)),kl.NS.DISCO_INFO,"iq","get",null,null),So.disco_entities=new So.DiscoEntities;const e="converse.disco-entities-".concat(So.bare_jid);So.disco_entities.browserStorage=So.createStore(e,"session");const t=await So.disco_entities.fetchEntities();0!==t.length&&t.get(So.domain)||So.disco_entities.create({jid:So.domain}),Cc.trigger("discoInitialized")}function Nl(){if(!So.stream_features){const e=kl.getBareJidFromJid(So.jid),t="converse.stream-features-".concat(e);Cc.promises.add("streamFeaturesAdded"),So.stream_features=new ua,So.stream_features.browserStorage=So.createStore(t,"session")}}function Il(){Cc.trigger("streamFeaturesAdded")}function Ml(){Nl(),Array.from(So.connection.features.childNodes).forEach((e=>{So.stream_features.create({name:e.nodeName,xmlns:e.getAttribute("xmlns")})})),Il()}const{Strophe:Rl,$iq:Dl}=Mc.env,zl={disco:{stream:{async getFeature(e,t){if(await Cc.waitUntil("streamFeaturesAdded"),!e||!t)throw new Error("name and xmlns need to be provided when calling disco.stream.getFeature");if(void 0!==So.stream_features||Cc.connection.connected())return So.stream_features.findWhere({name:e,xmlns:t});{const n="Tried to get feature ".concat(e," ").concat(t," but _converse.stream_features has been torn down");as.warn(n)}}},own:{identities:{add(e,t,n,s){for(var i=0;i<So.disco._identities.length;i++)if(So.disco._identities[i].category==e&&So.disco._identities[i].type==t&&So.disco._identities[i].name==n&&So.disco._identities[i].lang==s)return!1;So.disco._identities.push({category:e,type:t,name:n,lang:s})},clear(){So.disco._identities=[]},get:()=>So.disco._identities},features:{add(e){for(var t=0;t<So.disco._features.length;t++)if(So.disco._features[t]==e)return!1;So.disco._features.push(e)},clear(){So.disco._features=[]},get:()=>So.disco._features}},info(e,t){const n={xmlns:Rl.NS.DISCO_INFO};t&&(n.node=t);const s=Dl({from:So.connection.jid,to:e,type:"get"}).c("query",n);return Cc.sendIQ(s)},items(e,t){const n={xmlns:Rl.NS.DISCO_ITEMS};return t&&(n.node=t),Cc.sendIQ(Dl({from:So.connection.jid,to:e,type:"get"}).c("query",n))},entities:{async get(e,t=!1){if(await Cc.waitUntil("discoInitialized"),!e)return So.disco_entities;if(void 0===So.disco_entities&&!Cc.connection.connected()){const t="Tried to look up entity ".concat(e," but _converse.disco_entities has been torn down");return void as.warn(t)}const n=So.disco_entities.get(e);return n||!t?n:Cc.disco.entities.create(e)},create:(e,t)=>So.disco_entities.create({jid:e},t)},features:{async get(e,t){if(!t)throw new TypeError("You need to provide an entity JID");await Cc.waitUntil("discoInitialized");let n=await Cc.disco.entities.get(t,!0);if(void 0===So.disco_entities&&!Cc.connection.connected()){const n="Tried to get feature ".concat(e," for ").concat(t," but _converse.disco_entities has been torn down");return void as.warn(n)}n=await n.waitUntilFeaturesDiscovered;const i=[...n.items.map((t=>t.hasFeature(e))),n.hasFeature(e)];return(await Promise.all(i)).filter(s)}},supports:async(e,t)=>(await Cc.disco.features.get(e,t)).length>0,async refresh(e){if(!e)throw new TypeError("api.disco.refresh: You need to provide an entity JID");await Cc.waitUntil("discoInitialized");let t=await Cc.disco.entities.get(e);return t?(t.features.reset(),t.fields.reset(),t.identities.reset(),t.waitUntilFeaturesDiscovered.isPending||(t.waitUntilFeaturesDiscovered=Et()),t.queryInfo()):t=await Cc.disco.entities.create(e,{ignore_cache:!0}),t.waitUntilFeaturesDiscovered},refreshFeatures:e=>Cc.refresh(e),async getFeatures(e){if(!e)throw new TypeError("api.disco.getFeatures: You need to provide an entity JID");await Cc.waitUntil("discoInitialized");let t=await Cc.disco.entities.get(e,!0);return t=await t.waitUntilFeaturesDiscovered,t.features},async getFields(e){if(!e)throw new TypeError("api.disco.getFields: You need to provide an entity JID");await Cc.waitUntil("discoInitialized");let t=await Cc.disco.entities.get(e,!0);return t=await t.waitUntilFeaturesDiscovered,t.fields},async getIdentity(e,t,n){const s=await Cc.disco.entities.get(n,!0);if(void 0!==s||Cc.connection.connected())return s.getIdentity(e,t);{const t="Tried to look up category ".concat(e," for ").concat(n," but _converse.disco_entities has been torn down");as.warn(t)}}}},{Strophe:Ll}=Mc.env;Mc.plugins.add("converse-disco",{initialize(){Object.assign(Cc,zl),Cc.promises.add("discoInitialized"),Cc.promises.add("streamFeaturesAdded"),So.DiscoEntity=Al,So.DiscoEntities=Cl,So.disco={_identities:[],_features:[]},Cc.listen.on("userSessionInitialized",(async()=>{Nl(),So.connfeedback.get("connection_status")===Ll.Status.ATTACHED&&(await new Promise(((e,t)=>So.stream_features.fetch({success:e,error:t}))),Il())})),Cc.listen.on("beforeResourceBinding",Ml),Cc.listen.on("reconnected",Tl),Cc.listen.on("connected",Tl),Cc.listen.on("beforeTearDown",(async()=>{Cc.promises.add("streamFeaturesAdded"),So.stream_features&&(await So.stream_features.clearStore(),delete So.stream_features)})),Cc.listen.on("clearSession",(()=>{So.shouldClearCache()&&So.disco_entities&&(Array.from(So.disco_entities.models).forEach((e=>e.features.clearStore())),Array.from(So.disco_entities.models).forEach((e=>e.identities.clearStore())),Array.from(So.disco_entities.models).forEach((e=>e.dataforms.clearStore())),Array.from(So.disco_entities.models).forEach((e=>e.fields.clearStore())),So.disco_entities.clearStore(),delete So.disco_entities)}))}});const Pl=new RegExp("<object[^>]*>.*?</object>|<span[^>]*>.*?</span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)(\\*\\\\0\\/\\*|\\*\\\\O\\/\\*|\\-___\\-|\\:'\\-\\)|'\\:\\-\\)|'\\:\\-D|\\>\\:\\-\\)|>\\:\\-\\)|'\\:\\-\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:'\\-\\(|O\\:\\-\\)|0\\:\\-3|0\\:\\-\\)|0;\\^\\)|O;\\-\\)|0;\\-\\)|O\\:\\-3|\\-__\\-|\\:\\-Þ|\\:\\-Þ|\\<\\/3|<\\/3|\\:'\\)|\\:\\-D|'\\:\\)|'\\=\\)|'\\:D|'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\=\\)|>\\=\\)|;\\-\\)|\\*\\-\\)|;\\-\\]|;\\^\\)|'\\:\\(|'\\=\\(|\\:\\-\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\-\\[|\\>\\:\\(|>\\:\\(|\\:'\\(|;\\-\\(|\\>\\.\\<|>\\.<|#\\-\\)|%\\-\\)|X\\-\\)|\\\\0\\/|\\\\O\\/|0\\:3|0\\:\\)|O\\:\\)|O\\=\\)|O\\:3|B\\-\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\-P|\\:Þ|\\:Þ|\\:\\-b|\\:\\-O|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:\\-#|\\:\\-\\)|\\(y\\)|\\<3|<3|\\:D|\\=D|;\\)|\\*\\)|;\\]|;D|\\:\\*|\\=\\*|\\:\\(|\\:\\[|\\=\\(|\\:@|;\\(|D\\:|\\:\\$|\\=\\$|#\\)|%\\)|X\\)|B\\)|8\\)|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\=P|\\:b|\\:O|\\:X|\\:#|\\=X|\\=#|\\:\\)|\\=\\]|\\=\\)|\\:\\])(?=\\s|$|[!,.?]))","gi"),Fl=/(?:\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffc-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffd-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffd\udfff]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d])|(?:\ud83d[\udc68\udc69]|\ud83e\uddd1)(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddaf-\uddb3\uddbc\uddbd])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddcd-\uddcf\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26a7\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\uded5\udeeb\udeec\udef4-\udefa\udfe0-\udfeb]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd71\udd73-\udd76\udd7a-\udda2\udda5-\uddaa\uddae-\uddb4\uddb7\uddba\uddbc-\uddca\uddd0\uddde-\uddff\ude70-\ude73\ude78-\ude7a\ude80-\ude82\ude90-\ude95]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g;function Bl(){const e=Hl(['<img class="emoji"\n draggable="false"\n title="','"\n alt="','"\n src="','">']);return Bl=function(){return e},e}function Ul(){const e=Hl(['<img class="emoji"\n draggable="false"\n title="','"\n alt="','"\n src="',"/72x72/",'.png"/>']);return Ul=function(){return e},e}function ql(){const e=Hl(['<span title="','">',"</span>"]);return ql=function(){return e},e}function Hl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const $l=Mc.env.utils;Mc.emojis={initialized:!1,initialized_promise:Et()};const Gl={"*\\0/*":"1f646","*\\O/*":"1f646","-___-":"1f611",":'-)":"1f602","':-)":"1f605","':-D":"1f605",">:-)":"1f606","':-(":"1f613",">:-(":"1f620",":'-(":"1f622","O:-)":"1f607","0:-3":"1f607","0:-)":"1f607","0;^)":"1f607","O;-)":"1f607","0;-)":"1f607","O:-3":"1f607","-__-":"1f611",":-Þ":"1f61b","</3":"1f494",":')":"1f602",":-D":"1f603","':)":"1f605","'=)":"1f605","':D":"1f605","'=D":"1f605",">:)":"1f606",">;)":"1f606",">=)":"1f606",";-)":"1f609","*-)":"1f609",";-]":"1f609",";^)":"1f609","':(":"1f613","'=(":"1f613",":-*":"1f618",":^*":"1f618",">:P":"1f61c","X-P":"1f61c",">:[":"1f61e",":-(":"1f61e",":-[":"1f61e",">:(":"1f620",":'(":"1f622",";-(":"1f622",">.<":"1f623","#-)":"1f635","%-)":"1f635","X-)":"1f635","\\0/":"1f646","\\O/":"1f646","0:3":"1f607","0:)":"1f607","O:)":"1f607","O=)":"1f607","O:3":"1f607","B-)":"1f60e","8-)":"1f60e","B-D":"1f60e","8-D":"1f60e","-_-":"1f611",">:\\":"1f615",">:/":"1f615",":-/":"1f615",":-.":"1f615",":-P":"1f61b",":Þ":"1f61b",":-b":"1f61b",":-O":"1f62e",O_O:"1f62e",">:O":"1f62e",":-X":"1f636",":-#":"1f636",":-)":"1f642","(y)":"1f44d","<3":"2764",":D":"1f603","=D":"1f603",";)":"1f609","*)":"1f609",";]":"1f609",";D":"1f609",":*":"1f618","=*":"1f618",":(":"1f61e",":[":"1f61e","=(":"1f61e",":@":"1f620",";(":"1f622","D:":"1f628",":$":"1f633","=$":"1f633","#)":"1f635","%)":"1f635","X)":"1f635","B)":"1f60e","8)":"1f60e",":/":"1f615",":\\":"1f615","=/":"1f615","=\\":"1f615",":L":"1f615","=L":"1f615",":P":"1f61b","=P":"1f61b",":b":"1f61b",":O":"1f62e",":X":"1f636",":#":"1f636","=X":"1f636","=#":"1f636",":)":"1f642","=]":"1f642","=)":"1f642",":]":"1f642"};function Vl(e){if(e.indexOf("-")>-1){const t=[],n=e.split("-");for(let e=0;e<n.length;e++){let s=parseInt(n[e],16);if(s>=65536&&s<=1114111){const e=Math.floor((s-65536)/1024)+55296,t=(s-65536)%1024+56320;s=String.fromCharCode(e)+String.fromCharCode(t)}else s=String.fromCharCode(s);t.push(s)}return t.join("")}return function(e){let t="string"==typeof e?parseInt(e,16):e;return t<65536?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}(e)}function Wl(e){return e.replace(Pl,((e,t,n,s)=>void 0!==s&&""!==s&&$l.unescapeHTML(s)in Gl?(s=$l.unescapeHTML(s),n+Vl(Gl[s].toUpperCase())):e))}function Jl(e,t={unicode_only:!1,add_title_wrapper:!1}){const n=e.emoji,s=e.shortname;if(n){if(t.unicode_only)return n;if(Cc.settings.get("use_system_emojis"))return t.add_title_wrapper&&s?Ha(ql(),s,n):n;{const t=Cc.settings.get("emoji_image_path");return Ha(Ul(),s,n,t,e.cp)}}return t.unicode_only?s:Ha(Bl(),s,s,Mc.emojis.by_sn[s].url)}function Ql(e){if(!Mc.emojis.initialized)throw new Error("getShortnameReferences called before emojis are initialized. To avoid this problem, first await the converse.emojis.initilaized_promise.");return[...e.matchAll(Mc.emojis.shortnames_regex)].filter((e=>e[0].length>0)).map((e=>{const t=Mc.emojis.by_sn[e[0]].cp;return{cp:t,begin:e.index,end:e.index+e[0].length,shortname:e[0],emoji:t?Vl(t):null}}))}function Yl(e){const t=[];return function(e,n){const s=/\uFE0F/g,i=String.fromCharCode(8205);String(e).replace(Fl,((e,n,r)=>{const o=function(e){const t=[];let n=0,s=0;for(;s<e.length;){const i=e.charCodeAt(s++);n?(t.push((65536+(n-55296<<10)+(i-56320)).toString(16)),n=0):55296<=i&&i<=56319?n=i:t.push(i.toString(16))}return t.join("-")}(e.indexOf(i)<0?e.replace(s,""):e);o&&((e,n,s)=>{var i;t.push({begin:s,cp:e,emoji:n,end:s+n.length,shortname:(null===(i=$l.getEmojisByAtrribute("cp")[e])||void 0===i?void 0:i.sn)||""})})(o,e,r)}))}(e),t}Mc.plugins.add("converse-emoji",{initialize(){const{___:e}=So;Cc.settings.extend({emoji_image_path:"https://twemoji.maxcdn.com/v/12.1.6/",emoji_categories:{smileys:":grinning:",people:":thumbsup:",activity:":soccer:",travel:":motorcycle:",objects:":bomb:",nature:":rainbow:",food:":hotdog:",symbols:":musical_note:",flags:":flag_ac:",custom:null},emoji_category_labels:{smileys:e("Smileys and emotions"),people:e("People"),activity:e("Activities"),travel:e("Travel"),objects:e("Objects"),nature:e("Animals and nature"),food:e("Food and drink"),symbols:e("Symbols"),flags:e("Flags"),custom:e("Stickers")}}),So.EmojiPicker=ao.extend({defaults:{current_category:"smileys",current_skintone:"",scroll_position:0}});const t={};Object.assign($l,{shortnamesToEmojis:(e,t={unicode_only:!1,add_title_wrapper:!1})=>function(e,t){let n=[e];return[...Ql(e),...Yl(e)].sort(((e,t)=>t.begin-e.begin)).forEach((e=>{const s=n.shift(),i=Jl(e,t);n="string"==typeof i?[s.slice(0,e.begin)+i+s.slice(e.end),...n]:[s.slice(0,e.begin),i,s.slice(e.end),...n]})),n}(e=Wl(e),t),shortnamesToUnicode:e=>$l.shortnamesToEmojis(e,{unicode_only:!0})[0],isOnlyEmojis(e){const t=e.trim().split(/\s+/);return!(0===t.length||t.length>3)&&t.filter((e=>{const t=Yl($l.shortnamesToUnicode(e));return 1===t.length&&(e===t[0].shortname||e===t[0].emoji)})).length===t.length},getEmojisByAtrribute(e){if(t[e])return t[e];if("category"===e)return Mc.emojis.json;const n=Mc.emojis.list.map((t=>t[e])).filter(((e,t,n)=>n.indexOf(e)==t));return t[e]={},n.forEach((n=>t[e][n]=Mc.emojis.list.find((t=>t[e]===n)))),t[e]}}),Object.assign(Cc,{emojis:{async initialize(){if(!Mc.emojis.initialized){Mc.emojis.initialized=!0;const{default:t}=await n.e(4610).then(n.t.bind(n,7530,19));Mc.emojis.json=t,Mc.emojis.by_sn=Object.keys(t).reduce(((e,n)=>Object.assign(e,t[n])),{}),Mc.emojis.list=Object.values(Mc.emojis.by_sn),Mc.emojis.list.sort(((e,t)=>e.sn<t.sn?-1:e.sn>t.sn?1:0)),Mc.emojis.shortnames=Mc.emojis.list.map((e=>e.sn));const s=()=>Mc.emojis.shortnames.map((e=>e.replace(/[+]/g,"\\$&"))).join("|");Mc.emojis.shortnames_regex=new RegExp(s(),"gi"),Mc.emojis.toned=(Mc.emojis.toned||(Mc.emojis.toned=(e=Object.values(Mc.emojis.json.people).filter((e=>e.sn.includes("_tone"))).map((e=>e.sn.replace(/_tone[1-5]/,""))),[...new Set(e)])),Mc.emojis.toned),Mc.emojis.initialized_promise.resolve()}var e;return Mc.emojis.initialized_promise}}})}});const Kl={initialize(){this.checkValidity()&&(this.get("file")&&this.on("change:put",this.uploadFile,this),this.setTimerForEphemeralMessage()||this.setOccupant(),Cc.trigger("chatRoomMessageInitialized",this))},mayBeModerated(){return["all","moderator"].includes(Cc.settings.get("allow_message_retraction"))&&this.collection.chatbox.canModerateMessages()},checkValidity(){const e=So.Message.prototype.checkValidity.call(this);return!e&&this.collection.chatbox.debouncedRejoin(),e},onOccupantRemoved(){var e;this.stopListening(this.occupant),delete this.occupant;const t=null==this||null===(e=this.collection)||void 0===e?void 0:e.chatbox;if(!t)return as.error("Could not get collection.chatbox for message: ".concat(JSON.stringify(this.toJSON())));this.listenTo(t.occupants,"add",this.onOccupantAdded)},onOccupantAdded(e){if(e.get("nick")===zs.getResourceFromJid(this.get("from"))){var t;this.occupant=e,this.trigger("occupantAdded"),this.listenTo(this.occupant,"destroy",this.onOccupantRemoved);const n=null==this||null===(t=this.collection)||void 0===t?void 0:t.chatbox;if(!n)return as.error("Could not get collection.chatbox for message: ".concat(JSON.stringify(this.toJSON())));this.stopListening(n.occupants,"add",this.onOccupantAdded)}},setOccupant(){var e;if("groupchat"!==this.get("type"))return;const t=null==this||null===(e=this.collection)||void 0===e?void 0:e.chatbox;if(!t)return as.error("Could not get collection.chatbox for message: ".concat(JSON.stringify(this.toJSON())));const n=zs.getResourceFromJid(this.get("from"));if(this.occupant=t.occupants.findWhere({nick:n}),!this.occupant&&Cc.settings.get("muc_send_probes")){this.occupant=t.occupants.create({nick:n,type:"unavailable"});const e="".concat(t.get("jid"),"/").concat(n);Cc.user.presence.send("probe",e)}this.occupant?this.listenTo(this.occupant,"destroy",this.onOccupantRemoved):this.listenTo(t.occupants,"add",this.onOccupantAdded)}},Xl={},Zl=(e,t)=>e.replace(RegExp("\\"+t,"ig"),"\\"+t);Xl.escapeCharacters=e=>t=>e.split("").reduce(Zl,t),Xl.escapeRegexString=Xl.escapeCharacters("[\\^$.?*+(){}|"),Xl.findFirstMatchInArray=e=>t=>{for(let n=0;n<e.length;n++)if(0===t.localeCompare(e[n],void 0,{sensitivity:"base"}))return e[n];return null};const eu=([e,t],n,s)=>{let i=e,{begin:r,end:o}=n;const{value:a}=n;return r-=s,o=o-s-1,i="".concat(i.slice(0,r)).concat(a).concat(i.slice(o+1)),[i,[...t,{...n,begin:r,end:o}]]};Xl.reduceTextFromReferences=(e,t)=>t.reduce(eu,[e,[]]);const tu=Xl;go.webForm2xForm=function(e){const t=e.getAttribute("name");if(!t)return null;let n;return n="checkbox"===e.getAttribute("type")?e.checked?1:0:"TEXTAREA"==e.tagName?e.value.split("\n").filter((e=>e.trim())):"SELECT"==e.tagName?go.getSelectValues(e):e.value,go.toStanza('\n <field var="'.concat(t,'">\n ').concat(n.constructor===Array?n.map((e=>"<value>".concat(e,"</value>"))):"<value>".concat(n,"</value>"),"\n </field>"))};const nu=go,su=function(e,t){return function(e,t,n){for(var s=-1,i=e.length,r=t.length,o={};++s<i;){var a=s<r?t[s]:void 0;n(o,e[s],a)}return o}(e||[],t||[],Ue)},{Strophe:iu,sizzle:ru,u:ou}=Mc.env,{NS:au}=iu;async function cu(e,t,n){var s,i,r,o,a;const c=Kc(e);if(c)return c;const l='[xmlns="'.concat(au.MAM,'"] > forwarded[xmlns="').concat(au.FORWARD,'"] > message'),u=e;if(e=ru(l,e).pop()||e,ru('message > forwarded[xmlns="'.concat(iu.NS.FORWARD,'"]'),e).length)return new Pc("Invalid Stanza: Forged MAM groupchat message from ".concat(e.getAttribute("from")),e);const d=ru('delay[xmlns="'.concat(iu.NS.DELAY,'"]'),u).pop(),h=e.getAttribute("from"),f=iu.unescapeNode(iu.getResourceFromJid(h)),g=Xc(e),m=(new Date).toISOString();let p=Object.assign({from:h,nick:f,body:null===(s=e.querySelector("body"))||void 0===s||null===(i=s.textContent)||void 0===i?void 0:i.trim(),chat_state:Qc(e),from_muc:iu.getBareJidFromJid(h),from_real_jid:null===(r=t.occupants.findOccupant({nick:f}))||void 0===r?void 0:r.get("jid"),is_archived:tl(u),is_carbon:Jc(u),is_delayed:!!d,is_headline:Zc(e),is_markable:!!ru('markable[xmlns="'.concat(iu.NS.MARKERS,'"]'),e).length,is_marker:!!g,is_unstyled:!!ru('unstyled[xmlns="'.concat(iu.NS.STYLING,'"]'),e).length,marker_id:g&&g.getAttribute("id"),msgid:e.getAttribute("id")||u.getAttribute("id"),receipt_id:Wc(e),received:(new Date).toISOString(),references:Vc(e),subject:null===(o=e.querySelector("subject"))||void 0===o?void 0:o.textContent,thread:null===(a=e.querySelector("thread"))||void 0===a?void 0:a.textContent,time:d?Ao()(d.getAttribute("stamp")).toISOString():m,to:e.getAttribute("to"),type:e.getAttribute("type")},Gc(e),$c(e),Hc(e),qc(e,u),Fc(e,u),function(e){const t=qr()('> apply-to[xmlns="'.concat(zs.NS.FASTEN,'"]'),e).pop();if(t){const e=t.getAttribute("id"),n=qr()('> meta[xmlns="'.concat(zs.NS.XHTML,'"]'),t);if(n.length){const t=Cc.settings.get("message_limit"),s=n.reduce(((e,n)=>{const s=n.getAttribute("property");if(s){let i=Tr(n.getAttribute("content")||"");t&&"og:description"===s&&i.length>=t&&(i="".concat(i.slice(0,t)).concat(Tr("&#8230;"))),e[s]=i}return e}),{ogp_for_id:e});if("og:description"in s||"og:title"in s||"og:image"in s)return s}}return{}}(e),Uc(e,u),function(e){const t=ru('apply-to[xmlns="'.concat(iu.NS.FASTEN,'"]'),e).pop();if(t){const e=t.getAttribute("id"),s=ru('moderated[xmlns="'.concat(iu.NS.MODERATE,'"]'),t).pop();var n;if(s&&ru('retract[xmlns="'.concat(iu.NS.RETRACT,'"]'),s).pop())return{editable:!1,moderated:"retracted",moderated_by:s.getAttribute("by"),moderated_id:e,moderation_reason:null===(n=s.querySelector("reason"))||void 0===n?void 0:n.textContent}}else{const t=ru('> moderated[xmlns="'.concat(iu.NS.MODERATE,'"]'),e).pop();var s;if(t&&ru('retracted[xmlns="'.concat(iu.NS.RETRACT,'"]'),t).pop())return{editable:!1,is_tombstone:!0,moderated_by:t.getAttribute("by"),retracted:t.getAttribute("stamp"),moderation_reason:null===(s=t.querySelector("reason"))||void 0===s?void 0:s.textContent}}return{}}(e),Bc(e,n));return await Cc.emojis.initialize(),p=Object.assign({is_only_emojis:!!p.body&&ou.isOnlyEmojis(p.body),is_valid_receipt_request:Yc(e,p),message:p.body||p.error,sender:p.nick===t.get("nick")?"me":"them"},p),p.is_archived&&u.getAttribute("from")!==p.from_muc?new Pc("Invalid Stanza: Forged MAM message from ".concat(u.getAttribute("from")),e):p.is_archived&&u.getAttribute("from")!==t.get("jid")?new Pc("Invalid Stanza: Forged MAM groupchat message from ".concat(e.getAttribute("from")),e):p.is_carbon?new Pc("Invalid Stanza: MUC messages SHOULD NOT be XEP-0280 carbon copied",e):(p.id=p.origin_id||p["stanza_id ".concat(p.from_muc||p.from)]||ou.getUniqueId(),Cc.hook("parseMUCMessage",e,p))}const{Strophe:lu,$iq:uu,u:du}=Mc.env;async function hu(e,t){const n=uu({to:t,type:"get"}).c("query",{xmlns:lu.NS.MUC_ADMIN}).c("item",{affiliation:e}),s=await Cc.sendIQ(n,null,!1);if(null===s){const n="Error: timeout while fetching ".concat(e," list for MUC ").concat(t),i=new Error(n);return as.warn(n),as.warn(s),i}if(du.isErrorStanza(s)){const n="Error: not allowed to fetch ".concat(e," list for MUC ").concat(t),i=new Error(n);return as.warn(n),as.warn(s),i}return function(e){return ru('query[xmlns="'.concat(iu.NS.MUC_ADMIN,'"] item'),e).map((e=>{const t={affiliation:e.getAttribute("affiliation")},n=e.getAttribute("jid");ou.isValidJID(n)?t.jid=n:t.nick=n;const s=e.getAttribute("nick");return s&&(t.nick=s),e.getAttribute("role")&&(t.role=s),t}))}(s).filter((e=>e)).sort(((e,t)=>e.nick<t.nick?-1:e.nick>t.nick?1:0))}function fu(e,t){const n=[...new Set(t.map((e=>e.affiliation)))];return Promise.all(n.map((n=>gu(n,e,t))))}function gu(e,t,n){return Array.isArray(t)||(t=[t]),n=n.filter((t=>[void 0,e].includes(t.affiliation))),Promise.all(t.reduce(((t,s)=>[...t,...n.map((t=>function(e,t,n){const s=uu({to:t,type:"set"}).c("query",{xmlns:lu.NS.MUC_ADMIN}).c("item",{affiliation:n.affiliation||e,nick:n.nick,jid:n.jid});return void 0!==n.reason&&s.c("reason",n.reason),Cc.sendIQ(s)}(e,s,t)))]),[]))}function mu(e,t,n,s){const i=n.map((e=>e.jid)),r=s.map((e=>e.jid));let o=Wo(i,r).map((e=>n[na(i,e)]));return e||(o=o.concat(n.filter((e=>{const t=na(r,e.jid);return t>=0&&e.affiliation!==s[t].affiliation})))),t&&(o=o.concat(Wo(r,i).map((e=>({jid:e,affiliation:"none"}))))),o}const pu=["owner"],vu=["admin","ban","deop","destroy","member","op","revoke"],bu=["kick","mute","voice","modtools"],yu=["nick"],_u=["og:article:author","og:article:published_time","og:description","og:image","og:image:height","og:image:width","og:site_name","og:title","og:type","og:url","og:video:height","og:video:secure_url","og:video:tag","og:video:type","og:video:url","og:video:width"],wu=["301","303","333","307","321","322"],Su=ao.extend({defaults:()=>({connection_status:Mc.ROOMSTATUS.DISCONNECTED})}),xu={defaults(){return{bookmarked:!1,chat_state:void 0,has_activity:!1,hidden:So.isUniView()&&!Cc.settings.get("singleton"),hidden_occupants:!!Cc.settings.get("hide_muc_participants"),message_type:"groupchat",name:"",num_unread_general:0,num_unread:0,roomconfig:{},time_opened:this.get("time_opened")||(new Date).getTime(),time_sent:new Date(0).toISOString(),type:So.CHATROOMS_TYPE}},async initialize(){this.initialized=Et(),this.debouncedRejoin=Oo(this.rejoin,250),this.set("box_id","box-".concat(this.get("jid"))),this.initNotifications(),this.initMessages(),this.initUI(),this.initOccupants(),this.initDiscoModels(),this.registerHandlers(),this.on("change:chat_state",this.sendChatState,this),this.on("change:hidden",this.onHiddenChange,this),this.on("change:scrolled",(()=>!this.get("scrolled")&&this.clearUnreadMsgCounter())),this.on("destroy",this.removeHandlers,this),await this.restoreSession(),this.session.on("change:connection_status",this.onConnectionStatusChanged,this),this.listenTo(this.occupants,"add",this.onOccupantAdded),this.listenTo(this.occupants,"remove",this.onOccupantRemoved),this.listenTo(this.occupants,"change:show",this.onOccupantShowChanged),this.listenTo(this.occupants,"change:affiliation",this.createAffiliationChangeMessage),this.listenTo(this.occupants,"change:role",this.createRoleChangeMessage),await this.restoreFromCache()||this.join(),await Cc.trigger("chatRoomInitialized",this,{Synchronous:!0}),this.initialized.resolve()},async restoreFromCache(){return this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED&&await this.isJoined()?(await new Promise((e=>this.features.fetch({success:e,error:e}))),await this.fetchOccupants().catch((e=>as.error(e))),await this.fetchMessages().catch((e=>as.error(e))),!0):(this.clearCache(),!1)},async join(e,t){if(this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED)return this;if(this.session.save("connection_status",Mc.ROOMSTATUS.CONNECTING),await this.refreshDiscoInfo(),!(e=await this.getAndPersistNickname(e)))return nu.safeSave(this.session,{connection_status:Mc.ROOMSTATUS.NICKNAME_REQUIRED}),Cc.settings.get("muc_show_logs_before_join")&&await this.fetchMessages(),this;const n=Ds({from:So.connection.jid,to:this.getRoomJIDAndNick()}).c("x",{xmlns:zs.NS.MUC}).c("history",{maxstanzas:this.features.get("mam_enabled")?0:Cc.settings.get("muc_history_max_stanzas")}).up();return(t=t||this.get("password"))&&n.cnode(zs.xmlElement("password",[],t)),Cc.send(n),this},rejoin(){return this.registerHandlers(),this.clearCache(),this.join()},clearCache(){this.session.save("connection_status",Mc.ROOMSTATUS.DISCONNECTED),this.occupants.length?this.occupants.filter((e=>!e.isMember())).forEach((e=>e.destroy())):this.occupants.clearStore()},sendMarkerForMessage(e,t="displayed",n=!1){if(e&&Cc.settings.get("send_chat_markers").includes(t)&&((null==e?void 0:e.get("is_markable"))||n)){const n="stanza_id ".concat(this.get("jid")),s=e.get(n);if(!s)return void as.error("Can't send marker for message without stanza ID: ".concat(n));zc(zs.getBareJidFromJid(e.get("from")),s,t,e.get("type"))}},enableRAI(){if(Cc.settings.get("muc_subscribe_to_rai")){const e=zs.getDomainFromJid(this.get("jid"));Cc.user.presence.send(null,e,null,Is("rai",{xmlns:zs.NS.RAI}))}},async onHiddenChange(){const e=this.session.get("connection_status");this.get("hidden")&&e===Mc.ROOMSTATUS.ENTERED?Cc.settings.get("muc_subscribe_to_rai")&&"none"!==this.getOwnAffiliation()&&(e!==Mc.ROOMSTATUS.DISCONNECTED&&(this.sendMarkerForLastMessage("received",!0),await this.leave()),this.enableRAI()):e===Mc.ROOMSTATUS.DISCONNECTED&&this.rejoin()},onOccupantAdded(e){So.isInfoVisible(Mc.MUC_TRAFFIC_STATES.ENTERED)&&this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED&&"online"===e.get("show")&&this.updateNotifications(e.get("nick"),Mc.MUC_TRAFFIC_STATES.ENTERED)},onOccupantRemoved(e){So.isInfoVisible(Mc.MUC_TRAFFIC_STATES.EXITED)&&this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED&&"online"===e.get("show")&&this.updateNotifications(e.get("nick"),Mc.MUC_TRAFFIC_STATES.EXITED)},onOccupantShowChanged(e){e.get("states").includes("303")||("offline"===e.get("show")&&So.isInfoVisible(Mc.MUC_TRAFFIC_STATES.EXITED)?this.updateNotifications(e.get("nick"),Mc.MUC_TRAFFIC_STATES.EXITED):"online"===e.get("show")&&So.isInfoVisible(Mc.MUC_TRAFFIC_STATES.ENTERED)&&this.updateNotifications(e.get("nick"),Mc.MUC_TRAFFIC_STATES.ENTERED))},async onRoomEntered(){await this.occupants.fetchMembers(),Cc.settings.get("clear_messages_on_reconnection")?(await this.messages.clearStore(),this.messages.fetched.resolve()):await this.fetchMessages(),Cc.trigger("enteredNewRoom",this),Cc.settings.get("auto_register_muc_nickname")&&await Cc.disco.supports(zs.NS.MUC_REGISTER,this.get("jid"))&&this.registerNickname()},async onConnectionStatusChanged(){this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED&&(this.get("hidden")&&Cc.settings.get("muc_subscribe_to_rai")&&"none"!==this.getOwnAffiliation()?(await this.leave(),this.enableRAI()):await this.onRoomEntered())},async onReconnection(){await this.rejoin(),this.announceReconnection()},getMessagesCollection:()=>new So.ChatRoomMessages,restoreSession(){const e="muc.session-".concat(So.bare_jid,"-").concat(this.get("jid"));return this.session=new Su({id:e}),Cr(this.session,e,"session"),new Promise((e=>this.session.fetch({success:e,error:e})))},initDiscoModels(){let e="converse.muc-features-".concat(So.bare_jid,"-").concat(this.get("jid"));this.features=new ao(Object.assign({id:e},su(Mc.ROOM_FEATURES,Mc.ROOM_FEATURES.map((()=>!1))))),this.features.browserStorage=So.createStore(e,"session"),this.features.listenTo(So,"beforeLogout",(()=>this.features.browserStorage.flush())),e="converse.muc-config-{_converse.bare_jid}-".concat(this.get("jid")),this.config=new ao,this.config.browserStorage=So.createStore(e,"session"),this.config.listenTo(So,"beforeLogout",(()=>this.config.browserStorage.flush()))},initOccupants(){this.occupants=new So.ChatRoomOccupants;const e="converse.occupants-".concat(So.bare_jid).concat(this.get("jid"));this.occupants.browserStorage=So.createStore(e,"session"),this.occupants.chatroom=this,this.occupants.listenTo(So,"beforeLogout",(()=>this.occupants.browserStorage.flush()))},fetchOccupants(){return this.occupants.fetched=new Promise((e=>{this.occupants.fetch({add:!0,silent:!0,success:e,error:e})})),this.occupants.fetched},handleAffiliationChangedMessage(e){const t=qr()('x[xmlns="'.concat(zs.NS.MUC_USER,'"] item'),e).pop();if(t){const n=e.getAttribute("from"),s=e.getAttribute("type"),i=t.getAttribute("affiliation"),r=t.getAttribute("jid"),o={from:n,type:s,affiliation:i,states:[],show:"unavailable"==s?"offline":"online",role:t.getAttribute("role"),jid:zs.getBareJidFromJid(r),resource:zs.getResourceFromJid(r)},a=this.occupants.findOccupant({jid:o.jid});a?a.save(o):this.occupants.create(o)}},async handleErrorMessageStanza(e){const{__:t}=So,n=await cu(e,this,So);if(!await this.shouldShowErrorMessage(n))return;const s=this.getMessageReferencedByError(n);if(s){const e={error:n.error,error_condition:n.error_condition,error_text:n.error_text,error_type:n.error_type,editable:!1};n.msgid===s.get("retraction_id")?(e.retraction_id=void 0,n.error||("forbidden"===n.error_condition?e.error=t("You're not allowed to retract your message."):"not-acceptable"===n.error_condition?e.error=t("Your retraction was not delivered because you're not present in the groupchat."):e.error=t("Sorry, an error occurred while trying to retract your message."))):n.error||("forbidden"===n.error_condition?e.error=t("Your message was not delivered because you weren't allowed to send it."):"not-acceptable"===n.error_condition?e.error=t("Your message was not delivered because you're not present in the groupchat."):e.error=t("Sorry, an error occurred while trying to send your message.")),s.save(e)}else this.createMessage(n)},handleMessageFromMUCHost(e){if(this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED)return;const t=qr()('rai[xmlns="'.concat(zs.NS.RAI,'"]'),e).pop();Array.from((null==t?void 0:t.querySelectorAll("activity"))||[]).map((e=>e.textContent)).includes(this.get("jid"))&&this.save({has_activity:!0,num_unread_general:0})},handleForwardedMentions(e){if(this.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED)return;const t=qr()('mentions[xmlns="'.concat(zs.NS.MENTIONS,'"] forwarded[xmlns="').concat(zs.NS.FORWARD,'"] message[type="groupchat"]'),e),n=this.get("jid"),s=t.filter((e=>zs.getBareJidFromJid(e.getAttribute("from"))===n));s.length&&(this.save({has_activity:!0,num_unread:this.get("num_unread")+s.length}),s.forEach((async e=>{const t={stanza:e,attrs:await cu(e,this,So),chatbox:this};Cc.trigger("message",t)})))},async handleMessageStanza(e){if("groupchat"!==e.getAttribute("type"))return void this.handleForwardedMentions(e);if(tl(e))return as.warn('Received a MAM message with type "groupchat"');this.createInfoMessages(e),this.fetchFeaturesIfConfigurationChanged(e);const t=await cu(e,this,So),n={stanza:e,attrs:t,chatbox:this};return Cc.trigger("message",n),t&&this.queueMessage(t)},registerHandlers(){const e=this.get("jid"),t=zs.getDomainFromJid(e);this.removeHandlers(),this.presence_handler=So.connection.addHandler((e=>this.onPresence(e)||!0),null,"presence",null,null,e,{ignoreNamespaceFragment:!0,matchBareFromJid:!0}),this.domain_presence_handler=So.connection.addHandler((e=>this.onPresenceFromMUCHost(e)||!0),null,"presence",null,null,t),this.message_handler=So.connection.addHandler((e=>!!this.handleMessageStanza(e)||!0),null,"message",null,null,e,{matchBareFromJid:!0}),this.domain_message_handler=So.connection.addHandler((e=>this.handleMessageFromMUCHost(e)||!0),null,"message",null,null,t),this.affiliation_message_handler=So.connection.addHandler((e=>this.handleAffiliationChangedMessage(e)||!0),zs.NS.MUC_USER,"message",null,null,e)},removeHandlers(){return this.message_handler&&(So.connection&&So.connection.deleteHandler(this.message_handler),delete this.message_handler),this.domain_message_handler&&(So.connection&&So.connection.deleteHandler(this.domain_message_handler),delete this.domain_message_handler),this.presence_handler&&(So.connection&&So.connection.deleteHandler(this.presence_handler),delete this.presence_handler),this.domain_presence_handler&&(So.connection&&So.connection.deleteHandler(this.domain_presence_handler),delete this.domain_presence_handler),this.affiliation_message_handler&&(So.connection&&So.connection.deleteHandler(this.affiliation_message_handler),delete this.affiliation_message_handler),this},invitesAllowed(){return Cc.settings.get("allow_muc_invitations")&&(this.features.get("open")||"owner"===this.getOwnAffiliation())},getDisplayName(){return this.get("name")||("hidden"===Cc.settings.get("locked_muc_domain")?zs.getNodeFromJid(this.get("jid")):this.get("jid"))},sendTimedMessage(e){"function"==typeof e.tree&&(e=e.tree());let t=e.getAttribute("id");t||(t=this.getUniqueId("sendIQ"),e.setAttribute("id",t));const n=Et(),s=So.connection.addTimedHandler(So.STANZA_TIMEOUT,(()=>(So.connection.deleteHandler(i),n.reject(new So.TimeoutError("Timeout Error: No response from server")),!1))),i=So.connection.addHandler((e=>{s&&So.connection.deleteTimedHandler(s),"groupchat"===e.getAttribute("type")?n.resolve(e):n.reject(e)}),null,"message",["error","groupchat"],t);return Cc.send(e),n},async retractOwnMessage(e){const t=So.__,n=e.get("origin_id");if(!n)throw new Error("Can't retract message without a XEP-0359 Origin ID");const s=e.get("editable"),i=Ms({id:nu.getUniqueId(),to:this.get("jid"),type:"groupchat"}).c("store",{xmlns:zs.NS.HINTS}).up().c("apply-to",{id:n,xmlns:zs.NS.FASTEN}).c("retract",{xmlns:zs.NS.RETRACT});e.set({retracted:(new Date).toISOString(),retracted_id:n,retraction_id:i.nodeTree.getAttribute("id"),editable:!1});try{await this.sendTimedMessage(i)}catch(n){throw e.save({editable:s,error_type:"timeout",error:t("A timeout happened while while trying to retract your message."),retracted:void 0,retracted_id:void 0}),n}},async retractOtherMessage(e,t){const n=e.get("editable");e.save({moderated:"retracted",moderated_by:So.bare_jid,moderated_id:e.get("msgid"),moderation_reason:t,editable:!1});const s=await this.sendRetractionIQ(e,t);return(null===s||nu.isErrorStanza(s))&&e.save({editable:n,moderated:void 0,moderated_by:void 0,moderated_id:void 0,moderation_reason:void 0}),s},sendRetractionIQ(e,t){const n=Rs({to:this.get("jid"),type:"set"}).c("apply-to",{id:e.get("stanza_id ".concat(this.get("jid"))),xmlns:zs.NS.FASTEN}).c("moderate",{xmlns:zs.NS.MODERATE}).c("retract",{xmlns:zs.NS.RETRACT}).up().c("reason").t(t||"");return Cc.sendIQ(n,null,!1)},sendDestroyIQ(e,t){const n=Is("destroy");t&&n.attrs({jid:t});const s=Rs({to:this.get("jid"),type:"set"}).c("query",{xmlns:zs.NS.MUC_OWNER}).cnode(n.node);return e&&e.length>0&&s.c("reason",e),Cc.sendIQ(s)},async leave(e){var t;this.features.destroy();const n=null===(t=So.disco_entities)||void 0===t?void 0:t.get(this.get("jid"));n&&await new Promise(((e,t)=>n.destroy({success:e,error:t}))),Cc.connection.connected()&&Cc.user.presence.send("unavailable",this.getRoomJIDAndNick(),e),nu.safeSave(this.session,{connection_status:Mc.ROOMSTATUS.DISCONNECTED})},async close(e){return await this.leave(),"unregister"===Cc.settings.get("auto_register_muc_nickname")&&await Cc.disco.supports(zs.NS.MUC_REGISTER,this.get("jid"))&&this.unregisterNickname(),this.occupants.clearStore(),"closeAllChatBoxes"!==(null==e?void 0:e.name)&&Cc.settings.get("muc_clear_messages_on_leave")&&this.clearMessages(),await new Promise((e=>this.session.destroy({success:e,error:(t,n)=>{as.error(n),e()}}))),await new Promise((e=>this.features.destroy({success:e,error:(t,n)=>{as.error(n),e()}}))),So.ChatBox.prototype.close.call(this)},canModerateMessages(){const e=this.getOwnOccupant();return e&&e.isModerator()&&Cc.disco.supports(zs.NS.MODERATE,this.get("jid"))},getAllKnownNicknames(){return[...new Set([...this.occupants.map((e=>e.get("nick"))),...this.messages.map((e=>e.get("nick")))])].filter((e=>e))},getAllKnownNicknamesRegex(){const e=this.getAllKnownNicknames().map((e=>tu.escapeRegexString(e))).join("|");return RegExp("(?:\\p{P}|\\p{Z}|^)@(".concat(e,")(?![\\w@-])"),"uig")},getOccupantByJID(e){return this.occupants.findOccupant({jid:e})},getOccupantByNickname(e){return this.occupants.findOccupant({nick:e})},parseTextForReferences(e){if(!e||!/(\p{P}|\p{Z}|^)([@][\w_-]+(?:\.\w+)*)/giu.test(e))return[e,[]];const t=tu.findFirstMatchInArray(this.getAllKnownNicknames()),n=e=>{const t=this.get("jid"),n=this.getOccupant(e)||this.getOccupant(t),s=this.features.get("nonanonymous")&&(null==n?void 0:n.get("jid"))||"".concat(t,"/").concat(e);return encodeURI("xmpp:".concat(s))},s=this.getAllKnownNicknamesRegex(),i=[...e.matchAll(s)].filter((e=>!e[0].startsWith("/"))).map((e=>{let s=e[0].indexOf("@");"@"===e[0][s+1]&&(s+=1);const i=e.index+s,r=i+e[0].length-s,o=t(e[1]);return{begin:i,end:r,value:o,type:"mention",uri:n(o)}})),[r,o]=tu.reduceTextFromReferences(e,i);return[r,o]},getOutgoingMessageAttributes(e,t){const n=this.get("composing_spoiler"),[s,i]=this.parseTextForReferences(e),r=nu.getUniqueId(),o=s?nu.httpToGeoUri(nu.shortnamesToUnicode(s),So):void 0;return{body:o,is_spoiler:n,origin_id:r,references:i,id:r,msgid:r,from:"".concat(this.get("jid"),"/").concat(this.get("nick")),fullname:this.get("nick"),is_only_emojis:!!s&&nu.isOnlyEmojis(s),message:o,nick:this.get("nick"),sender:"me",spoiler_hint:n?t:void 0,type:"groupchat"}},getRoomJIDAndNick(){const e=this.get("nick");return zs.getBareJidFromJid(this.get("jid"))+(null!==e?"/".concat(e):"")},sendChatState(){if(!Cc.settings.get("send_chat_state_notifications")||!this.get("chat_state")||this.session.get("connection_status")!==Mc.ROOMSTATUS.ENTERED||this.features.get("moderated")&&"visitor"===this.getOwnRole())return;const e=Cc.settings.get("send_chat_state_notifications");if(Array.isArray(e)&&!e.includes(this.get("chat_state")))return;const t=this.get("chat_state");t!==So.GONE&&Cc.send(Ms({to:this.get("jid"),type:"groupchat"}).c(t,{xmlns:zs.NS.CHATSTATES}).up().c("no-store",{xmlns:zs.NS.HINTS}).up().c("no-permanent-store",{xmlns:zs.NS.HINTS}))},directInvite(e,t){this.features.get("membersonly")&&this.updateMemberLists([{jid:e,affiliation:"member",reason:t}]);const n={xmlns:"jabber:x:conference",jid:this.get("jid")};null!==t&&(n.reason=t),this.get("password")&&(n.password=this.get("password"));const s=Ms({from:So.connection.jid,to:e,id:nu.getUniqueId()}).c("x",n);Cc.send(s),Cc.trigger("roomInviteSent",{room:this,recipient:e,reason:t})},refreshDiscoInfo(){return Cc.disco.refresh(this.get("jid")).then((()=>this.getDiscoInfo())).catch((e=>as.error(e)))},getDiscoInfo(){return Cc.disco.getIdentity("conference","text",this.get("jid")).then((e=>this.save({name:null==e?void 0:e.get("name")}))).then((()=>this.getDiscoInfoFields())).then((()=>this.getDiscoInfoFeatures())).catch((e=>as.error(e)))},async getDiscoInfoFields(){const e=(await Cc.disco.getFields(this.get("jid"))).reduce(((e,t)=>{const n=t.get("var");return n&&n.startsWith("muc#roominfo_")&&(e[n.replace("muc#roominfo_","")]=t.get("value")),e}),{});this.config.save(e)},async getDiscoInfoFeatures(){const e=await Cc.disco.getFeatures(this.get("jid")),t=Object.assign(su(Mc.ROOM_FEATURES,Mc.ROOM_FEATURES.map((()=>!1))),{fetched:(new Date).toISOString()});e.each((e=>{const n=e.get("var");n.startsWith("muc_")?t[n.replace("muc_","")]=!0:n===zs.NS.MAM&&(t.mam_enabled=!0)})),this.features.save(t)},addFieldValue(e){const t=e.getAttribute("type");if("fixed"===t)return e;const n=e.getAttribute("var").replace("muc#roomconfig_",""),s=this.get("roomconfig");if(n in s){let i;switch(t){case"boolean":i=[s[n]?1:0];break;case"list-multi":i=s[n];break;default:i=[s[n]]}e.innerHTML=i.map((e=>Is("value").t(e))).join("")}return e},async autoConfigureChatRoom(){const e=await this.fetchRoomConfiguration(),t=qr()("field",e).map((e=>this.addFieldValue(e)));if(t.length)return this.sendConfiguration(t)},fetchRoomConfiguration(){return Cc.sendIQ(Rs({to:this.get("jid"),type:"get"}).c("query",{xmlns:zs.NS.MUC_OWNER}))},sendConfiguration(e=[]){const t=Rs({to:this.get("jid"),type:"set"}).c("query",{xmlns:zs.NS.MUC_OWNER}).c("x",{xmlns:zs.NS.XFORM,type:"submit"});return e.forEach((e=>t.cnode(e).up())),Cc.sendIQ(t)},onCommandError(e){const{__:t}=So;as.fatal(e);const n=t("Sorry, an error happened while running the command.")+" "+t("Check your browser's developer console for details.");this.createMessage({message:n,type:"error"})},getNickOrJIDFromCommandArgs(e){const{__:t}=So;if(nu.isValidJID(e.trim()))return e.trim();e.startsWith("@")||(e="@"+e);const[n,s]=this.parseTextForReferences(e);if(!s.length){const e=t("Error: couldn't find a groupchat participant based on your arguments");return void this.createMessage({message:e,type:"error"})}if(s.length>1){const e=t("Error: found multiple groupchat participant based on your arguments");return void this.createMessage({message:e,type:"error"})}const i=s.pop().value,r=e.split(i,2)[1];if(!r||r.startsWith(" "))return i;{const e=t("Error: couldn't find a groupchat participant based on your arguments");this.createMessage({message:e,type:"error"})}},validateRoleOrAffiliationChangeArgs(e,t){const{__:n}=So;if(!t){const t=n('Error: the "%1$s" command takes two arguments, the user\'s nickname and optionally a reason.',e);return this.createMessage({message:t,type:"error"}),!1}return!0},getAllowedCommands(){let e=["clear","help","me","nick","register"];(this.config.get("changesubject")||["owner","admin"].includes(this.getOwnAffiliation()))&&(e=[...e,"subject","topic"]);const t=this.occupants.findWhere({jid:So.bare_jid});return this.verifyAffiliations(["owner"],t,!1)?e=e.concat(pu).concat(vu):this.verifyAffiliations(["admin"],t,!1)&&(e=e.concat(vu)),this.verifyRoles(["moderator"],t,!1)?e=e.concat(bu).concat(yu):this.verifyRoles(["visitor","participant","moderator"],t,!1)||(e=e.concat(yu)),e.sort(),Array.isArray(Cc.settings.get("muc_disable_slash_commands"))?e.filter((e=>!Cc.settings.get("muc_disable_slash_commands").includes(e))):e},verifyAffiliations(e,t,n=!0){const{__:s}=So;if(!Array.isArray(e))throw new TypeError("affiliations must be an Array");if(!e.length)return!0;if(t=t||this.occupants.findWhere({jid:So.bare_jid})){const n=t.get("affiliation");if(e.includes(n))return!0}if(n){const e=s("Forbidden: you do not have the necessary affiliation in order to do that.");this.createMessage({message:e,type:"error"})}return!1},verifyRoles(e,t,n=!0){const{__:s}=So;if(!Array.isArray(e))throw new TypeError("roles must be an Array");if(!e.length)return!0;if(t=t||this.occupants.findWhere({jid:So.bare_jid})){const n=t.get("role");if(e.includes(n))return!0}if(n){const e=s("Forbidden: you do not have the necessary role in order to do that.");this.createMessage({message:e,type:"error"})}return!1},getOwnRole(){var e,t;return null===(e=this.getOwnOccupant())||void 0===e||null===(t=e.attributes)||void 0===t?void 0:t.role},getOwnAffiliation(){var e,t;return(null===(e=this.getOwnOccupant())||void 0===e||null===(t=e.attributes)||void 0===t?void 0:t.affiliation)||"none"},getOwnOccupant(){return this.occupants.findWhere({jid:So.bare_jid})},setRole(e,t,n,s,i){const r=Is("item",{nick:e.get("nick"),role:t}),o=Rs({to:this.get("jid"),type:"set"}).c("query",{xmlns:zs.NS.MUC_ADMIN}).cnode(r.node);return null!==n&&o.c("reason",n),Cc.sendIQ(o).then(s).catch(i)},getOccupant(e){return nu.isValidJID(e)?this.getOccupantByJID(e):this.getOccupantByNickname(e)},getOccupantsWithRole(e){return this.getOccupantsSortedBy("nick").filter((t=>t.get("role")===e)).map((e=>({jid:e.get("jid"),nick:e.get("nick"),role:e.get("role")})))},getOccupantsWithAffiliation(e){return this.getOccupantsSortedBy("nick").filter((t=>t.get("affiliation")===e)).map((e=>({jid:e.get("jid"),nick:e.get("nick"),affiliation:e.get("affiliation")})))},getOccupantsSortedBy(e){return Array.from(this.occupants.models).sort(((t,n)=>t.get(e)<n.get(e)?-1:t.get(e)>n.get(e)?1:0))},async updateMemberLists(e){const t=this.get("jid"),n=(await Promise.all(["member","admin","owner"].map((e=>hu(e,t))))).reduce(((e,t)=>nu.isErrorObject(t)?e:[...t,...e]),[]);await fu(t,mu(!0,!1,e,n)),await this.occupants.fetchMembers()},async getAndPersistNickname(e){return(e=e||this.get("nick")||await this.getReservedNick()||So.getDefaultMUCNickname())&&this.save({nick:e},{silent:!0}),e},async getReservedNick(){const e=Rs({to:this.get("jid"),from:So.connection.jid,type:"get"}).c("query",{xmlns:zs.NS.DISCO_INFO,node:"x-roomuser-item"}),t=await Cc.sendIQ(e,null,!1);if(nu.isErrorObject(t))throw t;const n=t.querySelector('query[node="x-roomuser-item"] identity');return n?n.getAttribute("name"):null},async registerNickname(){const{__:e}=So,t=this.get("nick"),n=this.get("jid");let s,i;try{s=await Cc.sendIQ(Rs({to:n,type:"get"}).c("query",{xmlns:zs.NS.MUC_REGISTER}))}catch(t){return qr()('not-allowed[xmlns="'.concat(zs.NS.STANZAS,'"]'),t).length?i=e("You're not allowed to register yourself in this groupchat."):qr()('registration-required[xmlns="'.concat(zs.NS.STANZAS,'"]'),t).length&&(i=e("You're not allowed to register in this groupchat because it's members-only.")),as.error(t),i}const r=qr()("field required",s).map((e=>e.parentElement));if(r.length>1&&"muc#register_roomnick"!==r[0].getAttribute("var"))return as.error("Can't register the user register in the groupchat ".concat(n," due to the required fields"));try{await Cc.sendIQ(Rs({to:n,type:"set"}).c("query",{xmlns:zs.NS.MUC_REGISTER}).c("x",{xmlns:zs.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE"}).c("value").t("http://jabber.org/protocol/muc#register").up().up().c("field",{var:"muc#register_roomnick"}).c("value").t(t))}catch(t){return qr()('service-unavailable[xmlns="'.concat(zs.NS.STANZAS,'"]'),t).length?i=e("Can't register your nickname in this groupchat, it doesn't support registration."):qr()('bad-request[xmlns="'.concat(zs.NS.STANZAS,'"]'),t).length&&(i=e("Can't register your nickname in this groupchat, invalid data form supplied.")),as.error(i),as.error(t),i}},async unregisterNickname(){const e=this.get("jid");let t;try{t=await Cc.sendIQ(Rs({to:e,type:"set"}).c("query",{xmlns:zs.NS.MUC_REGISTER}))}catch(e){return as.error(e),e}if(qr()('query[xmlns="'.concat(zs.NS.MUC_REGISTER,'"] registered'),t).pop()){const t=Rs({to:e,type:"set"}).c("query",{xmlns:zs.NS.MUC_REGISTER}).c("remove");return Cc.sendIQ(t).catch((e=>as.error(e)))}},updateOccupantsOnPresence(e){var t,n;const s=function(e){const t=e.getAttribute("from"),n=e.getAttribute("type"),s={from:t,nick:iu.getResourceFromJid(t),type:n,states:[],hats:[],show:"unavailable"!==n?"online":"offline"};return Array.from(e.children).forEach((e=>{if(e.matches("status"))s.status=e.textContent||null;else if(e.matches("show"))s.show=e.textContent||"online";else if(e.matches("x")&&e.getAttribute("xmlns")===iu.NS.MUC_USER)Array.from(e.children).forEach((e=>{"item"===e.nodeName?(s.affiliation=e.getAttribute("affiliation"),s.role=e.getAttribute("role"),s.jid=e.getAttribute("jid"),s.nick=e.getAttribute("nick")||s.nick):"status"==e.nodeName&&e.getAttribute("code")&&s.states.push(e.getAttribute("code"))}));else if(e.matches("x")&&e.getAttribute("xmlns")===iu.NS.VCARDUPDATE){var t;s.image_hash=null===(t=e.querySelector("photo"))||void 0===t?void 0:t.textContent}else e.matches("hats")&&e.getAttribute("xmlns")===iu.NS.MUC_HATS&&(s.hats=Array.from(e.children).map((e=>e.matches("hat")&&{title:e.getAttribute("title"),uri:e.getAttribute("uri")})))})),s}(e);if("error"===s.type||!s.jid&&!s.nick)return!0;const i=this.occupants.findOccupant(s);if("unavailable"===s.type&&i&&!s.states.includes(Mc.MUC_NICK_CHANGED_CODE)&&!["admin","owner","member"].includes(s.affiliation))return i.set(s),void i.destroy();const r=s.jid||"",o=Object.assign(s,{jid:zs.getBareJidFromJid(r)||(null==i||null===(t=i.attributes)||void 0===t?void 0:t.jid),resource:zs.getResourceFromJid(r)||(null==i||null===(n=i.attributes)||void 0===n?void 0:n.resource)});i?i.save(o):this.occupants.create(o)},fetchFeaturesIfConfigurationChanged(e){const t=["104","170","171","172","173","174"];qr()("status",e).filter((e=>t.includes(e.getAttribute("status")))).length&&this.refreshDiscoInfo()},isSameUser(e,t){const n=zs.getBareJidFromJid(e),s=zs.getBareJidFromJid(t),i=zs.getResourceFromJid(e),r=zs.getResourceFromJid(t);return nu.isSameBareJID(e,t)?n!==this.get("jid")||i===r:(n===this.get("jid")?this.occupants.findOccupant({nick:i}):this.occupants.findOccupant({jid:n}))===(s===this.get("jid")?this.occupants.findOccupant({nick:r}):this.occupants.findOccupant({jid:s}))},async isSubjectHidden(){return(await Cc.user.settings.get("mucs_with_hidden_subject",[])).includes(this.get("jid"))},async toggleSubjectHiddenState(){const e=this.get("jid"),t=await Cc.user.settings.get("mucs_with_hidden_subject",[]);t.includes(this.get("jid"))?Cc.user.settings.set("mucs_with_hidden_subject",t.filter((t=>t!==e))):Cc.user.settings.set("mucs_with_hidden_subject",[...t,e])},async handleSubjectChange(e){const t=So.__;if("string"==typeof e.subject&&!e.thread&&!e.message){const n=e.subject,s=e.nick;if(nu.safeSave(this,{subject:{author:s,text:e.subject||""}}),!e.is_delayed&&s){const i=t(n?"Topic set by %1$s":"Topic cleared by %1$s",s),r=this.messages.last();(null==r?void 0:r.get("nick"))===e.nick&&"info"===(null==r?void 0:r.get("type"))&&(null==r?void 0:r.get("message"))===i||this.createMessage({message:i,nick:e.nick,type:"info"}),await this.isSubjectHidden()&&this.toggleSubjectHiddenState()}return!0}return!1},setSubject(e=""){Cc.send(Ms({to:this.get("jid"),from:So.connection.jid,type:"groupchat"}).c("subject",{xmlns:"jabber:client"}).t(e).tree())},ignorableCSN(e){return e.chat_state&&!e.body&&(e.is_delayed||this.isOwnMessage(e))},isOwnMessage(e){let t;return t=es(e)?e.getAttribute("from"):e instanceof So.Message?e.get("from"):e.from,zs.getResourceFromJid(t)==this.get("nick")},getUpdatedMessageAttributes(e,t){const n=So.ChatBox.prototype.getUpdatedMessageAttributes.call(this,e,t);if(this.isOwnMessage(t)){const s=Object.keys(t).filter((e=>e.startsWith("stanza_id")));Object.assign(n,Pr(t,s)),e.get("received")||(n.received=(new Date).toISOString())}return n},async isJoined(){const e=this.get("jid"),t=Rs({to:"".concat(e,"/").concat(this.get("nick")),type:"get"}).c("ping",{xmlns:zs.NS.PING});try{await Cc.sendIQ(t)}catch(t){return null===t?as.warn("isJoined: Timeout error while checking whether we're joined to MUC: ".concat(e)):as.warn("isJoined: Apparently we're no longer connected to MUC: ".concat(e)),!1}return!0},async rejoinIfNecessary(){if(!await this.isJoined())return this.rejoin(),!0},async shouldShowErrorMessage(e){return("not-acceptable"!==e.error_condition||!await this.rejoinIfNecessary())&&So.ChatBox.prototype.shouldShowErrorMessage.call(this,e)},findDanglingModeration(e){if(!this.messages.length)return null;if(this.messages.last().get("time")>e.time){const t=Array.from(this.messages.models),n=e["stanza_id ".concat(this.get("jid"))];return n?(t.reverse(),t.find((({attributes:e})=>"retracted"===e.moderated&&e.moderated_id===n&&e.moderated_by))):null}},async handleModeration(e){const t=["editable","moderated","moderated_by","moderated_id","moderation_reason"];if("retracted"===e.moderated){const n={};n["stanza_id ".concat(this.get("jid"))]=e.moderated_id;const s=this.messages.findWhere(n);return s?(s.save(Pr(e,t)),!0):(e.dangling_moderation=!0,await this.createMessage(e),!0)}{const n=this.findDanglingModeration(e);if(n){const s=Pr(n.attributes,t),i=Object.assign({dangling_moderation:!1},e,s);return delete i.id,n.save(i),!0}}return!1},getNotificationsText(){const{__:e}=So,t=this.notifications.toJSON(),n=Cc.settings.get("muc_show_info_messages").filter((e=>Mc.MUC_ROLE_CHANGES_LIST.includes(e))),s=Cc.settings.get("muc_show_info_messages").filter((e=>Mc.MUC_TRAFFIC_STATES_LIST.includes(e)));return[...Mc.CHAT_STATES,...s,...n].reduce(((n,s)=>{const i=t[s];if(!(null==i?void 0:i.length))return n;const r=i.map((e=>{var t;return(null===(t=this.getOccupant(e))||void 0===t?void 0:t.getDisplayName())||e}));if(1===r.length){if("composing"===s)return"".concat(n).concat(e("%1$s is typing",r[0]),"\n");if("paused"===s)return"".concat(n).concat(e("%1$s has stopped typing",r[0]),"\n");if(s===So.GONE)return"".concat(n).concat(e("%1$s has gone away",r[0]),"\n");if("entered"===s)return"".concat(n).concat(e("%1$s has entered the groupchat",r[0]),"\n");if("exited"===s)return"".concat(n).concat(e("%1$s has left the groupchat",r[0]),"\n");if("op"===s)return"".concat(n).concat(e("%1$s is now a moderator",r[0]),"\n");if("deop"===s)return"".concat(n).concat(e("%1$s is no longer a moderator",r[0]),"\n");if("voice"===s)return"".concat(n).concat(e("%1$s has been given a voice",r[0]),"\n");if("mute"===s)return"".concat(n).concat(e("%1$s has been muted",r[0]),"\n")}else if(r.length>1){let t;if(r.length>3)t="".concat(Array.from(r).slice(0,2).join(", ")," and others");else{const n=r.pop();t=e("%1$s and %2$s",r.join(", "),n)}if("composing"===s)return"".concat(n).concat(e("%1$s are typing",t),"\n");if("paused"===s)return"".concat(n).concat(e("%1$s have stopped typing",t),"\n");if(s===So.GONE)return"".concat(n).concat(e("%1$s have gone away",t),"\n");if("entered"===s)return"".concat(n).concat(e("%1$s have entered the groupchat",t),"\n");if("exited"===s)return"".concat(n).concat(e("%1$s have left the groupchat",t),"\n");if("op"===s)return"".concat(n).concat(e("%1$s are now moderators",r[0]),"\n");if("deop"===s)return"".concat(n).concat(e("%1$s are no longer moderators",r[0]),"\n");if("voice"===s)return"".concat(n).concat(e("%1$s have been given voices",r[0]),"\n");if("mute"===s)return"".concat(n).concat(e("%1$s have been muted",r[0]),"\n")}return n}),"")},removeNotification(e,t){const n=this.notifications.toJSON();(t=Array.isArray(t)?t:[t]).forEach((t=>{const s=Array.from(n[t]||[]);if(s.includes(e)){const n=s.indexOf(e);s.splice(n,1),this.notifications.set(t,Array.from(s))}}))},updateNotifications(e,t){const n=this.notifications.toJSON(),s=n[t]||[];if(s.includes(e))return;const i=(i,r)=>(i[r]=r===t?[...s,e]:(n[r]||[]).filter((t=>t!==e)),i),r=Mc.CHAT_STATES.reduce(i,{}),o=Mc.MUC_TRAFFIC_STATES_LIST.reduce(i,{}),a=Mc.MUC_ROLE_CHANGES_LIST.reduce(i,{});this.notifications.set(Object.assign(r,o,a)),window.setTimeout((()=>this.removeNotification(e,t)),1e4)},handleMetadataFastening(e){if(!Cc.settings.get("muc_show_ogp_unfurls"))return!1;if(e.ogp_for_id){if(e.from!==this.get("jid"))return!1;const t=this.messages.findWhere({origin_id:e.ogp_for_id});if(t){const n=t.get("ogp_metadata")||[];if(n.filter((t=>t["og:url"]===e["og:url"])).length)return!1;const s=[...n,Pr(e,_u)];return t.save("ogp_metadata",s),!0}}return!1},async onMessage(e){if(e=await e,nu.isErrorObject(e))return e.stanza&&as.error(e.stanza),as.error(e.message);const t=this.getDuplicateMessage(e);if(t)return this.updateMessage(t,e);if(!(e.is_valid_receipt_request||e.is_marker||this.ignorableCSN(e)))if(this.handleMetadataFastening(e)||await this.handleRetraction(e)||await this.handleModeration(e)||await this.handleSubjectChange(e))e.nick&&this.removeNotification(e.nick,["composing","paused"]);else if(this.setEditable(e,e.time),e.chat_state&&this.updateNotifications(e.nick,e.chat_state),nu.shouldCreateGroupchatMessage(e)){const t=this.handleCorrection(e)||await this.createMessage(e);this.removeNotification(e.nick,["composing","paused"]),this.handleUnreadMessage(t)}},handleModifyError(e){var t;const n=null===(t=e.querySelector("error text"))||void 0===t?void 0:t.textContent;if(n)if(this.session.get("connection_status")===Mc.ROOMSTATUS.CONNECTING)this.setDisconnectionState(n);else{const e={type:"error",message:n,is_ephemeral:!0};this.createMessage(e)}},handleDisconnection(e){var t;const n=null!==e.querySelector("status[code='110']"),s=qr()('x[xmlns="'.concat(zs.NS.MUC_USER,'"]'),e).pop();if(!s)return;const i=Object.keys(So.muc.disconnect_messages),r=qr()("status",s).map((e=>e.getAttribute("code"))).filter((e=>i.includes(e)));if(!(n&&r.length>0))return;const o=s.querySelector("item"),a=o?null===(t=o.querySelector("reason"))||void 0===t?void 0:t.textContent:void 0,c=o?No(o.querySelector("actor"),"getAttribute","nick"):void 0,l=So.muc.disconnect_messages[r[0]],u=r.includes("301")?Mc.ROOMSTATUS.BANNED:Mc.ROOMSTATUS.DISCONNECTED;this.setDisconnectionState(l,a,c,u)},getActionInfoMessage(e,t,n){const s=So.__;return"301"===e?n?s("%1$s has been banned by %2$s",t,n):s("%1$s has been banned",t):"303"===e?s("%1$s's nickname has changed",t):"307"===e?n?s("%1$s has been kicked out by %2$s",t,n):s("%1$s has been kicked out",t):"321"===e?s("%1$s has been removed because of an affiliation change",t):"322"===e?s("%1$s has been removed for not being a member",t):void 0},createAffiliationChangeMessage(e){const t=So.__,n=e._previousAttributes.affiliation;if(!n)return;const s=e.get("affiliation");"admin"===n&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.EXADMIN)?this.createMessage({type:"info",message:t("%1$s is no longer an admin of this groupchat",e.get("nick"))}):"owner"===n&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.EXOWNER)?this.createMessage({type:"info",message:t("%1$s is no longer an owner of this groupchat",e.get("nick"))}):"outcast"===n&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.EXOUTCAST)&&this.createMessage({type:"info",message:t("%1$s is no longer banned from this groupchat",e.get("nick"))}),"none"===s&&"member"===n&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.EXMEMBER)&&this.createMessage({type:"info",message:t("%1$s is no longer a member of this groupchat",e.get("nick"))}),"member"===s&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.MEMBER)?this.createMessage({type:"info",message:t("%1$s is now a member of this groupchat",e.get("nick"))}):("admin"===s&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.ADMIN)||"owner"==s&&So.isInfoVisible(Mc.AFFILIATION_CHANGES.OWNER))&&this.createMessage({type:"info",message:t("%1$s is now an %2$s of this groupchat",e.get("nick"),s)})},createRoleChangeMessage(e,t){if("none"===t||e.changed.affiliation)return;const n=e._previousAttributes.role;"moderator"===n&&So.isInfoVisible(Mc.MUC_ROLE_CHANGES.DEOP)?this.updateNotifications(e.get("nick"),Mc.MUC_ROLE_CHANGES.DEOP):"visitor"===n&&So.isInfoVisible(Mc.MUC_ROLE_CHANGES.VOICE)&&this.updateNotifications(e.get("nick"),Mc.MUC_ROLE_CHANGES.VOICE),"visitor"===e.get("role")&&So.isInfoVisible(Mc.MUC_ROLE_CHANGES.MUTE)?this.updateNotifications(e.get("nick"),Mc.MUC_ROLE_CHANGES.MUTE):"moderator"===e.get("role")&&!["owner","admin"].includes(e.get("affiliation"))&&So.isInfoVisible(Mc.MUC_ROLE_CHANGES.OP)&&this.updateNotifications(e.get("nick"),Mc.MUC_ROLE_CHANGES.OP)},createInfoMessage(e,t,n){const s=So.__,i={type:"info"};if(So.isInfoVisible(e)&&"110"!==e&&("100"!==e||n)){if(e in So.muc.info_messages)i.message=So.muc.info_messages[e];else if(!n&&wu.includes(e)){var r,o;const n=zs.getResourceFromJid(t.getAttribute("from")),s=qr()('x[xmlns="'.concat(zs.NS.MUC_USER,'"] item'),t).pop();i.actor=s?null===(r=s.querySelector("actor"))||void 0===r?void 0:r.getAttribute("nick"):void 0,i.reason=s?null===(o=s.querySelector("reason"))||void 0===o?void 0:o.textContent:void 0,i.message=this.getActionInfoMessage(e,n,i.actor)}else if(n&&e in So.muc.new_nickname_messages){let r;n&&"210"===e?r=zs.getResourceFromJid(t.getAttribute("from")):n&&"303"===e&&(r=qr()('x[xmlns="'.concat(zs.NS.MUC_USER,'"] item'),t).pop().getAttribute("nick")),this.save("nick",r),i.message=s(So.muc.new_nickname_messages[e],r)}if(i.message){if("201"===e&&this.messages.findWhere(i))return;if(e in So.muc.info_messages&&this.messages.length&&this.messages.pop().get("message")===i.message)return;this.createMessage(i)}}},createInfoMessages(e){const t=qr()('x[xmlns="'.concat(zs.NS.MUC_USER,'"] status'),e).map((e=>e.getAttribute("code")));t.includes("333")&&t.includes("307")&&t.splice(t.indexOf("307"),1);const n=t.includes("110");t.forEach((t=>this.createInfoMessage(t,e,n)))},setDisconnectionState(e,t,n,s=Mc.ROOMSTATUS.DISCONNECTED){this.session.save({connection_status:s,disconnection_actor:n,disconnection_message:e,disconnection_reason:t})},onNicknameClash(e){const t=So.__;if(Cc.settings.get("muc_nickname_from_jid")){const t=e.getAttribute("from").split("/")[1];if(t===So.getDefaultMUCNickname())this.join(t+"-2");else{const e=t.lastIndexOf("-"),n=t.substring(e+1,t.length);this.join(t.substring(0,e+1)+String(Number(n)+1))}}else this.save({nickname_validation_message:t("The nickname you chose is reserved or currently in use, please choose a different one.")}),this.session.save({connection_status:Mc.ROOMSTATUS.NICKNAME_REQUIRED})},onErrorPresence(e){var t;const n=So.__,s=e.querySelector("error"),i=s.getAttribute("type"),r=null===(t=qr()('text[xmlns="'.concat(zs.NS.STANZAS,'"]'),s).pop())||void 0===t?void 0:t.textContent;if("modify"===i)this.handleModifyError(e);else if("auth"===i)if(qr()('not-authorized[xmlns="'.concat(zs.NS.STANZAS,'"]'),s).length&&(this.save({password_validation_message:r||n("Password incorrect")}),this.session.save({connection_status:Mc.ROOMSTATUS.PASSWORD_REQUIRED})),s.querySelector("registration-required")){const e=n("You are not on the member list of this groupchat.");this.setDisconnectionState(e,r)}else s.querySelector("forbidden")&&this.setDisconnectionState(So.muc.disconnect_messages[301],r,null,Mc.ROOMSTATUS.BANNED);else if("cancel"===i)if(s.querySelector("not-allowed")){const e=n("You are not allowed to create new groupchats.");this.setDisconnectionState(e,r)}else if(s.querySelector("not-acceptable")){const e=n("Your nickname doesn't conform to this groupchat's policies.");this.setDisconnectionState(e,r)}else if(qr()('gone[xmlns="'.concat(zs.NS.STANZAS,'"]'),s).length){var o;const e=null===(o=qr()('gone[xmlns="'.concat(zs.NS.STANZAS,'"]'),s).pop())||void 0===o?void 0:o.textContent.replace(/^xmpp:/,"").replace(/\?join$/,"");this.save({moved_jid:e,destroyed_reason:r}),this.session.save({connection_status:Mc.ROOMSTATUS.DESTROYED})}else if(s.querySelector("conflict"))this.onNicknameClash(e);else if(s.querySelector("item-not-found")){const e=n("This groupchat does not (yet) exist.");this.setDisconnectionState(e,r)}else if(s.querySelector("service-unavailable")){const e=n("This groupchat has reached its maximum number of participants.");this.setDisconnectionState(e,r)}else if(s.querySelector("remote-server-not-found")){const e=n("Remote server not found"),t=r?n('The explanation given is: "%1$s".',r):void 0;this.setDisconnectionState(e,t)}},onPresenceFromMUCHost(e){if("error"===e.getAttribute("type")){const t=e.querySelector("error");"wait"===(null==t?void 0:t.getAttribute("type"))&&(null==t?void 0:t.querySelector("resource-constraint"))&&this.session.get("connection_status")===Mc.ROOMSTATUS.DISCONNECTED&&this.rejoin()}},onPresence(e){if("error"===e.getAttribute("type"))return this.onErrorPresence(e);this.createInfoMessages(e),e.querySelector("status[code='110']")?(this.onOwnPresence(e),"none"!==this.getOwnRole()&&this.session.get("connection_status")===Mc.ROOMSTATUS.CONNECTING&&this.session.save("connection_status",Mc.ROOMSTATUS.CONNECTED)):this.updateOccupantsOnPresence(e)},async onOwnPresence(e){await this.occupants.fetched;const t=this.session.get("connection_status");if("unavailable"!==e.getAttribute("type")&&t!==Mc.ROOMSTATUS.ENTERED?(this.session.save("connection_status",Mc.ROOMSTATUS.ENTERED,{silent:!0}),this.updateOccupantsOnPresence(e),this.session.trigger("change:connection_status",this.session,t)):this.updateOccupantsOnPresence(e),"unavailable"!==e.getAttribute("type")){if(e.querySelector("status[code='201']"))if(this.get("auto_configure"))this.autoConfigureChatRoom().then((()=>this.refreshDiscoInfo()));else{if(!Cc.settings.get("muc_instant_rooms"))return void this.session.save({view:Mc.MUC.VIEWS.CONFIG});this.sendConfiguration().then((()=>this.refreshDiscoInfo()))}else this.features.get("fetched")||("owner"===this.getOwnAffiliation()&&this.get("auto_configure")?this.autoConfigureChatRoom().then((()=>this.refreshDiscoInfo())):this.getDiscoInfo());this.session.save({connection_status:Mc.ROOMSTATUS.ENTERED})}else this.handleDisconnection(e)},isUserMentioned(e){const t=this.get("nick");return e.get("references").length?e.get("references").filter((e=>"mention"===e.type)).map((e=>e.value)).includes(t):new RegExp("\\b".concat(t,"\\b")).test(e.get("message"))},handleUnreadMessage(e){if((null==e?void 0:e.get("body"))&&nu.isNewMessage(e))if("me"===e.get("sender"))this.model.set("scrolled",!1);else if(this.isHidden()||this.get("scrolled")){const t={num_unread_general:this.get("num_unread_general")+1};0===this.get("num_unread_general")&&(t.first_unread_id=e.get("id")),this.isUserMentioned(e)&&(t.num_unread=this.get("num_unread")+1),this.save(t)}else this.sendMarkerForMessage(e)},clearUnreadMsgCounter(){(this.get("num_unread_general")>0||this.get("num_unread")>0||this.get("has_activity"))&&this.sendMarkerForMessage(this.messages.last()),nu.safeSave(this,{has_activity:!1,num_unread:0,num_unread_general:0})}},Eu=ao.extend({defaults:{hats:[],show:"offline",states:[]},initialize(e){this.set(Object.assign({id:nu.getUniqueId()},e)),this.on("change:image_hash",this.onAvatarChanged,this)},onAvatarChanged(){const e=this.get("image_hash"),t=[];this.get("jid")&&t.push(So.vcards.findWhere({jid:this.get("jid")})),t.push(So.vcards.findWhere({jid:this.get("from")})),t.filter((e=>e)).forEach((t=>{e&&t.get("image_hash")!==e&&Cc.vcard.update(t,!0)}))},getDisplayName(){return this.get("nick")||this.get("jid")},isMember(){return["admin","owner","member"].includes(this.get("affiliation"))},isModerator(){return["admin","owner"].includes(this.get("affiliation"))||"moderator"===this.get("role")},isSelf(){return this.get("states").includes("110")}}),ju={moderator:1,participant:2,visitor:3,none:2},Au=ua.extend({model:Eu,comparator(e,t){const n=e.get("role")||"none",s=t.get("role")||"none";if(ju[n]===ju[s]){const n=e.getDisplayName().toLowerCase(),s=t.getDisplayName().toLowerCase();return n<s?-1:n>s?1:0}return ju[n]<ju[s]?-1:1},getAutoFetchedAffiliationLists(){const e=Cc.settings.get("muc_fetch_members");return Array.isArray(e)?e:e?["member","admin","owner"]:[]},async fetchMembers(){const e=this.getAutoFetchedAffiliationLists();if(0===e.length)return;const t=this.chatroom.get("jid"),n=await Promise.all(e.map((e=>hu(e,t)))),s=n.reduce(((e,t)=>nu.isErrorObject(t)?e:[...t,...e]),[]),i=e.filter((t=>!nu.isErrorObject(n[e.indexOf(t)]))),r=s.map((e=>e.jid)).filter((e=>void 0!==e)),o=s.map((e=>!e.jid&&e.nick||void 0)).filter((e=>void 0!==e));this.filter((e=>i.includes(e.get("affiliation"))&&!o.includes(e.get("nick"))&&!r.includes(e.get("jid")))).forEach((e=>{e.get("jid")!==So.bare_jid&&("offline"===e.get("show")?e.destroy():e.save("affiliation",null))})),s.forEach((e=>{const t=e.jid?this.findOccupant({jid:e.jid}):this.findOccupant({nick:e.nick});t?t.save(e):this.create(e)})),Cc.trigger("membersFetched")},findOccupant(e){const t=zs.getBareJidFromJid(e.jid);return t&&this.findWhere({jid:t})||this.findWhere({nick:e.nick})}}),Cu={affiliations:{set:(e,t)=>(t=Array.isArray(t)?t:[t],fu(e=Array.isArray(e)?e:[e],t))}},ku={rooms:{create(e,t={}){if(!(t="string"==typeof t?{nick:t}:t||{}).nick&&Cc.settings.get("muc_nickname_from_jid")&&(t.nick=zs.getNodeFromJid(So.bare_jid)),void 0===e)throw new TypeError("rooms.create: You need to provide at least one JID");return"string"==typeof e?Cc.rooms.get(nu.getJIDFromURI(e),t,!0):e.map((e=>Cc.rooms.get(nu.getJIDFromURI(e),t,!0)))},async open(e,t={},n=!1){if(await Cc.waitUntil("chatBoxesFetched"),void 0===e){const e="rooms.open: You need to provide at least one JID";throw as.error(e),new TypeError(e)}if("string"==typeof e){const s=await Cc.rooms.get(e,t,!0);return!t.hidden&&(null==s||s.maybeShow(n)),s}{const s=await Promise.all(e.map((e=>Cc.rooms.get(e,t,!0))));return s.forEach((e=>!t.hidden&&e.maybeShow(n))),s}},async get(e,t={},n=!1){async function s(e){e=nu.getJIDFromURI(e);let s=await Cc.chatboxes.get(e);return!s&&n?s=await Cc.chatboxes.create(e,t,So.ChatRoom):(s=s&&s.get("type")===So.CHATROOMS_TYPE?s:null,s&&Object.keys(t).length&&s.save(t)),s}return await Cc.waitUntil("chatBoxesFetched"),void 0===e?(await Cc.chatboxes.get()).filter((e=>e.get("type")===So.CHATROOMS_TYPE)):"string"==typeof e?s(e):Promise.all(e.map((e=>s(e))))}}},Ou=["moderator","participant","visitor"],Tu=["owner","admin","member","outcast","none"];Mc.AFFILIATION_CHANGES={OWNER:"owner",ADMIN:"admin",MEMBER:"member",EXADMIN:"exadmin",EXOWNER:"exowner",EXOUTCAST:"exoutcast",EXMEMBER:"exmember"},Mc.AFFILIATION_CHANGES_LIST=Object.values(Mc.AFFILIATION_CHANGES),Mc.MUC_TRAFFIC_STATES={ENTERED:"entered",EXITED:"exited"},Mc.MUC_TRAFFIC_STATES_LIST=Object.values(Mc.MUC_TRAFFIC_STATES),Mc.MUC_ROLE_CHANGES={OP:"op",DEOP:"deop",VOICE:"voice",MUTE:"mute"},Mc.MUC_ROLE_CHANGES_LIST=Object.values(Mc.MUC_ROLE_CHANGES),Mc.MUC={},Mc.MUC.INFO_CODES={visibility_changes:["100","102","103","172","173","174"],self:["110"],non_privacy_changes:["104","201"],muc_logging_changes:["170","171"],nickname_changes:["210","303"],disconnected:["301","307","321","322","332","333"],affiliation_changes:[...Mc.AFFILIATION_CHANGES_LIST],join_leave_events:[...Mc.MUC_TRAFFIC_STATES_LIST],role_changes:[...Mc.MUC_ROLE_CHANGES_LIST]};const{Strophe:Nu,sizzle:Iu}=Mc.env;function Mu(){So.connection.addHandler((e=>(So.onDirectMUCInvitation(e),!0)),"jabber:x:conference","message")}function Ru(){return So.chatboxes.filter((e=>e.get("type")===So.CHATROOMS_TYPE)).forEach((e=>e.session.save({connection_status:Mc.ROOMSTATUS.DISCONNECTED})))}async function Du(e){"visible"===e.state&&Cc.connection.connected()&&(await Cc.rooms.get()).forEach((e=>e.rejoinIfNecessary()))}async function zu(e){if(!nu.isValidMUCJID(e))return as.warn('invalid jid "'.concat(e,'" provided in url fragment'));await Cc.waitUntil("roomsAutoJoined"),Cc.settings.get("allow_bookmarks")&&await Cc.waitUntil("bookmarksInitialized"),Cc.rooms.open(e)}async function Lu(){await Promise.all(Cc.settings.get("auto_join_rooms").map((e=>"string"==typeof e?So.chatboxes.where({jid:e}).length?Promise.resolve():Cc.rooms.open(e):s(e)?Cc.rooms.open(e.jid,{...e}):(as.error('Invalid muc criteria specified for "auto_join_rooms"'),Promise.resolve())))),Cc.trigger("roomsAutoJoined")}Nu.addNamespace("MUC_ADMIN",Nu.NS.MUC+"#admin"),Nu.addNamespace("MUC_OWNER",Nu.NS.MUC+"#owner"),Nu.addNamespace("MUC_REGISTER","jabber:iq:register"),Nu.addNamespace("MUC_ROOMCONF",Nu.NS.MUC+"#roomconfig"),Nu.addNamespace("MUC_USER",Nu.NS.MUC+"#user"),Nu.addNamespace("MUC_HATS","xmpp:prosody.im/protocol/hats:1"),Mc.MUC_NICK_CHANGED_CODE="303",Mc.ROOM_FEATURES=["passwordprotected","unsecured","hidden","publicroom","membersonly","open","persistent","temporary","nonanonymous","semianonymous","moderated","unmoderated","mam_enabled"],Mc.ROOMSTATUS={CONNECTED:0,CONNECTING:1,NICKNAME_REQUIRED:2,PASSWORD_REQUIRED:3,DISCONNECTED:4,ENTERED:5,DESTROYED:6,BANNED:7},Mc.plugins.add("converse-muc",{dependencies:["converse-chatboxes","converse-chat","converse-disco","converse-controlbox"],overrides:{ChatBoxes:{model(e,t){const{_converse:n}=this.__super__;return e&&e.type==n.CHATROOMS_TYPE?new n.ChatRoom(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){const{__:e,___:t}=So;if(Cc.settings.extend({allow_muc:!0,allow_muc_invitations:!0,auto_join_on_invite:!1,auto_join_rooms:[],auto_register_muc_nickname:!1,hide_muc_participants:!1,locked_muc_domain:!1,muc_clear_messages_on_leave:!0,muc_domain:void 0,muc_fetch_members:!0,muc_history_max_stanzas:void 0,muc_instant_rooms:!0,muc_nickname_from_jid:!1,muc_send_probes:!1,muc_show_info_messages:[...Mc.MUC.INFO_CODES.visibility_changes,...Mc.MUC.INFO_CODES.self,...Mc.MUC.INFO_CODES.non_privacy_changes,...Mc.MUC.INFO_CODES.muc_logging_changes,...Mc.MUC.INFO_CODES.nickname_changes,...Mc.MUC.INFO_CODES.disconnected,...Mc.MUC.INFO_CODES.affiliation_changes,...Mc.MUC.INFO_CODES.join_leave_events,...Mc.MUC.INFO_CODES.role_changes],muc_show_logs_before_join:!1,muc_show_ogp_unfurls:!0,muc_subscribe_to_rai:!1}),Cc.promises.add(["roomsAutoJoined"]),Cc.settings.get("locked_muc_domain")&&"string"!=typeof Cc.settings.get("muc_domain"))throw new Error("Config Error: it makes no sense to set locked_muc_domain to true when muc_domain is not set");Mc.env.muc_utils={computeAffiliationsDelta:mu},Object.assign(Cc,ku),Object.assign(Cc.rooms,Cu),So.muc={info_messages:{100:e("This groupchat is not anonymous"),102:e("This groupchat now shows unavailable members"),103:e("This groupchat does not show unavailable members"),104:e("The groupchat configuration has changed"),170:e("Groupchat logging is now enabled"),171:e("Groupchat logging is now disabled"),172:e("This groupchat is now no longer anonymous"),173:e("This groupchat is now semi-anonymous"),174:e("This groupchat is now fully-anonymous"),201:e("A new groupchat has been created")},new_nickname_messages:{210:t("Your nickname has been automatically set to %1$s"),303:t("Your nickname has been changed to %1$s")},disconnect_messages:{301:e("You have been banned from this groupchat"),333:e("You have exited this groupchat due to a technical problem"),307:e("You have been kicked from this groupchat"),321:e("You have been removed from this groupchat because of an affiliation change"),322:e("You have been removed from this groupchat because the groupchat has changed to members-only and you're not a member"),332:e("You have been removed from this groupchat because the service hosting it is being shut down")}},So.isInfoVisible=function(e){return!!Cc.settings.get("muc_show_info_messages").includes(e)},So.router.route("converse/room?jid=:jid",zu),So.ChatRoom=So.ChatBox.extend(xu),So.ChatRoomMessage=So.Message.extend(Kl),So.ChatRoomOccupants=Au,So.ChatRoomOccupant=Eu,So.getDefaultMUCNickname=function(){if(!So.xmppstatus)throw new Error("Can't call _converse.getDefaultMUCNickname before the statusInitialized has been fired.");return So.xmppstatus.getNickname()||(Cc.settings.get("muc_nickname_from_jid")?Nu.unescapeNode(Nu.getNodeFromJid(So.bare_jid)):void 0)},So.ChatRoomMessages=ua.extend({model:So.ChatRoomMessage,comparator:"time"}),So.onDirectMUCInvitation=async function(t){const n=Iu('x[xmlns="jabber:x:conference"]',t).pop(),s=Nu.getBareJidFromJid(t.getAttribute("from")),i=n.getAttribute("jid"),r=n.getAttribute("reason");let o;if(Cc.settings.get("auto_join_on_invite"))o=!0;else{let t=So.roster.get(s);t=t?t.getDisplayName():s,o=r?confirm(e('%1$s has invited you to join a groupchat: %2$s, and left the following reason: "%3$s"',t,i,r)):confirm(e("%1$s has invited you to join a groupchat: %2$s",t,i))}!0===o&&(await async function(e,t){t.type=So.CHATROOMS_TYPE,t.id=e;const n=await Cc.rooms.get(e,t,!0);return n.maybeShow(!0),n}(i,{password:n.getAttribute("password")})).session.get("connection_status")===Mc.ROOMSTATUS.DISCONNECTED&&So.chatboxes.get(i).rejoin()},Cc.settings.get("allow_muc_invitations")&&(Cc.listen.on("connected",Mu),Cc.listen.on("reconnected",Mu)),Cc.listen.on("beforeTearDown",(()=>{So.chatboxes.where({type:So.CHATROOMS_TYPE}).forEach((e=>nu.safeSave(e.session,{connection_status:Mc.ROOMSTATUS.DISCONNECTED})))})),Cc.listen.on("windowStateChanged",Du),Cc.listen.on("addClientFeatures",(()=>{Cc.settings.get("allow_muc")&&Cc.disco.own.features.add(Nu.NS.MUC),Cc.settings.get("allow_muc_invitations")&&Cc.disco.own.features.add("jabber:x:conference")})),Cc.listen.on("chatBoxesFetched",Lu),Cc.listen.on("beforeResourceBinding",(()=>{So.connection.addHandler((e=>{const t=Nu.getBareJidFromJid(e.getAttribute("from"));return So.chatboxes.get(t)||Cc.waitUntil("chatBoxesFetched").then((async()=>{const n=So.chatboxes.get(t);n&&(await n.initialized,n.message_handler.run(e))})),!0}),null,"message","groupchat")})),Cc.listen.on("disconnected",Ru),Cc.listen.on("statusInitialized",(()=>{window.addEventListener(So.unloadevent,(()=>{!Cc.connection.isType("websocket")||Cc.settings.get("enable_smacks")&&So.session.get("smacks_stream_id")||Ru()}))}))}});const{Strophe:Pu}=Mc.env,Fu=ao.extend({idAttribute:"jid",getDisplayName(){return Pu.xmlunescape(this.get("name"))}});var Bu=n(2353),Uu=n.n(Bu);function qu(e,t){return"string"==typeof e&&t.includes(e)}function Hu(e,t){return"string"!=typeof e||"en"!==e&&!t(e)?function(e){let t;if(window.navigator.userLanguage&&(t=$u(window.navigator.userLanguage,e)),window.navigator.languages&&!t)for(let n=0;n<window.navigator.languages.length&&!t;n++)t=$u(window.navigator.languages[n],e);return window.navigator.browserLanguage&&!t&&(t=$u(window.navigator.browserLanguage,e)),window.navigator.language&&!t&&(t=$u(window.navigator.language,e)),window.navigator.systemLanguage&&!t&&(t=$u(window.navigator.systemLanguage,e)),t||"en"}(t)||"en":e}function $u(e,t){if(t(e))return e;var n=e.split("-")[0];return n!==e&&t(n)?n:void 0}let Gu;Object.assign(Zn,{getLocale:(e,t)=>Hu(e,(e=>qu(e,t))),translate(e){if(!Gu)return Uu().sprintf.apply(Uu(),arguments);const t=Gu.translate(e);return arguments.length>1?t.fetch.apply(t,[].slice.call(arguments,1)):t.fetch()},async initialize(){if(So.isTestEnv())So.locale="en";else try{const e=Cc.settings.get("i18n");So.locale=Zn.getLocale(e,Cc.settings.get("locales")),await async function(e){const{api:t,locale:s}=e,i=s.toLowerCase().replace("_","-");if(!qu(s,t.settings.get("locales"))||"en"===s)return;const{default:r}=await n(7521)("./".concat(s,"/LC_MESSAGES/converse.po"));await n(9434)("./".concat(i,".js")),Ao().locale(Hu(i,(e=>Ao().locale(e)))),Gu=new(Uu())(r)}(So)}catch(e){as.fatal(e.message),So.locale="en"}},__:(...e)=>Zn.translate(...e)});const Vu=Zn.__,{Strophe:Wu,$iq:Ju,sizzle:Qu}=Mc.env,Yu={model:Fu,comparator:e=>e.get("name").toLowerCase(),initialize(){this.on("add",(e=>this.openBookmarkedRoom(e).then((e=>this.markRoomAsBookmarked(e))).catch((e=>as.fatal(e))))),this.on("remove",this.markRoomAsUnbookmarked,this),this.on("remove",this.sendBookmarkStanza,this);const e="converse.room-bookmarks".concat(So.bare_jid);this.fetched_flag=e+"fetched",Cr(this,e)},openBookmarkedRoom:async e=>(Cc.settings.get("muc_respect_autojoin")&&e.get("autojoin")&&(await Cc.rooms.create(e.get("jid"),{nick:e.get("nick")})).maybeShow(),e),fetchBookmarks(){const e=Et();return window.sessionStorage.getItem(this.fetched_flag)?this.fetch({success:()=>e.resolve(),error:()=>e.resolve()}):this.fetchBookmarksFromServer(e),e},createBookmark(e){this.create(e),this.sendBookmarkStanza().catch((t=>this.onBookmarkError(t,e)))},sendBookmarkStanza(){const e=Ju({type:"set",from:So.connection.jid}).c("pubsub",{xmlns:Wu.NS.PUBSUB}).c("publish",{node:Wu.NS.BOOKMARKS}).c("item",{id:"current"}).c("storage",{xmlns:Wu.NS.BOOKMARKS});return this.forEach((t=>{e.c("conference",{name:t.get("name"),autojoin:t.get("autojoin"),jid:t.get("jid")}).c("nick").t(t.get("nick")).up().up()})),e.up().up().up(),e.c("publish-options").c("x",{xmlns:Wu.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE",type:"hidden"}).c("value").t("http://jabber.org/protocol/pubsub#publish-options").up().up().c("field",{var:"pubsub#persist_items"}).c("value").t("true").up().up().c("field",{var:"pubsub#access_model"}).c("value").t("whitelist"),Cc.sendIQ(e)},onBookmarkError(e,t){as.error("Error while trying to add bookmark"),as.error(e),Cc.alert("error",Vu("Error"),[Vu("Sorry, something went wrong while trying to save your bookmark.")]),this.findWhere({jid:t.jid}).destroy()},fetchBookmarksFromServer(e){const t=Ju({from:So.connection.jid,type:"get"}).c("pubsub",{xmlns:Wu.NS.PUBSUB}).c("items",{node:Wu.NS.BOOKMARKS});Cc.sendIQ(t).then((t=>this.onBookmarksReceived(e,t))).catch((t=>this.onBookmarksReceivedError(e,t)))},markRoomAsBookmarked(e){const t=So.chatboxes.get(e.get("jid"));void 0!==t&&t.save("bookmarked",!0)},markRoomAsUnbookmarked(e){const t=So.chatboxes.get(e.get("jid"));void 0!==t&&t.save("bookmarked",!1)},createBookmarksFromStanza(e){const t=Wu.NS.BOOKMARKS,n='items[node="'.concat(t,'"] item storage[xmlns="').concat(t,'"] conference');Qu(n,e).forEach((e=>{var t;const n=e.getAttribute("jid"),s=this.get(n),i={jid:n,name:e.getAttribute("name")||n,autojoin:"true"===e.getAttribute("autojoin"),nick:(null===(t=e.querySelector("nick"))||void 0===t?void 0:t.textContent)||""};s?s.save(i):this.create(i)}))},onBookmarksReceived(e,t){if(this.createBookmarksFromStanza(t),window.sessionStorage.setItem(this.fetched_flag,!0),void 0!==e)return e.resolve()},onBookmarksReceivedError(e,t){if(null===t)as.error("Error: timeout while fetching bookmarks"),Cc.alert("error",Vu("Timeout Error"),[Vu("The server did not return your bookmarks within the allowed time. You can reload the page to request them again.")]);else{if(e)return t.querySelector('error[type="cancel"] item-not-found')?(window.sessionStorage.setItem(this.fetched_flag,!0),e.resolve()):(as.error("Error while fetching bookmarks"),as.error(t),e.reject(new Error("Could not fetch bookmarks")));as.error("Error while fetching bookmarks"),as.error(t)}},getUnopenedBookmarks(){return this.filter((e=>!So.chatboxes.get(e.get("jid"))))}},{Strophe:Ku}=Mc.env;async function Xu(){const e=await Cc.disco.getIdentity("pubsub","pep",So.bare_jid);return So.allow_public_bookmarks?!!e:Cc.disco.supports(Ku.NS.PUBSUB+"#publish-options",So.bare_jid)}const{Strophe:Zu,sizzle:ed}=Mc.env;function td(e){return ed('event[xmlns="'.concat(Zu.NS.PUBSUB,'#event"] items[node="').concat(Zu.NS.BOOKMARKS,'"]'),e).length&&Cc.waitUntil("bookmarksInitialized").then((()=>So.bookmarks.createBookmarksFromStanza(e))).catch((e=>as.fatal(e))),!0}Zu.addNamespace("BOOKMARKS","storage:bookmarks"),Mc.plugins.add("converse-bookmarks",{dependencies:["converse-chatboxes","converse-muc"],overrides:{ChatRoom:{getDisplayName(){const{_converse:e}=this.__super__;if(this.get("bookmarked")&&e.bookmarks){const t=e.bookmarks.findWhere({jid:this.get("jid")});if(t)return t.get("name")}return this.__super__.getDisplayName.apply(this,arguments)},getAndPersistNickname(e){return e=e||function(e){if(!So.bookmarks||!Cc.settings.get("allow_bookmarks"))return null;const t=So.bookmarks.findWhere({jid:e});return t?t.get("nick"):void 0}(this.get("jid")),this.__super__.getAndPersistNickname.call(this,e)}}},initialize(){Cc.settings.extend({allow_bookmarks:!0,allow_public_bookmarks:!1,muc_respect_autojoin:!0}),Cc.promises.add("bookmarksInitialized"),So.Bookmark=Fu,So.Bookmarks=ua.extend(Yu),So.BookmarksList=ao.extend({defaults:{"toggle-state":So.OPENED}}),Cc.listen.on("addClientFeatures",(()=>{Cc.settings.get("allow_bookmarks")&&Cc.disco.own.features.add(Zu.NS.BOOKMARKS+"+notify")})),Cc.listen.on("clearSession",(()=>{void 0!==So.bookmarks&&(So.bookmarks.clearStore({silent:!0}),window.sessionStorage.removeItem(So.bookmarks.fetched_flag),delete So.bookmarks)})),Cc.listen.on("connected",(async()=>{const{connection:e}=So;e.addHandler(td,null,"message","headline",null,So.bare_jid),await Promise.all([Cc.waitUntil("chatBoxesFetched")]),async function(){Cc.settings.get("allow_bookmarks")&&await Xu()&&(So.bookmarks=new So.Bookmarks,await So.bookmarks.fetchBookmarks(),Cc.trigger("bookmarksInitialized"))}()}))}});const{Strophe:nd}=Mc.env,sd="converse.bosh-session";Mc.plugins.add("converse-bosh",{enabled:()=>!So.api.settings.get("blacklisted_plugins").includes("converse-bosh"),initialize(){Cc.settings.extend({bosh_service_url:void 0,prebind_url:null}),So.startNewPreboundBOSHSession=function(){if(!Cc.settings.get("prebind_url"))throw new Error("startNewPreboundBOSHSession: If you use prebind then you MUST supply a prebind_url");const e=new XMLHttpRequest;e.open("GET",Cc.settings.get("prebind_url"),!0),e.setRequestHeader("Accept","application/json, text/javascript"),e.onload=async function(){if(e.status>=200&&e.status<400){const t=JSON.parse(e.responseText),n=await So.setUserJID(t.jid);So.connection.attach(n,t.sid,t.rid,So.connection.onConnectStatusChanged)}else e.onerror()},e.onerror=function(){delete So.connection,Cc.trigger("noResumeableBOSHSession",So)},e.send()},So.restoreBOSHSession=async function(){const e=(await async function(){const e=sd;if(So.bosh_session||(So.bosh_session=new ao({id:e}),So.bosh_session.browserStorage=So.createStore(e,"session"),await new Promise((e=>So.bosh_session.fetch({success:e,error:e})))),So.jid){if(So.bosh_session.get("jid")!==So.jid){const e=await So.setUserJID(So.jid);So.bosh_session.clear({silent:!0}),So.bosh_session.save({jid:e})}}else{const e=So.bosh_session.get("jid");e&&await So.setUserJID(e)}return So.bosh_session}()).get("jid");if(e&&So.connection._proto instanceof nd.Bosh)try{return So.connection.restore(e,So.connection.onConnectStatusChanged),!0}catch(t){return!So.isTestEnv()&&as.warn("Could not restore session for jid: "+e+" Error message: "+t.message),!1}return!1},Cc.listen.on("clearSession",(()=>{if(void 0===So.bosh_session){const e=sd;sessionStorage.removeItem(e),sessionStorage.removeItem("".concat(e,"-").concat(e))}else So.bosh_session.destroy(),delete So.bosh_session})),Cc.listen.on("setUserJID",(()=>{void 0!==So.bosh_session&&So.bosh_session.save({jid:So.jid})})),Cc.listen.on("addClientFeatures",(()=>Cc.disco.own.features.add(nd.NS.BOSH))),Object.assign(Cc,{tokens:{get:e=>void 0===So.connection?null:"rid"===e.toLowerCase()?So.connection.rid||So.connection._proto.rid:"sid"===e.toLowerCase()?So.connection.sid||So.connection._proto.sid:void 0}})}});const{Strophe:id,$build:rd}=Mc.env;function od(e,t){return e.sort(((e,n)=>e[t]>n[t]?-1:1))}function ad(){const e=So.api.disco.own.identities.get(),t=So.api.disco.own.features.get();e.length>1&&(od(e,"category"),od(e,"type"),od(e,"lang"));let n=e.reduce(((e,t)=>{var n;return"".concat(e).concat(t.category,"/").concat(t.type,"/").concat(null!==(n=null==t?void 0:t.lang)&&void 0!==n?n:"","/").concat(t.name,"<")}),"");return t.sort(),n=t.reduce(((e,t)=>"".concat(e).concat(t,"<")),n),Ts.b64_sha1(n)}const{Strophe:cd}=Mc.env;function ld(e){var t,n;if(e&&(null===(n=So.session)||void 0===n||n.set({carbons_enabled:!1})),!Cc.settings.get("message_carbons")||(null===(t=So.session)||void 0===t?void 0:t.get("carbons_enabled")))return;const s=new zs.Builder("iq",{from:So.connection.jid,id:"enablecarbons",type:"set"}).c("enable",{xmlns:zs.NS.CARBONS});So.connection.addHandler((e=>{e.querySelectorAll("error").length>0?as.warn("An error occurred while trying to enable message carbons."):(So.session.set({carbons_enabled:!0}),as.debug("Message carbons have been enabled.")),So.session.save()}),null,"iq",null,"enablecarbons"),So.connection.send(s)}cd.addNamespace("CAPS","http://jabber.org/protocol/caps"),Mc.plugins.add("converse-caps",{dependencies:["converse-status"],initialize(){Cc.listen.on("constructedPresence",((e,t)=>t.root().cnode(rd("c",{xmlns:id.NS.CAPS,hash:"sha-1",node:"https://conversejs.org",ver:ad()}).nodeTree).up()&&t))}}),Mc.plugins.add("converse-carbons",{initialize(){Cc.settings.extend({message_carbons:!0}),Cc.listen.on("afterResourceBinding",ld)}});const ud=ua.extend({comparator:"time_opened",model:(e,t)=>new So.ChatBox(e,t),onChatBoxesFetched(e){e.filter((e=>!e.isValid())).forEach((e=>e.destroy())),Cc.trigger("chatBoxesFetched")},onConnected(e){e||(Cr(this,"converse.chatboxes-".concat(So.bare_jid)),this.fetch({add:!0,success:e=>this.onChatBoxesFetched(e)}))}}),{Strophe:dd}=Mc.env;async function hd(e,t,n){let s;e=dd.getBareJidFromJid(e.toLowerCase()),Object.assign(t,{jid:e,id:e});try{s=new n(t,{collection:So.chatboxes})}catch(e){return as.error(e),null}return await s.initialized,s.isValid()?(So.chatboxes.add(s),s):(s.destroy(),null)}const fd={create:async(e=[],t={},n)=>(await Cc.waitUntil("chatBoxesFetched"),"string"==typeof e?hd(e,t,n):Promise.all(e.map((e=>hd(e,t,n))))),get:async e=>(await Cc.waitUntil("chatBoxesFetched"),void 0===e?So.chatboxes.models:"string"==typeof e?So.chatboxes.get(e.toLowerCase()):(e=e.map((e=>e.toLowerCase())),So.chatboxes.models.filter((t=>e.includes(t.get("jid"))))))},{Strophe:gd}=Mc.env;Mc.plugins.add("converse-chatboxes",{dependencies:["converse-emoji","converse-roster","converse-vcard"],initialize(){Cc.promises.add(["chatBoxesFetched","chatBoxesInitialized","privateChatsAutoJoined"]),Object.assign(Cc,{chatboxes:fd}),So.ChatBoxes=ud,Cc.listen.on("addClientFeatures",(()=>{Cc.disco.own.features.add(gd.NS.MESSAGE_CORRECT),Cc.disco.own.features.add(gd.NS.HTTPUPLOAD),Cc.disco.own.features.add(gd.NS.OUTOFBAND)})),Cc.listen.on("pluginsInitialized",(()=>{So.chatboxes=new So.ChatBoxes,Cc.trigger("chatBoxesInitialized")})),Cc.listen.on("presencesInitialized",(e=>So.chatboxes.onConnected(e))),Cc.listen.on("reconnected",(()=>So.chatboxes.forEach((e=>e.onReconnection()))))}}),Mc.plugins.add("converse-headlines",{dependencies:["converse-chat"],overrides:{ChatBoxes:{model(e,t){const{_converse:n}=this.__super__;return e.type==n.HEADLINES_TYPE?new n.HeadlinesBox(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){function e(){So.connection.addHandler((e=>async function(e){if(Zc(e)||el(e)){const t=e.getAttribute("from");if(t.includes("@")&&!So.roster.get(t)&&!Cc.settings.get("allow_non_roster_messaging"))return;if(null===e.querySelector("body"))return;const n=So.chatboxes.create({id:t,jid:t,type:So.HEADLINES_TYPE,from:t}),s=await hl(e,So);await n.createMessage(s),Cc.trigger("message",{chatbox:n,stanza:e,attrs:s})}}(e)||!0),null,"message")}So.HeadlinesBox=So.ChatBox.extend({defaults(){return{bookmarked:!1,hidden:["mobile","fullscreen"].includes(Cc.settings.get("view_mode")),message_type:"headline",num_unread:0,time_opened:this.get("time_opened")||(new Date).getTime(),type:So.HEADLINES_TYPE}},async initialize(){this.set({box_id:"box-".concat(this.get("jid"))}),this.initMessages(),await this.fetchMessages(),Cc.trigger("headlinesBoxInitialized",this)}}),Cc.listen.on("connected",e),Cc.listen.on("reconnected",e),Object.assign(Cc,{headlines:{async get(e,t={},n=!1){async function s(e){let s=await Cc.chatboxes.get(e);return!s&&n?s=await Cc.chatboxes.create(e,t,So.HeadlinesBox):(s=s&&s.get("type")===So.HEADLINES_TYPE?s:null,s&&Object.keys(t).length&&s.save(t)),s}return void 0===e?(await Cc.chatboxes.get()).filter((e=>e.get("type")===So.HEADLINES_TYPE)):"string"==typeof e?s(e):Promise.all(e.map((e=>s(e))))}}})}});const{Strophe:md,$build:pd}=Mc.env;md.addNamespace("RSM","http://jabber.org/protocol/rsm");const vd=["after","before","index","max"],bd=e=>Number(e),yd=e=>e.toString(),_d={after:yd,before:yd,count:bd,first:yd,index:bd,last:yd,max:bd},wd=e=>void 0===e,Sd=Object.keys(_d);class xd{static getQueryParameters(e={}){return Pr(e,vd)}static parseXMLResult(e){const t={};for(var n=0;n<Sd.length;n++){const s=Sd[n],i=e.getElementsByTagName(s)[0];wd(i)||null===i||(t[s]=_d[s](md.getText(i)),"first"==s&&(t.index=_d.index(i.getAttribute("index"))))}return t}constructor(e={}){this.query=xd.getQueryParameters(e),this.result=e.xml?xd.parseXMLResult(e.xml):{}}toXML(){const e=pd("set",{xmlns:md.NS.RSM});return vd.reduce(((e,t)=>wd(this.query[t])?e:e.c(t).t((this.query[t]||"").toString()).up()),e).tree()}next(e,t){const n=Object.assign({},this.query,{after:this.result.last,before:t,max:e});return new xd(n)}previous(e,t){const n=Object.assign({},this.query,{after:t,before:this.result.first,max:e});return new xd(n)}}So.RSM_ATTRIBUTES=Sd,So.RSM=xd;const{Strophe:Ed,$iq:jd,dayjs:Ad}=Mc.env,{NS:Cd}=Ed,kd=Mc.env.utils,Od={archive:{async query(e){if(!Cc.connection.connected())throw new Error("Can't call `api.archive.query` before having established an XMPP session");const t={type:"set"};if(e&&e.groupchat){if(!e.with)throw new Error('You need to specify a "with" value containing the chat room JID, when querying groupchat messages.');t.to=e.with}const n=t.to||So.bare_jid;if(!await Cc.disco.supports(Cd.MAM,n))return as.warn("Did not fetch MAM archive for ".concat(n," because it doesn't support ").concat(Cd.MAM)),{messages:[]};const s=kd.getUniqueId(),i=jd(t).c("query",{xmlns:Cd.MAM,queryid:s});if(e){i.c("x",{xmlns:Cd.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE",type:"hidden"}).c("value").t(Cd.MAM).up().up(),e.with&&!e.groupchat&&i.c("field",{var:"with"}).c("value").t(e.with).up().up(),["start","end"].forEach((t=>{if(e[t]){const n=Ad(e[t]);if(!n.isValid())throw new TypeError("archive.query: invalid date provided for: ".concat(t));i.c("field",{var:t}).c("value").t(n.toISOString()).up().up()}})),i.up();const t=new xd(e);Object.keys(t.query).length&&i.cnode(t.toXML())}const r=[],o=So.connection.addHandler((t=>{const n=qr()('message > result[xmlns="'.concat(Cd.MAM,'"]'),t).pop();if(void 0===n||n.getAttribute("queryid")!==s)return!0;const i=t.getAttribute("from")||So.bare_jid;if(e.groupchat){if(i!==e.with)return as.warn("Ignoring alleged groupchat MAM message from ".concat(t.getAttribute("from"))),!0}else if(i!==So.bare_jid)return as.warn("Ignoring alleged MAM message from ".concat(t.getAttribute("from"))),!0;return r.push(t),!0}),Cd.MAM);let a;const c=await Cc.sendIQ(i,Cc.settings.get("message_archiving_timeout"),!1);if(null===c){const{__:e}=So,t=e("Timeout while trying to fetch archived messages.");return as.error(t),a=new So.TimeoutError(t),{messages:r,error:a}}if(kd.isErrorStanza(c)){const{__:e}=So,t=e("An error occurred while querying for archived messages.");return as.error(t),as.error(c),a=new Error(t),{messages:r,error:a}}let l;So.connection.deleteHandler(o);const u=c&&qr()('fin[xmlns="'.concat(Cd.MAM,'"]'),c).pop(),d="true"===(null==u?void 0:u.getAttribute("complete")),h=qr()('set[xmlns="'.concat(Cd.RSM,'"]'),u).pop();return h&&(l=new xd({...e,xml:h})),{messages:r,rsm:l,complete:d}}}},{Strophe:Td,$iq:Nd}=Mc.env,{NS:Id}=Td,Md=Mc.env.utils;function Rd(e){(null==e?void 0:e.querySelectorAll("feature-not-implemented").length)?as.warn("Message Archive Management (XEP-0313) not supported by ".concat(e.getAttribute("from"))):(as.error("Error while trying to set archiving preferences for ".concat(e.getAttribute("from"),".")),as.error(e))}function Dd(e,t){const n=qr()('prefs[xmlns="'.concat(Id.MAM,'"]'),e).pop();if(n.getAttribute("default")!==Cc.settings.get("message_archiving")){const e=Nd({type:"set"}).c("prefs",{xmlns:Id.MAM,default:Cc.settings.get("message_archiving")});Array.from(n.children).forEach((t=>e.cnode(t).up())),Cc.sendIQ(e).then((()=>t.save({preferences:{default:Cc.settings.get("message_archiving")}}))).catch(So.onMAMError)}else t.save({preferences:{default:Cc.settings.get("message_archiving")}})}function zd(e){const t=e.get("preferences")||{};e.get("var")===Id.MAM&&void 0!==Cc.settings.get("message_archiving")&&t.default!==Cc.settings.get("message_archiving")&&Cc.sendIQ(Nd({type:"get"}).c("prefs",{xmlns:Id.MAM})).then((t=>So.onMAMPreferences(t,e))).catch(So.onMAMError)}function Ld(e){Cc.settings.get("muc_show_logs_before_join")&&e.features.get("mam_enabled")&&!e.get("prejoin_mam_fetched")&&(Bd(e),e.save({prejoin_mam_fetched:!0}))}async function Pd(e,t,n,s,i){await Cc.emojis.initialize();const r=e.get("type")===So.CHATROOMS_TYPE;t.messages=t.messages.map((t=>r?cu(t,e,So):hl(t,So)));const o={query:n,chatbox:e,messages:t.messages};if(await Cc.trigger("MAMResult",o,{synchronous:!0}),t.messages.forEach((t=>e.queueMessage(t))),t.error){const n=t.error.retry_event_id=Md.getUniqueId();Cc.listen.once(n,(()=>Fd(e,s,i))),e.createMessageFromError(t.error)}}async function Fd(e,t={},n=null){if(e.disable_mam)return;const s=e.get("type")===So.CHATROOMS_TYPE,i=s?e.get("jid"):So.bare_jid;if(!await Cc.disco.supports(Id.MAM,i))return;const r=Cc.settings.get("archived_messages_page_size"),o=Object.assign({groupchat:s,max:r,with:e.get("jid")},t),a=await Cc.archive.query(o);return await Pd(e,a,o,t,n),a.rsm&&!a.complete&&n?("forwards"===n?t=a.rsm.next(r,t.before).query:"backwards"===n&&(t=a.rsm.previous(r,t.after).query),Fd(e,t,n)):void 0}function Bd(e){if(e.disable_mam)return;const t=e.most_recent_cached_message;if(t&&!Cc.settings.get("clear_messages_on_reconnection"))if(Cc.settings.get("mam_request_all_pages")){const n=t.get("stanza_id ".concat(e.get("jid")));Fd(e,n?{after:n}:{start:t.get("time")},"forwards")}else Fd(e,{before:"",start:t.get("time")});else Fd(e,{before:""})}const{Strophe:Ud}=Mc.env,{NS:qd}=Ud;Mc.plugins.add("converse-mam",{dependencies:["converse-disco","converse-muc"],initialize(){Cc.settings.extend({archived_messages_page_size:"50",mam_request_all_pages:!0,message_archiving:void 0,message_archiving_timeout:2e4}),Object.assign(Cc,Od),Object.assign(So,{onMAMError:Rd,onMAMPreferences:Dd,handleMAMResult:Pd}),Cc.listen.on("addClientFeatures",(()=>Cc.disco.own.features.add(qd.MAM))),Cc.listen.on("serviceDiscovered",zd),Cc.listen.on("chatRoomViewInitialized",(e=>{Cc.settings.get("muc_show_logs_before_join")&&(Ld(e.model),e.model.features.on("change:mam_enabled",(()=>Ld(e.model))))})),Cc.listen.on("enteredNewRoom",(e=>e.features.get("mam_enabled")&&Bd(e))),Cc.listen.on("chatReconnected",(e=>{e.get("type")===So.PRIVATE_CHAT_TYPE&&Bd(e)})),Cc.listen.on("afterMessagesFetched",(e=>{e.get("type")!==So.PRIVATE_CHAT_TYPE||So.connection.restored||Bd(e)}))}});const{Strophe:Hd,$iq:$d}=Mc.env;let Gd;function Vd(e){"visible"===e.state&&Cc.connection.connected()&&Cc.ping(null,5e3)}function Wd(e){Gd=new Date;const t=e.getAttribute("from"),n=e.getAttribute("id"),s=$d({type:"result",to:t,id:n});return So.connection.sendIQ(s),!0}function Jd(){void 0!==So.connection.disco&&Cc.disco.own.features.add(Hd.NS.PING),So.connection.addHandler(Wd,Hd.NS.PING,"iq","get"),So.connection.addHandler((()=>{if(Cc.settings.get("ping_interval")>0)return Gd=new Date,!0}))}function Qd(){if(So.isTestEnv()||!Cc.connection.connected())return;const e=Cc.settings.get("ping_interval");if(e>0){const t=new Date;Gd||(Gd=t),(t-Gd)/1e3>e&&Cc.ping()}}const{Strophe:Yd,$iq:Kd,u:Xd}=Mc.env,Zd={async ping(e,t){var n;if(n=new Date,Gd=n,e=e||Yd.getDomainFromJid(So.bare_jid),So.connection){const n=Kd({type:"get",to:e,id:Xd.getUniqueId("ping")}).c("ping",{xmlns:Yd.NS.PING}),s=await Cc.sendIQ(n,t||1e4,!1);return null===s?(as.warn("Timeout while pinging ".concat(e)),e===Yd.getDomainFromJid(So.bare_jid)&&Cc.connection.reconnect()):Xd.isErrorStanza(s)&&(as.error("Error while pinging ".concat(e)),as.error(s)),!0}return!1}},{Strophe:eh}=Mc.env;eh.addNamespace("PING","urn:xmpp:ping"),Mc.plugins.add("converse-ping",{initialize(){Cc.settings.extend({ping_interval:60}),Object.assign(Cc,Zd),setInterval(Qd,1e3),Cc.listen.on("connected",Jd),Cc.listen.on("reconnected",Jd),Cc.listen.on("windowStateChanged",Vd)}});const{Strophe:th,$iq:nh}=Mc.env;th.addNamespace("PUBSUB_ERROR",th.NS.PUBSUB+"#errors"),Mc.plugins.add("converse-pubsub",{dependencies:["converse-disco"],initialize(){Object.assign(So.api,{pubsub:{async publish(e,t,n,s,i=!0){const r=nh({from:So.bare_jid,type:"set",to:e}).c("pubsub",{xmlns:th.NS.PUBSUB}).c("publish",{node:t}).cnode(n.tree()).up().up();s&&(e=e||So.bare_jid,await Cc.disco.supports(th.NS.PUBSUB+"#publish-options",e)?(r.c("publish-options").c("x",{xmlns:th.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE",type:"hidden"}).c("value").t("".concat(th.NS.PUBSUB,"#publish-options")).up().up(),Object.keys(s).forEach((e=>r.c("field",{var:e}).c("value").t(s[e]).up().up()))):as.warn("_converse.api.publish: ".concat(e," does not support #publish-options, ")+"so we didn't set them even though they were provided."));try{await Cc.sendIQ(r)}catch(e){if(!(e instanceof Element&&i&&e.querySelector('precondition-not-met[xmlns="'.concat(th.NS.PUBSUB_ERROR,'"]'))))throw e;{const e=r.nodeTree;e.querySelector("publish-options").outerHTML="",as.warn("PubSub: Republishing without publish options. ".concat(e.outerHTML)),await Cc.sendIQ(e)}}}}})}});const sh=function(e){return function(e){return"number"==typeof e||de(e)&&"[object Number]"==y(e)}(e)&&e!=+e},{Strophe:ih,$pres:rh}=Mc.env,oh=ao.extend({defaults:()=>({status:Cc.settings.get("default_state")}),initialize(){this.on("change",(e=>{s(e.changed)&&("status"in e.changed||"status_message"in e.changed)&&Cc.user.presence.send(this.get("status"),null,this.get("status_message"))}))},getNickname:()=>So.nickname,getFullname:()=>"",async constructPresence(e,t=null,n){let s;e="string"==typeof e?e:this.get("status")||Cc.settings.get("default_state"),n="string"==typeof n?n:this.get("status_message");const i={to:t};"unavailable"===e||"probe"===e||"error"===e||"unsubscribe"===e||"unsubscribed"===e||"subscribe"===e||"subscribed"===e?(i.type=e,s=rh(i)):"offline"===e?(i.type="unavailable",s=rh(i)):s="online"===e?rh(i):rh(i).c("show").t(e).up(),n&&s.c("status").t(n).up();const r=Cc.settings.get("priority");if(s.c("priority").t(sh(Number(r))?0:r).up(),So.idle){const e=new Date;e.setSeconds(e.getSeconds()-So.idle_seconds),s.c("idle",{xmlns:ih.NS.IDLE,since:e.toISOString()})}return s=await Cc.hook("constructedPresence",null,s),s}}),ah={presence:{async send(e,t,n,s){await Cc.waitUntil("statusInitialized");const i=await So.xmppstatus.constructPresence(e,t,n);s&&(Array.isArray(s)||(s=[s]),s.map((e=>{var t;return null!==(t=null==e?void 0:e.tree())&&void 0!==t?t:e})).forEach((e=>i.cnode(e).up()))),Cc.send(i)}},status:{get:async()=>(await Cc.waitUntil("statusInitialized"),So.xmppstatus.get("status")),async set(e,t){const n={status:e};if(!Object.keys(So.STATUS_WEIGHTS).includes(e))throw new Error("Invalid availability value. See https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.1");"string"==typeof t&&(n.status_message=t),await Cc.waitUntil("statusInitialized"),So.xmppstatus.save(n)},message:{get:async()=>(await Cc.waitUntil("statusInitialized"),So.xmppstatus.get("status_message")),async set(e){await Cc.waitUntil("statusInitialized"),So.xmppstatus.save({status_message:e})}}}},{Strophe:ch,$build:lh}=Mc.env;function uh(e){Cc.trigger("statusInitialized",e)}function dh(e){if(e=void 0!==So.xmppstatus&&e)uh(e);else{const t="converse.xmppstatus-".concat(So.bare_jid);So.xmppstatus=new So.XMPPStatus({id:t}),Cr(So.xmppstatus,t,"session"),So.xmppstatus.fetch({success:()=>uh(e),error:()=>uh(e),silent:!0})}}function hh(){var e;So.idle_seconds>0&&(So.idle_seconds=0),(null===(e=So.connection)||void 0===e?void 0:e.authenticated)&&(So.inactive&&So.sendCSI(So.ACTIVE),So.idle&&(So.idle=!1,Cc.user.presence.send()),!0===So.auto_changed_status&&(So.auto_changed_status=!1,So.xmppstatus.set("status",Cc.settings.get("default_state"))))}function fh(){var e;if(!(null===(e=So.connection)||void 0===e?void 0:e.authenticated))return;const t=So.xmppstatus.get("status");So.idle_seconds++,Cc.settings.get("csi_waiting_time")>0&&So.idle_seconds>Cc.settings.get("csi_waiting_time")&&!So.inactive&&So.sendCSI(So.INACTIVE),Cc.settings.get("idle_presence_timeout")>0&&So.idle_seconds>Cc.settings.get("idle_presence_timeout")&&!So.idle&&(So.idle=!0,Cc.user.presence.send()),Cc.settings.get("auto_away")>0&&So.idle_seconds>Cc.settings.get("auto_away")&&"away"!==t&&"xa"!==t&&"dnd"!==t?(So.auto_changed_status=!0,So.xmppstatus.set("status","away")):Cc.settings.get("auto_xa")>0&&So.idle_seconds>Cc.settings.get("auto_xa")&&"xa"!==t&&"dnd"!==t&&(So.auto_changed_status=!0,So.xmppstatus.set("status","xa"))}function gh(e){Cc.send(lh(e,{xmlns:ch.NS.CSI})),So.inactive=e===So.INACTIVE}function mh(){if(Cc.settings.get("auto_away")<1&&Cc.settings.get("auto_xa")<1&&Cc.settings.get("csi_waiting_time")<1&&Cc.settings.get("idle_presence_timeout")<1)return;So.idle_seconds=0,So.auto_changed_status=!1;const{unloadevent:e}=So;window.addEventListener("click",So.onUserActivity),window.addEventListener("focus",So.onUserActivity),window.addEventListener("keypress",So.onUserActivity),window.addEventListener("mousemove",So.onUserActivity),window.addEventListener(e,So.onUserActivity,{once:!0,passive:!0}),window.addEventListener(e,(()=>{var e;return null===(e=So.session)||void 0===e?void 0:e.save("active",!1)})),So.everySecondTrigger=window.setInterval(So.onEverySecond,1e3)}Mc.plugins.add("converse-status",{initialize(){Cc.settings.extend({auto_away:0,auto_xa:0,csi_waiting_time:0,default_state:"online",priority:0}),Cc.promises.add(["statusInitialized"]),So.XMPPStatus=oh,So.onUserActivity=hh,So.onEverySecond=fh,So.sendCSI=gh,So.registerIntervalHandler=mh,Object.assign(So.api.user,ah),Cc.listen.on("presencesInitialized",(e=>{e||So.registerIntervalHandler()})),Cc.listen.on("clearSession",(()=>{So.shouldClearCache()&&So.xmppstatus&&(So.xmppstatus.destroy(),delete So.xmppstatus,Cc.promises.add(["statusInitialized"]))})),Cc.listen.on("connected",(()=>dh(!1))),Cc.listen.on("reconnected",(()=>dh(!0)))}});const{Strophe:ph,$iq:vh,$pres:bh}=Mc.env,yh=ao.extend({defaults:{chat_state:void 0,image:So.DEFAULT_IMAGE,image_type:So.DEFAULT_IMAGE_TYPE,num_unread:0,status:void 0},async initialize(e){this.initialized=Et(),this.setPresence();const{jid:t}=e,n=ph.getBareJidFromJid(t).toLowerCase();e.jid=n,this.set(Object.assign({groups:[],id:n,jid:n,user_id:ph.getNodeFromJid(t)},e)),this.listenTo(this.presence,"change:show",(()=>Cc.trigger("contactPresenceChanged",this))),this.listenTo(this.presence,"change:show",(()=>this.trigger("presenceChanged"))),await Cc.trigger("rosterContactInitialized",this,{Synchronous:!0}),this.initialized.resolve()},setPresence(){const e=this.get("jid");this.presence=So.presences.findWhere({jid:e})||So.presences.create({jid:e})},openChat(){const e=this.attributes;Cc.chats.open(e.jid,e,!0)},getFilterCriteria(){const e=this.get("nickname"),t=this.get("jid");let n=this.getDisplayName();return n=n.includes(t)?n:n.concat(" ".concat(t)),n=n.includes(e)?n:n.concat(" ".concat(e)),n.toLowerCase()},getDisplayName(){return this.get("nickname")?this.get("nickname"):this.get("jid")},getFullname(){return this.get("jid")},subscribe(e){const t=bh({to:this.get("jid"),type:"subscribe"});e&&""!==e&&t.c("status").t(e).up();const n=So.xmppstatus.getNickname()||So.xmppstatus.getFullname();return n&&t.c("nick",{xmlns:ph.NS.NICK}).t(n).up(),Cc.send(t),this.save("ask","subscribe"),this},ackSubscribe(){Cc.send(bh({type:"subscribe",to:this.get("jid")}))},ackUnsubscribe(){Cc.send(bh({type:"unsubscribe",to:this.get("jid")})),this.removeFromRoster(),this.destroy()},unauthorize(e){return So.rejectPresenceSubscription(this.get("jid"),e),this},authorize(e){const t=bh({to:this.get("jid"),type:"subscribed"});return e&&""!==e&&t.c("status").t(e),Cc.send(t),this},removeFromRoster(){const e=vh({type:"set"}).c("query",{xmlns:ph.NS.ROSTER}).c("item",{jid:this.get("jid"),subscription:"remove"});return Cc.sendIQ(e)}}),{Strophe:_h,$iq:wh,sizzle:Sh}=Mc.env,xh=Mc.env.utils,Eh=ua.extend({model:yh,initialize(){const e="roster.state-".concat(So.bare_jid,"-").concat(this.get("jid"));this.state=new ao({id:e,collapsed_groups:[]}),Cr(this.state,e),this.state.fetch()},onConnected(){this.registerRosterHandler(),this.registerRosterXHandler()},registerRosterHandler(){So.connection.addHandler((e=>(So.roster.onRosterPush(e),!0)),_h.NS.ROSTER,"iq","set")},registerRosterXHandler(){let e=0;So.connection.addHandler((function(t){return window.setTimeout((function(){So.connection.flush(),So.roster.subscribeToSuggestedItems.bind(So.roster)(t)}),e),e+=250*t.querySelectorAll("item").length,!0}),_h.NS.ROSTERX,"message",null)},async fetchRosterContacts(){const e=await new Promise(((e,t)=>{this.fetch({add:!0,silent:!0,success:e,error:(e,n)=>t(n)})}));if(xh.isErrorObject(e)&&(as.error(e),So.session.save("roster_cached",!1),this.data.save("version",void 0)),!So.session.get("roster_cached"))return So.send_initial_presence=!0,So.roster.fetchFromServer();Cc.trigger("cachedRoster",e)},subscribeToSuggestedItems:e=>(Array.from(e.querySelectorAll("item")).forEach((e=>{"add"===e.getAttribute("action")&&So.roster.addAndSubscribe(e.getAttribute("jid"),So.xmppstatus.getNickname()||So.xmppstatus.getFullname())})),!0),isSelf:e=>xh.isSameBareJID(e,So.connection.jid),async addAndSubscribe(e,t,n,s,i){const r=await this.addContactToRoster(e,t,n,i);r instanceof So.RosterContact&&r.subscribe(s)},sendContactAddIQ(e,t,n){t=t||null;const s=wh({type:"set"}).c("query",{xmlns:_h.NS.ROSTER}).c("item",{jid:e,name:t});return n.forEach((e=>s.c("group").t(e).up())),Cc.sendIQ(s)},async addContactToRoster(e,t,n,s){await Cc.waitUntil("rosterContactsFetched"),n=n||[];try{await this.sendContactAddIQ(e,t,n)}catch(n){return as.error(n),alert(Vu("Sorry, there was an error while trying to add %1$s as a contact.",t||e)),n}return this.create(Object.assign({ask:void 0,nickname:t,groups:n,jid:e,requesting:!1,subscription:"none"},s),{sort:!1})},async subscribeBack(e,t){const n=this.get(e);if(n instanceof So.RosterContact)n.authorize().subscribe();else{var s;const n=(null===(s=Sh('nick[xmlns="'.concat(_h.NS.NICK,'"]'),t).pop())||void 0===s?void 0:s.textContent)||null,i=await this.addContactToRoster(e,n,[],{subscription:"from"});i instanceof So.RosterContact&&i.authorize().subscribe()}},getNumOnlineContacts(){const e=["offline","unavailable"];return(t=this.models.filter((t=>!e.includes(t.presence.get("show")))))&&t.length?function(e,t){for(var n,s=-1,i=e.length;++s<i;){var r=t(e[s]);void 0!==r&&(n=void 0===n?r:n+r)}return n}(t,Xe):0;var t},onRosterPush(e){const t=e.getAttribute("id"),n=e.getAttribute("from");if(n&&n!==So.bare_jid)return void as.warn("Ignoring roster illegitimate roster push message from ".concat(e.getAttribute("from")));Cc.send(wh({type:"result",id:t,from:So.connection.jid}));const s=Sh('query[xmlns="'.concat(_h.NS.ROSTER,'"]'),e).pop();this.data.save("version",s.getAttribute("ver"));const i=Sh("item",s);if(i.length>1)throw as.error(e),new Error('Roster push query may not contain more than one "item" element.');if(0===i.length)return as.warn(e),void as.warn('Received a roster push stanza without an "item" element.');this.updateContact(i.pop()),Cc.trigger("rosterPush",e)},rosterVersioningSupported(){return Cc.disco.stream.getFeature("ver","urn:xmpp:features:rosterver")&&this.data.get("version")},async fetchFromServer(){const e=wh({type:"get",id:xh.getUniqueId("roster")}).c("query",{xmlns:_h.NS.ROSTER});this.rosterVersioningSupported()&&e.attrs({ver:this.data.get("version")});const t=await Cc.sendIQ(e,null,!1);if("error"!==t.getAttribute("type")){const e=Sh('query[xmlns="'.concat(_h.NS.ROSTER,'"]'),t).pop();e&&(Sh("item",e).forEach((e=>this.updateContact(e))),this.data.save("version",e.getAttribute("ver")))}else if(!xh.isServiceUnavailableError(t))return as.error(t),void as.error("Error while trying to fetch roster from the server");So.session.save("roster_cached",!0),Cc.trigger("roster",t)},updateContact(e){const t=e.getAttribute("jid"),n=this.get(t),s=e.getAttribute("subscription"),i=e.getAttribute("ask"),r=Array.from(e.getElementsByTagName("group")).map((e=>e.textContent));if(n){if("remove"===s)return n.destroy();n.save({subscription:s,ask:i,nickname:e.getAttribute("name"),requesting:null,groups:r})}else{if("none"===s&&null===i||"remove"===s)return;this.create({ask:i,nickname:e.getAttribute("name"),groups:r,jid:t,subscription:s},{sort:!1})}},createRequestingContact(e){var t;const n={jid:_h.getBareJidFromJid(e.getAttribute("from")),subscription:"none",ask:null,requesting:!0,nickname:(null===(t=Sh('nick[xmlns="'.concat(_h.NS.NICK,'"]'),e).pop())||void 0===t?void 0:t.textContent)||null};Cc.trigger("contactRequest",this.create(n))},handleIncomingSubscription(e){const t=e.getAttribute("from"),n=_h.getBareJidFromJid(t),s=this.get(n);Cc.settings.get("allow_contact_requests")||So.rejectPresenceSubscription(t,Vu("This client does not allow presence subscriptions")),Cc.settings.get("auto_subscribe")?s&&"to"===s.get("subscription")?s.authorize():this.subscribeBack(n,e):s?("none"!==s.get("subscription")||"subscribe"===s.get("ask"))&&s.authorize():this.createRequestingContact(e)},handleOwnPresence(e){const t=e.getAttribute("from"),n=_h.getResourceFromJid(t),s=e.getAttribute("type");if(So.connection.jid!==t&&"unavailable"!==s&&(!0===Cc.settings.get("synchronize_availability")||Cc.settings.get("synchronize_availability")===n)){var i,r;const t=(null===(i=e.querySelector("show"))||void 0===i?void 0:i.textContent)||"online";So.xmppstatus.save({status:t},{silent:!0});const n=null===(r=e.querySelector("status"))||void 0===r?void 0:r.textContent;n&&So.xmppstatus.save({status_message:n})}So.jid===t&&"unavailable"===s&&Cc.user.presence.send()},presenceHandler(e){var t;const n=e.getAttribute("type");if("error"===n)return!0;const s=e.getAttribute("from"),i=_h.getBareJidFromJid(s);if(this.isSelf(i))return this.handleOwnPresence(e);if(Sh('query[xmlns="'.concat(_h.NS.MUC,'"]'),e).length)return;const r=null===(t=e.querySelector("status"))||void 0===t?void 0:t.textContent,o=this.get(i);if(o&&r!==o.get("status")&&o.save({status:r}),"subscribed"===n&&o)o.ackSubscribe();else if("unsubscribed"===n&&o)o.ackUnsubscribe();else{if("unsubscribe"===n)return;if("subscribe"===n)this.handleIncomingSubscription(e);else if("unavailable"===n&&o){const e=_h.getResourceFromJid(s);o.presence.removeResource(e)}else o&&o.presence.addResource(e)}}}),{Strophe:jh}=Mc.env,Ah={contacts:{async get(e){await Cc.waitUntil("rosterContactsFetched");const t=e=>So.roster.get(jh.getBareJidFromJid(e));if(void 0===e)e=So.roster.pluck("jid");else if("string"==typeof e)return t(e);return e.map(t)},async add(e,t){if(await Cc.waitUntil("rosterContactsFetched"),"string"!=typeof e||!e.includes("@"))throw new TypeError("contacts.add: invalid jid");return So.roster.addAndSubscribe(e,t)}}},{Strophe:Ch,dayjs:kh,sizzle:Oh}=Mc.env,Th=ao.extend({idAttribute:"name"}),Nh=ua.extend({model:Th}),Ih=ao.extend({defaults:{show:"offline"},initialize(){this.resources=new Nh;const e="converse.identities-".concat(this.get("jid"));Cr(this.resources,e,"session"),this.listenTo(this.resources,"update",this.onResourcesChanged),this.listenTo(this.resources,"change",this.onResourcesChanged)},onResourcesChanged(){var e;const t=this.getHighestPriorityResource(),n=(null==t||null===(e=t.attributes)||void 0===e?void 0:e.show)||"offline";this.get("show")!==n&&this.save({show:n})},getHighestPriorityResource(){return this.resources.sortBy((e=>"".concat(e.get("priority"),"-").concat(e.get("timestamp")))).reverse()[0]},addResource(e){var t,n,s,i;const r=e.getAttribute("from"),o=Ch.getResourceFromJid(r),a=Oh('delay[xmlns="'.concat(Ch.NS.DELAY,'"]'),e).pop(),c=null!==(t=null===(n=e.querySelector("priority"))||void 0===n?void 0:n.textContent)&&void 0!==t?t:0,l=this.resources.get(o),u={name:o,priority:sh(parseInt(c,10))?0:parseInt(c,10),show:null!==(s=null===(i=e.querySelector("show"))||void 0===i?void 0:i.textContent)&&void 0!==s?s:"online",timestamp:a?kh(a.getAttribute("stamp")).toISOString():(new Date).toISOString()};l?l.save(u):this.resources.create(u)},removeResource(e){const t=this.resources.get(e);t&&t.destroy()}}),Mh=ua.extend({model:Ih});function Rh(e){const t=So.roster&&So.roster.findWhere({jid:e.get("jid")});void 0!==t&&t.save({num_unread:e.get("num_unread")})}async function Dh(){var e;await(null===(e=So.presences)||void 0===e?void 0:e.clearStore())}function zh(e,t){const n=e.presence.get("show")||"offline",s=t.presence.get("show")||"offline";if(So.STATUS_WEIGHTS[n]===So.STATUS_WEIGHTS[s]){const n=e.getDisplayName().toLowerCase(),s=t.getDisplayName().toLowerCase();return n<s?-1:n>s?1:0}return So.STATUS_WEIGHTS[n]<So.STATUS_WEIGHTS[s]?-1:1}function Lh(e,t){const n={};n[So.HEADER_UNREAD]=0,n[So.HEADER_REQUESTING_CONTACTS]=1,n[So.HEADER_CURRENT_CONTACTS]=2,n[So.HEADER_UNGROUPED]=3,n[So.HEADER_PENDING_CONTACTS]=4;const s=n,i=Object.keys(n),r=i.includes(e),o=i.includes(t);if(!r&&!o)return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0;if(r&&o)return s[e]<s[t]?-1:s[e]>s[t]?1:0;if(!r&&o){const e=So.HEADER_CURRENT_CONTACTS;return s[e]<s[t]?-1:s[e]>s[t]?1:0}if(r&&!o){const t=So.HEADER_CURRENT_CONTACTS;return s[e]<s[t]?-1:s[e]>s[t]?1:0}}const{$pres:Ph}=Mc.env;Mc.plugins.add("converse-roster",{dependencies:["converse-status"],initialize(){Cc.settings.extend({allow_contact_requests:!0,auto_subscribe:!1,synchronize_availability:!0}),Cc.promises.add(["cachedRoster","roster","rosterContactsFetched","rosterInitialized"]),Object.assign(So.api,Ah),So.HEADER_CURRENT_CONTACTS=Vu("My contacts"),So.HEADER_PENDING_CONTACTS=Vu("Pending contacts"),So.HEADER_REQUESTING_CONTACTS=Vu("Contact requests"),So.HEADER_UNGROUPED=Vu("Ungrouped"),So.HEADER_UNREAD=Vu("New messages"),So.registerPresenceHandler=function(){So.unregisterPresenceHandler(),So.presence_ref=So.connection.addHandler((e=>(So.roster.presenceHandler(e),!0)),null,"presence",null)},So.rejectPresenceSubscription=function(e,t){const n=Ph({to:e,type:"unsubscribed"});t&&""!==t&&n.c("status").t(t),Cc.send(n)},So.sendInitialPresence=function(){So.send_initial_presence&&Cc.user.presence.send()},So.populateRoster=async function(e=!1){e&&(So.send_initial_presence=!0);try{await So.roster.fetchRosterContacts(),Cc.trigger("rosterContactsFetched")}catch(e){as.error(e)}finally{So.sendInitialPresence()}},So.Presence=Ih,So.Presences=Mh,So.RosterContact=yh,So.RosterContacts=Eh,So.unregisterPresenceHandler=function(){void 0!==So.presence_ref&&(So.connection.deleteHandler(So.presence_ref),delete So.presence_ref)},Cc.listen.on("chatBoxesInitialized",(()=>{So.chatboxes.on("change:num_unread",Rh),So.chatboxes.on("add",(e=>{e.get("type")===So.PRIVATE_CHAT_TYPE&&e.setRosterContact(e.get("jid"))}))})),Cc.listen.on("beforeTearDown",(()=>So.unregisterPresenceHandler())),Cc.waitUntil("rosterContactsFetched").then((()=>{So.roster.on("add",(e=>{const t=So.chatboxes.findWhere({jid:e.get("jid")});t&&t.setRosterContact(e.get("jid"))}))})),Cc.listen.on("streamResumptionFailed",(()=>So.session.set("roster_cached",!1))),Cc.listen.on("clearSession",(async()=>{await Dh(),So.shouldClearCache()&&(So.rostergroups&&(await So.rostergroups.clearStore(),delete So.rostergroups),So.roster&&(No(So,"roster.data.destroy"),await So.roster.clearStore(),delete So.roster))})),Cc.listen.on("statusInitialized",(async e=>{if(e)!So.connection.hasResumed()&&await Dh();else{So.presences=new So.Presences;const e="converse.presences-".concat(So.bare_jid);Cr(So.presences,e,"session"),So.presences.fetch()}Cc.trigger("presencesInitialized",e)})),Cc.listen.on("presencesInitialized",(async e=>{e?Cc.trigger("rosterReadyAfterReconnection"):await async function(){await Cc.waitUntil("VCardsInitialized"),So.roster=new So.RosterContacts;let e="converse.contacts-".concat(So.bare_jid);Cr(So.roster,e),So.roster.data=new ao,e="converse-roster-model-".concat(So.bare_jid),So.roster.data.id=e,Cr(So.roster.data,e),So.roster.data.fetch(),Cc.trigger("rosterInitialized")}(),So.roster.onConnected(),So.registerPresenceHandler(),So.populateRoster(!So.connection.restored)}))}});const{Strophe:Fh}=Mc.env,Bh=Mc.env.utils;function Uh(){return!(Cc.connection.isType("bosh")&&!So.isTestEnv())&&Cc.disco.stream.getFeature("sm",Fh.NS.SM)}function qh(e){if(!So.session.get("smacks_enabled"))return!0;const t=parseInt(e.getAttribute("h"),10),n=So.session.get("num_stanzas_handled_by_server"),s=t-n;if(s<0){const e="New reported stanza count lower than previous. "+"New: ".concat(t," - Previous: ").concat(n);as.error(e)}const i=So.session.get("unacked_stanzas");if(s>i.length){const e="Higher reported acknowledge count than unacknowledged stanzas. "+"Reported Acknowledged Count: ".concat(s," -")+"Unacknowledged Stanza Count: ".concat(i.length," -")+"New: ".concat(t," - Previous: ").concat(n);as.error(e)}return So.session.save({num_stanzas_handled_by_server:t,num_stanzas_since_last_ack:0,unacked_stanzas:i.slice(s)}),!0}function Hh(){if(So.session.get("smacks_enabled")){const e=So.session.get("num_stanzas_handled"),t=Bh.toStanza('<a xmlns="'.concat(Fh.NS.SM,'" h="').concat(e,'"/>'));Cc.send(t)}return!0}function $h(e){if(So.session.get("smacks_enabled")&&(Bh.isTagEqual(e,"iq")||Bh.isTagEqual(e,"presence")||Bh.isTagEqual(e,"message"))){const e=So.session.get("num_stanzas_handled");So.session.save("num_stanzas_handled",e+1)}return!0}function Gh(){So.session.save({smacks_enabled:So.session.get("smacks_enabled")||!1,num_stanzas_handled:So.session.get("num_stanzas_handled")||0,num_stanzas_handled_by_server:So.session.get("num_stanzas_handled_by_server")||0,num_stanzas_since_last_ack:So.session.get("num_stanzas_since_last_ack")||0,unacked_stanzas:So.session.get("unacked_stanzas")||[]})}function Vh(){So.session&&So.session.save({smacks_enabled:!1,num_stanzas_handled:0,num_stanzas_handled_by_server:0,num_stanzas_since_last_ack:0,unacked_stanzas:[]})}function Wh(e){const t={smacks_enabled:!0};return["1","true"].includes(e.getAttribute("resume"))&&(t.smacks_stream_id=e.getAttribute("id")),So.session.save(t),!0}function Jh(e){return e.querySelector("item-not-found")?as.warn("Could not resume previous SMACKS session, session id not found. A new session will be established."):(as.error("Failed to enable stream management"),as.error(e.outerHTML)),Vh(),Cc.trigger("streamResumptionFailed"),!0}async function Qh(){if(Cc.settings.get("enable_smacks")&&!So.session.get("smacks_enabled")&&await Uh()){const e=Et();So.connection._addSysHandler((t=>e.resolve(Wh(t))),Fh.NS.SM,"enabled"),So.connection._addSysHandler((t=>e.resolve(Jh(t))),Fh.NS.SM,"failed");const t=Cc.connection.isType("websocket")||So.isTestEnv(),n=Bh.toStanza('<enable xmlns="'.concat(Fh.NS.SM,'" resume="').concat(t,'"/>'));Cc.send(n),So.connection.flush(),await e}}const Yh=[];async function Kh(){if(!Cc.settings.get("enable_smacks"))return;if(!await Uh())return;const e=So.connection;for(;Yh.length;)e.deleteHandler(Yh.pop());Yh.push(e.addHandler($h)),Yh.push(e.addHandler(Hh,Fh.NS.SM,"r")),Yh.push(e.addHandler(qh,Fh.NS.SM,"a")),So.session.get("smacks_stream_id")?await async function(){const e=Et();So.connection._addSysHandler((t=>e.resolve(function(e){Wh(e),qh(e),function(){const e=So.session.get("unacked_stanzas");So.session.save("unacked_stanzas",[]),e.forEach((e=>Cc.send(e)))}(),So.connection.do_bind=!1,So.connection.authenticated=!0,So.connection.restored=!0,So.connection._changeConnectStatus(Fh.Status.CONNECTED,null)}(t))),Fh.NS.SM,"resumed"),So.connection._addSysHandler((t=>e.resolve(Jh(t))),Fh.NS.SM,"failed");const t=So.session.get("smacks_stream_id"),n=So.session.get("num_stanzas_handled"),s=Bh.toStanza('<resume xmlns="'.concat(Fh.NS.SM,'" h="').concat(n,'" previd="').concat(t,'"/>'));Cc.send(s),So.connection.flush(),await e}():Vh()}function Xh(e){if(So.session){if(So.session.get("smacks_enabled")&&(Bh.isTagEqual(e,"iq")||Bh.isTagEqual(e,"presence")||Bh.isTagEqual(e,"message"))){const t=Fh.serialize(e);So.session.save("unacked_stanzas",(So.session.get("unacked_stanzas")||[]).concat([t]));const n=Cc.settings.get("smacks_max_unacked_stanzas");if(n>0){const e=So.session.get("num_stanzas_since_last_ack")+1;e%n==0&&Cc.send(Bh.toStanza('<r xmlns="'.concat(Fh.NS.SM,'"/>'))),So.session.save({num_stanzas_since_last_ack:e})}}}else as.warn("No _converse.session!")}const{Strophe:Zh}=Mc.env;Zh.addNamespace("SM","urn:xmpp:sm:3"),Mc.plugins.add("converse-smacks",{initialize(){Cc.settings.extend({enable_smacks:!0,smacks_max_unacked_stanzas:5}),Cc.listen.on("afterResourceBinding",Qh),Cc.listen.on("beforeResourceBinding",Kh),Cc.listen.on("send",Xh),Cc.listen.on("userSessionInitialized",Gh)}});const{Strophe:ef,$iq:tf,dayjs:nf}=Mc.env,sf=Mc.env.utils;Mc.plugins.add("converse-vcard",{dependencies:["converse-status","converse-roster"],overrides:{XMPPStatus:{getNickname(){const{_converse:e}=this.__super__,t=this.__super__.getNickname.apply(this);return!t&&e.xmppstatus.vcard?e.xmppstatus.vcard.get("nickname"):t},getFullname(){const{_converse:e}=this.__super__,t=this.__super__.getFullname.apply(this);return!t&&e.xmppstatus.vcard?e.xmppstatus.vcard.get("fullname"):t}},RosterContact:{getDisplayName(){return!this.get("nickname")&&this.vcard?this.vcard.getDisplayName():this.__super__.getDisplayName.apply(this)},getFullname(){return this.vcard?this.vcard.get("fullname"):this.__super__.getFullname.apply(this)}}},initialize(){function e(e,t,n){const s=tf(t?{type:e,to:t}:{type:e});return n?s.cnode(n):s.c("vCard",{xmlns:ef.NS.VCARD}),s}async function t(t,n){const s=ef.getBareJidFromJid(n)===t.bare_jid?null:n;let i;try{i=await Cc.sendIQ(e("get",s))}catch(i){return{stanza:i,jid:n,vcard_error:(new Date).toISOString()}}return async function(e,t){const n=t.querySelector("vCard");let s={};var i,r,o,a,c,l,u;if(null!==n&&(s={stanza:t,fullname:null===(i=n.querySelector("FN"))||void 0===i?void 0:i.textContent,nickname:null===(r=n.querySelector("NICKNAME"))||void 0===r?void 0:r.textContent,image:null===(o=n.querySelector("PHOTO BINVAL"))||void 0===o?void 0:o.textContent,image_type:null===(a=n.querySelector("PHOTO TYPE"))||void 0===a?void 0:a.textContent,url:null===(c=n.querySelector("URL"))||void 0===c?void 0:c.textContent,role:null===(l=n.querySelector("ROLE"))||void 0===l?void 0:l.textContent,email:null===(u=n.querySelector("EMAIL USERID"))||void 0===u?void 0:u.textContent,vcard_updated:(new Date).toISOString(),vcard_error:void 0}),s.image){const e=sf.base64ToArrayBuffer(s.image),t=await crypto.subtle.digest("SHA-1",e);s.image_hash=sf.arrayBufferToHex(t)}return s}(0,i)}async function n(e){let t;if(e instanceof So.Message){if("error"===e.get("type"))return;t=e.get("from")}else t=e.get("jid");await Cc.waitUntil("VCardsInitialized"),e.vcard=So.vcards.findWhere({jid:t}),e.vcard||(e.vcard=So.vcards.create({jid:t})),e.vcard.on("change",(()=>e.trigger("vcard:change")))}Cc.promises.add("VCardsInitialized"),So.VCard=ao.extend({defaults:{image:So.DEFAULT_IMAGE,image_type:So.DEFAULT_IMAGE_TYPE},set(e,t,n){let s;return"object"==typeof e?(s=e,n=t):(s={})[e]=t,"image"in s&&!s.image?(s.image=So.DEFAULT_IMAGE,s.image_type=So.DEFAULT_IMAGE_TYPE,ao.prototype.set.call(this,s,n)):ao.prototype.set.apply(this,arguments)},getDisplayName(){return this.get("nickname")||this.get("fullname")||this.get("jid")}}),So.VCards=ua.extend({model:So.VCard,initialize(){this.on("add",(e=>e.get("jid")&&Cc.vcard.update(e)))}}),So.initVCardCollection=async function(){So.vcards=new So.VCards;const e="".concat(So.bare_jid,"-converse.vcards");Cr(So.vcards,e),await new Promise((e=>{So.vcards.fetch({success:e,error:e},{silent:!0})}));const t=So.vcards;if(So.session){const e=So.session.get("bare_jid");So.xmppstatus.vcard=t.findWhere({jid:e})||t.create({jid:e})}Cc.trigger("VCardsInitialized")},Cc.listen.on("chatBoxInitialized",(e=>n(e))),Cc.listen.on("chatRoomInitialized",(e=>n(e))),Cc.listen.on("chatRoomMessageInitialized",(e=>async function(e){await Cc.waitUntil("VCardsInitialized"),["error","info"].includes(e.get("type"))||(e.vcard=function(e){var t;const n=null==e||null===(t=e.collection)||void 0===t?void 0:t.chatbox,s=ef.getResourceFromJid(e.get("from"));if(n&&n.get("nick")===s)return So.xmppstatus.vcard;{const t=e.occupant&&e.occupant.get("jid")||e.get("from");return t?So.vcards.findWhere({jid:t})||So.vcards.create({jid:t}):void as.error("Could not assign VCard for message because no JID found! msgid: ".concat(e.get("msgid")))}}(e))}(e))),Cc.listen.on("addClientFeatures",(()=>Cc.disco.own.features.add(ef.NS.VCARD))),Cc.listen.on("clearSession",(()=>{So.shouldClearCache()&&(Cc.promises.add("VCardsInitialized"),So.vcards&&(So.vcards.clearStore(),delete So.vcards))})),Cc.listen.on("messageInitialized",(e=>n(e))),Cc.listen.on("rosterContactInitialized",(e=>n(e))),Cc.listen.on("statusInitialized",So.initVCardCollection),Object.assign(So.api,{vcard:{async set(t,n){if(!t)throw Error("No jid provided for the VCard data");const s=document.createElement("div"),i=sf.toStanza('\n <vCard xmlns="vcard-temp">\n <FN>'.concat(n.fn,"</FN>\n <NICKNAME>").concat(n.nickname,"</NICKNAME>\n <URL>").concat(n.url,"</URL>\n <ROLE>").concat(n.role,"</ROLE>\n <EMAIL><INTERNET/><PREF/><USERID>").concat(n.email,"</USERID></EMAIL>\n <PHOTO>\n <TYPE>").concat(n.image_type,"</TYPE>\n <BINVAL>").concat(n.image,"</BINVAL>\n </PHOTO>\n </vCard>"),s);let r;try{r=await Cc.sendIQ(e("set",t,i))}catch(e){throw e}return await Cc.vcard.update(t,!0),r},get(e,n){if("string"==typeof e)return t(So,e);if(!n&&e.get("vcard_updated")&&nf(e.get("vcard_error")).isSame(new Date,"day"))return Promise.resolve({});{const n=e.get("jid");return n||as.error("No JID to get vcard for"),t(So,n)}},async update(e,t){const n=await this.get(e,t);(e="string"==typeof e?So.vcards.findWhere({jid:e}):e)?(delete n.stanza,e.save(n)):as.error("Could not find a VCard model for ".concat(e))}}})}});const rf={};function of(){const e=(t=['\n <form class="converse-form chatroom-form" @submit=',">\n <legend>",'</legend>\n <fieldset class="form-group">\n <label for="converse_muc_bookmark_name">','</label>\n <input class="form-control" type="text" value="','" name="name" required="required" id="converse_muc_bookmark_name"/>\n </fieldset>\n <fieldset class="form-group">\n <label for="converse_muc_bookmark_nick">','</label>\n <input class="form-control" type="text" name="nick" value="','" id="converse_muc_bookmark_nick"/>\n </fieldset>\n <fieldset class="form-group form-check">\n <input class="form-check-input" id="converse_muc_bookmark_autojoin" type="checkbox" name="autojoin"/>\n <label class="form-check-label" for="converse_muc_bookmark_autojoin">','</label>\n </fieldset>\n <fieldset class="form-group">\n <input class="btn btn-primary" type="submit" value="','">\n <input class="btn btn-secondary button-cancel" type="button" value="','" @click=',">\n </fieldset>\n </form>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return of=function(){return e},e}Cc.elements={registry:rf,define:function(e,t){this.registry[e]=t},register:function(){Object.keys(rf).forEach((e=>{customElements.get(e)||customElements.define(e,rf[e])}))}},n(6353);class af extends jc{constructor(){super(),Object.assign(this,Hi)}createRenderRoot(){return this}disconnectedCallback(){super.disconnectedCallback(),this.stopListening()}}class cf extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid)}render(){return(e=>{const t=Vu("Bookmark this groupchat"),n=Vu("Would you like this groupchat to be automatically joined upon startup?"),s=Vu("Cancel"),i=Vu("The name for this bookmark:"),r=Vu("What should your nickname for this groupchat be?"),o=Vu("Save");return Ha(of(),e.onSubmit,t,i,e.name,r,e.nick||"",n,o,s,e.onCancel)})(Object.assign(this.model.toJSON(),{onCancel:e=>this.closeBookmarkForm(e),onSubmit:e=>this.onBookmarkFormSubmitted(e)}))}onBookmarkFormSubmitted(e){var t,n,s;e.preventDefault(),So.bookmarks.createBookmark({jid:this.model.get("jid"),autojoin:(null===(t=e.target.querySelector('input[name="autojoin"]'))||void 0===t?void 0:t.checked)||!1,name:null===(n=e.target.querySelector("input[name=name]"))||void 0===n?void 0:n.value,nick:null===(s=e.target.querySelector("input[name=nick]"))||void 0===s?void 0:s.value}),this.closeBookmarkForm(e)}closeBookmarkForm(e){e.preventDefault(),this.model.session.save("view",null)}}Cc.elements.define("converse-muc-bookmark-form",cf);const lf=cf,uf=lt((function(e,t,n){var s=-1,i="function"==typeof t,r=ye(e)?Array(e.length):[];return Ii(e,(function(e){r[++s]=i?Ze(t,e,n):To(e,t,n)})),r}));function df(e,t){if(So.allow_bookmarks&&e.model.get("type")===So.CHATROOMS_TYPE){const n=e.model.get("bookmarked"),s={i18n_title:Vu(n?"Unbookmark this groupchat":"Bookmark this groupchat"),i18n_text:Vu(n?"Unbookmark":"Bookmark"),handler:t=>e.toggleBookmark(t),a_class:"toggle-bookmark",icon_class:"fa-bookmark",name:"bookmark"},i=t.map((e=>e.name)).indexOf("details"),r=Xu().then((e=>e?s:""));return i>-1?[...t.slice(0,i),r,...t.slice(i)]:[r,...t]}return t}function hf(e){e.preventDefault();const t=e.target.getAttribute("data-bookmark-name"),n=e.target.getAttribute("data-room-jid");confirm(Vu('Are you sure you want to remove the bookmark "%1$s"?',t))&&uf(So.bookmarks.where({jid:n}),ao.prototype.destroy)}async function ff(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid");(await Cc.rooms.open(t,{bring_to_foreground:!0})).session.save("view",Mc.MUC.VIEWS.BOOKMARK)}function gf(e){e.preventDefault();const{Strophe:t}=Mc.env,n=e.target.textContent,s=e.target.getAttribute("data-room-jid"),i={name:n||t.unescapeNode(t.getNodeFromJid(s))||s};Cc.rooms.open(s,i,!0)}function mf(){const e=(t=['\n <div class="list-item controlbox-padded room-item available-chatroom d-flex flex-row ','" data-room-jid="','">\n <a class="list-item-link open-room w-100" data-room-jid="','"\n title="','"\n @click=',">",'</a>\n\n <a class="list-item-action remove-bookmark fa fa-bookmark align-self-center ','"\n data-room-jid="','"\n data-bookmark-name="','"\n title="','"\n @click=',"></a>\n </div>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return mf=function(){return e},e}function pf(){const e=(t=['\n <div class="list-container list-container--bookmarks ','">\n <a class="list-toggle bookmarks-toggle controlbox-padded"\n title="','"\n @click=','>\n\n <span class="fa ','">\n </span> ','</a>\n <div class="items-list bookmarks rooms-list ','">\n ',"\n </div>\n </div>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return pf=function(){return e},e}"undefined"!=typeof Element&&Element.prototype;const vf=/^(\S+)\s*(.*)$/,bf=["model","collection","events"];class yf extends HTMLElement{constructor(e){var t,n,s;super(),s={},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,this.cid=qi("view"),this._domEvents=[],Us(this,Pr(e,bf))}createRenderRoot(){return this}connectedCallback(){this._initialized||(this.preinitialize.apply(this,arguments),this.initialize.apply(this,arguments),this._initialized=!0),this.delegateEvents()}disconnectedCallback(){this.undelegateEvents(),this.stopListening()}preinitialize(){}initialize(){}render(){return _(this.beforeRender)&&this.beforeRender(),_(this.toHTML)&&Wa(this.toHTML(),this),_(this.afterRender)&&this.afterRender(),this}delegateEvents(){if(!this.events)return this;this.undelegateEvents();for(const e in this.events){let t=this.events[e];if(_(t)||(t=this[t]),!t)continue;const n=e.match(vf);this.delegate(n[1],n[2],t.bind(this))}return this}delegate(e,t,n){const s=this;if(!s)return this;if("function"==typeof t&&(n=t,t=null),-1!==["focus","blur"].indexOf(e)){const s=this.querySelectorAll(t);for(let t=0,i=s.length;t<i;t++){const i=s[t];i.addEventListener(e,n,!1),this._domEvents.push({el:i,eventName:e,handler:n})}return n}const i=t?function(e){let i=e.target||e.srcElement;for(;i&&i!=s;i=i.parentNode)i.matches(t)&&(e.delegateTarget=i,n(e))}:n;return this.addEventListener(e,i,!1),this._domEvents.push({el:this,eventName:e,handler:i,listener:n,selector:t}),this}undelegateEvents(){if(this){for(let e=0,t=this._domEvents.length;e<t;e++){const t=this._domEvents[e];t.el.removeEventListener(t.eventName,t.handler,!1)}this._domEvents.length=0}return this}undelegate(e,t,n){if("function"==typeof t&&(n=t,t=null),this){const s=this._domEvents.slice();let i=s.length;for(;i--;){const r=s[i];!(r.eventName!==e||n&&r.listener!==n||t&&r.selector!==t)&&(r.el.removeEventListener(r.eventName,r.handler,!1),this._domEvents.splice(i,1))}}return this}}Object.assign(yf.prototype,Hi);const _f=Mc.env.utils;class wf extends yf{async initialize(){await Cc.waitUntil("bookmarksInitialized"),this.listenTo(So.bookmarks,"add",this.render),this.listenTo(So.bookmarks,"remove",this.render),this.listenTo(So.chatboxes,"add",this.render),this.listenTo(So.chatboxes,"remove",this.render);const e="converse.bookmarks-list-model-".concat(So.bare_jid);this.model=new So.BookmarksList({id:e}),Cr(this.model,e),this.model.fetch({success:()=>this.render(),error:(e,t)=>{as.error(t),this.render()}})}render(){Wa((e=>{const t=!!So.bookmarks.getUnopenedBookmarks().length,n=Vu("Click to toggle the bookmarks list"),s=Vu("Bookmarks");return Ha(pf(),t?"":"hidden",n,e.toggleBookmarksList,e.toggle_state===So.OPENED?"fa-caret-down":"fa-caret-right",s,e.toggle_state!==So.OPENED?"hidden":"",So.bookmarks.map((t=>(e=>{const t=e.bm.get("jid"),n=!(!Cc.settings.get("hide_open_bookmarks")||!So.chatboxes.get(t)),s=Vu("Unbookmark this groupchat"),i=Vu("Click to open this groupchat");return Ha(mf(),n?"hidden":"",t,t,i,gf,e.bm.getDisplayName(),e.bm.get("bookmarked")?"button-on":"",t,e.bm.getDisplayName(),s,hf)})(Object.assign({bm:t},e)))))})({toggleBookmarksList:e=>this.toggleBookmarksList(e),toggle_state:this.model.get("toggle-state")}),this)}toggleBookmarksList(e){e&&e.preventDefault&&e.preventDefault();const t=e.target.matches(".fa")?e.target:e.target.querySelector(".fa");_f.hasClass("fa-caret-down",t)?(_f.slideIn(this.querySelector(".bookmarks")),this.model.save({"toggle-state":So.CLOSED}),t.classList.remove("fa-caret-down"),t.classList.add("fa-caret-right")):(t.classList.remove("fa-caret-right"),t.classList.add("fa-caret-down"),_f.slideOut(this.querySelector(".bookmarks")),this.model.save({"toggle-state":So.OPENED}))}}Cc.elements.define("converse-bookmarks",wf);const{u:Sf}=Mc.env,xf={setBookmarkState(){void 0!==So.bookmarks&&(So.bookmarks.where({jid:this.model.get("jid")}).length?this.model.save("bookmarked",!0):this.model.save("bookmarked",!1))},renderBookmarkForm(){this.bookmark_form||(this.bookmark_form=new So.MUCBookmarkForm({model:this.model,chatroomview:this}),this.querySelector(".chatroom-body").insertAdjacentElement("beforeend",this.bookmark_form.el)),Sf.showElement(this.bookmark_form.el)},toggleBookmark(e){null==e||e.preventDefault();const t=So.bookmarks.where({jid:this.model.get("jid")});t.length?t.forEach((e=>e.destroy())):this.model.session.set("view",Mc.MUC.VIEWS.BOOKMARK)}};function Ef(){const e=(t=['\n <div class="inner-content converse-brand row">\n <div class="converse-brand__padding"></div>\n <div class="converse-brand__heading">\n <svg height="200px"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n viewBox="0 0 364 364"\n version="1.1">\n <title>Logo Converse</title>\n <defs>\n <linearGradient id="gradient" x1="92.14" y1="27.64" x2="267.65" y2="331.62" gradientUnits="userSpaceOnUse">\n <stop offset="0" stop-color="#fff1d1"/>\n <stop offset="0.05" stop-color="#fae8c1"/>\n <stop offset="0.15" stop-color="#f0d5a1"/>\n <stop offset="0.27" stop-color="#e7c687"/>\n <stop offset="0.4" stop-color="#e1bb72"/>\n <stop offset="0.54" stop-color="#dcb264"/>\n <stop offset="0.71" stop-color="#daad5c"/>\n <stop offset="1" stop-color="#d9ac59"/>\n </linearGradient>\n <filter id="shadow">\n <feGaussianBlur in="SourceAlpha" stdDeviation="2.3" result="blur1"/>\n <feOffset in="blur1" dx="3" dy="3" result="blur2"/>\n <feColorMatrix in="blur2" type="matrix" result="blur3"\n values="1 0 0 0 0.1\n 0 1 0 0 0.1\n 0 0 1 0 0.1\n 0 0 0 1 0"/>\n <feMerge>\n <feMergeNode in="blur3"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n </defs>\n <g filter="url(#shadow)">\n <path d="M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z" fill="#d9ac59"/>\n <path d="M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z" fill="url(#gradient)"/>\n </g>\n </svg>\n <span class="converse-brand__text">\n <span>converse<span class="subdued">.js</span></span>\n <p class="byline">messaging freedom</p>\n </span>\n </div>\n </div>'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Ef=function(){return e},e}n(5561),Mc.plugins.add("converse-bookmark-views",{dependencies:["converse-chatboxes","converse-muc","converse-muc-views"],initialize(){Cc.settings.extend({hide_open_bookmarks:!0}),So.removeBookmarkViaEvent=hf,So.addBookmarkViaEvent=ff,Object.assign(So.ChatRoomView.prototype,xf),So.MUCBookmarkForm=lf,So.BookmarksView=wf,Cc.listen.on("getHeadingButtons",df),Cc.listen.on("chatRoomViewInitialized",(e=>e.setBookmarkState()))}});const jf=e=>(...t)=>({_$litDirective$:e,values:t});class Af{constructor(e){}T(e,t,n){this.Σdt=e,this.M=t,this.Σct=n}S(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const{et:Cf}=rc,kf=()=>document.createComment(""),Of=(e,t,n)=>{var s;const i=e.A.parentNode,r=void 0===t?e.B:t.A;if(void 0===n){const t=i.insertBefore(kf(),r),s=i.insertBefore(kf(),r);n=new Cf(t,s,e,e.options)}else{const t=n.B.nextSibling,o=n.M!==e;if(o&&(null===(s=n.Q)||void 0===s||s.call(n,e),n.M=e),t!==r||o){let e=n.A;for(;e!==t;){const t=e.nextSibling;i.insertBefore(e,r),e=t}}}return n},Tf=(e,t,n=e)=>(e.I(t,n),e),Nf={},If=e=>{var t;null===(t=e.P)||void 0===t||t.call(e,!1,!0);let n=e.A;const s=e.B.nextSibling;for(;n!==s;){const e=n.nextSibling;n.remove(),n=e}},Mf=(e,t,n)=>{const s=new Map;for(let i=t;i<=n;i++)s.set(e[i],i);return s},Rf=jf(class extends Af{constructor(e){if(super(e),2!==e.type)throw Error("repeat() can only be used in text expressions")}Mt(e,t,n){let s;void 0===n?n=t:void 0!==t&&(s=t);const i=[],r=[];let o=0;for(const t of e)i[o]=s?s(t,o):o,r[o]=n(t,o),o++;return{values:r,keys:i}}render(e,t,n){return this.Mt(e,t,n).values}update(e,[t,n,s]){var i;const r=(e=>e.H)(e),{values:o,keys:a}=this.Mt(t,n,s);if(!r)return this.Pt=a,o;const c=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[],l=[];let u,d,h=0,f=r.length-1,g=0,m=o.length-1;for(;h<=f&&g<=m;)if(null===r[h])h++;else if(null===r[f])f--;else if(c[h]===a[g])l[g]=Tf(r[h],o[g]),h++,g++;else if(c[f]===a[m])l[m]=Tf(r[f],o[m]),f--,m--;else if(c[h]===a[m])l[m]=Tf(r[h],o[m]),Of(e,l[m+1],r[h]),h++,m--;else if(c[f]===a[g])l[g]=Tf(r[f],o[g]),Of(e,r[h],r[f]),f--,g++;else if(void 0===u&&(u=Mf(a,g,m),d=Mf(c,h,f)),u.has(c[h]))if(u.has(c[f])){const t=d.get(a[g]),n=void 0!==t?r[t]:null;if(null===n){const t=Of(e,r[h]);Tf(t,o[g]),l[g]=t}else l[g]=Tf(n,o[g]),Of(e,r[h],n),r[t]=null;g++}else If(r[f]),f--;else If(r[h]),h++;for(;g<=m;){const t=Of(e,l[m+1]);Tf(t,o[g]),l[g++]=t}for(;h<=f;){const e=r[h++];null!==e&&If(e)}return this.Pt=a,((e,t=Nf)=>{e.H=t})(e,l),$a}});function Df(){const e=qf(['\n <converse-chat jid="','" class="chatbox"></converse-chat>\n ']);return Df=function(){return e},e}function zf(){const e=qf(['\n <converse-headlines jid="','" class="chatbox headlines"></converse-headlines>\n ']);return zf=function(){return e},e}function Lf(){const e=qf(['\n <converse-muc jid="','" class="chatbox chatroom"></converse-muc>\n ']);return Lf=function(){return e},e}function Pf(){const e=qf(['<converse-controlbox-toggle class="','"></converse-controlbox-toggle>']);return Pf=function(){return e},e}function Ff(){const e=qf(["\n ",'\n <converse-controlbox\n id="controlbox"\n class="chatbox '," ",'"\n style="','"></converse-controlbox>\n ']);return Ff=function(){return e},e}function Bf(){const e=qf(["<converse-minimized-chats></converse-minimized-chats>"]);return Bf=function(){return e},e}function Uf(){const e=qf(["\n ","\n ","\n "]);return Uf=function(){return e},e}function qf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Hf(e){const{CONTROLBOX_TYPE:t}=So;return e.get("type")===t||!(e.get("hidden")||e.get("minimized"))}Cc.elements.define("converse-chats",class extends yf{initialize(){this.model=So.chatboxes,this.listenTo(this.model,"add",this.render),this.listenTo(this.model,"change:closed",this.render),this.listenTo(this.model,"change:hidden",this.render),this.listenTo(this.model,"change:jid",this.render),this.listenTo(this.model,"change:minimized",this.render),this.listenTo(this.model,"destroy",this.render),this.listenTo(So,"connected",this.render),this.listenTo(So,"reconnected",this.render),this.listenTo(So,"disconnected",this.render);const e=document.getElementById("conversejs-bg");e&&!e.innerHTML.trim()&&Wa(Ha(Ef()),e),document.querySelector("body").classList.add("converse-".concat(Cc.settings.get("view_mode"))),this.render(),Cc.trigger("chatBoxViewsInitialized")}render(){Wa((()=>{const{chatboxes:e,CONTROLBOX_TYPE:t,CHATROOMS_TYPE:n,HEADLINES_TYPE:s}=So,i=Cc.settings.get("view_mode"),r=null==So?void 0:So.connection,o=!(null==r?void 0:r.connected)||!(null==r?void 0:r.authenticated)||(null==r?void 0:r.disconnecting);return Ha(Uf(),"overlayed"===i?Ha(Bf()):"",Rf(e.filter(Hf),(e=>e.get("jid")),(e=>e.get("type")===t?Ha(Ff(),"overlayed"===i?Ha(Pf(),e.get("closed")?"":"hidden"):"",e.get("closed")?"hidden":"",o?"logged-out":"",e.get("width")?"width: ".concat(e.get("width")):""):e.get("type")===n?Ha(Lf(),e.get("jid")):e.get("type")===s?Ha(zf(),e.get("jid")):Ha(Df(),e.get("jid")))))})(),this)}});function $f(){const e=(t=['\n <svg xmlns="http://www.w3.org/2000/svg" class="avatar ','" width="','" height="','">\n <image width="','" height="','" preserveAspectRatio="xMidYMid slice" href="','"/>\n </svg>'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return $f=function(){return e},e}const Gf=e=>{return e.image?Ha($f(),e.classes,e.width,e.height,e.width,e.height,(t=e.image,n=e.image_type,t.startsWith("data:")?t:"data:".concat(n,";base64,").concat(t))):"";var t,n},Vf=/^\s*</,Wf=("undefined"!=typeof Element&&Element.prototype,function(e){this.cid=qi("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Us(this,Pr(e,Qf)),this._ensureElement(),this.initialize.apply(this,arguments)});Wf.extend=ir;const Jf=/^(\S+)\s*(.*)$/,Qf=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(Wf.prototype,Hi,{tagName:"div",$:function(e){return this.el.querySelectorAll(e)},preinitialize:function(){},initialize:function(){},render:function(){return _(this.beforeRender)&&this.beforeRender(),_(this.toHTML)&&Wa(this.toHTML(),this.el),_(this.afterRender)&&this.afterRender(),this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){if("string"==typeof e)if(Vf.test(e)){const t=document.createElement("div");t.innerHTML=e,this.el=t.firstChild}else this.el=document.querySelector(e);else e&&!es(e)&&e.length?this.el=e[0]:this.el=e},delegateEvents:function(e){if(e||(e=sr(this,"events")),!e)return this;this.undelegateEvents();for(const t in e){let n=e[t];if(_(n)||(n=this[n]),!n)continue;const s=t.match(Jf);this.delegate(s[1],s[2],n.bind(this))}return this},delegate:function(e,t,n){const s=this.el;if(!s)return this;if("function"==typeof t&&(n=t,t=null),-1!==["focus","blur"].indexOf(e)){const s=this.el.querySelectorAll(t);for(let t=0,i=s.length;t<i;t++){const i=s[t];i.addEventListener(e,n,!1),this._domEvents.push({el:i,eventName:e,handler:n})}return n}const i=t?function(e){let i=e.target||e.srcElement;for(;i&&i!=s;i=i.parentNode)i.matches(t)&&(e.delegateTarget=i,n(e))}:n;return this.el.addEventListener(e,i,!1),this._domEvents.push({el:this.el,eventName:e,handler:i,listener:n,selector:t}),this},undelegateEvents:function(){if(this.el){for(let e=0,t=this._domEvents.length;e<t;e++){const t=this._domEvents[e];t.el.removeEventListener(t.eventName,t.handler,!1)}this._domEvents.length=0}return this},undelegate:function(e,t,n){if("function"==typeof t&&(n=t,t=null),this.el){const s=this._domEvents.slice();let i=s.length;for(;i--;){const r=s[i];!(r.eventName!==e||n&&r.listener!==n||t&&r.selector!==t)&&(r.el.removeEventListener(r.eventName,r.handler,!1),this._domEvents.splice(i,1))}}return this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(sr(this,"el"));else{const e=Us({},sr(this,"attributes"));this.id&&(e.id=sr(this,"id")),this.className&&(e.class=sr(this,"className")),this.setElement(this._createElement(sr(this,"tagName"))),this._setAttributes(e)}},_setAttributes:function(e){for(const t in e)t in this.el?this.el[t]=e[t]:this.el.setAttribute(t,e[t])}});const Yf=Mc.env.utils,Kf={renderAvatar(e){var t;const n=(e=e||(null!==(t=null==this?void 0:this.el)&&void 0!==t?t:this)).querySelector("canvas.avatar, svg.avatar");if(null!==n&&this.model.vcard){const e={classes:n.getAttribute("class"),width:n.getAttribute("width"),height:n.getAttribute("height"),image_type:this.model.vcard.get("image_type"),image:this.model.vcard.get("image")};n.outerHTML=Yf.getElementFromTemplateResult(Gf(e)).outerHTML}}},Xf=Wf.extend(Kf);class Zf extends yf{renderAvatar(e){Kf.renderAvatar.call(this,e)}}function eg(){const e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh","".concat(e,"px"))}n(4410),Mc.plugins.add("converse-chatboxviews",{dependencies:["converse-chatboxes","converse-vcard"],initialize(){Cc.elements.register(),Cc.promises.add(["chatBoxViewsInitialized"]),Cc.settings.extend({animate:!0,theme:"default"}),So.ViewWithAvatar=Xf,So.chatboxviews=new class{constructor(){this.views={}}add(e,t){this.views[e]=t}get(e){return this.views[e]}getAll(){return Object.values(this.views)}keys(){return Object.keys(this.views)}remove(e){delete this.views[e]}map(e){return Object.values(this.views).map(e)}forEach(e){return Object.values(this.views).forEach(e)}filter(e){return Object.values(this.views).filter(e)}closeAllChatBoxes(){return Promise.all(Object.values(this.views).map((e=>e.close({name:"closeAllChatBoxes"}))))}},Cc.listen.on("chatBoxesInitialized",(()=>{So.chatboxes.on("destroy",(e=>So.chatboxviews.remove(e.get("jid"))))})),Cc.listen.on("cleanup",(()=>delete So.chatboxviews)),Cc.listen.on("clearSession",(()=>So.chatboxviews.closeAllChatBoxes())),Cc.listen.on("chatBoxViewsInitialized",eg),window.addEventListener("resize",eg),Object.assign(Mc,{insertInto(e){var t;const n=null===(t=So.chatboxviews)||void 0===t?void 0:t.el;if(n&&!e.contains(n))e.insertAdjacentElement("afterBegin",n),Cc.chatviews.get().filter((e=>"controlbox"!==e.model.get("id"))).forEach((e=>e.maintainScrollTop()));else if(!n)throw new Error("Cannot insert non-existing #conversejs element into the DOM")}})}});var tg=n(2919),ng=n.n(tg);function sg(){const e=(t=['<div class="alert ','" role="alert"><p>',"</p></div>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return sg=function(){return e},e}n(552);const{sizzle:ig}=Mc.env,rg=Mc.env.utils,og=Wf.extend({className:"modal",persistent:!1,events:{"click .nav-item .nav-link":"switchTab"},initialize(e){if(!this.id)throw new Error("Each modal class must have a unique id attribute");Object.assign(this,e),this.render(),this.el.setAttribute("tabindex","-1"),this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-hidden","true");const t=this.el.querySelector(".modal-title").getAttribute("id");t&&this.el.setAttribute("aria-labelledby",t),this.insertIntoDOM();const n=ng().Modal;this.modal=new n(this.el,{backdrop:!0,keyboard:!0}),this.el.addEventListener("hide.bs.modal",(()=>this.onHide()),!1)},onHide(){rg.removeClass("selected",this.trigger_el),!this.persistent&&Cc.modal.remove(this)},insertIntoDOM(){document.querySelector("#converse-modals").insertAdjacentElement("beforeEnd",this.el)},switchTab(e){e.stopPropagation(),e.preventDefault(),ig(".nav-link.active",this.el).forEach((e=>{rg.removeClass("active",this.el.querySelector(e.getAttribute("href"))),rg.removeClass("active",e)})),rg.addClass("active",e.target),rg.addClass("active",this.el.querySelector(e.target.getAttribute("href")))},alert(e,t="primary"){const n=this.el.querySelector(".modal-alert");if(null===n)return void as.error("Could not find a .modal-alert element in the modal to show an alert message in!");Wa((e=>Ha(sg(),e.type,e.message))({type:"alert-".concat(t),message:e}),n);const s=n.firstElementChild;setTimeout((()=>{rg.addClass("fade-out",s),setTimeout((()=>rg.removeElement(s)),600)}),5e3)},show(e){e&&(e.preventDefault(),this.trigger_el=e.target,!rg.hasClass("chat-image",this.trigger_el)&&rg.addClass("selected",this.trigger_el)),this.modal.show()}});function ag(){const e=lg(['<button type="button" class="close" data-dismiss="modal" aria-label="','"><span aria-hidden="true">×</span></button>']);return ag=function(){return e},e}function cg(){const e=lg(['<button type="button" class="btn btn-secondary" data-dismiss="modal">',"</button>"]);return cg=function(){return e},e}function lg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const ug=Ha(cg(),Vu("Close")),dg=Ha(ag(),Vu("Close"));function hg(){const e=gg(["<p>","</p>"]);return hg=function(){return e},e}function fg(){const e=gg(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header ','">\n <h5 class="modal-title">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n ',"\n </div>\n </div>\n </div>\n"]);return fg=function(){return e},e}function gg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const mg=og.extend({id:"alert-modal",initialize(){og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render)},toHTML(){return(e=>Ha(fg(),e.level,e.title,dg,e.messages.map((e=>Ha(hg(),e)))))(Object.assign({__:Vu},this.model.toJSON()))}});function pg(){const e=yg(["<p>","</p>"]);return pg=function(){return e},e}function vg(){const e=yg(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header ','">\n <h5 class="modal-title">','</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n <form class="converse-form converse-form--modal confirm" action="#">\n <div class="form-group">\n ',"\n </div>\n ",'\n <div class="form-group">\n <button type="submit" class="btn btn-primary">','</button>\n <input type="button" class="btn btn-secondary" data-dismiss="modal" value="','"/>\n </div>\n </form>\n </div>\n </div>\n </div>\n']);return vg=function(){return e},e}function bg(){const e=yg(['\n <div class="form-group">\n <label>\n ','\n <input type="text"\n name="','"\n class="',' form-control form-control--labeled"\n ?required="','"\n placeholder="','" />\n </label>\n </div>\n']);return bg=function(){return e},e}function yg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const _g=og.extend({id:"confirm-modal",events:{"submit .confirm":"onConfimation"},initialize(){this.confirmation=Et(),og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.el.addEventListener("closed.bs.modal",(()=>this.confirmation.reject()),!1)},toHTML(){return(e=>Ha(vg(),e.level||"",e.title,e.messages.map((e=>Ha(pg(),e))),e.fields.map((e=>(e=>Ha(bg(),e.label||"",e.name,e.challenge_failed?"error":"",e.required,e.placeholder))(e))),Vu("OK"),Vu("Cancel")))(this.model.toJSON())},afterRender(){this.close_handler_registered||(this.el.addEventListener("closed.bs.modal",(()=>{this.confirmation.isResolved||this.confirmation.reject()}),!1),this.close_handler_registered=!0)},onConfimation(e){e.preventDefault();const t=new FormData(e.target),n=(this.model.get("fields")||[]).map((e=>{const n=t.get(e.name).trim();return e.value=n,e.challenge&&(e.challenge_failed=n!==e.challenge),e}));if(n.filter((e=>e.challenge_failed)).length)return this.model.set("fields",n),void this.model.trigger("change");this.confirmation.resolve(n),this.modal.hide()}});Mc.env.BootstrapModal=og;let wg=[];const Sg={modal:{show(e,t,n){const s=this.get(e.id)||this.create(e,t);return s.show(n),s},get:e=>wg.filter((t=>t.id==e)).pop(),create(e,t){const n=new e(t);return wg.push(n),n},remove(e){wg=wg.filter((t=>t!==e)),e.remove()},removeAll(){wg.forEach((e=>e.remove())),wg=[]}},async confirm(e,t=[],n=[]){"string"==typeof t&&(t=[t]);const s=new ao({title:e,messages:t,fields:n,type:"confirm"}),i=new _g({model:s});let r;i.show();try{r=await i.confirmation}catch(e){r=!1}return i.remove(),r},async prompt(e,t=[],n=""){"string"==typeof t&&(t=[t]);const s=new ao({title:e,messages:t,fields:[{name:"reason",placeholder:n}],type:"prompt"}),i=new _g({model:s});let r;i.show();try{var o;r=null===(o=(await i.confirmation).pop())||void 0===o?void 0:o.value}catch(e){r=!1}return i.remove(),r},alert(e,t,n){let s;"string"==typeof n&&(n=[n]),"error"===e?s="alert-danger":"info"===e?s="alert-info":"warn"===e&&(s="alert-warning");const i=new ao({title:t,messages:n,level:s,type:"alert"});Cc.modal.show(mg,{model:i})}};Mc.plugins.add("converse-modal",{initialize(){Cc.listen.on("disconnect",(()=>{const e=document.querySelector("#converse-modals");e&&(e.innerHTML="")})),Cc.listen.on("clearSession",(()=>Cc.modal.removeAll())),Object.assign(So.api,Sg)}});const xg=(e,t)=>{var n,s;const i=e.N;if(void 0===i)return!1;for(const e of i)null===(s=(n=e).O)||void 0===s||s.call(n,t,!1),xg(e,t);return!0},Eg=e=>{let t,n;do{if(void 0===(t=e.M))break;n=t.N,n.delete(e),e=t}while(0===(null==n?void 0:n.size))},jg=e=>{for(let t;t=e.M;e=t){let n=t.N;if(void 0===n)t.N=n=new Set;else if(n.has(e))break;n.add(e),kg(t)}};function Ag(e){void 0!==this.N?(Eg(this),this.M=e,jg(this)):this.M=e}function Cg(e,t=!1,n=0){const s=this.H,i=this.N;if(void 0!==i&&0!==i.size)if(t)if(Array.isArray(s))for(let e=n;e<s.length;e++)xg(s[e],!1),Eg(s[e]);else null!=s&&(xg(s,!1),Eg(s));else xg(this,e)}const kg=e=>{var t,n,s,i;2==e.type&&(null!==(t=(s=e).P)&&void 0!==t||(s.P=Cg),null!==(n=(i=e).Q)&&void 0!==n||(i.Q=Ag))};class Og extends Af{constructor(){super(...arguments),this.isConnected=!0,this.ut=$a,this.N=void 0}T(e,t,n){super.T(e,t,n),jg(this)}O(e,t=!0){this.at(e),t&&(xg(this,e),Eg(this))}at(e){var t,n;e!==this.isConnected&&(e?(this.isConnected=!0,this.ut!==$a&&(this.setValue(this.ut),this.ut=$a),null===(t=this.reconnected)||void 0===t||t.call(this)):(this.isConnected=!1,null===(n=this.disconnected)||void 0===n||n.call(this)))}S(e,t){if(!this.isConnected)throw Error("AsyncDirective ".concat(this.constructor.name," was rendered while its tree was disconnected."));return super.S(e,t)}setValue(e){if(this.isConnected)if((e=>void 0===this.Σdt.strings)())this.Σdt.I(e,this);else{const t=[...this.Σdt.H];t[this.Σct]=e,this.Σdt.I(t,this,0)}else this.ut=e}disconnected(){}reconnected(){}}const Tg=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,Ng=jf(class extends Og{constructor(){super(...arguments),this.Ct=2147483647,this.Rt=[]}render(...e){var t;return null!==(t=e.find((e=>!Tg(e))))&&void 0!==t?t:$a}update(e,t){const n=this.Rt;let s=n.length;this.Rt=t;for(let e=0;e<t.length&&!(e>this.Ct);e++){const i=t[e];if(!Tg(i))return this.Ct=e,i;e<s&&i===n[e]||(this.Ct=2147483647,s=0,Promise.resolve(i).then((e=>{const t=this.Rt.indexOf(i);t>-1&&t<this.Ct&&(this.Ct=t,this.setValue(e))})))}return $a}});function Ig(){const e=Dg(['\n <button class="chat-msg__action ','" @click=','>\n <converse-icon class="','"\n path-prefix="','"\n color="var(--text-color-lighten-15-percent)"\n size="1em"></converse-icon>\n ',"\n </button>\n "]);return Ig=function(){return e},e}function Mg(){const e=Dg(['<converse-dropdown class="chat-msg__actions" .items=',"></converse-dropdown>"]);return Mg=function(){return e},e}function Rg(){const e=Dg(["",""]);return Rg=function(){return e},e}function Dg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{Strophe:zg,u:Lg}=Mc.env;class Pg extends af{static get properties(){return{correcting:{type:Boolean},editable:{type:Boolean},hide_url_previews:{type:Boolean},is_retracted:{type:Boolean},message_type:{type:String},model:{type:Object},unfurls:{type:Number}}}render(){return Ha(Rg(),Ng(this.renderActions(),""))}async renderActions(){const e=(await this.getActionButtons()).map((e=>Pg.getActionsDropdownItem(e)));return e.length?Ha(Mg(),e):""}static getActionsDropdownItem(e){return Ha(Ig(),e.button_class,e.handler,e.icon_class,Cc.settings.get("assets_path"),e.i18n_text)}onMessageEditButtonClicked(e){var t,n;e.preventDefault();const s=this.model.collection.findWhere("correcting"),i=null===(t=Lg.ancestor(this,".chatbox"))||void 0===t||null===(n=t.querySelector(".chat-textarea"))||void 0===n?void 0:n.value;(!i||s&&s.get("message")===i||confirm(Vu("You have an unsent message which will be lost if you continue. Are you sure?")))&&(s!==this.model?(null==s||s.save("correcting",!1),this.model.save("correcting",!0)):this.model.save("correcting",!1))}async onDirectMessageRetractButtonClicked(){if("me"!==this.model.get("sender"))return as.error("onMessageRetractButtonClicked called for someone else's message!");const e=Vu("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere."),t=[Vu("Are you sure you want to retract this message?")];Cc.settings.get("show_retraction_warning")&&(t[1]=e),await Cc.confirm(Vu("Confirm"),t)&&this.model.collection.chatbox.retractOwnMessage(this.model)}async retractOtherMessage(e){const t=this.model.collection.chatbox,n=await t.retractOtherMessage(this.model,e);if(null===n){const e=Vu("A timeout occurred while trying to retract the message");Cc.alert("error",Vu("Error"),e),as(e,zg.LogLevel.WARN)}else if(Lg.isErrorStanza(n)){const e=Vu("Sorry, you're not allowed to retract this message.");Cc.alert("error",Vu("Error"),e),as(e,zg.LogLevel.WARN),as(n,zg.LogLevel.WARN)}}async onMUCMessageRetractButtonClicked(){const e=Vu("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere.");if(this.model.mayBeRetracted()){const t=[Vu("Are you sure you want to retract this message?")];Cc.settings.get("show_retraction_warning")&&(t[1]=e),await Cc.confirm(Vu("Confirm"),t)&&this.model.collection.chatbox.retractOwnMessage(this.model)}else if(await this.model.mayBeModerated())if("me"===this.model.get("sender")){let t=[Vu("Are you sure you want to retract this message?")];Cc.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]),await Cc.confirm(Vu("Confirm"),t)&&this.retractOtherMessage()}else{let t=[Vu("You are about to retract this message."),Vu("You may optionally include a message, explaining the reason for the retraction.")];Cc.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]);const n=await Cc.prompt(Vu("Message Retraction"),t,Vu("Optional reason"));!1!==n&&this.retractOtherMessage(n)}else{const e=Vu("Sorry, you're not allowed to retract this message");Cc.alert("error",Vu("Error"),e)}}onMessageRetractButtonClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.collection.chatbox.get("type")===So.CHATROOMS_TYPE?this.onMUCMessageRetractButtonClicked():this.onDirectMessageRetractButtonClicked()}onHidePreviewsButtonClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.hide_url_previews?this.model.save({hide_url_previews:!1,url_preview_transition:"fade-in"}):this.model.set("url_preview_transition","fade-out")}async getActionButtons(){const e=[];this.editable&&e.push({i18n_text:this.correcting?Vu("Cancel Editing"):Vu("Edit"),handler:e=>this.onMessageEditButtonClicked(e),button_class:"chat-msg__action-edit",icon_class:"fa fa-pencil-alt",name:"edit"});const t="groupchat"===this.model.get("type")&&await this.model.mayBeModerated();!this.is_retracted&&(this.model.mayBeRetracted()||t)&&e.push({i18n_text:Vu("Retract"),handler:e=>this.onMessageRetractButtonClicked(e),button_class:"chat-msg__action-retract",icon_class:"fas fa-trash-alt",name:"retract"});const n=this.model.get("ogp_metadata")||[];if(this.model.collection.chatbox.get("type")===So.CHATROOMS_TYPE&&Cc.settings.get("muc_show_ogp_unfurls")&&n.length){let t;const s=this.hide_url_previews;t=n.length>1?Vu(s?"Show URL previews":"Hide URL previews"):Vu(s?"Show URL preview":"Hide URL preview"),e.push({i18n_text:t,handler:e=>this.onHidePreviewsButtonClicked(e),button_class:"chat-msg__action-hide-previews",icon_class:this.hide_url_previews?"fas fa-eye":"fas fa-eye-slash",name:"hide"})}return Cc.hook("getMessageActionButtons",this,e)}}function Fg(){const e=(t=['\n <div class="modal-dialog fit-content" role="document">\n <div class="modal-content fit-content">\n <div class="modal-header">\n <h4 class="modal-title" id="message-versions-modal-label">','<a target="_blank" rel="noopener" href="','">',"</a></h4>\n ",'\n </div>\n <div class="modal-body modal-body--image fit-content">\n <img class="chat-image" src="','" @load=','>\n </div>\n <div class="modal-footer">',"</div>\n </div>\n </div>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Fg=function(){return e},e}Cc.elements.define("converse-message-actions",Pg);const Bg=og.extend({id:"image-modal",toHTML(){return(e=>Ha(Fg(),Vu("Image: "),e.src,e.src,dg,e.src,e.onload,ug))({src:this.src,onload:e=>e.target.parentElement.style.height="".concat(e.target.height,"px")})}});var Ug=n(2369),qg=n.n(Ug);function Hg(){const e=Gg(["",""]);return Hg=function(){return e},e}function $g(){const e=Gg(["",""]);return $g=function(){return e},e}function Gg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Vg=jf(class extends Af{render(e,t,n,s){const i=new gm(e,t,n,Object.assign(s,{show_images:!1}));return Ha($g(),Ng(async function(e){return await e.addTemplates(),e.payload}(i),Ha(Hg(),i)))}});function Wg(){const e=Zg(['<span class="styling-directive">*</span><b>','</b><span class="styling-directive">*</span>']);return Wg=function(){return e},e}function Jg(){const e=Zg(['<span class="styling-directive">~</span><del>','</del><span class="styling-directive">~</span>']);return Jg=function(){return e},e}function Qg(){const e=Zg(["<blockquote>","</blockquote>"]);return Qg=function(){return e},e}function Yg(){const e=Zg(['<div class="styling-directive">```</div><code class="block">','</code><div class="styling-directive">```</div>'],['<div class="styling-directive">\\`\\`\\`</div><code class="block">','</code><div class="styling-directive">\\`\\`\\`</div>']);return Yg=function(){return e},e}function Kg(){const e=Zg(['<span class="styling-directive">`</span><code>','</code><span class="styling-directive">`</span>'],['<span class="styling-directive">\\`</span><code>','</code><span class="styling-directive">\\`</span>']);return Kg=function(){return e},e}function Xg(){const e=Zg(['<span class="styling-directive">_</span><i>','</i><span class="styling-directive">_</span>']);return Xg=function(){return e},e}function Zg(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const em=["*","_","~","`","```",">"],tm={"*":{name:"strong",type:"span"},_:{name:"emphasis",type:"span"},"~":{name:"strike",type:"span"},"`":{name:"preformatted",type:"span"},"```":{name:"preformatted_block",type:"block"},">":{name:"quote",type:"block"}},nm=["_",">","`","~"],sm={emphasis:(e,t,n,s)=>Ha(Xg(),Vg(e,t,n,s)),preformatted:e=>Ha(Kg(),e),preformatted_block:e=>Ha(Yg(),e),quote:(e,t,n,s)=>Ha(Qg(),Vg(e,t,n,s)),strike:(e,t,n,s)=>Ha(Jg(),Vg(e,t,n,s)),strong:(e,t,n,s)=>Ha(Wg(),Vg(e,t,n,s))};function im(e,t,n=!0){let s;if(!/(^```\s*\n|^```\s*$)/.test(e.slice(t))||0!==t&&"\n"!==e[t-1]&&">"!==e[t-1]){if(!em.includes(e.slice(t,t+1)))return null;if(s=e.slice(t,t+1),!function(e,t,n,s){if(s){const s=RegExp(nm.includes(e)?"^(\\p{L}|\\p{N})".concat(e):"^(\\p{L}|\\p{N})\\".concat(e),"u");if(n>1&&s.test(t.slice(n-1)))return!1;const i=am(e);if(i&&n>0&&"\n"!==t[n-1])return!1;if(!i&&e===t[n+1])return!1}else{const s=RegExp(nm.includes(e)?"^".concat(e,"(\\p{L}|\\p{N})"):"^\\".concat(e,"(\\p{L}|\\p{N})"),"u");if(n<t.length-1&&s.test(t.slice(n)))return!1}return!0}(s,e,t,n))return null}else s=e.slice(t,t+3);return s}function rm(e,t,n){const s=tm[e].type;return t===n.length||im(n,t,!1)===e||"span"===s&&"\n"===n[t]}function om(e,t){const n=im(e,t),s=n?function(e,t,n){if(!e)return 0;const s=n;if(n+=e.length,am(e))return(n+=t.slice(n).split(/\n[^>]/).shift().length)-s;if("span"===tm[e].type){const s=t.slice(n+1).split("\n").shift();let i=0,r=s.indexOf(e);for(;-1!==r;){if(rm(e,n+1+r,t))return r+1+2*e.length;r=s.indexOf(e,i++)}return 0}{const s=t.slice(n+1);let i=0,r=s.indexOf(e);for(;-1!==r;){if(rm(e,n+1+r,t))return r+1+2*e.length;r=s.indexOf(e,i++)}return 0}}(n,e,t):0;return s>0?{d:n,length:s}:{}}const am=e=>[">","&gt;"].includes(e);function cm(e,t,n,s,i){const r=sm[tm[e].name];return am(e)?r(t.replace(/\n>/g,"\n").replace(/\n$/,""),n,s,i):r(t,n,s,i)}function lm(){const e=dm(['<span class="mention">',"</span>"]);return lm=function(){return e},e}function um(){const e=dm(['<span class="mention mention--self badge badge-info">',"</span>"]);return um=function(){return e},e}function dm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const hm=Mc.env.utils,fm=e=>"string"==typeof e;class gm extends String{constructor(e,t=0,n=[],s={}){super(e),this.mentions=n,this.nick=null==s?void 0:s.nick,this.offset=t,this.onImgClick=null==s?void 0:s.onImgClick,this.onImgLoad=null==s?void 0:s.onImgLoad,this.options=s,this.payload=[],this.references=[],this.render_styling=null==s?void 0:s.render_styling,this.show_images=null==s?void 0:s.show_images}addHyperlinks(e,t){const n=[];try{const t={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi};qg().withinString(e,((e,t,s)=>(n.push({url:e,start:t,end:s}),e)),t)}catch(e){return void as.debug(e)}n.forEach((n=>{const s=e.slice(n.start,n.end),i=hm.filterQueryParamsFromURL(s);this.addTemplateResult(n.start+t,n.end+t,this.show_images&&hm.isImageURL(s)&&hm.isImageDomainAllowed(s)?hm.convertToImageTag(i,this.onImgLoad,this.onImgClick):hm.convertUrlToHyperlink(i))}))}addMapURLs(e,t){const n=/geo:([\-0-9.]+),([\-0-9.]+)(?:,([\-0-9.]+))?(?:\?(.*))?/g,s=e.matchAll(n);for(const e of s)this.addTemplateResult(e.index+t,e.index+e[0].length+t,hm.convertUrlToHyperlink(e[0].replace(n,So.geouri_replacement)))}addEmojis(e,t){[...Ql(e.toString()),...Yl(e.toString())].forEach((e=>{this.addTemplateResult(e.begin+t,e.end+t,Jl(e,{add_title_wrapper:!0}))}))}addMentions(e,t){var n;const s=t+this.offset;null===(n=this.mentions)||void 0===n||n.forEach((n=>{const i=Number(n.begin)-s;if(i<0||i>=s+e.length)return;const r=Number(n.end)-s,o=e.slice(i,r);o===this.nick?this.addTemplateResult(i+t,r+t,(e=>Ha(um(),e.mention))({mention:o})):this.addTemplateResult(i+t,r+t,(e=>Ha(lm(),e.mention))({mention:o}))}))}addStyling(){const e=[];if(function(e){for(let t=0;t<em.length;t++)if(e.includes(em[t]))return!0}(this,this.mentions)){const t=this.mentions.map((e=>Array.from({length:Number(e.end)},((t,n)=>Number(e.begin)+n))));let n=0;for(;n<this.length;){if(t.filter((e=>e.includes(n))).length){n++;continue}const{d:s,length:i}=om(this,n);if(s&&i){const t=am(s),r=n+i,o=t?r:r-s.length;let a="```"===s?n+s.length+1:n+s.length;t&&" "===this[a]&&(a+=1);const c=a,l=this.slice(a,o);e.push({begin:n,template:cm(s,l,c,this.mentions,this.options),end:r}),n=r}n++}}e.forEach((e=>this.addTemplateResult(e.begin,e.end,e.template)))}trimMeMessage(){0===this.offset&&this.isMeCommand()&&(this.payload[0]=this.payload[0].substring(4))}addAnnotations(e){const t=this.marshall();let n=0;for(const s of t)s&&(fm(s)?(e.call(this,s,n),n+=s.length):n=s.end)}async addTemplates(){await Cc.trigger("beforeMessageBodyTransformed",this,{Synchronous:!0}),this.render_styling&&this.addStyling(),this.addAnnotations(this.addMentions),this.addAnnotations(this.addHyperlinks),this.addAnnotations(this.addMapURLs),await Cc.emojis.initialize(),this.addAnnotations(this.addEmojis),await Cc.trigger("afterMessageBodyTransformed",this,{Synchronous:!0}),this.payload=this.marshall(),this.options.show_me_message&&this.trimMeMessage(),this.payload=this.payload.map((e=>fm(e)?e:e.template))}addTemplateResult(e,t,n){this.references.push({begin:e,end:t,template:n})}isMeCommand(){const e=this.toString();return!!e&&e.startsWith("/me ")}marshall(){let e=[this.toString()];return this.references.sort(((e,t)=>t.begin-e.begin)).forEach((t=>{const n=e.shift();e=[n.slice(0,t.begin),t,n.slice(t.end),...e]})),e.reduce(((e,t)=>{return fm(t)?[...e,Wl((n=t,n.replace(/\n\n+/g,(e=>"\n".concat("".repeat(e.length-2),"\n")))))]:[...e,t];var n}),[])}}function mm(){const e=vm(["",""]);return mm=function(){return e},e}function pm(){const e=vm(["",""]);return pm=function(){return e},e}function vm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}class bm{constructor(e,t,n=[],s={}){this.mentions=n,this.offset=t,this.options=s,this.text=e}async transform(){const e=new gm(this.text,this.offset,this.mentions,this.options);return await e.addTemplates(),e.payload}render(){return Ha(pm(),Ng(this.transform(),Ha(mm(),this.text)))}}const ym=jf(class extends Af{render(e,t,n,s,i){const r=new bm(e,t,n,s).render();return null==i||i(),r}});function _m(){const e=(t=['\n <audio controls src="','"></audio>\n <a target="_blank" rel="noopener" href="','">',"</a>\n"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return _m=function(){return e},e}function wm(){const e=(t=['<a target="_blank" rel="noopener" href="','">',"</a>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return wm=function(){return e},e}Cc.elements.define("converse-chat-message-body",class extends af{static get properties(){return{model:{type:Object},is_me_message:{type:Boolean},show_images:{type:Boolean},text:{type:String}}}onImgClick(e){e.preventDefault(),Cc.modal.create(Bg,{src:e.target.src},e).show(e)}onImgLoad(){this.dispatchEvent(new CustomEvent("imageLoaded",{detail:this,bubbles:!0}))}render(){const e=this.model.get("references"),t={nick:this.model.collection.chatbox.get("nick"),onImgClick:this.onImgClick,onImgLoad:()=>this.onImgLoad(),render_styling:!this.model.get("is_unstyled")&&Cc.settings.get("allow_message_styling"),show_images:this.show_images,show_me_message:!0};return ym(this.text,0,e,t,(()=>{var e;return null===(e=this.model.collection)||void 0===e?void 0:e.trigger("rendered",this.model)}))}});const Sm=e=>Ha(wm(),e.url,e.label_download);function xm(){const e=jm(["<label>","</label>"]);return xm=function(){return e},e}function Em(){const e=jm(['\n <fieldset class="form-group">\n ','\n <img src="data:',";base64,",'">\n <input name="','" type="text" ?required="','" />\n </fieldset>\n']);return Em=function(){return e},e}function jm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Am(){const e=(t=['\n <fieldset class="form-group">\n <input id="','" name="','" type="checkbox" ?checked='," ?required=",' />\n <label class="form-check-label" for="','">',"</label>\n </fieldset>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Am=function(){return e},e}function Cm(){const e=(t=['<p class="form-help">',"</p>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Cm=function(){return e},e}function km(){const e=Nm(['\n <input class="hidden-username" type="text" autocomplete="username" value="','"></input>\n ']);return km=function(){return e},e}function Om(){const e=Nm(['<label for="','">',"</label>"]);return Om=function(){return e},e}function Tm(){const e=Nm(['\n <div class="form-group">\n ',"\n\n \x3c!-- This is a hack to prevent Chrome from auto-filling the username in\n any of the other input fields in the MUC configuration form. --\x3e\n ",'\n\n <input\n autocomplete="','"\n class="form-control"\n id="','"\n name="','"\n placeholder="','"\n type="','"\n value="','"\n ?required='," />\n </div>"]);return Tm=function(){return e},e}function Nm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Im=e=>Ha(Tm(),"hidden"!==e.type?Ha(Om(),e.id,e.label):"","password"===e.type&&e.fixed_username?Ha(km(),e.fixed_username):"",e.autocomplete||"",e.id,e.name,e.placeholder||"",e.type,e.value||"",e.required);function Mm(){const e=Dm(['\n <div class="form-group">\n <label for="','">','</label>\n <select class="form-control" id="','" name="','" ?multiple="','">\n ',"\n </select>\n </div>"]);return Mm=function(){return e},e}function Rm(){const e=Dm(['<option value="','" ?selected="','">',"</option>"]);return Rm=function(){return e},e}function Dm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function zm(){const e=(t=['\n <label class="label-ta">','</label>\n <textarea name="','">',"</textarea>\n"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return zm=function(){return e},e}function Lm(){const e=(t=["\n <label>",'\n <a class="form-url" target="_blank" rel="noopener" href="','">',"</a>\n </label>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Lm=function(){return e},e}const Pm=e=>Ha(Lm(),e.label,e.value,e.value);function Fm(){const e=Um(["<label>","</label>"]);return Fm=function(){return e},e}function Bm(){const e=Um(['\n <div class="form-group">\n ','\n <div class="input-group">\n <div class="input-group-prepend">\n <input name="','"\n type="','"\n value="','"\n ?required="','" />\n <div class="input-group-text col" title="','">',"</div>\n </div>\n </div>\n </div>"]);return Bm=function(){return e},e}function Um(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const qm=e=>Ha(Bm(),e.label?Ha(Fm(),e.label):"",e.name,e.type,e.value||"",e.required,e.domain,e.domain);function Hm(){const e=(t=['<a href="','" class="chat-image__link" target="_blank" rel="noopener"\n ><img\n class="chat-image img-thumbnail"\n src="','"\n @click=',"\n @error=","\n @load=","\n /></a>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Hm=function(){return e},e}const $m=jf(class extends Og{render(e,t,n,s){return Ha(Hm(),t,e,s,(()=>this.onError(e,t,n,s)),n)}onError(e,t,n,s){const i=Mc.env.utils;if(i.isURLWithImageExtension(e))this.setValue(i.convertUrlToHyperlink(t));else{const i=new(qg())(e),r=i.filename();i.filename("".concat(r,".png")),this.setValue($m(i.toString(),t,n,s))}}});function Gm(){const e=(t=["",""],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Gm=function(){return e},e}function Vm(){const e=(t=['<video controls preload="metadata" src="','" style="max-height: 50vh"></video>'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Vm=function(){return e},e}function Wm(){const e=Qm(['<a target="_blank" rel="noopener" href="','">',"</a>"]);return Wm=function(){return e},e}function Jm(){const e=Qm(['\n <a target="_blank"\n rel="noopener"\n @click=','\n href="','">',"</a>"]);return Jm=function(){return e},e}function Qm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{sizzle:Ym}=Mc.env,Km=["http","https","xmpp","mailto"];function Xm(e,t){return{"muc#roomconfig_lang":"language","muc#roomconfig_roomsecret":(null==t?void 0:t.new_password)?"new-password":"current-password"}[e]}const Zm={"text-private":"password","text-single":"text",fixed:"label",boolean:"checkbox",hidden:"hidden","jid-multi":"textarea","list-single":"dropdown","list-multi":"dropdown"};function ep(e){try{return e instanceof qg()?e:new(qg())(e)}catch(e){return as.debug(e),null}}function tp(e,t){const n=ep(t);if(null===n||!function(e){return"http:"===window.location.protocol||"https:"===window.location.protocol&&"https"===e.protocol().toLowerCase()}(n))return!1;const s=n.filename().toLowerCase();return!!e.filter((e=>s.endsWith(e))).length}function np(e){try{return decodeURI(e.filename())}catch(t){return as.debug(t),e.filename()}}function sp(e){e.preventDefault(),Cc.rooms.open(e.target.href)}function ip(e,t){e.classList.remove("visible"),_(t)&&t()}go.getURI=ep,go.isAudioURL=e=>tp([".ogg",".mp3",".m4a"],e),go.isVideoURL=e=>tp([".mp4",".webm"],e),go.isURLWithImageExtension=e=>tp([".jpg",".jpeg",".png",".gif",".bmp",".tiff",".svg"],e),go.isImageURL=e=>{const t=Cc.settings.get("image_urls_regex");return(null==t?void 0:t.test(e))||go.isURLWithImageExtension(e)},go.isImageDomainAllowed=e=>{const t=Cc.settings.get("show_images_inline");if(!Array.isArray(t))return!0;try{const n=ep(e).domain();return t.includes(n)}catch(e){return as.debug(e),!0}},go.getOOBURLMarkup=function(e,t){const n=ep(t);return null===n?t:go.isVideoURL(n)?(e=>Ha(Vm(),e.url))({url:t}):go.isAudioURL(n)?function(e,t){const{__:n}=e;return(e=>Ha(_m(),e.url,e.url,e.label_download))({url:t.toString(),label_download:n('Download audio file "%1$s"',np(t))})}(e,n):go.isImageURL(n)?function(e,t){const{__:n}=e;return Sm({url:t.toString(),label_download:n('Download image file "%1$s"',np(t))})}(e,n):function(e,t){const{__:n}=e;return Sm({url:t.toString(),label_download:n('Download file "%1$s"',np(t))})}(e,n)},go.calculateElementHeight=function(e){return Array.from(e.children).reduce(((e,t)=>e+t.offsetHeight),0)},go.getNextElement=function(e,t="*"){let n=e.nextElementSibling;for(;null!==n&&!Ym.matchesSelector(n,t);)n=n.nextElementSibling;return n},go.getPreviousElement=function(e,t="*"){let n=e.previousElementSibling;for(;null!==n&&!Ym.matchesSelector(n,t);)n=n.previousElementSibling;return n},go.getFirstChildElement=function(e,t="*"){let n=e.firstElementChild;for(;null!==n&&!Ym.matchesSelector(n,t);)n=n.nextElementSibling;return n},go.getLastChildElement=function(e,t="*"){let n=e.lastElementChild;for(;null!==n&&!Ym.matchesSelector(n,t);)n=n.previousElementSibling;return n},go.hasClass=function(e,t){return t instanceof Element&&t.classList.contains(e)},go.toggleClass=function(e,t){go.hasClass(e,t)?go.removeClass(e,t):go.addClass(e,t)},go.addClass=function(e,t){return t instanceof Element&&t.classList.add(e),t},go.removeClass=function(e,t){return t instanceof Element&&t.classList.remove(e),t},go.removeElement=function(e){return e instanceof Element&&e.parentNode&&e.parentNode.removeChild(e),e},go.getElementFromTemplateResult=function(e){const t=document.createElement("div");return Wa(e,t),t.firstElementChild},go.showElement=e=>{go.removeClass("collapsed",e),go.removeClass("hidden",e)},go.hideElement=function(e){return e instanceof Element&&e.classList.add("hidden"),e},go.ancestor=function(e,t){let n=e;for(;null!==n&&!Ym.matchesSelector(n,t);)n=n.parentElement;return n},go.nextUntil=function(e,t){const n=[];let s=e.nextElementSibling;for(;null!==s&&!s.matches(t);)n.push(s),s=s.nextElementSibling;return n},go.unescapeHTML=function(e){var t=document.createElement("div");return t.innerHTML=e,t.innerText},go.escapeHTML=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},go.convertToImageTag=function(e,t,n){return(e=>Ha(Gm(),$m(e.url,e.url,e.onLoad,e.onClick)))({url:e,onClick:n,onLoad:t})},go.convertURIoHyperlink=function(e,t){let n=e.normalize()._string;const s=e._parts.urn?n:e.readable(),i=t||s;return e._parts.protocol||n.startsWith("http://")||n.startsWith("https://")||(n="http://"+n),"xmpp"===e._parts.protocol&&"join"===e._parts.query?Ha(Jm(),sp,n,i):Ha(Wm(),n,i)},go.convertUrlToHyperlink=function(e){const t=RegExp("^w{3}.","ig").test(e)?"http://".concat(e):e,n=ep(e);return null===n||!function(e){try{return!!new URL(e)}catch(e){return!1}}(t)||!function(e,t=Km){return!!t.includes(e)}(n._parts.protocol)&&n._parts.protocol?e:this.convertURIoHyperlink(n,e)},go.filterQueryParamsFromURL=function(e){const t=Cc.settings.get("filter_url_query_params");return t?ep(e).removeQuery(t).toString():e},go.slideInAllElements=function(e,t=300){return Promise.all(Array.from(e).map((e=>go.slideIn(e,t))))},go.slideToggleElement=function(e,t){return go.hasClass("collapsed",e)||go.hasClass("hidden",e)?go.slideOut(e,t):go.slideIn(e,t)},go.slideOut=function(e,t=200){return new Promise(((n,s)=>{if(!e){const e="An element needs to be passed in to slideOut";return as.warn(e),void s(new Error(e))}const i=e.getAttribute("data-slider-marker");i&&(e.removeAttribute("data-slider-marker"),window.cancelAnimationFrame(i));const r=go.calculateElementHeight(e);if(window.converse_disable_effects)return e.style.height=r+"px",function(e){e.removeAttribute("data-slider-marker"),e.classList.remove("collapsed"),e.style.overflow="",e.style.height=""}(e),void n();if(!go.hasClass("collapsed",e)&&!go.hasClass("hidden",e))return void n();const o=t/17;let a=0;e.style.height="0",e.style.overflow="hidden",e.classList.remove("hidden"),e.classList.remove("collapsed"),e.setAttribute("data-slider-marker",window.requestAnimationFrame((function t(){a+=r/o,a<r?(e.style.height=a+"px",e.setAttribute("data-slider-marker",window.requestAnimationFrame(t))):(e.removeAttribute("data-slider-marker"),e.style.height=go.calculateElementHeight(e)+"px",e.style.overflow="",e.style.height="",n())})))}))},go.slideIn=function(e,t=200){return new Promise(((n,s)=>{if(!e){const e="An element needs to be passed in to slideIn";return as.warn(e),s(new Error(e))}if(go.hasClass("collapsed",e))return n(e);if(window.converse_disable_effects)return e.classList.add("collapsed"),e.style.height="",n(e);const i=e.getAttribute("data-slider-marker");i&&(e.removeAttribute("data-slider-marker"),window.cancelAnimationFrame(i));const r=e.offsetHeight,o=t/17;let a=r;e.style.overflow="hidden",e.setAttribute("data-slider-marker",window.requestAnimationFrame((function t(){a-=r/o,a>0?(e.style.height=a+"px",e.setAttribute("data-slider-marker",window.requestAnimationFrame(t))):(e.removeAttribute("data-slider-marker"),e.classList.add("collapsed"),e.style.height="",n(e))})))}))},go.isInDOM=function(e){return document.querySelector("body").contains(e)},go.isVisible=function(e){return null!==e&&!go.hasClass("hidden",e)&&(e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0)},go.fadeIn=function(e,t){if(e||as.warn("An element needs to be passed in to fadeIn"),window.converse_disable_effects)return e.classList.remove("hidden"),ip(e,t);go.hasClass("hidden",e)?(e.classList.add("visible"),e.classList.remove("hidden"),e.addEventListener("webkitAnimationEnd",(()=>ip(e,t))),e.addEventListener("animationend",(()=>ip(e,t))),e.addEventListener("oanimationend",(()=>ip(e,t)))):ip(e,t)},go.xForm2TemplateResult=function(e,t,n){if("list-single"===e.getAttribute("type")||"list-multi"===e.getAttribute("type")){const t=go.queryChildren(e,"value").map((e=>null==e?void 0:e.textContent));return(e=>{var t;return Ha(Mm(),e.id,e.label,e.id,e.name,e.multiple,null===(t=e.options)||void 0===t?void 0:t.map((e=>(e=>Ha(Rm(),e.value,e.selected,e.label))(e))))})({options:go.queryChildren(e,"option").map((n=>{var s;const i=null===(s=n.querySelector("value"))||void 0===s?void 0:s.textContent;return{value:i,label:n.getAttribute("label"),selected:t.includes(i),required:!!e.querySelector("required")}})),id:go.getUniqueId(),label:e.getAttribute("label"),multiple:"list-multi"===e.getAttribute("type"),name:e.getAttribute("var"),required:!!e.querySelector("required")})}var s,i,r,o;if("fixed"===e.getAttribute("type"))return(e=>Ha(Cm(),e.text))({text:null===(s=e.querySelector("value"))||void 0===s?void 0:s.textContent});if("jid-multi"===e.getAttribute("type"))return(e=>Ha(zm(),e.label,e.name,e.value))({name:e.getAttribute("var"),label:e.getAttribute("label")||"",value:null===(i=e.querySelector("value"))||void 0===i?void 0:i.textContent,required:!!e.querySelector("required")});if("boolean"===e.getAttribute("type")){var a;const t=null===(a=e.querySelector("value"))||void 0===a?void 0:a.textContent;return(e=>Ha(Am(),e.id,e.name,e.checked,e.required,e.id,e.label))({id:go.getUniqueId(),name:e.getAttribute("var"),label:e.getAttribute("label")||"",checked:"1"===t||"true"===t?'checked="1"':"",required:!!e.querySelector("required")})}if("url"===e.getAttribute("var"))return Pm({label:e.getAttribute("label")||"",value:null===(r=e.querySelector("value"))||void 0===r?void 0:r.textContent});if("username"===e.getAttribute("var"))return qm({domain:" @"+n.domain,name:e.getAttribute("var"),type:Zm[e.getAttribute("type")],label:e.getAttribute("label")||"",value:null===(o=e.querySelector("value"))||void 0===o?void 0:o.textContent,required:!!e.querySelector("required")});if("ocr"===e.getAttribute("var")){const n=e.querySelector("uri"),s=Ym('data[cid="'+n.textContent.replace(/^cid:/,"")+'"]',t)[0];return(e=>Ha(Em(),e.label?Ha(xm(),e.label):"",e.type,e.data,e.name,e.required))({label:e.getAttribute("label"),name:e.getAttribute("var"),data:null==s?void 0:s.textContent,type:n.getAttribute("type"),required:!!e.querySelector("required")})}{var c;const t=e.getAttribute("var");return Im({id:go.getUniqueId(),label:e.getAttribute("label")||"",name:t,fixed_username:null==n?void 0:n.fixed_username,autocomplete:Xm(t,n),placeholder:null,required:!!e.querySelector("required"),type:Zm[e.getAttribute("type")],value:null===(c=e.querySelector("value"))||void 0===c?void 0:c.textContent})}};const rp=go,{keycodes:op}=Mc;function ap(e){let t=0;do{isNaN(e.offsetTop)||(t+=e.offsetTop)}while(e=e.offsetParent);return t}function cp(e){let t=0;do{isNaN(e.offsetLeft)||(t+=e.offsetLeft)}while(e=e.offsetParent);return t}class lp{static get DIRECTION(){return{down:"down",end:"end",home:"home",left:"left",right:"right",up:"up"}}static get DEFAULTS(){return{home:["".concat(op.SHIFT,"+").concat(op.UP_ARROW)],end:["".concat(op.SHIFT,"+").concat(op.DOWN_ARROW)],up:[op.UP_ARROW],down:[op.DOWN_ARROW],left:[op.LEFT_ARROW,"".concat(op.SHIFT,"+").concat(op.TAB)],right:[op.RIGHT_ARROW,op.TAB],getSelector:null,jump_to_picked:null,jump_to_picked_direction:null,jump_to_picked_selector:"picked",onSelected:null,selected:"selected",selector:"li"}}static getClosestElement(e,t){return e.reduce(((e,n)=>{const s=t(n);return s<e.distance?{distance:s,element:n}:e}),{distance:1/0}).element}constructor(e,t){this.doc=window.document,this.container=e,this.scroll_container=t.scroll_container||e,this.options=Object.assign({},lp.DEFAULTS,t),this.init()}init(){this.selected=null,this.keydownHandler=null,this.elements={},this.keys={},this.options.down.forEach((e=>this.keys[e]=lp.DIRECTION.down)),this.options.end.forEach((e=>this.keys[e]=lp.DIRECTION.end)),this.options.home.forEach((e=>this.keys[e]=lp.DIRECTION.home)),this.options.left.forEach((e=>this.keys[e]=lp.DIRECTION.left)),this.options.right.forEach((e=>this.keys[e]=lp.DIRECTION.right)),this.options.up.forEach((e=>this.keys[e]=lp.DIRECTION.up))}enable(){this.getElements(),this.keydownHandler=e=>this.handleKeydown(e),this.doc.addEventListener("keydown",this.keydownHandler),this.enabled=!0}disable(){this.keydownHandler&&this.doc.removeEventListener("keydown",this.keydownHandler),this.unselect(),this.elements={},this.enabled=!1}destroy(){this.disable(),this.container.domNavigator&&delete this.container.domNavigator}getNextElement(e){let t;if(e===lp.DIRECTION.home)t=this.getElements(e)[0];else if(e===lp.DIRECTION.end)t=Array.from(this.getElements(e)).pop();else if(this.selected)if(e===lp.DIRECTION.right){const n=this.getElements(e);t=n.slice(n.indexOf(this.selected))[1]}else if(e==lp.DIRECTION.left){const n=this.getElements(e);t=n.slice(0,n.indexOf(this.selected)).pop()||this.selected}else if(e==lp.DIRECTION.down){const e=this.selected.offsetLeft,n=this.selected.offsetTop+this.selected.offsetHeight,s=this.elementsAfter(0,n),i=t=>Math.abs(t.offsetLeft-e)+Math.abs(t.offsetTop-n);t=lp.getClosestElement(s,i)}else{if(e!=lp.DIRECTION.up)throw new Error("getNextElement: invalid direction value");{const e=this.selected.offsetLeft,n=this.selected.offsetTop-1,s=this.elementsBefore(1/0,n),i=t=>Math.abs(e-t.offsetLeft)+Math.abs(n-t.offsetTop);t=lp.getClosestElement(s,i)}}else t=e===lp.DIRECTION.right||e===lp.DIRECTION.down?this.getElements(e)[1]:this.getElements(e)[0];return this.options.jump_to_picked&&t&&t.matches(this.options.jump_to_picked)&&e===this.options.jump_to_picked_direction&&(t=this.container.querySelector(this.options.jump_to_picked_selector)||t),t}select(e,t){e&&e!==this.selected&&(this.unselect(),t&&this.scrollTo(e,t),e.matches("input")?e.focus():rp.addClass(this.options.selected,e),this.selected=e,this.options.onSelected&&this.options.onSelected(e))}unselect(){this.selected&&(rp.removeClass(this.options.selected,this.selected),delete this.selected)}scrollTo(e,t){if(this.inScrollContainerViewport(e)){if(!function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}(e))switch(t){case lp.DIRECTION.left:document.body.scrollLeft=cp(e)-document.body.offsetLeft;break;case lp.DIRECTION.up:document.body.scrollTop=ap(e)-document.body.offsetTop;break;case lp.DIRECTION.right:document.body.scrollLeft=cp(e)-document.body.offsetLeft-(document.documentElement.clientWidth-e.offsetWidth);break;case lp.DIRECTION.down:document.body.scrollTop=ap(e)-document.body.offsetTop-(document.documentElement.clientHeight-e.offsetHeight)}}else{const n=this.scroll_container;if(!n.contains(e))return;switch(t){case lp.DIRECTION.left:n.scrollLeft=e.offsetLeft-n.offsetLeft,n.scrollTop=e.offsetTop-n.offsetTop;break;case lp.DIRECTION.up:n.scrollTop=e.offsetTop-n.offsetTop;break;case lp.DIRECTION.right:n.scrollLeft=e.offsetLeft-n.offsetLeft-(n.offsetWidth-e.offsetWidth),n.scrollTop=e.offsetTop-n.offsetTop-(n.offsetHeight-e.offsetHeight);break;case lp.DIRECTION.down:n.scrollTop=e.offsetTop-n.offsetTop-(n.offsetHeight-e.offsetHeight)}}}inScrollContainerViewport(e){const t=this.scroll_container;return!(e.offsetLeft-t.scrollLeft<t.offsetLeft||e.offsetTop-t.scrollTop<t.offsetTop||e.offsetLeft+e.offsetWidth-t.scrollLeft>t.offsetLeft+t.offsetWidth||e.offsetTop+e.offsetHeight-t.scrollTop>t.offsetTop+t.offsetHeight)}getElements(e){const t=this.options.getSelector?this.options.getSelector(e):this.options.selector;return this.elements[t]||(this.elements[t]=Array.from(this.container.querySelectorAll(t))),this.elements[t]}elementsAfter(e,t){return this.getElements(lp.DIRECTION.down).filter((n=>n.offsetLeft>=e&&n.offsetTop>=t))}elementsBefore(e,t){return this.getElements(lp.DIRECTION.up).filter((n=>n.offsetLeft<=e&&n.offsetTop<=t))}handleKeydown(e){const t=op,n=e.shiftKey?this.keys["".concat(t.SHIFT,"+").concat(e.which)]:this.keys[e.which];if(n){e.preventDefault(),e.stopPropagation();const t=this.getNextElement(n,e);this.select(t,n)}}}const up=lp;function dp(){const e=(t=['\n <div class="dropleft">\n <button type="button" class="btn btn--transparent btn--standalone" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n <i class="',' only-icon"></i>\n </button>\n <div class="dropdown-menu">\n ',"\n </div>\n </div>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return dp=function(){return e},e}const hp=Mc.env.utils;class fp extends af{firstUpdated(){this.menu=this.querySelector(".dropdown-menu"),this.dropdown=this.firstElementChild,this.button=this.dropdown.querySelector("button"),this.dropdown.addEventListener("click",(e=>this.toggleMenu(e))),this.dropdown.addEventListener("keyup",(e=>this.handleKeyUp(e))),document.addEventListener("click",(e=>!this.contains(e.composedPath()[0])&&this.hideMenu(e)))}hideMenu(){var e,t;hp.removeClass("show",this.menu),null===(e=this.button)||void 0===e||e.setAttribute("aria-expanded",!1),null===(t=this.button)||void 0===t||t.blur()}showMenu(){hp.addClass("show",this.menu),this.button.setAttribute("aria-expanded",!0)}toggleMenu(e){e.preventDefault(),hp.hasClass("show",this.menu)?this.hideMenu():this.showMenu()}handleKeyUp(e){e.keyCode===Mc.keycodes.ESCAPE?this.hideMenu():e.keyCode===Mc.keycodes.DOWN_ARROW&&this.navigator&&!this.navigator.enabled&&this.enableArrowNavigation(e)}}function gp(){const e=pp(['<p class="older-msg"><time>',"</time>: ","</p>"]);return gp=function(){return e},e}function mp(){const e=pp(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h4 class="modal-title" id="message-versions-modal-label">',"</h4>\n ",'\n </div>\n <div class="modal-body">\n <h4>Older versions</h4>\n ',"\n <hr/>\n <h4>Current version</h4>\n <p>",'</p>\n </div>\n <div class="modal-footer">',"</div>\n </div>\n </div>\n"]);return mp=function(){return e},e}function pp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-dropdown",class extends fp{static get properties(){return{icon_classes:{type:String},items:{type:Array}}}render(){const e=this.icon_classes||"fa fa-bars";return Ha(dp(),e,this.items.map((e=>Ng(e,""))))}hideMenu(){super.hideMenu(),this.navigator.disable()}firstUpdated(){super.firstUpdated(),this.initArrowNavigation()}initArrowNavigation(){if(!this.navigator){const e={selector:".dropdown-item",onSelected:e=>e.focus()};this.navigator=new up(this.menu,e)}}enableArrowNavigation(e){e&&(e.preventDefault(),e.stopPropagation()),this.navigator.enable(),this.navigator.select(this.menu.firstElementChild)}handleKeyUp(e){super.handleKeyUp(e),e.keyCode!==Mc.keycodes.DOWN_ARROW||this.navigator.enabled||this.enableArrowNavigation(e)}});const vp=og.extend({id:"message-versions-modal",toHTML(){return(e=>Ha(mp(),Vu("Message versions"),dg,Object.keys(e.older_versions).map((t=>Ha(gp(),Ao()(t).format("MMM D, YYYY, HH:mm:ss"),e.older_versions[t]))),e.message,ug))(this.model.toJSON())}}),bp=jf(class extends Af{render(e){const t={classes:e.classes?"".concat(e.classes," avatar"):"avatar",height:e.width||36,image:e.image,image_type:e.image_type,width:e.height||36};return Gf(t)}});function yp(){const e=(t=['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="user-details-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n ','\n </div>\n <div class="modal-footer">\n ',"\n </div>\n </div>\n </div>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return yp=function(){return e},e}const _p=og.extend({initialize(){og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),Cc.trigger("occupantModalInitialized",this.model)},toHTML(){return(e=>Ha(yp(),e.display_name,dg,bp(e.avatar_data),ug))(Object.assign(this.model.toJSON(),{avatar_data:this.getAvatarData(),display_name:this.model.getDisplayName()}))},getAvatarData(){const e=So.vcards.findWhere({jid:this.model.get("jid")});return{classes:"chat-msg__avatar",height:120,width:120,image:"data:"+((null==e?void 0:e.get("image_type"))||So.DEFAULT_IMAGE_TYPE)+";base64,"+((null==e?void 0:e.get("image"))||So.DEFAULT_IMAGE)}}});So.OccupantModal=_p;const wp=_p;function Sp(){const e=Mp(["<p><label>",":</label> ","</p>"]);return Sp=function(){return e},e}function xp(){const e=Mp(["<p><label>",':</label> <a href="mailto:','">',"</a></p>"]);return xp=function(){return e},e}function Ep(){const e=Mp(["<p><label>",':</label> <a target="_blank" rel="noopener" href="','">',"</a></p>"]);return Ep=function(){return e},e}function jp(){const e=Mp(["<p><label>",":</label> ","</p>"]);return jp=function(){return e},e}function Ap(){const e=Mp(["<p><label>",":</label> ","</p>"]);return Ap=function(){return e},e}function Cp(){const e=Mp(['<div class="mb-4">',"</div>"]);return Cp=function(){return e},e}function kp(){const e=Mp(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="user-details-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n ',"\n ","\n <p><label>",':</label> <a href="xmpp:','">',"</a></p>\n ","\n ","\n ","\n ","\n\n ",'\n </div>\n <div class="modal-footer">\n ','\n <button type="button" class="btn btn-info refresh-contact"><i class="fa fa-refresh"> </i>',"</button>\n ","\n\n </div>\n </div>\n </div>\n "]);return kp=function(){return e},e}function Op(){const e=Mp(['\n <button type="button" @click="','" class="btn btn-danger remove-contact">\n <i class="far fa-trash-alt"></i>',"\n </button>\n "]);return Op=function(){return e},e}function Tp(){const e=Mp(['<li class="list-group-item"> '," </li>"]);return Tp=function(){return e},e}function Np(){const e=Mp(['\n <hr/>\n <ul class="list-group fingerprints">\n <li class="list-group-item active">',"</li>\n ","\n </ul>\n "]);return Np=function(){return e},e}function Ip(){const e=Mp(['\n <li class="list-group-item">\n <form class="fingerprint-trust">\n <div class="btn-group btn-group-toggle">\n <label class="btn btn--small ','">\n <input type="radio" name="','" value="1" ?checked=',">",'\n </label>\n <label class="btn btn--small ','">\n <input type="radio" name="','" value="-1" ?checked=',">",'\n </label>\n </div>\n <code class="fingerprint">',"</code>\n </form>\n </li>\n "]);return Ip=function(){return e},e}function Mp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Rp=e=>{const t=Vu("XMPP Address"),n=Vu("Email"),s=Vu("Full Name"),i=Vu("Nickname"),r=Vu("The User's Profile Image"),o=Vu("Refresh"),a=Vu("Role"),c=Vu("URL"),l={alt_text:r,extra_classes:"mb-3",height:"120",width:"120"};return Ha(kp(),e.display_name,dg,e.image?Ha(Cp(),Gf(Object.assign(e,l))):"",e.fullname?Ha(Ap(),s,e.fullname):"",t,e.jid,e.jid,e.nickname?Ha(jp(),i,e.nickname):"",e.url?Ha(Ep(),c,e.url,e.url):"",e.email?Ha(xp(),n,e.email,e.email):"",e.role?Ha(Sp(),a,e.role):"",e._converse.pluggable.plugins["converse-omemo"].enabled(e._converse)?(e=>{const t=Vu("OMEMO Fingerprints"),n=Vu("No OMEMO-enabled devices found"),s=e.view.devicelist.devices;return Ha(Np(),t,s.length?s.map((t=>(e=>{const t=Vu("Trusted"),n=Vu("Untrusted");return e.device.get("bundle")&&e.device.get("bundle").fingerprint?Ha(Ip(),-1!==e.device.get("trusted")?"btn-primary active":"btn-secondary",e.device.get("id"),-1!==e.device.get("trusted"),t,-1!==e.device.get("trusted")?"btn-primary active":"btn-secondary",e.device.get("id"),-1===e.device.get("trusted"),n,e.utils.formatFingerprint(e.device.get("bundle").fingerprint)):""})(Object.assign({device:t},e)))):Ha(Tp(),n))})(e):"",ug,o,e.allow_contact_removal&&e.is_roster_contact?(e=>{const t=Vu("Remove as contact");return Ha(Op(),e.removeContact,t)})(e):"")},Dp=Mc.env.utils,zp=og.extend({id:"user-details-modal",persistent:!0,events:{"click button.refresh-contact":"refreshContact","click .fingerprint-trust .btn input":"toggleDeviceTrust"},initialize(){og.prototype.initialize.apply(this,arguments),this.model.rosterContactAdded.then((()=>this.registerContactEventHandlers())),this.listenTo(this.model,"change",this.render),this.registerContactEventHandlers(),Cc.trigger("userDetailsModalInitialized",this.model)},toHTML(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.vcard,n=t?t.toJSON():{};return Rp(Object.assign(this.model.toJSON(),n,{_converse:So,allow_contact_removal:Cc.settings.get("allow_contact_removal"),display_name:this.model.getDisplayName(),is_roster_contact:void 0!==this.model.contact,removeContact:e=>this.removeContact(e),view:this,utils:Dp}))},registerContactEventHandlers(){void 0!==this.model.contact&&(this.listenTo(this.model.contact,"change",this.render),this.listenTo(this.model.contact.vcard,"change",this.render),this.model.contact.on("destroy",(()=>{delete this.model.contact,this.render()})))},async refreshContact(e){e&&e.preventDefault&&e.preventDefault();const t=this.el.querySelector(".fa-refresh");Dp.addClass("fa-spin",t);try{await Cc.vcard.update(this.model.contact.vcard,!0)}catch(e){as.fatal(e),this.alert(Vu("Sorry, something went wrong while trying to refresh"),"danger")}Dp.removeClass("fa-spin",t)},removeContact(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),Cc.settings.get("allow_contact_removal")&&!0===confirm(Vu("Are you sure you want to remove this contact?"))&&(setTimeout((()=>function(e){e.removeFromRoster((()=>e.destroy()),(t=>{t&&as.error(t),Cc.alert("error",Vu("Error"),[Vu("Sorry, there was an error while trying to remove %1$s as a contact.",e.getDisplayName())])}))}(this.model.contact)),1),this.modal.hide())}});So.UserDetailsModal=zp;const Lp=zp;var Pp=n(6755),Fp=n.n(Pp);function Bp(){const e=qp(['<a href="','" target="_blank" rel="noopener"><img class="card-img-top" src="','" @load=',"/></a>"]);return Bp=function(){return e},e}function Up(){const e=qp(['<div class="card card--unfurl">\n ','\n <div class="card-body">\n <a href="','" target="_blank" rel="noopener"><h5 class="card-title">','</h5></a>\n <p class="card-text"><converse-rich-text text=','></converse-rich-text></p>\n <p class="card-text"><a href="','" target="_blank" rel="noopener">',"</a></p>\n </div>\n </div>"]);return Up=function(){return e},e}function qp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Hp=Mc.env.utils;function $p(){const e=Kp(['<converse-message-unfurl\n @animationend="','"\n class="','"\n jid="','"\n description="','"\n title="','"\n image="','"\n url="','"></converse-message-unfurl>']);return $p=function(){return e},e}function Gp(){const e=Kp(['\n <time timestamp="','" class="chat-msg__time">','</time>&nbsp;\n <span class="chat-msg__author">',"","</span>&nbsp;"]);return Gp=function(){return e},e}function Vp(){const e=Kp(['<span class="fa fa-lock"></span>']);return Vp=function(){return e},e}function Wp(){const e=Kp(['<span class="badge badge-secondary">',"</span>"]);return Wp=function(){return e},e}function Jp(){const e=Kp(['\n <span class="chat-msg__heading">\n <span class="chat-msg__author"><a class="show-msg-author-modal" @click=',">","</a></span>\n ",'\n <time timestamp="','" class="chat-msg__time">',"</time>\n ","\n </span>"]);return Jp=function(){return e},e}function Qp(){const e=Kp(['<div class="message separator"><hr class="separator"><span class="separator-text">',"</span></div>"]);return Qp=function(){return e},e}function Yp(){const e=Kp(["\n ",'\n <div class="message chat-msg ','"\n data-isodate="','"\n data-msgid="','"\n data-from="','"\n data-encrypted="','">\n\n \x3c!-- Anchor to allow us to scroll the message into view --\x3e\n <a id="','"></a>\n\n <a class="show-msg-author-modal" @click=',">",'</a>\n <div class="chat-msg__content chat-msg__content--'," ",'">\n\n ','\n <div class="chat-msg__body chat-msg__body--'," "," ",'">\n <div class="chat-msg__message">\n ',"\n ","\n </div>\n <converse-message-actions\n .model=",'\n ?correcting="','"\n ?editable="','"\n ?is_retracted="','"\n ?hide_url_previews="','"\n unfurls="','"\n message_type="','"></converse-message-actions>\n </div>\n\n ',"\n </div>\n </div>"]);return Yp=function(){return e},e}function Kp(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Xp(){const e=(t=['<span class="spinner fa fa-spinner centered ','"/>'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Xp=function(){return e},e}n(4867),Cc.elements.define("converse-message-unfurl",class extends af{static get properties(){return{description:{type:String},image:{type:String},jid:{type:String},title:{type:String},url:{type:String}}}render(){return(e=>Ha(Up(),e.image&&Hp.isImageDomainAllowed(e.image)?Ha(Bp(),e.url,e.image,e.onload):"",e.url,e.title,e.description,e.url,Hp.getURI(e.url).domain()))(Object.assign({onload:()=>this.onImageLoad()},{description:this.description||"",image:this.image||"",title:this.title||"",url:this.url||""}))}onImageLoad(){this.dispatchEvent(new CustomEvent("imageLoaded",{detail:this,bubbles:!0}))}});const Zp=(e={})=>Ha(Xp(),e.classes||"");function ev(){const e=fv(['<div class="chat-msg__media">',"</div>"]);return ev=function(){return e},e}function tv(){const e=fv(['<i title="','" class="fa fa-edit chat-msg__edit-modal" @click=',"></i>"]);return tv=function(){return e},e}function nv(){const e=fv(['<span class="fa fa-check chat-msg__receipt"></span>']);return nv=function(){return e},e}function sv(){const e=fv(['<div class="chat-msg__subject">',"</div>"]);return sv=function(){return e},e}function iv(){const e=fv(["\n ","\n ",'\n <span>\n <converse-chat-message-body\n class="chat-msg__text '," ",'"\n .model="','"\n ?is_me_message="','"\n ?show_images="','"\n text="','"></converse-chat-message-body>\n ',"\n ","\n </span>\n ",'\n <div class="chat-msg__error">',"</div>\n "]);return iv=function(){return e},e}function rv(){const e=fv(['\n <div class="chat-msg__spoiler-hint">\n <span class="spoiler-hint">','</span>\n <a class="badge badge-info spoiler-toggle" href="#" @click=','>\n <i class="fa ','"></i>\n ',"\n </a>\n </div>\n "]);return rv=function(){return e},e}function ov(){const e=fv(['<q class="chat-msg--retracted__reason">',"</q>"]);return ov=function(){return e},e}function av(){const e=fv(["\n <div>","</div>\n ","\n "]);return av=function(){return e},e}function cv(){const e=fv(['\n <div class="message chat-msg">\n ','\n <div class="chat-msg__content">\n <span class="chat-msg__text">'," <strong>","</strong>, ",'</span>\n <progress value="','"/>\n </div>\n </div>']);return cv=function(){return e},e}function lv(){const e=fv(['<a class="retry" @click=',">","</a>"]);return lv=function(){return e},e}function uv(){const e=fv(['<q class="reason">',"</q>"]);return uv=function(){return e},e}function dv(){const e=fv(['<q class="reason">',"</q>"]);return dv=function(){return e},e}function hv(){const e=fv(['\n <div class="message chat-info chat-','"\n data-isodate="','"\n data-type="','"\n data-value="','">\n\n <div class="chat-info__message">\n ',"\n </div>\n ","\n ","\n ","\n </div>"]);return hv=function(){return e},e}function fv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{Strophe:gv}=Mc.env,mv=Mc.env.utils;function pv(){const e=(t=['\n <div class="message date-separator" data-isodate="','">\n <hr class="separator"/>\n <time class="separator-text" datetime="','"><span>',"</span></time>\n </div>\n"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return pv=function(){return e},e}function vv(){const e=yv(['<converse-chat-message\n jid="','"\n mid="','"></converse-chat-message>']);return vv=function(){return e},e}function bv(){const e=yv(["",""]);return bv=function(){return e},e}function yv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-chat-message",class extends af{static get properties(){return{jid:{type:String},mid:{type:String}}}render(){return this.show_spinner?Zp():this.model.get("file")&&!this.model.get("oob_url")?this.renderFileProgress():["error","info"].includes(this.model.get("type"))?this.renderInfoMessage():this.renderChatMessage()}connectedCallback(){super.connectedCallback(),this.chatbox=So.chatboxes.get(this.jid),this.model=this.chatbox.messages.get(this.mid),this.listenTo(this.chatbox,"change:first_unread_id",this.requestUpdate),this.listenTo(this.model,"change",this.requestUpdate),this.model.vcard&&this.listenTo(this.model.vcard,"change",this.requestUpdate),"groupchat"===this.model.get("type")&&(this.model.occupant?this.listenTo(this.model.occupant,"change",this.requestUpdate):this.listenTo(this.model,"occupantAdded",(()=>{this.listenTo(this.model.occupant,"change",this.requestUpdate)})))}getProps(){return Object.assign(this.model.toJSON(),this.getDerivedMessageProps())}renderInfoMessage(){const e=Ao()(this.model.get("time")).toISOString(),t=Vu("Retry");return Ha(hv(),this.model.get("type"),e,this.data_name,this.data_value,this.model.getMessageText(),this.model.get("reason")?Ha(dv(),this.model.get("reason")):"",this.model.get("error_text")?Ha(uv(),this.model.get("error_text")):"",this.model.get("retry_event_id")?Ha(lv(),this.onRetryClicked,t):"")}renderFileProgress(){const e=Vu("Uploading file:"),t=this.model.file.name,n=Fp()(this.model.file.size);return Ha(cv(),bp(this.getAvatarData()),e,t,n,this.model.get("progress"))}renderChatMessage(){return((e,t)=>{var n,s;const i=Vu("New messages");return Ha(Yp(),t.is_first_unread?Ha(Qp(),i):"",e.getExtraMessageClasses(),t.time,t.msgid,t.from,t.is_encrypted,t.msgid,e.showUserModal,t.should_show_avatar?bp(e.getAvatarData()):"",t.sender,t.is_me_message?"chat-msg__content--action":"",t.is_me_message?"":Ha(Jp(),e.showUserModal,t.username,t.hats.map((e=>Ha(Wp(),e.title))),e.model.get("edited")||e.model.get("time"),t.pretty_time,t.is_encrypted?Ha(Vp()):""),t.message_type,t.received?"chat-msg__body--received":"",t.is_delayed?"chat-msg__body--delayed":"",t.is_me_message?Ha(Gp(),t.edited||t.time,t.pretty_time,t.is_me_message?"**":"",t.username):"",t.is_retracted?e.renderRetraction():e.renderMessageText(),e.model,t.correcting,t.editable,t.is_retracted,e.model.get("hide_url_previews"),null===(n=e.model.get("ogp_metadata"))||void 0===n?void 0:n.length,t.message_type,e.model.get("hide_url_previews")?"":null===(s=e.model.get("ogp_metadata"))||void 0===s?void 0:s.map((t=>{var n;return Ha($p(),e.onUnfurlAnimationEnd,e.model.get("url_preview_transition"),null===(n=e.chatbox)||void 0===n?void 0:n.get("jid"),t["og:description"]||"",t["og:title"]||"",t["og:image"]||"",t["og:url"]||"")})))})(this,this.getProps())}shouldShowAvatar(){return Cc.settings.get("show_message_avatar")&&!this.model.isMeCommand()&&"headline"!==this.type}getAvatarData(){var e,t;return{classes:"chat-msg__avatar",height:36,width:36,image:"data:"+((null===(e=this.model.vcard)||void 0===e?void 0:e.get("image_type"))||So.DEFAULT_IMAGE_TYPE)+";base64,"+((null===(t=this.model.vcard)||void 0===t?void 0:t.get("image"))||So.DEFAULT_IMAGE)}}onUnfurlAnimationEnd(){"fade-out"===this.model.get("url_preview_transition")&&this.model.save({hide_url_previews:!this.model.get("hide_url_previews"),url_preview_transition:"fade-in"})}async onRetryClicked(){this.show_spinner=!0,this.requestUpdate(),await Cc.trigger(this.model.get("retry_event_id"),{synchronous:!0}),this.model.destroy(),this.parentElement.removeChild(this)}isFollowup(){const e=this.model.collection.models,t=e.indexOf(this.model),n=t?e[t-1]:null;if(null===n)return!1;const s=Ao()(this.model.get("time"));return this.model.get("from")===n.get("from")&&!this.model.isMeCommand()&&!n.isMeCommand()&&"info"!==this.model.get("type")&&"info"!==n.get("type")&&s.isBefore(Ao()(n.get("time")).add(10,"minutes"))&&!!this.model.get("is_encrypted")==!!n.get("is_encrypted")}isRetracted(){return this.model.get("retracted")||"retracted"===this.model.get("moderated")}hasMentions(){return"groupchat"===this.model.get("type")&&"them"===this.model.get("sender")&&this.chatbox.isUserMentioned(this.model)}getOccupantAffiliation(){var e;return null===(e=this.model.occupant)||void 0===e?void 0:e.get("affiliation")}getOccupantRole(){var e;return null===(e=this.model.occupant)||void 0===e?void 0:e.get("role")}getExtraMessageClasses(){const e=[this.isFollowup()?"chat-msg--followup":null,this.model.get("is_delayed")?"delayed":null,this.model.isMeCommand()?"chat-msg--action":null,this.isRetracted()?"chat-msg--retracted":null,this.model.get("type"),this.shouldShowAvatar()?"chat-msg--with-avatar":null].map((e=>e));var t,n;return"groupchat"===this.model.get("type")&&(e.push(null!==(t=this.getOccupantRole())&&void 0!==t?t:""),e.push(null!==(n=this.getOccupantAffiliation())&&void 0!==n?n:""),"them"===this.model.get("sender")&&this.hasMentions()&&e.push("mentioned")),this.model.get("correcting")&&e.push("correcting"),e.filter((e=>e)).join(" ")}getDerivedMessageProps(){const e=Cc.settings.get("time_format");return{pretty_time:Ao()(this.model.get("edited")||this.model.get("time")).format(e),has_mentions:this.hasMentions(),hats:So.getHats(this.model),is_first_unread:this.chatbox.get("first_unread_id")===this.model.get("id"),is_me_message:this.model.isMeCommand(),is_retracted:this.isRetracted(),username:this.model.getDisplayName(),should_show_avatar:this.shouldShowAvatar()}}getRetractionText(){if("groupchat"===this.model.get("type")&&this.model.get("moderated_by")){const e=this.model.get("moderated_by"),t=this.model.collection.chatbox;this.model.mod||(this.model.mod=t.occupants.findOccupant({jid:e})||t.occupants.findOccupant({nick:gv.getResourceFromJid(e)}));const n=this.model.mod?this.model.mod.getDisplayName():"A moderator";return Vu("%1$s has removed this message",n)}return Vu("%1$s has removed this message",this.model.getDisplayName())}renderRetraction(){const e=this.isRetracted()?this.getRetractionText():null;return Ha(av(),e,this.model.get("moderation_reason")?Ha(ov(),this.model.get("moderation_reason")):"")}renderMessageText(){const e=Vu("This message has been edited"),t=Vu("Show more"),n="groupchat"===this.model.get("type"),s=Vu("Show less"),i=Ha(rv(),this.model.get("spoiler_hint"),this.toggleSpoilerMessage,this.model.get("is_spoiler_visible")?"fa-eye-slash":"fa-eye",this.model.get("is_spoiler_visible")?s:t),r=this.model.get("is_spoiler")?"spoiler ".concat(this.model.get("is_spoiler_visible")?"":"hidden"):"",o=this.model.getMessageText();return Ha(iv(),this.model.get("is_spoiler")?i:"",this.model.get("subject")?Ha(sv(),this.model.get("subject")):"",this.model.get("is_only_emojis")?"chat-msg__text--larger":"",r,this.model,this.model.isMeCommand(),Cc.settings.get("show_images_inline"),o,!this.model.get("received")||this.model.isMeCommand()||n?"":Ha(nv()),this.model.get("edited")?Ha(tv(),e,this.showMessageVersionsModal):"",this.model.get("oob_url")?Ha(ev(),mv.getOOBURLMarkup(So,this.model.get("oob_url"))):"",this.model.get("error_text")||this.model.get("error"))}showUserModal(e){if("me"===this.model.get("sender"))So.xmppstatusview.showProfileModal(e);else if("groupchat"===this.model.get("type"))e.preventDefault(),Cc.modal.show(wp,{model:this.model.occupant},e);else{e.preventDefault();const t=this.model.collection.chatbox;Cc.modal.show(Lp,{model:t},e)}}showMessageVersionsModal(e){e.preventDefault(),Cc.modal.show(vp,{model:this.model},e)}toggleSpoilerMessage(e){null==e||e.preventDefault(),this.model.save({is_spoiler_visible:!this.model.get("is_spoiler_visible")})}}),So.getHats=function(e){if("groupchat"===e.get("type")){var t;const n=Cc.settings.get("muc_hats").filter((e=>e)).map((e=>e.toLowerCase()));let s=[];n.includes("vcard_roles")&&(s=e.vcard?e.vcard.get("role"):null,s=s?s.split(",").filter((e=>e)).map((e=>({title:e}))):[]);const i=[...e.occupant?[e.occupant.get("role")]:[],...e.occupant?[e.occupant.get("affiliation")]:[]].filter((e=>e)).filter((e=>n.includes(e.toLowerCase()))).map((e=>({title:e})));return[...n.includes("xep317")&&(null===(t=e.occupant)||void 0===t?void 0:t.get("hats"))||[],...s,...i]}return[]},Cc.elements.define("converse-message-history",class extends af{static get properties(){return{model:{type:Object},messages:{type:Array}}}render(){const e=this.messages;return e.length?Ha(bv(),Rf(e,(e=>e.get("id")),(e=>this.renderMessage(e)))):""}renderMessage(e){if(e.get("dangling_retraction")||e.get("is_only_key"))return"";const t=function(e){const t=e.collection.models,n=t.indexOf(e),s=t[n-1];if(!s||Ao()(e.get("time")).isAfter(Ao()(s.get("time")),"day")){const t=Ao()(e.get("time")).startOf("day");return(e=>Ha(pv(),e.time,e.time,e.datestring))({type:"date",time:t.toISOString(),datestring:t.format("dddd MMM Do YYYY")})}}(e);return[...t?[t]:[],Ha(vv(),this.model.get("jid"),e.get("id"))]}});var _v=n(3279),wv=n.n(_v);function Sv(e){if(!e.isHidden()&&Cc.settings.get("allow_url_history_change")){const t=window.location.hash;t&&e.messages.get(t.slice(1))&&So.router.history.navigate()}}function xv(){const e=jv(['<span class="spinner fa fa-spinner centered"></span>']);return xv=function(){return e},e}function Ev(){const e=jv(['\n <div class="chat-content__notifications">',"</div>\n <converse-message-history\n .model=","\n .messages=",">\n </converse-message-history>\n ","\n "]);return Ev=function(){return e},e}function jv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Av(){const e=kv(['<svg .style="','"> <use href="','"> </use> </svg>']);return Av=function(){return e},e}function Cv(){const e=kv(["\n :host {\n display: inline-block;\n padding: 0;\n margin: 0;\n }\n "]);return Cv=function(){return e},e}function kv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n(9023),Cc.elements.define("converse-chat-content",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.markScrolled=wv()(this._markScrolled,50),this.model=So.chatboxes.get(this.jid),this.listenTo(this.model,"change:hidden_occupants",this.requestUpdate),this.listenTo(this.model,"change:scrolled",this.scrollDown),this.listenTo(this.model.messages,"add",this.requestUpdate),this.listenTo(this.model.messages,"change",this.requestUpdate),this.listenTo(this.model.messages,"remove",this.requestUpdate),this.listenTo(this.model.messages,"rendered",this.requestUpdate),this.listenTo(this.model.messages,"reset",this.requestUpdate),this.listenTo(this.model.notifications,"change",this.requestUpdate),this.listenTo(this.model.ui,"change",this.requestUpdate),this.model.occupants&&this.listenTo(this.model.occupants,"change",this.requestUpdate),this.addEventListener("scroll",(()=>this.markScrolled()))}render(){var e;return Ha(Ev(),this.model.getNotificationsText(),this.model,[...this.model.messages.models],(null===(e=this.model.ui)||void 0===e?void 0:e.get("chat-content-spinner-top"))?Ha(xv()):"")}_markScrolled(){let e=!0;const t=0===this.scrollTop,n=Math.ceil(this.clientHeight-this.scrollTop)>=this.scrollHeight-Math.ceil(this.scrollHeight/20);t?(e=!1,Sv(this.model)):n&&Cc.trigger("chatBoxScrolledUp",this),this.model.get("scolled")!==e&&ho(this.model,{scrolled:e})}scrollDown(){if(!this.model.get("scrolled")){if(this.scrollTo){const e=this.scrollTop?"smooth":"auto";this.scrollTo({top:0,behavior:e})}else this.scrollTop=0;Cc.trigger("chatBoxScrolledDown",{chatbox:this.model})}}}),customElements.define("converse-icon",class extends af{static get properties(){return{color:String,class_name:{attribute:"class"},style:String,size:String}}static get styles(){return((e,...t)=>{const n=t.reduce(((t,n,s)=>t+(e=>{if(e instanceof cc)return e.cssText;if("number"==typeof e)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[s+1]),e[0]);let s=lc.get(n);return void 0===s&&lc.set(n,s=new cc(n,ac)),s})(Cv())}constructor(){super(),this.class_name="",this.style="",this.size="",this.color=""}getSource(){return"#icon-".concat(this.class_name.split(" ")[1].replace("fa-",""))}getStyles(){return"\n ".concat(this.size?"width: ".concat(this.size,";"):"","\n ").concat(this.size?"height: ".concat(this.size,";"):"","\n ").concat(this.color?"fill: ".concat(this.color,";"):"","\n ").concat(this.style,"\n ")}render(){return Ha(Av(),this.getStyles(),this.getSource())}});class Ov extends Af{constructor(e){if(super(e),this.vt=Ga,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Ga)return this.Vt=void 0,this.vt=e;if(e===$a)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.vt)return this.Vt;this.vt=e;const t=[e];return t.raw=t,this.Vt={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Ov.directiveName="unsafeHTML",Ov.resultType=1;const Tv=jf(Ov);function Nv(){const e=Mv(['<div class="message chat-','" data-isodate="','">',"</div>"]);return Nv=function(){return e},e}function Iv(){const e=Mv(['<converse-icon class="fas fa-times close-chat-help"\n @click=','\n path-prefix="','"\n size="1em"></converse-icon>']);return Iv=function(){return e},e}function Mv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Rv(){const e=Hv(["<converse-emoji-picker-content\n .chatview=","\n .model=",'\n .search_results="','"\n current_skintone="','"\n query="','"></converse-emoji-picker-content>']);return Rv=function(){return e},e}function Dv(){const e=Hv(['\n <div class="emoji-picker__header">\n <input class="form-control emoji-search" name="emoji-search" placeholder="','"\n .value=',"\n @keydown=","\n @blur=","\n @focus=",">\n ","\n </div>\n ",'\n\n <div class="emoji-skintone-picker">\n <label>Skin tone</label>\n <ul>',"</ul>\n </div>"]);return Dv=function(){return e},e}function zv(){const e=Hv(['\n <li data-skintone="','" class="emoji-skintone ','">\n <a class="pick-skintone" href="#" data-skintone="','" @click=',">","</a>\n </li>"]);return zv=function(){return e},e}function Lv(){const e=Hv(["\n <span ?hidden=",' class="emoji-lists__container emoji-lists__container--browse">\n ',"\n </span>"]);return Lv=function(){return e},e}function Pv(){const e=Hv(['\n <a id="emoji-picker-','" class="emoji-category__heading" data-category="','">','</a>\n <ul class="emoji-picker" data-category="','">\n ',"\n </ul>"]);return Pv=function(){return e},e}function Fv(){const e=Hv(["\n <span ?hidden=",' class="emoji-lists__container emojis-lists__container--search">\n <a id="emoji-picker-search-results" class="emoji-category__heading">','</a>\n <ul class="emoji-picker">\n ',"\n </ul>\n </span>\n "]);return Fv=function(){return e},e}function Bv(){const e=Hv(['\n <li class="emoji insert-emoji ','" data-emoji="','" title="','">\n <a href="#" @click=',' data-emoji="','">',"</a>\n </li>\n "]);return Bv=function(){return e},e}function Uv(){const e=Hv(["<ul>","</ul>"]);return Uv=function(){return e},e}function qv(){const e=Hv(['\n <li data-category="','"\n class="emoji-category '," ",'"\n title="','">\n\n <a class="pick-category"\n @click=','\n href="#emoji-picker-','"\n data-category="','">'," </a>\n </li>\n "]);return qv=function(){return e},e}function Hv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-chat-help",class extends af{static get properties(){return{chat_type:{type:String},messages:{type:Array},model:{type:Object},type:{type:String}}}render(){const e=(new Date).toISOString();return[Ha(Iv(),this.close,Cc.settings.get("assets_path")),...this.messages.map((t=>this.renderHelpMessage({isodate:e,markup:Er.filterXSS(t,{whiteList:{strong:[]}})})))]}close(){this.model.set({show_help_messages:!1})}renderHelpMessage(e){return Ha(Nv(),this.type,e.isodate,Tv(e.markup))}});const $v=Mc.env.utils,Gv=e=>Ha(Bv(),e.shouldBeHidden(e.emoji.sn)?"hidden":"",e.emoji.sn,e.emoji.sn,e.insertEmoji,e.emoji.sn,$v.shortnamesToEmojis(e.emoji.sn)),Vv=e=>{const t=Vu("Search");return Ha(Dv(),t,e.query||"",e.onSearchInputKeyDown,e.onSearchInputBlurred,e.onSearchInputFocus,e.query?"":(e=>{const t=Cc.settings.get("emoji_categories");return Ha(Uv(),Object.keys(t).map((n=>t[n]?(e=>Ha(qv(),e.category,e.category,e.current_category===e.category?"picked":"",Vu(Cc.settings.get("emoji_category_labels")[e.category]),e.onCategoryPicked,e.category,e.category,e.emoji))(Object.assign({category:n,emoji:e.sn2Emoji(t[n])},e)):"")))})(e),e.render_emojis?Ha(Rv(),e.chatview,e.model,e.search_results,e.current_skintone,e.query):"",["tone1","tone2","tone3","tone4","tone5"].map((t=>(e=>Ha(zv(),e.skintone,e.current_skintone===e.skintone?"picked":"",e.skintone,e.onSkintonePicked,$v.shortnamesToEmojis(":"+e.skintone+":")))(Object.assign({skintone:t},e)))))};function Wv(){const e=(t=['\n <div class="emoji-picker__lists">\n ',"\n ","\n </div>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Wv=function(){return e},e}const{sizzle:Jv}=Mc.env;function Qv(){const e=Kv(["\n <converse-emoji-picker\n .chatview=","\n .model=","\n ?render_emojis=",'\n current_category="','"\n current_skintone="','"\n query="','"\n ></converse-emoji-picker>']);return Qv=function(){return e},e}function Yv(){const e=Kv(['\n <div class="dropup">\n <button class="toggle-emojis"\n title="','"\n data-toggle="dropdown"\n aria-haspopup="true"\n aria-expanded="false">\n <converse-icon\n class="fa fa-smile "\n path-prefix="','"\n size="1em"></converse-icon>\n </button>\n <div class="dropdown-menu">\n ',"\n </div>\n </div>"]);return Yv=function(){return e},e}function Kv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-emoji-picker-content",class extends af{static get properties(){return{chatview:{type:Object},search_results:{type:Array},current_skintone:{type:String},model:{type:Object},query:{type:String}}}render(){const e={current_skintone:this.current_skintone,insertEmoji:e=>this.insertEmoji(e),query:this.query,search_results:this.search_results,shouldBeHidden:e=>this.shouldBeHidden(e)};return Ha(Wv(),(e=>{const t=Vu("Search results");return Ha(Fv(),!e.query,t,e.search_results.map((t=>Gv(Object.assign({emoji:t},e)))))})(e),(e=>{const t=Cc.settings.get("emoji_categories");return Ha(Lv(),e.query,Object.keys(t).map((n=>t[n]?(e=>Ha(Pv(),e.category,e.category,Vu(Cc.settings.get("emoji_category_labels")[e.category]),e.category,Object.values(Mc.emojis.json[e.category]).map((t=>Gv(Object.assign({emoji:t},e))))))(Object.assign({category:n},e)):"")))})(e))}firstUpdated(){this.initIntersectionObserver()}initIntersectionObserver(){if(window.IntersectionObserver){if(this.observer)this.observer.disconnect();else{const e={root:this.querySelector(".emoji-picker__lists"),threshold:[.1]},t=e=>this.setCategoryOnVisibilityChange(e);this.observer=new IntersectionObserver(t,e)}Jv(".emoji-picker",this).forEach((e=>this.observer.observe(e)))}}setCategoryOnVisibilityChange(e){const t=this.parentElement.navigator.selected;let n;if(n=e.filter((e=>e.target.contains(t))).pop()||e.reduce(((e,t)=>t.intersectionRatio>=((null==e?void 0:e.intersectionRatio)||0)?t:e),null),n&&n.isIntersecting){const e=n.target.getAttribute("data-category");e!==this.model.get("current_category")&&(this.parentElement.preserve_scroll=!0,this.model.save({current_category:e}))}}insertEmoji(e){e.preventDefault(),e.stopPropagation();const t="IMG"===e.target.nodeName?e.target.parentElement:e.target;this.parentElement.insertIntoTextArea(t.getAttribute("data-emoji"))}shouldBeHidden(e){if(e.includes("_tone")){if(!this.current_skintone||!e.includes(this.current_skintone))return!0}else if(this.current_skintone&&Mc.emojis.toned.includes(e))return!0;return!(!this.query||So.FILTER_CONTAINS(e,this.query))}}),n(3796);const Xv=Mc.env.utils;function Zv(){const e=(t=['<span class="message-limit ','" title="','">',"</span>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Zv=function(){return e},e}function eb(){const e=ub(["",""]);return eb=function(){return e},e}function tb(){const e=ub(['\n <button class="toggle-compose-spoiler"\n title="','"\n @click=','>\n <converse-icon class="fa ','"\n path-prefix="','"\n size="1em"></converse-icon>\n </button>']);return tb=function(){return e},e}function nb(){const e=ub(['\n <button title="','" @click=','>\n <converse-icon class="fa fa-paperclip"\n path-prefix="','"\n size="1em"></converse-icon>\n </button>\n <input type="file" @change=',' class="fileupload" multiple="" style="display:none"/>']);return nb=function(){return e},e}function sb(){const e=ub(['\n <button class="toggle_occupants right"\n title="','"\n @click=','>\n <converse-icon class="fa ','"\n path-prefix="','" size="1em"></converse-icon>\n </button>']);return sb=function(){return e},e}function ib(){const e=ub(["",""]);return ib=function(){return e},e}function rb(){const e=ub(["\n <converse-message-limit-indicator .model=",' class="right">\n </converse-message-limit-indicator>']);return rb=function(){return e},e}function ob(){const e=ub(['\n <button class="toggle-call" @click=',' title="','">\n <converse-icon class="fa fa-phone" path-prefix="/dist" size="1em"></converse-icon>\n </button>']);return ob=function(){return e},e}function ab(){const e=ub(["<converse-emoji-dropdown .chatview=","></converse-dropdown>"]);return ab=function(){return e},e}function cb(){const e=ub(['<button type="submit" class="btn send-button fa fa-paper-plane" title="','"></button>']);return cb=function(){return e},e}function lb(){const e=ub(['\n <span class="toolbar-buttons">',"</span>\n ","\n "]);return lb=function(){return e},e}function ub(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-emoji-dropdown",class extends fp{static get properties(){return{chatview:{type:Object}}}constructor(){super(),this.render_emojis=!1}initModel(){return this.init_promise||(this.init_promise=(async()=>{await Cc.emojis.initialize();const e="converse.emoji-".concat(So.bare_jid,"-").concat(this.chatview.model.get("jid"));this.model=new So.EmojiPicker({id:e}),Cr(this.model,e),await new Promise((e=>this.model.fetch({success:e,error:e}))),this.model.set({autocompleting:null,ac_position:null})})()),this.init_promise}render(){return Ha(Yv(),Vu("Insert emojis"),Cc.settings.get("assets_path"),Ng(this.initModel().then((()=>Ha(Qv(),this.chatview,this.model,this.render_emojis,this.model.get("current_category")||"",this.model.get("current_skintone")||"",this.model.get("query")||""))),""))}connectedCallback(){super.connectedCallback(),this.render_emojis=!1}toggleMenu(e){e.stopPropagation(),e.preventDefault(),Xv.hasClass("show",this.menu)?Xv.ancestor(e.target,".toggle-emojis")&&this.hideMenu():this.showMenu()}async showMenu(){await this.initModel(),this.render_emojis||(this.render_emojis=!0,await this.requestUpdate()),super.showMenu(),setTimeout((()=>{var e;return null===(e=this.querySelector(".emoji-search"))||void 0===e?void 0:e.focus()}))}}),Cc.elements.define("converse-emoji-picker",class extends af{static get properties(){return{chatview:{type:Object},current_category:{type:String,reflect:!0},current_skintone:{type:String,reflect:!0},model:{type:Object},query:{type:String,reflet:!0},render_emojis:{type:Boolean}}}firstUpdated(){this.listenTo(this.model,"change",(e=>this.onModelChanged(e.changed))),this.initArrowNavigation()}constructor(){super(),this._search_results=[],this.debouncedFilter=Oo((e=>this.model.set({query:e.value})),250),this.registerEvents()}get search_results(){return this._search_results}set search_results(e){this._search_results=e,this.requestUpdate()}render(){return Vv({chatview:this.chatview,current_category:this.current_category,current_skintone:this.current_skintone,model:this.model,onCategoryPicked:e=>this.chooseCategory(e),onSearchInputBlurred:e=>this.chatview.emitFocused(e),onSearchInputFocus:e=>this.onSearchInputFocus(e),onSearchInputKeyDown:e=>this.onKeyDown(e),onSkintonePicked:e=>this.chooseSkinTone(e),query:this.query,search_results:this.search_results,render_emojis:this.render_emojis,sn2Emoji:e=>Xv.shortnamesToEmojis(this.getTonedShortname(e))})}updated(e){e.has("query")&&this.updateSearchResults(e),e.has("current_category")&&this.setScrollPosition()}onModelChanged(e){"current_category"in e&&(this.current_category=e.current_category),"current_skintone"in e&&(this.current_skintone=e.current_skintone),"query"in e&&(this.query=e.query)}setScrollPosition(){if(this.preserve_scroll)return void(this.preserve_scroll=!1);const e=this.querySelector(".emoji-lists__container--browse"),t=this.querySelector("#emoji-picker-".concat(this.current_category));t&&(e.scrollTop=t.offsetTop-3*t.offsetHeight+4)}updateSearchResults(e){const t=e.get("query"),n=So.FILTER_CONTAINS;if(this.query){if(this.query===t)return this.search_results;t&&this.query.includes(t)?this.search_results=this.search_results.filter((e=>n(e.sn,this.query))):this.search_results=Mc.emojis.list.filter((e=>n(e.sn,this.query)))}else this.search_results.length&&(this.search_results=[]);this.requestUpdate()}registerEvents(){this.onGlobalKeyDown=e=>this._onGlobalKeyDown(e),document.querySelector("body").addEventListener("keydown",this.onGlobalKeyDown)}connectedCallback(){super.connectedCallback(),this.registerEvents()}disconnectedCallback(){document.querySelector("body").removeEventListener("keydown",this.onGlobalKeyDown),super.disconnectedCallback()}_onGlobalKeyDown(e){this.navigator&&(e.keyCode===Mc.keycodes.ENTER&&this.navigator.selected&&Xv.isVisible(this)?this.onEnterPressed(e):e.keyCode===Mc.keycodes.DOWN_ARROW&&!this.navigator.enabled&&Xv.isVisible(this)&&this.enableArrowNavigation(e))}setCategoryForElement(e){const t=this.current_category,n=(null==e?void 0:e.getAttribute("data-category"))||t;t!==n&&this.model.save({current_category:n})}insertIntoTextArea(e){const t=this.model.get("autocompleting"),n=this.model.get("ac_position");this.chatview.getMessageForm().insertIntoTextArea(e,t,!1,n),this.model.set({autocompleting:null,query:"",ac_position:null})}chooseSkinTone(e){e.preventDefault(),e.stopPropagation();const t=("IMG"===e.target.nodeName?e.target.parentElement:e.target).getAttribute("data-skintone").trim();this.current_skintone===t?this.model.save({current_skintone:""}):this.model.save({current_skintone:t})}chooseCategory(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation();const t=e.target.matches("li")?e.target:Xv.ancestor(e.target,"li");this.setCategoryForElement(t),this.navigator.select(t),!this.navigator.enabled&&this.navigator.enable()}onKeyDown(e){if(e.keyCode===Mc.keycodes.TAB)if(e.target.value){e.preventDefault();const t=Mc.emojis.shortnames.find((t=>So.FILTER_CONTAINS(t,e.target.value)));t&&this.model.set({query:t})}else this.navigator.enabled||this.enableArrowNavigation(e);else e.keyCode!==Mc.keycodes.DOWN_ARROW||this.navigator.enabled?e.keyCode===Mc.keycodes.ENTER?this.onEnterPressed(e):e.keyCode===Mc.keycodes.ESCAPE?(Xv.ancestor(this,"converse-emoji-dropdown").hideMenu(),this.chatview.el.querySelector(".chat-textarea").focus(),e.stopPropagation(),e.preventDefault()):e.keyCode!==Mc.keycodes.ENTER&&e.keyCode!==Mc.keycodes.DOWN_ARROW&&this.debouncedFilter(e.target):this.enableArrowNavigation(e)}onEnterPressed(e){e.emoji_keypress_handled||(e.preventDefault(),e.stopPropagation(),e.emoji_keypress_handled=!0,Mc.emojis.shortnames.includes(e.target.value)?this.insertIntoTextArea(e.target.value):1===this.search_results.length?this.insertIntoTextArea(this.search_results[0].sn):this.navigator.selected&&this.navigator.selected.matches(".insert-emoji")?this.insertIntoTextArea(this.navigator.selected.getAttribute("data-emoji")):this.navigator.selected&&this.navigator.selected.matches(".emoji-category")&&this.chooseCategory({target:this.navigator.selected}))}onSearchInputFocus(e){this.chatview.emitBlurred(e),this.disableArrowNavigation()}getTonedShortname(e){return Mc.emojis.toned.includes(e)&&this.current_skintone?"".concat(e.slice(0,e.length-1),"_").concat(this.current_skintone,":"):e}initArrowNavigation(){if(!this.navigator){const e="li:not(.hidden):not(.emoji-skintone), .emoji-search",t={jump_to_picked:".emoji-category",jump_to_picked_selector:".emoji-category.picked",jump_to_picked_direction:up.DIRECTION.down,picked_selector:".picked",scroll_container:this.querySelector(".emoji-picker__lists"),getSelector:t=>{if(t===up.DIRECTION.down){const t=this.navigator.selected&&this.navigator.selected.getAttribute("data-category");return t?'ul[data-category="'.concat(t,'"] li:not(.hidden):not(.emoji-skintone), .emoji-search'):e}return e},onSelected:e=>{e.matches(".insert-emoji")&&this.setCategoryForElement(e.parentElement),e.matches(".insert-emoji, .emoji-category")&&e.firstElementChild.focus(),e.matches(".emoji-search")&&e.focus()}};this.navigator=new up(this,t)}}disableArrowNavigation(){this.navigator.disable()}enableArrowNavigation(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.disableArrowNavigation(),this.navigator.enable(),this.navigator.handleKeydown(e)}}),Cc.elements.define("converse-message-limit-indicator",class extends af{static get properties(){return{model:{type:Object}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change:draft",this.requestUpdate)}render(){const e=Cc.settings.get("message_limit");return e?(e=>{const t=Vu("Message characters remaining");return Ha(Zv(),e<1?"error":"",t,e)})(e-(this.model.get("draft")||"").length):""}}),n(4837);const db=Mc.env.Strophe;function hb(){const e=yb(['<p class="chat-head__desc">',"</p>"]);return hb=function(){return e},e}function fb(){const e=yb(["<converse-dropdown .items=","></converse-dropdown>"]);return fb=function(){return e},e}function gb(){const e=yb(['<a class="user show-msg-author-modal" @click=',">","</a>"]);return gb=function(){return e},e}function mb(){const e=yb(['<a class="show-msg-author-modal" @click=',">","</a>"]);return mb=function(){return e},e}function pb(){const e=yb(['<converse-controlbox-navback jid="','"></converse-controlbox-navback>']);return pb=function(){return e},e}function vb(){const e=yb(['\n <div class="chatbox-title ','">\n <div class="chatbox-title--row">\n ',"\n ",'\n <div class="chatbox-title__text" title="','">\n ','\n </div>\n </div>\n <div class="chatbox-title__buttons row no-gutters">\n ',"\n ","\n </div>\n </div>\n ","\n "]);return vb=function(){return e},e}function bb(){const e=yb(['<span class="mr-2">',"</span>"]);return bb=function(){return e},e}function yb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _b(){const e=Sb(['\n <a\n href="#"\n class="chatbox-btn '," fa ",'"\n @click=','\n title="','"\n ></a>\n ']);return _b=function(){return e},e}function wb(){const e=Sb(['\n <a href="#" class="dropdown-item ','" @click=',' title="','"\n ><i class="fa ','"></i>',"</a\n >\n "]);return wb=function(){return e},e}function Sb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}async function xb(e){const t=await e;return Ha(wb(),t.a_class,t.handler,t.i18n_title,t.icon_class,t.i18n_text)}async function Eb(e){const t=await e;return Ha(_b(),t.a_class,t.icon_class,t.handler,t.i18n_title)}async function jb(e){!0===confirm(Vu("Are you sure you want to clear the messages from this conversation?"))&&await e.clearMessages()}function Ab(e,t){const n=t.replace(/^\s*/,"").match(/^\/(.*)\s*$/);if(n){if("clear"===n[1])return jb(e),!0;var s;if("close"===n[1])return null===(s=So.chatboxviews.get(e.get("jid")))||void 0===s||s.close(),!0;if("help"===n[1])return e.set({show_help_messages:!1},{silent:!0}),e.set({show_help_messages:!0}),!0}}function Cb(e){if(e.target.value){const t=e.target.scrollHeight+"px";e.target.style.height!=t&&(e.target.style.height="auto",e.target.style.height=t)}else e.target.style=""}window.customElements.define("converse-chat-toolbar",class extends af{static get properties(){return{composing_spoiler:{type:Boolean},hidden_occupants:{type:Boolean},is_groupchat:{type:Boolean},message_limit:{type:Number},model:{type:Object},show_call_button:{type:Boolean},show_emoji_button:{type:Boolean},show_occupants_toggle:{type:Boolean},show_send_button:{type:Boolean},show_spoiler_button:{type:Boolean}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdate)}render(){const e=Vu("Send the message");return Ha(lb(),Ng(this.getButtons(),""),this.show_send_button?Ha(cb(),e):"")}firstUpdated(){Cc.trigger("renderToolbar",this)}getButtons(){const e=[];if(this.show_emoji_button){const t=So.chatboxviews.get(this.model.get("jid"));e.push(Ha(ab(),t))}if(this.show_call_button){const t=Vu("Start a call");e.push(Ha(ob(),this.toggleCall,t))}Cc.settings.get("message_limit")&&e.push(Ha(rb(),this.model)),this.show_spoiler_button&&e.push(this.getSpoilerButton());const t=Cc.disco.supports(db.NS.HTTPUPLOAD,So.domain);if(e.push(Ha(ib(),Ng(t.then((e=>this.getHTTPUploadButton(e))),""))),this.show_occupants_toggle){const t=Vu("Hide participants"),n=Vu("Show participants");e.push(Ha(sb(),this.hidden_occupants?n:t,this.toggleOccupants,this.hidden_occupants?"fa-angle-double-left":"fa-angle-double-right",Cc.settings.get("assets_path")))}return So.api.hook("getToolbarButtons",this,e)}getHTTPUploadButton(e){if(e){const e=Vu("Choose a file to send");return Ha(nb(),e,this.toggleFileUpload,Cc.settings.get("assets_path"),this.onFileSelection)}return""}getSpoilerButton(){var e;const t=this.model;if(!this.is_groupchat&&!(null===(e=t.presence)||void 0===e?void 0:e.resources.length))return;let n;n=this.composing_spoiler?Vu("Click to write as a normal (non-spoiler) message"):Vu("Click to write your message as a spoiler");const s=Ha(tb(),n,this.toggleComposeSpoilerMessage,this.composing_spoiler?"fa-eye-slash":"fa-eye",Cc.settings.get("assets_path"));if(this.is_groupchat)return s;{const e=t.get("jid"),n=Promise.all(t.presence.resources.map((t=>Cc.disco.supports(db.NS.SPOILER,"".concat(e,"/").concat(t.get("name")))))).then((e=>e.reduce(((e,t)=>e&&t),!0)));return Ha(eb(),Ng(n.then((()=>s)),""))}}toggleFileUpload(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.querySelector(".fileupload").click()}onFileSelection(e){this.model.sendFiles(e.target.files)}toggleComposeSpoilerMessage(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.set("composing_spoiler",!this.model.get("composing_spoiler"))}toggleOccupants(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.save({hidden_occupants:!this.model.get("hidden_occupants")})}toggleCall(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),Cc.trigger("callButtonClicked",{connection:So.connection,model:this.model})}}),n(4311);class kb extends yf{async render(){const e=await this.generateHeadingTemplate();Wa(e,this)}connectedCallback(){var e;super.connectedCallback(),this.model=So.chatboxes.get(this.getAttribute("jid")),this.debouncedRender=Oo(this.render,100),this.listenTo(this.model,"vcard:change",this.debouncedRender),this.model.contact&&this.listenTo(this.model.contact,"destroy",this.debouncedRender),null===(e=this.model.rosterContactAdded)||void 0===e||e.then((()=>{this.listenTo(this.model.contact,"change:nickname",this.debouncedRender),this.debouncedRender()})),this.render()}showUserDetailsModal(e){e.preventDefault(),Cc.modal.show(Lp,{model:this.model},e)}close(){var e;null===(e=So.chatboxviews.get(this.getAttribute("jid")))||void 0===e||e.close()}getHeadingButtons(){const e=[{a_class:"show-user-details-modal",handler:e=>this.showUserDetailsModal(e),i18n_text:Vu("Details"),i18n_title:Vu("See more information about this person"),icon_class:"fa-id-card",name:"details",standalone:"overlayed"===Cc.settings.get("view_mode")}];Cc.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Vu("Close"),i18n_title:Vu("Close and end this conversation"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Cc.settings.get("view_mode")});const t=So.chatboxviews.get(this.getAttribute("jid"));return t?So.api.hook("getHeadingButtons",t,e):e}async generateHeadingTemplate(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.vcard,n=t?t.toJSON():{},s=Vu("The User's Profile Image"),i=Object.assign({alt_text:s,extra_classes:"",height:40,width:40},n),r=await this.getHeadingButtons(),o=r.filter((e=>e.standalone)),a=r.filter((e=>!e.standalone));return(e=>{const t=Ha(bb(),bp(e.avatar_data));return Ha(vb(),e.status?"":"chatbox-title--no-desc",So.api.settings.get("singleton")?"":Ha(pb(),e.jid),e.type!==So.HEADLINES_TYPE?Ha(mb(),e.showUserDetailsModal,t):"",e.jid,e.type!==So.HEADLINES_TYPE?Ha(gb(),e.showUserDetailsModal,e.display_name):e.display_name,e.dropdown_btns.length?Ha(fb(),e.dropdown_btns):"",e.standalone_btns.length?(e=>e.standalone_btns.reverse().map((e=>Ng(e,""))))(e):"",e.status?Ha(hb(),e.status):"")})(Object.assign(this.model.toJSON(),{avatar_data:i,display_name:this.model.getDisplayName(),dropdown_btns:a.map((e=>xb(e))),showUserDetailsModal:e=>this.showUserDetailsModal(e),standalone_btns:o.map((e=>Eb(e)))}))}}function Ob(){const e=(t=['\n <form class="sendXMPPMessage">\n <input type="text" placeholder="','" value="','" class="',' spoiler-hint"/>\n <textarea\n autofocus\n type="text"\n @drop=',"\n @input=","\n @keydown=","\n @keyup=","\n @paste=","\n @change=",'\n class="chat-textarea\n ',"\n ",'"\n placeholder="','">',"</textarea>\n </form>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Ob=function(){return e},e}Cc.elements.define("converse-chat-heading",kb);const{u:Tb}=Mc.env;class Nb extends yf{async connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.listenTo(this.model.messages,"change:correcting",this.onMessageCorrecting),this.render()}toHTML(){var e,t;return(e=>{const t=e.composing_spoiler?Vu("Hidden message"):Vu("Message"),n=Vu("Optional hint"),s=Cc.settings.get("show_send_button");return Ha(Ob(),n||"",e.hint_value||"",e.composing_spoiler?"":"hidden",e.onDrop,Cb,e.onKeyDown,e.onKeyUp,e.onPaste,e.onChange,s?"chat-textarea-send-button":"",e.composing_spoiler?"spoiler":"",t,e.message_value||"")})(Object.assign(this.model.toJSON(),{onDrop:e=>this.onDrop(e),hint_value:null===(e=this.querySelector(".spoiler-hint"))||void 0===e?void 0:e.value,message_value:null===(t=this.querySelector(".chat-textarea"))||void 0===t?void 0:t.value,onChange:e=>this.model.set({draft:e.target.value}),onKeyDown:e=>this.onKeyDown(e),onKeyUp:e=>this.onKeyUp(e),onPaste:e=>this.onPaste(e),viewUnreadMessages:e=>this.viewUnreadMessages(e)}))}insertIntoTextArea(e,t=!1,n=!1,s){const i=this.querySelector(".chat-textarea");if(n?Tb.addClass("correcting",i):Tb.removeClass("correcting",i),t)i.value=s&&"string"==typeof t?i.value.replace(new RegExp(t,"g"),((n,i)=>i==s-t.length?e+" ":n)):e;else{let t=i.value;t&&" "!==t[t.length-1]&&(t+=" "),i.value=t+e+" "}const r=document.createEvent("HTMLEvents");r.initEvent("change",!1,!0),i.dispatchEvent(r),Tb.placeCaretAtEnd(i)}onMessageCorrecting(e){if(e.get("correcting"))this.insertIntoTextArea(Tb.prefixMentions(e),!0,!0);else{const t=this.model.messages.findWhere("correcting");t&&t!==e?this.insertIntoTextArea(Tb.prefixMentions(e),!0,!0):this.insertIntoTextArea("",!0,!1)}}onEscapePressed(e){e.preventDefault();const t=this.model.messages.findLastIndex("correcting"),n=t>=0?this.model.messages.at(t):null;n&&n.save("correcting",!1),this.insertIntoTextArea("",!0,!1)}onPaste(e){if(e.stopPropagation(),0!==e.clipboardData.files.length)return e.preventDefault(),void this.model.sendFiles(Array.from(e.clipboardData.files));this.model.set({draft:e.clipboardData.getData("text/plain")})}onKeyUp(e){this.model.set({draft:e.target.value})}onKeyDown(e){if(!e.ctrlKey){if(!e.shiftKey&&!e.altKey&&!e.metaKey)if(e.keyCode===Mc.keycodes.TAB){const t=Tb.getCurrentWord(e.target,null,/(:.*?:)/g);t.startsWith(":")&&(e.preventDefault(),e.stopPropagation(),this.model.trigger("emoji-picker-autocomplete",e.target,t))}else{if(e.keyCode===Mc.keycodes.FORWARD_SLASH)return;if(e.keyCode===Mc.keycodes.ESCAPE)return this.onEscapePressed(e,this);if(e.keyCode===Mc.keycodes.ENTER)return this.onFormSubmitted(e);if(e.keyCode!==Mc.keycodes.UP_ARROW||e.target.selectionEnd){if(e.keyCode===Mc.keycodes.DOWN_ARROW&&e.target.selectionEnd===e.target.value.length&&Tb.hasClass("correcting",this.querySelector(".chat-textarea")))return this.model.editLaterMessage()}else{const e=this.querySelector(".chat-textarea");if(!e.value||Tb.hasClass("correcting",e))return this.model.editEarlierMessage()}}[Mc.keycodes.SHIFT,Mc.keycodes.META,Mc.keycodes.META_RIGHT,Mc.keycodes.ESCAPE,Mc.keycodes.ALT].includes(e.keyCode)||this.model.get("chat_state")!==So.COMPOSING&&this.model.setChatState(So.COMPOSING)}}parseMessageForCommands(e){return Ab(this.model,e)}async onFormSubmitted(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const s=this.querySelector(".chat-textarea"),i=s.value.trim();if(Cc.settings.get("message_limit")&&i.length>Cc.settings.get("message_limit")||!i.replace(/\s/g,"").length)return;if(!So.connection.authenticated){const e=Vu("Sorry, the connection has been lost, and your message could not be sent");return Cc.alert("error",Vu("Error"),e),void Cc.connection.reconnect()}let r,o={};this.model.get("composing_spoiler")&&(o=this.querySelector("form.sendXMPPMessage input.spoiler-hint"),r=o.value),Tb.addClass("disabled",s),s.setAttribute("disabled","disabled"),null===(n=this.querySelector("converse-emoji-dropdown"))||void 0===n||n.hideMenu();const a=this.parseMessageForCommands(i),c=a?null:await this.model.sendMessage(i,r);(a||c)&&(o.value="",s.value="",Tb.removeClass("correcting",s),s.style.height="auto",this.model.set({draft:""})),"overlayed"===Cc.settings.get("view_mode")&&(So.chatboxviews.get(this.getAttribute("jid")).querySelector(".chat-content__messages").parentElement.style.display="none"),s.removeAttribute("disabled"),Tb.removeClass("disabled",s),"overlayed"===Cc.settings.get("view_mode")&&(So.chatboxviews.get(this.getAttribute("jid")).querySelector(".chat-content__messages").parentElement.style.display=""),this.model.setChatState(So.ACTIVE,{silent:!0}),s.focus()}}function Ib(){const e=Db(['\n <converse-chat-toolbar\n class="chat-toolbar no-text-select"\n .model=','\n ?composing_spoiler="','"\n ?show_call_button="','"\n ?show_emoji_button="','"\n ?show_send_button="','"\n ?show_spoiler_button="','"\n ?show_toolbar="','"\n message_limit="','"></converse-chat-toolbar>']);return Ib=function(){return e},e}function Mb(){const e=Db(['<div class="new-msgs-indicator" @click=',">▼ "," ▼</div>"]);return Mb=function(){return e},e}function Rb(){const e=Db(["\n ","\n ",'\n <converse-message-form jid="','"></converse-message-form>\n ']);return Rb=function(){return e},e}function Db(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-message-form",Nb),n(6694);class zb extends yf{constructor(...e){var t,n,s;super(...e),s={"click .send-button":"sendButtonClicked","click .toggle-clear":"clearMessages"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}async connectedCallback(){super.connectedCallback(),this.debouncedRender=Oo(this.render,100),this.model=So.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.listenTo(this.model,"change:num_unread",this.debouncedRender),this.listenTo(this.model,"emoji-picker-autocomplete",this.autocompleteInPicker),this.addEventListener("focusin",(e=>this.emitFocused(e))),this.addEventListener("focusout",(e=>this.emitBlurred(e))),this.render()}render(){Wa((e=>{const t=Vu("You have unread messages"),n=Cc.settings.get("message_limit"),s=Cc.settings.get("visible_toolbar_buttons").call,i=Cc.settings.get("visible_toolbar_buttons").emoji,r=Cc.settings.get("show_send_button"),o=Cc.settings.get("visible_toolbar_buttons").spoiler,a=Cc.settings.get("show_toolbar");return Ha(Rb(),e.model.get("scrolled")&&e.model.get("num_unread")?Ha(Mb(),(t=>e.viewUnreadMessages(t)),t):"",Cc.settings.get("show_toolbar")?Ha(Ib(),e.model,e.model.get("composing_spoiler"),s,i,r,o,a,n):"",e.model.get("jid"))})({model:this.model,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}sendButtonClicked(e){var t;null===(t=this.querySelector("converse-message-form"))||void 0===t||t.onFormSubmitted(e)}viewUnreadMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.save({scrolled:!1})}emitFocused(e){var t;null===(t=So.chatboxviews.get(this.getAttribute("jid")))||void 0===t||t.emitFocused(e)}emitBlurred(e){var t;null===(t=So.chatboxviews.get(this.getAttribute("jid")))||void 0===t||t.emitBlurred(e)}getToolbarOptions(){return{}}onDrop(e){0!=e.dataTransfer.files.length&&(e.preventDefault(),this.model.sendFiles(e.dataTransfer.files))}onDragOver(e){e.preventDefault()}clearMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),jb(this.model)}async autocompleteInPicker(e,t){await Cc.emojis.initialize();const n=this.querySelector("converse-emoji-picker");if(n){n.model.set({ac_position:e.selectionStart,autocompleting:t,query:t});const s=this.querySelector("converse-emoji-dropdown");null==s||s.showMenu()}}}Cc.elements.define("converse-chat-bottom-panel",zb);const Lb=Mc.env.utils;class Pb extends af{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),So.chatboxviews.remove(this.jid,this)}updated(){this.model&&this.jid!==this.model.get("jid")&&(this.stopListening(),delete this.model,this.requestUpdate(),this.initialize())}maybeFocus(){Cc.settings.get("auto_focus")&&this.focus()}focus(){const e=this.getElementsByClassName("chat-textarea")[0];return e&&document.activeElement!==e&&e.focus(),this}emitBlurred(e){this.contains(document.activeElement)||this.contains(e.relatedTarget)||Cc.trigger("chatBoxBlurred",this,e)}emitFocused(e){this.contains(e.relatedTarget)||Cc.trigger("chatBoxFocused",this,e)}onStatusMessageChanged(e){this.renderHeading(),Cc.trigger("contactStatusMessageChanged",{contact:e.attributes,message:e.get("status")})}getBottomPanel(){return this.model.get("type")===So.CHATROOMS_TYPE?this.querySelector("converse-muc-bottom-panel"):this.querySelector("converse-chat-bottom-panel")}getMessageForm(){return this.model.get("type")===So.CHATROOMS_TYPE?this.querySelector("converse-muc-message-form"):this.querySelector("converse-message-form")}scrollDown(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.get("scrolled")&&Lb.safeSave(this.model,{scrolled:!1}),Sv(this.model)}onWindowStateChanged(e){"visible"===e.state?this.model.isHidden()||this.model.clearUnreadMsgCounter():"hidden"===e.state&&(this.model.setChatState(So.INACTIVE,{silent:!0}),this.model.sendChatState())}}function Fb(){const e=qb(['<div class="chat-content__help">\n <converse-chat-help\n .model=',"\n .messages=","\n ?hidden=",'\n type="info"\n chat_type="','"\n ></converse-chat-help></div>']);return Fb=function(){return e},e}function Bb(){const e=qb(['\n <converse-chat-heading jid="','" class="chat-head chat-head-chatbox row no-gutters"></converse-chat-heading>\n <div class="chat-body">\n <div class="chat-content ','" aria-live="polite">\n <converse-chat-content\n class="chat-content__messages"\n jid="','"></converse-chat-content>\n\n ','\n </div>\n <converse-chat-bottom-panel jid="','" class="bottom-panel"> </converse-chat-bottom-panel>\n </div>\n ']);return Bb=function(){return e},e}function Ub(){const e=qb(['\n <div class="flyout box-flyout">\n <converse-dragresize></converse-dragresize>\n ',"\n </div>\n"]);return Ub=function(){return e},e}function qb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}class Hb extends Pb{constructor(...e){var t,n;super(...e),(n="length")in(t=this)?Object.defineProperty(t,n,{value:200,enumerable:!0,configurable:!0,writable:!0}):t[n]=200}connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){So.chatboxviews.add(this.jid,this),this.model=So.chatboxes.get(this.jid),this.listenTo(So,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>!this.model.get("hidden")&&this.afterShown())),this.listenTo(this.model,"change:show_help_messages",this.requestUpdate),this.listenTo(this.model,"change:status",this.onStatusMessageChanged),await this.model.messages.fetched,!this.model.get("hidden")&&this.afterShown(),Cc.trigger("chatBoxViewInitialized",this)}render(){return(e=>Ha(Ub(),e.model?Ha(Bb(),e.jid,e.show_send_button?"chat-content-sendbutton":"",e.jid,e.show_help_messages?Ha(Fb(),e.model,e.help_messages,!e.show_help_messages,So.CHATROOMS_TYPE):"",e.jid):""))(Object.assign({model:this.model,help_messages:this.getHelpMessages(),show_help_messages:this.model.get("show_help_messages")},this.model.toJSON()))}getHelpMessages(){return["<strong>/clear</strong>: ".concat(Vu("Remove messages")),"<strong>/close</strong>: ".concat(Vu("Close this chat")),"<strong>/me</strong>: ".concat(Vu("Write in the third person")),"<strong>/help</strong>: ".concat(Vu("Show this menu"))]}showControlBox(){var e;null===(e=So.chatboxviews.get("controlbox"))||void 0===e||e.show()}close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),So.router.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&So.router.navigate(""),this.model.close(e)}afterShown(){this.model.setChatState(So.ACTIVE),this.maybeFocus()}}Cc.elements.define("converse-chat",Hb);const $b={chatviews:{get:e=>void 0===e?Object.values(So.chatboxviews.getAll()):"string"==typeof e?So.chatboxviews.get(e):e.map((e=>So.chatboxviews.get(e)))}};n(9475);const{Strophe:Gb}=Mc.env;function Vb(){const e=Jb(['\n <p class="brand-subtitle">','</p>\n <p class="brand-subtitle">\n <a target="_blank" rel="nofollow" href="https://conversejs.org">Open Source</a> XMPP chat client\n brought to you by <a target="_blank" rel="nofollow" href="https://opkode.com">Opkode</a>\n </p>\n <p class="brand-subtitle">\n <a target="_blank" rel="nofollow" href="https://hosted.weblate.org/projects/conversejs/#languages"\n >Translate</a\n >\n it into your own language\n </p>\n ']);return Vb=function(){return e},e}function Wb(){const e=Jb(["\n ","\n "]);return Wb=function(){return e},e}function Jb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Qb(){const e=Kb(['\n <p class="byline">messaging freedom</p>\n ']);return Qb=function(){return e},e}function Yb(){const e=Kb(['\n <a class="brand-heading" href="https://conversejs.org" target="_blank" rel="noopener">\n <span class="brand-name-wrapper ','">\n <svg\n class="converse-svg-logo"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink"\n viewBox="0 0 364 364">\n\n <title>Converse</title>\n <g class="cls-1" id="g904">\n <g data-name="Layer 2">\n <g data-name="Layer 7">\n <path\n class="cls-3"\n d="M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z"\n />\n <path\n class="cls-4"\n d="M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z"\n />\n </g>\n </g>\n </g>\n </svg>\n <span class="brand-name">\n <span class="brand-name__text">converse<span class="subdued">.js</span></span>\n ',"\n </span>\n </span>\n </a>\n "]);return Yb=function(){return e},e}function Kb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Xb(){const e=(t=["\n <converse-brand-logo></converse-brand-logo>\n <converse-brand-byline></converse-brand-byline>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Xb=function(){return e},e}function Zb(){const e=ay(['\n <converse-brand-heading></converse-brand-heading>\n <form id="converse-login" class="converse-form" method="post">\n <div class="conn-feedback fade-in ','">\n <p class="feedback-subject">','</p>\n <p class="feedback-message ','">',"</p>\n </div>\n ","\n </form>\n"]);return Zb=function(){return e},e}function ey(){const e=ay(["<p>","</p>"]);return ey=function(){return e},e}function ty(){const e=ay(['<input class="btn btn-primary login-anon" type="submit" value="','">']);return ty=function(){return e},e}function ny(){const e=ay(["\n ","\n ","\n ","\n "]);return ny=function(){return e},e}function sy(){const e=ay(['\n <div class="form-group">\n <label for="converse-login-jid">',':</label>\n <input id="converse-login-jid"\n ?autofocus=','\n required\n class="form-control"\n type="text"\n name="jid"\n placeholder="','"/>\n </div>\n ',"\n ",'\n <fieldset class="form-group buttons">\n <input class="btn btn-primary" type="submit" value="','"/>\n </fieldset>\n ',"\n "]);return sy=function(){return e},e}function iy(){const e=ay(['\n <fieldset class="switch-form">\n <p>','</p>\n <p><a class="register-account toggle-register-login" href="#converse/register">',"</a></p>\n </fieldset>\n "]);return iy=function(){return e},e}function ry(){const e=ay(['\n <div class="form-group">\n <label for="converse-login-password">','</label>\n <input id="converse-login-password" class="form-control" required="required" type="password" name="password" placeholder="','"/>\n </div>\n ']);return ry=function(){return e},e}function oy(){const e=ay(['\n <div class="form-group form-check login-trusted">\n <input id="converse-login-trusted" type="checkbox" class="form-check-input" name="trusted" ?checked=','>\n <label for="converse-login-trusted" class="form-check-label login-trusted__desc">','</label>\n <i class="fa fa-info-circle" data-toggle="popover"\n data-title="Trusted device?"\n data-content="','"></i>\n </div>\n ']);return oy=function(){return e},e}function ay(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Mc.plugins.add("converse-chatview",{dependencies:["converse-chatboxviews","converse-chat","converse-disco","converse-modal"],initialize(){Cc.settings.extend({auto_focus:!0,debounced_content_rendering:!0,filter_url_query_params:null,image_urls_regex:null,message_limit:0,muc_hats:["xep317"],show_images_inline:!0,show_message_avatar:!0,show_retraction_warning:!0,show_send_button:!0,show_toolbar:!0,time_format:"HH:mm",use_system_emojis:!0,visible_toolbar_buttons:{call:!1,clear:!0,emoji:!0,spoiler:!0}}),Object.assign(Cc,$b),So.ChatBoxView=Hb,Cc.listen.on("connected",(()=>Cc.disco.own.features.add(Gb.NS.SPOILER)))}}),Cc.elements.define("converse-brand-byline",class extends af{render(){const e="fullscreen"===Cc.settings.get("view_mode");return Ha(Wb(),e?Ha(Vb(),So.VERSION_NAME):"")}}),Cc.elements.define("converse-brand-logo",class extends af{render(){const e="fullscreen"===Cc.settings.get("view_mode");return Ha(Yb(),e?"brand-name-wrapper--fullscreen":"",e?Ha(Qb()):"")}}),Cc.elements.define("converse-brand-heading",class extends af{render(){return Ha(Xb())}});const cy=e=>Ha(Zb(),e.conn_feedback_subject?e.conn_feedback_class:"hidden",e.conn_feedback_subject,e.conn_feedback_message?"":"hidden",e.conn_feedback_message,"CONNECTING"===So.CONNECTION_STATUS[e.connection_status]?Zp({classes:"hor_centered"}):(e=>{const t=Vu("Disconnected"),n=Vu("Click here to log in anonymously");return Ha(ny(),e.authentication==e.LOGIN||e.authentication==e.EXTERNAL?(e=>{const t=Vu("Log in"),n=Vu("XMPP Address");return Ha(sy(),n,!!Cc.settings.get("auto_focus"),e.placeholder_username,e.authentication!==e.EXTERNAL?(()=>{const e=Vu("Password");return Ha(ry(),e,e)})():"",e.show_trust_checkbox?(e=>{const t=Vu("To improve performance, we cache your data in this browser. Uncheck this box if this is a public computer or if you want your data to be deleted when you log out. It's important that you explicitly log out, otherwise not all cached data might be deleted. Please note, when using an untrusted device, OMEMO encryption is NOT available."),n=Vu("This is a trusted device");return Ha(oy(),e,n,t)})("off"!==e.show_trust_checkbox):"",t,So.allow_registration&&!Cc.settings.get("auto_login")&&So.pluggable.plugins["converse-register"].enabled(So)?(()=>{const e=Vu("Create an account"),t=Vu("Don't have a chat account?");return Ha(iy(),t,e)})():"")})(e):"",e.authentication==e.ANONYMOUS?Ha(ty(),n):"",e.authentication==e.PREBIND?Ha(ey(),t):"")})(e));function ly(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const uy=Mc.env.utils,{Strophe:dy}=Mc.env,hy=[0,1,2,3,4,7,10],fy={0:"Error",1:"Connecting",2:"Connection failure",3:"Authenticating",4:"Authentication failure",5:"Connected",6:"Disconnected",7:"Disconnecting",8:"Attached",9:"Redirect",10:"Reconnecting"},gy={Error:"error",Connecting:"info","Connection failure":"error",Authenticating:"info","Authentication failure":"error",Connected:"info",Disconnected:"error",Disconnecting:"warn",Attached:"info",Redirect:"info",Reconnecting:"warn"},my=ao.extend({defaults:{errors:[]}});Cc.elements.define("converse-login-panel",class extends yf{constructor(...e){super(...e),ly(this,"id","converse-login-panel"),ly(this,"className","controlbox-pane fade-in row no-gutters"),ly(this,"events",{"submit form#converse-login":"authenticate","change input":"validate"})}initialize(){this.model=new my,this.listenTo(this.model,"change",this.render),this.listenTo(So.connfeedback,"change",this.render),this.render(),this.initPopovers()}render(){const e=So.connfeedback.get("connection_status");let t,n;hy.includes(e)&&(n=fy[e],t=gy[n]),Wa(cy(Object.assign(this.model.toJSON(),{_converse:So,ANONYMOUS:So.ANONYMOUS,EXTERNAL:So.EXTERNAL,LOGIN:So.LOGIN,PREBIND:So.PREBIND,auto_login:Cc.settings.get("auto_login"),authentication:Cc.settings.get("authentication"),connection_status:e,conn_feedback_class:t,conn_feedback_subject:n,conn_feedback_message:So.connfeedback.get("message"),placeholder_username:(Cc.settings.get("locked_domain")||Cc.settings.get("default_domain"))&&Vu("Username")||Vu("user@domain"),show_trust_checkbox:Cc.settings.get("allow_user_trust_override")})),this)}initPopovers(){Array.from(this.querySelectorAll("[data-title]")).forEach((e=>{new(ng().Popover)(e,{trigger:"mobile"===Cc.settings.get("view_mode")?"click":"hover",dismissible:"mobile"===Cc.settings.get("view_mode"),container:this.parentElement.parentElement.parentElement})}))}validate(){const e=this.querySelector("form").querySelector("input[name=jid]");return!e.value||Cc.settings.get("locked_domain")||Cc.settings.get("default_domain")||uy.isValidJID(e.value)?(e.setCustomValidity(""),!0):(e.setCustomValidity(Vu("Please enter a valid XMPP address")),!1)}authenticate(e){if(null==e||e.preventDefault(),Cc.settings.get("authentication")===So.ANONYMOUS)return this.connect(So.jid,null);if(!this.validate())return;const t=new FormData(e.target);So.config.save({trusted:!!t.get("trusted")});let n=t.get("jid");if(Cc.settings.get("locked_domain")){const e="@"+Cc.settings.get("locked_domain");n.endsWith(e)&&(n=n.substr(0,n.length-e.length)),n=dy.escapeNode(n)+e}else Cc.settings.get("default_domain")&&!n.includes("@")&&(n=n+"@"+Cc.settings.get("default_domain"));this.connect(n,t.get("password"))}connect(e,t){["converse/login","converse/register"].includes(So.router.history.getFragment())&&So.router.navigate("",{replace:!0}),So.connection&&So.connection.reset(),Cc.user.login(e,t)}});const py=Mc.env.utils;function vy(){var e;const t=So.chatboxes.add(new So.ControlBox({id:"controlbox"}));return null===(e=So.chatboxviews.get("controlbox"))||void 0===e||e.setModel(),t}function by(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=So.chatboxes.get("controlbox")||vy();py.safeSave(n,{closed:!1})}function yy(){const e=(t=['<i class="fa fa-arrow-left" @click=',"></i>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return yy=function(){return e},e}Cc.elements.define("converse-controlbox-navback",class extends af{static get properties(){return{jid:{type:String}}}render(){return e=this.jid,Ha(yy(),(()=>function(e){by();const t=So.chatboxes.get(e);py.safeSave(t,{hidden:!0})}(e)));var e}});const{dayjs:_y}=Mc.env,wy={defaults(){return{bookmarked:!1,box_id:"controlbox",chat_state:void 0,closed:!Cc.settings.get("show_controlbox_by_default"),num_unread:0,time_opened:this.get("time_opened")||(new Date).getTime(),type:So.CONTROLBOX_TYPE,url:""}},initialize(){"controlbox"===this.get("id")?this.set({time_opened:_y(0).valueOf()}):So.ChatBox.prototype.initialize.apply(this,arguments)},validate(e){return e.type===So.CONTROLBOX_TYPE?"embedded"===Cc.settings.get("view_mode")&&Cc.settings.get("singleton")?"Controlbox not relevant in embedded view mode":void 0:So.ChatBox.prototype.validate.call(this,e)},maybeShow(e){return e||"controlbox"!==this.get("id")?So.ChatBox.prototype.maybeShow.call(this,e):this},onReconnection(){this.save("connected",!0)}};function Sy(){const e=(t=['<a id="toggle-controlbox" class="toggle-controlbox ','" @click=','><span class="toggle-feedback">',"</span></a>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Sy=function(){return e},e}class xy extends af{async connectedCallback(){super.connectedCallback(),await Cc.waitUntil("initialized"),this.model=So.chatboxes.get("controlbox"),this.listenTo(this.model,"change:closed",(()=>this.requestUpdate())),this.requestUpdate()}render(){var e;return(e=>{const t=Cc.connection.connected()?Vu("Chat Contacts"):Vu("Toggle chat");return Ha(Sy(),e.hide?"hidden":"",e.onClick,t)})({onClick:by,hide:!(null===(e=this.model)||void 0===e?void 0:e.get("closed"))})}}Cc.elements.define("converse-controlbox-toggle",xy);const Ey=xy;function jy(){const e=Ny(["<converse-login-panel></converse-login-panel>"]);return jy=function(){return e},e}function Ay(){const e=Ny(["<converse-register-panel></converse-register-panel>"]);return Ay=function(){return e},e}function Cy(){const e=Ny(['<div id="converse-roster" class="controlbox-section"><converse-roster></converse-roster></div>']);return Cy=function(){return e},e}function ky(){const e=Ny(['\n <converse-user-profile></converse-user-profile>\n <converse-headlines-panel class="controlbox-section"></converse-headlines-panel>\n <div id="chatrooms" class="controlbox-section">\n <converse-rooms-list></converse-rooms-list>\n <converse-bookmarks></converse-bookmarks>\n </div>\n ',""]);return ky=function(){return e},e}function Oy(){const e=Ny(['\n <a class="chatbox-btn close-chatbox-button fa fa-times" @click=',"></a>\n "]);return Oy=function(){return e},e}function Ty(){const e=Ny(['\n <div class="flyout box-flyout">\n <converse-dragresize></converse-dragresize>\n <div class="chat-head controlbox-head">\n ','\n </div>\n <div class="controlbox-panes">\n <div class="controlbox-pane">\n ',"\n </div>\n </div>\n </div>\n"]);return Ty=function(){return e},e}function Ny(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Iy=Mc.env.utils;class My extends yf{initialize(){this.setModel(),this.render(),So.chatboxviews.add("controlbox",this),Cc.trigger("controlBoxInitialized",this)}setModel(){this.model=So.chatboxes.get("controlbox"),this.initEventHandlers()}initEventHandlers(){this.listenTo(this.model,"change:active-form",this.render),this.listenTo(this.model,"change:connected",this.render),this.listenTo(this.model,"change:closed",(()=>!this.model.get("closed")&&this.afterShown()))}render(){Wa((e=>Ha(Ty(),e.sticky_controlbox?"":Ha(Oy(),e.close),e.connected?Ha(ky(),Cc.settings.get("authentication")===So.ANONYMOUS?"":Ha(Cy())):"register"===e["active-form"]?Ha(Ay()):Ha(jy())))({sticky_controlbox:Cc.settings.get("sticky_controlbox"),...this.model.toJSON(),close:e=>this.close(e)}),this)}afterRender(){this.model.get("connected")&&void 0===this.model.get("closed")&&this.model.set("closed",!Cc.settings.get("show_controlbox_by_default"))}close(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),("closeAllChatBoxes"!==(null==e?void 0:e.name)||So.disconnection_cause===So.LOGOUT&&!Cc.settings.get("show_controlbox_by_default"))&&!Cc.settings.get("sticky_controlbox"))return Iy.safeSave(this.model,{closed:!0}),Cc.trigger("controlBoxClosed",this),this}afterShown(){return Cc.trigger("controlBoxOpened",this),this}showHelpMessages(){}}Cc.elements.define("converse-controlbox",My);const Ry=My,{u:Dy}=Mc.env,zy={controlbox:{async open(){await Cc.waitUntil("chatBoxesFetched");const e=await Cc.chatboxes.get("controlbox")||Cc.chatboxes.create("controlbox",{},So.Controlbox);return Dy.safeSave(e,{closed:!1}),e},get:()=>So.chatboxviews.get("controlbox")}};n(9980);const Ly=Mc.env.utils;function Py(){const e=So.chatboxviews.get("controlbox");return e.model.set({connected:!1}),e}function Fy(){const e=null==So?void 0:So.chatboxviews,t=e&&e.get("controlbox");t&&(Ly.safeSave(t.model,{connected:!1}),(null==t?void 0:t.controlbox_pane)&&(t.controlbox_pane.remove(),delete t.controlbox_pane))}function By(){(So.chatboxes.get("controlbox")||vy()).save({connected:!0})}Mc.plugins.add("converse-controlbox",{dependencies:["converse-modal","converse-chatboxes","converse-chat","converse-rosterview","converse-chatview"],enabled:e=>!e.api.settings.get("singleton"),overrides:{ChatBoxes:{model(e,t){const{_converse:n}=this.__super__;return e&&"controlbox"==e.id?new n.ControlBox(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){Cc.settings.extend({allow_logout:!0,allow_user_trust_override:!0,default_domain:void 0,locked_domain:void 0,show_controlbox_by_default:!1,sticky_controlbox:!1}),Cc.promises.add("controlBoxInitialized"),Object.assign(Cc,zy),So.ControlBoxView=Ry,So.ControlBox=So.ChatBox.extend(wy),So.ControlBoxToggle=Ey,Cc.listen.on("chatBoxesFetched",By),Cc.listen.on("cleanup",(()=>delete So.controlboxtoggle)),Cc.listen.on("clearSession",Fy),Cc.listen.on("will-reconnect",Py),Cc.waitUntil("chatBoxViewsInitialized").then(vy).catch((e=>as.fatal(e)))}});const{u:Uy}=Mc.env;function qy(e,t=!0){if(!Cc.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=Uy.ancestor(e.target,".box-flyout"),s=window.getComputedStyle(n),i=n.parentElement;i.height=parseInt(s.height.replace(/px$/,""),10),So.resizing={chatbox:i,direction:"top"},i.prev_pageY=e.pageY,t&&Cc.trigger("startVerticalResize",i)}function Hy(e,t=!0){if(!Cc.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=Uy.ancestor(e.target,".box-flyout"),s=window.getComputedStyle(n),i=n.parentElement;i.width=parseInt(s.width.replace(/px$/,""),10),So.resizing={chatbox:i,direction:"left"},i.prev_pageX=e.pageX,t&&Cc.trigger("startHorizontalResize",i)}function $y(e){Hy(e,!1),qy(e,!1),So.resizing.direction="topleft",Cc.trigger("startDiagonalResize",this)}function Gy(e,t){if(void 0!==e)return void 0===t?e:e!==t&&Math.abs(e-t)<10?t:e}function Vy(e){if(!So.resizing||!Cc.settings.get("allow_dragresize"))return!0;e.preventDefault(),So.resizing.chatbox.resizeChatBox(e)}function Wy(e){if(!So.resizing||!Cc.settings.get("allow_dragresize"))return!0;e.preventDefault();const t=Gy(So.resizing.chatbox.height,So.resizing.chatbox.model.get("default_height")),n=Gy(So.resizing.chatbox.width,So.resizing.chatbox.model.get("default_width"));Cc.connection.connected()?(So.resizing.chatbox.model.save({height:t}),So.resizing.chatbox.model.save({width:n})):(So.resizing.chatbox.model.set({height:t}),So.resizing.chatbox.model.set({width:n})),So.resizing=null}function Jy(){const e=(t=['\n <div class="dragresize dragresize-top" @mousedown="','"></div>\n <div class="dragresize dragresize-topleft" @mousedown="','"></div>\n <div class="dragresize dragresize-left" @mousedown="','"></div>\n'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Jy=function(){return e},e}customElements.define("converse-dragresize",class extends af{render(){return Ha(Jy(),qy,$y,Hy)}});const Qy={initDragResize(){var e;const t=this,n=Oo((()=>t.setDimensions()));window.addEventListener("resize",t.debouncedSetDimensions),this.listenTo(this.model,"destroy",(()=>window.removeEventListener("resize",n)));const s=this.querySelector(".box-flyout"),i=window.getComputedStyle(s);if(void 0===this.model.get("height")){const e=parseInt(i.height.replace(/px$/,""),10),t=parseInt(i.width.replace(/px$/,""),10);this.model.set("height",e),this.model.set("default_height",e),this.model.set("width",t),this.model.set("default_width",t)}const r=i["min-width"],o=i["min-height"];return this.model.set("min_width",r.endsWith("px")?Number(r.replace(/px$/,"")):0),this.model.set("min_height",o.endsWith("px")?Number(o.replace(/px$/,"")):0),this.prev_pageY=0,this.prev_pageX=0,(null===(e=So.connection)||void 0===e?void 0:e.connected)&&(this.height=this.model.get("height"),this.width=this.model.get("width")),this},resizeChatBox(e){let t;0===So.resizing.direction.indexOf("top")&&(t=e.pageY-this.prev_pageY,t&&(this.height=this.height-t>(this.model.get("min_height")||0)?this.height-t:this.model.get("min_height"),this.prev_pageY=e.pageY,this.setChatBoxHeight(this.height))),So.resizing.direction.includes("left")&&(t=this.prev_pageX-e.pageX,t&&(this.width=this.width+t>(this.model.get("min_width")||0)?this.width+t:this.model.get("min_width"),this.prev_pageX=e.pageX,this.setChatBoxWidth(this.width)))},setDimensions(){this.adjustToViewport(),this.setChatBoxHeight(this.model.get("height")),this.setChatBoxWidth(this.model.get("width"))},setChatBoxHeight(e){e=e?Gy(e,this.model.get("default_height"))+"px":"";const t=this.querySelector(".box-flyout");null!==t&&(t.style.height=e)},setChatBoxWidth(e){e=e?Gy(e,this.model.get("default_width"))+"px":"",this.style.width=e;const t=this.querySelector(".box-flyout");null!==t&&(t.style.width=e)},adjustToViewport(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);e<=480?(this.model.set("height",void 0),this.model.set("width",void 0)):e<=this.model.get("width")?this.model.set("width",void 0):t<=this.model.get("height")&&this.model.set("height",void 0)}};function Yy(){const e=e_(['<p class="chat-head__desc">',"</p>"]);return Yy=function(){return e},e}function Ky(){const e=e_(["<converse-dropdown .items=","></converse-dropdown>"]);return Ky=function(){return e},e}function Xy(){const e=e_(['<converse-controlbox-navback jid="','"></converse-controlbox-navback>']);return Xy=function(){return e},e}function Zy(){const e=e_(['\n <div class="chatbox-title ','">\n <div class="chatbox-title--row">\n ','\n <div class="chatbox-title__text" title="','">','</div>\n </div>\n <div class="chatbox-title__buttons row no-gutters">\n ',"\n ","\n </div>\n </div>\n ","\n "]);return Zy=function(){return e},e}function e_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function t_(){const e=s_(['\n <converse-headlines-heading jid="','" class="chat-head chat-head-chatbox row no-gutters">\n </converse-headlines-heading>\n <div class="chat-body">\n <div class="chat-content" aria-live="polite">\n <converse-chat-content\n class="chat-content__messages"\n jid="','"></converse-chat-content>\n </div>\n </div>']);return t_=function(){return e},e}function n_(){const e=s_(['\n <div class="flyout box-flyout">\n <converse-dragresize></converse-dragresize>\n ',"\n </div>\n"]);return n_=function(){return e},e}function s_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function i_(){const e=o_(['\n <div class="list-container list-container--headline ','">\n <div class="items-list rooms-list headline-list">\n ',"\n </div>\n </div>\n"]);return i_=function(){return e},e}function r_(){const e=o_(['\n <div class="list-item controlbox-padded d-flex flex-row"\n data-headline-jid="','">\n <a class="list-item-link open-headline available-room w-100"\n data-headline-jid="','"\n title="','" href="#">',"</a>\n </div>\n"]);return r_=function(){return e},e}function o_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Mc.plugins.add("converse-dragresize",{dependencies:["converse-chatview","converse-headlines-view","converse-muc-views"],enabled:e=>"overlayed"==e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){const e=this.__super__.initialize.apply(this,arguments),t=this.get("height"),n=this.get("width");return("controlbox"===this.get("id")?e=>this.set(e):e=>this.save(e))({height:Gy(t,this.get("default_height")),width:Gy(n,this.get("default_width"))}),e}}},initialize(){Cc.settings.extend({allow_dragresize:!0}),Object.assign(So.ChatBoxView.prototype,Qy),Object.assign(So.ChatRoomView.prototype,Qy),Object.assign(So.ControlBoxView.prototype,Qy),Cc.listen.on("registeredGlobalEventHandlers",(function(){document.addEventListener("mousemove",Vy),document.addEventListener("mouseup",Wy)})),Cc.listen.on("unregisteredGlobalEventHandlers",(function(){document.removeEventListener("mousemove",Vy),document.removeEventListener("mouseup",Wy)})),Cc.listen.on("beforeShowingChatView",(e=>e.initDragResize().setDimensions()))}}),Mc.plugins.add("converse-singleton",{enabled:e=>e.api.settings.get("singleton"),initialize(){if(Cc.settings.extend({allow_logout:!1,allow_muc_invitations:!1,hide_muc_server:!0}),!Array.isArray(Cc.settings.get("auto_join_rooms"))&&!Array.isArray(Cc.settings.get("auto_join_private_chats")))throw new Error("converse-singleton: auto_join_rooms must be an Array");if(Cc.settings.get("auto_join_rooms").length>1||Cc.settings.get("auto_join_private_chats").length>1)throw new Error("It doesn't make sense to have singleton set to true and auto_join_rooms or auto_join_private_chats set to more then one, since only one chat room may be open at any time.")}}),n(2366),n(553),Mc.plugins.add("converse-fullscreen",{enabled:e=>e.isUniView(),initialize(){Cc.settings.extend({chatview_avatar_height:50,chatview_avatar_width:50,hide_open_bookmarks:!0,show_controlbox_by_default:!0,sticky_controlbox:!0})}}),Cc.elements.define("converse-headlines-heading",class extends kb{async connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.render()}async generateHeadingTemplate(){const e=await this.getHeadingButtons(),t=e.filter((e=>e.standalone)),n=e.filter((e=>!e.standalone));return(e=>Ha(Zy(),e.status?"":"chatbox-title--no-desc",So.api.settings.get("singleton")?"":Ha(Xy(),e.jid),e.jid,e.display_name,e.dropdown_btns.length?Ha(Ky(),e.dropdown_btns):"",e.standalone_btns.length?(e=>e.standalone_btns.reverse().map((e=>Ng(e,""))))(e):"",e.status?Ha(Yy(),e.status):""))(Object.assign(this.model.toJSON(),{display_name:this.model.getDisplayName(),dropdown_btns:n.map((e=>xb(e))),standalone_btns:t.map((e=>Eb(e)))}))}getHeadingButtons(){const e=[];return Cc.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Vu("Close"),i18n_title:Vu("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Cc.settings.get("view_mode")}),So.api.hook("getHeadingButtons",this,e)}}),Cc.elements.define("converse-headlines",class extends Pb{connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){So.chatboxviews.add(this.jid,this),this.model=So.chatboxes.get(this.jid),this.model.disable_mam=!0,this.listenTo(So,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>this.afterShown())),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model,"show",this.show),this.listenTo(this.model.messages,"add",this.requestUpdate),this.listenTo(this.model.messages,"remove",this.requestUpdate),this.listenTo(this.model.messages,"reset",this.requestUpdate),await this.model.messages.fetched,this.model.maybeShow(),Cc.trigger("headlinesBoxViewInitialized",this)}render(){return(e=>Ha(n_(),e?Ha(t_(),e.get("jid"),e.get("jid")):""))(this.model)}async close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),So.router.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&So.router.navigate(""),await this.model.close(e),Cc.trigger("chatBoxClosed",this),this}getNotifications(){return[]}afterShown(){}});function a_(){const e=(t=['\n <div class="controlbox-section" id="headline">\n <div class="d-flex controlbox-padded ','">\n <span class="w-100 controlbox-heading controlbox-heading--headline">',"</span>\n </div>\n </div>\n ","\n"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return a_=function(){return e},e}class c_ extends yf{constructor(...e){var t,n,s;super(...e),s={"click .open-headline":"openHeadline"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}initialize(){this.model=So.chatboxes,this.listenTo(this.model,"add",this.renderIfHeadline),this.listenTo(this.model,"remove",this.renderIfHeadline),this.listenTo(this.model,"destroy",this.renderIfHeadline),this.render()}toHTML(){return(e=>Ha(a_(),e.headlineboxes.length?"":"hidden",e.heading_headline,(e=>Ha(i_(),e.headlineboxes.length?"":"hidden",e.headlineboxes.map((t=>(e=>Ha(r_(),e.headlinebox.get("jid"),e.headlinebox.get("jid"),e.open_title,e.headlinebox.get("jid")))(Object.assign({headlinebox:t},e))))))(e)))({heading_headline:Vu("Announcements"),headlineboxes:this.model.filter((e=>e.get("type")===So.HEADLINES_TYPE)),open_title:Vu("Click to open this server message")})}renderIfHeadline(e){return e&&e.get("type")===So.HEADLINES_TYPE&&this.render()}openHeadline(e){e.preventDefault();const t=e.target.getAttribute("data-headline-jid");So.chatboxes.get(t).maybeShow(!0)}}async function l_(e){if(e.model.messages.length){const t=e.model.get("type")===So.CHATROOMS_TYPE,n=e.model.getOldestMessage();if(n){const s=t?e.model.get("jid"):So.bare_jid,i=n&&n.get("stanza_id ".concat(s));e.model.ui.set("chat-content-spinner-top",!0),i?await Fd(e.model,{before:i}):await Fd(e.model,{end:n.get("time")}),Cc.settings.get("allow_url_history_change")&&So.router.history.navigate("#".concat(n.get("msgid"))),setTimeout((()=>e.model.ui.set("chat-content-spinner-top",!1)),250)}}}function u_(){const e=h_(['<span class="message-count badge badge-light">',"</span>"]);return u_=function(){return e},e}function d_(){const e=h_(['\n <div class="chat-head-',' chat-head row no-gutters">\n <a class="restore-chat w-100 align-self-center" title="','" @click=',">\n ","\n ",'\n </a>\n <a class="chatbox-btn close-chatbox-button fa fa-times" @click=',"></a>\n </div>"]);return d_=function(){return e},e}function h_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-headlines-panel",c_),n(9996),Mc.plugins.add("converse-headlines-view",{dependencies:["converse-headlines","converse-chatview"],initialize(){So.HeadlinesPanel=c_}}),Mc.plugins.add("converse-mam-views",{dependencies:["converse-mam","converse-chatview","converse-muc-views"],initialize(){Cc.listen.on("chatBoxScrolledUp",l_)}});const f_=Mc.env.utils;function g_(e){return"controlbox"===e.model.get("id")?f_.isVisible(e)?f_.getOuterWidth(e,!0):f_.getOuterWidth(So.controlboxtoggle.el,!0):!e.model.get("minimized")&&f_.isVisible(e)?f_.getOuterWidth(e,!0):0}function m_(){var e;const t=null===(e=So.minimized_chats)||void 0===e?void 0:e.el;return So.chatboxes.pluck("minimized").includes(!0)?f_.getOuterWidth(t,!0):0}function p_(e){const t=e?e.model.get("id"):null,n=e?f_.getOuterWidth(e.el,!0):0;return Object.values(So.chatboxviews.xget(t)).reduce(((e,t)=>e+g_(t)),n)}async function v_(e){var t;if(So.isTestEnv()||Cc.settings.get("no_trimming")||!Cc.connection.connected()||"overlayed"!==Cc.settings.get("view_mode"))return;const n=So.chatboxviews.filter((e=>!e.model.get("minimized")&&!e.model.get("closed")&&f_.isVisible(e)));if(n.length<=1)return;const s=f_.getOuterWidth(document.querySelector("body"),!0);if(g_(n[0])!==s&&(await Cc.waitUntil("minimizedChatsInitialized"),null===(t=So.minimized_chats)||void 0===t?void 0:t.el))for(;m_()+p_(e)>s;){const t=b_([e?e.model.get("id"):null]);if(!t)break;{const e=So.chatboxviews.get(t.get("id"));e&&e.hide(),__(t)}}}function b_(e){e.push("controlbox");let t=0,n=So.chatboxes.sort().at(t);for(;e.includes(n.get("id"))||!0===n.get("minimized");)if(t++,n=So.chatboxes.at(t),!n)return null;return n}function y_(e,t){(null==e?void 0:e.preventDefault)?e.preventDefault():t=e,f_.safeSave(t,{hidden:!1,minimized:!1,time_opened:(new Date).getTime()})}function __(e,t){(null==e?void 0:e.preventDefault)?e.preventDefault():t=e,t.setChatState(So.INACTIVE),f_.safeSave(t,{hidden:!0,minimized:!0,time_minimized:(new Date).toISOString()})}Cc.elements.define("converse-minimized-chat",class extends af{static get properties(){return{model:{type:Object},title:{type:String},type:{type:String},num_unread:{type:Number}}}render(){return(e=>{const t=Vu("Click to restore this chat");return Ha(d_(),e.type,t,e.restore,e.num_unread?Ha(u_(),e.num_unread):"",e.title,e.close)})({close:e=>this.close(e),num_unread:this.num_unread,restore:e=>this.restore(e),title:this.title,type:this.type})}close(e){null==e||e.preventDefault();const t=So.chatboxviews.get(this.model.get("id"));t?t.close():(this.model.destroy(),Cc.trigger("chatBoxClosed",this))}restore(e){null==e||e.preventDefault(),y_(this.model)}});const w_=ao.extend({defaults:{collapsed:!1}});function S_(){const e=E_(["<converse-minimized-chat\n .model=","\n title=","\n type=","\n num_unread=","></converse-minimized-chat>"]);return S_=function(){return e},e}function x_(){const e=E_(['<div id="minimized-chats" class="','">\n <a id="toggle-minimized-chats" class="row no-gutters" @click=',">\n "," ",'\n <span class="unread-message-count ','" href="#">','</span>\n </a>\n <div class="flyout minimized-chats-flyout row no-gutters ','">\n ',"\n </div>\n </div>"]);return x_=function(){return e},e}function E_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}class j_ extends yf{async initialize(){this.model=So.chatboxes,await this.initToggle(),this.render(),this.listenTo(this.minchats,"change:collapsed",this.render),this.listenTo(this.model,"add",this.render),this.listenTo(this.model,"change:fullname",this.render),this.listenTo(this.model,"change:jid",this.render),this.listenTo(this.model,"change:minimized",this.render),this.listenTo(this.model,"change:name",this.render),this.listenTo(this.model,"change:num_unread",this.render),this.listenTo(this.model,"remove",this.render)}render(){const e=this.model.where({minimized:!0}),t=e.reduce(((e,t)=>e+t.get("num_unread")),0),n=e.reduce(((e,t)=>e+(t.get("minimized")?1:0)),0),s={chats:e,num_unread:t,num_minimized:n,collapsed:this.minchats.get("collapsed")};s.toggle=e=>this.toggle(e),Wa((e=>Ha(x_(),e.chats.length?"":"hidden",e.toggle,e.num_minimized,Vu("Minimized"),e.num_unread?"":"unread-message-count-hidden",e.num_unread,e.collapsed?"hidden":"",e.chats.map((e=>Ha(S_(),e,e.getDisplayName(),e.get("type"),e.get("num_unread"))))))(s),this)}async initToggle(){const e="converse.minchatstoggle-".concat(So.bare_jid);this.minchats=new w_({id:e}),Cr(this.minchats,e,"session"),await new Promise((e=>this.minchats.fetch({success:e,error:e})))}toggle(e){null==e||e.preventDefault(),this.minchats.save({collapsed:!this.minchats.get("collapsed")})}}Cc.elements.define("converse-minimized-chats",j_),n(6123);const{dayjs:A_}=Mc.env;Mc.plugins.add("converse-minimize",{dependencies:["converse-chatview","converse-controlbox","converse-muc-views","converse-headlines-view","converse-dragresize"],enabled:e=>"overlayed"===e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){this.__super__.initialize.apply(this,arguments),this.on("change:hidden",(e=>!e.get("hidden")&&y_(this)),this),"controlbox"!==this.get("id")&&this.save({minimized:this.get("minimized")||!1,time_minimized:this.get("time_minimized")||A_()})},maybeShow(e){return!e&&this.get("minimized")?this:this.__super__.maybeShow.apply(this,arguments)},isHidden(){return this.__super__.isHidden.call(this)||this.get("minimized")}},ChatBoxView:{isNewMessageHidden(){return this.model.get("minimized")||this.__super__.isNewMessageHidden.apply(this,arguments)},setChatBoxHeight(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxHeight.call(this,e)},setChatBoxWidth(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxWidth.call(this,e)}}},initialize(){function e(e){e.on("change:minimized",(()=>function(e){e.get("minimized")?function(e){Cc.trigger("chatBoxMinimized",e)}(e):function(e){e.isScrolledUp()||e.clearUnreadMsgCounter(),e.setChatState(So.ACTIVE),Cc.trigger("chatBoxMaximized",e)}(e)}(e)))}Cc.settings.extend({no_trimming:!1}),Cc.promises.add("minimizedChatsInitialized"),So.MinimizedChatsToggle=w_,So.MinimizedChats=j_,So.minimize={},So.minimize.trimChats=v_,So.minimize.minimize=__,So.minimize.maximize=y_,Cc.listen.on("chatBoxViewInitialized",(e=>So.minimize.trimChats(e))),Cc.listen.on("chatRoomViewInitialized",(e=>So.minimize.trimChats(e))),Cc.listen.on("chatBoxMaximized",(e=>So.minimize.trimChats(e))),Cc.listen.on("controlBoxOpened",(e=>So.minimize.trimChats(e))),Cc.listen.on("chatBoxInitialized",e),Cc.listen.on("chatRoomInitialized",e),Cc.listen.on("getHeadingButtons",((e,t)=>e.model.get("type")===So.CHATROOMS_TYPE?function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>__(t,e.model),i18n_text:Vu("Minimize"),i18n_title:Vu("Minimize this groupchat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===So.api.settings.get("view_mode")},s=t.map((e=>e.name)).indexOf("signout");return s>-1?[...t.slice(0,s),n,...t.slice(s)]:[n,...t]}(e,t):function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>__(t,e.model),i18n_text:Vu("Minimize"),i18n_title:Vu("Minimize this chat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===So.api.settings.get("view_mode")},s=t.map((e=>e.name)).indexOf("close");return s>-1?[...t.slice(0,s),n,...t.slice(s)]:[n,...t]}(e,t)));const t=Oo((()=>So.minimize.trimChats()),250);Cc.listen.on("registeredGlobalEventHandlers",(()=>window.addEventListener("resize",t))),Cc.listen.on("unregisteredGlobalEventHandlers",(()=>window.removeEventListener("resize",t)))}});const C_=Mc.env.utils,k_={getElement:(e,t)=>"string"==typeof e?(t||document).querySelector(e):e||null,bind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/\s+/).forEach((t=>e.addEventListener(t,s)))}},unbind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/\s+/).forEach((t=>e.removeEventListener(t,s)))}},regExpEscape:e=>e.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),isMention:(e,t)=>t.includes(e[0])||C_.isMentionBoundary(e[0])&&t.includes(e[1])},O_=function(e,t){return RegExp(k_.regExpEscape(t.trim()),"i").test(e)},T_=function(e,t){return RegExp("^"+k_.regExpEscape(t.trim()),"i").test(e)},N_=function(e,t){const n=e.query.toLowerCase(),s=e.label.toLowerCase().indexOf(n),i=t.label.toLowerCase().indexOf(n);return s===i?function(e,t){return e.length!==t.length?e.length-t.length:e<t?-1:1}(e,t):(-1===s?1/0:s)<(-1===i?1/0:i)?-1:1},I_=(e,t)=>{t=t.trim();const n=document.createElement("li");n.setAttribute("aria-selected","false");const s=new RegExp("("+t+")","ig");return(t?e.split(s):[e]).forEach((e=>{if(t&&e.match(s)){const t=document.createElement("mark");t.textContent=e,n.appendChild(t)}else n.appendChild(document.createTextNode(e))})),n},M_=class extends String{constructor(e,t){super();const n=Array.isArray(e)?{label:e[0],value:e[1]}:"object"==typeof e&&"label"in e&&"value"in e?e:{label:e,value:e};this.label=n.label||n.value,this.value=n.value,this.query=t}get lenth(){return this.label.length}toString(){return""+this.label}valueOf(){return this.toString()}},R_=Mc.env.utils;class D_{constructor(e,t={}){this.suggestions=[],this.is_opened=!1,R_.hasClass("suggestion-box",e)?this.container=e:this.container=e.querySelector(".suggestion-box"),this.input=this.container.querySelector(".suggestion-box__input"),this.input.setAttribute("aria-autocomplete","list"),this.ul=this.container.querySelector(".suggestion-box__results"),this.status=this.container.querySelector(".suggestion-box__additions"),Object.assign(this,{match_current_word:!1,ac_triggers:[],include_triggers:[],min_chars:2,max_items:10,auto_evaluate:!0,auto_first:!1,data:e=>e,filter:O_,sort:!1!==t.sort&&N_,item:I_},t),this.index=-1,this.bindEvents(),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||t.list||[]}bindEvents(){const e={blur:()=>this.close({reason:"blur"})};this.auto_evaluate&&(e.input=()=>this.evaluate()),this._events={input:e,form:{submit:()=>this.close({reason:"submit"})},ul:{mousedown:e=>this.onMouseDown(e),mouseover:e=>this.onMouseOver(e)}},k_.bind(this.input,this._events.input),k_.bind(this.input.form,this._events.form),k_.bind(this.ul,this._events.ul)}set list(e){if(Array.isArray(e)||"function"==typeof e)this._list=e;else if("string"==typeof e&&e.includes(","))this._list=e.split(/\s*,\s*/);else{var t;const n=(null===(t=k_.getElement(e))||void 0===t?void 0:t.children)||[];this._list=Array.from(n).filter((e=>!e.disabled)).map((e=>{const t=e.textContent.trim(),n=e.value||t,s=e.label||t;return""!==n?{label:s,value:n}:null})).filter((e=>e))}document.activeElement===this.input&&this.evaluate()}get list(){return this._list}get selected(){return this.index>-1}get opened(){return this.is_opened}close(e){this.opened&&(this.ul.setAttribute("hidden",""),this.is_opened=!1,this.index=-1,this.trigger("suggestion-box-close",e||{}))}insertValue(e){this.match_current_word?R_.replaceCurrentWord(this.input,e.value):this.input.value=e.value}open(){this.ul.removeAttribute("hidden"),this.is_opened=!0,this.auto_first&&-1===this.index&&this.goto(0),this.trigger("suggestion-box-open")}destroy(){k_.unbind(this.input,this._events.input),k_.unbind(this.input.form,this._events.form),this.input.removeAttribute("aria-autocomplete")}next(){const e=this.ul.children.length;this.goto(this.index<e-1?this.index+1:e?0:-1)}previous(){const e=this.ul.children.length,t=this.index-1;this.goto(this.selected&&-1!==t?t:e-1)}goto(e){const t=this.ul.children;this.selected&&t[this.index].setAttribute("aria-selected","false"),this.index=e,e>-1&&t.length>0&&(t[e].setAttribute("aria-selected","true"),t[e].focus(),this.status.textContent=t[e].textContent,this.ul.scrollTop=t[e].offsetTop-this.ul.clientHeight+t[e].clientHeight,this.trigger("suggestion-box-highlight",{text:this.suggestions[this.index]}))}select(e){if(e?this.index=R_.siblingIndex(e):e=this.ul.children[this.index],e){const e=this.suggestions[this.index];this.insertValue(e),this.close({reason:"select"}),this.auto_completing=!1,this.trigger("suggestion-box-selectcomplete",{text:e})}}onMouseOver(e){const t=R_.ancestor(e.target,"li");t&&this.goto(Array.prototype.slice.call(this.ul.children).indexOf(t))}onMouseDown(e){if(0!==e.button)return;const t=R_.ancestor(e.target,"li");t&&(e.preventDefault(),this.select(t,e.target))}onKeyDown(e){if(this.opened){if([Mc.keycodes.ENTER,Mc.keycodes.TAB].includes(e.keyCode)&&this.selected)return e.preventDefault(),e.stopPropagation(),this.select(),!0;if(e.keyCode===Mc.keycodes.ESCAPE)return this.close({reason:"esc"}),!0;if([Mc.keycodes.UP_ARROW,Mc.keycodes.DOWN_ARROW].includes(e.keyCode))return e.preventDefault(),e.stopPropagation(),this[e.keyCode===Mc.keycodes.UP_ARROW?"previous":"next"](),!0}if(![Mc.keycodes.SHIFT,Mc.keycodes.META,Mc.keycodes.META_RIGHT,Mc.keycodes.ESCAPE,Mc.keycodes.ALT].includes(e.keyCode))if(this.ac_triggers.includes(e.key))"Tab"===e.key&&e.preventDefault(),this.auto_completing=!0;else if("Backspace"===e.key){const t=R_.getCurrentWord(e.target,e.target.selectionEnd-1);k_.isMention(t,this.ac_triggers)&&(this.auto_completing=!0)}}async evaluate(e){const t=this.selected&&e&&(e.keyCode===Mc.keycodes.UP_ARROW||e.keyCode===Mc.keycodes.DOWN_ARROW);if(!this.auto_evaluate&&!this.auto_completing||t)return;const n="function"==typeof this._list?await this._list():this._list;if(0===n.length)return;let s=this.match_current_word?R_.getCurrentWord(this.input):this.input.value;const i=k_.isMention(s,this.ac_triggers);i&&(this.auto_completing=!0,this.include_triggers.includes(e.key)||(s=R_.isMentionBoundary(s[0])?s.slice("2"):s.slice("1"))),(i||s.length)&&s.length>=this.min_chars?(this.index=-1,this.ul.innerHTML="",this.suggestions=n.map((e=>new M_(this.data(e,s),s))).filter((e=>this.filter(e,s))),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.max_items),this.suggestions.forEach((e=>this.ul.appendChild(this.item(e,s)))),0===this.ul.children.length?this.close({reason:"nomatches"}):this.open()):(this.close({reason:"nomatches"}),i||(this.auto_completing=!1))}}Object.assign(D_.prototype,Hi);const z_=D_;function L_(){const e=(t=['\n <div class="suggestion-box suggestion-box__name">\n <ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>\n <input\n type="text"\n name="','"\n autocomplete="off"\n @keydown=',"\n @keyup=",'\n class="form-control suggestion-box__input"\n placeholder="','"\n />\n <span\n class="suggestion-box__additions visually-hidden"\n role="status"\n aria-live="assertive"\n aria-relevant="additions"\n ></span>\n </div>\n '],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return L_=function(){return e},e}function P_(){const e=B_(['<div class="alert alert-','" role="alert">',"</div>"]);return P_=function(){return e},e}function F_(){const e=B_(["\n <form @submit=",">\n ",'\n <fieldset class="form-group">\n <input type="hidden" name="command_node" value="','"/>\n <input type="hidden" name="command_jid" value="','"/>\n\n <p class="form-help">',"</p>\n ",'\n </fieldset>\n <fieldset>\n <input type="submit" class="btn btn-primary" value="','">\n <input type="button" class="btn btn-secondary button-cancel" value="','" @click=',">\n </fieldset>\n </form>\n "]);return F_=function(){return e},e}function B_(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function U_(){const e=(t=['\n <li class="room-item list-group-item">\n <div class="available-chatroom d-flex flex-row">\n <a class="open-room available-room w-100"\n @click=','\n data-command-node="','"\n data-command-jid="','"\n data-command-name="','"\n title="','"\n href="#">',"</a>\n </div>\n ","\n </li>\n"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return U_=function(){return e},e}Cc.elements.define("converse-autocomplete",class extends af{static get properties(){return{getAutoCompleteList:{type:Function},auto_evaluate:{type:Boolean},auto_first:{type:Boolean},filter:{type:String},include_triggers:{type:String},min_chars:{type:Number},name:{type:String},placeholder:{type:String},triggers:{type:String}}}constructor(){super(),this.auto_evaluate=!0,this.auto_first=!1,this.filter="contains",this.include_triggers="",this.match_current_word=!1,this.max_items=10,this.min_chars=1,this.triggers=""}render(){return Ha(L_(),this.name,this.onKeyDown,this.onKeyUp,this.placeholder)}firstUpdated(){this.auto_complete=new z_(this.firstElementChild,{ac_triggers:this.triggers.split(" "),auto_evaluate:this.auto_evaluate,auto_first:this.auto_first,filter:"contains"==this.filter?O_:T_,include_triggers:[],list:()=>this.getAutoCompleteList(),match_current_word:!0,max_items:this.max_items,min_chars:this.min_chars}),this.auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}onKeyDown(e){this.auto_complete.onKeyDown(e)}onKeyUp(e){this.auto_complete.evaluate(e)}}),n(6657),So.FILTER_CONTAINS=O_,So.FILTER_STARTSWITH=T_,So.AutoComplete=z_;function q_(){const e=lw(['<li class="list-group-item">',"</li>"]);return q_=function(){return e},e}function H_(){const e=lw(['<li class="list-group-item"> '," </li>"]);return H_=function(){return e},e}function $_(){const e=lw(['<div class="row"><div class="col pt-2"><p class="helptext pb-3">',"</p></div></div>"]);return $_=function(){return e},e}function G_(){const e=lw(['<input class="form-control" .value="','" @keyup=',' type="text" name="filter" placeholder="','"/>']);return G_=function(){return e},e}function V_(){const e=lw(['<li class="list-group-item">',"</li>"]);return V_=function(){return e},e}function W_(){const e=lw(['<li class="list-group-item">',"</li>"]);return W_=function(){return e},e}function J_(){const e=lw(['<li class="list-group-item"> '," </li>"]);return J_=function(){return e},e}function Q_(){const e=lw(['<div class="row"><div class="col pt-2"><p class="helptext pb-3">',"</p></div></div>"]);return Q_=function(){return e},e}function Y_(){const e=lw(['<input class="form-control" .value="','" @keyup=',' type="text" name="filter" placeholder="','"/>']);return Y_=function(){return e},e}function K_(){const e=lw(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="converse-modtools-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body d-flex flex-column">\n <span class="modal-alert"></span>\n\n ','\n\n <div class="tab-content">\n <div class="tab-pane tab-pane--columns ','" id="affiliations-tabpanel" role="tabpanel" aria-labelledby="affiliations-tab">\n <form class="converse-form query-affiliation" @submit=','>\n <p class="helptext pb-3">','</p>\n <div class="form-group">\n <label for="affiliation">\n <strong>',':</strong>\n </label>\n <div class="row">\n <div class="col">\n <select class="custom-select select-affiliation" name="affiliation">\n ','\n </select>\n </div>\n <div class="col">\n <input type="submit" class="btn btn-primary" name="users_with_affiliation" value="','"/>\n </div>\n </div>\n <div class="row">\n <div class="col mt-3">\n ',"\n </div>\n </div>\n\n ",'\n </div>\n </form>\n <div class="scrollable-container">\n <ul class="list-group list-group--users">\n ',"\n ","\n\n ",'\n </ul>\n </div>\n </div>\n\n <div class="tab-pane tab-pane--columns ','" id="roles-tabpanel" role="tabpanel" aria-labelledby="roles-tab">\n <form class="converse-form query-role" @submit=','>\n <p class="helptext pb-3">','</p>\n <div class="form-group">\n <label for="role"><strong>',':</strong></label>\n <div class="row">\n <div class="col">\n <select class="custom-select select-role" name="role">\n ','\n </select>\n </div>\n <div class="col">\n <input type="submit" class="btn btn-primary" name="users_with_role" value="','"/>\n </div>\n </div>\n <div class="row">\n <div class="col mt-3">\n ',"\n </div>\n </div>\n\n ",'\n </div>\n </form>\n <div class="scrollable-container">\n <ul class="list-group list-group--users">\n ',"\n ","\n ","\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>"]);return K_=function(){return e},e}function X_(){const e=lw(['\n <ul class="nav nav-pills justify-content-center">\n <li role="presentation" class="nav-item">\n <a class="nav-link active" id="affiliations-tab" href="#affiliations-tabpanel" aria-controls="affiliations-tabpanel" role="tab" data-toggle="tab" @click=','>Affiliations</a>\n </li>\n <li role="presentation" class="nav-item">\n <a class="nav-link" id="roles-tab" href="#roles-tabpanel" aria-controls="roles-tabpanel" role="tab" data-toggle="tab" @click=',">Roles</a>\n </li>\n </ul>\n"]);return X_=function(){return e},e}function Z_(){const e=lw(['<a href="#" data-form="affiliation-form" class="toggle-form right fa fa-wrench" @click=',"></a>"]);return Z_=function(){return e},e}function ew(){const e=lw(['\n <li class="list-group-item" data-nick="','">\n <ul class="list-group">\n <li class="list-group-item active">\n <div><strong>JID:</strong> ','</div>\n </li>\n <li class="list-group-item">\n <div><strong>Nickname:</strong> ','</div>\n </li>\n <li class="list-group-item">\n <div><strong>Affiliation:</strong> '," ","</div>\n ","\n </li>\n </ul>\n </li>\n"]);return ew=function(){return e},e}function tw(){const e=lw(['<option value="','" ?selected=',">","</option>"]);return tw=function(){return e},e}function nw(){const e=lw(['\n <form class="affiliation-form hidden" @submit=','>\n <div class="form-group">\n <input type="hidden" name="jid" value="','"/>\n <input type="hidden" name="nick" value="','"/>\n <div class="row">\n <div class="col">\n <label><strong>',':</strong></label>\n <select class="custom-select select-affiliation" name="affiliation">\n ','\n </select>\n </div>\n <div class="col">\n <label><strong>',':</strong></label>\n <input class="form-control" type="text" name="reason"/>\n </div>\n </div>\n </div>\n <div class="form-group">\n <input type="submit" class="btn btn-primary" name="change" value="','"/>\n </div>\n </form>\n ']);return nw=function(){return e},e}function sw(){const e=lw(['<a href="#" data-form="role-form" class="toggle-form right fa fa-wrench" @click=',"></a>"]);return sw=function(){return e},e}function iw(){const e=lw(['\n <li class="list-group-item" data-nick="','">\n <ul class="list-group">\n <li class="list-group-item active">\n <div><strong>JID:</strong> ','</div>\n </li>\n <li class="list-group-item">\n <div><strong>Nickname:</strong> ','</div>\n </li>\n <li class="list-group-item">\n <div><strong>Role:</strong> '," ","</div>\n ","\n </li>\n </ul>\n </li>\n"]);return iw=function(){return e},e}function rw(){const e=lw(['<option value="','" ?selected=',">","</option>"]);return rw=function(){return e},e}function ow(){const e=lw(['\n <form class="role-form hidden" @submit=','>\n <div class="form-group">\n <input type="hidden" name="jid" value="','"/>\n <input type="hidden" name="nick" value="','"/>\n <div class="row">\n <div class="col">\n <label><strong>',':</strong></label>\n <select class="custom-select select-role" name="role">\n ','\n </select>\n </div>\n <div class="col">\n <label><strong>',':</strong></label>\n <input class="form-control" type="text" name="reason"/>\n </div>\n </div>\n </div>\n <div class="form-group">\n <input type="submit" class="btn btn-primary" value="','"/>\n </div>\n </form>\n ']);return ow=function(){return e},e}function aw(){const e=lw(['\n <option value="','"\n ?selected=','\n title="','">',"</option>\n"]);return aw=function(){return e},e}function cw(){const e=lw(['\n <option value="','"\n ?selected=','\n title="','">',"</option>\n"]);return cw=function(){return e},e}function lw(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function uw(e){return"moderator"===e?Vu("Moderators are privileged users who can change the roles of other users (except those with admin or owner affiliations."):"participant"===e?Vu("The default role, implies that you can read and write messages."):"visitor"==e?Vu("Visitors aren't allowed to write messages in a moderated multi-user chat."):void 0}function dw(e){return"owner"===e?Vu("Owner is the highest affiliation. Owners can modify roles and affiliations of all other users."):"admin"===e?Vu("Admin is the 2nd highest affiliation. Admins can modify roles and affiliations of all other users except owners."):"outcast"===e?Vu('To ban a user, you give them the affiliation of "outcast".'):void 0}const hw=e=>{const t=Vu("Affiliation"),n=Vu("Moderator Tools"),s=Vu("No users with that affiliation found."),i=Vu("No users with that role found."),r=Vu("Type here to filter the search results"),o=Vu("Role"),a=Vu("Show users"),c=Vu("Roles are assigned to users to grant or deny them certain abilities in a multi-user chat. They're assigned either explicitly or implicitly as part of an affiliation. A role that's not due to an affiliation, is only valid for the duration of the user's session."),l=Vu("An affiliation is a long-lived entitlement which typically implies a certain role and which grants privileges and responsibilities. For example admins and owners automatically have the moderator role."),u=e.queryable_roles.length&&e.queryable_affiliations.length;return Ha(K_(),n,dg,u?(e=>Ha(X_(),e.switchTab,e.switchTab))(e):"",e.queryable_affiliations.length?"active":"",e.queryAffiliation,l,t,e.queryable_affiliations.map((t=>(e=>Ha(aw(),e.item||"",e.item===e.affiliation,dw(e.item),e.item))(Object.assign({item:t},e)))),a,Array.isArray(e.users_with_affiliation)&&e.users_with_affiliation.length>5?Ha(Y_(),e.affiliations_filter,e.filterAffiliationResults,r):"",dw(e.affiliation)?Ha(Q_(),dw(e.affiliation)):"",e.loading_users_with_affiliation?Ha(J_(),Zp()):"",Array.isArray(e.users_with_affiliation)&&0===e.users_with_affiliation.length?Ha(W_(),s):"",e.users_with_affiliation instanceof Error?Ha(V_(),e.users_with_affiliation.message):(e.users_with_affiliation||[]).map((t=>(t.nick||t.jid).match(new RegExp(e.affiliations_filter,"i"))?(e=>Ha(ew(),e.item.nick,e.item.jid,e.item.nick,e.item.affiliation,e.assignable_affiliations.length?Ha(Z_(),e.toggleForm):"",e.assignable_affiliations.length?(e=>{const t=Vu("Change affiliation"),n=Vu("New affiliation"),s=Vu("Reason");return Ha(nw(),e.assignAffiliation,e.item.jid,e.item.nick,n,e.assignable_affiliations.map((t=>Ha(tw(),t,t===e.item.affiliation,t))),s,t)})(e):""))(Object.assign({item:t},e)):"")),!u&&e.queryable_roles.length?"active":"",e.queryRole,c,o,e.queryable_roles.map((t=>(e=>Ha(cw(),e.item||"",e.item===e.role,uw(e.item),e.item))(Object.assign({item:t},e)))),a,Array.isArray(e.users_with_role)&&e.users_with_role.length>5?Ha(G_(),e.roles_filter,e.filterRoleResults,r):"",uw(e.role)?Ha($_(),uw(e.role)):"",e.loading_users_with_role?Ha(H_(),Zp()):"",e.users_with_role&&0===e.users_with_role.length?Ha(q_(),i):"",(e.users_with_role||[]).map((t=>t.nick.match(e.roles_filter)?(e=>Ha(iw(),e.item.nick,e.item.jid,e.item.nick,e.item.role,e.assignable_roles.length?Ha(sw(),e.toggleForm):"",e.assignable_roles.length?(e=>{const t=Vu("Change role"),n=Vu("New Role"),s=Vu("Reason");return Ha(ow(),e.assignRole,e.item.jid,e.item.nick,n,e.assignable_roles.map((t=>Ha(rw(),t,t===e.item.role,t))),s,t)})(e):""))(Object.assign({item:t},e)):"")))},{Strophe:fw,sizzle:gw}=Mc.env,mw=Mc.env.utils,pw=og.extend({id:"converse-modtools-modal",persistent:!0,initialize(e){this.muc=e.muc,og.prototype.initialize.apply(this,arguments),this.affiliations_filter="",this.roles_filter="",this.listenTo(this.model,"change:role",(()=>{this.users_with_role=this.muc.getOccupantsWithRole(this.model.get("role")),this.render()})),this.listenTo(this.model,"change:affiliation",(async()=>{this.loading_users_with_affiliation=!0,this.users_with_affiliation=null,this.render();const e=this.model.get("affiliation");if(this.shouldFetchAffiliationsList()){const t=this.muc.get("jid");this.users_with_affiliation=await hu(e,t)}else this.users_with_affiliation=this.muc.getOccupantsWithAffiliation(e);this.loading_users_with_affiliation=!1,this.render()}))},toHTML(){const e=this.muc.occupants.findWhere({jid:So.bare_jid});return hw(Object.assign(this.model.toJSON(),{affiliations_filter:this.affiliations_filter,assignAffiliation:e=>this.assignAffiliation(e),assignRole:e=>this.assignRole(e),assignable_affiliations:this.getAssignableAffiliations(e),assignable_roles:this.getAssignableRoles(e),filterAffiliationResults:e=>this.filterAffiliationResults(e),filterRoleResults:e=>this.filterRoleResults(e),loading_users_with_affiliation:this.loading_users_with_affiliation,queryAffiliation:e=>this.queryAffiliation(e),queryRole:e=>this.queryRole(e),queryable_affiliations:Tu.filter((e=>!So.modtools_disable_query.includes(e))),queryable_roles:Ou.filter((e=>!So.modtools_disable_query.includes(e))),roles_filter:this.roles_filter,switchTab:e=>this.switchTab(e),toggleForm:e=>this.toggleForm(e),users_with_affiliation:this.users_with_affiliation,users_with_role:this.users_with_role}))},getAssignableAffiliations(e){let t=Cc.settings.get("modtools_disable_assign");return Array.isArray(t)||(t=t?Tu:[]),"owner"===e.get("affiliation")?Tu.filter((e=>!t.includes(e))):"admin"===e.get("affiliation")?Tu.filter((e=>!["owner","admin",...t].includes(e))):[]},getAssignableRoles(e){let t=Cc.settings.get("modtools_disable_assign");return Array.isArray(t)||(t=t?Ou:[]),"moderator"===e.get("role")?Ou.filter((e=>!t.includes(e))):[]},shouldFetchAffiliationsList(){const e=this.model.get("affiliation");return"none"!==e&&!this.muc.occupants.getAutoFetchedAffiliationLists().includes(e)},toggleForm(e){e.stopPropagation(),e.preventDefault();const t=e.target.getAttribute("data-form"),n=mw.ancestor(e.target,".list-group-item").querySelector(".".concat(t));mw.hasClass("hidden",n)?mw.removeClass("hidden",n):mw.addClass("hidden",n)},filterRoleResults(e){this.roles_filter=e.target.value,this.render()},filterAffiliationResults(e){this.affiliations_filter=e.target.value,this.render()},queryRole(e){e.stopPropagation(),e.preventDefault();const t=new FormData(e.target).get("role");this.model.set({role:null},{silent:!0}),this.model.set({role:t})},queryAffiliation(e){e.stopPropagation(),e.preventDefault();const t=new FormData(e.target).get("affiliation");this.model.set({affiliation:null},{silent:!0}),this.model.set({affiliation:t})},async assignAffiliation(e){e.stopPropagation(),e.preventDefault();const t=new FormData(e.target),n=t.get("affiliation"),s={jid:t.get("jid"),reason:t.get("reason")},i=this.model.get("affiliation"),r=this.muc.get("jid");try{await gu(n,r,[s])}catch(e){return null===e?this.alert(Vu("Timeout error while trying to set the affiliation"),"danger"):gw('not-allowed[xmlns="'.concat(fw.NS.STANZAS,'"]'),e).length?this.alert(Vu("Sorry, you're not allowed to make that change"),"danger"):this.alert(Vu("Sorry, something went wrong while trying to set the affiliation"),"danger"),void as.error(e)}this.alert(Vu("Affiliation changed"),"primary"),await this.muc.occupants.fetchMembers(),this.model.set({affiliation:null},{silent:!0}),this.model.set({affiliation:i})},assignRole(e){e.stopPropagation(),e.preventDefault();const t=new FormData(e.target),n=this.muc.getOccupant(t.get("jid")||t.get("nick")),s=t.get("role"),i=t.get("reason"),r=this.model.get("role");this.muc.setRole(n,s,i,(()=>{this.alert(Vu("Role changed"),"primary"),this.model.set({role:null},{silent:!0}),this.model.set({role:r})}),(e=>{gw('not-allowed[xmlns="'.concat(fw.NS.STANZAS,'"]'),e).length?this.alert(Vu("You're not allowed to make that change"),"danger"):(this.alert(Vu("Sorry, something went wrong while trying to set the role"),"danger"),mw.isErrorObject(e)&&as.error(e))}))}});function vw(){const e=Cw(['<converse-muc-destroyed jid="','"></converse-muc-destroyed>']);return vw=function(){return e},e}function bw(){const e=Cw(['<converse-muc-disconnected jid="','"></converse-muc-disconnected>']);return bw=function(){return e},e}function yw(){const e=Cw(['<converse-muc-disconnected jid="','"></converse-muc-disconnected>']);return yw=function(){return e},e}function _w(){const e=Cw(['<converse-muc-chatarea jid="','"></converse-muc-chatarea>']);return _w=function(){return e},e}function ww(){const e=Cw(['<converse-muc-password-form class="muc-form-container" jid="','"></converse-muc-password-form>']);return ww=function(){return e},e}function Sw(){const e=Cw(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "]);return Sw=function(){return e},e}function xw(){const e=Cw(['<converse-muc-bookmark-form class="muc-form-container" jid="','"></converse-muc-bookmark-form>']);return xw=function(){return e},e}function Ew(){const e=Cw(['<converse-muc-config-form class="muc-form-container" jid="','"></converse-muc-config-form>']);return Ew=function(){return e},e}function jw(){const e=Cw(['<converse-muc-nickname-form jid="','"></converse-muc-nickname-form>']);return jw=function(){return e},e}function Aw(){const e=Cw(['<converse-muc-chatarea jid="','"></converse-muc-chatarea>']);return Aw=function(){return e},e}function Cw(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{Strophe:kw,$pres:Ow,$iq:Tw,sizzle:Nw,u:Iw}=Mc.env,Mw={admin:"admin",ban:"outcast",member:"member",owner:"owner",revoke:"none"},Rw={deop:"participant",kick:"none",mute:"visitor",op:"moderator",voice:"participant"};function Dw(e,t){t.querySelector("converse-rooms-list").model.save("muc_domain",kw.getDomainFromJid(e))}function zw(e){e.model.get("connected")&&(e.querySelector("converse-rooms-list").model.get("muc_domain")||(void 0===Cc.settings.get("muc_domain")?function(e){function t(t){t&&t.get("var")===kw.NS.MUC&&t.entity.getIdentity("conference","text").then((n=>{n&&Dw(t.get("from"),e)}))}Cc.waitUntil("discoInitialized").then((()=>{Cc.listen.on("serviceDiscovered",t),So.disco_entities.each((e=>t(e.features.findWhere({var:kw.NS.MUC}))))})).catch((e=>as.error(e)))}(e):Dw(Cc.settings.get("muc_domain"),e)))}function Lw(e,t){t=t.trim();const n=document.createElement("li");if(n.setAttribute("aria-selected","false"),Cc.settings.get("muc_mention_autocomplete_show_avatar")){const t=document.createElement("img");let s="data:"+So.DEFAULT_IMAGE_TYPE+";base64,"+So.DEFAULT_IMAGE;if(So.vcards){const t=So.vcards.findWhere({nickname:e});t&&(s="data:"+t.get("image_type")+";base64,"+t.get("image"))}t.setAttribute("src",s),t.setAttribute("width","22"),t.setAttribute("class","avatar avatar-autocomplete"),n.appendChild(t)}const s=new RegExp("("+t+")","ig");return(t?e.split(s):[e]).forEach((e=>{if(t&&e.match(s)){const t=document.createElement("mark");t.textContent=e,n.appendChild(t)}else n.appendChild(document.createTextNode(e))})),n}async function Pw(){const e=[...await Cc.rooms.get(),...await Cc.contacts.get()];return[...new Set(e.map((e=>kw.getDomainFromJid(e.get("jid")))))]}function Fw(e,t,n,s=[],i=[]){const r=Rw[t];if(!r)throw Error("ChatRoomView#setRole called with invalid command: ".concat(t));if(!e.verifyAffiliations(s)||!e.verifyRoles(i))return!1;if(!e.validateRoleOrAffiliationChangeArgs(t,n))return!1;const o=e.getNickOrJIDFromCommandArgs(n);if(!o)return!1;const a=n.split(o,2)[1].trim(),c=e.getOccupant(o);return e.setRole(c,r,a,void 0,(t=>e.onCommandError(t))),!0}function Bw(e,t,n,s){const i=Mw[t];if(!i)throw Error("verifyAffiliations called with invalid command: ".concat(t));if(!e.verifyAffiliations(s))return!1;if(!e.validateRoleOrAffiliationChangeArgs(t,n))return!1;const r=e.getNickOrJIDFromCommandArgs(n);if(!r)return!1;let o;const a=n.split(r,2)[1].trim(),c=e.getOccupant(r);if(c)o=c.get("jid");else{if(!Iw.isValidJID(r)){const t=Vu("Couldn't find a participant with that nickname. They might have left the groupchat.");return void e.createMessage({message:t,type:"error"})}o=r}const l={jid:o,reason:a};c&&Cc.settings.get("auto_register_muc_nickname")&&(l.nick=c.get("nick")),gu(i,e.get("jid"),[l]).then((()=>e.occupants.fetchMembers())).catch((t=>e.onCommandError(t)))}function Uw(e,t){if(!e.verifyRoles(["moderator"]))return;let n=Cc.modal.get(pw.id);if(n)n.model.set({affiliation:t});else{const s=new ao({affiliation:t});n=Cc.modal.create(pw,{model:s,muc:e})}n.show()}function qw(){const e=Gw(['\n <fieldset class="form-group">\n <ul class="list-group">\n <li class="list-group-item active">',":</li>\n ","\n </ul>\n </fieldset>"]);return qw=function(){return e},e}function Hw(){const e=Gw(['<div class="alert alert-','" role="alert">',"</div>"]);return Hw=function(){return e},e}function $w(){const e=Gw(["\n ",'\n <form class="converse-form" @submit=','>\n <fieldset class="form-group">\n <label>\n ','\n <p class="form-help">','</p>\n <converse-autocomplete\n .getAutoCompleteList="','"\n placeholder="','"\n name="jid"/>\n </label>\n </fieldset>\n <fieldset class="form-group">\n <input type="submit" class="btn btn-primary" value="','">\n </fieldset>\n ',"\n\n </form>\n "]);return $w=function(){return e},e}function Gw(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{Strophe:Vw,$iq:Ww,sizzle:Jw,u:Qw}=Mc.env;function Yw(){const e=Xw(['<div class="new-msgs-indicator" @click=',">▼ "," ▼</div>"]);return Yw=function(){return e},e}function Kw(){const e=Xw(["\n ",'\n <form class="setNicknameButtonForm hidden">\n <input type="submit" class="btn btn-primary" name="join" value="Join"/>\n </form>\n <form class="sendXMPPMessage">\n <input type="text" placeholder="','" value="','" class="',' spoiler-hint"/>\n <div class="suggestion-box">\n <ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>\n <textarea\n autofocus\n type="text"\n @drop=',"\n @input=","\n @keydown=","\n @keyup=","\n @paste=","\n @change=",'\n class="chat-textarea suggestion-box__input\n ',"\n ",'"\n placeholder="','">','</textarea>\n <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span>\n </div>\n </form>']);return Kw=function(){return e},e}function Xw(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Zw(){const e=(t=['\n <div class="chatroom-form-container muc-nickname-form"\n @submit=','>\n <form class="converse-form chatroom-form converse-centered-form">\n <fieldset class="form-group">\n <label>','</label>\n <p class="validation-message">','</p>\n <input type="text"\n required="required"\n name="nick"\n value="','"\n class="form-control ','"\n placeholder="','"/>\n </fieldset>\n <fieldset class="form-group">\n <input type="submit" class="btn btn-primary" name="join" value="','"/>\n </fieldset>\n </form>\n </div>'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Zw=function(){return e},e}Cc.elements.define("converse-adhoc-commands",class extends af{static get properties(){return{alert:{type:String},alert_type:{type:String},nonce:{type:String},showform:{type:String},view:{type:String}}}constructor(){super(),this.view="choose-service",this.showform="",this.commands=[]}render(){return(e=>{const t=Vu("On which entity do you want to run commands?"),n=Vu("Certain XMPP services and entities allow privileged users to execute ad-hoc commands on them."),s=Vu("Commands found"),i=Vu("List available commands"),r=Vu("XMPP Address"),o=Vu("No commands found");return Ha($w(),e.alert?Ha(Hw(),e.alert_type,e.alert):"",e.fetchCommands,t,n,Pw,r,i,"list-commands"===e.view?Ha(qw(),e.commands.length?s:o,e.commands.map((t=>((e,t)=>Ha(U_(),e.toggleCommandForm,t.node,t.jid,t.name,t.name,t.name||t.jid,t.node===e.showform?((e,t)=>{const n=Vu("Hide"),s=Vu("Execute");return Ha(F_(),e.runCommand,t.alert?Ha(P_(),t.alert_type,t.alert):"",t.node,t.jid,t.instructions,t.fields,s,n,e.hideCommandForm)})(e,t):""))(e,t)))):"")})({alert:this.alert,alert_type:this.alert_type,commands:this.commands,fetchCommands:e=>this.fetchCommands(e),hideCommandForm:e=>this.hideCommandForm(e),runCommand:e=>this.runCommand(e),showform:this.showform,toggleCommandForm:e=>this.toggleCommandForm(e),view:this.view})}async fetchCommands(e){e.preventDefault(),delete this.alert_type,delete this.alert;const t=new FormData(e.target).get("jid").trim();let n;try{n=await Cc.disco.supports(Vw.NS.ADHOC,t)}catch(e){as.error(e)}if(n)try{this.commands=await Cc.adhoc.getCommands(t),this.view="list-commands"}catch(e){return as.error(e),this.alert_type="danger",this.alert=Vu("Sorry, an error occurred while looking for commands on that entity."),this.commands=[],void as.error(e)}else this.alert_type="danger",this.alert=Vu("The specified entity doesn't support ad-hoc commands")}async toggleCommandForm(e){e.preventDefault();const t=e.target.getAttribute("data-command-node"),n=this.commands.filter((e=>e.node===t))[0];this.showform!==t&&await async function(e){const t=e.node,n=e.jid,s=Tw({type:"set",to:n}).c("command",{xmlns:kw.NS.ADHOC,node:t,action:"execute"});try{var i;const t=await Cc.sendIQ(s),n=Nw('command[xmlns="'.concat(kw.NS.ADHOC,'"]'),t).pop();e.sessionid=n.getAttribute("sessionid"),e.instructions=null===(i=Nw('x[type="form"][xmlns="jabber:x:data"] instructions',n).pop())||void 0===i?void 0:i.textContent,e.fields=Nw('x[type="form"][xmlns="jabber:x:data"] field',n).map((e=>Iw.xForm2TemplateResult(e,n)))}catch(t){null===t?as.error("Error: timeout while trying to execute command for ".concat(n)):(as.error("Error while trying to execute command for ".concat(n)),as.error(t)),e.fields=[]}}(n),this.showform=t}hideCommandForm(e){e.preventDefault(),this.showform=""}async runCommand(e){e.preventDefault();const t=new FormData(e.target),n=t.get("command_jid").trim(),s=t.get("command_node").trim(),i=this.commands.filter((e=>e.node===s))[0];i.alert=null,this.nonce=Qw.getUniqueId();const r=Jw(":input:not([type=button]):not([type=submit])",e.target).filter((e=>!["command_jid","command_node"].includes(e.getAttribute("name")))).map(Qw.webForm2xForm).filter((e=>e)),o=Ww({to:n,type:"set"}).c("command",{sessionid:i.sessionid,node:i.node,xmlns:Vw.NS.ADHOC}).c("x",{xmlns:Vw.NS.XFORM,type:"submit"});let a;r.forEach((e=>o.cnode(e).up()));try{a=await Cc.sendIQ(o)}catch(e){i.alert_type="danger",i.alert=Vu("Sorry, an error occurred while trying to execute the command. See the developer console for details"),as.error("Error while trying to execute an ad-hoc command"),as.error(e)}var c;i.alert=a?null===(c=a.querySelector("note"))||void 0===c?void 0:c.textContent:"Done",i.alert_type="primary",this.nonce=Qw.getUniqueId()}}),Cc.elements.define("converse-muc-message-form",class extends Nb{toHTML(){var e,t;return(e=>{const t=Vu("You have unread messages"),n=e.composing_spoiler?Vu("Hidden message"):Vu("Message"),s=Vu("Optional hint"),i=Cc.settings.get("show_send_button");return Ha(Kw(),e.scrolled&&e.num_unread?Ha(Yw(),(t=>e.viewUnreadMessages(t)),t):"",s||"",e.hint_value||"",e.composing_spoiler?"":"hidden",e.onDrop,Cb,e.onKeyDown,e.onKeyUp,e.onPaste,e.onChange,i?"chat-textarea-send-button":"",e.composing_spoiler?"spoiler":"",n,e.message_value||"")})(Object.assign(this.model.toJSON(),{onDrop:e=>this.onDrop(e),hint_value:null===(e=this.querySelector(".spoiler-hint"))||void 0===e?void 0:e.value,message_value:null===(t=this.querySelector(".chat-textarea"))||void 0===t?void 0:t.value,onChange:e=>this.model.set({draft:e.target.value}),onKeyDown:e=>this.onKeyDown(e),onKeyUp:e=>this.onKeyUp(e),onPaste:e=>this.onPaste(e),viewUnreadMessages:e=>this.viewUnreadMessages(e)}))}afterRender(){const e=this.model.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED,t=e&&!(this.model.features.get("moderated")&&"visitor"===this.model.getOwnRole());e&&t&&this.initMentionAutoComplete()}initMentionAutoComplete(){this.mention_auto_complete=new So.AutoComplete(this,{auto_first:!0,auto_evaluate:!1,min_chars:Cc.settings.get("muc_mention_autocomplete_min_chars"),match_current_word:!0,list:()=>this.getAutoCompleteList(),filter:"contains"==Cc.settings.get("muc_mention_autocomplete_filter")?So.FILTER_CONTAINS:So.FILTER_STARTSWITH,ac_triggers:["Tab","@"],include_triggers:[],item:Lw}),this.mention_auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}parseMessageForCommands(e){return function(e,t){if(Cc.settings.get("muc_disable_slash_commands")&&!Array.isArray(Cc.settings.get("muc_disable_slash_commands")))return Ab(e,t);const n=((t=t.replace(/^\s*/,"")).match(/^\/([a-zA-Z]*) ?/)||[""]).pop().toLowerCase();if(!n)return!1;const s=t.slice(("/"+n).length+1).trim();if(!e.getAllowedCommands().includes(n))return!1;switch(n){case"admin":Bw(e,n,s,["owner"]);break;case"ban":Bw(e,n,s,["admin","owner"]);break;case"modtools":Uw(e,s);break;case"deop":Fw(e,n,s,["admin","owner"]);break;case"destroy":if(!e.verifyAffiliations(["owner"]))break;So.chatboxviews.get(e.get("jid")).destroy().catch((t=>e.onCommandError(t)));break;case"help":e.set({show_help_messages:!1},{silent:!0}),e.set({show_help_messages:!0});break;case"kick":case"mute":Fw(e,n,s,[],["moderator"]);break;case"member":Bw(e,n,s,["admin","owner"]);break;case"nick":if(!e.verifyRoles(["visitor","participant","moderator"]))break;if(0===s.length){const t=Vu('Your nickname is "%1$s"',e.get("nick"));e.createMessage({message:t,type:"error"})}else{const t=kw.getBareJidFromJid(e.get("jid"));Cc.send(Ow({from:So.connection.jid,to:"".concat(t,"/").concat(s),id:Iw.getUniqueId()}).tree())}break;case"owner":Bw(e,n,s,["owner"]);break;case"op":Fw(e,n,s,["admin","owner"]);break;case"register":s.length>1?e.createMessage({message:Vu("Error: invalid number of arguments"),type:"error"}):e.registerNickname().then((t=>{t&&e.createMessage({message:t,type:"error"})}));break;case"revoke":Bw(e,n,s,["admin","owner"]);break;case"topic":case"subject":e.setSubject(s);break;case"voice":Fw(e,n,s,[],["moderator"]);break;default:return Ab(e,t)}return!0}(this.model,e)}getAutoCompleteList(){return this.model.getAllKnownNicknames().map((e=>({label:e,value:"@".concat(e)})))}onKeyDown(e){this.mention_auto_complete.onKeyDown(e)||super.onKeyDown(e)}onKeyUp(e){this.mention_auto_complete.evaluate(e),super.onKeyUp(e)}});const eS=e=>{const t=Vu("Nickname"),n=Vu("Enter groupchat"),s=Cc.settings.get("muc_show_logs_before_join")?Vu("Choose a nickname to enter"):Vu("Please choose your nickname"),i=e.get("nickname_validation_message");return Ha(Zw(),(t=>function(e,t){e.preventDefault();const n=e.target.nick.value.trim();n&&t.join(n)}(t,e)),s,i,e.get("nick")||"",i?"error":"",t,n)};function tS(){const e=aS(['<span class="muc-bottom-panel muc-bottom-panel--nickname">',"</span>"]);return tS=function(){return e},e}function nS(){const e=aS(['<span class="muc-bottom-panel muc-bottom-panel--muted">',"</span>"]);return nS=function(){return e},e}function sS(){const e=aS(['<div class="new-msgs-indicator" @click=',">▼ "," ▼</div>"]);return sS=function(){return e},e}function iS(){const e=aS(["\n ","\n ",""]);return iS=function(){return e},e}function rS(){const e=aS(['\n <converse-chat-toolbar\n class="chat-toolbar no-text-select"\n .model=','\n ?composing_spoiler="','"\n ?hidden_occupants="','"\n ?is_groupchat="','"\n ?show_call_button="','"\n ?show_emoji_button="','"\n ?show_occupants_toggle="','"\n ?show_send_button="','"\n ?show_spoiler_button="','"\n ?show_toolbar="','"\n message_limit="','"></converse-chat-toolbar>']);return rS=function(){return e},e}function oS(){const e=aS(["\n ","\n <converse-muc-message-form jid=","></converse-muc-message-form>"]);return oS=function(){return e},e}function aS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function cS(){const e=gS(['<span class="badge badge-secondary">',"</span>"]);return cS=function(){return e},e}function lS(){const e=gS(['<span class="badge badge-info">',"</span>"]);return lS=function(){return e},e}function uS(){const e=gS(['<span class="badge badge-info">',"</span>"]);return uS=function(){return e},e}function dS(){const e=gS(['<span class="badge badge-info">',"</span>"]);return dS=function(){return e},e}function hS(){const e=gS(['<span class="badge badge-groupchat">',"</span>"]);return hS=function(){return e},e}function fS(){const e=gS(['\n <li class="occupant" id="','" title="','">\n <div class="row no-gutters">\n <div class="col-auto">\n <div class="occupant-status occupant-',' circle" title="','"></div>\n </div>\n <div class="col occupant-nick-badge">\n <span class="occupant-nick" @click=',">",'</span>\n <span class="occupant-badges">\n ',"\n ","\n ","\n ","\n ","\n </span>\n </div>\n </div>\n </li>\n "]);return fS=function(){return e},e}function gS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n(5921),Cc.elements.define("converse-muc-bottom-panel",class extends zb{constructor(...e){var t,n,s;super(...e),s={"click .hide-occupants":"hideOccupants","click .send-button":"sendButtonClicked"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}async connectedCallback(){await super.connectedCallback(),this.debouncedRender=Oo(this.render,100),this.listenTo(this.model,"change:hidden_occupants",this.debouncedRender),this.listenTo(this.model,"change:num_unread_general",this.debouncedRender),this.listenTo(this.model.features,"change:moderated",this.debouncedRender),this.listenTo(this.model.occupants,"add",this.renderIfOwnOccupant),this.listenTo(this.model.occupants,"change:role",this.renderIfOwnOccupant),this.listenTo(this.model.session,"change:connection_status",this.debouncedRender),this.render()}render(){const e=this.model.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED,t=e&&!(this.model.features.get("moderated")&&"visitor"===this.model.getOwnRole());Wa((e=>{const t=Vu("You have unread messages"),n=e.model.session.get("connection_status"),s=Vu("You're not allowed to send messages in this room");return n===Mc.ROOMSTATUS.ENTERED?Ha(iS(),e.model.get("scrolled")&&e.model.get("num_unread_general")?Ha(sS(),(t=>e.viewUnreadMessages(t)),t):"",e.can_edit?(e=>{const t=Cc.settings.get("message_limit"),n=Cc.settings.get("visible_toolbar_buttons").call,s=Cc.settings.get("visible_toolbar_buttons").emoji,i=Cc.settings.get("show_send_button"),r=Cc.settings.get("visible_toolbar_buttons").spoiler,o=Cc.settings.get("show_toolbar");return Ha(oS(),o?Ha(rS(),e.model,e.model.get("composing_spoiler"),e.model.get("hidden_occupants"),e.model.get("is_groupchat"),n,s,e.model.get("show_occupants_toggle"),i,r,o,t):"",e.model.get("jid"))})(e):Ha(nS(),s)):n!=Mc.ROOMSTATUS.NICKNAME_REQUIRED?"":Cc.settings.get("muc_show_logs_before_join")?Ha(tS(),eS(e.model)):void 0})({can_edit:t,entered:e,model:this.model,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}renderIfOwnOccupant(e){e.get("jid")===So.bare_jid&&this.debouncedRender()}sendButtonClicked(e){var t;null===(t=this.querySelector("converse-message-form"))||void 0===t||t.onFormSubmitted(e)}getToolbarOptions(){return Object.assign(super.getToolbarOptions(),{is_groupchat:!0,label_hide_occupants:Vu("Hide the list of participants"),show_occupants_toggle:Cc.settings.get("visible_toolbar_buttons").toggle_occupants})}hideOccupants(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.save({hidden_occupants:!0})}});function mS(){const e=(t=['\n <div class="occupants-header">\n <i class="hide-occupants fa fa-times" @click=','></i>\n <div class="occupants-header--title">\n <span class="occupants-heading">','</span>\n </div>\n </div>\n <div class="dragresize dragresize-occupants-left"></div>\n <ul class="occupant-list">',"</ul>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return mS=function(){return e},e}const pS={offline:"Offline",unavailable:"Unavailable",xa:"Extended Away",away:"Away",dnd:"Do not disturb",chat:"Chattty",online:"Online"};n(5660);const{u:vS}=Mc.env;function bS(){const e=_S(['<div class="chat-content__help">\n <converse-chat-help\n .model=',"\n .messages=","\n ?hidden=",'\n type="info"\n chat_type="','"\n ></converse-chat-help></div>']);return bS=function(){return e},e}function yS(){const e=_S(['\n <div class="chat-area">\n <div class="chat-content ','" aria-live="polite">\n <converse-chat-content\n class="chat-content__messages"\n jid="','"></converse-chat-content>\n\n ','\n </div>\n <converse-muc-bottom-panel jid="','" class="bottom-panel"></converse-muc-bottom-panel>\n </div>\n <div class="disconnect-container hidden"></div>\n <converse-muc-sidebar\n class="occupants col-md-3 col-4 ','"\n style="flex: 0 0 ','px"\n jid=',"\n @mousedown=","></converse-muc-sidebar>\n"]);return yS=function(){return e},e}function _S(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-muc-sidebar",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid),this.listenTo(this.model.occupants,"add",this.requestUpdate),this.listenTo(this.model.occupants,"remove",this.requestUpdate),this.listenTo(this.model.occupants,"change",this.requestUpdate),this.model.initialized.then((()=>this.requestUpdate()))}render(){return(e=>{const t=e=>Vu("Click to mention %1$s in your message.",e.get("nick")),n=Vu("Participants"),s=e.occupants.map((n=>(e=>{const t=Vu("Owner"),n=Vu("Admin"),s=Vu("Member"),i=Vu("Moderator"),r=Vu("Visitor");return Ha(fS(),e.id,(e=>{const t=Vu("This user is a moderator."),n=Vu("This user can send messages in this groupchat."),s=Vu("This user can NOT send messages in this groupchat."),i="".concat(e.jid," ")||0;return"moderator"===e.role?"".concat(i).concat(t," ").concat(e.hint_occupant):"participant"===e.role?"".concat(i).concat(n," ").concat(e.hint_occupant):"visitor"===e.role?"".concat(i).concat(s," ").concat(e.hint_occupant):["visitor","participant","moderator"].includes(e.role)?void 0:"".concat(i).concat(e.hint_occupant)})(e),e.show,e.hint_show,e.onOccupantClicked,e.nick||e.jid,"owner"===e.affiliation?Ha(hS(),t):"","admin"===e.affiliation?Ha(dS(),n):"","member"===e.affiliation?Ha(uS(),s):"","moderator"===e.role?Ha(lS(),i):"","visitor"===e.role?Ha(cS(),r):"")})(Object.assign({jid:"",hint_show:pS[n.get("show")],hint_occupant:t(n),onOccupantClicked:e.onOccupantClicked},n.toJSON()))));return Ha(mS(),e.closeSidebar,n,s)})(Object.assign(this.model.toJSON(),{occupants:[...this.model.occupants.models],closeSidebar:e=>this.closeSidebar(e),onOccupantClicked:e=>this.onOccupantClicked(e)}))}closeSidebar(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),vS.safeSave(this.model,{hidden_occupants:!0})}onOccupantClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=So.chatboxviews.get(this.getAttribute("jid"));null==n||n.getBottomPanel().insertIntoTextArea("@".concat(e.target.textContent))}});const{u:wS}=Mc.env;function SS(){const e=jS(['\n <fieldset>\n <input type="submit" class="btn btn-primary" value="','">\n <input type="button" class="btn btn-secondary button-cancel" value="','" @click=',">\n </fieldset>"]);return SS=function(){return e},e}function xS(){const e=jS(['<p class="form-help">',"</p>"]);return xS=function(){return e},e}function ES(){const e=jS(['\n <form class="converse-form chatroom-form ','"\n autocomplete="off"\n @submit=','>\n\n <fieldset class="form-group">\n <legend class="centered">',"</legend>\n ","\n ","\n </fieldset>\n ","\n </form>\n "]);return ES=function(){return e},e}function jS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-muc-chatarea",class extends af{static get properties(){return{jid:{type:String},show_help_messages:{type:Boolean},type:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid),this.listenTo(this.model,"change:show_help_messages",(()=>this.requestUpdate())),this.listenTo(this.model,"change:hidden_occupants",(()=>this.requestUpdate())),this.listenTo(this.model.session,"change:connection_status",(()=>this.requestUpdate())),this.onMouseMove=this._onMouseMove.bind(this),this.onMouseUp=this._onMouseUp.bind(this)}render(){return(e=>Ha(yS(),e.show_send_button?"chat-content-sendbutton":"",e.jid,e.show_help_messages?Ha(bS(),e.model,e.help_messages,!e.show_help_messages,So.CHATROOMS_TYPE):"",e.jid,e.show_sidebar?"":"hidden",e.occupants_width,e.jid,e.onMousedown))({help_messages:this.getHelpMessages(),jid:this.jid,model:this.model,occupants:this.model.occupants,occupants_width:this.model.get("occupants_width"),onMousedown:e=>this.onMousedown(e),show_help_messages:this.model.get("show_help_messages"),show_send_button:So.show_send_button,show_sidebar:this.shouldShowSidebar(),type:this.type})}shouldShowSidebar(){return!this.model.get("hidden_occupants")&&this.model.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED}getHelpMessages(){const e=Cc.settings.get("muc_disable_slash_commands"),t=Array.isArray(e)?e:[];return["<strong>/admin</strong>: ".concat(Vu("Change user's affiliation to admin")),"<strong>/ban</strong>: ".concat(Vu("Ban user by changing their affiliation to outcast")),"<strong>/clear</strong>: ".concat(Vu("Clear the chat area")),"<strong>/close</strong>: ".concat(Vu("Close this groupchat")),"<strong>/deop</strong>: ".concat(Vu("Change user role to participant")),"<strong>/destroy</strong>: ".concat(Vu("Remove this groupchat")),"<strong>/help</strong>: ".concat(Vu("Show this menu")),"<strong>/kick</strong>: ".concat(Vu("Kick user from groupchat")),"<strong>/me</strong>: ".concat(Vu("Write in 3rd person")),"<strong>/member</strong>: ".concat(Vu("Grant membership to a user")),"<strong>/modtools</strong>: ".concat(Vu("Opens up the moderator tools GUI")),"<strong>/mute</strong>: ".concat(Vu("Remove user's ability to post messages")),"<strong>/nick</strong>: ".concat(Vu("Change your nickname")),"<strong>/op</strong>: ".concat(Vu("Grant moderator role to user")),"<strong>/owner</strong>: ".concat(Vu("Grant ownership of this groupchat")),"<strong>/register</strong>: ".concat(Vu("Register your nickname")),"<strong>/revoke</strong>: ".concat(Vu("Revoke the user's current affiliation")),"<strong>/subject</strong>: ".concat(Vu("Set groupchat subject")),"<strong>/topic</strong>: ".concat(Vu("Set groupchat subject (alias for /subject)")),"<strong>/voice</strong>: ".concat(Vu("Allow muted user to post messages"))].filter((e=>t.every((t=>!e.startsWith(t+"<",9))))).filter((e=>this.model.getAllowedCommands().some((t=>e.startsWith(t+"<",9)))))}onMousedown(e){wS.hasClass("dragresize-occupants-left",e.target)&&this.onStartResizeOccupants(e)}onStartResizeOccupants(e){this.resizing=!0,this.addEventListener("mousemove",this.onMouseMove),this.addEventListener("mouseup",this.onMouseUp);const t=this.querySelector("converse-muc-sidebar"),n=window.getComputedStyle(t);this.width=parseInt(n.width.replace(/px$/,""),10),this.prev_pageX=e.pageX}_onMouseMove(e){if(this.resizing){e.preventDefault();const t=this.prev_pageX-e.pageX;this.resizeSidebarView(t,e.pageX),this.prev_pageX=e.pageX}}_onMouseUp(e){if(this.resizing){e.preventDefault(),this.resizing=!1,this.removeEventListener("mousemove",this.onMouseMove),this.removeEventListener("mouseup",this.onMouseUp);const t=this.querySelector("converse-muc-sidebar").getBoundingClientRect(),n=this.calculateSidebarWidth(t,0);wS.safeSave(this.model,{occupants_width:n})}}calculateSidebarWidth(e,t){let n=e.width+t;const s=this.clientWidth;return n<.2*s?(n=.2*s,this.is_minimum=!0):n>.75*s?(n=.75*s,this.is_maximum=!0):s-n<250?(n=s-250,this.is_maximum=!0):(this.is_maximum=!1,this.is_minimum=!1),n}resizeSidebarView(e,t){const n=this.querySelector("converse-muc-sidebar"),s=n.getBoundingClientRect();if(this.is_minimum)this.is_minimum=s.left<t;else if(this.is_maximum)this.is_maximum=s.left>t;else{const t=this.calculateSidebarWidth(s,e);n.style.flex="0 0 "+t+"px"}}});const{sizzle:AS}=Mc.env,CS=Mc.env.utils,{sizzle:kS}=Mc.env,OS=Mc.env.utils;function TS(){const e=MS(['<p class="destroyed-reason">',"</p>"]);return TS=function(){return e},e}function NS(){const e=MS(['\n <div class="alert alert-danger">\n <h3 class="alert-heading disconnect-msg">',"</h3>\n </div>\n ","\n ","\n "]);return NS=function(){return e},e}function IS(){const e=MS(['\n <p class="moved-label">','</p>\n <p class="moved-link">\n <a class="switch-chat" @click=',">","</a>\n </p>"]);return IS=function(){return e},e}function MS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-muc-config-form",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid),this.listenTo(this.model.features,"change:passwordprotected",this.requestUpdate),this.listenTo(this.model.session,"change:config_stanza",this.requestUpdate),this.getConfig()}render(){return(e=>{const t=Cc.settings.get("roomconfig_whitelist"),n=e.model.session.get("config_stanza");let s,i=[],r="";if(n){var o,a;const c=CS.toStanza(n);i=AS("field",c),t.length&&(i=i.filter((e=>t.includes(e.getAttribute("var")))));const l={new_password:!e.model.features.get("passwordprotected"),fixed_username:e.model.get("jid")};i=i.map((e=>CS.xForm2TemplateResult(e,c,l))),r=null===(o=c.querySelector("instructions"))||void 0===o?void 0:o.textContent,s=null===(a=c.querySelector("title"))||void 0===a?void 0:a.textContent}else s=Vu("Loading configuration form");const c=Vu("Save"),l=Vu("Cancel");return Ha(ES(),i.length?"":"converse-form--spinner",e.submitConfigForm,s,s!==r?Ha(xS(),r):"",i.length?i:Zp({classes:"hor_centered"}),i.length?Ha(SS(),c,l,e.closeConfigForm):"")})({model:this.model,closeConfigForm:e=>this.closeForm(e),submitConfigForm:e=>this.submitConfigForm(e)})}async getConfig(){const e=await this.model.fetchRoomConfiguration();this.model.session.set("config_stanza",e.outerHTML)}async submitConfigForm(e){e.preventDefault();const t=kS(":input:not([type=button]):not([type=submit])",e.target).map(OS.webForm2xForm).filter((e=>e));try{await this.model.sendConfiguration(t)}catch(e){as.error(e);const t=Vu("Sorry, an error occurred while trying to submit the config form.")+" "+Vu("Check your browser's developer console for details.");Cc.alert("error",Vu("Error"),t)}await this.model.refreshDiscoInfo(),this.closeForm()}closeForm(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.session.set("view",null)}});function RS(){const e=zS(['<p class="disconnect-msg">',"</p>"]);return RS=function(){return e},e}function DS(){const e=zS(['\n <div class="alert alert-danger">\n <h3 class="alert-heading disconnect-msg">',"</h3>\n ","\n </div>"]);return DS=function(){return e},e}function zS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function LS(){const e=FS(['<div class="error error-feedback">',"</div>"]);return LS=function(){return e},e}function PS(){const e=FS(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="add-chatroom-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n <div class="suggestion-box room-invite">\n <form @submit=','>\n <div class="form-group">\n <label class="clearfix" for="invitee_jids">',":</label>\n ",'\n <input class="form-control suggestion-box__input"\n required="required"\n name="invitee_jids"\n id="invitee_jids"\n placeholder="','"\n type="text"/>\n <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span>\n <ul class="suggestion-box__results suggestion-box__results--below" hidden=""></ul>\n </div>\n <div class="form-group">\n <label>',':</label>\n <textarea class="form-control" name="reason"></textarea>\n </div>\n <div class="form-group">\n <button type="submit" class="btn btn-primary">',"</button>\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n "]);return PS=function(){return e},e}function FS(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-muc-destroyed",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid)}render(){const e=this.model.get("destroyed_reason");return(e=>{const t=Vu("This groupchat no longer exists"),n=Vu('The following reason was given: "%1$s"',e.reason||"");return Ha(NS(),t,e.reason?Ha(TS(),n):"",e.moved_jid?(e=>{const t=Vu("The conversation has moved to a new address. Click the link below to enter.");return Ha(IS(),t,(t=>e.onSwitch(t)),e.moved_jid)})(e):"")})({moved_jid:this.model.get("moved_jid"),reason:e,onSwitch:e=>this.onSwitch(e)})}async onSwitch(e){e.preventDefault();const t=this.model.get("moved_jid");(await Cc.rooms.get(t,{},!0)).maybeShow(!0),this.model.destroy()}}),Cc.elements.define("converse-muc-disconnected",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid)}render(){const e=this.model.session.get("disconnection_message");if(!e)return;const t=[e],n=this.model.session.get("disconnection_actor");n&&t.push(Vu("This action was done by %1$s.",n));const s=this.model.session.get("disconnection_reason");return s&&t.push(Vu('The reason given is: "%1$s".',s)),(e=>Ha(DS(),e[0],e.slice(1).map((e=>Ha(RS(),e)))))(t)}});const BS=Mc.env.utils,US=og.extend({id:"muc-invite-modal",initialize(){og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.initInviteWidget()},toHTML(){return(e=>{const t=Vu("Invite"),n=Vu("Invite someone to this groupchat"),s=Vu("user@example.org"),i=Vu("Please enter a valid XMPP address"),r=Vu("XMPP Address"),o=Vu("Optional reason for the invitation");return Ha(PS(),n,dg,e.submitInviteForm,r,e.invalid_invite_jid?Ha(LS(),i):"",s,o,t)})(Object.assign(this.model.toJSON(),{submitInviteForm:e=>this.submitInviteForm(e)}))},initInviteWidget(){this.invite_auto_complete&&this.invite_auto_complete.destroy();const e=So.roster.map((e=>({label:e.getDisplayName(),value:e.get("jid")}))),t=this.el.querySelector(".suggestion-box").parentElement;this.invite_auto_complete=new So.AutoComplete(t,{min_chars:1,list:e})},submitInviteForm(e){e.preventDefault();const t=new FormData(e.target),n=t.get("invitee_jids"),s=t.get("reason");BS.isValidJID(n)?(this.chatroomview.model.directInvite(n,s),this.modal.hide()):this.model.set({invalid_invite_jid:!0})}});function qS(){const e=sx(['<li class="feature" ><span class="fa fa-database"></span>'," - <em>","</em></li>"]);return qS=function(){return e},e}function HS(){const e=sx(['<li class="feature" ><span class="fa fa-info-circle"></span>'," - <em>","</em></li>"]);return HS=function(){return e},e}function $S(){const e=sx(['<li class="feature" ><span class="fa fa-gavel"></span>'," - <em>","</em></li>"]);return $S=function(){return e},e}function GS(){const e=sx(['<li class="feature" ><span class="fa fa-user-secret"></span>'," - <em>","</em></li>"]);return GS=function(){return e},e}function VS(){const e=sx(['<li class="feature" ><span class="fa fa-id-card"></span>'," - <em>","</em></li>"]);return VS=function(){return e},e}function WS(){const e=sx(['<li class="feature" ><span class="fa fa-snowflake-o"></span>'," - <em>","</em></li>"]);return WS=function(){return e},e}function JS(){const e=sx(['<li class="feature" ><span class="fa fa-save"></span>'," - <em>","</em></li>"]);return JS=function(){return e},e}function QS(){const e=sx(['<li class="feature" ><span class="fa fa-globe"></span>'," - <em>","</em></li>"]);return QS=function(){return e},e}function YS(){const e=sx(['<li class="feature" ><span class="fa fa-address-book"></span>'," - <em>","</em></li>"]);return YS=function(){return e},e}function KS(){const e=sx(['<li class="feature" ><span class="fa fa-eye"></span>'," - <em>","</em></li>"]);return KS=function(){return e},e}function XS(){const e=sx(['<li class="feature" ><span class="fa fa-eye-slash"></span>'," - <em>","</em></li>"]);return XS=function(){return e},e}function ZS(){const e=sx(['<li class="feature" ><span class="fa fa-unlock"></span>'," - <em>","</em></li>"]);return ZS=function(){return e},e}function ex(){const e=sx(['<li class="feature" ><span class="fa fa-lock"></span>'," - <em>","</em></li>"]);return ex=function(){return e},e}function tx(){const e=sx(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="muc-details-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n <div class="room-info">\n <p class="room-info"><strong>',"</strong>: ",'</p>\n <p class="room-info"><strong>',"</strong>: ",'</p>\n <p class="room-info"><strong>',"</strong>: ","</p>\n ",'\n <p class="room-info"><strong>',"</strong>: ",'</p>\n <p class="room-info"><strong>','</strong>:\n <div class="chatroom-features">\n <ul class="features-list">\n ',"\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n </ul>\n </div>\n </p>\n </div>\n </div>\n <div class="modal-footer">',"</div>\n </div>\n </div>\n "]);return tx=function(){return e},e}function nx(){const e=sx(['\n <p class="room-info"><strong>',"</strong>: ",'</p>\n <p class="room-info"><strong>',"</strong>: ","</p>\n "]);return nx=function(){return e},e}function sx(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const ix=og.extend({id:"muc-details-modal",initialize(){og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.listenTo(this.model.features,"change",this.render),this.listenTo(this.model.occupants,"add",this.render),this.listenTo(this.model.occupants,"change",this.render)},toHTML(){return(e=>{const t=Vu("Groupchat address (JID)"),n=Vu("Message archiving"),s=Vu("Messages are archived on the server"),i=Vu("Description"),r=Vu("Features"),o=Vu("Hidden"),a=Vu("This groupchat is not publicly searchable"),c=Vu("This groupchat is restricted to members only"),l=Vu("Members only"),u=Vu("Moderated"),d=Vu("Participants entering this groupchat need to request permission to write"),h=Vu("Name"),f=Vu("This groupchat does not require a password upon entry"),g=Vu("No password required"),m=Vu("Not anonymous"),p=Vu("All other groupchat participants can see your XMPP address"),v=Vu("Not moderated"),b=Vu("Participants entering this groupchat can write right away"),y=Vu("Online users"),_=Vu("Open"),w=Vu("Anyone can join this groupchat"),S=Vu("This groupchat requires a password before entry"),x=Vu("Password protected"),E=Vu("Persistent"),j=Vu("This groupchat persists even if it's unoccupied"),A=Vu("Public"),C=Vu("Semi-anonymous"),k=Vu("Only moderators can see your XMPP address"),O=Vu("Temporary"),T=Vu("This groupchat will disappear once the last person leaves");return Ha(tx(),e.display_name,dg,h,e.name,t,e.jid,i,e.config.description,e.subject?(e=>{const t=Vu("Topic"),n=Vu("Topic author");return Ha(nx(),t,Tv(Er.filterXSS(e.subject.text,{whiteList:{}})),n,e.subject&&e.subject.author)})(e):"",y,e.num_occupants,r,e.features.passwordprotected?Ha(ex(),x,S):"",e.features.unsecured?Ha(ZS(),g,f):"",e.features.hidden?Ha(XS(),o,a):"",e.features.public_room?Ha(KS(),A,e.__("This groupchat is publicly searchable")):"",e.features.membersonly?Ha(YS(),l,c):"",e.features.open?Ha(QS(),_,w):"",e.features.persistent?Ha(JS(),E,j):"",e.features.temporary?Ha(WS(),O,T):"",e.features.nonanonymous?Ha(VS(),m,p):"",e.features.semianonymous?Ha(GS(),C,k):"",e.features.moderated?Ha($S(),u,d):"",e.features.unmoderated?Ha(HS(),v,b):"",e.features.mam_enabled?Ha(qS(),n,s):"",ug)})(Object.assign(this.model.toJSON(),{config:this.model.config.toJSON(),display_name:Vu("Groupchat info for %1$s",this.model.getDisplayName()),features:this.model.features.toJSON(),num_occupants:this.model.occupants.length}))}});function rx(){const e=ux(['<p class="chat-head__desc" title="','">\n <converse-rich-text text='," render_styling></converse-rich-text>\n </p>"]);return rx=function(){return e},e}function ox(){const e=ux(["<converse-dropdown .items=","></converse-dropdown>"]);return ox=function(){return e},e}function ax(){const e=ux(['<i class="fa fa-bookmark chatbox-title__text--bookmarked" title="','"></i>']);return ax=function(){return e},e}function cx(){const e=ux(['<converse-controlbox-navback jid="','"></converse-controlbox-navback>']);return cx=function(){return e},e}function lx(){const e=ux(['\n <div class="chatbox-title ','">\n ','\n <div class="chatbox-title__text" title="','">',"\n ",'\n </div>\n <div class="chatbox-title__buttons row no-gutters">\n ',"\n ","\n </div>\n </div>\n ","\n "]);return lx=function(){return e},e}function ux(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-rich-text",class extends af{static get properties(){return{mentions:{type:Array},nick:{type:String},offset:{type:Number},onImgClick:{type:Function},onImgLoad:{type:Function},render_styling:{type:Boolean},show_images:{type:Boolean},show_me_message:{type:Boolean},text:{type:String}}}constructor(){super(),this.offset=0,this.mentions=[],this.render_styling=!1,this.show_images=!1,this.show_me_message=!1}render(){const e={nick:this.nick,onImgClick:this.onImgClick,onImgLoad:this.onImgLoad,render_styling:this.render_styling,show_images:this.show_images,show_me_message:this.show_me_message};return ym(this.text,this.offset,this.mentions,e)}});n(5355),Cc.elements.define("converse-muc-heading",class extends kb{async connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.getAttribute("jid")),this.debouncedRender=Oo(this.render,100),this.listenTo(this.model,"change",this.debouncedRender);const e=await So.api.user.settings.getModel();this.listenTo(e,"change:mucs_with_hidden_subject",this.debouncedRender),await this.model.initialized,this.listenTo(this.model.features,"change:open",this.debouncedRender),this.model.occupants.forEach((e=>this.onOccupantAdded(e))),this.listenTo(this.model.occupants,"add",this.onOccupantAdded),this.listenTo(this.model.occupants,"change:affiliation",this.onOccupantAffiliationChanged),this.render()}onOccupantAdded(e){e.get("jid")===So.bare_jid&&this.debouncedRender()}onOccupantAffiliationChanged(e){e.get("jid")===So.bare_jid&&this.debouncedRender()}showRoomDetailsModal(e){e.preventDefault(),Cc.modal.show(ix,{model:this.model},e)}showInviteModal(e){e.preventDefault(),Cc.modal.show(US,{model:new ao,chatroomview:this},e)}toggleTopic(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.toggleSubjectHiddenState()}getAndRenderConfigurationForm(){this.model.session.set("view",Mc.MUC.VIEWS.CONFIG)}destroy(){var e;null===(e=So.chatboxviews.get(this.getAttribute("jid")))||void 0===e||e.destroy()}getHeadingButtons(e){const t=[];t.push({i18n_text:Vu("Details"),i18n_title:Vu("Show more information about this groupchat"),handler:e=>this.showRoomDetailsModal(e),a_class:"show-muc-details-modal",icon_class:"fa-info-circle",name:"details"}),"owner"===this.model.getOwnAffiliation()&&t.push({i18n_text:Vu("Configure"),i18n_title:Vu("Configure this groupchat"),handler:()=>this.getAndRenderConfigurationForm(),a_class:"configure-chatroom-button",icon_class:"fa-wrench",name:"configure"}),this.model.invitesAllowed()&&t.push({i18n_text:Vu("Invite"),i18n_title:Vu("Invite someone to join this groupchat"),handler:e=>this.showInviteModal(e),a_class:"open-invite-modal",icon_class:"fa-user-plus",name:"invite"});const n=this.model.get("subject");if(n&&n.text&&t.push({i18n_text:Vu(e?"Show topic":"Hide topic"),i18n_title:Vu(e?"Show the topic message in the heading":"Hide the topic in the heading"),handler:e=>this.toggleTopic(e),a_class:"hide-topic",icon_class:"fa-minus-square",name:"toggle-topic"}),this.model.session.get("connection_status")===Mc.ROOMSTATUS.ENTERED){const e=this.model.getAllowedCommands();e.includes("modtools")&&t.push({i18n_text:Vu("Moderate"),i18n_title:Vu("Moderate this groupchat"),handler:()=>Uw(this.model),a_class:"moderate-chatroom-button",icon_class:"fa-user-cog",name:"moderate"}),e.includes("destroy")&&t.push({i18n_text:Vu("Destroy"),i18n_title:Vu("Remove this groupchat"),handler:e=>this.destroy(e),a_class:"destroy-chatroom-button",icon_class:"fa-trash",name:"destroy"})}Cc.settings.get("singleton")||t.push({i18n_text:Vu("Leave"),i18n_title:Vu("Leave and close this groupchat"),handler:async e=>{e.stopPropagation();const t=[Vu("Are you sure you want to leave this groupchat?")];await Cc.confirm(Vu("Confirm"),t)&&this.close(e)},a_class:"close-chatbox-button",standalone:"overlayed"===Cc.settings.get("view_mode"),icon_class:"fa-sign-out-alt",name:"signout"});const s=So.chatboxviews.get(this.getAttribute("jid"));return s?So.api.hook("getHeadingButtons",s,t):t}async generateHeadingTemplate(){const e=await this.model.isSubjectHidden(),t=await this.getHeadingButtons(e),n=t.filter((e=>e.standalone)),s=t.filter((e=>!e.standalone));return(e=>{const t=Vu("Hide the groupchat topic"),n=Vu("This groupchat is bookmarked"),s=e.subject?e.subject.text:"",i=s&&!e.subject_hidden;return Ha(lx(),i?"":"chatbox-title--no-desc",So.api.settings.get("singleton")?"":Ha(cx(),e.jid),"hidden"!==So.locked_muc_domain?e.jid:"",e.title,e.bookmarked?Ha(ax(),n):"",e.standalone_btns.length?(e=>e.standalone_btns.reverse().map((e=>Ng(e,""))))(e):"",e.dropdown_btns.length?Ha(ox(),e.dropdown_btns):"",i?Ha(rx(),t,s):"")})(Object.assign(this.model.toJSON(),{_converse:So,subject_hidden:e,dropdown_btns:s.map((e=>xb(e))),standalone_btns:n.map((e=>Eb(e))),title:this.model.getDisplayName()}))}});function dx(){const e=(t=['\n <form class="converse-form chatroom-form converse-centered-form" @submit=','>\n <fieldset class="form-group">\n <label>','</label>\n <p class="validation-message">','</p>\n <input class="hidden-username" type="text" autocomplete="username" value="','"></input>\n <input type="password"\n name="password"\n required="required"\n class="form-control ','"\n placeholder="','"/>\n </fieldset>\n <fieldset class="form-group">\n <input class="btn btn-primary" type="submit" value="','"/>\n </fieldset>\n </form>\n '],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return dx=function(){return e},e}Cc.elements.define("converse-muc-nickname-form",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid)}render(){return eS(this.model)}});function hx(){const e=gx(['\n <converse-muc-heading jid="','" class="chat-head chat-head-chatroom row no-gutters">\n </converse-muc-heading>\n <div class="chat-body chatroom-body row no-gutters">',"</div>\n "]);return hx=function(){return e},e}function fx(){const e=gx(['\n <div class="flyout box-flyout">\n <converse-dragresize></converse-dragresize>\n ',"\n </div>"]);return fx=function(){return e},e}function gx(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function mx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Cc.elements.define("converse-muc-password-form",class extends af{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=So.chatboxes.get(this.jid),this.listenTo(this.model,"change:password_validation_message",this.render),this.render()}render(){return(e=>{const t=Vu("This groupchat requires a password"),n=Vu("Password: "),s=Vu("Submit");return Ha(dx(),e.submitPassword,t,e.validation_message,e.jid,e.validation_message?"error":"",n,s)})({jid:this.model.get("jid"),submitPassword:e=>this.submitPassword(e),validation_message:this.model.get("password_validation_message")})}submitPassword(e){e.preventDefault();const t=this.querySelector("input[type=password]").value;this.model.join(this.model.get("nick"),t),this.model.set("password_validation_message",null)}});class px extends Pb{constructor(...e){super(...e),mx(this,"length",300),mx(this,"is_chatroom",!0)}connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){this.model=await Cc.rooms.get(this.jid),So.chatboxviews.add(this.jid,this),this.setAttribute("id",this.model.get("box_id")),this.listenTo(So,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdateMessageForm),this.listenTo(this.model,"show",this.show),this.listenTo(this.model.session,"change:connection_status",this.updateAfterTransition),this.listenTo(this.model.session,"change:view",this.requestUpdate),this.updateAfterTransition(),this.model.maybeShow(),Cc.trigger("chatRoomViewInitialized",this)}render(){return(e=>Ha(fx(),e.model?Ha(hx(),e.model.get("jid"),function(e){const t=e.model.session.get("view"),n=e.model.get("jid"),s=Mc.ROOMSTATUS,i=e.model.session.get("connection_status");return t===Mc.MUC.VIEWS.CONFIG?Ha(Ew(),n):t===Mc.MUC.VIEWS.BOOKMARK?Ha(xw(),n):Ha(Sw(),i==s.PASSWORD_REQUIRED?Ha(ww(),n):"",i==s.ENTERED?Ha(_w(),n):"",i==s.CONNECTING?Zp():"",i==s.NICKNAME_REQUIRED?function(e){const t=e.get("jid");return Cc.settings.get("muc_show_logs_before_join")?Ha(Aw(),t):Ha(jw(),t)}(e.model):"",i==s.DISCONNECTED?Ha(yw(),n):"",i==s.BANNED?Ha(bw(),n):"",i==s.DESTROYED?Ha(vw(),n):"")}(e)):""))({model:this.model})}close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),So.router.history.getFragment()==="converse/room?jid="+this.model.get("jid")&&So.router.navigate(""),this.model.close(e)}async destroy(){const e=[Vu("Are you sure you want to destroy this groupchat?")];let t=[{name:"challenge",label:Vu("Please enter the XMPP address of this groupchat to confirm"),challenge:this.model.get("jid"),placeholder:Vu("name@example.org"),required:!0},{name:"reason",label:Vu("Optional reason for destroying this groupchat"),placeholder:Vu("Reason")},{name:"newjid",label:Vu("Optional XMPP address for a new groupchat that replaces this one"),placeholder:Vu("replacement@example.org")}];try{var n,s;t=await Cc.confirm(Vu("Confirm"),e,t);const i=null===(n=t.filter((e=>"reason"===e.name)).pop())||void 0===n?void 0:n.value,r=null===(s=t.filter((e=>"newjid"===e.name)).pop())||void 0===s?void 0:s.value;return this.model.sendDestroyIQ(i,r).then((()=>this.close()))}catch(e){as.error(e)}}updateAfterTransition(){this.model.session.get("connection_status")===Mc.ROOMSTATUS.CONNECTING&&(this.model.session.save({disconnection_actor:void 0,disconnection_message:void 0,disconnection_reason:void 0}),this.model.save({moved_jid:void 0,password_validation_message:void 0,reason:void 0})),this.requestUpdate()}}Cc.elements.define("converse-muc",px);const vx={roomviews:{get(e){if(Array.isArray(e))return Cc.chatviews.get(e).filter((e=>e.model.get("type")===So.CHATROOMS_TYPE));{const t=Cc.chatviews.get(e);return t.model.get("type")===So.CHATROOMS_TYPE?t:null}},close(e){let t;return void 0===e?t=So.chatboxviews:"string"==typeof e?t=[So.chatboxviews.get(e)].filter((e=>e)):Array.isArray(e)&&(t=e.map((e=>So.chatboxviews.get(e)))),Promise.all(t.map((e=>e.is_chatroom&&e.model&&e.close())))}}};n(5498),Mc.MUC.VIEWS={CONFIG:"config-form",BOOKMARK:"bookmark-form"},Mc.plugins.add("converse-muc-views",{dependencies:["converse-modal","converse-controlbox","converse-chatview"],initialize(){const{_converse:e}=this;Cc.settings.extend({auto_list_rooms:!1,cache_muc_messages:!0,locked_muc_nickname:!1,modtools_disable_query:[],modtools_disable_assign:!1,muc_disable_slash_commands:!1,muc_mention_autocomplete_filter:"contains",muc_mention_autocomplete_min_chars:0,muc_mention_autocomplete_show_avatar:!0,muc_roomid_policy:null,muc_roomid_policy_hint:null,roomconfig_whitelist:[],show_retraction_warning:!0,visible_toolbar_buttons:{toggle_occupants:!0}}),e.ChatRoomView=px,Object.assign(e.api,vx),Cc.listen.on("clearsession",(()=>{const t=e.chatboxviews.get("controlbox");t&&t.roomspanel&&(t.roomspanel.model.destroy(),t.roomspanel.remove(),delete t.roomspanel)})),Cc.listen.on("controlBoxInitialized",(e=>{Cc.settings.get("allow_muc")&&(zw(e),e.model.on("change:connected",(()=>zw(e))))}))}});var bx=n(4023),yx=n.n(bx);const{Strophe:_x,u:wx}=Mc.env,Sx="Notification"in window;let xx;function Ex(e){var t,n;return So.isTestEnv()||null!==(t=null===(n=So.chatboxes.get(e.from))||void 0===n?void 0:n.isHidden())&&void 0!==t&&t}function jx(){return So.isTestEnv()||Sx&&Cc.settings.get("show_desktop_notifications")&&"granted"===Notification.permission}function Ax(){var e,t;xx=null,null===(e=(t=navigator).clearAppBadge)||void 0===e||e.call(t).catch((e=>as.error("Could not clear unread count in app badge "+e)))}function Cx(){if(Cc.settings.get("show_tab_notifications")){var e,t,n;xx=null!==(e=xx)&&void 0!==e?e:new Mc.env.Favico({type:"circle",animation:"pop"});const s=So.chatboxes.models.reduce(((e,t)=>e+(t.get("num_unread")||0)),0);xx.badge(s),null===(t=(n=navigator).setAppBadge)||void 0===t||t.call(n,s).catch((e=>as.error("Could set unread count in app badge - "+e)))}}async function kx(e){if(!await async function(e){const{attrs:t,stanza:n}=e;if(!t||null!==n.querySelector("forwarded"))return!1;if("groupchat"===t.type)return await async function(e){if(!(null==e?void 0:e.body))return!1;const t=e.from,n=e.from_muc,s=Cc.settings.get("notify_all_room_messages"),i=So.chatboxes.get(n),r=_x.getResourceFromJid(t),o=r&&_x.unescapeNode(r)||"";let a=!1;const c=i.get("nick");Cc.settings.get("notify_nicknames_without_references")&&(a=new RegExp("\\b".concat(c,"\\b")).test(e.body));const l=e.references.reduce(((e,t)=>e||(e=>{const t=e.uri.replace(/^xmpp:/,"");return t==So.bare_jid||t==="".concat(n,"/").concat(c)})(t)),!1),u=o!==c,d=!0===s||Array.isArray(s)&&s.includes(n)||l||a;return!(!u||!d)&&await Cc.hook("shouldNotifyOfGroupMessage",e,!0)}(t);if(t.is_headline)return Ex(t);const s=_x.getBareJidFromJid(t.from)===So.bare_jid;return!wx.isOnlyChatStateNotification(n)&&!wx.isOnlyMessageDeliveryReceipt(n)&&!s&&("all"===Cc.settings.get("show_desktop_notifications")||Ex(t))}(e))return!1;Cc.trigger("messageNotification",e),function(){if(Cc.settings.get("play_sounds")&&void 0!==window.Audio){const e=new Audio(Cc.settings.get("sounds_path")+"msg_received.ogg"),t=e.canPlayType("audio/ogg");if("probably"===t)return e.play();const n=new Audio(Cc.settings.get("sounds_path")+"msg_received.mp3"),s=n.canPlayType("audio/mp3");"probably"===s?n.play():"maybe"===t?e.play():"maybe"===s&&n.play()}}(),function(e){const{attrs:t}=e;if(t.is_error)return;if(!jx())return;let n,s;const i=t.from,r=_x.getBareJidFromJid(i);if("headline"===t.type){if(r.includes("@")&&!Cc.settings.get("allow_non_roster_messaging"))return;n=Vu("Notification from %1$s",r)}else if(r.includes("@"))if("groupchat"===t.type)n=Vu("%1$s says",_x.getResourceFromJid(i));else{if(void 0===So.roster)return void as.error("Could not send notification, because roster is undefined");if(s=So.roster.get(r),void 0!==s)n=Vu("%1$s says",s.getDisplayName());else{if(!Cc.settings.get("allow_non_roster_messaging"))return;n=Vu("%1$s says",r)}}else n=Vu("Notification from %1$s",r);const o=t.is_encrypted?Vu("Encrypted message received"):t.body;if(!o)return;const a=new Notification(n,{body:o,lang:So.locale,icon:Cc.settings.get("notification_icon"),requireInteraction:!So.notification_delay});Cc.settings.get("notification_delay")&&setTimeout((()=>a.close()),Cc.settings.get("notification_delay")),a.onclick=function(e){e.preventDefault(),window.focus(),So.chatboxes.get(r).maybeShow(!0)}}(e)}function Ox(e){jx()&&function(e){if("error"===e.klass||"warn"===e.klass){const t=new Notification(e.subject,{body:e.message,lang:So.locale,icon:So.notification_icon});setTimeout(t.close.bind(t),5e3)}}(e)}function Tx(e){jx()&&Cc.settings.get("show_chat_state_notifications")&&function(e){if(So.chatstate_notification_blacklist.includes(e.jid))return;const t=e.presence.get("show");let n=null;if("offline"===t?n=Vu("has gone offline"):"away"===t?n=Vu("has gone away"):"dnd"===t?n=Vu("is busy"):"online"===t&&(n=Vu("has come online")),null===n)return;const s=new Notification(e.getDisplayName(),{body:n,lang:So.locale,icon:So.notification_icon});setTimeout((()=>s.close()),5e3)}(e)}function Nx(e){jx()&&function(e){const t=new Notification(e.getDisplayName(),{body:Vu("wants to be your contact"),lang:So.locale,icon:So.notification_icon});setTimeout((()=>t.close()),5e3)}(e)}function Ix(){Sx&&!["denied","granted"].includes(Notification.permission)&&Notification.requestPermission()}function Mx(){const e=Dx(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="converse-modtools-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n ','\n\n <div class="tab-content">\n <div class="tab-pane tab-pane--columns ','"\n id="about-tabpanel" role="tabpanel" aria-labelledby="about-tab">\n\n <span class="modal-alert"></span>\n <br/>\n <div class="container">\n <h6 class="brand-heading">Converse</h6>\n <p class="brand-subtitle">','</p>\n <p class="brand-subtitle">','</p>\n <p class="brand-subtitle">','</p>\n </div>\n </div>\n\n <div class="tab-pane tab-pane--columns ','"\n id="commands-tabpanel"\n role="tabpanel"\n aria-labelledby="commands-tab">\n <converse-adhoc-commands/>\n </div>\n </div>\n </div>\n </div>\n </div>\n']);return Mx=function(){return e},e}function Rx(){const e=Dx(['\n <ul class="nav nav-pills justify-content-center">\n <li role="presentation" class="nav-item">\n <a class="nav-link active" id="about-tab" href="#about-tabpanel" aria-controls="about-tabpanel" role="tab" data-toggle="tab" @click=',">",'</a>\n </li>\n <li role="presentation" class="nav-item">\n <a class="nav-link" id="commands-tab" href="#commands-tabpanel" aria-controls="commands-tabpanel" role="tab" data-toggle="tab" @click=',">","</a>\n </li>\n </ul>\n "]);return Rx=function(){return e},e}function Dx(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Mc.env.Favico=yx(),Mc.plugins.add("converse-notification",{dependencies:["converse-chatboxes"],initialize(){Cc.settings.extend({chatstate_notification_blacklist:[],notification_delay:5e3,notification_icon:"logo/conversejs-filled.svg",notify_all_room_messages:!1,notify_nicknames_without_references:!1,play_sounds:!0,show_chat_state_notifications:!1,show_desktop_notifications:!0,show_tab_notifications:!0,sounds_path:Cc.settings.get("assets_path")+"/sounds/"}),Cc.listen.on("clearSession",Ax),Cc.waitUntil("chatBoxesInitialized").then((()=>So.chatboxes.on("change:num_unread",Cx))),Cc.listen.on("pluginsInitialized",(function(){Cc.listen.on("contactRequest",Nx),Cc.listen.on("contactPresenceChanged",Tx),Cc.listen.on("message",kx),Cc.listen.on("feedback",Ox),Cc.listen.on("connected",Ix)}))}});let zx;const Lx=og.extend({id:"converse-client-info-modal",initialize(e){zx=e._converse,og.prototype.initialize.apply(this,arguments)},toHTML(){return(e=>{const t=Vu("Settings"),n=Vu("%1$s Open Source %2$s XMPP chat client brought to you by %3$s Opkode %2$s",'<a target="_blank" rel="nofollow" href="https://conversejs.org">',"</a>",'<a target="_blank" rel="nofollow" href="https://opkode.com">'),s=Vu("%1$s Translate %2$s it into your own language",'<a target="_blank" rel="nofollow" href="https://hosted.weblate.org/projects/conversejs/#languages">',"</a>"),i=Cc.settings.get("show_client_info"),r=Cc.settings.get("allow_adhoc_commands"),o=i&&r;return Ha(Mx(),t,dg,o?(e=>{const t=Vu("About"),n=Vu("Commands");return Ha(Rx(),e.switchTab,t,e.switchTab,n)})(e):"",i?"active":"",e.version_name,Tv(Er.filterXSS(n,{whiteList:{a:[]}})),Tv(Er.filterXSS(s,{whiteList:{a:[]}})),!i&&r?"active":"")})(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{version_name:zx.VERSION_NAME}))}});function Px(){const e=Ux(['<a class="controlbox-heading__btn logout fa fa-sign-out-alt align-self-center" title="','" @click=',"></a>"]);return Px=function(){return e},e}function Fx(){const e=Ux(['<a class="controlbox-heading__btn show-client-info fa fa-cog align-self-center" title="','" @click=',"></a>"]);return Fx=function(){return e},e}function Bx(){const e=Ux(['\n <div class="userinfo controlbox-padded">\n <div class="controlbox-section profile d-flex">\n <a class="show-profile" href="#" @click=','>\n <canvas class="avatar align-self-center" height="40" width="40"></canvas>\n </a>\n <span class="username w-100 align-self-center">',"</span>\n ","\n ",'\n </div>\n <div class="d-flex xmpp-status">\n <a class="change-status" title="','" data-toggle="modal" data-target="#changeStatusModal" @click=','>\n <span class="',' w-100 align-self-center" data-value="','">\n <span class="\n ',"\n ","\n ","\n ","\n ",'"></span> ',"</span>\n </a>\n </div>\n </div>\n"]);return Bx=function(){return e},e}function Ux(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function qx(){const e=(t=['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="changeStatusModalLabel">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n <form class="converse-form set-xmpp-status" id="set-xmpp-status">\n <div class="form-group">\n <div class="custom-control custom-radio">\n <input ?checked=','\n type="radio" id="radio-online" value="online" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-online">\n <span class="fa fa-circle chat-status chat-status--online"></span>','</label>\n </div>\n <div class="custom-control custom-radio">\n <input ?checked=','\n type="radio" id="radio-busy" value="dnd" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-busy">\n <span class="fa fa-minus-circle chat-status chat-status--busy"></span>','</label>\n </div>\n <div class="custom-control custom-radio">\n <input ?checked=','\n type="radio" id="radio-away" value="away" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-away">\n <span class="fa fa-circle chat-status chat-status--away"></span>','</label>\n </div>\n <div class="custom-control custom-radio">\n <input ?checked=','\n type="radio" id="radio-xa" value="xa" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-xa">\n <span class="far fa-circle chat-status chat-status--xa"></span>','</label>\n </div>\n </div>\n <div class="form-group">\n <div class="btn-group w-100">\n <input name="status_message" type="text" class="form-control"\n value="','" placeholder="','"/>\n <span class="clear-input fa fa-times ','"></span>\n </div>\n </div>\n <button type="submit" class="btn btn-primary">',"</button>\n </form>\n </div>\n </div>\n </div>\n"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return qx=function(){return e},e}Cc.elements.define("converse-user-profile",class extends Zf{async initialize(){this.model=So.xmppstatus,this.listenTo(this.model,"change",this.render),await Cc.waitUntil("VCardsInitialized"),this.listenTo(this.model.vcard,"change",this.render),this.render()}render(){const e=this.model.get("status")||"offline";var t;Wa((e=>{const t=Vu("Log out"),n=Vu("Click to change your chat status"),s=Vu("Show details about this chat client"),i=Cc.settings.get("show_client_info")||Cc.settings.get("allow_adhoc_commands");return Ha(Bx(),e.showProfileModal,e.fullname,i?Ha(Fx(),s,e.showUserSettingsModal):"",Cc.settings.get("allow_logout")?Ha(Px(),t,e.logout):"",n,e.showStatusChangeModal,e.chat_status,e.chat_status,"online"===e.chat_status&&"fa fa-circle chat-status chat-status--online","dnd"===e.chat_status&&"fa fa-minus-circle chat-status chat-status--busy","away"===e.chat_status&&"fa fa-circle chat-status chat-status--away","xa"===e.chat_status&&"far fa-circle chat-status chat-status--xa ","offline"===e.chat_status&&"fa fa-circle chat-status chat-status--offline",e.status_message)})(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{chat_status:e,fullname:this.model.vcard.get("fullname")||So.bare_jid,showUserSettingsModal:e=>this.showUserSettingsModal(e),status_message:this.model.get("status_message")||Vu("I am %1$s",(t=e,"chat"===t?Vu("online"):"dnd"===t?Vu("busy"):"xa"===t?Vu("away for long"):"away"===t?Vu("away"):"offline"===t?Vu("offline"):Vu(t)||Vu("online"))),logout:this.logout,showStatusChangeModal:()=>this.showStatusChangeModal(),showProfileModal:()=>this.showProfileModal()})),this),this.renderAvatar()}showProfileModal(e){null==e||e.preventDefault(),Cc.modal.show(So.ProfileModal,{model:this.model},e)}showStatusChangeModal(e){null==e||e.preventDefault(),Cc.modal.show(So.ChatStatusModal,{model:this.model},e)}showUserSettingsModal(e){null==e||e.preventDefault(),Cc.modal.show(Lx,{model:this.model,_converse:So},e)}logout(e){null==e||e.preventDefault(),!0===confirm(Vu("Are you sure you want to log out?"))&&Cc.user.logout()}});const Hx=Mc.env.utils,$x=og.extend({id:"modal-status-change",events:{"submit form#set-xmpp-status":"onFormSubmitted","click .clear-input":"clearStatusMessage"},toHTML(){return(e=>Ha(qx(),e.modal_title,dg,"online"===e.status,e.label_online,"busy"===e.status,e.label_busy,"away"===e.status,e.label_away,"xa"===e.status,e.label_xa,e.status_message||"",e.placeholder_status_message,e.status_message?"":"hidden",e.label_save))(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{label_away:Vu("Away"),label_busy:Vu("Busy"),label_cancel:Vu("Cancel"),label_close:Vu("Close"),label_custom_status:Vu("Custom status"),label_offline:Vu("Offline"),label_online:Vu("Online"),label_save:Vu("Save"),label_xa:Vu("Away for long"),modal_title:Vu("Change chat status"),placeholder_status_message:Vu("Personal status message")}))},afterRender(){this.el.addEventListener("shown.bs.modal",(()=>{this.el.querySelector('input[name="status_message"]').focus()}),!1)},clearStatusMessage(e){e&&e.preventDefault&&(e.preventDefault(),Hx.hideElement(this.el.querySelector(".clear-input"))),this.el.querySelector('input[name="status_message"]').value=""},onFormSubmitted(e){e.preventDefault();const t=new FormData(e.target);this.model.save({status_message:t.get("status_message"),status:t.get("chat_status")}),this.modal.hide()}});function Gx(){const e=(t=['\n <a class="change-avatar" @click=',' title="','">\n ',"\n </a>\n <input @change=",' class="hidden" name="image" type="file"/>\n '],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return Gx=function(){return e},e}So.ChatStatusModal=$x;const Vx=Vu("Your avatar image");function Wx(){const e=tE(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="user-profile-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n ','\n <div class="tab-content">\n <div class="tab-pane active" id="profile-tabpanel" role="tabpanel" aria-labelledby="profile-tab">\n <form class="converse-form converse-form--modal profile-form" action="#">\n <div class="row">\n <div class="col-auto">\n <converse-image-picker image="','" width="','" height="','"></converse-image-picker>\n </div>\n <div class="col">\n <div class="form-group">\n <label class="col-form-label">',":</label>\n <div>",'</div>\n </div>\n </div>\n </div>\n <div class="form-group">\n <label for="vcard-fullname" class="col-form-label">',':</label>\n <input id="vcard-fullname" type="text" class="form-control" name="fn" value="','"/>\n </div>\n <div class="form-group">\n <label for="vcard-nickname" class="col-form-label">',':</label>\n <input id="vcard-nickname" type="text" class="form-control" name="nickname" value="','"/>\n </div>\n <div class="form-group">\n <label for="vcard-url" class="col-form-label">',':</label>\n <input id="vcard-url" type="url" class="form-control" name="url" value="','"/>\n </div>\n <div class="form-group">\n <label for="vcard-email" class="col-form-label">',':</label>\n <input id="vcard-email" type="email" class="form-control" name="email" value="','"/>\n </div>\n <div class="form-group">\n <label for="vcard-role" class="col-form-label">',':</label>\n <input id="vcard-role" type="text" class="form-control" name="role" value="','" aria-describedby="vcard-role-help"/>\n <small id="vcard-role-help" class="form-text text-muted">','</small>\n </div>\n <hr/>\n <div class="form-group">\n <button type="submit" class="save-form btn btn-primary">',"</button>\n </div>\n </form>\n </div>\n ","\n </div>\n </div>\n </div>\n </div>\n "]);return Wx=function(){return e},e}function Jx(){const e=tE(['\n <ul class="nav nav-pills justify-content-center">\n <li role="presentation" class="nav-item">\n <a class="nav-link active" id="profile-tab" href="#profile-tabpanel" aria-controls="profile-tabpanel" role="tab" data-toggle="tab">','</a>\n </li>\n <li role="presentation" class="nav-item">\n <a class="nav-link" id="omemo-tab" href="#omemo-tabpanel" aria-controls="omemo-tabpanel" role="tab" data-toggle="tab">',"</a>\n </li>\n </ul>"]);return Jx=function(){return e},e}function Qx(){const e=tE(['\n <div class="tab-pane" id="omemo-tabpanel" role="tabpanel" aria-labelledby="omemo-tab">\n <form class="converse-form fingerprint-removal">\n <ul class="list-group fingerprints">\n <li class="list-group-item active">','</li>\n <li class="list-group-item">\n ','\n </li>\n </ul>\n <div class="form-group">\n <button type="button" class="generate-bundle btn btn-danger">',"</button>\n </div>\n ","\n </form>\n </div>"]);return Qx=function(){return e},e}function Yx(){const e=tE(['\n <ul class="list-group fingerprints">\n <li class="list-group-item nopadding active">\n <label>\n <input type="checkbox" class="select-all" title="','" aria-label="','"/>\n ',"\n </label>\n </li>\n ",'\n </ul>\n <div class="form-group"><button type="submit" class="save-form btn btn-primary">',"</button></div>\n "]);return Yx=function(){return e},e}function Kx(){const e=tE(["\n ","\n"]);return Kx=function(){return e},e}function Xx(){const e=tE(['\n <li class="fingerprint-removal-item list-group-item nopadding">\n <label>\n <input type="checkbox" value="','"\n aria-label="','"/>\n <span>',"</span>\n </label>\n </li>\n "]);return Xx=function(){return e},e}function Zx(){const e=tE(['\n <li class="fingerprint-removal-item list-group-item nopadding">\n <label>\n <input type="checkbox" value="','"\n aria-label="','"/>\n <span class="fingerprint">',"</span>\n </label>\n </li>\n "]);return Zx=function(){return e},e}function eE(){const e=tE(['\n <span class="fingerprint">',"</span>"]);return eE=function(){return e},e}function tE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-image-picker",class extends af{static get properties(){return{height:{type:Number},image:{type:String},width:{type:Number}}}render(){const e={height:this.height,image:this.image,width:this.width};return Ha(Gx(),this.openFileSelection,Vx,bp(e),this.updateFilePreview)}openFileSelection(e){e.preventDefault(),this.querySelector('input[type="file"]').click()}updateFilePreview(e){const t=e.target.files[0],n=new FileReader;n.onloadend=()=>this.image=n.result,n.readAsDataURL(t)}});const nE=Mc.env.utils,sE=e=>{const t=Vu("This device's OMEMO fingerprint"),n=Vu("Generate new keys and fingerprint");return Ha(Qx(),t,e.view.current_device&&e.view.current_device.get("bundle")&&e.view.current_device.get("bundle").fingerprint?(e=>Ha(eE(),nE.formatFingerprint(e.view.current_device.get("bundle").fingerprint)))(e):Zp(),n,e.view.other_devices.length?(e=>{const t=Vu("Other OMEMO-enabled devices"),n=Vu("Checkbox to select fingerprints of all other OMEMO devices"),s=Vu("Remove checked devices and close"),i=Vu("Select all");return Ha(Yx(),i,n,t,e.view.other_devices.map((t=>(e=>Ha(Kx(),e.device.get("bundle")&&e.device.get("bundle").fingerprint?(e=>{const t=Vu("Checkbox for selecting the following fingerprint");return Ha(Zx(),e.device.get("id"),t,nE.formatFingerprint(e.device.get("bundle").fingerprint))})(e):(e=>{const t=Vu("Device without a fingerprint"),n=Vu("Checkbox for selecting the following device");return Ha(Xx(),e.device.get("id"),n,t)})(e)))(Object.assign({device:t},e)))),s)})(e):"")},{sizzle:iE}=converse.env,rE=og.extend({id:"user-profile-modal",events:{"submit .profile-form":"onFormSubmitted"},initialize(){this.listenTo(this.model,"change",this.render),og.prototype.initialize.apply(this,arguments),Cc.trigger("profileModalInitialized",this.model)},toHTML(){return(e=>{const t=Vu("Your Profile"),n=Vu("Email"),s=Vu("Full Name"),i=Vu("XMPP Address (JID)"),r=Vu("Nickname"),o=Vu("Role"),a=Vu("Save and close"),c=Vu("Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages."),l=Vu("URL"),u=Vu("OMEMO"),d=Vu("Profile"),h=Ha(Jx(),d,u);return Ha(Wx(),t,dg,So.pluggable.plugins["converse-omemo"].enabled(So)&&h||"",e.image,e.width,e.height,i,e.jid,s,e.fullname||"",r,e.nickname||"",l,e.url||"",n,e.email||"",o,e.role||"",c,a,So.pluggable.plugins["converse-omemo"].enabled(So)&&sE(e)||"")})(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),this.getAvatarData(),{view:this}))},getAvatarData(){return{height:128,width:128,image:"data:"+this.model.vcard.get("image_type")+";base64,"+this.model.vcard.get("image")}},afterRender(){this.tabs=iE(".nav-item .nav-link",this.el).map((e=>new(ng().Tab)(e)))},async setVCard(e){try{await Cc.vcard.set(So.bare_jid,e)}catch(e){return as.fatal(e),void this.alert([Vu("Sorry, an error happened while trying to save your profile data."),Vu("You can check your browser's developer console for any error output.")].join(" "))}this.modal.hide()},onFormSubmitted(e){e.preventDefault();const t=new FileReader,n=new FormData(e.target),s=n.get("image"),i={fn:n.get("fn"),nickname:n.get("nickname"),role:n.get("role"),email:n.get("email"),url:n.get("url")};s.size?(t.onloadend=()=>{Object.assign(i,{image:btoa(t.result),image_type:s.type}),this.setVCard(i)},t.readAsBinaryString(s)):(Object.assign(i,{image:this.model.vcard.get("image"),image_type:this.model.vcard.get("image_type")}),this.setVCard(i))}});So.ProfileModal=rE,Mc.plugins.add("converse-profile",{dependencies:["converse-status","converse-modal","converse-vcard","converse-chatboxviews"],initialize(){Cc.settings.extend({allow_adhoc_commands:!0,show_client_info:!0})}});const oE={async sendMessage(e,t){if(this.get("omemo_active")&&e){const n=this.getOutgoingMessageAttributes(e,t);let s,i;n.is_encrypted=!0,n.plaintext=n.message;try{const e=await So.getBundlesAndBuildSessions(this);s=await this.createMessage(n),i=await So.createOMEMOMessageStanza(this,s,e)}catch(e){return this.handleMessageSendError(e),null}return So.api.send(i),s}return this.__super__.sendMessage.apply(this,arguments)}};function aE(){const e=(t=['\n <button class="toggle-omemo" title="','" ?disabled='," @click=",'>\n <converse-icon\n class="fa ','"\n path-prefix="','"\n size="1em"\n color="','"\n ></converse-icon>\n </button>\n '],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return aE=function(){return e},e}const{Strophe:cE,sizzle:lE,u:uE}=Mc.env,dE={name:"AES-GCM",length:128},hE={async encryptMessage(e){const t=crypto.getRandomValues(new window.Uint8Array(12)),n=await crypto.subtle.generateKey(dE,!0,["encrypt","decrypt"]),s={name:"AES-GCM",iv:t,tagLength:128},i=await crypto.subtle.encrypt(s,n,uE.stringToArrayBuffer(e)),r=i.byteLength-16,o=i.slice(0,r),a=i.slice(r),c=await crypto.subtle.exportKey("raw",n);return{key:c,tag:a,key_and_tag:uE.appendArrayBuffer(c,a),payload:uE.arrayBufferToBase64(o),iv:uE.arrayBufferToBase64(t)}},async decryptMessage(e){const t=await crypto.subtle.importKey("raw",e.key,dE,!0,["encrypt","decrypt"]),n=uE.appendArrayBuffer(uE.base64ToArrayBuffer(e.payload),e.tag),s={name:"AES-GCM",iv:uE.base64ToArrayBuffer(e.iv),tagLength:128};return uE.arrayBufferToString(await crypto.subtle.decrypt(s,t,n))}};function fE(e,t){return t.is_encrypted&&t.encrypted.key?!0===t.encrypted.prekey?async function(e){const t=pE(e.from,parseInt(e.encrypted.device_id,10)),n=uE.base64ToArrayBuffer(e.encrypted.key);let s;try{s=await t.decryptPreKeyWhisperMessage(n,"binary")}catch(t){return as.error("".concat(t.name," ").concat(t.message)),Object.assign(e,bE(t))}try{const t=await vE(e,s);return await So.omemo_store.generateMissingPreKeys(),await So.omemo_store.publishBundle(),t?Object.assign(e,{plaintext:t}):Object.assign(e,{is_only_key:!0})}catch(t){return as.error("".concat(t.name," ").concat(t.message)),Object.assign(e,bE(t))}}(t):async function(e){const t=e.from_muc?e.from_real_jid:e.from;t||Object.assign(e,{error_text:Vu("Sorry, could not decrypt a received OMEMO because we don't have the JID for that user."),error_type:"Decryption",is_ephemeral:!1,is_error:!0,type:"error"});const n=pE(t,parseInt(e.encrypted.device_id,10)),s=uE.base64ToArrayBuffer(e.encrypted.key);try{const t=await n.decryptWhisperMessage(s,"binary"),i=await vE(e,t);return Object.assign(e,{plaintext:i})}catch(t){return as.error("".concat(t.name," ").concat(t.message)),Object.assign(e,bE(t))}}(t):t}function gE(){So.chatboxes.on("add",(e=>{jE(e),e.get("type")===So.CHATROOMS_TYPE&&(e.occupants.on("add",(t=>async function(e,t){!t.isSelf()&&e.features.get("nonanonymous")&&e.features.get("membersonly")&&e.get("omemo_active")&&(await So.contactHasOMEMOSupport(t.get("jid"))||(e.createMessage({message:Vu("%1$s doesn't appear to have a client that supports OMEMO. Encrypted chat will no longer be possible in this grouchat.",t.get("nick")),type:"error"}),e.save({omemo_active:!1,omemo_supported:!1})))}(e,t))),e.features.on("change",(()=>jE(e))))}))}function mE(e){e.listenTo(e.model.messages,"add",(t=>{t.get("is_encrypted")&&!t.get("is_error")&&e.model.save("omemo_supported",!0)})),e.listenTo(e.model,"change:omemo_supported",(()=>{var t;!e.model.get("omemo_supported")&&e.model.get("omemo_active")?e.model.set("omemo_active",!1):null===(t=e.querySelector("converse-chat-toolbar"))||void 0===t||t.requestUpdate()})),e.listenTo(e.model,"change:omemo_active",(()=>{e.querySelector("converse-chat-toolbar").requestUpdate()}))}function pE(e,t){const n=new libsignal.SignalProtocolAddress(e,t);return new window.libsignal.SessionCipher(So.omemo_store,n)}async function vE(e,t){const n=e.encrypted,s=So.devicelists.getDeviceList(e.from);await s._devices_promise;let i=s.get(n.device_id);if(i||(i=await s.devices.create({id:n.device_id,jid:e.from},{promise:!0})),n.payload){const e=t.slice(0,16),s=t.slice(16),r=await hE.decryptMessage(Object.assign(n,{key:e,tag:s}));return i.save("active",!0),r}}function bE(e){return"debug"===Cc.settings.get("loglevel")?{error_text:Vu("Sorry, could not decrypt a received OMEMO message due to an error.")+" ".concat(e.name," ").concat(e.message),error_type:"Decryption",is_ephemeral:!0,is_error:!0,type:"error"}:{}}function yE(e){const t=e.querySelector("signedPreKeyPublic"),n=e.querySelector("signedPreKeySignature"),s=lE("prekeys > preKeyPublic",e).map((e=>({id:parseInt(e.getAttribute("preKeyId"),10),key:e.textContent})));return{identity_key:e.querySelector("identityKey").textContent.trim(),signed_prekey:{id:parseInt(t.getAttribute("signedPreKeyId"),10),public_key:t.textContent,signature:n.textContent},prekeys:s}}async function _E(e){var t;if(null===(t=e.get("bundle"))||void 0===t?void 0:t.fingerprint)return;const n=await e.getBundle();n.fingerprint=uE.arrayBufferToHex(uE.base64ToArrayBuffer(n.identity_key)),e.save("bundle",n),e.trigger("change:bundle")}async function wE(e){await Cc.waitUntil("OMEMOInitialized");const t=So.devicelists.get(e)||So.devicelists.create({jid:e});return await t.fetchDevices(),t.devices}function SE(){So.connection.addHandler((e=>{try{lE('event[xmlns="'.concat(cE.NS.PUBSUB,'#event"]'),e).length&&(function(e){const t=lE('items[node="'.concat(cE.NS.OMEMO_DEVICELIST,'"]'),e).pop();if(!t)return;const n='item list[xmlns="'.concat(cE.NS.OMEMO,'"] device'),s=lE(n,t).map((e=>e.getAttribute("id"))),i=e.getAttribute("from"),r=So.devicelists.getDeviceList(i),o=r.devices;Wo(o.pluck("id"),s).forEach((e=>{i===So.bare_jid&&e===So.omemo_store.get("device_id")||o.get(e).save("active",!1)})),s.forEach((e=>{const t=o.get(e);t?t.save("active",!0):o.create({id:e,jid:i})})),uE.isSameBareJID(i,So.bare_jid)&&r.publishCurrentDevice(s)}(e),function(e){const t=lE("items",e).pop();if(!t||!t.getAttribute("node").startsWith(cE.NS.OMEMO_BUNDLES))return;const n=t.getAttribute("node").split(":")[1],s=e.getAttribute("from"),i=lE("item > bundle",t).pop(),r=So.devicelists.getDeviceList(s);(r.devices.get(n)||r.devices.create({id:n,jid:s})).save({bundle:yE(i)})}(e))}catch(e){as.error(e.message)}return!0}),null,"message","headline")}function xE(){if(void 0===So.omemo_store){const e="converse.omemosession-".concat(So.bare_jid);So.omemo_store=new So.OMEMOStore({id:e}),Cr(So.omemo_store,e)}return So.omemo_store.fetchSession()}async function EE(){if(!So.config.get("trusted")||Cc.settings.get("clear_cache_on_logout"))return void as.warn("Not initializing OMEMO, since this browser is not trusted or clear_cache_on_logout is set to true");So.devicelists=new So.DeviceLists;const e="converse.devicelists-".concat(So.bare_jid);Cr(So.devicelists,e);try{await async function(){await new Promise(((e,t)=>So.devicelists.fetch({success:e,error:(e,n)=>t(n)})));let e=So.devicelists.get(So.bare_jid);return e?e.fetchDevices():e=await So.devicelists.create({jid:So.bare_jid},{promise:!0}),e._devices_promise}(),await xE(),await So.omemo_store.publishBundle()}catch(e){return as.error("Could not initialize OMEMO support"),void as.error(e)}Cc.trigger("OMEMOInitialized")}async function jE(e){let t;e.get("type")===So.CHATROOMS_TYPE?(await Cc.waitUntil("OMEMOInitialized"),t=e.features.get("nonanonymous")&&e.features.get("membersonly")):e.get("type")===So.PRIVATE_CHAT_TYPE&&(t=await So.contactHasOMEMOSupport(e.get("jid"))),e.set("omemo_supported",t),t&&Cc.settings.get("omemo_default")&&e.set("omemo_active",!0)}function AE(e){e.stopPropagation(),e.preventDefault();const t=uE.ancestor(e.target,"converse-chat-toolbar");if(!t.model.get("omemo_supported")){let e;return e=t.model.get("type")===So.CHATROOMS_TYPE?[Vu("Cannot use end-to-end encryption in this groupchat, either the groupchat has some anonymity or not all participants support OMEMO.")]:[Vu("Cannot use end-to-end encryption because %1$s uses a client that doesn't support OMEMO.",t.model.contact.getDisplayName())],Cc.alert("error",Vu("Error"),e)}t.model.save({omemo_active:!t.model.get("omemo_active")})}function CE(e,t){const n=e.model;let s;if(n.get("type")===So.CHATROOMS_TYPE&&n.get("omemo_supported")){const e=Vu("Messages are being sent in plaintext"),t=Vu("Messages are sent encrypted");s=n.get("omemo_active")?t:e}else s=Vu("This groupchat needs to be members-only and non-anonymous in order to support OMEMO encrypted messages");return t.push(Ha(aE(),s,!n.get("omemo_supported"),AE,n.get("omemo_active")?"fa-lock":"fa-unlock",Cc.settings.get("assets_path"),n.get("omemo_active")?"var(--info-color)":"var(--error-color)")),t}const{Strophe:kE,$msg:OE}=Mc.env,TE={generateFingerprints:async function(e){const t=await wE(e);return Promise.all(t.map((e=>_E(e))))},getDeviceForContact:function(e,t){return wE(e).then((e=>e.get(t)))},contactHasOMEMOSupport:async function(e){return(await wE(e)).length>0},getBundlesAndBuildSessions:async function(e){const t=Vu("Sorry, no devices found to which we can send an OMEMO encrypted message.");let n;if(e.get("type")===So.CHATROOMS_TYPE){const t=await Promise.all(e.occupants.map((e=>wE(e.get("jid")))));n=t.reduce(((e,t)=>function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],s=e;s--;)t[s-1]=arguments[s];return Ft(ve(n)?se(n):[n],Dr(t,1))}(e,t.models)),[])}else if(e.get("type")===So.PRIVATE_CHAT_TYPE){const s=await wE(e.get("jid"));if(0===s.length){const e=new Error(t);throw e.user_facing=!0,e}const i=So.devicelists.get(So.bare_jid).devices;n=[...i.models,...s.models]}const s=So.omemo_store.get("device_id");n=n.filter((e=>e.get("id")!==s)),await Promise.all(n.map((e=>e.getBundle())));const i=n.filter((e=>e)).map((e=>async function(e){if(!e.get("bundle"))return as.error("Could not build an OMEMO session for device ".concat(e.get("id")," because we don't have its bundle")),null;const t=new libsignal.SignalProtocolAddress(e.get("jid"),e.get("id")),n=await So.omemo_store.loadSession(t.toString());if(n)return n;try{return await async function(e){const t=new libsignal.SignalProtocolAddress(e.get("jid"),e.get("id")),n=new libsignal.SessionBuilder(So.omemo_store,t),s=e.getRandomPreKey(),i=await e.getBundle();return n.processPreKey({registrationId:parseInt(e.get("id"),10),identityKey:uE.base64ToArrayBuffer(i.identity_key),signedPreKey:{keyId:i.signed_prekey.id,publicKey:uE.base64ToArrayBuffer(i.signed_prekey.public_key),signature:uE.base64ToArrayBuffer(i.signed_prekey.signature)},preKey:{keyId:s.id,publicKey:uE.base64ToArrayBuffer(s.key)}})}(e)}catch(t){return as.error("Could not build an OMEMO session for device ".concat(e.get("id"))),as.error(t),null}}(e)));if(await Promise.all(i),i.includes(null)&&(n=n.filter((e=>i[n.indexOf(e)])),0===n.length)){const e=new Error(t);throw e.user_facing=!0,e}return n},createOMEMOMessageStanza:function(e,t,n){const s=Vu("This is an OMEMO encrypted message which your client doesnt seem to support. Find more information on https://conversations.im/omemo");if(!t.get("message"))throw new Error("No message body to encrypt!");const i=OE({from:So.connection.jid,to:e.get("jid"),type:e.get("message_type"),id:t.get("msgid")}).c("body").t(s).up();return"chat"===t.get("type")&&i.c("request",{xmlns:kE.NS.RECEIPTS}).up(),i.c("encrypted",{xmlns:kE.NS.OMEMO}).c("header",{sid:So.omemo_store.get("device_id")}),hE.encryptMessage(t.get("message")).then((t=>{const s=n.filter((e=>-1!=e.get("trusted")&&e.get("active"))).map((n=>e.encryptKey(t.key_and_tag,n)));return Promise.all(s).then((e=>function(e,t,n){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s].payload,r=t[s].device,o=3==parseInt(i.type,10);e.c("key",{rid:r.get("id")}).t(btoa(i.body)),o&&e.attrs({prekey:o}),e.up(),s==t.length-1&&e.c("iv").t(n).up().up()}return Promise.resolve(e)}(i,e,t.iv))).then((e=>(e.c("payload").t(t.payload).up().up(),e.c("store",{xmlns:kE.NS.HINTS}),e)))}))}};class NE extends Error{constructor(e,t){super(e,t),this.name="IQError",this.iq=t}}const{Strophe:IE,sizzle:ME,u:RE,$iq:DE}=Mc.env,zE=ao.extend({defaults:{trusted:0,active:!0},getRandomPreKey(){const e=this.get("bundle");return e.prekeys[RE.getRandomInt(e.prekeys.length)]},async fetchBundleFromServer(){const e=DE({type:"get",from:So.bare_jid,to:this.get("jid")}).c("pubsub",{xmlns:IE.NS.PUBSUB}).c("items",{node:"".concat(IE.NS.OMEMO_BUNDLES,":").concat(this.get("id"))});let t;try{t=await Cc.sendIQ(e)}catch(t){return as.error("Could not fetch bundle for device ".concat(this.get("id")," from ").concat(this.get("jid"))),as.error(t),null}if(t.querySelector("error"))throw new NE("Could not fetch bundle",t);const n=ME('items[node="'.concat(IE.NS.OMEMO_BUNDLES,":").concat(this.get("id"),'"]'),t).pop(),s=yE(ME('bundle[xmlns="'.concat(IE.NS.OMEMO,'"]'),n).pop());return this.save("bundle",s),s},getBundle(){return this.get("bundle")?Promise.resolve(this.get("bundle"),this):this.fetchBundleFromServer()}}),{Strophe:LE,$build:PE,$iq:FE,sizzle:BE}=Mc.env,UE=ao.extend({idAttribute:"jid",initialize(){this.initDevices()},initDevices(){this.devices=new So.Devices;const e="converse.devicelist-".concat(So.bare_jid,"-").concat(this.get("jid"));Cr(this.devices,e),this.fetchDevices()},async onDevicesFound(e){if(0===e.length){let e;try{e=await this.fetchDevicesFromServer()}catch(e){null===e?as.error("Timeout error while fetching devices for ".concat(this.get("jid"))):(as.error("Could not fetch devices for ".concat(this.get("jid"))),as.error(e)),this.destroy()}this.get("jid")===So.bare_jid&&await this.publishCurrentDevice(e)}},fetchDevices(){return void 0===this._devices_promise&&(this._devices_promise=new Promise((e=>{this.devices.fetch({success:t=>e(this.onDevicesFound(t)),error:(t,n)=>{as.error(n),e()}})}))),this._devices_promise},async getOwnDeviceId(){let e=So.omemo_store.get("device_id");return this.devices.findWhere({id:e})||(await So.omemo_store.generateBundle(),e=So.omemo_store.get("device_id")),e},async publishCurrentDevice(e){if(this.get("jid")===So.bare_jid){if(await xE(),So.omemo_store)return e.includes(await this.getOwnDeviceId())?void 0:this.publishDevices();as.warn("publishCurrentDevice: omemo_store is not defined, likely a timing issue")}},async fetchDevicesFromServer(){const e=FE({type:"get",from:So.bare_jid,to:this.get("jid")}).c("pubsub",{xmlns:LE.NS.PUBSUB}).c("items",{node:LE.NS.OMEMO_DEVICELIST});let t;try{t=await Cc.sendIQ(e)}catch(e){return as.error(e),[]}const n='list[xmlns="'.concat(LE.NS.OMEMO,'"] device'),s=BE(n,t).map((e=>e.getAttribute("id")));return await Promise.all(s.map((e=>this.devices.create({id:e,jid:this.get("jid")},{promise:!0})))),s},publishDevices(){const e=PE("item",{id:"current"}).c("list",{xmlns:LE.NS.OMEMO});return this.devices.filter((e=>e.get("active"))).forEach((t=>e.c("device",{id:t.get("id")}).up())),Cc.pubsub.publish(null,LE.NS.OMEMO_DEVICELIST,e,{"pubsub#access_model":"open"},!1)},removeOwnDevices(e){if(this.get("jid")!==So.bare_jid)throw new Error("Cannot remove devices from someone else's device list");return e.forEach((e=>this.devices.get(e).destroy())),this.publishDevices()}}),qE=ua.extend({model:UE,getDeviceList(e){return this.get(e)||this.create({jid:e})}}),HE=ua.extend({model:zE});var $E=Math.ceil,GE=Math.max;const VE=function(e,t,n){return n&&"number"!=typeof n&&ut(e,t,n)&&(t=n=void 0),e=Pi(e),void 0===t?(t=e,e=0):t=Pi(t),function(e,t,n,s){for(var i=-1,r=GE($E((t-e)/(n||1)),0),o=Array(r);r--;)o[s?r:++i]=e,e+=n;return o}(e,t,n=void 0===n?e<t?1:-1:Pi(n),void 0)},{Strophe:WE,$build:JE,u:QE}=Mc.env,YE=ao.extend({Direction:{SENDING:1,RECEIVING:2},getIdentityKeyPair(){const e=this.get("identity_keypair");return Promise.resolve({privKey:QE.base64ToArrayBuffer(e.privKey),pubKey:QE.base64ToArrayBuffer(e.pubKey)})},getLocalRegistrationId(){return Promise.resolve(parseInt(this.get("device_id"),10))},isTrustedIdentity(e,t,n){if(null==e)throw new Error("Can't check identity key for invalid key");if(!(t instanceof ArrayBuffer))throw new Error("Expected identity_key to be an ArrayBuffer");const s=this.get("identity_key"+e);return void 0===s?Promise.resolve(!0):Promise.resolve(QE.arrayBufferToBase64(t)===s)},loadIdentityKey(e){if(null==e)throw new Error("Can't load identity_key for invalid identifier");return Promise.resolve(QE.base64ToArrayBuffer(this.get("identity_key"+e)))},saveIdentity(e,t){if(null==e)throw new Error("Can't save identity_key for invalid identifier");const n=new libsignal.SignalProtocolAddress.fromString(e),s=this.get("identity_key"+n.getName()),i=QE.arrayBufferToBase64(t);return this.save("identity_key"+n.getName(),i),s&&i!==s?Promise.resolve(!0):Promise.resolve(!1)},getPreKeys(){return this.get("prekeys")||{}},loadPreKey(e){const t=this.getPreKeys()[e];return t?Promise.resolve({privKey:QE.base64ToArrayBuffer(t.privKey),pubKey:QE.base64ToArrayBuffer(t.pubKey)}):Promise.resolve()},storePreKey(e,t){const n={};return n[e]={pubKey:QE.arrayBufferToBase64(t.pubKey),privKey:QE.arrayBufferToBase64(t.privKey)},this.save("prekeys",Object.assign(this.getPreKeys(),n)),Promise.resolve()},removePreKey(e){return this.save("prekeys",oo(this.getPreKeys(),e)),Promise.resolve()},loadSignedPreKey(e){const t=this.get("signed_prekey");return t?Promise.resolve({privKey:QE.base64ToArrayBuffer(t.privKey),pubKey:QE.base64ToArrayBuffer(t.pubKey)}):Promise.resolve()},storeSignedPreKey(e){if("object"!=typeof e)throw new Error("storeSignedPreKey: expected an object");return this.save("signed_prekey",{id:e.keyId,privKey:QE.arrayBufferToBase64(e.keyPair.privKey),pubKey:QE.arrayBufferToBase64(e.keyPair.pubKey),signature:QE.arrayBufferToBase64(e.signature)}),Promise.resolve()},removeSignedPreKey(e){return this.get("signed_prekey").id===e&&(this.unset("signed_prekey"),this.save()),Promise.resolve()},loadSession(e){return Promise.resolve(this.get("session"+e))},storeSession(e,t){return Promise.resolve(this.save("session"+e,t))},removeSession(e){return Promise.resolve(this.unset("session"+e))},removeAllSessions(e){const t=Object.keys(this.attributes).filter((t=>!!t.startsWith("session"+e)&&t)),n={};return t.forEach((e=>{n[e]=void 0})),this.save(n),Promise.resolve()},publishBundle(){const e=this.get("signed_prekey"),t="".concat(WE.NS.OMEMO_BUNDLES,":").concat(this.get("device_id")),n=JE("item").c("bundle",{xmlns:WE.NS.OMEMO}).c("signedPreKeyPublic",{signedPreKeyId:e.id}).t(e.pubKey).up().c("signedPreKeySignature").t(e.signature).up().c("identityKey").t(this.get("identity_keypair").pubKey).up().c("prekeys");return Object.values(this.get("prekeys")).forEach(((e,t)=>n.c("preKeyPublic",{preKeyId:t}).t(e.pubKey).up())),Cc.pubsub.publish(null,t,n,{"pubsub#access_model":"open"},!1)},async generateMissingPreKeys(){const e=Wo(uf(VE(0,So.NUM_PREKEYS),Number.prototype.toString),Object.keys(this.getPreKeys()));if(e.length<1)return as.warn("No missing prekeys to generate for our own device"),Promise.resolve();(await Promise.all(e.map((e=>libsignal.KeyHelper.generatePreKey(parseInt(e,10)))))).forEach((e=>this.storePreKey(e.keyId,e.keyPair)));const t=Object.keys(this.getPreKeys()).map((e=>({id:e.keyId,key:QE.arrayBufferToBase64(e.pubKey)}))),n=So.devicelists.get(So.bare_jid).devices.get(this.get("device_id")),s=await n.getBundle();n.save("bundle",Object.assign(s,{prekeys:t}))},async generateBundle(){const e=await libsignal.KeyHelper.generateIdentityKeyPair(),t={},n=QE.arrayBufferToBase64(e.pubKey),s=function(){const e=So.devicelists.get(So.bare_jid).devices.pluck("id");let t=libsignal.KeyHelper.generateRegistrationId(),n=0;for(;e.includes(t);)if(t=libsignal.KeyHelper.generateRegistrationId(),n++,10===n)throw new Error("Unable to generate a unique device ID");return t.toString()}();t.identity_key=n,t.device_id=s,this.save({device_id:s,identity_keypair:{privKey:QE.arrayBufferToBase64(e.privKey),pubKey:n},identity_key:n});const i=await libsignal.KeyHelper.generateSignedPreKey(e,0);So.omemo_store.storeSignedPreKey(i),t.signed_prekey={id:i.keyId,public_key:QE.arrayBufferToBase64(i.keyPair.pubKey),signature:QE.arrayBufferToBase64(i.signature)};const r=await Promise.all(VE(0,So.NUM_PREKEYS).map((e=>libsignal.KeyHelper.generatePreKey(e))));r.forEach((e=>So.omemo_store.storePreKey(e.keyId,e.keyPair)));const o=So.devicelists.get(So.bare_jid),a=await o.devices.create({id:t.device_id,jid:So.bare_jid},{promise:!0}),c=r.map((e=>({id:e.keyId,key:QE.arrayBufferToBase64(e.keyPair.pubKey)})));t.prekeys=c,a.save("bundle",t)},fetchSession(){return void 0===this._setup_promise&&(this._setup_promise=new Promise(((e,t)=>{this.fetch({success:()=>{So.omemo_store.get("device_id")?e():this.generateBundle().then(e).catch(t)},error:(n,s)=>{as.warn("Could not fetch OMEMO session from cache, we'll generate a new one."),as.warn(s),this.generateBundle().then(e).catch(t)}})}))),this._setup_promise}}),{Strophe:KE,sizzle:XE,u:ZE}=Mc.env,ej={events:{"change input.select-all":"selectAll","click .generate-bundle":"generateOMEMODeviceBundle","submit .fingerprint-removal":"removeSelectedFingerprints"},initialize(){return this.debouncedRender=Oo(this.render,50),this.devicelist=So.devicelists.get(So.bare_jid),this.listenTo(this.devicelist.devices,"change:bundle",this.debouncedRender),this.listenTo(this.devicelist.devices,"reset",this.debouncedRender),this.listenTo(this.devicelist.devices,"reset",this.debouncedRender),this.listenTo(this.devicelist.devices,"remove",this.debouncedRender),this.listenTo(this.devicelist.devices,"add",this.debouncedRender),this.__super__.initialize.apply(this,arguments)},beforeRender(){const e=So.omemo_store.get("device_id");if(e&&(this.current_device=this.devicelist.devices.get(e)),this.other_devices=this.devicelist.devices.filter((t=>t.get("id")!==e)),this.__super__.beforeRender)return this.__super__.beforeRender.apply(this,arguments)},selectAll(e){let t=ZE.ancestor(e.target,"li");for(;t;)t.querySelector('input[type="checkbox"]').checked=e.target.checked,t=t.nextElementSibling},removeSelectedFingerprints(e){e.preventDefault(),e.stopPropagation(),e.target.querySelector(".select-all").checked=!1;const t=XE('.fingerprint-removal-item input[type="checkbox"]:checked',e.target).map((e=>e.value));this.devicelist.removeOwnDevices(t).then(this.modal.hide).catch((e=>{as.error(e),So.api.alert(KE.LogLevel.ERROR,Vu("Error"),[Vu("Sorry, an error occurred while trying to remove the devices.")])}))},generateOMEMODeviceBundle(e){e.preventDefault(),confirm(Vu("Are you sure you want to generate new OMEMO keys? This will remove your old keys and all previously encrypted messages will no longer be decryptable on this device."))&&Cc.omemo.bundle.generate()}},tj={events:{"click .fingerprint-trust .btn input":"toggleDeviceTrust"},initialize(){const e=this.model.get("jid");return this.devicelist=So.devicelists.getDeviceList(e),this.listenTo(this.devicelist.devices,"change:bundle",this.render),this.listenTo(this.devicelist.devices,"change:trusted",this.render),this.listenTo(this.devicelist.devices,"remove",this.render),this.listenTo(this.devicelist.devices,"add",this.render),this.listenTo(this.devicelist.devices,"reset",this.render),this.__super__.initialize.apply(this,arguments)},toggleDeviceTrust(e){const t=e.target;this.devicelist.devices.get(t.getAttribute("name")).save("trusted",parseInt(t.value,10))}},nj={omemo:{bundle:{generate:async()=>{const e=So.devicelists.get(So.bare_jid),t=So.omemo_store.get("device_id");if(t){const n=e.devices.get(t);So.omemo_store.unset(t),n&&await new Promise((e=>n.destroy({success:e,error:e}))),e.devices.trigger("remove")}await So.omemo_store.generateBundle(),await e.publishDevices();const n=_E(e.devices.get(So.omemo_store.get("device_id")));return await So.omemo_store.publishBundle(),n}}}},{Strophe:sj,sizzle:ij}=Mc.env,rj={encryptKey:(e,t)=>pE(t.get("jid"),t.get("id")).encrypt(e).then((e=>({payload:e,device:t}))),handleMessageSendError(e){if("IQError"===e.name){this.save("omemo_supported",!1);const t=[];ij('presence-subscription-required[xmlns="'.concat(sj.NS.PUBSUB_ERROR,'"]'),e.iq).length?t.push(Vu("Sorry, we're unable to send an encrypted message because %1$s requires you to be subscribed to their presence in order to see their OMEMO information",e.iq.getAttribute("from"))):ij('remote-server-not-found[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]',e.iq).length?t.push(Vu("Sorry, we're unable to send an encrypted message because the remote server for %1$s could not be found",e.iq.getAttribute("from"))):(t.push(Vu("Unable to send an encrypted message due to an unexpected error.")),t.push(e.iq.outerHTML)),Cc.alert("error",Vu("Error"),t),as.error(e)}else{if(!e.user_facing)throw e;Cc.alert("error",Vu("Error"),[e.message]),as.error(e)}}},{Strophe:oj}=Mc.env;Mc.env.omemo=hE,oj.addNamespace("OMEMO_DEVICELIST",oj.NS.OMEMO+".devicelist"),oj.addNamespace("OMEMO_VERIFICATION",oj.NS.OMEMO+".verification"),oj.addNamespace("OMEMO_WHITELISTED",oj.NS.OMEMO+".whitelisted"),oj.addNamespace("OMEMO_BUNDLES",oj.NS.OMEMO+".bundles"),Mc.plugins.add("converse-omemo",{enabled:e=>window.libsignal&&e.config.get("trusted")&&!Cc.settings.get("clear_cache_on_logout")&&!e.api.settings.get("blacklisted_plugins").includes("converse-omemo"),dependencies:["converse-chatview","converse-pubsub","converse-profile"],overrides:{ProfileModal:ej,UserDetailsModal:tj,ChatBox:oE},initialize(){Cc.settings.extend({omemo_default:!1}),Cc.promises.add(["OMEMOInitialized"]),So.NUM_PREKEYS=100,Object.assign(So.ChatBox.prototype,rj),Object.assign(So,TE),Object.assign(So.api,nj),So.OMEMOStore=YE,So.Device=zE,So.Devices=HE,So.DeviceList=UE,So.DeviceLists=qE,Cc.waitUntil("chatBoxesInitialized").then(gE),Cc.listen.on("parseMessage",fE),Cc.listen.on("parseMUCMessage",fE),Cc.listen.on("chatBoxViewInitialized",mE),Cc.listen.on("chatRoomViewInitialized",mE),Cc.listen.on("connected",SE),Cc.listen.on("getToolbarButtons",CE),Cc.listen.on("statusInitialized",EE),Cc.listen.on("addClientFeatures",(()=>Cc.disco.own.features.add("".concat(oj.NS.OMEMO_DEVICELIST,"+notify")))),Cc.listen.on("userDetailsModalInitialized",(e=>{const t=e.get("jid");So.generateFingerprints(t).catch((e=>as.error(e)))})),Cc.listen.on("profileModalInitialized",(()=>{So.generateFingerprints(So.bare_jid).catch((e=>as.error(e)))})),Cc.listen.on("afterTearDown",(()=>delete So.omemo_store)),Cc.listen.on("clearSession",(()=>{So.shouldClearCache()&&So.devicelists&&(So.devicelists.clearStore(),delete So.devicelists)}))}});const{Strophe:aj,$iq:cj}=Mc.env;function lj(){const e=hj(['\n <input\n type="button"\n class="btn btn-secondary button-cancel"\n value="','"\n />\n ']);return lj=function(){return e},e}function uj(){const e=hj(['\n <input type="submit" class="btn btn-primary" value="','" />\n ']);return uj=function(){return e},e}function dj(){const e=hj(['\n <form id="converse-register" class="converse-form">\n <legend class="col-form-label">'," ",'</legend>\n <p class="title">','</p>\n <p class="form-help instructions">','</p>\n <div class="form-errors hidden"></div>\n ','\n\n <fieldset class="buttons form-group">\n ',"\n ",'\n <div class="switch-form">\n <p>','</p>\n <p><a class="login-here toggle-register-login" href="#converse/login">',"</a></p>\n </div>\n </fieldset>\n </form>\n "]);return dj=function(){return e},e}function hj(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function fj(){const e=yj(["\n <converse-brand-logo></converse-brand-logo>\n ","\n ","\n ","\n "]);return fj=function(){return e},e}function gj(){const e=yj(['\n <form id="converse-register" class="converse-form">\n <legend class="col-form-label">','</legend>\n <div class="form-group">\n <label>','</label>\n <div class="form-errors hidden"></div>\n ',"\n </div>\n ","\n </form>\n "]);return gj=function(){return e},e}function mj(){const e=yj(['\n <fieldset class="form-group buttons">\n <input class="btn btn-primary" type="submit" value="','" />\n </fieldset>\n <div class="switch-form">\n <p>','</p>\n <p><a class="login-here toggle-register-login" href="#converse/login">',"</a></p>\n </div>\n "]);return mj=function(){return e},e}function pj(){const e=yj(['\n <input class="form-control" required="required" type="text" name="domain" placeholder="','" />\n <p class="form-text text-muted">\n ','\n <a href="','" class="url" target="_blank" rel="noopener">',"</a>.\n </p>\n "]);return pj=function(){return e},e}function vj(){const e=yj(['\n <button class="btn btn-secondary button-cancel hor_centered">',"</button>\n "]);return vj=function(){return e},e}function bj(){const e=yj(['\n <form id="converse-register" class="converse-form no-scrolling">\n ','\n <p class="info">',"</p>\n ","\n </form>\n "]);return bj=function(){return e},e}function yj(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}aj.addNamespace("PUSH","urn:xmpp:push:0"),Mc.plugins.add("converse-push",{initialize(){async function e(e){e=e||So.bare_jid;const t=So.session.get("push_enabled")||[];if(t.includes(e))return;const n=Cc.settings.get("push_app_servers").filter((e=>!e.disable)),s=Cc.settings.get("push_app_servers").filter((e=>e.disable)),i=n.map((t=>async function(e,t){if(!t.jid||!t.node)return;if(!await Cc.disco.getIdentity("pubsub","push",t.jid))return as.warn('Not enabling push the service "'.concat(t.jid,"\", it doesn't have the right disco identtiy."));const n=await Promise.all([Cc.disco.supports(aj.NS.PUSH,t.jid),Cc.disco.supports(aj.NS.PUSH,e)]);if(!n[0]&&!n[1])return void as.warn('Not enabling push app server "'.concat(t.jid,'", no disco support from your server.'));const s=cj({type:"set"});return e!==So.bare_jid&&s.attrs({to:e}),s.c("enable",{xmlns:aj.NS.PUSH,jid:t.jid,node:t.node}),t.secret&&s.c("x",{xmlns:aj.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE"}).c("value").t("".concat(aj.NS.PUBSUB,"#publish-options")).up().up().c("field",{var:"secret"}).c("value").t(t.secret),Cc.sendIQ(s)}(e,t))),r=s.map((t=>async function(e,t){if(!t.jid)return;if(!await Cc.disco.supports(aj.NS.PUSH,e||So.bare_jid))return void as.warn('Not disabling push app server "'.concat(t.jid,'", no disco support from your server.'));const n=cj({type:"set"});e!==So.bare_jid&&n.attrs({to:e}),n.c("disable",{xmlns:aj.NS.PUSH,jid:t.jid}),t.node&&n.attrs({node:t.node}),Cc.sendIQ(n).catch((e=>{as.error("Could not disable push app server for ".concat(t.jid)),as.error(e)}))}(e,t)));try{await Promise.all(i.concat(r))}catch(e){as.error("Could not enable or disable push App Server"),e&&as.error(e)}finally{t.push(e)}So.session.save("push_enabled",t)}function t(t){t.get("type")==So.CHATROOMS_TYPE&&e(aj.getDomainFromJid(t.get("jid")))}Cc.settings.extend({push_app_servers:[],enable_muc_push:!1}),Cc.listen.on("statusInitialized",(()=>e())),Cc.settings.get("enable_muc_push")&&Cc.listen.on("chatBoxesInitialized",(()=>So.chatboxes.on("add",t)))}});const _j=e=>Ha(fj(),0===e.model.get("registration_status")?(()=>{const e=Cc.settings.get("registration_domain"),t=Vu("Create your account"),n=Vu("Please enter the XMPP provider to register with:");return Ha(gj(),t,n,e||(()=>{const e=Cc.settings.get("domain_placeholder"),t=Vu("Tip: A list of public XMPP providers is available"),n=Vu("here"),s=Cc.settings.get("providers_link");return Ha(pj(),e,t,s,n)})(),e?"":(()=>{const e=Vu("Fetch registration form"),t=Vu("Already have a chat account?"),n=Vu("Log in here");return Ha(mj(),e,t,n)})())})():"",1===e.model.get("registration_status")?(()=>{const e=Cc.settings.get("registration_domain"),t=Vu("Hold tight, we're fetching the registration form…"),n=Vu("Cancel");return Ha(bj(),Zp({classes:"hor_centered"}),t,e?"":Ha(vj(),n))})():"",2===e.model.get("registration_status")?(e=>{const t=Vu("Choose a different provider"),n=Vu("Already have a chat account?"),s=Vu("Account Registration:"),i=Vu("Log in here"),r=Vu("Register"),o=Cc.settings.get("registration_domain");return Ha(dj(),s,e.domain,e.title,e.instructions,e.form_fields,e.fields?Ha(uj(),r):"",o?"":Ha(lj(),t),n,i)})(e):"");function wj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Strophe:Sj,sizzle:xj,$iq:Ej}=Mc.env,jj=Mc.env.utils,Aj=1,Cj=2;Cc.elements.define("converse-register-panel",class extends yf{constructor(...e){super(...e),wj(this,"id","converse-register-panel"),wj(this,"className","controlbox-pane fade-in"),wj(this,"events",{"submit form#converse-register":"onFormSubmission","click .button-cancel":"renderProviderChoiceForm"})}initialize(){this.reset();const e=So.chatboxes.get("controlbox");this.model=e,this.listenTo(So,"connectionInitialized",this.registerHooks),this.listenTo(this.model,"change:registration_status",this.render);const t=Cc.settings.get("registration_domain");t?this.fetchRegistrationForm(t):this.model.set("registration_status",0)}render(){Wa(_j({domain:this.domain,fields:this.fields,form_fields:this.form_fields,instructions:this.instructions,model:this.model,title:this.title}),this)}registerHooks(){const e=So.connection,t=e._connect_cb.bind(e);e._connect_cb=(e,n,s)=>{this._registering?this.getRegistrationFields(e,n)&&(this._registering=!1):t(e,n,s)}}connectedCallback(){super.connectedCallback(),this.render()}getRegistrationFields(e,t){const n=So.connection;n.connected=!0;const s=n._proto._reqToData(e);if(!s)return;if(n._proto._connect_cb(s)===Sj.Status.CONNFAIL)return this.showValidationError(Vu("Sorry, we're unable to connect to your chosen provider.")),!1;const i=s.getElementsByTagName("register"),r=s.getElementsByTagName("mechanism");if(0===i.length&&0===r.length)return n._proto._no_auth_received(t),!1;if(0===i.length)return n._changeConnectStatus(Sj.Status.REGIFAIL),this.showValidationError(Vu("Sorry, the given provider does not support in band account registration. Please try with a different provider.")),!0;n._addSysHandler(this.onRegistrationFields.bind(this),null,"iq",null,null);const o=Ej({type:"get"}).c("query",{xmlns:Sj.NS.REGISTER}).tree();return o.setAttribute("id",n.getUniqueId("sendIQ")),n.send(o),n.connected=!1,!0}onRegistrationFields(e){return"error"===e.getAttribute("type")?(So.connection._changeConnectStatus(Sj.Status.REGIFAIL,Vu('Something went wrong while establishing a connection with "%1$s". Are you sure it exists?',this.domain)),!1):1!==e.getElementsByTagName("query").length?(So.connection._changeConnectStatus(Sj.Status.REGIFAIL,"unknown"),!1):(this.setFields(e),this.model.get("registration_status")===Aj&&this.renderRegistrationForm(e),!1)}reset(e){const t={fields:{},urls:[],title:"",instructions:"",registered:!1,_registering:!1,domain:null,form_type:null};Object.assign(this,t),e&&Object.assign(this,Pr(e,Object.keys(t)))}onFormSubmission(e){e&&e.preventDefault&&e.preventDefault(),null===e.target.querySelector("input[name=domain]")?this.submitRegistrationForm(e.target):this.onProviderChosen(e.target)}onProviderChosen(e){const t=e.querySelector("input[name=domain]"),n=null==t?void 0:t.value;n?(e.querySelector("input[type=submit]").classList.add("hidden"),this.fetchRegistrationForm(n.trim())):t.classList.add("error")}async fetchRegistrationForm(e){var t;return this.model.set("registration_status",Aj),this.reset({domain:Sj.getDomainFromJid(e),_registering:!0}),await So.initConnection(this.domain),null===(t=So.connection)||void 0===t||t.connect(this.domain,"",(e=>this.onConnectStatusChanged(e))),!1}giveFeedback(e,t){let n=this.querySelector(".reg-feedback");null!==n&&n.parentNode.removeChild(n);const s=this.querySelector("form");s.insertAdjacentHTML("afterbegin",'<span class="reg-feedback"></span>'),n=s.querySelector(".reg-feedback"),n.textContent=e,t&&n.classList.add(t)}showSpinner(){const e=this.querySelector("form");return Wa(Zp(),e),this}onConnectStatusChanged(e){as.debug("converse-register: onConnectStatusChanged"),[Sj.Status.DISCONNECTED,Sj.Status.CONNFAIL,Sj.Status.REGIFAIL,Sj.Status.NOTACCEPTABLE,Sj.Status.CONFLICT].includes(e)?(as.error("Problem during registration: Strophe.Status is ".concat(So.CONNECTION_STATUS[e])),this.abortRegistration()):e===Sj.Status.REGISTERED&&(as.debug("Registered successfully."),So.connection.reset(),this.showSpinner(),["converse/login","converse/register"].includes(So.router.history.getFragment())&&So.router.navigate("",{replace:!0}),this.fields.password&&this.fields.username?(So.connection.connect(this.fields.username.toLowerCase()+"@"+this.domain.toLowerCase(),this.fields.password,So.onConnectStatusChanged),this.giveFeedback(Vu("Now logging you in"),"info")):So.giveFeedback(Vu("Registered successfully")),this.reset())}getLegacyFormFields(){return[...Object.keys(this.fields).map((e=>"username"===e?qm({domain:" @".concat(this.domain),name:e,type:"text",label:e,value:"",required:!0}):Im({label:e,name:e,placeholder:e,required:!0,type:"password"===e||"email"===e?e:"text",value:""}))),...this.urls.map((e=>Pm({label:"",value:e})))]}getFormFields(e){return"xform"===this.form_type?Array.from(e.querySelectorAll("field")).map((t=>nu.xForm2TemplateResult(t,e,{domain:this.domain}))):this.getLegacyFormFields()}renderRegistrationForm(e){this.form_fields=this.getFormFields(e),this.model.set("registration_status",Cj)}showValidationError(e){const t=this.querySelector("form");let n=t.querySelector(".form-errors");if(null===n){n='<div class="form-errors hidden"></div>';const e=t.querySelector("p.instructions");null===e?t.insertAdjacentHTML("afterbegin",n):e.insertAdjacentHTML("afterend",n),n=t.querySelector(".form-errors")}else n.innerHTML="";n.insertAdjacentHTML("beforeend",'<p class="form-help error">'+e+"</p>"),n.classList.remove("hidden")}reportErrors(e){const t=e.querySelectorAll("error");if(t.forEach((e=>this.showValidationError(e.textContent))),!t.length){const e=Vu("The provider rejected your registration attempt. Please check the values you entered for correctness.");this.showValidationError(e)}}renderProviderChoiceForm(e){e&&e.preventDefault&&e.preventDefault(),So.connection._proto._abortAllRequests(),So.connection.reset(),this.render()}abortRegistration(){So.connection._proto._abortAllRequests(),So.connection.reset(),[Aj,Cj].includes(this.model.get("registration_status"))?Cc.settings.get("registration_domain")&&this.fetchRegistrationForm(Cc.settings.get("registration_domain")):this.render()}submitRegistrationForm(e){if(Array.from(this.querySelectorAll("input.required")).reduce(((e,t)=>""===t.value?(t.classList.add("error"),e+1):e),0))return;const t=xj(":input:not([type=button]):not([type=submit])",e),n=Ej({type:"set",id:jj.getUniqueId()}).c("query",{xmlns:Sj.NS.REGISTER});"xform"===this.form_type?(n.c("x",{xmlns:Sj.NS.XFORM,type:"submit"}),t.map((e=>nu.webForm2xForm(e))).filter((e=>e)).forEach((e=>n.cnode(e).up()))):t.forEach((e=>n.c(e.getAttribute("name"),{},e.value))),So.connection._addSysHandler(this._onRegisterIQ.bind(this),null,"iq",null,null),So.connection.send(n),this.setFields(n.tree())}setFields(e){const t=e.querySelector("query"),n=xj('x[xmlns="'.concat(Sj.NS.XFORM,'"]'),t);n.length>0?this._setFieldsFromXForm(n.pop()):this._setFieldsFromLegacy(t)}_setFieldsFromLegacy(e){[].forEach.call(e.children,(e=>{"instructions"!==e.tagName.toLowerCase()?"x"!==e.tagName.toLowerCase()?this.fields[e.tagName.toLowerCase()]=Sj.getText(e):"jabber:x:oob"===e.getAttribute("xmlns")&&this.urls.concat(xj("url",e).map((e=>e.textContent))):this.instructions=Sj.getText(e)})),this.form_type="legacy"}_setFieldsFromXForm(e){var t,n;this.title=null===(t=e.querySelector("title"))||void 0===t?void 0:t.textContent,this.instructions=null===(n=e.querySelector("instructions"))||void 0===n?void 0:n.textContent,e.querySelectorAll("field").forEach((e=>{const t=e.getAttribute("var");var n,s;t?this.fields[t.toLowerCase()]=null!==(n=null===(s=e.querySelector("value"))||void 0===s?void 0:s.textContent)&&void 0!==n?n:"":as.warn("Found field we couldn't parse")})),this.form_type="xform"}_onRegisterIQ(e){if("error"===e.getAttribute("type")){as.error("Registration failed."),this.reportErrors(e);let t=e.getElementsByTagName("error");if(1!==t.length)return So.connection._changeConnectStatus(Sj.Status.REGIFAIL,"unknown"),!1;t=t[0].firstElementChild.tagName.toLowerCase(),"conflict"===t?So.connection._changeConnectStatus(Sj.Status.CONFLICT,t):"not-acceptable"===t?So.connection._changeConnectStatus(Sj.Status.NOTACCEPTABLE,t):So.connection._changeConnectStatus(Sj.Status.REGIFAIL,t)}else So.connection._changeConnectStatus(Sj.Status.REGISTERED,null);return!1}});const{Strophe:kj}=Mc.env;kj.addNamespace("REGISTER","jabber:iq:register");const Oj=Object.keys(kj.Status).reduce(((e,t)=>Math.max(e,kj.Status[t])),0);function Tj(){const e=Rj(['<div class="form-group">',"</div>"]);return Tj=function(){return e},e}function Nj(){const e=Rj(['<label class="roomid-policy-error">',"</label>"]);return Nj=function(){return e},e}function Ij(){const e=Rj(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="add-chatroom-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body">\n <span class="modal-alert"></span>\n <form class="converse-form add-chatroom">\n <div class="form-group">\n <label for="chatroom">',":</label>\n ",'\n <input type="text" required="required" name="chatroom" class="form-control roomjid-input" placeholder="','"/>\n </div>\n ',"\n ",'\n <input type="submit" class="btn btn-primary" name="join" value="','" ?disabled=',">\n </form>\n </div>\n </div>\n </div>\n "]);return Ij=function(){return e},e}function Mj(){const e=Rj(['\n <div class="form-group" >\n <label for="nickname">',':</label>\n <input type="text" title="','" required="required" name="nickname" value="','" class="form-control"/>\n </div>\n ']);return Mj=function(){return e},e}function Rj(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}kj.Status.REGIFAIL=Oj+1,kj.Status.REGISTERED=Oj+2,kj.Status.CONFLICT=Oj+3,kj.Status.NOTACCEPTABLE=Oj+5,Mc.plugins.add("converse-register",{dependencies:["converse-controlbox"],enabled:()=>!0,initialize(){async function e(e){await Cc.waitUntil("controlBoxInitialized"),So.chatboxes.get("controlbox").set({"active-form":e})}So.CONNECTION_STATUS[kj.Status.REGIFAIL]="REGIFAIL",So.CONNECTION_STATUS[kj.Status.REGISTERED]="REGISTERED",So.CONNECTION_STATUS[kj.Status.CONFLICT]="CONFLICT",So.CONNECTION_STATUS[kj.Status.NOTACCEPTABLE]="NOTACCEPTABLE",Cc.settings.extend({allow_registration:!0,domain_placeholder:Vu(" e.g. conversejs.org"),providers_link:"https://compliance.conversations.im/",registration_domain:""}),So.router.route("converse/login",(()=>e("login"))),So.router.route("converse/register",(()=>e("register"))),Cc.listen.on("controlBoxInitialized",(e=>{e.model.on("change:active-form",e.showLoginOrRegisterForm,e)}))}});const Dj=Mc.env.utils,{Strophe:zj}=Mc.env,Lj=og.extend({persistent:!0,id:"add-chatroom-modal",events:{"submit form.add-chatroom":"openChatRoom","keyup .roomjid-input":"checkRoomidPolicy","change .roomjid-input":"checkRoomidPolicy"},initialize(){og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:muc_domain",this.render),this.muc_roomid_policy_error_msg=null},toHTML(){let e="";if(!Cc.settings.get("locked_muc_domain")){const t=this.model.get("muc_domain")||Cc.settings.get("muc_domain");e=t?"name@".concat(t):Vu("name@conference.example.org")}return(e=>{const t=Vu("Join"),n=Vu("Enter a new Groupchat");return Ha(Ij(),n,dg,e.label_room_address,e.muc_roomid_policy_error_msg?Ha(Nj(),e.muc_roomid_policy_error_msg):"",e.chatroom_placeholder,e.muc_roomid_policy_hint?Ha(Tj(),Tv(Er.filterXSS(e.muc_roomid_policy_hint,{whiteList:{b:[],br:[],em:[]}}))):"",e._converse.locked_muc_nickname?"":(e=>{const t=Vu("Nickname"),n=Vu("This field is required");return Ha(Mj(),t,n,e.nick||"")})(e),t||"",e.muc_roomid_policy_error_msg)})(Object.assign(this.model.toJSON(),{_converse:So,label_room_address:Cc.settings.get("muc_domain")?Vu("Groupchat name"):Vu("Groupchat address"),chatroom_placeholder:e,muc_roomid_policy_error_msg:this.muc_roomid_policy_error_msg,muc_roomid_policy_hint:Cc.settings.get("muc_roomid_policy_hint")}))},afterRender(){this.el.addEventListener("shown.bs.modal",(()=>{this.el.querySelector('input[name="chatroom"]').focus()}),!1)},parseRoomDataFromEvent(e){const t=new FormData(e),n=t.get("chatroom");let s;if(Cc.settings.get("locked_muc_nickname")){if(s=So.getDefaultMUCNickname(),!s)throw new Error("Using locked_muc_nickname but no nickname found!")}else s=t.get("nickname").trim();return{jid:n,nick:s}},openChatRoom(e){e.preventDefault();const t=this.parseRoomDataFromEvent(e.target);let n;""===t.nick&&(t.nick=void 0),Cc.settings.get("locked_muc_domain")||Cc.settings.get("muc_domain")&&!Dj.isValidJID(t.jid)?n="".concat(zj.escapeNode(t.jid),"@").concat(Cc.settings.get("muc_domain")):(n=t.jid,this.model.setDomain(n)),Cc.rooms.open(n,Object.assign(t,{jid:n}),!0),this.modal.hide(),e.target.reset()},checkRoomidPolicy(){if(Cc.settings.get("muc_roomid_policy")&&Cc.settings.get("muc_domain")){let e=this.el.querySelector(".roomjid-input").value;!Mc.locked_muc_domain&&Dj.isValidJID(e)||(e="".concat(zj.escapeNode(e),"@").concat(Cc.settings.get("muc_domain")));const t=zj.getNodeFromJid(e),n=zj.getDomainFromJid(e);Cc.settings.get("muc_domain")!==n||Cc.settings.get("muc_roomid_policy").test(t)?this.muc_roomid_policy_error_msg=null:this.muc_roomid_policy_error_msg=Vu("Groupchat id is invalid."),this.render()}}}),Pj=function(e){return e&&e.length?e[0]:void 0};function Fj(){const e=$j(['<li class="list-group-item active">',"</li>"]);return Fj=function(){return e},e}function Bj(){const e=$j(['<li class="list-group-item"> '," </li>"]);return Bj=function(){return e},e}function Uj(){const e=$j(['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="muc-list-modal-label">',"</h5>\n ",'\n </div>\n <div class="modal-body d-flex flex-column">\n <span class="modal-alert"></span>\n ','\n <ul class="available-chatrooms list-group">\n ',"\n ","\n ",'\n </ul>\n </div>\n <div class="modal-footer">',"</div>\n </div>\n </div>\n "]);return Uj=function(){return e},e}function qj(){const e=$j(['\n <li class="room-item list-group-item">\n <div class="available-chatroom d-flex flex-row">\n <a class="open-room available-room w-100"\n @click=','\n data-room-jid="','"\n data-room-name="','"\n title="','"\n href="#">','</a>\n <a class="right room-info icon-room-info"\n @click=','\n data-room-jid="','"\n title="','"\n href="#"></a>\n </div>\n </li>\n ']);return qj=function(){return e},e}function Hj(){const e=$j(['\n <form class="converse-form list-chatrooms"\n @submit=','>\n <div class="form-group">\n <label for="chatroom">',':</label>\n <input type="text"\n @change=','\n value="','"\n required="required"\n name="server"\n class="form-control"\n placeholder="','"/>\n </div>\n <input type="submit" class="btn btn-primary" name="list" value="','"/>\n </form>\n ']);return Hj=function(){return e},e}function $j(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Gj(){const e=sA(['<li class="room-info">',"</li>"]);return Gj=function(){return e},e}function Vj(){const e=sA(['<li class="room-info">',"</li>"]);return Vj=function(){return e},e}function Wj(){const e=sA(['<li class="room-info">',"</li>"]);return Wj=function(){return e},e}function Jj(){const e=sA(['<li class="room-info">',"</li>"]);return Jj=function(){return e},e}function Qj(){const e=sA(['<li class="room-info">',"</li>"]);return Qj=function(){return e},e}function Yj(){const e=sA(['<li class="room-info">',"</li>"]);return Yj=function(){return e},e}function Kj(){const e=sA(['<li class="room-info">',"</li>"]);return Kj=function(){return e},e}function Xj(){const e=sA(['<li class="room-info">',"</li>"]);return Xj=function(){return e},e}function Zj(){const e=sA(['<li class="room-info">',"</li>"]);return Zj=function(){return e},e}function eA(){const e=sA(['<li class="room-info">',"</li>"]);return eA=function(){return e},e}function tA(){const e=sA(['<li class="room-info locked">',"</li>"]);return tA=function(){return e},e}function nA(){const e=sA(['\n <div class="room-info">\n <p class="room-info"><strong>',"</strong> ",'</p>\n <p class="room-info"><strong>',"</strong> ",'</p>\n <p class="room-info"><strong>',"</strong> ",'</p>\n <p class="room-info"><strong>',"</strong>\n <ul>\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n </ul>\n </p>\n </div>\n"]);return nA=function(){return e},e}function sA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{Strophe:iA,$iq:rA,sizzle:oA}=Mc.env,aA=Mc.env.utils;const cA=og.extend({id:"muc-list-modal",persistent:!0,initialize(){this.items=[],this.loading_items=!1,og.prototype.initialize.apply(this,arguments),Cc.settings.get("muc_domain")&&!this.model.get("muc_domain")&&this.model.save("muc_domain",Cc.settings.get("muc_domain")),this.listenTo(this.model,"change:muc_domain",this.onDomainChange),this.el.addEventListener("shown.bs.modal",(()=>Cc.settings.get("locked_muc_domain")?this.updateRoomsList():this.el.querySelector('input[name="server"]').focus()))},toHTML(){const e=this.model.get("muc_domain")||Cc.settings.get("muc_domain");return(e=>{const t=Vu("Query for Groupchats");return Ha(Uj(),t,dg,e.show_form?(e=>{const t=Vu("Show groupchats"),n=Vu("Server address");return Ha(Hj(),e.submitForm,n,e.setDomainFromEvent,e.muc_domain||"",e.server_placeholder,t)})(e):"",e.loading_items?Ha(Bj(),Zp()):"",e.feedback_text?Ha(Fj(),e.feedback_text):"",Rf(e.items,(e=>e.jid),(t=>((e,t)=>{const n=Vu("Show more information on this groupchat"),s=Vu("Click to open this groupchat");return Ha(qj(),e.openRoom,t.jid,t.name,s,t.name||t.jid,e.toggleRoomInfo,t.jid,n)})(e,t))),ug)})(Object.assign(this.model.toJSON(),{show_form:!Cc.settings.get("locked_muc_domain"),server_placeholder:e||Vu("conference.example.org"),items:this.items,loading_items:this.loading_items,openRoom:e=>this.openRoom(e),setDomainFromEvent:e=>this.setDomainFromEvent(e),submitForm:e=>this.showRooms(e),toggleRoomInfo:e=>this.toggleRoomInfo(e)}))},openRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid"),n=e.target.getAttribute("data-room-name");this.modal.hide(),Cc.rooms.open(t,{name:n},!0)},toggleRoomInfo(e){e.preventDefault(),function(e){const t=aA.ancestor(e.target,".room-item"),n=t.querySelector("div.room-info");n?(aA.slideIn(n).then(aA.removeElement),t.querySelector("a.room-info").classList.remove("selected")):(t.insertAdjacentElement("beforeend",aA.getElementFromTemplateResult(Zp())),Cc.disco.info(e.target.getAttribute("data-room-jid"),null).then((e=>function(e,t){var n,s;e.querySelector("span.spinner").remove(),e.querySelector("a.room-info").classList.add("selected"),e.insertAdjacentHTML("beforeEnd",aA.getElementFromTemplateResult((e=>{const t=Vu("Description:"),n=Vu("Groupchat Address (JID):"),s=Vu("Participants:"),i=Vu("Features:"),r=Vu("Requires authentication"),o=Vu("Hidden"),a=Vu("Requires an invitation"),c=Vu("Moderated"),l=Vu("Non-anonymous"),u=Vu("Open"),d=Vu("Permanent"),h=Vu("Public"),f=Vu("Semi-anonymous"),g=Vu("Temporary"),m=Vu("Unmoderated");return Ha(nA(),n,e.jid,t,e.desc,s,e.occ,i,e.passwordprotected?Ha(tA(),r):"",e.hidden?Ha(eA(),o):"",e.membersonly?Ha(Zj(),a):"",e.moderated?Ha(Xj(),c):"",e.nonanonymous?Ha(Kj(),l):"",e.open?Ha(Yj(),u):"",e.persistent?Ha(Qj(),d):"",e.publicroom?Ha(Jj(),h):"",e.semianonymous?Ha(Wj(),f):"",e.temporary?Ha(Vj(),g):"",e.unmoderated?Ha(Gj(),m):"")})({jid:t.getAttribute("from"),desc:null===(n=Pj(oA('field[var="muc#roominfo_description"] value',t)))||void 0===n?void 0:n.textContent,occ:null===(s=Pj(oA('field[var="muc#roominfo_occupants"] value',t)))||void 0===s?void 0:s.textContent,hidden:oA('feature[var="muc_hidden"]',t).length,membersonly:oA('feature[var="muc_membersonly"]',t).length,moderated:oA('feature[var="muc_moderated"]',t).length,nonanonymous:oA('feature[var="muc_nonanonymous"]',t).length,open:oA('feature[var="muc_open"]',t).length,passwordprotected:oA('feature[var="muc_passwordprotected"]',t).length,persistent:oA('feature[var="muc_persistent"]',t).length,publicroom:oA('feature[var="muc_publicroom"]',t).length,semianonymous:oA('feature[var="muc_semianonymous"]',t).length,temporary:oA('feature[var="muc_temporary"]',t).length,unmoderated:oA('feature[var="muc_unmoderated"]',t).length})))}(t,e))).catch((e=>as.error(e))))}(e)},onDomainChange(){Cc.settings.get("auto_list_rooms")&&this.updateRoomsList()},onRoomsFound(e){this.loading_items=!1;const t=e?oA("query item",e):[];return t.length?(this.model.set({feedback_text:Vu("Groupchats found")},{silent:!0}),this.items=t.map(nl)):(this.items=[],this.model.set({feedback_text:Vu("No groupchats found")},{silent:!0})),this.render(),!0},updateRoomsList(){const e=rA({to:this.model.get("muc_domain"),from:So.connection.jid,type:"get"}).c("query",{xmlns:iA.NS.DISCO_ITEMS});Cc.sendIQ(e).then((e=>this.onRoomsFound(e))).catch((()=>this.onRoomsFound()))},showRooms(e){e.preventDefault(),this.loading_items=!0,this.render();const t=new FormData(e.target);this.model.setDomain(t.get("server")),this.updateRoomsList()},setDomainFromEvent(e){this.model.setDomain(e.target.value)},setNick(e){this.model.save({nick:e.target.value})}});function lA(){const e=mA(['\n <div class="d-flex controlbox-padded">\n <span class="w-100 controlbox-heading controlbox-heading--groupchats">','</span>\n <a class="controlbox-heading__btn show-list-muc-modal fa fa-list-ul"\n @click=','\n title="','" data-toggle="modal" data-target="#muc-list-modal"></a>\n <a class="controlbox-heading__btn show-add-muc-modal fa fa-plus"\n @click=','\n title="','" data-toggle="modal" data-target="#add-chatrooms-modal"></a>\n </div>\n\n <div class="list-container list-container--openrooms ','">\n <a class="list-toggle open-rooms-toggle controlbox-padded" title="','" @click=','>\n <span class="fa ','"></span> ','</a>\n <div class="items-list rooms-list open-rooms-list ','">\n ',"\n </div>\n </div>"]);return lA=function(){return e},e}function uA(){const e=mA(['\n <div class="list-item controlbox-padded available-chatroom d-flex flex-row '," ",'"\n data-room-jid="','">\n\n ','\n\n <a class="list-item-link open-room available-room w-100"\n data-room-jid="','"\n title="','"\n @click=',">","</a>\n\n ",'\n\n <a class="list-item-action room-info fa fa-info-circle"\n data-room-jid="','"\n title="','"\n @click=','></a>\n\n <a class="list-item-action fa fa-sign-out-alt close-room"\n data-room-jid="','"\n data-room-name="','"\n title="','"\n @click=',"></a>\n </div>"]);return uA=function(){return e},e}function dA(){const e=mA(['<span class="list-item-badge badge badge--muc msgs-indicator"></span>']);return dA=function(){return e},e}function hA(){const e=mA(['<span class="list-item-badge badge badge--muc msgs-indicator">',"</span>"]);return hA=function(){return e},e}function fA(){const e=mA(['\n <a class="list-item-action fa fa-bookmark add-bookmark"\n data-room-jid="','"\n data-bookmark-name="','"\n @click=','\n title="','"></a>']);return fA=function(){return e},e}function gA(){const e=mA(['\n <a class="list-item-action fa fa-bookmark remove-bookmark button-on"\n data-room-jid="','"\n data-bookmark-name="','"\n @click=','\n title="','"></a>']);return gA=function(){return e},e}function mA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const{Strophe:pA}=Mc.env,vA=Mc.env.utils,bA=ao.extend({defaults:function(){return{muc_domain:Cc.settings.get("muc_domain"),nick:So.getDefaultMUCNickname(),"toggle-state":So.OPENED}},setDomain(e){Cc.settings.get("locked_muc_domain")||this.save("muc_domain",pA.getDomainFromJid(e))}});function yA(){const e=(t=['\n <?xml version="1.0" encoding="UTF-8"?>\n \x3c!--\n Font Awesome Free 5.13.0 by @fontawesome - https://fontawesome.com\n License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n --\x3e\n <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">\n <symbol id="icon-address-book" viewBox="0 0 448 512">\n <path d="M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-228-32c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H118.4C106 384 96 375.4 96 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z"></path>\n </symbol>\n <symbol id="icon-angle-double-down" viewBox="0 0 320 512">\n <path d="M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"></path>\n </symbol>\n <symbol id="icon-angle-double-left" viewBox="0 0 448 512">\n <path d="M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"></path>\n </symbol>\n <symbol id="icon-angle-double-right" viewBox="0 0 448 512">\n <path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"></path>\n </symbol>\n <symbol id="icon-angle-double-up" viewBox="0 0 320 512">\n <path d="M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z"></path>\n </symbol>\n <symbol id="icon-angle-down" viewBox="0 0 320 512">\n <path d="M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z"></path>\n </symbol>\n <symbol id="icon-angle-left" viewBox="0 0 256 512">\n <path d="M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"></path>\n </symbol>\n <symbol id="icon-angle-right" viewBox="0 0 256 512">\n <path d="M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"></path>\n </symbol>\n <symbol id="icon-angle-up" viewBox="0 0 320 512">\n <path d="M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z"></path>\n </symbol>\n <symbol id="icon-arrow-alt-circle-down" viewBox="0 0 512 512">\n <path d="M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zM212 140v116h-70.9c-10.7 0-16.1 13-8.5 20.5l114.9 114.3c4.7 4.7 12.2 4.7 16.9 0l114.9-114.3c7.6-7.6 2.2-20.5-8.5-20.5H300V140c0-6.6-5.4-12-12-12h-64c-6.6 0-12 5.4-12 12z"></path>\n </symbol>\n <symbol id="icon-arrow-alt-circle-left" viewBox="0 0 512 512">\n <path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm116-292H256v-70.9c0-10.7-13-16.1-20.5-8.5L121.2 247.5c-4.7 4.7-4.7 12.2 0 16.9l114.3 114.9c7.6 7.6 20.5 2.2 20.5-8.5V300h116c6.6 0 12-5.4 12-12v-64c0-6.6-5.4-12-12-12z"></path>\n </symbol>\n <symbol id="icon-arrow-alt-circle-right" viewBox="0 0 512 512">\n <path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zM140 300h116v70.9c0 10.7 13 16.1 20.5 8.5l114.3-114.9c4.7-4.7 4.7-12.2 0-16.9l-114.3-115c-7.6-7.6-20.5-2.2-20.5 8.5V212H140c-6.6 0-12 5.4-12 12v64c0 6.6 5.4 12 12 12z"></path>\n </symbol>\n <symbol id="icon-arrow-alt-circle-up" viewBox="0 0 512 512">\n <path d="M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm292 116V256h70.9c10.7 0 16.1-13 8.5-20.5L264.5 121.2c-4.7-4.7-12.2-4.7-16.9 0l-115 114.3c-7.6 7.6-2.2 20.5 8.5 20.5H212v116c0 6.6 5.4 12 12 12h64c6.6 0 12-5.4 12-12z"></path>\n </symbol>\n <symbol id="icon-arrow-circle-down" viewBox="0 0 512 512">\n <path d="M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z"></path>\n </symbol>\n <symbol id="icon-arrow-circle-left" viewBox="0 0 512 512">\n <path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm28.9-143.6L209.4 288H392c13.3 0 24-10.7 24-24v-16c0-13.3-10.7-24-24-24H209.4l75.5-72.4c9.7-9.3 9.9-24.8.4-34.3l-11-10.9c-9.4-9.4-24.6-9.4-33.9 0L107.7 239c-9.4 9.4-9.4 24.6 0 33.9l132.7 132.7c9.4 9.4 24.6 9.4 33.9 0l11-10.9c9.5-9.5 9.3-25-.4-34.3z"></path>\n </symbol>\n <symbol id="icon-arrow-circle-right" viewBox="0 0 512 512">\n <path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm-28.9 143.6l75.5 72.4H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h182.6l-75.5 72.4c-9.7 9.3-9.9 24.8-.4 34.3l11 10.9c9.4 9.4 24.6 9.4 33.9 0L404.3 273c9.4-9.4 9.4-24.6 0-33.9L271.6 106.3c-9.4-9.4-24.6-9.4-33.9 0l-11 10.9c-9.5 9.6-9.3 25.1.4 34.4z"></path>\n </symbol>\n <symbol id="icon-arrow-circle-up" viewBox="0 0 512 512">\n <path d="M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm143.6 28.9l72.4-75.5V392c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V209.4l72.4 75.5c9.3 9.7 24.8 9.9 34.3.4l10.9-11c9.4-9.4 9.4-24.6 0-33.9L273 107.7c-9.4-9.4-24.6-9.4-33.9 0L106.3 240.4c-9.4 9.4-9.4 24.6 0 33.9l10.9 11c9.6 9.5 25.1 9.3 34.4-.4z"></path>\n </symbol>\n <symbol id="icon-arrow-down" viewBox="0 0 448 512">\n <path d="M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z"></path>\n </symbol>\n <symbol id="icon-arrow-left" viewBox="0 0 448 512">\n <path d="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"></path>\n </symbol>\n <symbol id="icon-arrow-right" viewBox="0 0 448 512">\n <path d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path>\n </symbol>\n <symbol id="icon-arrow-up" viewBox="0 0 448 512">\n <path d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"></path>\n </symbol>\n <symbol id="icon-arrows-alt" viewBox="0 0 512 512">\n <path d="M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"></path>\n </symbol>\n <symbol id="icon-arrows-alt-h" viewBox="0 0 512 512">\n <path d="M377.941 169.941V216H134.059v-46.059c0-21.382-25.851-32.09-40.971-16.971L7.029 239.029c-9.373 9.373-9.373 24.568 0 33.941l86.059 86.059c15.119 15.119 40.971 4.411 40.971-16.971V296h243.882v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.568 0-33.941l-86.059-86.059c-15.119-15.12-40.971-4.412-40.971 16.97z"></path>\n </symbol>\n <symbol id="icon-arrows-alt-v" viewBox="0 0 256 512">\n <path d="M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z"></path>\n </symbol>\n <symbol id="icon-bars" viewBox="0 0 448 512">\n <path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"></path>\n </symbol>\n <symbol id="icon-bookmark" viewBox="0 0 384 512">\n <path d="M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z"></path>\n </symbol>\n <symbol id="icon-caret-down" viewBox="0 0 320 512">\n <path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path>\n </symbol>\n <symbol id="icon-caret-right" viewBox="0 0 192 512">\n <path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"></path>\n </symbol>\n <symbol id="icon-check" viewBox="0 0 512 512">\n <path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path>\n </symbol>\n <symbol id="icon-circle" viewBox="0 0 512 512">\n <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path>\n </symbol>\n <symbol id="icon-cog" viewBox="0 0 512 512">\n <path d="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"></path>\n </symbol>\n <symbol id="icon-database" viewBox="0 0 448 512">\n <path d="M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z"></path>\n </symbol>\n <symbol id="icon-edit" viewBox="0 0 576 512">\n <path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"></path>\n </symbol>\n <symbol id="icon-eye" viewBox="0 0 576 512">\n <path d="M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"></path>\n </symbol>\n <symbol id="icon-eye-slash" viewBox="0 0 640 512">\n <path d="M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"></path>\n </symbol>\n <symbol id="icon-gavel" viewBox="0 0 512 512">\n <path d="M504.971 199.362l-22.627-22.627c-9.373-9.373-24.569-9.373-33.941 0l-5.657 5.657L329.608 69.255l5.657-5.657c9.373-9.373 9.373-24.569 0-33.941L312.638 7.029c-9.373-9.373-24.569-9.373-33.941 0L154.246 131.48c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l5.657-5.657 39.598 39.598-81.04 81.04-5.657-5.657c-12.497-12.497-32.758-12.497-45.255 0L9.373 412.118c-12.497 12.497-12.497 32.758 0 45.255l45.255 45.255c12.497 12.497 32.758 12.497 45.255 0l114.745-114.745c12.497-12.497 12.497-32.758 0-45.255l-5.657-5.657 81.04-81.04 39.598 39.598-5.657 5.657c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l124.451-124.451c9.372-9.372 9.372-24.568 0-33.941z"></path>\n </symbol>\n <symbol id="icon-globe" viewBox="0 0 496 512">\n <path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"></path>\n </symbol>\n <symbol id="icon-id-card" viewBox="0 0 576 512">\n <path d="M528 32H48C21.5 32 0 53.5 0 80v16h576V80c0-26.5-21.5-48-48-48zM0 432c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V128H0v304zm352-232c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zM176 192c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zM67.1 396.2C75.5 370.5 99.6 352 128 352h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.9-5.2 19.8-15.6 19.8H82.7c-10.4 0-18.8-10-15.6-19.8z"></path>\n </symbol>\n <symbol id="icon-id-card-alt" viewBox="0 0 576 512">\n <path d="M528 64H384v96H192V64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM288 224c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm93.3 224H194.7c-10.4 0-18.8-10-15.6-19.8 8.3-25.6 32.4-44.2 60.9-44.2h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.8-5.2 19.8-15.6 19.8zM352 32c0-17.7-14.3-32-32-32h-64c-17.7 0-32 14.3-32 32v96h128V32z"></path>\n </symbol>\n <symbol id="icon-info" viewBox="0 0 192 512">\n <path d="M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z"></path>\n </symbol>\n <symbol id="icon-info-circle" viewBox="0 0 512 512">\n <path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"></path>\n </symbol>\n <symbol id="icon-list-ul" viewBox="0 0 512 512">\n <path d="M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"></path>\n </symbol>\n <symbol id="icon-lock" viewBox="0 0 448 512">\n <path d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"></path>\n </symbol>\n <symbol id="icon-lock-open" viewBox="0 0 576 512">\n <path d="M423.5 0C339.5.3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z"></path>\n </symbol>\n <symbol id="icon-minus" viewBox="0 0 448 512">\n <path d="M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path>\n </symbol>\n <symbol id="icon-minus-circle" viewBox="0 0 512 512">\n <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z"></path>\n </symbol>\n <symbol id="icon-minus-square" viewBox="0 0 448 512">\n <path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM92 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H92z"></path>\n </symbol>\n <symbol id="icon-paper-plane" viewBox="0 0 512 512">\n <path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"></path>\n </symbol>\n <symbol id="icon-paperclip" viewBox="0 0 448 512">\n <path d="M43.246 466.142c-58.43-60.289-57.341-157.511 1.386-217.581L254.392 34c44.316-45.332 116.351-45.336 160.671 0 43.89 44.894 43.943 117.329 0 162.276L232.214 383.128c-29.855 30.537-78.633 30.111-107.982-.998-28.275-29.97-27.368-77.473 1.452-106.953l143.743-146.835c6.182-6.314 16.312-6.422 22.626-.241l22.861 22.379c6.315 6.182 6.422 16.312.241 22.626L171.427 319.927c-4.932 5.045-5.236 13.428-.648 18.292 4.372 4.634 11.245 4.711 15.688.165l182.849-186.851c19.613-20.062 19.613-52.725-.011-72.798-19.189-19.627-49.957-19.637-69.154 0L90.39 293.295c-34.763 35.56-35.299 93.12-1.191 128.313 34.01 35.093 88.985 35.137 123.058.286l172.06-175.999c6.177-6.319 16.307-6.433 22.626-.256l22.877 22.364c6.319 6.177 6.434 16.307.256 22.626l-172.06 175.998c-59.576 60.938-155.943 60.216-214.77-.485z"></path>\n </symbol>\n <symbol id="icon-pencil-alt" viewBox="0 0 512 512">\n <path d="M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"></path>\n </symbol>\n <symbol id="icon-phone" viewBox="0 0 512 512">\n <path d="M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z"></path>\n </symbol>\n <symbol id="icon-plus" viewBox="0 0 448 512">\n <path d="M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"></path>\n </symbol>\n <symbol id="icon-plus-circle" viewBox="0 0 512 512">\n <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"></path>\n </symbol>\n <symbol id="icon-plus-square" viewBox="0 0 448 512">\n <path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"></path>\n </symbol>\n <symbol id="icon-save" viewBox="0 0 448 512">\n <path d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"></path>\n </symbol>\n <symbol id="icon-sign-out-alt" viewBox="0 0 512 512">\n <path d="M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"></path>\n </symbol>\n <symbol id="icon-smile" viewBox="0 0 496 512">\n <path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z"></path>\n </symbol>\n <symbol id="icon-snowflake" viewBox="0 0 448 512">\n <path d="M440.3 345.2l-33.8-19.5 26-7c8.2-2.2 13.1-10.7 10.9-18.9l-4-14.9c-2.2-8.2-10.7-13.1-18.9-10.9l-70.8 19-63.9-37 63.8-36.9 70.8 19c8.2 2.2 16.7-2.7 18.9-10.9l4-14.9c2.2-8.2-2.7-16.7-10.9-18.9l-26-7 33.8-19.5c7.4-4.3 9.9-13.7 5.7-21.1L430.4 119c-4.3-7.4-13.7-9.9-21.1-5.7l-33.8 19.5 7-26c2.2-8.2-2.7-16.7-10.9-18.9l-14.9-4c-8.2-2.2-16.7 2.7-18.9 10.9l-19 70.8-62.8 36.2v-77.5l53.7-53.7c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0L256 56.4V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v40.4l-19.7-19.7c-6.2-6.2-16.4-6.2-22.6 0L138.3 48c-6.3 6.2-6.3 16.4 0 22.6l53.7 53.7v77.5l-62.8-36.2-19-70.8c-2.2-8.2-10.7-13.1-18.9-10.9l-14.9 4c-8.2 2.2-13.1 10.7-10.9 18.9l7 26-33.8-19.5c-7.4-4.3-16.8-1.7-21.1 5.7L2.1 145.7c-4.3 7.4-1.7 16.8 5.7 21.1l33.8 19.5-26 7c-8.3 2.2-13.2 10.7-11 19l4 14.9c2.2 8.2 10.7 13.1 18.9 10.9l70.8-19 63.8 36.9-63.8 36.9-70.8-19c-8.2-2.2-16.7 2.7-18.9 10.9l-4 14.9c-2.2 8.2 2.7 16.7 10.9 18.9l26 7-33.8 19.6c-7.4 4.3-9.9 13.7-5.7 21.1l15.5 26.8c4.3 7.4 13.7 9.9 21.1 5.7l33.8-19.5-7 26c-2.2 8.2 2.7 16.7 10.9 18.9l14.9 4c8.2 2.2 16.7-2.7 18.9-10.9l19-70.8 62.8-36.2v77.5l-53.7 53.7c-6.3 6.2-6.3 16.4 0 22.6l11.3 11.3c6.2 6.2 16.4 6.2 22.6 0l19.7-19.7V496c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-40.4l19.7 19.7c6.2 6.2 16.4 6.2 22.6 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6L256 387.7v-77.5l62.8 36.2 19 70.8c2.2 8.2 10.7 13.1 18.9 10.9l14.9-4c8.2-2.2 13.1-10.7 10.9-18.9l-7-26 33.8 19.5c7.4 4.3 16.8 1.7 21.1-5.7l15.5-26.8c4.3-7.3 1.8-16.8-5.6-21z"></path>\n </symbol>\n <symbol id="icon-spinner" viewBox="0 0 512 512">\n <path d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"></path>\n </symbol>\n <symbol id="icon-sync" viewBox="0 0 512 512">\n <path d="M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"></path>\n </symbol>\n <symbol id="icon-times" viewBox="0 0 352 512">\n <path d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path>\n </symbol>\n <symbol id="icon-times-circle" viewBox="0 0 512 512">\n <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"></path>\n </symbol>\n <symbol id="icon-trash" viewBox="0 0 448 512">\n <path d="M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"></path>\n </symbol>\n <symbol id="icon-trash-alt" viewBox="0 0 448 512">\n <path d="M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"></path>\n </symbol>\n <symbol id="icon-unlock" viewBox="0 0 448 512">\n <path d="M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"></path>\n </symbol>\n <symbol id="icon-user" viewBox="0 0 448 512">\n <path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"></path>\n </symbol>\n <symbol id="icon-user-cog" viewBox="0 0 640 512">\n <path d="M610.5 373.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 400.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm201.2 226.5c-2.3-1.2-4.6-2.6-6.8-3.9l-7.9 4.6c-6 3.4-12.8 5.3-19.6 5.3-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-5.5-17.7 1.9-36.4 17.9-45.7l7.9-4.6c-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-16-9.2-23.4-28-17.9-45.7.9-2.9 2.2-5.8 3.2-8.7-3.8-.3-7.5-1.2-11.4-1.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c10.1 0 19.5-3.2 27.2-8.5-1.2-3.8-2-7.7-2-11.8v-9.2z"></path>\n </symbol>\n <symbol id="icon-user-plus" viewBox="0 0 640 512">\n <path d="M624 208h-64v-64c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v64h-64c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h64v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-64h64c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm-400 48c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"></path>\n </symbol>\n <symbol id="icon-user-secret" viewBox="0 0 448 512">\n <path d="M383.9 308.3l23.9-62.6c4-10.5-3.7-21.7-15-21.7h-58.5c11-18.9 17.8-40.6 17.8-64v-.3c39.2-7.8 64-19.1 64-31.7 0-13.3-27.3-25.1-70.1-33-9.2-32.8-27-65.8-40.6-82.8-9.5-11.9-25.9-15.6-39.5-8.8l-27.6 13.8c-9 4.5-19.6 4.5-28.6 0L182.1 3.4c-13.6-6.8-30-3.1-39.5 8.8-13.5 17-31.4 50-40.6 82.8-42.7 7.9-70 19.7-70 33 0 12.6 24.8 23.9 64 31.7v.3c0 23.4 6.8 45.1 17.8 64H56.3c-11.5 0-19.2 11.7-14.7 22.3l25.8 60.2C27.3 329.8 0 372.7 0 422.4v44.8C0 491.9 20.1 512 44.8 512h358.4c24.7 0 44.8-20.1 44.8-44.8v-44.8c0-48.4-25.8-90.4-64.1-114.1zM176 480l-41.6-192 49.6 32 24 40-32 120zm96 0l-32-120 24-40 49.6-32L272 480zm41.7-298.5c-3.9 11.9-7 24.6-16.5 33.4-10.1 9.3-48 22.4-64-25-2.8-8.4-15.4-8.4-18.3 0-17 50.2-56 32.4-64 25-9.5-8.8-12.7-21.5-16.5-33.4-.8-2.5-6.3-5.7-6.3-5.8v-10.8c28.3 3.6 61 5.8 96 5.8s67.7-2.1 96-5.8v10.8c-.1.1-5.6 3.2-6.4 5.8z"></path>\n </symbol>\n <symbol id="icon-users" viewBox="0 0 640 512">\n <path d="M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"></path>\n </symbol>\n <symbol id="icon-wrench" viewBox="0 0 512 512">\n <path d="M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"></path>\n </symbol>\n </svg>\n'],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return yA=function(){return e},e}function _A(){const e=(t=['\n <converse-chats class="converse-chatboxes row no-gutters ','"></converse-chats>\n <div id="converse-modals" class="modals"></div>\n <converse-fontawesome></converse-fontawesome>\n '],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return _A=function(){return e},e}function wA(){if(!Cc.settings.get("auto_insert"))return;const e=Cc.settings.get("root");if(!e.querySelector("converse-root#conversejs")){const t=document.createElement("converse-root"),n=e.querySelector("body");n?n.appendChild(t):e.appendChild(t)}}function SA(){const e=(t=['\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="addContactModalLabel">',"</h5>\n ",'\n </div>\n <form class="converse-form add-xmpp-contact">\n <div class="modal-body">\n <span class="modal-alert"></span>\n <div class="form-group add-xmpp-contact__jid">\n <label class="clearfix" for="jid">',':</label>\n <div class="suggestion-box suggestion-box__jid">\n <ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>\n <input type="text" name="jid" ?required=','\n value="','"\n class="form-control suggestion-box__input"\n placeholder="','"/>\n <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span>\n </div>\n </div>\n <div class="form-group add-xmpp-contact__name">\n <label class="clearfix" for="name">',':</label>\n <div class="suggestion-box suggestion-box__name">\n <ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>\n <input type="text" name="name" value="','"\n class="form-control suggestion-box__input"\n placeholder="','"/>\n <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span>\n </div>\n </div>\n <div class="form-group">\n <div class="invalid-feedback">','</div>\n </div>\n <button type="submit" class="btn btn-primary">',"</button>\n </div>\n </form>\n </div>\n </div>\n "],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return SA=function(){return e},e}Cc.elements.define("converse-rooms-list",class extends yf{initialize(){const e="converse.roomspanel".concat(So.bare_jid);this.model=new bA({id:e}),Cr(this.model,e),this.model.fetch(),this.listenTo(So.chatboxes,"add",this.renderIfChatRoom),this.listenTo(So.chatboxes,"remove",this.renderIfChatRoom),this.listenTo(So.chatboxes,"destroy",this.renderIfChatRoom),this.listenTo(So.chatboxes,"change",this.renderIfRelevantChange),this.render()}renderIfChatRoom(e){vA.isChatRoom(e)&&this.render()}renderIfRelevantChange(e){const t=["bookmarked","hidden","name","num_unread","num_unread_general","has_activity"],n=e.changed||{};vA.isChatRoom(e)&&Object.keys(n).filter((e=>t.includes(e))).length&&this.render()}render(){Wa((e=>{const t=Vu("Click to toggle the list of open groupchats"),n=Vu("Groupchats"),s=Vu("Query for groupchats"),i=Vu("Add a new groupchat");return Ha(lA(),n,(t=>Cc.modal.show(cA,{model:e.model},t)),s,(t=>Cc.modal.show(Lj,{model:e.model},t)),i,e.rooms.length?"":"hidden",t,e.toggleRoomsList,e.toggle_state===So.OPENED?"fa-caret-down":"fa-caret-right",Vu("Open Groupchats"),e.collapsed&&"collapsed",e.rooms.map((t=>(e=>{const t=Vu("Leave this groupchat"),n=e.room.get("num_unread_general")||e.room.get("has_activity");return Ha(uA(),e.currently_open(e.room)?"open":"",n?"unread-msgs":"",e.room.get("jid"),e.room.get("num_unread")?(e=>Ha(hA(),e.room.get("num_unread")))(e):e.room.get("has_activity")?Ha(dA()):"",e.room.get("jid"),Vu("Click to open this groupchat"),e.openRoom,e.room.getDisplayName(),e.allow_bookmarks?(e=>{const t=Vu("Bookmark this groupchat"),n=Vu("Unbookmark this groupchat");return e.bookmarked?Ha(gA(),e.room.get("jid"),e.room.getDisplayName(),e.removeBookmark,e.bookmarked?n:t):Ha(fA(),e.room.get("jid"),e.room.getDisplayName(),e.addBookmark,e.bookmarked?n:t)})(e):"",e.room.get("jid"),Vu("Show more information on this groupchat"),e.showRoomDetailsModal,e.room.get("jid"),e.room.getDisplayName(),t,e.closeRoom)})(Object.assign({room:t},e)))))})({addBookmark:e=>this.addBookmark(e),allow_bookmarks:So.allow_bookmarks&&So.bookmarks,closeRoom:e=>this.closeRoom(e),collapsed:this.model.get("toggle-state")!==So.OPENED,currently_open:e=>So.isUniView()&&!e.get("hidden"),model:this.model,openRoom:e=>this.openRoom(e),removeBookmark:e=>this.removeBookmark(e),rooms:So.chatboxes.filter((e=>e.get("type")===So.CHATROOMS_TYPE)),showRoomDetailsModal:e=>this.showRoomDetailsModal(e),toggleRoomsList:e=>this.toggleRoomsList(e),toggle_state:this.model.get("toggle-state")}),this)}showRoomDetailsModal(e){const t=e.target.getAttribute("data-room-jid"),n=So.chatboxes.get(t);e.preventDefault(),Cc.modal.show(ix,{model:n},e)}async openRoom(e){e.preventDefault();const t=e.target.textContent,n=e.target.getAttribute("data-room-jid"),s={name:t||pA.unescapeNode(pA.getNodeFromJid(n))||n};await Cc.rooms.open(n,s,!0)}async closeRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-name");if(confirm(Vu("Are you sure you want to leave the groupchat %1$s?",t))){const t=e.target.getAttribute("data-room-jid");(await Cc.rooms.get(t)).close()}}removeBookmark(e){So.removeBookmarkViaEvent(e)}addBookmark(e){So.addBookmarkViaEvent(e)}toggleRoomsList(e){e&&e.preventDefault&&e.preventDefault();const t=e.target.matches(".fa")?e.target:e.target.querySelector(".fa");t.classList.contains("fa-caret-down")?vA.slideIn(this.el.querySelector(".open-rooms-list")).then((()=>{this.model.save({"toggle-state":So.CLOSED}),t.classList.remove("fa-caret-down"),t.classList.add("fa-caret-right")})):vA.slideOut(this.el.querySelector(".open-rooms-list")).then((()=>{this.model.save({"toggle-state":So.OPENED}),t.classList.remove("fa-caret-right"),t.classList.add("fa-caret-down")}))}}),Mc.plugins.add("converse-roomslist",{dependencies:["converse-singleton","converse-controlbox","converse-muc","converse-bookmarks"],initialize(){Cc.listen.on("connected",(async()=>{So.allow_bookmarks?await Cc.waitUntil("bookmarksInitialized"):await Promise.all([Cc.waitUntil("chatBoxesFetched")])}))}}),window.customElements.define("converse-fontawesome",class extends af{render(){return Ha(yA())}}),customElements.define("converse-root",class extends af{render(){return(()=>{let e=Cc.settings.get("singleton")?"converse-singleton":"";return e+="converse-".concat(Cc.settings.get("view_mode")),Ha(_A(),e)})()}connectedCallback(){super.connectedCallback(),this.classList.add("conversejs"),this.classList.add("converse-".concat(Cc.settings.get("view_mode"))),this.classList.add("theme-".concat(Cc.settings.get("theme"))),this.setAttribute("id","conversejs")}}),Mc.plugins.add("converse-rootview",{initialize(){Cc.settings.extend({auto_insert:!0}),Cc.listen.on("chatBoxesInitialized",wA)}});const{Strophe:xA}=Mc.env,EA=Mc.env.utils,jA=og.extend({id:"add-contact-modal",events:{"submit form":"addContactFromForm"},initialize(){og.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render)},toHTML(){const e=Cc.settings.get("xhr_user_search_url")?Vu("Contact name"):Vu("Optional nickname");return(e=>{const t=Vu("name@example.org"),n=Vu("Add"),s=Vu("Please enter a valid XMPP address"),i=Vu("Add a Contact"),r=Vu("XMPP Address"),o=Vu("Nickname");return Ha(SA(),i,dg,r,!e._converse.xhr_user_search_url,e.jid||"",t,o,e.nickname||"",o,s,n)})(Object.assign(this.model.toJSON(),{_converse:So,label_nickname:e}))},afterRender(){"string"==typeof Cc.settings.get("xhr_user_search_url")?this.initXHRAutoComplete():this.initJIDAutoComplete();const e=this.el.querySelector('input[name="jid"]');this.el.addEventListener("shown.bs.modal",(()=>e.focus()),!1)},initJIDAutoComplete(){if(!Cc.settings.get("autocomplete_add_contact"))return;const e=this.el.querySelector(".suggestion-box__jid").parentElement;this.jid_auto_complete=new So.AutoComplete(e,{data:(e,t)=>"".concat(t.slice(0,t.indexOf("@")),"@").concat(e),filter:So.FILTER_STARTSWITH,list:[...new Set(So.roster.map((e=>xA.getDomainFromJid(e.get("jid")))))]})},initXHRAutoComplete(){if(!Cc.settings.get("autocomplete_add_contact"))return this.initXHRFetch();const e=this.el.querySelector(".suggestion-box__name").parentElement;this.name_auto_complete=new So.AutoComplete(e,{auto_evaluate:!1,filter:So.FILTER_STARTSWITH,list:[]});const t=new window.XMLHttpRequest;t.onload=()=>{if(t.responseText){const e=t.responseText;this.name_auto_complete.list=JSON.parse(e).map((e=>({label:e.fullname||e.jid,value:e.jid}))),this.name_auto_complete.auto_completing=!0,this.name_auto_complete.evaluate()}};const n=this.el.querySelector('input[name="name"]');n.addEventListener("input",Oo((()=>{t.open("GET","".concat(Cc.settings.get("xhr_user_search_url"),"q=").concat(encodeURIComponent(n.value)),!0),t.send()}),300)),this.name_auto_complete.on("suggestion-box-selectcomplete",(e=>{this.el.querySelector('input[name="name"]').value=e.text.label,this.el.querySelector('input[name="jid"]').value=e.text.value}))},initXHRFetch(){this.xhr=new window.XMLHttpRequest,this.xhr.onload=()=>{if(this.xhr.responseText){const e=this.xhr.responseText,t=JSON.parse(e).map((e=>({label:e.fullname||e.jid,value:e.jid})));if(1!==t.length){const e=this.el.querySelector(".invalid-feedback");return e.textContent=Vu("Sorry, could not find a contact with that name"),void EA.addClass("d-block",e)}const n=t[0].value;if(this.validateSubmission(n)){const e=this.el.querySelector("form"),s=t[0].label;this.afterSubmission(e,n,s)}}}},validateSubmission(e){const t=this.el.querySelector(".invalid-feedback");return!e||Fr(e.split("@")).length<2?(EA.addClass("is-invalid",this.el.querySelector('input[name="jid"]')),EA.addClass("d-block",t),!1):So.roster.get(xA.getBareJidFromJid(e))?(t.textContent=Vu("This contact has already been added"),EA.addClass("d-block",t),!1):(EA.removeClass("d-block",t),!0)},afterSubmission(e,t,n){So.roster.addAndSubscribe(t,n),this.model.clear(),this.modal.hide()},addContactFromForm(e){e.preventDefault();const t=new FormData(e.target),n=(t.get("jid")||"").trim();if(!n&&"string"==typeof Cc.settings.get("xhr_user_search_url")){const e=this.el.querySelector('input[name="name"]');return this.xhr.open("GET","".concat(Cc.settings.get("xhr_user_search_url"),"q=").concat(encodeURIComponent(e.value)),!0),void this.xhr.send()}this.validateSubmission(n)&&this.afterSubmission(e.target,n,t.get("name"))}});function AA(e){var t,n;null===(t=So.roster)||void 0===t||null===(n=t.findWhere({jid:e.get("jid")}))||void 0===n||n.trigger("highlight")}function CA(e,t){const n=So.roster_filter,s=n.get("filter_type"),i="state"===s?n.get("chat_state").toLowerCase():n.get("filter_text").toLowerCase();return!!i&&("state"===s?![So.HEADER_REQUESTING_CONTACTS,So.HEADER_UNREAD].includes(t)&&("unread_messages"===i?0===e.get("num_unread"):"online"===i?["offline","unavailable"].includes(e.presence.get("show")):!e.presence.get("show").includes(i)):"contacts"===s?!e.getFilterCriteria().includes(i):void 0)}function kA(e){const t=So.roster_filter;if("groups"===t.get("filter_type")){var n;const s=null===(n=t.get("filter_text"))||void 0===n?void 0:n.toLowerCase();if(!s)return!0;if(!e.toLowerCase().includes(s))return!1}return!0}function OA(){const e=NA(['\n <div class="roster-group" data-group="','">\n <a href="#" class="list-toggle group-toggle controlbox-padded" title="','" @click=','>\n <span class="fa ','"></span> ','\n </a>\n <ul class="items-list roster-group-contacts ','" data-group="','">\n ',"\n </ul>\n </div>"]);return OA=function(){return e},e}function TA(){const e=NA(['\n <li class="list-item d-flex controlbox-padded ','" data-status="','">\n <converse-roster-contact .model=',"></converse-roster-contact>\n </li>"]);return TA=function(){return e},e}function NA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}So.AddContactModal=jA;const{u:IA}=Mc.env;function MA(e){const t=e.get("jid"),n=[];if(So.isUniView()){const e=So.chatboxes.get(t);e&&!e.get("hidden")&&n.push("open")}const s=e.get("ask"),i=e.get("requesting"),r=e.get("subscription");return"subscribe"===s||"from"===r?n.push("pending-xmpp-contact"):!0===i?n.push("requesting-xmpp-contact"):("both"===r||"to"===r||IA.isSameBareJID(t,So.connection.jid))&&(n.push("current-xmpp-contact"),n.push(r),n.push(e.presence.get("show"))),Ha(TA(),n.join(" "),e.presence.get("show"),e)}function RA(){const e=zA(['\n <a class="controlbox-heading__btn add-contact fa fa-user-plus"\n title="','"\n data-toggle="modal"\n data-target="#add-contact-modal"></a>']);return RA=function(){return e},e}function DA(){const e=zA(['\n <div class="d-flex controlbox-padded">\n <span class="w-100 controlbox-heading controlbox-heading--contacts">','</span>\n <a class="controlbox-heading__btn sync-contacts fa fa-sync" title="','"></a>\n ','\n </div>\n <converse-roster-filter></converse-roster-filter>\n <div class="list-container roster-contacts">\n ',"\n </div>\n "]);return DA=function(){return e},e}function zA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const LA=()=>{const e=Vu("Contacts"),t=Vu("Add a contact"),n=Vu("Re-sync your contacts"),s=(So.roster||[]).reduce(((e,t)=>function(e,t){if("subscribe"===t.get("ask")){const n=So.HEADER_PENDING_CONTACTS;e[n]?e[n].push(t):e[n]=[t]}else if(t.get("requesting")){const n=So.HEADER_REQUESTING_CONTACTS;e[n]?e[n].push(t):e[n]=[t]}else{let n;Cc.settings.get("roster_groups")?(n=t.get("groups"),n=0===n.length?[So.HEADER_UNGROUPED]:n):n=[So.HEADER_CURRENT_CONTACTS];for(const s of n)e[s]?e[s].push(t):e[s]=[t]}if(t.get("num_unread")){const n=So.HEADER_UNREAD;e[n]?e[n].push(t):e[n]=[t]}return e}(e,t)),{}),i=Object.keys(s).filter(kA);return i.sort(Lh),Ha(DA(),e,n,Cc.settings.get("allow_contact_requests")?Ha(RA(),t):"",Rf(i,(e=>e),(e=>{const t=s[e].filter((t=>function(e,t){const n=e.presence.get("show");return Cc.settings.get("hide_offline_users")&&"offline"===n?("subscribe"===e.get("ask")||"from"===e.get("subscription")||!0===e.get("requesting"))&&!CA(e,t):!CA(e,t)}(t,e)));return t.sort(zh),t.length?(e=>{const t=Vu("Click to hide these contacts"),n=So.roster.state.get("collapsed_groups");return Ha(OA(),e.name,t,(t=>function(e,t){var n;null==e||null===(n=e.preventDefault)||void 0===n||n.call(e);const s=So.roster.state.get("collapsed_groups");s.includes(t)?So.roster.state.save("collapsed_groups",s.filter((e=>e!==t))):So.roster.state.save("collapsed_groups",[...s,t])}(t,e.name)),n.includes(e.name)?"fa-caret-right":"fa-caret-down",e.name,n.includes(e.name)?"collapsed":"",e.name,e.contacts.map(MA))})({contacts:t,name:e}):""})))},PA=Mc.env.utils;function FA(){const e=qA(['<a class="list-item-link open-chat w-100" href="#" @click=',">","</a>"]);return FA=function(){return e},e}function BA(){const e=qA(["\n ",'\n <a class="list-item-action remove-xmpp-contact far fa-trash-alt" @click=',' title="','" href="#"></a>']);return BA=function(){return e},e}function UA(){const e=qA(['<span class="pending-contact-name" title="JID: ','">',"</span>"]);return UA=function(){return e},e}function qA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}Cc.elements.define("converse-roster",class extends yf{constructor(...e){var t,n,s;super(...e),s={"click a.controlbox-heading__btn.add-contact":"showAddContactModal","click a.controlbox-heading__btn.sync-contacts":"syncContacts"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}async initialize(){await Cc.waitUntil("rosterInitialized"),this.debouncedRender=Oo(this.render,100),this.listenTo(So,"rosterContactsFetched",this.render),this.listenTo(So.roster,"add",this.debouncedRender),this.listenTo(So.roster,"destroy",this.debouncedRender),this.listenTo(So.roster,"remove",this.debouncedRender),this.listenTo(So.roster,"change",this.renderIfRelevantChange),this.listenTo(So.roster.state,"change",this.render),So.presences.on("change:show",(()=>this.debouncedRender())),this.render(),this.listenToRosterFilter(),Cc.trigger("rosterViewInitialized")}render(){Wa(LA(),this)}renderIfRelevantChange(e){const t=["ask","requesting","groups","num_unread"],n=e.changed||{};Object.keys(n).filter((e=>t.includes(e))).length&&this.render()}listenToRosterFilter(){this.filter_view=this.querySelector("converse-roster-filter"),this.filter_view.addEventListener("update",(()=>this.render()))}showAddContactModal(e){Cc.modal.show(So.AddContactModal,{model:new ao},e)}async syncContacts(e){e.preventDefault(),PA.addClass("fa-spin",e.target),So.roster.data.save("version",null),await So.roster.fetchFromServer(),Cc.user.presence.send(),PA.removeClass("fa-spin",e.target)}});const HA=e=>Ha(UA(),e.jid,e.display_name);function $A(){const e=WA(['<a class="open-chat w-100" href="#" @click=',">","</a>"]);return $A=function(){return e},e}function GA(){const e=WA(["\n ",'\n <a class="accept-xmpp-request list-item-action list-item-action--visible fa fa-check"\n @click=','\n aria-label="','" title="','" href="#"></a>\n <a class="decline-xmpp-request list-item-action list-item-action--visible fa fa-times"\n @click=','\n aria-label="','" title="','" href="#"></a>']);return GA=function(){return e},e}function VA(){const e=WA(['<span class="req-contact-name w-100" title="JID: ','">',"</span>"]);return VA=function(){return e},e}function WA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const JA=e=>Ha(VA(),e.jid,e.display_name);function QA(){const e=XA(['<a class="list-item-action remove-xmpp-contact far fa-trash-alt" @click=',' title="','" href="#"></a>']);return QA=function(){return e},e}function YA(){const e=XA(['<span class="msgs-indicator">',"</span>"]);return YA=function(){return e},e}function KA(){const e=XA(['\n <a class="list-item-link cbox-list-item open-chat ','" title="','" href="#" @click=',">\n ",'\n <span class="','" title="','"></span>\n ','\n <span class="contact-name contact-name--'," ",'">',"</span>\n </a>\n ",""]);return KA=function(){return e},e}function XA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const ZA=Mc.env.utils;class eC extends af{static get properties(){return{model:{type:Object}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change",this.requestUpdate),this.listenTo(this.model,"highlight",this.requestUpdate),this.listenTo(this.model,"vcard:change",this.requestUpdate)}render(){const e=this.model.get("ask"),t=this.model.get("requesting"),n=this.model.get("subscription"),s=this.model.get("jid");if("subscribe"===e||"from"===n){const e=this.model.getDisplayName();return(e=>{const t=Vu("Click to remove %1$s as a contact",e.display_name);return Ha(BA(),Cc.settings.get("allow_chat_pending_contacts")?Ha(FA(),e.openChat,HA(e)):HA(e),e.removeContact,t)})(Object.assign(this.model.toJSON(),{display_name:e,openChat:e=>this.openChat(e),removeContact:e=>this.removeContact(e)}))}if(!0===t){const e=this.model.getDisplayName();return(e=>Ha(GA(),Cc.settings.get("allow_chat_pending_contacts")?Ha($A(),e.openChat,JA(e)):JA(e),e.acceptRequest,e.desc_accept,e.desc_accept,e.declineRequest,e.desc_decline,e.desc_decline))(Object.assign(this.model.toJSON(),{display_name:e,openChat:e=>this.openChat(e),acceptRequest:e=>this.acceptRequest(e),declineRequest:e=>this.declineRequest(e),desc_accept:Vu("Click to accept the contact request from %1$s",e),desc_decline:Vu("Click to decline the contact request from %1$s",e),allow_chat_pending_contacts:Cc.settings.get("allow_chat_pending_contacts")}))}if("both"===n||"to"===n||ZA.isSameBareJID(s,So.connection.jid))return this.renderRosterItem(this.model)}renderRosterItem(e){const t={dnd:Vu("This contact is busy"),online:Vu("This contact is online"),offline:Vu("This contact is offline"),unavailable:Vu("This contact is unavailable"),xa:Vu("This contact is away for an extended period"),away:Vu("This contact is away")},n=e.presence.get("show")||"offline";let s;s="online"===n?"fa fa-circle chat-status chat-status--online":"away"===n?"fa fa-circle chat-status chat-status--away":"xa"===n?"far fa-circle chat-status chat-status-xa":"dnd"===n?"fa fa-minus-circle chat-status chat-status--busy":"fa fa-times-circle chat-status chat-status--offline";const i=e.getDisplayName();return(e=>{const t=Vu("Click to chat with %1$s (XMPP address: %2$s)",e.display_name,e.jid),n=Vu("Click to remove %1$s as a contact",e.display_name);return Ha(KA(),e.num_unread?"unread-msgs":"",t,e.openChat,bp(e.getAvatarData()),e.status_icon,e.desc_status,e.num_unread?Ha(YA(),e.num_unread):"",e.show,e.num_unread?"unread-msgs":"",e.display_name,Cc.settings.get("allow_contact_removal")?Ha(QA(),e.removeContact,n):"")})(Object.assign(e.toJSON(),{show:n,display_name:i,status_icon:s,openChat:e=>this.openChat(e),removeContact:e=>this.removeContact(e),getAvatarData:()=>this.getAvatarData(),desc_status:t[n],num_unread:e.get("num_unread")||0}))}getAvatarData(){var e,t;return{classes:"avatar",height:30,width:30,image:"data:"+((null===(e=this.model.vcard)||void 0===e?void 0:e.get("image_type"))||So.DEFAULT_IMAGE_TYPE)+";base64,"+((null===(t=this.model.vcard)||void 0===t?void 0:t.get("image"))||So.DEFAULT_IMAGE)}}openChat(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.openChat()}removeContact(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),Cc.settings.get("allow_contact_removal")&&confirm(Vu("Are you sure you want to remove this contact?")))try{this.model.removeFromRoster(),this.model.collection&&this.model.destroy()}catch(e){as.error(e),Cc.alert("error",Vu("Error"),[Vu("Sorry, there was an error while trying to remove %1$s as a contact.",this.model.getDisplayName())])}}async acceptRequest(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),await So.roster.sendContactAddIQ(this.model.get("jid"),this.model.getFullname(),[]),this.model.authorize().subscribe()}declineRequest(e){return e&&e.preventDefault&&e.preventDefault(),!0===confirm(Vu("Are you sure you want to decline this contact request?"))&&this.model.unauthorize().destroy(),this}}function tC(){const e=(t=['\n <form class="controlbox-padded roster-filter-form input-button-group ','"\n @submit=','>\n <div class="form-inline flex-nowrap">\n <div class="filter-by d-flex flex-nowrap">\n <span @click=',' class="fa fa-user ','" data-type="contacts" title="','"></span>\n <span @click=',' class="fa fa-users ','" data-type="groups" title="','"></span>\n <span @click=',' class="fa fa-circle ','" data-type="state" title="','"></span>\n </div>\n <div class="btn-group">\n <input .value="','"\n @keydown=','\n class="roster-filter form-control ','"\n placeholder="','"/>\n <span class="clear-input fa fa-times ','"\n @click=','>\n </span>\n </div>\n <select class="form-control state-type ','"\n @change=','>\n <option value="">',"</option>\n <option ?selected=",' value="unread_messages">',"</option>\n <option ?selected=",' value="online">',"</option>\n <option ?selected=",' value="chat">',"</option>\n <option ?selected=",' value="dnd">',"</option>\n <option ?selected=",' value="away">',"</option>\n <option ?selected=",' value="xa">',"</option>\n <option ?selected=",' value="offline">',"</option>\n </select>\n </div>\n </form>"],n||(n=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})));var t,n;return tC=function(){return e},e}Cc.elements.define("converse-roster-contact",eC);const nC=ao.extend({initialize(){this.set({filter_text:"",filter_type:"contacts",chat_state:"online"})}});class sC extends yf{constructor(...e){var t,n,s;super(...e),s="span",(n="tagName")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}initialize(){const e=new So.RosterFilter;e.id="_converse.rosterfilter-".concat(So.bare_jid),Cr(e,e.id),this.model=e,So.roster_filter=e,this.liveFilter=Oo((()=>{this.model.save({filter_text:this.querySelector(".roster-filter").value})}),250),this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"change",(()=>this.dispatchEvent(new CustomEvent("update",{detail:this.model.changed})))),this.listenTo(So.roster,"add",this.render),this.listenTo(So.roster,"destroy",this.render),this.listenTo(So.roster,"remove",this.render),So.presences.on("change:show",this.render,this),this.model.fetch(),this.render()}render(){return Wa((e=>{const t=Vu("Filter"),n=Vu("Filter by contact name"),s=Vu("Filter by group name"),i=Vu("Filter by status"),r=Vu("Any"),o=Vu("Unread"),a=Vu("Online"),c=Vu("Chatty"),l=Vu("Busy"),u=Vu("Away"),d=Vu("Extended Away"),h=Vu("Offline");return Ha(tC(),e.visible?"fade-in":"hidden",e.submitFilter,e.changeTypeFilter,"contacts"===e.filter_type?"selected":"",n,e.changeTypeFilter,"groups"===e.filter_type?"selected":"",s,e.changeTypeFilter,"state"===e.filter_type?"selected":"",i,e.filter_text||"",e.liveFilter,"state"===e.filter_type?"hidden":"",t,e.filter_text&&"state"!==e.filter_type?"":"hidden",e.clearFilter,"state"!==e.filter_type?"hidden":"",e.changeChatStateFilter,r,"unread_messages"===e.chat_state,o,"online"===e.chat_state,a,"chat"===e.chat_state,c,"dnd"===e.chat_state,l,"away"===e.chat_state,u,"xa"===e.chat_state,d,"offline"===e.chat_state,h)})(Object.assign(this.model.toJSON(),{visible:this.shouldBeVisible(),changeChatStateFilter:e=>this.changeChatStateFilter(e),changeTypeFilter:e=>this.changeTypeFilter(e),clearFilter:e=>this.clearFilter(e),liveFilter:e=>this.liveFilter(e),submitFilter:e=>this.submitFilter(e)})),this),this}changeChatStateFilter(e){e&&e.preventDefault(),this.model.save({chat_state:this.querySelector(".state-type").value})}changeTypeFilter(e){e&&e.preventDefault();const t=e.target.dataset.type;"state"===t?this.model.save({filter_type:t,chat_state:this.querySelector(".state-type").value}):this.model.save({filter_type:t,filter_text:this.querySelector(".roster-filter").value})}submitFilter(e){e&&e.preventDefault(),this.liveFilter()}isActive(){return"state"===this.model.get("filter_type")||this.model.get("filter_text")}shouldBeVisible(){return So.roster&&So.roster.length>=5||this.isActive()}clearFilter(e){e&&e.preventDefault(),this.model.save({filter_text:""})}}Cc.elements.define("converse-roster-filter",sC),n(7385),Mc.plugins.add("converse-rosterview",{dependencies:["converse-roster","converse-modal","converse-chatboxviews"],initialize(){Cc.settings.extend({autocomplete_add_contact:!0,allow_chat_pending_contacts:!0,allow_contact_removal:!0,hide_offline_users:!1,roster_groups:!0,xhr_user_search_url:null}),Cc.promises.add("rosterViewInitialized"),So.RosterFilter=nC,So.RosterFilterView=sC,So.RosterContactView=eC,Cc.listen.on("chatBoxesInitialized",(()=>{So.chatboxes.on("destroy",(e=>AA(e))),So.chatboxes.on("change:hidden",(e=>AA(e)))})),Cc.listen.on("afterTearDown",(()=>{var e;return null===(e=So.rotergroups)||void 0===e?void 0:e.off().reset()}))}}),So.CustomElement=af;const iC=["converse-bookmark-views","converse-chatboxviews","converse-chatview","converse-controlbox","converse-dragresize","converse-fullscreen","converse-headlines-view","converse-mam-views","converse-minimize","converse-modal","converse-muc-views","converse-notification","converse-omemo","converse-profile","converse-push","converse-register","converse-roomslist","converse-rootview","converse-rosterview","converse-singleton"],rC=Mc.initialize;Mc.initialize=function(e,t){return Array.isArray(e.whitelisted_plugins)?e.whitelisted_plugins=e.whitelisted_plugins.concat(iC):e.whitelisted_plugins=iC,rC(e,t)};const oC=Mc},4009:(e,t,n)=>{"use strict";!function(t){var n=/^(b|B)$/,s={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},i={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function r(e){var t,r,o,a,c,l,u,d,h,f,g,m,p,v,b,y=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},_=[],w=0,S=void 0,x=void 0;if(isNaN(e))throw new TypeError("Invalid number");return r=!0===y.bits,g=!0===y.unix,t=y.base||2,f=void 0!==y.round?y.round:g?1:2,l=void 0!==y.locale?y.locale:"",u=y.localeOptions||{},m=void 0!==y.separator?y.separator:"",p=void 0!==y.spacer?y.spacer:g?"":" ",b=y.symbols||{},v=2===t&&y.standard||"jedec",h=y.output||"string",a=!0===y.fullform,c=y.fullforms instanceof Array?y.fullforms:[],S=void 0!==y.exponent?y.exponent:-1,o=2<t?1e3:1024,(d=(x=Number(e))<0)&&(x=-x),(-1===S||isNaN(S))&&(S=Math.floor(Math.log(x)/Math.log(o)))<0&&(S=0),8<S&&(S=8),"exponent"===h?S:(0===x?(_[0]=0,_[1]=g?"":s[v][r?"bits":"bytes"][S]):(w=x/(2===t?Math.pow(2,10*S):Math.pow(1e3,S)),r&&o<=(w*=8)&&S<8&&(w/=o,S++),_[0]=Number(w.toFixed(0<S?f:0)),_[0]===o&&S<8&&void 0===y.exponent&&(_[0]=1,S++),_[1]=10===t&&1===S?r?"kb":"kB":s[v][r?"bits":"bytes"][S],g&&(_[1]="jedec"===v?_[1].charAt(0):0<S?_[1].replace(/B$/,""):_[1],n.test(_[1])&&(_[0]=Math.floor(_[0]),_[1]=""))),d&&(_[0]=-_[0]),_[1]=b[_[1]]||_[1],!0===l?_[0]=_[0].toLocaleString():0<l.length?_[0]=_[0].toLocaleString(l,u):0<m.length&&(_[0]=_[0].toString().replace(".",m)),"array"===h?_:(a&&(_[1]=c[S]?c[S]:i[v][S]+(r?"bit":"byte")+(1===_[0]?"":"s")),"object"===h?{value:_[0],symbol:_[1],exponent:S}:_.join(p)))}r.partial=function(e){return function(t){return r(t,e)}},e.exports=r}("undefined"!=typeof window?window:n.g)},2242:(e,t,n)=>{e.exports={default:n(3391),__esModule:!0}},8902:(e,t,n)=>{e.exports={default:n(8613),__esModule:!0}},6593:(e,t,n)=>{e.exports={default:n(112),__esModule:!0}},6803:(e,t,n)=>{"use strict";t.__esModule=!0;var s,i=(s=n(6593))&&s.__esModule?s:{default:s};t.default=function(e){return function(){var t=e.apply(this,arguments);return new i.default((function(e,n){return function s(r,o){try{var a=t[r](o),c=a.value}catch(e){return void n(e)}if(!a.done)return i.default.resolve(c).then((function(e){s("next",e)}),(function(e){s("throw",e)}));e(c)}("next")}))}}},8106:(e,t,n)=>{"use strict";t.__esModule=!0;var s,i=(s=n(2242))&&s.__esModule?s:{default:s};t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},2548:(e,t,n)=>{var s=function(){return this}()||Function("return this")(),i=s.regeneratorRuntime&&Object.getOwnPropertyNames(s).indexOf("regeneratorRuntime")>=0,r=i&&s.regeneratorRuntime;if(s.regeneratorRuntime=void 0,e.exports=n(8544),i)s.regeneratorRuntime=r;else try{delete s.regeneratorRuntime}catch(e){s.regeneratorRuntime=void 0}},8544:e=>{!function(t){"use strict";var n,s=Object.prototype,i=s.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag",l=t.regeneratorRuntime;if(l)e.exports=l;else{(l=t.regeneratorRuntime=e.exports).wrap=y;var u="suspendedStart",d="suspendedYield",h="executing",f="completed",g={},m={};m[o]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(T([])));v&&v!==s&&i.call(v,o)&&(m=v);var b=x.prototype=w.prototype=Object.create(m);S.prototype=b.constructor=x,x.constructor=S,x[c]=S.displayName="GeneratorFunction",l.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},l.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(b),e},l.awrap=function(e){return{__await:e}},E(j.prototype),j.prototype[a]=function(){return this},l.AsyncIterator=j,l.async=function(e,t,n,s){var i=new j(y(e,t,n,s));return l.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},E(b),b[c]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},l.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var s=t.pop();if(s in e)return n.value=s,n.done=!1,n}return n.done=!0,n}},l.values=T,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function s(s,i){return a.type="throw",a.arg=e,t.next=s,i&&(t.method="next",t.arg=n),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return s("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return s(o.catchLoc,!0);if(this.prev<o.finallyLoc)return s(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return s(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return s(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var r=s;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var s=n.completion;if("throw"===s.type){var i=s.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,s){return this.delegate={iterator:T(e),resultName:t,nextLoc:s},"next"===this.method&&(this.arg=n),g}}}function y(e,t,n,s){var i=t&&t.prototype instanceof w?t:w,r=Object.create(i.prototype),o=new O(s||[]);return r._invoke=function(e,t,n){var s=u;return function(i,r){if(s===h)throw new Error("Generator is already running");if(s===f){if("throw"===i)throw r;return N()}for(n.method=i,n.arg=r;;){var o=n.delegate;if(o){var a=A(o,n);if(a){if(a===g)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(s===u)throw s=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);s=h;var c=_(e,t,n);if("normal"===c.type){if(s=n.done?f:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(s=f,n.method="throw",n.arg=c.arg)}}}(e,n,o),r}function _(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function w(){}function S(){}function x(){}function E(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function j(e){function t(n,s,r,o){var a=_(e[n],e,s);if("throw"!==a.type){var c=a.arg,l=c.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,r,o)}),(function(e){t("throw",e,r,o)})):Promise.resolve(l).then((function(e){c.value=e,r(c)}),o)}o(a.arg)}var n;this._invoke=function(e,s){function i(){return new Promise((function(n,i){t(e,s,n,i)}))}return n=n?n.then(i,i):i()}}function A(e,t){var s=e.iterator[t.method];if(s===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,A(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=_(s,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,r=function t(){for(;++s<e.length;)if(i.call(e,s))return t.value=e[s],t.done=!1,t;return t.value=n,t.done=!0,t};return r.next=r}}return{next:N}}function N(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())},4942:(e,t,n)=>{e.exports=n(2548)},2919:function(e,t,n){var s,i;void 0===(i="function"==typeof(s=function(){"use strict";var e=void 0!==n.g?n.g:this||window,t=document,s=t.documentElement,i=e.BSN={},r=i.supports=[],o="data-toggle",a="data-dismiss",c="Alert",l="Button",u="Collapse",d="Dropdown",h="Modal",f="Popover",g="Tab",m="data-backdrop",p="data-target",v="data-title",b="aria-expanded",y="aria-hidden",_="aria-selected",w="click",S="focus",x="hover",E="keydown",j="keyup",A="resize",C="onmouseleave"in t?["mouseenter","mouseleave"]:["mouseover","mouseout"],k="show",O="shown",T="hide",N="hidden",I="change",M="getAttribute",R="Transition",D="Duration",z="Webkit",L="tabindex",P="active",F="show",B="collapsing",U="left",q="right",H="top",$="bottom",G=/\b(top|bottom|left|right)+/,V=0,W="fixed-top",J="fixed-bottom",Q=z+R in s.style||R.toLowerCase()in s.style,Y=z+R in s.style?z.toLowerCase()+R+"End":R.toLowerCase()+"end",K=z+D in s.style?z.toLowerCase()+R+D:R.toLowerCase()+D,X=function(e){e.focus?e.focus():e.setActive()},Z=function(e,t){e.classList.add(t)},ee=function(e,t){e.classList.remove(t)},te=function(e,t){return e.classList.contains(t)},ne=function(e,t){return[].slice.call(e.getElementsByClassName(t))},se=function(e,n){return"object"==typeof e?e:(n||t).querySelector(e)},ie=function(e,n){var s=n.charAt(0),i=n.substr(1);if("."===s){for(;e&&e!==t;e=e.parentNode)if(null!==se(n,e.parentNode)&&te(e,i))return e}else if("#"===s)for(;e&&e!==t;e=e.parentNode)if(e.id===i)return e;return!1},re=function(e,t,n,s){s=s||!1,e.addEventListener(t,n,s)},oe=function(e,t,n,s){s=s||!1,e.removeEventListener(t,n,s)},ae=function(e,t,n,s){re(e,t,(function i(r){n(r),oe(e,t,i,s)}),s)},ce=!!function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});ae(e,"testPassive",null,n)}catch(e){}return t}()&&{passive:!0},le=function(t){var n=Q?e.getComputedStyle(t)[K]:0;return"number"!=typeof(n=parseFloat(n))||isNaN(n)?0:1e3*n},ue=function(e,t){var n=0;le(e)?ae(e,Y,(function(e){!n&&t(e),n=1})):setTimeout((function(){!n&&t(),n=1}),17)},de=function(e,t,n){var s=new CustomEvent(e+".bs."+t);s.relatedTarget=n,this.dispatchEvent(s)},he=function(n,i,r,o){var a,c,l,u,d,h,f=i.offsetWidth,g=i.offsetHeight,m=s.clientWidth||t.body.clientWidth,p=s.clientHeight||t.body.clientHeight,v=n.getBoundingClientRect(),b=o===t.body?{y:e.pageYOffset||s.scrollTop,x:e.pageXOffset||s.scrollLeft}:{x:o.offsetLeft+o.scrollLeft,y:o.offsetTop+o.scrollTop},y=v.right-v.left,_=v.bottom-v.top,w=te(i,"popover"),S=se(".arrow",i),x=v.top+_/2-g/2<0,E=v.left+y/2-f/2<0,j=v.left+f/2+y/2>=m,A=v.top+g/2+_/2>=p,C=v.top-g<0,k=v.left-f<0,O=v.top+g+_>=p,T=v.left+f+y>=m;r=(r=(r=(r=(r=(r===U||r===q)&&k&&T?H:r)===H&&C?$:r)===$&&O?H:r)===U&&k?q:r)===q&&T?U:r,-1===i.className.indexOf(r)&&(i.className=i.className.replace(G,r)),d=S.offsetWidth,h=S.offsetHeight,r===U||r===q?(c=r===U?v.left+b.x-f-(w?d:0):v.left+b.x+y,x?(a=v.top+b.y,l=_/2-d):A?(a=v.top+b.y-g+_,l=g-_/2-d):(a=v.top+b.y-g/2+_/2,l=g/2-(w?.9*h:h/2))):r!==H&&r!==$||(a=r===H?v.top+b.y-g-(w?h:0):v.top+b.y+_,E?(c=0,u=v.left+y/2-d):j?(c=m-1.01*f,u=f-(m-v.left)+y/2-d/2):(c=v.left+b.x-f/2+y/2,u=f/2-(w?d:d/2))),i.style.top=a+"px",i.style.left=c+"px",l&&(S.style.top=l+"px"),u&&(S.style.left=u+"px")};i.version="2.0.27";var fe=function(e){e=se(e);var t=this,n="alert",s=ie(e,".alert"),i=function(n){s=ie(n.target,".alert"),(e=se('[data-dismiss="alert"]',s))&&s&&(e===n.target||e.contains(n.target))&&t.close()},r=function(){de.call(s,"closed",n),oe(e,w,i),s.parentNode.removeChild(s)};this.close=function(){s&&e&&te(s,F)&&(de.call(s,"close",n),ee(s,F),s&&(te(s,"fade")?ue(s,r):r()))},c in e||re(e,w,i),e.Alert=t};r.push([c,fe,'[data-dismiss="alert"]']);var ge=function(e){e=se(e);var n=!1,s="button",i="checked",r="LABEL",o="INPUT",a=function(t){var a=t.target.tagName===r?t.target:t.target.parentNode.tagName===r?t.target.parentNode:null;if(a){var c=ne(a.parentNode,"btn"),l=a.getElementsByTagName(o)[0];if(l){if("checkbox"===l.type&&(l.checked?(ee(a,P),l.getAttribute(i),l.removeAttribute(i),l.checked=!1):(Z(a,P),l.getAttribute(i),l.setAttribute(i,i),l.checked=!0),n||(n=!0,de.call(l,I,s),de.call(e,I,s))),"radio"===l.type&&!n&&(!l.checked||0===t.screenX&&0==t.screenY)){Z(a,P),Z(a,S),l.setAttribute(i,i),l.checked=!0,de.call(l,I,s),de.call(e,I,s),n=!0;for(var u=0,d=c.length;u<d;u++){var h=c[u],f=h.getElementsByTagName(o)[0];h!==a&&te(h,P)&&(ee(h,P),f.removeAttribute(i),f.checked=!1,de.call(f,I,s))}}setTimeout((function(){n=!1}),50)}}},c=function(e){Z(e.target.parentNode,S)},u=function(e){ee(e.target.parentNode,S)};if(!(l in e)){re(e,w,a),re(e,j,(function(e){32===(e.which||e.keyCode)&&e.target===t.activeElement&&a(e)})),re(e,E,(function(e){32===(e.which||e.keyCode)&&e.preventDefault()}));for(var d=ne(e,"btn"),h=0;h<d.length;h++){var f=d[h].getElementsByTagName(o)[0];re(f,S,c),re(f,"blur",u)}}var g=ne(e,"btn"),m=g.length;for(h=0;h<m;h++)!te(g[h],P)&&se("input:checked",g[h])&&Z(g[h],P);e.Button=this};r.push([l,ge,'[data-toggle="buttons"]']);var me=function(e,t){e=se(e),t=t||{};var n,s,i,r,o,a=null,c=null,l=this,d=e.getAttribute("data-parent"),h="collapse",f="collapsed",g=function(e,t){de.call(e,T,h),e.isAnimating=!0,e.style.height=e.scrollHeight+"px",ee(e,h),ee(e,F),Z(e,B),e.offsetWidth,e.style.height="0px",ue(e,(function(){e.isAnimating=!1,e.setAttribute(b,"false"),t.setAttribute(b,"false"),ee(e,B),Z(e,h),e.style.height="",de.call(e,N,h)}))};this.toggle=function(e){e.preventDefault(),te(c,F)?l.hide():l.show()},this.hide=function(){c.isAnimating||(g(c,e),Z(e,f))},this.show=function(){var t,i;a&&(n=se(".collapse.show",a),s=n&&(se('[data-target="#'+n.id+'"]',a)||se('[href="#'+n.id+'"]',a))),(!c.isAnimating||n&&!n.isAnimating)&&(s&&n!==c&&(g(n,s),Z(s,f)),i=e,de.call(t=c,k,h),t.isAnimating=!0,Z(t,B),ee(t,h),t.style.height=t.scrollHeight+"px",ue(t,(function(){t.isAnimating=!1,t.setAttribute(b,"true"),i.setAttribute(b,"true"),ee(t,B),Z(t,h),Z(t,F),t.style.height="",de.call(t,O,h)})),ee(e,f))},u in e||re(e,w,l.toggle),(i=e.href&&e.getAttribute("href"),r=e.getAttribute(p),o=i||r&&"#"===r.charAt(0)&&r,c=o&&se(o)).isAnimating=!1,a=se(t.parent)||d&&ie(e,d),e.Collapse=l};r.push([u,me,'[data-toggle="collapse"]']);var pe=function(e,n){e=se(e),this.persist=!0===n||"true"===e.getAttribute("data-persist")||!1;var s=this,i=e.parentNode,r="dropdown",a=null,c=se(".dropdown-menu",i),l=function(){for(var e=c.children,t=[],n=0;n<e.length;n++)e[n].children.length&&"A"===e[n].children[0].tagName&&t.push(e[n].children[0]),"A"===e[n].tagName&&t.push(e[n]);return t}(),u=function(e){(e.href&&"#"===e.href.slice(-1)||e.parentNode&&e.parentNode.href&&"#"===e.parentNode.href.slice(-1))&&this.preventDefault()},h=function(){var n=e.open?re:oe;n(t,w,f),n(t,E,m),n(t,j,p),n(t,S,f,!0)},f=function(t){var n=t.target,i=n&&(n.getAttribute(o)||n.parentNode&&M in n.parentNode&&n.parentNode.getAttribute(o));(t.type!==S||n!==e&&n!==c&&!c.contains(n))&&(n!==c&&!c.contains(n)||!s.persist&&!i)&&(a=n===e||e.contains(n)?e:null,y(),u.call(t,n))},g=function(t){a=e,v(),u.call(t,t.target)},m=function(e){var t=e.which||e.keyCode;38!==t&&40!==t||e.preventDefault()},p=function(n){var i=n.which||n.keyCode,r=t.activeElement,o=l.indexOf(r),u=r===e,d=c.contains(r),h=r.parentNode===c||r.parentNode.parentNode===c;h&&(o=u?0:38===i?o>1?o-1:0:40===i&&o<l.length-1?o+1:o,l[o]&&X(l[o])),(l.length&&h||!l.length&&(d||u)||!d)&&e.open&&27===i&&(s.toggle(),a=null)},v=function(){de.call(i,k,r,a),Z(c,F),Z(i,F),e.setAttribute(b,!0),de.call(i,O,r,a),e.open=!0,oe(e,w,g),setTimeout((function(){X(c.getElementsByTagName("INPUT")[0]||e),h()}),1)},y=function(){de.call(i,T,r,a),ee(c,F),ee(i,F),e.setAttribute(b,!1),de.call(i,N,r,a),e.open=!1,h(),X(e),setTimeout((function(){re(e,w,g)}),1)};e.open=!1,this.toggle=function(){te(i,F)&&e.open?y():v()},d in e||(!1 in c&&c.setAttribute(L,"0"),re(e,w,g)),e.Dropdown=s};r.push([d,pe,'[data-toggle="dropdown"]']);var ve=function(n,i){n=se(n);var r="modal",o="static",c="modalTrigger",l="modal-backdrop",u=n.getAttribute(p)||n.getAttribute("href"),d=se(u),f=te(n,r)?n:d;if(te(n,r)&&(n=null),f){i=i||{},this.keyboard=!1!==i.keyboard&&"false"!==f.getAttribute("data-keyboard"),this.backdrop=i.backdrop!==o&&f.getAttribute(m)!==o||o,this.backdrop=!1!==i.backdrop&&"false"!==f.getAttribute(m)&&this.backdrop,this.animation=!!te(f,"fade"),this.content=i.content,f.isAnimating=!1;var g,v,b,_,S,x=this,j=null,C=ne(s,W).concat(ne(s,J)),I=function(){var n,s=e.getComputedStyle(t.body),i=parseInt(s.paddingRight,10);if(g&&(t.body.style.paddingRight=i+v+"px",f.style.paddingRight=v+"px",C.length))for(var r=0;r<C.length;r++)n=e.getComputedStyle(C[r]).paddingRight,C[r].style.paddingRight=parseInt(n)+v+"px"},M=function(){var n,i,r;g=t.body.clientWidth<(r=s.getBoundingClientRect(),e.innerWidth||r.right-Math.abs(r.left)),(i=t.createElement("div")).className="modal-scrollbar-measure",t.body.appendChild(i),n=i.offsetWidth-i.clientWidth,t.body.removeChild(i),v=n},R=function(){(b=se(".modal-backdrop"))&&null!==b&&"object"==typeof b&&(V=0,t.body.removeChild(b),b=null)},D=function(){X(f),f.isAnimating=!1,de.call(f,O,r,j),re(e,A,x.update,ce),re(f,w,P),re(t,E,L)},z=function(){f.style.display="",n&&X(n),de.call(f,N,r),ne(t,"modal show")[0]||(function(){if(t.body.style.paddingRight="",f.style.paddingRight="",C.length)for(var e=0;e<C.length;e++)C[e].style.paddingRight=""}(),ee(t.body,"modal-open"),b&&te(b,"fade")?(ee(b,F),ue(b,R)):R(),oe(e,A,x.update,ce),oe(f,w,P),oe(t,E,L)),f.isAnimating=!1},L=function(e){f.isAnimating||x.keyboard&&27==e.which&&te(f,F)&&x.hide()},P=function(e){if(!f.isAnimating){var t=e.target;te(f,F)&&(t.parentNode.getAttribute(a)===r||t.getAttribute(a)===r||t===f&&x.backdrop!==o)&&(x.hide(),j=null,e.preventDefault())}};this.toggle=function(){te(f,F)?this.hide():this.show()},this.show=function(){te(f,F)||f.isAnimating||(clearTimeout(S),S=setTimeout((function(){f.isAnimating=!0,de.call(f,k,r,j);var e,n=ne(t,"modal show")[0];n&&n!==f&&(c in n&&n.modalTrigger.Modal.hide(),h in n&&n.Modal.hide()),x.backdrop&&!V&&!b&&(e=t.createElement("div"),null===(b=se(".modal-backdrop"))&&(e.setAttribute("class",l+(x.animation?" fade":"")),b=e,t.body.appendChild(b)),V=1),b&&!te(b,F)&&(b.offsetWidth,_=le(b),Z(b,F)),setTimeout((function(){f.style.display="block",M(),I(),Z(t.body,"modal-open"),Z(f,F),f.setAttribute(y,!1),te(f,"fade")?ue(f,D):D()}),Q&&b&&_?_:1)}),1))},this.hide=function(){!f.isAnimating&&te(f,F)&&(clearTimeout(S),S=setTimeout((function(){f.isAnimating=!0,de.call(f,T,r),b=se(".modal-backdrop"),_=b&&le(b),ee(f,F),f.setAttribute(y,!0),setTimeout((function(){te(f,"fade")?ue(f,z):z()}),Q&&b&&_?_:2)}),2))},this.setContent=function(e){se(".modal-content",f).innerHTML=e},this.update=function(){te(f,F)&&(M(),I())},n&&!(h in n)&&re(n,w,(function(e){if(!f.isAnimating){var t=e.target;(t=t.hasAttribute(p)||t.hasAttribute("href")?t:t.parentNode)!==n||te(f,F)||(f.modalTrigger=n,j=n,x.show(),e.preventDefault())}})),x.content&&x.setContent(x.content),n?(n.Modal=x,f.modalTrigger=n):f.Modal=x}};r.push([h,ve,'[data-toggle="modal"]']);var be=function(n,s){n=se(n),s=s||{};var i=n.getAttribute("data-trigger"),r=n.getAttribute("data-animation"),o=n.getAttribute("data-placement"),a=n.getAttribute("data-dismissible"),c=n.getAttribute("data-delay"),l=n.getAttribute("data-container"),u="popover",d="class",h="div",g="fade",m="data-content",p='<button type="button" class="close">×</button>',b=se(s.container),y=se(l),_=ie(n,".modal"),S=ie(n,".fixed-top"),E=ie(n,".fixed-bottom");this.template=s.template?s.template:null,this.trigger=s.trigger?s.trigger:i||x,this.animation=s.animation&&s.animation!==g?s.animation:r||g,this.placement=s.placement?s.placement:o||H,this.delay=parseInt(s.delay||c)||200,this.dismissible=!(!s.dismissible&&"true"!==a),this.container=b||y||S||E||_||t.body;var j=this,I=s.title||n.getAttribute(v)||null,M=s.content||n.getAttribute(m)||null;if(M||this.template){var R=null,D=0,z=this.placement,L=function(e){null!==R&&e.target===se(".close",R)&&j.hide()},P=function(s){w!=j.trigger&&"focus"!=j.trigger||!j.dismissible&&s(n,"blur",j.hide),j.dismissible&&s(t,w,L),s(e,A,j.hide,ce)},B=function(){P(re),de.call(n,O,u)},U=function(){P(oe),j.container.removeChild(R),D=null,R=null,de.call(n,N,u)};this.toggle=function(){null===R?j.show():j.hide()},this.show=function(){clearTimeout(D),D=setTimeout((function(){null===R&&(z=j.placement,function(){I=s.title||n.getAttribute(v),M=(M=s.content||n.getAttribute(m))?M.trim():null,R=t.createElement(h);var e=t.createElement(h);if(e.setAttribute(d,"arrow"),R.appendChild(e),null!==M&&null===j.template){if(R.setAttribute("role","tooltip"),null!==I){var i=t.createElement("h3");i.setAttribute(d,"popover-header"),i.innerHTML=j.dismissible?I+p:I,R.appendChild(i)}var r=t.createElement(h);r.setAttribute(d,"popover-body"),r.innerHTML=j.dismissible&&null===I?M+p:M,R.appendChild(r)}else{var o=t.createElement(h);j.template=j.template.trim(),o.innerHTML=j.template,R.innerHTML=o.firstChild.innerHTML}j.container.appendChild(R),R.style.display="block",R.setAttribute(d,"popover bs-popover-"+z+" "+j.animation)}(),he(n,R,z,j.container),!te(R,F)&&Z(R,F),de.call(n,k,u),j.animation?ue(R,B):B())}),20)},this.hide=function(){clearTimeout(D),D=setTimeout((function(){R&&null!==R&&te(R,F)&&(de.call(n,T,u),ee(R,F),j.animation?ue(R,U):U())}),j.delay)},f in n||(j.trigger===x?(re(n,C[0],j.show),j.dismissible||re(n,C[1],j.hide)):w!=j.trigger&&"focus"!=j.trigger||re(n,j.trigger,j.toggle)),n.Popover=j}};r.push([f,be,'[data-toggle="popover"]']);var ye=function(e,t){var n=(e=se(e)).getAttribute("data-height"),s="tab";t=t||{},this.height=!!Q&&(t.height||"true"===n);var i,r,o,a,c,l,u,d=this,h=ie(e,".nav"),f=!1,m=h&&se(".dropdown-toggle",h),p=function(){f.style.height="",ee(f,B),h.isAnimating=!1},v=function(){f?l?p():setTimeout((function(){f.style.height=u+"px",f.offsetWidth,ue(f,p)}),50):h.isAnimating=!1,de.call(i,O,s,r)},b=function(){f&&(o.style.float=U,a.style.float=U,c=o.scrollHeight),Z(a,P),de.call(i,k,s,r),ee(o,P),de.call(r,N,s,i),f&&(u=a.scrollHeight,l=u===c,Z(f,B),f.style.height=c+"px",f.offsetHeight,o.style.float="",a.style.float=""),te(a,"fade")?setTimeout((function(){Z(a,F),ue(a,v)}),20):v()};if(h){h.isAnimating=!1;var y=function(){var e,t=ne(h,P);return 1!==t.length||te(t[0].parentNode,"dropdown")?t.length>1&&(e=t[t.length-1]):e=t[0],e},S=function(){return se(y().getAttribute("href"))};this.show=function(){a=se((i=i||e).getAttribute("href")),r=y(),o=S(),h.isAnimating=!0,ee(r,P),r.setAttribute(_,"false"),Z(i,P),i.setAttribute(_,"true"),m&&(te(e.parentNode,"dropdown-menu")?te(m,P)||Z(m,P):te(m,P)&&ee(m,P)),de.call(r,T,s,i),te(o,"fade")?(ee(o,F),ue(o,b)):b()},g in e||re(e,w,(function(e){e.preventDefault(),i=e.currentTarget,!h.isAnimating&&!te(i,P)&&d.show()})),d.height&&(f=S().parentNode),e.Tab=d}};r.push([g,ye,'[data-toggle="tab"]']);var _e=function(e,t){for(var n=0,s=t.length;n<s;n++)new e(t[n])},we=i.initCallback=function(e){e=e||t;for(var n=0,s=r.length;n<s;n++)_e(r[n][1],e.querySelectorAll(r[n][2]))};return t.body?we():re(t,"DOMContentLoaded",(function(){we()})),{Alert:fe,Button:ge,Collapse:me,Dropdown:pe,Modal:ve,Popover:be,Tab:ye}})?s.apply(t,[]):s)||(e.exports=i)},3391:(e,t,n)=>{n(1477);var s=n(4579).Object;e.exports=function(e,t,n){return s.defineProperty(e,t,n)}},8613:(e,t,n)=>{n(961),e.exports=n(4579).Object.keys},112:(e,t,n)=>{n(4058),n(1867),n(3871),n(2878),n(5971),n(2526),e.exports=n(4579).Promise},5663:e=>{e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},9003:e=>{e.exports=function(){}},9142:e=>{e.exports=function(e,t,n,s){if(!(e instanceof t)||void 0!==s&&s in e)throw TypeError(n+": incorrect invocation!");return e}},2159:(e,t,n)=>{var s=n(6727);e.exports=function(e){if(!s(e))throw TypeError(e+" is not an object!");return e}},7428:(e,t,n)=>{var s=n(7932),i=n(8728),r=n(6531);e.exports=function(e){return function(t,n,o){var a,c=s(t),l=i(c.length),u=r(o,l);if(e&&n!=n){for(;l>u;)if((a=c[u++])!=a)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},4677:(e,t,n)=>{var s=n(2894),i=n(2939)("toStringTag"),r="Arguments"==s(function(){return arguments}());e.exports=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:r?s(t):"Object"==(o=s(t))&&"function"==typeof t.callee?"Arguments":o}},2894:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},4579:e=>{var t=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=t)},9216:(e,t,n)=>{var s=n(5663);e.exports=function(e,t,n){if(s(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,s){return e.call(t,n,s)};case 3:return function(n,s,i){return e.call(t,n,s,i)}}return function(){return e.apply(t,arguments)}}},8333:e=>{e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},9666:(e,t,n)=>{e.exports=!n(7929)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},7467:(e,t,n)=>{var s=n(6727),i=n(3938).document,r=s(i)&&s(i.createElement);e.exports=function(e){return r?i.createElement(e):{}}},3338:e=>{e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},3856:(e,t,n)=>{var s=n(3938),i=n(4579),r=n(9216),o=n(1818),a=n(7069),c=function(e,t,n){var l,u,d,h=e&c.F,f=e&c.G,g=e&c.S,m=e&c.P,p=e&c.B,v=e&c.W,b=f?i:i[t]||(i[t]={}),y=b.prototype,_=f?s:g?s[t]:(s[t]||{}).prototype;for(l in f&&(n=t),n)(u=!h&&_&&void 0!==_[l])&&a(b,l)||(d=u?_[l]:n[l],b[l]=f&&"function"!=typeof _[l]?n[l]:p&&u?r(d,s):v&&_[l]==d?function(e){var t=function(t,n,s){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,s)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?r(Function.call,d):d,m&&((b.virtual||(b.virtual={}))[l]=d,e&c.R&&y&&!y[l]&&o(y,l,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},7929:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},5576:(e,t,n)=>{var s=n(9216),i=n(5602),r=n(5991),o=n(2159),a=n(8728),c=n(3728),l={},u={},d=e.exports=function(e,t,n,d,h){var f,g,m,p,v=h?function(){return e}:c(e),b=s(n,d,t?2:1),y=0;if("function"!=typeof v)throw TypeError(e+" is not iterable!");if(r(v)){for(f=a(e.length);f>y;y++)if((p=t?b(o(g=e[y])[0],g[1]):b(e[y]))===l||p===u)return p}else for(m=v.call(e);!(g=m.next()).done;)if((p=i(m,b,g.value,t))===l||p===u)return p};d.BREAK=l,d.RETURN=u},3938:e=>{var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},7069:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},1818:(e,t,n)=>{var s=n(4743),i=n(3101);e.exports=n(9666)?function(e,t,n){return s.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},4881:(e,t,n)=>{var s=n(3938).document;e.exports=s&&s.documentElement},3758:(e,t,n)=>{e.exports=!n(9666)&&!n(7929)((function(){return 7!=Object.defineProperty(n(7467)("div"),"a",{get:function(){return 7}}).a}))},6778:e=>{e.exports=function(e,t,n){var s=void 0===n;switch(t.length){case 0:return s?e():e.call(n);case 1:return s?e(t[0]):e.call(n,t[0]);case 2:return s?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return s?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return s?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},799:(e,t,n)=>{var s=n(2894);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==s(e)?e.split(""):Object(e)}},5991:(e,t,n)=>{var s=n(5449),i=n(2939)("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(s.Array===e||r[i]===e)}},6727:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},5602:(e,t,n)=>{var s=n(2159);e.exports=function(e,t,n,i){try{return i?t(s(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&s(r.call(e)),t}}},3945:(e,t,n)=>{"use strict";var s=n(526),i=n(3101),r=n(5378),o={};n(1818)(o,n(2939)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=s(o,{next:i(1,n)}),r(e,t+" Iterator")}},5700:(e,t,n)=>{"use strict";var s=n(6227),i=n(3856),r=n(7470),o=n(1818),a=n(5449),c=n(3945),l=n(5378),u=n(5089),d=n(2939)("iterator"),h=!([].keys&&"next"in[].keys()),f="keys",g="values",m=function(){return this};e.exports=function(e,t,n,p,v,b,y){c(n,t,p);var _,w,S,x=function(e){if(!h&&e in C)return C[e];switch(e){case f:case g:return function(){return new n(this,e)}}return function(){return new n(this,e)}},E=t+" Iterator",j=v==g,A=!1,C=e.prototype,k=C[d]||C["@@iterator"]||v&&C[v],O=k||x(v),T=v?j?x("entries"):O:void 0,N="Array"==t&&C.entries||k;if(N&&(S=u(N.call(new e)))!==Object.prototype&&S.next&&(l(S,E,!0),s||"function"==typeof S[d]||o(S,d,m)),j&&k&&k.name!==g&&(A=!0,O=function(){return k.call(this)}),s&&!y||!h&&!A&&C[d]||o(C,d,O),a[t]=O,a[E]=m,v)if(_={values:j?O:x(g),keys:b?O:x(f),entries:T},y)for(w in _)w in C||r(C,w,_[w]);else i(i.P+i.F*(h||A),t,_);return _}},6630:(e,t,n)=>{var s=n(2939)("iterator"),i=!1;try{var r=[7][s]();r.return=function(){i=!0},Array.from(r,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var r=[7],o=r[s]();o.next=function(){return{done:n=!0}},r[s]=function(){return o},e(r)}catch(e){}return n}},5084:e=>{e.exports=function(e,t){return{value:t,done:!!e}}},5449:e=>{e.exports={}},6227:e=>{e.exports=!0},1601:(e,t,n)=>{var s=n(3938),i=n(2569).set,r=s.MutationObserver||s.WebKitMutationObserver,o=s.process,a=s.Promise,c="process"==n(2894)(o);e.exports=function(){var e,t,n,l=function(){var s,i;for(c&&(s=o.domain)&&s.exit();e;){i=e.fn,e=e.next;try{i()}catch(s){throw e?n():t=void 0,s}}t=void 0,s&&s.enter()};if(c)n=function(){o.nextTick(l)};else if(!r||s.navigator&&s.navigator.standalone)if(a&&a.resolve){var u=a.resolve(void 0);n=function(){u.then(l)}}else n=function(){i.call(s,l)};else{var d=!0,h=document.createTextNode("");new r(l).observe(h,{characterData:!0}),n=function(){h.data=d=!d}}return function(s){var i={fn:s,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},9304:(e,t,n)=>{"use strict";var s=n(5663);function i(e){var t,n;this.promise=new e((function(e,s){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=s})),this.resolve=s(t),this.reject=s(n)}e.exports.f=function(e){return new i(e)}},526:(e,t,n)=>{var s=n(2159),i=n(7856),r=n(3338),o=n(8989)("IE_PROTO"),a=function(){},c=function(){var e,t=n(7467)("iframe"),s=r.length;for(t.style.display="none",n(4881).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;s--;)delete c.prototype[r[s]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=s(e),n=new a,a.prototype=null,n[o]=e):n=c(),void 0===t?n:i(n,t)}},4743:(e,t,n)=>{var s=n(2159),i=n(3758),r=n(3206),o=Object.defineProperty;t.f=n(9666)?Object.defineProperty:function(e,t,n){if(s(e),t=r(t,!0),s(n),i)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},7856:(e,t,n)=>{var s=n(4743),i=n(2159),r=n(6162);e.exports=n(9666)?Object.defineProperties:function(e,t){i(e);for(var n,o=r(t),a=o.length,c=0;a>c;)s.f(e,n=o[c++],t[n]);return e}},5089:(e,t,n)=>{var s=n(7069),i=n(6530),r=n(8989)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),s(e,r)?e[r]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},2963:(e,t,n)=>{var s=n(7069),i=n(7932),r=n(7428)(!1),o=n(8989)("IE_PROTO");e.exports=function(e,t){var n,a=i(e),c=0,l=[];for(n in a)n!=o&&s(a,n)&&l.push(n);for(;t.length>c;)s(a,n=t[c++])&&(~r(l,n)||l.push(n));return l}},6162:(e,t,n)=>{var s=n(2963),i=n(3338);e.exports=Object.keys||function(e){return s(e,i)}},2584:(e,t,n)=>{var s=n(3856),i=n(4579),r=n(7929);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],o={};o[e]=t(n),s(s.S+s.F*r((function(){n(1)})),"Object",o)}},931:e=>{e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},7790:(e,t,n)=>{var s=n(2159),i=n(6727),r=n(9304);e.exports=function(e,t){if(s(e),i(t)&&t.constructor===e)return t;var n=r.f(e);return(0,n.resolve)(t),n.promise}},3101:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},8144:(e,t,n)=>{var s=n(1818);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:s(e,i,t[i]);return e}},7470:(e,t,n)=>{e.exports=n(1818)},9967:(e,t,n)=>{"use strict";var s=n(3938),i=n(4579),r=n(4743),o=n(9666),a=n(2939)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:s[e];o&&t&&!t[a]&&r.f(t,a,{configurable:!0,get:function(){return this}})}},5378:(e,t,n)=>{var s=n(4743).f,i=n(7069),r=n(2939)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,r)&&s(e,r,{configurable:!0,value:t})}},8989:(e,t,n)=>{var s=n(250)("keys"),i=n(5730);e.exports=function(e){return s[e]||(s[e]=i(e))}},250:(e,t,n)=>{var s=n(4579),i=n(3938),r="__core-js_shared__",o=i[r]||(i[r]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:s.version,mode:n(6227)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},2707:(e,t,n)=>{var s=n(2159),i=n(5663),r=n(2939)("species");e.exports=function(e,t){var n,o=s(e).constructor;return void 0===o||null==(n=s(o)[r])?t:i(n)}},510:(e,t,n)=>{var s=n(1052),i=n(8333);e.exports=function(e){return function(t,n){var r,o,a=String(i(t)),c=s(n),l=a.length;return c<0||c>=l?e?"":void 0:(r=a.charCodeAt(c))<55296||r>56319||c+1===l||(o=a.charCodeAt(c+1))<56320||o>57343?e?a.charAt(c):r:e?a.slice(c,c+2):o-56320+(r-55296<<10)+65536}}},2569:(e,t,n)=>{var s,i,r,o=n(9216),a=n(6778),c=n(4881),l=n(7467),u=n(3938),d=u.process,h=u.setImmediate,f=u.clearImmediate,g=u.MessageChannel,m=u.Dispatch,p=0,v={},b=function(){var e=+this;if(v.hasOwnProperty(e)){var t=v[e];delete v[e],t()}},y=function(e){b.call(e.data)};h&&f||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return v[++p]=function(){a("function"==typeof e?e:Function(e),t)},s(p),p},f=function(e){delete v[e]},"process"==n(2894)(d)?s=function(e){d.nextTick(o(b,e,1))}:m&&m.now?s=function(e){m.now(o(b,e,1))}:g?(r=(i=new g).port2,i.port1.onmessage=y,s=o(r.postMessage,r,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(s=function(e){u.postMessage(e+"","*")},u.addEventListener("message",y,!1)):s="onreadystatechange"in l("script")?function(e){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),b.call(e)}}:function(e){setTimeout(o(b,e,1),0)}),e.exports={set:h,clear:f}},6531:(e,t,n)=>{var s=n(1052),i=Math.max,r=Math.min;e.exports=function(e,t){return(e=s(e))<0?i(e+t,0):r(e,t)}},1052:e=>{var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},7932:(e,t,n)=>{var s=n(799),i=n(8333);e.exports=function(e){return s(i(e))}},8728:(e,t,n)=>{var s=n(1052),i=Math.min;e.exports=function(e){return e>0?i(s(e),9007199254740991):0}},6530:(e,t,n)=>{var s=n(8333);e.exports=function(e){return Object(s(e))}},3206:(e,t,n)=>{var s=n(6727);e.exports=function(e,t){if(!s(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!s(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!s(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!s(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},5730:e=>{var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++t+n).toString(36))}},6640:(e,t,n)=>{var s=n(3938).navigator;e.exports=s&&s.userAgent||""},2939:(e,t,n)=>{var s=n(250)("wks"),i=n(5730),r=n(3938).Symbol,o="function"==typeof r;(e.exports=function(e){return s[e]||(s[e]=o&&r[e]||(o?r:i)("Symbol."+e))}).store=s},3728:(e,t,n)=>{var s=n(4677),i=n(2939)("iterator"),r=n(5449);e.exports=n(4579).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||r[s(e)]}},3882:(e,t,n)=>{"use strict";var s=n(9003),i=n(5084),r=n(5449),o=n(7932);e.exports=n(5700)(Array,"Array",(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),r.Arguments=r.Array,s("keys"),s("values"),s("entries")},1477:(e,t,n)=>{var s=n(3856);s(s.S+s.F*!n(9666),"Object",{defineProperty:n(4743).f})},961:(e,t,n)=>{var s=n(6530),i=n(6162);n(2584)("keys",(function(){return function(e){return i(s(e))}}))},4058:()=>{},2878:(e,t,n)=>{"use strict";var s,i,r,o,a=n(6227),c=n(3938),l=n(9216),u=n(4677),d=n(3856),h=n(6727),f=n(5663),g=n(9142),m=n(5576),p=n(2707),v=n(2569).set,b=n(1601)(),y=n(9304),_=n(931),w=n(6640),S=n(7790),x="Promise",E=c.TypeError,j=c.process,A=j&&j.versions,C=A&&A.v8||"",k=c.Promise,O="process"==u(j),T=function(){},N=i=y.f,I=!!function(){try{var e=k.resolve(1),t=(e.constructor={})[n(2939)("species")]=function(e){e(T,T)};return(O||"function"==typeof PromiseRejectionEvent)&&e.then(T)instanceof t&&0!==C.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(e){}}(),M=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},R=function(e,t){if(!e._n){e._n=!0;var n=e._c;b((function(){for(var s=e._v,i=1==e._s,r=0,o=function(t){var n,r,o,a=i?t.ok:t.fail,c=t.resolve,l=t.reject,u=t.domain;try{a?(i||(2==e._h&&L(e),e._h=1),!0===a?n=s:(u&&u.enter(),n=a(s),u&&(u.exit(),o=!0)),n===t.promise?l(E("Promise-chain cycle")):(r=M(n))?r.call(n,c,l):c(n)):l(s)}catch(e){u&&!o&&u.exit(),l(e)}};n.length>r;)o(n[r++]);e._c=[],e._n=!1,t&&!e._h&&D(e)}))}},D=function(e){v.call(c,(function(){var t,n,s,i=e._v,r=z(e);if(r&&(t=_((function(){O?j.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(s=c.console)&&s.error&&s.error("Unhandled promise rejection",i)})),e._h=O||z(e)?2:1),e._a=void 0,r&&t.e)throw t.v}))},z=function(e){return 1!==e._h&&0===(e._a||e._c).length},L=function(e){v.call(c,(function(){var t;O?j.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},P=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),R(t,!0))},F=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw E("Promise can't be resolved itself");(t=M(e))?b((function(){var s={_w:n,_d:!1};try{t.call(e,l(F,s,1),l(P,s,1))}catch(e){P.call(s,e)}})):(n._v=e,n._s=1,R(n,!1))}catch(e){P.call({_w:n,_d:!1},e)}}};I||(k=function(e){g(this,k,x,"_h"),f(e),s.call(this);try{e(l(F,this,1),l(P,this,1))}catch(e){P.call(this,e)}},(s=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(8144)(k.prototype,{then:function(e,t){var n=N(p(this,k));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?j.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&R(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new s;this.promise=e,this.resolve=l(F,e,1),this.reject=l(P,e,1)},y.f=N=function(e){return e===k||e===o?new r(e):i(e)}),d(d.G+d.W+d.F*!I,{Promise:k}),n(5378)(k,x),n(9967)(x),o=n(4579).Promise,d(d.S+d.F*!I,x,{reject:function(e){var t=N(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(a||!I),x,{resolve:function(e){return S(a&&this===o?k:this,e)}}),d(d.S+d.F*!(I&&n(6630)((function(e){k.all(e).catch(T)}))),x,{all:function(e){var t=this,n=N(t),s=n.resolve,i=n.reject,r=_((function(){var n=[],r=0,o=1;m(e,!1,(function(e){var a=r++,c=!1;n.push(void 0),o++,t.resolve(e).then((function(e){c||(c=!0,n[a]=e,--o||s(n))}),i)})),--o||s(n)}));return r.e&&i(r.v),n.promise},race:function(e){var t=this,n=N(t),s=n.reject,i=_((function(){m(e,!1,(function(e){t.resolve(e).then(n.resolve,s)}))}));return i.e&&s(i.v),n.promise}})},1867:(e,t,n)=>{"use strict";var s=n(510)(!0);n(5700)(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=s(t,n),this._i+=e.length,{value:e,done:!1})}))},5971:(e,t,n)=>{"use strict";var s=n(3856),i=n(4579),r=n(3938),o=n(2707),a=n(7790);s(s.P+s.R,"Promise",{finally:function(e){var t=o(this,i.Promise||r.Promise),n="function"==typeof e;return this.then(n?function(n){return a(t,e()).then((function(){return n}))}:e,n?function(n){return a(t,e()).then((function(){throw n}))}:e)}})},2526:(e,t,n)=>{"use strict";var s=n(3856),i=n(9304),r=n(931);s(s.S,"Promise",{try:function(e){var t=i.f(this),n=r(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},3871:(e,t,n)=>{n(3882);for(var s=n(3938),i=n(1818),r=n(5449),o=n(2939)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<a.length;c++){var l=a[c],u=s[l],d=u&&u.prototype;d&&!d[o]&&i(d,o,l),r[l]=r.Array}},5708:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"_modal.scss"}]),e.exports=t},2376:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"bookmarks.scss"}]),e.exports=t},7862:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"chats.scss"}]),e.exports=t},1890:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"chat-bottom-panel.scss"}]),e.exports=t},3960:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"chat-head.scss"}]),e.exports=t},1089:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"index.scss"}]),e.exports=t},9900:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"_controlbox.scss"}]),e.exports=t},9684:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"background.scss"}]),e.exports=t},7601:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"fullscreen.scss"}]),e.exports=t},4774:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"headlines.scss"}]),e.exports=t},5078:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"minimize.scss"}]),e.exports=t},7823:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"index.scss"}]),e.exports=t},8961:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"muc-bottom-panel.scss"}]),e.exports=t},3305:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"muc-head.scss"}]),e.exports=t},6672:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"muc-occupants.scss"}]),e.exports=t},9597:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"roster.scss"}]),e.exports=t},6955:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"_autocomplete.scss"}]),e.exports=t},5594:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"chat-content.scss"}]),e.exports=t},3347:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"emoji.scss"}]),e.exports=t},9548:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"toolbar.scss"}]),e.exports=t},7103:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"unfurl.scss"}]),e.exports=t},9369:(e,t,n)=>{(t=n(3645)(!0)).push([e.id,"","",{version:3,sources:[],names:[],mappings:"",file:"index.scss"}]),e.exports=t},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n,s,i,r=e[1]||"",o=e[3];if(!o)return r;if(t&&"function"==typeof btoa){var a=(n=o,s=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(i," */")),c=o.sources.map((function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")}));return[r].concat(c).concat([a]).join("\n")}return[r].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,s){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(s)for(var r=0;r<this.length;r++){var o=this[r][0];null!=o&&(i[o]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);s&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},7484:function(e){e.exports=function(){"use strict";var e="millisecond",t="second",n="minute",s="hour",i="day",r="week",o="month",a="quarter",c="year",l="date",u=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},f=function(e,t,n){var s=String(e);return!s||s.length>=t?e:""+Array(t+1-s.length).join(n)+e},g={s:f,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),s=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+f(s,2,"0")+":"+f(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var s=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(s,o),r=n-i<0,a=t.clone().add(s+(r?-1:1),o);return+(-(s+(n-i)/(r?i-a:a-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return{M:o,y:c,w:r,d:i,D:l,h:s,m:n,s:t,ms:e,Q:a}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",p={};p[m]=h;var v=function(e){return e instanceof w},b=function(e,t,n){var s;if(!e)return m;if("string"==typeof e)p[e]&&(s=e),t&&(p[e]=t,s=e);else{var i=e.name;p[i]=e,s=i}return!n&&s&&(m=s),s||!n&&m},y=function(e,t){if(v(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new w(n)},_=g;_.l=b,_.i=v,_.w=function(e,t){return y(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var w=function(){function h(e){this.$L=b(e.locale,null,!0),this.parse(e)}var f=h.prototype;return f.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var s=t.match(u);if(s){var i=s[2]-1||0,r=(s[7]||"0").substring(0,3);return n?new Date(Date.UTC(s[1],i,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],i,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},f.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},f.$utils=function(){return _},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(e,t){var n=y(e);return this.startOf(t)<=n&&n<=this.endOf(t)},f.isAfter=function(e,t){return y(e)<this.startOf(t)},f.isBefore=function(e,t){return this.endOf(t)<y(e)},f.$g=function(e,t,n){return _.u(e)?this[t]:this.set(n,e)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(e,a){var u=this,d=!!_.u(a)||a,h=_.p(e),f=function(e,t){var n=_.w(u.$u?Date.UTC(u.$y,t,e):new Date(u.$y,t,e),u);return d?n:n.endOf(i)},g=function(e,t){return _.w(u.toDate()[e].apply(u.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(t)),u)},m=this.$W,p=this.$M,v=this.$D,b="set"+(this.$u?"UTC":"");switch(h){case c:return d?f(1,0):f(31,11);case o:return d?f(1,p):f(0,p+1);case r:var y=this.$locale().weekStart||0,w=(m<y?m+7:m)-y;return f(d?v-w:v+(6-w),p);case i:case l:return g(b+"Hours",0);case s:return g(b+"Minutes",1);case n:return g(b+"Seconds",2);case t:return g(b+"Milliseconds",3);default:return this.clone()}},f.endOf=function(e){return this.startOf(e,!1)},f.$set=function(r,a){var u,d=_.p(r),h="set"+(this.$u?"UTC":""),f=(u={},u[i]=h+"Date",u[l]=h+"Date",u[o]=h+"Month",u[c]=h+"FullYear",u[s]=h+"Hours",u[n]=h+"Minutes",u[t]=h+"Seconds",u[e]=h+"Milliseconds",u)[d],g=d===i?this.$D+(a-this.$W):a;if(d===o||d===c){var m=this.clone().set(l,1);m.$d[f](g),m.init(),this.$d=m.set(l,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](g);return this.init(),this},f.set=function(e,t){return this.clone().$set(e,t)},f.get=function(e){return this[_.p(e)]()},f.add=function(e,a){var l,u=this;e=Number(e);var d=_.p(a),h=function(t){var n=y(u);return _.w(n.date(n.date()+Math.round(t*e)),u)};if(d===o)return this.set(o,this.$M+e);if(d===c)return this.set(c,this.$y+e);if(d===i)return h(1);if(d===r)return h(7);var f=(l={},l[n]=6e4,l[s]=36e5,l[t]=1e3,l)[d]||1,g=this.$d.getTime()+e*f;return _.w(g,this)},f.subtract=function(e,t){return this.add(-1*e,t)},f.format=function(e){var t=this;if(!this.isValid())return"Invalid Date";var n=e||"YYYY-MM-DDTHH:mm:ssZ",s=_.z(this),i=this.$locale(),r=this.$H,o=this.$m,a=this.$M,c=i.weekdays,l=i.months,u=function(e,s,i,r){return e&&(e[s]||e(t,n))||i[s].substr(0,r)},h=function(e){return _.s(r%12||12,e,"0")},f=i.meridiem||function(e,t,n){var s=e<12?"AM":"PM";return n?s.toLowerCase():s},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:_.s(a+1,2,"0"),MMM:u(i.monthsShort,a,l,3),MMMM:u(l,a),D:this.$D,DD:_.s(this.$D,2,"0"),d:String(this.$W),dd:u(i.weekdaysMin,this.$W,c,2),ddd:u(i.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(r),HH:_.s(r,2,"0"),h:h(1),hh:h(2),a:f(r,o,!0),A:f(r,o,!1),m:String(o),mm:_.s(o,2,"0"),s:String(this.$s),ss:_.s(this.$s,2,"0"),SSS:_.s(this.$ms,3,"0"),Z:s};return n.replace(d,(function(e,t){return t||g[e]||s.replace(":","")}))},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(e,l,u){var d,h=_.p(l),f=y(e),g=6e4*(f.utcOffset()-this.utcOffset()),m=this-f,p=_.m(this,f);return p=(d={},d[c]=p/12,d[o]=p,d[a]=p/3,d[r]=(m-g)/6048e5,d[i]=(m-g)/864e5,d[s]=m/36e5,d[n]=m/6e4,d[t]=m/1e3,d)[h]||m,u?p:_.a(p)},f.daysInMonth=function(){return this.endOf(o).$D},f.$locale=function(){return p[this.$L]},f.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),s=b(e,t,!0);return s&&(n.$L=s),n},f.clone=function(){return _.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},h}(),S=w.prototype;return y.prototype=S,[["$ms",e],["$s",t],["$m",n],["$H",s],["$W",i],["$M",o],["$y",c],["$D",l]].forEach((function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),y.extend=function(e,t){return e.$i||(e(t,w,y),e.$i=!0),y},y.locale=b,y.isDayjs=v,y.unix=function(e){return y(1e3*e)},y.en=p[m],y.Ls=p,y.p={},y}()},9434:(e,t,n)=>{var s={"./af.js":[5903,9210],"./am.js":[9911,5073],"./ar-dz.js":[7200,9406],"./ar-kw.js":[977,9897],"./ar-ly.js":[8540,3521],"./ar-ma.js":[6817,5313],"./ar-sa.js":[1573,485],"./ar-tn.js":[9339,8040],"./ar.js":[3939,6755],"./az.js":[8092,4963],"./be.js":[504,9478],"./bg.js":[9091,578],"./bi.js":[9149,2984],"./bm.js":[5287,2263],"./bn.js":[5254,280],"./bo.js":[2502,9950],"./br.js":[8864,760],"./bs.js":[4502,9833],"./ca.js":[3646,102],"./cs.js":[8507,7400],"./cv.js":[6636,4481],"./cy.js":[8792,6740],"./da.js":[7427,2548],"./de-at.js":[3237,7175],"./de-ch.js":[6148,1679],"./de.js":[790,52],"./dv.js":[1794,5569],"./el.js":[5423,1606],"./en-au.js":[5109,5485],"./en-ca.js":[5105,4035],"./en-gb.js":[9517,6031],"./en-ie.js":[758,8129],"./en-il.js":[5805,3463],"./en-in.js":[8529,6898],"./en-nz.js":[302,8547],"./en-sg.js":[5941,1735],"./en-tt.js":[6183,6105],"./en.js":[5054,535],"./eo.js":[4990,5121],"./es-do.js":[3864,8758],"./es-pr.js":[3521,911],"./es-us.js":[6165,3208],"./es.js":[7763,3411],"./et.js":[9670,4153],"./eu.js":[6629,1396],"./fa.js":[6953,5544],"./fi.js":[7822,2130],"./fo.js":[9197,8745],"./fr-ca.js":[7989,7363],"./fr-ch.js":[4254,7952],"./fr.js":[6023,1910],"./fy.js":[3220,6376],"./ga.js":[2186,688],"./gd.js":[4855,5050],"./gl.js":[229,5818],"./gom-latn.js":[6312,825],"./gu.js":[7632,3623],"./he.js":[5418,9372],"./hi.js":[7573,8010],"./hr.js":[6257,7419],"./ht.js":[8889,5822],"./hu.js":[8562,8214],"./hy-am.js":[8242,5407],"./id.js":[3783,9513],"./is.js":[8980,1194],"./it-ch.js":[3706,6010],"./it.js":[5551,1880],"./ja.js":[6831,1107],"./jv.js":[2641,4305],"./ka.js":[6622,5186],"./kk.js":[2921,5206],"./km.js":[5567,2475],"./kn.js":[1113,7523],"./ko.js":[9132,3446],"./ku.js":[4888,7024],"./ky.js":[466,5055],"./lb.js":[1796,5215],"./lo.js":[8894,1204],"./lt.js":[8768,7899],"./lv.js":[953,631],"./me.js":[8066,145],"./mi.js":[8602,7454],"./mk.js":[1560,4951],"./ml.js":[4017,7679],"./mn.js":[4717,8618],"./mr.js":[5473,5600],"./ms-my.js":[7387,882],"./ms.js":[5742,9095],"./mt.js":[8477,9665],"./my.js":[2966,5166],"./nb.js":[9682,646],"./ne.js":[4149,9030],"./nl-be.js":[7496,3155],"./nl.js":[9182,1520],"./nn.js":[2722,7050],"./oc-lnc.js":[6159,7203],"./pa-in.js":[5914,5850],"./pl.js":[1987,1211],"./pt-br.js":[7548,5274],"./pt.js":[5001,265],"./ro.js":[8146,8022],"./ru.js":[600,559],"./rw.js":[6509,3221],"./sd.js":[5437,1298],"./se.js":[772,1942],"./si.js":[7109,9333],"./sk.js":[5627,6783],"./sl.js":[2544,9625],"./sq.js":[8341,8603],"./sr-cyrl.js":[7101,3435],"./sr.js":[617,7390],"./ss.js":[4127,9238],"./sv.js":[1876,9652],"./sw.js":[2030,9733],"./ta.js":[5596,7645],"./te.js":[5159,7714],"./tet.js":[9157,555],"./tg.js":[9928,2446],"./th.js":[2019,1729],"./tk.js":[5817,5256],"./tl-ph.js":[6513,9443],"./tlh.js":[7296,2814],"./tr.js":[3035,8665],"./tzl.js":[7797,2843],"./tzm-latn.js":[261,3933],"./tzm.js":[4722,4342],"./ug-cn.js":[313,6890],"./uk.js":[4144,1619],"./ur.js":[2957,9568],"./uz-latn.js":[8727,1110],"./uz.js":[7486,3153],"./vi.js":[7553,8073],"./x-pseudo.js":[5321,4423],"./yo.js":[4724,8692],"./zh-cn.js":[3852,9630],"./zh-hk.js":[2390,3755],"./zh-tw.js":[3901,6776],"./zh.js":[2009,8458]};function i(e){if(!n.o(s,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return n.e(t[1]).then((()=>n.t(i,7)))}i.keys=()=>Object.keys(s),i.id=9434,e.exports=i},8734:function(e){e.exports=function(){"use strict";return function(e,t,n){var s=t.prototype,i=s.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},s.format=function(e){var t=this,n=this.$locale(),s=this.$utils(),r=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return i.bind(this)(r)}}}()},6632:(e,t)=>{!function e(t,n,s){function i(o,a){if(!n[o]){if(!t[o]){if(r)return r(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return i(t[o][1][e]||e)}),l,l.exports,e,t,n,s)}return n[o].exports}for(var r=void 0,o=0;o<s.length;o++)i(s[o]);return i}({1:[function(e,t,n){var s=e("cssfilter").FilterCSS,i=e("cssfilter").getDefaultWhiteList,r=e("./util");var o=new s;function a(e){return e.replace(c,"&lt;").replace(l,"&gt;")}var c=/</g,l=/>/g,u=/"/g,d=/&quot;/g,h=/&#([a-zA-Z0-9]*);?/gim,f=/&colon;?/gim,g=/&newline;?/gim,m=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,p=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,v=/u\s*r\s*l\s*\(.*/gi;function b(e){return e.replace(u,"&quot;")}function y(e){return e.replace(d,'"')}function _(e){return e.replace(h,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function w(e){return e.replace(f,":").replace(g," ")}function S(e){for(var t="",n=0,s=e.length;n<s;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return r.trim(t)}function x(e){return S(e=w(e=_(e=y(e))))}function E(e){return a(e=b(e))}var j=/<!--[\s\S]*?-->/g;n.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","loop","preload","src","height","width"]},n.getDefaultWhiteList=function(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],sup:[],strong:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","loop","preload","src","height","width"]}},n.onTag=function(e,t,n){},n.onIgnoreTag=function(e,t,n){},n.onTagAttr=function(e,t,n){},n.onIgnoreTagAttr=function(e,t,n){},n.safeAttrValue=function(e,t,n,s){if(n=x(n),"href"===t||"src"===t){if("#"===(n=r.trim(n)))return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===t){if(m.lastIndex=0,m.test(n))return""}else if("style"===t){if(p.lastIndex=0,p.test(n))return"";if(v.lastIndex=0,v.test(n)&&(m.lastIndex=0,m.test(n)))return"";!1!==s&&(n=(s=s||o).process(n))}return E(n)},n.escapeHtml=a,n.escapeQuote=b,n.unescapeQuote=y,n.escapeHtmlEntities=_,n.escapeDangerHtml5Entities=w,n.clearNonPrintableCharacter=S,n.friendlyAttrValue=x,n.escapeAttrValue=E,n.onIgnoreTagStripAll=function(){return""},n.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var n=!Array.isArray(e),s=[],i=!1;return{onIgnoreTag:function(o,a,c){if(function(t){return!!n||-1!==r.indexOf(e,t)}(o)){if(c.isClosing){var l="[/removed]",u=c.position+l.length;return s.push([!1!==i?i:c.position,u]),i=!1,l}return i||(i=c.position),"[removed]"}return t(o,a,c)},remove:function(e){var t="",n=0;return r.forEach(s,(function(s){t+=e.slice(n,s[0]),n=s[1]})),t+=e.slice(n)}}},n.stripCommentTag=function(e){return e.replace(j,"")},n.stripBlankChar=function(e){var t=e.split("");return(t=t.filter((function(e){var t=e.charCodeAt(0);return!(127===t||t<=31&&10!==t&&13!==t)}))).join("")},n.cssFilter=o,n.getDefaultCSSWhiteList=i},{"./util":4,cssfilter:8}],2:[function(e,t,n){var s=e("./default"),i=e("./parser"),r=e("./xss");function o(e,t){return new r(t).process(e)}for(var a in(n=t.exports=o).filterXSS=o,n.FilterXSS=r,s)n[a]=s[a];for(var a in i)n[a]=i[a];"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)},{"./default":1,"./parser":3,"./xss":5}],3:[function(e,t,n){var s=e("./util");function i(e){var t=s.spaceIndex(e);if(-1===t)var n=e.slice(1,-1);else n=e.slice(1,t+1);return"/"===(n=s.trim(n).toLowerCase()).slice(0,1)&&(n=n.slice(1)),"/"===n.slice(-1)&&(n=n.slice(0,-1)),n}function r(e){return"</"===e.slice(0,2)}var o=/[^a-zA-Z0-9_:\.\-]/gim;function a(e,t){for(;t<e.length;t++){var n=e[t];if(" "!==n)return"="===n?t:-1}}function c(e,t){for(;t>0;t--){var n=e[t];if(" "!==n)return"="===n?t:-1}}function l(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}n.parseTag=function(e,t,n){"use strict";var s="",o=0,a=!1,c=!1,l=0,u=e.length,d="",h="";e:for(l=0;l<u;l++){var f=e.charAt(l);if(!1===a){if("<"===f){a=l;continue}}else if(!1===c){if("<"===f){s+=n(e.slice(o,l)),a=l,o=l;continue}if(">"===f){s+=n(e.slice(o,a)),d=i(h=e.slice(a,l+1)),s+=t(a,s.length,d,h,r(h)),o=l+1,a=!1;continue}if('"'===f||"'"===f)for(var g=1,m=e.charAt(l-g);" "===m||"="===m;){if("="===m){c=f;continue e}m=e.charAt(l-++g)}}else if(f===c){c=!1;continue}}return o<e.length&&(s+=n(e.substr(o))),s},n.parseAttr=function(e,t){"use strict";var n=0,i=[],r=!1,u=e.length;function d(e,n){if(!((e=(e=s.trim(e)).replace(o,"").toLowerCase()).length<1)){var r=t(e,n||"");r&&i.push(r)}}for(var h=0;h<u;h++){var f,g=e.charAt(h);if(!1!==r||"="!==g)if(!1===r||h!==n||'"'!==g&&"'"!==g||"="!==e.charAt(h-1)){if(/\s|\n|\t/.test(g)){if(e=e.replace(/\s|\n|\t/g," "),!1===r){if(-1===(f=a(e,h))){d(s.trim(e.slice(n,h))),r=!1,n=h+1;continue}h=f-1;continue}if(-1===(f=c(e,h-1))){d(r,l(s.trim(e.slice(n,h)))),r=!1,n=h+1;continue}}}else{if(-1===(f=e.indexOf(g,h+1)))break;d(r,s.trim(e.slice(n+1,f))),r=!1,n=(h=f)+1}else r=e.slice(n,h),n=h+1}return n<e.length&&(!1===r?d(e.slice(n)):d(r,l(s.trim(e.slice(n))))),s.trim(i.join(" "))}},{"./util":4}],4:[function(e,t,n){t.exports={indexOf:function(e,t){var n,s;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,s=e.length;n<s;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var s,i;if(Array.prototype.forEach)return e.forEach(t,n);for(s=0,i=e.length;s<i;s++)t.call(n,e[s],s,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}}},{}],5:[function(e,t,n){var s=e("cssfilter").FilterCSS,i=e("./default"),r=e("./parser"),o=r.parseTag,a=r.parseAttr,c=e("./util");function l(e){return null==e}function u(e){(e=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=i.onIgnoreTagStripAll),e.whiteList=e.whiteList||i.whiteList,e.onTag=e.onTag||i.onTag,e.onTagAttr=e.onTagAttr||i.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||i.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||i.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||i.safeAttrValue,e.escapeHtml=e.escapeHtml||i.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new s(e.css))}u.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,n=t.whiteList,s=t.onTag,r=t.onIgnoreTag,u=t.onTagAttr,d=t.onIgnoreTagAttr,h=t.safeAttrValue,f=t.escapeHtml,g=this.cssFilter;t.stripBlankChar&&(e=i.stripBlankChar(e)),t.allowCommentTag||(e=i.stripCommentTag(e));var m=!1;t.stripIgnoreTagBody&&(m=i.StripTagBody(t.stripIgnoreTagBody,r),r=m.onIgnoreTag);var p=o(e,(function(e,t,i,o,m){var p,v={sourcePosition:e,position:t,isClosing:m,isWhite:n.hasOwnProperty(i)};if(!l(p=s(i,o,v)))return p;if(v.isWhite){if(v.isClosing)return"</"+i+">";var b=function(e){var t=c.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var n="/"===(e=c.trim(e.slice(t+1,-1)))[e.length-1];return n&&(e=c.trim(e.slice(0,-1))),{html:e,closing:n}}(o),y=n[i],_=a(b.html,(function(e,t){var n,s=-1!==c.indexOf(y,e);return l(n=u(i,e,t,s))?s?(t=h(i,e,t,g))?e+'="'+t+'"':e:l(n=d(i,e,t,s))?void 0:n:n}));return o="<"+i,_&&(o+=" "+_),b.closing&&(o+=" /"),o+">"}return l(p=r(i,o,v))?f(o):p}),f);return m&&(p=m.remove(p)),p},t.exports=u},{"./default":1,"./parser":3,"./util":4,cssfilter:8}],6:[function(e,t,n){var s=e("./default"),i=e("./parser");function r(e){return null==e}function o(e){(e=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{})).whiteList=e.whiteList||s.whiteList,e.onAttr=e.onAttr||s.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||s.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||s.safeAttrValue,this.options=e}e("./util"),o.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,n=t.whiteList,s=t.onAttr,o=t.onIgnoreAttr,a=t.safeAttrValue;return i(e,(function(e,t,i,c,l){var u=n[i],d=!1;if(!0===u?d=u:"function"==typeof u?d=u(c):u instanceof RegExp&&(d=u.test(c)),!0!==d&&(d=!1),c=a(i,c)){var h,f={position:t,sourcePosition:e,source:l,isWhite:d};return d?r(h=s(i,c,f))?i+":"+c:h:r(h=o(i,c,f))?void 0:h}}))},t.exports=o},{"./default":7,"./parser":9,"./util":10}],7:[function(e,t,n){function s(){return{"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1}}var i=/javascript\s*\:/gim;n.whiteList={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1},n.getDefaultWhiteList=s,n.onAttr=function(e,t,n){},n.onIgnoreAttr=function(e,t,n){},n.safeAttrValue=function(e,t){return i.test(t)?"":t}},{}],8:[function(e,t,n){var s=e("./default"),i=e("./css");for(var r in(n=t.exports=function(e,t){return new i(t).process(e)}).FilterCSS=i,s)n[r]=s[r];"undefined"!=typeof window&&(window.filterCSS=t.exports)},{"./css":6,"./default":7}],9:[function(e,t,n){var s=e("./util");t.exports=function(e,t){";"!==(e=s.trimRight(e))[e.length-1]&&(e+=";");var n=e.length,i=!1,r=0,o=0,a="";function c(){if(!i){var n=s.trim(e.slice(r,o)),c=n.indexOf(":");if(-1!==c){var l=s.trim(n.slice(0,c)),u=s.trim(n.slice(c+1));if(l){var d=t(r,a.length,l,u,n);d&&(a+=d+"; ")}}}r=o+1}for(;o<n;o++){var l=e[o];if("/"===l&&"*"===e[o+1]){var u=e.indexOf("*/",o+2);if(-1===u)break;r=(o=u+1)+1,i=!1}else"("===l?i=!0:")"===l?i=!1:";"===l?i||c():"\n"===l&&c()}return s.trim(a)}},{"./util":10}],10:[function(e,t,n){t.exports={indexOf:function(e,t){var n,s;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,s=e.length;n<s;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var s,i;if(Array.prototype.forEach)return e.forEach(t,n);for(s=0,i=e.length;s<i;s++)t.call(n,e[s],s,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}}},{}]},{},[2]),t.filterXSS=filterXSS,t.filterCSS=filterCSS},4023:(e,t)=>{var n,s;s=function(e){"use strict";e=e||{};var t,n,s,i,r,o,a,c,l,u,d,h,f,g,m={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1,element:null,dataUrl:!1,win:window};(h={}).ff="undefined"!=typeof InstallTrigger,h.chrome=!!window.chrome,h.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0,h.ie=!1,h.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,h.supported=h.chrome||h.ff||h.opera;var p=[];d=function(){},c=!1;var v={ready:function(){c=!0,v.reset(),d()},reset:function(){c&&(p=[],l=!1,u=!1,o.clearRect(0,0,i,s),o.drawImage(a,0,0,i,s),_.setIcon(r),window.clearTimeout(f),window.clearTimeout(void 0))},start:function(){if(c&&!u&&p.length>0){u=!0;var e=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach((function(e){e in p[0].options&&(t[e]=p[0].options[e])})),x.run(p[0].options,(function(){l=p[0],u=!1,p.length>0&&(p.shift(),v.start())}),!1)};l?x.run(l.options,(function(){e()}),!0):e()}}},b={},y=function(e){return e.n="number"==typeof e.n?Math.abs(0|e.n):e.n,e.x=i*e.x,e.y=s*e.y,e.w=i*e.w,e.h=s*e.h,e.len=(""+e.n).length,e};b.circle=function(e){var n=!1;2===(e=y(e)).len?(e.x=e.x-.4*e.w,e.w=1.4*e.w,n=!0):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w,n=!0),o.clearRect(0,0,i,s),o.drawImage(a,0,0,i,s),o.beginPath(),o.font=t.fontStyle+" "+Math.floor(e.h*(e.n>99?.85:1))+"px "+t.fontFamily,o.textAlign="center",n?(o.moveTo(e.x+e.w/2,e.y),o.lineTo(e.x+e.w-e.h/2,e.y),o.quadraticCurveTo(e.x+e.w,e.y,e.x+e.w,e.y+e.h/2),o.lineTo(e.x+e.w,e.y+e.h-e.h/2),o.quadraticCurveTo(e.x+e.w,e.y+e.h,e.x+e.w-e.h/2,e.y+e.h),o.lineTo(e.x+e.h/2,e.y+e.h),o.quadraticCurveTo(e.x,e.y+e.h,e.x,e.y+e.h-e.h/2),o.lineTo(e.x,e.y+e.h/2),o.quadraticCurveTo(e.x,e.y,e.x+e.h/2,e.y)):o.arc(e.x+e.w/2,e.y+e.h/2,e.h/2,0,2*Math.PI),o.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+e.o+")",o.fill(),o.closePath(),o.beginPath(),o.stroke(),o.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?o.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):o.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),o.closePath()},b.rectangle=function(e){2===(e=y(e)).len?(e.x=e.x-.4*e.w,e.w=1.4*e.w):e.len>=3&&(e.x=e.x-.65*e.w,e.w=1.65*e.w),o.clearRect(0,0,i,s),o.drawImage(a,0,0,i,s),o.beginPath(),o.font=t.fontStyle+" "+Math.floor(e.h*(e.n>99?.9:1))+"px "+t.fontFamily,o.textAlign="center",o.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+e.o+")",o.fillRect(e.x,e.y,e.w,e.h),o.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+e.o+")","number"==typeof e.n&&e.n>999?o.fillText((e.n>9999?9:Math.floor(e.n/1e3))+"k+",Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.2*e.h)):o.fillText(e.n,Math.floor(e.x+e.w/2),Math.floor(e.y+e.h-.15*e.h)),o.closePath()};var _={};function w(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,s){return t+t+n+n+s+s}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return!!t&&{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}}function S(e,t){var n,s={};for(n in e)s[n]=e[n];for(n in t)s[n]=t[n];return s}_.getIcons=function(){var e=[];return t.element?e=[t.element]:t.elementId?(e=[g.getElementById(t.elementId)])[0].setAttribute("href",e[0].getAttribute("src")):0===(e=function(){for(var e=[],t=g.getElementsByTagName("head")[0].getElementsByTagName("link"),n=0;n<t.length;n++)/(^|\s)icon(\s|$)/i.test(t[n].getAttribute("rel"))&&e.push(t[n]);return e}()).length&&((e=[g.createElement("link")])[0].setAttribute("rel","icon"),g.getElementsByTagName("head")[0].appendChild(e[0])),e.forEach((function(e){e.setAttribute("type","image/png")})),e},_.setIcon=function(e){var t=e.toDataURL("image/png");_.setIconSrc(t)},_.setIconSrc=function(e){if(t.dataUrl&&t.dataUrl(e),t.element)t.element.setAttribute("href",e),t.element.setAttribute("src",e);else if(t.elementId){var s=g.getElementById(t.elementId);s.setAttribute("href",e),s.setAttribute("src",e)}else if(h.ff||h.opera){var i=n[n.length-1],r=g.createElement("link");n=[r],h.opera&&r.setAttribute("rel","icon"),r.setAttribute("rel","icon"),r.setAttribute("type","image/png"),g.getElementsByTagName("head")[0].appendChild(r),r.setAttribute("href",e),i.parentNode&&i.parentNode.removeChild(i)}else n.forEach((function(t){t.setAttribute("href",e)}))};var x={duration:40,types:{}};return x.types.fade=[{x:.4,y:.4,w:.6,h:.6,o:0},{x:.4,y:.4,w:.6,h:.6,o:.1},{x:.4,y:.4,w:.6,h:.6,o:.2},{x:.4,y:.4,w:.6,h:.6,o:.3},{x:.4,y:.4,w:.6,h:.6,o:.4},{x:.4,y:.4,w:.6,h:.6,o:.5},{x:.4,y:.4,w:.6,h:.6,o:.6},{x:.4,y:.4,w:.6,h:.6,o:.7},{x:.4,y:.4,w:.6,h:.6,o:.8},{x:.4,y:.4,w:.6,h:.6,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],x.types.none=[{x:.4,y:.4,w:.6,h:.6,o:1}],x.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:.9,y:.9,w:.1,h:.1,o:1},{x:.8,y:.8,w:.2,h:.2,o:1},{x:.7,y:.7,w:.3,h:.3,o:1},{x:.6,y:.6,w:.4,h:.4,o:1},{x:.5,y:.5,w:.5,h:.5,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],x.types.popFade=[{x:.75,y:.75,w:0,h:0,o:0},{x:.65,y:.65,w:.1,h:.1,o:.2},{x:.6,y:.6,w:.2,h:.2,o:.4},{x:.55,y:.55,w:.3,h:.3,o:.6},{x:.5,y:.5,w:.4,h:.4,o:.8},{x:.45,y:.45,w:.5,h:.5,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],x.types.slide=[{x:.4,y:1,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.8,w:.6,h:.6,o:1},{x:.4,y:.7,w:.6,h:.6,o:1},{x:.4,y:.6,w:.6,h:.6,o:1},{x:.4,y:.5,w:.6,h:.6,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],x.run=function(e,n,s,i){var o=x.types[g.hidden||g.msHidden||g.webkitHidden||g.mozHidden?"none":t.animation];i=!0===s?void 0!==i?i:o.length-1:void 0!==i?i:0,n=n||function(){},i<o.length&&i>=0?(b[t.type](S(e,o[i])),f=setTimeout((function(){s?i-=1:i+=1,x.run(e,n,s,i)}),x.duration),_.setIcon(r)):n()},function(){(t=S(m,e)).bgColor=w(t.bgColor),t.textColor=w(t.textColor),t.position=t.position.toLowerCase(),t.animation=x.types[""+t.animation]?t.animation:m.animation,g=t.win.document;var c=t.position.indexOf("up")>-1,l=t.position.indexOf("left")>-1;if(c||l)for(var u in x.types)for(var d=0;d<x.types[u].length;d++){var h=x.types[u][d];c&&(h.y<.6?h.y=h.y-.4:h.y=h.y-2*h.y+(1-h.w)),l&&(h.x<.6?h.x=h.x-.4:h.x=h.x-2*h.x+(1-h.h)),x.types[u][d]=h}t.type=b[""+t.type]?t.type:m.type,n=_.getIcons(),r=document.createElement("canvas"),a=document.createElement("img");var f=n[n.length-1];f.hasAttribute("href")?(a.setAttribute("crossOrigin","anonymous"),a.onload=function(){s=a.height>0?a.height:32,i=a.width>0?a.width:32,r.height=s,r.width=i,o=r.getContext("2d"),v.ready()},a.setAttribute("src",f.getAttribute("href"))):(s=32,i=32,a.height=s,a.width=i,r.height=s,r.width=i,o=r.getContext("2d"),v.ready())}(),{badge:function(e,t){t=("string"==typeof t?{animation:t}:t)||{},d=function(){try{if("number"==typeof e?e>0:""!==e){var n={type:"badge",options:{n:e}};if("animation"in t&&x.types[""+t.animation]&&(n.options.animation=""+t.animation),"type"in t&&b[""+t.type]&&(n.options.type=""+t.type),["bgColor","textColor"].forEach((function(e){e in t&&(n.options[e]=w(t[e]))})),["fontStyle","fontFamily"].forEach((function(e){e in t&&(n.options[e]=t[e])})),p.push(n),p.length>100)throw new Error("Too many badges requests in queue.");v.start()}else v.reset()}catch(e){throw new Error("Error setting badge. Message: "+e.message)}},c&&d()},setOpt:function(e,n){var s=e;null==n&&"[object Object]"==Object.prototype.toString.call(e)||((s={})[e]=n);for(var i=Object.keys(s),r=0;r<i.length;r++)"bgColor"==i[r]||"textColor"==i[r]?t[i[r]]=w(s[i[r]]):t[i[r]]=s[i[r]];p.push(l),v.start()},reset:v.reset,browser:{supported:h.supported}}},void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)},6755:function(e){e.exports=function(){"use strict";var e=/^(b|B)$/,t={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},n={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]},s={floor:Math.floor,ceil:Math.ceil};function i(i){var r,o,a,c,l,u,d,h,f,g,m,p,v,b,y,_,w,S,x,E,j=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},A=[],C=0;if(isNaN(i))throw new TypeError("Invalid number");if(a=!0===j.bits,y=!0===j.unix,p=!0===j.pad,o=j.base||2,v=void 0!==j.round?j.round:y?1:2,d=void 0!==j.locale?j.locale:"",h=j.localeOptions||{},_=void 0!==j.separator?j.separator:"",w=void 0!==j.spacer?j.spacer:y?"":" ",x=j.symbols||{},S=2===o&&j.standard||"jedec",m=j.output||"string",l=!0===j.fullform,u=j.fullforms instanceof Array?j.fullforms:[],r=void 0!==j.exponent?j.exponent:-1,E=s[j.roundingMethod]||Math.round,c=o>2?1e3:1024,(f=(g=Number(i))<0)&&(g=-g),(-1===r||isNaN(r))&&(r=Math.floor(Math.log(g)/Math.log(c)))<0&&(r=0),r>8&&(r=8),"exponent"===m)return r;if(0===g)A[0]=0,b=A[1]=y?"":t[S][a?"bits":"bytes"][r];else{C=g/(2===o?Math.pow(2,10*r):Math.pow(1e3,r)),a&&(C*=8)>=c&&r<8&&(C/=c,r++);var k=Math.pow(10,r>0?v:0);A[0]=E(C*k)/k,A[0]===c&&r<8&&void 0===j.exponent&&(A[0]=1,r++),b=A[1]=10===o&&1===r?a?"kb":"kB":t[S][a?"bits":"bytes"][r],y&&(A[1]="jedec"===S?A[1].charAt(0):r>0?A[1].replace(/B$/,""):A[1],e.test(A[1])&&(A[0]=Math.floor(A[0]),A[1]=""))}if(f&&(A[0]=-A[0]),A[1]=x[A[1]]||A[1],!0===d?A[0]=A[0].toLocaleString():d.length>0?A[0]=A[0].toLocaleString(d,h):_.length>0&&(A[0]=A[0].toString().replace(".",_)),p&&!1===Number.isInteger(A[0])&&v>0){var O=_||".",T=A[0].toString().split(O),N=T[1]||"",I=N.length,M=v-I;A[0]="".concat(T[0]).concat(O).concat(N.padEnd(I+M,"0"))}return l&&(A[1]=u[r]?u[r]:n[S][r]+(a?"bit":"byte")+(1===A[0]?"":"s")),"array"===m?A:"object"===m?{value:A[0],symbol:A[1],exponent:r,unit:b}:A.join(w)}return i.partial=function(e){return function(t){return i(t,e)}},i}()},2353:function(e,t){!function(n,s){var i=Array.prototype,r=Object.prototype,o=i.slice,a=r.hasOwnProperty,c=i.forEach,l={},u={forEach:function(e,t,n){var s,i,r;if(null!==e)if(c&&e.forEach===c)e.forEach(t,n);else if(e.length===+e.length){for(s=0,i=e.length;s<i;s++)if(s in e&&t.call(n,e[s],s,e)===l)return}else for(r in e)if(a.call(e,r)&&t.call(n,e[r],r,e)===l)return},extend:function(e){return this.forEach(o.call(arguments,1),(function(t){for(var n in t)e[n]=t[n]})),e}},d=function(e){if(this.defaults={locale_data:{messages:{"":{domain:"messages",lang:"en",plural_forms:"nplurals=2; plural=(n != 1);"}}},domain:"messages",debug:!1},this.options=u.extend({},this.defaults,e),this.textdomain(this.options.domain),e.domain&&!this.options.locale_data[this.options.domain])throw new Error("Text domain set to non-existent domain: `"+e.domain+"`")};function h(e){return d.PF.compile(e||"nplurals=2; plural=(n != 1);")}function f(e,t){this._key=e,this._i18n=t}d.context_delimiter=String.fromCharCode(4),u.extend(f.prototype,{onDomain:function(e){return this._domain=e,this},withContext:function(e){return this._context=e,this},ifPlural:function(e,t){return this._val=e,this._pkey=t,this},fetch:function(e){return"[object Array]"!={}.toString.call(e)&&(e=[].slice.call(arguments,0)),(e&&e.length?d.sprintf:function(e){return e})(this._i18n.dcnpgettext(this._domain,this._context,this._key,this._pkey,this._val),e)}}),u.extend(d.prototype,{translate:function(e){return new f(e,this)},textdomain:function(e){if(!e)return this._textdomain;this._textdomain=e},gettext:function(e){return this.dcnpgettext.call(this,s,s,e)},dgettext:function(e,t){return this.dcnpgettext.call(this,e,s,t)},dcgettext:function(e,t){return this.dcnpgettext.call(this,e,s,t)},ngettext:function(e,t,n){return this.dcnpgettext.call(this,s,s,e,t,n)},dngettext:function(e,t,n,i){return this.dcnpgettext.call(this,e,s,t,n,i)},dcngettext:function(e,t,n,i){return this.dcnpgettext.call(this,e,s,t,n,i)},pgettext:function(e,t){return this.dcnpgettext.call(this,s,e,t)},dpgettext:function(e,t,n){return this.dcnpgettext.call(this,e,t,n)},dcpgettext:function(e,t,n){return this.dcnpgettext.call(this,e,t,n)},npgettext:function(e,t,n,i){return this.dcnpgettext.call(this,s,e,t,n,i)},dnpgettext:function(e,t,n,s,i){return this.dcnpgettext.call(this,e,t,n,s,i)},dcnpgettext:function(e,t,n,s,i){var r;if(s=s||n,e=e||this._textdomain,!this.options)return(r=new d).dcnpgettext.call(r,void 0,void 0,n,s,i);if(!this.options.locale_data)throw new Error("No locale data provided.");if(!this.options.locale_data[e])throw new Error("Domain `"+e+"` was not found.");if(!this.options.locale_data[e][""])throw new Error("No locale meta information provided.");if(!n)throw new Error("No translation key found.");var o,a,c,l=t?t+d.context_delimiter+n:n,u=this.options.locale_data,f=u[e],g=(u.messages||this.defaults.locale_data.messages)[""],m=f[""].plural_forms||f[""]["Plural-Forms"]||f[""]["plural-forms"]||g.plural_forms||g["Plural-Forms"]||g["plural-forms"];if(void 0===i)c=0;else{if("number"!=typeof i&&(i=parseInt(i,10),isNaN(i)))throw new Error("The number that was passed in is not a number.");c=h(m)(i)}if(!f)throw new Error("No domain named `"+e+"` could be found.");return!(o=f[l])||c>o.length?(this.options.missing_key_callback&&this.options.missing_key_callback(l,e),a=[n,s],!0===this.options.debug&&console.log(a[h(m)(i)]),a[h()(i)]):(a=o[c])||(a=[n,s])[h()(i)]}});var g,m=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function t(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var n=function(){return n.cache.hasOwnProperty(arguments[0])||(n.cache[arguments[0]]=n.parse(arguments[0])),n.format.call(null,n.cache[arguments[0]],arguments)};return n.format=function(n,s){var i,r,o,a,c,l,u,d=1,h=n.length,f="",g=[];for(r=0;r<h;r++)if("string"===(f=e(n[r])))g.push(n[r]);else if("array"===f){if((a=n[r])[2])for(i=s[d],o=0;o<a[2].length;o++){if(!i.hasOwnProperty(a[2][o]))throw m('[sprintf] property "%s" does not exist',a[2][o]);i=i[a[2][o]]}else i=a[1]?s[a[1]]:s[d++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw m("[sprintf] expecting number but found %s",e(i));switch(null==i&&(i=""),a[8]){case"b":i=i.toString(2);break;case"c":i=String.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=String(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,l=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",u=a[6]-String(i).length,c=a[6]?t(l,u):"",g.push(a[5]?i+c:c+i)}return g.join("")},n.cache={},n.parse=function(e){for(var t=e,n=[],s=[],i=0;t;){if(null!==(n=/^[^\x25]+/.exec(t)))s.push(n[0]);else if(null!==(n=/^\x25{2}/.exec(t)))s.push("%");else{if(null===(n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)))throw"[sprintf] huh?";if(n[2]){i|=1;var r=[],o=n[2],a=[];if(null===(a=/^([a-z_][a-z_\d]*)/i.exec(o)))throw"[sprintf] huh?";for(r.push(a[1]);""!==(o=o.substring(a[0].length));)if(null!==(a=/^\.([a-z_][a-z_\d]*)/i.exec(o)))r.push(a[1]);else{if(null===(a=/^\[(\d+)\]/.exec(o)))throw"[sprintf] huh?";r.push(a[1])}n[2]=r}else i|=2;if(3===i)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";s.push(n)}t=t.substring(n[0].length)}return s},n}(),p=function(e,t){return t.unshift(e),m.apply(null,t)};d.parse_plural=function(e,t){return e=e.replace(/n/g,t),d.parse_expression(e)},d.sprintf=function(e,t){return"[object Array]"=={}.toString.call(t)?p(e,[].slice.call(t)):m.apply(this,[].slice.call(arguments))},d.prototype.sprintf=function(){return d.sprintf.apply(this,arguments)},(d.PF={}).parse=function(e){var t=d.PF.extractPluralExpr(e);return d.PF.parser.parse.call(d.PF.parser,t)},d.PF.compile=function(e){var t=d.PF.parse(e);return function(e){return!0===(n=d.PF.interpreter(t)(e))?1:n||0;var n}},d.PF.interpreter=function(e){return function(t){switch(e.type){case"GROUP":return d.PF.interpreter(e.expr)(t);case"TERNARY":return d.PF.interpreter(e.expr)(t)?d.PF.interpreter(e.truthy)(t):d.PF.interpreter(e.falsey)(t);case"OR":return d.PF.interpreter(e.left)(t)||d.PF.interpreter(e.right)(t);case"AND":return d.PF.interpreter(e.left)(t)&&d.PF.interpreter(e.right)(t);case"LT":return d.PF.interpreter(e.left)(t)<d.PF.interpreter(e.right)(t);case"GT":return d.PF.interpreter(e.left)(t)>d.PF.interpreter(e.right)(t);case"LTE":return d.PF.interpreter(e.left)(t)<=d.PF.interpreter(e.right)(t);case"GTE":return d.PF.interpreter(e.left)(t)>=d.PF.interpreter(e.right)(t);case"EQ":return d.PF.interpreter(e.left)(t)==d.PF.interpreter(e.right)(t);case"NEQ":return d.PF.interpreter(e.left)(t)!=d.PF.interpreter(e.right)(t);case"MOD":return d.PF.interpreter(e.left)(t)%d.PF.interpreter(e.right)(t);case"VAR":return t;case"NUM":return e.val;default:throw new Error("Invalid Token found.")}}},d.PF.extractPluralExpr=function(e){e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),/;\s*$/.test(e)||(e=e.concat(";"));var t,n=/nplurals\=(\d+);/,s=e.match(n);if(!(s.length>1))throw new Error("nplurals not found in plural_forms string: "+e);if(s[1],!((t=(e=e.replace(n,"")).match(/plural\=(.*);/))&&t.length>1))throw new Error("`plural` expression not found: "+e);return t[1]},d.PF.parser=((g={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,n:19,NUMBER:20,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},productions_:[0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],performAction:function(e,t,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return{type:"GROUP",expr:r[a-1]};case 2:this.$={type:"TERNARY",expr:r[a-4],truthy:r[a-2],falsey:r[a]};break;case 3:this.$={type:"OR",left:r[a-2],right:r[a]};break;case 4:this.$={type:"AND",left:r[a-2],right:r[a]};break;case 5:this.$={type:"LT",left:r[a-2],right:r[a]};break;case 6:this.$={type:"LTE",left:r[a-2],right:r[a]};break;case 7:this.$={type:"GT",left:r[a-2],right:r[a]};break;case 8:this.$={type:"GTE",left:r[a-2],right:r[a]};break;case 9:this.$={type:"NEQ",left:r[a-2],right:r[a]};break;case 10:this.$={type:"EQ",left:r[a-2],right:r[a]};break;case 11:this.$={type:"MOD",left:r[a-2],right:r[a]};break;case 12:this.$={type:"GROUP",expr:r[a-1]};break;case 13:this.$={type:"VAR"};break;case 14:this.$={type:"NUM",val:Number(e)}}},table:[{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],defaultActions:{6:[2,1]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,n=[0],s=[null],i=[],r=this.table,o="",a=0,c=0,l=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;function d(){var e;return"number"!=typeof(e=t.lexer.lex()||1)&&(e=t.symbols_[e]||e),e}i.push(u),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var h,f,g,m,p,v,b,y,_,w={};;){if(g=n[n.length-1],this.defaultActions[g]?m=this.defaultActions[g]:(null==h&&(h=d()),m=r[g]&&r[g][h]),void 0===m||!m.length||!m[0]){if(!l){for(v in _=[],r[g])this.terminals_[v]&&v>2&&_.push("'"+this.terminals_[v]+"'");var S="";S=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+_.join(", ")+", got '"+this.terminals_[h]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:u,expected:_})}if(3==l){if(1==h)throw new Error(S||"Parsing halted.");c=this.lexer.yyleng,o=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,h=d()}for(;!(2..toString()in r[g]);){if(0==g)throw new Error(S||"Parsing halted.");1,n.length=n.length-2,s.length=s.length-1,i.length=i.length-1,g=n[n.length-1]}f=h,h=2,m=r[g=n[n.length-1]]&&r[g][2],l=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+h);switch(m[0]){case 1:n.push(h),s.push(this.lexer.yytext),i.push(this.lexer.yylloc),n.push(m[1]),h=null,f?(h=f,f=null):(c=this.lexer.yyleng,o=this.lexer.yytext,a=this.lexer.yylineno,u=this.lexer.yylloc,l>0&&l--);break;case 2:if(b=this.productions_[m[1]][1],w.$=s[s.length-b],w._$={first_line:i[i.length-(b||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(b||1)].first_column,last_column:i[i.length-1].last_column},void 0!==(p=this.performAction.call(w,o,c,a,this.yy,m[1],s,i)))return p;b&&(n=n.slice(0,-1*b*2),s=s.slice(0,-1*b),i=i.slice(0,-1*b)),n.push(this.productions_[m[1]][0]),s.push(w.$),i.push(w._$),y=r[n[n.length-2]][n[n.length-1]],n.push(y);break;case 3:return!0}}return!0}}).lexer={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;s<n.length;s++)if(e=this._input.match(this.rules[n[s]]))return(t=e[0].match(/\n.*/g))&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1])||void 0;if(""===this._input)return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},performAction:function(e,t,n,s){switch(n){case 0:break;case 1:return 20;case 2:return 19;case 3:return 8;case 4:return 9;case 5:return 6;case 6:return 7;case 7:return 11;case 8:return 13;case 9:return 10;case 10:return 12;case 11:return 14;case 12:return 15;case 13:return 16;case 14:return 17;case 15:return 18;case 16:return 5;case 17:return"INVALID"}},rules:[/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}},g),e.exports&&(t=e.exports=d),t.Jed=d}()},3245:function(e,t){"undefined"!=typeof self&&self,function(e){"use strict";var t=/^~~local_forage_type~([^~]+)~/,n="__lfsc__:".length,s=n+"arbf".length,i=Object.prototype.toString;function r(e){var t=.75*e.length,n=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var s=new ArrayBuffer(t),i=new Uint8Array(s),r=0,o=0;r<n;r+=4){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r+1]),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r+2]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[r+3]);i[o++]=a<<2|c>>4,i[o++]=(15&c)<<4|l>>2,i[o++]=(3&l)<<6|63&u}return s}function o(e){for(var t=new Uint8Array(e),n="",s=0;s<t.length;s+=3)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[s]>>2],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[s])<<4|t[s+1]>>4],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[s+1])<<2|t[s+2]>>6],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[s+2]];return t.length%3==2?n=n.substring(0,n.length-1)+"=":t.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function a(e){var t,n;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var s=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(Object.keys(e)),r=i.next();!r.done;r=i.next()){var o=r.value;Object.prototype.hasOwnProperty.call(e,o)&&(e.isActiveClone=null,s[o]=a(e[o]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return s}function c(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function l(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function d(e,t){var n=this;if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var s=this.config();e.name=e.name||s.name,e.storeName=e.storeName||s.storeName}return{promise:e.name?new Promise((function(t){e.storeName?t(c(e,n._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),callback:t}}function h(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var f={bufferToString:o,deserialize:function(e){if("__lfsc__:"!==e.substring(0,n))return JSON.parse(e);var i,o=e.substring(s),a=e.substring(n,s);if("blob"===a&&t.test(o)){var c=o.match(t);i=c[1],o=o.substring(c[0].length)}var l=r(o);switch(a){case"arbf":return l;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),s=0;s<e.length;s+=1)n.append(e[s]);return n.getBlob(t.type)}}([l],{type:i});case"si08":return new Int8Array(l);case"ui08":return new Uint8Array(l);case"uic8":return new Uint8ClampedArray(l);case"si16":return new Int16Array(l);case"ur16":return new Uint16Array(l);case"si32":return new Int32Array(l);case"ui32":return new Uint32Array(l);case"fl32":return new Float32Array(l);case"fl64":return new Float64Array(l);default:throw new Error("Unkown type: "+a)}},serialize:function(e,t){var n="";if(e&&(n=i.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===i.call(e.buffer))){var s=void 0,r="__lfsc__:";e instanceof ArrayBuffer?(s=e,r+="arbf"):(s=e.buffer,"[object Int8Array]"===n?r+="si08":"[object Uint8Array]"===n?r+="ui08":"[object Uint8ClampedArray]"===n?r+="uic8":"[object Int16Array]"===n?r+="si16":"[object Uint16Array]"===n?r+="ur16":"[object Int32Array]"===n?r+="si32":"[object Uint32Array]"===n?r+="ui32":"[object Float32Array]"===n?r+="fl32":"[object Float64Array]"===n?r+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(r+o(s))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n="~~local_forage_type~"+e.type+"~"+o(this.result);t("__lfsc__:blob"+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},stringToBuffer:r},g={},m=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return g[t]||(g[t]=new e(t)),g[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete g[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?a(e):{},n=c(t,this._defaultConfig),s=m.resolve(n);return this._dbInfo=t,this._dbInfo.serializer=f,this._dbInfo.keyPrefix=n,this._dbInfo.mStore=s,Promise.resolve()},e.clear=function(e){var t=this,n=this.ready().then((function(){t._dbInfo.mStore.clear()}));return l(n,e),n},e.dropInstance=function(e,t){var n=d.apply(this,arguments),s=n.promise,i=n.callback;return l(s.then((function(e){m.resolve(e).drop()})),i),s},e.getItem=function(e,t){var n=this;e=h(e);var s=this.ready().then((function(){var t=n._dbInfo.mStore.get(e);return null==t?null:n._dbInfo.serializer.deserialize(t)}));return l(s,t),s},e.iterate=function(e,t){var n=this,s=this.ready().then((function(){for(var t=n._dbInfo.mStore,s=t.keys(),i=0;i<s.length;i++){var r=t.get(s[i]);if(r&&(r=n._dbInfo.serializer.deserialize(r)),void 0!==(r=e(r,s[i],i+1)))return r}}));return l(s,t),s},e.key=function(e,t){var n=this,s=this.ready().then((function(){var t;try{void 0===(t=n._dbInfo.mStore.key(e))&&(t=null)}catch(e){t=null}return t}));return l(s,t),s},e.keys=function(e){var t=this,n=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return l(n,e),n},e.length=function(e){var t=this.keys().then((function(e){return e.length}));return l(t,e),t},e.removeItem=function(e,t){var n=this;e=h(e);var s=this.ready().then((function(){n._dbInfo.mStore.rm(e)}));return l(s,t),s},e.setItem=function(e,t,n){var s=this;e=h(e);var i=this.ready().then((function(){void 0===t&&(t=null);var n=t;return new Promise((function(i,r){s._dbInfo.serializer.serialize(t,(function(t,o){if(o)r(o);else try{s._dbInfo.mStore.set(e,t),i(n)}catch(e){r(e)}}))}))}));return l(i,n),i},Object.defineProperty(e,"__esModule",{value:!0})}(t)},1459:function(e,t,n){!function(e,t){"use strict";function n(e){return n.result?n.result:e&&"function"==typeof e.getSerializer?(n.result=e.getSerializer(),n.result):Promise.reject(new Error("localforage.getSerializer() was not available! localforage v1.4+ is required!"))}function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function i(e,t,n,s){function i(e,t){var n=e||t;return e&&"function"==typeof e||"string"!=typeof n||(e=function(e){return e[n]}),e}var r=[];if("[object Array]"===Object.prototype.toString.call(e)){t=i(t,"key"),n=i(n,"value");for(var o=0,a=e.length;o<a;o++){var c=e[o];r.push(s(t(c),n(c)))}}else for(var l in e)e.hasOwnProperty(l)&&r.push(s(l,e[l]));return r}function r(e,t,n,r){var o=this,a=o.ready().then((function(){return new Promise((function(s,r){var a,c=o._dbInfo,l=c.db.transaction(c.storeName,"readwrite"),u=l.objectStore(c.storeName);function d(e){var t=e.target||this;a=t.error||t.transaction.error,r(a)}l.oncomplete=function(){s(e)},l.onabort=l.onerror=function(e){r(a||e.target)},i(e,t,n,(function(e,t){null===t&&(t=void 0),u.put(t,e).onerror=d}))}))}));return s(a,r),a}function o(e,t,r,o){var a=this,c=new Promise((function(s,o){a.ready().then((function(){return n(a)})).then((function(n){var c=a._dbInfo;c.db.transaction((function(a){var l="INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",u=i(e,t,r,(function(e,t){return new Promise((function(s,i){n.serialize(t,(function(t,n){n?i(n):a.executeSql(l,[e,t],(function(){s()}),(function(e,t){i(t)}))}))}))}));Promise.all(u).then((function(){s(e)}),o)}),(function(e){o(e)}))})).catch(o)}));return s(c,o),c}function a(e,t,n,r){var o=this,a=i(e,t,n,(function(e,t){return o.setItem(e,t)})),c=Promise.all(a);return s(c,r),c}function c(e,t,n,s){var i=this,c=i.driver();return c===i.INDEXEDDB?r.call(i,e,t,n,s):c===i.WEBSQL?o.call(i,e,t,n,s):a.call(i,e,t,n,s)}function l(e){var t=Object.getPrototypeOf(e);t&&(t.setItems=c,t.setItems.indexedDB=function(){return r.apply(this,arguments)},t.setItems.websql=function(){return o.apply(this,arguments)},t.setItems.generic=function(){return a.apply(this,arguments)})}var u=l(t="default"in t?t.default:t);e.setItemsGeneric=a,e.localforageSetItems=c,e.extendPrototype=l,e.extendPrototypeResult=u,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(9483))},7715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=l(n(8106)),i=l(n(8902)),r=l(n(4942)),o=l(n(6803)),a=l(n(6593));t.default=function(e,t){var n=(0,c.getStorage)(),l=!(!n||!n[t]),u=l?n[t]:{clear:function(){},get:function(){},remove:function(){},set:function(){}},d=u.clear.bind(u),h=u.get.bind(u),f=u.remove.bind(u),g=u.set.bind(u);return{_driver:e,_support:l,_initStorage:function(){return a.default.resolve()},clear:function(e){var t=this;return(0,o.default)(r.default.mark((function n(){return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:d(),e&&e();case 2:case"end":return t.stop()}}),n,t)})))()},iterate:function(e,t){var n=this;return(0,o.default)(r.default.mark((function s(){var o;return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,c.usePromise)(h,null);case 2:o=n.sent,(0,i.default)(o).forEach((function(t,n){return e(o[t],t,n)})),t&&t();case 6:case"end":return n.stop()}}),s,n)})))()},getItem:function(e,t){var n=this;return(0,o.default)(r.default.mark((function s(){var i;return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,(0,c.usePromise)(h,e);case 3:return i=n.sent,i=void 0===(i="string"==typeof e?i[e]:i)?null:i,t&&t(null,i),n.abrupt("return",i);case 10:throw n.prev=10,n.t0=n.catch(0),t&&t(n.t0),n.t0;case 14:case"end":return n.stop()}}),s,n,[[0,10]])})))()},key:function(e,t){var n=this;return(0,o.default)(r.default.mark((function s(){var o,a;return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,c.usePromise)(h,null);case 2:return o=n.sent,a=(0,i.default)(o)[e],t&&t(a),n.abrupt("return",a);case 6:case"end":return n.stop()}}),s,n)})))()},keys:function(e){var t=this;return(0,o.default)(r.default.mark((function n(){var s,o;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.usePromise)(h,null);case 2:return s=t.sent,o=(0,i.default)(s),e&&e(o),t.abrupt("return",o);case 6:case"end":return t.stop()}}),n,t)})))()},length:function(e){var t=this;return(0,o.default)(r.default.mark((function n(){var s,o;return r.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,c.usePromise)(h,null);case 2:return s=t.sent,o=(0,i.default)(s).length,e&&e(o),t.abrupt("return",o);case 6:case"end":return t.stop()}}),n,t)})))()},removeItem:function(e,t){var n=this;return(0,o.default)(r.default.mark((function s(){return r.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,c.usePromise)(f,e);case 2:t&&t();case 3:case"end":return n.stop()}}),s,n)})))()},setItem:function(e,t,n){var i=this;return(0,o.default)(r.default.mark((function o(){return r.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,c.usePromise)(g,(0,s.default)({},e,t));case 2:n&&n();case 3:case"end":return i.stop()}}),o,i)})))()}}};var c=n(4639);function l(e){return e&&e.__esModule?e:{default:e}}},7002:(e,t,n)=>{"use strict";var s,i=(s=n(7715))&&s.__esModule?s:{default:s};t.Z=(0,i.default)("webExtensionLocalStorage","local")},1063:(e,t,n)=>{"use strict";var s,i=(s=n(7715))&&s.__esModule?s:{default:s};t.Z=(0,i.default)("webExtensionSyncStorage","sync")},4639:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s,i=(s=n(6593))&&s.__esModule?s:{default:s};function r(){return window.browser&&browser.storage||window.chrome&&chrome.storage}t.getStorage=r,t.usePromise=function(e,t){return function(){var e=r();try{return e&&e.local.get&&e.local.get()&&"function"==typeof e.local.get().then}catch(e){return!1}}()?e(t):new i.default((function(n){e(t,(function(){n.apply(void 0,arguments)}))}))}},9483:(e,t,n)=>{e.exports=function e(t,n,s){function i(o,a){if(!n[o]){if(!t[o]){if(r)return r(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return i(t[o][1][e]||e)}),l,l.exports,e,t,n,s)}return n[o].exports}for(var r=void 0,o=0;o<s.length;o++)i(s[o]);return i}({1:[function(e,t,s){(function(e){"use strict";var n,s,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var r=0,o=new i(u),a=e.document.createTextNode("");o.observe(a,{characterData:!0}),n=function(){a.data=r=++r%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;s=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}s=!1}t.exports=function(e){1!==l.push(e)||s||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var s=e(1);function i(){}var r={},o=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function l(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==i&&f(this,e)}function u(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){s((function(){var s;try{s=t(n)}catch(t){return r.reject(e,t)}s===e?r.reject(e,new TypeError("Cannot resolve promise with itself")):r.resolve(e,s)}))}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function s(t){n||(n=!0,r.reject(e,t))}function i(t){n||(n=!0,r.resolve(e,t))}var o=g((function(){t(i,s)}));"error"===o.status&&s(o.value)}function g(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=l,l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(i);return this.state!==c?d(n,this.state===a?e:t,this.outcome):this.queue.push(new u(n,e,t)),n},u.prototype.callFulfilled=function(e){r.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){r.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},r.resolve=function(e,t){var n=g(h,t);if("error"===n.status)return r.reject(e,n.value);var s=n.value;if(s)f(e,s);else{e.state=a,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},r.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,s=e.queue.length;++n<s;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:r.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return r.reject(t,e)},l.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,s=!1;if(!n)return this.resolve([]);for(var o=new Array(n),a=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then((function(e){o[i]=e,++a!==n||s||(s=!0,r.resolve(l,o))}),(function(e){s||(s=!0,r.reject(l,e))}))}},l.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n,s=e.length,o=!1;if(!s)return this.resolve([]);for(var a=-1,c=new this(i);++a<s;)n=e[a],t.resolve(n).then((function(e){o||(o=!0,r.resolve(c,e))}),(function(e){o||(o=!0,r.reject(c,e))}));return c}},{1:1}],3:[function(e,t,s){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){"use strict";var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function r(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),s=0;s<e.length;s+=1)n.append(e[s]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var o=Promise;function a(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function l(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function u(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",h=void 0,f={},g=Object.prototype.toString,m="readonly",p="readwrite";function v(e){for(var t=e.length,n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;i<t;i++)s[i]=e.charCodeAt(i);return n}function b(e){return"boolean"==typeof h?o.resolve(h):function(e){return new o((function(t){var n=e.transaction(d,p),s=r([""]);n.objectStore(d).put(s,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function y(e){var t=f[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function _(e){var t=f[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=f[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function S(e,t){return new o((function(n,s){if(f[e.name]=f[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);y(e),e.db.close()}var r=[e.name];t&&r.push(e.version);var o=i.open.apply(i,r);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),s(o.error)},o.onsuccess=function(){n(o.result),_(e)}}))}function x(e){return S(e,!1)}function E(e){return S(e,!0)}function j(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),s=e.version<e.db.version,i=e.version>e.db.version;if(s&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function A(e){return r([v(atob(e.data))],{type:e.type})}function C(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,n=t._initReady().then((function(){var e=f[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(n,e,e),n}function O(e,t,n,s){void 0===s&&(s=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(s>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((function(){return function(e){y(e);for(var t=f[e.name],n=t.forages,s=0;s<n.length;s++){var i=n[s];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,x(e).then((function(t){return e.db=t,j(e)?E(e):t})).then((function(s){e.db=t.db=s;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=s})).catch((function(t){throw w(e,t),t}))}(e).then((function(){O(e,t,n,s-1)}))})).catch(n);n(i)}}var T={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var s in e)n[s]=e[s];var i=f[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},f[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var r=[];function a(){return o.resolve()}for(var c=0;c<i.forages.length;c++){var l=i.forages[c];l!==t&&r.push(l._initReady().catch(a))}var u=i.forages.slice(0);return o.all(r).then((function(){return n.db=i.db,x(n)})).then((function(e){return n.db=e,j(n,t._defaultConfig.version)?E(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var s=0;s<u.length;s++){var r=u[s];r!==t&&(r._dbInfo.db=n.db,r._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,s=new o((function(t,s){n.ready().then((function(){O(n._dbInfo,m,(function(i,r){if(i)return s(i);try{var o=r.objectStore(n._dbInfo.storeName).openCursor(),a=1;o.onsuccess=function(){var n=o.result;if(n){var s=n.value;C(s)&&(s=A(s));var i=e(s,n.key,a++);void 0!==i?t(i):n.continue()}else t()},o.onerror=function(){s(o.error)}}catch(e){s(e)}}))})).catch(s)}));return a(s,t),s},getItem:function(e,t){var n=this;e=l(e);var s=new o((function(t,s){n.ready().then((function(){O(n._dbInfo,m,(function(i,r){if(i)return s(i);try{var o=r.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),C(e)&&(e=A(e)),t(e)},o.onerror=function(){s(o.error)}}catch(e){s(e)}}))})).catch(s)}));return a(s,t),s},setItem:function(e,t,n){var s=this;e=l(e);var i=new o((function(n,i){var r;s.ready().then((function(){return r=s._dbInfo,"[object Blob]"===g.call(t)?b(r.db).then((function(e){return e?t:(n=t,new o((function(e,t){var s=new FileReader;s.onerror=t,s.onloadend=function(t){var s=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:s,type:n.type})},s.readAsBinaryString(n)})));var n})):t})).then((function(t){O(s._dbInfo,p,(function(r,o){if(r)return i(r);try{var a=o.objectStore(s._dbInfo.storeName);null===t&&(t=void 0);var c=a.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),n(t)},o.onabort=o.onerror=function(){var e=c.error?c.error:c.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return a(i,n),i},removeItem:function(e,t){var n=this;e=l(e);var s=new o((function(t,s){n.ready().then((function(){O(n._dbInfo,p,(function(i,r){if(i)return s(i);try{var o=r.objectStore(n._dbInfo.storeName).delete(e);r.oncomplete=function(){t()},r.onerror=function(){s(o.error)},r.onabort=function(){var e=o.error?o.error:o.transaction.error;s(e)}}catch(e){s(e)}}))})).catch(s)}));return a(s,t),s},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,p,(function(s,i){if(s)return n(s);try{var r=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=r.error?r.error:r.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return a(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,m,(function(s,i){if(s)return n(s);try{var r=i.objectStore(t._dbInfo.storeName).count();r.onsuccess=function(){e(r.result)},r.onerror=function(){n(r.error)}}catch(e){n(e)}}))})).catch(n)}));return a(n,e),n},key:function(e,t){var n=this,s=new o((function(t,s){e<0?t(null):n.ready().then((function(){O(n._dbInfo,m,(function(i,r){if(i)return s(i);try{var o=r.objectStore(n._dbInfo.storeName),a=!1,c=o.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===e||a?t(n.key):(a=!0,n.advance(e)):t(null)},c.onerror=function(){s(c.error)}}catch(e){s(e)}}))})).catch(s)}));return a(s,t),s},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){O(t._dbInfo,m,(function(s,i){if(s)return n(s);try{var r=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];r.onsuccess=function(){var t=r.result;t?(o.push(t.key),t.continue()):e(o)},r.onerror=function(){n(r.error)}}catch(e){n(e)}}))})).catch(n)}));return a(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var s,r=this;if(e.name){var c=e.name===n.name&&r._dbInfo.db?o.resolve(r._dbInfo.db):x(e).then((function(t){var n=f[e.name],s=n.forages;n.db=t;for(var i=0;i<s.length;i++)s[i]._dbInfo.db=t;return t}));s=e.storeName?c.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;y(e);var s=f[e.name],r=s.forages;t.close();for(var a=0;a<r.length;a++){var c=r[a];c._dbInfo.db=null,c._dbInfo.version=n}return new o((function(t,s){var r=i.open(e.name,n);r.onerror=function(e){r.result.close(),s(e)},r.onupgradeneeded=function(){r.result.deleteObjectStore(e.storeName)},r.onsuccess=function(){var e=r.result;e.close(),t(e)}})).then((function(e){s.db=e;for(var t=0;t<r.length;t++){var n=r[t];n._dbInfo.db=e,_(n._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):c.then((function(t){y(e);var n=f[e.name],s=n.forages;t.close();for(var r=0;r<s.length;r++)s[r]._dbInfo.db=null;return new o((function(t,n){var s=i.deleteDatabase(e.name);s.onerror=s.onblocked=function(e){var t=s.result;t&&t.close(),n(e)},s.onsuccess=function(){var e=s.result;e&&e.close(),t(e)}})).then((function(e){n.db=e;for(var t=0;t<s.length;t++)_(s[t]._dbInfo)})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else s=o.reject("Invalid arguments");return a(s,t),s}};var N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",R=M.length,D="arbf",z="blob",L="si08",P="ui08",F="uic8",B="si16",U="si32",q="ur16",H="ui32",$="fl32",G="fl64",V=R+D.length,W=Object.prototype.toString;function J(e){var t,n,s,i,r,o=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var l=new ArrayBuffer(o),u=new Uint8Array(l);for(t=0;t<a;t+=4)n=N.indexOf(e[t]),s=N.indexOf(e[t+1]),i=N.indexOf(e[t+2]),r=N.indexOf(e[t+3]),u[c++]=n<<2|s>>4,u[c++]=(15&s)<<4|i>>2,u[c++]=(3&i)<<6|63&r;return l}function Q(e){var t,n=new Uint8Array(e),s="";for(t=0;t<n.length;t+=3)s+=N[n[t]>>2],s+=N[(3&n[t])<<4|n[t+1]>>4],s+=N[(15&n[t+1])<<2|n[t+2]>>6],s+=N[63&n[t+2]];return n.length%3==2?s=s.substring(0,s.length-1)+"=":n.length%3==1&&(s=s.substring(0,s.length-2)+"=="),s}var Y={serialize:function(e,t){var n="";if(e&&(n=W.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===W.call(e.buffer))){var s,i=M;e instanceof ArrayBuffer?(s=e,i+=D):(s=e.buffer,"[object Int8Array]"===n?i+=L:"[object Uint8Array]"===n?i+=P:"[object Uint8ClampedArray]"===n?i+=F:"[object Int16Array]"===n?i+=B:"[object Uint16Array]"===n?i+=q:"[object Int32Array]"===n?i+=U:"[object Uint32Array]"===n?i+=H:"[object Float32Array]"===n?i+=$:"[object Float64Array]"===n?i+=G:t(new Error("Failed to get type for BinaryArray"))),t(i+Q(s))}else if("[object Blob]"===n){var r=new FileReader;r.onload=function(){var n="~~local_forage_type~"+e.type+"~"+Q(this.result);t("__lfsc__:blob"+n)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,R)!==M)return JSON.parse(e);var t,n=e.substring(V),s=e.substring(R,V);if(s===z&&I.test(n)){var i=n.match(I);t=i[1],n=n.substring(i[0].length)}var o=J(n);switch(s){case D:return o;case z:return r([o],{type:t});case L:return new Int8Array(o);case P:return new Uint8Array(o);case F:return new Uint8ClampedArray(o);case B:return new Int16Array(o);case q:return new Uint16Array(o);case U:return new Int32Array(o);case H:return new Uint32Array(o);case $:return new Float32Array(o);case G:return new Float64Array(o);default:throw new Error("Unkown type: "+s)}},stringToBuffer:J,bufferToString:Q};function K(e,t,n,s){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,s)}function X(e,t,n,s,i,r){e.executeSql(n,s,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?r(e,o):K(e,t,(function(){e.executeSql(n,s,i,r)}),r)}),r):r(e,o)}),r)}function Z(e,t,n,s){var i=this;e=l(e);var r=new o((function(r,o){i.ready().then((function(){void 0===t&&(t=null);var a=t,c=i._dbInfo;c.serializer.serialize(t,(function(t,l){l?o(l):c.db.transaction((function(n){X(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){r(a)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(s>0)return void r(Z.apply(i,[e,a,n,s-1]));o(t)}}))}))})).catch(o)}));return a(r,n),r}function ee(e){return new o((function(t,n){e.transaction((function(s){s.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,s){for(var i=[],r=0;r<s.rows.length;r++)i.push(s.rows.item(r).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}var te={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var s in e)n[s]="string"!=typeof e[s]?e[s].toString():e[s];var i=new o((function(e,s){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return s(e)}n.db.transaction((function(i){K(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){s(t)}))}),s)}));return n.serializer=Y,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,s=new o((function(t,s){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){X(n,i,"SELECT * FROM "+i.storeName,[],(function(n,s){for(var r=s.rows,o=r.length,a=0;a<o;a++){var c=r.item(a),l=c.value;if(l&&(l=i.serializer.deserialize(l)),void 0!==(l=e(l,c.key,a+1)))return void t(l)}t()}),(function(e,t){s(t)}))}))})).catch(s)}));return a(s,t),s},getItem:function(e,t){var n=this;e=l(e);var s=new o((function(t,s){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){X(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var s=n.rows.length?n.rows.item(0).value:null;s&&(s=i.serializer.deserialize(s)),t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return a(s,t),s},setItem:function(e,t,n){return Z.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=l(e);var s=new o((function(t,s){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){X(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){s(t)}))}))})).catch(s)}));return a(s,t),s},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){X(t,s,"DELETE FROM "+s.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return a(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){X(t,s,"SELECT COUNT(key) as c FROM "+s.storeName,[],(function(t,n){var s=n.rows.item(0).c;e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return a(n,e),n},key:function(e,t){var n=this,s=new o((function(t,s){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){X(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var s=n.rows.length?n.rows.item(0).key:null;t(s)}),(function(e,t){s(t)}))}))})).catch(s)}));return a(s,t),s},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var s=t._dbInfo;s.db.transaction((function(t){X(t,s,"SELECT key FROM "+s.storeName,[],(function(t,n){for(var s=[],i=0;i<n.rows.length;i++)s.push(n.rows.item(i).key);e(s)}),(function(e,t){n(t)}))}))})).catch(n)}));return a(n,e),n},dropInstance:function(e,t){t=u.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var s,i=this;return a(s=e.name?new o((function(t){var s;s=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:s,storeNames:[e.storeName]}):t(ee(s))})).then((function(e){return new o((function(t,n){e.db.transaction((function(s){function i(e){return new o((function(t,n){s.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var r=[],a=0,c=e.storeNames.length;a<c;a++)r.push(i(e.storeNames[a]));o.all(r).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):o.reject("Invalid arguments"),t),s}};function ne(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function se(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var ie={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=ne(e,this._defaultConfig),se()?(this._dbInfo=t,t.serializer=Y,o.resolve()):o.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,s=n.ready().then((function(){for(var t=n._dbInfo,s=t.keyPrefix,i=s.length,r=localStorage.length,o=1,a=0;a<r;a++){var c=localStorage.key(a);if(0===c.indexOf(s)){var l=localStorage.getItem(c);if(l&&(l=t.serializer.deserialize(l)),void 0!==(l=e(l,c.substring(i),o++)))return l}}}));return a(s,t),s},getItem:function(e,t){var n=this;e=l(e);var s=n.ready().then((function(){var t=n._dbInfo,s=localStorage.getItem(t.keyPrefix+e);return s&&(s=t.serializer.deserialize(s)),s}));return a(s,t),s},setItem:function(e,t,n){var s=this;e=l(e);var i=s.ready().then((function(){void 0===t&&(t=null);var n=t;return new o((function(i,r){var o=s._dbInfo;o.serializer.serialize(t,(function(t,s){if(s)r(s);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||r(e),r(e)}}))}))}));return a(i,n),i},removeItem:function(e,t){var n=this;e=l(e);var s=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return a(s,t),s},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var s=localStorage.key(n);0===s.indexOf(e)&&localStorage.removeItem(s)}}));return a(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var n=this,s=n.ready().then((function(){var t,s=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(s.keyPrefix.length)),t}));return a(s,t),s},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,s=[],i=0;i<n;i++){var r=localStorage.key(i);0===r.indexOf(e.keyPrefix)&&s.push(r.substring(e.keyPrefix.length))}return s}));return a(n,e),n},dropInstance:function(e,t){if(t=u.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var s,i=this;return a(s=e.name?new o((function(t){e.storeName?t(ne(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),t),s}},re=function(e,t){for(var n=e.length,s=0;s<n;){if((i=e[s])===(r=t)||"number"==typeof i&&"number"==typeof r&&isNaN(i)&&isNaN(r))return!0;s++}var i,r;return!1},oe=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ae={},ce={},le={INDEXEDDB:T,WEBSQL:te,LOCALSTORAGE:ie},ue=[le.INDEXEDDB._driver,le.WEBSQL._driver,le.LOCALSTORAGE._driver],de=["dropInstance"],he=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(de),fe={description:"",driver:ue.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ge(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function me(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(oe(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var pe=new(function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),le)if(le.hasOwnProperty(n)){var s=le[n],i=s._driver;this[n]=i,ae[i]||this.defineDriver(s)}this._defaultConfig=me({},fe),this._config=me({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":s(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var s=new o((function(t,n){try{var s=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var r=he.concat("_initStorage"),c=0,l=r.length;c<l;c++){var u=r[c];if((!re(de,u)||e[u])&&"function"!=typeof e[u])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=o.reject(t);return a(n,arguments[arguments.length-1]),n}},n=0,s=de.length;n<s;n++){var i=de[n];e[i]||(e[i]=t(i))}}();var d=function(n){ae[s]&&console.info("Redefining LocalForage driver: "+s),ae[s]=e,ce[s]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}}));return c(s,t,n),s},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var s=ae[e]?o.resolve(ae[e]):o.reject(new Error("Driver not found."));return c(s,t,n),s},e.prototype.getSerializer=function(e){var t=o.resolve(Y);return c(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return c(n,e,e),n},e.prototype.setDriver=function(e,t,n){var s=this;oe(e)||(e=[e]);var i=this._getSupportedDrivers(e);function r(){s._config.driver=s.driver()}function a(e){return s._extend(e),r(),s._ready=s._initStorage(s._config),s._ready}var l=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=l.then((function(){var e=i[0];return s._dbInfo=null,s._ready=null,s.getDriver(e).then((function(e){s._driver=e._driver,r(),s._wrapLibraryMethodsWithReady(),s._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,s._dbInfo=null,s._ready=null,s.getDriver(i).then(a).catch(n)}r();var c=new Error("No available storage method found.");return s._driverSet=o.reject(c),s._driverSet}()}}(i)}))})).catch((function(){r();var e=new Error("No available storage method found.");return s._driverSet=o.reject(e),s._driverSet})),c(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ce[e]},e.prototype._extend=function(e){me(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,s=e.length;n<s;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=he.length;e<t;e++)ge(this,he[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=pe},{3:3}]},{},[4])(4)},2705:(e,t,n)=>{var s=n(5639).Symbol;e.exports=s},4239:(e,t,n)=>{var s=n(2705),i=n(9607),r=n(2333),o=s?s.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):r(e)}},1957:(e,t,n)=>{var s="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=s},9607:(e,t,n)=>{var s=n(2705),i=Object.prototype,r=i.hasOwnProperty,o=i.toString,a=s?s.toStringTag:void 0;e.exports=function(e){var t=r.call(e,a),n=e[a];try{e[a]=void 0;var s=!0}catch(e){}var i=o.call(e);return s&&(t?e[a]=n:delete e[a]),i}},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5639:(e,t,n)=>{var s=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,r=s||i||Function("return this")();e.exports=r},3279:(e,t,n)=>{var s=n(3218),i=n(7771),r=n(4841),o=Math.max,a=Math.min;e.exports=function(e,t,n){var c,l,u,d,h,f,g=0,m=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=c,s=l;return c=l=void 0,g=t,d=e.apply(s,n)}function y(e){return g=e,h=setTimeout(w,t),m?b(e):d}function _(e){var n=e-f;return void 0===f||n>=t||n<0||p&&e-g>=u}function w(){var e=i();if(_(e))return S(e);h=setTimeout(w,function(e){var n=t-(e-f);return p?a(n,u-(e-g)):n}(e))}function S(e){return h=void 0,v&&c?b(e):(c=l=void 0,d)}function x(){var e=i(),n=_(e);if(c=arguments,l=this,f=e,n){if(void 0===h)return y(f);if(p)return clearTimeout(h),h=setTimeout(w,t),b(f)}return void 0===h&&(h=setTimeout(w,t)),d}return t=r(t)||0,s(n)&&(m=!!n.leading,u=(p="maxWait"in n)?o(r(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==h&&clearTimeout(h),g=0,c=f=l=h=void 0},x.flush=function(){return void 0===h?d:S(i())},x}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3448:(e,t,n)=>{var s=n(4239),i=n(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==s(e)}},7771:(e,t,n)=>{var s=n(5639);e.exports=function(){return s.Date.now()}},4841:(e,t,n)=>{var s=n(3218),i=n(3448),r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=a.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}},1271:(e,t,n)=>{var s;!function(i){var r,o,a,c,l,u,d,h,f,g,m,p,v,b,y,_,w,S,x,E="sizzle"+1*new Date,j=i.document,A=0,C=0,k=he(),O=he(),T=he(),N=he(),I=function(e,t){return e===t&&(m=!0),0},M={}.hasOwnProperty,R=[],D=R.pop,z=R.push,L=R.push,P=R.slice,F=function(e,t){for(var n=0,s=e.length;n<s;n++)if(e[n]===t)return n;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",U="[\\x20\\t\\r\\n\\f]",q="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",H="\\[[\\x20\\t\\r\\n\\f]*("+q+")(?:"+U+"*([*^$|!~]?=)"+U+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+q+"))|)"+U+"*\\]",$=":("+q+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",G=new RegExp(U+"+","g"),V=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),W=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),J=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),Q=new RegExp(U+"|>"),Y=new RegExp($),K=new RegExp("^"+q+"$"),X={ID:new RegExp("^#("+q+")"),CLASS:new RegExp("^\\.("+q+")"),TAG:new RegExp("^("+q+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Z=/HTML$/i,ee=/^(?:input|select|textarea|button)$/i,te=/^h\d$/i,ne=/^[^{]+\{\s*\[native \w/,se=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ie=/[+~]/,re=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),oe=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ae=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ce=function(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},le=function(){p()},ue=Ee((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(R=P.call(j.childNodes),j.childNodes),R[j.childNodes.length].nodeType}catch(e){L={apply:R.length?function(e,t){z.apply(e,P.call(t))}:function(e,t){for(var n=e.length,s=0;e[n++]=t[s++];);e.length=n-1}}}function de(e,t,n,s){var i,r,a,c,l,d,f,g=t&&t.ownerDocument,m=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==m&&9!==m&&11!==m)return n;if(!s&&(p(t),t=t||v,y)){if(11!==m&&(l=se.exec(e)))if(i=l[1]){if(9===m){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(g&&(a=g.getElementById(i))&&x(t,a)&&a.id===i)return n.push(a),n}else{if(l[2])return L.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&o.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(i)),n}if(o.qsa&&!N[e+" "]&&(!_||!_.test(e))&&(1!==m||"object"!==t.nodeName.toLowerCase())){if(f=e,g=t,1===m&&(Q.test(e)||J.test(e))){for((g=ie.test(e)&&we(t.parentNode)||t)===t&&o.scope||((c=t.getAttribute("id"))?c=c.replace(ae,ce):t.setAttribute("id",c=E)),r=(d=u(e)).length;r--;)d[r]=(c?"#"+c:":scope")+" "+xe(d[r]);f=d.join(",")}try{return L.apply(n,g.querySelectorAll(f)),n}catch(t){N(e,!0)}finally{c===E&&t.removeAttribute("id")}}}return h(e.replace(V,"$1"),t,n,s)}function he(){var e=[];return function t(n,s){return e.push(n+" ")>a.cacheLength&&delete t[e.shift()],t[n+" "]=s}}function fe(e){return e[E]=!0,e}function ge(e){var t=v.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function me(e,t){for(var n=e.split("|"),s=n.length;s--;)a.attrHandle[n[s]]=t}function pe(e,t){var n=t&&e,s=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(s)return s;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ve(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function be(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ye(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ue(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function _e(e){return fe((function(t){return t=+t,fe((function(n,s){for(var i,r=e([],n.length,t),o=r.length;o--;)n[i=r[o]]&&(n[i]=!(s[i]=n[i]))}))}))}function we(e){return e&&void 0!==e.getElementsByTagName&&e}for(r in o=de.support={},l=de.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Z.test(t||n&&n.nodeName||"HTML")},p=de.setDocument=function(e){var t,n,s=e?e.ownerDocument||e:j;return s!=v&&9===s.nodeType&&s.documentElement?(b=(v=s).documentElement,y=!l(v),j!=v&&(n=v.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",le,!1):n.attachEvent&&n.attachEvent("onunload",le)),o.scope=ge((function(e){return b.appendChild(e).appendChild(v.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),o.attributes=ge((function(e){return e.className="i",!e.getAttribute("className")})),o.getElementsByTagName=ge((function(e){return e.appendChild(v.createComment("")),!e.getElementsByTagName("*").length})),o.getElementsByClassName=ne.test(v.getElementsByClassName),o.getById=ge((function(e){return b.appendChild(e).id=E,!v.getElementsByName||!v.getElementsByName(E).length})),o.getById?(a.filter.ID=function(e){var t=e.replace(re,oe);return function(e){return e.getAttribute("id")===t}},a.find.ID=function(e,t){if(void 0!==t.getElementById&&y){var n=t.getElementById(e);return n?[n]:[]}}):(a.filter.ID=function(e){var t=e.replace(re,oe);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},a.find.ID=function(e,t){if(void 0!==t.getElementById&&y){var n,s,i,r=t.getElementById(e);if(r){if((n=r.getAttributeNode("id"))&&n.value===e)return[r];for(i=t.getElementsByName(e),s=0;r=i[s++];)if((n=r.getAttributeNode("id"))&&n.value===e)return[r]}return[]}}),a.find.TAG=o.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):o.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,s=[],i=0,r=t.getElementsByTagName(e);if("*"===e){for(;n=r[i++];)1===n.nodeType&&s.push(n);return s}return r},a.find.CLASS=o.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&y)return t.getElementsByClassName(e)},w=[],_=[],(o.qsa=ne.test(v.querySelectorAll))&&(ge((function(e){var t;b.appendChild(e).innerHTML="<a id='"+E+"'></a><select id='"+E+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&_.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||_.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+B+")"),e.querySelectorAll("[id~="+E+"-]").length||_.push("~="),(t=v.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||_.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll(":checked").length||_.push(":checked"),e.querySelectorAll("a#"+E+"+*").length||_.push(".#.+[+~]"),e.querySelectorAll("\\\f"),_.push("[\\r\\n\\f]")})),ge((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=v.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&_.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&_.push(":enabled",":disabled"),b.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&_.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),_.push(",.*:")}))),(o.matchesSelector=ne.test(S=b.matches||b.webkitMatchesSelector||b.mozMatchesSelector||b.oMatchesSelector||b.msMatchesSelector))&&ge((function(e){o.disconnectedMatch=S.call(e,"*"),S.call(e,"[s!='']:x"),w.push("!=",$)})),_=_.length&&new RegExp(_.join("|")),w=w.length&&new RegExp(w.join("|")),t=ne.test(b.compareDocumentPosition),x=t||ne.test(b.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,s=t&&t.parentNode;return e===s||!(!s||1!==s.nodeType||!(n.contains?n.contains(s):e.compareDocumentPosition&&16&e.compareDocumentPosition(s)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},I=t?function(e,t){if(e===t)return m=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!o.sortDetached&&t.compareDocumentPosition(e)===n?e==v||e.ownerDocument==j&&x(j,e)?-1:t==v||t.ownerDocument==j&&x(j,t)?1:g?F(g,e)-F(g,t):0:4&n?-1:1)}:function(e,t){if(e===t)return m=!0,0;var n,s=0,i=e.parentNode,r=t.parentNode,o=[e],a=[t];if(!i||!r)return e==v?-1:t==v?1:i?-1:r?1:g?F(g,e)-F(g,t):0;if(i===r)return pe(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;o[s]===a[s];)s++;return s?pe(o[s],a[s]):o[s]==j?-1:a[s]==j?1:0},v):v},de.matches=function(e,t){return de(e,null,null,t)},de.matchesSelector=function(e,t){if(p(e),o.matchesSelector&&y&&!N[t+" "]&&(!w||!w.test(t))&&(!_||!_.test(t)))try{var n=S.call(e,t);if(n||o.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return de(t,v,null,[e]).length>0},de.contains=function(e,t){return(e.ownerDocument||e)!=v&&p(e),x(e,t)},de.attr=function(e,t){(e.ownerDocument||e)!=v&&p(e);var n=a.attrHandle[t.toLowerCase()],s=n&&M.call(a.attrHandle,t.toLowerCase())?n(e,t,!y):void 0;return void 0!==s?s:o.attributes||!y?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},de.escape=function(e){return(e+"").replace(ae,ce)},de.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},de.uniqueSort=function(e){var t,n=[],s=0,i=0;if(m=!o.detectDuplicates,g=!o.sortStable&&e.slice(0),e.sort(I),m){for(;t=e[i++];)t===e[i]&&(s=n.push(i));for(;s--;)e.splice(n[s],1)}return g=null,e},c=de.getText=function(e){var t,n="",s=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=c(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[s++];)n+=c(t);return n},(a=de.selectors={cacheLength:50,createPseudo:fe,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(re,oe),e[3]=(e[3]||e[4]||e[5]||"").replace(re,oe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||de.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&de.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Y.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(re,oe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=k[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+U+"|$)"))&&k(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(s){var i=de.attr(s,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(G," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,s,i){var r="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===s&&0===i?function(e){return!!e.parentNode}:function(t,n,c){var l,u,d,h,f,g,m=r!==o?"nextSibling":"previousSibling",p=t.parentNode,v=a&&t.nodeName.toLowerCase(),b=!c&&!a,y=!1;if(p){if(r){for(;m;){for(h=t;h=h[m];)if(a?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;g=m="only"===e&&!g&&"nextSibling"}return!0}if(g=[o?p.firstChild:p.lastChild],o&&b){for(y=(f=(l=(u=(d=(h=p)[E]||(h[E]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===A&&l[1])&&l[2],h=f&&p.childNodes[f];h=++f&&h&&h[m]||(y=f=0)||g.pop();)if(1===h.nodeType&&++y&&h===t){u[e]=[A,f,y];break}}else if(b&&(y=f=(l=(u=(d=(h=t)[E]||(h[E]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===A&&l[1]),!1===y)for(;(h=++f&&h&&h[m]||(y=f=0)||g.pop())&&((a?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++y||(b&&((u=(d=h[E]||(h[E]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[A,y]),h!==t)););return(y-=i)===s||y%s==0&&y/s>=0}}},PSEUDO:function(e,t){var n,s=a.pseudos[e]||a.setFilters[e.toLowerCase()]||de.error("unsupported pseudo: "+e);return s[E]?s(t):s.length>1?(n=[e,e,"",t],a.setFilters.hasOwnProperty(e.toLowerCase())?fe((function(e,n){for(var i,r=s(e,t),o=r.length;o--;)e[i=F(e,r[o])]=!(n[i]=r[o])})):function(e){return s(e,0,n)}):s}},pseudos:{not:fe((function(e){var t=[],n=[],s=d(e.replace(V,"$1"));return s[E]?fe((function(e,t,n,i){for(var r,o=s(e,null,i,[]),a=e.length;a--;)(r=o[a])&&(e[a]=!(t[a]=r))})):function(e,i,r){return t[0]=e,s(t,null,r,n),t[0]=null,!n.pop()}})),has:fe((function(e){return function(t){return de(e,t).length>0}})),contains:fe((function(e){return e=e.replace(re,oe),function(t){return(t.textContent||c(t)).indexOf(e)>-1}})),lang:fe((function(e){return K.test(e||"")||de.error("unsupported lang: "+e),e=e.replace(re,oe).toLowerCase(),function(t){var n;do{if(n=y?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=i.location&&i.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===b},focus:function(e){return e===v.activeElement&&(!v.hasFocus||v.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ye(!1),disabled:ye(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!a.pseudos.empty(e)},header:function(e){return te.test(e.nodeName)},input:function(e){return ee.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:_e((function(){return[0]})),last:_e((function(e,t){return[t-1]})),eq:_e((function(e,t,n){return[n<0?n+t:n]})),even:_e((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:_e((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:_e((function(e,t,n){for(var s=n<0?n+t:n>t?t:n;--s>=0;)e.push(s);return e})),gt:_e((function(e,t,n){for(var s=n<0?n+t:n;++s<t;)e.push(s);return e}))}}).pseudos.nth=a.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})a.pseudos[r]=ve(r);for(r in{submit:!0,reset:!0})a.pseudos[r]=be(r);function Se(){}function xe(e){for(var t=0,n=e.length,s="";t<n;t++)s+=e[t].value;return s}function Ee(e,t,n){var s=t.dir,i=t.next,r=i||s,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){for(;t=t[s];)if(1===t.nodeType||o)return e(t,n,i);return!1}:function(t,n,c){var l,u,d,h=[A,a];if(c){for(;t=t[s];)if((1===t.nodeType||o)&&e(t,n,c))return!0}else for(;t=t[s];)if(1===t.nodeType||o)if(u=(d=t[E]||(t[E]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[s]||t;else{if((l=u[r])&&l[0]===A&&l[1]===a)return h[2]=l[2];if(u[r]=h,h[2]=e(t,n,c))return!0}return!1}}function je(e){return e.length>1?function(t,n,s){for(var i=e.length;i--;)if(!e[i](t,n,s))return!1;return!0}:e[0]}function Ae(e,t,n,s,i){for(var r,o=[],a=0,c=e.length,l=null!=t;a<c;a++)(r=e[a])&&(n&&!n(r,s,i)||(o.push(r),l&&t.push(a)));return o}function Ce(e,t,n,s,i,r){return s&&!s[E]&&(s=Ce(s)),i&&!i[E]&&(i=Ce(i,r)),fe((function(r,o,a,c){var l,u,d,h=[],f=[],g=o.length,m=r||function(e,t,n){for(var s=0,i=t.length;s<i;s++)de(e,t[s],n);return n}(t||"*",a.nodeType?[a]:a,[]),p=!e||!r&&t?m:Ae(m,h,e,a,c),v=n?i||(r?e:g||s)?[]:o:p;if(n&&n(p,v,a,c),s)for(l=Ae(v,f),s(l,[],a,c),u=l.length;u--;)(d=l[u])&&(v[f[u]]=!(p[f[u]]=d));if(r){if(i||e){if(i){for(l=[],u=v.length;u--;)(d=v[u])&&l.push(p[u]=d);i(null,v=[],l,c)}for(u=v.length;u--;)(d=v[u])&&(l=i?F(r,d):h[u])>-1&&(r[l]=!(o[l]=d))}}else v=Ae(v===o?v.splice(g,v.length):v),i?i(null,o,v,c):L.apply(o,v)}))}function ke(e){for(var t,n,s,i=e.length,r=a.relative[e[0].type],o=r||a.relative[" "],c=r?1:0,l=Ee((function(e){return e===t}),o,!0),u=Ee((function(e){return F(t,e)>-1}),o,!0),d=[function(e,n,s){var i=!r&&(s||n!==f)||((t=n).nodeType?l(e,n,s):u(e,n,s));return t=null,i}];c<i;c++)if(n=a.relative[e[c].type])d=[Ee(je(d),n)];else{if((n=a.filter[e[c].type].apply(null,e[c].matches))[E]){for(s=++c;s<i&&!a.relative[e[s].type];s++);return Ce(c>1&&je(d),c>1&&xe(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(V,"$1"),n,c<s&&ke(e.slice(c,s)),s<i&&ke(e=e.slice(s)),s<i&&xe(e))}d.push(n)}return je(d)}Se.prototype=a.filters=a.pseudos,a.setFilters=new Se,u=de.tokenize=function(e,t){var n,s,i,r,o,c,l,u=O[e+" "];if(u)return t?0:u.slice(0);for(o=e,c=[],l=a.preFilter;o;){for(r in n&&!(s=W.exec(o))||(s&&(o=o.slice(s[0].length)||o),c.push(i=[])),n=!1,(s=J.exec(o))&&(n=s.shift(),i.push({value:n,type:s[0].replace(V," ")}),o=o.slice(n.length)),a.filter)!(s=X[r].exec(o))||l[r]&&!(s=l[r](s))||(n=s.shift(),i.push({value:n,type:r,matches:s}),o=o.slice(n.length));if(!n)break}return t?o.length:o?de.error(e):O(e,c).slice(0)},d=de.compile=function(e,t){var n,s=[],i=[],r=T[e+" "];if(!r){for(t||(t=u(e)),n=t.length;n--;)(r=ke(t[n]))[E]?s.push(r):i.push(r);(r=T(e,function(e,t){var n=t.length>0,s=e.length>0,i=function(i,r,o,c,l){var u,d,h,g=0,m="0",b=i&&[],_=[],w=f,S=i||s&&a.find.TAG("*",l),x=A+=null==w?1:Math.random()||.1,E=S.length;for(l&&(f=r==v||r||l);m!==E&&null!=(u=S[m]);m++){if(s&&u){for(d=0,r||u.ownerDocument==v||(p(u),o=!y);h=e[d++];)if(h(u,r||v,o)){c.push(u);break}l&&(A=x)}n&&((u=!h&&u)&&g--,i&&b.push(u))}if(g+=m,n&&m!==g){for(d=0;h=t[d++];)h(b,_,r,o);if(i){if(g>0)for(;m--;)b[m]||_[m]||(_[m]=D.call(c));_=Ae(_)}L.apply(c,_),l&&!i&&_.length>0&&g+t.length>1&&de.uniqueSort(c)}return l&&(A=x,f=w),b};return n?fe(i):i}(i,s))).selector=e}return r},h=de.select=function(e,t,n,s){var i,r,o,c,l,h="function"==typeof e&&e,f=!s&&u(e=h.selector||e);if(n=n||[],1===f.length){if((r=f[0]=f[0].slice(0)).length>2&&"ID"===(o=r[0]).type&&9===t.nodeType&&y&&a.relative[r[1].type]){if(!(t=(a.find.ID(o.matches[0].replace(re,oe),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(r.shift().value.length)}for(i=X.needsContext.test(e)?0:r.length;i--&&(o=r[i],!a.relative[c=o.type]);)if((l=a.find[c])&&(s=l(o.matches[0].replace(re,oe),ie.test(r[0].type)&&we(t.parentNode)||t))){if(r.splice(i,1),!(e=s.length&&xe(r)))return L.apply(n,s),n;break}}return(h||d(e,f))(s,t,!y,n,!t||ie.test(e)&&we(t.parentNode)||t),n},o.sortStable=E.split("").sort(I).join("")===E,o.detectDuplicates=!!m,p(),o.sortDetached=ge((function(e){return 1&e.compareDocumentPosition(v.createElement("fieldset"))})),ge((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||me("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),o.attributes&&ge((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||me("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ge((function(e){return null==e.getAttribute("disabled")}))||me(B,(function(e,t,n){var s;if(!n)return!0===e[t]?t.toLowerCase():(s=e.getAttributeNode(t))&&s.specified?s.value:null}));var Oe=i.Sizzle;de.noConflict=function(){return i.Sizzle===de&&(i.Sizzle=Oe),de},void 0===(s=function(){return de}.call(t,n,t,e))||(e.exports=s)}(window)},552:(e,t,n)=>{var s=n(5708);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},5561:(e,t,n)=>{var s=n(2376);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},4410:(e,t,n)=>{var s=n(7862);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},6694:(e,t,n)=>{var s=n(1890);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},4311:(e,t,n)=>{var s=n(3960);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},9475:(e,t,n)=>{var s=n(1089);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},9980:(e,t,n)=>{var s=n(9900);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},553:(e,t,n)=>{var s=n(9684);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},2366:(e,t,n)=>{var s=n(7601);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},9996:(e,t,n)=>{var s=n(4774);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},6123:(e,t,n)=>{var s=n(5078);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},5498:(e,t,n)=>{var s=n(7823);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},5921:(e,t,n)=>{var s=n(8961);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},5355:(e,t,n)=>{var s=n(3305);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},5660:(e,t,n)=>{var s=n(6672);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},7385:(e,t,n)=>{var s=n(9597);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},6657:(e,t,n)=>{var s=n(6955);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},9023:(e,t,n)=>{var s=n(5594);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},3796:(e,t,n)=>{var s=n(3347);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},4837:(e,t,n)=>{var s=n(9548);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},4867:(e,t,n)=>{var s=n(7103);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},6353:(e,t,n)=>{var s=n(9369);"string"==typeof s&&(s=[[e.id,s,""]]);n(6723)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},6723:(e,t,n)=>{var s,i,r={},o=(s=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=s.apply(this,arguments)),i}),a=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var s=a.call(this,e,n);if(window.HTMLIFrameElement&&s instanceof window.HTMLIFrameElement)try{s=s.contentDocument.head}catch(e){s=null}t[e]=s}return t[e]}}(),l=null,u=0,d=[],h=n(1947);function f(e,t){for(var n=0;n<e.length;n++){var s=e[n],i=r[s.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](s.parts[o]);for(;o<s.parts.length;o++)i.parts.push(y(s.parts[o],t))}else{var a=[];for(o=0;o<s.parts.length;o++)a.push(y(s.parts[o],t));r[s.id]={id:s.id,refs:1,parts:a}}}}function g(e,t){for(var n=[],s={},i=0;i<e.length;i++){var r=e[i],o=t.base?r[0]+t.base:r[0],a={css:r[1],media:r[2],sourceMap:r[3]};s[o]?s[o].parts.push(a):n.push(s[o]={id:o,parts:[a]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var s=d[d.length-1];if("top"===e.insertAt)s?s.nextSibling?n.insertBefore(t,s.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),d.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function p(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=d.indexOf(e);t>=0&&d.splice(t,1)}function v(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var s=n.nc;s&&(e.attrs.nonce=s)}return b(t,e.attrs),m(e,t),t}function b(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,s,i,r;if(t.transform&&e.css){if(!(r="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=r}if(t.singleton){var o=u++;n=l||(l=v(t)),s=S.bind(null,n,o,!1),i=S.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),m(e,t),t}(t),s=E.bind(null,n,t),i=function(){p(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),s=x.bind(null,n),i=function(){p(n)});return s(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;s(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=g(e,t);return f(n,t),function(e){for(var s=[],i=0;i<n.length;i++){var o=n[i];(a=r[o.id]).refs--,s.push(a)}for(e&&f(g(e,t),t),i=0;i<s.length;i++){var a;if(0===(a=s[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete r[a.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function S(e,t,n,s){var i=n?"":s.css;if(e.styleSheet)e.styleSheet.cssText=w(t,i);else{var r=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(r,o[t]):e.appendChild(r)}}function x(e,t){var n=t.css,s=t.media;if(s&&e.setAttribute("media",s),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function E(e,t,n){var s=n.css,i=n.sourceMap,r=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||r)&&(s=h(s)),i&&(s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([s],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(o),a&&URL.revokeObjectURL(a)}},1947:e=>{e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,s=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,r=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?e:(i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:s+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},7026:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},647:(e,t,n)=>{function s(e){this.options=e||{locator:{}}}function i(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function o(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function a(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function c(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}s.prototype.parseFromString=function(e,t){var n=this.options,s=new d,r=n.domBuilder||new i,a=n.errorHandler,c=n.locator,u=n.xmlns||{},h=/\/x?html?$/.test(t),f=h?l.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&r.setDocumentLocator(c),s.errorHandler=function(e,t,n){if(!e){if(t instanceof i)return t;e=t}var s={},r=e instanceof Function;function a(t){var i=e[t];!i&&r&&(i=2==e.length?function(n){e(t,n)}:e),s[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+o(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),s}(a,r,c),s.domBuilder=n.domBuilder||r,h&&(u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"==typeof e?s.parse(e,u,f):s.errorHandler.error("invalid doc source"),r.doc},i.prototype={startDocument:function(){this.doc=(new f).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,s){var i=this.doc,o=i.createElementNS(e,n||t),a=s.length;c(this,o),this.currentElement=o,this.locator&&r(this.locator,o);for(var l=0;l<a;l++){e=s.getURI(l);var u=s.getValue(l),d=(n=s.getQName(l),i.createAttributeNS(e,n));this.locator&&r(s.getLocator(l),d),d.value=d.nodeValue=u,o.setAttributeNode(d)}},endElement:function(e,t,n){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&r(this.locator,n),c(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=a.apply(this,arguments)){if(this.cdata)var s=this.doc.createCDATASection(e);else s=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(e)&&this.doc.appendChild(s),this.locator&&r(this.locator,s)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=a.apply(this,arguments);var s=this.doc.createComment(e);this.locator&&r(this.locator,s),c(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var s=this.doc.implementation;if(s&&s.createDocumentType){var i=s.createDocumentType(e,t,n);this.locator&&r(this.locator,i),c(this,i)}},warning:function(e){console.warn("[xmldom warning]\t"+e,o(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,o(this.locator))},fatalError:function(e){throw new h(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){i.prototype[e]=function(){return null}}));var l=n(3791),u=n(8275),d=u.XMLReader,h=u.ParseError,f=t.DOMImplementation=n(9034).DOMImplementation;n(9034),t.a=s},9034:(e,t)=>{function n(e,t){for(var n in e)t[n]=e[n]}function s(e,t){var s=e.prototype;if(!(s instanceof t)){function i(){}i.prototype=t.prototype,n(s,i=new i),e.prototype=s=i}s.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),s.constructor=e)}var i={},r=i.ELEMENT_NODE=1,o=i.ATTRIBUTE_NODE=2,a=i.TEXT_NODE=3,c=i.CDATA_SECTION_NODE=4,l=i.ENTITY_REFERENCE_NODE=5,u=i.ENTITY_NODE=6,d=i.PROCESSING_INSTRUCTION_NODE=7,h=i.COMMENT_NODE=8,f=i.DOCUMENT_NODE=9,g=i.DOCUMENT_TYPE_NODE=10,m=i.DOCUMENT_FRAGMENT_NODE=11,p=i.NOTATION_NODE=12,v={},b={},y=(v.INDEX_SIZE_ERR=(b[1]="Index size error",1),v.DOMSTRING_SIZE_ERR=(b[2]="DOMString size error",2),v.HIERARCHY_REQUEST_ERR=(b[3]="Hierarchy request error",3)),_=(v.WRONG_DOCUMENT_ERR=(b[4]="Wrong document",4),v.INVALID_CHARACTER_ERR=(b[5]="Invalid character",5),v.NO_DATA_ALLOWED_ERR=(b[6]="No data allowed",6),v.NO_MODIFICATION_ALLOWED_ERR=(b[7]="No modification allowed",7),v.NOT_FOUND_ERR=(b[8]="Not found",8)),w=(v.NOT_SUPPORTED_ERR=(b[9]="Not supported",9),v.INUSE_ATTRIBUTE_ERR=(b[10]="Attribute in use",10));function S(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,b[e]),this.message=b[e],Error.captureStackTrace&&Error.captureStackTrace(this,S);return n.code=e,t&&(this.message=this.message+": "+t),n}function x(){}function E(e,t){this._node=e,this._refresh=t,j(this)}function j(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var s=e._refresh(e._node);ne(e,"length",s.length),n(s,e),e._inc=t}}function A(){}function C(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function k(e,t,n,s){if(s?t[C(t,s)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(s&&D(i,e,s),function(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(i,e,n))}}function O(e,t,n){var s=C(t,n);if(!(s>=0))throw S(_,new Error(e.tagName+"@"+n));for(var i=t.length-1;s<i;)t[s]=t[++s];if(t.length=i,e){var r=e.ownerDocument;r&&(D(r,e,n),n.ownerElement=null)}}function T(e){if(this._features={},e)for(var t in e)this._features=e[t]}function N(){}function I(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function M(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(M(e,t))return!0}while(e=e.nextSibling)}function R(){}function D(e,t,n,s){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function z(e,t,n){if(e&&e._inc){e._inc++;var s=t.childNodes;if(n)s[s.length++]=n;else{for(var i=t.firstChild,r=0;i;)s[r++]=i,i=i.nextSibling;s.length=r}}}function L(e,t){var n=t.previousSibling,s=t.nextSibling;return n?n.nextSibling=s:e.firstChild=s,s?s.previousSibling=n:e.lastChild=n,z(e.ownerDocument,e),t}function P(e,t,n){var s=t.parentNode;if(s&&s.removeChild(t),t.nodeType===m){var i=t.firstChild;if(null==i)return t;var r=t.lastChild}else i=r=t;var o=n?n.previousSibling:e.lastChild;i.previousSibling=o,r.nextSibling=n,o?o.nextSibling=i:e.firstChild=i,null==n?e.lastChild=r:n.previousSibling=r;do{i.parentNode=e}while(i!==r&&(i=i.nextSibling));return z(e.ownerDocument||e,e),t.nodeType==m&&(t.firstChild=t.lastChild=null),t}function F(){this._nsMap={}}function B(){}function U(){}function q(){}function H(){}function $(){}function G(){}function V(){}function W(){}function J(){}function Q(){}function Y(){}function K(e,t){var n=[],s=9==this.nodeType&&this.documentElement||this,i=s.prefix,r=s.namespaceURI;if(r&&null==i&&null==(i=s.lookupPrefix(r)))var o=[{namespace:r,prefix:null}];return Z(this,n,e,t,o),n.join("")}function X(e,t,n){var s=e.prefix||"",i=e.namespaceURI;if(!s&&!i)return!1;if("xml"===s&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var r=n.length;r--;){var o=n[r];if(o.prefix==s)return o.namespace!=i}return!0}function Z(e,t,n,s,i){if(s){if(!(e=s(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case r:i||(i=[]),i.length;var u=e.attributes,p=u.length,v=e.firstChild,b=e.tagName;n="http://www.w3.org/1999/xhtml"===e.namespaceURI||n,t.push("<",b);for(var y=0;y<p;y++)"xmlns"==(_=u.item(y)).prefix?i.push({prefix:_.localName,namespace:_.value}):"xmlns"==_.nodeName&&i.push({prefix:"",namespace:_.value});for(y=0;y<p;y++){var _;if(X(_=u.item(y),0,i)){var w=_.prefix||"",S=_.namespaceURI,x=w?" xmlns:"+w:" xmlns";t.push(x,'="',S,'"'),i.push({prefix:w,namespace:S})}Z(_,t,n,s,i)}if(X(e,0,i)&&(w=e.prefix||"",S=e.namespaceURI,x=w?" xmlns:"+w:" xmlns",t.push(x,'="',S,'"'),i.push({prefix:w,namespace:S})),v||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(b)){if(t.push(">"),n&&/^script$/i.test(b))for(;v;)v.data?t.push(v.data):Z(v,t,n,s,i),v=v.nextSibling;else for(;v;)Z(v,t,n,s,i),v=v.nextSibling;t.push("</",b,">")}else t.push("/>");return;case f:case m:for(v=e.firstChild;v;)Z(v,t,n,s,i),v=v.nextSibling;return;case o:return t.push(" ",e.name,'="',e.value.replace(/[&"]/g,I),'"');case a:return t.push(e.data.replace(/[<&]/g,I).replace(/]]>/g,"]]&gt;"));case c:return t.push("<![CDATA[",e.data,"]]>");case h:return t.push("\x3c!--",e.data,"--\x3e");case g:var E=e.publicId,j=e.systemId;if(t.push("<!DOCTYPE ",e.name),E)t.push(" PUBLIC ",E),j&&"."!=j&&t.push(" ",j),t.push(">");else if(j&&"."!=j)t.push(" SYSTEM ",j,">");else{var A=e.internalSubset;A&&t.push(" [",A,"]"),t.push(">")}return;case d:return t.push("<?",e.target," ",e.data,"?>");case l:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ee(e,t,n){var s;switch(t.nodeType){case r:(s=t.cloneNode(!1)).ownerDocument=e;case m:break;case o:n=!0}if(s||(s=t.cloneNode(!1)),s.ownerDocument=e,s.parentNode=null,n)for(var i=t.firstChild;i;)s.appendChild(ee(e,i,n)),i=i.nextSibling;return s}function te(e,t,n){var s=new t.constructor;for(var i in t){var a=t[i];"object"!=typeof a&&a!=s[i]&&(s[i]=a)}switch(t.childNodes&&(s.childNodes=new x),s.ownerDocument=e,s.nodeType){case r:var c=t.attributes,l=s.attributes=new A,u=c.length;l._ownerElement=s;for(var d=0;d<u;d++)s.setAttributeNode(te(e,c.item(d),!0));break;case o:n=!0}if(n)for(var h=t.firstChild;h;)s.appendChild(te(e,h,n)),h=h.nextSibling;return s}function ne(e,t,n){e[t]=n}v.INVALID_STATE_ERR=(b[11]="Invalid state",11),v.SYNTAX_ERR=(b[12]="Syntax error",12),v.INVALID_MODIFICATION_ERR=(b[13]="Invalid modification",13),v.NAMESPACE_ERR=(b[14]="Invalid namespace",14),v.INVALID_ACCESS_ERR=(b[15]="Invalid access",15),S.prototype=Error.prototype,n(v,S),x.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],s=0;s<this.length;s++)Z(this[s],n,e,t);return n.join("")}},E.prototype.item=function(e){return j(this),this[e]},s(E,x),A.prototype={length:0,item:x.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new S(w);var n=this.getNamedItem(e.nodeName);return k(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new S(w);return t=this.getNamedItemNS(e.namespaceURI,e.localName),k(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return O(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return O(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var s=this[n];if(s.localName==t&&s.namespaceURI==e)return s}return null}},T.prototype={hasFeature:function(e,t){var n=this._features[e.toLowerCase()];return!(!n||t&&!(t in n))},createDocument:function(e,t,n){var s=new R;if(s.implementation=this,s.childNodes=new x,s.doctype=n,n&&s.appendChild(n),t){var i=s.createElementNS(e,t);s.appendChild(i)}return s},createDocumentType:function(e,t,n){var s=new G;return s.name=e,s.nodeName=e,s.publicId=t,s.systemId=n,s}},N.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return P(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return L(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return te(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==a&&e.nodeType==a?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var s in n)if(n[s]==e)return s;t=t.nodeType==o?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==o?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(i,N),n(i,N.prototype),R.prototype={nodeName:"#document",nodeType:f,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==m){for(var n=e.firstChild;n;){var s=n.nextSibling;this.insertBefore(n,t),n=s}return e}return null==this.documentElement&&e.nodeType==r&&(this.documentElement=e),P(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),L(this,e)},importNode:function(e,t){return ee(this,e,t)},getElementById:function(e){var t=null;return M(this.documentElement,(function(n){if(n.nodeType==r&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new E(this,(function(e){var n=[];return M(e.documentElement,(function(s){s!==e&&s.nodeType==r&&t.test(s.getAttribute("class"))&&n.push(s)})),n}))},createElement:function(e){var t=new F;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new x,(t.attributes=new A)._ownerElement=t,t},createDocumentFragment:function(){var e=new Q;return e.ownerDocument=this,e.childNodes=new x,e},createTextNode:function(e){var t=new q;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new H;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new $;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Y;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new B;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new F,s=t.split(":"),i=n.attributes=new A;return n.childNodes=new x,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==s.length?(n.prefix=s[0],n.localName=s[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new B,s=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==s.length?(n.prefix=s[0],n.localName=s[1]):n.localName=t,n}},s(R,N),F.prototype={nodeType:r,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===m?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var s=e.lastChild;n.removeChild(t),s=e.lastChild}return s=e.lastChild,t.parentNode=e,t.previousSibling=s,t.nextSibling=null,s?s.nextSibling=t:e.firstChild=t,e.lastChild=t,z(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var s=this.ownerDocument.createAttributeNS(e,t);s.value=s.nodeValue=""+n,this.setAttributeNode(s)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new E(this,(function(t){var n=[];return M(t,(function(s){s===t||s.nodeType!=r||"*"!==e&&s.tagName!=e||n.push(s)})),n}))},getElementsByTagNameNS:function(e,t){return new E(this,(function(n){var s=[];return M(n,(function(i){i===n||i.nodeType!==r||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||s.push(i)})),s}))}},R.prototype.getElementsByTagName=F.prototype.getElementsByTagName,R.prototype.getElementsByTagNameNS=F.prototype.getElementsByTagNameNS,s(F,N),B.prototype.nodeType=o,s(B,N),U.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(b[y])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},s(U,N),q.prototype={nodeName:"#text",nodeType:a,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var s=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}},s(q,U),H.prototype={nodeName:"#comment",nodeType:h},s(H,U),$.prototype={nodeName:"#cdata-section",nodeType:c},s($,U),G.prototype.nodeType=g,s(G,N),V.prototype.nodeType=p,s(V,N),W.prototype.nodeType=u,s(W,N),J.prototype.nodeType=l,s(J,N),Q.prototype.nodeName="#document-fragment",Q.prototype.nodeType=m,s(Q,N),Y.prototype.nodeType=d,s(Y,N),N.prototype.toString=K;try{if(Object.defineProperty){function se(e){switch(e.nodeType){case r:case m:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(se(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(E.prototype,"length",{get:function(){return j(this),this.$$length}}),Object.defineProperty(N.prototype,"textContent",{get:function(){return se(this)},set:function(e){switch(this.nodeType){case r:case m:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ne=function(e,t,n){e["$$"+t]=n}}}catch(e){}t.DOMImplementation=T},3791:(e,t)=>{t.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"",lowast:"",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"",cap:"∩",cup:"",int:"∫",there4:"∴",sim:"",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:"",emsp:"",thinsp:"",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"",mdash:"—",lsquo:"",rsquo:"",sbquo:"",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"",Prime:"″",lsaquo:"",rsaquo:"",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},8275:(e,t)=>{var n=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+n.source+s.source+"*(?::"+n.source+s.source+"*)?$");function r(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,r)}function o(){}function a(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function c(e,t,n,s,i,r){function o(e,t,s){e in n.attributeNames&&r.fatalError("Attribute "+e+" redefined"),n.addValue(e,t,s)}for(var a,c=++t,l=0;;){var u=e.charAt(c);switch(u){case"=":if(1===l)a=e.slice(t,c),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(r.warning('attribute value must after "="'),a=e.slice(t,c)),t=c+1,!((c=e.indexOf(u,t))>0))throw new Error("attribute value no end '"+u+"' match");o(a,d=e.slice(t,c).replace(/&#?\w+;/g,i),t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');o(a,d=e.slice(t,c).replace(/&#?\w+;/g,i),t),r.warning('attribute "'+a+'" missed start quot('+u+")!!"),t=c+1,l=5}break;case"/":switch(l){case 0:n.setTagName(e.slice(t,c));case 5:case 6:case 7:l=7,n.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),0==l&&n.setTagName(e.slice(t,c)),c;case">":switch(l){case 0:n.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,c)).slice(-1)&&(n.closed=!0,d=d.slice(0,-1));case 2:2===l&&(d=a),4==l?(r.warning('attribute "'+d+'" missed quot(")!'),o(a,d.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===s[""]&&d.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return c;case"€":u=" ";default:if(u<=" ")switch(l){case 0:n.setTagName(e.slice(t,c)),l=6;break;case 1:a=e.slice(t,c),l=2;break;case 4:var d=e.slice(t,c).replace(/&#?\w+;/g,i);r.warning('attribute "'+d+'" missed quot(")!!'),o(a,d,t);case 5:l=6}else switch(l){case 2:n.tagName,"http://www.w3.org/1999/xhtml"===s[""]&&a.match(/^(?:disabled|checked|selected)$/i)||r.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,t),t=c,l=1;break;case 5:r.warning('attribute space is required"'+a+'"!!');case 6:l=1,t=c;break;case 3:l=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function l(e,t,n){for(var s=e.tagName,i=null,r=e.length;r--;){var o=e[r],a=o.qName,c=o.value;if((f=a.indexOf(":"))>0)var l=o.prefix=a.slice(0,f),u=a.slice(f+1),d="xmlns"===l&&u;else u=a,l=null,d="xmlns"===a&&"";o.localName=u,!1!==d&&(null==i&&(i={},h(n,n={})),n[d]=i[d]=c,o.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(d,c))}for(r=e.length;r--;)(l=(o=e[r]).prefix)&&("xml"===l&&(o.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(o.uri=n[l||""]));var f;(f=s.indexOf(":"))>0?(l=e.prefix=s.slice(0,f),u=e.localName=s.slice(f+1)):(l=null,u=e.localName=s);var g=e.uri=n[l||""];if(t.startElement(g,u,s,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(g,u,s),i)for(l in i)t.endPrefixMapping(l)}function u(e,t,n,s,i){if(/^(?:script|textarea)$/i.test(n)){var r=e.indexOf("</"+n+">",t),o=e.substring(t+1,r);if(/[&<]/.test(o))return/^script$/i.test(n)?(i.characters(o,0,o.length),r):(o=o.replace(/&#?\w+;/g,s),i.characters(o,0,o.length),r)}return t+1}function d(e,t,n,s){var i=s[n];return null==i&&((i=e.lastIndexOf("</"+n+">"))<t&&(i=e.lastIndexOf("</"+n)),s[n]=i),i<t}function h(e,t){for(var n in e)t[n]=e[n]}function f(e,t,n,s){switch(e.charAt(t+2)){case"-":return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,i-t-4),i+3):(s.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var r=function(e,t){var n,s=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(s.push(n),n[1])return s}(e,t),o=r.length;if(o>1&&/!doctype/i.test(r[0][0])){var a=r[1][0],c=!1,l=!1;o>3&&(/^public$/i.test(r[2][0])?(c=r[3][0],l=o>4&&r[4][0]):/^system$/i.test(r[2][0])&&(l=r[3][0]));var u=r[o-1];return n.startDTD(a,c,l),n.endDTD(),u.index+u[0].length}}return-1}function g(e,t,n){var s=e.indexOf("?>",t);if(s){var i=e.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),s+2):-1}return-1}function m(){this.attributeNames={}}r.prototype=new Error,r.prototype.name=r.name,o.prototype={parse:function(e,t,n){var s=this.domBuilder;s.startDocument(),h(t,t={}),function(e,t,n,s,i){function o(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function h(t){if(t>x){var n=e.substring(x,t).replace(/&#?\w+;/g,o);_&&p(x),s.characters(n,0,t-x),x=t}}function p(t,n){for(;t>=b&&(n=y.exec(e));)v=n.index,b=v+n[0].length,_.lineNumber++;_.columnNumber=t-v+1}for(var v=0,b=0,y=/.*(?:\r\n?|\n)|.*$/g,_=s.locator,w=[{currentNSMap:t}],S={},x=0;;){try{var E=e.indexOf("<",x);if(E<0){if(!e.substr(x).match(/^\s*$/)){var j=s.doc,A=j.createTextNode(e.substr(x));j.appendChild(A),s.currentElement=A}return}switch(E>x&&h(E),e.charAt(E+1)){case"/":var C=e.indexOf(">",E+3),k=e.substring(E+2,C),O=w.pop();C<0?(k=e.substring(E+2).replace(/[\s<].*/,""),i.error("end tag name: "+k+" is not complete:"+O.tagName),C=E+1+k.length):k.match(/\s</)&&(k=k.replace(/[\s<].*/,""),i.error("end tag name: "+k+" maybe not complete"),C=E+1+k.length);var T=O.localNSMap,N=O.tagName==k;if(N||O.tagName&&O.tagName.toLowerCase()==k.toLowerCase()){if(s.endElement(O.uri,O.localName,k),T)for(var I in T)s.endPrefixMapping(I);N||i.fatalError("end tag name: "+k+" is not match the current start tagName:"+O.tagName)}else w.push(O);C++;break;case"?":_&&p(E),C=g(e,E,s);break;case"!":_&&p(E),C=f(e,E,s,i);break;default:_&&p(E);var M=new m,R=w[w.length-1].currentNSMap,D=(C=c(e,E,M,R,o,i),M.length);if(!M.closed&&d(e,C,M.tagName,S)&&(M.closed=!0,n.nbsp||i.warning("unclosed xml attribute")),_&&D){for(var z=a(_,{}),L=0;L<D;L++){var P=M[L];p(P.offset),P.locator=a(_,{})}s.locator=z,l(M,s,R)&&w.push(M),s.locator=_}else l(M,s,R)&&w.push(M);"http://www.w3.org/1999/xhtml"!==M.uri||M.closed?C++:C=u(e,C,M.tagName,o,s)}}catch(e){if(e instanceof r)throw e;i.error("element parse error: "+e),C=-1}C>x?x=C:h(Math.max(E,x)+1)}}(e,t,n,s,this.errorHandler),s.endDocument()}},m.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!i.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=o,t.ParseError=r},7521:(e,t,n)=>{var s={"./af/LC_MESSAGES/converse.po":[2866,5830],"./ar/LC_MESSAGES/converse.po":[7693,4469],"./bg/LC_MESSAGES/converse.po":[5638,2551],"./ca/LC_MESSAGES/converse.po":[6124,1553],"./cs/LC_MESSAGES/converse.po":[4283,5301],"./da/LC_MESSAGES/converse.po":[8135,1163],"./de/LC_MESSAGES/converse.po":[254,2895],"./el/LC_MESSAGES/converse.po":[8778,5524],"./eo/LC_MESSAGES/converse.po":[4111,2433],"./es/LC_MESSAGES/converse.po":[3516,8269],"./eu/LC_MESSAGES/converse.po":[6160,3103],"./fa/LC_MESSAGES/converse.po":[7167,321],"./fi/LC_MESSAGES/converse.po":[5819,7618],"./fr/LC_MESSAGES/converse.po":[7500,5129],"./gl/LC_MESSAGES/converse.po":[8429,777],"./he/LC_MESSAGES/converse.po":[2233,4363],"./hi/LC_MESSAGES/converse.po":[7785,4468],"./hu/LC_MESSAGES/converse.po":[2325,6239],"./id/LC_MESSAGES/converse.po":[4938,6678],"./it/LC_MESSAGES/converse.po":[2755,3719],"./ja/LC_MESSAGES/converse.po":[2693,6249],"./lt/LC_MESSAGES/converse.po":[3547,513],"./mr/LC_MESSAGES/converse.po":[2260,1784],"./nb/LC_MESSAGES/converse.po":[9701,473],"./nl/LC_MESSAGES/converse.po":[3175,2473],"./nl_BE/LC_MESSAGES/converse.po":[658,8131],"./oc/LC_MESSAGES/converse.po":[506,5500],"./pl/LC_MESSAGES/converse.po":[275,3606],"./pt/LC_MESSAGES/converse.po":[8300,6227],"./pt_BR/LC_MESSAGES/converse.po":[7606,1455],"./ro/LC_MESSAGES/converse.po":[6899,3539],"./ru/LC_MESSAGES/converse.po":[499,7917],"./sv/LC_MESSAGES/converse.po":[164,8859],"./th/LC_MESSAGES/converse.po":[4307,457],"./tr/LC_MESSAGES/converse.po":[5882,4195],"./uk/LC_MESSAGES/converse.po":[6264,7979],"./vi/LC_MESSAGES/converse.po":[1937,2110],"./zh_CN/LC_MESSAGES/converse.po":[6592,3325],"./zh_TW/LC_MESSAGES/converse.po":[1288,1458]};function i(e){if(!n.o(s,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return n.e(t[1]).then((()=>n.t(i,3)))}i.keys=()=>Object.keys(s),i.id=7521,e.exports=i}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}o.m=i,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,s){if(1&s&&(n=this(n)),8&s)return n;if("object"==typeof n&&n){if(4&s&&n.__esModule)return n;if(16&s&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var r={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>r[e]=()=>n[e]));return r.default=()=>n,o.d(i,r),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>({52:"locales/dayjs/de-js",102:"locales/dayjs/ca-js",145:"locales/dayjs/me-js",265:"locales/dayjs/pt-js",280:"locales/dayjs/bn-js",321:"locales/fa-LC_MESSAGES-converse-po",457:"locales/th-LC_MESSAGES-converse-po",473:"locales/nb-LC_MESSAGES-converse-po",485:"locales/dayjs/ar-sa-js",513:"locales/lt-LC_MESSAGES-converse-po",535:"locales/dayjs/en-js",555:"locales/dayjs/tet-js",559:"locales/dayjs/ru-js",578:"locales/dayjs/bg-js",631:"locales/dayjs/lv-js",646:"locales/dayjs/nb-js",688:"locales/dayjs/ga-js",760:"locales/dayjs/br-js",777:"locales/gl-LC_MESSAGES-converse-po",825:"locales/dayjs/gom-latn-js",882:"locales/dayjs/ms-my-js",911:"locales/dayjs/es-pr-js",1107:"locales/dayjs/ja-js",1110:"locales/dayjs/uz-latn-js",1163:"locales/da-LC_MESSAGES-converse-po",1194:"locales/dayjs/is-js",1204:"locales/dayjs/lo-js",1211:"locales/dayjs/pl-js",1298:"locales/dayjs/sd-js",1396:"locales/dayjs/eu-js",1455:"locales/pt_BR-LC_MESSAGES-converse-po",1458:"locales/zh_TW-LC_MESSAGES-converse-po",1520:"locales/dayjs/nl-js",1553:"locales/ca-LC_MESSAGES-converse-po",1606:"locales/dayjs/el-js",1619:"locales/dayjs/uk-js",1679:"locales/dayjs/de-ch-js",1729:"locales/dayjs/th-js",1735:"locales/dayjs/en-sg-js",1784:"locales/mr-LC_MESSAGES-converse-po",1880:"locales/dayjs/it-js",1910:"locales/dayjs/fr-js",1942:"locales/dayjs/se-js",2110:"locales/vi-LC_MESSAGES-converse-po",2130:"locales/dayjs/fi-js",2263:"locales/dayjs/bm-js",2433:"locales/eo-LC_MESSAGES-converse-po",2446:"locales/dayjs/tg-js",2473:"locales/nl-LC_MESSAGES-converse-po",2475:"locales/dayjs/km-js",2548:"locales/dayjs/da-js",2551:"locales/bg-LC_MESSAGES-converse-po",2814:"locales/dayjs/tlh-js",2843:"locales/dayjs/tzl-js",2895:"locales/de-LC_MESSAGES-converse-po",2984:"locales/dayjs/bi-js",3103:"locales/eu-LC_MESSAGES-converse-po",3153:"locales/dayjs/uz-js",3155:"locales/dayjs/nl-be-js",3208:"locales/dayjs/es-us-js",3221:"locales/dayjs/rw-js",3325:"locales/zh_CN-LC_MESSAGES-converse-po",3411:"locales/dayjs/es-js",3435:"locales/dayjs/sr-cyrl-js",3446:"locales/dayjs/ko-js",3463:"locales/dayjs/en-il-js",3521:"locales/dayjs/ar-ly-js",3539:"locales/ro-LC_MESSAGES-converse-po",3606:"locales/pl-LC_MESSAGES-converse-po",3623:"locales/dayjs/gu-js",3719:"locales/it-LC_MESSAGES-converse-po",3755:"locales/dayjs/zh-hk-js",3933:"locales/dayjs/tzm-latn-js",4035:"locales/dayjs/en-ca-js",4153:"locales/dayjs/et-js",4195:"locales/tr-LC_MESSAGES-converse-po",4305:"locales/dayjs/jv-js",4342:"locales/dayjs/tzm-js",4363:"locales/he-LC_MESSAGES-converse-po",4423:"locales/dayjs/x-pseudo-js",4468:"locales/hi-LC_MESSAGES-converse-po",4469:"locales/ar-LC_MESSAGES-converse-po",4481:"locales/dayjs/cv-js",4610:"emojis",4951:"locales/dayjs/mk-js",4963:"locales/dayjs/az-js",5050:"locales/dayjs/gd-js",5055:"locales/dayjs/ky-js",5073:"locales/dayjs/am-js",5121:"locales/dayjs/eo-js",5129:"locales/fr-LC_MESSAGES-converse-po",5166:"locales/dayjs/my-js",5186:"locales/dayjs/ka-js",5206:"locales/dayjs/kk-js",5215:"locales/dayjs/lb-js",5256:"locales/dayjs/tk-js",5274:"locales/dayjs/pt-br-js",5301:"locales/cs-LC_MESSAGES-converse-po",5313:"locales/dayjs/ar-ma-js",5407:"locales/dayjs/hy-am-js",5485:"locales/dayjs/en-au-js",5500:"locales/oc-LC_MESSAGES-converse-po",5524:"locales/el-LC_MESSAGES-converse-po",5544:"locales/dayjs/fa-js",5569:"locales/dayjs/dv-js",5600:"locales/dayjs/mr-js",5818:"locales/dayjs/gl-js",5822:"locales/dayjs/ht-js",5830:"locales/af-LC_MESSAGES-converse-po",5850:"locales/dayjs/pa-in-js",6010:"locales/dayjs/it-ch-js",6031:"locales/dayjs/en-gb-js",6105:"locales/dayjs/en-tt-js",6227:"locales/pt-LC_MESSAGES-converse-po",6239:"locales/hu-LC_MESSAGES-converse-po",6249:"locales/ja-LC_MESSAGES-converse-po",6376:"locales/dayjs/fy-js",6678:"locales/id-LC_MESSAGES-converse-po",6740:"locales/dayjs/cy-js",6755:"locales/dayjs/ar-js",6776:"locales/dayjs/zh-tw-js",6783:"locales/dayjs/sk-js",6890:"locales/dayjs/ug-cn-js",6898:"locales/dayjs/en-in-js",7024:"locales/dayjs/ku-js",7050:"locales/dayjs/nn-js",7175:"locales/dayjs/de-at-js",7203:"locales/dayjs/oc-lnc-js",7363:"locales/dayjs/fr-ca-js",7390:"locales/dayjs/sr-js",7400:"locales/dayjs/cs-js",7419:"locales/dayjs/hr-js",7454:"locales/dayjs/mi-js",7523:"locales/dayjs/kn-js",7618:"locales/fi-LC_MESSAGES-converse-po",7645:"locales/dayjs/ta-js",7679:"locales/dayjs/ml-js",7714:"locales/dayjs/te-js",7899:"locales/dayjs/lt-js",7917:"locales/ru-LC_MESSAGES-converse-po",7952:"locales/dayjs/fr-ch-js",7979:"locales/uk-LC_MESSAGES-converse-po",8010:"locales/dayjs/hi-js",8022:"locales/dayjs/ro-js",8040:"locales/dayjs/ar-tn-js",8073:"locales/dayjs/vi-js",8129:"locales/dayjs/en-ie-js",8131:"locales/nl_BE-LC_MESSAGES-converse-po",8214:"locales/dayjs/hu-js",8269:"locales/es-LC_MESSAGES-converse-po",8458:"locales/dayjs/zh-js",8547:"locales/dayjs/en-nz-js",8603:"locales/dayjs/sq-js",8618:"locales/dayjs/mn-js",8665:"locales/dayjs/tr-js",8692:"locales/dayjs/yo-js",8745:"locales/dayjs/fo-js",8758:"locales/dayjs/es-do-js",8859:"locales/sv-LC_MESSAGES-converse-po",9030:"locales/dayjs/ne-js",9095:"locales/dayjs/ms-js",9210:"locales/dayjs/af-js",9238:"locales/dayjs/ss-js",9333:"locales/dayjs/si-js",9372:"locales/dayjs/he-js",9406:"locales/dayjs/ar-dz-js",9443:"locales/dayjs/tl-ph-js",9478:"locales/dayjs/be-js",9513:"locales/dayjs/id-js",9568:"locales/dayjs/ur-js",9625:"locales/dayjs/sl-js",9630:"locales/dayjs/zh-cn-js",9652:"locales/dayjs/sv-js",9665:"locales/dayjs/mt-js",9733:"locales/dayjs/sw-js",9833:"locales/dayjs/bs-js",9897:"locales/dayjs/ar-kw-js",9950:"locales/dayjs/bo-js"}[e]+".js"),o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},s="converse.js:",o.l=(e,t,i,r)=>{if(n[e])n[e].push(t);else{var a,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==s+i){a=d;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",s+i),a.src=e),n[e]=[t];var h=(t,s)=>{a.onerror=a.onload=null,clearTimeout(f);var i=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(s))),t)return t(s)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/dist/",(()=>{var e={179:0};o.f.j=(t,n)=>{var s=o.o(e,t)?e[t]:void 0;if(0!==s)if(s)n.push(s[2]);else{var i=new Promise(((n,i)=>s=e[t]=[n,i]));n.push(s[2]=i);var r=o.p+o.u(t),a=new Error;o.l(r,(n=>{if(o.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var i=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+r+")",a.name="ChunkLoadError",a.type=i,a.request=r,s[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var s,i,[r,a,c]=n,l=0;for(s in a)o.o(a,s)&&(o.m[s]=a[s]);for(c&&c(o),t&&t(n);l<r.length;l++)i=r[l],o.o(e,i)&&e[i]&&e[i][0](),e[r[l]]=0},n=self.webpackChunkconverse_js=self.webpackChunkconverse_js||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";const e={},t={plugins:{add(t,n){if(void 0!==e[t])throw new TypeError('Error: plugin with name "'.concat(t,'" has already been ')+"registered!");e[t]=n}},initialize(e={}){t.load(e).initialize(e)},load:(n={})=>(n.assets_path&&(o.p=n.assets_path),o(9598),Object.keys(e).forEach((n=>t.plugins.add(n,e[n]))),t)};window.converse=t;const n=new CustomEvent("converse-loaded",{detail:{converse:t}});window.dispatchEvent(n)})()})();
//# sourceMappingURL=converse.min.js.map