2021-11-11 22:06:49 +01:00
/*! For license information please see converse.min.js.LICENSE.txt */
2023-02-17 12:24:37 +01:00
( ( ) => { var e , t , n , s , i = { 8487 : 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 ) { return t && e . then ( ( function ( e ) { t ( null , e ) } ) , ( function ( e ) { t ( e ) } ) ) , e } function i ( e , t ) { var n = this . getItem ( e ) . then ( ( function ( t ) { return { key : e , value : t } } ) ) ; return s ( n , t ) , n } function r ( e ) { var t = this ; return new Promise ( ( function ( n , s ) { for ( var r = [ ] , o = 0 , a = e . length ; o < a ; o ++ ) r . push ( i . call ( t , e [ o ] ) ) ; Promise . all ( r ) . then ( ( function ( e ) { for ( var t = { } , s = 0 , i = e . length ; s < i ; s ++ ) { var r = e [ s ] ; t [ r . key ] = r . value } n ( t ) } ) ) . catch ( s ) } ) ) } function o ( ) { var e = { } ; return this . iterate ( ( function ( t , n ) { e [ n ] = t } ) ) . then ( ( function ( ) { return e } ) ) } function a ( ) { return "undefined" != typeof IDBKeyRange ? IDBKeyRange : "undefined" != typeof webkitIDBKeyRange ? webkitIDBKeyRange : "undefined" != typeof mozIDBKeyRange ? mozIDBKeyRange : void 0 } t = "default" in t ? t . default : t ; var c = a ( ) ; function l ( e ) { e = e . slice ( ) ; var t = this ; function n ( e , t ) { return e < t ? - 1 : e > t ? 1 : 0 } return new Promise ( ( function ( s , i ) { t . ready ( ) . then ( ( function ( ) { var r , o = t . _dbInfo , a = o . db . transaction ( o . storeName , "readonly" ) . objectStore ( o . storeName ) , l = e . sort ( n ) , d = c . bound ( e [ 0 ] , e [ e . length - 1 ] , ! 1 , ! 1 ) ; if ( "getAll" in a ) ( r = a . getAll ( d ) ) . onsuccess = function ( ) { var e = r . result ; void 0 === e && ( e = null ) , s ( e ) } ; else { r = a . openCursor ( d ) ; var u = { } , h = 0 ; r . onsuccess = function ( ) { var e = r . result ; if ( e ) { for ( var t = e . key ; t > l [ h ] ; ) if ( ++ h === l . length ) return void s ( u ) ; if ( t === l [ h ] ) { var n = e . value ; void 0 === n && ( n = null ) , u [ t ] = n , e . continue ( ) } else e . continue ( l [ h ] ) } else s ( u ) } } r . onerror = function ( ) { i ( r . error ) } } ) ) . catch ( i ) } ) ) } function d ( e ) { var t = this ; return new Promise ( ( function ( s , i ) { t . ready ( ) . then ( ( function ( ) { return n ( t ) } ) ) . then ( ( function ( n ) { var r = t . _dbInfo ; r . db . transaction ( ( function ( t ) { for ( var o = new Array ( e . length ) , a = 0 , c = e . length ; a < c ; a ++ ) o [ a ] = "?" ; t . executeSql ( "SELECT * FROM " + r . storeName + " WHERE (key IN (" + o . join ( "," ) + "))" , e , ( function ( e , t ) { for ( var i = { } , r = t . rows , o = 0 , a = r . length ; o < a ; o ++ ) { var c = r . item ( o ) , l = c . value ; l && ( l = n . deserialize ( l ) ) , i [ c . key ] = l } s ( i ) } ) , ( function ( e , t ) { i ( t ) } ) ) } ) ) } ) ) . catch ( i ) } ) ) } function u ( e , t ) { var n , i = this ; if ( arguments . length && null !== e ) { var a = i . driver ( ) ; n = a === i . INDEXEDDB ? l . apply ( i , arguments ) : a === i . WEBSQL ? d . apply ( i , arguments ) : r . apply ( i , arguments ) } else n = o . apply ( i ) ; return s ( n , t ) , n } function h ( e ) { var t = Object . getPrototypeOf ( e ) ; t && ( t . getItems = u , t . getItems . indexedDB = function ( ) { return l . apply ( this , arguments ) } , t . getItems . websql = function ( ) { return d . apply ( this , arguments ) } , t . getItems . generic = function ( ) { return r . apply ( this , arguments ) } ) } var m = h ( t ) ; e . localforageGetItems = u , e . extendPrototype = h , e . extendPrototypeResult = m , e . getItemsGeneric = r , Object . defineProperty ( e , "__esModule" , { value : ! 0 } ) } ( t , n ( 5513 ) ) } , 7609 : ( e , t , n ) => { "use strict" ; const s = n ( 7776 ) , i = n ( 2350 ) ; e . exports = { atob : s , btoa : i } } , 7776 : e => { "use strict" ; const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ; function n ( e ) { const n = t . indexOf ( e ) ; return n < 0 ? void 0 : n } e . exports = function ( e ) { if ( 0 === arguments . length ) throw new TypeError ( "1 argument required, but only 0 present." ) ; 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 t = "" , s = 0 , i = 0 ; for ( let r = 0 ; r < e . length ; r ++ ) s <<= 6 , s |= n ( e [ r ] ) , i += 6 , 24 === i && ( t += String . fromCharCode ( ( 16711680 & s ) >> 16 ) , t += String . fromCharCode ( ( 65280 & s ) >> 8 ) , t += String . fromCharCode ( 255 & s ) , s = i = 0 ) ; return 12 === i ? ( s >>= 4 , t += String . fromCharCode ( s ) ) : 18 === i && ( s >>= 2 , t += String . fromCharCode ( ( 65280 & s ) >> 8 ) , t += String . fromCharCode ( 255 & s ) ) , t } } , 2350 : e => { "use strict" ; const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ; function n ( e ) { if ( e >= 0 && e < 64 ) return t [ e ] } e . exports = function ( e ) { if ( 0 === arguments . length ) throw new TypeError ( "1 argument required, but only 0 present." ) ; let t ; for ( e = ` ${ e } ` , t = 0 ; t < e . length ; t ++ ) if ( e . charCodeAt ( t ) > 255 ) return null ; let s = "" ; for ( t = 0 ; t < e . length ; t += 3 ) { const i = [ void 0 , void 0 , void 0 , void 0 ] ; i [ 0 ] = e . charCodeAt ( t ) >> 2 , i [ 1 ] = ( 3 & e . charCodeAt ( t ) ) << 4 , e . length > t + 1 && ( i [ 1 ] |= e . charCodeAt ( t + 1 ) >> 4 , i [ 2 ] = ( 15 & e . charCodeAt ( t + 1 ) ) << 2 ) , e . length > t
< command sessionid = "${t}" node = "${n}" action = "${s}" xmlns = "${dp.NS.ADHOC}" >
$ { [ "cancel" , "prev" ] . includes ( s ) ? "" : mp `
< x xmlns = "${dp.NS.XFORM}" type = "submit" >
$ { i . reduce ( ( ( e , t ) => { let { name : n , value : s } = t ; return e + ` <field var=" ${ n } "><value> ${ s } </value></field> ` } ) , "" ) }
< / x > ` }
< / c o m m a n d >
< /iq>`,o=await Ih.sendIQ(r,null,!1);if(null===o){Il.warn("A timeout occurred while trying to run an ad-hoc command");const{__:e}=nd;return{status:"error",note:e("A timeout occurred")}}hp.isErrorStanza(o)&&(Il.error("Error while trying to execute an ad-hoc command"),Il.error(o));const a=o.querySelector("command")?.getAttribute("status");return{status:a,..."executing"===a?lp(o):{},note:o.querySelector("note")?.textContent}}}},{Strophe:fp}=Oh.env;fp.addNamespace("ADHOC","http:/ / jabber . org / protocol / commands "),Oh.plugins.add(" converse - adhoc ",{dependencies:[" converse - disco "],initialize(){Object.assign(this._converse.api,gp)}});class pp extends Mm{defaults(){return{bookmarked:!1,hidden:[" mobile "," fullscreen "].includes(Ih.settings.get(" view _mode ")),message_type:" headline ",num_unread:0,time_opened:this.get(" time _opened ")||(new Date).getTime(),type:nd.HEADLINES_TYPE}}async initialize(){this.set({box_id:`box-${this.get(" jid ")}`}),this.initUI(),this.initMessages(),await this.fetchMessages(),Ih.trigger(" headlinesFeedInitialized ",this)}}const vp={headlines:{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];async function s(e){let s=await Ih.chatboxes.get(e);return!s&&n?s=await Ih.chatboxes.create(e,t,nd.HeadlinesFeed):(s=s&&s.get(" type ")===nd.HEADLINES_TYPE?s:null,s&&Object.keys(t).length&&s.save(t)),s}if(void 0===e){return(await Ih.chatboxes.get()).filter((e=>e.get(" type ")===nd.HEADLINES_TYPE))}return" string "==typeof e?s(e):Promise.all(e.map((e=>s(e))))}}};Oh.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.HeadlinesFeed(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){function e(){nd.connection.addHandler((e=>async function(e){if(xm(e)||Em(e)){const t=e.getAttribute(" from ");if(await Ih.waitUntil(" rosterInitialized "),t.includes(" @ ")&&!nd.roster.get(t)&&!Ih.settings.get(" allow _non _roster _messaging "))return;if(null===e.querySelector(" body "))return;const n=nd.chatboxes.create({id:t,jid:t,type:nd.HEADLINES_TYPE,from:t}),s=await jm(e);await n.createMessage(s),Ih.trigger(" message ",{chatbox:n,stanza:e,attrs:s})}}(e)||!0),null," message ")}nd.HeadlinesFeed=pp,Ih.listen.on(" connected ",e),Ih.listen.on(" reconnected ",e),Object.assign(Ih,vp)}});const yp=Oh.env.utils;class _p extends No{defaults(){return{msgid:yp.getUniqueId(),is_ephemeral:!1}}}const{Strophe:bp,$build:wp}=Oh.env;bp.addNamespace(" RSM "," http : //jabber.org/protocol/rsm");const Sp=["after","before","index","max"],xp=e=>Number(e),Ep=e=>e.toString(),Ap={after:Ep,before:Ep,count:xp,first:Ep,index:xp,last:Ep,max:xp},Cp=e=>void 0===e,$p=Object.keys(Ap);class kp{static getQueryParameters(){return To(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},Sp)}static parseXMLResult(e){const t={};for(var n=0;n<$p.length;n++){const s=$p[n],i=e.getElementsByTagName(s)[0];Cp(i)||null===i||(t[s]=Ap[s](bp.getText(i)),"first"==s&&(t.index=Ap.index(i.getAttribute("index"))))}return t}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.query=kp.getQueryParameters(e),this.result=e.xml?kp.parseXMLResult(e.xml):{}}toXML(){const e=wp("set",{xmlns:bp.NS.RSM});return Sp.reduce(((e,t)=>Cp(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 kp(n)}previous(e,t){const n=Object.assign({},this.query,{after:t,before:this.result.first,max:e});return new kp(n)}}nd.RSM_ATTRIBUTES=$p,nd.RSM=kp;const{Strophe:jp,$iq:Tp,dayjs:Np}=Oh.env,{NS:Ip}=jp,Op=Oh.env.utils,Mp={archive:{async query(e){if(!Ih.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||nd.bare_jid;if(!await Ih.disco.supports
2022-12-17 22:08:36 +01:00
< div class = "modal-dialog" role = "document" tabindex = "-1" role = "dialog" aria - hidden = "true" >
< div class = "modal-content" >
2023-01-07 22:34:35 +01:00
< div class = "modal-header ${n}" >
2022-12-17 22:08:36 +01:00
< h5 class = "modal-title" > $ { e . getModalTitle ( ) } < / h 5 >
2023-02-17 12:24:37 +01:00
$ { x _ }
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" >
2023-02-17 12:24:37 +01:00
$ { t ? u _ ( { type : ` alert- ${ t . type } ` , message : t . message } ) : "" }
2022-12-17 22:08:36 +01:00
< / s p a n >
2023-01-07 22:34:35 +01:00
$ { e . renderModal ? . ( ) ? ? "" }
2022-12-17 22:08:36 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . renderModalFooter ? . ( ) ? ? Gu ` <div class="modal-footer"> ${ S _ } </div> ` }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
` })(this)}getModalTitle(){return""}switchTab(e){e?.stopPropagation(),e?.preventDefault(),this.tab=e.target.getAttribute("data-name"),this.render()}onHide(){this.modal.hide()}insertIntoDOM(){document.querySelector("#converse-modals").insertAdjacentElement("beforeEnd",this)}alert(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"primary";this.model.set("alert",{message:e,type:t}),setTimeout((()=>{this.model.set("alert",void 0)}),5e3)}async show(){await this.initialized,this.modal.show(),this.render()}};Ih.elements.define("converse-alert-modal",class extends $ _{initialize(){super.initialize(),this.listenTo(this.model,"change",(()=>this.render())),this.addEventListener("hide.bs.modal",(()=>this.remove()),!1)}renderModal(){return(e=>Gu `
2022-12-17 22:08:36 +01:00
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
2023-02-17 12:24:37 +01:00
$ { e . messages . map ( ( e => Gu ` <p> ${ e } </p> ` ) ) }
< / d i v > ` ) ( t h i s . m o d e l . t o J S O N ( ) ) } g e t M o d a l T i t l e ( ) { r e t u r n t h i s . m o d e l . g e t ( " t i t l e " ) } } ) ; c o n s t k _ = e = > G u `
2022-12-17 22:08:36 +01:00
< form class = "converse-form converse-form--modal confirm" action = "#" @ submit = $ { t => e . onConfimation ( t ) } >
< div class = "form-group" >
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "messages" ) ? . map ( ( e => Gu ` <p> ${ e } </p> ` ) ) }
2022-12-17 22:08:36 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "fields" ) ? . map ( ( e => ( e => Gu `
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label >
$ { e . label || "" }
< input type = "text"
name = "${e.name}"
class = "${e.challenge_failed?" error ":" "} form-control form-control--labeled"
? required = "${e.required}"
placeholder = "${e.placeholder}" / >
< / l a b e l >
< / d i v >
` )(e)))}
< div class = "form-group" >
2023-02-17 12:24:37 +01:00
< button type = "submit" class = "btn btn-primary" > $ { Gy ( "OK" ) } < / b u t t o n >
< input type = "button" class = "btn btn-secondary" data - dismiss = "modal" value = "${Gy(" Cancel ")}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
< / f o r m > ` ; c l a s s j _ e x t e n d s $ _ { c o n s t r u c t o r ( e ) { s u p e r ( e ) , t h i s . c o n f i r m a t i o n = e a ( ) } i n i t i a l i z e ( ) { s u p e r . i n i t i a l i z e ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e n d e r ( ) ) ) , t h i s . a d d E v e n t L i s t e n e r ( " h i d e . b s . m o d a l " , ( ( ) = > { t h i s . c o n f i r m a t i o n . i s R e s o l v e d | | t h i s . c o n f i r m a t i o n . r e j e c t ( ) } ) , ! 1 ) } r e n d e r M o d a l ( ) { r e t u r n k _ ( t h i s ) } g e t M o d a l T i t l e ( ) { r e t u r n t h i s . m o d e l . g e t ( " t i t l e " ) } o n C o n f i m a t i o n ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) , n = ( t h i s . m o d e l . g e t ( " f i e l d s " ) | | [ ] ) . m a p ( ( e = > { c o n s t n = t . g e t ( e . n a m e ) . t r i m ( ) ; r e t u r n e . v a l u e = n , e . c h a l l e n g e & & ( e . c h a l l e n g e _ f a i l e d = n ! = = e . c h a l l e n g e ) , e } ) ) ; i f ( n . f i l t e r ( ( e = > e . c h a l l e n g e _ f a i l e d ) ) . l e n g t h ) r e t u r n t h i s . m o d e l . s e t ( " f i e l d s " , n ) , v o i d t h i s . m o d e l . t r i g g e r ( " c h a n g e " ) ; t h i s . c o n f i r m a t i o n . r e s o l v e ( n ) , t h i s . m o d a l . h i d e ( ) } r e n d e r M o d a l F o o t e r ( ) { r e t u r n " " } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c o n f i r m - m o d a l " , j _ ) ; l e t T _ = [ ] , N _ = { } ; c o n s t I _ = { m o d a l : { s h o w ( e , t , n ) { l e t s ; i f ( " s t r i n g " = = t y p e o f e ) s = t h i s . g e t ( e ) ? ? t h i s . c r e a t e ( e , t ) , O b j e c t . a s s i g n ( s , t ) ; e l s e { c o n s t n = e , i = n . i d ? ? t . i d ; s = t h i s . g e t ( i ) ? ? t h i s . c r e a t e ( n , t ) } r e t u r n s . s h o w ( n ) , s } , g e t : e = > N _ [ e ] ? ? T _ . f i l t e r ( ( t = > t . i d = = e ) ) . p o p ( ) , c r e a t e ( e , t ) { l e t n ; i f ( " s t r i n g " = = t y p e o f e ) { c o n s t s = c u s t o m E l e m e n t s . g e t ( e ) ; n = N _ [ e ] = n e w s ( t ) } e l s e { n = n e w e ( t ) , T _ . p u s h ( n ) } r e t u r n n } , r e m o v e ( e ) { l e t t ; " s t r i n g " = = t y p e o f e ? ( t = N _ [ e ] , d e l e t e N _ [ e ] ) : ( t = e , T _ = T _ . f i l t e r ( ( e = > e ! = = t ) ) ) , t ? . r e m o v e ( ) } , r e m o v e A l l ( ) { T _ . f o r E a c h ( ( e = > e . r e m o v e ( ) ) ) , T _ = [ ] , N _ = { } } } , a s y n c c o n f i r m ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : [ ] ; " s t r i n g " = = t y p e o f t & & ( t = [ t ] ) ; c o n s t n = n e w N o ( { t i t l e : e , m e s s a g e s : t , f i e l d s : a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ? a r g u m e n t s [ 2 ] : [ ] , t y p e : " c o n f i r m " } ) , s = n e w j _ ( { m o d e l : n } ) ; l e t i ; s . s h o w ( ) ; t r y { i = a w a i t s . c o n f i r m a t i o n } c a t c h ( e ) { i = ! 1 } r e t u r n s . r e m o v e ( ) , i } , a s y n c p r o m p t ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : [ ] ; " s t r i n g " = = t y p e o f t & & ( t = [ t ] ) ; c o n s t n = n e w N o ( { t i t l e : e , m e s s a g e s : t , f i e l d s : [ { n a m e : " r e a s o n " , p l a c e h o l d e r : a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ? a r g u m e n t s [ 2 ] : " " } ] , t y p e : " p r o m p t " } ) , s = n e w j _ ( { m o d e l : n } ) ; l e t i ; s . s h o w ( ) ; t r y { i = ( a w a i t s . c o n f i r m a t i o n ) . p o p ( ) ? . v a l u e } c a t c h ( e ) { i = ! 1 } r e t u r n s . r e m o v e ( ) , i } , a l e r t ( e , t , n ) { l e t s ; " s t r i n g " = = t y p e o f n & & ( n = [ n ] ) , " e r r o r " = = = e ? s = " a l e r t - d a n g e r " : " i n f o " = = = e ? s = " a l e r t - i n f o " : " w a r n " = = = e & & ( s = " a l e r t - w a r n i n g " ) ; c o n s t i = n e w N o ( { t i t l e : t , m e s s a g e s : n , l e v e l : s , t y p e : " a l e r t " } ) ; I _ . m o d a l . s h o w ( " c o n v e r s e - a l e r t - m o d a l " , { m o d e l : i } ) } } , O _ = I _ ; O h . e n v . B o o t s t r a p M o d a l = w _ , O h . p l u g i n s . a d d ( " c o n v e r s e - m o d a l " , { i n i t i a l i z e ( ) { I h . l i s t e n . o n ( " d i s c o n n e c t " , ( ( ) = > { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " # c o n v e r s e - m o d a l s " ) ; e & & ( e . i n n e r H T M L = " " ) } ) ) , I h . l i s t e n . o n ( " c l e a r S e s s i o n " , ( ( ) = > I h . m o d a l . r e m o v e A l l ( ) ) ) , O b j e c t . a s s i g n ( n d . a p i , O _ ) } } ) ; c o n s t M _ = O h . e n v . u t i l s , R _ = { g e t E l e m e n t : ( e , t ) = > " s t r i n g " = = t y p e o f e ? ( t | | d o c u m e n t ) . q u e r y S e l e c t o r ( e ) : e | | n u l l , b i n d ( e , t ) { i f ( e ) f o r ( v a r n i n t ) { i f ( ! O b j e c t . p r o t o t y p e . h a s O w n P r o p e r t y . c a l l ( t , n ) ) c o n t i n u e ; c o n s t s = t [ n ] ; n . s p l i t ( / \ s + / ) . f o r E a c h ( ( t = > e . a d d E v e n t L i s t e n e r ( t , s ) ) ) } } , u n b i n d ( e , t ) { i f ( e ) f o r ( v a r n i n t ) { i f ( ! O b j e c t . p r o t o t y p e . h a s O w n P r o p e r t y . c a l l ( t , n ) ) c o n t i n u e ; c o n s t s = t [ n ] ; n . s p l i t ( / \ s + / ) . f o r E a c h ( ( t = > e . r e m o v e E v e n t L i s t e n e r ( t , s ) ) ) } } , r e g E x p E s c a p e : e = > e . r e p l a c e ( / [ - \ \ ^ $ * + ? . ( ) | [ \ ] { } ] / g , " \ \ $ & " ) , i s M e n t i o n : ( e , t ) = > t . i n c l u d e s ( e [ 0 ] ) | | M _ . i s M e n t i o n B o u n d a r y ( e [ 0 ] ) & & t . i n c l u d e s ( e [ 1 ] ) } , D _ = f u n c t i o n ( e , t ) { r e t u r n R e g E x p ( R _ . r e g E x p E s c a p e ( t . t r i m ( ) ) , " i " ) . t e s t ( e ) } , z _ = f u n c t i o n ( e , t ) { r e t u r n R e g E x p ( " ^ " + R _ . r e g E x p E s c a p e ( t . t r i m ( ) ) , " i " ) . t e s t ( e ) } , L _ = f u n c t i o n ( e , t ) { c o n s t n = e . q u e r y . t o L o w e r C a s e ( ) , s = e . l a b e l . t o L o w e r C a s e ( ) . i n d e x O f ( n ) , i = t . l a b e l . t o L o w e r C a s e ( ) . i n d e x O f ( n ) ; r e t u r n s = = = i ? f u n c t i o n ( e , t ) { r e t u r n e . l e n g t h ! = = t . l e n g t h ? e . l e n g t h - t . l e n g t h : e < t ? - 1 : 1 } ( e , t ) : ( - 1 = = = s ? 1 / 0 : s ) < ( - 1 = = = i ? 1 / 0 : i ) ? - 1 : 1 } , P _ = ( e , t ) = > { t = t . t r i m ( ) ; c o n s t n = d o c u m e n t . c r e a t e E l e m e n t ( " l i " ) ; n . s e t A t t r i b u t e ( " a r i a - s e l e c t e d " , " f a l s e " ) ; c o n s t s = n e w R e g E x p ( " ( " + t + " ) " , " i g " ) ; r e t u r n ( t ? e . s p l i t ( s ) : [ e ] ) . f o r E a c h ( ( e = > { i f ( t & & e . m a t c h ( s ) ) { c o n s t t = d o c u m e n t . c r e a t e E l e m e n t ( " m a r k " ) ; t . t e x t C o n t e n t = e , n . a p p e n d C h i l d ( t ) } e l s e n . a p p e n d C h i l d ( d o c u m e n t . c r e a t e T e x t N o d e ( e ) ) } ) ) , n } ; c o n s t F _ = c l a s s e x t e n d s S t r i n g { c o n s t r u c t o r ( e , t ) { s u p e r ( ) ; c o n s t n = A r r a y . i s A r r a y ( e ) ? { l a b e l : e [ 0 ] , v a l u e : e [ 1 ] } : " o b j e c t " = = t y p e o f e & & " l a b e l " i n e & & " v a l u e " i n e ? e : { l a b e l : e , v a l u e : e } ; t h i s . l a b e l = n . l a b e l | | n . v a l u e , t h i s . v a l u e = n . v a l u e , t h i s . q u e r y = t } g e t l e n t h ( ) { r e t u r n t h i s . l a b e l . l e n g t h } t o S t r i n g ( ) { r e t u r n " " + t h i s . l a b e l } v a l u e O f ( ) { r e t u r
2022-12-17 22:08:36 +01:00
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results ${e}" hidden = "" > < / u l >
< input
? autofocus = $ { this . autofocus }
? required = $ { this . required }
type = "text"
name = "${this.name}"
autocomplete = "off"
@ keydown = $ { this . onKeyDown }
@ keyup = $ { this . onKeyUp }
class = "form-control suggestion-box__input"
placeholder = "${this.placeholder}"
/ >
< span
class = "suggestion-box__additions visually-hidden"
role = "status"
aria - live = "assertive"
aria - relevant = "additions"
> < / s p a n >
< / d i v >
2023-02-17 12:24:37 +01:00
` }firstUpdated(){this.auto_complete=new q_(this.firstElementChild,{ac_triggers:this.triggers.split(" "),auto_evaluate:this.auto_evaluate,auto_first:this.auto_first,filter:"contains"==this.filter?D_:z_,include_triggers:[],list:this.list??(e=>this.getAutoCompleteList(e)),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)}});var H_=n(4921),G_={};G_.styleTagTransform=o_(),G_.setAttributes=n_(),G_.insert=e_().bind(null,"head"),G_.domAPI=Ky(),G_.insertStyleElement=i_();Qy()(H_.Z,G_);H_.Z&&H_.Z.locals&&H_.Z.locals;nd.FILTER_CONTAINS=D_,nd.FILTER_STARTSWITH=z_,nd.AutoComplete=q_;const W_={execute:Gy("Execute"),prev:Gy("Previous"),next:Gy("Next"),complete:Gy("Complete")},V_=(e,t)=>Gu `
2022-12-17 22:08:36 +01:00
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . toggleCommandForm ( t ) }
2022-12-17 22:08:36 +01:00
data - command - node = "${t.node}"
data - command - jid = "${t.jid}"
data - command - name = "${t.name}"
title = "${t.name}"
href = "#" > $ { t . name || t . jid } < / a >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { t . node === e . showform ? ( ( e , t ) => { const n = Gy ( "Cancel" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< span > <!-- Don ' t remove this < span > ,
this is a workaround for a lit bug where a < form > cannot be removed
if it contains an < input > with name "remove" -- >
2023-02-17 12:24:37 +01:00
< form >
$ { t . alert ? Gu ` <div class="alert alert- ${ t . alert _type } " role="alert"> ${ t . alert } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< fieldset class = "form-group" >
< input type = "hidden" name = "command_node" value = "${t.node}" / >
< input type = "hidden" name = "command_jid" value = "${t.jid}" / >
2023-02-17 12:24:37 +01:00
< p class = "form-instructions" > $ { t . instructions } < / p >
2022-12-17 22:08:36 +01:00
$ { t . fields }
< / f i e l d s e t >
< fieldset >
2023-02-17 12:24:37 +01:00
$ { t . actions . map ( ( t => Gu ` <input data-action=" ${ t } "
@ click = $ { t => e . executeAction ( t ) }
type = "button"
class = "btn btn-primary"
value = "${W_[t]}" > ` ))}<input type="button"
class = "btn btn-secondary button-cancel"
value = "${n}"
@ click = $ { t => e . cancel ( t ) } >
2022-12-17 22:08:36 +01:00
< / f i e l d s e t >
< / f o r m >
< / s p a n >
` })(e,t):""}
< / l i >
2023-02-17 12:24:37 +01:00
` ,J_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.classes?.includes("hor_centered")?Gu ` < div class = "spinner__container" > < converse - icon size = "1em" class = "fa fa-spinner spinner centered ${e.classes||" "}" > < / c o n v e r s e - i c o n > < / d i v > ` : G u ` < c o n v e r s e - i c o n s i z e = " 1 e m " c l a s s = " f a f a - s p i n n e r s p i n n e r c e n t e r e d $ { e . c l a s s e s | | " " } " > < / c o n v e r s e - i c o n > ` } , Z _ = e = > { r e t u r n e . i m a g e ? G u `
2022-12-17 22:08:36 +01:00
< svg xmlns = "http://www.w3.org/2000/svg" class = "avatar ${e.classes}" width = "${e.width}" height = "${e.height}" >
< image width = "${e.width}" height = "${e.height}" preserveAspectRatio = "xMidYMid meet" href = "${t=e.image,n=e.image_type,t.startsWith(" data : ")?t:`data:${n};base64,${t}`}" / >
2023-02-17 12:24:37 +01:00
< / s v g > ` : " " ; v a r t , n } ; v a r Q _ = n ( 5 2 2 2 ) , Y _ = { } ; Y _ . s t y l e T a g T r a n s f o r m = o _ ( ) , Y _ . s e t A t t r i b u t e s = n _ ( ) , Y _ . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , Y _ . d o m A P I = K y ( ) , Y _ . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( Q _ . Z , Y _ ) ; Q _ . Z & & Q _ . Z . l o c a l s & & Q _ . Z . l o c a l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - a v a t a r " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { d a t a : { t y p e : O b j e c t } , w i d t h : { t y p e : S t r i n g } , h e i g h t : { t y p e : S t r i n g } , n o n c e : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . w i d t h = 3 6 , t h i s . h e i g h t = 3 6 } r e n d e r ( ) { c o n s t e = t h i s . d a t a ? . i m a g e _ t y p e | | n d . D E F A U L T _ I M A G E _ T Y P E ; l e t t ; i f ( t h i s . d a t a ? . d a t a _ u r i ) t = t h i s . d a t a ? . d a t a _ u r i ; e l s e { t = " d a t a : " + e + " ; b a s e 6 4 , " + ( t h i s . d a t a ? . i m a g e | | n d . D E F A U L T _ I M A G E ) } r e t u r n Z _ ( { c l a s s e s : t h i s . g e t A t t r i b u t e ( " c l a s s " ) , h e i g h t : t h i s . h e i g h t , w i d t h : t h i s . w i d t h , i m a g e : t , i m a g e _ t y p e : e } ) } } ) ; c o n s t { I : K _ } = a h , X _ = ( ) = > d o c u m e n t . c r e a t e C o m m e n t ( " " ) , e b = ( e , t , n ) = > { v a r s ; c o n s t i = e . _ $ A A . p a r e n t N o d e , r = v o i d 0 = = = t ? e . _ $ A B : t . _ $ A A ; i f ( v o i d 0 = = = n ) { c o n s t t = i . i n s e r t B e f o r e ( X _ ( ) , r ) , s = i . i n s e r t B e f o r e ( X _ ( ) , r ) ; n = n e w K _ ( t , s , e , e . o p t i o n s ) } e l s e { c o n s t t = n . _ $ A B . n e x t S i b l i n g , o = n . _ $ A M , a = o ! = = e ; i f ( a ) { l e t t ; n u l l = = = ( s = n . _ $ A Q ) | | v o i d 0 = = = s | | s . c a l l ( n , e ) , n . _ $ A M = e , v o i d 0 ! = = n . _ $ A P & & ( t = e . _ $ A U ) ! = = o . _ $ A U & & n . _ $ A P ( t ) } i f ( t ! = = r | | a ) { l e t e = n . _ $ A A ; f o r ( ; e ! = = t ; ) { c o n s t t = e . n e x t S i b l i n g ; i . i n s e r t B e f o r e ( e , r ) , e = t } } } r e t u r n n } , t b = f u n c t i o n ( e , t ) { l e t n = a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ? a r g u m e n t s [ 2 ] : e ; r e t u r n e . _ $ A I ( t , n ) , e } , n b = { } , s b = e = > { v a r t ; n u l l = = = ( t = e . _ $ A P ) | | v o i d 0 = = = t | | t . c a l l ( e , ! 1 , ! 0 ) ; l e t n = e . _ $ A A ; c o n s t s = e . _ $ A B . n e x t S i b l i n g ; f o r ( ; n ! = = s ; ) { c o n s t e = n . n e x t S i b l i n g ; n . r e m o v e ( ) , n = e } } , i b = 2 , r b = e = > f u n c t i o n ( ) { f o r ( v a r t = a r g u m e n t s . l e n g t h , n = n e w A r r a y ( t ) , s = 0 ; s < t ; s + + ) n [ s ] = a r g u m e n t s [ s ] ; r e t u r n { _ $ l i t D i r e c t i v e $ : e , v a l u e s : n } } ; c l a s s o b { c o n s t r u c t o r ( e ) { } g e t _ $ A U ( ) { r e t u r n t h i s . _ $ A M . _ $ A U } _ $ A T ( e , t , n ) { t h i s . _ $ C t = e , t h i s . _ $ A M = t , t h i s . _ $ C i = n } _ $ A S ( e , t ) { r e t u r n t h i s . u p d a t e ( e , t ) } u p d a t e ( e , t ) { r e t u r n t h i s . r e n d e r ( . . . t ) } } c o n s t a b = ( e , t ) = > { v a r n , s ; c o n s t i = e . _ $ A N ; i f ( v o i d 0 = = = i ) r e t u r n ! 1 ; f o r ( c o n s t e o f i ) n u l l = = = ( s = ( n = e ) . _ $ A O ) | | v o i d 0 = = = s | | s . c a l l ( n , t , ! 1 ) , a b ( e , t ) ; r e t u r n ! 0 } , c b = e = > { l e t t , n ; d o { i f ( v o i d 0 = = = ( t = e . _ $ A M ) ) b r e a k ; n = t . _ $ A N , n . d e l e t e ( e ) , e = t } w h i l e ( 0 = = = ( n u l l = = n ? v o i d 0 : n . s i z e ) ) } , l b = e = > { f o r ( l e t t ; t = e . _ $ A M ; e = t ) { l e t n = t . _ $ A N ; i f ( v o i d 0 = = = n ) t . _ $ A N = n = n e w S e t ; e l s e i f ( n . h a s ( e ) ) b r e a k ; n . a d d ( e ) , h b ( t ) } } ; f u n c t i o n d b ( e ) { v o i d 0 ! = = t h i s . _ $ A N ? ( c b ( t h i s ) , t h i s . _ $ A M = e , l b ( t h i s ) ) : t h i s . _ $ A M = e } f u n c t i o n u b ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] & & a r g u m e n t s [ 1 ] , n = a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ? a r g u m e n t s [ 2 ] : 0 ; c o n s t s = t h i s . _ $ A H , i = t h i s . _ $ A N ; i f ( v o i d 0 ! = = i & & 0 ! = = i . s i z e ) i f ( t ) i f ( A r r a y . i s A r r a y ( s ) ) f o r ( l e t e = n ; e < s . l e n g t h ; e + + ) a b ( s [ e ] , ! 1 ) , c b ( s [ e ] ) ; e l s e n u l l ! = s & & ( a b ( s , ! 1 ) , c b ( s ) ) ; e l s e a b ( t h i s , e ) } c o n s t h b = e = > { v a r t , n , s , i ; e . t y p e = = i b & & ( n u l l ! = = ( t = ( s = e ) . _ $ A P ) & & v o i d 0 ! = = t | | ( s . _ $ A P = u b ) , n u l l ! = = ( n = ( i = e ) . _ $ A Q ) & & v o i d 0 ! = = n | | ( i . _ $ A Q = d b ) ) } ; c l a s s m b e x t e n d s o b { c o n s t r u c t o r ( ) { s u p e r ( . . . a r g u m e n t s ) , t h i s . _ $ A N = v o i d 0 } _ $ A T ( e , t , n ) { s u p e r . _ $ A T ( e , t , n ) , l b ( t h i s ) , t h i s . i s C o n n e c t e d = e . _ $ A U } _ $ A O ( e ) { l e t t = ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ) | | a r g u m e n t s [ 1 ] ; v a r n , s ; e ! = = t h i s . i s C o n n e c t e d & & ( t h i s . i s C o n n e c t e d = e , e ? n u l l = = = ( n = t h i s . r e c o n n e c t e d ) | | v o i d 0 = = = n | | n . c a l l ( t h i s ) : n u l l = = = ( s = t h i s . d i s c o n n e c t e d ) | | v o i d 0 = = = s | | s . c a l l ( t h i s ) ) , t & & ( a b ( t h i s , e ) , c b ( t h i s ) ) } s e t V a l u e ( e ) { i f ( ( e = > v o i d 0 = = = e . s t r i n g s ) ( t h i s . _ $ C t ) ) t h i s . _ $ C t . _ $ A I ( e , t h i s ) ; e l s e { c o n s t t = [ . . . t h i s . _ $ C t . _ $ A H ] ; t [ t h i s . _ $ C i ] = e , t h i s . _ $ C t . _ $ A I ( t , t h i s , 0 ) } } d i s c o n n e c t e d ( ) { } r e c o n n e c t e d ( ) { } } c l a s s g b { c o n s t r u c t o r ( e ) { t h i s . Y = e } d i s c o n n e c t ( ) { t h i s . Y = v o i d 0 } r e c o n n e c t ( e ) { t h i s . Y = e } d e r e f ( ) { r e t u r n t h i s . Y } } c l a s s f b { c o n s t r u c t o r ( ) { t h i s . Z = v o i d 0 , t h i s . q = v o i d 0 } g e t ( ) { r e t u r n t h i s . Z } p a u s e ( ) { v a r e ; n u l l ! = = ( e = t h i s . Z ) & & v o i d 0 ! = = e | | ( t h i s . Z = n e w P r o m i s e ( ( e = > t h i s . q = e ) ) ) } r e s u m e ( ) { v a r e ; n u l l = = = ( e = t h i s . q ) | | v o i d 0 = = = e | | e . c a l l ( t h i s ) , t h i s . Z = t h i s . q = v o i d 0 } } c o n s t p b = e = > ! ( e = > n u l l = = = e | | " o b j e c t " ! = t y p e o f e & & " f u n c t i o n " ! = t y p e o f e ) ( e ) & & " f u n c t i o n " = = t y p e o f e . t h e n ; c o n s t v b = r b ( c l a s s e x t e n d s m b { c o n s t r u c t o r ( ) { s u p e r ( . . . a r g u m e n t s ) , t h i s . _ $ C w t = 1 0 7 3 7 4 1 8 2 3 , t h i s . _ $ C y t = [ ] , t h i s . _ $ C K = n e w g b ( t h i s ) , t h i s . _ $ C X = n e w f b } r e n d e r ( ) { f o r ( v a r e , t = a r g u m e n t s . l e n g t h , n = n e w A r r a y ( t ) , s = 0 ; s < t ; s + + ) n [ s ] = a r g u m e n t s [ s ] ; r e t u r n n u l l ! = = ( e = n . f i n d ( ( e = > ! p b ( e ) ) ) ) & & v o i d 0 ! = = e ? e : W u } u p d a t e ( e , t ) { c o n s t n = t h i s . _ $ C y t ; l e t s = n . l e n g t h ; t h i s . _ $ C y t = t ; c o n s t i = t h i s . _ $ C K , r = t h i s . _ $ C X ; t h i s . i s C o n n e c t e d | | t h i s . d i s c o n n e c t e d ( ) ; f o r ( l e t e = 0 ; e < t . l e
2022-12-17 22:08:36 +01:00
< div class = "row" >
< div class = "col-auto" >
< converse - avatar
class = "avatar modal-avatar"
2023-01-07 22:34:35 +01:00
. data = $ { s ? . attributes }
nonce = $ { s ? . get ( "vcard_updated" ) }
2022-12-17 22:08:36 +01:00
height = "120" width = "120" > < / c o n v e r s e - a v a t a r >
< / d i v >
< div class = "col" >
< ul class = "occupant-details" >
< li >
2023-02-17 12:24:37 +01:00
$ { i ? Gu ` <div class="row"><strong> ${ Gy ( "Nickname" ) } :</strong></div><div class="row"> ${ i } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-02-17 12:24:37 +01:00
$ { n ? Gu ` <div class="row"><strong> ${ Gy ( "XMPP Address" ) } :</strong></div><div class="row"> ${ n } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-02-17 12:24:37 +01:00
$ { a ? Gu ` <div class="row"><strong> ${ Gy ( "Affiliation" ) } :</strong></div><div class="row"> ${ a } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-02-17 12:24:37 +01:00
$ { o ? Gu ` <div class="row"><strong> ${ Gy ( "Roles" ) } :</strong></div><div class="row"> ${ o } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-02-17 12:24:37 +01:00
$ { c ? Gu ` <div class="row"><strong> ${ Gy ( "Hats" ) } :</strong></div><div class="row"> ${ c } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
< li >
2023-02-17 12:24:37 +01:00
$ { r ? Gu ` <div class="row"><strong> ${ Gy ( "Occupant Id" ) } :</strong></div><div class="row"> ${ r } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< / l i >
2023-02-17 12:24:37 +01:00
$ { vb ( m , "" ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
` })(this)}getModalTitle(){return(this.model??this.message)?.getDisplayName()}addToContacts(){const e=(this.model??this.message).get("jid");e&&Ih.modal.show("converse-add-contact-modal",{model:new No({jid:e})})}});const bb=e=>Gu `
2022-12-17 22:08:36 +01:00
< li class = "list-group-item" data - nick = "${e.item.nick}" >
< ul class = "list-group" >
< li class = "list-group-item active" >
< div > < strong > JID : < / s t r o n g > $ { e . i t e m . j i d } < / d i v >
< / l i >
< li class = "list-group-item" >
< div > < strong > Nickname : < / s t r o n g > $ { e . i t e m . n i c k } < / d i v >
< / l i >
< li class = "list-group-item" >
2023-02-17 12:24:37 +01:00
< div > < strong > Role : < / s t r o n g > $ { e . i t e m . r o l e } $ { e . a s s i g n a b l e _ r o l e s . l e n g t h ? ( e = > G u `
2022-12-17 22:08:36 +01:00
< a href = "#" data - form = "role-form" class = "toggle-form right" color = "var(--subdued-color)" @ click = $ { e . toggleForm } >
< converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` ) ( e ) : " " } < / d i v >
2023-02-17 12:24:37 +01:00
$ { e . assignable _roles . length ? ( e => { const t = Gy ( "Change role" ) , n = Gy ( "New Role" ) , s = Gy ( "Reason" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< form class = "role-form hidden" @ submit = $ { e . assignRole } >
< div class = "form-group" >
< input type = "hidden" name = "jid" value = "${e.item.jid}" / >
< input type = "hidden" name = "nick" value = "${e.item.nick}" / >
< div class = "row" >
< div class = "col" >
< label > < strong > $ { n } : < / s t r o n g > < / l a b e l >
< select class = "custom-select select-role" name = "role" >
2023-02-17 12:24:37 +01:00
$ { e . assignable _roles . map ( ( t => Gu ` <option value=" ${ t } " ?selected= ${ t === e . item . role } > ${ t } </option> ` ) ) }
2022-12-17 22:08:36 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
< input type = "submit" class = "btn btn-primary" value = "${t}" / >
< / d i v >
< / f o r m >
` })(e):""}
< / l i >
< / u l >
< / l i >
2023-02-17 12:24:37 +01:00
` ,wb=e=>Gu `
2022-12-17 22:08:36 +01:00
< li class = "list-group-item" data - nick = "${e.item.nick}" >
< ul class = "list-group" >
< li class = "list-group-item active" >
< div > < strong > JID : < / s t r o n g > $ { e . i t e m . j i d } < / d i v >
< / l i >
< li class = "list-group-item" >
< div > < strong > Nickname : < / s t r o n g > $ { e . i t e m . n i c k } < / d i v >
< / l i >
< li class = "list-group-item" >
2023-02-17 12:24:37 +01:00
< div > < strong > Affiliation : < / s t r o n g > $ { e . i t e m . a f f i l i a t i o n } $ { e . a s s i g n a b l e _ a f f i l i a t i o n s . l e n g t h ? ( e = > G u `
2022-12-17 22:08:36 +01:00
< a href = "#" data - form = "affiliation-form" class = "toggle-form right" color = "var(--subdued-color)" @ click = $ { e . toggleForm } >
< converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` ) ( e ) : " " } < / d i v >
2023-02-17 12:24:37 +01:00
$ { e . assignable _affiliations . length ? ( e => { const t = Gy ( "Change affiliation" ) , n = Gy ( "New affiliation" ) , s = Gy ( "Reason" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< form class = "affiliation-form hidden" @ submit = $ { e . assignAffiliation } >
< div class = "form-group" >
< input type = "hidden" name = "jid" value = "${e.item.jid}" / >
< input type = "hidden" name = "nick" value = "${e.item.nick}" / >
< div class = "row" >
< div class = "col" >
< label > < strong > $ { n } : < / s t r o n g > < / l a b e l >
< select class = "custom-select select-affiliation" name = "affiliation" >
2023-02-17 12:24:37 +01:00
$ { e . assignable _affiliations . map ( ( t => Gu ` <option value=" ${ t } " ?selected= ${ t === e . item . affiliation } > ${ t } </option> ` ) ) }
2022-12-17 22:08:36 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
< input type = "submit" class = "btn btn-primary" name = "change" value = "${t}" / >
< / d i v >
< / f o r m >
` })(e):""}
< / l i >
< / u l >
< / l i >
2023-02-17 12:24:37 +01:00
` ,Sb=e=>{const t=Gy("Affiliation"),n=Gy("No users with that affiliation found."),s=Gy("No users with that role found."),i=Gy("Type here to filter the search results"),r=Gy("Role"),o=Gy("Show users"),a=Gy("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."),c=Gy("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."),l=e.queryable_roles.length&&e.queryable_affiliations.length;return Gu `
$ { e . alert _message ? Gu ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert _message } </div> ` : "" }
$ { l ? ( e => Gu `
2022-12-17 22:08:36 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" affiliations "===e.tab?" active ":" "}"
id = "affiliations-tab"
href = "#affiliations-tabpanel"
aria - controls = "affiliations-tabpanel"
role = "tab"
data - name = "affiliations"
@ click = $ { e . switchTab } > Affiliations < / a >
< / l i >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" roles "===e.tab?" active ":" "}"
id = "roles-tab"
href = "#roles-tabpanel"
aria - controls = "roles-tabpanel"
role = "tab"
data - name = "roles"
@ click = $ { e . switchTab } > Roles < / a >
< / l i >
< / u l >
` )(e):""}
< div class = "tab-content" >
2023-02-17 12:24:37 +01:00
$ { e . queryable _affiliations . length ? Gu `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane tab-pane--columns ${" affiliations "===e.tab?" active ":" "}" id = "affiliations-tabpanel" role = "tabpanel" aria - labelledby = "affiliations-tab" >
< form class = "converse-form query-affiliation" @ submit = $ { e . queryAffiliation } >
< p class = "helptext pb-3" > $ { c } < / p >
< div class = "form-group" >
< label for = "affiliation" >
< strong > $ { t } : < / s t r o n g >
< / l a b e l >
< div class = "row" >
< div class = "col" >
< select class = "custom-select select-affiliation" name = "affiliation" >
2023-02-17 12:24:37 +01:00
$ { e . queryable _affiliations . map ( ( t => ( e => Gu `
2022-12-17 22:08:36 +01:00
< option value = "${e.item||" "}"
? selected = $ { e . item === e . affiliation }
2023-02-17 12:24:37 +01:00
title = "${_b(e.item)}" > $ { e . item } < / o p t i o n >
2022-12-17 22:08:36 +01:00
` )(Object.assign({item:t},e))))}
< / s e l e c t >
< / d i v >
< div class = "col" >
< input type = "submit" class = "btn btn-primary" name = "users_with_affiliation" value = "${o}" / >
< / d i v >
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
2023-02-17 12:24:37 +01:00
$ { Array . isArray ( e . users _with _affiliation ) && e . users _with _affiliation . length > 5 ? Gu ` <input class="form-control" .value=" ${ e . affiliations _filter } " @keyup= ${ e . filterAffiliationResults } type="text" name="filter" placeholder=" ${ i } "/> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { _b ( e . affiliation ) ? Gu ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ _b ( e . affiliation ) } </p></div></div> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
2023-02-17 12:24:37 +01:00
$ { e . loading _users _with _affiliation ? Gu ` <li class="list-group-item"> ${ J _ ( ) } </li> ` : "" }
$ { Array . isArray ( e . users _with _affiliation ) && 0 === e . users _with _affiliation . length ? Gu ` <li class="list-group-item"> ${ n } </li> ` : "" }
2022-12-17 22:08:36 +01:00
2023-02-17 12:24:37 +01:00
$ { e . users _with _affiliation instanceof Error ? Gu ` <li class="list-group-item"> ${ e . users _with _affiliation . message } </li> ` : ( e . users _with _affiliation || [ ] ) . map ( ( t => ( t . nick || t . jid ) . match ( new RegExp ( e . affiliations _filter , "i" ) ) ? wb ( Object . assign ( { item : t } , e ) ) : "" ) ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / d i v >
< / d i v > ` : " " }
2023-02-17 12:24:37 +01:00
$ { e . queryable _roles . length ? Gu `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane tab-pane--columns ${" roles "===e.tab?" active ":" "}" id = "roles-tabpanel" role = "tabpanel" aria - labelledby = "roles-tab" >
< form class = "converse-form query-role" @ submit = $ { e . queryRole } >
< p class = "helptext pb-3" > $ { a } < / p >
< div class = "form-group" >
< label for = "role" > < strong > $ { r } : < / s t r o n g > < / l a b e l >
< div class = "row" >
< div class = "col" >
< select class = "custom-select select-role" name = "role" >
2023-02-17 12:24:37 +01:00
$ { e . queryable _roles . map ( ( t => ( e => Gu `
2022-12-17 22:08:36 +01:00
< option value = "${e.item||" "}"
? selected = $ { e . item === e . role }
2023-02-17 12:24:37 +01:00
title = "${yb(e.item)}" > $ { e . item } < / o p t i o n >
2022-12-17 22:08:36 +01:00
` )(Object.assign({item:t},e))))}
< / s e l e c t >
< / d i v >
< div class = "col" >
< input type = "submit" class = "btn btn-primary" name = "users_with_role" value = "${o}" / >
< / d i v >
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
2023-02-17 12:24:37 +01:00
$ { Array . isArray ( e . users _with _role ) && e . users _with _role . length > 5 ? Gu ` <input class="form-control" .value=" ${ e . roles _filter } " @keyup= ${ e . filterRoleResults } type="text" name="filter" placeholder=" ${ i } "/> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { yb ( e . role ) ? Gu ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ yb ( e . role ) } </p></div></div> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
2023-02-17 12:24:37 +01:00
$ { e . loading _users _with _role ? Gu ` <li class="list-group-item"> ${ J _ ( ) } </li> ` : "" }
$ { e . users _with _role && 0 === e . users _with _role . length ? Gu ` <li class="list-group-item"> ${ s } </li> ` : "" }
$ { ( e . users _with _role || [ ] ) . map ( ( t => t . nick . match ( e . roles _filter ) ? bb ( Object . assign ( { item : t } , e ) ) : "" ) ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / d i v >
< / d i v > ` : " " }
2023-02-17 12:24:37 +01:00
< / d i v > ` } , { S t r o p h e : x b , s i z z l e : E b , u : A b } = O h . e n v ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m o d t o o l s " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { a f f i l i a t i o n : { t y p e : S t r i n g } , a f f i l i a t i o n s _ f i l t e r : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ m e s s a g e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ t y p e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , j i d : { t y p e : S t r i n g } , m u c : { t y p e : O b j e c t , a t t r i b u t e : ! 1 } , r o l e : { t y p e : S t r i n g } , r o l e s _ f i l t e r : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , t a b : { t y p e : S t r i n g } , u s e r s _ w i t h _ a f f i l i a t i o n : { t y p e : A r r a y , a t t r i b u t e : ! 1 } , u s e r s _ w i t h _ r o l e : { t y p e : A r r a y , a t t r i b u t e : ! 1 } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . t a b = " a f f i l i a t i o n s " , t h i s . a f f i l i a t i o n = " " , t h i s . a f f i l i a t i o n s _ f i l t e r = " " , t h i s . r o l e = " " , t h i s . r o l e s _ f i l t e r = " " } u p d a t e d ( e ) { e . h a s ( " r o l e " ) & & t h i s . o n S e a r c h R o l e C h a n g e ( ) , e . h a s ( " a f f i l i a t i o n " ) & & t h i s . o n S e a r c h A f f i l i a t i o n C h a n g e ( ) , e . h a s ( " j i d " ) & & e . g e t ( " j i d " ) & & t h i s . i n i t i a l i z e ( ) } a s y n c i n i t i a l i z e ( ) { t h i s . i n i t i a l i z e d = e a ( ) ; c o n s t e = a w a i t I h . r o o m s . g e t ( t h i s . j i d ) ; a w a i t e . i n i t i a l i z e d , t h i s . m u c = e , t h i s . i n i t i a l i z e d . r e s o l v e ( ) } r e n d e r ( ) { i f ( t h i s . m u c ? . o c c u p a n t s ) { c o n s t e = t h i s . m u c . o c c u p a n t s . f i n d W h e r e ( { j i d : n d . b a r e _ j i d } ) ; r e t u r n S b ( { a f f i l i a t i o n s _ f i l t e r : t h i s . a f f i l i a t i o n s _ f i l t e r , a l e r t _ m e s s a g e : t h i s . a l e r t _ m e s s a g e , a l e r t _ t y p e : t h i s . a l e r t _ t y p e , a s s i g n A f f i l i a t i o n : e = > t h i s . a s s i g n A f f i l i a t i o n ( e ) , a s s i g n R o l e : e = > t h i s . a s s i g n R o l e ( e ) , a s s i g n a b l e _ a f f i l i a t i o n s : T g ( e ) , a s s i g n a b l e _ r o l e s : a f ( e ) , f i l t e r A f f i l i a t i o n R e s u l t s : e = > t h i s . f i l t e r A f f i l i a t i o n R e s u l t s ( e ) , f i l t e r R o l e R e s u l t s : e = > t h i s . f i l t e r R o l e R e s u l t s ( e ) , l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n : t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n , q u e r y A f f i l i a t i o n : e = > t h i s . q u e r y A f f i l i a t i o n ( e ) , q u e r y R o l e : e = > t h i s . q u e r y R o l e ( e ) , q u e r y a b l e _ a f f i l i a t i o n s : R g . f i l t e r ( ( e = > ! I h . s e t t i n g s . g e t ( " m o d t o o l s _ d i s a b l e _ q u e r y " ) . i n c l u d e s ( e ) ) ) , q u e r y a b l e _ r o l e s : M g . f i l t e r ( ( e = > ! I h . s e t t i n g s . g e t ( " m o d t o o l s _ d i s a b l e _ q u e r y " ) . i n c l u d e s ( e ) ) ) , r o l e s _ f i l t e r : t h i s . r o l e s _ f i l t e r , s w i t c h T a b : e = > t h i s . s w i t c h T a b ( e ) , t a b : t h i s . t a b , t o g g l e F o r m : e = > t h i s . t o g g l e F o r m ( e ) , u s e r s _ w i t h _ a f f i l i a t i o n : t h i s . u s e r s _ w i t h _ a f f i l i a t i o n , u s e r s _ w i t h _ r o l e : t h i s . u s e r s _ w i t h _ r o l e } ) } r e t u r n " " } s w i t c h T a b ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , t h i s . t a b = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - n a m e " ) , t h i s . r e q u e s t U p d a t e ( ) } a s y n c o n S e a r c h A f f i l i a t i o n C h a n g e ( ) { i f ( t h i s . a f f i l i a t i o n ) { i f ( a w a i t t h i s . i n i t i a l i z e d , t h i s . c l e a r A l e r t ( ) , t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n = ! 0 , t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = n u l l , t h i s . s h o u l d F e t c h A f f i l i a t i o n s L i s t ( ) ) { c o n s t e = a w a i t j g ( t h i s . a f f i l i a t i o n , t h i s . j i d ) ; e i n s t a n c e o f E r r o r ? ( t h i s . a l e r t ( e . m e s s a g e , " d a n g e r " ) , t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = [ ] ) : t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = e } e l s e t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = t h i s . m u c . g e t O c c u p a n t s W i t h A f f i l i a t i o n ( t h i s . a f f i l i a t i o n ) ; t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n = ! 1 } } a s y n c o n S e a r c h R o l e C h a n g e ( ) { t h i s . r o l e & & ( a w a i t t h i s . i n i t i a l i z e d , t h i s . c l e a r A l e r t ( ) , t h i s . u s e r s _ w i t h _ r o l e = t h i s . m u c . g e t O c c u p a n t s W i t h R o l e ( t h i s . r o l e ) ) } s h o u l d F e t c h A f f i l i a t i o n s L i s t ( ) { c o n s t e = t h i s . a f f i l i a t i o n ; i f ( " n o n e " = = = e ) r e t u r n ! 1 ; r e t u r n ! o f ( ) . i n c l u d e s ( e ) } t o g g l e F o r m ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = A b . a n c e s t o r ( e . t a r g e t , " . t o g g l e - f o r m " ) , n = t . g e t A t t r i b u t e ( " d a t a - f o r m " ) , s = A b . a n c e s t o r ( t , " . l i s t - g r o u p - i t e m " ) . q u e r y S e l e c t o r ( ` . $ { n } ` ) ; A b . h a s C l a s s ( " h i d d e n " , s ) ? A b . r e m o v e C l a s s ( " h i d d e n " , s ) : A b . a d d C l a s s ( " h i d d e n " , s ) } f i l t e r R o l e R e s u l t s ( e ) { t h i s . r o l e s _ f i l t e r = e . t a r g e t . v a l u e , t h i s . r e n d e r ( ) } f i l t e r A f f i l i a t i o n R e s u l t s ( e ) { t h i s . a f f i l i a t i o n s _ f i l t e r = e . t a r g e t . v a l u e } q u e r y R o l e ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " r o l e " ) ; t h i s . r o l e = n u l l , t h i s . r o l e = t } q u e r y A f f i l i a t i o n ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " a f f i l i a t i o n " ) ; t h i s . a f f i l i a t i o n = n u l l , t h i s . a f f i l i a t i o n = t } a l e r t ( e , t ) { t h i s . a l e r t _ m e s s a g e = e , t h i s . a l e r t _ t y p e = t } c l e a r A l e r t ( ) { t h i s . a l e r t _ m e s s a g e = v o i d 0 , t h i s . a l e r t _ t y p e = v o i d 0 } a s y n c a s s i g n A f f i l i a t i o n ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , t h i s . c l e a r A l e r t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) , n = t . g e t ( " a f f i l i a t i o n " ) , s = { j i d : t . g e t ( " j i d " ) , r e a s o n : t . g e t ( " r e a s o n " ) } , i = t h i s . a f f i l i a t i o n , r = t h i s . m u c . g e t ( " j i d " ) ; t r y { a w a i t I g ( n , r , [ s ] ) } c a t c h ( e ) { r e t u r n n u l l = = = e ? t h i s . a l e r t ( G y ( " T i m e o u t e r r o r w h i l e t r y i n g t o s e t t h e a f f i l i a t i o n " ) , " d a n g e r " ) : E b ( ` n o t - a l l o w e d [ x m l n s = " $ { x b . N S . S T A N Z A S } " ] ` , e ) . l e n g t h ? t h i s . a l e r t ( G y ( " S o r r y , y o u ' r e n o t a l l o w e d t o m a k e t h a t c h a n g e " ) , " d a n g e r " ) : t h i s . a l e r t ( G y ( " S o r r y , s o m e t h i n g w e n t w r o n g w h i l e t r y i n g t o s e t t h e a f f i l i a t i o n " ) , " d
$ { i == s . PASSWORD _REQUIRED ? Gu ` <converse-muc-password-form class="muc-form-container" jid=" ${ n } "></converse-muc-password-form> ` : "" }
$ { i == s . ENTERED ? Gu ` <converse-muc-chatarea jid=" ${ n } "></converse-muc-chatarea> ` : "" }
$ { i == s . CONNECTING ? J _ ( ) : "" }
$ { i == s . NICKNAME _REQUIRED ? function ( e ) { const t = e . get ( "jid" ) ; return Ih . settings . get ( "muc_show_logs_before_join" ) ? Gu ` <converse-muc-chatarea jid=" ${ t } "></converse-muc-chatarea> ` : Gu ` <converse-muc-nickname-form jid=" ${ t } "></converse-muc-nickname-form> ` } ( e . model ) : "" }
$ { i == s . DISCONNECTED ? Gu ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . BANNED ? Gu ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . DESTROYED ? Gu ` <converse-muc-destroyed jid=" ${ n } "></converse-muc-destroyed> ` : "" }
` }function Ib(e,t){t=t.trim();const n=document.createElement("li");if(n.setAttribute("aria-selected","false"),Ih.settings.get("muc_mention_autocomplete_show_avatar")){const t=document.createElement("img");let s="data:"+nd.DEFAULT_IMAGE_TYPE+";base64,"+nd.DEFAULT_IMAGE;if(nd.vcards){const t=nd.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 Ob(){const e=[...await Ih.rooms.get(),...await Ih.contacts.get()],t=[...new Set(e.map((e=>Cb.getDomainFromJid(e.get("jid")))))];return t}function Mb(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const r=jb[t];if(!r)throw Error( ` ChatRoomView # setRole called with invalid command : $ { 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 Rb(e,t,n,s){const i=kb[t];if(!i)throw Error( ` verifyAffiliations called with invalid command : $ { 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(! $ b.isValidJID(r)){const t=Gy("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&&Ih.settings.get("auto_register_muc_nickname")&&(l.nick=c.get("nick")),Ig(i,e.get("jid"),[l]).then((()=>e.occupants.fetchMembers())).catch((t=>e.onCommandError(t)))}function Db(e,t){if(!e.verifyRoles(["moderator"]))return;let n=Ih.modal.get("converse-modtools-modal");n?(n.affiliation=t,n.render()):n=Ih.modal.create("converse-modtools-modal",{affiliation:t,jid:e.get("jid")}),n.show()}function zb(e,t){const n=e.model;if(t||n.get("type")!==nd.CHATROOMS_TYPE||Ih.settings.get("muc_disable_slash_commands")&&!Array.isArray(Ih.settings.get("muc_disable_slash_commands")))return t;let s=e.text;s=s.replace(/^ \s */,"");const i=(s.match(/^ \/ ([a-zA-Z]*) ?/)||[""]).pop().toLowerCase();if(!i)return!1;const r=s.slice(("/"+i).length+1).trim(),o=n.getAllowedCommands()??[];if("admin"===i&&o.includes(i))return Rb(n,i,r,["owner"]),!0;if("ban"===i&&o.includes(i))return Rb(n,i,r,["admin","owner"]),!0;if("modtools"===i&&o.includes(i))return Db(n,r),!0;if("deop"===i&&o.includes(i))return Mb(n,i,r,["admin","owner"]),!0;if("destroy"===i&&o.includes(i))return!n.verifyAffiliations(["owner"])||(Tb(n).catch((e=>n.onCommandError(e))),!0);if("help"===i&&o.includes(i))return n.set({show_help_messages:!1},{silent:!0}),n.set({show_help_messages:!0}),!0;if("kick"===i&&o.includes(i))return Mb(n,i,r,[],["moderator"]),!0;if("mute"===i&&o.includes(i))return Mb(n,i,r,[],["moderator"]),!0;if("member"===i&&o.includes(i))return Rb(n,i,r,["admin","owner"]),!0;if("nick"===i&&o.includes(i)){if(!n.verifyRoles(["visitor","participant","moderator"]))return!0;if(0===r.length){const e=Gy('Your nickname is "%1 $ s"',n.get("nick"));n.createMessage({message:e,type:"error"})}else n.setNickname(r);return!0}return"owner"===i&&o.includes(i)?(Rb(n,i,r,["owner"]),!0):"op"===i&&o.includes(i)?(Mb(n,i,r,["admin","owner"]),!0):"register"===i&&o.includes(i)?(r.length>1?n.createMessage({message:Gy("Error: invalid number of arguments"),type:"error"}):n.registerNickname().then((e=>{e&&n.createMessage({message:e,type:"error"})})),!0):"revoke"===i&&o.includes(i)?(Rb(n,i,r,["admin","owner"]),!0):"topic"===i&&o.includes(i)||"subject"===i&&o.includes(i)?(n.setSubject(r),!0):!("voice"!==i||!o.inclu
$ { e . alert ? Gu ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert } </div> ` : "" }
$ { e . note ? Gu ` <p class="form-help"> ${ e . note } </p> ` : "" }
2022-12-17 22:08:36 +01:00
< form class = "converse-form" @ submit = $ { e . fetchCommands } >
< fieldset class = "form-group" >
< label >
2023-02-17 12:24:37 +01:00
$ { t }
< p class = "form-help" > $ { n } < / p >
2022-12-17 22:08:36 +01:00
< converse - autocomplete
2023-02-17 12:24:37 +01:00
. getAutoCompleteList = "${Ob}"
required
placeholder = "${r}"
2022-12-17 22:08:36 +01:00
name = "jid" >
< / c o n v e r s e - a u t o c o m p l e t e >
< / l a b e l >
< / f i e l d s e t >
< fieldset class = "form-group" >
2023-02-17 12:24:37 +01:00
$ { e . fetching ? J _ ( ) : Gu ` <input type="submit" class="btn btn-primary" value=" ${ i } "> ` }
2022-12-17 22:08:36 +01:00
< / f i e l d s e t >
2023-02-17 12:24:37 +01:00
$ { "list-commands" === e . view ? Gu `
2022-12-17 22:08:36 +01:00
< fieldset class = "form-group" >
< ul class = "list-group" >
2023-02-17 12:24:37 +01:00
< li class = "list-group-item active" > $ { e . commands . length ? s : o } : < / l i >
$ { e . commands . map ( ( t => V _ ( e , t ) ) ) }
2022-12-17 22:08:36 +01:00
< / u l >
< / f i e l d s e t > ` : " " }
< / f o r m >
2023-02-17 12:24:37 +01:00
` },Pb=(e,t)=>Gu ` < audio controls src = "${e}" > < / a u d i o > $ { t ? " " : G u ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , F b = ( e , t ) = > { c o n s t n = G y ( ' D o w n l o a d f i l e " % 1 $ s " ' , t ) ; r e t u r n G u ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { n } < / a > ` } , U b = e = > G u `
< fieldset class = "form-group" >
$ { e . label ? Gu ` <label> ${ e . label } </label> ` : "" }
< img src = "data:${e.type};base64,${e.data}" >
< input name = "${e.name}" type = "text" ? required = "${e.required}" / >
< / f i e l d s e t >
` ,Bb=e=>Gu `
< fieldset class = "form-group" >
< input id = "${e.id}" name = "${e.name}" type = "checkbox" ? checked = $ { e . checked } ? required = $ { e . required } / >
< label class = "form-check-label" for = "${e.id}" > $ { e . label } < / l a b e l >
< / f i e l d s e t > ` , q b = e = > G u ` < p c l a s s = " f o r m - h e l p " > $ { e . t e x t } < / p > ` , H b = e = > G u `
< div class = "form-group" >
$ { "hidden" !== e . type ? Gu ` <label for=" ${ e . id } "> ${ e . label } </label> ` : "" }
<!-- This is a hack to prevent Chrome from auto - filling the username in
any of the other input fields in the MUC configuration form . -- >
$ { "password" === e . type && e . fixed _username ? Gu `
< input class = "hidden-username" type = "text" autocomplete = "username" value = "${e.fixed_username}" > < / i n p u t >
` :""}
< input
autocomplete = "${e.autocomplete||" "}"
class = "form-control"
id = "${e.id}"
name = "${e.name}"
placeholder = "${e.placeholder||" "}"
type = "${e.type}"
value = "${e.value||" "}"
? required = $ { e . required } / >
< / d i v > ` , G b = e = > G u `
< div class = "form-group" >
< label for = "${e.id}" > $ { e . label } < / l a b e l >
< select class = "form-control" id = "${e.id}" name = "${e.name}" ? multiple = "${e.multiple}" >
$ { e . options ? . map ( ( e => ( e => Gu ` <option value=" ${ e . value } " ?selected=" ${ e . selected } "> ${ e . label } </option> ` ) ( e ) ) ) }
< / s e l e c t >
< / d i v > ` , W b = e = > { c o n s t t = k l . g e t U n i q u e I d ( ) ; r e t u r n G u `
< div class = "form-group" >
< label class = "label-ta" for = "${t}" > $ { e . label } < / l a b e l >
< textarea name = "${e.name}" id = "${t}" class = "form-control" > $ { e . value } < / t e x t a r e a >
< / d i v >
` },Vb=e=>Gu `
< label > $ { e . label }
< a class = "form-url" target = "_blank" rel = "noopener" href = "${e.value}" > $ { e . value } < / a >
< / l a b e l > ` , J b = e = > G u `
< div class = "form-group" >
$ { e . label ? Gu ` <label> ${ e . label } </label> ` : "" }
< div class = "input-group" >
< input name = "${e.name}"
class = "form-control"
type = "${e.type}"
value = "${e.value||" "}"
? required = "${e.required}" / >
< div class = "input-group-append" >
< div class = "input-group-text" title = "${e.domain}" > $ { e . domain } < / d i v >
< / d i v >
< / d i v >
< /div>`;function Zb(e){e.preventDefault(),Ih.rooms.open(e.target.href)}const Qb=(e,t)=>{let n=e.normalizePath().toString();return e._parts.protocol||t.startsWith("http:/ / ")||t.startsWith(" https : //")||(n="http://"+n),"xmpp"===e._parts.protocol&&"join"===e._parts.query?Gu`
< a target = "_blank"
rel = "noopener"
@ click = $ { Zb }
href = "${n}" > $ { t } < / a > ` : G u ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { n } " > $ { t } < / a > ` } , Y b = ( e , t ) = > G u ` < v i d e o c o n t r o l s p r e l o a d = " m e t a d a t a " s r c = " $ { e } " > < / v i d e o > $ { t ? " " : G u ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , { s i z z l e : K b , S t r o p h e : X b } = O h . e n v , e w = [ " h t t p " , " h t t p s " , " x m p p " , " m a i l t o " ] ; f u n c t i o n t w ( e , t ) { r e t u r n { " m u c # r o o m c o n f i g _ l a n g " : " l a n g u a g e " , " m u c # r o o m c o n f i g _ r o o m s e c r e t " : t ? . n e w _ p a s s w o r d ? " n e w - p a s s w o r d " : " c u r r e n t - p a s s w o r d " } [ e ] } c o n s t n w = { " t e x t - p r i v a t e " : " p a s s w o r d " , " t e x t - s i n g l e " : " t e x t " , f i x e d : " l a b e l " , b o o l e a n : " c h e c k b o x " , h i d d e n : " h i d d e n " , " j i d - m u l t i " : " t e x t a r e a " , " l i s t - s i n g l e " : " d r o p d o w n " , " l i s t - m u l t i " : " d r o p d o w n " } , s w = { " x s : a n y U R I " : " u r l " , " x s : b y t e " : " n u m b e r " , " x s : d a t e " : " d a t e " , " x s : d a t e T i m e " : " d a t e t i m e " , " x s : i n t " : " n u m b e r " , " x s : i n t e g e r " : " n u m b e r " , " x s : t i m e " : " t i m e " } , i w = / \ s * \ n \ s * / ; f u n c t i o n r w ( e ) { l e t t ; e = e . t r e e ? . ( ) ? ? e ; c o n s t n = [ ] , s = d o c u m e n t . c r e a t e T r e e W a l k e r ( e , N o d e F i l t e r . S H O W _ T E X T , ( e = > " b o d y " = = = e . p a r e n t E l e m e n t . n o d e N a m e . t o L o w e r C a s e ( ) ? N o d e F i l t e r . F I L T E R _ R E J E C T : N o d e F i l t e r . F I L T E R _ A C C E P T ) ) ; f o r ( ; t = s . n e x t N o d e ( ) ; ) n . p u s h ( t ) ; r e t u r n n . f o r E a c h ( ( e = > i w . t e s t ( e . d a t a ) & & e . p a r e n t E l e m e n t . r e m o v e C h i l d ( e ) ) ) , e } c o n s t o w = n e w X M L S e r i a l i z e r ; f u n c t i o n a w ( e ) { c o n s t t = e . g e t A t t r i b u t e ( " n a m e " ) ; i f ( ! t ) r e t u r n n u l l ; l e t n ; r e t u r n n = " c h e c k b o x " = = = e . g e t A t t r i b u t e ( " t y p e " ) ? e . c h e c k e d ? 1 : 0 : " T E X T A R E A " = = e . t a g N a m e ? e . v a l u e . s p l i t ( " \ n " ) . f i l t e r ( ( e = > e . t r i m ( ) ) ) : " S E L E C T " = = e . t a g N a m e ? k l . g e t S e l e c t V a l u e s ( e ) : e . v a l u e , { n a m e : t , v a l u e : n } } f u n c t i o n c w ( e ) { c o n s t t = n w [ e . g e t A t t r i b u t e ( " t y p e " ) ] ; i f ( " t e x t " = = t ) { c o n s t n = e . g e t E l e m e n t s B y T a g N a m e N S ( " h t t p : / / j a b b e r . o r g / p r o t o c o l / x d a t a - v a l i d a t e " , " v a l i d a t e " ) ; i f ( 1 = = = n . l e n g t h ) { c o n s t e = n [ 0 ] . g e t A t t r i b u t e ( " d a t a t y p e " ) ; r e t u r n s w [ e ] | | t } } r e t u r n t } f u n c t i o n l w ( e ) { c o n s t t = J h ( e ) ; t r y { r e t u r n d e c o d e U R I ( t . f i l e n a m e ( ) ) } c a t c h ( e ) { r e t u r n I l . d e b u g ( e ) , t . f i l e n a m e ( ) } } f u n c t i o n d w ( e ) { c o n s t t = J h ( e ) ; r e t u r n n u l l = = = t ? e : i m ( t ) ? Y b ( e ) : s m ( t ) ? P b ( e ) : ( r m ( t ) , F b ( t . t o S t r i n g ( ) , l w ( t ) ) ) } f u n c t i o n u w ( e , t ) { l e t n = e ; f o r ( ; n u l l ! = = n & & ! K b . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p a r e n t E l e m e n t ; r e t u r n n } f u n c t i o n h w ( e ) { c o n s t t = R e g E x p ( " ^ w { 3 } . " , " i g " ) . t e s t ( e ) ? ` h t t p : / / $ { e } ` : e , n = J h ( e ) ; r e t u r n n u l l = = = n | | ! f u n c t i o n ( e ) { t r y { r e t u r n ! ! n e w U R L ( e ) } c a t c h ( e ) { r e t u r n ! 1 } } ( t ) | | ! f u n c t i o n ( e ) { r e t u r n ! ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : e w ) . i n c l u d e s ( e ) } ( n . _ p a r t s . p r o t o c o l ) & & n . _ p a r t s . p r o t o c o l ? e : Q b ( n , e ) } f u n c t i o n m w ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : 2 0 0 ; r e t u r n n e w P r o m i s e ( ( ( n , s ) = > { i f ( ! e ) { c o n s t e = " A n e l e m e n t n e e d s t o b e p a s s e d i n t o s l i d e O u t " ; r e t u r n I l . w a r n ( e ) , v o i d s ( n e w E r r o r ( e ) ) } c o n s t i = e . g e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) ; i & & ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , w i n d o w . c a n c e l A n i m a t i o n F r a m e ( i ) ) ; c o n s t r = k l . c a l c u l a t e E l e m e n t H e i g h t ( e ) ; i f ( w i n d o w . c o n v e r s e _ d i s a b l e _ e f f e c t s ) r e t u r n e . s t y l e . h e i g h t = r + " p x " , f u n c t i o n ( e ) { e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , e . c l a s s L i s t . r e m o v e ( " c o l l a p s e d " ) , e . s t y l e . o v e r f l o w = " " , e . s t y l e . h e i g h t = " " } ( e ) , v o i d n ( ) ; i f ( ! k l . h a s C l a s s ( " c o l l a p s e d " , e ) & & ! k l . h a s C l a s s ( " h i d d e n " , e ) ) r e t u r n v o i d n ( ) ; c o n s t o = t / 1 7 ; l e t a = 0 ; e . s t y l e . h e i g h t = " 0 " , e . s t y l e . o v e r f l o w = " h i d d e n " , e . c l a s s L i s t . r e m o v e ( " h i d d e n " ) , e . c l a s s L i s t . r e m o v e ( " c o l l a p s e d " ) , e . s e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " , w i n d o w . r e q u e s t A n i m a t i o n F r a m e ( ( f u n c t i o n t ( ) { a + = r / o , a < r ? ( e . s t y l e . h e i g h t = a + " p x " , e . s e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " , w i n d o w . r e q u e s t A n i m a t i o n F r a m e ( t ) ) ) : ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , e . s t y l e . h e i g h t = k l . c a l c u l a t e E l e m e n t H e i g h t ( e ) + " p x " , e . s t y l e . o v e r f l o w = " " , e . s t y l e . h e i g h t = " " , n ( ) ) } ) ) ) } ) ) } f u n c t i o n g w ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : 2 0 0 ; r e t u r n n e w P r o m i s e ( ( ( n , s ) = > { i f ( ! e ) { c o n s t e = " A n e l e m e n t n e e d s t o b e p a s s e d i n t o s l i d e I n " ; r e t u r n I l . w a r n ( e ) , s ( n e w E r r o r ( e ) ) } i f ( k l . h a s C l a s s ( " c o l l a p s e d " , e ) ) r e t u r n n ( e ) ; i f ( w i n d o w . c o n v e r s e _ d i s a b l e _ e f f e c t s ) r e t u r n e . c l a s s L i s t . a d d ( " c o l l a p s e d " ) , e . s t y l e . h e i g h t = " " , n ( e ) ; c o n s t i = e . g e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) ; i & & ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , w i n d o w . c a n c e l A n i m a t i o n F r a m e ( i ) ) ; c o n s t r = e . o f f s e t H e i g h t , o = t / 1 7 ; l e t a = r ; e . s t y l e . o v e r f l o w = " h i d d e n " , e . s e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " , w i n d o w . r e q u e s t A n i m a t i o n F r a m e ( ( f u n c t i o n t ( ) { a - = r / o , a > 0 ? ( e . s t y l e . h e i g h t = a + " p x " , e . s e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " , w i n d o w . r e q u e s t A n i m a t i o n F r a m e ( t ) ) ) : ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , e . c l a s s L i s t . a d d ( " c o l l a p s e d " ) , e . s t y l e . h e i g h t = " " , n ( e ) ) } ) ) ) } ) ) } f u
2022-12-17 22:08:36 +01:00
< div class = "list-item room-item available-chatroom d-flex flex-row" data - room - jid = "${t}" >
< a class = "list-item-link open-room w-100" data - room - jid = "${t}"
title = "${s}"
2023-02-17 12:24:37 +01:00
@ click = $ { Ew } > $ { e . getDisplayName ( ) } < / a >
2022-12-17 22:08:36 +01:00
< a class = "list-item-action remove-bookmark align-self-center ${e.get(" bookmarked ")?" button - on ":" "}"
data - room - jid = "${t}"
data - bookmark - name = "${e.getDisplayName()}"
title = "${n}"
2023-02-17 12:24:37 +01:00
@ click = $ { Sw } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-bookmark" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
< / d i v >
2023-02-17 12:24:37 +01:00
` };var Cw=n(5251), $ w={}; $ w.styleTagTransform=o_(), $ w.setAttributes=n_(), $ w.insert=e_().bind(null,"head"), $ w.domAPI=Ky(), $ w.insertStyleElement=i_();Qy()(Cw.Z, $ w);Cw.Z&&Cw.Z.locals&&Cw.Z.locals;class kw extends Vy{async initialize(){await Ih.waitUntil("bookmarksInitialized");const{bookmarks:e,chatboxes:t}=nd;this.liveFilter=vh((e=>this.model.set({filter_text:e.target.value})),100),this.listenTo(e,"add",(()=>this.requestUpdate())),this.listenTo(e,"remove",(()=>this.requestUpdate())),this.listenTo(t,"add",(()=>this.requestUpdate())),this.listenTo(t,"remove",(()=>this.requestUpdate()));const n= ` converse . bookmarks - list - model - $ { nd . bare _jid } ` ;this.model=new No({id:n}),Xc(this.model,n),this.listenTo(this.model,"change",(()=>this.requestUpdate())),this.model.fetch({success:()=>this.requestUpdate(),error:()=>this.requestUpdate()})}render(){return nd.bookmarks&&this.model?(e=>{const t=Gy("Filter"),n=e.model.get("filter_text"),{bookmarks:s}=nd,i=n?s.filter((e=>((e,t)=>e.get("name")?.includes(t)||e.get("jid")?.includes(t))(e,n))):s;return Gu `
2022-12-17 22:08:36 +01:00
< form class = "converse-form bookmarks-filter" >
< div class = "btn-group w-100" >
< input
. value = $ { n ? ? "" }
@ keydown = "${t=>e.liveFilter(t)}"
class = "form-control"
placeholder = "${t}" / >
< converse - icon size = "1em" class = "fa fa-times clear-input ${n?" ":" hidden "}"
@ click = $ { e . clearFilter } >
< / c o n v e r s e - i c o n >
< / d i v >
< / f o r m >
< div class = "list-container list-container--bookmarks" >
< div class = "items-list bookmarks rooms-list" >
2023-02-17 12:24:37 +01:00
$ { i . map ( ( e => Aw ( e ) ) ) }
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
` })(this):J_()}clearFilter(e){e?.stopPropagation?.(),this.model.set("filter_text","")}}Ih.elements.define("converse-bookmarks",kw);Ih.elements.define("converse-bookmark-list-modal",class extends $ _{renderModal(){return Gu ` < converse - bookmarks > < / c o n v e r s e - b o o k m a r k s > ` } g e t M o d a l T i t l e ( ) { r e t u r n G y ( " B o o k m a r k s " ) } } ) ; c l a s s j w e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } w i l l U p d a t e ( e ) { e . h a s ( " j i d " ) & & ( t h i s . m o d e l = n d . c h a t b o x e s . g e t ( t h i s . j i d ) , t h i s . b o o k m a r k = n d . b o o k m a r k s . g e t ( t h i s . j i d ) ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = e . m o d e l . g e t D i s p l a y N a m e ( ) , n = e . b o o k m a r k ? . g e t ( " n i c k " ) ? ? e . m o d e l . g e t ( " n i c k " ) , s = G y ( ' B o o k m a r k f o r " % 1 $ s " ' , t ) , i = G y ( " W o u l d y o u l i k e t h i s g r o u p c h a t t o b e a u t o m a t i c a l l y j o i n e d u p o n s t a r t u p ? " ) , r = G y ( " R e m o v e " ) , o = G y ( " T h e n a m e f o r t h i s b o o k m a r k : " ) , a = G y ( " W h a t s h o u l d y o u r n i c k n a m e f o r t h i s g r o u p c h a t b e ? " ) , c = e . b o o k m a r k ? G y ( " U p d a t e " ) : G y ( " S a v e " ) ; r e t u r n G u `
< form class = "converse-form chatroom-form" @ submit = $ { t => e . onBookmarkFormSubmitted ( t ) } >
2023-01-07 22:34:35 +01:00
< legend > $ { s } < / l e g e n d >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "converse_muc_bookmark_name" > $ { o } < / l a b e l >
< input class = "form-control" type = "text" value = "${t}" name = "name" required = "required" id = "converse_muc_bookmark_name" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "converse_muc_bookmark_nick" > $ { a } < / l a b e l >
< input class = "form-control" type = "text" name = "nick" value = "${n||" "}" id = "converse_muc_bookmark_nick" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group form-check" >
< input class = "form-check-input" id = "converse_muc_bookmark_autojoin" type = "checkbox" name = "autojoin" / >
2023-01-07 22:34:35 +01:00
< label class = "form-check-label" for = "converse_muc_bookmark_autojoin" > $ { i } < / l a b e l >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< input class = "btn btn-primary" type = "submit" value = "${c}" >
2023-02-17 12:24:37 +01:00
$ { e . bookmark ? Gu ` <input class="btn btn-secondary button-remove" type="button" value=" ${ r } " @click= ${ t => e . removeBookmark ( t ) } > ` : "" }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< / f o r m >
2023-02-17 12:24:37 +01:00
` })(this)}onBookmarkFormSubmitted(e){e.preventDefault(),nd.bookmarks.createBookmark({jid:this.model.get("jid"),autojoin:e.target.querySelector('input[name="autojoin"]')?.checked||!1,name:e.target.querySelector("input[name=name]")?.value,nick:e.target.querySelector("input[name=nick]")?.value}),this.closeBookmarkForm(e)}removeBookmark(e){this.bookmark?.destroy(),this.closeBookmarkForm(e)}closeBookmarkForm(e){e.preventDefault();const t=document.createEvent("Event");t.initEvent("hide.bs.modal",!0,!0),this.dispatchEvent(t)}}Ih.elements.define("converse-muc-bookmark-form",jw);const Tw=jw;Ih.elements.define("converse-bookmark-form-modal",class extends $ _{renderModal(){return Gu `
2022-12-17 22:08:36 +01:00
< converse - muc - bookmark - form class = "muc-form-container" jid = "${this.jid}" >
2023-02-17 12:24:37 +01:00
< / c o n v e r s e - m u c - b o o k m a r k - f o r m > ` } g e t M o d a l T i t l e ( ) { r e t u r n G y ( " B o o k m a r k " ) } } ) ; c o n s t { u : N w } = O h . e n v , I w = { s e t B o o k m a r k S t a t e ( ) { i f ( v o i d 0 ! = = n d . b o o k m a r k s ) { n d . b o o k m a r k s . w h e r e ( { j i d : t h i s . m o d e l . g e t ( " j i d " ) } ) . l e n g t h ? t h i s . m o d e l . s a v e ( " b o o k m a r k e d " , ! 0 ) : t h i s . m o d e l . s a v e ( " b o o k m a r k e d " , ! 1 ) } } , r e n d e r B o o k m a r k F o r m ( ) { i f ( ! t h i s . b o o k m a r k _ f o r m ) { t h i s . b o o k m a r k _ f o r m = n e w n d . M U C B o o k m a r k F o r m ( { m o d e l : t h i s . m o d e l , c h a t r o o m v i e w : t h i s } ) ; t h i s . q u e r y S e l e c t o r ( " . c h a t r o o m - b o d y " ) . i n s e r t A d j a c e n t E l e m e n t ( " b e f o r e e n d " , t h i s . b o o k m a r k _ f o r m . e l ) } N w . s h o w E l e m e n t ( t h i s . b o o k m a r k _ f o r m . e l ) } , s h o w B o o k m a r k M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . m o d e l . g e t ( " j i d " ) ; I h . m o d a l . s h o w ( " c o n v e r s e - b o o k m a r k - f o r m - m o d a l " , { j i d : t } , e ) } } ; O h . p l u g i n s . a d d ( " c o n v e r s e - b o o k m a r k - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - c h a t b o x e s " , " c o n v e r s e - m u c " , " c o n v e r s e - m u c - v i e w s " ] , i n i t i a l i z e ( ) { I h . s e t t i n g s . e x t e n d ( { h i d e _ o p e n _ b o o k m a r k s : ! 0 } ) , n d . r e m o v e B o o k m a r k V i a E v e n t = S w , n d . a d d B o o k m a r k V i a E v e n t = x w , O b j e c t . a s s i g n ( n d . C h a t R o o m V i e w . p r o t o t y p e , I w ) , n d . M U C B o o k m a r k F o r m = T w , n d . B o o k m a r k s V i e w = k w , I h . l i s t e n . o n ( " g e t H e a d i n g B u t t o n s " , w w ) , I h . l i s t e n . o n ( " c h a t R o o m V i e w I n i t i a l i z e d " , ( e = > e . s e t B o o k m a r k S t a t e ( ) ) ) } } ) ; c o n s t O w = ( e , t , n ) = > { c o n s t s = n e w M a p ; f o r ( l e t i = t ; i < = n ; i + + ) s . s e t ( e [ i ] , i ) ; r e t u r n s } , M w = r b ( c l a s s e x t e n d s o b { c o n s t r u c t o r ( e ) { i f ( s u p e r ( e ) , e . t y p e ! = = i b ) t h r o w E r r o r ( " r e p e a t ( ) c a n o n l y b e u s e d i n t e x t e x p r e s s i o n s " ) } h t ( e , t , n ) { l e t s ; v o i d 0 = = = n ? n = t : v o i d 0 ! = = t & & ( s = t ) ; c o n s t i = [ ] , r = [ ] ; l e t o = 0 ; f o r ( c o n s t t o f e ) i [ o ] = s ? s ( t , o ) : o , r [ o ] = n ( t , o ) , o + + ; r e t u r n { v a l u e s : r , k e y s : i } } r e n d e r ( e , t , n ) { r e t u r n t h i s . h t ( e , t , n ) . v a l u e s } u p d a t e ( e , t ) { l e t [ n , s , i ] = t ; v a r r ; c o n s t o = ( e = > e . _ $ A H ) ( e ) , { v a l u e s : a , k e y s : c } = t h i s . h t ( n , s , i ) ; i f ( ! A r r a y . i s A r r a y ( o ) ) r e t u r n t h i s . u t = c , a ; c o n s t l = n u l l ! = = ( r = t h i s . u t ) & & v o i d 0 ! = = r ? r : t h i s . u t = [ ] , d = [ ] ; l e t u , h , m = 0 , g = o . l e n g t h - 1 , f = 0 , p = a . l e n g t h - 1 ; f o r ( ; m < = g & & f < = p ; ) i f ( n u l l = = = o [ m ] ) m + + ; e l s e i f ( n u l l = = = o [ g ] ) g - - ; e l s e i f ( l [ m ] = = = c [ f ] ) d [ f ] = t b ( o [ m ] , a [ f ] ) , m + + , f + + ; e l s e i f ( l [ g ] = = = c [ p ] ) d [ p ] = t b ( o [ g ] , a [ p ] ) , g - - , p - - ; e l s e i f ( l [ m ] = = = c [ p ] ) d [ p ] = t b ( o [ m ] , a [ p ] ) , e b ( e , d [ p + 1 ] , o [ m ] ) , m + + , p - - ; e l s e i f ( l [ g ] = = = c [ f ] ) d [ f ] = t b ( o [ g ] , a [ f ] ) , e b ( e , o [ m ] , o [ g ] ) , g - - , f + + ; e l s e i f ( v o i d 0 = = = u & & ( u = O w ( c , f , p ) , h = O w ( l , m , g ) ) , u . h a s ( l [ m ] ) ) i f ( u . h a s ( l [ g ] ) ) { c o n s t t = h . g e t ( c [ f ] ) , n = v o i d 0 ! = = t ? o [ t ] : n u l l ; i f ( n u l l = = = n ) { c o n s t t = e b ( e , o [ m ] ) ; t b ( t , a [ f ] ) , d [ f ] = t } e l s e d [ f ] = t b ( n , a [ f ] ) , e b ( e , o [ m ] , n ) , o [ t ] = n u l l ; f + + } e l s e s b ( o [ g ] ) , g - - ; e l s e s b ( o [ m ] ) , m + + ; f o r ( ; f < = p ; ) { c o n s t t = e b ( e , d [ p + 1 ] ) ; t b ( t , a [ f ] ) , d [ f + + ] = t } f o r ( ; m < = g ; ) { c o n s t e = o [ m + + ] ; n u l l ! = = e & & s b ( e ) } r e t u r n t h i s . u t = c , f u n c t i o n ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : n b ; e . _ $ A H = t } ( e , d ) , W u } } ) ; f u n c t i o n R w ( e ) { c o n s t { C O N T R O L B O X _ T Y P E : t } = n d , n = " o v e r l a y e d " = = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & e . g e t ( " m i n i m i z e d " ) ; r e t u r n e . g e t ( " t y p e " ) = = = t | | ! ( e . g e t ( " h i d d e n " ) | | n ) } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t s " , c l a s s e x t e n d s V y { i n i t i a l i z e ( ) { t h i s . m o d e l = n d . c h a t b o x e s , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : c l o s e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : j i d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : m i n i m i z e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " d e s t r o y " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d , " c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d , " r e c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d , " d i s c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) ; c o n s t e = s l ( ) ; t h i s . l i s t e n T o ( e , " c h a n g e : v i e w _ m o d e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( e , " c h a n g e : s i n g l e t o n " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) ; c o n s t t = d o c u m e n t . g e t E l e m e n t B y I d ( " c o n v e r s e j s - b g " ) ; t & & ! t . i n n e r H T M L . t r i m ( ) & & l h ( G u `
2021-11-11 22:06:49 +01:00
< div class = "inner-content converse-brand row" >
< div class = "converse-brand__padding" > < / d i v >
< div class = "converse-brand__heading" >
< svg height = "200px"
xmlns = "http://www.w3.org/2000/svg"
xmlns : xlink = "http://www.w3.org/1999/xlink"
viewBox = "0 0 364 364"
version = "1.1" >
< title > Logo Converse < / t i t l e >
< defs >
< linearGradient id = "gradient" x1 = "92.14" y1 = "27.64" x2 = "267.65" y2 = "331.62" gradientUnits = "userSpaceOnUse" >
< stop offset = "0" stop - color = "#fff1d1" / >
< stop offset = "0.05" stop - color = "#fae8c1" / >
< stop offset = "0.15" stop - color = "#f0d5a1" / >
< stop offset = "0.27" stop - color = "#e7c687" / >
< stop offset = "0.4" stop - color = "#e1bb72" / >
< stop offset = "0.54" stop - color = "#dcb264" / >
< stop offset = "0.71" stop - color = "#daad5c" / >
< stop offset = "1" stop - color = "#d9ac59" / >
< / l i n e a r G r a d i e n t >
< filter id = "shadow" >
< feGaussianBlur in = "SourceAlpha" stdDeviation = "2.3" result = "blur1" / >
< feOffset in = "blur1" dx = "3" dy = "3" result = "blur2" / >
< feColorMatrix in = "blur2" type = "matrix" result = "blur3"
values = " 1 0 0 0 0.1
0 1 0 0 0.1
0 0 1 0 0.1
0 0 0 1 0 " / >
< feMerge >
< feMergeNode in = "blur3" / >
< feMergeNode in = "SourceGraphic" / >
< / f e M e r g e >
< / f i l t e r >
< / d e f s >
< g filter = "url(#shadow)" >
< 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" / >
< 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)" / >
< / g >
< / s v g >
< span class = "converse-brand__text" >
< span > converse < span class = "subdued" > . js < / s p a n > < / s p a n >
< p class = "byline" > messaging freedom < / p >
< / s p a n >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { "overlayed" === Ih . settings . get ( "view_mode" ) ? Gu ` <div class="converse-brand__padding"></div> ` : "" }
< / d i v > ` , t ) ; d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . c l a s s L i s t . a d d ( ` c o n v e r s e - $ { I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) } ` ) , I h . t r i g g e r ( " c h a t B o x V i e w s I n i t i a l i z e d " ) } r e n d e r ( ) { r e t u r n ( ( ) = > { c o n s t { c h a t b o x e s : e , C O N T R O L B O X _ T Y P E : t , C H A T R O O M S _ T Y P E : n , H E A D L I N E S _ T Y P E : s } = n d , i = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) , r = n d ? . c o n n e c t i o n , o = ! r ? . c o n n e c t e d | | ! r ? . a u t h e n t i c a t e d | | r ? . d i s c o n n e c t i n g ; r e t u r n G u `
$ { o || "overlayed" !== i ? "" : Gu ` <converse-minimized-chats></converse-minimized-chats> ` }
$ { Mw ( e . filter ( Rw ) , ( e => e . get ( "jid" ) ) , ( e => e . get ( "type" ) === t ? Gu `
$ { "overlayed" === i ? Gu ` <converse-controlbox-toggle class=" ${ e . get ( "closed" ) ? "" : "hidden" } "></converse-controlbox-toggle> ` : "" }
2021-11-11 22:06:49 +01:00
< converse - controlbox
id = "controlbox"
2022-12-17 22:08:36 +01:00
class = "chatbox ${" overlayed "===i&&e.get(" closed ")?" hidden ":" "} ${o?" logged - out ":" "}"
2021-11-11 22:06:49 +01:00
style = "${e.get(" width ")?`width: ${e.get(" width ")}`:" "}" > < / c o n v e r s e - c o n t r o l b o x >
2023-02-17 12:24:37 +01:00
` :e.get("type")===n?Gu `
2021-11-11 22:06:49 +01:00
< converse - muc jid = "${e.get(" jid ")}" class = "chatbox chatroom" > < / c o n v e r s e - m u c >
2023-02-17 12:24:37 +01:00
` :e.get("type")===s?Gu `
2021-11-11 22:06:49 +01:00
< converse - headlines jid = "${e.get(" jid ")}" class = "chatbox headlines" > < / c o n v e r s e - h e a d l i n e s >
2023-02-17 12:24:37 +01:00
` :Gu `
2021-11-11 22:06:49 +01:00
< converse - chat jid = "${e.get(" jid ")}" class = "chatbox" > < / c o n v e r s e - c h a t >
` ))}
2023-02-17 12:24:37 +01:00
` })()}});const Dw=class{constructor(){this.views={}}add(e,t){this.views[e]=t}get(e){return this.views[e]}xget(e){return this.keys().filter((t=>t!==e)).reduce(((e,t)=>(e[t]=this.views[t],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"}))))}};function zw(){const e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh", ` $ { e } px ` )}var Lw=n(6931),Pw={};Pw.styleTagTransform=o_(),Pw.setAttributes=n_(),Pw.insert=e_().bind(null,"head"),Pw.domAPI=Ky(),Pw.insertStyleElement=i_();Qy()(Lw.Z,Pw);Lw.Z&&Lw.Z.locals&&Lw.Z.locals;Oh.plugins.add("converse-chatboxviews",{dependencies:["converse-chatboxes","converse-vcard"],initialize(){Ih.promises.add(["chatBoxViewsInitialized"]),Ih.settings.extend({animate:!0}),nd.chatboxviews=new Dw,Ih.listen.on("chatBoxesInitialized",(()=>{nd.chatboxes.on("destroy",(e=>nd.chatboxviews.remove(e.get("jid"))))})),Ih.listen.on("cleanup",(()=>delete nd.chatboxviews)),Ih.listen.on("clearSession",(()=>nd.chatboxviews.closeAllChatBoxes())),Ih.listen.on("chatBoxViewsInitialized",zw),window.addEventListener("resize",zw),Object.assign(Oh,{insertInto(e){const t=nd.chatboxviews?.el;if(t&&!e.contains(t))e.insertAdjacentElement("afterBegin",t);else if(!t)throw new Error("Cannot insert non-existing #conversejs element into the DOM")}})}});var Fw=n(4166),Uw={};Uw.styleTagTransform=o_(),Uw.setAttributes=n_(),Uw.insert=e_().bind(null,"head"),Uw.domAPI=Ky(),Uw.insertStyleElement=i_();Qy()(Fw.Z,Uw);Fw.Z&&Fw.Z.locals&&Fw.Z.locals;const{Strophe:Bw,u:qw}=Oh.env;class Hw extends Vy{static get properties(){return{is_retracted:{type:Boolean},model:{type:Object}}}initialize(){const e=sl();this.listenTo(e,"change:allowed_audio_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:allowed_image_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:allowed_video_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:render_media",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate()))}render(){return Gu ` $ { vb ( this . renderActions ( ) , "" ) } ` }async renderActions(){const e=this.model.collection.length>2&&this.model===this.model.collection.last(),t=(await this.getActionButtons()).map((e=>Hw.getActionsDropdownItem(e)));return t.length?Gu ` < converse - dropdown
2021-11-11 22:06:49 +01:00
class = "chat-msg__actions ${e?" dropup dropup -- left ":" dropleft "}"
. items = $ { t }
2023-02-17 12:24:37 +01:00
> < / c o n v e r s e - d r o p d o w n > ` : " " } s t a t i c g e t A c t i o n s D r o p d o w n I t e m ( e ) { r e t u r n G u `
2021-11-11 22:06:49 +01:00
< button class = "chat-msg__action ${e.button_class}" @ click = $ { e . handler } >
< converse - icon
class = "${e.icon_class}"
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { e . i18n _text }
< / b u t t o n >
2023-02-17 12:24:37 +01:00
` }async onMessageEditButtonClicked(e){e.preventDefault();const t=this.model.collection.findWhere("correcting"),n=qw.ancestor(this,".chatbox")?.querySelector(".chat-textarea")?.value;if(n&&(!t||t.getMessageText()!==n)){if(!await Ih.confirm(Gy("You have an unsent message which will be lost if you continue. Are you sure?")))return}t!==this.model?(t?.save("correcting",!1),this.model.save("correcting",!0)):this.model.save("correcting",!1)}async onDirectMessageRetractButtonClicked(){if("me"!==this.model.get("sender"))return Il.error("onMessageRetractButtonClicked called for someone else's message!");const e=Gy("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere."),t=[Gy("Are you sure you want to retract this message?")];Ih.settings.get("show_retraction_warning")&&(t[1]=e);if(await Ih.confirm(Gy("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=Gy("A timeout occurred while trying to retract the message");Ih.alert("error",Gy("Error"),e),Il(e,Bw.LogLevel.WARN)}else if(qw.isErrorStanza(n)){const e=Gy("Sorry, you're not allowed to retract this message.");Ih.alert("error",Gy("Error"),e),Il(e,Bw.LogLevel.WARN),Il(n,Bw.LogLevel.WARN)}}async onMUCMessageRetractButtonClicked(){const e=Gy("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=[Gy("Are you sure you want to retract this message?")];if(Ih.settings.get("show_retraction_warning")&&(t[1]=e),await Ih.confirm(Gy("Confirm"),t)){this.model.collection.chatbox.retractOwnMessage(this.model)}}else if(await this.model.mayBeModerated())if("me"===this.model.get("sender")){let t=[Gy("Are you sure you want to retract this message?")];Ih.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]),await Ih.confirm(Gy("Confirm"),t)&&this.retractOtherMessage()}else{let t=[Gy("You are about to retract this message."),Gy("You may optionally include a message, explaining the reason for the retraction.")];Ih.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]);const n=await Ih.prompt(Gy("Message Retraction"),t,Gy("Optional reason"));!1!==n&&this.retractOtherMessage(n)}else{const e=Gy("Sorry, you're not allowed to retract this message");Ih.alert("error",Gy("Error"),e)}}onMessageRetractButtonClicked(e){e?.preventDefault?.();this.model.collection.chatbox.get("type")===nd.CHATROOMS_TYPE?this.onMUCMessageRetractButtonClicked():this.onDirectMessageRetractButtonClicked()}onMediaToggleClicked(e){if(e?.preventDefault?.(),this.hasHiddenMedia(this.getMediaURLs()))this.model.save({hide_url_previews:!1,url_preview_transition:"fade-in"});else{(this.model.get("ogp_metadata")||[]).length?this.model.set("url_preview_transition","fade-out"):this.model.save({hide_url_previews:!0,url_preview_transition:"fade-in"})}}hasHiddenMedia(e){if("boolean"==typeof this.model.get("hide_url_previews"))return this.model.get("hide_url_previews");const t=Ih.settings.get("render_media");return Array.isArray(t)?e.reduce(((e,n)=>e||!Qh(t,n)),!1):!t}getMediaURLs(){const e=(this.model.get("ogp_metadata")||[]).map((e=>({url:e["og:image"],is_image:!0}))).filter((e=>em(e))),t=Fh(this.model.get("media_urls")||[],this.model.get("body")).filter((e=>em(e)));return[...new Set([...t.map((e=>e.url)),...e.map((e=>e.url))])]}addMediaRenderingToggle(e){const t=this.getMediaURLs();if(t.length){const n=this.hasHiddenMedia(t);e.push({i18n_text:Gy(n?"Show media":"Hide media"),handler:e=>this.onMediaToggleClicked(e),button_class:"chat-msg__action-hide-previews",icon_class:n?"fas fa-eye":"fas fa-eye-slash",name:"hide"})}}async getActionButtons(){const e=[];this.model.get("editable")&&e.push({i18n_text:this.model.get("correcting")?Gy("Cancel Editing"):Gy("Edit"),handler:e=>this.onMessageEditButtonClicked(e),button_class:"chat-msg__action-edit",icon_class:"fa fa-pencil-alt",name:
2021-11-11 22:06:49 +01:00
@ mouseover = $ { ( ) => this . setHover ( ) }
@ mouseleave = $ { ( ) => this . unsetHover ( ) }
2023-02-17 12:24:37 +01:00
@ click = $ { e => this . onControlsClicked ( e ) } > < img class = "gif" src = "${this.src}" > < / a > < / c a n v a s > ` } r e n d e r E r r o r F a l l b a c k ( ) { r e t u r n " u r l " = = = t h i s . f a l l b a c k ? h w ( t h i s . s r c ) : " e m p t y " = = = t h i s . f a l l b a c k ? " " : v o i d 0 } s e t H o v e r ( ) { t h i s . s u p e r g i f & & ( t h i s . s u p e r g i f . h o v e r i n g = ! 0 , t h i s . h o v e r _ t i m e o u t & & c l e a r T i m e o u t ( t h i s . h o v e r _ t i m e o u t ) , t h i s . h o v e r _ t i m e o u t = s e t T i m e o u t ( ( ( ) = > t h i s . u n s e t H o v e r ( ) ) , 2 e 3 ) ) } u n s e t H o v e r ( ) { t h i s . s u p e r g i f & & ( t h i s . s u p e r g i f . h o v e r i n g = ! 1 ) } o n C o n t r o l s C l i c k e d ( e ) { e . p r e v e n t D e f a u l t ( ) , t h i s . s u p e r g i f . p l a y i n g ? t h i s . s u p e r g i f . p a u s e ( ) : t h i s . s u p e r g i f . f r a m e s . l e n g t h > 0 & & ( t h i s . s u p e r g i f . o p t i o n s . l o o p = ! 0 , t h i s . s u p e r g i f . p l a y ( ) ) } } ) ; c o n s t i S = ( e , t ) = > G u ` < c o n v e r s e - g i f a u t o p l a y n o l o o p f a l l b a c k = ' e m p t y ' s r c = $ { e } > < / c o n v e r s e - g i f > $ { t ? " " : G u ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , { U R I : r S } = O h . e n v ; c o n s t o S = r b ( c l a s s e x t e n d s m b { r e n d e r ( e , t , n , s ) { r e t u r n t ? G u ` < a h r e f = " $ { t } " c l a s s = " c h a t - i m a g e _ _ l i n k " t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " > $ { t h i s . r e n d e r I m a g e ( e , t , n , s ) } < / a > ` : t h i s . r e n d e r I m a g e ( e , t , n , s ) } r e n d e r I m a g e ( e , t , n , s ) { r e t u r n G u ` < i m g c l a s s = " c h a t - i m a g e i m g - t h u m b n a i l "
2022-05-05 23:06:17 +02:00
loading = "lazy"
2021-11-11 22:06:49 +01:00
src = "${e}"
2022-05-05 23:06:17 +02:00
@ click = $ { s }
@ error = $ { ( ) => this . onError ( e , t , n , s ) }
2023-02-17 12:24:37 +01:00
@ load = $ { n } / > < / a > ` } o n E r r o r ( e , t , n , s ) { i f ( t m ( e ) ) t & & t h i s . s e t V a l u e ( h w ( t ) ) ; e l s e { c o n s t i = n e w r S ( e ) , r = i . f i l e n a m e ( ) ; i . f i l e n a m e ( ` $ { r } . p n g ` ) , t h i s . s e t V a l u e ( o S ( i . t o S t r i n g ( ) , t , n , s ) ) } } } ) , a S = e = > G u ` $ { o S ( e . s r c | | e . u r l , e . h r e f , e . o n L o a d , e . o n C l i c k ) } ` ; c o n s t c S = r b ( c l a s s e x t e n d s o b { r e n d e r ( e , t , n ) { c o n s t s = n e w U S ( e , t , O b j e c t . a s s i g n ( n , { s h o w _ i m a g e s : ! 1 , e m b e d _ v i d e o s : ! 1 , e m b e d _ a u d i o : ! 1 } ) ) ; r e t u r n G u ` $ { v b ( a s y n c f u n c t i o n ( e ) { t r y { a w a i t e . a d d T e m p l a t e s ( ) } c a t c h ( e ) { I l . e r r o r ( e ) } r e t u r n e . p a y l o a d } ( s ) , G u ` $ { s } ` ) } ` } } ) , l S = [ " * " , " _ " , " ~ " , " ` " ] , d S = [ . . . l S , " ` ` ` " , " > " ] , u S = { " * " : { n a m e : " s t r o n g " , t y p e : " s p a n " } , _ : { n a m e : " e m p h a s i s " , t y p e : " s p a n " } , " ~ " : { n a m e : " s t r i k e " , t y p e : " s p a n " } , " ` " : { n a m e : " p r e f o r m a t t e d " , t y p e : " s p a n " } , " ` ` ` " : { n a m e : " p r e f o r m a t t e d _ b l o c k " , t y p e : " b l o c k " } , " > " : { n a m e : " q u o t e " , t y p e : " b l o c k " } } , h S = [ " _ " , " > " , " ` " , " ~ " ] , m S = { e m p h a s i s : ( e , t , n ) = > G u ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > _ < / s p a n > < i > $ { c S ( e , t , n ) } < / i > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > _ < / s p a n > ` , p r e f o r m a t t e d : e = > G u ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` < / s p a n > < c o d e > $ { e } < / c o d e > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` < / s p a n > ` , p r e f o r m a t t e d _ b l o c k : e = > G u ` < d i v c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` \ ` \ ` < / d i v > < c o d e c l a s s = " b l o c k " > $ { e } < / c o d e > < d i v c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` \ ` \ ` < / d i v > ` , q u o t e : ( e , t , n ) = > G u ` < b l o c k q u o t e > $ { c S ( e , t , n ) } < / b l o c k q u o t e > ` , s t r i k e : ( e , t , n ) = > G u ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > ~ < / s p a n > < d e l > $ { c S ( e , t , n ) } < / d e l > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > ~ < / s p a n > ` , s t r o n g : ( e , t , n ) = > G u ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > * < / s p a n > < b > $ { c S ( e , t , n ) } < / b > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > * < / s p a n > ` } ; f u n c t i o n g S ( e , t ) { l e t n , s = ! ( a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] ) | | a r g u m e n t s [ 2 ] ; i f ( / ( ^ ` ` ` [ \ s , \ u 2 0 0 B ] * \ n ) | ( ^ ` ` ` [ \ s , \ u 2 0 0 B ] * $ ) / . t e s t ( e . s l i c e ( t ) ) & & ( 0 = = = t | | " > " = = = e [ t - 1 ] | | / \ n \ u 2 0 0 B { 0 , 2 } $ / . t e s t ( e . s l i c e ( 0 , t ) ) ) ) n = e . s l i c e ( t , t + 3 ) ; e l s e { i f ( ! d S . i n c l u d e s ( e . s l i c e ( t , t + 1 ) ) ) r e t u r n n u l l ; i f ( n = e . s l i c e ( t , t + 1 ) , ! f u n c t i o n ( e , t , n , s ) { i f ( s ) { c o n s t s = R e g E x p ( h S . i n c l u d e s ( e ) ? ` ^ ( \ \ p { L } | \ \ p { N } ) $ { e } ` : ` ^ ( \ \ p { L } | \ \ p { N } ) \ \ $ { e } ` , " u " ) ; i f ( n > 1 & & s . t e s t ( t . s l i c e ( n - 1 ) ) ) r e t u r n ! 1 ; i f ( p S ( e ) & & n > 0 & & " \ n " ! = = t [ n - 1 ] ) r e t u r n ! 1 ; i f ( l S . i n c l u d e s ( e ) & & t [ n + 1 ] = = = e ) r e t u r n ! 1 } e l s e { c o n s t s = R e g E x p ( h S . i n c l u d e s ( e ) ? ` ^ $ { e } ( \ \ p { L } | \ \ p { N } ) ` : ` ^ \ \ $ { e } ( \ \ p { L } | \ \ p { N } ) ` , " u " ) ; i f ( n < t . l e n g t h - 1 & & s . t e s t ( t . s l i c e ( n ) ) ) r e t u r n ! 1 ; i f ( l S . i n c l u d e s ( e ) & & t [ n - 1 ] = = = e ) r e t u r n ! 1 } r e t u r n ! 0 } ( n , e , t , s ) ) r e t u r n n u l l } r e t u r n n } f u n c t i o n f S ( e , t ) { c o n s t n = g S ( e , t ) , s = n ? f u n c t i o n ( e , t , n ) { i f ( ! e ) r e t u r n 0 ; c o n s t s = n ; i f ( n + = e . l e n g t h , p S ( e ) ) r e t u r n ( n + = t . s l i c e ( n ) . s p l i t ( / \ n [ ^ > ] / ) . s h i f t ( ) . l e n g t h ) - s ; i f ( " s p a n " = = = u S [ e ] . t y p e ) { c o n s t s = t . s l i c e ( n ) . s p l i t ( " \ n " ) . s h i f t ( ) ; l e t i = 0 , r = s . i n d e x O f ( e ) ; f o r ( ; - 1 ! = = r ; ) { i f ( g S ( t , n + r , ! 1 ) = = = e ) r e t u r n r + 2 * e . l e n g t h ; r = s . i n d e x O f ( e , i + + ) } r e t u r n 0 } { c o n s t s = t . s l i c e ( n + 1 ) ; l e t i = 0 , r = s . i n d e x O f ( e ) ; f o r ( ; - 1 ! = = r ; ) { i f ( g S ( t , n + 1 + r , ! 1 ) = = = e ) r e t u r n r + 1 + 2 * e . l e n g t h ; r = s . i n d e x O f ( e , i + + ) } r e t u r n 0 } } ( n , e , t ) : 0 ; r e t u r n s > 0 ? { d : n , l e n g t h : s } : { } } c o n s t p S = e = > [ " > " , " & g t ; " ] . i n c l u d e s ( e ) ; f u n c t i o n v S ( e , t , n , s ) { c o n s t i = m S [ u S [ e ] . n a m e ] ; i f ( p S ( e ) ) { r e t u r n i ( t . r e p l a c e ( / \ n > \ s / g , " \ n " ) . r e p l a c e ( / \ n > / g , " \ n " ) . r e p l a c e ( / \ n $ / , " " ) , n , s ) } r e t u r n i ( t , n , s ) } v a r y S = n ( 9 0 4 6 ) , _ S = n . n ( y S ) ; c o n s t b S = e = > G u `
< div class = "message date-separator" data - isodate = "${e.time}" >
< hr class = "separator" / >
< time class = "separator-text" datetime = "${e.time}" > < span > $ { e . datestring } < / s p a n > < / t i m e >
< / d i v >
` ,wS=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"),SS=/(?: \u d83d \u dc68 \u d83c \u dffb \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffc- \u dfff]| \u d83d \u dc68 \u d83c \u dffc \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb \u dffd- \u dfff]| \u d83d \u dc68 \u d83c \u dffd \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb \u dffc \u dffe \u dfff]| \u d83d \u dc68 \u d83c \u dffe \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb- \u dffd \u dfff]| \u d83d \u dc68 \u d83c \u dfff \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb- \u dffe]| \u d83d \u dc69 \u d83c \u dffb \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffc- \u dfff]| \u d83d \u dc69 \u d83c \u dffb \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc69 \u d83c[ \u dffc- \u dfff]| \u d83d \u dc69 \u d83c \u dffc \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb \u dffd- \u dfff]| \u d83d \u dc69 \u d83c \u dffc \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc69 \u d83c[ \u dffb \u dffd- \u dfff]| \u d83d \u dc69 \u d83c \u dffd \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb \u dffc \u dffe \u dfff]| \u d83d \u dc69 \u d83c \u dffd \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc69 \u d83c[ \u dffb \u dffc \u dffe \u dfff]| \u d83d \u dc69 \u d83c \u dffe \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb- \u dffd \u dfff]| \u d83d \u dc69 \u d83c \u dffe \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc69 \u d83c[ \u dffb- \u dffd \u dfff]| \u d83d \u dc69 \u d83c \u dfff \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc68 \u d83c[ \u dffb- \u dffe]| \u d83d \u dc69 \u d83c \u dfff \u 200d \u d83e \u dd1d \u 200d \u d83d \u dc69 \u d83c[ \u dffb- \u dffe]| \u d83e \u ddd1 \u d83c \u dffb \u 200d \u d83e \u dd1d \u 200d \u d83e \u ddd1 \u d83c[ \u dffb- \u dfff]| \u d83e \u ddd1 \u d83c \u dffc \u 200d \u d83e \u dd1d \u 200d \u d83e \u ddd1 \u d83c[ \u dffb- \u dfff]| \u d83e \u ddd1 \u d83c \u dffd \u 200d \u d83e \u dd1d \u 200d \u d83e \u ddd1 \u d83c[ \u dffb- \u dfff]| \u d83e \u ddd1 \u d83c \u dffe \u 200d \u d83e \u dd1d \u 200d \u d83e \u ddd1 \u d83c[ \u dffb- \u dfff]| \u d83e \u ddd1 \u d83c \u dfff \u 200d \u d83e \u dd1d \u 200d \u d83e \u ddd1 \u d83c[ \u dffb- \u dfff]| \u d83e \u ddd1 \u 200d \u d83e \u dd1d \u 200d \u d83e \u ddd1| \u d83d \u dc6b \u d83c[ \u dffb- \u dfff]| \u d83d \u dc6c \u d83c[ \u dffb- \u dfff]| \u d83d \u dc6d \u d83c[ \u dffb- \u dfff]| \u d83d[ \u dc6b- \u dc6d])|(?: \u d83d[ \u dc68 \u dc69]| \u d83e \u ddd1)(?: \u d83c[ \u dffb- \u dfff])? \u 200d(?: \u 2695 \u fe0f| \u 2696 \u fe0f| \u 2708 \u fe0f| \u d83c[ \u df3e \u df73 \u df93 \u dfa4 \u dfa8 \u dfeb \u dfed]| \u d83d[ \u dcbb \u dcbc \u dd27 \u dd2c \u de80 \u de92]| \u d83e[ \u ddaf- \u ddb3 \u ddbc \u ddbd])|(?: \u d83c[ \u dfcb \u dfcc]| \u d83d[ \u dd74 \u dd75]| \u 26f9)((?: \u d83c[ \u dffb- \u dfff]| \u fe0f) \u 200d[ \u 2640 \u 2642] \u fe0f)|(?: \u d83c[ \u dfc3 \u dfc4 \u dfca]| \u d83d[ \u dc6e \u dc71 \u dc73 \u dc77 \u dc81 \u dc82 \u dc86 \u dc87 \u de45- \u de47 \u de4b \u de4d \u de4e \u dea3 \u deb4- \u deb6]| \u d83e[ \u dd26 \u dd35 \u dd37- \u dd39 \u dd3d \u dd3e \u ddb8 \u ddb9 \u ddcd- \u ddcf \u ddd6- \u dddd])(?: \u d83c[ \u dffb- \u dfff])? \u 200d[ \u 2640 \u 2642] \u fe0f|(?: \u d83d \u dc68 \u 200d \u 2764 \u fe0f \u 200d \u d83d \u dc8b \u 200d \u d83d \u dc68| \u d83d \u dc68 \u 200d \u d83d \u dc68 \u 200d \u d83d \u dc66 \u 200d \u d83d \u dc66| \u d83d \u dc68 \u 200d \u d83d \u dc68 \u 200d \u d83d \u dc67 \u 200d \u d83d[ \u dc66 \u dc67]| \u d83d \u dc68 \u 200d \u d83d \u dc69 \u 200d \u d83d \u dc66 \u 200d \u d83d \u dc66| \u d83d \u dc68 \u 200d \u d83d \u dc69 \u 200d \u d83d \u dc67 \u 200d \u d83d[ \u dc66 \u dc67]| \u d83d \u dc69 \u 200d \u 2764 \u fe0f \u 200d \u d83d \u dc8b \u 200d \u d83d[ \
2022-12-17 22:08:36 +01:00
< a
href = "#"
class = "chatbox-btn ${t.a_class}"
@ click = $ { t . handler }
title = "${t.i18n_title}"
>
< converse - icon
size = "1em"
class = "fa ${t.icon_class}"
> < / c o n v e r s e - i c o n >
< / a >
2023-02-17 12:24:37 +01:00
` }(e))).reverse().map((e=>vb(e,"")))))}function MS(e){return e.then((e=>{const t=e.filter((e=>!e.standalone)).map((e=>async function(e){const t=await e;return t?Gu `
2022-12-17 22:08:36 +01:00
< a href = "#" class = "dropdown-item ${t.a_class}" @ click = $ { t . handler } title = "${t.i18n_title}" >
< converse - icon
size = "1em"
class = "fa ${t.icon_class}"
> < / c o n v e r s e - i c o n >
$ { t . i18n _text }
< / a >
2023-02-17 12:24:37 +01:00
` :""}(e)));return t.length?Gu ` < converse - dropdown class = "chatbox-btn dropleft" . items = $ { t } > < / c o n v e r s e - d r o p d o w n > ` : " " } ) ) } f u n c t i o n R S ( e ) { i f ( ! e . i s H i d d e n ( ) & & I h . s e t t i n g s . g e t ( " a l l o w _ u r l _ h i s t o r y _ c h a n g e " ) ) { c o n s t t = w i n d o w . l o c a t i o n . h a s h ; t & & e . m e s s a g e s . g e t ( t . s l i c e ( 1 ) ) & & n d . r o u t e r . h i s t o r y . n a v i g a t e ( ) } } c o n s t D S = _ S ( ) ( ( e = > f u n c t i o n ( e ) { c o n s t t = e . t a r g e t ; i f ( " c o n v e r s e - c h a t - c o n t e n t " ! = = t . n o d e N a m e . t o L o w e r C a s e ( ) ) r e t u r n ; l e t n = ! 0 ; c o n s t s = 0 = = = M a t h . f l o o r ( t . s c r o l l T o p ) , i = M a t h . c e i l ( t . c l i e n t H e i g h t - t . s c r o l l T o p ) > = t . s c r o l l H e i g h t - M a t h . c e i l ( t . s c r o l l H e i g h t / 2 0 ) ; s ? ( n = ! 1 , R S ( t . m o d e l ) ) : i & & I h . t r i g g e r ( " c h a t B o x S c r o l l e d U p " , t ) , t . m o d e l . g e t ( " s c o l l e d " ) ! = = n & & t . m o d e l . u i . s e t ( { s c r o l l e d : n } ) } ( e ) ) , 5 0 ) ; f u n c t i o n z S ( e ) { i f ( " g r o u p c h a t " = = = e . g e t ( " t y p e " ) ) { c o n s t t = I h . s e t t i n g s . g e t ( " m u c _ h a t s " ) . f i l t e r ( ( e = > e ) ) . m a p ( ( e = > e . t o L o w e r C a s e ( ) ) ) ; l e t n = [ ] ; t . i n c l u d e s ( " v c a r d _ r o l e s " ) & & ( n = e . v c a r d ? e . v c a r d . g e t ( " r o l e " ) : n u l l , n = n ? n . s p l i t ( " , " ) . f i l t e r ( ( e = > e ) ) . m a p ( ( e = > ( { t i t l e : e } ) ) ) : [ ] ) ; c o n s t s = [ . . . e . o c c u p a n t ? [ e . o c c u p a n t . g e t ( " r o l e " ) ] : [ ] , . . . e . o c c u p a n t ? [ e . o c c u p a n t . g e t ( " a f f i l i a t i o n " ) ] : [ ] ] . f i l t e r ( ( e = > e ) ) . f i l t e r ( ( e = > t . i n c l u d e s ( e . t o L o w e r C a s e ( ) ) ) ) . m a p ( ( e = > ( { t i t l e : e } ) ) ) ; r e t u r n [ . . . t . i n c l u d e s ( " x e p 3 1 7 " ) & & e . o c c u p a n t ? . g e t ( " h a t s " ) | | [ ] , . . . n , . . . s ] } r e t u r n [ ] } f u n c t i o n L S ( ) { v a r e ; r e t u r n O h . e m o j i s . t o n e d | | ( O h . e m o j i s . t o n e d = ( e = O b j e c t . v a l u e s ( O h . e m o j i s . j s o n . p e o p l e ) . f i l t e r ( ( e = > e . s n . i n c l u d e s ( " _ t o n e " ) ) ) . m a p ( ( e = > e . s n . r e p l a c e ( / _ t o n e [ 1 - 5 ] / , " " ) ) ) , [ . . . n e w S e t ( e ) ] ) ) , O h . e m o j i s . t o n e d } f u n c t i o n P S ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : { u n i c o d e _ o n l y : ! 1 , a d d _ t i t l e _ w r a p p e r : ! 1 } ; c o n s t n = e . e m o j i , s = e . s h o r t n a m e ; i f ( n ) { i f ( t . u n i c o d e _ o n l y ) r e t u r n n ; i f ( I h . s e t t i n g s . g e t ( " u s e _ s y s t e m _ e m o j i s " ) ) r e t u r n t . a d d _ t i t l e _ w r a p p e r & & s ? G u ` < s p a n t i t l e = " $ { s } " > $ { n } < / s p a n > ` : n ; { c o n s t t = I h . s e t t i n g s . g e t ( " e m o j i _ i m a g e _ p a t h " ) ; r e t u r n G u ` < i m g c l a s s = " e m o j i "
2022-05-05 23:06:17 +02:00
loading = "lazy"
draggable = "false"
title = "${s}"
alt = "${n}"
2023-02-17 12:24:37 +01:00
src = "${t}/72x72/${e.cp}.png" / > ` }}return t.unicode_only?s:Gu ` < img class = "emoji"
2022-05-05 23:06:17 +02:00
loading = "lazy"
draggable = "false"
title = "${s}"
alt = "${s}"
2023-02-17 12:24:37 +01:00
src = "${Oh.emojis.by_sn[s].url}" > ` }Object.assign(IS,{shortnamesToEmojis:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{unicode_only:!1,add_title_wrapper:!1};return function(e,t){let n=[e];return[...kS(e),...jS(e)].sort(((e,t)=>t.begin-e.begin)).forEach((e=>{const s=n.shift(),i=PS(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= $ S(e),t)}});const FS=e=>"string"==typeof e;class US extends String{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(e),this.embed_audio=n?.embed_audio,this.embed_videos=n?.embed_videos,this.mentions=n?.mentions||[],this.media_urls=n?.media_urls,this.nick=n?.nick,this.offset=t,this.onImgClick=n?.onImgClick,this.onImgLoad=n?.onImgLoad,this.options=n,this.payload=[],this.references=[],this.render_styling=n?.render_styling,this.show_images=n?.show_images,this.hide_media_urls=n?.hide_media_urls}shouldRenderMedia(e,t){let n;return"image"===t?n=this.show_images:"audio"===t?n=this.embed_audio:"video"===t&&(n=this.embed_videos),"boolean"==typeof n?n:Yh(e,t)}addHyperlinks(e,t){const n=t+this.offset;Fh(this.media_urls||hm(e,t).media_urls||[],e,n).filter((e=>!e.is_encrypted)).forEach((e=>{const n=e.url,s=Kh(n);let i;i=nm(n)&&this.shouldRenderMedia(n,"image")?iS(s,this.hide_media_urls):rm(n)&&this.shouldRenderMedia(n,"image")?aS({src:s,href:this.hide_media_urls?null:s,onClick:this.onImgClick,onLoad:this.onImgLoad}):im(n)&&this.shouldRenderMedia(n,"video")?Yb(s,this.hide_media_urls):sm(n)&&this.shouldRenderMedia(n,"audio")?Pb(s,this.hide_media_urls):hw(s),this.addTemplateResult(e.start+t,e.end+t,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,hw(e[0].replace(n,Ih.settings.get("geouri_replacement"))))}addEmojis(e,t){[...kS(e.toString()),...jS(e.toString())].forEach((e=>{this.addTemplateResult(e.begin+t,e.end+t,PS(e,{add_title_wrapper:!0}))}))}addMentions(e,t){const n=t+this.offset;this.mentions?.forEach((s=>{const i=Number(s.begin)-n;if(i<0||i>=n+e.length)return;const r=Number(s.end)-n,o=e.slice(i,r);o===this.nick?this.addTemplateResult(i+t,r+t,(e=>Gu ` < span class = "mention mention--self badge badge-info" data - uri = "${e.uri}" > $ { e . mention } < / s p a n > ` ) ( { . . . s , m e n t i o n : o } ) ) : t h i s . a d d T e m p l a t e R e s u l t ( i + t , r + t , ( e = > G u ` < s p a n c l a s s = " m e n t i o n " d a t a - u r i = " $ { e . u r i } " > $ { e . m e n t i o n } < / s p a n > ` ) ( { . . . s , m e n t i o n : o } ) ) } ) ) } a d d S t y l i n g ( ) { i f ( ! f u n c t i o n ( e ) { f o r ( l e t t = 0 ; t < d S . l e n g t h ; t + + ) i f ( e . i n c l u d e s ( d S [ t ] ) ) r e t u r n ! 0 } ( t h i s ) ) r e t u r n ; c o n s t e = [ ] , t = t h i s . m e n t i o n s . m a p ( ( e = > A r r a y . f r o m ( { l e n g t h : N u m b e r ( e . e n d ) } , ( ( t , n ) = > N u m b e r ( e . b e g i n ) + n ) ) ) ) ; l e t n = 0 ; f o r ( ; n < t h i s . l e n g t h ; ) { i f ( t . f i l t e r ( ( e = > e . i n c l u d e s ( n ) ) ) . l e n g t h ) { n + + ; c o n t i n u e } c o n s t { d : s , l e n g t h : i } = f S ( t h i s , n ) ; i f ( s & & i ) { c o n s t t = p S ( s ) , r = n + i , o = t ? r : r - s . l e n g t h ; l e t a = " ` ` ` " = = = s ? n + s . l e n g t h + 1 : n + s . l e n g t h ; t & & " " = = = t h i s [ a ] & & ( a + = 1 ) ; c o n s t c = a , l = t h i s . s l i c e ( a , o ) ; e . p u s h ( { b e g i n : n , t e m p l a t e : v S ( s , l , c , t h i s . o p t i o n s ) , e n d : r } ) , n = r } n + + } e . f o r E a c h ( ( e = > t h i s . a d d T e m p l a t e R e s u l t ( e . b e g i n , e . e n d , e . t e m p l a t e ) ) ) } t r i m M e M e s s a g e ( ) { 0 = = = t h i s . o f f s e t & & t h i s . i s M e C o m m a n d ( ) & & ( t h i s . p a y l o a d [ 0 ] = t h i s . p a y l o a d [ 0 ] . s u b s t r i n g ( 4 ) ) } a d d A n n o t a t i o n s ( e ) { c o n s t t = t h i s . m a r s h a l l ( ) ; l e t n = 0 ; f o r ( c o n s t s o f t ) s & & ( F S ( s ) ? ( e . c a l l ( t h i s , s , n ) , n + = s . l e n g t h ) : n = s . e n d ) } a s y n c a d d T e m p l a t e s ( ) { a w a i t I h . t r i g g e r ( " b e f o r e M e s s a g e B o d y T r a n s f o r m e d " , t h i s , { S y n c h r o n o u s : ! 0 } ) , t h i s . r e n d e r _ s t y l i n g & & t h i s . a d d S t y l i n g ( ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d M e n t i o n s ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d H y p e r l i n k s ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d M a p U R L s ) , a w a i t I h . e m o j i s . i n i t i a l i z e ( ) , t h i s . a d d A n n o t a t i o n s ( t h i s . a d d E m o j i s ) , a w a i t I h . t r i g g e r ( " a f t e r M e s s a g e B o d y T r a n s f o r m e d " , t h i s , { S y n c h r o n o u s : ! 0 } ) , t h i s . p a y l o a d = t h i s . m a r s h a l l ( ) , t h i s . o p t i o n s . s h o w _ m e _ m e s s a g e & & t h i s . t r i m M e M e s s a g e ( ) , t h i s . p a y l o a d = t h i s . p a y l o a d . m a p ( ( e = > F S ( e ) ? e : e . t e m p l a t e ) ) } a d d T e m p l a t e R e s u l t ( e , t , n ) { t h i s . r e f e r e n c e s . p u s h ( { b e g i n : e , e n d : t , t e m p l a t e : n } ) } i s M e C o m m a n d ( ) { c o n s t e = t h i s . t o S t r i n g ( ) ; r e t u r n ! ! e & & e . s t a r t s W i t h ( " / m e " ) } m a r s h a l l ( ) { l e t e = [ t h i s . t o S t r i n g ( ) ] ; r e t u r n t h i s . r e f e r e n c e s . s o r t ( ( ( e , t ) = >
2021-11-11 22:06:49 +01:00
< button type = "button" class = "btn btn--transparent btn--standalone" data - toggle = "dropdown" aria - haspopup = "true" aria - expanded = "false" >
2022-12-17 22:08:36 +01:00
< converse - icon size = "1em" class = "${this.icon_classes}" >
2021-03-19 19:26:15 +01:00
< / b u t t o n >
2021-11-11 22:06:49 +01:00
< div class = "dropdown-menu" >
2023-02-17 12:24:37 +01:00
$ { this . items . map ( ( e => vb ( e , "" ) ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
` }firstUpdated(){super.firstUpdated(),this.initArrowNavigation()}connectedCallback(){super.connectedCallback(),this.hideOnEscape=e=>e.keyCode===Dl.ESCAPE&&this.hideMenu(),document.addEventListener("keydown",this.hideOnEscape)}disconnectedCallback(){document.removeEventListener("keydown",this.hideOnEscape),super.disconnectedCallback()}hideMenu(){super.hideMenu(),this.navigator?.disable()}initArrowNavigation(){if(!this.navigator){const e={selector:".dropdown-item",onSelected:e=>e.focus()};this.navigator=new XS(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!==Dl.DOWN_ARROW||this.navigator.enabled||this.enableArrowNavigation(e)}}Ih.elements.define("converse-dropdown",ix);var rx=n(2751),ox={};ox.styleTagTransform=o_(),ox.setAttributes=n_(),ox.insert=e_().bind(null,"head"),ox.domAPI=Ky(),ox.insertStyleElement=i_();Qy()(rx.Z,ox);rx.Z&&rx.Z.locals&&rx.Z.locals;const{dayjs:ax}=Oh.env;Ih.elements.define("converse-message-versions",class extends Vy{static get properties(){return{model:{type:Object}}}render(){const e=this.model.get("older_versions"),t=Object.keys(e);return Gu `
$ { t . length ? Gu ` <h4> ${ Gy ( "Older versions" ) } </h4> ${ t . map ( ( t => ( ( e , t ) => Gu ` <p class="older-msg"><time> ${ ax ( e ) . format ( "MMM D, YYYY, HH:mm:ss" ) } </time>: ${ t [ e ] } </p> ` ) ( t , e ) ) ) } ` : Gu ` <h4> ${ Gy ( "No older versions found" ) } </h4> ` }
2021-11-11 22:06:49 +01:00
< hr / >
2023-02-17 12:24:37 +01:00
< h4 > $ { Gy ( "Current version" ) } < / h 4 >
< p > < time > $ { ax ( this . model . get ( "time" ) ) . format ( "MMM D, YYYY, HH:mm:ss" ) } < / t i m e > : $ { t h i s . m o d e l . g e t M e s s a g e T e x t ( ) } < / p > ` } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - v e r s i o n s - m o d a l " , c l a s s e x t e n d s $ _ { r e n d e r M o d a l ( ) { r e t u r n G u ` < c o n v e r s e - m e s s a g e - v e r s i o n s . m o d e l = $ { t h i s . m o d e l } > < / c o n v e r s e - m e s s a g e - v e r s i o n s > ` } g e t M o d a l T i t l e ( ) { r e t u r n G y ( " M e s s a g e v e r s i o n s " ) } } ) ; c o n s t c x = e = > { c o n s t t = v o i d 0 ! = = e . m o d e l . c o n t a c t , n = G y ( " R e f r e s h " ) , s = I h . s e t t i n g s . g e t ( " a l l o w _ c o n t a c t _ r e m o v a l " ) ; r e t u r n G u `
2022-12-17 22:08:36 +01:00
< div class = "modal-footer" >
2023-02-17 12:24:37 +01:00
$ { S _ }
2022-12-17 22:08:36 +01:00
< button type = "button" class = "btn btn-info refresh-contact" @ click = $ { t => e . refreshContact ( t ) } >
< converse - icon
class = "fa fa-refresh"
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { n } < / b u t t o n >
2023-02-17 12:24:37 +01:00
$ { s && t ? ( e => { const t = Gy ( "Remove as contact" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< button type = "button" @ click = "${t=>e.removeContact(t)}" class = "btn btn-danger remove-contact" >
2022-04-02 21:20:14 +02:00
< converse - icon
class = "fas fa-trash-alt"
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { t }
2021-11-11 22:06:49 +01:00
< / b u t t o n >
` })(e):""}
2022-12-17 22:08:36 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
` };function lx(e){nd.roster?.get(e.get("jid"))?.trigger("highlight")}function dx(e,t){const n=nd.roster_filter,s=n.get("filter_type"),i="state"===s?n.get("chat_state").toLowerCase():n.get("filter_text").toLowerCase();if(!i)return!1;if("state"===s){return![nd.HEADER_REQUESTING_CONTACTS,nd.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))}return"contacts"===s?!e.getFilterCriteria().includes(i):void 0}function ux(e){const t=nd.roster_filter;if("groups"===t.get("filter_type")){const n=t.get("filter_text")?.toLowerCase();if(!n)return!0;if(!e.toLowerCase().includes(n))return!1}return!0}const hx=Oh.env.utils;Ih.elements.define("converse-user-details-modal",class extends $ _{initialize(){super.initialize(),this.model.rosterContactAdded.then((()=>this.registerContactEventHandlers())),this.listenTo(this.model,"change",this.render),this.registerContactEventHandlers(),Ih.trigger("userDetailsModalInitialized",this.model)}renderModal(){return(e=>{const t=e.model?.vcard,n=t?t.toJSON():{},s={...e.model.toJSON(),...n},i=Gy("XMPP Address"),r=Gy("Email"),o=Gy("Full Name"),a=Gy("Nickname"),c=Gy("The User's Profile Image"),l=Gy("Role"),d=Gy("URL"),u={alt_text:c,extra_classes:"mb-3",height:"120",width:"120"};return Gu `
2022-12-17 22:08:36 +01:00
< div class = "modal-body" >
2023-02-17 12:24:37 +01:00
$ { s . image ? Gu ` <div class="mb-4"> ${ Z _ ( Object . assign ( s , u ) ) } </div> ` : "" }
$ { s . fullname ? Gu ` <p><label> ${ o } :</label> ${ s . fullname } </p> ` : "" }
2023-01-07 22:34:35 +01:00
< p > < label > $ { i } : < / l a b e l > < a h r e f = " x m p p : $ { s . j i d } " > $ { s . j i d } < / a > < / p >
2023-02-17 12:24:37 +01:00
$ { s . nickname ? Gu ` <p><label> ${ a } :</label> ${ s . nickname } </p> ` : "" }
$ { s . url ? Gu ` <p><label> ${ d } :</label> <a target="_blank" rel="noopener" href=" ${ s . url } "> ${ s . url } </a></p> ` : "" }
$ { s . email ? Gu ` <p><label> ${ r } :</label> <a href="mailto: ${ s . email } "> ${ s . email } </a></p> ` : "" }
$ { s . role ? Gu ` <p><label> ${ l } :</label> ${ s . role } </p> ` : "" }
2021-03-19 19:26:15 +01:00
2023-01-07 22:34:35 +01:00
< converse - omemo - fingerprints jid = $ { s . jid } > < / c o n v e r s e - o m e m o - f i n g e r p r i n t s >
2021-11-11 22:06:49 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
` })(this)}renderModalFooter(){return cx(this)}getModalTitle(){return this.model.getDisplayName()}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");hx.addClass("fa-spin",t);try{await Ih.vcard.update(this.model.contact.vcard,!0)}catch(e){Il.fatal(e),this.alert(Gy("Sorry, something went wrong while trying to refresh"),"danger")}hx.removeClass("fa-spin",t)}async removeContact(e){if(e?.preventDefault?.(),!Ih.settings.get("allow_contact_removal"))return;await Ih.confirm(Gy("Are you sure you want to remove this contact?"))&&(setTimeout((()=>function(e){e.removeFromRoster((()=>e.destroy()),(t=>{t&&Il.error(t),Ih.alert("error",Gy("Error"),[Gy("Sorry, there was an error while trying to remove %1 $ s as a contact.",e.getDisplayName())])}))}(this.model.contact)),1),this.modal.hide())}});const{dayjs:mx}=Oh.env,{dayjs:gx}=Oh.env;function fx(e){return!!Jh(e).host()}Ih.elements.define("converse-image",class extends Vy{static get properties(){return{src:{type:String},onImgLoad:{type:Function},href:{type:String}}}render(){return nm(this.src)&&Yh(this.src,"image")?iS(Kh(this.src),!0):aS({src:Kh(this.src),href:this.href,onClick:this.onImgClick,onLoad:this.onImgLoad})}});const px=e=>{const t=(n=e.image)&&Xh(n,"allowed_image_domains")&&fx(n);var n;const s=e.title||e.description||e.url;return t||s?Gu ` < div class = "card card--unfurl" >
$ { t ? ( e => Gu ` <converse-image class="card-img-top hor_centered" href=" ${ e . url } " src=" ${ e . image } " .onImgLoad= ${ e . onload } ></converse-image> ` ) ( e ) : "" }
$ { s ? Gu ` <div class="card-body">
$ { e . title ? ( ( e , t ) => e . url && fx ( e . url ) && ! nm ( e . image ) ? Gu ` <a href=" ${ e . url } " target="_blank" rel="noopener"> ${ t ( e ) } </a> ` : t ( e ) ) ( e , ( e => Gu ` <h5 class="card-title"> ${ e . title } </h5> ` ) ) : "" }
$ { e . description ? Gu ` <p class="card-text">
2022-01-03 11:54:10 +01:00
< converse - rich - text text = $ { e . description } > < / c o n v e r s e - r i c h - t e x t >
< / p > ` : " " }
2023-02-17 12:24:37 +01:00
$ { e . url ? Gu ` <p class="card-text">
< a href = "${e.url}" target = "_blank" rel = "noopener" > $ { Jh ( e . url ) . domain ( ) } < / a >
2022-01-03 11:54:10 +01:00
< / p > ` : " " }
< / d i v > ` : " " }
2023-02-17 12:24:37 +01:00
< / d i v > ` : " " } ; v a r v x = n ( 5 0 4 6 ) , y x = { } ; y x . s t y l e T a g T r a n s f o r m = o _ ( ) , y x . s e t A t t r i b u t e s = n _ ( ) , y x . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , y x . d o m A P I = K y ( ) , y x . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( v x . Z , y x ) ; v x . Z & & v x . Z . l o c a l s & & v x . Z . l o c a l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - u n f u r l " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { d e s c r i p t i o n : { t y p e : S t r i n g } , i m a g e : { t y p e : S t r i n g } , j i d : { t y p e : S t r i n g } , t i t l e : { t y p e : S t r i n g } , u r l : { t y p e : S t r i n g } } } i n i t i a l i z e ( ) { c o n s t e = s l ( ) ; t h i s . l i s t e n T o ( e , " c h a n g e : a l l o w e d _ i m a g e _ d o m a i n s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( e , " c h a n g e : r e n d e r _ m e d i a " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { r e t u r n p x ( O b j e c t . a s s i g n ( { o n l o a d : ( ) = > t h i s . o n I m a g e L o a d ( ) } , { d e s c r i p t i o n : t h i s . d e s c r i p t i o n | | " " , i m a g e : t h i s . i m a g e | | " " , t i t l e : t h i s . t i t l e | | " " , u r l : t h i s . u r l | | " " } ) ) } o n I m a g e L o a d ( ) { t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " i m a g e L o a d e d " , { d e t a i l : t h i s , b u b b l e s : ! 0 } ) ) } } ) ; c o n s t _ x = e = > { c o n s t t = G y ( " S h o w m o r e " ) , n = " g r o u p c h a t " = = = e . m o d e l . g e t ( " t y p e " ) , s = G y ( " S h o w l e s s " ) , i = G u `
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__spoiler-hint" >
< span class = "spoiler-hint" > $ { e . model . get ( "spoiler_hint" ) } < / s p a n >
< a class = "badge badge-info spoiler-toggle" href = "#" @ click = $ { e . toggleSpoilerMessage } >
2022-04-02 21:20:14 +02:00
< converse - icon size = "1em" color = "var(--background)" class = "fa ${e.model.get(" is _spoiler _visible ")?" fa - eye - slash ":" fa - eye "}" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
$ { e . model . get ( "is_spoiler_visible" ) ? s : t }
2022-01-03 11:54:10 +01:00
< / a >
< / d i v >
2023-02-17 12:24:37 +01:00
` ,r=e.model.get("is_spoiler")?"spoiler "+(e.model.get("is_spoiler_visible")?"":"hidden"):"",o=e.model.getMessageText(),a=e.model.get("oob_url")&&o!==e.model.get("oob_url");return Gu `
2022-05-05 23:06:17 +02:00
$ { e . model . get ( "is_spoiler" ) ? i : "" }
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "subject" ) ? Gu ` <div class="chat-msg__subject"> ${ e . model . get ( "subject" ) } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< span class = "chat-msg__body--wrapper" >
2022-01-03 11:54:10 +01:00
< converse - chat - message - body
2022-12-17 22:08:36 +01:00
class = "chat-msg__text ${e.model.get(" is _only _emojis ")?" chat - msg _ _text -- larger ":" "} ${r}"
2022-01-03 11:54:10 +01:00
. model = "${e.model}"
hide _url _previews = $ { e . model . get ( "hide_url_previews" ) }
? is _me _message = $ { e . model . isMeCommand ( ) }
2022-12-17 22:08:36 +01:00
text = "${o}" > < / c o n v e r s e - c h a t - m e s s a g e - b o d y >
2023-02-17 12:24:37 +01:00
$ { ! e . model . get ( "received" ) || e . model . isMeCommand ( ) || n ? "" : Gu ` <converse-icon size="1em" color="var(--chat-color)" class="fa fa-check chat-msg__receipt"></converse-icon> ` }
$ { e . model . get ( "edited" ) ? ( e => { const t = Gy ( "This message has been edited" ) ; return Gu ` <converse-icon title=" ${ t } " class="fa fa-edit chat-msg__edit-modal" @click= ${ e . showMessageVersionsModal } size="1em"></converse-icon> ` } ) ( e ) : "" }
2022-01-03 11:54:10 +01:00
< / s p a n >
2023-02-17 12:24:37 +01:00
$ { a ? Gu ` <div class="chat-msg__media"> ${ dw ( e . model . get ( "oob_url" ) ) } </div> ` : "" }
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__error" > $ { e . model . get ( "error_text" ) || e . model . get ( "error" ) } < / d i v >
2023-02-17 12:24:37 +01:00
` };var bx=n(9523),wx={};wx.styleTagTransform=o_(),wx.setAttributes=n_(),wx.insert=e_().bind(null,"head"),wx.domAPI=Ky(),wx.insertStyleElement=i_();Qy()(bx.Z,wx);bx.Z&&bx.Z.locals&&bx.Z.locals;const{Strophe:Sx,dayjs:xx}=Oh.env;Ih.elements.define("converse-chat-message",class extends Vy{static get properties(){return{jid:{type:String},mid:{type:String}}}async initialize(){if(await this.setModels(),!this.model)return void Il.error("Could not find module for converse-chat-message");const e=sl();this.listenTo(e,"change:render_media",(()=>{this.model.save("hide_url_previews",void 0),this.requestUpdate()})),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.requestUpdate(),this.listenTo(this.model.occupant,"change",(()=>this.requestUpdate()))})))}async setModels(){this.chatbox=await Ih.chatboxes.get(this.jid),await this.chatbox.initialized,await this.chatbox.messages.fetched,this.model=this.chatbox.messages.get(this.mid),this.model&&this.requestUpdate()}render(){return this.model?this.show_spinner?J_():this.model.get("file")&&this.model.get("upload")!==nd.SUCCESS?this.renderFileProgress():["mep"].includes(this.model.get("type"))?this.renderMEPMessage():["error","info"].includes(this.model.get("type"))?this.renderInfoMessage():this.renderChatMessage():""}getProps(){return Object.assign(this.model.toJSON(),this.getDerivedMessageProps())}renderRetraction(){return(e=>{const t=e.isRetracted()?e.getRetractionText():null;return Gu `
2022-05-05 23:06:17 +02:00
< div class = "retraction" > $ { t } < / d i v >
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "moderation_reason" ) ? Gu ` <q class="chat-msg--retracted__reason"> ${ e . model . get ( "moderation_reason" ) } </q> ` : "" } ` })(this)}renderMessageText(){return _x(this)}renderMEPMessage(){return(e=>{const t=gx(e.model.get("time")).toISOString();return Gu `
2022-01-03 11:54:10 +01:00
< div class = "message chat-info message--mep ${e.getExtraMessageClasses()}"
data - isodate = "${t}"
data - type = "${e.data_name}"
data - value = "${e.data_value}" >
< div class = "chat-msg__content" >
< div class = "chat-msg__body chat-msg__body--${e.model.get(" type ")} ${e.model.get(" is _delayed ")?" chat - msg _ _body -- delayed ":" "}" >
< div class = "chat-info__message" >
2023-02-17 12:24:37 +01:00
$ { e . isRetracted ( ) ? e . renderRetraction ( ) : Gu `
2022-01-03 11:54:10 +01:00
< converse - rich - text
. mentions = $ { e . model . get ( "references" ) }
render _styling
text = $ { e . model . getMessageText ( ) } >
< / c o n v e r s e - r i c h - t e x t >
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "reason" ) ? Gu ` <q class="reason"><converse-rich-text text= ${ e . model . get ( "reason" ) } ></converse-rich-text></q> ` : "" }
2022-01-03 11:54:10 +01:00
` }
< / d i v >
< converse - message - actions
? is _retracted = $ { e . isRetracted ( ) }
. model = $ { e . model } > < / c o n v e r s e - m e s s a g e - a c t i o n s >
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ) ( t h i s ) } r e n d e r I n f o M e s s a g e ( ) { r e t u r n ( e = > { c o n s t t = m x ( e . m o d e l . g e t ( " t i m e " ) ) . t o I S O S t r i n g ( ) , n = G y ( " R e t r y " ) ; r e t u r n G u `
2021-11-11 22:06:49 +01:00
< div class = "message chat-info chat-${e.model.get(" type ")}"
data - isodate = "${t}"
data - type = "${e.data_name}"
data - value = "${e.data_value}" >
< div class = "chat-info__message" >
< converse - rich - text
. mentions = $ { e . model . get ( "references" ) }
render _styling
text = $ { e . model . getMessageText ( ) } >
< / c o n v e r s e - r i c h - t e x t >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "reason" ) ? Gu ` <q class="reason"> ${ e . model . get ( "reason" ) } </q> ` : "" }
$ { e . model . get ( "error_text" ) ? Gu ` <q class="reason"> ${ e . model . get ( "error_text" ) } </q> ` : "" }
$ { e . model . get ( "retry_event_id" ) ? Gu ` <a class="retry" @click= ${ e . onRetryClicked } > ${ n } </a> ` : "" }
< / d i v > ` } ) ( t h i s ) } r e n d e r F i l e P r o g r e s s ( ) { r e t u r n t h i s . m o d e l . f i l e ? ( e = > { c o n s t t = G y ( " U p l o a d i n g f i l e : " ) , n = e . m o d e l . f i l e . n a m e , s = z h ( ) ( e . m o d e l . f i l e . s i z e ) ; r e t u r n G u `
2022-01-03 11:54:10 +01:00
< div class = "message chat-msg" >
2023-02-17 12:24:37 +01:00
$ { e . shouldShowAvatar ( ) ? Gu ` <a class="show-msg-author-modal" @click= ${ e . showUserModal } >
2022-01-03 11:54:10 +01:00
< converse - avatar class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a > ` : " " }
< div class = "chat-msg__content" >
2023-01-07 22:34:35 +01:00
< span class = "chat-msg__text" > $ { t } < strong > $ { n } < / s t r o n g > , $ { s } < / s p a n >
2022-01-03 11:54:10 +01:00
< progress value = "${e.model.get(" progress ")}" / >
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ) ( t h i s ) : " " } r e n d e r C h a t M e s s a g e ( ) { r e t u r n ( ( e , t ) = > { c o n s t n = G y ( " N e w m e s s a g e s " ) , s = e . m o d e l . i s F o l l o w u p ( ) ; r e t u r n G u `
$ { t . is _first _unread ? Gu ` <div class="message separator"><hr class="separator"><span class="separator-text"> ${ n } </span></div> ` : "" }
2021-03-19 19:26:15 +01:00
< div class = "message chat-msg ${e.getExtraMessageClasses()}"
2021-11-11 22:06:49 +01:00
data - isodate = "${t.time}"
data - msgid = "${t.msgid}"
data - from = "${t.from}"
data - encrypted = "${t.is_encrypted}" >
2021-03-19 19:26:15 +01:00
<!-- Anchor to allow us to scroll the message into view -- >
2021-11-11 22:06:49 +01:00
< a id = "${t.msgid}" > < / a >
2021-03-19 19:26:15 +01:00
2023-02-17 12:24:37 +01:00
$ { t . should _show _avatar && ! s ? Gu ` <a class="show-msg-author-modal" @click= ${ e . showUserModal } >
2022-01-03 11:54:10 +01:00
< converse - avatar
class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__content chat-msg__content--${t.sender} ${t.is_me_message?" chat - msg _ _content -- action ":" "}" >
2023-02-17 12:24:37 +01:00
$ { t . is _me _message || s ? "" : Gu `
2021-03-19 19:26:15 +01:00
< span class = "chat-msg__heading" >
2021-11-11 22:06:49 +01:00
< span class = "chat-msg__author" > < a class = "show-msg-author-modal" @ click = $ { e . showUserModal } > $ { t . username } < / a > < / s p a n >
2023-02-17 12:24:37 +01:00
$ { t . hats . map ( ( e => Gu ` <span class="badge badge-secondary"> ${ e . title } </span> ` ) ) }
2021-11-11 22:06:49 +01:00
< time timestamp = "${e.model.get(" edited ")||e.model.get(" time ")}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e >
2023-02-17 12:24:37 +01:00
$ { t . is _encrypted ? Gu ` <converse-icon class="fa fa-lock" size="1.1em"></converse-icon> ` : "" }
2021-03-19 19:26:15 +01:00
< / s p a n > ` }
2022-01-03 11:54:10 +01:00
2021-11-11 22:06:49 +01:00
< div class = "chat-msg__body chat-msg__body--${t.message_type} ${t.received?" chat - msg _ _body -- received ":" "} ${t.is_delayed?" chat - msg _ _body -- delayed ":" "}" >
2021-03-19 19:26:15 +01:00
< div class = "chat-msg__message" >
2023-02-17 12:24:37 +01:00
$ { t . is _me _message ? Gu `
2021-11-11 22:06:49 +01:00
< time timestamp = "${t.edited||t.time}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e > & n b s p ;
< span class = "chat-msg__author" > $ { t . is _me _message ? "**" : "" } $ { t . username } < / s p a n > & n b s p ; ` : " " }
$ { t . is _retracted ? e . renderRetraction ( ) : e . renderMessageText ( ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< converse - message - actions
. model = $ { e . model }
2022-01-03 11:54:10 +01:00
? is _retracted = $ { t . is _retracted } > < / c o n v e r s e - m e s s a g e - a c t i o n s >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "ogp_metadata" ) ? . map ( ( t => ! 0 === e . model . get ( "hide_url_previews" ) ? "" : Yh ( t [ "og:image" ] , "image" ) ? Gu ` <converse-message-unfurl
2021-11-11 22:06:49 +01:00
@ animationend = "${e.onUnfurlAnimationEnd}"
class = "${e.model.get(" url _preview _transition ")}"
2023-01-07 22:34:35 +01:00
jid = "${e.chatbox?.get(" jid ")}"
2021-11-11 22:06:49 +01:00
description = "${t[" og : description "]||" "}"
title = "${t[" og : title "]||" "}"
image = "${t[" og : image "]||" "}"
2023-01-07 22:34:35 +01:00
url = "${t[" og : url "]||" "}" > < / c o n v e r s e - m e s s a g e - u n f u r l > ` : " " ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ) ( t h i s , t h i s . g e t P r o p s ( ) ) } s h o u l d S h o w A v a t a r ( ) { r e t u r n I h . s e t t i n g s . g e t ( " s h o w _ m e s s a g e _ a v a t a r " ) & & ! t h i s . m o d e l . i s M e C o m m a n d ( ) & & [ " c h a t " , " g r o u p c h a t " , " n o r m a l " ] . i n c l u d e s ( t h i s . m o d e l . g e t ( " t y p e " ) ) } o n U n f u r l A n i m a t i o n E n d ( ) { " f a d e - o u t " = = = t h i s . m o d e l . g e t ( " u r l _ p r e v i e w _ t r a n s i t i o n " ) & & t h i s . m o d e l . s a v e ( { h i d e _ u r l _ p r e v i e w s : ! 0 , u r l _ p r e v i e w _ t r a n s i t i o n : " f a d e - i n " } ) } a s y n c o n R e t r y C l i c k e d ( ) { t h i s . s h o w _ s p i n n e r = ! 0 , t h i s . r e q u e s t U p d a t e ( ) , a w a i t I h . t r i g g e r ( t h i s . m o d e l . g e t ( " r e t r y _ e v e n t _ i d " ) , { s y n c h r o n o u s : ! 0 } ) , t h i s . m o d e l . d e s t r o y ( ) , t h i s . p a r e n t E l e m e n t . r e m o v e C h i l d ( t h i s ) } i s R e t r a c t e d ( ) { r e t u r n t h i s . m o d e l . g e t ( " r e t r a c t e d " ) | | " r e t r a c t e d " = = = t h i s . m o d e l . g e t ( " m o d e r a t e d " ) } h a s M e n t i o n s ( ) { r e t u r n " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) & & " t h e m " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) & & t h i s . c h a t b o x . i s U s e r M e n t i o n e d ( t h i s . m o d e l ) } g e t O c c u p a n t A f f i l i a t i o n ( ) { r e t u r n t h i s . m o d e l . o c c u p a n t ? . g e t ( " a f f i l i a t i o n " ) } g e t O c c u p a n t R o l e ( ) { r e t u r n t h i s . m o d e l . o c c u p a n t ? . g e t ( " r o l e " ) } g e t E x t r a M e s s a g e C l a s s e s ( ) { c o n s t e = [ t h i s . m o d e l . i s F o l l o w u p ( ) ? " c h a t - m s g - - f o l l o w u p " : n u l l , t h i s . m o d e l . g e t ( " i s _ d e l a y e d " ) ? " d e l a y e d " : n u l l , t h i s . m o d e l . i s M e C o m m a n d ( ) ? " c h a t - m s g - - a c t i o n " : n u l l , t h i s . i s R e t r a c t e d ( ) ? " c h a t - m s g - - r e t r a c t e d " : n u l l , t h i s . m o d e l . g e t ( " t y p e " ) , t h i s . s h o u l d S h o w A v a t a r ( ) ? " c h a t - m s g - - w i t h - a v a t a r " : n u l l ] . m a p ( ( e = > e ) ) ; r e t u r n " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) & & ( e . p u s h ( t h i s . g e t O c c u p a n t R o l e ( ) ? ? " " ) , e . p u s h ( t h i s . g e t O c c u p a n t A f f i l i a t i o n ( ) ? ? " " ) , " t h e m " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) & & t h i s . h a s M e n t i o n s ( ) & & e . p u s h ( " m e n t i o n e d " ) ) , t h i s . m o d e l . g e t ( " c o r r e c t i n g " ) & & e . p u s h ( " c o r r e c t i n g " ) , e . f i l t e r ( ( e = > e ) ) . j o i n ( " " ) } g e t D e r i v e d M e s s a g e P r o p s ( ) { c o n s t e = I h . s e t t i n g s . g e t ( " t i m e _ f o r m a t " ) ; r e t u r n { p r e t t y _ t i m e : x x ( t h i s . m o d e l . g e t ( " e d i t e d " ) | | t h i s . m o d e l . g e t ( " t i m e " ) ) . f o r m a t ( e ) , h a s _ m e n t i o n s : t h i s . h a s M e n t i o n s ( ) , h a t s : z S ( t h i s . m o d e l ) , i s _ f i r s t _ u n r e a d : t h i s . c h a t b o x . g e t ( " f i r s t _ u n r e a d _ i d " ) = = = t h i s . m o d e l . g e t ( " i d " ) , i s _ m e _ m e s s a g e : t h i s . m o d e l . i s M e C o m m a n d ( ) , i s _ r e t r a c t e d : t h i s . i s R e t r a c t e d ( ) , u s e r n a m e : t h i s . m o d e l . g e t D i s p l a y N a m e ( ) , s h o u l d _ s h o w _ a v a t a r : t h i s . s h o u l d S h o w A v a t a r ( ) } } g e t R e t r a c t i o n T e x t ( ) { i f ( [ " g r o u p c h a t " , " m e p " ] . i n c l u d e s ( t h i s . m o d e l . g e t ( " t y p e " ) ) & & t h i s . m o d e l . g e t ( " m o d e r a t e d _ b y " ) ) { c o n s t e = t h i s . m o d e l . g e t ( " m o d e r a t e d _ b y " ) , t = t h i s . m o d e l . c o l l e c t i o n . c h a t b o x ; t h i s . m o d e l . m o d | | ( t h i s . m o d e l . m o d = t . o c c u p a n t s . f i n d O c c u p a n t ( { j i d : e } ) | | t . o c c u p a n t s . f i n d O c c u p a n t ( { n i c k : S x . g e t R e s o u r c e F r o m J i d ( e ) } ) ) ; c o n s t n = t h i s . m o d e l . m o d ? t h i s . m o d e l . m o d . g e t D i s p l a y N a m e ( ) : " A m o d e r a t o r " ; r e t u r n G y ( " % 1 $ s h a s r e m o v e d t h i s m e s s a g e " , n ) } r e t u r n G y ( " % 1 $ s h a s r e m o v e d t h i s m e s s a g e " , t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ) } s h o w U s e r M o d a l ( e ) { i f ( " m e " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) ) I h . m o d a l . s h o w ( " c o n v e r s e - p r o f i l e - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) ; e l s e i f ( " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) ) e . p r e v e n t D e f a u l t ( ) , I h . m o d a l . s h o w ( " c o n v e r s e - m u c - o c c u p a n t - m o d a l " , { m o d e l : t h i s . m o d e l . o c c u p a n t , m e s s a g e : t h i s . m o d e l } , e ) ; e l s e { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . m o d e l . c o l l e c t i o n . c h a t b o x ; I h . m o d a l . s h o w ( " c o n v e r s e - u s e r - d e t a i l s - m o d a l " , { m o d e l : t } , e ) } } s h o w M e s s a g e V e r s i o n s M o d a l ( e ) { e . p r e v e n t D e f a u l t ( ) , I h . m o d a l . s h o w ( " c o n v e r s e - m e s s a g e - v e r s i o n s - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) } t o g g l e S p o i l e r M e s s a g e ( e ) { e ? . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { i s _ s p o i l e r _ v i s i b l e : ! t h i s . m o d e l . g e t ( " i s _ s p o i l e r _ v i s i b l e " ) } ) } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - h i s t o r y " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } , m e s s a g e s : { t y p e : A r r a y } } } r e n d e r ( ) { c o n s t e = t h i s . m e s s a g e s ; r e t u r n e . l e n g t h ? M w ( e , ( e = > e . g e t ( " i d " ) ) , ( e = > G u ` $ { t h i s . r e n d e r M e s s a g e ( e ) } ` ) ) : " " } r e n d e r M e s s a g e ( e ) { i f ( e . g e t ( " d a n g l i n g _ r e t r a c t i o n " ) | | e . g e t ( " i s _ o n l y _ k e y " ) ) r e t u r n " " ; c o n s t t = e . g e t ( " t e m p l a t e _ h o o k " ) ; i f ( " s t r i n g " = = t y p e o f t ) { c o n s t n = I h . h o o k ( t , e , " " ) ; r e t u r n v b ( n , " " ) } { c o n s t t = G u ` < c o n v e r s e - c h a t - m e s s a g e
2021-11-11 22:06:49 +01:00
jid = "${this.model.get(" jid ")}"
2023-02-17 12:24:37 +01:00
mid = "${e.get(" id ")}" > < / c o n v e r s e - c h a t - m e s s a g e > ` , n = f u n c t i o n ( e ) { c o n s t t = e . c o l l e c t i o n ? . m o d e l s ; i f ( ! t ) r e t u r n ; c o n s t n = t . i n d e x O f ( e ) , s = t [ n - 1 ] ; i f ( ! s | | N S ( e . g e t ( " t i m e " ) ) . i s A f t e r ( N S ( s . g e t ( " t i m e " ) ) , " d a y " ) ) { c o n s t t = N S ( e . g e t ( " t i m e " ) ) . s t a r t O f ( " d a y " ) ; r e t u r n b S ( { t y p e : " d a t e " , t i m e : t . t o I S O S t r i n g ( ) , d a t e s t r i n g : t . f o r m a t ( " d d d d M M M D o Y Y Y Y " ) } ) } } ( e ) ; r e t u r n n ? [ n , t ] : t } } } ) ; v a r E x = n ( 8 0 5 4 ) , A x = { } ; A x . s t y l e T a g T r a n s f o r m = o _ ( ) , A x . s e t A t t r i b u t e s = n _ ( ) , A x . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , A x . d o m A P I = K y ( ) , A x . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( E x . Z , A x ) ; E x . Z & & E x . Z . l o c a l s & & E x . Z . l o c a l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t - c o n t e n t " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } d i s c o n n e c t e d C a l l b a c k ( ) { s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) , t h i s . r e m o v e E v e n t L i s t e n e r ( " s c r o l l " , D S ) } a s y n c i n i t i a l i z e ( ) { a w a i t t h i s . s e t M o d e l s ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n _ o c c u p a n t s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " r e n d e r e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . m e s s a g e s , " r e s e t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . n o t i f i c a t i o n s , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . u i , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . u i , " c h a n g e : s c r o l l e d " , t h i s . s c r o l l D o w n ) , t h i s . m o d e l . o c c u p a n t s & & t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . a d d E v e n t L i s t e n e r ( " s c r o l l " , D S ) } a s y n c s e t M o d e l s ( ) { t h i s . m o d e l = a w a i t I h . c h a t b o x e s . g e t ( t h i s . j i d ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l ? G u `
2021-11-11 22:06:49 +01:00
< div class = "chat-content__notifications" > $ { this . model . getNotificationsText ( ) } < / d i v >
2021-03-19 19:26:15 +01:00
< converse - message - history
2021-11-11 22:06:49 +01:00
. model = $ { this . model }
. messages = $ { [ ... this . model . messages . models ] } >
2021-03-19 19:26:15 +01:00
< / c o n v e r s e - m e s s a g e - h i s t o r y >
2023-02-17 12:24:37 +01:00
$ { this . model . ui ? . get ( "chat-content-spinner-top" ) ? J _ ( ) : "" }
` :""}scrollDown(){if(!this.model.ui.get("scrolled")){if(this.scrollTo){const e=this.scrollTop?"smooth":"auto";this.scrollTo({top:0,behavior:e})}else this.scrollTop=0;Ih.trigger("chatBoxScrolledDown",{chatbox:this.model})}}});class Cx extends ob{constructor(e){if(super(e),this.it=Vu,e.type!==ib)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Vu||null==e)return this._t=void 0,this.it=e;if(e===Wu)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_ $ litType $ :this.constructor.resultType,strings:t,values:[]}}}Cx.directiveName="unsafeHTML",Cx.resultType=1;const $ x=rb(Cx);Ih.elements.define("converse-chat-help",class extends Vy{static get properties(){return{chat_type:{type:String},messages:{type:Array},model:{type:Object},type:{type:String}}}render(){const e=(new Date).toISOString();return[Gu ` < converse - icon class = "fas fa-times close-chat-help"
2021-03-19 19:26:15 +01:00
@ click = $ { this . close }
2023-02-17 12:24:37 +01:00
path - prefix = "${Ih.settings.get(" assets _path ")}"
size = "1em" > < / c o n v e r s e - i c o n > ` , . . . t h i s . m e s s a g e s . m a p ( ( t = > t h i s . r e n d e r H e l p M e s s a g e ( { i s o d a t e : e , m a r k u p : z o ( ) . s a n i t i z e ( t , { A L L O W E D _ T A G S : [ " s t r o n g " ] } ) } ) ) ) ] } c l o s e ( ) { t h i s . m o d e l . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 1 } ) } r e n d e r H e l p M e s s a g e ( e ) { r e t u r n G u ` < d i v c l a s s = " m e s s a g e c h a t - $ { t h i s . t y p e } " d a t a - i s o d a t e = " $ { e . i s o d a t e } " > $ { $ x ( e . m a r k u p ) } < / d i v > ` } } ) ; c o n s t k x = O h . e n v . u t i l s , j x = e = > { c o n s t t = I h . s e t t i n g s . g e t ( " e m o j i _ c a t e g o r i e s " ) ; r e t u r n G u ` < u l > $ { O b j e c t . k e y s ( t ) . m a p ( ( n = > t [ n ] ? ( e = > G u `
2021-11-11 22:06:49 +01:00
< li data - category = "${e.category}"
class = "emoji-category ${e.category} ${e.current_category===e.category?" picked ":" "}"
2023-02-17 12:24:37 +01:00
title = "${Gy(Ih.settings.get(" emoji _category _labels ")[e.category])}" >
2021-11-11 22:06:49 +01:00
< a class = "pick-category"
@ click = $ { e . onCategoryPicked }
href = "#emoji-picker-${e.category}"
data - category = "${e.category}" > $ { e . emoji } < / a >
< / l i >
2023-02-17 12:24:37 +01:00
` )(Object.assign({category:n,emoji:e.sn2Emoji(t[n])},e)):""))}</ul> ` } , Tx = e => Gu `
2022-05-05 23:06:17 +02:00
< li class = "emoji insert-emoji ${e.shouldBeHidden(e.emoji.sn)?" hidden ":" "}" data - emoji = "${e.emoji.sn}" title = "${e.emoji.sn}" >
2023-02-17 12:24:37 +01:00
< a href = "#" @ click = $ { e . insertEmoji } data - emoji = "${e.emoji.sn}" > $ { kx . shortnamesToEmojis ( e . emoji . sn ) } < / a >
2022-05-05 23:06:17 +02:00
< / l i >
2023-02-17 12:24:37 +01:00
` ,Nx=e=>{const t=Ih.settings.get("emoji_categories");return Gu `
2022-05-05 23:06:17 +02:00
< span ? hidden = $ { e . query } class = "emoji-lists__container emoji-lists__container--browse" >
2023-02-17 12:24:37 +01:00
$ { Object . keys ( t ) . map ( ( n => t [ n ] ? ( e => Gu `
< a id = "emoji-picker-${e.category}" class = "emoji-category__heading" data - category = "${e.category}" > $ { Gy ( Ih . settings . get ( "emoji_category_labels" ) [ e . category ] ) } < / a >
2022-05-05 23:06:17 +02:00
< ul class = "emoji-picker" data - category = "${e.category}" >
2023-02-17 12:24:37 +01:00
$ { Object . values ( Oh . emojis . json [ e . category ] ) . map ( ( t => Tx ( Object . assign ( { emoji : t } , e ) ) ) ) }
2022-05-05 23:06:17 +02:00
< / u l > ` ) ( O b j e c t . a s s i g n ( { c a t e g o r y : n } , e ) ) : " " ) ) }
2023-02-17 12:24:37 +01:00
< / s p a n > ` } , I x = e = > { c o n s t t = G y ( " S e a r c h " ) ; r e t u r n G u `
2022-05-05 23:06:17 +02:00
< div class = "emoji-picker__header" >
< input class = "form-control emoji-search" name = "emoji-search" placeholder = "${t}"
. value = $ { e . query || "" }
@ keydown = $ { e . onSearchInputKeyDown }
@ blur = $ { e . onSearchInputBlurred }
@ focus = $ { e . onSearchInputFocus } >
2023-02-17 12:24:37 +01:00
$ { e . query ? "" : jx ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . render _emojis ? Gu ` <converse-emoji-picker-content
2021-03-19 19:26:15 +01:00
. chatview = $ { e . chatview }
. model = $ { e . model }
. search _results = "${e.search_results}"
current _skintone = "${e.current_skintone}"
query = "${e.query}" > < / c o n v e r s e - e m o j i - p i c k e r - c o n t e n t > ` : " " }
< div class = "emoji-skintone-picker" >
2023-02-17 12:24:37 +01:00
< ul > $ { [ "tone1" , "tone2" , "tone3" , "tone4" , "tone5" ] . map ( ( t => ( e => Gu `
2021-03-19 19:26:15 +01:00
< li data - skintone = "${e.skintone}" class = "emoji-skintone ${e.current_skintone===e.skintone?" picked ":" "}" >
2023-02-17 12:24:37 +01:00
< a class = "pick-skintone" href = "#" data - skintone = "${e.skintone}" @ click = $ { e . onSkintonePicked } > $ { kx . shortnamesToEmojis ( ":" + e . skintone + ":" ) } < / a >
2021-11-11 22:06:49 +01:00
< / l i > ` ) ( O b j e c t . a s s i g n ( { s k i n t o n e : t } , e ) ) ) ) } < / u l >
2023-02-17 12:24:37 +01:00
< / d i v > ` } , { s i z z l e : O x } = O h . e n v ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - e m o j i - p i c k e r - c o n t e n t " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { c h a t v i e w : { t y p e : O b j e c t } , s e a r c h _ r e s u l t s : { t y p e : A r r a y } , c u r r e n t _ s k i n t o n e : { t y p e : S t r i n g } , m o d e l : { t y p e : O b j e c t } , q u e r y : { t y p e : S t r i n g } } } r e n d e r ( ) { c o n s t e = { c u r r e n t _ s k i n t o n e : t h i s . c u r r e n t _ s k i n t o n e , i n s e r t E m o j i : e = > t h i s . i n s e r t E m o j i ( e ) , q u e r y : t h i s . q u e r y , s e a r c h _ r e s u l t s : t h i s . s e a r c h _ r e s u l t s , s h o u l d B e H i d d e n : e = > t h i s . s h o u l d B e H i d d e n ( e ) } ; r e t u r n G u `
2021-03-19 19:26:15 +01:00
< div class = "emoji-picker__lists" >
2023-02-17 12:24:37 +01:00
$ { ( e => { const t = Gy ( "Search results" ) ; return Gu `
2021-03-19 19:26:15 +01:00
< span ? hidden = $ { ! e . query } class = "emoji-lists__container emojis-lists__container--search" >
< a id = "emoji-picker-search-results" class = "emoji-category__heading" > $ { t } < / a >
< ul class = "emoji-picker" >
2023-02-17 12:24:37 +01:00
$ { e . search _results . map ( ( t => Tx ( Object . assign ( { emoji : t } , e ) ) ) ) }
2021-03-19 19:26:15 +01:00
< / u l >
< / s p a n >
` })(e)}
2023-02-17 12:24:37 +01:00
$ { Nx ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
` }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)}Ox(".emoji-picker",this).forEach((e=>this.observer.observe(e)))}}setCategoryOnVisibilityChange(e){const t=this.parentElement.navigator.selected,n=e.filter((e=>e.target.contains(t))).pop();let s;if(s=n||e.reduce(((e,t)=>t.intersectionRatio>=(e?.intersectionRatio||0)?t:e),null),s&&s.isIntersecting){const e=s.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&&LS().includes(e))return!0;return!(!this.query||nd.FILTER_CONTAINS(e,this.query))}});const Mx=Oh.env.utils;Ih.elements.define("converse-emoji-dropdown",class extends ix{static get properties(){return{chatview:{type:Object}}}constructor(){super(),this.render_emojis=!1}initModel(){return this.init_promise||(this.init_promise=(async()=>{await Ih.emojis.initialize();const e= ` converse . emoji - $ { nd . bare _jid } - $ { this . chatview . model . get ( "jid" ) } ` ;this.model=new nd.EmojiPicker({id:e}),Xc(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(){const e=this.chatview.model.get("type")===nd.CHATROOMS_TYPE?"--muc-toolbar-btn-color":"--chat-toolbar-btn-color";return Gu `
2021-03-19 19:26:15 +01:00
< div class = "dropup" >
< button class = "toggle-emojis"
2023-02-17 12:24:37 +01:00
title = "${Gy(" Insert emojis ")}"
2021-03-19 19:26:15 +01:00
data - toggle = "dropdown"
aria - haspopup = "true"
aria - expanded = "false" >
< converse - icon
2022-04-02 21:20:14 +02:00
color = "var(${e})"
2021-03-19 19:26:15 +01:00
class = "fa fa-smile "
2023-02-17 12:24:37 +01:00
path - prefix = "${Ih.settings.get(" assets _path ")}"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n >
< div class = "dropdown-menu" >
2023-02-17 12:24:37 +01:00
$ { vb ( this . initModel ( ) . then ( ( ( ) => Gu `
2021-03-19 19:26:15 +01:00
< converse - emoji - picker
. chatview = $ { this . chatview }
. model = $ { this . model }
2022-04-02 21:20:14 +02:00
@ emojiSelected = $ { ( ) => this . hideMenu ( ) }
2021-03-19 19:26:15 +01:00
? render _emojis = $ { this . render _emojis }
current _category = "${this.model.get(" current _category ")||" "}"
current _skintone = "${this.model.get(" current _skintone ")||" "}"
query = "${this.model.get(" query ")||" "}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - e m o j i - p i c k e r > ` ) ) , " " ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . r e n d e r _ e m o j i s = ! 1 } t o g g l e M e n u ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , M x . h a s C l a s s ( " s h o w " , t h i s . m e n u ) ? M x . a n c e s t o r ( e . t a r g e t , " . t o g g l e - e m o j i s " ) & & t h i s . h i d e M e n u ( ) : t h i s . s h o w M e n u ( ) } a s y n c s h o w M e n u ( ) { a w a i t t h i s . i n i t M o d e l ( ) , t h i s . r e n d e r _ e m o j i s | | ( t h i s . r e n d e r _ e m o j i s = ! 0 , t h i s . r e q u e s t U p d a t e ( ) , a w a i t t h i s . u p d a t e C o m p l e t e ) , s u p e r . s h o w M e n u ( ) , s e t T i m e o u t ( ( ( ) = > t h i s . q u e r y S e l e c t o r ( " . e m o j i - s e a r c h " ) ? . f o c u s ( ) ) ) } } ) ; v a r R x = n ( 8 1 2 5 ) , D x = { } ; D x . s t y l e T a g T r a n s f o r m = o _ ( ) , D x . s e t A t t r i b u t e s = n _ ( ) , D x . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , D x . d o m A P I = K y ( ) , D x . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( R x . Z , D x ) ; R x . Z & & R x . Z . l o c a l s & & R x . Z . l o c a l s ; c o n s t z x = O h . e n v . u t i l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - e m o j i - p i c k e r " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { c h a t v i e w : { t y p e : O b j e c t } , c u r r e n t _ c a t e g o r y : { t y p e : S t r i n g , r e f l e c t : ! 0 } , c u r r e n t _ s k i n t o n e : { t y p e : S t r i n g , r e f l e c t : ! 0 } , m o d e l : { t y p e : O b j e c t } , q u e r y : { t y p e : S t r i n g , r e f l e c t : ! 0 } , r e n d e r _ e m o j i s : { t y p e : B o o l e a n } } } f i r s t U p d a t e d ( ) { s u p e r . f i r s t U p d a t e d ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( e = > t h i s . o n M o d e l C h a n g e d ( e . c h a n g e d ) ) ) , t h i s . i n i t A r r o w N a v i g a t i o n ( ) } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . q u e r y = " " , t h i s . _ s e a r c h _ r e s u l t s = [ ] , t h i s . d e b o u n c e d F i l t e r = v h ( ( e = > t h i s . m o d e l . s e t ( { q u e r y : e . v a l u e } ) ) , 2 5 0 ) } g e t s e a r c h _ r e s u l t s ( ) { r e t u r n t h i s . _ s e a r c h _ r e s u l t s } s e t s e a r c h _ r e s u l t s ( e ) { t h i s . _ s e a r c h _ r e s u l t s = e , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n I x ( { c h a t v i e w : t h i s . c h a t v i e w , c u r r e n t _ c a t e g o r y : t h i s . c u r r e n t _ c a t e g o r y , c u r r e n t _ s k i n t o n e : t h i s . c u r r e n t _ s k i n t o n e , m o d e l : t h i s . m o d e l , o n C a t e g o r y P i c k e d : e = > t h i s . c h o o s e C a t e g o r y ( e ) , o n S e a r c h I n p u t B l u r r e d : e = > t h i s . c h a t v i e w . e m i t F o c u s e d ( e ) , o n S e a r c h I n p u t F o c u s : e = > t h i s . o n S e a r c h I n p u t F o c u s ( e ) , o n S e a r c h I n p u t K e y D o w n : e = > t h i s . o n S e a r c h I n p u t K e y D o w n ( e ) , o n S k i n t o n e P i c k e d : e = > t h i s . c h o o s e S k i n T o n e ( e ) , q u e r y : t h i s . q u e r y , s e a r c h _ r e s u l t s : t h i s . s e a r c h _ r e s u l t s , r e n d e r _ e m o j i s : t h i s . r e n d e r _ e m o j i s , s n 2 E m o j i : e = > z x . s h o r t n a m e s T o E m o j i s ( t h i s . g e t T o n e d S h o r t n a m e ( e ) ) } ) } u p d a t e d ( e ) { e . h a s ( " q u e r y " ) & & t h i s . u p d a t e S e a r c h R e s u l t s ( e ) , e . h a s ( " c u r r e n t _ c a t e g o r y " ) & & t h i s . s e t S c r o l l P o s i t i o n ( ) } o n M o d e l C h a n g e d ( e ) { " c u r r e n t _ c a t e g o r y " i n e & & ( t h i s . c u r r e n t _ c a t e g o r y = e . c u r r e n t _ c a t e g o r y ) , " c u r r e n t _ s k i n t o n e " i n e & & ( t h i s . c u r r e n t _ s k i n t o n e = e . c u r r e n t _ s k i n t o n e ) , " q u e r y " i n e & & ( t h i s . q u e r y = e . q u e r y ) } s e t S c r o l l P o s i t i o n ( ) { i f ( t h i s . p r e s e r v e _ s c r o l l ) r e t u r n v o i d ( t h i s . p r e s e r v e _ s c r o l l = ! 1 ) ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . e m o j i - l i s t s _ _ c o n t a i n e r - - b r o w s e " ) , t = t h i s . q u e r y S e l e c t o r ( ` # e m o j i - p i c k e r - $ { t h i s . c u r r e n t _ c a t e g o r y } ` ) ; t & & ( e . s c r o l l T o p = t . o f f s e t T o p - 3 * t . o f f s e t H e i g h t + 4 ) } u p d a t e S e a r c h R e s u l t s ( e ) { c o n s t t = e . g e t ( " q u e r y " ) , n = n d . F I L T E R _ C O N T A I N S ; i f ( t h i s . q u e r y ) { i f ( t h i s . q u e r y = = = t ) r e t u r n t h i s . s e a r c h _ r e s u l t s ; t & & t h i s . q u e r y . i n c l u d e s ( t ) ? t h i s . s e a r c h _ r e s u l t s = t h i s . s e a r c h _ r e s u l t s . f i l t e r ( ( e = > n ( e . s n , t h i s . q u e r y ) ) ) : t h i s . s e a r c h _ r e s u l t s = O h . e m o j i s . l i s t . f i l t e r ( ( e = > n ( e . s n , t h i s . q u e r y ) ) ) } e l s e t h i s . s e a r c h _ r e s u l t s . l e n g t h & & ( t h i s . s e a r c h _ r e s u l t s = [ ] ) } r e g i s t e r E v e n t s ( ) { t h i s . o n G l o b a l K e y D o w n = e = > t h i s . _ o n G l o b a l K e y D o w n ( e ) ; d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . a d d E v e n t L i s t e n e r ( " k e y d o w n " , t h i s . o n G l o b a l K e y D o w n ) } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . r e g i s t e r E v e n t s ( ) } d i s c o n n e c t e d C a l l b a c k ( ) { d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . r e m o v e E v e n t L i s t e n e r ( " k e y d o w n " , t h i s . o n G l o b a l K e y D o w n ) , t h i s . d i s a b l e A r r o w N a v i g a t i o n ( ) , s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) } _ o n G l o b a l K e y D o w n ( e ) { t h i s . n a v i g a t o r & & ( e . k e y C o d e = = = D l . E N T E R & & z x . i s V i s i b l e ( t h i s ) ? t h i s . o n E n t e r P r e s s e d ( e ) : e . k e y C o d e = = = D l . D O W N _ A R R O W & & ! t h i s . n a v i g a t o r . e n a b l e d & & z x . i s V i s i b l e ( t h i s ) ? t h i s . e n a b l e A r r o w N a v i g a t i o n ( e ) : e . k e y C o d e = = = D l . E S C A P E & & ( t h i s . d i s a b l e A r r o w N a v i g a t i o n ( ) , s e t T i m e o u t ( ( ( ) = > t h i s . c h a t v i e w . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) . f o c u s ( ) ) , 5 0 ) ) ) } s e t C a t e g o r y F o r E l e m e n t ( e ) { c o n s t t = t h i s . c u r r e n t _ c a t e g o r y , n = e ? . g e t A t t r i b u t e ( " d a t a - c a t e g o r y " ) | | t ; t ! = = n & & t h i s . m o d e l . s a v e ( { c u r r e n t _ c a t e g o r y : n } ) } i n s e r t I n t o T e x t A r e a ( e ) { c o n s t t = t h i s . m o d e l . g e t ( " a u t o c o m p l e t i n g " ) , n = t h i s . m o d e l . g e t ( " a c _ p o s i t i o n " ) ; t h i s . m o d e l . s e t ( { a u t o c o m p l e t i n g : n u l l , q u e r y : " " , a c _ p o s i t i o n : n u l l } ) , t h i s . d i s a b l e A r r o w N a v i g a t i o n ( ) ; c o n s t s = { b u b b l e s : ! 0 , d e t a i l : { v a l u e : e , a u t o c o m p l e t i n g : t , a c _ p o s i t i o n : n , j i d : t h i s . c h a t v i e w . m o d e l . g e t ( " j i d " ) } } ; t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " e m o j i S e l e c t e d " , s ) ) } c h o o s e S k i n T o n e ( e ) { e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) ; c o n s t t = ( " I M G " = = = e . t a r g e t . n o d e N a m e ? e . t a r g e t . p a r e n t E l e m e n t : e . t a r g e t ) . g e t A t t r i b u t e ( " d a t a - s k i n t o n
< span class = "toolbar-buttons" > $ { vb ( e . getButtons ( ) , "" ) } < / s p a n >
$ { e . show _send _button ? function ( ) { const e = Gy ( "Send the message" ) ; return Gu ` <button type="submit" class="btn send-button" title=" ${ e } ">
2022-05-05 23:06:17 +02:00
< converse - icon color = "var(--toolbar-btn-text-color)" class = "fa fa-paper-plane" size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n > ` } ( ) : " " }
2023-02-17 12:24:37 +01:00
` ;var Px=n(6176),Fx={};Fx.styleTagTransform=o_(),Fx.setAttributes=n_(),Fx.insert=e_().bind(null,"head"),Fx.domAPI=Ky(),Fx.insertStyleElement=i_();Qy()(Px.Z,Fx);Px.Z&&Px.Z.locals&&Px.Z.locals;const Ux=Oh.env.Strophe;Ih.elements.define("converse-chat-toolbar",class extends Vy{static get properties(){return{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_send_button:{type:Boolean},show_spoiler_button:{type:Boolean}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change:composing_spoiler",(()=>this.requestUpdate()))}render(){return Lx(this)}firstUpdated(){Ih.trigger("renderToolbar",this)}getButtons(){const e=[];if(this.show_emoji_button){const t=nd.chatboxviews.get(this.model.get("jid"));e.push(Gu ` < converse - emoji - dropdown . chatview = $ { t } > < / c o n v e r s e - e m o j i - d r o p d o w n > ` ) } i f ( t h i s . s h o w _ c a l l _ b u t t o n ) { c o n s t t = t h i s . i s _ g r o u p c h a t ? " - - m u c - t o o l b a r - b t n - c o l o r " : " - - c h a t - t o o l b a r - b t n - c o l o r " , n = G y ( " S t a r t a c a l l " ) ; e . p u s h ( G u `
2022-04-02 21:20:14 +02:00
< button class = "toggle-call" @ click = $ { this . toggleCall } title = "${n}" >
2023-01-07 22:34:35 +01:00
< converse - icon color = "var(${t})" class = "fa fa-phone" size = "1em" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
< / b u t t o n > ` ) } I h . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & e . p u s h ( G u `
2021-11-11 22:06:49 +01:00
< converse - message - limit - indicator . model = $ { this . model } class = "right" >
2023-02-17 12:24:37 +01:00
< / c o n v e r s e - m e s s a g e - l i m i t - i n d i c a t o r > ` ) , t h i s . s h o w _ s p o i l e r _ b u t t o n & & e . p u s h ( t h i s . g e t S p o i l e r B u t t o n ( ) ) ; c o n s t t = I h . d i s c o . s u p p o r t s ( U x . N S . H T T P U P L O A D , n d . d o m a i n ) ; i f ( e . p u s h ( G u ` $ { v b ( t . t h e n ( ( e = > t h i s . g e t H T T P U p l o a d B u t t o n ( e ) ) ) , " " ) } ` ) , t h i s . i s _ g r o u p c h a t & & I h . s e t t i n g s . g e t ( " v i s i b l e _ t o o l b a r _ b u t t o n s " ) ? . t o g g l e _ o c c u p a n t s ) { c o n s t t = G y ( " H i d e p a r t i c i p a n t s " ) , n = G y ( " S h o w p a r t i c i p a n t s " ) ; e . p u s h ( G u `
2021-03-19 19:26:15 +01:00
< button class = "toggle_occupants right"
2023-01-07 22:34:35 +01:00
title = "${this.hidden_occupants?n:t}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleOccupants } >
2022-04-02 21:20:14 +02:00
< converse - icon
color = "var(--muc-toolbar-btn-color)"
class = "fa ${this.hidden_occupants?" fa - angle - double - left ":" fa - angle - double - right "}"
size = "1em" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
< / b u t t o n > ` ) } r e t u r n n d . a p i . h o o k ( " g e t T o o l b a r B u t t o n s " , t h i s , e ) } g e t H T T P U p l o a d B u t t o n ( e ) { i f ( e ) { c o n s t e = G y ( " C h o o s e a f i l e t o s e n d " ) , t = t h i s . i s _ g r o u p c h a t ? " - - m u c - t o o l b a r - b t n - c o l o r " : " - - c h a t - t o o l b a r - b t n - c o l o r " ; r e t u r n G u `
2021-03-19 19:26:15 +01:00
< button title = "${e}" @ click = $ { this . toggleFileUpload } >
2022-04-02 21:20:14 +02:00
< converse - icon
color = "var(${t})"
class = "fa fa-paperclip"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n >
2023-02-17 12:24:37 +01:00
< input type = "file" @ change = $ { this . onFileSelection } class = "fileupload" multiple = "" style = "display:none" / > ` }return""}getSpoilerButton(){const e=this.model;if(!this.is_groupchat&&!e.presence?.resources.length)return;let t;t=e.get("composing_spoiler")?Gy("Click to write as a normal (non-spoiler) message"):Gy("Click to write your message as a spoiler");const n=this.is_groupchat?"--muc-toolbar-btn-color":"--chat-toolbar-btn-color",s=Gu `
2021-03-19 19:26:15 +01:00
< button class = "toggle-compose-spoiler"
2023-01-07 22:34:35 +01:00
title = "${t}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleComposeSpoilerMessage } >
2022-04-02 21:20:14 +02:00
< converse - icon
2023-01-07 22:34:35 +01:00
color = "var(${n})"
class = "fa ${e.get(" composing _spoiler ")?" fa - eye - slash ":" fa - eye "}"
2022-04-02 21:20:14 +02:00
size = "1em" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
< /button>`;if(this.is_groupchat)return s;{const t=e.get("jid"),n=Promise.all(e.presence.resources.map((e=>Ih.disco.supports(Ux.NS.SPOILER,`${t}/ $ { e . get ( "name" ) } ` )))).then((e=>e.reduce(((e,t)=>e&&t),!0)));return Gu ` $ { vb ( n . then ( ( ( ) => s ) ) , "" ) } ` }}toggleFileUpload(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.querySelector(".fileupload").click()}onFileSelection(e){this.model.sendFiles(e.target.files)}toggleComposeSpoilerMessage(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.model.set("composing_spoiler",!this.model.get("composing_spoiler"))}toggleOccupants(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.model.save({hidden_occupants:!this.model.get("hidden_occupants")})}toggleCall(e){e?.preventDefault?.(),e?.stopPropagation?.(),Ih.trigger("callButtonClicked",{connection:nd.connection,model:this.model})}});var Bx=n(7802),qx={};qx.styleTagTransform=o_(),qx.setAttributes=n_(),qx.insert=e_().bind(null,"head"),qx.domAPI=Ky(),qx.insertStyleElement=i_();Qy()(Bx.Z,qx);Bx.Z&&Bx.Z.locals&&Bx.Z.locals;async function Hx(e){await Ih.confirm(Gy("Are you sure you want to clear the messages from this conversation?"))&&await e.clearMessages()}function Gx(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=""}Ih.elements.define("converse-chat-heading",class extends Vy{static get properties(){return{jid:{type:String}}}initialize(){this.model=nd.chatboxes.get(this.jid),this.listenTo(this.model,"change:status",(()=>this.requestUpdate())),this.listenTo(this.model,"vcard:add",(()=>this.requestUpdate())),this.listenTo(this.model,"vcard:change",(()=>this.requestUpdate())),this.model.contact&&this.listenTo(this.model.contact,"destroy",(()=>this.requestUpdate())),this.model.rosterContactAdded?.then((()=>{this.listenTo(this.model.contact,"change:nickname",(()=>this.requestUpdate())),this.requestUpdate()}))}render(){return(e=>{const t=Gy("The User's Profile Image"),n=Gu ` < span title = "${t}" >
2022-01-03 11:54:10 +01:00
< converse - avatar
class = "avatar chat-msg__avatar"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2023-02-17 12:24:37 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r > < / s p a n > ` , s = e . m o d e l . g e t D i s p l a y N a m e ( ) ; r e t u r n G u `
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
2023-02-17 12:24:37 +01:00
$ { nd . api . settings . get ( "singleton" ) ? "" : Gu ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
$ { e . type !== nd . HEADLINES _TYPE ? Gu ` <a class="show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ n } </a> ` : "" }
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__text" title = "${e.jid}" >
2023-02-17 12:24:37 +01:00
$ { e . type !== nd . HEADLINES _TYPE ? Gu ` <a class="user show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ s } </a> ` : s }
2021-11-11 22:06:49 +01:00
< / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__buttons row no-gutters" >
2023-02-17 12:24:37 +01:00
$ { vb ( MS ( e . heading _buttons _promise ) , "" ) }
$ { vb ( OS ( e . heading _buttons _promise ) , "" ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . status ? Gu ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` })(Object.assign(this.model.toJSON(),{heading_buttons_promise:this.getHeadingButtons(),model:this.model,showUserDetailsModal:e=>this.showUserDetailsModal(e)}))}showUserDetailsModal(e){e.preventDefault(),Ih.modal.show("converse-user-details-modal",{model:this.model},e)}close(e){e.preventDefault(),this.model.close()}getHeadingButtons(){const e=[{a_class:"show-user-details-modal",handler:e=>this.showUserDetailsModal(e),i18n_text:Gy("Details"),i18n_title:Gy("See more information about this person"),icon_class:"fa-id-card",name:"details",standalone:"overlayed"===Ih.settings.get("view_mode")}];Ih.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Gy("Close"),i18n_title:Gy("Close and end this conversation"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Ih.settings.get("view_mode")});const t=nd.chatboxviews.get(this.getAttribute("jid"));return t?nd.api.hook("getHeadingButtons",t,e):e}});const{u:Wx}=Oh.env;class Vx extends C_{async connectedCallback(){super.connectedCallback(),this.model=nd.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.listenTo(this.model.messages,"change:correcting",this.onMessageCorrecting),this.listenTo(this.model,"change:composing_spoiler",(()=>this.render())),this.handleEmojiSelection=e=>{let{detail:t}=e;this.model.get("jid")===t.jid&&this.insertIntoTextArea(t.value,t.autocompleting,!1,t.ac_position)},document.addEventListener("emojiSelected",this.handleEmojiSelection),this.render()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("emojiSelected",this.handleEmojiSelection)}toHTML(){return(e=>{const t=e.composing_spoiler?Gy("Hidden message"):Gy("Message"),n=Gy("Optional hint"),s=Ih.settings.get("show_send_button");return Gu `
2021-11-11 22:06:49 +01:00
< form class = "sendXMPPMessage" >
2022-05-05 23:06:17 +02:00
< input type = "text"
enterkeyhint = "send"
placeholder = "${n||" "}" i
value = "${e.hint_value||" "}"
class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
2021-11-11 22:06:49 +01:00
< textarea
autofocus
type = "text"
2022-05-05 23:06:17 +02:00
enterkeyhint = "send"
2021-11-11 22:06:49 +01:00
@ drop = $ { e . onDrop }
2023-02-17 12:24:37 +01:00
@ input = $ { Gx }
2021-11-11 22:06:49 +01:00
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea
2022-05-05 23:06:17 +02:00
$ { s ? "chat-textarea-send-button" : "" }
2021-11-11 22:06:49 +01:00
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
2023-02-17 12:24:37 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { o n D r o p : e = > t h i s . o n D r o p ( e ) , h i n t _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . s p o i l e r - h i n t " ) ? . v a l u e , m e s s a g e _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ? . v a l u e , o n C h a n g e : e = > t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) , o n K e y D o w n : e = > t h i s . o n K e y D o w n ( e ) , o n K e y U p : e = > t h i s . o n K e y U p ( e ) , o n P a s t e : e = > t h i s . o n P a s t e ( e ) , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) ) } i n s e r t I n t o T e x t A r e a ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] & & a r g u m e n t s [ 1 ] , n = a r g u m e n t s . l e n g t h > 2 & & v o i d 0 ! = = a r g u m e n t s [ 2 ] & & a r g u m e n t s [ 2 ] , s = a r g u m e n t s . l e n g t h > 3 ? a r g u m e n t s [ 3 ] : v o i d 0 ; c o n s t i = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ; i f ( n ? W x . a d d C l a s s ( " c o r r e c t i n g " , i ) : W x . r e m o v e C l a s s ( " c o r r e c t i n g " , i ) , t ) i . v a l u e = s & & " s t r i n g " = = t y p e o f t ? i . v a l u e . r e p l a c e ( n e w R e g E x p ( t , " g " ) , ( ( n , i ) = > i = = s - t . l e n g t h ? e + " " : n ) ) : e ; e l s e { l e t t = i . v a l u e ; t & & " " ! = = t [ t . l e n g t h - 1 ] & & ( t + = " " ) , i . v a l u e = t + e + " " } c o n s t r = d o c u m e n t . c r e a t e E v e n t ( " H T M L E v e n t s " ) ; r . i n i t E v e n t ( " c h a n g e " , ! 1 , ! 0 ) , i . d i s p a t c h E v e n t ( r ) , W x . p l a c e C a r e t A t E n d ( i ) } o n M e s s a g e C o r r e c t i n g ( e ) { i f ( e . g e t ( " c o r r e c t i n g " ) ) t h i s . i n s e r t I n t o T e x t A r e a ( v l ( e ) , ! 0 , ! 0 ) ; e l s e { c o n s t t = t h i s . m o d e l . m e s s a g e s . f i n d W h e r e ( " c o r r e c t i n g " ) ; t & & t ! = = e ? t h i s . i n s e r t I n t o T e x t A r e a ( v l ( e ) , ! 0 , ! 0 ) : t h i s . i n s e r t I n t o T e x t A r e a ( " " , ! 0 , ! 1 ) } } o n E s c a p e P r e s s e d ( e ) { c o n s t t = t h i s . m o d e l . m e s s a g e s . f i n d L a s t I n d e x ( " c o r r e c t i n g " ) , n = t > = 0 ? t h i s . m o d e l . m e s s a g e s . a t ( t ) : n u l l ; n & & ( e . p r e v e n t D e f a u l t ( ) , n . s a v e ( " c o r r e c t i n g " , ! 1 ) , t h i s . i n s e r t I n t o T e x t A r e a ( " " , ! 0 , ! 1 ) ) } o n P a s t e ( e ) { i f ( e . s t o p P r o p a g a t i o n ( ) , 0 ! = = e . c l i p b o a r d D a t a . f i l e s . l e n g t h ) r e t u r n e . p r e v e n t D e f a u l t ( ) , v o i d t h i s . m o d e l . s e n d F i l e s ( A r r a y . f r o m ( e . c l i p b o a r d D a t a . f i l e s ) ) ; t h i s . m o d e l . s e t ( { d r a f t : e . c l i p b o a r d D a t a . g e t D a t a ( " t e x t / p l a i n " ) } ) } o n K e y U p ( e ) { t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) } o n K e y D o w n ( e ) { i f ( ! e . c t r l K e y ) { i f ( ! e . s h i f t K e y & & ! e . a l t K e y & & ! e . m e t a K e y ) i f ( e . k e y C o d e = = = O h . k e y c o d e s . T A B ) { c o n s t t = W x . g e t C u r r e n t W o r d ( e . t a r g e t , n u l l , / ( : . * ? : ) / g ) ; t . s t a r t s W i t h ( " : " ) & & ( e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) , t h i s . m o d e l . t r i g g e r ( " e m o j i - p i c k e r - a u t o c o m p l e t e " , e . t a r g e t , t ) ) } e l s e { i f ( e . k e y C o d e = = = O h . k e y c o d e s . F O R W A R D _ S L A S H ) r e t u r n ; i f ( e . k e y C o d e = = = O h . k e y c o d e s . E S C A P E ) r e t u r n t h i s . o n E s c a p e P r e s s e d ( e , t h i s ) ; i f ( e . k e y C o d e = = = O h . k e y c o d e s . E N T E R ) r e t u r n t h i s . o n F o r m S u b m i t t e d ( e ) ; i f ( e . k e y C o d e ! = = O h . k e y c o d e s . U P _ A R R O W | | e . t a r g e t . s e l e c t i o n E n d ) { i f ( e . k e y C o d e = = = O h . k e y c o d e s . D O W N _ A R R O W & & e . t a r g e t . s e l e c t i o n E n d = = = e . t a r g e t . v a l u e . l e n g t h & & W x . h a s C l a s s ( " c o r r e c t i n g " , t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ) ) r e t u r n t h i s . m o d e l . e d i t L a t e r M e s s a g e ( ) } e l s e { c o n s t e = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ; i f ( ! e . v a l u e | | W x . h a s C l a s s ( " c o r r e c t i n g " , e ) ) r e t u r n t h i s . m o d e l . e d i t E a r l i e r M e s s a g e ( ) } } [ O h . k e y c o d e s . S H I F T , O h . k e y c o d e s . M E T A , O h . k e y c o d e s . M E T A _ R I G H T , O h . k e y c o d e s . E S C A P E , O h . k e y c o d e s . A L T ] . i n c l u d e s ( e . k e y C o d e ) | | t h i s . m o d e l . g e t ( " c h a t _ s t a t e " ) ! = = n d . C O M P O S I N G & & t h i s . m o d e l . s e t C h a t S t a t e ( n d . C O M P O S I N G ) } } a s y n c o n F o r m S u b m i t t e d ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) , n = t . v a l u e . t r i m ( ) ; i f ( I h . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & n . l e n g t h > I h . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) | | ! n . r e p l a c e ( / \ s / g , " " ) . l e n g t h ) r e t u r n ; i f ( ! n d . c o n n e c t i o n . a u t h e n t i c a t e d ) { c o n s t e = G y ( " S o r r y , t h e c o n n e c t i o n h a s b e e n l o s t , a n d y o u r m e s s a g e c o u l d n o t b e s e n t " ) ; r e t u r n I h . a l e r t ( " e r r o r " , G y ( " E r r o r " ) , e ) , v o i d I h . c o n n e c t i o n . r e c o n n e c t ( ) } l e t s , i = { } ; t h i s . m o d e l . g e t ( " c o m p o s i n g _ s p o i l e r " ) & & ( i = t h i s . q u e r y S e l e c t o r ( " f o r m . s e n d X M P P M e s s a g e i n p u t . s p o i l e r - h i n t " ) , s = i . v a l u e ) , W x . a d d C l a s s ( " d i s a b l e d " , t ) , t . s e t A t t r i b u t e ( " d i s a b l e d " , " d i s a b l e d " ) , t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - e m o j i - d r o p d o w n " ) ? . h i d e M e n u ( ) ; c o n s t r = a w a i t a s y n c f u n c t i o n ( e , t ) { c o n s t n = t . r e p l a c e ( / ^ \ s * / , " " ) . m a t c h ( / ^ \ / ( . * ) \ s * $ / ) ; i f ( n ) { l e t s = ! 1 ; i f ( s = a w a i t I h . h o o k ( " p a r s e M e s s a g e F o r C o m m a n d s " , { m o d e l : e , t e x t : t } , s ) , s ) r e t u r n ! 0 ; i f ( " c l e a r " = = = n [ 1 ] ) r e t u r n H x ( e ) , ! 0 ; i f ( " c l o s e " = = = n [ 1 ] ) r e t u r n n d . c h a t b o x v i e w s . g e t ( e . g e t ( " j i d " ) ) ? . c l o s e ( ) , ! 0 ; i f ( " h e l p " = = = n [ 1 ] ) r e t u r n e . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 1 } , { s i l e n t : ! 0 } ) , e . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 0 } ) , ! 0 } r e t u r n ! 1 } ( t h i s . m o d e l , n ) , o = r ? n u l l : a w a i t t h i s . m o d e l . s e n d M e s s a g e ( { b o d y : n , s p o i l e r _ h i n t : s } ) ; i f ( ( r | | o ) & & ( i . v a l u e = " " , t . v a l u e = " " , W x . r e m o v e C l a s s ( " c o r r e c t i n g " , t ) , t . s t y l e . h e i g h t = " a u t o " , t h i s . m o d e l . s e t ( { d r a f t : " " } ) ) , " o v e r l a y e d " = = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ) { n d . c h a t b o x v i e w s . g e t ( t h i s . g e t A t t r i b u t e ( " j i d " ) ) . q u e r y S e l e c t o r ( " . c h a t - c o n t e n t _ _ m e s s a g e s " ) . p a r e n t E l e m e n t . s t y l e . d i s p l a y = " n o n e " } i f ( t . r e m o v e A t t r i b u t e (
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? Gu ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { Ih . settings . get ( "show_toolbar" ) ? Gu `
2021-11-11 22:06:49 +01:00
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? composing _spoiler = "${e.model.get(" composing _spoiler ")}"
2022-05-05 23:06:17 +02:00
? show _call _button = "${s}"
? show _emoji _button = "${i}"
2022-12-17 22:08:36 +01:00
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
2021-11-11 22:06:49 +01:00
? show _toolbar = "${a}"
message _limit = "${n}" > < / c o n v e r s e - c h a t - t o o l b a r > ` : " " }
< converse - message - form jid = "${e.model.get(" jid ")}" > < / c o n v e r s e - m e s s a g e - f o r m >
2023-02-17 12:24:37 +01:00
` })({model:this.model,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}sendButtonClicked(e){this.querySelector("converse-message-form")?.onFormSubmitted(e)}viewUnreadMessages(e){e?.preventDefault?.(),this.model.ui.set({scrolled:!1})}emitFocused(e){nd.chatboxviews.get(this.getAttribute("jid"))?.emitFocused(e)}emitBlurred(e){nd.chatboxviews.get(this.getAttribute("jid"))?.emitBlurred(e)}onDrop(e){0!=e.dataTransfer.files.length&&(e.preventDefault(),this.model.sendFiles(e.dataTransfer.files))}onDragOver(e){e.preventDefault()}clearMessages(e){e?.preventDefault?.(),Hx(this.model)}async autocompleteInPicker(e,t){await Ih.emojis.initialize();const n=this.querySelector("converse-emoji-picker");if(n){n.model.set({ac_position:e.selectionStart,autocompleting:t,query:t});this.querySelector("converse-emoji-dropdown")?.showMenu()}}}Ih.elements.define("converse-chat-bottom-panel",Qx);class Yx extends Vy{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),nd.chatboxviews.remove(this.jid,this)}updated(){this.model&&this.jid!==this.model.get("jid")&&(this.stopListening(),nd.chatboxviews.remove(this.model.get("jid"),this),delete this.model,this.requestUpdate(),this.initialize())}close(e){return e?.preventDefault?.(),this.model.close(e)}maybeFocus(){Ih.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)||Ih.trigger("chatBoxBlurred",this,e)}emitFocused(e){this.contains(e.relatedTarget)||Ih.trigger("chatBoxFocused",this,e)}getBottomPanel(){return this.model.get("type")===nd.CHATROOMS_TYPE?this.querySelector("converse-muc-bottom-panel"):this.querySelector("converse-chat-bottom-panel")}getMessageForm(){return this.model.get("type")===nd.CHATROOMS_TYPE?this.querySelector("converse-muc-message-form"):this.querySelector("converse-message-form")}scrollDown(e){e?.preventDefault?.(),e?.stopPropagation?.(),this.model.ui.get("scrolled")&&this.model.ui.set({scrolled:!1}),RS(this.model)}onWindowStateChanged(e){"visible"===e.state?this.model.isHidden()||this.model.clearUnreadMsgCounter():"hidden"===e.state&&(this.model.setChatState(nd.INACTIVE,{silent:!0}),this.model.sendChatState())}}class Kx extends Yx{length=200;async initialize(){nd.chatboxviews.add(this.jid,this),this.model=nd.chatboxes.get(this.jid),this.listenTo(nd,"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())),await this.model.messages.fetched,!this.model.get("hidden")&&this.afterShown(),Ih.trigger("chatBoxViewInitialized",this)}render(){return(e=>Gu `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2023-02-17 12:24:37 +01:00
$ { e . model ? Gu `
2021-11-11 22:06:49 +01:00
< converse - chat - heading jid = "${e.jid}" class = "chat-head chat-head-chatbox row no-gutters" > < / c o n v e r s e - c h a t - h e a d i n g >
< div class = "chat-body" >
< div class = "chat-content ${e.show_send_button?" chat - content - sendbutton ":" "}" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.jid}" > < / c o n v e r s e - c h a t - c o n t e n t >
2021-03-19 19:26:15 +01:00
2023-02-17 12:24:37 +01:00
$ { e . show _help _messages ? Gu ` <div class="chat-content__help">
2021-11-11 22:06:49 +01:00
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . help _messages }
? hidden = $ { ! e . show _help _messages }
type = "info"
2023-02-17 12:24:37 +01:00
chat _type = "${nd.CHATROOMS_TYPE}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - c h a t - h e l p > < / d i v > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< converse - chat - bottom - panel jid = "${e.jid}" class = "bottom-panel" > < / c o n v e r s e - c h a t - b o t t o m - p a n e l >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
` :""}
< / d i v >
2023-02-17 12:24:37 +01:00
` )(Object.assign({model:this.model,help_messages:this.getHelpMessages(),show_help_messages:this.model.get("show_help_messages")},this.model.toJSON()))}getHelpMessages(){return[ ` < strong > / c l e a r < / s t r o n g > : $ { G y ( " R e m o v e m e s s a g e s " ) } ` , ` < s t r o n g > / c l o s e < / s t r o n g > : $ { G y ( " C l o s e t h i s c h a t " ) } ` , ` < s t r o n g > / m e < / s t r o n g > : $ { G y ( " W r i t e i n t h e t h i r d p e r s o n " ) } ` , ` < s t r o n g > / h e l p < / s t r o n g > : $ { G y ( " S h o w t h i s m e n u " ) } ` ] } a f t e r S h o w n ( ) { t h i s . m o d e l . s e t C h a t S t a t e ( n d . A C T I V E ) , t h i s . m o d e l . c l e a r U n r e a d M s g C o u n t e r ( ) , t h i s . m a y b e F o c u s ( ) } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t " , K x ) ; v a r X x = n ( 5 5 9 9 ) , e E = { } ; e E . s t y l e T a g T r a n s f o r m = o _ ( ) , e E . s e t A t t r i b u t e s = n _ ( ) , e E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , e E . d o m A P I = K y ( ) , e E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( X x . Z , e E ) ; X x . Z & & X x . Z . l o c a l s & & X x . Z . l o c a l s ; c o n s t { S t r o p h e : t E } = O h . e n v ; O h . p l u g i n s . a d d ( " c o n v e r s e - c h a t v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - c h a t b o x v i e w s " , " c o n v e r s e - c h a t " , " c o n v e r s e - d i s c o " , " c o n v e r s e - m o d a l " ] , i n i t i a l i z e ( ) { I h . s e t t i n g s . e x t e n d ( { a l l o w e d _ a u d i o _ d o m a i n s : n u l l , a l l o w e d _ i m a g e _ d o m a i n s : n u l l , a l l o w e d _ v i d e o _ d o m a i n s : n u l l , a u t o _ f o c u s : ! 0 , d e b o u n c e d _ c o n t e n t _ r e n d e r i n g : ! 0 , f i l t e r _ u r l _ q u e r y _ p a r a m s : n u l l , i m a g e _ u r l s _ r e g e x : n u l l , m e s s a g e _ l i m i t : 0 , m u c _ h a t s : [ " x e p 3 1 7 " ] , r e n d e r _ m e d i a : ! 0 , s h o w _ m e s s a g e _ a v a t a r : ! 0 , s h o w _ r e t r a c t i o n _ w a r n i n g : ! 0 , s h o w _ s e n d _ b u t t o n : ! 0 , s h o w _ t o o l b a r : ! 0 , t i m e _ f o r m a t : " H H : m m " , u s e _ s y s t e m _ e m o j i s : ! 0 , v i s i b l e _ t o o l b a r _ b u t t o n s : { c a l l : ! 1 , c l e a r : ! 0 , e m o j i : ! 0 , s p o i l e r : ! 0 } } ) , n d . C h a t B o x V i e w = K x , I h . l i s t e n . o n ( " c o n n e c t e d " , ( ( ) = > I h . d i s c o . o w n . f e a t u r e s . a d d ( t E . N S . S P O I L E R ) ) ) , I h . l i s t e n . o n ( " c h a t B o x C l o s e d " , ( e = > { r e t u r n t = e . g e t ( " j i d " ) , v o i d ( n d . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) = = = ` c o n v e r s e / c h a t ? j i d = $ { t } ` & & n d . r o u t e r . n a v i g a t e ( " " ) ) ; v a r t } ) ) } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - b r a n d - b y l i n e " , c l a s s e x t e n d s V y { r e n d e r ( ) { c o n s t e = " f u l l s c r e e n " = = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ; r e t u r n G u `
$ { e ? Gu `
< p class = "brand-subtitle" > $ { nd . VERSION _NAME } < / p >
2021-11-11 22:06:49 +01:00
< p class = "brand-subtitle" >
< a target = "_blank" rel = "nofollow" href = "https://conversejs.org" > Open Source < / a > X M P P c h a t c l i e n t
brought to you by < a target = "_blank" rel = "nofollow" href = "https://opkode.com" > Opkode < / a >
< / p >
< p class = "brand-subtitle" >
< a target = "_blank" rel = "nofollow" href = "https://hosted.weblate.org/projects/conversejs/#languages"
> Translate < / a
>
it into your own language
< / p >
` :""}
2023-02-17 12:24:37 +01:00
` }});Ih.elements.define("converse-brand-logo",class extends Vy{render(){const e="fullscreen"===Ih.settings.get("view_mode");return Gu `
2021-11-11 22:06:49 +01:00
< a class = "brand-heading" href = "https://conversejs.org" target = "_blank" rel = "noopener" >
< span class = "brand-name-wrapper ${e?" brand - name - wrapper -- fullscreen ":" "}" >
< svg
class = "converse-svg-logo"
xmlns : svg = "http://www.w3.org/2000/svg"
xmlns = "http://www.w3.org/2000/svg"
xmlns : xlink = "http://www.w3.org/1999/xlink"
viewBox = "0 0 364 364" >
2021-03-19 19:26:15 +01:00
2021-11-11 22:06:49 +01:00
< title > Converse < / t i t l e >
< g class = "cls-1" id = "g904" >
< g data - name = "Layer 2" >
< g data - name = "Layer 7" >
< path
class = "cls-3"
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"
/ >
< path
class = "cls-4"
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"
/ >
< / g >
2021-03-19 19:26:15 +01:00
< / g >
< / g >
2021-11-11 22:06:49 +01:00
< / s v g >
< span class = "brand-name" >
< span class = "brand-name__text" > converse < span class = "subdued" > . js < / s p a n > < / s p a n >
2023-02-17 12:24:37 +01:00
$ { e ? Gu `
2021-11-11 22:06:49 +01:00
< p class = "byline" > messaging freedom < / p >
` :""}
< / s p a n >
2021-03-19 19:26:15 +01:00
< / s p a n >
2021-11-11 22:06:49 +01:00
< / a >
2023-02-17 12:24:37 +01:00
` }});Ih.elements.define("converse-brand-heading",class extends Vy{render(){return Gu `
2021-11-11 22:06:49 +01:00
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
< converse - brand - byline > < / c o n v e r s e - b r a n d - b y l i n e >
2023-02-17 12:24:37 +01:00
` }});const{Strophe:nE}=Oh.env,sE=[nE.Status.ERROR,nE.Status.CONNECTING,nE.Status.CONNFAIL,nE.Status.AUTHENTICATING,nE.Status.AUTHFAIL,nE.Status.DISCONNECTING,nE.Status.RECONNECTING],iE=Object.fromEntries([[nE.Status.ERROR,"Error"],[nE.Status.CONNECTING,"Connecting"],[nE.Status.CONNFAIL,"Connection failure"],[nE.Status.AUTHENTICATING,"Authenticating"],[nE.Status.AUTHFAIL,"Authentication failure"],[nE.Status.CONNECTED,"Connected"],[nE.Status.DISCONNECTED,"Disconnected"],[nE.Status.DISCONNECTING,"Disconnecting"],[nE.Status.ATTACHED,"Attached"],[nE.Status.REDIRECT,"Redirect"],[nE.Status.CONNTIMEOUT,"Connection timeout"],[nE.Status.RECONNECTING,"Reconnecting"]]),rE=Object.fromEntries([[nE.Status.ERROR,"error"],[nE.Status.CONNECTING,"info"],[nE.Status.CONNFAIL,"error"],[nE.Status.AUTHENTICATING,"info"],[nE.Status.AUTHFAIL,"error"],[nE.Status.CONNECTED,"info"],[nE.Status.DISCONNECTED,"error"],[nE.Status.DISCONNECTING,"warn"],[nE.Status.ATTACHED,"info"],[nE.Status.REDIRECT,"info"],[nE.Status.RECONNECTING,"warn"]]),oE=e=>{const t=Ih.settings.get("authentication"),n=Gy("Log in"),s=Gy("XMPP Address"),i=Ih.settings.get("locked_domain"),r=Ih.settings.get("default_domain"),o=(i||r)&&Gy("Username")||Gy("user@domain"),a=Ih.settings.get("allow_user_trust_override");return Gu `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
2022-05-05 23:06:17 +02:00
< label for = "converse-login-jid" > $ { s } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "converse-login-jid"
2023-02-17 12:24:37 +01:00
? autofocus = $ { ! ! Ih . settings . get ( "auto_focus" ) }
2022-04-02 21:20:14 +02:00
@ changed = $ { e . validate }
2023-02-17 12:24:37 +01:00
value = "${Ih.settings.get(" jid ")??" "}"
2021-03-19 19:26:15 +01:00
required
class = "form-control"
type = "text"
name = "jid"
2022-12-17 22:08:36 +01:00
placeholder = "${o}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { t !== nd . EXTERNAL ? ( ( ) => { const e = Gy ( "Password" ) ; return Gu `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label for = "converse-login-password" > $ { e } < / l a b e l >
2022-04-02 21:20:14 +02:00
< input id = "converse-login-password"
class = "form-control"
required = "required"
2023-02-17 12:24:37 +01:00
value = "${Ih.settings.get(" password ")??" "}"
2022-04-02 21:20:14 +02:00
type = "password"
name = "password"
placeholder = "${e}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
` })():""}
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "show_connection_url_input" ) ? ( ( ) => { const e = Gy ( "Connection URL" ) , t = Gy ( "HTTP or websocket URL that is used to connect to your XMPP server" ) , n = Gy ( "e.g. wss://example.org/xmpp-websocket" ) ; return Gu `
2022-04-02 21:20:14 +02:00
< div class = "form-group fade-in" >
< label for = "converse-conn-url" > $ { e } < / l a b e l >
< p class = "form-help instructions" > $ { t } < / p >
< input id = "converse-conn-url"
class = "form-control"
type = "url"
name = "connection-url"
placeholder = "${n}" / >
< / d i v >
` })():""}
2023-02-17 12:24:37 +01:00
$ { a ? ( e => { const t = Gy ( "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 = Gy ( "This is a trusted device" ) ; return Gu `
2021-03-19 19:26:15 +01:00
< div class = "form-group form-check login-trusted" >
< input id = "converse-login-trusted" type = "checkbox" class = "form-check-input" name = "trusted" ? checked = $ { e } >
< label for = "converse-login-trusted" class = "form-check-label login-trusted__desc" > $ { n } < / l a b e l >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-info-circle" data - toggle = "popover"
2021-03-19 19:26:15 +01:00
data - title = "Trusted device?"
2022-12-17 22:08:36 +01:00
data - content = "${t}"
size = "1.2em"
title = "${t}" > < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-04-02 21:20:14 +02:00
` })("off"!==a):""}
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
2022-04-02 21:20:14 +02:00
< input class = "btn btn-primary" type = "submit" value = "${n}" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "allow_registration" ) && ! Ih . settings . get ( "auto_login" ) && nd . pluggable . plugins [ "converse-register" ] . enabled ( nd ) ? ( ( ) => { const e = Gy ( "Create an account" ) , t = Gy ( "Don't have a chat account?" ) ; return Gu `
2021-03-19 19:26:15 +01:00
< fieldset class = "switch-form" >
< p > $ { t } < / p >
< p > < a class = "register-account toggle-register-login" href = "#converse/register" > $ { e } < / a > < / p >
< / f i e l d s e t >
` })():""}
2023-02-17 12:24:37 +01:00
` },aE=e=>{const t=nd.connfeedback.get("connection_status");let n,s;sE.includes(t)&&(s=iE[t],n=rE[t]);const i=nd.connfeedback.get("message");return Gu `
2022-05-05 23:06:17 +02:00
< converse - brand - heading > < / c o n v e r s e - b r a n d - h e a d i n g >
< form id = "converse-login" class = "converse-form" method = "post" @ submit = $ { e . onLoginFormSubmitted } >
< div class = "conn-feedback fade-in ${s?n:" hidden "}" >
< p class = "feedback-subject" > $ { s } < / p >
< p class = "feedback-message ${i?" ":" hidden "}" > $ { i } < / p >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { "CONNECTING" === nd . CONNECTION _STATUS [ t ] ? J _ ( { classes : "hor_centered" } ) : ( e => { const t = Ih . settings . get ( "authentication" ) , { ANONYMOUS : n , EXTERNAL : s , LOGIN : i , PREBIND : r } = nd , o = Gy ( "Disconnected" ) , a = Gy ( "Click here to log in anonymously" ) ; return Gu `
$ { t == i || t == s ? oE ( e ) : "" }
$ { t == n ? Gu ` <input class="btn btn-primary login-anon" type="submit" value=" ${ a } "> ` : "" }
$ { t == r ? Gu ` <p> ${ o } </p> ` : "" }
2021-03-19 19:26:15 +01:00
` })(e)}
2023-02-17 12:24:37 +01:00
< / f o r m > ` } , { S t r o p h e : c E , u : l E } = O h . e n v ; f u n c t i o n d E ( ) { c o n s t e = n d . c h a t b o x e s . a d d ( n e w n d . C o n t r o l B o x ( { i d : " c o n t r o l b o x " } ) ) ; r e t u r n n d . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ? . s e t M o d e l ( ) , e } f u n c t i o n u E ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) ; c o n s t t = n d . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) | | d E ( ) ; l E . s a f e S a v e ( t , { c l o s e d : ! 1 } ) } f u n c t i o n h E ( ) { c o n s t e = n d . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ; r e t u r n e . m o d e l . s e t ( { c o n n e c t e d : ! 1 } ) , e } f u n c t i o n m E ( ) { c o n s t e = n d ? . c h a t b o x v i e w s , t = e & & e . g e t ( " c o n t r o l b o x " ) ; t & & ( l E . s a f e S a v e ( t . m o d e l , { c o n n e c t e d : ! 1 } ) , t ? . c o n t r o l b o x _ p a n e & & ( t . c o n t r o l b o x _ p a n e . r e m o v e ( ) , d e l e t e t . c o n t r o l b o x _ p a n e ) ) } f u n c t i o n g E ( ) { ( n d . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) | | d E ( ) ) . s a v e ( { c o n n e c t e d : ! 0 } ) } c o n s t { S t r o p h e : f E , u : p E } = O h . e n v ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - l o g i n - f o r m " , c l a s s e x t e n d s V y { i n i t i a l i z e ( ) { t h i s . l i s t e n T o ( n d . c o n n f e e d b a c k , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . h a n d l e r = ( ) = > t h i s . r e q u e s t U p d a t e ( ) } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , I h . s e t t i n g s . l i s t e n . o n ( " c h a n g e " , t h i s . h a n d l e r ) } d i s c o n n e c t e d C a l l b a c k ( ) { s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) , I h . s e t t i n g s . l i s t e n . n o t ( " c h a n g e " , t h i s . h a n d l e r ) } r e n d e r ( ) { r e t u r n a E ( t h i s ) } f i r s t U p d a t e d ( ) { t h i s . i n i t P o p o v e r s ( ) } a s y n c o n L o g i n F o r m S u b m i t t e d ( e ) { i f ( e ? . p r e v e n t D e f a u l t ( ) , I h . s e t t i n g s . g e t ( " a u t h e n t i c a t i o n " ) = = = n d . A N O N Y M O U S ) r e t u r n t h i s . c o n n e c t ( n d . j i d ) ; ( f u n c t i o n ( e ) { c o n s t t = e . q u e r y S e l e c t o r ( " i n p u t [ n a m e = j i d ] " ) ; r e t u r n ! t . v a l u e | | I h . s e t t i n g s . g e t ( " l o c k e d _ d o m a i n " ) | | I h . s e t t i n g s . g e t ( " d e f a u l t _ d o m a i n " ) | | l E . i s V a l i d J I D ( t . v a l u e ) ? ( t . s e t C u s t o m V a l i d i t y ( " " ) , ! 0 ) : ( t . s e t C u s t o m V a l i d i t y ( G y ( " P l e a s e e n t e r a v a l i d X M P P a d d r e s s " ) ) , ! 1 ) } ) ( e . t a r g e t ) & & ( ! f u n c t i o n ( e ) { l e t t = a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ? a r g u m e n t s [ 1 ] : { } ; c o n s t n = n e w F o r m D a t a ( e ) , s = n . g e t ( " c o n n e c t i o n - u r l " ) ; s ? . s t a r t s W i t h ( " w s " ) ? t . w e b s o c k e t _ u r l = s : s ? . s t a r t s W i t h ( " h t t p " ) & & ( t . b o s h _ s e r v i c e _ u r l = s ) ; l e t i = n . g e t ( " j i d " ) ; i f ( I h . s e t t i n g s . g e t ( " l o c k e d _ d o m a i n " ) ) { c o n s t e = " @ " + I h . s e t t i n g s . g e t ( " l o c k e d _ d o m a i n " ) ; i . e n d s W i t h ( e ) & & ( i = i . s u b s t r ( 0 , i . l e n g t h - e . l e n g t h ) ) , i = c E . e s c a p e N o d e ( i ) + e } e l s e I h . s e t t i n g s . g e t ( " d e f a u l t _ d o m a i n " ) & & ! i . i n c l u d e s ( " @ " ) & & ( i = i + " @ " + I h . s e t t i n g s . g e t ( " d e f a u l t _ d o m a i n " ) ) ; t . j i d = i , t . p a s s w o r d = n . g e t ( " p a s s w o r d " ) , I h . s e t t i n g s . s e t ( t ) , n d . c o n f i g . s a v e ( { t r u s t e d : ! ! n . g e t ( " t r u s t e d " ) } ) } ( e . t a r g e t ) , I h . s e t t i n g s . g e t ( " b o s h _ s e r v i c e _ u r l " ) | | I h . s e t t i n g s . g e t ( " w e b s o c k e t _ u r l " ) | | a w a i t t h i s . d i s c o v e r C o n n e c t i o n M e t h o d s ( e ) , I h . s e t t i n g s . g e t ( " b o s h _ s e r v i c e _ u r l " ) | | I h . s e t t i n g s . g e t ( " w e b s o c k e t _ u r l " ) ? t h i s . c o n n e c t ( ) : I h . s e t t i n g s . s e t ( " s h o w _ c o n n e c t i o n _ u r l _ i n p u t " , ! 0 ) ) } d i s c o v e r C o n n e c t i o n M e t h o d s ( e ) { i f ( ! I h . s e t t i n g s . g e t ( " d i s c o v e r _ c o n n e c t i o n _ m e t h o d s " ) ) r e t u r n ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " j i d " ) , n = f E . g e t D o m a i n F r o m J i d ( t ) ; r e t u r n ( ! n d . c o n n e c t i o n ? . j i d | | t & & ! p E . i s S a m e D o m a i n ( n d . c o n n e c t i o n . j i d , t ) ) & & E h ( ) , n d . c o n n e c t i o n . d i s c o v e r C o n n e c t i o n M e t h o d s ( n ) } i n i t P o p o v e r s ( ) { A r r a y . f r o m ( t h i s . q u e r y S e l e c t o r A l l ( " [ d a t a - t i t l e ] " ) ) . f o r E a c h ( ( e = > { n e w ( d _ ( ) . P o p o v e r ) ( e , { t r i g g e r : " m o b i l e " = = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ? " c l i c k " : " h o v e r " , d i s m i s s i b l e : " m o b i l e " = = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) , c o n t a i n e r : t h i s . p a r e n t E l e m e n t . p a r e n t E l e m e n t . p a r e n t E l e m e n t } ) } ) ) } c o n n e c t ( e ) { [ " c o n v e r s e / l o g i n " , " c o n v e r s e / r e g i s t e r " ] . i n c l u d e s ( n d . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) ) & & n d . r o u t e r . n a v i g a t e ( " " , { r e p l a c e : ! 0 } ) , n d . c o n n e c t i o n ? . r e s e t ( ) , I h . u s e r . l o g i n ( e ) } } ) ; c o n s t v E = e = > G u ` < c o n v e r s e - i c o n s i z e = " 1 e m " c l a s s = " f a f a - a r r o w - l e f t " @ c l i c k = $ { ( ) = > f u n c t i o n ( e ) { u E ( ) ; c o n s t t = n d . c h a t b o x e s . g e t ( e ) ; l E . s a f e S a v e ( t , { h i d d e n : ! 0 } ) } ( e ) } > < / c o n v e r s e - i c o n > ` ; c l a s s y E e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } r e n d e r ( ) { r e t u r n v E ( t h i s . j i d ) } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c o n t r o l b o x - n a v b a c k " , y E ) ; c o n s t { d a y j s : _ E } = O h . e n v , b E = N o . e x t e n d ( { d e f a u l t s : ( ) = > ( { b o o k m a r k e d : ! 1 , b o x _ i d : " c o n t r o l b o x " , c h a t _ s t a t e : v o i d 0 , c l o s e d : ! I h . s e t t i n g s . g e t ( " s h o w _ c o n t r o l b o x _ b y _ d e f a u l t " ) , n u m _ u n r e a d : 0 , t i m e _ o p e n e d : _ E ( 0 ) . v a l u e O f ( ) , t y p e : n d . C O N T R O L B O X _ T Y P E , u r l : " " } ) , v a l i d a t e ( e ) { r e t u r n e . t y p e = = = n d . C O N T R O L B O X _ T Y P E ? " e m b e d d e d " = = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & I h . s e t t i n g s . g e t ( " s i n g l e t o n " ) ? " C o n t r o l b o x n o t r e l e v a n t i n e m b e d d e d v i e w m o d e " : v o i d 0 : n d . C h a t B o x . p r o t o t y p e . v a l i d a t e . c a l l ( t h i s , e ) } , m a y b e S h o w ( e ) { r e t u r n e | | " c o n t r o l b o x " ! = = t h i s . g e t ( " i d " ) ? n d . C h a t B o x . p r o t o t y p e . m a y b e S h o w . c a l l ( t h i s , e ) : t h i s } , o n R e c o n n e c t i o n ( ) { t h i s . s a v e ( " c o n n e c t e d " , ! 0 ) } } ) ; c l a s s w E e x t e n d s V y { a s y n c c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , a w a i t I h . w a i t U n t i l ( " i n i t i a l i z e d " ) , t h i s . m o d e l = n
2022-05-05 23:06:17 +02:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
< div class = "chat-head controlbox-head" >
2023-02-17 12:24:37 +01:00
$ { n ? "" : Gu `
2022-12-17 22:08:36 +01:00
< a class = "chatbox-btn close-chatbox-button" @ click = $ { t => e . close ( t ) } >
< converse - icon class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2022-05-05 23:06:17 +02:00
` }
2021-11-11 22:06:49 +01:00
< / d i v >
2022-05-05 23:06:17 +02:00
< div class = "controlbox-panes" >
< div class = "controlbox-pane" >
2023-02-17 12:24:37 +01:00
$ { t . connected ? Gu `
2022-05-05 23:06:17 +02:00
< converse - user - profile > < / c o n v e r s e - u s e r - p r o f i l e >
2022-12-17 22:08:36 +01:00
< converse - headlines - feeds - list class = "controlbox-section" > < / c o n v e r s e - h e a d l i n e s - f e e d s - l i s t >
< div id = "chatrooms" class = "controlbox-section" > < converse - rooms - list > < / c o n v e r s e - r o o m s - l i s t > < / d i v >
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "authentication" ) === nd . ANONYMOUS ? "" : Gu ` <div id="converse-roster" class="controlbox-section"><converse-roster></converse-roster></div> ` } ` :function(e){const t=nd.connfeedback.get("connection_status");return[xE.Status.RECONNECTING,xE.Status.CONNECTING].includes(t)?J_():"register"===e["active-form"]?Gu ` < converse - register - panel > < / c o n v e r s e - r e g i s t e r - p a n e l > ` : G u ` < c o n v e r s e - l o g i n - f o r m i d = " c o n v e r s e - l o g i n - p a n e l " c l a s s = " c o n t r o l b o x - p a n e f a d e - i n r o w n o - g u t t e r s " > < / c o n v e r s e - l o g i n - f o r m > ` } ( t ) }
2022-05-05 23:06:17 +02:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } , A E = O h . e n v . u t i l s ; c l a s s C E e x t e n d s V y { i n i t i a l i z e ( ) { t h i s . s e t M o d e l ( ) , n d . c h a t b o x v i e w s . a d d ( " c o n t r o l b o x " , t h i s ) , t h i s . m o d e l . g e t ( " c o n n e c t e d " ) & & v o i d 0 = = = t h i s . m o d e l . g e t ( " c l o s e d " ) & & t h i s . m o d e l . s e t ( " c l o s e d " , ! I h . s e t t i n g s . g e t ( " s h o w _ c o n t r o l b o x _ b y _ d e f a u l t " ) ) , t h i s . r e q u e s t U p d a t e ( ) , I h . t r i g g e r ( " c o n t r o l B o x I n i t i a l i z e d " , t h i s ) } s e t M o d e l ( ) { t h i s . m o d e l = n d . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) , t h i s . l i s t e n T o ( n d . c o n n f e e d b a c k , " c h a n g e : c o n n e c t i o n _ s t a t u s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : a c t i v e - f o r m " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : c l o s e d " , ( ( ) = > ! t h i s . m o d e l . g e t ( " c l o s e d " ) & & t h i s . a f t e r S h o w n ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l ? E E ( t h i s ) : " " } c l o s e ( e ) { i f ( e ? . p r e v e n t D e f a u l t ? . ( ) , ( " c l o s e A l l C h a t B o x e s " ! = = e ? . n a m e | | n d . d i s c o n n e c t i o n _ c a u s e = = = n d . L O G O U T & & ! I h . s e t t i n g s . g e t ( " s h o w _ c o n t r o l b o x _ b y _ d e f a u l t " ) ) & & ! I h . s e t t i n g s . g e t ( " s t i c k y _ c o n t r o l b o x " ) ) r e t u r n A E . s a f e S a v e ( t h i s . m o d e l , { c l o s e d : ! 0 } ) , I h . t r i g g e r ( " c o n t r o l B o x C l o s e d " , t h i s ) , t h i s } a f t e r S h o w n ( ) { r e t u r n I h . t r i g g e r ( " c o n t r o l B o x O p e n e d " , t h i s ) , t h i s } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c o n t r o l b o x " , C E ) ; c o n s t $ E = C E , { u : k E } = O h . e n v , j E = { c o n t r o l b o x : { a s y n c o p e n ( ) { a w a i t I h . w a i t U n t i l ( " c h a t B o x e s F e t c h e d " ) ; c o n s t e = a w a i t I h . c h a t b o x e s . g e t ( " c o n t r o l b o x " ) | | I h . c h a t b o x e s . c r e a t e ( " c o n t r o l b o x " , { } , n d . C o n t r o l b o x ) ; r e t u r n k E . s a f e S a v e ( e , { c l o s e d : ! 1 } ) , e } , g e t : ( ) = > n d . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) } } ; v a r T E = n ( 1 8 7 5 ) , N E = { } ; N E . s t y l e T a g T r a n s f o r m = o _ ( ) , N E . s e t A t t r i b u t e s = n _ ( ) , N E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , N E . d o m A P I = K y ( ) , N E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( T E . Z , N E ) ; T E . Z & & T E . Z . l o c a l s & & T E . Z . l o c a l s ; v a r I E = n ( 6 7 5 5 ) , O E = { } ; O E . s t y l e T a g T r a n s f o r m = o _ ( ) , O E . s e t A t t r i b u t e s = n _ ( ) , O E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , O E . d o m A P I = K y ( ) , O E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( I E . Z , O E ) ; I E . Z & & I E . Z . l o c a l s & & I E . Z . l o c a l s ; O h . p l u g i n s . a d d ( " c o n v e r s e - c o n t r o l b o x " , { d e p e n d e n c i e s : [ " c o n v e r s e - m o d a l " , " c o n v e r s e - c h a t b o x e s " , " c o n v e r s e - c h a t " , " c o n v e r s e - r o s t e r v i e w " , " c o n v e r s e - c h a t v i e w " ] , e n a b l e d : e = > ! e . a p i . s e t t i n g s . g e t ( " s i n g l e t o n " ) , o v e r r i d e s : { C h a t B o x e s : { m o d e l ( e , t ) { r e t u r n e & & " c o n t r o l b o x " = = e . i d ? n e w b E ( e , t ) : t h i s . _ _ s u p e r _ _ . m o d e l . a p p l y ( t h i s , a r g u m e n t s ) } } } , i n i t i a l i z e ( ) { I h . s e t t i n g s . e x t e n d ( { a l l o w _ l o g o u t : ! 0 , a l l o w _ u s e r _ t r u s t _ o v e r r i d e : ! 0 , d e f a u l t _ d o m a i n : v o i d 0 , l o c k e d _ d o m a i n : v o i d 0 , s h o w _ c o n n e c t i o n _ u r l _ i n p u t : ! 1 , s h o w _ c o n t r o l b o x _ b y _ d e f a u l t : ! 1 , s t i c k y _ c o n t r o l b o x : ! 1 } ) , I h . p r o m i s e s . a d d ( " c o n t r o l B o x I n i t i a l i z e d " , ! 1 ) , O b j e c t . a s s i g n ( I h , j E ) , n d . C o n t r o l B o x V i e w = $ E , n d . C o n t r o l B o x = b E , n d . C o n t r o l B o x T o g g l e = S E , I h . l i s t e n . o n ( " c h a t B o x e s F e t c h e d " , g E ) , I h . l i s t e n . o n ( " c l e a r S e s s i o n " , m E ) , I h . l i s t e n . o n ( " w i l l - r e c o n n e c t " , h E ) , I h . w a i t U n t i l ( " c h a t B o x V i e w s I n i t i a l i z e d " ) . t h e n ( d E ) . c a t c h ( ( e = > I l . f a t a l ( e ) ) ) } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - h e a d l i n e s - h e a d i n g " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = n d . c h a t b o x e s . g e t ( t h i s . j i d ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n ( e = > G u `
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
2023-02-17 12:24:37 +01:00
$ { nd . api . settings . get ( "singleton" ) ? "" : Gu ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__text" title = "${e.jid}" > $ { e . display _name } < / d i v >
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
2023-02-17 12:24:37 +01:00
$ { vb ( MS ( e . heading _buttons _promise ) , "" ) }
$ { vb ( OS ( e . heading _buttons _promise ) , "" ) }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . status ? Gu ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` )({...this.model.toJSON(),display_name:this.model.getDisplayName(),heading_buttons_promise:this.getHeadingButtons()})}getHeadingButtons(){const e=[];return Ih.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Gy("Close"),i18n_title:Gy("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Ih.settings.get("view_mode")}),nd.api.hook("getHeadingButtons",this,e)}close(e){e.preventDefault(),this.model.close()}});Ih.elements.define("converse-headlines",class extends Yx{async initialize(){nd.chatboxviews.add(this.jid,this),this.model=nd.chatboxes.get(this.jid),this.model.disable_mam=!0,this.listenTo(nd,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>this.afterShown())),this.listenTo(this.model,"destroy",this.remove),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(),Ih.trigger("headlinesBoxViewInitialized",this)}render(){return(e=>Gu `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2023-02-17 12:24:37 +01:00
$ { e ? Gu `
2021-11-11 22:06:49 +01:00
< converse - headlines - heading jid = "${e.get(" jid ")}" class = "chat-head chat-head-chatbox row no-gutters" >
< / c o n v e r s e - h e a d l i n e s - h e a d i n g >
< div class = "chat-body" >
< div class = "chat-content" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.get(" jid ")}" > < / c o n v e r s e - c h a t - c o n t e n t >
< / d i v >
< / d i v > ` : " " }
< / d i v >
2023-02-17 12:24:37 +01:00
` )(this.model)}async close(e){return e?.preventDefault?.(),nd.router.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&nd.router.navigate(""),await this.model.close(e),this}getNotifications(){return[]}afterShown(){this.model.clearUnreadMsgCounter()}});const ME=e=>{const t=e.model.filter((e=>e.get("type")===nd.HEADLINES_TYPE)),n=Gy("Announcements");return Gu `
2022-12-17 22:08:36 +01:00
< div class = "controlbox-section" id = "headline" >
< div class = "d-flex controlbox-padded ${t.length?" ":" hidden "}" >
< span class = "w-100 controlbox-heading controlbox-heading--headline" > $ { n } < / s p a n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-05-05 23:06:17 +02:00
< / d i v >
2022-12-17 22:08:36 +01:00
< div class = "list-container list-container--headline ${t.length?" ":" hidden "}" >
< div class = "items-list rooms-list headline-list" >
2023-02-17 12:24:37 +01:00
$ { t . map ( ( t => function ( e , t ) { const n = Gy ( "Click to open this server message" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< div class = "list-item controlbox-padded d-flex flex-row"
data - headline - jid = "${t.get(" jid ")}" >
< a class = "list-item-link open-headline available-room w-100"
data - headline - jid = "${t.get(" jid ")}"
title = "${n}"
@ click = $ { t => e . openHeadline ( t ) }
href = "#" > $ { t . get ( "jid" ) } < / a >
< / d i v >
2023-02-17 12:24:37 +01:00
` }(e,t)))}
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ; c l a s s R E e x t e n d s V y { i n i t i a l i z e ( ) { t h i s . m o d e l = n d . c h a t b o x e s , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , ( e = > t h i s . r e n d e r I f H e a d l i n e ( e ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " r e m o v e " , ( e = > t h i s . r e n d e r I f H e a d l i n e ( e ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " d e s t r o y " , ( e = > t h i s . r e n d e r I f H e a d l i n e ( e ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n M E ( t h i s ) } r e n d e r I f H e a d l i n e ( e ) { r e t u r n e ? . g e t ( " t y p e " ) = = = n d . H E A D L I N E S _ T Y P E & & t h i s . r e q u e s t U p d a t e ( ) } a s y n c o p e n H e a d l i n e ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - h e a d l i n e - j i d " ) ; ( a w a i t I h . h e a d l i n e s . g e t ( t ) ) . m a y b e S h o w ( ! 0 ) } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - h e a d l i n e s - f e e d s - l i s t " , R E ) ; v a r D E = n ( 5 9 5 6 ) , z E = { } ; z E . s t y l e T a g T r a n s f o r m = o _ ( ) , z E . s e t A t t r i b u t e s = n _ ( ) , z E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , z E . d o m A P I = K y ( ) , z E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( D E . Z , z E ) ; D E . Z & & D E . Z . l o c a l s & & D E . Z . l o c a l s ; v a r L E = n ( 2 7 5 9 ) , P E = { } ; P E . s t y l e T a g T r a n s f o r m = o _ ( ) , P E . s e t A t t r i b u t e s = n _ ( ) , P E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , P E . d o m A P I = K y ( ) , P E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( L E . Z , P E ) ; L E . Z & & L E . Z . l o c a l s & & L E . Z . l o c a l s ; O h . p l u g i n s . a d d ( " c o n v e r s e - h e a d l i n e s - v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - h e a d l i n e s " , " c o n v e r s e - c h a t v i e w " ] , i n i t i a l i z e ( ) { n d . H e a d l i n e s F e e d s L i s t = R E , n d . H e a d l i n e s P a n e l = R E } } ) ; v a r F E = n ( 9 6 7 9 ) , U E = { } ; U E . s t y l e T a g T r a n s f o r m = o _ ( ) , U E . s e t A t t r i b u t e s = n _ ( ) , U E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , U E . d o m A P I = K y ( ) , U E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( F E . Z , U E ) ; F E . Z & & F E . Z . l o c a l s & & F E . Z . l o c a l s ; f u n c t i o n B E ( e , t ) { r e t u r n e i n s t a n c e o f _ p ? G u ` < c o n v e r s e - m a m - p l a c e h o l d e r . m o d e l = $ { e } > < / c o n v e r s e - m a m - p l a c e h o l d e r > ` : t } a s y n c f u n c t i o n q E ( e ) { i f ( ! e . m o d e l . u i . g e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " ) & & e . m o d e l . m e s s a g e s . l e n g t h ) { c o n s t t = e . m o d e l . g e t ( " t y p e " ) = = = n d . C H A T R O O M S _ T Y P E , n = e . m o d e l . g e t O l d e s t M e s s a g e ( ) ; i f ( n ) { c o n s t s = t ? e . m o d e l . g e t ( " j i d " ) : n d . b a r e _ j i d , i = n & & n . g e t ( ` s t a n z a _ i d $ { s } ` ) ; e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 0 ) ; t r y { i ? a w a i t H p ( e . m o d e l , { b e f o r e : i } ) : a w a i t H p ( e . m o d e l , { e n d : n . g e t ( " t i m e " ) } ) } c a t c h ( t ) { r e t u r n I l . e r r o r ( t ) , v o i d e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 1 ) } I h . s e t t i n g s . g e t ( " a l l o w _ u r l _ h i s t o r y _ c h a n g e " ) & & n d . r o u t e r . h i s t o r y . n a v i g a t e ( ` # $ { n . g e t ( " m s g i d " ) } ` ) , s e t T i m e o u t ( ( ( ) = > e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 1 ) ) , 2 5 0 ) } } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m a m - p l a c e h o l d e r " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } } } r e n d e r ( ) { r e t u r n ( e = t h i s ) . m o d e l . g e t ( " f e t c h i n g " ) ? J _ ( { c l a s s e s : " h o r _ c e n t e r e d " } ) : G u ` < a @ c l i c k = " $ { t = > e . f e t c h M i s s i n g M e s s a g e s ( t ) } " t i t l e = " $ { G y ( " C l i c k t o l o a d m i s s i n g m e s s a g e s " ) } " >
2022-12-17 22:08:36 +01:00
< div class = "message mam-placeholder" > < / d i v >
2023-02-17 12:24:37 +01:00
< / a > ` ; v a r e } a s y n c f e t c h M i s s i n g M e s s a g e s ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , t h i s . m o d e l . s e t ( " f e t c h i n g " , ! 0 ) ; c o n s t t = { b e f o r e : t h i s . m o d e l . g e t ( " b e f o r e " ) , s t a r t : t h i s . m o d e l . g e t ( " s t a r t " ) } ; a w a i t H p ( t h i s . m o d e l . c o l l e c t i o n . c h a t b o x , t ) , t h i s . m o d e l . d e s t r o y ( ) } } ) , O h . p l u g i n s . a d d ( " c o n v e r s e - m a m - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - m a m " , " c o n v e r s e - c h a t v i e w " , " c o n v e r s e - m u c - v i e w s " ] , i n i t i a l i z e ( ) { I h . l i s t e n . o n ( " c h a t B o x S c r o l l e d U p " , q E ) , I h . l i s t e n . o n ( " g e t M e s s a g e T e m p l a t e " , B E ) } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - m e s s a g e - f o r m " , c l a s s e x t e n d s V x { a s y n c c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d } t o H T M L ( ) { r e t u r n ( e = > { c o n s t t = e . c o m p o s i n g _ s p o i l e r ? G y ( " H i d d e n m e s s a g e " ) : G y ( " M e s s a g e " ) , n = G y ( " O p t i o n a l h i n t " ) , s = I h . s e t t i n g s . g e t ( " s h o w _ s e n d _ b u t t o n " ) ; r e t u r n G u `
2021-11-11 22:06:49 +01:00
< form class = "setNicknameButtonForm hidden" >
< input type = "submit" class = "btn btn-primary" name = "join" value = "Join" / >
< / f o r m >
< form class = "sendXMPPMessage" >
< input type = "text" placeholder = "${n||" "}" value = "${e.hint_value||" "}" class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
< div class = "suggestion-box" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< textarea
autofocus
type = "text"
@ drop = $ { e . onDrop }
2023-02-17 12:24:37 +01:00
@ input = $ { Gx }
2021-11-11 22:06:49 +01:00
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea suggestion - box _ _input
2022-05-05 23:06:17 +02:00
$ { s ? "chat-textarea-send-button" : "" }
2021-11-11 22:06:49 +01:00
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
2023-02-17 12:24:37 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { h i n t _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . s p o i l e r - h i n t " ) ? . v a l u e , m e s s a g e _ v a l u e : t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ? . v a l u e , o n C h a n g e : e = > t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) , o n D r o p : e = > t h i s . o n D r o p ( e ) , o n K e y D o w n : e = > t h i s . o n K e y D o w n ( e ) , o n K e y U p : e = > t h i s . o n K e y U p ( e ) , o n P a s t e : e = > t h i s . o n P a s t e ( e ) , s c r o l l e d : t h i s . m o d e l . u i . g e t ( " s c r o l l e d " ) , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) ) } a f t e r R e n d e r ( ) { c o n s t e = t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = O h . R O O M S T A T U S . E N T E R E D , t = e & & ! ( t h i s . m o d e l . f e a t u r e s . g e t ( " m o d e r a t e d " ) & & " v i s i t o r " = = = t h i s . m o d e l . g e t O w n R o l e ( ) ) ; e & & t & & t h i s . i n i t M e n t i o n A u t o C o m p l e t e ( ) } i n i t M e n t i o n A u t o C o m p l e t e ( ) { t h i s . m e n t i o n _ a u t o _ c o m p l e t e = n e w n d . A u t o C o m p l e t e ( t h i s , { a u t o _ f i r s t : ! 0 , a u t o _ e v a l u a t e : ! 1 , m i n _ c h a r s : I h . s e t t i n g s . g e t ( " m u c _ m e n t i o n _ a u t o c o m p l e t e _ m i n _ c h a r s " ) , m a t c h _ c u r r e n t _ w o r d : ! 0 , l i s t : ( ) = > t h i s . g e t A u t o C o m p l e t e L i s t ( ) , f i l t e r : " c o n t a i n s " = = I h . s e t t i n g s . g e t ( " m u c _ m e n t i o n _ a u t o c o m p l e t e _ f i l t e r " ) ? n d . F I L T E R _ C O N T A I N S : n d . F I L T E R _ S T A R T S W I T H , a c _ t r i g g e r s : [ " T a b " , " @ " ] , i n c l u d e _ t r i g g e r s : [ ] , i t e m : I b } ) , t h i s . m e n t i o n _ a u t o _ c o m p l e t e . o n ( " s u g g e s t i o n - b o x - s e l e c t c o m p l e t e " , ( ( ) = > t h i s . a u t o _ c o m p l e t i n g = ! 1 ) ) } g e t A u t o C o m p l e t e L i s t ( ) { r e t u r n t h i s . m o d e l . g e t A l l K n o w n N i c k n a m e s ( ) . m a p ( ( e = > ( { l a b e l : e , v a l u e : ` @ $ { e } ` } ) ) ) } o n K e y D o w n ( e ) { t h i s . m e n t i o n _ a u t o _ c o m p l e t e . o n K e y D o w n ( e ) | | s u p e r . o n K e y D o w n ( e ) } o n K e y U p ( e ) { t h i s . m e n t i o n _ a u t o _ c o m p l e t e . e v a l u a t e ( e ) , s u p e r . o n K e y U p ( e ) } } ) ; v a r H E = n ( 6 2 3 3 ) , G E = { } ; G E . s t y l e T a g T r a n s f o r m = o _ ( ) , G E . s e t A t t r i b u t e s = n _ ( ) , G E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , G E . d o m A P I = K y ( ) , G E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( H E . Z , G E ) ; H E . Z & & H E . Z . l o c a l s & & H E . Z . l o c a l s ; c l a s s W E e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . m o d e l = n d . c h a t b o x e s . g e t ( t h i s . j i d ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = G y ( " N i c k n a m e " ) , n = e . m o d e l ? . i s E n t e r e d ( ) ? G y ( " C h a n g e n i c k n a m e " ) : G y ( " E n t e r g r o u p c h a t " ) , s = I h . s e t t i n g s . g e t ( " m u c _ s h o w _ l o g s _ b e f o r e _ j o i n " ) ? G y ( " C h o o s e a n i c k n a m e t o e n t e r " ) : G y ( " P l e a s e c h o o s e y o u r n i c k n a m e " ) , i = e . m o d e l ? . g e t ( " n i c k n a m e _ v a l i d a t i o n _ m e s s a g e " ) ; r e t u r n G u `
2022-12-17 22:08:36 +01:00
< div class = "chatroom-form-container muc-nickname-form" >
< form class = "converse-form chatroom-form converse-centered-form"
@ submit = $ { t => e . submitNickname ( t ) } >
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group" >
2023-01-07 22:34:35 +01:00
< label > $ { s } < / l a b e l >
< p class = "validation-message" > $ { i } < / p >
2021-11-11 22:06:49 +01:00
< input type = "text"
required = "required"
name = "nick"
2023-01-07 22:34:35 +01:00
value = "${e.model?.get(" nick ")||" "}"
class = "form-control ${i?" error ":" "}"
placeholder = "${t}" / >
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2022-12-17 22:08:36 +01:00
< input type = "submit"
class = "btn btn-primary"
name = "join"
2023-01-07 22:34:35 +01:00
value = "${n}" / >
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
< / f o r m >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ) ( t h i s ) } s u b m i t N i c k n a m e ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . n i c k . v a l u e . t r i m ( ) ; t & & ( t h i s . m o d e l . i s E n t e r e d ( ) ? ( t h i s . m o d e l . s e t N i c k n a m e ( t ) , t h i s . c l o s e M o d a l ( ) ) : t h i s . m o d e l . j o i n ( t ) ) } c l o s e M o d a l ( ) { c o n s t e = d o c u m e n t . c r e a t e E v e n t ( " E v e n t " ) ; e . i n i t E v e n t ( " h i d e . b s . m o d a l " , ! 0 , ! 0 ) , t h i s . d i s p a t c h E v e n t ( e ) } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - n i c k n a m e - f o r m " , W E ) ; c o n s t V E = e = > { c o n s t t = G y ( " Y o u h a v e u n r e a d m e s s a g e s " ) , n = e . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) , s = G y ( " Y o u ' r e n o t a l l o w e d t o s e n d m e s s a g e s i n t h i s r o o m " ) ; r e t u r n n = = = O h . R O O M S T A T U S . E N T E R E D ? G u `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread_general" ) ? Gu ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { e . can _edit ? ( e => { const t = Gy ( "You have unread messages" ) , n = Ih . settings . get ( "message_limit" ) , s = Ih . settings . get ( "visible_toolbar_buttons" ) . call , i = Ih . settings . get ( "visible_toolbar_buttons" ) . emoji , r = Ih . settings . get ( "show_send_button" ) , o = Ih . settings . get ( "visible_toolbar_buttons" ) . spoiler , a = Ih . settings . get ( "show_toolbar" ) ; return Gu `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? Gu ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { a ? Gu `
2021-11-11 22:06:49 +01:00
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? hidden _occupants = "${e.model.get(" hidden _occupants ")}"
? is _groupchat = "${e.is_groupchat}"
2022-05-05 23:06:17 +02:00
? show _call _button = "${s}"
? show _emoji _button = "${i}"
2022-12-17 22:08:36 +01:00
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
2021-11-11 22:06:49 +01:00
? show _toolbar = "${a}"
message _limit = "${n}" > < / c o n v e r s e - c h a t - t o o l b a r > ` : " " }
2023-02-17 12:24:37 +01:00
< converse - muc - message - form jid = $ { e . model . get ( "jid" ) } > < / c o n v e r s e - m u c - m e s s a g e - f o r m > ` } ) ( e ) : G u ` < s p a n c l a s s = " m u c - b o t t o m - p a n e l m u c - b o t t o m - p a n e l - - m u t e d " > $ { s } < / s p a n > ` } ` : n ! = O h . R O O M S T A T U S . N I C K N A M E _ R E Q U I R E D ? " " : I h . s e t t i n g s . g e t ( " m u c _ s h o w _ l o g s _ b e f o r e _ j o i n " ) ? G u ` < s p a n c l a s s = " m u c - b o t t o m - p a n e l m u c - b o t t o m - p a n e l - - n i c k n a m e " >
2022-04-02 21:20:14 +02:00
< converse - muc - nickname - form jid = "${e.model.get(" jid ")}" > < / c o n v e r s e - m u c - n i c k n a m e - f o r m >
2023-02-17 12:24:37 +01:00
< / s p a n > ` : v o i d 0 } ; v a r J E = n ( 6 9 1 6 ) , Z E = { } ; Z E . s t y l e T a g T r a n s f o r m = o _ ( ) , Z E . s e t A t t r i b u t e s = n _ ( ) , Z E . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , Z E . d o m A P I = K y ( ) , Z E . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( J E . Z , Z E ) ; J E . Z & & J E . Z . l o c a l s & & J E . Z . l o c a l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - b o t t o m - p a n e l " , c l a s s e x t e n d s Q x { e v e n t s = { " c l i c k . h i d e - o c c u p a n t s " : " h i d e O c c u p a n t s " , " c l i c k . s e n d - b u t t o n " : " s e n d B u t t o n C l i c k e d " } ; a s y n c i n i t i a l i z e ( ) { a w a i t s u p e r . i n i t i a l i z e ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n _ o c c u p a n t s " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n u m _ u n r e a d _ g e n e r a l " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : m o d e r a t e d " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " a d d " , t h i s . r e n d e r I f O w n O c c u p a n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e : r o l e " , t h i s . r e n d e r I f O w n O c c u p a n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l . s e s s i o n , " c h a n g e : c o n n e c t i o n _ s t a t u s " , t h i s . d e b o u n c e d R e n d e r ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = O h . R O O M S T A T U S . E N T E R E D , t = e & & ! ( t h i s . m o d e l . f e a t u r e s . g e t ( " m o d e r a t e d " ) & & " v i s i t o r " = = = t h i s . m o d e l . g e t O w n R o l e ( ) ) ; l h ( V E ( { c a n _ e d i t : t , e n t e r e d : e , m o d e l : t h i s . m o d e l , i s _ g r o u p c h a t : ! 0 , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) , t h i s ) } r e n d e r I f O w n O c c u p a n t ( e ) { e . g e t ( " j i d " ) = = = n d . b a r e _ j i d & & t h i s . d e b o u n c e d R e n d e r ( ) } s e n d B u t t o n C l i c k e d ( e ) { t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - m e s s a g e - f o r m " ) ? . o n F o r m S u b m i t t e d ( e ) } h i d e O c c u p a n t s ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , e ? . s t o p P r o p a g a t i o n ? . ( ) , t h i s . m o d e l . s a v e ( { h i d d e n _ o c c u p a n t s : ! 0 } ) } } ) ; c o n s t Q E = { o f f l i n e : " O f f l i n e " , u n a v a i l a b l e : " U n a v a i l a b l e " , x a : " E x t e n d e d A w a y " , a w a y : " A w a y " , d n d : " D o n o t d i s t u r b " , c h a t : " C h a t t t y " , o n l i n e : " O n l i n e " } , Y E = e = > { c o n s t t = e . g e t ( " r o l e " ) , n = ( e = > G y ( " C l i c k t o m e n t i o n % 1 $ s i n y o u r m e s s a g e . " , e . g e t ( " n i c k " ) ) ) ( e ) , s = G y ( " T h i s u s e r i s a m o d e r a t o r . " ) , i = G y ( " T h i s u s e r c a n s e n d m e s s a g e s i n t h i s g r o u p c h a t . " ) , r = G y ( " T h i s u s e r c a n N O T s e n d m e s s a g e s i n t h i s g r o u p c h a t . " ) , o = e . g e t ( " j i d " ) ? ` $ { e . g e t ( " j i d " ) } ` : " " ; r e t u r n " m o d e r a t o r " = = = t ? ` $ { o } $ { s } $ { n } ` : " p a r t i c i p a n t " = = = t ? ` $ { o } $ { i } $ { n } ` : " v i s i t o r " = = = t ? ` $ { o } $ { r } $ { n } ` : [ " v i s i t o r " , " p a r t i c i p a n t " , " m o d e r a t o r " ] . i n c l u d e s ( t ) ? v o i d 0 : ` $ { o } $ { n } ` } , K E = ( e , t ) = > { c o n s t n = e . g e t ( " a f f i l i a t i o n " ) , s = Q E [ e . g e t ( " s h o w " ) ] , i = G y ( " A d m i n " ) , r = G y ( " M e m b e r " ) , o = G y ( " M o d e r a t o r " ) , a = G y ( " O w n e r " ) , c = G y ( " V i s i t o r " ) , l = e . g e t ( " r o l e " ) , d = e . g e t ( " s h o w " ) ; l e t u , h ; r e t u r n [ u , h ] = " o n l i n e " = = = d ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - o n l i n e " ] : " d n d " = = = d ? [ " f a f a - m i n u s - c i r c l e " , " c h a t - s t a t u s - b u s y " ] : " a w a y " = = = d ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - a w a y " ] : [ " f a f a - c i r c l e " , " s u b d u e d - c o l o r " ] , G u `
< li class = "occupant" id = "${e.id}" title = "${YE(e)}" >
2021-11-11 22:06:49 +01:00
< div class = "row no-gutters" >
< div class = "col-auto" >
2023-02-17 12:24:37 +01:00
< a class = "show-msg-author-modal" @ click = $ { t => function ( e , t ) { Ih . modal . show ( "converse-muc-occupant-modal" , { model : t } , e ) } ( t , e ) } >
2022-01-03 11:54:10 +01:00
< converse - avatar
class = "avatar chat-msg__avatar"
2023-01-07 22:34:35 +01:00
. data = $ { e . vcard ? . attributes }
nonce = $ { e . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "30" width = "30" > < / c o n v e r s e - a v a t a r >
< converse - icon
2023-01-07 22:34:35 +01:00
title = "${s}"
color = "var(--${h})"
2022-01-03 11:54:10 +01:00
style = "margin-top: -0.1em"
size = "0.82em"
2023-01-07 22:34:35 +01:00
class = "${u} chat-status chat-status--avatar" > < / c o n v e r s e - i c o n >
2022-01-03 11:54:10 +01:00
< / a >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "col occupant-nick-badge" >
2022-01-03 11:54:10 +01:00
< span class = "occupant-nick" @ click = $ { t . onOccupantClicked } > $ { e . getDisplayName ( ) } < / s p a n >
2021-11-11 22:06:49 +01:00
< span class = "occupant-badges" >
2023-02-17 12:24:37 +01:00
$ { "owner" === n ? Gu ` <span class="badge badge-groupchat"> ${ a } </span> ` : "" }
$ { "admin" === n ? Gu ` <span class="badge badge-info"> ${ i } </span> ` : "" }
$ { "member" === n ? Gu ` <span class="badge badge-info"> ${ r } </span> ` : "" }
$ { "moderator" === l ? Gu ` <span class="badge badge-info"> ${ o } </span> ` : "" }
$ { "visitor" === l ? Gu ` <span class="badge badge-secondary"> ${ c } </span> ` : "" }
2021-11-11 22:06:49 +01:00
< / s p a n >
< / d i v >
< / d i v >
< / l i >
2023-02-17 12:24:37 +01:00
` };var XE=n(9959),eA={};eA.styleTagTransform=o_(),eA.setAttributes=n_(),eA.insert=e_().bind(null,"head"),eA.domAPI=Ky(),eA.insertStyleElement=i_();Qy()(XE.Z,eA);XE.Z&&XE.Z.locals&&XE.Z.locals;var tA=n(902),nA={};nA.styleTagTransform=o_(),nA.setAttributes=n_(),nA.insert=e_().bind(null,"head"),nA.domAPI=Ky(),nA.insertStyleElement=i_();Qy()(tA.Z,nA);tA.Z&&tA.Z.locals&&tA.Z.locals;const{u:sA}=Oh.env;Ih.elements.define("converse-muc-sidebar",class extends Vy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=nd.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.listenTo(this.model.occupants,"vcard:change",(()=>this.requestUpdate())),this.listenTo(this.model.occupants,"vcard:add",(()=>this.requestUpdate())),this.model.initialized.then((()=>this.requestUpdate()))}render(){const e=(e=>{const t=1===e.occupants.length?Gy("Participant"):Gy("Participants");return Gu `
2021-11-11 22:06:49 +01:00
< div class = "occupants-header" >
< div class = "occupants-header--title" >
2022-05-05 23:06:17 +02:00
< span class = "occupants-heading" > $ { e . occupants . length } $ { t } < / s p a n >
2022-04-02 21:20:14 +02:00
< i class = "hide-occupants" @ click = $ { e . closeSidebar } >
< converse - icon class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
< / i >
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
< div class = "dragresize dragresize-occupants-left" > < / d i v >
2023-02-17 12:24:37 +01:00
< ul class = "occupant-list" > $ { Mw ( e . occupants , ( e => e . get ( "jid" ) ) , ( t => KE ( t , e ) ) ) } < / u l >
` })(Object.assign(this.model.toJSON(),{occupants:[...this.model.occupants.models],closeSidebar:e=>this.closeSidebar(e),onOccupantClicked:e=>this.onOccupantClicked(e)}));return e}closeSidebar(e){e?.preventDefault?.(),e?.stopPropagation?.(),sA.safeSave(this.model,{hidden_occupants:!0})}onOccupantClicked(e){e?.preventDefault?.();nd.chatboxviews.get(this.getAttribute("jid"))?.getMessageForm().insertIntoTextArea( ` @ $ { e . target . textContent } ` )}});const{u:iA}=Oh.env;Ih.elements.define("converse-muc-chatarea",class extends Vy{static get properties(){return{jid:{type:String},show_help_messages:{type:Boolean},type:{type:String}}}async initialize(){this.model=await Ih.rooms.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),this.requestUpdate()}render(){return(e=>Gu `
2021-11-11 22:06:49 +01:00
< div class = "chat-area" >
< div class = "chat-content ${e.show_send_button?" chat - content - sendbutton ":" "}" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.jid}" > < / c o n v e r s e - c h a t - c o n t e n t >
2023-02-17 12:24:37 +01:00
$ { e . model ? . get ( "show_help_messages" ) ? Gu ` <div class="chat-content__help">
2021-11-11 22:06:49 +01:00
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . getHelpMessages ( ) }
type = "info"
2023-02-17 12:24:37 +01:00
chat _type = "${nd.CHATROOMS_TYPE}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - c h a t - h e l p > < / d i v > ` : " " }
< / d i v >
< converse - muc - bottom - panel jid = "${e.jid}" class = "bottom-panel" > < / c o n v e r s e - m u c - b o t t o m - p a n e l >
< / d i v >
< div class = "disconnect-container hidden" > < / d i v >
2023-02-17 12:24:37 +01:00
$ { e . model ? Gu `
2021-11-11 22:06:49 +01:00
< converse - muc - sidebar
class = "occupants col-md-3 col-4 ${e.shouldShowSidebar()?" ":" hidden "}"
style = "flex: 0 0 ${e.model.get(" occupants _width ")}px"
jid = $ { e . jid }
@ mousedown = $ { e . onMousedown } > < / c o n v e r s e - m u c - s i d e b a r > ` : " " }
2023-02-17 12:24:37 +01:00
` )({getHelpMessages:()=>this.getHelpMessages(),jid:this.jid,model:this.model,onMousedown:e=>this.onMousedown(e),show_send_button:Ih.settings.get("show_send_button"),shouldShowSidebar:()=>this.shouldShowSidebar(),type:this.type})}shouldShowSidebar(){return!this.model.get("hidden_occupants")&&this.model.session.get("connection_status")===Oh.ROOMSTATUS.ENTERED}getHelpMessages(){const e=Ih.settings.get("muc_disable_slash_commands"),t=Array.isArray(e)?e:[];return[ ` < strong > / a d m i n < / s t r o n g > : $ { G y ( " C h a n g e u s e r ' s a f f i l i a t i o n t o a d m i n " ) } ` , ` < s t r o n g > / b a n < / s t r o n g > : $ { G y ( " B a n u s e r b y c h a n g i n g t h e i r a f f i l i a t i o n t o o u t c a s t " ) } ` , ` < s t r o n g > / c l e a r < / s t r o n g > : $ { G y ( " C l e a r t h e c h a t a r e a " ) } ` , ` < s t r o n g > / c l o s e < / s t r o n g > : $ { G y ( " C l o s e t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / d e o p < / s t r o n g > : $ { G y ( " C h a n g e u s e r r o l e t o p a r t i c i p a n t " ) } ` , ` < s t r o n g > / d e s t r o y < / s t r o n g > : $ { G y ( " R e m o v e t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / h e l p < / s t r o n g > : $ { G y ( " S h o w t h i s m e n u " ) } ` , ` < s t r o n g > / k i c k < / s t r o n g > : $ { G y ( " K i c k u s e r f r o m g r o u p c h a t " ) } ` , ` < s t r o n g > / m e < / s t r o n g > : $ { G y ( " W r i t e i n 3 r d p e r s o n " ) } ` , ` < s t r o n g > / m e m b e r < / s t r o n g > : $ { G y ( " G r a n t m e m b e r s h i p t o a u s e r " ) } ` , ` < s t r o n g > / m o d t o o l s < / s t r o n g > : $ { G y ( " O p e n s u p t h e m o d e r a t o r t o o l s G U I " ) } ` , ` < s t r o n g > / m u t e < / s t r o n g > : $ { G y ( " R e m o v e u s e r ' s a b i l i t y t o p o s t m e s s a g e s " ) } ` , ` < s t r o n g > / n i c k < / s t r o n g > : $ { G y ( " C h a n g e y o u r n i c k n a m e " ) } ` , ` < s t r o n g > / o p < / s t r o n g > : $ { G y ( " G r a n t m o d e r a t o r r o l e t o u s e r " ) } ` , ` < s t r o n g > / o w n e r < / s t r o n g > : $ { G y ( " G r a n t o w n e r s h i p o f t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / r e g i s t e r < / s t r o n g > : $ { G y ( " R e g i s t e r y o u r n i c k n a m e " ) } ` , ` < s t r o n g > / r e v o k e < / s t r o n g > : $ { G y ( " R e v o k e t h e u s e r ' s c u r r e n t a f f i l i a t i o n " ) } ` , ` < s t r o n g > / s u b j e c t < / s t r o n g > : $ { G y ( " S e t g r o u p c h a t s u b j e c t " ) } ` , ` < s t r o n g > / t o p i c < / s t r o n g > : $ { G y ( " S e t g r o u p c h a t s u b j e c t ( a l i a s f o r / s u b j e c t ) " ) } ` , ` < s t r o n g > / v o i c e < / s t r o n g > : $ { G y ( " A l l o w m u t e d u s e r t o p o s t m e s s a g e s " ) } ` ] . f i l t e r ( ( e = > t . e v e r y ( ( t = > ! e . s t a r t s W i t h ( t + " < " , 9 ) ) ) ) ) . f i l t e r ( ( e = > t h i s . m o d e l . g e t A l l o w e d C o m m a n d s ( ) . s o m e ( ( t = > e . s t a r t s W i t h ( t + " < " , 9 ) ) ) ) ) } o n M o u s e d o w n ( e ) { i A . h a s C l a s s ( " d r a g r e s i z e - o c c u p a n t s - l e f t " , e . t a r g e t ) & & t h i s . o n S t a r t R e s i z e O c c u p a n t s ( e ) } o n S t a r t R e s i z e O c c u p a n t s ( e ) { t h i s . r e s i z i n g = ! 0 , t h i s . a d d E v e n t L i s t e n e r ( " m o u s e m o v e " , t h i s . o n M o u s e M o v e ) , t h i s . a d d E v e n t L i s t e n e r ( " m o u s e u p " , t h i s . o n M o u s e U p ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) , n = w i n d o w . g e t C o m p u t e d S t y l e ( t ) ; t h i s . w i d t h = p a r s e I n t ( n . w i d t h . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , t h i s . p r e v _ p a g e X = e . p a g e X } _ o n M o u s e M o v e ( e ) { i f ( t h i s . r e s i z i n g ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . p r e v _ p a g e X - e . p a g e X ; t h i s . r e s i z e S i d e b a r V i e w ( t , e . p a g e X ) , t h i s . p r e v _ p a g e X = e . p a g e X } } _ o n M o u s e U p ( e ) { i f ( t h i s . r e s i z i n g ) { e . p r e v e n t D e f a u l t ( ) , t h i s . r e s i z i n g = ! 1 , t h i s . r e m o v e E v e n t L i s t e n e r ( " m o u s e m o v e " , t h i s . o n M o u s e M o v e ) , t h i s . r e m o v e E v e n t L i s t e n e r ( " m o u s e u p " , t h i s . o n M o u s e U p ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) . g e t B o u n d i n g C l i e n t R e c t ( ) , n = t h i s . c a l c u l a t e S i d e b a r W i d t h ( t , 0 ) ; i A . s a f e S a v e ( t h i s . m o d e l , { o c c u p a n t s _ w i d t h : n } ) } } c a l c u l a t e S i d e b a r W i d t h ( e , t ) { l e t n = e . w i d t h + t ; c o n s t s = t h i s . c l i e n t W i d t h ; r e t u r n n < . 2 * s ? ( n = . 2 * s , t h i s . i s _ m i n i m u m = ! 0 ) : n > . 7 5 * s ? ( n = . 7 5 * s , t h i s . i s _ m a x i m u m = ! 0 ) : s - n < 2 5 0 ? ( n = s - 2 5 0 , t h i s . i s _ m a x i m u m = ! 0 ) : ( t h i s . i s _ m a x i m u m = ! 1 , t h i s . i s _ m i n i m u m = ! 1 ) , n } r e s i z e S i d e b a r V i e w ( e , t ) { c o n s t n = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) , s = n . g e t B o u n d i n g C l i e n t R e c t ( ) ; i f ( t h i s . i s _ m i n i m u m ) t h i s . i s _ m i n i m u m = s . l e f t < t ; e l s e i f ( t h i s . i s _ m a x i m u m ) t h i s . i s _ m a x i m u m = s . l e f t > t ; e l s e { c o n s t t = t h i s . c a l c u l a t e S i d e b a r W i d t h ( s , e ) ; n . s t y l e . f l e x = " 0 0 " + t + " p x " } } } ) ; c o n s t { s i z z l e : r A } = O h . e n v , o A = O h . e n v . u t i l s , { s i z z l e : a A } = O h . e n v , c A = O h . e n v . u t i l s ; c l a s s l A e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . m o d e l = n d . c h a t b o x e s . g e t ( t h i s . j i d ) , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : p a s s w o r d p r o t e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . s e s s i o n , " c h a n g e : c o n f i g _ s t a n z a " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . g e t C o n f i g ( ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = I h . s e t t i n g s . g e t ( " r o o m c o n f i g _ w h i t e l i s t " ) , n = e . m o d e l . s e s s i o n . g e t ( " c o n f i g _ s t a n z a " ) ; l e t s , i = [ ] , r = " " ; i f ( n ) { c o n s t o = o A . t o S t a n z a ( n ) ; i = r A ( " f i e l d " , o ) , t . l e n g t h & & ( i = i . f i l t e r ( ( e = > t . i n c l u d e s ( e . g e t A t t r i b u t e ( " v a r " ) ) ) ) ) ; c o n s t a = { n e w _ p a s s w o r d : ! e . m o d e l . f e a t u r e s . g e t ( " p a s s w o r d p r o t e c t e d " ) , f i x e d _ u s e r n a m e : e . m o d e l . g e t ( " j i d " ) } ; i = i . m a p ( ( e = > o A . x F o r m 2 T e m p l a t e R e s u l t ( e , o , a ) ) ) , r = o . q u e r y S e l e c t o r ( " i n s t r u c t i o n s " ) ? . t e x t C o n t
2022-05-05 23:06:17 +02:00
< form class = "converse-form chatroom-form ${i.length?" ":" converse - form -- spinner "}"
2021-11-11 22:06:49 +01:00
autocomplete = "off"
@ submit = $ { e . submitConfigForm } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2022-05-05 23:06:17 +02:00
< legend class = "centered" > $ { s } < / l e g e n d >
2023-02-17 12:24:37 +01:00
$ { s !== r ? Gu ` <p class="form-help"> ${ r } </p> ` : "" }
$ { i . length ? i : J _ ( { classes : "hor_centered" } ) }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2023-02-17 12:24:37 +01:00
$ { i . length ? Gu `
2021-11-11 22:06:49 +01:00
< fieldset >
2023-01-07 22:34:35 +01:00
< input type = "submit" class = "btn btn-primary" value = "${o}" >
< input type = "button" class = "btn btn-secondary button-cancel" value = "${a}" @ click = $ { e . closeConfigForm } >
2022-12-17 22:08:36 +01:00
< / f i e l d s e t > ` : " " }
< / f o r m >
2023-02-17 12:24:37 +01:00
` })({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=aA(":input:not([type=button]):not([type=submit])",e.target).map(cA.webForm2xForm).filter((e=>e));try{await this.model.sendConfiguration(t)}catch(e){Il.error(e);const t=Gy("Sorry, an error occurred while trying to submit the config form.")+" "+Gy("Check your browser's developer console for details.");Ih.alert("error",Gy("Error"),t)}await this.model.refreshDiscoInfo(),this.closeForm()}closeForm(e){e?.preventDefault?.(),this.model.session.set("view",null)}}Ih.elements.define("converse-muc-config-form",lA);const dA=e=>{const t=Gy("This groupchat no longer exists"),n=Gy('The following reason was given: "%1 $ s"',e.reason||"");return Gu `
2022-12-17 22:08:36 +01:00
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { t } < / h 3 >
2021-11-11 22:06:49 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . reason ? Gu ` <p class="destroyed-reason"> ${ n } </p> ` : "" }
$ { e . moved _jid ? ( e => { const t = Gy ( "The conversation has moved to a new address. Click the link below to enter." ) ; return Gu `
2022-12-17 22:08:36 +01:00
< p class = "moved-label" > $ { t } < / p >
< p class = "moved-link" >
< a class = "switch-chat" @ click = $ { t => e . onSwitch ( t ) } > $ { e . moved _jid } < / a >
< / p > ` } ) ( e ) : " " }
2023-02-17 12:24:37 +01:00
` };Ih.elements.define("converse-muc-destroyed",class extends Vy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=nd.chatboxes.get(this.jid)}render(){const e=this.model.get("destroyed_reason"),t=this.model.get("moved_jid");return dA({moved_jid:t,reason:e,onSwitch:e=>this.onSwitch(e)})}async onSwitch(e){e.preventDefault();const t=this.model.get("moved_jid");(await Ih.rooms.get(t,{},!0)).maybeShow(!0),this.model.destroy()}});Ih.elements.define("converse-muc-disconnected",class extends Vy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=nd.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(Gy("This action was done by %1 $ s.",n));const s=this.model.session.get("disconnection_reason");return s&&t.push(Gy('The reason given is: "%1 $ s".',s)),(e=>Gu `
2022-12-17 22:08:36 +01:00
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { e [ 0 ] } < / h 3 >
2023-02-17 12:24:37 +01:00
$ { e . slice ( 1 ) . map ( ( e => Gu ` <p class="disconnect-msg"> ${ e } </p> ` ) ) }
< / d i v > ` ) ( t ) } } ) ; c o n s t u A = e = > { c o n s t t = e . t o J S O N ( ) , n = e . c o n f i g . t o J S O N ( ) , s = e . f e a t u r e s . t o J S O N ( ) , i = e . o c c u p a n t s . f i l t e r ( ( e = > " o f f l i n e " ! = = e . g e t ( " s h o w " ) ) ) . l e n g t h , r = G y ( " X M P P a d d r e s s " ) , o = G y ( " M e s s a g e a r c h i v i n g " ) , a = G y ( " M e s s a g e s a r e a r c h i v e d o n t h e s e r v e r " ) , c = G y ( " D e s c r i p t i o n " ) , l = G y ( " F e a t u r e s " ) , d = G y ( " H i d d e n " ) , u = G y ( " T h i s g r o u p c h a t i s n o t p u b l i c l y s e a r c h a b l e " ) , h = G y ( " T h i s g r o u p c h a t i s r e s t r i c t e d t o m e m b e r s o n l y " ) , m = G y ( " M e m b e r s o n l y " ) , g = G y ( " M o d e r a t e d " ) , f = G y ( " P a r t i c i p a n t s e n t e r i n g t h i s g r o u p c h a t n e e d t o r e q u e s t p e r m i s s i o n t o w r i t e " ) , p = G y ( " N a m e " ) , v = G y ( " T h i s g r o u p c h a t d o e s n o t r e q u i r e a p a s s w o r d u p o n e n t r y " ) , y = G y ( " N o p a s s w o r d r e q u i r e d " ) , _ = G y ( " N o t a n o n y m o u s " ) , b = G y ( " A l l o t h e r g r o u p c h a t p a r t i c i p a n t s c a n s e e y o u r X M P P a d d r e s s " ) , w = G y ( " N o t m o d e r a t e d " ) , S = G y ( " P a r t i c i p a n t s e n t e r i n g t h i s g r o u p c h a t c a n w r i t e r i g h t a w a y " ) , x = G y ( " O n l i n e u s e r s " ) , E = G y ( " O p e n " ) , A = G y ( " A n y o n e c a n j o i n t h i s g r o u p c h a t " ) , C = G y ( " T h i s g r o u p c h a t r e q u i r e s a p a s s w o r d b e f o r e e n t r y " ) , $ = G y ( " P a s s w o r d p r o t e c t e d " ) , k = G y ( " P e r s i s t e n t " ) , j = G y ( " T h i s g r o u p c h a t p e r s i s t s e v e n i f i t ' s u n o c c u p i e d " ) , T = G y ( " P u b l i c " ) , N = G y ( " S e m i - a n o n y m o u s " ) , I = G y ( " O n l y m o d e r a t o r s c a n s e e y o u r X M P P a d d r e s s " ) , O = G y ( " T e m p o r a r y " ) , M = G y ( " T h i s g r o u p c h a t w i l l d i s a p p e a r o n c e t h e l a s t p e r s o n l e a v e s " ) ; r e t u r n G u `
2022-12-17 22:08:36 +01:00
< div class = "room-info" >
< p class = "room-info" > < strong > $ { p } < / s t r o n g > : $ { t . n a m e } < / p >
< p class = "room-info" > < strong > $ { r } < / s t r o n g > : < c o n v e r s e - r i c h - t e x t t e x t = " x m p p : $ { t . j i d } ? j o i n " > < / c o n v e r s e - r i c h - t e x t > < / p >
< p class = "room-info" > < strong > $ { c } < / s t r o n g > : < c o n v e r s e - r i c h - t e x t t e x t = " $ { n . d e s c r i p t i o n } " r e n d e r _ s t y l i n g > < / c o n v e r s e - r i c h - t e x t > < / p >
2023-02-17 12:24:37 +01:00
$ { t . subject ? ( e => { const t = Gy ( "Topic" ) , n = Gy ( "Topic author" ) ; return Gu `
2022-04-02 21:20:14 +02:00
< p class = "room-info" > < strong > $ { t } < / s t r o n g > : < c o n v e r s e - r i c h - t e x t t e x t = $ { e . s u b j e c t . t e x t } r e n d e r _ s t y l i n g > < / c o n v e r s e - r i c h - t e x t > < / p >
2021-11-11 22:06:49 +01:00
< p class = "room-info" > < strong > $ { n } < / s t r o n g > : $ { e . s u b j e c t & & e . s u b j e c t . a u t h o r } < / p >
2022-04-02 21:20:14 +02:00
` })(t):""}
2022-12-17 22:08:36 +01:00
< p class = "room-info" > < strong > $ { x } < / s t r o n g > : $ { i } < / p >
< p class = "room-info" > < strong > $ { l } < / s t r o n g > :
< div class = "chatroom-features" >
< ul class = "features-list" >
2023-02-17 12:24:37 +01:00
$ { s . passwordprotected ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-lock"></converse-icon> ${ $ } - <em> ${ C } </em></li> ` : "" }
$ { s . unsecured ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-unlock"></converse-icon> ${ y } - <em> ${ v } </em></li> ` : "" }
$ { s . hidden ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-eye-slash"></converse-icon> ${ d } - <em> ${ u } </em></li> ` : "" }
$ { s . public _room ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-eye"></converse-icon> ${ T } - <em> ${ t . _ _ ( "This groupchat is publicly searchable" ) } </em></li> ` : "" }
$ { s . membersonly ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-address-book"></converse-icon> ${ m } - <em> ${ h } </em></li> ` : "" }
$ { s . open ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-globe"></converse-icon> ${ E } - <em> ${ A } </em></li> ` : "" }
$ { s . persistent ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-save"></converse-icon> ${ k } - <em> ${ j } </em></li> ` : "" }
$ { s . temporary ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-snowflake"></converse-icon> ${ O } - <em> ${ M } </em></li> ` : "" }
$ { s . nonanonymous ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-id-card"></converse-icon> ${ _ } - <em> ${ b } </em></li> ` : "" }
$ { s . semianonymous ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-user-secret"></converse-icon> ${ N } - <em> ${ I } </em></li> ` : "" }
$ { s . moderated ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-gavel"></converse-icon> ${ g } - <em> ${ f } </em></li> ` : "" }
$ { s . unmoderated ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-info-circle"></converse-icon> ${ w } - <em> ${ S } </em></li> ` : "" }
$ { s . mam _enabled ? Gu ` <li class="feature" ><converse-icon size="1em" class="fa fa-database"></converse-icon> ${ o } - <em> ${ a } </em></li> ` : "" }
2022-12-17 22:08:36 +01:00
< / u l >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< / p >
2023-02-17 12:24:37 +01:00
` };var hA=n(814),mA={};mA.styleTagTransform=o_(),mA.setAttributes=n_(),mA.insert=e_().bind(null,"head"),mA.domAPI=Ky(),mA.insertStyleElement=i_();Qy()(hA.Z,mA);hA.Z&&hA.Z.locals&&hA.Z.locals;Ih.elements.define("converse-muc-details-modal",class extends $ _{initialize(){super.initialize(),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()))}renderModal(){return uA(this.model)}getModalTitle(){return Gy("Groupchat info for %1 $ s",this.model.getDisplayName())}});const gA=Oh.env.utils;Ih.elements.define("converse-muc-invite-modal",class extends $ _{initialize(){super.initialize(),this.listenTo(this.model,"change",(()=>this.render()))}renderModal(){return(e=>{const t=Gy("Invite"),n=Gy("user@example.org"),s=Gy("Please enter a valid XMPP address"),i=Gy("XMPP Address"),r=Gy("Optional reason for the invitation");return Gu `
2022-12-17 22:08:36 +01:00
< form class = "converse-form" @ submit = $ { t => e . submitInviteForm ( t ) } >
< div class = "form-group" >
< label class = "clearfix" for = "invitee_jids" > $ { i } : < / l a b e l >
2023-02-17 12:24:37 +01:00
$ { e . model . get ( "invalid_invite_jid" ) ? Gu ` <div class="error error-feedback"> ${ s } </div> ` : "" }
2022-12-17 22:08:36 +01:00
< converse - autocomplete
. getAutoCompleteList = $ { ( ) => e . getAutoCompleteList ( ) }
? autofocus = $ { ! 0 }
min _chars = "1"
position = "below"
required = "required"
name = "invitee_jids"
id = "invitee_jids"
placeholder = "${n}" >
< / c o n v e r s e - a u t o c o m p l e t e >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label > $ { r } : < / l a b e l >
< textarea class = "form-control" name = "reason" > < / t e x t a r e a >
< / d i v >
< div class = "form-group" >
< input type = "submit" class = "btn btn-primary" value = "${t}" / >
< / d i v >
< / f o r m >
2023-02-17 12:24:37 +01:00
` })(this)}getModalTitle(){return Gy("Invite someone to this groupchat")}getAutoCompleteList(){return nd.roster.map((e=>({label:e.getDisplayName(),value:e.get("jid")})))}submitInviteForm(e){e.preventDefault();const t=new FormData(e.target),n=t.get("invitee_jids")?.trim(),s=t.get("reason");gA.isValidJID(n)?(this.chatroomview.model.directInvite(n,s),this.modal.hide()):this.model.set({invalid_invite_jid:!0})}});Ih.elements.define("converse-muc-nickname-modal",class extends $ _{renderModal(){return Gu ` < converse - muc - nickname - form jid = "${this.model.get(" jid ")}" > < / c o n v e r s e - m u c - n i c k n a m e - f o r m > ` } g e t M o d a l T i t l e ( ) { r e t u r n G y ( " C h a n g e y o u r n i c k n a m e " ) } } ) ; v a r f A = n ( 3 0 7 ) , p A = { } ; p A . s t y l e T a g T r a n s f o r m = o _ ( ) , p A . s e t A t t r i b u t e s = n _ ( ) , p A . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , p A . d o m A P I = K y ( ) , p A . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( f A . Z , p A ) ; f A . Z & & f A . Z . l o c a l s & & f A . Z . l o c a l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - r i c h - t e x t " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { e m b e d _ a u d i o : { t y p e : B o o l e a n } , e m b e d _ v i d e o s : { t y p e : B o o l e a n } , m e n t i o n s : { t y p e : A r r a y } , n i c k : { t y p e : S t r i n g } , o f f s e t : { t y p e : N u m b e r } , o n I m g C l i c k : { t y p e : F u n c t i o n } , o n I m g L o a d : { t y p e : F u n c t i o n } , r e n d e r _ s t y l i n g : { t y p e : B o o l e a n } , s h o w _ i m a g e s : { t y p e : B o o l e a n } , h i d e _ m e d i a _ u r l s : { t y p e : B o o l e a n } , s h o w _ m e _ m e s s a g e : { t y p e : B o o l e a n } , t e x t : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . e m b e d _ a u d i o = ! 1 , t h i s . e m b e d _ v i d e o s = ! 1 , t h i s . h i d e _ m e d i a _ u r l s = ! 1 , t h i s . m e n t i o n s = [ ] , t h i s . o f f s e t = 0 , t h i s . r e n d e r _ s t y l i n g = ! 1 , t h i s . s h o w _ i m a g e _ u r l s = ! 0 , t h i s . s h o w _ i m a g e s = ! 1 , t h i s . s h o w _ m e _ m e s s a g e = ! 1 } r e n d e r ( ) { c o n s t e = { e m b e d _ a u d i o : t h i s . e m b e d _ a u d i o , e m b e d _ v i d e o s : t h i s . e m b e d _ v i d e o s , h i d e _ m e d i a _ u r l s : t h i s . h i d e _ m e d i a _ u r l s , m e n t i o n s : t h i s . m e n t i o n s , n i c k : t h i s . n i c k , o n I m g C l i c k : t h i s . o n I m g C l i c k , o n I m g L o a d : t h i s . o n I m g L o a d , r e n d e r _ s t y l i n g : t h i s . r e n d e r _ s t y l i n g , s h o w _ i m a g e s : t h i s . s h o w _ i m a g e s , s h o w _ m e _ m e s s a g e : t h i s . s h o w _ m e _ m e s s a g e } ; r e t u r n H S ( t h i s . t e x t , t h i s . o f f s e t , e ) } } ) ; v a r v A = n ( 3 2 8 8 ) , y A = { } ; y A . s t y l e T a g T r a n s f o r m = o _ ( ) , y A . s e t A t t r i b u t e s = n _ ( ) , y A . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , y A . d o m A P I = K y ( ) , y A . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( v A . Z , y A ) ; v A . Z & & v A . Z . l o c a l s & & v A . Z . l o c a l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - h e a d i n g " , c l a s s e x t e n d s V y { a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = n d . c h a t b o x e s . g e t ( t h i s . g e t A t t r i b u t e ( " j i d " ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . u s e r _ s e t t i n g s = a w a i t n d . a p i . u s e r . s e t t i n g s . g e t M o d e l ( ) , t h i s . l i s t e n T o ( t h i s . u s e r _ s e t t i n g s , " c h a n g e : m u c s _ w i t h _ h i d d e n _ s u b j e c t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , a w a i t t h i s . m o d e l . i n i t i a l i z e d , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : o p e n " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . m o d e l . o c c u p a n t s . f o r E a c h ( ( e = > t h i s . o n O c c u p a n t A d d e d ( e ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " a d d " , t h i s . o n O c c u p a n t A d d e d ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e : a f f i l i a t i o n " , t h i s . o n O c c u p a n t A f f i l i a t i o n C h a n g e d ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l & & t h i s . u s e r _ s e t t i n g s ? ( e = > { c o n s t t = e . m o d e l . t o J S O N ( ) , n = e . u s e r _ s e t t i n g s ? . g e t ( " m u c s _ w i t h _ h i d d e n _ s u b j e c t " , [ ] ) ? . i n c l u d e s ( e . m o d e l . g e t ( " j i d " ) ) , s = e . g e t H e a d i n g B u t t o n s ( n ) , i = G y ( " H i d e t h e g r o u p c h a t t o p i c " ) , r = G y ( " T h i s g r o u p c h a t i s b o o k m a r k e d " ) , o = t . s u b j e c t ? t . s u b j e c t . t e x t : " " , a = o & & ! n , c = e . m o d e l . v c a r d ? . g e t ( " i m a g e " ) ; r e t u r n G u `
2023-01-07 22:34:35 +01:00
< div class = "chatbox-title ${a?" ":" chatbox - title -- no - desc "}" >
2022-05-05 23:06:17 +02:00
2023-02-17 12:24:37 +01:00
$ { c && c !== nd . DEFAULT _IMAGE ? Gu `
2022-05-05 23:06:17 +02:00
< converse - avatar class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-05-05 23:06:17 +02:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r > ` : " " }
2022-04-02 21:20:14 +02:00
< div class = "chatbox-title--row" >
2023-02-17 12:24:37 +01:00
$ { nd . api . settings . get ( "singleton" ) ? "" : Gu ` <converse-controlbox-navback jid=" ${ t . jid } "></converse-controlbox-navback> ` }
< div class = "chatbox-title__text" title = "${" hidden "!==Ih.settings.get(" locked _muc _domain ")?t.jid:" "}" > $ { e . model . getDisplayName ( ) }
$ { t . bookmarked ? Gu ` <converse-icon
2022-12-17 22:08:36 +01:00
class = "fa fa-bookmark chatbox-title__text--bookmarked"
size = "1em"
color = "var(--chatroom-head-color)"
2023-01-07 22:34:35 +01:00
title = "${r}" >
2022-12-17 22:08:36 +01:00
< / c o n v e r s e - i c o n > ` : " " }
2022-04-02 21:20:14 +02:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
2023-02-17 12:24:37 +01:00
$ { vb ( OS ( s ) , "" ) }
$ { vb ( MS ( s ) , "" ) }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2023-02-17 12:24:37 +01:00
$ { a ? Gu ` <p class="chat-head__desc" title=" ${ i } ">
2023-01-07 22:34:35 +01:00
< converse - rich - text text = $ { o } render _styling > < / c o n v e r s e - r i c h - t e x t >
2021-11-11 22:06:49 +01:00
< / p > ` : " " }
2023-02-17 12:24:37 +01:00
` })(this):""}onOccupantAdded(e){e.get("jid")===nd.bare_jid&&this.requestUpdate()}onOccupantAffiliationChanged(e){e.get("jid")===nd.bare_jid&&this.requestUpdate()}showRoomDetailsModal(e){e.preventDefault(),Ih.modal.show("converse-muc-details-modal",{model:this.model},e)}showInviteModal(e){e.preventDefault(),Ih.modal.show("converse-muc-invite-modal",{model:new No,chatroomview:this},e)}toggleTopic(e){e?.preventDefault?.(),this.model.toggleSubjectHiddenState()}getAndRenderConfigurationForm(){this.model.session.set("view",Oh.MUC.VIEWS.CONFIG)}close(e){e.preventDefault(),this.model.close()}destroy(e){e.preventDefault(),Tb(this.model)}getHeadingButtons(e){const t=[];t.push({i18n_text:Gy("Details"),i18n_title:Gy("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:Gy("Configure"),i18n_title:Gy("Configure this groupchat"),handler:()=>this.getAndRenderConfigurationForm(),a_class:"configure-chatroom-button",icon_class:"fa-wrench",name:"configure"}),t.push({i18n_text:Gy("Nickname"),i18n_title:Gy("Change the nickname you're using in this groupchat"),handler:e=>Ih.modal.show("converse-muc-nickname-modal",{model:this.model},e),a_class:"open-nickname-modal",icon_class:"fa-smile",name:"nickname"}),this.model.invitesAllowed()&&t.push({i18n_text:Gy("Invite"),i18n_title:Gy("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");n&&n.text&&t.push({i18n_text:Gy(e?"Show topic":"Hide topic"),i18n_title:Gy(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"});if(this.model.session.get("connection_status")===Oh.ROOMSTATUS.ENTERED){const e=this.model.getAllowedCommands();e.includes("modtools")&&t.push({i18n_text:Gy("Moderate"),i18n_title:Gy("Moderate this groupchat"),handler:()=>Db(this.model),a_class:"moderate-chatroom-button",icon_class:"fa-user-cog",name:"moderate"}),e.includes("destroy")&&t.push({i18n_text:Gy("Destroy"),i18n_title:Gy("Remove this groupchat"),handler:e=>this.destroy(e),a_class:"destroy-chatroom-button",icon_class:"fa-trash",name:"destroy"})}Ih.settings.get("singleton")||t.push({i18n_text:Gy("Leave"),i18n_title:Gy("Leave and close this groupchat"),handler:async e=>{e.stopPropagation();const t=[Gy("Are you sure you want to leave this groupchat?")];await Ih.confirm(Gy("Confirm"),t)&&this.close(e)},a_class:"close-chatbox-button",standalone:"overlayed"===Ih.settings.get("view_mode"),icon_class:"fa-sign-out-alt",name:"signout"});const s=nd.chatboxviews.get(this.getAttribute("jid"));return s?nd.api.hook("getHeadingButtons",s,t):Promise.resolve(t)}});class _A extends Vy{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=nd.chatboxes.get(this.jid),this.listenTo(this.model,"change:password_validation_message",this.render),this.render()}render(){return(e=>{const t=Gy("This groupchat requires a password"),n=Gy("Password: "),s=Gy("Submit");return Gu `
2021-11-11 22:06:49 +01:00
< form class = "converse-form chatroom-form converse-centered-form" @ submit = $ { e . submitPassword } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label > $ { t } < / l a b e l >
< p class = "validation-message" > $ { e . validation _message } < / p >
< input class = "hidden-username" type = "text" autocomplete = "username" value = "${e.jid}" > < / i n p u t >
< input type = "password"
name = "password"
required = "required"
class = "form-control ${e.validation_message?" error ":" "}"
placeholder = "${n}" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2022-05-05 23:06:17 +02:00
< input class = "btn btn-primary" type = "submit" value = "${s}" / >
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
2021-03-19 19:26:15 +01:00
< / f o r m >
2023-02-17 12:24:37 +01:00
` })({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)}}Ih.elements.define("converse-muc-password-form",_A);class bA extends Yx{length=300;is_chatroom=!0;async initialize(){this.model=await Ih.rooms.get(this.jid),nd.chatboxviews.add(this.jid,this),this.setAttribute("id",this.model.get("box_id")),this.listenTo(nd,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdateMessageForm),this.listenTo(this.model.session,"change:connection_status",this.onConnectionStatusChanged),this.listenTo(this.model.session,"change:view",(()=>this.requestUpdate())),this.onConnectionStatusChanged(),this.model.maybeShow(),Ih.trigger("chatRoomViewInitialized",this)}render(){return(e=>Gu `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2023-02-17 12:24:37 +01:00
$ { e . model ? Gu `
2021-11-11 22:06:49 +01:00
< converse - muc - heading jid = "${e.model.get(" jid ")}" class = "chat-head chat-head-chatroom row no-gutters" >
< / c o n v e r s e - m u c - h e a d i n g >
2023-02-17 12:24:37 +01:00
< div class = "chat-body chatroom-body row no-gutters" > $ { Nb ( e ) } < / d i v >
2021-11-11 22:06:49 +01:00
` :""}
2023-02-17 12:24:37 +01:00
< / d i v > ` ) ( { m o d e l : t h i s . m o d e l } ) } o n C o n n e c t i o n S t a t u s C h a n g e d ( ) { t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = O h . R O O M S T A T U S . C O N N E C T I N G & & ( t h i s . m o d e l . s e s s i o n . s a v e ( { d i s c o n n e c t i o n _ a c t o r : v o i d 0 , d i s c o n n e c t i o n _ m e s s a g e : v o i d 0 , d i s c o n n e c t i o n _ r e a s o n : v o i d 0 } ) , t h i s . m o d e l . s a v e ( { m o v e d _ j i d : v o i d 0 , p a s s w o r d _ v a l i d a t i o n _ m e s s a g e : v o i d 0 , r e a s o n : v o i d 0 } ) ) , t h i s . r e q u e s t U p d a t e ( ) } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c " , b A ) ; v a r w A = n ( 3 0 7 6 ) , S A = { } ; S A . s t y l e T a g T r a n s f o r m = o _ ( ) , S A . s e t A t t r i b u t e s = n _ ( ) , S A . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , S A . d o m A P I = K y ( ) , S A . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( w A . Z , S A ) ; w A . Z & & w A . Z . l o c a l s & & w A . Z . l o c a l s ; c o n s t { S t r o p h e : x A } = O h . e n v ; O h . M U C . V I E W S = { C O N F I G : " c o n f i g - f o r m " } , O h . p l u g i n s . a d d ( " c o n v e r s e - m u c - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - m o d a l " , " c o n v e r s e - c o n t r o l b o x " , " c o n v e r s e - c h a t v i e w " ] , i n i t i a l i z e ( ) { c o n s t { _ c o n v e r s e : e } = t h i s ; I h . s e t t i n g s . e x t e n d ( { a u t o _ l i s t _ r o o m s : ! 1 , c a c h e _ m u c _ m e s s a g e s : ! 0 , l o c k e d _ m u c _ n i c k n a m e : ! 1 , m o d t o o l s _ d i s a b l e _ q u e r y : [ ] , m u c _ d i s a b l e _ s l a s h _ c o m m a n d s : ! 1 , m u c _ m e n t i o n _ a u t o c o m p l e t e _ f i l t e r : " c o n t a i n s " , m u c _ m e n t i o n _ a u t o c o m p l e t e _ m i n _ c h a r s : 0 , m u c _ m e n t i o n _ a u t o c o m p l e t e _ s h o w _ a v a t a r : ! 0 , m u c _ r o o m i d _ p o l i c y : n u l l , m u c _ r o o m i d _ p o l i c y _ h i n t : n u l l , r o o m c o n f i g _ w h i t e l i s t : [ ] , s h o w _ r e t r a c t i o n _ w a r n i n g : ! 0 , v i s i b l e _ t o o l b a r _ b u t t o n s : { t o g g l e _ o c c u p a n t s : ! 0 } } ) , e . C h a t R o o m V i e w = b A , I h . s e t t i n g s . g e t ( " m u c _ d o m a i n " ) | | I h . l i s t e n . o n ( " s e r v i c e D i s c o v e r e d " , ( a s y n c e = > { i f ( e ? . g e t ( " v a r " ) = = = x A . N S . M U C ) { i f ( e . e n t i t y . g e t ( " j i d " ) . i n c l u d e s ( " @ " ) ) r e t u r n ; a w a i t e . e n t i t y . g e t I d e n t i t y ( " c o n f e r e n c e " , " t e x t " ) & & I h . s e t t i n g s . s e t ( " m u c _ d o m a i n " , x A . g e t D o m a i n F r o m J i d ( e . g e t ( " f r o m " ) ) ) } } ) ) , I h . l i s t e n . o n ( " c l e a r s e s s i o n " , ( ( ) = > { c o n s t t = e . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ; t & & t . r o o m s p a n e l & & ( t . r o o m s p a n e l . m o d e l . d e s t r o y ( ) , t . r o o m s p a n e l . r e m o v e ( ) , d e l e t e t . r o o m s p a n e l ) } ) ) , I h . l i s t e n . o n ( " c h a t B o x C l o s e d " , ( t = > { v a r n ; t . g e t ( " t y p e " ) = = = e . C H A T R O O M S _ T Y P E & & ( n = t . g e t ( " j i d " ) , n d . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) = = = ` c o n v e r s e / r o o m ? j i d = $ { n } ` & & n d . r o u t e r . n a v i g a t e ( " " ) ) } ) ) , I h . l i s t e n . o n ( " p a r s e M e s s a g e F o r C o m m a n d s " , z b ) } } ) ; c o n s t E A = N o . e x t e n d ( { d e f a u l t s : { c o l l a p s e d : ! 1 } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m i n i m i z e d - c h a t s " , c l a s s e x t e n d s V y { a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = n d . c h a t b o x e s , a w a i t t h i s . i n i t T o g g l e ( ) , t h i s . l i s t e n T o ( t h i s . m i n c h a t s , " c h a n g e : c o l l a p s e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : f u l l n a m e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : j i d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : m i n i m i z e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n a m e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n u m _ u n r e a d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d , " c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d , " r e c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d , " d i s c o n n e c t e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . w h e r e ( { m i n i m i z e d : ! 0 } ) , t = e . r e d u c e ( ( ( e , t ) = > e + t . g e t ( " n u m _ u n r e a d " ) ) , 0 ) , n = e . r e d u c e ( ( ( e , t ) = > e + ( t . g e t ( " m i n i m i z e d " ) ? 1 : 0 ) ) , 0 ) , s = { c h a t s : e , n u m _ u n r e a d : t , n u m _ m i n i m i z e d : n , c o l l a p s e d : t h i s . m i n c h a t s . g e t ( " c o l l a p s e d " ) } ; r e t u r n s . t o g g l e = e = > t h i s . t o g g l e ( e ) , ( e = > G u ` < d i v i d = " m i n i m i z e d - c h a t s " c l a s s = " $ { e . c h a t s . l e n g t h ? " " : " h i d d e n " } " >
2022-12-17 22:08:36 +01:00
< a id = "toggle-minimized-chats" class = "row no-gutters" @ click = $ { e . toggle } >
2023-02-17 12:24:37 +01:00
$ { e . num _minimized } $ { Gy ( "Minimized" ) }
2022-12-17 22:08:36 +01:00
< span class = "unread-message-count ${e.num_unread?" ":" unread - message - count - hidden "}" href = "#" > $ { e . num _unread } < / s p a n >
< / a >
< div class = "flyout minimized-chats-flyout row no-gutters ${e.collapsed?" hidden ":" "}" >
2023-02-17 12:24:37 +01:00
$ { e . chats . map ( ( e => Gu ` <converse-minimized-chat
2022-12-17 22:08:36 +01:00
. model = $ { e }
title = $ { e . getDisplayName ( ) }
type = $ { e . get ( "type" ) }
num _unread = $ { e . get ( "num_unread" ) } > < / c o n v e r s e - m i n i m i z e d - c h a t > ` ) ) }
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` ) ( s ) } a s y n c i n i t T o g g l e ( ) { c o n s t e = ` c o n v e r s e . m i n c h a t s t o g g l e - $ { n d . b a r e _ j i d } ` ; t h i s . m i n c h a t s = n e w E A ( { i d : e } ) , X c ( t h i s . m i n c h a t s , e , " s e s s i o n " ) , a w a i t n e w P r o m i s e ( ( e = > t h i s . m i n c h a t s . f e t c h ( { s u c c e s s : e , e r r o r : e } ) ) ) } t o g g l e ( e ) { e ? . p r e v e n t D e f a u l t ( ) , t h i s . m i n c h a t s . s a v e ( { c o l l a p s e d : ! t h i s . m i n c h a t s . g e t ( " c o l l a p s e d " ) } ) } } ) ; c o n s t { d a y j s : A A , u : C A } = O h . e n v ; f u n c t i o n $ A ( e ) { i f ( " c o n t r o l b o x " = = = e . m o d e l . g e t ( " i d " ) ) { i f ( C A . i s V i s i b l e ( e ) ) r e t u r n C A . g e t O u t e r W i d t h ( e , ! 0 ) ; { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - c o n t r o l b o x - t o g g l e " ) ; r e t u r n e ? C A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } } r e t u r n ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & C A . i s V i s i b l e ( e ) ? C A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n k A ( ) { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - m i n i m i z e d - c h a t s " ) ; r e t u r n n d . c h a t b o x e s . p l u c k ( " m i n i m i z e d " ) . i n c l u d e s ( ! 0 ) ? C A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n j A ( e ) { c o n s t t = e ? e . m o d e l . g e t ( " i d " ) : n u l l , n = e ? C A . g e t O u t e r W i d t h ( e , ! 0 ) : 0 ; r e t u r n O b j e c t . v a l u e s ( n d . c h a t b o x v i e w s . x g e t ( t ) ) . r e d u c e ( ( ( e , t ) = > e + $ A ( t ) ) , n ) } f u n c t i o n T A ( e ) { i f ( n d . i s T e s t E n v ( ) | | I h . s e t t i n g s . g e t ( " n o _ t r i m m i n g " ) | | " o v e r l a y e d " ! = = I h . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ) r e t u r n ; c o n s t t = n d . c h a t b o x v i e w s . f i l t e r ( ( e = > ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & ! e . m o d e l . g e t ( " c l o s e d " ) & & C A . i s V i s i b l e ( e ) ) ) ; i f ( t . l e n g t h < = 1 ) r e t u r n ; c o n s t n = C A . g e t O u t e r W i d t h ( d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) , ! 0 ) ; i f ( $ A ( t [ 0 ] ) = = = n ) r e t u r n ; i f ( d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - m i n i m i z e d - c h a t s " ) ) f o r ( ; k A ( ) + j A ( e ) > n ; ) { c o n s t t = N A ( [ e ? e . m o d e l . g e t ( " i d " ) : n u l l ] ) ; i f ( ! t ) b r e a k ; n d . c h a t b o x e s . g e t ( t . g e t ( " i d " ) ) ? . s a v e ( " h i d d e n " , ! 0 ) , O A ( t ) } } f u n c t i o n N A ( e ) { e . p u s h ( " c o n t r o l b o x " ) ; l e t t = 0 , n = n d . c h a t b o x e s . s o r t ( ) . a t ( t ) ; f o r ( ; e . i n c l u d e s ( n . g e t ( " i d " ) ) | | ! 0 = = = n . g e t ( " m i n i m i z e d " ) ; ) i f ( t + + , n = n d . c h a t b o x e s . a t ( t ) , ! n ) r e t u r n n u l l ; r e t u r n n } f u n c t i o n I A ( e , t ) { e ? . p r e v e n t D e f a u l t ? e . p r e v e n t D e f a u l t ( ) : t = e , C A . s a f e S a v e ( t , { h i d d e n : ! 1 , m i n i m i z e d : ! 1 , t i m e _ o p e n e d : ( n e w D a t e ) . g e t T i m e ( ) } ) } f u n c t i o n O A ( e , t ) { e ? . p r e v e n t D e f a u l t ? e . p r e v e n t D e f a u l t ( ) : t = e , t . s e t C h a t S t a t e ( n d . I N A C T I V E ) , C A . s a f e S a v e ( t , { h i d d e n : ! 0 , m i n i m i z e d : ! 0 , t i m e _ m i n i m i z e d : ( n e w D a t e ) . t o I S O S t r i n g ( ) } ) } f u n c t i o n M A ( e ) { e . g e t ( " m i n i m i z e d " ) ? f u n c t i o n ( e ) { I h . t r i g g e r ( " c h a t B o x M i n i m i z e d " , e ) } ( e ) : f u n c t i o n ( e ) { e . i s S c r o l l e d U p ( ) | | e . c l e a r U n r e a d M s g C o u n t e r ( ) , e . s e t C h a t S t a t e ( n d . A C T I V E ) , I h . t r i g g e r ( " c h a t B o x M a x i m i z e d " , e ) } ( e ) } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - m i n i m i z e d - c h a t " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } , t i t l e : { t y p e : S t r i n g } , t y p e : { t y p e : S t r i n g } , n u m _ u n r e a d : { t y p e : N u m b e r } } } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = G y ( " C l i c k t o r e s t o r e t h i s c h a t " ) ; l e t n ; r e t u r n n = " c h a t r o o m " = = = e . t y p e ? " v a r ( - - c h a t r o o m - h e a d - c o l o r ) " : " h e a d l i n e " = = = e . t y p e ? " v a r ( - - h e a d l i n e s - h e a d - t e x t - c o l o r ) " : " v a r ( - - c h a t - h e a d - t e x t - c o l o r ) " , G u `
2022-12-17 22:08:36 +01:00
< div class = "chat-head-${e.type} chat-head row no-gutters" >
< a class = "restore-chat w-100 align-self-center" title = "${t}" @ click = $ { e . restore } >
2023-02-17 12:24:37 +01:00
$ { e . num _unread ? Gu ` <span class="message-count badge badge-light"> ${ e . num _unread } </span> ` : "" }
2022-12-17 22:08:36 +01:00
$ { e . title }
< / a >
< a class = "chatbox-btn close-chatbox-button" @ click = $ { e . close } >
< converse - icon color = $ { n } class = "fas fa-times" @ click = $ { e . close } size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2023-02-17 12:24:37 +01:00
< /div>`})({close:e=>this.close(e),num_unread:this.num_unread,restore:e=>this.restore(e),title:this.title,type:this.type})}close(e){e?.preventDefault(),this.model.close()}restore(e){e?.preventDefault(),IA(this.model)}});var RA=n(4915),DA={};DA.styleTagTransform=o_(),DA.setAttributes=n_(),DA.insert=e_().bind(null,"head"),DA.domAPI=Ky(),DA.insertStyleElement=i_();Qy()(RA.Z,DA);RA.Z&&RA.Z.locals&&RA.Z.locals;Oh.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:{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){!function(e){e.on("change:hidden",(t=>!t.get("hidden")&&IA(e)),e),"controlbox"!==e.get("id")&&e.save({minimized:e.get("minimized")||!1,time_minimized:e.get("time_minimized")||AA()})}(e),e.on("change:minimized",(()=>MA(e)))}Ih.settings.extend({no_trimming:!1}),Ih.promises.add("minimizedChatsInitialized"),nd.MinimizedChatsToggle=EA,nd.minimize={trimChats:TA,minimize:OA,maximize:IA},Ih.listen.on("chatBoxViewInitialized",(e=>nd.minimize.trimChats(e))),Ih.listen.on("chatRoomViewInitialized",(e=>nd.minimize.trimChats(e))),Ih.listen.on("controlBoxOpened",(e=>nd.minimize.trimChats(e))),Ih.listen.on("chatBoxInitialized",e),Ih.listen.on("chatRoomInitialized",e),Ih.listen.on("getHeadingButtons",((e,t)=>e.model.get("type")===nd.CHATROOMS_TYPE?function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>OA(t,e.model),i18n_text:Gy("Minimize"),i18n_title:Gy("Minimize this groupchat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===nd.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=>OA(t,e.model),i18n_text:Gy("Minimize"),i18n_title:Gy("Minimize this chat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===nd.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=vh((()=>nd.minimize.trimChats()),250);Ih.listen.on("registeredGlobalEventHandlers",(()=>window.addEventListener("resize",t))),Ih.listen.on("unregisteredGlobalEventHandlers",(()=>window.removeEventListener("resize",t)))}});var zA=n(3243),LA=n.n(zA);const{Strophe:PA}=Oh.env,FA="Notification"in window;let UA;function BA(e){return nd.isTestEnv()||(nd.chatboxes.get(e.from)?.isHidden()??!1)}function qA(){return nd.isTestEnv()||FA&&Ih.settings.get("show_desktop_notifications")&&"granted"===Notification.permission}function HA(){UA=null,navigator.clearAppBadge?.().catch((e=>Il.error("Could not clear unread count in app badge "+e)))}function GA(){if(Ih.settings.get("show_tab_notifications")){UA=UA??new Oh.env.Favico({type:"circle",animation:"pop"});const e=nd.chatboxes.models.reduce(((e,t)=>e+(t.get("num_unread")||0)),0);UA.badge(e),navigator.setAppBadge?.(e).catch((e=>Il.error("Could set unread count in app badge - "+e)))}}function WA(e,t,n){return e.reduce(((e,s)=>e||(e=>[nd.bare_jid,`${t}/${n}`].includes(e.uri.replace(/ ^ xmpp : / , " " ) ) ) ( s ) ) , ! 1 ) } f u n c t i o n V A ( e ) { c o n s t { a t t r s : t } = e ; i f ( ! t | | t . i s _ f o r w a r d e d ) r e t u r n ! 1 ; i f ( " g r o u p c h a t " = = = t . t y p e ) r e t u r n a s y n c f u n c t i o n ( e ) { i f ( ! e ? . b o d y & & ! e ? . m e s s a g e ) r e t u r n ! 1 ; c o n s t t = e . f r o m , n = e . f r o m _ m u c , s = I h . s e t t i n g s . g e t ( " n o t i f y _ a l l _ r o o m _ m e s s a g e s " ) , i = n d . c h a t b o x e s . g e t ( n ) , r = P A . g e t R e s o u r c e F r o m J i d ( t ) , o = r & & P A . u n e s c a p e N o d e ( r ) | | " " ; l e t a = ! 1 ; c o n s t c = i . g e t ( " n i c k " ) ; I h . s e t t i n g s . g e t ( " n o t i f y _ n i c k n a m e s _ w i t h o u t _ r e f e r e n c e s " ) & & ( a = n e w R e g E x p ( ` \ \ b $ { c } \ \ b ` ) . t e s t ( e . b o d
2022-12-17 22:08:36 +01:00
< form class = "converse-form set-xmpp-status" id = "set-xmpp-status" @ submit = $ { t => e . onFormSubmitted ( t ) } >
< div class = "form-group" >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "online" === a }
type = "radio" id = "radio-online" value = "online" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-online" >
< converse - icon size = "1em" class = "fa fa-circle chat-status chat-status--online" > < / c o n v e r s e - i c o n > $ { s } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "busy" === a }
type = "radio" id = "radio-busy" value = "dnd" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-busy" >
< converse - icon size = "1em" class = "fa fa-minus-circle chat-status chat-status--busy" > < / c o n v e r s e - i c o n > $ { n } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "away" === a }
type = "radio" id = "radio-away" value = "away" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-away" >
< converse - icon size = "1em" class = "fa fa-circle chat-status chat-status--away" > < / c o n v e r s e - i c o n > $ { t } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "xa" === a }
type = "radio" id = "radio-xa" value = "xa" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-xa" >
< converse - icon size = "1em" class = "far fa-circle chat-status chat-status--xa" > < / c o n v e r s e - i c o n > $ { r } < / l a b e l >
< / d i v >
< / d i v >
< div class = "form-group" >
< div class = "btn-group w-100" >
< input name = "status_message" type = "text" class = "form-control" autofocus
value = "${c||" "}" placeholder = "${o}" / >
< converse - icon size = "1em" class = "fa fa-times clear-input ${c?" ":" hidden "}" @ click = $ { t => e . clearStatusMessage ( t ) } > < / c o n v e r s e - i c o n >
< / d i v >
< / d i v >
< button type = "submit" class = "btn btn-primary" > $ { i } < / b u t t o n >
2023-02-17 12:24:37 +01:00
< / f o r m > ` } ) ( t h i s ) } g e t M o d a l T i t l e ( ) { r e t u r n G y ( " C h a n g e c h a t s t a t u s " ) } c l e a r S t a t u s M e s s a g e ( e ) { e & & e . p r e v e n t D e f a u l t & & ( e . p r e v e n t D e f a u l t ( ) , X A . h i d e E l e m e n t ( t h i s . q u e r y S e l e c t o r ( " . c l e a r - i n p u t " ) ) ) ; t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " s t a t u s _ m e s s a g e " ] ' ) . v a l u e = " " } o n F o r m S u b m i t t e d ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) ; t h i s . m o d e l . s a v e ( { s t a t u s _ m e s s a g e : t . g e t ( " s t a t u s _ m e s s a g e " ) , s t a t u s : t . g e t ( " c h a t _ s t a t u s " ) } ) , t h i s . m o d a l . h i d e ( ) } } n d . C h a t S t a t u s M o d a l = e C , I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t - s t a t u s - m o d a l " , e C ) ; c o n s t t C = G y ( " Y o u r p r o f i l e p i c t u r e " ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - i m a g e - p i c k e r " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { h e i g h t : { t y p e : N u m b e r } , d a t a : { t y p e : O b j e c t } , w i d t h : { t y p e : N u m b e r } } } r e n d e r ( ) { r e t u r n G u `
< a class = "change-avatar" @ click = $ { this . openFileSelection } title = "${tC}" >
2022-12-17 22:08:36 +01:00
< converse - avatar class = "avatar" . data = $ { this . data } height = "${this.height}" width = "${this.width}" > < / c o n v e r s e - a v a t a r >
< / a >
< input @ change = $ { this . updateFilePreview } class = "hidden" name = "image" type = "file" / >
2023-02-17 12:24:37 +01:00
` }openFileSelection(e){e.preventDefault(),this.querySelector('input[type="file"]').click()}updateFilePreview(e){const t=e.target.files[0],n=new FileReader;n.onloadend=()=>{this.data={data_uri:n.result,image_type:t.type}},n.readAsDataURL(t)}});const nC=e=>{const t={...e.model.toJSON(),...e.model.vcard.toJSON()},n=Gy("Email"),s=Gy("Full Name"),i=Gy("XMPP Address"),r=Gy("Nickname"),o=Gy("Role"),a=Gy("Save and close"),c=Gy("Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages."),l=Gy("URL"),d=Gy("OMEMO"),u=Gy("Profile"),h=Gy("Reset Password"),m=[Gu ` < li role = "presentation" class = "nav-item" >
2022-12-17 22:08:36 +01:00
< a class = "nav-link ${" profile "===e.tab?" active ":" "}"
id = "profile-tab"
href = "#profile-tabpanel"
2023-01-07 22:34:35 +01:00
aria - controls = "profile-tabpanel"
role = "tab"
2022-12-17 22:08:36 +01:00
@ click = $ { t => e . switchTab ( t ) }
data - name = "profile"
2023-01-07 22:34:35 +01:00
data - toggle = "tab" > $ { u } < / a >
2023-02-17 12:24:37 +01:00
< / l i > ` ] ; r e t u r n m . p u s h ( G u ` < l i r o l e = " p r e s e n t a t i o n " c l a s s = " n a v - i t e m " >
2023-01-07 22:34:35 +01:00
< a class = "nav-link ${" passwordreset "===e.tab?" active ":" "}"
id = "passwordreset-tab"
href = "#passwordreset-tabpanel"
aria - controls = "passwordreset-tabpanel"
role = "tab"
@ click = $ { t => e . switchTab ( t ) }
data - name = "passwordreset"
data - toggle = "tab" > $ { h } < / a >
2023-02-17 12:24:37 +01:00
< / l i > ` ) , n d . p l u g g a b l e . p l u g i n s [ " c o n v e r s e - o m e m o " ] ? . e n a b l e d ( n d ) & & m . p u s h ( G u ` < l i r o l e = " p r e s e n t a t i o n " c l a s s = " n a v - i t e m " >
2023-01-07 22:34:35 +01:00
< a class = "nav-link ${" omemo "===e.tab?" active ":" "}"
id = "omemo-tab"
href = "#omemo-tabpanel"
aria - controls = "omemo-tabpanel"
role = "tab"
@ click = $ { t => e . switchTab ( t ) }
data - name = "omemo"
data - toggle = "tab" > $ { d } < / a >
2023-02-17 12:24:37 +01:00
< / l i > ` ) , G u `
2023-01-07 22:34:35 +01:00
< ul class = "nav nav-pills justify-content-center" > $ { m } < / u l >
2022-12-17 22:08:36 +01:00
< div class = "tab-content" >
< div class = "tab-pane ${" profile "===e.tab?" active ":" "}" id = "profile-tabpanel" role = "tabpanel" aria - labelledby = "profile-tab" >
< form class = "converse-form converse-form--modal profile-form" action = "#" @ submit = $ { t => e . onFormSubmitted ( t ) } >
< div class = "row" >
< div class = "col-auto" >
2023-01-07 22:34:35 +01:00
< converse - image - picker . data = "${{image:t.image,image_type:t.image_type}}" width = "128" height = "128" > < / c o n v e r s e - i m a g e - p i c k e r >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "col" >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label class = "col-form-label" > $ { i } : < / l a b e l >
< div > $ { t . jid } < / d i v >
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-fullname" class = "col-form-label" > $ { s } : < / l a b e l >
< input id = "vcard-fullname" type = "text" class = "form-control" name = "fn" value = "${t.fullname||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-nickname" class = "col-form-label" > $ { r } : < / l a b e l >
< input id = "vcard-nickname" type = "text" class = "form-control" name = "nickname" value = "${t.nickname||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-url" class = "col-form-label" > $ { l } : < / l a b e l >
< input id = "vcard-url" type = "url" class = "form-control" name = "url" value = "${t.url||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-email" class = "col-form-label" > $ { n } : < / l a b e l >
< input id = "vcard-email" type = "email" class = "form-control" name = "email" value = "${t.email||" "}" / >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< label for = "vcard-role" class = "col-form-label" > $ { o } : < / l a b e l >
< input id = "vcard-role" type = "text" class = "form-control" name = "role" value = "${t.role||" "}" aria - describedby = "vcard-role-help" / >
< small id = "vcard-role-help" class = "form-text text-muted" > $ { c } < / s m a l l >
2022-12-17 22:08:36 +01:00
< / d i v >
< hr / >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< button type = "submit" class = "save-form btn btn-primary" > $ { a } < / b u t t o n >
2022-12-17 22:08:36 +01:00
< / d i v >
< / f o r m >
< / d i v >
2023-01-07 22:34:35 +01:00
< div class = "tab-pane ${" passwordreset "===e.tab?" active ":" "}" id = "passwordreset-tabpanel" role = "tabpanel" aria - labelledby = "passwordreset-tab" >
2023-02-17 12:24:37 +01:00
$ { "passwordreset" === e . tab ? Gu ` <converse-change-password-form></converse-change-password-form> ` : "" }
2023-01-07 22:34:35 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { nd . pluggable . plugins [ "converse-omemo" ] ? . enabled ( nd ) ? ( e => Gu `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane ${" omemo "===e.tab?" active ":" "}" id = "omemo-tabpanel" role = "tabpanel" aria - labelledby = "omemo-tab" >
2023-02-17 12:24:37 +01:00
$ { "omemo" === e . tab ? Gu ` <converse-omemo-profile></converse-omemo-profile> ` : "" }
2022-12-17 22:08:36 +01:00
< / d i v > ` ) ( e ) : " " }
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ; v a r s C = n ( 4 9 2 3 ) , i C = n . n ( s C ) ; c o n s t { S t r o p h e : r C , $ i q : o C , s i z z l e : a C , u : c C } = O h . e n v ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a n g e - p a s s w o r d - f o r m " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { p a s s w o r d s _ m i s m a t c h e d : { t y p e : B o o l e a n } , a l e r t _ m e s s a g e : { t y p e : S t r i n g } } } i n i t i a l i z e ( ) { t h i s . p a s s w o r d s _ m i s m a t c h e d = ! 1 , t h i s . a l e r t _ m e s s a g e = " " } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = G y ( " S u b m i t " ) , n = G y ( " T h e n e w p a s s w o r d s m u s t m a t c h " ) , s = G y ( " N e w p a s s w o r d " ) , i = G y ( " C o n f i r m n e w p a s s w o r d " ) ; r e t u r n G u ` < f o r m c l a s s = " c o n v e r s e - f o r m p a s s w o r d r e s e t - f o r m " m e t h o d = " P O S T " @ s u b m i t = $ { t = > e . o n S u b m i t ( t ) } >
$ { e . alert _message ? Gu ` <div class="alert alert-danger" role="alert"> ${ e . alert _message } </div> ` : "" }
2023-01-07 22:34:35 +01:00
< div class = "form-group" >
< label for = "converse_password_reset_new" > $ { s } < / l a b e l >
< input
class = "form-control ${e.passwords_mismatched?" error ":" "}"
type = "password"
value = ""
name = "password"
required = "required"
id = "converse_password_reset_new"
autocomplete = "new-password"
minlength = "8"
? disabled = "${e.alert_message}"
/ >
< / d i v >
< div class = "form-group" >
< label for = "converse_password_reset_check" > $ { i } < / l a b e l >
< input
class = "form-control ${e.passwords_mismatched?" error ":" "}"
type = "password"
value = ""
name = "password_check"
required = "required"
id = "converse_password_reset_check"
autocomplete = "new-password"
minlength = "8"
? disabled = "${e.alert_message}"
@ input = $ { t => e . checkPasswordsMatch ( t ) }
/ >
2023-02-17 12:24:37 +01:00
$ { e . passwords _mismatched ? Gu ` <span class="error"> ${ n } </span> ` : "" }
2023-01-07 22:34:35 +01:00
< / d i v >
< input class = "save-form btn btn-primary"
type = "submit"
value = $ { t }
? disabled = "${e.alert_message}" / >
2023-02-17 12:24:37 +01:00
< /form>`})(this)}checkPasswordsMatch(e){const t=new FormData(e.target.form??e.target),n=t.get("password"),s=t.get("password_check");return this.passwords_mismatched=n&&n!==s,this.passwords_mismatched}async onSubmit(e){if(e.preventDefault(),this.checkPasswordsMatch(e))return;const t=oC({type:"get",to:nd.domain}).c("query",{xmlns:rC.NS.REGISTER}),n=await Ih.sendIQ(t);if(null===n)return void(this.alert_message=Gy("Timeout error"));if(aC(`error service-unavailable[xmlns="${rC.NS.STANZAS}"]`,n).length)return void(this.alert_message=Gy("Your server does not support in-band password reset"));if(cC.isErrorStanza(n))return this.alert_message=Gy("Your server responded with an unknown error, check the console for details"),Il.error("Could not set password"),void Il.error(n);const s=n.querySelector("username").textContent,i=new FormData(e.target).get("password"),r=oC({type:"set",to:nd.domain}).c("query",{xmlns:rC.NS.REGISTER}).c("username",{},s).c("password",{},i),o=await Ih.sendIQ(r);null===o?this.alert_message=Gy("Timeout error while trying to set your password"):aC(`error not-allowed[xmlns="${rC.NS.STANZAS}"]`,o).length?this.alert_message=Gy("Your server does not allow in-band password reset"):aC(`error forbidden[xmlns="${rC.NS.STANZAS}"]`,o).length||cC.isErrorStanza(o)?this.alert_message=Gy("You are not allowed to change your password"):Ih.alert("info",Gy("Success"),[Gy("Your new password has been set")])}});const lC=new(iC())({targetSize:.1,quality:.75,maxWidth:256,maxHeight:256});Ih.elements.define("converse-profile-modal",class extends $_{constructor(e){super(e),this.tab="profile"}initialize(){super.initialize(),this.listenTo(this.model,"change",this.render),Ih.trigger("profileModalInitialized",this.model)}renderModal(){return nC(this)}getModalTitle(){return Gy("Your Profile")}async setVCard(e){try{await Ih.vcard.set(nd.bare_jid,e)}catch(e){return Il.fatal(e),void this.alert([Gy("Sorry, an error happened while trying to save your profile data."),Gy("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")};if(s.size){const e=[s];lC.compress(e).then((e=>{const{photo:n}=e[0];t.onloadend=()=>{Object.assign(i,{image:btoa(t.result),image_type:s.type}),this.setVCard(i)},t.readAsBinaryString(n.data)}))}else Object.assign(i,{image:this.model.vcard.get("image"),image_type:this.model.vcard.get("image_type")}),this.setVCard(i)}});const dC=e=>{const t=Gy("%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 ">'),n=Gy(" % 1 $s Translate % 2 $s it into your own language ",'<a target=" _blank " rel=" nofollow " href=" https : //hosted.weblate.org/projects/conversejs/#languages">',"</a>"),s=Ih.settings.get("show_client_info"),i=Ih.settings.get("allow_adhoc_commands");return Gu`
$ { s && i ? ( e => { const t = Gy ( "About" ) , n = Gy ( "Commands" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" about "===e.tab?" active ":" "}"
id = "about-tab"
href = "#about-tabpanel"
aria - controls = "about-tabpanel"
role = "tab"
data - toggle = "tab"
data - name = "about"
@ click = $ { t => e . switchTab ( t ) } > $ { t } < / a >
< / l i >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link ${" commands "===e.tab?" active ":" "}"
id = "commands-tab"
href = "#commands-tabpanel"
aria - controls = "commands-tabpanel"
role = "tab"
data - toggle = "tab"
data - name = "commands"
@ click = $ { t => e . switchTab ( t ) } > $ { n } < / a >
< / l i >
< / u l >
` })(e):""}
< div class = "tab-content" >
2023-02-17 12:24:37 +01:00
$ { s ? Gu `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane tab-pane--columns ${" about "===e.tab?" active ":" "}"
id = "about-tabpanel" role = "tabpanel" aria - labelledby = "about-tab" >
< span class = "modal-alert" > < / s p a n >
< br / >
< div class = "container" >
< h6 class = "brand-heading" > Converse < / h 6 >
2023-02-17 12:24:37 +01:00
< p class = "brand-subtitle" > $ { nd . VERSION _NAME } < / p >
< p class = "brand-subtitle" > $ { $x ( zo ( ) . sanitize ( t ) ) } < / p >
< p class = "brand-subtitle" > $ { $x ( zo ( ) . sanitize ( n ) ) } < / p >
2022-12-17 22:08:36 +01:00
< / d i v >
< / d i v > ` : " " }
2023-02-17 12:24:37 +01:00
$ { i ? Gu `
2022-12-17 22:08:36 +01:00
< div class = "tab-pane tab-pane--columns ${" commands "===e.tab?" active ":" "}"
id = "commands-tabpanel"
role = "tabpanel"
aria - labelledby = "commands-tab" >
< converse - adhoc - commands / >
< / d i v > ` : " " }
< / d i v >
2023-02-17 12:24:37 +01:00
` };Ih.elements.define("converse-user-settings-modal",class extends $ _{constructor(e){super(e);const t=Ih.settings.get("show_client_info"),n=Ih.settings.get("allow_adhoc_commands");t&&n||t?this.tab="about":n&&(this.tab="commands")}renderModal(){return dC(this)}getModalTitle(){return Gy("Settings")}});const{Strophe:uC, $ iq:hC,sizzle:mC,u:gC}=Oh.env;async function fC(e){e?.preventDefault();await Ih.confirm(Gy("Are you sure you want to log out?"))&&Ih.user.logout()}function pC(){const e=Gy("Log out");return Gu ` < a class = "controlbox-heading__btn logout align-self-center" title = "${e}" @ click = $ { fC } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-sign-out-alt" size = "1em" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
< / a > ` } c o n s t v C = e = > { c o n s t t = e . m o d e l . g e t ( " s t a t u s " ) | | " o f f l i n e " , n = e . m o d e l . v c a r d ? . g e t ( " f u l l n a m e " ) | | e . m o d e l . v c a r d ? . g e t ( " n i c k n a m e " ) | | n d . b a r e _ j i d , s = e . m o d e l . g e t ( " s t a t u s _ m e s s a g e " ) | | G y ( " I a m % 1 $ s " , " c h a t " = = = ( i = t ) ? G y ( " o n l i n e " ) : " d n d " = = = i ? G y ( " b u s y " ) : " x a " = = = i ? G y ( " a w a y f o r l o n g " ) : " a w a y " = = = i ? G y ( " a w a y " ) : " o f f l i n e " = = = i ? G y ( " o f f l i n e " ) : G y ( i ) | | G y ( " o n l i n e " ) ) ; v a r i ; c o n s t r = G y ( " C l i c k t o c h a n g e y o u r c h a t s t a t u s " ) , o = I h . s e t t i n g s . g e t ( " s h o w _ c l i e n t _ i n f o " ) | | I h . s e t t i n g s . g e t ( " a l l o w _ a d h o c _ c o m m a n d s " ) ; l e t a , c ; r e t u r n [ a , c ] = " o n l i n e " = = = t ? [ " f a f a - c i r c l e c h a t - s t a t u s " , " c h a t - s t a t u s - o n l i n e " ] : " d n d " = = = t ? [ " f a f a - m i n u s - c i r c l e c h a t - s t a t u s " , " c h a t - s t a t u s - b u s y " ] : " a w a y " = = = t ? [ " f a f a - c i r c l e c h a t - s t a t u s " , " c h a t - s t a t u s - a w a y " ] : [ " f a f a - c i r c l e c h a t - s t a t u s " , " s u b d u e d - c o l o r " ] , G u `
2022-12-17 22:08:36 +01:00
< div class = "userinfo controlbox-padded" >
< div class = "controlbox-section profile d-flex" >
< a class = "show-profile" href = "#" @ click = $ { e . showProfileModal } >
< converse - avatar class = "avatar align-self-center"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-12-17 22:08:36 +01:00
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a >
2023-01-07 22:34:35 +01:00
< span class = "username w-100 align-self-center" > $ { n } < / s p a n >
2023-02-17 12:24:37 +01:00
$ { o ? function ( e ) { const t = Gy ( "Show details about this chat client" ) ; return Gu ` <a class="controlbox-heading__btn show-client-info align-self-center" title=" ${ t } " @click= ${ e . showUserSettingsModal } >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-cog" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` } ( e ) : " " }
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "allow_logout" ) ? pC ( ) : "" }
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "d-flex xmpp-status" >
2023-01-07 22:34:35 +01:00
< a class = "change-status" title = "${r}" data - toggle = "modal" data - target = "#changeStatusModal" @ click = $ { e . showStatusChangeModal } >
< span class = "${t} w-100 align-self-center" data - value = "${t}" >
< converse - icon color = "var(--${c})" style = "margin-top: -0.1em" size = "0.82em" class = "${a}" > < / c o n v e r s e - i c o n > $ { s } < / s p a n >
2022-12-17 22:08:36 +01:00
< / a >
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - u s e r - p r o f i l e " , c l a s s e x t e n d s V y { i n i t i a l i z e ( ) { t h i s . m o d e l = n d . x m p p s t a t u s , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { r e t u r n v C ( t h i s ) } s h o w P r o f i l e M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) , I h . m o d a l . s h o w ( " c o n v e r s e - p r o f i l e - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) } s h o w S t a t u s C h a n g e M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) , I h . m o d a l . s h o w ( " c o n v e r s e - c h a t - s t a t u s - m o d a l " , { m o d e l : t h i s . m o d e l } , e ) } s h o w U s e r S e t t i n g s M o d a l ( e ) { e ? . p r e v e n t D e f a u l t ( ) , I h . m o d a l . s h o w ( " c o n v e r s e - u s e r - s e t t i n g s - m o d a l " , { m o d e l : t h i s . m o d e l , _ c o n v e r s e : n d } , e ) } } ) , O h . p l u g i n s . a d d ( " c o n v e r s e - p r o f i l e " , { d e p e n d e n c i e s : [ " c o n v e r s e - s t a t u s " , " c o n v e r s e - m o d a l " , " c o n v e r s e - v c a r d " , " c o n v e r s e - c h a t b o x v i e w s " , " c o n v e r s e - a d h o c - v i e w s " ] , i n i t i a l i z e ( ) { I h . s e t t i n g s . e x t e n d ( { s h o w _ c l i e n t _ i n f o : ! 0 } ) } } ) ; c o n s t y C = f u n c t i o n ( ) { v a r e = a r g u m e n t s . l e n g t h ; i f ( ! e ) r e t u r n [ ] ; f o r ( v a r t = A r r a y ( e - 1 ) , n = a r g u m e n t s [ 0 ] , s = e ; s - - ; ) t [ s - 1 ] = a r g u m e n t s [ s ] ; r e t u r n N s ( X ( n ) ? E s ( n ) : [ n ] , S o ( t , 1 ) ) } , _ C = - 1 , b C = 1 2 8 , w C = { n a m e : " A E S - G C M " , l e n g t h : 1 2 8 } , S C = { a a c : " a u d i o / a a c " , a b w : " a p p l i c a t i o n / x - a b i w o r d " , a r c : " a p p l i c a t i o n / x - f r e e a r c " , a v i : " v i d e o / x - m s v i d e o " , a z w : " a p p l i c a t i o n / v n d . a m a z o n . e b o o k " , b i n : " a p p l i c a t i o n / o c t e t - s t r e a m " , b m p : " i m a g e / b m p " , b z : " a p p l i c a t i o n / x - b z i p " , b z 2 : " a p p l i c a t i o n / x - b z i p 2 " , c d a : " a p p l i c a t i o n / x - c d f " , c s h : " a p p l i c a t i o n / x - c s h " , c s s : " t e x t / c s s " , c s v : " t e x t / c s v " , d o c : " a p p l i c a t i o n / m s w o r d " , d o c x : " a p p l i c a t i o n / v n d . o p e n x m l f o r m a t s - o f f i c e d o c u m e n t . w o r d p r o c e s s i n g m l . d o c u m e n t " , e o t : " a p p l i c a t i o n / v n d . m s - f o n t o b j e c t " , e p u b : " a p p l i c a t i o n / e p u b + z i p " , g i f : " i m a g e / g i f " , g z : " a p p l i c a t i o n / g z i p " , h t m : " t e x t / h t m l " , h t m l : " t e x t / h t m l " , i c o : " i m a g e / v n d . m i c r o s o f t . i c o n " , i c s : " t e x t / c a l e n d a r " , j a r : " a p p l i c a t i o n / j a v a - a r c h i v e " , j p e g : " i m a g e / j p e g " , j p g : " i m a g e / j p e g " , j s : " t e x t / j a v a s c r i p t " , j s o n : " a p p l i c a t i o n / j s o n " , j s o n l d : " a p p l i c a t i o n / l d + j s o n " , m 4 a : " a u d i o / m p 4 " , m i d : " a u d i o / m i d i " , m i d i : " a u d i o / m i d i " , m j s : " t e x t / j a v a s c r i p t " , m p 3 : " a u d i o / m p e g " , m p 4 : " v i d e o / m p 4 " , m p e g : " v i d e o / m p e g " , m p k g : " a p p l i c a t i o n / v n d . a p p l e . i n s t a l l e r + x m l " , o d p : " a p p l i c a t i o n / v n d . o a s i s . o p e n d o c u m e n t . p r e s e n t a t i o n " , o d s : " a p p l i c a t i o n / v n d . o a s i s . o p e n d o c u m e n t . s p r e a d s h e e t " , o d t : " a p p l i c a t i o n / v n d . o a s i s . o p e n d o c u m e n t . t e x t " , o g a : " a u d i o / o g g " , o g v : " v i d e o / o g g " , o g x : " a p p l i c a t i o n / o g g " , o p u s : " a u d i o / o p u s " , o t f : " f o n t / o t f " , p n g : " i m a g e / p n g " , p d f : " a p p l i c a t i o n / p d f " , p h p : " a p p l i c a t i o n / x - h t t p d - p h p " , p p t : " a p p l i c a t i o n / v n d . m s - p o w e r p o i n t " , p p t x : " a p p l i c a t i o n / v n d . o p e n x m l f o r m a t s - o f f i c e d o c u m e n t . p r e s e n t a t i o n m l . p r e s e n t a t i o n " , r a r : " a p p l i c a t i o n / v n d . r a r " , r t f : " a p p l i c a t i o n / r t f " , s h : " a p p l i c a t i o n / x - s h " , s v g : " i m a g e / s v g + x m l " , s w f : " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h " , t a r : " a p p l i c a t i o n / x - t a r " , t i f : " i m a g e / t i f f " , t i f f : " i m a g e / t i f f " , t s : " v i d e o / m p 2 t " , t t f : " f o n t / t t f " , t x t : " t e x t / p l a i n " , v s d : " a p p l i c a t i o n / v n d . v i s i o " , w a v : " a u d i o / w a v " , w e b a : " a u d i o / w e b m " , w e b m : " v i d e o / w e b m " , w e b p : " i m a g e / w e b p " , w o f f : " f o n t / w o f f " , w o f f 2 : " f o n t / w o f f 2 " , x h t m l : " a p p l i c a t i o n / x h t m l + x m l " , x l s : " a p p l i c a t i o n / v n d . m s - e x c e l " , x l s x : " a p p l i c a t i o n / v n d . o p e n x m l f o r m a t s - o f f i c e d o c u m e n t . s p r e a d s h e e t m l . s h e e t " , x m l : " t e x t / x m l " , x u l : " a p p l i c a t i o n / v n d . m o z i l l a . x u l + x m l " , z i p : " a p p l i c a t i o n / z i p " , " 3 g p " : " v i d e o / 3 g p p " , " 3 g 2 " : " v i d e o / 3 g p p 2 " , " 7 z " : " a p p l i c a t i o n / x - 7 z - c o m p r e s s e d " } , { S t r o p h e : x C , U R I : E C , s i z z l e : A C , u : C C } = O h . e n v ; f u n c t i o n $ C ( e ) { e = e . r e p l a c e ( / ^ 0 5 / , " " ) ; f o r ( l e t t = 1 ; t < 8 ; t + + ) { c o n s t n = 8 * t + t - 1 ; e = e . s l i c e ( 0 , n ) + " " + e . s l i c e ( n ) } r e t u r n e } f u n c t i o n k C ( e , t ) { r e t u r n e . g e t ( " o m e m o _ a c t i v e " ) & & t . b o d y & & ( t . i s _ e n c r y p t e d = ! 0 , t . p l a i n t e x t = t . b o d y , t . b o d y = G y ( " T h i s i s a n O M E M O e n c r y p t e d m e s s a g e w h i c h y o u r c l i e n t d o e s n ’ t s e e m t o s u p p o r t . F i n d m o r e i n f o r m a t i o n o n h t t p s : / / c o n v e r s a t i o n s . i m / o m e m o " ) ) , t } a s y n c f u n c t i o n j C ( e ) { c o n s t t = " l o c a l h o s t " = = = w i n d o w . l o c a t i o n . h o s t n a m e & & " l o c a l h o s t " = = = e . d o m a i n ( ) ? " h t t p " : " h t t p s " , n = e . t o S t r i n g ( ) . r e p l a c e ( / ^ a e s g c m / , t ) , s = a w a i t a s y n c f u n c t i o n ( e ) { l e t t ; t r y { t = a w a i t f e t c h ( e ) } c a t c h ( t ) { r e t u r n I l . e r r o r ( ` $ { t . n a m e } : F a i l e d t o d o w n l o a d e n c r y p t e d m e d i a : $ { e } ` ) , I l . e r r o r ( t ) , n u l l } i f ( t . s t a t u s > = 2 0 0 & & t . s t a t u s < 4 0 0 ) r e t u r n t . a r r a y B u f f e r ( ) } ( n ) ; i f ( n u l l = = = s ) r e t u r n I l . e r r o r ( ` C o u l d n o t d e c r y p t a r e c e i v e d e n c r y p t e d f i l e $ { e . t o S t r i n g ( ) } s i n c e i t c o u l d n o t b e d o w n l o a d e d ` ) , n e w E r r o r ( G y ( " E r r o r : c o u l d n o t d e c r y p t a r e c e i v e d e n c r y p t e d f i l e , b e c a u s e i t c o u l d n o t b e d o w n l o a d e d " ) ) ; c o n s t i = e . h a s h ( ) . s l i c e ( 1 ) , r = i . s u b s t r i n g ( i . l e n g t h - 6
< button class = "toggle-omemo" title = "${i}" data - disabled = $ { ! n . get ( "omemo_supported" ) } @ click = $ { VC } >
2022-01-03 11:54:10 +01:00
< converse - icon
class = "fa ${n.get(" omemo _active ")?" fa - lock ":" fa - unlock "}"
2023-02-17 12:24:37 +01:00
path - prefix = "${Ih.settings.get(" assets _path ")}"
2022-01-03 11:54:10 +01:00
size = "1em"
2022-12-17 22:08:36 +01:00
color = "${r}"
2022-01-03 11:54:10 +01:00
> < / c o n v e r s e - i c o n >
< / b u t t o n >
2023-02-17 12:24:37 +01:00
` ),t}async function ZC(e,t){let{stanza:n}=t;const{message:s}=t;if(!s.get("is_encrypted"))return t;if(!s.get("body"))throw new Error("No message body to encrypt!");const i=await async function(e){const t=Gy("Sorry, no devices found to which we can send an OMEMO encrypted message.");let n;if(e.get("type")===nd.CHATROOMS_TYPE){const t=await Promise.all(e.occupants.map((e=>UC(e.get("jid")))));n=t.reduce(((e,t)=>yC(e,t.models)),[])}else if(e.get("type")===nd.PRIVATE_CHAT_TYPE){const s=await UC(e.get("jid"));if(0===s.length){const e=new Error(t);throw e.user_facing=!0,e}const i=(await Ih.omemo.devicelists.get(nd.bare_jid)).devices;n=[...i.models,...s.models]}const s=nd.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=>BC(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}(e);n.c("encrypted",{xmlns:xC.NS.OMEMO}).c("header",{sid:nd.omemo_store.get("device_id")});const{key_and_tag:r,iv:o,payload:a}=await QC.encryptMessage(s.get("plaintext")),c=await Promise.all(i.filter((e=>e.get("trusted")!=_C&&e.get("active"))).map((e=>function(e,t){return RC(t.get("jid"),t.get("id")).encrypt(e).then((e=>({payload:e,device:t})))}(r,e))));return n=await 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)}(n,c,o),n.c("payload").t(a).up().up(),n.c("store",{xmlns:xC.NS.HINTS}).up(),n.c("encryption",{xmlns:xC.NS.EME,namespace:xC.NS.OMEMO}),{message:s,stanza:n}}const QC={decryptMessage:async function(e){const t=await crypto.subtle.importKey("raw",e.key,wC,!0,["encrypt","decrypt"]),n=Bf(Vf(e.payload),e.tag),s={name:"AES-GCM",iv:Vf(e.iv),tagLength:bC};return Hf(await crypto.subtle.decrypt(s,t,n))},encryptMessage:async function(e){const t=crypto.getRandomValues(new window.Uint8Array(12)),n=await crypto.subtle.generateKey(wC,!0,["encrypt","decrypt"]),s={name:"AES-GCM",iv:t,tagLength:bC},i=await crypto.subtle.encrypt(s,n,Gf(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:Bf(c,a),payload:Wf(o),iv:Wf(t)}},formatFingerprint: $ C},YC=e=>{const t=Gy("OMEMO Fingerprints"),n=Gy("No OMEMO-enabled devices found"),s=e.devicelist.devices;return Gu `
2022-01-03 11:54:10 +01:00
< hr / >
< ul class = "list-group fingerprints" >
< li class = "list-group-item active" > $ { t } < / l i >
2023-02-17 12:24:37 +01:00
$ { s . length ? s . map ( ( t => ( ( e , t ) => { const n = Gy ( "Trusted" ) , s = Gy ( "Untrusted" ) ; return t . get ( "bundle" ) && t . get ( "bundle" ) . fingerprint ? Gu `
2022-01-03 11:54:10 +01:00
< li class = "list-group-item" >
< form class = "fingerprint-trust" >
< div class = "btn-group btn-group-toggle" >
< label class = "btn btn--small ${1===t.get(" trusted ")?" btn - primary active ":" btn - secondary "}"
@ click = $ { e . toggleDeviceTrust } >
< input type = "radio" name = "${t.get(" id ")}" value = "1"
? checked = $ { - 1 !== t . get ( "trusted" ) } > $ { n }
< / l a b e l >
< label class = "btn btn--small ${-1===t.get(" trusted ")?" btn - primary active ":" btn - secondary "}"
@ click = $ { e . toggleDeviceTrust } >
< input type = "radio" name = "${t.get(" id ")}" value = "-1"
2022-05-05 23:06:17 +02:00
? checked = $ { - 1 === t . get ( "trusted" ) } > $ { s }
2022-01-03 11:54:10 +01:00
< / l a b e l >
< / d i v >
2023-02-17 12:24:37 +01:00
< code class = "fingerprint" > $ { $C ( t . get ( "bundle" ) . fingerprint ) } < / c o d e >
2022-01-03 11:54:10 +01:00
< / f o r m >
< / l i >
2023-02-17 12:24:37 +01:00
` :""})(e,t))):Gu ` < li class = "list-group-item" > $ { n } < / l i > ` }
2022-01-03 11:54:10 +01:00
< / u l >
2023-02-17 12:24:37 +01:00
` };Ih.elements.define("converse-omemo-fingerprints",class extends Vy{static get properties(){return{jid:{type:String}}}async initialize(){this.devicelist=await Ih.omemo.devicelists.get(this.jid,!0),this.listenTo(this.devicelist.devices,"change:bundle",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"change:trusted",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"remove",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"add",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"reset",(()=>this.requestUpdate())),this.requestUpdate()}render(){return this.devicelist?YC(this):""}toggleDeviceTrust(e){const t=e.target;this.devicelist.devices.get(t.getAttribute("name")).save("trusted",parseInt(t.value,10))}});const KC=e=>Gu `
$ { e . device . get ( "bundle" ) && e . device . get ( "bundle" ) . fingerprint ? ( e => { const t = Gy ( "Checkbox for selecting the following fingerprint" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< li class = "fingerprint-removal-item list-group-item" >
2022-01-03 11:54:10 +01:00
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${t}" / >
2023-02-17 12:24:37 +01:00
< span class = "fingerprint" > $ { $C ( e . device . get ( "bundle" ) . fingerprint ) } < / s p a n >
2022-01-03 11:54:10 +01:00
< / l a b e l >
< / l i >
2023-02-17 12:24:37 +01:00
` })(e):(e=>{const t=Gy("Device without a fingerprint"),n=Gy("Checkbox for selecting the following device");return Gu `
2022-12-17 22:08:36 +01:00
< li class = "fingerprint-removal-item list-group-item" >
2022-01-03 11:54:10 +01:00
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${n}" / >
< span > $ { t } < / s p a n >
< / l a b e l >
< / l i >
` })(e)}
2023-02-17 12:24:37 +01:00
` ,XC=e=>{const t=Gy("This device's OMEMO fingerprint"),n=Gy("Generate new keys and fingerprint");return Gu `
2022-05-05 23:06:17 +02:00
< form class = "converse-form fingerprint-removal" @ submit = $ { e . removeSelectedFingerprints } >
< ul class = "list-group fingerprints" >
2023-01-07 22:34:35 +01:00
< li class = "list-group-item active" > $ { t } < / l i >
2022-05-05 23:06:17 +02:00
< li class = "list-group-item" >
2023-02-17 12:24:37 +01:00
$ { e . current _device && e . current _device . get ( "bundle" ) && e . current _device . get ( "bundle" ) . fingerprint ? ( e => Gu `
< span class = "fingerprint" > $ { $C ( e . current _device . get ( "bundle" ) . fingerprint ) } < / s p a n > ` ) ( e ) : J _ ( ) }
2022-05-05 23:06:17 +02:00
< / l i >
< / u l >
< div class = "form-group" >
2023-01-07 22:34:35 +01:00
< button type = "button" class = "generate-bundle btn btn-danger" @ click = $ { e . generateOMEMODeviceBundle } > $ { n } < / b u t t o n >
2022-05-05 23:06:17 +02:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { e . other _devices ? . length ? ( e => { const t = Gy ( "Other OMEMO-enabled devices" ) , n = Gy ( "Checkbox to select fingerprints of all other OMEMO devices" ) , s = Gy ( "Remove checked devices and close" ) , i = Gy ( "Select all" ) ; return Gu `
2022-05-05 23:06:17 +02:00
< ul class = "list-group fingerprints" >
2022-12-17 22:08:36 +01:00
< li class = "list-group-item active" >
2022-05-05 23:06:17 +02:00
< label >
2023-01-07 22:34:35 +01:00
< input type = "checkbox" class = "select-all" @ change = $ { e . selectAll } title = "${i}" aria - label = "${n}" / >
$ { t }
2022-05-05 23:06:17 +02:00
< / l a b e l >
< / l i >
2023-02-17 12:24:37 +01:00
$ { e . other _devices ? . map ( ( t => KC ( Object . assign ( { device : t } , e ) ) ) ) }
2022-01-03 11:54:10 +01:00
< / u l >
2023-01-07 22:34:35 +01:00
< div class = "form-group" > < button type = "submit" class = "save-form btn btn-primary" > $ { s } < / b u t t o n > < / d i v >
2022-01-03 11:54:10 +01:00
` })(e):""}
2023-02-17 12:24:37 +01:00
< / f o r m > ` } , { S t r o p h e : e $ , s i z z l e : t $ , u : n $ } = O h . e n v ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - o m e m o - p r o f i l e " , c l a s s e x t e n d s V y { a s y n c i n i t i a l i z e ( ) { t h i s . d e v i c e l i s t = a w a i t I h . o m e m o . d e v i c e l i s t s . g e t ( n d . b a r e _ j i d , ! 0 ) , a w a i t t h i s . s e t A t t r i b u t e s ( ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " c h a n g e : b u n d l e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " r e s e t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " r e s e t " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . d e v i c e l i s t . d e v i c e s , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } a s y n c s e t A t t r i b u t e s ( ) { t h i s . d e v i c e _ i d = a w a i t I h . o m e m o . g e t D e v i c e I D ( ) , t h i s . c u r r e n t _ d e v i c e = t h i s . d e v i c e l i s t . d e v i c e s . g e t ( t h i s . d e v i c e _ i d ) , t h i s . o t h e r _ d e v i c e s = t h i s . d e v i c e l i s t . d e v i c e s . f i l t e r ( ( e = > e . g e t ( " i d " ) ! = = t h i s . d e v i c e _ i d ) ) } r e n d e r ( ) { r e t u r n t h i s . d e v i c e l i s t ? X C ( t h i s ) : J _ ( ) } s e l e c t A l l ( e ) { l e t t = n $ . a n c e s t o r ( e . t a r g e t , " l i " ) ; f o r ( ; t ; ) t . q u e r y S e l e c t o r ( ' i n p u t [ t y p e = " c h e c k b o x " ] ' ) . c h e c k e d = e . t a r g e t . c h e c k e d , t = t . n e x t E l e m e n t S i b l i n g } a s y n c r e m o v e S e l e c t e d F i n g e r p r i n t s ( e ) { e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) , e . t a r g e t . q u e r y S e l e c t o r ( " . s e l e c t - a l l " ) . c h e c k e d = ! 1 ; c o n s t t = t $ ( ' . f i n g e r p r i n t - r e m o v a l - i t e m i n p u t [ t y p e = " c h e c k b o x " ] : c h e c k e d ' , e . t a r g e t ) . m a p ( ( e = > e . v a l u e ) ) ; t r y { a w a i t t h i s . d e v i c e l i s t . r e m o v e O w n D e v i c e s ( t ) } c a t c h ( e ) { I l . e r r o r ( e ) , n d . a p i . a l e r t ( e $ . L o g L e v e l . E R R O R , G y ( " E r r o r " ) , [ G y ( " S o r r y , a n e r r o r o c c u r r e d w h i l e t r y i n g t o r e m o v e t h e d e v i c e s . " ) ] ) } a w a i t t h i s . s e t A t t r i b u t e s ( ) , t h i s . r e q u e s t U p d a t e ( ) } a s y n c g e n e r a t e O M E M O D e v i c e B u n d l e ( e ) { e . p r e v e n t D e f a u l t ( ) ; a w a i t I h . c o n f i r m ( G y ( " A r e y o u s u r e y o u w a n t t o g e n e r a t e n e w O M E M O k e y s ? T h i s w i l l r e m o v e y o u r o l d k e y s a n d a l l p r e v i o u s l y e n c r y p t e d m e s s a g e s w i l l n o l o n g e r b e d e c r y p t a b l e o n t h i s d e v i c e . " ) ) & & ( a w a i t I h . o m e m o . b u n d l e . g e n e r a t e ( ) , a w a i t t h i s . s e t A t t r i b u t e s ( ) , t h i s . r e q u e s t U p d a t e ( ) ) } } ) ; c o n s t s $ = { a s y n c g e n e r a t e F i n g e r p r i n t s ( e ) { c o n s t t = a w a i t U C ( e ) ; r e t u r n P r o m i s e . a l l ( t . m a p ( ( e = > F C ( e ) ) ) ) } , g e t D e v i c e F o r C o n t a c t : ( e , t ) = > U C ( e ) . t h e n ( ( e = > e . g e t ( t ) ) ) , c o n t a c t H a s O M E M O S u p p o r t : a s y n c e = > ( a w a i t U C ( e ) ) . l e n g t h > 0 } , i $ = s $ ; c l a s s r $ e x t e n d s E r r o r { c o n s t r u c t o r ( e , t ) { s u p e r ( e , t ) , t h i s . n a m e = " I Q E r r o r " , t h i s . i q = t } } c o n s t { S t r o p h e : o $ , s i z z l e : a $ , $ i q : c $ } = O h . e n v , l $ = N o . e x t e n d ( { d e f a u l t s : { t r u s t e d : 0 , a c t i v e : ! 0 } , g e t R a n d o m P r e K e y ( ) { c o n s t e = t h i s . g e t ( " b u n d l e " ) ; r e t u r n e . p r e k e y s [ w l ( e . p r e k e y s . l e n g t h ) ] } , a s y n c f e t c h B u n d l e F r o m S e r v e r ( ) { c o n s t e = c $ ( { t y p e : " g e t " , f r o m : n d . b a r e _ j i d , t o : t h i s . g e t ( " j i d " ) } ) . c ( " p u b s u b " , { x m l n s : o $ . N S . P U B S U B } ) . c ( " i t e m s " , { n o d e : ` $ { o $ . N S . O M E M O _ B U N D L E S } : $ { t h i s . g e t ( " i d " ) } ` } ) ; l e t t ; t r y { t = a w a i t I h . s e n d I Q ( e ) } c a t c h ( t ) { r e t u r n I l . e r r o r ( ` C o u l d n o t f e t c h b u n d l e f o r d e v i c e $ { t h i s . g e t ( " i d " ) } f r o m $ { t h i s . g e t ( " j i d " ) } ` ) , I l . e r r o r ( t ) , n u l l } i f ( t . q u e r y S e l e c t o r ( " e r r o r " ) ) t h r o w n e w r $ ( " C o u l d n o t f e t c h b u n d l e " , t ) ; c o n s t n = a $ ( ` i t e m s [ n o d e = " $ { o $ . N S . O M E M O _ B U N D L E S } : $ { t h i s . g e t ( " i d " ) } " ] ` , t ) . p o p ( ) , s = P C ( a $ ( ` b u n d l e [ x m l n s = " $ { o $ . N S . O M E M O } " ] ` , n ) . p o p ( ) ) ; r e t u r n t h i s . s a v e ( " b u n d l e " , s ) , s } , g e t B u n d l e ( ) { r e t u r n t h i s . g e t ( " b u n d l e " ) ? P r o m i s e . r e s o l v e ( t h i s . g e t ( " b u n d l e " ) , t h i s ) : t h i s . f e t c h B u n d l e F r o m S e r v e r ( ) } } ) , { S t r o p h e : d $ , $ b u i l d : u $ , $ i q : h $ , s i z z l e : m $ } = O h . e n v , g $ = N o . e x t e n d ( { i d A t t r i b u t e : " j i d " , a s y n c i n i t i a l i z e ( ) { t h i s . i n i t i a l i z e d = e a ( ) , a w a i t t h i s . i n i t D e v i c e s ( ) , t h i s . i n i t i a l i z e d . r e s o l v e ( ) } , i n i t D e v i c e s ( ) { t h i s . d e v i c e s = n e w n d . D e v i c e s ; c o n s t e = ` c o n v e r s e . d e v i c e l i s t - $ { n d . b a r e _ j i d } - $ { t h i s . g e t ( " j i d " ) } ` ; r e t u r n X c ( t h i s . d e v i c e s , e ) , t h i s . f e t c h D e v i c e s ( ) } , a s y n c o n D e v i c e s F o u n d ( e ) { i f ( 0 = = = e . l e n g t h ) { l e t e = [ ] ; t r y { e = a w a i t t h i s . f e t c h D e v i c e s F r o m S e r v e r ( ) } c a t c h ( e ) { n u l l = = = e ? I l . e r r o r ( ` T i m e o u t e r r o r w h i l e f e t c h i n g d e v i c e s f o r $ { t h i s . g e t ( " j i d " ) } ` ) : ( I l . e r r o r ( ` C o u l d n o t f e t c h d e v i c e s f o r $ { t h i s . g e t ( " j i d " ) } ` ) , I l . e r r o r ( e ) ) , t h i s . d e s t r o y ( ) } t h i s . g e t ( " j i d " ) = = = n d . b a r e _ j i d & & t h i s . p u b l i s h C u r r e n t D e v i c e ( e ) } } , f e t c h D e v i c e s ( ) { r e t u r n v o i d 0 = = = t h i s . _ d e v i c e s _ p r o m i s e & & ( t h i s . _ d e v i c e s _ p r o m i s e = n e w P r o m i s e ( ( e = > { t h i s . d e v i c e s . f e t c h ( { s u c c e s s : t = > e ( t h i s . o n D e v i c e s F o u n d ( t ) ) , e r r o r : ( t , n ) = > { I l . e r r o r ( n ) , e ( ) } } ) } ) ) ) , t h i s . _ d e v i c e s _ p r o m i s e } , a s y n c g e t O w n D e v i c e I d ( ) { l e t e = n d . o m e m o _ s t o r e . g e t ( " d e v i c e _ i d " ) ; r e t u r n t h i s . d e v i c e s . g e t ( e ) | | ( a w a i t n d . o m e m o _ s t o r e . g e n e r a t e B u n d l e ( ) , e = n d . o m e m o _ s t o r e . g e t ( " d e v i c e _ i d " ) ) , e } , a s y n c p u b l i s h C u r r e n t D e v i c e ( e ) { i f ( t h i s . g e t ( " j i d " ) = = = n d . b a r e _ j i d ) { i f ( a w a i t H C ( ) , n d . o m e m o _ s t o r e ) r e t u r n e . i n c l u d e
< div class = "switch-form" >
< p > $ { e } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { t } < / a > < / p >
< / d i v > ` } , R $ = e = > { c o n s t t = I h . s e t t i n g s . g e t ( " r e g i s t r a t i o n _ d o m a i n " ) , n = G y ( " C r e a t e y o u r a c c o u n t " ) , s = G y ( " P l e a s e e n t e r t h e X M P P p r o v i d e r t o r e g i s t e r w i t h : " ) , i = ! t & & e . s t a t u s = = = D $ ; r e t u r n G u `
< form id = "converse-register" class = "converse-form" @ submit = $ { t => e . onFormSubmission ( t ) } >
< legend class = "col-form-label" > $ { n } < / l e g e n d >
2021-11-11 22:06:49 +01:00
< div class = "form-group" >
2023-02-17 12:24:37 +01:00
< label > $ { s } < / l a b e l >
$ { t || ( ( ) => { const e = Ih . settings . get ( "domain_placeholder" ) , t = Gy ( "Tip: A list of public XMPP providers is available" ) , n = Gy ( "here" ) , s = Ih . settings . get ( "providers_link" ) ; return Gu `
2021-11-11 22:06:49 +01:00
< input class = "form-control" required = "required" type = "text" name = "domain" placeholder = "${e}" / >
< p class = "form-text text-muted" >
$ { t }
2022-05-05 23:06:17 +02:00
< a href = "${s}" class = "url" target = "_blank" rel = "noopener" > $ { n } < / a > .
2021-11-11 22:06:49 +01:00
< / p >
` })()}
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { i ? ( ( ) => { const e = Gy ( "Fetch registration form" ) , t = Gy ( "Already have a chat account?" ) , n = Gy ( "Log in here" ) ; return Gu `
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
< input class = "btn btn-primary" type = "submit" value = "${e}" / >
< / f i e l d s e t >
< div class = "switch-form" >
< p > $ { t } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { n } < / a > < / p >
< / d i v >
2023-02-17 12:24:37 +01:00
` })():""}
2021-11-11 22:06:49 +01:00
< / f o r m >
2023-02-17 12:24:37 +01:00
` },D $ =0,z $ =e=>Gu `
2022-05-05 23:06:17 +02:00
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
2023-02-17 12:24:37 +01:00
$ { e . alert _message ? Gu ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert _message } </div> ` : "" }
$ { e . status === D$ ? R$ ( e ) : "" }
$ { 1 === e . status ? ( e => { const t = Ih . settings . get ( "registration_domain" ) , n = Gy ( "Cancel" ) ; return Gu `
< form id = "converse-register" class = "converse-form no-scrolling" @ submit = $ { t => e . onFormSubmission ( t ) } >
$ { J _ ( { classes : "hor_centered" } ) }
$ { t ? "" : Gu `
< button class = "btn btn-secondary button-cancel hor_centered"
@ click = $ { t => e . renderProviderChoiceForm ( t ) } > $ { n } < / b u t t o n >
2021-11-11 22:06:49 +01:00
` }
< / f o r m >
2023-02-17 12:24:37 +01:00
` })(e):""}
$ { 2 === e . status ? ( e => { const t = Gy ( "Choose a different provider" ) , n = Gy ( "Account Registration:" ) , s = Gy ( "Register" ) , i = Ih . settings . get ( "registration_domain" ) ; return Gu `
< form id = "converse-register" class = "converse-form" @ submit = $ { t => e . onFormSubmission ( t ) } >
< legend class = "col-form-label" > $ { n } $ { e . domain } < / l e g e n d >
2021-11-11 22:06:49 +01:00
< p class = "title" > $ { e . title } < / p >
< p class = "form-help instructions" > $ { e . instructions } < / p >
< div class = "form-errors hidden" > < / d i v >
$ { e . form _fields }
< fieldset class = "buttons form-group" >
2023-02-17 12:24:37 +01:00
$ { e . fields ? Gu `
< input type = "submit" class = "btn btn-primary" value = "${s}" / >
2021-11-11 22:06:49 +01:00
` :""}
2023-02-17 12:24:37 +01:00
$ { i ? "" : Gu `
2021-11-11 22:06:49 +01:00
< input
type = "button"
class = "btn btn-secondary button-cancel"
value = "${t}"
2023-02-17 12:24:37 +01:00
@ click = $ { t => e . renderProviderChoiceForm ( t ) }
2021-11-11 22:06:49 +01:00
/ >
` }
2023-02-17 12:24:37 +01:00
$ { M$ ( ) }
2021-11-11 22:06:49 +01:00
< / f i e l d s e t >
< / f o r m >
` })(e):""}
2023-02-17 12:24:37 +01:00
$ { 3 === e . status ? M$ ( ) : "" }
` ;async function L $ (e){await Ih.waitUntil("controlBoxInitialized");nd.chatboxes.get("controlbox").set({"active-form":e})}const P $ =(e,t)=> ` < field var = "${e}" > $ { t } < / f i e l d > ` , F $ = e = > ` < v a l u e > $ { e } < / v a l u e > ` ; f u n c t i o n U $ ( e ) { c o n s t t = e . g e t A t t r i b u t e ( " n a m e " ) ; i f ( ! t ) r e t u r n n u l l ; l e t n ; r e t u r n n = " c h e c k b o x " = = = e . g e t A t t r i b u t e ( " t y p e " ) ? e . c h e c k e d ? 1 : 0 : " T E X T A R E A " = = e . t a g N a m e ? e . v a l u e . s p l i t ( " \ n " ) . f i l t e r ( ( e = > e . t r i m ( ) ) ) : " S E L E C T " = = e . t a g N a m e ? k l . g e t S e l e c t V a l u e s ( e ) : e . v a l u e , k l . t o S t a n z a ( P $ ( t , A r r a y . i s A r r a y ( n ) ? n . m a p ( F $ ) : F $ ( n ) ) ) } k l . w e b F o r m 2 x F o r m = U $ ; v a r B $ = n ( 7 0 9 9 ) , q $ = { } ; q $ . s t y l e T a g T r a n s f o r m = o _ ( ) , q $ . s e t A t t r i b u t e s = n _ ( ) , q $ . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , q $ . d o m A P I = K y ( ) , q $ . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( B $ . Z , q $ ) ; B $ . Z & & B $ . Z . l o c a l s & & B $ . Z . l o c a l s ; c o n s t { S t r o p h e : H $ , s i z z l e : G $ , $ i q : W $ } = O h . e n v , V $ = O h . e n v . u t i l s , J $ = 1 , Z $ = 2 ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - r e g i s t e r - p a n e l " , c l a s s e x t e n d s V y { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { s t a t u s : { t y p e : S t r i n g } , a l e r t _ m e s s a g e : { t y p e : S t r i n g } , a l e r t _ t y p e : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . a l e r t _ t y p e = " i n f o " , t h i s . s e t E r r o r M e s s a g e = e = > t h i s . s e t M e s s a g e ( e , " d a n g e r " ) , t h i s . s e t F e e d b a c k M e s s a g e = e = > t h i s . s e t M e s s a g e ( e , " i n f o " ) } i n i t i a l i z e ( ) { t h i s . r e s e t ( ) , t h i s . l i s t e n T o ( n d , " c o n n e c t i o n I n i t i a l i z e d " , ( ( ) = > t h i s . r e g i s t e r H o o k s ( ) ) ) ; c o n s t e = I h . s e t t i n g s . g e t ( " r e g i s t r a t i o n _ d o m a i n " ) ; e ? t h i s . f e t c h R e g i s t r a t i o n F o r m ( e ) : t h i s . s t a t u s = 0 } r e n d e r ( ) { r e t u r n z $ ( t h i s ) } s e t M e s s a g e ( e , t ) { t h i s . a l e r t _ t y p e = t , t h i s . a l e r t _ m e s s a g e = e } r e g i s t e r H o o k s ( ) { c o n s t e = n d . c o n n e c t i o n , t = e . _ c o n n e c t _ c b . b i n d ( e ) ; e . _ c o n n e c t _ c b = ( e , n , s ) = > { t h i s . _ r e g i s t e r i n g ? t h i s . g e t R e g i s t r a t i o n F i e l d s ( e , n ) & & ( t h i s . _ r e g i s t e r i n g = ! 1 ) : t ( e , n , s ) } } g e t R e g i s t r a t i o n F i e l d s ( e , t ) { c o n s t n = n d . c o n n e c t i o n ; n . c o n n e c t e d = ! 0 ; c o n s t s = n . _ p r o t o . _ r e q T o D a t a ( e ) ; i f ( ! s ) r e t u r n ; i f ( n . _ p r o t o . _ c o n n e c t _ c b ( s ) = = = H $ . S t a t u s . C O N N F A I L ) r e t u r n t h i s . s t a t u s = 0 , t h i s . s e t E r r o r M e s s a g e ( G y ( " S o r r y , w e ' r e u n a b l e t o c o n n e c t t o y o u r c h o s e n p r o v i d e r . " ) ) , ! 1 ; c o n s t i = s . g e t E l e m e n t s B y T a g N a m e ( " r e g i s t e r " ) , r = s . g e t E l e m e n t s B y T a g N a m e ( " m e c h a n i s m " ) ; i f ( 0 = = = i . l e n g t h & & 0 = = = r . l e n g t h ) r e t u r n n . _ p r o t o . _ n o _ a u t h _ r e c e i v e d ( t ) , ! 1 ; i f ( 0 = = = i . l e n g t h ) r e t u r n n . _ c h a n g e C o n n e c t S t a t u s ( H $ . S t a t u s . R E G I F A I L ) , t h i s . a l e r t _ t y p e = " d a n g e r " , t h i s . s e t E r r o r M e s s a g e ( G y ( " S o r r y , t h e g i v e n p r o v i d e r d o e s n o t s u p p o r t i n b a n d a c c o u n t r e g i s t r a t i o n . P l e a s e t r y w i t h a d i f f e r e n t p r o v i d e r . " ) ) , ! 0 ; n . _ a d d S y s H a n d l e r ( ( e = > t h i s . o n R e g i s t r a t i o n F i e l d s ( e ) ) , n u l l , " i q " , n u l l , n u l l ) ; c o n s t o = W $ ( { t y p e : " g e t " } ) . c ( " q u e r y " , { x m l n s : H $ . N S . R E G I S T E R } ) . t r e e ( ) ; r e t u r n o . s e t A t t r i b u t e ( " i d " , n . g e t U n i q u e I d ( " s e n d I Q " ) ) , n . s e n d ( o ) , n . c o n n e c t e d = ! 1 , ! 0 } o n R e g i s t r a t i o n F i e l d s ( e ) { r e t u r n " e r r o r " = = = e . g e t A t t r i b u t e ( " t y p e " ) ? ( t h i s . r e p o r t E r r o r s ( e ) , I h . s e t t i n g s . g e t ( " r e g i s t r a t i o n _ d o m a i n " ) ? t h i s . s t a t u s = 3 : t h i s . s t a t u s = 0 , ! 1 ) : ( t h i s . s e t F i e l d s ( e ) , t h i s . s t a t u s = = = J $ & & t h i s . r e n d e r R e g i s t r a t i o n F o r m ( e ) , ! 1 ) } r e s e t ( e ) { O b j e c t . a s s i g n ( t h i s , { f i e l d s : { } , u r l s : [ ] , t i t l e : " " , i n s t r u c t i o n s : " " , r e g i s t e r e d : ! 1 , _ r e g i s t e r i n g : ! 1 , d o m a i n : n u l l , f o r m _ t y p e : n u l l } ) , e & & O b j e c t . a s s i g n ( t h i s , e ) } o n F o r m S u b m i s s i o n ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , n u l l = = = e . t a r g e t . q u e r y S e l e c t o r ( " i n p u t [ n a m e = d o m a i n ] " ) ? t h i s . s u b m i t R e g i s t r a t i o n F o r m ( e . t a r g e t ) : t h i s . o n P r o v i d e r C h o s e n ( e . t a r g e t ) } o n P r o v i d e r C h o s e n ( e ) { c o n s t t = e . q u e r y S e l e c t o r ( " i n p u t [ n a m e = d o m a i n ] " ) ? . v a l u e ; t & & t h i s . f e t c h R e g i s t r a t i o n F o r m ( t . t r i m ( ) ) } f e t c h R e g i s t r a t i o n F o r m ( e ) { r e t u r n t h i s . s t a t u s = J $ , t h i s . r e s e t ( { d o m a i n : H $ . g e t D o m a i n F r o m J i d ( e ) , _ r e g i s t e r i n g : ! 0 } ) , E h ( t h i s . d o m a i n ) , n d . c o n n e c t i o n ? . c o n n e c t ( t h i s . d o m a i n , " " , ( e = > t h i s . o n C o n n e c t S t a t u s C h a n g e d ( e ) ) ) , ! 1 } o n C o n n e c t S t a t u s C h a n g e d ( e ) { I l . d e b u g ( " c o n v e r s e - r e g i s t e r : o n C o n n e c t S t a t u s C h a n g e d " ) , [ H $ . S t a t u s . D I S C O N N E C T E D , H $ . S t a t u s . C O N N F A I L , H $ . S t a t u s . R E G I F A I L , H $ . S t a t u s . N O T A C C E P T A B L E , H $ . S t a t u s . C O N F L I C T ] . i n c l u d e s ( e ) ? ( I l . e r r o r ( ` P r o b l e m d u r i n g r e g i s t r a t i o n : S t r o p h e . S t a t u s i s $ { n d . C O N N E C T I O N _ S T A T U S [ e ] } ` ) , t h i s . a b o r t R e g i s t r a t i o n ( ) ) : e = = = H $ . S t a t u s . R E G I S T E R E D & & ( I l . d e b u g ( " R e g i s t e r e d s u c c e s s f u l l y . " ) , n d . c o n n e c t i o n . r e s e t ( ) , [ " c o n v e r s e / l o g i n " , " c o n v e r s e / r e g i s t e r " ] . i n c l u d e s ( n d . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) ) & & n d . r o u t e r . n a v i g a t e ( " " , { r e p l a c e : ! 0 } ) , L $ ( " l o g i n " ) , t h i s . f i e l d s . p a s s w o r d & & t h i s . f i e l d s . u s e r n a m e ? ( n d . c o n n e c t i o n . c o n n e c t ( t h i s . f i e l d s . u s e r n a m e . t o L o w e r C a s e ( ) + " @ " + t h i s . d o m a i n . t o L o w e r C a s e ( ) , t h i s . f i e l d s . p a s s w o r d , n d . o n C o n n e c t S t a t u s C h a n g e d ) , t h i s . s e t F e e d b a c k M e s s a g e ( G y ( " N o w l o g g i n g y o u i n " ) ) ) : t h i s . s e t F e e d b a c k M e s s a g e ( G y ( " R e g i s t e r e d s u c c e s s f u l l y " ) ) , t h i s . r e s e t ( ) ) } g e t L e g a c y F o
2022-12-17 22:08:36 +01:00
< form class = "converse-form add-chatroom" @ submit = $ { t => e . openChatRoom ( t ) } >
< div class = "form-group" >
< label for = "chatroom" > $ { i } : < / l a b e l >
2023-02-17 12:24:37 +01:00
$ { r ? Gu ` <label class="roomid-policy-error"> ${ r } </label> ` : "" }
2022-12-17 22:08:36 +01:00
< converse - autocomplete
2023-02-17 12:24:37 +01:00
. getAutoCompleteList = $ { ik }
2022-12-17 22:08:36 +01:00
? autofocus = $ { ! 0 }
min _chars = "3"
position = "below"
placeholder = "${s}"
class = "add-muc-autocomplete"
name = "chatroom" >
< / c o n v e r s e - a u t o c o m p l e t e >
2021-11-11 22:06:49 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
$ { o ? Gu ` <div class="form-group"> ${ $x ( zo ( ) . sanitize ( o , { ALLOWED _TAGS : [ "b" , "br" , "em" ] } ))}</div> ` : "" }
$ { Ih . settings . get ( "locked_muc_nickname" ) ? "" : ( e => { const t = Gy ( "Nickname" ) , n = Gy ( "This field is required" ) ; return Gu `
2022-12-17 22:08:36 +01:00
< div class = "form-group" >
< label for = "nickname" > $ { t } : < / l a b e l >
< input type = "text"
title = "${n}"
required = "required"
name = "nickname"
value = "${e.model.get(" nick ")||" "}"
class = "form-control" / >
< / d i v >
` })(e)}
< input type = "submit" class = "btn btn-primary" name = "join" value = "${t||" "}" ? disabled = $ { r } / >
< / f o r m >
2023-02-17 12:24:37 +01:00
` };var ok=n(3247),ak={};ak.styleTagTransform=o_(),ak.setAttributes=n_(),ak.insert=e_().bind(null,"head"),ak.domAPI=Ky(),ak.insertStyleElement=i_();Qy()(ok.Z,ak);ok.Z&&ok.Z.locals&&ok.Z.locals;const ck=Oh.env.utils,{Strophe:lk}=Oh.env;Ih.elements.define("converse-add-muc-modal",class extends $ _{initialize(){super.initialize(),this.listenTo(this.model,"change:muc_domain",(()=>this.render())),this.muc_roomid_policy_error_msg=null,this.render(),this.addEventListener("shown.bs.modal",(()=>{this.querySelector('input[name="chatroom"]').focus()}),!1)}renderModal(){return rk(this)}getModalTitle(){return Gy("Enter a new Groupchat")}parseRoomDataFromEvent(e){const t=new FormData(e),n=t.get("chatroom")?.trim();let s;if(Ih.settings.get("locked_muc_nickname")){if(s=nd.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){if(e.preventDefault(),this.checkRoomidPolicy())return;const t=this.parseRoomDataFromEvent(e.target);let n;""===t.nick&&(t.nick=void 0),Ih.settings.get("locked_muc_domain")||Ih.settings.get("muc_domain")&&!ck.isValidJID(t.jid)?n= ` $ { lk . escapeNode ( t . jid ) } @ $ { Ih . settings . get ( "muc_domain" ) } ` :(n=t.jid,this.model.setDomain(n)),Ih.rooms.open(n,Object.assign(t,{jid:n}),!0),e.target.reset(),this.modal.hide()}checkRoomidPolicy(){if(Ih.settings.get("muc_roomid_policy")&&Ih.settings.get("muc_domain")){let e=this.querySelector("converse-autocomplete input").value;!Ih.settings.get("locked_muc_domain")&&ck.isValidJID(e)||(e= ` $ { lk . escapeNode ( e ) } @ $ { Ih . settings . get ( "muc_domain" ) } ` );const t=lk.getNodeFromJid(e),n=lk.getDomainFromJid(e);if(Ih.settings.get("muc_domain")===n&&!Ih.settings.get("muc_roomid_policy").test(t))return this.muc_roomid_policy_error_msg=Gy("Groupchat id is invalid."),!0;this.muc_roomid_policy_error_msg=null,this.render()}}});const dk=function(e){return e&&e.length?e[0]:void 0},uk=e=>{const t=Gy("Description:"),n=Gy("Groupchat XMPP Address:"),s=Gy("Participants:"),i=Gy("Features:"),r=Gy("Requires authentication"),o=Gy("Hidden"),a=Gy("Requires an invitation"),c=Gy("Moderated"),l=Gy("Non-anonymous"),d=Gy("Open"),u=Gy("Permanent"),h=Gy("Public"),m=Gy("Semi-anonymous"),g=Gy("Temporary"),f=Gy("Unmoderated");return Gu `
< div class = "room-info" >
< p class = "room-info" > < strong > $ { n } < / s t r o n g > $ { e . j i d } < / p >
< p class = "room-info" > < strong > $ { t } < / s t r o n g > $ { e . d e s c } < / p >
< p class = "room-info" > < strong > $ { s } < / s t r o n g > $ { e . o c c } < / p >
< p class = "room-info" > < strong > $ { i } < / s t r o n g >
< ul >
$ { e . passwordprotected ? Gu ` <li class="room-info locked"> ${ r } </li> ` : "" }
$ { e . hidden ? Gu ` <li class="room-info"> ${ o } </li> ` : "" }
$ { e . membersonly ? Gu ` <li class="room-info"> ${ a } </li> ` : "" }
$ { e . moderated ? Gu ` <li class="room-info"> ${ c } </li> ` : "" }
$ { e . nonanonymous ? Gu ` <li class="room-info"> ${ l } </li> ` : "" }
$ { e . open ? Gu ` <li class="room-info"> ${ d } </li> ` : "" }
$ { e . persistent ? Gu ` <li class="room-info"> ${ u } </li> ` : "" }
$ { e . publicroom ? Gu ` <li class="room-info"> ${ h } </li> ` : "" }
$ { e . semianonymous ? Gu ` <li class="room-info"> ${ m } </li> ` : "" }
$ { e . temporary ? Gu ` <li class="room-info"> ${ g } </li> ` : "" }
$ { e . unmoderated ? Gu ` <li class="room-info"> ${ f } </li> ` : "" }
< / u l >
< / p >
< / d i v >
` },hk=e=>Gu `
$ { e . show _form ? ( e => { const t = Gy ( "Show groupchats" ) , n = Gy ( "Server address" ) ; return Gu `
2021-11-11 22:06:49 +01:00
< form class = "converse-form list-chatrooms"
@ submit = $ { e . submitForm } >
< div class = "form-group" >
< label for = "chatroom" > $ { n } : < / l a b e l >
< input type = "text"
2022-12-17 22:08:36 +01:00
autofocus
2021-11-11 22:06:49 +01:00
@ change = $ { e . setDomainFromEvent }
value = "${e.muc_domain||" "}"
required = "required"
name = "server"
class = "form-control"
placeholder = "${e.server_placeholder}" / >
< / d i v >
< input type = "submit" class = "btn btn-primary" name = "list" value = "${t}" / >
< / f o r m >
` })(e):""}
2022-12-17 22:08:36 +01:00
< ul class = "available-chatrooms list-group" >
2023-02-17 12:24:37 +01:00
$ { e . loading _items ? Gu ` <li class="list-group-item"> ${ J _ ( ) } </li> ` : "" }
$ { e . feedback _text ? Gu ` <li class="list-group-item active"> ${ e . feedback _text } </li> ` : "" }
$ { Mw ( e . items , ( e => e . jid ) , ( t => ( ( e , t ) => { const n = Gy ( "Show more information on this groupchat" ) , s = Gy ( "Click to open this groupchat" ) ; return Gu `
2021-11-11 22:06:49 +01:00
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
2022-12-17 22:08:36 +01:00
@ click = $ { e . openRoom }
data - room - jid = "${t.jid}"
data - room - name = "${t.name}"
title = "${s}"
href = "#" > $ { t . name || t . jid } < / a >
< a class = "right room-info icon-room-info"
@ click = $ { e . toggleRoomInfo }
data - room - jid = "${t.jid}"
title = "${n}"
href = "#" > < / a >
2021-11-11 22:06:49 +01:00
< / d i v >
< / l i >
` })(e,t)))}
2022-12-17 22:08:36 +01:00
< / u l >
2023-02-17 12:24:37 +01:00
` ,{Strophe:mk, $ iq:gk,sizzle:fk}=Oh.env,pk=Oh.env.utils;function vk(e){const t=pk.ancestor(e.target,".room-item"),n=t.querySelector("div.room-info");n?(pk.slideIn(n).then(pk.removeElement),t.querySelector("a.room-info").classList.remove("selected")):(t.insertAdjacentElement("beforeend",pk.getElementFromTemplateResult(J_())),Ih.disco.info(e.target.getAttribute("data-room-jid"),null).then((e=>function(e,t){e.querySelector("span.spinner").remove(),e.querySelector("a.room-info").classList.add("selected"),e.insertAdjacentHTML("beforeEnd",pk.getElementFromTemplateResult(uk({jid:t.getAttribute("from"),desc:dk(fk('field[var="muc#roominfo_description"] value',t))?.textContent,occ:dk(fk('field[var="muc#roominfo_occupants"] value',t))?.textContent,hidden:fk('feature[var="muc_hidden"]',t).length,membersonly:fk('feature[var="muc_membersonly"]',t).length,moderated:fk('feature[var="muc_moderated"]',t).length,nonanonymous:fk('feature[var="muc_nonanonymous"]',t).length,open:fk('feature[var="muc_open"]',t).length,passwordprotected:fk('feature[var="muc_passwordprotected"]',t).length,persistent:fk('feature[var="muc_persistent"]',t).length,publicroom:fk('feature[var="muc_publicroom"]',t).length,semianonymous:fk('feature[var="muc_semianonymous"]',t).length,temporary:fk('feature[var="muc_temporary"]',t).length,unmoderated:fk('feature[var="muc_unmoderated"]',t).length})))}(t,e))).catch((e=>Il.error(e))))}function yk(e){return gl()&&!e.get("hidden")}Ih.elements.define("converse-muc-list-modal",class extends $ _{constructor(e){super(e),this.items=[],this.loading_items=!1}initialize(){super.initialize(),this.listenTo(this.model,"change:muc_domain",this.onDomainChange),this.listenTo(this.model,"change:feedback_text",(()=>this.render())),this.addEventListener("shown.bs.modal",(()=>Ih.settings.get("locked_muc_domain")&&this.updateRoomsList())),this.model.save("feedback_text","")}renderModal(){return hk(Object.assign(this.model.toJSON(),{show_form:!Ih.settings.get("locked_muc_domain"),server_placeholder:this.model.get("muc_domain")||Gy("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)}))}getModalTitle(){return Gy("Query for Groupchats")}openRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid"),n=e.target.getAttribute("data-room-name");this.modal.hide(),Ih.rooms.open(t,{name:n},!0)}toggleRoomInfo(e){e.preventDefault(),vk(e)}onDomainChange(){Ih.settings.get("auto_list_rooms")&&this.updateRoomsList()}onRoomsFound(e){this.loading_items=!1;const t=e?fk("query item",e):[];return t.length?(this.model.set({feedback_text:Gy("Groupchats found")},{silent:!0}),this.items=t.map(Cm)):(this.items=[],this.model.set({feedback_text:Gy("No groupchats found")},{silent:!0})),this.render(),!0}updateRoomsList(){const e=gk({to:this.model.get("muc_domain"),from:nd.connection.jid,type:"get"}).c("query",{xmlns:mk.NS.DISCO_ITEMS});Ih.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})}});const _k=e=>Gu ` < span class = "list-item-badge badge badge--muc msgs-indicator" > $ { e . get ( "num_unread" ) } < / s p a n > ` , b k = ( ) = > G u ` < s p a n c l a s s = " l i s t - i t e m - b a d g e b a d g e b a d g e - - m u c m s g s - i n d i c a t o r " > < / s p a n > ` ; f u n c t i o n w k ( e , t ) { c o n s t n = G y ( " L e a v e t h i s g r o u p c h a t " ) , s = t . g e t ( " n u m _ u n r e a d _ g e n e r a l " ) | | t . g e t ( " h a s _ a c t i v i t y " ) ; r e t u r n G u `
< div class = "list-item controlbox-padded available-chatroom d-flex flex-row ${yk(t)?" open ":" "} ${s?" unread - msgs ":" "}"
data - room - jid = "${t.get(" jid ")}" >
2021-03-19 19:26:15 +01:00
2023-02-17 12:24:37 +01:00
$ { t . get ( "num_unread" ) ? _k ( t ) : t . get ( "has_activity" ) ? bk ( ) : "" }
2021-11-11 22:06:49 +01:00
2021-03-19 19:26:15 +01:00
< a class = "list-item-link open-room available-room w-100"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}"
title = "${Gy(" Click to open this groupchat ")}"
@ click = $ { t => e . openRoom ( t ) } > $ { t . getDisplayName ( ) } < / a >
2022-12-17 22:08:36 +01:00
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "allow_bookmarks" ) ? function ( e ) { const t = e . get ( "bookmarked" ) ? ? ! 1 , n = Gy ( "Bookmark" ) ; return Gu `
< a class = "list-item-action add-bookmark"
data - room - jid = "${e.get(" jid ")}"
data - bookmark - name = "${e.getDisplayName()}"
@ click = $ { e => xw ( e ) }
title = "${n}" >
2022-12-17 22:08:36 +01:00
2023-02-17 12:24:37 +01:00
< converse - icon class = "fa ${t?" fa - bookmark ":" fa - bookmark - empty "}"
size = "1.2em"
color = "${yk(e)?" var ( -- inverse - link - color ) ":" "}" > < / c o n v e r s e - i c o n >
< / a > ` } ( t ) : " " }
2021-03-19 19:26:15 +01:00
2022-12-17 22:08:36 +01:00
< a class = "list-item-action room-info"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}"
title = "${Gy(" Show more information on this groupchat ")}"
@ click = $ { t => e . showRoomDetailsModal ( t ) } >
2021-03-19 19:26:15 +01:00
2023-02-17 12:24:37 +01:00
< converse - icon class = "fa fa-info-circle" size = "1.2em" color = "${yk(t)?" var ( -- inverse - link - color ) ":" "}" > < / c o n v e r s e - i c o n >
2022-12-17 22:08:36 +01:00
< / a >
< a class = "list-item-action close-room"
2023-02-17 12:24:37 +01:00
data - room - jid = "${t.get(" jid ")}"
data - room - name = "${t.getDisplayName()}"
title = "${n}"
@ click = $ { t => e . closeRoom ( t ) } >
< converse - icon class = "fa fa-sign-out-alt" size = "1.2em" color = "${yk(t)?" var ( -- inverse - link - color ) ":" "}" > < / c o n v e r s e - i c o n >
2022-12-17 22:08:36 +01:00
< / a >
2023-02-17 12:24:37 +01:00
< / d i v > ` } c o n s t { S t r o p h e : S k , u : x k } = O h . e n v ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o o m s - l i s t " , c l a s s e x t e n d s V y { i n i t i a l i z e ( ) { c o n s t e = ` c o n v e r s e . r o o m s p a n e l $ { n d . b a r e _ j i d } ` ; t h i s . m o d e l = n e w X $ ( { i d : e } ) , X c ( t h i s . m o d e l , e ) , t h i s . m o d e l . f e t c h ( ) , t h i s . l i s t e n T o ( n d . c h a t b o x e s , " a d d " , t h i s . r e n d e r I f C h a t R o o m ) , t h i s . l i s t e n T o ( n d . c h a t b o x e s , " r e m o v e " , t h i s . r e n d e r I f C h a t R o o m ) , t h i s . l i s t e n T o ( n d . c h a t b o x e s , " d e s t r o y " , t h i s . r e n d e r I f C h a t R o o m ) , t h i s . l i s t e n T o ( n d . c h a t b o x e s , " c h a n g e " , t h i s . r e n d e r I f R e l e v a n t C h a n g e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t { c h a t b o x e s : t , C H A T R O O M S _ T Y P E : n , C L O S E D : s } = n d , i = t . f i l t e r ( ( e = > e . g e t ( " t y p e " ) = = = n ) ) ; i . s o r t ( ( ( e , t ) = > e . g e t D i s p l a y N a m e ( ) . t o L o w e r C a s e ( ) < = t . g e t D i s p l a y N a m e ( ) . t o L o w e r C a s e ( ) ? - 1 : 1 ) ) ; c o n s t r = G y ( " C l i c k t o t o g g l e t h e l i s t o f o p e n g r o u p c h a t s " ) , o = G y ( " G r o u p c h a t s " ) , a = G y ( " Q u e r y f o r g r o u p c h a t s " ) , c = G y ( " A d d a n e w g r o u p c h a t " ) , l = G y ( " S h o w b o o k m a r k e d g r o u p c h a t s " ) , d = e . m o d e l . g e t ( " t o g g l e _ s t a t e " ) = = = s ; r e t u r n G u `
2022-05-05 23:06:17 +02:00
< div class = "d-flex controlbox-padded" >
2022-12-17 22:08:36 +01:00
< span class = "w-100 controlbox-heading controlbox-heading--groupchats" >
2023-02-17 12:24:37 +01:00
< a class = "list-toggle open-rooms-toggle" title = "${r}" @ click = $ { t => e . toggleRoomsList ( t ) } >
2022-12-17 22:08:36 +01:00
< converse - icon
2023-02-17 12:24:37 +01:00
class = "fa ${d?" fa - caret - right ":" fa - caret - down "}"
2022-12-17 22:08:36 +01:00
size = "1em"
color = "var(--muc-color)" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
$ { o }
2022-12-17 22:08:36 +01:00
< / a >
< / s p a n >
< a class = "controlbox-heading__btn show-bookmark-list-modal"
2023-02-17 12:24:37 +01:00
@ click = $ { t => Ih . modal . show ( "converse-bookmark-list-modal" , { model : e . model } , t ) }
title = "${l}"
2022-12-17 22:08:36 +01:00
data - toggle = "modal" >
< converse - icon class = "fa fa-bookmark right" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2022-05-05 23:06:17 +02:00
< a class = "controlbox-heading__btn show-list-muc-modal"
2023-02-17 12:24:37 +01:00
@ click = $ { t => Ih . modal . show ( "converse-muc-list-modal" , { model : e . model } , t ) }
title = "${a}" data - toggle = "modal" data - target = "#muc-list-modal" >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-list-ul right" size = "1em" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
< / a >
< a class = "controlbox-heading__btn show-add-muc-modal"
2023-02-17 12:24:37 +01:00
@ click = $ { t => Ih . modal . show ( "converse-add-muc-modal" , { model : e . model } , t ) }
title = "${c}" data - toggle = "modal" data - target = "#add-chatrooms-modal" >
2022-12-17 22:08:36 +01:00
< converse - icon class = "fa fa-plus right" size = "1em" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
< / a >
< / d i v >
2023-02-17 12:24:37 +01:00
< div class = "list-container list-container--openrooms ${i.length?" ":" hidden "}" >
< div class = "items-list rooms-list open-rooms-list ${d?" collapsed ":" "}" >
$ { i . map ( ( t => wk ( e , t ) ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
< / d i v > ` } ) ( t h i s ) } r e n d e r I f C h a t R o o m ( e ) { x k . i s C h a t R o o m ( e ) & & t h i s . r e q u e s t U p d a t e ( ) } r e n d e r I f R e l e v a n t C h a n g e ( e ) { c o n s t t = [ " b o o k m a r k e d " , " h i d d e n " , " n a m e " , " n u m _ u n r e a d " , " n u m _ u n r e a d _ g e n e r a l " , " h a s _ a c t i v i t y " ] , n = e . c h a n g e d | | { } ; x k . i s C h a t R o o m ( e ) & & O b j e c t . k e y s ( n ) . f i l t e r ( ( e = > t . i n c l u d e s ( e ) ) ) . l e n g t h & & t h i s . r e q u e s t U p d a t e ( ) } s h o w R o o m D e t a i l s M o d a l ( e ) { c o n s t t = e . c u r r e n t T a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) , n = n d . c h a t b o x e s . g e t ( t ) ; e . p r e v e n t D e f a u l t ( ) , I h . m o d a l . s h o w ( " c o n v e r s e - m u c - d e t a i l s - m o d a l " , { m o d e l : n } , e ) } a s y n c o p e n R o o m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . t e x t C o n t e n t , n = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) , s = { n a m e : t | | S k . u n e s c a p e N o d e ( S k . g e t N o d e F r o m J i d ( n ) ) | | n } ; a w a i t I h . r o o m s . o p e n ( n , s , ! 0 ) } a s y n c c l o s e R o o m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . c u r r e n t T a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - n a m e " ) , n = e . c u r r e n t T a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) ; i f ( a w a i t I h . c o n f i r m ( G y ( " A r e y o u s u r e y o u w a n t t o l e a v e t h e g r o u p c h a t % 1 $ s ? " , t ) ) ) { ( a w a i t I h . r o o m s . g e t ( n ) ) . c l o s e ( ) } } t o g g l e R o o m s L i s t ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " . o p e n - r o o m s - l i s t " ) ; t h i s . m o d e l . g e t ( " t o g g l e _ s t a t e " ) = = = n d . C L O S E D ? x k . s l i d e O u t ( t ) . t h e n ( ( ( ) = > t h i s . m o d e l . s a v e ( { t o g g l e _ s t a t e : n d . O P E N E D } ) ) ) : x k . s l i d e I n ( t ) . t h e n ( ( ( ) = > t h i s . m o d e l . s a v e ( { t o g g l e _ s t a t e : n d . C L O S E D } ) ) ) } } ) , O h . p l u g i n s . a d d ( " c o n v e r s e - r o o m s l i s t " , { d e p e n d e n c i e s : [ " c o n v e r s e - s i n g l e t o n " , " c o n v e r s e - c o n t r o l b o x " , " c o n v e r s e - m u c " , " c o n v e r s e - b o o k m a r k s " ] , i n i t i a l i z e ( ) { } } ) ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - f o n t a w e s o m e " , c l a s s e x t e n d s V y { r e n d e r ( ) { r e t u r n G u `
2021-11-11 22:06:49 +01:00
< ? xml version = "1.0" encoding = "UTF-8" ? >
<!--
Font Awesome Free 5.13 . 0 by @ fontawesome - https : //fontawesome.com
License - https : //fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
-- >
< svg xmlns = "http://www.w3.org/2000/svg" style = "display: none;" >
< symbol id = "icon-address-book" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-down" viewBox = "0 0 320 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-left" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-right" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-up" viewBox = "0 0 320 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-down" viewBox = "0 0 320 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-left" viewBox = "0 0 256 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-right" viewBox = "0 0 256 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-up" viewBox = "0 0 320 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-down" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-left" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-right" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-up" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-down" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-left" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-right" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-up" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-down" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-left" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-right" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-up" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt-h" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt-v" viewBox = "0 0 256 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-bars" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-bookmark" viewBox = "0 0 384 512" >
< path d = "M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z" > < / p a t h >
< / s y m b o l >
2023-02-17 12:24:37 +01:00
< symbol id = "icon-bookmark-empty" viewBox = "0 0 384 512" >
< path d = "M0 48C0 21.5 21.5 0 48 0l0 48V441.4l130.1-92.9c8.3-6 19.6-6 27.9 0L336 441.4V48H48V0H336c26.5 0 48 21.5 48 48V488c0 9-5 17.2-13 21.3s-17.6 3.4-24.9-1.8L192 397.5 37.9 507.5c-7.3 5.2-16.9 5.9-24.9 1.8S0 497 0 488V48z" / >
< / s y m b o l >
2021-11-11 22:06:49 +01:00
< symbol id = "icon-caret-down" viewBox = "0 0 320 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-caret-right" viewBox = "0 0 192 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-check" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-cog" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-database" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-edit" viewBox = "0 0 576 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-eye" viewBox = "0 0 576 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-eye-slash" viewBox = "0 0 640 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-gavel" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-globe" viewBox = "0 0 496 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-id-card" viewBox = "0 0 576 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-id-card-alt" viewBox = "0 0 576 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-info" viewBox = "0 0 192 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-info-circle" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-list-ul" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-lock" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-lock-open" viewBox = "0 0 576 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus-circle" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus-square" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-paper-plane" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-paperclip" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-pencil-alt" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-phone" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus-circle" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus-square" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-save" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-sign-out-alt" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-smile" viewBox = "0 0 496 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-snowflake" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-spinner" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-sync" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-times" viewBox = "0 0 352 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-times-circle" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-trash" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-trash-alt" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-unlock" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-cog" viewBox = "0 0 640 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-plus" viewBox = "0 0 640 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-secret" viewBox = "0 0 448 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-users" viewBox = "0 0 640 512" >
< 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" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-wrench" viewBox = "0 0 512 512" >
< 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" > < / p a t h >
< / s y m b o l >
2022-04-02 21:20:14 +02:00
< symbol id = "icon-refresh" viewBox = "0 0 512 512" >
< path d = "M464 16c-17.67 0-32 14.31-32 32v74.09C392.1 66.52 327.4 32 256 32C161.5 32 78.59 92.34 49.58 182.2c-5.438 16.81 3.797 34.88 20.61 40.28c16.89 5.5 34.88-3.812 40.3-20.59C130.9 138.5 189.4 96 256 96c50.5 0 96.26 24.55 124.4 64H336c-17.67 0-32 14.31-32 32s14.33 32 32 32h128c17.67 0 32-14.31 32-32V48C496 30.31 481.7 16 464 16zM441.8 289.6c-16.92-5.438-34.88 3.812-40.3 20.59C381.1 373.5 322.6 416 256 416c-50.5 0-96.25-24.55-124.4-64H176c17.67 0 32-14.31 32-32s-14.33-32-32-32h-128c-17.67 0-32 14.31-32 32v144c0 17.69 14.33 32 32 32s32-14.31 32-32v-74.09C119.9 445.5 184.6 480 255.1 480c94.45 0 177.4-60.34 206.4-150.2C467.9 313 458.6 294.1 441.8 289.6z" > < / p a t h >
< / s y m b o l >
2021-11-11 22:06:49 +01:00
< / s v g >
2023-02-17 12:24:37 +01:00
` }});function Ek(){if(!Ih.settings.get("auto_insert"))return;const e=Ih.settings.get("root");if(!e.querySelector("converse-root")){const t=document.createElement("converse-root"),n=e.querySelector("body");n?n.appendChild(t):e.appendChild(t)}}var Ak=n(1513),Ck={};Ck.styleTagTransform=o_(),Ck.setAttributes=n_(),Ck.insert=e_().bind(null,"head"),Ck.domAPI=Ky(),Ck.insertStyleElement=i_();Qy()(Ak.Z,Ck);Ak.Z&&Ak.Z.locals&&Ak.Z.locals;class $ k extends Vy{render(){return(()=>{const e=Ih.settings.get("singleton")?["converse-singleton"]:[];return e.push( ` converse - $ { Ih . settings . get ( "view_mode" ) } ` ),Gu `
2022-01-03 11:54:10 +01:00
< converse - chats class = "converse-chatboxes row no-gutters ${e.join(" ")}" > < / c o n v e r s e - c h a t s >
2021-11-11 22:06:49 +01:00
< div id = "converse-modals" class = "modals" > < / d i v >
< converse - fontawesome > < / c o n v e r s e - f o n t a w e s o m e >
2023-02-17 12:24:37 +01:00
` })()}initialize(){this.setAttribute("id","conversejs"),this.setClasses();const e=sl();this.listenTo(e,"change:view_mode",(()=>this.setClasses())),this.listenTo(e,"change:singleton",(()=>this.setClasses())),window.matchMedia("(prefers-color-scheme: dark)").addListener((()=>this.setClasses())),window.matchMedia("(prefers-color-scheme: light)").addListener((()=>this.setClasses()))}setClasses(){this.className="",this.classList.add("conversejs"),this.classList.add( ` converse - $ { Ih . settings . get ( "view_mode" ) } ` ),this.classList.add( ` theme - $ { window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ? Ih . settings . get ( "dark_theme" ) : Ih . settings . get ( "theme" ) } ` ),this.requestUpdate()}}Oh.plugins.add("converse-rootview",{initialize(){Ih.settings.extend({auto_insert:!0,theme:"classic",dark_theme:"dracula"}),Ih.listen.on("chatBoxesInitialized",Ek),Ih.elements.define("converse-root", $ k)}});const kk=e=>{const t=Gy("Add"),n=Gy("name@example.org"),s=Gy("Please enter a valid XMPP address"),i=Gy("Group"),r=Gy("Name"),o=Gy("XMPP Address");return Gu `
2022-12-17 22:08:36 +01:00
< form class = "converse-form add-xmpp-contact" @ submit = $ { t => e . addContactFromForm ( t ) } >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "form-group add-xmpp-contact__jid" >
< label class = "clearfix" for = "jid" > $ { o } : < / l a b e l >
< div class = "suggestion-box suggestion-box__jid" >
< ul class = "suggestion-box__results suggestion-box__results--below" hidden = "" > < / u l >
2023-02-17 12:24:37 +01:00
< input type = "text" name = "jid" ? required = $ { ! Ih . settings . get ( "xhr_user_search_url" ) }
2022-12-17 22:08:36 +01:00
value = "${e.model.get(" jid ")||" "}"
class = "form-control suggestion-box__input"
placeholder = "${n}" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< div class = "form-group add-xmpp-contact__name" >
< label class = "clearfix" for = "name" > $ { r } : < / l a b e l >
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< input type = "text" name = "name" value = "${e.model.get(" nickname ")||" "}"
class = "form-control suggestion-box__input" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group add-xmpp-contact__group" >
< label class = "clearfix" for = "name" > $ { i } : < / l a b e l >
2023-02-17 12:24:37 +01:00
< converse - autocomplete . list = $ { function ( ) { const { roster : e } = nd , t = e . reduce ( ( ( e , t ) => e . concat ( t . get ( "groups" ) ) ) , [ ] ) ; return [ ... new Set ( t . filter ( ( e => e ) ) ) ] } ( ) } name = "group" > < / c o n v e r s e - a u t o c o m p l e t e >
2022-12-17 22:08:36 +01:00
< / d i v >
< div class = "form-group" > < div class = "invalid-feedback" > $ { s } < / d i v > < / d i v >
< button type = "submit" class = "btn btn-primary" > $ { t } < / b u t t o n >
2021-03-19 19:26:15 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
< / f o r m > ` } , { S t r o p h e : j k } = O h . e n v , T k = O h . e n v . u t i l s ; I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - a d d - c o n t a c t - m o d a l " , c l a s s e x t e n d s $ _ { i n i t i a l i z e ( ) { s u p e r . i n i t i a l i z e ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e n d e r ( ) ) ) , t h i s . r e n d e r ( ) , t h i s . a d d E v e n t L i s t e n e r ( " s h o w n . b s . m o d a l " , ( ( ) = > t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " j i d " ] ' ) ? . f o c u s ( ) ) , ! 1 ) } r e n d e r M o d a l ( ) { r e t u r n k k ( t h i s ) } g e t M o d a l T i t l e ( ) { r e t u r n G y ( " A d d a C o n t a c t " ) } a f t e r R e n d e r ( ) { " s t r i n g " = = t y p e o f I h . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) ? t h i s . i n i t X H R A u t o C o m p l e t e ( ) : t h i s . i n i t J I D A u t o C o m p l e t e ( ) } i n i t J I D A u t o C o m p l e t e ( ) { i f ( ! I h . s e t t i n g s . g e t ( " a u t o c o m p l e t e _ a d d _ c o n t a c t " ) ) r e t u r n ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . s u g g e s t i o n - b o x _ _ j i d " ) . p a r e n t E l e m e n t ; t h i s . j i d _ a u t o _ c o m p l e t e = n e w n d . A u t o C o m p l e t e ( e , { d a t a : ( e , t ) = > ` $ { t . s l i c e ( 0 , t . i n d e x O f ( " @ " ) ) } @ $ { e } ` , f i l t e r : n d . F I L T E R _ S T A R T S W I T H , l i s t : [ . . . n e w S e t ( n d . r o s t e r . m a p ( ( e = > j k . g e t D o m a i n F r o m J i d ( e . g e t ( " j i d " ) ) ) ) ) ] } ) } i n i t G r o u p A u t o C o m p l e t e ( ) { i f ( ! I h . s e t t i n g s . g e t ( " a u t o c o m p l e t e _ a d d _ c o n t a c t " ) ) r e t u r n ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . s u g g e s t i o n - b o x _ _ j i d " ) . p a r e n t E l e m e n t ; t h i s . j i d _ a u t o _ c o m p l e t e = n e w n d . A u t o C o m p l e t e ( e , { d a t a : ( e , t ) = > ` $ { t . s l i c e ( 0 , t . i n d e x O f ( " @ " ) ) } @ $ { e } ` , f i l t e r : n d . F I L T E R _ S T A R T S W I T H , l i s t : [ . . . n e w S e t ( n d . r o s t e r . m a p ( ( e = > j k . g e t D o m a i n F r o m J i d ( e . g e t ( " j i d " ) ) ) ) ) ] } ) } i n i t X H R A u t o C o m p l e t e ( ) { i f ( ! I h . s e t t i n g s . g e t ( " a u t o c o m p l e t e _ a d d _ c o n t a c t " ) ) r e t u r n t h i s . i n i t X H R F e t c h ( ) ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . s u g g e s t i o n - b o x _ _ n a m e " ) . p a r e n t E l e m e n t ; t h i s . n a m e _ a u t o _ c o m p l e t e = n e w n d . A u t o C o m p l e t e ( e , { a u t o _ e v a l u a t e : ! 1 , f i l t e r : n d . F I L T E R _ S T A R T S W I T H , l i s t : [ ] } ) ; c o n s t t = n e w w i n d o w . X M L H t t p R e q u e s t ; t . o n l o a d = ( ) = > { i f ( t . r e s p o n s e T e x t ) { c o n s t e = t . r e s p o n s e T e x t ; t h i s . n a m e _ a u t o _ c o m p l e t e . l i s t = J S O N . p a r s e ( e ) . m a p ( ( e = > ( { l a b e l : e . f u l l n a m e | | e . j i d , v a l u e : e . j i d } ) ) ) , t h i s . n a m e _ a u t o _ c o m p l e t e . a u t o _ c o m p l e t i n g = ! 0 , t h i s . n a m e _ a u t o _ c o m p l e t e . e v a l u a t e ( ) } } ; c o n s t n = t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " n a m e " ] ' ) ; n . a d d E v e n t L i s t e n e r ( " i n p u t " , v h ( ( ( ) = > { t . o p e n ( " G E T " , ` $ { I h . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) } q = $ { e n c o d e U R I C o m p o n e n t ( n . v a l u e ) } ` , ! 0 ) , t . s e n d ( ) } ) , 3 0 0 ) ) , t h i s . n a m e _ a u t o _ c o m p l e t e . o n ( " s u g g e s t i o n - b o x - s e l e c t c o m p l e t e " , ( e = > { t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " n a m e " ] ' ) . v a l u e = e . t e x t . l a b e l , t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " j i d " ] ' ) . v a l u e = e . t e x t . v a l u e } ) ) } i n i t X H R F e t c h ( ) { t h i s . x h r = n e w w i n d o w . X M L H t t p R e q u e s t , t h i s . x h r . o n l o a d = ( ) = > { i f ( t h i s . x h r . r e s p o n s e T e x t ) { c o n s t e = t h i s . x h r . r e s p o n s e T e x t , t = J S O N . p a r s e ( e ) . m a p ( ( e = > ( { l a b e l : e . f u l l n a m e | | e . j i d , v a l u e : e . j i d } ) ) ) ; i f ( 1 ! = = t . l e n g t h ) { c o n s t e = t h i s . q u e r y S e l e c t o r ( " . i n v a l i d - f e e d b a c k " ) ; r e t u r n e . t e x t C o n t e n t = G y ( " S o r r y , c o u l d n o t f i n d a c o n t a c t w i t h t h a t n a m e " ) , v o i d T k . a d d C l a s s ( " d - b l o c k " , e ) } c o n s t n = t [ 0 ] . v a l u e ; i f ( t h i s . v a l i d a t e S u b m i s s i o n ( n ) ) { c o n s t e = t h i s . q u e r y S e l e c t o r ( " f o r m " ) , s = t [ 0 ] . l a b e l ; t h i s . a f t e r S u b m i s s i o n ( e , n , s ) } } } } v a l i d a t e S u b m i s s i o n ( e ) { c o n s t t = t h i s . q u e r y S e l e c t o r ( " . i n v a l i d - f e e d b a c k " ) ; r e t u r n ! e | | L o ( e . s p l i t ( " @ " ) ) . l e n g t h < 2 ? ( T k . a d d C l a s s ( " i s - i n v a l i d " , t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " j i d " ] ' ) ) , T k . a d d C l a s s ( " d - b l o c k " , t ) , ! 1 ) : n d . r o s t e r . g e t ( j k . g e t B a r e J i d F r o m J i d ( e ) ) ? ( t . t e x t C o n t e n t = G y ( " T h i s c o n t a c t h a s a l r e a d y b e e n a d d e d " ) , T k . a d d C l a s s ( " d - b l o c k " , t ) , ! 1 ) : ( T k . r e m o v e C l a s s ( " d - b l o c k " , t ) , ! 0 ) } a f t e r S u b m i s s i o n ( e , t , n , s ) { s & & ! A r r a y . i s A r r a y ( s ) & & ( s = [ s ] ) , n d . r o s t e r . a d d A n d S u b s c r i b e ( t , n , s ) , t h i s . m o d e l . c l e a r ( ) , t h i s . m o d a l . h i d e ( ) } a d d C o n t a c t F r o m F o r m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) , n = ( t . g e t ( " j i d " ) | | " " ) . t r i m ( ) ; i f ( ! n & & " s t r i n g " = = t y p e o f I h . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) ) { c o n s t e = t h i s . q u e r y S e l e c t o r ( ' i n p u t [ n a m e = " n a m e " ] ' ) ; r e t u r n t h i s . x h r . o p e n ( " G E T " , ` $ { I h . s e t t i n g s . g e t ( " x h r _ u s e r _ s e a r c h _ u r l " ) } q = $ { e n c o d e U R I C o m p o n e n t ( e . v a l u e ) } ` , ! 0 ) , v o i d t h i s . x h r . s e n d ( ) } t h i s . v a l i d a t e S u b m i s s i o n ( n ) & & t h i s . a f t e r S u b m i s s i o n ( e . t a r g e t , n , t . g e t ( " n a m e " ) , t . g e t ( " g r o u p " ) ) } } ) ; c o n s t { u : N k } = O h . e n v ; f u n c t i o n I k ( e ) { c o n s t t = e . g e t ( " j i d " ) , n = [ ] ; i f ( g l ( ) ) { c o n s t e = n d . c h a t b o x e s . g e t ( t ) ; e & & ! e . g e t ( " h i d d e n " ) & & n . p u s h ( " o p e n " ) } c o n s t s = e . g e t ( " a s k " ) , i = e . g e t ( " r e q u e s t i n g " ) , r = e . g e t ( " s u b s c r i p t i o n " ) ; r e t u r n " s u b s c r i b e " = = = s | | " f r o m " = = = r ? n . p u s h ( " p e n d i n g - x m p p - c o n t a c t " ) : ! 0 = = = i ? n . p u s h ( " r e q u e s t i n g - x m p p - c o n t a c t " ) : ( " b o t h " = = = r | | " t o " = = = r | | N k . i s S a m e B a r e J I D ( t , n d . c o n n e c t i o n . j i d ) ) & & ( n . p u s h ( " c u r r e n t - x m p p - c o n t a c t " ) , n . p u s h ( r ) , n . p u s h ( e . p r e s e n c e . g e t ( " s h o w " ) ) ) , G u `
2021-11-11 22:06:49 +01:00
< li class = "list-item d-flex controlbox-padded ${n.join(" ")}" data - status = "${e.presence.get(" show ")}" >
< converse - roster - contact . model = $ { e } > < / c o n v e r s e - r o s t e r - c o n t a c t >
2023-02-17 12:24:37 +01:00
< / l i > ` } c o n s t O k = e = > { c o n s t t = G y ( " C l i c k t o h i d e t h e s e c o n t a c t s " ) , n = n d . r o s t e r . s t a t e . g e t ( " c o l l a p s e d _ g r o u p s " ) ; r e t u r n G u `
2022-05-05 23:06:17 +02:00
< div class = "roster-group" data - group = "${e.name}" >
2023-02-17 12:24:37 +01:00
< a href = "#" class = "list-toggle group-toggle controlbox-padded" title = "${t}" @ click = $ { t => function ( e , t ) { e ? . preventDefault ? . ( ) ; const n = nd . roster . state . get ( "collapsed_groups" ) ; n . includes ( t ) ? nd . roster . state . save ( "collapsed_groups" , n . filter ( ( e => e !== t ) ) ) : nd . roster . state . save ( "collapsed_groups" , [ ... n , t ] ) } ( t , e . name ) } >
2022-05-05 23:06:17 +02:00
< converse - icon color = "var(--chat-head-color-dark)" size = "1em" class = "fa ${n.includes(e.name)?" fa - caret - right ":" fa - caret - down "}" > < / c o n v e r s e - i c o n > $ { e . n a m e }
< / a >
< ul class = "items-list roster-group-contacts ${n.includes(e.name)?" collapsed ":" "}" data - group = "${e.name}" >
2023-02-17 12:24:37 +01:00
$ { Mw ( e . contacts , ( e => e . get ( "jid" ) ) , Ik ) }
2022-05-05 23:06:17 +02:00
< / u l >
2023-02-17 12:24:37 +01:00
< / d i v > ` } , M k = e = > { c o n s t t = G y ( " C o n t a c t s " ) , n = G y ( " C l i c k t o t o g g l e c o n t a c t s " ) , s = G y ( " A d d a c o n t a c t " ) , i = G y ( " R e - s y n c y o u r c o n t a c t s " ) , r = ( n d . r o s t e r | | [ ] ) . r e d u c e ( ( ( e , t ) = > f u n c t i o n ( e , t ) { i f ( t . g e t ( " r e q u e s t i n g " ) ) { c o n s t n = n d . H E A D E R _ R E Q U E S T I N G _ C O N T A C T S ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } e l s e { l e t n ; I h . s e t t i n g s . g e t ( " r o s t e r _ g r o u p s " ) ? ( n = t . g e t ( " g r o u p s " ) , n = 0 = = = n . l e n g t h ? [ n d . H E A D E R _ U N G R O U P E D ] : n ) : n = " s u b s c r i b e " = = = t . g e t ( " a s k " ) ? [ n d . H E A D E R _ P E N D I N G _ C O N T A C T S ] : [ n d . H E A D E R _ C U R R E N T _ C O N T A C T S ] ; f o r ( c o n s t s o f n ) e [ s ] ? e [ s ] . p u s h ( t ) : e [ s ] = [ t ] } i f ( t . g e t ( " n u m _ u n r e a d " ) ) { c o n s t n = n d . H E A D E R _ U N R E A D ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } r e t u r n e } ( e , t ) ) , { } ) , o = O b j e c t . k e y s ( r ) . f i l t e r ( u x ) , a = e . m o d e l . g e t ( " t o g g l e _ s t a t e " ) = = = n d . C L O S E D ; r e t u r n o . s o r t ( F v ) , G u `
2021-11-11 22:06:49 +01:00
< div class = "d-flex controlbox-padded" >
2022-12-17 22:08:36 +01:00
< span class = "w-100 controlbox-heading controlbox-heading--contacts" >
< a class = "list-toggle open-contacts-toggle" title = "${n}" @ click = $ { e . toggleRoster } >
< converse - icon
class = "fa ${a?" fa - caret - right ":" fa - caret - down "}"
size = "1em"
color = "var(--chat-color)" > < / c o n v e r s e - i c o n >
$ { t }
< / a >
< / s p a n >
< a class = "controlbox-heading__btn sync-contacts"
@ click = $ { t => e . syncContacts ( t ) }
title = "${i}" >
2022-04-02 21:20:14 +02:00
< converse - icon class = "fa fa-sync right ${e.syncing_contacts?" fa - spin ":" "}" size = "1em" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / a >
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "allow_contact_requests" ) ? Gu `
2021-11-11 22:06:49 +01:00
< a class = "controlbox-heading__btn add-contact"
@ click = $ { t => e . showAddContactModal ( t ) }
2022-12-17 22:08:36 +01:00
title = "${s}"
2021-11-11 22:06:49 +01:00
data - toggle = "modal"
data - target = "#add-contact-modal" >
2022-04-02 21:20:14 +02:00
< converse - icon class = "fa fa-user-plus right" size = "1.25em" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2023-01-07 22:34:35 +01:00
2022-12-17 22:08:36 +01:00
< div class = "list-container roster-contacts ${a?" hidden ":" "}" >
< converse - roster - filter @ update = $ { ( ) => e . requestUpdate ( ) } > < / c o n v e r s e - r o s t e r - f i l t e r >
2023-02-17 12:24:37 +01:00
$ { Mw ( o , ( e => e ) , ( e => { const t = r [ e ] . filter ( ( t => function ( e , t ) { const n = e . presence . get ( "show" ) ; return Ih . settings . get ( "hide_offline_users" ) && "offline" === n ? ( "subscribe" === e . get ( "ask" ) || "from" === e . get ( "subscription" ) || ! 0 === e . get ( "requesting" ) ) && ! dx ( e , t ) : ! dx ( e , t ) } ( t , e ) ) ) ; return t . sort ( Pv ) , t . length ? Ok ( { contacts : t , name : e } ) : "" } ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
2023-02-17 12:24:37 +01:00
` };Ih.elements.define("converse-roster",class extends Vy{async initialize(){const e= ` converse . contacts - panel$ { nd . bare _jid } ` ;this.model=new No({id:e}),Xc(this.model,e),this.model.fetch(),await Ih.waitUntil("rosterInitialized");const{chatboxes:t,presences:n,roster:s}=nd;this.listenTo(nd,"rosterContactsFetched",(()=>this.requestUpdate())),this.listenTo(n,"change:show",(()=>this.requestUpdate())),this.listenTo(t,"change:hidden",(()=>this.requestUpdate())),this.listenTo(s,"add",(()=>this.requestUpdate())),this.listenTo(s,"destroy",(()=>this.requestUpdate())),this.listenTo(s,"remove",(()=>this.requestUpdate())),this.listenTo(s,"change",(()=>this.requestUpdate())),this.listenTo(s.state,"change",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate())),Ih.trigger("rosterViewInitialized")}render(){return Mk(this)}showAddContactModal(e){Ih.modal.show("converse-add-contact-modal",{model:new No},e)}async syncContacts(e){e.preventDefault();const{roster:t}=nd;this.syncing_contacts=!0,this.requestUpdate(),t.data.save("version",null),await t.fetchFromServer(),Ih.user.presence.send(),this.syncing_contacts=!1,this.requestUpdate()}toggleRoster(e){e?.preventDefault?.();const t=this.querySelector(".list-container.roster-contacts");this.model.get("toggle_state")===nd.CLOSED?mw(t).then((()=>this.model.save({toggle_state:nd.OPENED}))):gw(t).then((()=>this.model.save({toggle_state:nd.CLOSED})))}});const Rk={dnd:Gy("This contact is busy"),online:Gy("This contact is online"),offline:Gy("This contact is offline"),unavailable:Gy("This contact is unavailable"),xa:Gy("This contact is away for an extended period"),away:Gy("This contact is away")},Dk=(e,t)=>{const n=t.presence.get("show")||"offline";let s,i;[s,i]="online"===n?["fa fa-circle","chat-status-online"]:"dnd"===n?["fa fa-minus-circle","chat-status-busy"]:"away"===n?["fa fa-circle","chat-status-away"]:["fa fa-circle","subdued-color"];const r=Rk[n],o=t.get("num_unread")||0,a=t.getDisplayName(),c=Gy("Click to chat with %1 $ s (XMPP address: %2 $ s)",a,e.model.get("jid"));return Gu `
2023-01-07 22:34:35 +01:00
< a class = "list-item-link cbox-list-item open-chat ${o?" unread - msgs ":" "}" title = "${c}" href = "#" @ click = $ { e . openChat } >
2022-01-03 11:54:10 +01:00
< span >
< converse - avatar
class = "avatar"
2023-01-07 22:34:35 +01:00
. data = $ { e . model . vcard ? . attributes }
nonce = $ { e . model . vcard ? . get ( "vcard_updated" ) }
2022-01-03 11:54:10 +01:00
height = "30" width = "30" > < / c o n v e r s e - a v a t a r >
< converse - icon
2023-01-07 22:34:35 +01:00
title = "${r}"
color = "var(--${i})"
2022-01-03 11:54:10 +01:00
size = "1em"
2023-01-07 22:34:35 +01:00
class = "${s} chat-status chat-status--avatar" > < / c o n v e r s e - i c o n >
2022-01-03 11:54:10 +01:00
< / s p a n >
2023-02-17 12:24:37 +01:00
$ { o ? Gu ` <span class="msgs-indicator"> ${ o } </span> ` : "" }
2023-01-07 22:34:35 +01:00
< span class = "contact-name contact-name--${e.show} ${o?" unread - msgs ":" "}" > $ { a } < / s p a n >
2021-11-11 22:06:49 +01:00
< / a >
2023-02-17 12:24:37 +01:00
$ { Ih . settings . get ( "allow_contact_removal" ) ? ( ( e , t ) => { const n = t . getDisplayName ( ) , s = Gy ( "Click to remove %1$s as a contact" , n ) ; return Gu `
2022-05-05 23:06:17 +02:00
< a class = "list-item-action remove-xmpp-contact" @ click = $ { e . removeContact } title = "${s}" href = "#" >
2022-04-02 21:20:14 +02:00
< converse - icon class = "fa fa-trash-alt" size = "1.5em" > < / c o n v e r s e - i c o n >
< / a >
2023-02-17 12:24:37 +01:00
` })(e,t):""} ` } ; class zk extends Vy { static get properties ( ) { return { model : { type : Object } } } initialize ( ) { this . listenTo ( this . model , "change" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "highlight" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "vcard:add" , ( ( ) => this . requestUpdate ( ) ) ) , this . listenTo ( this . model , "vcard:change" , ( ( ) => this . requestUpdate ( ) ) ) } render ( ) { if ( ! 0 === this . model . get ( "requesting" ) ) { const e = this . model . getDisplayName ( ) ; return ( e => Gu `
2022-12-17 22:08:36 +01:00
< a class = "open-chat w-100" href = "#" @ click = $ { e . openChat } >
< span class = "req-contact-name w-100" title = "JID: ${e.jid}" > $ { e . display _name } < / s p a n >
< / a >
< a class = "accept-xmpp-request list-item-action list-item-action--visible"
2022-05-05 23:06:17 +02:00
@ click = $ { e . acceptRequest }
2022-12-17 22:08:36 +01:00
aria - label = "${e.desc_accept}" title = "${e.desc_accept}" href = "#" >
< converse - icon class = "fa fa-check" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
< a class = "decline-xmpp-request list-item-action list-item-action--visible"
2022-05-05 23:06:17 +02:00
@ click = $ { e . declineRequest }
2022-12-17 22:08:36 +01:00
aria - label = "${e.desc_decline}" title = "${e.desc_decline}" href = "#" >
< converse - icon class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
2023-02-17 12:24:37 +01:00
< / a > ` ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { d i s p l a y _ n a m e : e , o p e n C h a t : e = > t h i s . o p e n C h a t ( e ) , a c c e p t R e q u e s t : e = > t h i s . a c c e p t R e q u e s t ( e ) , d e c l i n e R e q u e s t : e = > t h i s . d e c l i n e R e q u e s t ( e ) , d e s c _ a c c e p t : G y ( " C l i c k t o a c c e p t t h e c o n t a c t r e q u e s t f r o m % 1 $ s " , e ) , d e s c _ d e c l i n e : G y ( " C l i c k t o d e c l i n e t h e c o n t a c t r e q u e s t f r o m % 1 $ s " , e ) } ) ) } r e t u r n D k ( t h i s , t h i s . m o d e l ) } o p e n C h a t ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , t h i s . m o d e l . o p e n C h a t ( ) } a s y n c r e m o v e C o n t a c t ( e ) { i f ( e ? . p r e v e n t D e f a u l t ? . ( ) , ! I h . s e t t i n g s . g e t ( " a l l o w _ c o n t a c t _ r e m o v a l " ) ) r e t u r n ; i f ( a w a i t I h . c o n f i r m ( G y ( " A r e y o u s u r e y o u w a n t t o r e m o v e t h i s c o n t a c t ? " ) ) ) t r y { t h i s . m o d e l . r e m o v e F r o m R o s t e r ( ) , t h i s . m o d e l . c o l l e c t i o n & & t h i s . m o d e l . d e s t r o y ( ) } c a t c h ( e ) { I l . e r r o r ( e ) , I h . a l e r t ( " e r r o r " , G y ( " E r r o r " ) , [ G y ( " S o r r y , t h e r e w a s a n e r r o r w h i l e t r y i n g t o r e m o v e % 1 $ s a s a c o n t a c t . " , t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ) ] ) } } a s y n c a c c e p t R e q u e s t ( e ) { e ? . p r e v e n t D e f a u l t ? . ( ) , a w a i t n d . r o s t e r . s e n d C o n t a c t A d d I Q ( t h i s . m o d e l . g e t ( " j i d " ) , t h i s . m o d e l . g e t F u l l n a m e ( ) , [ ] ) , t h i s . m o d e l . a u t h o r i z e ( ) . s u b s c r i b e ( ) } a s y n c d e c l i n e R e q u e s t ( e ) { e & & e . p r e v e n t D e f a u l t & & e . p r e v e n t D e f a u l t ( ) ; r e t u r n a w a i t I h . c o n f i r m ( G y ( " A r e y o u s u r e y o u w a n t t o d e c l i n e t h i s c o n t a c t r e q u e s t ? " ) ) & & t h i s . m o d e l . u n a u t h o r i z e ( ) . d e s t r o y ( ) , t h i s } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o s t e r - c o n t a c t " , z k ) ; c l a s s L k e x t e n d s V y { a s y n c i n i t i a l i z e ( ) { a w a i t I h . w a i t U n t i l ( " r o s t e r I n i t i a l i z e d " ) , t h i s . m o d e l = n d . r o s t e r _ f i l t e r , t h i s . l i v e F i l t e r = v h ( ( ( ) = > { t h i s . m o d e l . s a v e ( { f i l t e r _ t e x t : t h i s . q u e r y S e l e c t o r ( " . r o s t e r - f i l t e r " ) . v a l u e } ) } ) , 2 5 0 ) , t h i s . l i s t e n T o ( n d , " r o s t e r C o n t a c t s F e t c h e d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d . p r e s e n c e s , " c h a n g e : s h o w " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d . r o s t e r , " a d d " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d . r o s t e r , " d e s t r o y " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( n d . r o s t e r , " r e m o v e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , t h i s . d i s p a t c h U p d a t e E v e n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n t h i s . m o d e l ? ( e = > { c o n s t t = G y ( " F i l t e r " ) , n = G y ( " F i l t e r b y c o n t a c t n a m e " ) , s = G y ( " F i l t e r b y g r o u p n a m e " ) , i = G y ( " F i l t e r b y s t a t u s " ) , r = G y ( " A n y " ) , o = G y ( " U n r e a d " ) , a = G y ( " O n l i n e " ) , c = G y ( " C h a t t y " ) , l = G y ( " B u s y " ) , d = G y ( " A w a y " ) , u = G y ( " E x t e n d e d A w a y " ) , h = G y ( " O f f l i n e " ) ; r e t u r n G u `
2021-11-11 22:06:49 +01:00
< form class = "controlbox-padded roster-filter-form input-button-group ${e.visible?" fade - in ":" hidden "}"
@ submit = $ { e . submitFilter } >
< div class = "form-inline flex-nowrap" >
< div class = "filter-by d-flex flex-nowrap" >
2022-04-02 21:20:14 +02:00
< converse - icon size = "1em" @ click = $ { e . changeTypeFilter } class = "fa fa-user clickable ${" contacts "===e.filter_type?" selected ":" "}" data - type = "contacts" title = "${n}" > < / c o n v e r s e - i c o n >
2022-05-05 23:06:17 +02:00
< converse - icon size = "1em" @ click = $ { e . changeTypeFilter } class = "fa fa-users clickable ${" groups "===e.filter_type?" selected ":" "}" data - type = "groups" title = "${s}" > < / c o n v e r s e - i c o n >
< converse - icon size = "1em" @ click = $ { e . changeTypeFilter } class = "fa fa-circle clickable ${" state "===e.filter_type?" selected ":" "}" data - type = "state" title = "${i}" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "btn-group" >
< input . value = "${e.filter_text||" "}"
@ keydown = $ { e . liveFilter }
class = "roster-filter form-control ${" state "===e.filter_type?" hidden ":" "}"
placeholder = "${t}" / >
2022-04-02 21:20:14 +02:00
< converse - icon size = "1em" class = "fa fa-times clear-input ${e.filter_text&&" state "!==e.filter_type?" ":" hidden "}"
2021-11-11 22:06:49 +01:00
@ click = $ { e . clearFilter } >
2022-04-02 21:20:14 +02:00
< / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / d i v >
< select class = "form-control state-type ${" state "!==e.filter_type?" hidden ":" "}"
@ change = $ { e . changeChatStateFilter } >
2022-12-17 22:08:36 +01:00
< option value = "" > $ { r } < / o p t i o n >
< option ? selected = $ { "unread_messages" === e . chat _state } value = "unread_messages" > $ { o } < / o p t i o n >
2021-11-11 22:06:49 +01:00
< option ? selected = $ { "online" === e . chat _state } value = "online" > $ { a } < / o p t i o n >
< option ? selected = $ { "chat" === e . chat _state } value = "chat" > $ { c } < / o p t i o n >
< option ? selected = $ { "dnd" === e . chat _state } value = "dnd" > $ { l } < / o p t i o n >
< option ? selected = $ { "away" === e . chat _state } value = "away" > $ { d } < / o p t i o n >
< option ? selected = $ { "xa" === e . chat _state } value = "xa" > $ { u } < / o p t i o n >
< option ? selected = $ { "offline" === e . chat _state } value = "offline" > $ { h } < / o p t i o n >
< / s e l e c t >
< / d i v >
2023-02-17 12:24:37 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { v i s i b l e : t h i s . s h o u l d B e V i s i b l e ( ) , c h a n g e C h a t S t a t e F i l t e r : e = > t h i s . c h a n g e C h a t S t a t e F i l t e r ( e ) , c h a n g e T y p e F i l t e r : e = > t h i s . c h a n g e T y p e F i l t e r ( e ) , c l e a r F i l t e r : e = > t h i s . c l e a r F i l t e r ( e ) , l i v e F i l t e r : e = > t h i s . l i v e F i l t e r ( e ) , s u b m i t F i l t e r : e = > t h i s . s u b m i t F i l t e r ( e ) } ) ) : " " } d i s p a t c h U p d a t e E v e n t ( ) { t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " u p d a t e " , { d e t a i l : t h i s . m o d e l . c h a n g e d } ) ) } c h a n g e C h a t S t a t e F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { c h a t _ s t a t e : t h i s . q u e r y S e l e c t o r ( " . s t a t e - t y p e " ) . v a l u e } ) } c h a n g e T y p e F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) ; c o n s t t = u w ( e . t a r g e t , " c o n v e r s e - i c o n " ) ? . d a t a s e t . t y p e | | " c o n t a c t s " ; " s t a t e " = = = t ? t h i s . m o d e l . s a v e ( { f i l t e r _ t y p e : t , c h a t _ s t a t e : t h i s . q u e r y S e l e c t o r ( " . s t a t e - t y p e " ) . v a l u e } ) : t h i s . m o d e l . s a v e ( { f i l t e r _ t y p e : t , f i l t e r _ t e x t : t h i s . q u e r y S e l e c t o r ( " . r o s t e r - f i l t e r " ) . v a l u e } ) } s u b m i t F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . l i v e F i l t e r ( ) } i s A c t i v e ( ) { r e t u r n " s t a t e " = = = t h i s . m o d e l . g e t ( " f i l t e r _ t y p e " ) | | t h i s . m o d e l . g e t ( " f i l t e r _ t e x t " ) } s h o u l d B e V i s i b l e ( ) { r e t u r n n d . r o s t e r ? . l e n g t h > = 5 | | t h i s . i s A c t i v e ( ) } c l e a r F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { f i l t e r _ t e x t : " " } ) } } I h . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o s t e r - f i l t e r " , L k ) ; v a r P k = n ( 1 9 8 4 ) , F k = { } ; F k . s t y l e T a g T r a n s f o r m = o _ ( ) , F k . s e t A t t r i b u t e s = n _ ( ) , F k . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , F k . d o m A P I = K y ( ) , F k . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( P k . Z , F k ) ; P k . Z & & P k . Z . l o c a l s & & P k . Z . l o c a l s ; O h . p l u g i n s . a d d ( " c o n v e r s e - r o s t e r v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - r o s t e r " , " c o n v e r s e - m o d a l " , " c o n v e r s e - c h a t b o x v i e w s " ] , i n i t i a l i z e ( ) { I h . s e t t i n g s . e x t e n d ( { a u t o c o m p l e t e _ a d d _ c o n t a c t : ! 0 , a l l o w _ c o n t a c t _ r e m o v a l : ! 0 , h i d e _ o f f l i n e _ u s e r s : ! 1 , r o s t e r _ g r o u p s : ! 0 , x h r _ u s e r _ s e a r c h _ u r l : n u l l } ) , I h . p r o m i s e s . a d d ( " r o s t e r V i e w I n i t i a l i z e d " ) , n d . R o s t e r F i l t e r = k v , n d . R o s t e r F i l t e r V i e w = L k , n d . R o s t e r C o n t a c t V i e w = z k , I h . l i s t e n . o n ( " c h a t B o x e s I n i t i a l i z e d " , ( ( ) = > { n d . c h a t b o x e s . o n ( " d e s t r o y " , ( e = > l x ( e ) ) ) , n d . c h a t b o x e s . o n ( " c h a n g e : h i d d e n " , ( e = > l x ( e ) ) ) } ) ) , I h . l i s t e n . o n ( " a f t e r T e a r D o w n " , ( ( ) = > n d . r o t e r g r o u p s ? . o f f ( ) . r e s e t ( ) ) ) } } ) ; v a r U k = n ( 1 8 3 3 ) , B k = { } ; B k . s t y l e T a g T r a n s f o r m = o _ ( ) , B k . s e t A t t r i b u t e s = n _ ( ) , B k . i n s e r t = e _ ( ) . b i n d ( n u l l , " h e a d " ) , B k . d o m A P I = K y ( ) , B k . i n s e r t S t y l e E l e m e n t = i _ ( ) ; Q y ( ) ( U k . Z , B k ) ; U k . Z & & U k . Z . l o c a l s & & U k . Z . l o c a l s ; O h . p l u g i n s . a d d ( " c o n v e r s e - s i n g l e t o n " , { e n a b l e d : e = > e . a p i . s e t t i n g s . g e t ( " s i n g l e t o n " ) , i n i t i a l i z e ( ) { I h . s e t t i n g s . e x t e n d ( { a l l o w _ l o g o u t : ! 1 , a l l o w _ m u c _ i n v i t a t i o n s : ! 1 , h i d e _ m u c _ s e r v e r : ! 0 } ) ; c o n s t e = I h . s e t t i n g s . g e t ( " a u t o _ j o i n _ r o o m s " ) , t = I h . s e t t i n g s . g e t ( " a u t o _ j o i n _ p r i v a t e _ c h a t s " ) ; i f ( ! A r r a y . i s A r r a y ( e ) & & ! A r r a y . i s A r r a y ( t ) ) t h r o w n e w E r r o r ( " c o n v e r s e - s i n g l e t o n : a u t o _ j o i n _ r o o m s m u s t b e a n A r r a y " ) ; i f ( 0 = = = e . l e n g t h & & 0 = = = t . l e n g t h ) t h r o w n e w E r r o r ( " I f y o u s e t s i n g l e t o n s e t t o t r u e , y o u n e e d t o s p e c i f y a u t o _ j o i n _ r o o m s o r a u t o _ j o i n _ p r i v a t e _ c h a t s " ) ; i f ( e . l e n g t h > 0 & & t . l e n g t h > 0 ) t h r o w n e w E r r o r ( " I t d o e s n ' t m a k e s e n s e t o h a v e s i n g l e t o n s e t t o t r u e a n d a u t o _ j o i n _ r o o m s o r a u t o _ j o i n _ p r i v a t e _ c h a t s s e t t o m o r e t h e n o n e , s i n c e o n l y o n e c h a t r o o m m a y b e o p e n a t a n y t i m e . " ) } } ) ; c o n s t { u : q k } = O h . e n v ; f u n c t i o n H k ( e ) { l e t t = ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ) | | a r g u m e n t s [ 1 ] ; i f ( ! I h . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) ; c o n s t n = q k . a n c e s t o r ( e . t a r g e t , " . b o x - f l y o u t " ) , s = w i n d o w . g e t C o m p u t e d S t y l e ( n ) , i = n . p a r e n t E l e m e n t ; i . h e i g h t = p a r s e I n t ( s . h e i g h t . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , n d . r e s i z i n g = { c h a t b o x : i , d i r e c t i o n : " t o p " } , i . p r e v _ p a g e Y = e . p a g e Y , t & & I h . t r i g g e r ( " s t a r t V e r t i c a l R e s i z e " , i ) } f u n c t i o n G k ( e ) { l e t t = ! ( a r g u m e n t s . l e n g t h > 1 & & v o i d 0 ! = = a r g u m e n t s [ 1 ] ) | | a r g u m e n t s [ 1 ] ; i f ( ! I h . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) ; c o n s t n = q k . a n c e s t o r ( e . t a r g e t , " . b o x - f l y o u t " ) , s = w i n d o w . g e t C o m p u t e d S t y l e ( n ) , i = n . p a r e n t E l e m e n t ; i . w i d t h = p a r s e I n t ( s . w i d t h . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , n d . r e s i z i n g = { c h a t b o x : i , d i r e c t i o n : " l e f t " } , i . p r e v _ p a g e X = e . p a g e X , t & & I h . t r i g g e r ( " s t a r t H o r i z o n t a l R e s i z e " , i ) } f u n c t i o n W k ( e ) { G k ( e , ! 1 ) , H k ( e , ! 1 ) , n d . r e s i z i n g . d i r e c t i o n = " t o p l e f t " , I h . t r i g g e r ( " s t a r t D i a g o n a l R e s i z e " , t h i s ) } f u n c t i o n V k ( e , t ) { i f ( v o i d 0 = = = e ) r e t u r n ; i f ( v o i d 0 = = = t ) r e t u r n e ; r e t u r n e ! = = t & & M a t h . a b s ( e - t ) < 1 0 ? t : e } f u n c t i o n J k ( e ) { i f ( ! n d . r e s i z i n g | | ! I h . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) , n d . r e s i z i n g . c h a t b o x . r e s i z e C h a t B o x ( e ) } f u n c t i o n Z k ( e ) { i f ( ! n d . r e s i z i n g | | ! I h . s e t t i n g s . g e t ( " a l l o w _ d r a g r e s i z e " ) ) r e t u r n ! 0 ; e . p r e v e n t D e f a u l t ( ) ; c o n s t t = V k ( n d . r e s i z i n g . c h a t b o x . h e i g h t , n d . r e s i z i n g . c h a t b o x .
< div class = "dragresize dragresize-top" @ mousedown = "${Hk}" > < / d i v >
< div class = "dragresize dragresize-topleft" @ mousedown = "${Wk}" > < / d i v >
< div class = "dragresize dragresize-left" @ mousedown = "${Gk}" > < / d i v >
` ;Ih.elements.define("converse-dragresize",class extends Vy{render(){return Qk()}});const Yk={initDragResize(){const e=this,t=vh((()=>e.setDimensions()));window.addEventListener("resize",e.debouncedSetDimensions),this.listenTo(this.model,"destroy",(()=>window.removeEventListener("resize",t)));const n=this.querySelector(".box-flyout"),s=window.getComputedStyle(n);if(void 0===this.model.get("height")){const e=parseInt(s.height.replace(/px $ /,""),10),t=parseInt(s.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 i=s["min-width"],r=s["min-height"];return this.model.set("min_width",i.endsWith("px")?Number(i.replace(/px $ /,"")):0),this.model.set("min_height",r.endsWith("px")?Number(r.replace(/px $ /,"")):0),this.prev_pageY=0,this.prev_pageX=0,nd.connection?.connected&&(this.height=this.model.get("height"),this.width=this.model.get("width")),this},resizeChatBox(e){let t;0===nd.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))),nd.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?Vk(e,this.model.get("default_height"))+"px":"";const t=this.querySelector(".box-flyout");null!==t&&(t.style.height=e)},setChatBoxWidth(e){e=e?Vk(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)}};Oh.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"),s="controlbox"===this.get("id")?e=>this.set(e):e=>this.save(e);return s({height:Vk(t,this.get("default_height")),width:Vk(n,this.get("default_width"))}),e}}},initialize(){Ih.settings.extend({allow_dragresize:!0}),Object.assign(nd.ChatBoxView.prototype,Yk),Object.assign(nd.ChatRoomView.prototype,Yk),nd.ControlBoxView&&Object.assign(nd.ControlBoxView.prototype,Yk),Ih.listen.on("registeredGlobalEventHandlers",(function(){document.addEventListener("mousemove",Jk),document.addEventListener("mouseup",Zk)})),Ih.listen.on("unregisteredGlobalEventHandlers",(function(){document.removeEventListener("mousemove",Jk),document.removeEventListener("mouseup",Zk)})),Ih.listen.on("beforeShowingChatView",(e=>e.initDragResize().setDimensions()))}});var Kk=n(2791),Xk={};Xk.styleTagTransform=o_(),Xk.setAttributes=n_(),Xk.insert=e_().bind(null,"head"),Xk.domAPI=Ky(),Xk.insertStyleElement=i_();Qy()(Kk.Z,Xk);Kk.Z&&Kk.Z.locals&&Kk.Z.locals;Oh.plugins.add("converse-fullscreen",{enabled:()=>gl(),initialize(){Ih.settings.extend({chatview_avatar_height:50,chatview_avatar_width:50,hide_open_bookmarks:!0,show_controlbox_by_default:!0,sticky_controlbox:!0})}}),nd.CustomElement=Vy;const ej=Oh.initialize;Oh.initialize=function(e,t){return Array.isArray(e.whitelisted_plugins)?e.whitelisted_plugins=e.whitelisted_plugins.concat(Jy):e.whitelisted_plugins=Jy,ej(e,t)};const tj=Oh},5251:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var s=n(4216),i=n.n(s),r=n(7705),o=n.n(r)()(i());o.push([e.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const a=o},69
2021-01-29 23:34:36 +01:00
//# sourceMappingURL=converse.min.js.map