2021-11-11 22:06:49 +01:00
/*! For license information please see converse.min.js.LICENSE.txt */
2021-11-12 22:09:04 +01:00
( ( ) => { var e , t , n , s , i = { 9494 : ( e , t , n ) => { "use strict" ; const s = n ( 7672 ) , i = n ( 4817 ) ; e . exports = { atob : s , btoa : i } } , 7672 : e => { "use strict" ; function t ( e ) { const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" . indexOf ( e ) ; return t < 0 ? void 0 : t } e . exports = function ( e ) { if ( ( e = ( e = ` ${ e } ` ) . replace ( /[ \t\n\f\r]/g , "" ) ) . length % 4 == 0 && ( e = e . replace ( /==?$/ , "" ) ) , e . length % 4 == 1 || /[^+/0-9A-Za-z]/ . test ( e ) ) return null ; let n = "" , s = 0 , i = 0 ; for ( let r = 0 ; r < e . length ; r ++ ) s <<= 6 , s |= t ( e [ r ] ) , i += 6 , 24 === i && ( n += String . fromCharCode ( ( 16711680 & s ) >> 16 ) , n += String . fromCharCode ( ( 65280 & s ) >> 8 ) , n += String . fromCharCode ( 255 & s ) , s = i = 0 ) ; return 12 === i ? ( s >>= 4 , n += String . fromCharCode ( s ) ) : 18 === i && ( s >>= 2 , n += String . fromCharCode ( ( 65280 & s ) >> 8 ) , n += String . fromCharCode ( 255 & s ) ) , n } } , 4817 : e => { "use strict" ; function t ( e ) { if ( e >= 0 && e < 64 ) return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [ e ] } e . exports = function ( e ) { let n ; for ( e = ` ${ e } ` , n = 0 ; n < e . length ; n ++ ) if ( e . charCodeAt ( n ) > 255 ) return null ; let s = "" ; for ( n = 0 ; n < e . length ; n += 3 ) { const i = [ void 0 , void 0 , void 0 , void 0 ] ; i [ 0 ] = e . charCodeAt ( n ) >> 2 , i [ 1 ] = ( 3 & e . charCodeAt ( n ) ) << 4 , e . length > n + 1 && ( i [ 1 ] |= e . charCodeAt ( n + 1 ) >> 4 , i [ 2 ] = ( 15 & e . charCodeAt ( n + 1 ) ) << 2 ) , e . length > n + 2 && ( i [ 2 ] |= e . charCodeAt ( n + 2 ) >> 6 , i [ 3 ] = 63 & e . charCodeAt ( n + 2 ) ) ; for ( let e = 0 ; e < i . length ; e ++ ) void 0 === i [ e ] ? s += "=" : s += t ( i [ e ] ) } return s } } , 4457 : ( e , t , n ) => { var s ; ! function ( ) { "use strict" ; var i = { not _string : /[^s]/ , not _bool : /[^t]/ , not _type : /[^T]/ , not _primitive : /[^v]/ , number : /[diefg]/ , numeric _arg : /[bcdiefguxX]/ , json : /[j]/ , not _json : /[^j]/ , text : /^[^\x25]+/ , modulo : /^\x25{2}/ , placeholder : /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/ , key : /^([a-z_][a-z_\d]*)/i , key _access : /^\.([a-z_][a-z_\d]*)/i , index _access : /^\[(\d+)\]/ , sign : /^[+-]/ } ; function r ( e ) { return a ( l ( e ) , arguments ) } function o ( e , t ) { return r . apply ( null , [ e ] . concat ( t || [ ] ) ) } function a ( e , t ) { var n , s , o , a , c , l , d , u , h , m = 1 , f = e . length , g = "" ; for ( s = 0 ; s < f ; s ++ ) if ( "string" == typeof e [ s ] ) g += e [ s ] ; else if ( "object" == typeof e [ s ] ) { if ( ( a = e [ s ] ) . keys ) for ( n = t [ m ] , o = 0 ; o < a . keys . length ; o ++ ) { if ( null == n ) throw new Error ( r ( '[sprintf] Cannot access property "%s" of undefined value "%s"' , a . keys [ o ] , a . keys [ o - 1 ] ) ) ; n = n [ a . keys [ o ] ] } else n = a . param _no ? t [ a . param _no ] : t [ m ++ ] ; if ( i . not _type . test ( a . type ) && i . not _primitive . test ( a . type ) && n instanceof Function && ( n = n ( ) ) , i . numeric _arg . test ( a . type ) && "number" != typeof n && isNaN ( n ) ) throw new TypeError ( r ( "[sprintf] expecting number but found %T" , n ) ) ; switch ( i . number . test ( a . type ) && ( u = n >= 0 ) , a . type ) { case "b" : n = parseInt ( n , 10 ) . toString ( 2 ) ; break ; case "c" : n = String . fromCharCode ( parseInt ( n , 10 ) ) ; break ; case "d" : case "i" : n = parseInt ( n , 10 ) ; break ; case "j" : n = JSON . stringify ( n , null , a . width ? parseInt ( a . width ) : 0 ) ; break ; case "e" : n = a . precision ? parseFloat ( n ) . toExponential ( a . precision ) : parseFloat ( n ) . toExponential ( ) ; break ; case "f" : n = a . precision ? parseFloat ( n ) . toFixed ( a . precision ) : parseFloat ( n ) ; break ; case "g" : n = a . precision ? String ( Number ( n . toPrecision ( a . precision ) ) ) : parseFloat ( n ) ; break ; case "o" : n = ( parseInt ( n , 10 ) >>> 0 ) . toString ( 8 ) ; break ; case "s" : n = String ( n ) , n = a . precision ? n . substring ( 0 , a . precision ) : n ; break ; case "t" : n = String ( ! ! n ) , n = a . precision ? n . substring ( 0 , a . precision ) : n ; break ; case "T" : n = Object . prototype . toString . call ( n ) . slice ( 8 , - 1 ) . toLowerCase ( ) , n = a . precision ? n . substring ( 0 , a . precision ) : n ; break ; case "u" : n = parseInt ( n , 10 ) >>> 0 ; break ; case "v" : n = n . valueOf ( ) , n = a . precision ? n . substring ( 0 , a . precision ) : n ; break ; case "x" : n = ( parseInt ( n , 10 ) >>> 0 ) . toString ( 16 ) ; break ; case "X" : n = ( parseInt ( n , 10 ) >>> 0 ) . toString ( 16 ) . toUpperCase ( ) } i . json . test ( a . type ) ? g += n : ( ! i . number . test ( a . type ) || u && ! a . sign ? h = "" : ( h = u ? "+" : "-" , n = n . toString ( ) . replace ( i . sign , "" ) ) , l = a . pad _char ? "0" === a . pad _char ? "0" : a . pad _char . charAt ( 1 ) : " " , d = a . width - ( h + n ) . length , c = a . width && d > 0 ? l . repeat ( d ) : "" , g += a . align ? h + n + c : "0" === l ? h + c + n : c + h + n ) } return g } var c = Object . create ( null ) ; function l ( e ) { if ( c [ e ] ) return c [ e ] ; for ( var t , n = e , s = [ ] , r = 0 ; n ; ) { if ( null !== ( t = i . text . exec ( n ) ) ) s . push ( t [ 0 ] ) ; else if ( null !== ( t = i . modulo . exec ( n ) ) ) s . push ( "%" ) ; else { if ( null === ( t = i . placeholder . exec ( n ) ) ) throw new SyntaxError ( "[sprintf] unexpected placeholder" ) ; if ( t [ 2 ] ) { r |= 1 ; var o = [ ] , a = t [ 2 ] , l = [ ] ; if ( null === ( l = i . key . exec ( a ) ) ) throw new SyntaxError ( " [ sprintf ] failed to parse named argument
2021-03-19 19:26:15 +01:00
draggable = "false"
2021-11-11 22:06:49 +01:00
title = "${s}"
2021-03-19 19:26:15 +01:00
alt = "${n}"
2021-11-11 22:06:49 +01:00
src = "${t}/72x72/${e.cp}.png" / > ` }}return t.unicode_only?s:Qc ` < img class = "emoji"
2021-03-19 19:26:15 +01:00
draggable = "false"
2021-11-11 22:06:49 +01:00
title = "${s}"
alt = "${s}"
2021-11-12 22:09:04 +01:00
src = "${jl.emojis.by_sn[s].url}" > ` }function au(e){if(!jl.emojis.initialized)throw new Error("getShortnameReferences called before emojis are initialized. To avoid this problem, first await the converse.emojis.initilaized_promise.");return[...e.matchAll(jl.emojis.shortnames_regex)].filter((e=>e[0].length>0)).map((e=>{const t=jl.emojis.by_sn[e[0]].cp;return{cp:t,begin:e.index,end:e.index+e[0].length,shortname:e[0],emoji:t?iu(t):null}}))}function cu(e){const t=[];return function(e,n){const s=/ \u FE0F/g,i=String.fromCharCode(8205);String(e).replace(tu,((e,n,r)=>{const o=function(e){const t=[];let n=0,s=0;for(;s<e.length;){const i=e.charCodeAt(s++);n?(t.push((65536+(n-55296<<10)+(i-56320)).toString(16)),n=0):55296<=i&&i<=56319?n=i:t.push(i.toString(16))}return t.join("-")}(e.indexOf(i)<0?e.replace(s,""):e);o&&((e,n,s)=>{var i;t.push({begin:s,cp:e,emoji:n,end:s+n.length,shortname:(null===(i=nu.getEmojisByAtrribute("cp")[e])||void 0===i?void 0:i.sn)||""})})(o,e,r)}))}(e),t}jl.plugins.add("converse-emoji",{initialize(){const{___:e}=va;Cl.settings.extend({emoji_image_path:"https://twemoji.maxcdn.com/v/12.1.6/",emoji_categories:{smileys:":grinning:",people:":thumbsup:",activity:":soccer:",travel:":motorcycle:",objects:":bomb:",nature:":rainbow:",food:":hotdog:",symbols:":musical_note:",flags:":flag_ac:",custom:null},emoji_category_labels:{smileys:e("Smileys and emotions"),people:e("People"),activity:e("Activities"),travel:e("Travel"),objects:e("Objects"),nature:e("Animals and nature"),food:e("Food and drink"),symbols:e("Symbols"),flags:e("Flags"),custom:e("Stickers")}}),va.EmojiPicker=Zo.extend({defaults:{current_category:"smileys",current_skintone:"",scroll_position:0}});const t={};Object.assign(nu,{shortnamesToEmojis:(e,t={unicode_only:!1,add_title_wrapper:!1})=>function(e,t){let n=[e];return[...au(e),...cu(e)].sort(((e,t)=>t.begin-e.begin)).forEach((e=>{const s=n.shift(),i=ou(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=ru(e),t),shortnamesToUnicode:e=>nu.shortnamesToEmojis(e,{unicode_only:!0})[0],isOnlyEmojis(e){const t=e.trim().split(/ \s +/);return!(0===t.length||t.length>3)&&t.filter((e=>{const t=cu(nu.shortnamesToUnicode(e));return 1===t.length&&(e===t[0].shortname||e===t[0].emoji)})).length===t.length},getEmojisByAtrribute(e){if(t[e])return t[e];if("category"===e)return jl.emojis.json;const n=jl.emojis.list.map((t=>t[e])).filter(((e,t,n)=>n.indexOf(e)==t));return t[e]={},n.forEach((n=>t[e][n]=jl.emojis.list.find((t=>t[e]===n)))),t[e]}}),Object.assign(Cl,{emojis:{async initialize(){if(!jl.emojis.initialized){jl.emojis.initialized=!0;const{default:t}=await n.e(4610).then(n.t.bind(n,7530,19));jl.emojis.json=t,jl.emojis.by_sn=Object.keys(t).reduce(((e,n)=>Object.assign(e,t[n])),{}),jl.emojis.list=Object.values(jl.emojis.by_sn),jl.emojis.list.sort(((e,t)=>e.sn<t.sn?-1:e.sn>t.sn?1:0)),jl.emojis.shortnames=jl.emojis.list.map((e=>e.sn));const s=()=>jl.emojis.shortnames.map((e=>e.replace(/[+]/g," \\ $ &"))).join("|");jl.emojis.shortnames_regex=new RegExp(s(),"gi"),jl.emojis.toned=(jl.emojis.toned||(jl.emojis.toned=(e=Object.values(jl.emojis.json.people).filter((e=>e.sn.includes("_tone"))).map((e=>e.sn.replace(/_tone[1-5]/,""))),[...new Set(e)])),jl.emojis.toned),jl.emojis.initialized_promise.resolve()}var e;return jl.emojis.initialized_promise}}})}});const lu={initialize(){this.checkValidity()&&(this.get("file")&&this.on("change:put",this.uploadFile,this),this.setTimerForEphemeralMessage()||this.setOccupant(),Cl.trigger("chatRoomMessageInitialized",this))},mayBeModerated(){return["all","moderator"].includes(Cl.settings.get("allow_message_retraction"))&&this.collection.chatbox.canModerateMessages()},checkValidity(){const e=va.Message.prototype.checkValidity.call(this);return!e&&this.collection.chatbox.debouncedRejoin(),e},onOccupantRemoved(){var e;this.stopListening(this.occupant),delete this.occupant;const t=null==this||null===(e=this.collection)||void 0===e?void 0:e.chatbox;if(!t)return M.error( ` Could not get collection . chatbox for message : $ { JSON . str
2021-03-19 19:26:15 +01:00
< form class = "converse-form chatroom-form" @ submit = $ { e . onSubmit } >
< legend > $ { t } < / l e g e n d >
< fieldset class = "form-group" >
< label for = "converse_muc_bookmark_name" > $ { i } < / l a b e l >
< input class = "form-control" type = "text" value = "${e.name}" name = "name" required = "required" id = "converse_muc_bookmark_name" / >
< / f i e l d s e t >
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label for = "converse_muc_bookmark_nick" > $ { r } < / l a b e l >
2021-03-19 19:26:15 +01:00
< input class = "form-control" type = "text" name = "nick" value = "${e.nick||" "}" id = "converse_muc_bookmark_nick" / >
< / 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" / >
< label class = "form-check-label" for = "converse_muc_bookmark_autojoin" > $ { n } < / l a b e l >
< / f i e l d s e t >
< fieldset class = "form-group" >
< input class = "btn btn-primary" type = "submit" value = "${o}" >
2021-11-11 22:06:49 +01:00
< input class = "btn btn-secondary button-cancel" type = "button" value = "${s}" @ click = $ { e . onCancel } >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< / f o r m >
2021-11-11 22:06:49 +01:00
` })(Object.assign(this.model.toJSON(),{onCancel:e=>this.closeBookmarkForm(e),onSubmit:e=>this.onBookmarkFormSubmitted(e)}))}onBookmarkFormSubmitted(e){var t,n,s;e.preventDefault(),va.bookmarks.createBookmark({jid:this.model.get("jid"),autojoin:(null===(t=e.target.querySelector('input[name="autojoin"]'))||void 0===t?void 0:t.checked)||!1,name:null===(n=e.target.querySelector("input[name=name]"))||void 0===n?void 0:n.value,nick:null===(s=e.target.querySelector("input[name=nick]"))||void 0===s?void 0:s.value}),this.closeBookmarkForm(e)}closeBookmarkForm(e){e.preventDefault(),this.model.session.save("view",null)}}Cl.elements.define("converse-muc-bookmark-form",sg);const ig=sg,rg=Je((function(e,t,n){var s=-1,i="function"==typeof t,r=Ye(e)?Array(e.length):[];return ls(e,(function(e){r[++s]=i?ze(t,e,n):Sa(e,t,n)})),r}));function og(e,t){if(va.allow_bookmarks&&e.model.get("type")===va.CHATROOMS_TYPE){const n=e.model.get("bookmarked"),s={i18n_title:vh(n?"Unbookmark this groupchat":"Bookmark this groupchat"),i18n_text:vh(n?"Unbookmark":"Bookmark"),handler:t=>e.toggleBookmark(t),a_class:"toggle-bookmark",icon_class:"fa-bookmark",name:"bookmark"},i=t.map((e=>e.name)).indexOf("details"),r=xh().then((e=>e?s:""));return i>-1?[...t.slice(0,i),r,...t.slice(i)]:[r,...t]}return t}function ag(e){e.preventDefault();const t=e.target.getAttribute("data-bookmark-name"),n=e.target.getAttribute("data-room-jid");confirm(vh('Are you sure you want to remove the bookmark "%1 $ s"?',t))&&rg(va.bookmarks.where({jid:n}),Zo.prototype.destroy)}async function cg(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid");(await Cl.rooms.open(t,{bring_to_foreground:!0})).session.save("view",jl.MUC.VIEWS.BOOKMARK)}function lg(e){e.preventDefault();const{Strophe:t}=jl.env,n=e.target.textContent,s=e.target.getAttribute("data-room-jid"),i={name:n||t.unescapeNode(t.getNodeFromJid(s))||s};Cl.rooms.open(s,i,!0)}const dg=e=>{const t=e.bm.get("jid"),n=!(!Cl.settings.get("hide_open_bookmarks")||!va.chatboxes.get(t)),s=vh("Unbookmark this groupchat"),i=vh("Click to open this groupchat");return Qc `
< div class = "list-item controlbox-padded room-item available-chatroom d-flex flex-row ${n?" hidden ":" "}" data - room - jid = "${t}" >
< a class = "list-item-link open-room w-100" data - room - jid = "${t}"
title = "${i}"
@ click = $ { lg } > $ { e . bm . getDisplayName ( ) } < / a >
< a class = "list-item-action remove-bookmark fa fa-bookmark align-self-center ${e.bm.get(" bookmarked ")?" button - on ":" "}"
data - room - jid = "${t}"
data - bookmark - name = "${e.bm.getDisplayName()}"
title = "${s}"
@ click = $ { ag } > < / a >
< / d i v >
` };"undefined"!=typeof Element&&Element.prototype;const ug=/^( \S +) \s *(.*) $ /,hg=["model","collection","events"];class mg extends HTMLElement{constructor(e){var t,n,s;super(),s={},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,this.cid=Ts("view"),this._domEvents=[],Ct(this,ko(e,hg))}createRenderRoot(){return this}connectedCallback(){this._initialized||(this.preinitialize.apply(this,arguments),this.initialize.apply(this,arguments),this._initialized=!0),this.delegateEvents()}disconnectedCallback(){this.undelegateEvents(),this.stopListening()}preinitialize(){}initialize(){}render(){return ve(this.beforeRender)&&this.beforeRender(),ve(this.toHTML)&&tl(this.toHTML(),this),ve(this.afterRender)&&this.afterRender(),this}delegateEvents(){if(!this.events)return this;this.undelegateEvents();for(const e in this.events){let t=this.events[e];if(ve(t)||(t=this[t]),!t)continue;const n=e.match(ug);this.delegate(n[1],n[2],t.bind(this))}return this}delegate(e,t,n){const s=this;if(!s)return this;if("function"==typeof t&&(n=t,t=null),-1!==["focus","blur"].indexOf(e)){const s=this.querySelectorAll(t);for(let t=0,i=s.length;t<i;t++){const i=s[t];i.addEventListener(e,n,!1),this._domEvents.push({el:i,eventName:e,handler:n})}return n}const i=t?function(e){let i=e.target||e.srcElement;for(;i&&i!=s;i=i.parentNode)i.matches(t)&&(e.delegateTarget=i,n(e))}:n;return this.addEventListener(e,i,!1),this._domEvents.push({el:this,eventName:e,handler:i,listener:n,selector:t}),this}undelegateEvents(){if(this){for(let e=0,t=this._domEvents.length;e<t;e++){const t=this._domEvents[e];t.el.removeEventListener(t.eventName,t.handler,!1)}this._domEvents.length=0}return this}undelegate(e,t,n){if("function"==typeof t&&(n=t,t=null),this){const s=this._domEvents.slice();let i=s.length;for(;i--;){const r=s[i];!(r.eventName!==e||n&&r.listener!==n||t&&r.selector!==t)&&(r.el.removeEventListener(r.eventName,r.handler,!1),this._domEvents.splice(i,1))}}return this}}Object.assign(mg.prototype,ks);const fg=jl.env.utils;class gg extends mg{async initialize(){await Cl.waitUntil("bookmarksInitialized"),this.listenTo(va.bookmarks,"add",this.render),this.listenTo(va.bookmarks,"remove",this.render),this.listenTo(va.chatboxes,"add",this.render),this.listenTo(va.chatboxes,"remove",this.render);const e= ` converse . bookmarks - list - model - $ { va . bare _jid } ` ;this.model=new va.BookmarksList({id:e}),_o(this.model,e),this.model.fetch({success:()=>this.render(),error:(e,t)=>{M.error(t),this.render()}})}render(){tl((e=>{const t=!!va.bookmarks.getUnopenedBookmarks().length,n=vh("Click to toggle the bookmarks list"),s=vh("Bookmarks");return Qc `
< div class = "list-container list-container--bookmarks ${t?" ":" hidden "}" >
< a class = "list-toggle bookmarks-toggle controlbox-padded"
title = "${n}"
@ click = $ { e . toggleBookmarksList } >
< span class = "fa ${e.toggle_state===va.OPENED?" fa - caret - down ":" fa - caret - right "}" >
< / s p a n > $ { s } < / a >
< div class = "items-list bookmarks rooms-list ${e.toggle_state!==va.OPENED?" hidden ":" "}" >
$ { va . bookmarks . map ( ( t => dg ( Object . assign ( { bm : t } , e ) ) ) ) }
< / d i v >
< / d i v >
` })({toggleBookmarksList:e=>this.toggleBookmarksList(e),toggle_state:this.model.get("toggle-state")}),this)}toggleBookmarksList(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=e.target.matches(".fa")?e.target:e.target.querySelector(".fa");fg.hasClass("fa-caret-down",n)?(fg.slideIn(this.querySelector(".bookmarks")),this.model.save({"toggle-state":va.CLOSED}),n.classList.remove("fa-caret-down"),n.classList.add("fa-caret-right")):(n.classList.remove("fa-caret-right"),n.classList.add("fa-caret-down"),fg.slideOut(this.querySelector(".bookmarks")),this.model.save({"toggle-state":va.OPENED}))}}Cl.elements.define("converse-bookmarks",gg);const{u:pg}=jl.env,vg={setBookmarkState(){void 0!==va.bookmarks&&(va.bookmarks.where({jid:this.model.get("jid")}).length?this.model.save("bookmarked",!0):this.model.save("bookmarked",!1))},renderBookmarkForm(){this.bookmark_form||(this.bookmark_form=new va.MUCBookmarkForm({model:this.model,chatroomview:this}),this.querySelector(".chatroom-body").insertAdjacentElement("beforeend",this.bookmark_form.el)),pg.showElement(this.bookmark_form.el)},toggleBookmark(e){null==e||e.preventDefault();const t=va.bookmarks.where({jid:this.model.get("jid")});t.length?t.forEach((e=>e.destroy())):this.model.session.set("view",jl.MUC.VIEWS.BOOKMARK)}};var bg=n(3742),yg={};yg.styleTagTransform=eg(),yg.setAttributes=Yf(),yg.insert=Jf().bind(null,"head"),yg.domAPI=Wf(),yg.insertStyleElement=Xf(),Hf()(bg.Z,yg),bg.Z&&bg.Z.locals&&bg.Z.locals,jl.plugins.add("converse-bookmark-views",{dependencies:["converse-chatboxes","converse-muc","converse-muc-views"],initialize(){Cl.settings.extend({hide_open_bookmarks:!0}),va.removeBookmarkViaEvent=ag,va.addBookmarkViaEvent=cg,Object.assign(va.ChatRoomView.prototype,vg),va.MUCBookmarkForm=ig,va.BookmarksView=gg,Cl.listen.on("getHeadingButtons",og),Cl.listen.on("chatRoomViewInitialized",(e=>e.setBookmarkState()))}});const _g=e=>(...t)=>({_ $ litDirective $ :e,values:t});class wg{constructor(e){}T(e,t,n){this.Σdt=e,this.M=t,this.Σct=n}S(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const{et:Sg}=ml,xg=()=>document.createComment(""),Eg=(e,t,n)=>{var s;const i=e.A.parentNode,r=void 0===t?e.B:t.A;if(void 0===n){const t=i.insertBefore(xg(),r),s=i.insertBefore(xg(),r);n=new Sg(t,s,e,e.options)}else{const t=n.B.nextSibling,o=n.M!==e;if(o&&(null===(s=n.Q)||void 0===s||s.call(n,e),n.M=e),t!==r||o){let e=n.A;for(;e!==t;){const t=e.nextSibling;i.insertBefore(e,r),e=t}}}return n},Ag=(e,t,n=e)=>(e.I(t,n),e),Cg={},Tg=e=>{var t;null===(t=e.P)||void 0===t||t.call(e,!1,!0);let n=e.A;const s=e.B.nextSibling;for(;n!==s;){const e=n.nextSibling;n.remove(),n=e}},kg=(e,t,n)=>{const s=new Map;for(let i=t;i<=n;i++)s.set(e[i],i);return s},jg=_g(class extends wg{constructor(e){if(super(e),2!==e.type)throw Error("repeat() can only be used in text expressions")}Mt(e,t,n){let s;void 0===n?n=t:void 0!==t&&(s=t);const i=[],r=[];let o=0;for(const t of e)i[o]=s?s(t,o):o,r[o]=n(t,o),o++;return{values:r,keys:i}}render(e,t,n){return this.Mt(e,t,n).values}update(e,[t,n,s]){var i;const r=(e=>e.H)(e),{values:o,keys:a}=this.Mt(t,n,s);if(!r)return this.Pt=a,o;const c=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[],l=[];let d,u,h=0,m=r.length-1,f=0,g=o.length-1;for(;h<=m&&f<=g;)if(null===r[h])h++;else if(null===r[m])m--;else if(c[h]===a[f])l[f]=Ag(r[h],o[f]),h++,f++;else if(c[m]===a[g])l[g]=Ag(r[m],o[g]),m--,g--;else if(c[h]===a[g])l[g]=Ag(r[h],o[g]),Eg(e,l[g+1],r[h]),h++,g--;else if(c[m]===a[f])l[f]=Ag(r[m],o[f]),Eg(e,r[h],r[m]),m--,f++;else if(void 0===d&&(d=kg(a,f,g),u=kg(c,h,m)),d.has(c[h]))if(d.has(c[m])){const t=u.get(a[f]),n=void 0!==t?r[t]:null;if(null===n){const t=Eg(e,r[h]);Ag(t,o[f]),l[f]=t}else l[f]=Ag(n,o[f]),Eg(e,r[h],n),r[t]=null;f++}else Tg(r[m]),m--;else Tg(r[h]),h++;for(;f<=g;){const t=Eg(e,l[g+1]);Ag(t,o[f]),l[f++]=t}for(;h<=m;){const e=r[h++];null!==e&&Tg(e)}return this.Pt=a,((e,t=Cg)=>{e.H=t})(e,l),Xc}});function Ng(e){const{CONTROLBOX_TYPE:t}=va,n="overlayed"===Cl.settings.get("view_mode")&&e.get("minimized");return e.get("type")===t||!(e.get("hidden")||n)}C
< 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 >
$ { "overlayed" === Cl . settings . get ( "view_mode" ) ? Qc ` <div class="converse-brand__padding"></div> ` : "" }
< / d i v > ` , 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 " ) . c l a s s L i s t . a d d ( ` c o n v e r s e - $ { C l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) } ` ) , t h i s . r e n d e r ( ) , C l . 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 ( ) { t l ( ( ( ) = > { 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 } = v a , i = C l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) , r = n u l l = = v a ? v o i d 0 : v a . c o n n e c t i o n , o = ! ( n u l l ! = r & & r . c o n n e c t e d ) | | ! ( n u l l ! = r & & r . a u t h e n t i c a t e d ) | | ( n u l l = = r ? v o i d 0 : r . d i s c o n n e c t i n g ) ; r e t u r n Q c `
$ { o || "overlayed" !== i ? "" : Qc ` <converse-minimized-chats></converse-minimized-chats> ` }
$ { jg ( e . filter ( Ng ) , ( e => e . get ( "jid" ) ) , ( e => e . get ( "type" ) === t ? Qc `
$ { "overlayed" === i ? Qc ` <converse-controlbox-toggle class=" ${ e . get ( "closed" ) ? "" : "hidden" } "></converse-controlbox-toggle> ` : "" }
< converse - controlbox
id = "controlbox"
class = "chatbox ${e.get(" closed ")?" hidden ":" "} ${o?" logged - out ":" "}"
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 >
` :e.get("type")===n?Qc `
< converse - muc jid = "${e.get(" jid ")}" class = "chatbox chatroom" > < / c o n v e r s e - m u c >
` :e.get("type")===s?Qc `
< 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 >
` :Qc `
< converse - chat jid = "${e.get(" jid ")}" class = "chatbox" > < / c o n v e r s e - c h a t >
` ))}
` })(),this)}});const Og=e=>{return e.image?Qc `
< 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}`}" / >
2021-11-12 22:09:04 +01:00
< /svg>`:"";var t,n},$g=/ ^ \ s * < /,Ig=("undefined"!=typeof Element&&Element.prototype,function(e){this.cid=Ts("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Ct(this,ko(e,Rg)),this._ensureElement(),this.initialize.apply(this,arguments)});Ig.extend=Ws;const Mg=/ ^ ( \ S + ) \ s * ( . * ) $ / , Rg = [ "model" , "collection" , "el" , "id" , "attributes" , "className" , "tagName" , "events" ] ; Object . assign ( Ig . prototype , ks , { tagName : "div" , $ : function ( e ) { return this . el . querySelectorAll ( e ) } , preinitialize : function ( ) { } , initialize : function ( ) { } , render : function ( ) { return ve ( this . beforeRender ) && this . beforeRender ( ) , ve ( this . toHTML ) && tl ( this . toHTML ( ) , this . el ) , ve ( this . afterRender ) && this . afterRender ( ) , this } , remove : function ( ) { return this . _removeElement ( ) , this . stopListening ( ) , this } , _removeElement : function ( ) { this . undelegateEvents ( ) , this . el . parentNode && this . el . parentNode . removeChild ( this . el ) } , setElement : function ( e ) { return this . undelegateEvents ( ) , this . _setElement ( e ) , this . delegateEvents ( ) , this } , _setElement : function ( e ) { if ( "string" == typeof e ) if ( $g . test ( e ) ) { const t = document . createElement ( "div" ) ; t . innerHTML = e , this . el = t . firstChild } else this . el = document . querySelector ( e ) ; else e && ! T ( e ) && e . length ? this . el = e [ 0 ] : this . el = e } , delegateEvents : function ( e ) { if ( e || ( e = Gs ( this , "events" ) ) , ! e ) return this ; this . undelegateEvents ( ) ; for ( const t in e ) { let n = e [ t ] ; if ( ve ( n ) || ( n = this [ n ] ) , ! n ) continue ; const s = t . match ( Mg ) ; this . delegate ( s [ 1 ] , s [ 2 ] , n . bind ( this ) ) } return this } , delegate : function ( e , t , n ) { const s = this . el ; if ( ! s ) return this ; if ( "function" == typeof t && ( n = t , t = null ) , - 1 !== [ "focus" , "blur" ] . indexOf ( e ) ) { const s = this . el . querySelectorAll ( t ) ; for ( let t = 0 , i = s . length ; t < i ; t ++ ) { const i = s [ t ] ; i . addEventListener ( e , n , ! 1 ) , this . _domEvents . push ( { el : i , eventName : e , handler : n } ) } return n } const i = t ? function ( e ) { let i = e . target || e . srcElement ; for ( ; i && i != s ; i = i . parentNode ) i . matches ( t ) && ( e . delegateTarget = i , n ( e ) ) } : n ; return this . el . addEventListener ( e , i , ! 1 ) , this . _domEvents . push ( { el : this . el , eventName : e , handler : i , listener : n , selector : t } ) , this } , undelegateEvents : function ( ) { if ( this . el ) { for ( let e = 0 , t = this . _domEvents . length ; e < t ; e ++ ) { const t = this . _domEvents [ e ] ; t . el . removeEventListener ( t . eventName , t . handler , ! 1 ) } this . _domEvents . length = 0 } return this } , undelegate : function ( e , t , n ) { if ( "function" == typeof t && ( n = t , t = null ) , this . el ) { const s = this . _domEvents . slice ( ) ; let i = s . length ; for ( ; i -- ; ) { const r = s [ i ] ; ! ( r . eventName !== e || n && r . listener !== n || t && r . selector !== t ) && ( r . el . removeEventListener ( r . eventName , r . handler , ! 1 ) , this . _domEvents . splice ( i , 1 ) ) } } return this } , _createElement : function ( e ) { return document . createElement ( e ) } , _ensureElement : function ( ) { if ( this . el ) this . setElement ( Gs ( this , "el" ) ) ; else { const e = Ct ( { } , Gs ( this , "attributes" ) ) ; this . id && ( e . id = Gs ( this , "id" ) ) , this . className && ( e . class = Gs ( this , "className" ) ) , this . setElement ( this . _createElement ( Gs ( this , "tagName" ) ) ) , this . _setAttributes ( e ) } } , _setAttributes : function ( e ) { for ( const t in e ) t in this . el ? this . el [ t ] = e [ t ] : this . el . setAttribute ( t , e [ t ] ) } } ) ; const Dg = jl . env . utils , Lg = { renderAvatar ( e ) { const t = ( e = e || ( ( null == this ? void 0 : this . el ) ? ? this ) ) . querySelector ( "canvas.avatar, svg.avatar" ) ; if ( null !== t && this . model . vcard ) { const e = { classes : t . getAttribute ( "class" ) , width : t . getAttribute ( "width" ) , height : t . getAttribute ( "height" ) , image _type : this . model . vcard . get ( "image_type" ) , image : this . model . vcard . get ( "image" ) } ; t . outerHTML = Dg . getElementFromTemplateResult ( Og ( e ) ) . outerHTML } } } , zg = Ig . extend ( Lg ) ; class Pg extends mg { renderAvatar ( e ) { Lg . renderAvatar . call ( this , e ) } } function Fg ( ) { const e = . 01 * window . innerHeight ; document . documentElement . style . setProperty ( "--vh" , ` ${ e } px ` ) } var Ug = n ( 7904 ) , Bg = { } ; Bg . styleTagTransform = eg ( ) , Bg . setAttributes = Yf ( ) , Bg . insert = Jf ( ) . bind ( null , "head" ) , Bg . domAPI = Wf ( ) , Bg . insertStyleElement = Xf ( ) , Hf ( ) ( Ug . Z , Bg ) , Ug . Z && Ug . Z . locals && Ug . Z . locals , jl . plugins . add ( "converse-chatboxviews" , { dependencies : [ "converse-chatboxes" , "converse-vcard" ] , initialize ( ) { Cl . elements . register ( ) , Cl . promises . add ( [ "chatBoxViewsInitialized" ] ) , Cl . settings . extend ( { animate : ! 0 , theme : "default" } ) , va . ViewWithAvatar = zg , va . chatboxviews = new class { constructor ( ) { this . views = { } } add ( e , t ) { this . views [ e ] = t } get ( e ) { return this . views [ e ] } getAll ( ) { return Object . values ( this . views
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header ${e.level}" >
< h5 class = "modal-title" > $ { e . title } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
$ { e . messages . map ( ( e => Qc ` <p> ${ e } </p> ` ) ) }
< / d i v >
< / d i v >
< / d i v >
` )(Object.assign({__:vh},this.model.toJSON()))}}),Zg=Kg.extend({id:"confirm-modal",events:{"submit .confirm":"onConfimation"},initialize(){this.confirmation=ji(),Kg.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.el.addEventListener("closed.bs.modal",(()=>this.confirmation.reject()),!1)},toHTML(){return(e=>Qc `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header ${e.level||" "}" >
< h5 class = "modal-title" > $ { e . title } < / h 5 >
< button type = "button" class = "close" data - dismiss = "modal" aria - label = "Close" >
< span aria - hidden = "true" > × < / s p a n >
< / b u t t o n >
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< form class = "converse-form converse-form--modal confirm" action = "#" >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
$ { e . messages . map ( ( e => Qc ` <p> ${ e } </p> ` ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
$ { e . fields . map ( ( e => ( e => Qc `
2021-03-19 19:26:15 +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 >
2021-11-11 22:06:49 +01:00
` )(e)))}
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< button type = "submit" class = "btn btn-primary" > $ { vh ( "OK" ) } < / b u t t o n >
< input type = "button" class = "btn btn-secondary" data - dismiss = "modal" value = "${vh(" Cancel ")}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
` )(this.model.toJSON())},afterRender(){this.close_handler_registered||(this.el.addEventListener("closed.bs.modal",(()=>{this.confirmation.isResolved||this.confirmation.reject()}),!1),this.close_handler_registered=!0)},onConfimation(e){e.preventDefault();const t=new FormData(e.target),n=(this.model.get("fields")||[]).map((e=>{const n=t.get(e.name).trim();return e.value=n,e.challenge&&(e.challenge_failed=n!==e.challenge),e}));if(n.filter((e=>e.challenge_failed)).length)return this.model.set("fields",n),void this.model.trigger("change");this.confirmation.resolve(n),this.modal.hide()}});jl.env.BootstrapModal=Kg;let ep=[];const tp={modal:{show(e,t,n){const s=this.get(e.id)||this.create(e,t);return s.show(n),s},get:e=>ep.filter((t=>t.id==e)).pop(),create(e,t){const n=new e(t);return ep.push(n),n},remove(e){ep=ep.filter((t=>t!==e)),e.remove()},removeAll(){ep.forEach((e=>e.remove())),ep=[]}},async confirm(e,t=[],n=[]){"string"==typeof t&&(t=[t]);const s=new Zo({title:e,messages:t,fields:n,type:"confirm"}),i=new Zg({model:s});let r;i.show();try{r=await i.confirmation}catch(e){r=!1}return i.remove(),r},async prompt(e,t=[],n=""){"string"==typeof t&&(t=[t]);const s=new Zo({title:e,messages:t,fields:[{name:"reason",placeholder:n}],type:"prompt"}),i=new Zg({model:s});let r;i.show();try{var o;r=null===(o=(await i.confirmation).pop())||void 0===o?void 0:o.value}catch(e){r=!1}return i.remove(),r},alert(e,t,n){let s;"string"==typeof n&&(n=[n]),"error"===e?s="alert-danger":"info"===e?s="alert-info":"warn"===e&&(s="alert-warning");const i=new Zo({title:t,messages:n,level:s,type:"alert"});Cl.modal.show(Xg,{model:i})}};jl.plugins.add("converse-modal",{initialize(){Cl.listen.on("disconnect",(()=>{const e=document.querySelector("#converse-modals");e&&(e.innerHTML="")})),Cl.listen.on("clearSession",(()=>Cl.modal.removeAll())),Object.assign(va.api,tp)}});const np=(e,t)=>{var n,s;const i=e.N;if(void 0===i)return!1;for(const e of i)null===(s=(n=e).O)||void 0===s||s.call(n,t,!1),np(e,t);return!0},sp=e=>{let t,n;do{if(void 0===(t=e.M))break;n=t.N,n.delete(e),e=t}while(0===(null==n?void 0:n.size))},ip=e=>{for(let t;t=e.M;e=t){let n=t.N;if(void 0===n)t.N=n=new Set;else if(n.has(e))break;n.add(e),ap(t)}};function rp(e){void 0!==this.N?(sp(this),this.M=e,ip(this)):this.M=e}function op(e,t=!1,n=0){const s=this.H,i=this.N;if(void 0!==i&&0!==i.size)if(t)if(Array.isArray(s))for(let e=n;e<s.length;e++)np(s[e],!1),sp(s[e]);else null!=s&&(np(s,!1),sp(s));else np(this,e)}const ap=e=>{var t,n,s,i;2==e.type&&(null!==(t=(s=e).P)&&void 0!==t||(s.P=op),null!==(n=(i=e).Q)&&void 0!==n||(i.Q=rp))};class cp extends wg{constructor(){super(...arguments),this.isConnected=!0,this.ut=Xc,this.N=void 0}T(e,t,n){super.T(e,t,n),ip(this)}O(e,t=!0){this.at(e),t&&(np(this,e),sp(this))}at(e){var t,n;e!==this.isConnected&&(e?(this.isConnected=!0,this.ut!==Xc&&(this.setValue(this.ut),this.ut=Xc),null===(t=this.reconnected)||void 0===t||t.call(this)):(this.isConnected=!1,null===(n=this.disconnected)||void 0===n||n.call(this)))}S(e,t){if(!this.isConnected)throw Error( ` AsyncDirective $ { this . constructor . name } was rendered while its tree was disconnected . ` );return super.S(e,t)}setValue(e){if(this.isConnected)if((e=>void 0===this.Σdt.strings)())this.Σdt.I(e,this);else{const t=[...this.Σdt.H];t[this.Σct]=e,this.Σdt.I(t,this,0)}else this.ut=e}disconnected(){}reconnected(){}}const lp=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,dp=_g(class extends cp{constructor(){super(...arguments),this.Ct=2147483647,this.Rt=[]}render(...e){var t;return null!==(t=e.find((e=>!lp(e))))&&void 0!==t?t:Xc}update(e,t){const n=this.Rt;let s=n.length;this.Rt=t;for(let e=0;e<t.length&&!(e>this.Ct);e++){const i=t[e];if(!lp(i))return this.Ct=e,i;e<s&&i===n[e]||(this.Ct=2147483647,s=0,Promise.resolve(i).then((e=>{const t=this.Rt.indexOf(i);t>-1&&t<this.Ct&&(this.Ct=t,this.setValue(e))})))}return Xc}}),{Strophe:up,u:hp}=jl.env;class mp extends Uf{static get properties(){return{correcting:{type:Boolean},editable:{type:Boolean},hide_url_previews:{type:Boolean},is_retracted:
class = "chat-msg__actions ${e?" dropup dropup -- left ":" dropleft "}"
. items = $ { t }
> < / 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 Q c `
< button class = "chat-msg__action ${e.button_class}" @ click = $ { e . handler } >
< converse - icon
class = "${e.icon_class}"
path - prefix = "${Cl.settings.get(" assets _path ")}"
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 >
` }onMessageEditButtonClicked(e){var t,n;e.preventDefault();const s=this.model.collection.findWhere("correcting"),i=null===(t=hp.ancestor(this,".chatbox"))||void 0===t||null===(n=t.querySelector(".chat-textarea"))||void 0===n?void 0:n.value;(!i||s&&s.get("message")===i||confirm(vh("You have an unsent message which will be lost if you continue. Are you sure?")))&&(s!==this.model?(null==s||s.save("correcting",!1),this.model.save("correcting",!0)):this.model.save("correcting",!1))}async onDirectMessageRetractButtonClicked(){if("me"!==this.model.get("sender"))return M.error("onMessageRetractButtonClicked called for someone else's message!");const e=vh("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere."),t=[vh("Are you sure you want to retract this message?")];Cl.settings.get("show_retraction_warning")&&(t[1]=e),await Cl.confirm(vh("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=vh("A timeout occurred while trying to retract the message");Cl.alert("error",vh("Error"),e),M(e,up.LogLevel.WARN)}else if(hp.isErrorStanza(n)){const e=vh("Sorry, you're not allowed to retract this message.");Cl.alert("error",vh("Error"),e),M(e,up.LogLevel.WARN),M(n,up.LogLevel.WARN)}}async onMUCMessageRetractButtonClicked(){const e=vh("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=[vh("Are you sure you want to retract this message?")];Cl.settings.get("show_retraction_warning")&&(t[1]=e),await Cl.confirm(vh("Confirm"),t)&&this.model.collection.chatbox.retractOwnMessage(this.model)}else if(await this.model.mayBeModerated())if("me"===this.model.get("sender")){let t=[vh("Are you sure you want to retract this message?")];Cl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]),await Cl.confirm(vh("Confirm"),t)&&this.retractOtherMessage()}else{let t=[vh("You are about to retract this message."),vh("You may optionally include a message, explaining the reason for the retraction.")];Cl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]);const n=await Cl.prompt(vh("Message Retraction"),t,vh("Optional reason"));!1!==n&&this.retractOtherMessage(n)}else{const e=vh("Sorry, you're not allowed to retract this message");Cl.alert("error",vh("Error"),e)}}onMessageRetractButtonClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.collection.chatbox.get("type")===va.CHATROOMS_TYPE?this.onMUCMessageRetractButtonClicked():this.onDirectMessageRetractButtonClicked()}onHidePreviewsButtonClicked(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.hide_url_previews)this.model.save({hide_url_previews:!1,url_preview_transition:"fade-in"});else{const e=this.model.get("ogp_metadata")||[];Cl.settings.get("muc_show_ogp_unfurls")&&e.length?this.model.set("url_preview_transition","fade-out"):this.model.save({hide_url_previews:!0,url_preview_transition:"fade-in"})}}async getActionButtons(){var e;const t=[];this.editable&&t.push({i18n_text:this.correcting?vh("Cancel Editing"):vh("Edit"),handler:e=>this.onMessageEditButtonClicked(e),button_class:"chat-msg__action-edit",icon_class:"fa fa-pencil-alt",name:"edit"});const n="groupchat"===this.model.get("type")&&await this.model.mayBeModerated();if(!this.is_retracted&&(this.model.mayBeRetracted()||n)&&t.push({i18n_text:vh("Retract"),handler:e=>this.onMessageRetractButtonClicked(e),button_class:"chat-msg__action-retract",icon_class:"fas fa-trash-alt",name:"retract"}),!this.model.collection)return[];const s=this.model.get("ogp_metadata")||[],i=Cl.settings.get("muc_show_ogp_unfurls")&&s.length,r=null===(e=this.model.get("media_urls"))||void 0===e?void 0:e.length;if(i||r){let e;const n=this.hide_url_previews;e=s.length>1?vh(n?"Show URL previews":"Hide URL previews"):1===s.length?vh(n?"Show URL
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog fit-content" role = "document" >
< div class = "modal-content fit-content" >
< div class = "modal-header" >
2021-11-11 22:06:49 +01:00
< h4 class = "modal-title" id = "message-versions-modal-label" > $ { vh ( "Image: " ) } < a target = "_blank" rel = "noopener" href = "${e.src}" > $ { e . src } < / a > < / h 4 >
$ { Qg }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body modal-body--image fit-content" >
< img class = "chat-image" src = "${e.src}" @ load = $ { e . onload } >
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "modal-footer" > $ { Yg } < / d i v >
< / d i v >
< / d i v > ` ) ( { s r c : t h i s . s r c , o n l o a d : e = > e . t a r g e t . p a r e n t E l e m e n t . s t y l e . h e i g h t = ` $ { e . t a r g e t . h e i g h t } p x ` } ) } } ) , g p = ( e , t ) = > Q c ` < a u d i o c o n t r o l s s r c = " $ { e } " > < / a u d i o > $ { t ? " " : Q c ` < 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 > ` } ` ; c l a s s p p { c o n s t r u c t o r ( e ) { e . t o S t r i n g ( ) . i n d e x O f ( " A r r a y B u f f e r " ) > 0 & & ( e = n e w U i n t 8 A r r a y ( e ) ) , t h i s . d a t a = e , t h i s . l e n = t h i s . d a t a . l e n g t h , t h i s . p o s = 0 } r e a d B y t e ( ) { i f ( t h i s . p o s > = t h i s . d a t a . l e n g t h ) t h r o w n e w E r r o r ( " A t t e m p t e d t o r e a d p a s t e n d o f s t r e a m . " ) ; r e t u r n t h i s . d a t a i n s t a n c e o f U i n t 8 A r r a y ? t h i s . d a t a [ t h i s . p o s + + ] : 2 5 5 & t h i s . d a t a . c h a r C o d e A t ( t h i s . p o s + + ) } r e a d B y t e s ( e ) { c o n s t t = [ ] ; f o r ( l e t n = 0 ; n < e ; n + + ) t . p u s h ( t h i s . r e a d B y t e ( ) ) ; r e t u r n t } r e a d ( e ) { l e t t = " " ; f o r ( l e t n = 0 ; n < e ; n + + ) t + = S t r i n g . f r o m C h a r C o d e ( t h i s . r e a d B y t e ( ) ) ; r e t u r n t } r e a d U n s i g n e d ( ) { c o n s t e = t h i s . r e a d B y t e s ( 2 ) ; r e t u r n ( e [ 1 ] < < 8 ) + e [ 0 ] } } f u n c t i o n v p ( e ) { r e t u r n e . r e d u c e ( ( f u n c t i o n ( e , t ) { r e t u r n 2 * e + t } ) , 0 ) } f u n c t i o n b p ( e ) { c o n s t t = [ ] ; f o r ( l e t n = 7 ; n > = 0 ; n - - ) t . p u s h ( ! ! ( e & 1 < < n ) ) ; r e t u r n t } f u n c t i o n y p ( e ) { l e t t , n ; n = " " ; d o { t = e . r e a d B y t e ( ) , n + = e . r e a d ( t ) } w h i l e ( 0 ! = = t ) ; r e t u r n n } f u n c t i o n _ p ( e , t ) { c o n s t n = [ ] ; f o r ( l e t s = 0 ; s < t ; s + + ) n . p u s h ( e . r e a d B y t e s ( 3 ) ) ; r e t u r n n } f u n c t i o n w p ( e , t ) { c o n s t n = { } ; s w i t c h ( n . s e n t i n e l = e . r e a d B y t e ( ) , S t r i n g . f r o m C h a r C o d e ( n . s e n t i n e l ) ) { c a s e " ! " : n . t y p e = " e x t " , f u n c t i o n ( e , t , n ) { s w i t c h ( t . l a b e l = e . r e a d B y t e ( ) , t . l a b e l ) { c a s e 2 4 9 : t . e x t T y p e = " g c e " , f u n c t i o n ( t ) { e . r e a d B y t e ( ) ; c o n s t s = b p ( e . r e a d B y t e ( ) ) ; t . r e s e r v e d = s . s p l i c e ( 0 , 3 ) , t . d i s p o s a l M e t h o d = v p ( s . s p l i c e ( 0 , 3 ) ) , t . u s e r I n p u t = s . s h i f t ( ) , t . t r a n s p a r e n c y G i v e n = s . s h i f t ( ) , t . d e l a y T i m e = e . r e a d U n s i g n e d ( ) , t . t r a n s p a r e n c y I n d e x = e . r e a d B y t e ( ) , t . t e r m i n a t o r = e . r e a d B y t e ( ) , n u l l = = n | | n . g c e ( t ) } ( t ) ; b r e a k ; c a s e 2 5 4 : t . e x t T y p e = " c o m " , f u n c t i o n ( t ) { t . c o m m e n t = y p ( e ) , n . c o m & & n . c o m ( t ) } ( t ) ; b r e a k ; c a s e 1 : t . e x t T y p e = " p t e " , f u n c t i o n ( t ) { e . r e a d B y t e ( ) , t . p t H e a d e r = e . r e a d B y t e s ( 1 2 ) , t . p t D a t a = y p ( e ) , n . p t e & & n . p t e ( t ) } ( t ) ; b r e a k ; c a s e 2 5 5 : t . e x t T y p e = " a p p " , f u n c t i o n ( t ) { s w i t c h ( e . r e a d B y t e ( ) , t . i d e n t i f i e r = e . r e a d ( 8 ) , t . a u t h C o d e = e . r e a d ( 3 ) , t . i d e n t i f i e r ) { c a s e " N E T S C A P E " : ! f u n c t i o n ( t ) { e . r e a d B y t e ( ) , t . u n k n o w n = e . r e a d B y t e ( ) , t . i t e r a t i o n s = e . r e a d U n s i g n e d ( ) , t . t e r m i n a t o r = e . r e a d B y t e ( ) , n . a p p & & n . a p p . N E T S C A P E & & n . a p p . N E T S C A P E ( t ) } ( t ) ; b r e a k ; d e f a u l t : ! f u n c t i o n ( t ) { t . a p p D a t a = y p ( e ) , n . a p p & & n . a p p [ t . i d e n t i f i e r ] & & n . a p p [ t . i d e n t i f i e r ] ( t ) } ( t ) } } ( t ) ; b r e a k ; d e f a u l t : t . e x t T y p e = " u n k n o w n " , f u n c t i o n ( t ) { t . d a t a = y p ( e ) , n . u n k n o w n & & n . u n k n o w n ( t ) } ( t ) } } ( e , n , t ) ; b r e a k ; c a s e " , " : n . t y p e = " i m g " , f u n c t i o n ( e , t , n ) { t . l e f t P o s = e . r e a d U n s i g n e d ( ) , t . t o p P o s = e . r e a d U n s i g n e d ( ) , t . w i d t h = e . r e a d U n s i g n e d ( ) , t . h e i g h t = e . r e a d U n s i g n e d ( ) ; c o n s t s = b p ( e . r e a d B y t e ( ) ) ; t . l c t F l a g = s . s h i f t ( ) , t . i n t e r l a c e d = s . s h i f t ( ) , t . s o r t e d = s . s h i f t ( ) , t . r e s e r v e d = s . s p l i c e ( 0 , 2 ) , t . l c t S i z e = v p ( s . s p l i c e ( 0 , 3 ) ) , t . l c t F l a g & & ( t . l c t = _ p ( e , 1 < < t . l c t S i z e + 1 ) ) , t . l z w M i n C o d e S i z e = e . r e a d B y t e ( ) ; c o n s t i = y p ( e ) ; t . p i x e l s = f u n c t i o n ( e , t ) { l e t n = 0 ; f u n c t i o n s ( e ) { l e t s = 0 ; f o r ( l e t i = 0 ; i < e ; i + + ) t . c h a r C o d e A t ( n > > 3 ) & 1 < < ( 7 & n ) & & ( s | = 1 < < i ) , n + + ; r e t u r n s } c o n s t i = [ ] , r = 1 < < e , o = r + 1 ; l e t a = e + 1 , c = [ ] ; c o n s t l = f u n c t i o n ( ) { c = [ ] , a = e + 1 ; f o r ( l e t e = 0 ; e < r ; e + + ) c [ e ] = [ e ] ; c [ r ] = [ ] , c [ o ] = n u l l } ; l e t d , u ; f o r ( ; ; ) i f ( u = d , d = s ( a ) , d ! = = r ) { i f ( d = = = o ) b r e a k ; i f ( d < c . l e n g t h ) u ! = = r & & c . p u s h ( c [ u ] . c o n c a t ( c [ d ] [ 0 ] ) ) ; e l s e { i f ( d ! = = c . l e n g t h ) t h r o w n e w E r r o r ( " I n v a l i d L Z W c o d e . " ) ; c . p u s h ( c [ u ] . c o n c a t ( c [ u ] [ 0 ] ) ) } i . p u s h . a p p l y ( i , c [ d ] ) , c . l e n g t h = = = 1 < < a & & a < 1 2 & & a + + } e l s e l ( ) ; r e t u r n i } ( t . l z w M i n C o d e S i z e , i ) , t . i n t e r l a c e d & & ( t . p i x e l s = f u n c t i o n ( e , t ) { c o n s t n = n e w A r r a y ( e . l e n g t h ) , s = e . l e n g t h / t ; f u n c t i o n i ( s , i ) { c o n s t r = e . s l i c e ( i * t , ( i + 1 ) * t ) ; n . s p l i c e . a p p l y ( n , [ s * t , t ] . c o n c a t ( r ) ) } c o n s t r = [ 0 , 4 , 2 , 1 ] , o = [ 8 , 8 , 4 , 2 ] ; l e t a = 0 ; f o r ( l e t e = 0 ; e < 4 ; e + + ) f o r ( l e t t = r [ e ] ; t < s ; t + = o [ e ] ) i ( t , a ) , a + + ; r e t u r n n } ( t . p i x e l s , t . w i d t h ) ) , n u l l = = n | | n ( t ) } ( e , n , n u l l = = t ? v o i d 0 : t . i m g ) ; b r e a k ; c a s e " ; " : n . t y p e = " e o f " , n u l l = = t | | t . e o f ( n ) ; b r e a k ; d e f a u l t : t h r o w n e w E r r o r ( " U n k n o w n b l o c k : 0 x " + n . s e n t i n e l . t o S t r i n g ( 1 6 ) ) } " e o f " ! = = n . t y p e & & s e t T i m e o u t ( ( ( ) = > w p ( e , t ) ) , 0 ) } c l a s s S p { c o n s t r u c t o r ( e , t ) { t h i s . o p t i o n s = O b j e c t . a s s i g n ( { w i d t h : n u l l , h e i g h t : n u l l , a u t o p l a y : ! 0 , l o o p : ! 0 , s h o w _ p r o g r e s s _ b a r : ! 0 , p r o g r e s s _ b g _ c o l o r : " r g b a ( 0 , 0 , 0 , 0 . 4 ) " , p r o g r e s s _ c o l o r : " r g b a ( 2 5 5 , 0 , 2 2 , . 8 ) " , p r o g r e s s _ b a r _ h e i g h t : 5 } , t ) , t h i s . e l = e , t h i s . g i f _ e l = e . q u e r y S e l e c t o r ( " i m g " ) , t h i s . c a n v a s = e . q u e r y S e l e c t o r ( " c a n v a s " ) , t h i s . c t x = t h i s . c a n v a s . g e t C o n t e x t ( " 2 d " ) , t h i s . o f f s c r e e n C a n v a s = d o c u m e n t . c r e a t e E l e m e n t ( " c a n v a s " ) , t h i s . c t x _ s c a l e d = ! 1 , t h i s . d i s p o s a l _ m e t h o d = n u l l , t h i s . d i s p o s a l _ r e s t o r e _ f r o m _ i d x = n u l l , t h i s . f r a m e = n u l l , t h i s . f r a m e
< div class = "form-group" >
$ { "hidden" !== e . type ? Qc ` <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 ? Qc `
< 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 > ` , A p = e = > Q c `
< label > $ { e . label }
< a class = "form-url" target = "_blank" rel = "noopener" href = "${e.value}" > $ { e . value } < / a >
< / l a b e l > ` , C p = e = > Q c `
< div class = "form-group" >
$ { e . label ? Qc ` <label> ${ e . label } </label> ` : "" }
< div class = "input-group" >
< div class = "input-group-prepend" >
< input name = "${e.name}"
type = "${e.type}"
value = "${e.value||" "}"
? required = "${e.required}" / >
< div class = "input-group-text col" title = "${e.domain}" > $ { e . domain } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< /div>`;function Tp(e){e.preventDefault(),Cl.rooms.open(e.target.href)}const kp=(e,t)=>{let n=e.normalize()._string;const s=e._parts.urn?n:e.readable(),i=t||s;return e._parts.protocol||n.startsWith("http:/ / ")||n.startsWith(" https : //")||(n="http://"+n),"xmpp"===e._parts.protocol&&"join"===e._parts.query?Qc`
2021-03-19 19:26:15 +01:00
< a target = "_blank"
rel = "noopener"
2021-11-11 22:06:49 +01:00
@ click = $ { Tp }
href = "${n}" > $ { i } < / a > ` : Q c ` < 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 } " > $ { i } < / a > ` } , j p = ( e , t ) = > Q c ` < 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 ? " " : Q c ` < 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 : N p } = j l . e n v , O p = [ " 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 $ p ( 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 " : n u l l ! = 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 I p = { " 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 " } ; f u n c t i o n M p ( e ) { c o n s t t = I l ( e ) ; r e t u r n n u l l = = = t ? e : B l ( t ) ? j p ( e ) : U l ( t ) ? g p ( e ) : ( q l ( t ) , x p ( t . t o S t r i n g ( ) , f u n c t i o n ( e ) { t r y { r e t u r n d e c o d e U R I ( e . f i l e n a m e ( ) ) } c a t c h ( t ) { r e t u r n M . d e b u g ( t ) , e . f i l e n a m e ( ) } } ( t ) ) ) } f u n c t i o n R p ( 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 = I l ( 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 , t = O p ) { r e t u r n ! ! t . 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 : k p ( n , e ) } f u n c t i o n D p ( e , t ) { e . c l a s s L i s t . r e m o v e ( " v i s i b l e " ) , v e ( t ) & & t ( ) } l a . c a l c u l a t e E l e m e n t H e i g h t = f u n c t i o n ( e ) { r e t u r n A r r a y . f r o m ( e . c h i l d r e n ) . r e d u c e ( ( ( e , t ) = > e + t . o f f s e t H e i g h t ) , 0 ) } , l a . g e t N e x t E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . n e x t E l e m e n t S i b l i n g ; f o r ( ; n u l l ! = = n & & ! N p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . n e x t E l e m e n t S i b l i n g ; r e t u r n n } , l a . g e t P r e v i o u s E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . p r e v i o u s E l e m e n t S i b l i n g ; f o r ( ; n u l l ! = = n & & ! N p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p r e v i o u s E l e m e n t S i b l i n g ; r e t u r n n } , l a . g e t F i r s t C h i l d E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . f i r s t E l e m e n t C h i l d ; f o r ( ; n u l l ! = = n & & ! N p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . n e x t E l e m e n t S i b l i n g ; r e t u r n n } , l a . g e t L a s t C h i l d E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . l a s t E l e m e n t C h i l d ; f o r ( ; n u l l ! = = n & & ! N p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p r e v i o u s E l e m e n t S i b l i n g ; r e t u r n n } , l a . h a s C l a s s = f u n c t i o n ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . c o n t a i n s ( e ) } , l a . t o g g l e C l a s s = f u n c t i o n ( e , t ) { l a . h a s C l a s s ( e , t ) ? l a . r e m o v e C l a s s ( e , t ) : l a . a d d C l a s s ( e , t ) } , l a . a d d C l a s s = f u n c t i o n ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . a d d ( e ) , t } , l a . r e m o v e C l a s s = f u n c t i o n ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . r e m o v e ( e ) , t } , l a . r e m o v e E l e m e n t = f u n c t i o n ( e ) { r e t u r n e i n s t a n c e o f E l e m e n t & & e . p a r e n t N o d e & & e . p a r e n t N o d e . r e m o v e C h i l d ( e ) , e } , l a . g e t E l e m e n t F r o m T e m p l a t e R e s u l t = f u n c t i o n ( e ) { 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 ( " d i v " ) ; r e t u r n t l ( e , t ) , t . f i r s t E l e m e n t C h i l d } , l a . s h o w E l e m e n t = e = > { l a . r e m o v e C l a s s ( " c o l l a p s e d " , e ) , l a . r e m o v e C l a s s ( " h i d d e n " , e ) } , l a . h i d e E l e m e n t = f u n c t i o n ( e ) { r e t u r n e i n s t a n c e o f E l e m e n t & & e . c l a s s L i s t . a d d ( " h i d d e n " ) , e } , l a . a n c e s t o r = f u n c t i o n ( e , t ) { l e t n = e ; f o r ( ; n u l l ! = = n & & ! N p . 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 } , l a . n e x t U n t i l = f u n c t i o n ( e , t ) { c o n s t n = [ ] ; l e t s = e . n e x t E l e m e n t S i b l i n g ; f o r ( ; n u l l ! = = s & & ! s . m a t c h e s ( t ) ; ) n . p u s h ( s ) , s = s . n e x t E l e m e n t S i b l i n g ; r e t u r n n } , l a . u n e s c a p e H T M L = f u n c t i o n ( e ) { v a r t = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; r e t u r n t . i n n e r H T M L = e , t . i n n e r T e x t } , l a . e s c a p e H T M L = f u n c t i o n ( e ) { r e t u r n e . r e p l a c e ( / & / g , " & a m p ; " ) . r e p l a c e ( / < / g , " & l t ; " ) . r e p l a c e ( / > / g , " & g t ; " ) . r e p l a c e ( / " / g , " & q u o t ; " ) } , l a . s l i d e I n A l l E l e m e n t s = f u n c t i o n ( e , t = 3 0 0 ) { r e t u r n P r o m i s e . a l l ( A r r a y . f r o m ( e ) . m a p ( ( e = > l a . s l i d e I n ( e , t ) ) ) ) } , l a . s l i d e T o g g l e E l e m e n t = f u n c t i o n ( e , t ) { r e t u r n l a . h a s C l a s s ( " c o l l a p s e d " , e ) | | l a . h a s C l a s s ( " h i d d e n " , e ) ? l a . s l i d e O u t ( e , t ) : l a . s l i d e I n ( e , t ) } , l a . s l i d e O u t = f u n c t i o n ( e , t = 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 M . 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 = l a . 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 ( ! l a . h a s C l a s s ( " c o l l a p s e d " , e ) & & ! l a . 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 (
< 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}" >
$ { null === ( t = e . options ) || void 0 === t ? void 0 : t . map ( ( e => ( e => Qc ` <option value=" ${ e . value } " ?selected=" ${ e . selected } "> ${ e . label } </option> ` ) ( e ) ) ) }
< / s e l e c t >
< / d i v > ` } ) ( { o p t i o n s : l a . q u e r y C h i l d r e n ( e , " o p t i o n " ) . m a p ( ( n = > { v a r s ; c o n s t i = n u l l = = = ( s = n . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = s ? v o i d 0 : s . t e x t C o n t e n t ; r e t u r n { v a l u e : i , l a b e l : n . g e t A t t r i b u t e ( " l a b e l " ) , s e l e c t e d : t . i n c l u d e s ( i ) , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } } ) ) , i d : l a . g e t U n i q u e I d ( ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) , m u l t i p l e : " l i s t - m u l t i " = = = e . g e t A t t r i b u t e ( " t y p e " ) , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) } v a r s , i , r , o ; i f ( " f i x e d " = = = e . g e t A t t r i b u t e ( " t y p e " ) ) r e t u r n ( e = > Q c ` < p c l a s s = " f o r m - h e l p " > $ { e . t e x t } < / p > ` ) ( { t e x t : n u l l = = = ( s = e . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = s ? v o i d 0 : s . t e x t C o n t e n t } ) ; i f ( " j i d - m u l t i " = = = e . g e t A t t r i b u t e ( " t y p e " ) ) r e t u r n ( e = > Q c `
< label class = "label-ta" > $ { e . label } < / l a b e l >
< textarea name = "${e.name}" > $ { e . value } < / t e x t a r e a >
` )({name:e.getAttribute("var"),label:e.getAttribute("label")||"",value:null===(i=e.querySelector("value"))||void 0===i?void 0:i.textContent,required:!!e.querySelector("required")});if("boolean"===e.getAttribute("type")){var a;const t=null===(a=e.querySelector("value"))||void 0===a?void 0:a.textContent;return(e=>Qc `
< 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 > ` ) ( { i d : l a . g e t U n i q u e I d ( ) , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , c h e c k e d : " 1 " = = = t | | " t r u e " = = = t ? ' c h e c k e d = " 1 " ' : " " , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) } i f ( " u r l " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n A p ( { l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : n u l l = = = ( r = e . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = r ? v o i d 0 : r . t e x t C o n t e n t } ) ; i f ( " u s e r n a m e " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n C p ( { d o m a i n : " @ " + n . d o m a i n , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , t y p e : I p [ e . g e t A t t r i b u t e ( " t y p e " ) ] , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : n u l l = = = ( o = e . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = o ? v o i d 0 : o . t e x t C o n t e n t , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) ; i f ( " o c r " = = = e . g e t A t t r i b u t e ( " v a r " ) ) { c o n s t n = e . q u e r y S e l e c t o r ( " u r i " ) , s = N p ( ' d a t a [ c i d = " ' + n . t e x t C o n t e n t . r e p l a c e ( / ^ c i d : / , " " ) + ' " ] ' , t ) [ 0 ] ; r e t u r n ( e = > Q c `
< fieldset class = "form-group" >
$ { e . label ? Qc ` <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 >
` )({label:e.getAttribute("label"),name:e.getAttribute("var"),data:null==s?void 0:s.textContent,type:n.getAttribute("type"),required:!!e.querySelector("required")})}{var c;const t=e.getAttribute("var");return Ep({id:la.getUniqueId(),label:e.getAttribute("label")||"",name:t,fixed_username:null==n?void 0:n.fixed_username,autocomplete: $ p(t,n),placeholder:null,required:!!e.querySelector("required"),type:Ip[e.getAttribute("type")],value:null===(c=e.querySelector("value"))||void 0===c?void 0:c.textContent})}},Object.assign(la,{getOOBURLMarkup:Mp});const Lp=la;var zp=n(3735),Pp={};Pp.styleTagTransform=eg(),Pp.setAttributes=Yf(),Pp.insert=Jf().bind(null,"head"),Pp.domAPI=Wf(),Pp.insertStyleElement=Xf(),Hf()(zp.Z,Pp),zp.Z&&zp.Z.locals&&zp.Z.locals,Cl.elements.define("converse-gif",class extends Uf{static get properties(){return{autoplay:{type:Boolean},noloop:{type:Boolean},progress_color:{type:String},fallback:{type:String},src:{type:String}}}constructor(){super(),this.autoplay=!1,this.noloop=!1,this.fallback="url"}initialize(){const e={autoplay:this.autoplay,loop:!this.noloop};this.progress_color&&(e.progress_color=this.progress_color),this.supergif=new Sp(this,e)}updated(e){this.supergif&&!e.has("src")?(e.has("autoplay")&&(this.supergif.options.autoplay=this.autoplay),e.has("noloop")&&(this.supergif.options.loop=!this.noloop),e.has("progress_color")&&(this.supergif.options.progress_color=this.progress_color)):this.initialize()}render(){var e;return null!==(e=this.supergif)&&void 0!==e&&e.load_error&&["url","empty"].includes(this.fallback)?this.renderErrorFallback():Qc ` < canvas class = "gif-canvas"
@ mouseover = $ { ( ) => this . setHover ( ) }
@ mouseleave = $ { ( ) => this . unsetHover ( ) }
@ 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 ? R p ( 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 . 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 { U R I : F p } = j l . e n v , U p = _ g ( c l a s s e x t e n d s c p { r e n d e r ( e , t , n , s ) { r e t u r n t ? Q c ` < 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 Q c ` < 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 "
src = "${e}"
@ click = $ { s }
@ error = $ { ( ) => this . onError ( e , t , n , s ) }
@ load = $ { n } / > < / a > ` } o n E r r o r ( e , t , n , s ) { i f ( P l ( e ) ) t & & t h i s . s e t V a l u e ( R p ( t ) ) ; e l s e { c o n s t i = n e w F p ( 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 ( U p ( i . t o S t r i n g ( ) , t , n , s ) ) } } } ) , B p = e = > Q c ` $ { U p ( e . u r l , e . h r e f , e . o n L o a d , e . o n C l i c k ) } ` , q p = _ g ( c l a s s e x t e n d s w g { r e n d e r ( e , t , n , s ) { c o n s t i = n e w t v ( e , t , n , O b j e c t . a s s i g n ( s , { 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 Q c ` $ { d p ( a s y n c f u n c t i o n ( e ) { r e t u r n a w a i t e . a d d T e m p l a t e s ( ) , e . p a y l o a d } ( i ) , Q c ` $ { i } ` ) } ` } } ) , H p = [ " * " , " _ " , " ~ " , " ` " ] , G p = [ . . . H p , " ` ` ` " , " > " ] , W p = { " * " : { 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 " } } , V p = [ " _ " , " > " , " ` " , " ~ " ] , J p = { e m p h a s i s : ( e , t , n , s ) = > Q c ` < 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 > $ { q p ( e , t , n , s ) } < / 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 = > Q c ` < 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 = > Q c ` < 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 , s ) = > Q c ` < b l o c k q u o t e > $ { q p ( e , t , n , s ) } < / b l o c k q u o t e > ` , s t r i k e : ( e , t , n , s ) = > Q c ` < 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 > $ { q p ( e , t , n , s ) } < / 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 , s ) = > Q c ` < 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 > $ { q p ( e , t , n , s ) } < / 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 K p ( e , t , n = ! 0 ) { l e t s ; i f ( ! / ( ^ ` ` ` \ s * \ n | ^ ` ` ` \ s * $ ) / . t e s t ( e . s l i c e ( t ) ) | | 0 ! = = t & & " \ n " ! = = e [ t - 1 ] & & " > " ! = = e [ t - 1 ] ) { i f ( ! G p . 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 ( s = 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 ( V p . 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 ( Q p ( e ) & & n > 0 & & " \ n " ! = = t [ n - 1 ] ) r e t u r n ! 1 ; i f ( H p . 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 ( V p . 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 ( H p . 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 } ( s , e , t , n ) ) r e t u r n n u l l } e l s e s = e . s l i c e ( t , t + 3 ) ; r e t u r n s } f u n c t i o n Y p ( e , t ) { c o n s t n = K p ( 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 , Q p ( 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 " = = = W p [ 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 ( K p ( 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 ( K p ( 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 Q p = e = > [ " > " , " & g t ; " ] . i n c l u d e s ( e ) ; f u n c t i o n X p ( e , t , n , s , i ) { c o n s t r = J p [ W p [ e ] . n a m e ] ; r e t u r n Q p ( e ) ? r ( t . r e p l a c e ( / \ n > / g , " \ n " ) . r e p l a c e ( / \ n $ / , " " ) , n , s , i ) : r ( t , n , s , i ) } c o n s t { U R I : Z p } = j l . e n v , e v = e = > " s t r i n g " = = t y p e o f e ; c l a s s t v 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 = 0 , n = [ ] , s = { } ) { s u p e r ( e ) , t h i s . e m b e d _ a u d i o = n u l l = = s ? v o i d 0 : s . e m b e d _ a u d i o , t h i s . e m b e d _ v i d e o s = n u l l = = s ? v o i d 0 : s . e m b e d _ v i d e o s , t h i s . m e n t i o n s = n , t h i s . n i c k = n u l l = = s ? v o i d 0 : s . n i c k , t h i s . o f f s e t = t , t h i s . o n I m g C l i c k = n u l l = = s ? v o i d 0 : s . o n I m g C l i c k , t h i s . o n I m g L o a d = n u l l = = s ? v o i d 0 : s . o n I m g L o a d , t h i s . o p t i o n s = s , t h i s . p a y l o a d = [ ] , t h i s . r e f e r e n c e s = [ ] , t h i s . r e n d e r _ s t y l i n g = n u l l = = s ? v o i d 0 : s . r e n d e r _ s t y l i n g , t h i s . s h o w _ i m a g e s = n u l l = = s ? v o i d 0 : s . s h o w _ i m a g e s , t h i s . h i d e _ m e d i a _ u r l s = n u l l = = s ? v o i d 0 : s . h i d e _ m e d i a _ u r l s } a d d H y p e r l i n k s ( e , t ) { c o n s t n = [ ] ; t r y { Z p . w i t h i n S t r i n g ( e , ( ( e , t , s ) = > ( n . p u s h ( { u r l : e , s t a r t : t , e n d : s } ) , e ) ) , g e ) } c a t c h ( e ) { r e t u r n v o i d M . d e b u g ( e ) } n . f i l t e r ( ( t = > ! e . s l i c e ( t . s t a r t , t . e n d ) . s t a r t s W i t h ( " a e s g c m : / / " ) ) ) . f o r E a c h ( ( e = > { c o n s t n = e . u r l , s = f u n c t i o n ( e ) { c o n s t t = C l . s e t t i n g s . g e t ( " f i l t e r _ u r l _ q u e r y _ p a r a m s " ) ; r e t u r n t ? I l ( e ) . r e m o v e Q u e r y ( t ) . t o S t r i n g ( ) : e } ( n ) ; l e t i ; v a r r , o ; t h i s . s h o w _ i m a g e s & & F l ( n ) & & z l ( n ) ? ( r = s , o = t h i s . h i d e _ m e d i a _ u r l s , i = Q c ` < 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 = $ { r } > < / c o n v e r s e - g i f > $ { o ? " " : Q c ` < 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 = " $ { r } " > $ { r } < / a > ` } ` ) : i = t h i s . s h o w _ i m a g e s & & q l ( n ) & & z l ( n ) ? B p ( { u r l : s , h r e f : t h i s . h i d e _ m e d i a _ u r l s ? n u l l : s , o n C l i c k : t h i s . o n I m g C l i c k , o n L o a d : t h i s . o n I m g L o a d } ) : t h i s . e m b e d _ v i d e o s & & B l ( n ) & & L l ( n ) ? j p ( s , t h i s . h i d e _ m e d i a _ u r l s ) : t h i s . e m b e d _ a u d i o & & U l ( n ) & & D l ( n ) ? g p ( s , t h i s . h i d e _ m e d i a _ u r l s ) : R p ( s ) , t h i s . a d d T e m p l a t e R e s u
< button type = "button" class = "btn btn--transparent btn--standalone" data - toggle = "dropdown" aria - haspopup = "true" aria - expanded = "false" >
< converse - icon color = "${this.color}" 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" >
$ { this . items . map ( ( e => dp ( e , "" ) ) ) }
< / d i v >
` }firstUpdated(){super.firstUpdated(),this.initArrowNavigation()}hideMenu(){var e;super.hideMenu(),null===(e=this.navigator)||void 0===e||e.disable()}initArrowNavigation(){if(!this.navigator){const e={selector:".dropdown-item",onSelected:e=>e.focus()};this.navigator=new hv(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!==jl.keycodes.DOWN_ARROW||this.navigator.enabled||this.enableArrowNavigation(e)}}Cl.elements.define("converse-dropdown",vv);const{dayjs:bv}=jl.env;Cl.elements.define("converse-message-versions",class extends Uf{static get properties(){return{model:{type:Object}}}render(){const e=this.model.get("older_versions"),t=this.model.get("message");return Qc `
< h4 > Older versions < / h 4 >
$ { Object . keys ( e ) . map ( ( t => Qc ` <p class="older-msg"><time> ${ bv ( t ) . format ( "MMM D, YYYY, HH:mm:ss" ) } </time>: ${ e [ t ] } </p> ` ) ) }
< hr / >
< h4 > Current version < / h 4 >
< p > $ { t } < / p > ` } } ) ; c o n s t y v = K g . e x t e n d ( { i d : " m e s s a g e - v e r s i o n s - m o d a l " , t o H T M L ( ) { r e t u r n ( e = > Q c `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
2021-11-11 22:06:49 +01:00
< h4 class = "modal-title" id = "message-versions-modal-label" > $ { vh ( "Message versions" ) } < / h 4 >
$ { Qg }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body" >
2021-11-11 22:06:49 +01:00
< converse - message - versions . model = $ { e } > < / c o n v e r s e - m e s s a g e - v e r s i o n s >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "modal-footer" > $ { Yg } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
` )(this.model)}}),_v=_g(class extends wg{render(e){const t={classes:e.classes? ` $ { e . classes } avatar ` :"avatar",height:e.width||36,image:e.image,image_type:e.image_type,width:e.height||36};return Og(t)}}),wv=Kg.extend({initialize(){Kg.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),Cl.trigger("occupantModalInitialized",this.model)},toHTML(){return(e=>Qc `
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "user-details-modal-label" > $ { e . display _name } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
$ { _v ( e . avatar _data ) }
< / d i v >
< div class = "modal-footer" >
$ { Yg }
< / d i v >
< / d i v >
< / d i v >
` )(Object.assign(this.model.toJSON(),{avatar_data:this.getAvatarData(),display_name:this.model.getDisplayName()}))},getAvatarData(){const e=va.vcards.findWhere({jid:this.model.get("jid")});return{classes:"chat-msg__avatar",height:120,width:120,image:"data:"+((null==e?void 0:e.get("image_type"))||va.DEFAULT_IMAGE_TYPE)+";base64,"+((null==e?void 0:e.get("image"))||va.DEFAULT_IMAGE)}}});va.OccupantModal=wv;const Sv=wv,xv=e=>{const t=vh("XMPP Address"),n=vh("Email"),s=vh("Full Name"),i=vh("Nickname"),r=vh("The User's Profile Image"),o=vh("Refresh"),a=vh("Role"),c=vh("URL"),l={alt_text:r,extra_classes:"mb-3",height:"120",width:"120"};return Qc `
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "user-details-modal-label" > $ { e . display _name } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
$ { e . image ? Qc ` <div class="mb-4"> ${ Og ( Object . assign ( e , l ) ) } </div> ` : "" }
$ { e . fullname ? Qc ` <p><label> ${ s } :</label> ${ e . fullname } </p> ` : "" }
< p > < label > $ { t } : < / l a b e l > < a h r e f = " x m p p : $ { e . j i d } " > $ { e . j i d } < / a > < / p >
$ { e . nickname ? Qc ` <p><label> ${ i } :</label> ${ e . nickname } </p> ` : "" }
$ { e . url ? Qc ` <p><label> ${ c } :</label> <a target="_blank" rel="noopener" href=" ${ e . url } "> ${ e . url } </a></p> ` : "" }
$ { e . email ? Qc ` <p><label> ${ n } :</label> <a href="mailto: ${ e . email } "> ${ e . email } </a></p> ` : "" }
$ { e . role ? Qc ` <p><label> ${ a } :</label> ${ e . role } </p> ` : "" }
$ { e . _converse . pluggable . plugins [ "converse-omemo" ] . enabled ( e . _converse ) ? ( e => { const t = vh ( "OMEMO Fingerprints" ) , n = vh ( "No OMEMO-enabled devices found" ) , s = e . view . devicelist . devices ; return Qc `
< hr / >
< ul class = "list-group fingerprints" >
< li class = "list-group-item active" > $ { t } < / l i >
$ { s . length ? s . map ( ( t => ( e => { const t = vh ( "Trusted" ) , n = vh ( "Untrusted" ) ; return e . device . get ( "bundle" ) && e . device . get ( "bundle" ) . fingerprint ? Qc `
< li class = "list-group-item" >
< form class = "fingerprint-trust" >
< div class = "btn-group btn-group-toggle" >
< label class = "btn btn--small ${-1!==e.device.get(" trusted ")?" btn - primary active ":" btn - secondary "}" >
< input type = "radio" name = "${e.device.get(" id ")}" value = "1" ? checked = $ { - 1 !== e . device . get ( "trusted" ) } > $ { t }
< / l a b e l >
< label class = "btn btn--small ${-1!==e.device.get(" trusted ")?" btn - primary active ":" btn - secondary "}" >
< input type = "radio" name = "${e.device.get(" id ")}" value = "-1" ? checked = $ { - 1 === e . device . get ( "trusted" ) } > $ { n }
< / l a b e l >
< / d i v >
< code class = "fingerprint" > $ { e . utils . formatFingerprint ( e . device . get ( "bundle" ) . fingerprint ) } < / c o d e >
< / f o r m >
< / l i >
` :""})(Object.assign({device:t},e)))):Qc ` < li class = "list-group-item" > $ { n } < / l i > ` }
< / u l >
` })(e):""}
< / d i v >
< div class = "modal-footer" >
$ { Yg }
< button type = "button" class = "btn btn-info refresh-contact" > < i class = "fa fa-refresh" > < / i > $ { o } < / b u t t o n >
$ { e . allow _contact _removal && e . is _roster _contact ? ( e => { const t = vh ( "Remove as contact" ) ; return Qc `
< button type = "button" @ click = "${e.removeContact}" class = "btn btn-danger remove-contact" >
< i class = "far fa-trash-alt" > < / i > $ { t }
< / b u t t o n >
` })(e):""}
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
` },Ev=jl.env.utils,Av=Kg.extend({id:"user-details-modal",persistent:!0,events:{"click button.refresh-contact":"refreshContact","click .fingerprint-trust .btn input":"toggleDeviceTrust"},initialize(){Kg.prototype.initialize.apply(this,arguments),this.model.rosterContactAdded.then((()=>this.registerContactEventHandlers())),this.listenTo(this.model,"change",this.render),this.registerContactEventHandlers(),Cl.trigger("userDetailsModalInitialized",this.model)},toHTML(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.vcard,n=t?t.toJSON():{};return xv(Object.assign(this.model.toJSON(),n,{_converse:va,allow_contact_removal:Cl.settings.get("allow_contact_removal"),display_name:this.model.getDisplayName(),is_roster_contact:void 0!==this.model.contact,removeContact:e=>this.removeContact(e),view:this,utils:Ev}))},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");Ev.addClass("fa-spin",t);try{await Cl.vcard.update(this.model.contact.vcard,!0)}catch(e){M.fatal(e),this.alert(vh("Sorry, something went wrong while trying to refresh"),"danger")}Ev.removeClass("fa-spin",t)},removeContact(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),Cl.settings.get("allow_contact_removal")&&!0===confirm(vh("Are you sure you want to remove this contact?"))&&(setTimeout((()=>function(e){e.removeFromRoster((()=>e.destroy()),(t=>{t&&M.error(t),Cl.alert("error",vh("Error"),[vh("Sorry, there was an error while trying to remove %1 $ s as a contact.",e.getDisplayName())])}))}(this.model.contact)),1),this.modal.hide())}});va.UserDetailsModal=Av;const Cv=Av,{dayjs:Tv}=jl.env;function kv(e){return!!Il(e).host()}const jv=(e,t)=>e.url&&kv(e.url)&&!Fl(e.url)?Qc ` < a href = "${e.url}" target = "_blank" rel = "noopener" > $ { t ( e ) } < / a > ` : t ( e ) , N v = e = > Q c ` < c o n v e r s e - r i c h - t e x t c l a s s = " c a r d - i m g - t o p " t e x t = " $ { e . i m a g e } " s h o w _ i m a g e s ? h i d e _ m e d i a _ u r l s = $ { f u n c t i o n ( e ) { r e t u r n F l ( e . u r l ) | | B l ( e . u r l ) | | U l ( e . u r l ) } ( e . u r l ) } . o n I m g L o a d = $ { e . o n l o a d } > < / c o n v e r s e - r i c h - t e x t > ` ; v a r O v = n ( 7 4 1 5 ) , $ v = { } ; $ v . s t y l e T a g T r a n s f o r m = e g ( ) , $ v . s e t A t t r i b u t e s = Y f ( ) , $ v . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , $ v . d o m A P I = W f ( ) , $ v . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( O v . Z , $ v ) , O v . Z & & O v . Z . l o c a l s & & O v . Z . l o c a l s , C l . 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 U f { 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 } } } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = ( n = e . i m a g e ) & & z l ( n ) & & k v ( n ) ; v a r n ; c o n s t s = e . t i t l e | | e . d e s c r i p t i o n | | e . u r l ; r e t u r n t | | s ? Q c ` < d i v c l a s s = " c a r d c a r d - - u n f u r l " >
$ { t ? jv ( e , Nv ) : "" }
$ { s ? Qc `
< div class = "card-body" >
$ { e . title ? jv ( e , ( e => Qc ` <h5 class="card-title"> ${ e . title } </h5> ` ) ) : "" }
$ { e . description ? Qc ` <p class="card-text"><converse-rich-text text= ${ e . description } ></converse-rich-text></p> ` : "" }
$ { e . url ? Qc ` <p class="card-text"><a href=" ${ e . url } " target="_blank" rel="noopener"> ${ Il ( e . url ) . domain ( ) } </a></p> ` : "" }
< / d i v > ` : " " }
2021-11-12 22:09:04 +01:00
< /div>`:""})(Object.assign({onload:()=>this.onImageLoad()},{description:this.description||"",image:this.image||"",title:this.title||"",url:this.url||""}))}onImageLoad(){this.dispatchEvent(new CustomEvent("imageLoaded",{detail:this,bubbles:!0}))}});const Iv=(e={})=>{var t;return null!==(t=e.classes)&&void 0!==t&&t.includes("hor_centered")?Qc`<div class="spinner__container"><span class="spinner fa fa-spinner centered ${e.classes||""}"/ > < /div>`:Qc`<span class="spinner fa fa-spinner centered ${e.classes||""}"/ > ` };var Mv=n(3279),Rv=n.n(Mv);const{dayjs:Dv}=jl.env;function Lv(e){if(!e.isHidden()&&Cl.settings.get("allow_url_history_change")){const t=window.location.hash;t&&e.messages.get(t.slice(1))&&va.router.history.navigate()}}const zv=Rv()((e=>function(e){const t=e.target;if("converse-chat-content"!==t.nodeName.toLowerCase())return;let n=!0;const s=0===Math.floor(t.scrollTop),i=Math.ceil(t.clientHeight-t.scrollTop)>=t.scrollHeight-Math.ceil(t.scrollHeight/20);s?(n=!1,Lv(t.model)):i&&Cl.trigger("chatBoxScrolledUp",t),t.model.get("scolled")!==n&&t.model.ui.set({scrolled:n})}(e)),50);function Pv(e){if("groupchat"===e.get("type")){var t;const n=Cl.settings.get("muc_hats").filter((e=>e)).map((e=>e.toLowerCase()));let s=[];n.includes("vcard_roles")&&(s=e.vcard?e.vcard.get("role"):null,s=s?s.split(",").filter((e=>e)).map((e=>({title:e}))):[]);const i=[...e.occupant?[e.occupant.get("role")]:[],...e.occupant?[e.occupant.get("affiliation")]:[]].filter((e=>e)).filter((e=>n.includes(e.toLowerCase()))).map((e=>({title:e})));return[...n.includes("xep317")&&(null===(t=e.occupant)||void 0===t?void 0:t.get("hats"))||[],...s,...i]}return[]}const{Strophe:Fv,dayjs:Uv}=jl.env;Cl.elements.define("converse-chat-message",class extends Uf{static get properties(){return{jid:{type:String},mid:{type:String}}}connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){await this.setModels(),this.model?(this.listenTo(this.chatbox,"change:first_unread_id",this.requestUpdate),this.listenTo(this.model,"change",this.requestUpdate),this.model.vcard&&this.listenTo(this.model.vcard,"change",this.requestUpdate),"groupchat"===this.model.get("type")&&(this.model.occupant?this.listenTo(this.model.occupant,"change",this.requestUpdate):this.listenTo(this.model,"occupantAdded",(()=>{this.listenTo(this.model.occupant,"change",this.requestUpdate)})))):M.error("Could not find module for converse-chat-message")}async setModels(){this.chatbox=await Cl.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?Iv():this.model.get("file")&&this.model.get("upload")!==va.SUCCESS?this.renderFileProgress():["error","info"].includes(this.model.get("type"))?this.renderInfoMessage():this.renderChatMessage():""}getProps(){return Object.assign(this.model.toJSON(),this.getDerivedMessageProps())}renderInfoMessage(){return(e=>{const t=Tv(e.model.get("time")).toISOString(),n=vh("Retry");return Qc `
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 >
$ { e . model . get ( "reason" ) ? Qc ` <q class="reason"> ${ e . model . get ( "reason" ) } </q> ` : "" }
$ { e . model . get ( "error_text" ) ? Qc ` <q class="reason"> ${ e . model . get ( "error_text" ) } </q> ` : "" }
$ { e . model . get ( "retry_event_id" ) ? Qc ` <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 ( ) { i f ( ! t h i s . m o d e l . f i l e ) r e t u r n " " ; c o n s t e = v h ( " U p l o a d i n g f i l e : " ) , t = t h i s . m o d e l . f i l e . n a m e , n = v d ( ) ( t h i s . m o d e l . f i l e . s i z e ) ; r e t u r n Q c `
2021-03-19 19:26:15 +01:00
< div class = "message chat-msg" >
2021-11-11 22:06:49 +01:00
$ { _v ( this . getAvatarData ( ) ) }
2021-03-19 19:26:15 +01:00
< div class = "chat-msg__content" >
< span class = "chat-msg__text" > $ { e } < strong > $ { t } < / s t r o n g > , $ { n } < / s p a n >
2021-11-11 22:06:49 +01:00
< progress value = "${this.model.get(" progress ")}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v > ` } 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 ) = > { v a r n , s ; c o n s t i = v h ( " N e w m e s s a g e s " ) ; r e t u r n Q c `
$ { t . is _first _unread ? Qc ` <div class="message separator"><hr class="separator"><span class="separator-text"> ${ i } </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
2021-11-11 22:06:49 +01:00
< a class = "show-msg-author-modal" @ click = $ { e . showUserModal } > $ { t . should _show _avatar ? _v ( e . getAvatarData ( ) ) : "" } < / a >
< div class = "chat-msg__content chat-msg__content--${t.sender} ${t.is_me_message?" chat - msg _ _content -- action ":" "}" >
2021-03-19 19:26:15 +01:00
2021-11-11 22:06:49 +01:00
$ { t . is _me _message ? "" : Qc `
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 >
$ { t . hats . map ( ( e => Qc ` <span class="badge badge-secondary"> ${ e . title } </span> ` ) ) }
< time timestamp = "${e.model.get(" edited ")||e.model.get(" time ")}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e >
$ { t . is _encrypted ? Qc ` <span class="fa fa-lock"></span> ` : "" }
2021-03-19 19:26:15 +01:00
< / s p a n > ` }
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" >
2021-11-11 22:06:49 +01:00
$ { t . is _me _message ? Qc `
< 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 }
2021-11-11 22:06:49 +01:00
? correcting = $ { t . correcting }
? editable = $ { t . editable }
? hide _url _previews = $ { e . model . get ( "hide_url_previews" ) }
? is _retracted = $ { t . is _retracted }
unfurls = "${null===(n=e.model.get(" ogp _metadata "))||void 0===n?void 0:n.length}"
message _type = "${t.message_type}" > < / 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
$ { e . model . get ( "hide_url_previews" ) ? "" : null === ( s = e . model . get ( "ogp_metadata" ) ) || void 0 === s ? void 0 : s . map ( ( t => { var n ; return Qc ` <converse-message-unfurl
@ animationend = "${e.onUnfurlAnimationEnd}"
class = "${e.model.get(" url _preview _transition ")}"
jid = "${null===(n=e.chatbox)||void 0===n?void 0:n.get(" jid ")}"
description = "${t[" og : description "]||" "}"
title = "${t[" og : title "]||" "}"
image = "${t[" og : image "]||" "}"
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 >
2021-11-11 22:06:49 +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 C l . 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 ( ) & & " h e a d l i n e " ! = = t h i s . t y p e } g e t A v a t a r D a t a ( ) { v a r e , t ; r e t u r n { c l a s s e s : " c h a t - m s g _ _ a v a t a r " , h e i g h t : 3 6 , w i d t h : 3 6 , i m a g e : " d a t a : " + ( ( n u l l = = = ( e = t h i s . m o d e l . v c a r d ) | | v o i d 0 = = = e ? v o i d 0 : e . g e t ( " i m a g e _ t y p e " ) ) | | v a . D E F A U L T _ I M A G E _ T Y P E ) + " ; b a s e 6 4 , " + ( ( n u l l = = = ( t = t h i s . m o d e l . v c a r d ) | | v o i d 0 = = = t ? v o i d 0 : t . g e t ( " i m a g e " ) ) | | v a . D E F A U L T _ I M A G 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 : ! t h i s . m o d e l . g e t ( " h i d e _ u r l _ p r e v i e w s " ) , 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 C l . 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 ( ) { v a r e ; r e t u r n n u l l = = = ( e = t h i s . m o d e l . o c c u p a n t ) | | v o i d 0 = = = e ? v o i d 0 : e . 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 ( ) { v a r e ; r e t u r n n u l l = = = ( e = t h i s . m o d e l . o c c u p a n t ) | | v o i d 0 = = = e ? v o i d 0 : e . 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 = C l . 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 : U v ( 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 : P v ( 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 " = = = 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 : F v . 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 v h ( " % 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 v h ( " % 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 ( ) ) } r e n d e r R e t r a c t i o n ( ) { c o n s t e = t h i s . i s R e t r a c t e d ( ) ? t h i s . g e t R e t r a c t i o n T e x t ( ) : n u l l ; r e t u r n Q c `
2021-03-19 19:26:15 +01:00
< div > $ { e } < / d i v >
2021-11-11 22:06:49 +01:00
$ { this . model . get ( "moderation_reason" ) ? Qc ` <q class="chat-msg--retracted__reason"> ${ this . model . get ( "moderation_reason" ) } </q> ` : "" }
` }renderMessageText(){return(e=>{const t=vh("Show more"),n="groupchat"===e.model.get("type"),s=vh("Show less"),i=Qc `
< 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 } >
< i class = "fa ${e.model.get(" is _spoiler _visible ")?" fa - eye - slash ":" fa - eye "}" > < / i >
$ { e . model . get ( "is_spoiler_visible" ) ? s : t }
< / a >
< / d i v >
` ,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 Qc `
$ { e . model . get ( "is_spoiler" ) ? i : "" }
$ { e . model . get ( "subject" ) ? Qc ` <div class="chat-msg__subject"> ${ e . model . get ( "subject" ) } </div> ` : "" }
< span >
< converse - chat - message - body
class = "chat-msg__text ${e.model.get(" is _only _emojis ")?" chat - msg _ _text -- larger ":" "} ${r}"
. model = "${e.model}"
? hide _url _previews = $ { e . model . get ( "hide_url_previews" ) }
? is _me _message = $ { e . model . isMeCommand ( ) }
? show _images = $ { Cl . settings . get ( "show_images_inline" ) }
? embed _videos = $ { Cl . settings . get ( "embed_videos" ) }
? embed _audio = $ { Cl . settings . get ( "embed_audio" ) }
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 >
$ { ! e . model . get ( "received" ) || e . model . isMeCommand ( ) || n ? "" : Qc ` <span class="fa fa-check chat-msg__receipt"></span> ` }
$ { e . model . get ( "edited" ) ? ( e => { const t = vh ( "This message has been edited" ) ; return Qc ` <converse-icon title=" ${ t } " class="fa fa-edit chat-msg__edit-modal" @click= ${ e . showMessageVersionsModal } size="1em"></converse-icon> ` } ) ( e ) : "" }
< / s p a n >
$ { a ? Qc ` <div class="chat-msg__media"> ${ Mp ( e . model . get ( "oob_url" ) ) } </div> ` : "" }
< div class = "chat-msg__error" > $ { e . model . get ( "error_text" ) || e . model . get ( "error" ) } < / d i v >
` })(this)}showUserModal(e){if("me"===this.model.get("sender"))Cl.modal.show(va.ProfileModal,{model:this.model},e);else if("groupchat"===this.model.get("type"))e.preventDefault(),Cl.modal.show(Sv,{model:this.model.occupant},e);else{e.preventDefault();const t=this.model.collection.chatbox;Cl.modal.show(Cv,{model:t},e)}}showMessageVersionsModal(e){e.preventDefault(),Cl.modal.show(yv,{model:this.model},e)}toggleSpoilerMessage(e){null==e||e.preventDefault(),this.model.save({is_spoiler_visible:!this.model.get("is_spoiler_visible")})}}),Cl.elements.define("converse-message-history",class extends Uf{static get properties(){return{model:{type:Object},messages:{type:Array}}}render(){const e=this.messages;return e.length?jg(e,(e=>e.get("id")),(e=>Qc ` $ { this . renderMessage ( e ) } ` )):""}renderMessage(e){if(e.get("dangling_retraction")||e.get("is_only_key"))return"";const t=e.get("template_hook");if("string"==typeof t){const n=Cl.hook(t,e,"");return dp(n,"")}{const t=Qc ` < converse - chat - message
jid = "${this.model.get(" jid ")}"
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 ) { v a r t ; c o n s t n = n u l l = = = ( t = e . c o l l e c t i o n ) | | v o i d 0 = = = t ? v o i d 0 : t . m o d e l s ; i f ( ! n ) r e t u r n ; c o n s t s = n . i n d e x O f ( e ) , i = n [ s - 1 ] ; i f ( ! i | | D v ( e . g e t ( " t i m e " ) ) . i s A f t e r ( D v ( i . g e t ( " t i m e " ) ) , " d a y " ) ) { c o n s t t = D v ( e . g e t ( " t i m e " ) ) . s t a r t O f ( " d a y " ) ; r e t u r n ( e = > Q c `
< div class = "message date-separator" data - isodate = "${e.time}" >
2021-03-19 19:26:15 +01:00
< hr class = "separator" / >
2021-11-11 22:06:49 +01:00
< time class = "separator-text" datetime = "${e.time}" > < span > $ { e . datestring } < / s p a n > < / t i m e >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
` )({type:"date",time:t.toISOString(),datestring:t.format("dddd MMM Do YYYY")})}}(e);return n?[n,t]:t}}});var Bv=n(8269),qv={};qv.styleTagTransform=eg(),qv.setAttributes=Yf(),qv.insert=Jf().bind(null,"head"),qv.domAPI=Wf(),qv.insertStyleElement=Xf(),Hf()(Bv.Z,qv),Bv.Z&&Bv.Z.locals&&Bv.Z.locals,Cl.elements.define("converse-chat-content",class extends Uf{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.initialize()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",zv)}async initialize(){await this.setModels(),this.listenTo(this.model,"change:hidden_occupants",this.requestUpdate),this.listenTo(this.model.messages,"add",this.requestUpdate),this.listenTo(this.model.messages,"change",this.requestUpdate),this.listenTo(this.model.messages,"remove",this.requestUpdate),this.listenTo(this.model.messages,"rendered",this.requestUpdate),this.listenTo(this.model.messages,"reset",this.requestUpdate),this.listenTo(this.model.notifications,"change",this.requestUpdate),this.listenTo(this.model.ui,"change",this.requestUpdate),this.listenTo(this.model.ui,"change:scrolled",this.scrollDown),this.model.occupants&&this.listenTo(this.model.occupants,"change",this.requestUpdate),this.addEventListener("scroll",zv)}async setModels(){this.model=await Cl.chatboxes.get(this.jid),await this.model.initialized,this.requestUpdate()}render(){var e;return this.model?Qc `
< 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 >
2021-11-11 22:06:49 +01:00
$ { null !== ( e = this . model . ui ) && void 0 !== e && e . get ( "chat-content-spinner-top" ) ? Qc ` <span class="spinner fa fa-spinner centered"></span> ` : "" }
` :""}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;Cl.trigger("chatBoxScrolledDown",{chatbox:this.model})}}});class Hv extends wg{constructor(e){if(super(e),this.vt=Zc,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Zc)return this.Vt=void 0,this.vt=e;if(e===Xc)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.vt)return this.Vt;this.vt=e;const t=[e];return t.raw=t,this.Vt={_ $ litType $ :this.constructor.resultType,strings:t,values:[]}}}Hv.directiveName="unsafeHTML",Hv.resultType=1;const Gv=_g(Hv);Cl.elements.define("converse-chat-help",class extends Uf{static get properties(){return{chat_type:{type:String},messages:{type:Array},model:{type:Object},type:{type:String}}}render(){const e=(new Date).toISOString();return[Qc ` < converse - icon class = "fas fa-times close-chat-help"
2021-03-19 19:26:15 +01:00
@ click = $ { this . close }
2021-11-11 22:06:49 +01:00
path - prefix = "${Cl.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 : N 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 Q c ` < 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 } " > $ { G v ( e . m a r k u p ) } < / d i v > ` } } ) ; c o n s t W v = j l . e n v . u t i l s , V v = e = > Q c `
2021-03-19 19:26:15 +01:00
< li class = "emoji insert-emoji ${e.shouldBeHidden(e.emoji.sn)?" hidden ":" "}" data - emoji = "${e.emoji.sn}" title = "${e.emoji.sn}" >
2021-11-11 22:06:49 +01:00
< a href = "#" @ click = $ { e . insertEmoji } data - emoji = "${e.emoji.sn}" > $ { Wv . shortnamesToEmojis ( e . emoji . sn ) } < / a >
2021-03-19 19:26:15 +01:00
< / l i >
2021-11-11 22:06:49 +01:00
` ,Jv=e=>{const t=vh("Search");return Qc `
2021-03-19 19:26:15 +01: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 } >
2021-11-11 22:06:49 +01:00
$ { e . query ? "" : ( e => { const t = Cl . settings . get ( "emoji_categories" ) ; return Qc ` <ul> ${ Object . keys ( t ) . map ( ( n => t [ n ] ? ( e => Qc `
< li data - category = "${e.category}"
class = "emoji-category ${e.category} ${e.current_category===e.category?" picked ":" "}"
title = "${vh(Cl.settings.get(" emoji _category _labels ")[e.category])}" >
< a class = "pick-category"
@ click = $ { e . onCategoryPicked }
href = "#emoji-picker-${e.category}"
data - category = "${e.category}" > $ { e . emoji } < / a >
< / l i >
` )(Object.assign({category:n,emoji:e.sn2Emoji(t[n])},e)):""))}</ul> ` } ) ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
$ { e . render _emojis ? Qc ` <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" >
< label > Skin tone < / l a b e l >
2021-11-11 22:06:49 +01:00
< ul > $ { [ "tone1" , "tone2" , "tone3" , "tone4" , "tone5" ] . map ( ( t => ( e => Qc `
2021-03-19 19:26:15 +01:00
< li data - skintone = "${e.skintone}" class = "emoji-skintone ${e.current_skintone===e.skintone?" picked ":" "}" >
2021-11-11 22:06:49 +01:00
< a class = "pick-skintone" href = "#" data - skintone = "${e.skintone}" @ click = $ { e . onSkintonePicked } > $ { Wv . shortnamesToEmojis ( ":" + e . skintone + ":" ) } < / a >
< / 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 >
< / d i v > ` } , { s i z z l e : K v } = j l . e n v ; C l . 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 U f { 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 Q c `
2021-03-19 19:26:15 +01:00
< div class = "emoji-picker__lists" >
2021-11-11 22:06:49 +01:00
$ { ( e => { const t = vh ( "Search results" ) ; return Qc `
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" >
2021-11-11 22:06:49 +01:00
$ { e . search _results . map ( ( t => Vv ( Object . assign ( { emoji : t } , e ) ) ) ) }
2021-03-19 19:26:15 +01:00
< / u l >
< / s p a n >
` })(e)}
2021-11-11 22:06:49 +01:00
$ { ( e => { const t = Cl . settings . get ( "emoji_categories" ) ; return Qc `
< span ? hidden = $ { e . query } class = "emoji-lists__container emoji-lists__container--browse" >
$ { Object . keys ( t ) . map ( ( n => t [ n ] ? ( e => Qc `
< a id = "emoji-picker-${e.category}" class = "emoji-category__heading" data - category = "${e.category}" > $ { vh ( Cl . settings . get ( "emoji_category_labels" ) [ e . category ] ) } < / a >
< ul class = "emoji-picker" data - category = "${e.category}" >
$ { Object . values ( jl . emojis . json [ e . category ] ) . map ( ( t => Vv ( Object . assign ( { emoji : t } , e ) ) ) ) }
< / u l > ` ) ( O b j e c t . a s s i g n ( { c a t e g o r y : n } , e ) ) : " " ) ) }
< / s p a n > ` } ) ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +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)}Kv(".emoji-picker",this).forEach((e=>this.observer.observe(e)))}}setCategoryOnVisibilityChange(e){const t=this.parentElement.navigator.selected;let n;if(n=e.filter((e=>e.target.contains(t))).pop()||e.reduce(((e,t)=>t.intersectionRatio>=((null==e?void 0:e.intersectionRatio)||0)?t:e),null),n&&n.isIntersecting){const e=n.target.getAttribute("data-category");e!==this.model.get("current_category")&&(this.parentElement.preserve_scroll=!0,this.model.save({current_category:e}))}}insertEmoji(e){e.preventDefault(),e.stopPropagation();const t="IMG"===e.target.nodeName?e.target.parentElement:e.target;this.parentElement.insertIntoTextArea(t.getAttribute("data-emoji"))}shouldBeHidden(e){if(e.includes("_tone")){if(!this.current_skintone||!e.includes(this.current_skintone))return!0}else if(this.current_skintone&&jl.emojis.toned.includes(e))return!0;return!(!this.query||va.FILTER_CONTAINS(e,this.query))}});const Yv=jl.env.utils;Cl.elements.define("converse-emoji-dropdown",class extends vv{static get properties(){return{chatview:{type:Object}}}constructor(){super(),this.render_emojis=!1}initModel(){return this.init_promise||(this.init_promise=(async()=>{await Cl.emojis.initialize();const e= ` converse . emoji - $ { va . bare _jid } - $ { this . chatview . model . get ( "jid" ) } ` ;this.model=new va.EmojiPicker({id:e}),_o(this.model,e),await new Promise((e=>this.model.fetch({success:e,error:e}))),this.model.set({autocompleting:null,ac_position:null})})()),this.init_promise}render(){return Qc `
2021-03-19 19:26:15 +01:00
< div class = "dropup" >
< button class = "toggle-emojis"
2021-11-11 22:06:49 +01:00
title = "${vh(" Insert emojis ")}"
2021-03-19 19:26:15 +01:00
data - toggle = "dropdown"
aria - haspopup = "true"
aria - expanded = "false" >
< converse - icon
class = "fa fa-smile "
2021-11-11 22:06:49 +01:00
path - prefix = "${Cl.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" >
2021-11-11 22:06:49 +01:00
$ { dp ( this . initModel ( ) . then ( ( ( ) => Qc `
2021-03-19 19:26:15 +01:00
< converse - emoji - picker
. chatview = $ { this . chatview }
. model = $ { this . model }
? 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 >
2021-11-11 22:06:49 +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 ( ) , Y v . h a s C l a s s ( " s h o w " , t h i s . m e n u ) ? Y v . 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 , a w a i t t h i s . r e q u e s t U p d a 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 ( ( ( ) = > { v a r e ; r e t u r n n u l l = = = ( e = 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 " ) ) | | v o i d 0 = = = e ? v o i d 0 : e . f o c u s ( ) } ) ) } } ) ; v a r Q v = n ( 9 7 9 6 ) , X v = { } ; X v . s t y l e T a g T r a n s f o r m = e g ( ) , X v . s e t A t t r i b u t e s = Y f ( ) , X v . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , X v . d o m A P I = W f ( ) , X v . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( Q v . Z , X v ) , Q v . Z & & Q v . Z . l o c a l s & & Q v . Z . l o c a l s ; c o n s t Z v = j l . e n v . u t i l s ; C l . 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 U f { 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 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 . _ 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 = h c ( ( 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 J v ( { 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 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 v . 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 = v a . 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 = j l . 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 = [ ] ) ; t h i s . r e q u e s t U p d a t e ( ) } 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 ) , 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 = = = j l . k e y c o d e s . E N T E R & & t h i s . n a v i g a t o r . s e l e c t e d & & Z v . 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 = = = j l . k e y c o d e s . 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 v . 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 ) ) } 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 = ( n u l l = = e ? v o i d 0 : 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 . c h a t v i e w . g e t M e s s a g e F o r m ( ) . i n s e r t I n t o T e x t A r e a ( e , t , ! 1 , 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 } ) } 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 e " ) . t r i m ( ) ; t h i s . c u r r e n t _ s k i n t o n e = = = t ? t h i s . m o d e l . s a v e ( { c u r r e n t _ s k i n t o n e : " " } ) : t h i s . m o d e l . s a v e ( { c u r r e n t _ s k i n t o n e : t } ) } c h o o s e C a t e g o r y ( 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 ( ) , e . s t o p P r o p a g a t i o n & & e . s t o p P r o p a g a t i o n ( ) ;
< a href = "#" class = "dropdown-item ${t.a_class}" @ click = $ { t . handler } title = "${t.i18n_title}" >
< converse - icon size = "1em" color = "var(--text-color-lighten-15-percent)" class = "fa ${t.icon_class}" > < / c o n v e r s e - i c o n >
$ { t . i18n _text }
< / a >
` }async function ib(e){const t=await e;return Qc `
< a
href = "#"
class = "chatbox-btn ${t.a_class} fa ${t.icon_class}"
@ click = $ { t . handler }
title = "${t.i18n_title}"
> < / a >
` }async function rb(e){!0===confirm(vh("Are you sure you want to clear the messages from this conversation?"))&&await e.clearMessages()}function ob(e,t){const n=t.replace(/^ \s */,"").match(/^ \/ (.*) \s * $ /);if(n){if("clear"===n[1])return rb(e),!0;var s;if("close"===n[1])return null===(s=va.chatboxviews.get(e.get("jid")))||void 0===s||s.close(),!0;if("help"===n[1])return e.set({show_help_messages:!1},{silent:!0}),e.set({show_help_messages:!0}),!0}}function ab(e){if(e.target.value){const t=e.target.scrollHeight+"px";e.target.style.height!=t&&(e.target.style.height="auto",e.target.style.height=t)}else e.target.style=""}window.customElements.define("converse-chat-toolbar",class extends Uf{static get properties(){return{composing_spoiler:{type:Boolean},hidden_occupants:{type:Boolean},is_groupchat:{type:Boolean},message_limit:{type:Number},model:{type:Object},show_call_button:{type:Boolean},show_emoji_button:{type:Boolean},show_send_button:{type:Boolean},show_spoiler_button:{type:Boolean}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdate)}render(){const e=vh("Send the message");return Qc `
< span class = "toolbar-buttons" > $ { dp ( this . getButtons ( ) , "" ) } < / s p a n >
$ { this . show _send _button ? Qc ` <button type="submit" class="btn send-button fa fa-paper-plane" title=" ${ e } "></button> ` : "" }
` }firstUpdated(){Cl.trigger("renderToolbar",this)}getButtons(){var e;const t=[];if(this.show_emoji_button){const e=va.chatboxviews.get(this.model.get("jid"));t.push(Qc ` < converse - emoji - dropdown . chatview = $ { e } > < / 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 e = v h ( " S t a r t a c a l l " ) ; t . p u s h ( Q c `
< button class = "toggle-call" @ click = $ { this . toggleCall } title = "${e}" >
2021-03-19 19:26:15 +01:00
< converse - icon class = "fa fa-phone" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
2021-11-11 22:06:49 +01:00
< / b u t t o n > ` ) } C l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & t . p u s h ( Q c `
< converse - message - limit - indicator . model = $ { this . model } class = "right" >
< / 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 & & t . 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 n = C l . d i s c o . s u p p o r t s ( n b . N S . H T T P U P L O A D , v a . d o m a i n ) ; i f ( t . p u s h ( Q c ` $ { d p ( n . 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 & & n u l l ! = = ( e = C l . 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 " ) ) & & v o i d 0 ! = = e & & e . t o g g l e _ o c c u p a n t s ) { c o n s t e = v h ( " H i d e p a r t i c i p a n t s " ) , n = v h ( " S h o w p a r t i c i p a n t s " ) ; t . p u s h ( Q c `
2021-03-19 19:26:15 +01:00
< button class = "toggle_occupants right"
2021-11-11 22:06:49 +01:00
title = "${this.hidden_occupants?n:e}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleOccupants } >
< converse - icon class = "fa ${this.hidden_occupants?" fa - angle - double - left ":" fa - angle - double - right "}"
2021-11-11 22:06:49 +01:00
path - prefix = "${Cl.settings.get(" assets _path ")}" size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n > ` ) } r e t u r n v a . 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 , t ) } 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 = v h ( " C h o o s e a f i l e t o s e n d " ) ; r e t u r n Q c `
2021-03-19 19:26:15 +01:00
< button title = "${e}" @ click = $ { this . toggleFileUpload } >
< converse - icon class = "fa fa-paperclip"
2021-11-11 22:06:49 +01:00
path - prefix = "${Cl.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 >
2021-11-11 22:06:49 +01:00
< input type = "file" @ change = $ { this . onFileSelection } class = "fileupload" multiple = "" style = "display:none" / > ` }return""}getSpoilerButton(){var e;const t=this.model;if(!(this.is_groupchat||null!==(e=t.presence)&&void 0!==e&&e.resources.length))return;let n;n=this.composing_spoiler?vh("Click to write as a normal (non-spoiler) message"):vh("Click to write your message as a spoiler");const s=Qc `
2021-03-19 19:26:15 +01:00
< button class = "toggle-compose-spoiler"
2021-11-11 22:06:49 +01:00
title = "${n}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleComposeSpoilerMessage } >
< converse - icon class = "fa ${this.composing_spoiler?" fa - eye - slash ":" fa - eye "}"
2021-11-11 22:06:49 +01:00
path - prefix = "${Cl.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 >
2021-11-11 22:06:49 +01:00
< /button>`;if(this.is_groupchat)return s;{const e=t.get("jid"),n=Promise.all(t.presence.resources.map((t=>Cl.disco.supports(nb.NS.SPOILER,`${e}/ $ { t . get ( "name" ) } ` )))).then((e=>e.reduce(((e,t)=>e&&t),!0)));return Qc ` $ { dp ( n . then ( ( ( ) => s ) ) , "" ) } ` }}toggleFileUpload(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.querySelector(".fileupload").click()}onFileSelection(e){this.model.sendFiles(e.target.files)}toggleComposeSpoilerMessage(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.set("composing_spoiler",!this.model.get("composing_spoiler"))}toggleOccupants(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.save({hidden_occupants:!this.model.get("hidden_occupants")})}toggleCall(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),Cl.trigger("callButtonClicked",{connection:va.connection,model:this.model})}});var cb=n(6220),lb={};lb.styleTagTransform=eg(),lb.setAttributes=Yf(),lb.insert=Jf().bind(null,"head"),lb.domAPI=Wf(),lb.insertStyleElement=Xf(),Hf()(cb.Z,lb),cb.Z&&cb.Z.locals&&cb.Z.locals,Cl.elements.define("converse-chat-heading",class extends Uf{connectedCallback(){super.connectedCallback(),this.initialize()}initialize(){var e;this.model=va.chatboxes.get(this.getAttribute("jid")),this.listenTo(this.model,"change:status",this.requestUpdate),this.listenTo(this.model,"vcard:change",this.requestUpdate),this.model.contact&&this.listenTo(this.model.contact,"destroy",this.requestUpdate),null===(e=this.model.rosterContactAdded)||void 0===e||e.then((()=>{this.listenTo(this.model.contact,"change:nickname",this.requestUpdate),this.requestUpdate()}))}render(){return(e=>{var t;const n=null===(t=e.model)||void 0===t?void 0:t.vcard,s=n?n.toJSON():{},i=vh("The User's Profile Image"),r=Object.assign({alt_text:i,extra_classes:"",height:40,width:40},s),o=Qc ` < span class = "mr-2" > $ { _v ( r ) } < / s p a n > ` , a = 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 Q c `
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
$ { va . api . settings . get ( "singleton" ) ? "" : Qc ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
$ { e . type !== va . HEADLINES _TYPE ? Qc ` <a class="show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ o } </a> ` : "" }
< div class = "chatbox-title__text" title = "${e.jid}" >
$ { e . type !== va . HEADLINES _TYPE ? Qc ` <a class="user show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ a } </a> ` : a }
< / 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" >
$ { dp ( async function ( e ) { return ( await e ) . filter ( ( e => ! e . standalone ) ) . map ( ( e => sb ( e ) ) ) } ( e . heading _buttons _promise ) . then ( ( e => e . length ? Qc ` <converse-dropdown class="dropleft" color="var(--chat-head-text-color)" .items= ${ e } ></converse-dropdown> ` : "" ) ) , "" ) }
$ { dp ( async function ( e ) { return ( await e ) . filter ( ( e => e . standalone ) ) . map ( ( e => ib ( e ) ) ) } ( e . heading _buttons _promise ) . then ( ( e => e . reverse ( ) . map ( ( e => dp ( e , "" ) ) ) ) ) , "" ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
$ { e . status ? Qc ` <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(),Cl.modal.show(Cv,{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:vh("Details"),i18n_title:vh("See more information about this person"),icon_class:"fa-id-card",name:"details",standalone:"overlayed"===Cl.settings.get("view_mode")}];Cl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:vh("Close"),i18n_title:vh("Close and end this conversation"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Cl.settings.get("view_mode")});const t=va.chatboxviews.get(this.getAttribute("jid"));return t?va.api.hook("getHeadingButtons",t,e):e}});const{u:db}=jl.env;class ub extends mg{async connectedCallback(){super.connectedCallback(),this.model=va.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.listenTo(this.model.messages,"change:correcting",this.onMessageCorrecting),this.render()}toHTML(){var e,t;return(e=>{const t=e.composing_spoiler?vh("Hidden message"):vh("Message"),n=vh("Optional hint"),s=Cl.settings.get("show_send_button");return Qc `
< form class = "sendXMPPMessage" >
< input type = "text" placeholder = "${n||" "}" value = "${e.hint_value||" "}" class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
< textarea
autofocus
type = "text"
@ drop = $ { e . onDrop }
@ input = $ { ab }
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea
$ { s ? "chat-textarea-send-button" : "" }
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
2021-11-12 22:09:04 +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 : n u l l = = = ( 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 o i d 0 = = = e ? v o i d 0 : e . v a l u e , m e s s a g e _ v a l u e : n u l l = = = ( 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 " ) ) | | v o i d 0 = = = t ? v o i d 0 : t . 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 , t = ! 1 , n = ! 1 , s ) { 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 ? d b . a d d C l a s s ( " c o r r e c t i n g " , i ) : d b . 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 ) , d b . 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 ( d b . p r e f i x M e n t i o n s ( 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 ( d b . p r e f i x M e n t i o n s ( 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 ) { 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 . 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 & & 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 = = = j l . k e y c o d e s . T A B ) { c o n s t t = d b . 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 = = = j l . 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 = = = j l . 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 = = = j l . 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 ! = = j l . 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 = = = j l . 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 & & d b . 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 | | d b . 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 ( ) } } [ j l . k e y c o d e s . S H I F T , j l . k e y c o d e s . M E T A , j l . k e y c o d e s . M E T A _ R I G H T , j l . k e y c o d e s . E S C A P E , j l . 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 " ) ! = = v a . 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 ( v a . C O M P O S I N G ) } } p a r s e M e s s a g e F o r C o m m a n d s ( e ) { r e t u r n o b ( t h i s . m o d e l , e ) } a s y n c o n F o r m S u b m i t t e d ( e ) { v a r t , n ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) ; c o n s t s = 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 = s . v a l u e . t r i m ( ) ; i f ( C l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & i . l e n g t h > C l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) | | ! i . r e p l a c e ( / \ s / g , " " ) . l e n g t h ) r e t u r n ; i f ( ! v a . 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 = v h ( " 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 C l . a l e r t ( " e r r o r " , v h ( " E r r o r " ) , e ) , v o i d C l . c o n n e c t i o n . r e c o n n e c t ( ) } l e t r , o = { } ; 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 " ) & & ( o = 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 " ) , r = o . v a l u e ) , d b . a d d C l a s s ( " d i s a b l e d " , s ) , s . 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 " ) , n u l l = = = ( 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 - e m o j i - d r o p d o w n " ) ) | | v o i d 0 = = = n | | n . h i d e M e n u ( ) ; c o n s t a = t h i s . p a r s e M e s s a g e F o r C o m m a n d s ( i ) , c = a ? 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 : i , s p o i l e r _ h i n t : r } ) ; ( a | | c ) & & ( o . v a l u e = " " , s . v a l u e = " " , d b . r e m o v e C l a s s ( " c o r r e c t i n g " , s ) , s . 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 " = = = C l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & ( v a . 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 " ) , s . r e m o v e A t t r i b u t e ( " d i s a b l e d " ) , d b . r e m o v e C l a s s ( " d i s a b l e d " , s ) , " o v e r l a y e d " = = = C l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & ( v a . 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 = " " ) , t h i s . m o d e l . s e t C h a t S t a t e ( v a . A C T I V E , { s i l e n t : ! 0 } ) , s . f o c u s ( ) } } C l . 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 - f o r m " ,
2021-11-11 22:06:49 +01:00
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? Qc ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { Cl . settings . get ( "show_toolbar" ) ? Qc `
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? composing _spoiler = "${e.model.get(" composing _spoiler ")}"
? show _call _button = "${s}"
? show _emoji _button = "${i}"
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
? 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 >
` })({model:this.model,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}sendButtonClicked(e){var t;null===(t=this.querySelector("converse-message-form"))||void 0===t||t.onFormSubmitted(e)}viewUnreadMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.ui.set({scrolled:!1})}emitFocused(e){var t;null===(t=va.chatboxviews.get(this.getAttribute("jid")))||void 0===t||t.emitFocused(e)}emitBlurred(e){var t;null===(t=va.chatboxviews.get(this.getAttribute("jid")))||void 0===t||t.emitBlurred(e)}onDrop(e){0!=e.dataTransfer.files.length&&(e.preventDefault(),this.model.sendFiles(e.dataTransfer.files))}onDragOver(e){e.preventDefault()}clearMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),rb(this.model)}async autocompleteInPicker(e,t){await Cl.emojis.initialize();const n=this.querySelector("converse-emoji-picker");if(n){n.model.set({ac_position:e.selectionStart,autocompleting:t,query:t});const s=this.querySelector("converse-emoji-dropdown");null==s||s.showMenu()}}}Cl.elements.define("converse-chat-bottom-panel",fb);class gb extends Uf{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),va.chatboxviews.remove(this.jid,this)}updated(){this.model&&this.jid!==this.model.get("jid")&&(this.stopListening(),va.chatboxviews.remove(this.model.get("jid"),this),delete this.model,this.requestUpdate(),this.initialize())}close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.close(e)}maybeFocus(){Cl.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)||Cl.trigger("chatBoxBlurred",this,e)}emitFocused(e){this.contains(e.relatedTarget)||Cl.trigger("chatBoxFocused",this,e)}getBottomPanel(){return this.model.get("type")===va.CHATROOMS_TYPE?this.querySelector("converse-muc-bottom-panel"):this.querySelector("converse-chat-bottom-panel")}getMessageForm(){return this.model.get("type")===va.CHATROOMS_TYPE?this.querySelector("converse-muc-message-form"):this.querySelector("converse-message-form")}scrollDown(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.ui.get("scrolled")&&this.model.ui.set({scrolled:!1}),Lv(this.model)}onWindowStateChanged(e){"visible"===e.state?this.model.isHidden()||this.model.clearUnreadMsgCounter():"hidden"===e.state&&(this.model.setChatState(va.INACTIVE,{silent:!0}),this.model.sendChatState())}}class pb extends gb{constructor(...e){var t,n;super(...e),(n="length")in(t=this)?Object.defineProperty(t,n,{value:200,enumerable:!0,configurable:!0,writable:!0}):t[n]=200}connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){va.chatboxviews.add(this.jid,this),this.model=va.chatboxes.get(this.jid),this.listenTo(va,"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(),Cl.trigger("chatBoxViewInitialized",this)}render(){return(e=>Qc `
< 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 >
$ { e . model ? Qc `
< 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
2021-11-11 22:06:49 +01:00
$ { e . show _help _messages ? Qc ` <div class="chat-content__help">
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . help _messages }
? hidden = $ { ! e . show _help _messages }
type = "info"
chat _type = "${va.CHATROOMS_TYPE}"
> < / 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 >
` )(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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " S h o w t h i s m e n u " ) } ` ] } s h o w C o n t r o l B o x ( ) { v a r e ; n u l l = = = ( e = v a . 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 o i d 0 = = = e | | e . s h o w ( ) } 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 ( v a . 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 ( ) } } C l . 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 " , p b ) ; v a r v b = n ( 9 1 0 7 ) , b b = { } ; b b . s t y l e T a g T r a n s f o r m = e g ( ) , b b . s e t A t t r i b u t e s = Y f ( ) , b b . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , b b . d o m A P I = W f ( ) , b b . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( v b . Z , b b ) , v b . Z & & v b . Z . l o c a l s & & v b . Z . l o c a l s ; c o n s t { S t r o p h e : y b } = j l . e n v ; j l . 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 ( ) { C l . s e t t i n g s . e x t e n d ( { 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 , e m b e d _ v i d e o s : ! 0 , e m b e d _ a u d i o : ! 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 " ] , s h o w _ i m a g e s _ i n l i n e : ! 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 } } ) , v a . C h a t B o x V i e w = p b , C l . l i s t e n . o n ( " c o n n e c t e d " , ( ( ) = > C l . d i s c o . o w n . f e a t u r e s . a d d ( y b . N S . S P O I L E R ) ) ) , C l . 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 ( v a . 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 } ` & & v a . r o u t e r . n a v i g a t e ( " " ) ) ; v a r t } ) ) } } ) , C l . 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 U f { r e n d e r ( ) { c o n s t e = " f u l l s c r e e n " = = = C l . 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 Q c `
$ { e ? Qc `
< p class = "brand-subtitle" > $ { va . VERSION _NAME } < / p >
< 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 >
` :""}
` }}),Cl.elements.define("converse-brand-logo",class extends Uf{render(){const e="fullscreen"===Cl.settings.get("view_mode");return Qc `
< 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 >
$ { e ? Qc `
< 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 >
` }}),Cl.elements.define("converse-brand-heading",class extends Uf{render(){return Qc `
< 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 >
` }});const _b=e=>Qc `
< 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" >
< div class = "conn-feedback fade-in ${e.conn_feedback_subject?e.conn_feedback_class:" hidden "}" >
< p class = "feedback-subject" > $ { e . conn _feedback _subject } < / p >
< p class = "feedback-message ${e.conn_feedback_message?" ":" hidden "}" > $ { e . conn _feedback _message } < / p >
< / d i v >
$ { "CONNECTING" === va . CONNECTION _STATUS [ e . connection _status ] ? Iv ( { classes : "hor_centered" } ) : ( e => { const t = vh ( "Disconnected" ) , n = vh ( "Click here to log in anonymously" ) ; return Qc `
$ { e . authentication == e . LOGIN || e . authentication == e . EXTERNAL ? ( e => { const t = vh ( "Log in" ) , n = vh ( "XMPP Address" ) ; return Qc `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label for = "converse-login-jid" > $ { n } : < / l a b e l >
< input id = "converse-login-jid"
2021-11-11 22:06:49 +01:00
? autofocus = $ { ! ! Cl . settings . get ( "auto_focus" ) }
2021-03-19 19:26:15 +01:00
required
class = "form-control"
type = "text"
name = "jid"
placeholder = "${e.placeholder_username}" / >
< / d i v >
2021-11-11 22:06:49 +01:00
$ { e . authentication !== e . EXTERNAL ? ( ( ) => { const e = vh ( "Password" ) ; return Qc `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label for = "converse-login-password" > $ { e } < / l a b e l >
< input id = "converse-login-password" class = "form-control" required = "required" type = "password" name = "password" placeholder = "${e}" / >
< / d i v >
` })():""}
2021-11-11 22:06:49 +01:00
$ { e . show _trust _checkbox ? ( e => { const t = vh ( "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 = vh ( "This is a trusted device" ) ; return Qc `
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 >
< i class = "fa fa-info-circle" data - toggle = "popover"
data - title = "Trusted device?"
data - content = "${t}" > < / i >
< / d i v >
` })("off"!==e.show_trust_checkbox):""}
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
2021-03-19 19:26:15 +01:00
< input class = "btn btn-primary" type = "submit" value = "${t}" / >
< / f i e l d s e t >
2021-11-11 22:06:49 +01:00
$ { va . allow _registration && ! Cl . settings . get ( "auto_login" ) && va . pluggable . plugins [ "converse-register" ] . enabled ( va ) ? ( ( ) => { const e = vh ( "Create an account" ) , t = vh ( "Don't have a chat account?" ) ; return Qc `
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 >
` })():""}
2021-11-11 22:06:49 +01:00
` })(e):""}
$ { e . authentication == e . ANONYMOUS ? Qc ` <input class="btn btn-primary login-anon" type="submit" value=" ${ n } "> ` : "" }
$ { e . authentication == e . PREBIND ? Qc ` <p> ${ t } </p> ` : "" }
2021-03-19 19:26:15 +01:00
` })(e)}
< / f o r m >
2021-11-11 22:06:49 +01:00
` ;function wb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sb=jl.env.utils,{Strophe:xb}=jl.env,Eb=[0,1,2,3,4,7,10],Ab={0:"Error",1:"Connecting",2:"Connection failure",3:"Authenticating",4:"Authentication failure",5:"Connected",6:"Disconnected",7:"Disconnecting",8:"Attached",9:"Redirect",10:"Reconnecting"},Cb={Error:"error",Connecting:"info","Connection failure":"error",Authenticating:"info","Authentication failure":"error",Connected:"info",Disconnected:"error",Disconnecting:"warn",Attached:"info",Redirect:"info",Reconnecting:"warn"},Tb=Zo.extend({defaults:{errors:[]}});Cl.elements.define("converse-login-panel",class extends mg{constructor(...e){super(...e),wb(this,"id","converse-login-panel"),wb(this,"className","controlbox-pane fade-in row no-gutters"),wb(this,"events",{"submit form#converse-login":"authenticate","change input":"validate"})}initialize(){this.model=new Tb,this.listenTo(this.model,"change",this.render),this.listenTo(va.connfeedback,"change",this.render),this.render(),this.initPopovers()}render(){const e=va.connfeedback.get("connection_status");let t,n;Eb.includes(e)&&(n=Ab[e],t=Cb[n]),tl(_b(Object.assign(this.model.toJSON(),{_converse:va,ANONYMOUS:va.ANONYMOUS,EXTERNAL:va.EXTERNAL,LOGIN:va.LOGIN,PREBIND:va.PREBIND,auto_login:Cl.settings.get("auto_login"),authentication:Cl.settings.get("authentication"),connection_status:e,conn_feedback_class:t,conn_feedback_subject:n,conn_feedback_message:va.connfeedback.get("message"),placeholder_username:(Cl.settings.get("locked_domain")||Cl.settings.get("default_domain"))&&vh("Username")||vh("user@domain"),show_trust_checkbox:Cl.settings.get("allow_user_trust_override")})),this)}initPopovers(){Array.from(this.querySelectorAll("[data-title]")).forEach((e=>{new(Hg().Popover)(e,{trigger:"mobile"===Cl.settings.get("view_mode")?"click":"hover",dismissible:"mobile"===Cl.settings.get("view_mode"),container:this.parentElement.parentElement.parentElement})}))}validate(){const e=this.querySelector("form").querySelector("input[name=jid]");return!e.value||Cl.settings.get("locked_domain")||Cl.settings.get("default_domain")||Sb.isValidJID(e.value)?(e.setCustomValidity(""),!0):(e.setCustomValidity(vh("Please enter a valid XMPP address")),!1)}authenticate(e){if(null==e||e.preventDefault(),Cl.settings.get("authentication")===va.ANONYMOUS)return this.connect(va.jid,null);if(!this.validate())return;const t=new FormData(e.target);va.config.save({trusted:!!t.get("trusted")});let n=t.get("jid");if(Cl.settings.get("locked_domain")){const e="@"+Cl.settings.get("locked_domain");n.endsWith(e)&&(n=n.substr(0,n.length-e.length)),n=xb.escapeNode(n)+e}else Cl.settings.get("default_domain")&&!n.includes("@")&&(n=n+"@"+Cl.settings.get("default_domain"));this.connect(n,t.get("password"))}connect(e,t){["converse/login","converse/register"].includes(va.router.history.getFragment())&&va.router.navigate("",{replace:!0}),va.connection&&va.connection.reset(),Cl.user.login(e,t)}});const kb=jl.env.utils;function jb(){var e;const t=va.chatboxes.add(new va.ControlBox({id:"controlbox"}));return null===(e=va.chatboxviews.get("controlbox"))||void 0===e||e.setModel(),t}function Nb(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=va.chatboxes.get("controlbox")||jb();kb.safeSave(n,{closed:!1})}function Ob(){const e=va.chatboxviews.get("controlbox");return e.model.set({connected:!1}),e}function $ b(){const e=null==va?void 0:va.chatboxviews,t=e&&e.get("controlbox");t&&(kb.safeSave(t.model,{connected:!1}),null!=t&&t.controlbox_pane&&(t.controlbox_pane.remove(),delete t.controlbox_pane))}function Ib(){(va.chatboxes.get("controlbox")||jb()).save({connected:!0})}Cl.elements.define("converse-controlbox-navback",class extends Uf{static get properties(){return{jid:{type:String}}}render(){return e=this.jid,Qc ` < i class = "fa fa-arrow-left" @ click = $ { ( ) => function ( e ) { Nb ( ) ; const t = va . chatboxes . get ( e ) ; kb . safeSave ( t , { hidden : ! 0 } ) } ( e ) } > < / i > ` ; v a r e } } ) ; c o n s t { d a y j s : M b } = j l . e n v , R b = Z 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
2021-03-19 19:26:15 +01:00
< div class = "flyout box-flyout" >
2021-11-11 22:06:49 +01:00
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2021-03-19 19:26:15 +01:00
< div class = "chat-head controlbox-head" >
2021-11-11 22:06:49 +01:00
$ { e . sticky _controlbox ? "" : Qc `
< a class = "chatbox-btn close-chatbox-button fa fa-times" @ click = $ { e . close } > < / a >
` }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "controlbox-panes" >
< div class = "controlbox-pane" >
$ { e . connected ? Qc `
< converse - user - profile > < / c o n v e r s e - u s e r - p r o f i l e >
< converse - headlines - panel class = "controlbox-section" > < / c o n v e r s e - h e a d l i n e s - p a n e l >
< 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 >
< converse - bookmarks > < / c o n v e r s e - b o o k m a r k s >
< / d i v >
$ { Cl . settings . get ( "authentication" ) === va . ANONYMOUS ? "" : Qc ` <div id="converse-roster" class="controlbox-section"><converse-roster></converse-roster></div> ` } ` :"register"===e["active-form"]?Qc ` < converse - register - panel > < / c o n v e r s e - r e g i s t e r - p a n e l > ` : Q c ` < c o n v e r s e - l o g i n - p a n e l > < / c o n v e r s e - l o g i n - p a n e l > ` }
< / d i v >
< / d i v >
< / d i v >
` )({sticky_controlbox:Cl.settings.get("sticky_controlbox"),...this.model.toJSON(),close:e=>this.close(e)}),this)}afterRender(){this.model.get("connected")&&void 0===this.model.get("closed")&&this.model.set("closed",!Cl.settings.get("show_controlbox_by_default"))}close(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),("closeAllChatBoxes"!==(null==e?void 0:e.name)||va.disconnection_cause===va.LOGOUT&&!Cl.settings.get("show_controlbox_by_default"))&&!Cl.settings.get("sticky_controlbox"))return zb.safeSave(this.model,{closed:!0}),Cl.trigger("controlBoxClosed",this),this}afterShown(){return Cl.trigger("controlBoxOpened",this),this}showHelpMessages(){}}Cl.elements.define("converse-controlbox",Pb);const Fb=Pb,{u:Ub}=jl.env,Bb={controlbox:{async open(){await Cl.waitUntil("chatBoxesFetched");const e=await Cl.chatboxes.get("controlbox")||Cl.chatboxes.create("controlbox",{},va.Controlbox);return Ub.safeSave(e,{closed:!1}),e},get:()=>va.chatboxviews.get("controlbox")}};var qb=n(7581),Hb={};Hb.styleTagTransform=eg(),Hb.setAttributes=Yf(),Hb.insert=Jf().bind(null,"head"),Hb.domAPI=Wf(),Hb.insertStyleElement=Xf(),Hf()(qb.Z,Hb),qb.Z&&qb.Z.locals&&qb.Z.locals,jl.plugins.add("converse-controlbox",{dependencies:["converse-modal","converse-chatboxes","converse-chat","converse-rosterview","converse-chatview"],enabled:e=>!e.api.settings.get("singleton"),overrides:{ChatBoxes:{model(e,t){return e&&"controlbox"==e.id?new Rb(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){Cl.settings.extend({allow_logout:!0,allow_user_trust_override:!0,default_domain:void 0,locked_domain:void 0,show_controlbox_by_default:!1,sticky_controlbox:!1}),Cl.promises.add("controlBoxInitialized"),Object.assign(Cl,Bb),va.ControlBoxView=Fb,va.ControlBox=Rb,va.ControlBoxToggle=Lb,Cl.listen.on("chatBoxesFetched",Ib),Cl.listen.on("cleanup",(()=>delete va.controlboxtoggle)),Cl.listen.on("clearSession", $ b),Cl.listen.on("will-reconnect",Ob),Cl.waitUntil("chatBoxViewsInitialized").then(jb).catch((e=>M.fatal(e)))}});const{u:Gb}=jl.env;function Wb(e,t=!0){if(!Cl.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=Gb.ancestor(e.target,".box-flyout"),s=window.getComputedStyle(n),i=n.parentElement;i.height=parseInt(s.height.replace(/px $ /,""),10),va.resizing={chatbox:i,direction:"top"},i.prev_pageY=e.pageY,t&&Cl.trigger("startVerticalResize",i)}function Vb(e,t=!0){if(!Cl.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=Gb.ancestor(e.target,".box-flyout"),s=window.getComputedStyle(n),i=n.parentElement;i.width=parseInt(s.width.replace(/px $ /,""),10),va.resizing={chatbox:i,direction:"left"},i.prev_pageX=e.pageX,t&&Cl.trigger("startHorizontalResize",i)}function Jb(e){Vb(e,!1),Wb(e,!1),va.resizing.direction="topleft",Cl.trigger("startDiagonalResize",this)}function Kb(e,t){if(void 0!==e)return void 0===t?e:e!==t&&Math.abs(e-t)<10?t:e}function Yb(e){if(!va.resizing||!Cl.settings.get("allow_dragresize"))return!0;e.preventDefault(),va.resizing.chatbox.resizeChatBox(e)}function Qb(e){if(!va.resizing||!Cl.settings.get("allow_dragresize"))return!0;e.preventDefault();const t=Kb(va.resizing.chatbox.height,va.resizing.chatbox.model.get("default_height")),n=Kb(va.resizing.chatbox.width,va.resizing.chatbox.model.get("default_width"));Cl.connection.connected()?(va.resizing.chatbox.model.save({height:t}),va.resizing.chatbox.model.save({width:n})):(va.resizing.chatbox.model.set({height:t}),va.resizing.chatbox.model.set({width:n})),va.resizing=null}const Xb=()=>Qc `
< div class = "dragresize dragresize-top" @ mousedown = "${Wb}" > < / d i v >
< div class = "dragresize dragresize-topleft" @ mousedown = "${Jb}" > < / d i v >
< div class = "dragresize dragresize-left" @ mousedown = "${Vb}" > < / d i v >
` ;customElements.define("converse-dragresize",class extends Uf{render(){return Xb()}});const Zb={initDragResize(){var e;const t=this,n=hc((()=>t.setDimensions()));window.addEventListener("resize",t.debouncedSetDimensions),this.listenTo(this.model,"destroy",(()=>window.removeEventListener("resize",n)));const s=this.querySelector(".box-flyout"),i=window.getComputedStyle(s);if(void 0===this.model.get("height")){const e=parseInt(i.height.replace(/px $ /,""),10),t=parseInt(i.width.replace(/px $ /,""),10);this.model.set("height",e),this.model.set("default_height",e),this.model.set("width",t),this.model.set("default_width",t)}const r=i["min-width"],o=i["min-height"];return this.model.set("min_width",r.endsWith("px")?Number(r.replace(/px $ /,"")):0),this.model.set("min_height",o.endsWith("px")?Number(o.replace(/px $ /,"")):0),this.prev_pageY=0,this.prev_pageX=0,null!==(e=va.connection)&&void 0!==e&&e.connected&&(this.height=this.model.get("height"),this.width=this.model.get("width")),this},resizeChatBox(e){let t;0===va.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))),va.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?Kb(e,this.model.get("default_height"))+"px":"";const t=this.querySelector(".box-flyout");null!==t&&(t.style.height=e)},setChatBoxWidth(e){e=e?Kb(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)}};jl.plugins.add("converse-dragresize",{dependencies:["converse-chatview","converse-headlines-view","converse-muc-views"],enabled:e=>"overlayed"==e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){const e=this.__super__.initialize.apply(this,arguments),t=this.get("height"),n=this.get("width");return("controlbox"===this.get("id")?e=>this.set(e):e=>this.save(e))({height:Kb(t,this.get("default_height")),width:Kb(n,this.get("default_width"))}),e}}},initialize(){Cl.settings.extend({allow_dragresize:!0}),Object.assign(va.ChatBoxView.prototype,Zb),Object.assign(va.ChatRoomView.prototype,Zb),Object.assign(va.ControlBoxView.prototype,Zb),Cl.listen.on("registeredGlobalEventHandlers",(function(){document.addEventListener("mousemove",Yb),document.addEventListener("mouseup",Qb)})),Cl.listen.on("unregisteredGlobalEventHandlers",(function(){document.removeEventListener("mousemove",Yb),document.removeEventListener("mouseup",Qb)})),Cl.listen.on("beforeShowingChatView",(e=>e.initDragResize().setDimensions()))}}),jl.plugins.add("converse-singleton",{enabled:e=>e.api.settings.get("singleton"),initialize(){if(Cl.settings.extend({allow_logout:!1,allow_muc_invitations:!1,hide_muc_server:!0}),!Array.isArray(Cl.settings.get("auto_join_rooms"))&&!Array.isArray(Cl.settings.get("auto_join_private_chats")))throw new Error("converse-singleton: auto_join_rooms must be an Array");if(Cl.settings.get("auto_join_rooms").length>1||Cl.settings.get("auto_join_private_chats").length>1)throw new Error("It doesn't make sense to have singleton set to true and auto_join_rooms or auto_join_private_chats set to more then one, since only one chat room may be open at any time.")}});var ey=n(6752),ty={};ty.styleTagTransform=eg(),ty.setAttributes=Yf(),ty.insert=Jf().bind(null,"head"),ty.domAPI=Wf(),ty.insertStyleElement=Xf(),
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
$ { va . api . settings . get ( "singleton" ) ? "" : Qc ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
< 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" >
$ { e . dropdown _btns . length ? Qc ` <converse-dropdown class="dropleft" .items= ${ e . dropdown _btns } ></converse-dropdown> ` : "" }
$ { e . standalone _btns . length ? ( e => e . standalone _btns . reverse ( ) . map ( ( e => dp ( e , "" ) ) ) ) ( e ) : "" }
< / d i v >
< / d i v >
$ { e . status ? Qc ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` )(Object.assign(this.model.toJSON(),{display_name:this.model.getDisplayName(),dropdown_btns:n.map((e=>sb(e))),standalone_btns:t.map((e=>ib(e)))}))}getHeadingButtons(){const e=[];return Cl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:vh("Close"),i18n_title:vh("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Cl.settings.get("view_mode")}),va.api.hook("getHeadingButtons",this,e)}close(e){e.preventDefault(),this.model.close()}}),Cl.elements.define("converse-headlines",class extends gb{connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){va.chatboxviews.add(this.jid,this),this.model=va.chatboxes.get(this.jid),this.model.disable_mam=!0,this.listenTo(va,"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(),Cl.trigger("headlinesBoxViewInitialized",this)}render(){return(e=>Qc `
< 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 >
$ { e ? Qc `
< 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 >
` )(this.model)}async close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),va.router.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&va.router.navigate(""),await this.model.close(e),this}getNotifications(){return[]}afterShown(){this.model.clearUnreadMsgCounter()}});class ny extends mg{constructor(...e){var t,n,s;super(...e),s={"click .open-headline":"openHeadline"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}initialize(){this.model=va.chatboxes,this.listenTo(this.model,"add",this.renderIfHeadline),this.listenTo(this.model,"remove",this.renderIfHeadline),this.listenTo(this.model,"destroy",this.renderIfHeadline),this.render()}toHTML(){return(e=>Qc `
< div class = "controlbox-section" id = "headline" >
< div class = "d-flex controlbox-padded ${e.headlineboxes.length?" ":" hidden "}" >
< span class = "w-100 controlbox-heading controlbox-heading--headline" > $ { e . heading _headline } < / s p a n >
< / d i v >
< / d i v >
$ { ( e => Qc `
< div class = "list-container list-container--headline ${e.headlineboxes.length?" ":" hidden "}" >
< div class = "items-list rooms-list headline-list" >
$ { e . headlineboxes . map ( ( t => ( e => Qc `
< div class = "list-item controlbox-padded d-flex flex-row"
data - headline - jid = "${e.headlinebox.get(" jid ")}" >
< a class = "list-item-link open-headline available-room w-100"
data - headline - jid = "${e.headlinebox.get(" jid ")}"
title = "${e.open_title}" href = "#" > $ { e . headlinebox . get ( "jid" ) } < / a >
< / d i v >
` )(Object.assign({headlinebox:t},e))))}
< / d i v >
< / d i v >
` )(e)}
2021-11-12 22:09:04 +01:00
` )({heading_headline:vh("Announcements"),headlineboxes:this.model.filter((e=>e.get("type")===va.HEADLINES_TYPE)),open_title:vh("Click to open this server message")})}renderIfHeadline(e){return e&&e.get("type")===va.HEADLINES_TYPE&&this.render()}openHeadline(e){e.preventDefault();const t=e.target.getAttribute("data-headline-jid");va.chatboxes.get(t).maybeShow(!0)}}Cl.elements.define("converse-headlines-panel",ny);var sy=n(115),iy={};iy.styleTagTransform=eg(),iy.setAttributes=Yf(),iy.insert=Jf().bind(null,"head"),iy.domAPI=Wf(),iy.insertStyleElement=Xf(),Hf()(sy.Z,iy),sy.Z&&sy.Z.locals&&sy.Z.locals,jl.plugins.add("converse-headlines-view",{dependencies:["converse-headlines","converse-chatview"],initialize(){va.HeadlinesPanel=ny}});var ry=n(7667),oy={};function ay(e,t){return e instanceof Bh?Qc ` < converse - mam - placeholder . model = $ { 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 c y ( 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 " ) = = = v a . 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 " ) : v a . 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 m m ( e . m o d e l , { b e f o r e : i } ) : a w a i t m m ( 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 M . 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 ) } C l . 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 " ) & & v a . 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 ) } } } o y . s t y l e T a g T r a n s f o r m = e g ( ) , o y . s e t A t t r i b u t e s = Y f ( ) , o y . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , o y . d o m A P I = W f ( ) , o y . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( r y . Z , o y ) , r y . Z & & r y . Z . l o c a l s & & r y . Z . l o c a l s , C l . 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 U f { 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 " ) ? I v ( { c l a s s e s : " h o r _ c e n t e r e d " } ) : Q c ` < 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 = " $ { v h ( " 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 " ) } " >
2021-11-11 22:06:49 +01:00
< div class = "message mam-placeholder" > < / d i v >
< / 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 ) { v a r t ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) , 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 n = { 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 m m ( 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 , n ) , t h i s . m o d e l . d e s t r o y ( ) } } ) , j l . 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 ( ) { C l . 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 " , c y ) , C l . 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 " , a y ) } } ) ; c o n s t l y = j l . e n v . u t i l s ; f u n c t i o n d y ( e ) { r e t u r n " c o n t r o l b o x " = = = e . m o d e l . g e t ( " i d " ) ? l y . i s V i s i b l e ( e ) ? l y . g e t O u t e r W i d t h ( e , ! 0 ) : l y . g e t O u t e r W i d t h ( v a . c o n t r o l b o x t o g g l e . e l , ! 0 ) : ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & l y . i s V i s i b l e ( e ) ? l y . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n u y ( ) { v a r e ; c o n s t t = n u l l = = = ( e = v a . m i n i m i z e d _ c h a t s ) | | v o i d 0 = = = e ? v o i d 0 : e . e l ; r e t u r n v a . 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 ) ? l y . g e t O u t e r W i d t h ( t , ! 0 ) : 0 } f u n c t i o n h y ( 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 ? l y . g e t O u t e r W i d t h ( e . e l , ! 0 ) : 0 ; r e t u r n O b j e c t . v a l u e s ( v a . 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 + d y ( t ) ) , n ) } a s y n c f u n c t i o n m y ( e ) { v a r t ; i f ( v a . i s T e s t E n v ( ) | | C l . s e t t i n g s . g e t ( " n o _ t r i m m i n g " ) | | ! C l . c o n n e c t i o n . c o n n e c t e d ( ) | | " o v e r l a y e d " ! = = C l . 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 n = v a . 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 " ) & & l y . i s V i s i b l e ( e ) ) ) ; i f ( n . l e n g t h < = 1 ) r e t u r n ; c o n s t s = l y . 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 ( d y ( n [ 0 ] ) ! = = s & & ( a w a i t C l . w a i t U n t i l ( " m i n i m i z e d C h a t s I n i t i a l i z e d " ) , n u l l = = = ( t = v a . m i n i m i z e d _ c h a t s ) | | v o i d 0 = = = t ? v o i d 0 : t . e l ) ) f o r ( ; u y ( ) + h y ( e ) > s ; ) { c o n s t t = f y ( [ e ? e . m o d e l . g e t ( " i d " ) : n u l l ] ) ; i f ( ! t ) b r e a k ; { c o n s t e = v a . c h a t b o x v i e w s . g e t ( t . g e t ( " i d " ) ) ; e & & e . h i d e ( ) , p y ( t ) } } } f u n c t i o n f y ( e ) { e . p u s h ( " c o n t r o l b o x " ) ; l e t t = 0 , n = v a . 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 = v a . 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 g y ( e , t ) { n u l l ! = 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 ( ) : t = e , l y . 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 p y ( e , t ) { n u l l ! = 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 ( ) : t = e , t . s e t C h a t S t a t e ( v a . I N A C T I V E ) , l y . 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 ( ) } ) } C l . 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 U f { 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 = v h ( " C l i c k t o r e s t o r e t h i s c h a t " ) ; r e t u r n Q c `
< 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 } >
$ { e . num _unread ? Qc ` <span class="message-count badge badge-light"> ${ e . num _unread } </span> ` : "" }
$ { e . title }
< / a >
< a class = "chatbox-btn close-chatbox-button" @ click = $ { e . close } >
< converse - icon color = $ { "chatroom" === e . type ? "var(--chatroom-head-color)" : "var(--chat-head-text-color)" } class = "fas fa-times" @ click = $ { e . close } size = "1em" > < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / a >
2021-11-11 22:06:49 +01:00
< / d i v > ` } ) ( { c l o s e : e = > t h i s . c l o s e ( e ) , n u m _ u n r e a d : t h i s . n u m _ u n r e a d , r e s t o r e : e = > t h i s . r e s t o r e ( e ) , t i t l e : t h i s . t i t l e , t y p e : t h i s . t y p e } ) } c l o s e ( e ) { n u l l = = 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 . c l o s e ( ) } r e s t o r e ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , g y ( t h i s . m o d e l ) } } ) ; c o n s t v y = Z 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 } } ) ; c l a s s b y e x t e n d s U f { c o n s t r u c t o r ( ) { s u p e r ( ) , 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 . m o d e l = v a . 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 ( v a , " 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 ( v a , " 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 ( v a , " 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 = > Q c ` < 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 " } " >
< a id = "toggle-minimized-chats" class = "row no-gutters" @ click = $ { e . toggle } >
$ { e . num _minimized } $ { vh ( "Minimized" ) }
< 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 ":" "}" >
$ { e . chats . map ( ( e => Qc ` <converse-minimized-chat
2021-03-19 19:26:15 +01:00
. model = $ { e }
title = $ { e . getDisplayName ( ) }
type = $ { e . get ( "type" ) }
2021-11-11 22:06:49 +01:00
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 > ` ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< /div>`)(s)}async initToggle(){const e=`converse.minchatstoggle-${va.bare_jid}`;this.minchats=new vy({id:e}),_o(this.minchats,e,"session"),await new Promise((e=>this.minchats.fetch({success:e,error:e})))}toggle(e){null==e||e.preventDefault(),this.minchats.save({collapsed:!this.minchats.get("collapsed")})}}Cl.elements.define("converse-minimized-chats",by);var yy=n(7926),_y={};_y.styleTagTransform=eg(),_y.setAttributes=Yf(),_y.insert=Jf().bind(null,"head"),_y.domAPI=Wf(),_y.insertStyleElement=Xf(),Hf()(yy.Z,_y),yy.Z&&yy.Z.locals&&yy.Z.locals;const{dayjs:wy}=jl.env;jl.plugins.add("converse-minimize",{dependencies:["converse-chatview","converse-controlbox","converse-muc-views","converse-headlines-view","converse-dragresize"],enabled:e=>"overlayed"===e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){this.__super__.initialize.apply(this,arguments),this.on("change:hidden",(e=>!e.get("hidden")&&gy(this)),this),"controlbox"!==this.get("id")&&this.save({minimized:this.get("minimized")||!1,time_minimized:this.get("time_minimized")||wy()})},maybeShow(e){return!e&&this.get("minimized")?this:this.__super__.maybeShow.apply(this,arguments)},isHidden(){return this.__super__.isHidden.call(this)||this.get("minimized")}},ChatBoxView:{isNewMessageHidden(){return this.model.get("minimized")||this.__super__.isNewMessageHidden.apply(this,arguments)},setChatBoxHeight(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxHeight.call(this,e)},setChatBoxWidth(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxWidth.call(this,e)}}},initialize(){function e(e){e.on("change:minimized",(()=>function(e){e.get("minimized")?function(e){Cl.trigger("chatBoxMinimized",e)}(e):function(e){e.isScrolledUp()||e.clearUnreadMsgCounter(),e.setChatState(va.ACTIVE),Cl.trigger("chatBoxMaximized",e)}(e)}(e)))}Cl.settings.extend({no_trimming:!1}),Cl.promises.add("minimizedChatsInitialized"),va.MinimizedChatsToggle=vy,va.MinimizedChats=by,va.minimize={},va.minimize.trimChats=my,va.minimize.minimize=py,va.minimize.maximize=gy,Cl.listen.on("chatBoxViewInitialized",(e=>va.minimize.trimChats(e))),Cl.listen.on("chatRoomViewInitialized",(e=>va.minimize.trimChats(e))),Cl.listen.on("chatBoxMaximized",(e=>va.minimize.trimChats(e))),Cl.listen.on("controlBoxOpened",(e=>va.minimize.trimChats(e))),Cl.listen.on("chatBoxInitialized",e),Cl.listen.on("chatRoomInitialized",e),Cl.listen.on("getHeadingButtons",((e,t)=>e.model.get("type")===va.CHATROOMS_TYPE?function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>py(t,e.model),i18n_text:vh("Minimize"),i18n_title:vh("Minimize this groupchat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===va.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=>py(t,e.model),i18n_text:vh("Minimize"),i18n_title:vh("Minimize this chat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===va.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=hc((()=>va.minimize.trimChats()),250);Cl.listen.on("registeredGlobalEventHandlers",(()=>window.addEventListener("resize",t))),Cl.listen.on("unregisteredGlobalEventHandlers",(()=>window.removeEventListener("resize",t)))}});const Sy=jl.env.utils,xy={getElement:(e,t)=>"string"==typeof e?(t||document).querySelector(e):e||null,bind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/ \ s + /).forEach((t=>e.addEventListener(t,s)))}},unbind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/ \ s + /).forEach((t=>e.removeEventListener(t,s)))}},regExpEscape:e=>e.replace(/ [ - \ \ ^ $ * + ? . ( ) | [ \ ] { } ] / g , "\\$&" ) , isMention : ( e , t ) => t . includes ( e [ 0 ] ) || Sy . isMentionBoundary ( e [ 0 ] ) && t . includes ( e [ 1 ] ) } , Ey = function ( e , t ) { return RegExp ( xy . regExpEscape ( t . trim ( ) ) , "i" ) . test ( e ) } , Ay = function ( e , t ) { return RegExp ( "^" + xy . regExpEscape ( t . trim ( ) ) , "i" ) . test ( e ) } , Cy = fun
2021-03-19 19:26:15 +01:00
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
2021-11-11 22:06:49 +01:00
< input
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 >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
` }firstUpdated(){this.auto_complete=new Oy(this.firstElementChild,{ac_triggers:this.triggers.split(" "),auto_evaluate:this.auto_evaluate,auto_first:this.auto_first,filter:"contains"==this.filter?Ey:Ay,include_triggers:[],list:()=>this.getAutoCompleteList(),match_current_word:!0,max_items:this.max_items,min_chars:this.min_chars}),this.auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}onKeyDown(e){this.auto_complete.onKeyDown(e)}onKeyUp(e){this.auto_complete.evaluate(e)}});var $ y=n(8481),Iy={};Iy.styleTagTransform=eg(),Iy.setAttributes=Yf(),Iy.insert=Jf().bind(null,"head"),Iy.domAPI=Wf(),Iy.insertStyleElement=Xf(),Hf()( $ y.Z,Iy), $ y.Z&& $ y.Z.locals&& $ y.Z.locals,va.FILTER_CONTAINS=Ey,va.FILTER_STARTSWITH=Ay,va.AutoComplete=Oy;function My(e){return"moderator"===e?vh("Moderators are privileged users who can change the roles of other users (except those with admin or owner affiliations."):"participant"===e?vh("The default role, implies that you can read and write messages."):"visitor"==e?vh("Visitors aren't allowed to write messages in a moderated multi-user chat."):void 0}function Ry(e){return"owner"===e?vh("Owner is the highest affiliation. Owners can modify roles and affiliations of all other users."):"admin"===e?vh("Admin is the 2nd highest affiliation. Admins can modify roles and affiliations of all other users except owners."):"outcast"===e?vh('To ban a user, you give them the affiliation of "outcast".'):void 0}const Dy=e=>{const t=vh("Affiliation"),n=vh("No users with that affiliation found."),s=vh("No users with that role found."),i=vh("Type here to filter the search results"),r=vh("Role"),o=vh("Show users"),a=vh("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=vh("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 Qc `
$ { e . alert _message ? Qc ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert _message } </div> ` : "" }
$ { l ? Qc `
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link active" id = "affiliations-tab" href = "#affiliations-tabpanel" aria - controls = "affiliations-tabpanel" role = "tab" data - toggle = "tab" > Affiliations < / a >
2021-03-19 19:26:15 +01:00
< / l i >
2021-11-11 22:06:49 +01:00
< li role = "presentation" class = "nav-item" >
< a class = "nav-link" id = "roles-tab" href = "#roles-tabpanel" aria - controls = "roles-tabpanel" role = "tab" data - toggle = "tab" > Roles < / a >
< / l i >
< / u l >
` :""}
< div class = "tab-content" >
$ { e . queryable _affiliations . length ? Qc `
< div class = "tab-pane tab-pane--columns ${e.queryable_affiliations.length?" 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" >
$ { e . queryable _affiliations . map ( ( t => ( e => Qc `
< option value = "${e.item||" "}"
? selected = $ { e . item === e . affiliation }
title = "${Ry(e.item)}" > $ { e . item } < / o p t i o n >
` )(Object.assign({item:t},e))))}
< / s e l e c t >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "col" >
< input type = "submit" class = "btn btn-primary" name = "users_with_affiliation" value = "${o}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
$ { Array . isArray ( e . users _with _affiliation ) && e . users _with _affiliation . length > 5 ? Qc ` <input class="form-control" .value=" ${ e . affiliations _filter } " @keyup= ${ e . filterAffiliationResults } type="text" name="filter" placeholder=" ${ i } "/> ` : "" }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
$ { Ry ( e . affiliation ) ? Qc ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ Ry ( e . affiliation ) } </p></div></div> ` : "" }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
$ { e . loading _users _with _affiliation ? Qc ` <li class="list-group-item"> ${ Iv ( ) } </li> ` : "" }
$ { Array . isArray ( e . users _with _affiliation ) && 0 === e . users _with _affiliation . length ? Qc ` <li class="list-group-item"> ${ n } </li> ` : "" }
$ { e . users _with _affiliation instanceof Error ? Qc ` <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" ) ) ? ( e => Qc `
2021-03-19 19:26:15 +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" >
2021-11-11 22:06:49 +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 = > Q c `
< 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 >
$ { e . assignable _affiliations . length ? ( e => { const t = vh ( "Change affiliation" ) , n = vh ( "New affiliation" ) , s = vh ( "Reason" ) ; return Qc `
< form class = "affiliation-form hidden" @ submit = $ { e . assignAffiliation } >
2021-03-19 19:26:15 +01:00
< 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 >
2021-11-11 22:06:49 +01:00
< select class = "custom-select select-affiliation" name = "affiliation" >
$ { e . assignable _affiliations . map ( ( t => Qc ` <option value=" ${ t } " ?selected= ${ t === e . item . affiliation } > ${ t } </option> ` ) ) }
2021-03-19 19:26:15 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
2021-11-11 22:06:49 +01:00
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
2021-03-19 19:26:15 +01:00
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" name = "change" value = "${t}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
` })(e):""}
< / l i >
< / u l >
< / l i >
2021-11-11 22:06:49 +01:00
` )(Object.assign({item:t},e)):""))}
< / u l >
< / d i v >
< / d i v > ` : " " }
$ { e . queryable _roles . length ? Qc `
< div class = "tab-pane tab-pane--columns ${!l&&e.queryable_roles.length?" 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" >
$ { e . queryable _roles . map ( ( t => ( e => Qc `
< option value = "${e.item||" "}"
? selected = $ { e . item === e . role }
title = "${My(e.item)}" > $ { e . item } < / o p t i o n >
` )(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" >
$ { Array . isArray ( e . users _with _role ) && e . users _with _role . length > 5 ? Qc ` <input class="form-control" .value=" ${ e . roles _filter } " @keyup= ${ e . filterRoleResults } type="text" name="filter" placeholder=" ${ i } "/> ` : "" }
< / d i v >
< / d i v >
$ { My ( e . role ) ? Qc ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ My ( e . role ) } </p></div></div> ` : "" }
< / d i v >
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
$ { e . loading _users _with _role ? Qc ` <li class="list-group-item"> ${ Iv ( ) } </li> ` : "" }
$ { e . users _with _role && 0 === e . users _with _role . length ? Qc ` <li class="list-group-item"> ${ s } </li> ` : "" }
$ { ( e . users _with _role || [ ] ) . map ( ( t => t . nick . match ( e . roles _filter ) ? ( e => Qc `
2021-03-19 19:26:15 +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" >
2021-11-11 22:06:49 +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 = > Q c `
< 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 >
$ { e . assignable _roles . length ? ( e => { const t = vh ( "Change role" ) , n = vh ( "New Role" ) , s = vh ( "Reason" ) ; return Qc `
< form class = "role-form hidden" @ submit = $ { e . assignRole } >
2021-03-19 19:26:15 +01:00
< 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 >
2021-11-11 22:06:49 +01:00
< select class = "custom-select select-role" name = "role" >
$ { e . assignable _roles . map ( ( t => Qc ` <option value=" ${ t } " ?selected= ${ t === e . item . role } > ${ t } </option> ` ) ) }
2021-03-19 19:26:15 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
2021-11-11 22:06:49 +01:00
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
2021-03-19 19:26:15 +01:00
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${t}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
` })(e):""}
< / l i >
< / u l >
< / l i >
2021-11-11 22:06:49 +01:00
` )(Object.assign({item:t},e)):""))}
< / u l >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v > ` : " " }
< / d i v > ` } , { S t r o p h e : L y , s i z z l e : z y , u : P y } = j l . e n v ; C l . 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 U f { 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 } , 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 . 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 = " " } 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 . i n i t i a l i z e ( ) } 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 = j i ( ) ; c o n s t e = a w a i t C l . 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 ( ) { v a r e ; i f ( n u l l ! = = ( e = t h i s . m u c ) & & v o i d 0 ! = = e & & e . 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 : v a . b a r e _ j i d } ) ; r e t u r n D y ( { 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 : C u ( e ) , a s s i g n a b l e _ r o l e s : W u ( 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 : o h . f i l t e r ( ( e = > ! C l . 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 : r h . f i l t e r ( ( e = > ! C l . 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 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 " " } 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 A u ( 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 ; r e t u r n " n o n e " ! = = e & & ! t h i s . m u c . o c c u p a n t s . g e t A u t o F e t c h e d A f f i l i a t i o n L i s t s ( ) . 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 = P y . 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 = P y . 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 } ` ) ; P y . h a s C l a s s ( " h i d d e n " , s ) ? P y . r e m o v e C l a s s ( " h i d d e n " , s ) : P y . 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 k u ( 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 ( v h ( " 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 " ) : z y ( ` n o t - a l l o w e d [ x m l n s = " $ { L y . 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 ( v h ( " 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 ( v h ( " 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 a n g e r " ) , v o i d M . e r r o r ( e ) } a w a i t t h i s . m u c . o c
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
2021-11-11 22:06:49 +01:00
< h5 class = "modal-title" id = "converse-modtools-modal-label" > $ { t } < / h 5 >
$ { Qg }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "modal-body d-flex flex-column" >
< converse - modtools jid = $ { e . jid } affiliation = $ { e . affiliation } > < / c o n v e r s e - m o d t o o l s >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v > ` } ) ( t h i s ) } } ) , { S t r o p h e : U y , $ p r e s : B y , $ i q : q y , s i z z l e : H y , u : G y } = j l . e n v , W y = { a d m i n : " a d m i n " , b a n : " o u t c a s t " , m e m b e r : " m e m b e r " , o w n e r : " o w n e r " , r e v o k e : " n o n e " } , V y = { d e o p : " p a r t i c i p a n t " , k i c k : " n o n e " , m u t e : " v i s i t o r " , o p : " m o d e r a t o r " , v o i c e : " p a r t i c i p a n t " } ; a s y n c f u n c t i o n J y ( e ) { c o n s t t = [ v h ( " A r e y o u s u r e y o u w a n t t o d e s t r o y t h i s g r o u p c h a t ? " ) ] ; l e t n = [ { n a m e : " c h a l l e n g e " , l a b e l : v h ( " P l e a s e e n t e r t h e X M P P a d d r e s s o f t h i s g r o u p c h a t t o c o n f i r m " ) , c h a l l e n g e : e . g e t ( " j i d " ) , p l a c e h o l d e r : v h ( " n a m e @ e x a m p l e . o r g " ) , r e q u i r e d : ! 0 } , { n a m e : " r e a s o n " , l a b e l : v h ( " O p t i o n a l r e a s o n f o r d e s t r o y i n g t h i s g r o u p c h a t " ) , p l a c e h o l d e r : v h ( " R e a s o n " ) } , { n a m e : " n e w j i d " , l a b e l : v h ( " O p t i o n a l X M P P a d d r e s s f o r a n e w g r o u p c h a t t h a t r e p l a c e s t h i s o n e " ) , p l a c e h o l d e r : v h ( " r e p l a c e m e n t @ e x a m p l e . o r g " ) } ] ; t r y { v a r s , i ; n = a w a i t C l . c o n f i r m ( v h ( " C o n f i r m " ) , t , n ) ; c o n s t r = n u l l = = = ( s = n . f i l t e r ( ( e = > " r e a s o n " = = = e . n a m e ) ) . p o p ( ) ) | | v o i d 0 = = = s ? v o i d 0 : s . v a l u e , o = n u l l = = = ( i = n . f i l t e r ( ( e = > " n e w j i d " = = = e . n a m e ) ) . p o p ( ) ) | | v o i d 0 = = = i ? v o i d 0 : i . v a l u e ; r e t u r n e . s e n d D e s t r o y I Q ( r , o ) . t h e n ( ( ( ) = > e . c l o s e ( ) ) ) } c a t c h ( e ) { M . e r r o r ( e ) } } f u n c t i o n K y ( e , t ) { t . q u e r y S e l e c t o r ( " c o n v e r s e - r o o m s - l i s t " ) . m o d e l . s a v e ( " m u c _ d o m a i n " , U y . g e t D o m a i n F r o m J i d ( e ) ) } f u n c t i o n Y y ( e ) { e . m o d e l . g e t ( " c o n n e c t e d " ) & & ( e . q u e r y S e l e c t o r ( " c o n v e r s e - r o o m s - l i s t " ) . m o d e l . g e t ( " m u c _ d o m a i n " ) | | ( v o i d 0 = = = C l . s e t t i n g s . g e t ( " m u c _ d o m a i n " ) ? f u n c t i o n ( e ) { f u n c t i o n t ( t ) { t & & t . g e t ( " v a r " ) = = = U y . N S . M U C & & t . 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 " ) . t h e n ( ( n = > { n & & K y ( t . g e t ( " f r o m " ) , e ) } ) ) } C l . w a i t U n t i l ( " d i s c o I n i t i a l i z e d " ) . t h e n ( ( ( ) = > { C l . 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 " , t ) , v a . d i s c o _ e n t i t i e s . e a c h ( ( e = > t ( e . f e a t u r e s . f i n d W h e r e ( { v a r : U y . N S . M U C } ) ) ) ) } ) ) . c a t c h ( ( e = > M . e r r o r ( e ) ) ) } ( e ) : K y ( C l . s e t t i n g s . g e t ( " m u c _ d o m a i n " ) , e ) ) ) } f u n c t i o n Q y ( 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 " ) ; i f ( 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 l . 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 _ s h o w _ a v a t a r " ) ) { 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 ( " i m g " ) ; l e t s = " d a t a : " + v a . D E F A U L T _ I M A G E _ T Y P E + " ; b a s e 6 4 , " + v a . D E F A U L T _ I M A G E ; i f ( v a . v c a r d s ) { c o n s t t = v a . v c a r d s . f i n d W h e r e ( { n i c k n a m e : e } ) ; t & & ( s = " d a t a : " + t . g e t ( " i m a g e _ t y p e " ) + " ; b a s e 6 4 , " + t . g e t ( " i m a g e " ) ) } t . s e t A t t r i b u t e ( " s r c " , s ) , t . s e t A t t r i b u t e ( " w i d t h " , " 2 2 " ) , t . s e t A t t r i b u t e ( " c l a s s " , " a v a t a r a v a t a r - a u t o c o m p l e t e " ) , n . a p p e n d C h i l d ( t ) } 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 } a s y n c f u n c t i o n X y ( ) { c o n s t e = [ . . . a w a i t C l . r o o m s . g e t ( ) , . . . a w a i t C l . c o n t a c t s . g e t ( ) ] ; r e t u r n [ . . . n e w S e t ( e . m a p ( ( e = > U y . g e t D o m a i n F r o m J i d ( e . g e t ( " j i d " ) ) ) ) ) ] } f u n c t i o n Z y ( e , t , n , s = [ ] , i = [ ] ) { c o n s t r = V y [ t ] ; i f ( ! r ) t h r o w E r r o r ( ` C h a t R o o m V i e w # s e t R o l e c a l l e d w i t h i n v a l i d c o m m a n d : $ { t } ` ) ; i f ( ! e . v e r i f y A f f i l i a t i o n s ( s ) | | ! e . v e r i f y R o l e s ( i ) ) r e t u r n ! 1 ; i f ( ! e . v a l i d a t e R o l e O r A f f i l i a t i o n C h a n g e A r g s ( t , n ) ) r e t u r n ! 1 ; c o n s t o = e . g e t N i c k O r J I D F r o m C o m m a n d A r g s ( n ) ; i f ( ! o ) r e t u r n ! 1 ; c o n s t a = n . s p l i t ( o , 2 ) [ 1 ] . t r i m ( ) , c = e . g e t O c c u p a n t ( o ) ; r e t u r n e . s e t R o l e ( c , r , a , v o i d 0 , ( t = > e . o n C o m m a n d E r r o r ( t ) ) ) , ! 0 } f u n c t i o n e _ ( e , t , n , s ) { c o n s t i = W y [ t ] ; i f ( ! i ) t h r o w E r r o r ( ` v e r i f y A f f i l i a t i o n s c a l l e d w i t h i n v a l i d c o m m a n d : $ { t } ` ) ; i f ( ! e . v e r i f y A f f i l i a t i o n s ( s ) ) r e t u r n ! 1 ; i f ( ! e . v a l i d a t e R o l e O r A f f i l i a t i o n C h a n g e A r g s ( t , n ) ) r e t u r n ! 1 ; c o n s t r = e . g e t N i c k O r J I D F r o m C o m m a n d A r g s ( n ) ; i f ( ! r ) r e t u r n ! 1 ; l e t o ; c o n s t a = n . s p l i t ( r , 2 ) [ 1 ] . t r i m ( ) , c = e . g e t O c c u p a n t ( r ) ; i f ( c ) o = c . g e t ( " j i d " ) ; e l s e { i f ( ! G y . i s V a l i d J I D ( r ) ) { c o n s t t = v h ( " C o u l d n ' t f i n d a p a r t i c i p a n t w i t h t h a t n i c k n a m e . T h e y m i g h t h a v e l e f t t h e g r o u p c h a t . " ) ; r e t u r n v o i d e . c r e a t e M e s s a g e ( { m e s s a g e : t , t y p e : " e r r o r " } ) } o = r } c o n s t l = { j i d : o , r e a s o n : a } ; c & & C l . s e t t i n g s . g e t ( " a u t o _ r e g i s t e r _ m u c _ n i c k n a m e " ) & & ( l . n i c k = c . g e t ( " n i c k " ) ) , k u ( i , e . g e t ( " j i d " ) , [ l ] ) . t h e n ( ( ( ) = > e . o c c u p a n t s . f e t c h M e m b e r s ( ) ) ) . c a t c h ( ( t = > e . o n C o m m a n d E r r o r ( t ) ) ) } f u n c t i o n t _ ( e , t ) { i f ( ! e . v e r i f y R o l e s ( [ " m o d e r a t o r " ] ) ) r e t u r n ; l e t n = C l . m o d a l . g e t ( F y . i d ) ; n ? ( n . a f f i l i a t i o n = t , n . r e n d e r ( ) ) : n = C l . m o d a l . c r e a t e ( F y , { a f f i l i a t i o n : t , j i d : e . g e t ( " j i d " ) } ) , n . s h o w ( ) } c o n s t n _ = e = > { c o n s t t = v h ( " O n w h i c h e n t i t y d o y o u w a n t t o r u n c o m m a n d s ? " ) , n = v h ( " C e r t a i n X M P P s e r v i c e s a n d e n t i t i e s a l l o w p r i v i l e g e d u s e r s t o e x e c u t e a d - h o c c o m m a n d s o n t h e m . " ) , s = v h ( " C o m m a n d s f o u n d " ) , i = v h ( " L i s t a v a i l a b l e c o m m a n d s " ) , r = v h ( " X M P P A d d r e s s " ) , o = v h ( " N o c o m m a n d s f o u n d " ) ; r e t u r n Q c `
$ { e . alert ? Qc ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert } </div> ` : "" }
< form class = "converse-form" @ submit = $ { e . fetchCommands } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label >
$ { t }
< p class = "form-help" > $ { n } < / p >
< converse - autocomplete
. getAutoCompleteList = "${Xy}"
placeholder = "${r}"
name = "jid" / >
< / 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" >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${i}" >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2021-11-11 22:06:49 +01:00
$ { "list-commands" === e . view ? Qc `
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< ul class = "list-group" >
< li class = "list-group-item active" > $ { e . commands . length ? s : o } : < / l i >
$ { e . commands . map ( ( t => ( ( e , t ) => Qc `
2021-03-19 19:26:15 +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"
@ click = $ { e . toggleCommandForm }
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 >
2021-11-11 22:06:49 +01:00
$ { t . node === e . showform ? ( ( e , t ) => { const n = vh ( "Hide" ) , s = vh ( "Execute" ) ; return Qc `
2021-03-19 19:26:15 +01:00
< form @ submit = $ { e . runCommand } >
2021-11-11 22:06:49 +01:00
$ { t . alert ? Qc ` <div class="alert alert- ${ t . alert _type } " role="alert"> ${ t . alert } </div> ` : "" }
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
< input type = "hidden" name = "command_node" value = "${t.node}" / >
< input type = "hidden" name = "command_jid" value = "${t.jid}" / >
< p class = "form-help" > $ { t . instructions } < / p >
2021-11-11 22:06:49 +01:00
$ { t . fields }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${s}" >
2021-03-19 19:26:15 +01:00
< input type = "button" class = "btn btn-secondary button-cancel" value = "${n}" @ click = $ { e . hideCommandForm } >
< / f i e l d s e t >
< / f o r m >
` })(e,t):""}
< / l i >
2021-11-11 22:06:49 +01:00
` )(e,t)))}
< / u l >
< / f i e l d s e t > ` : " " }
< / f o r m >
` },{Strophe:s_, $ iq:i_,sizzle:r_,u:o_}=jl.env;Cl.elements.define("converse-adhoc-commands",class extends Uf{static get properties(){return{alert:{type:String},alert_type:{type:String},nonce:{type:String},showform:{type:String},view:{type:String}}}constructor(){super(),this.view="choose-service",this.showform="",this.commands=[]}render(){return n_({alert:this.alert,alert_type:this.alert_type,commands:this.commands,fetchCommands:e=>this.fetchCommands(e),hideCommandForm:e=>this.hideCommandForm(e),runCommand:e=>this.runCommand(e),showform:this.showform,toggleCommandForm:e=>this.toggleCommandForm(e),view:this.view})}async fetchCommands(e){e.preventDefault(),delete this.alert_type,delete this.alert;const t=new FormData(e.target).get("jid").trim();let n;try{n=await Cl.disco.supports(s_.NS.ADHOC,t)}catch(e){M.error(e)}if(n)try{this.commands=await Cl.adhoc.getCommands(t),this.view="list-commands"}catch(e){return M.error(e),this.alert_type="danger",this.alert=vh("Sorry, an error occurred while looking for commands on that entity."),this.commands=[],void M.error(e)}else this.alert_type="danger",this.alert=vh("The specified entity doesn't support ad-hoc commands")}async toggleCommandForm(e){e.preventDefault();const t=e.target.getAttribute("data-command-node"),n=this.commands.filter((e=>e.node===t))[0];this.showform!==t&&await async function(e){const t=e.node,n=e.jid,s=qy({type:"set",to:n}).c("command",{xmlns:Uy.NS.ADHOC,node:t,action:"execute"});try{var i;const t=await Cl.sendIQ(s),n=Hy( ` command [ xmlns = "${Uy.NS.ADHOC}" ] ` ,t).pop();e.sessionid=n.getAttribute("sessionid"),e.instructions=null===(i=Hy('x[type="form"][xmlns="jabber:x:data"] instructions',n).pop())||void 0===i?void 0:i.textContent,e.fields=Hy('x[type="form"][xmlns="jabber:x:data"] field',n).map((e=>Gy.xForm2TemplateResult(e,n)))}catch(t){null===t?M.error( ` Error : timeout while trying to execute command for $ { n } ` ):(M.error( ` Error while trying to execute command for $ { n } ` ),M.error(t)),e.fields=[]}}(n),this.showform=t}hideCommandForm(e){e.preventDefault(),this.showform=""}async runCommand(e){e.preventDefault();const t=new FormData(e.target),n=t.get("command_jid").trim(),s=t.get("command_node").trim(),i=this.commands.filter((e=>e.node===s))[0];i.alert=null,this.nonce=o_.getUniqueId();const r=r_(":input:not([type=button]):not([type=submit])",e.target).filter((e=>!["command_jid","command_node"].includes(e.getAttribute("name")))).map(o_.webForm2xForm).filter((e=>e)),o=i_({to:n,type:"set"}).c("command",{sessionid:i.sessionid,node:i.node,xmlns:s_.NS.ADHOC}).c("x",{xmlns:s_.NS.XFORM,type:"submit"});let a;r.forEach((e=>o.cnode(e).up()));try{a=await Cl.sendIQ(o)}catch(e){i.alert_type="danger",i.alert=vh("Sorry, an error occurred while trying to execute the command. See the developer console for details"),M.error("Error while trying to execute an ad-hoc command"),M.error(e)}var c;i.alert=a?null===(c=a.querySelector("note"))||void 0===c?void 0:c.textContent:"Done",i.alert_type="primary",this.nonce=o_.getUniqueId()}}),Cl.elements.define("converse-muc-message-form",class extends ub{toHTML(){var e,t;return(e=>{const t=e.composing_spoiler?vh("Hidden message"):vh("Message"),n=vh("Optional hint"),s=Cl.settings.get("show_send_button");return Qc `
< 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 }
@ input = $ { ab }
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea suggestion - box _ _input
$ { s ? "chat-textarea-send-button" : "" }
$ { 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 >
< /form>`})(Object.assign(this.model.toJSON(),{hint_value:null===(e=this.querySelector(".spoiler-hint"))||void 0===e?void 0:e.value,message_value:null===(t=this.querySelector(".chat-textarea"))||void 0===t?void 0:t.value,onChange:e=>this.model.set({draft:e.target.value}),onDrop:e=>this.onDrop(e),onKeyDown:e=>this.onKeyDown(e),onKeyUp:e=>this.onKeyUp(e),onPaste:e=>this.onPaste(e),scrolled:this.model.ui.get("scrolled"),viewUnreadMessages:e=>this.viewUnreadMessages(e)}))}afterRender(){const e=this.model.session.get("connection_status")===jl.ROOMSTATUS.ENTERED,t=e&&!(this.model.features.get("moderated")&&"visitor"===this.model.getOwnRole());e&&t&&this.initMentionAutoComplete()}initMentionAutoComplete(){this.mention_auto_complete=new va.AutoComplete(this,{auto_first:!0,auto_evaluate:!1,min_chars:Cl.settings.get("muc_mention_autocomplete_min_chars"),match_current_word:!0,list:()=>this.getAutoCompleteList(),filter:"contains"==Cl.settings.get("muc_mention_autocomplete_filter")?va.FILTER_CONTAINS:va.FILTER_STARTSWITH,ac_triggers:["Tab","@"],include_triggers:[],item:Qy}),this.mention_auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}parseMessageForCommands(e){return function(e,t){if(Cl.settings.get("muc_disable_slash_commands")&&!Array.isArray(Cl.settings.get("muc_disable_slash_commands")))return ob(e,t);const n=((t=t.replace(/ ^ \ s * /,"")).match(/ ^ \ / ( [ a - zA - Z ] * ) ? /)||[""]).pop().toLowerCase();if(!n)return!1;const s=t.slice(("/ "+n).length+1).trim();if(!e.getAllowedCommands().includes(n))return!1;switch(n){case" admin ":e_(e,n,s,[" owner "]);break;case" ban ":e_(e,n,s,[" admin "," owner "]);break;case" modtools ":t_(e,s);break;case" deop ":Zy(e,n,s,[" admin "," owner "]);break;case" destroy ":if(!e.verifyAffiliations([" owner "]))break;Jy(e).catch((t=>e.onCommandError(t)));break;case" help ":e.set({show_help_messages:!1},{silent:!0}),e.set({show_help_messages:!0});break;case" kick ":case" mute ":Zy(e,n,s,[],[" moderator "]);break;case" member ":e_(e,n,s,[" admin "," owner "]);break;case" nick ":if(!e.verifyRoles([" visitor "," participant "," moderator "]))break;if(0===s.length){const t=vh('Your nickname is " % 1 $s "',e.get(" nick "));e.createMessage({message:t,type:" error "})}else{const t=Uy.getBareJidFromJid(e.get(" jid "));Cl.send(By({from:va.connection.jid,to:`${t}/${s}`,id:Gy.getUniqueId()}).tree())}break;case" owner ":e_(e,n,s,[" owner "]);break;case" op ":Zy(e,n,s,[" admin "," owner "]);break;case" register ":s.length>1?e.createMessage({message:vh(" Error : invalid number of arguments "),type:" error "}):e.registerNickname().then((t=>{t&&e.createMessage({message:t,type:" error "})}));break;case" revoke ":e_(e,n,s,[" admin "," owner "]);break;case" topic ":case" subject ":e.setSubject(s);break;case" voice ":Zy(e,n,s,[],[" moderator "]);break;default:return ob(e,t)}return!0}(this.model,e)}getAutoCompleteList(){return this.model.getAllKnownNicknames().map((e=>({label:e,value:`@${e}`})))}onKeyDown(e){this.mention_auto_complete.onKeyDown(e)||super.onKeyDown(e)}onKeyUp(e){this.mention_auto_complete.evaluate(e),super.onKeyUp(e)}});const a_=e=>{const t=vh(" Nickname "),n=vh(" Enter groupchat "),s=Cl.settings.get(" muc _show _logs _before _join ")?vh(" Choose a nickname to enter "):vh(" Please choose your nickname "),i=e.get(" nickname _validation _message " ) ; return Qc `
< div class = "chatroom-form-container muc-nickname-form"
@ submit = $ { t => function ( e , t ) { e . preventDefault ( ) ; const n = e . target . nick . value . trim ( ) ; n && t . join ( n ) } ( t , e ) } >
< form class = "converse-form chatroom-form converse-centered-form" >
< fieldset class = "form-group" >
< label > $ { s } < / l a b e l >
< p class = "validation-message" > $ { i } < / p >
< input type = "text"
required = "required"
name = "nick"
value = "${e.get(" nick ")||" "}"
class = "form-control ${i?" error ":" "}"
placeholder = "${t}" / >
< / f i e l d s e t >
< fieldset class = "form-group" >
< input type = "submit" class = "btn btn-primary" name = "join" value = "${n}" / >
< / f i e l d s e t >
< / f o r m >
< / d i v > ` } ; v a r c _ = n ( 2 4 9 0 ) , l _ = { } ; l _ . s t y l e T a g T r a n s f o r m = e g ( ) , l _ . s e t A t t r i b u t e s = Y f ( ) , l _ . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , l _ . d o m A P I = W f ( ) , l _ . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( c _ . Z , l _ ) , c _ . Z & & c _ . Z . l o c a l s & & c _ . Z . l o c a l s , C l . 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 f b { c o n s t r u c t o r ( . . . e ) { v a r t , n , s ; s u p e r ( . . . e ) , 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 " } , ( n = " e v e n t s " ) i n ( t = t h i s ) ? O b j e c t . d e f i n e P r o p e r t y ( t , n , { v a l u e : s , e n u m e r a b l e : ! 0 , c o n f i g u r a b l e : ! 0 , w r i t a b l e : ! 0 } ) : t [ n ] = s } 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 " ) = = = j l . 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 ( ) ) ; t l ( ( e = > { c o n s t t = v h ( " 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 = v h ( " 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 = = = j l . R O O M S T A T U S . E N T E R E D ? Q c `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread_general" ) ? Qc ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { e . can _edit ? ( e => { const t = vh ( "You have unread messages" ) , n = Cl . settings . get ( "message_limit" ) , s = Cl . settings . get ( "visible_toolbar_buttons" ) . call , i = Cl . settings . get ( "visible_toolbar_buttons" ) . emoji , r = Cl . settings . get ( "show_send_button" ) , o = Cl . settings . get ( "visible_toolbar_buttons" ) . spoiler , a = Cl . settings . get ( "show_toolbar" ) ; return Qc `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? Qc ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { a ? Qc `
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? composing _spoiler = "${e.model.get(" composing _spoiler ")}"
? hidden _occupants = "${e.model.get(" hidden _occupants ")}"
? is _groupchat = "${e.is_groupchat}"
? show _call _button = "${s}"
? show _emoji _button = "${i}"
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
? 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 - 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 ) : Q c ` < 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 ! = j l . 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 ? " " : C l . 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 " ) ? Q c ` < 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 " > $ { a _ ( e . m o d e l ) } < / s p a n > ` : v o i d 0 } ) ( { 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 " ) = = = v a . 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 ) { v a r t ; n u l l = = = ( 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 e s s a g e - f o r m " ) ) | | v o i d 0 = = = t | | t . 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 ) { v a r t , n ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) , n u l l = = e | | n u l l = = = ( n = e . s t o p P r o p a g a t i o n ) | | v o i d 0 = = = n | | n . c a l l ( e ) , 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 d _ = { 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 " } ; v a r u _ = n ( 1 1 0 7 ) , h _ = { } ; h _ . s t y l e T a g T r a n s f o r m = e g ( ) , h _ . s e t A t t r i b u t e s = Y f ( ) , h _ . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , h _ . d o m A P I = W f ( ) , h _ . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( u _ . Z , h _ ) , u _ . Z & & u _ . Z . l o c a l s & & u _ . Z . l o c a l s ; c o n s t { u : m _ } = j l . e n v ; C l . 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 - s i d e b a r " , c l a s s e x t e n d s U f { 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 = v a . 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 . o c c u p a n t 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 . o c c u p a n t 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 . 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 . m o d e l . i n i t i a l i z e d . t h e 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 ( e = > { c o n s t t = e = > v h ( " 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 " ) ) , n = v h ( " P a r t i c i p a n t s " ) , s = e . o c c u p a n t s . m a p ( ( n = > ( e = > { c o n s t t = v h ( " O w n e r " ) , n = v h ( " A d m i n " ) , s = v h ( " M e m b e r " ) , i = v h ( " M o d e r a t o r " ) , r = v h ( " V i s i t o r " ) ; r e t u r n Q c `
< li class = "occupant" id = "${e.id}" title = "${(e=>{const t=vh(" This user is a moderator . "),n=vh(" This user can send messages in this groupchat . "),s=vh(" This user can NOT send messages in this groupchat . "),i=`${e.jid} `||" ";return" moderator "===e.role?`${i}${t} ${e.hint_occupant}`:" participant "===e.role?`${i}${n} ${e.hint_occupant}`:" visitor "===e.role?`${i}${s} ${e.hint_occupant}`:[" visitor "," participant "," moderator "].includes(e.role)?void 0:`${i}${e.hint_occupant}`})(e)}" >
< div class = "row no-gutters" >
< div class = "col-auto" >
< div class = "occupant-status occupant-${e.show} circle" title = "${e.hint_show}" > < / d i v >
< / d i v >
< div class = "col occupant-nick-badge" >
< span class = "occupant-nick" @ click = $ { e . onOccupantClicked } > $ { e . nick || e . jid } < / s p a n >
< span class = "occupant-badges" >
$ { "owner" === e . affiliation ? Qc ` <span class="badge badge-groupchat"> ${ t } </span> ` : "" }
$ { "admin" === e . affiliation ? Qc ` <span class="badge badge-info"> ${ n } </span> ` : "" }
$ { "member" === e . affiliation ? Qc ` <span class="badge badge-info"> ${ s } </span> ` : "" }
$ { "moderator" === e . role ? Qc ` <span class="badge badge-info"> ${ i } </span> ` : "" }
$ { "visitor" === e . role ? Qc ` <span class="badge badge-secondary"> ${ r } </span> ` : "" }
< / s p a n >
< / d i v >
< / d i v >
< / l i >
` })(Object.assign({jid:"",hint_show:d_[n.get("show")],hint_occupant:t(n),onOccupantClicked:e.onOccupantClicked},n.toJSON()))));return Qc `
< div class = "occupants-header" >
< i class = "hide-occupants fa fa-times" @ click = $ { e . closeSidebar } > < / i >
< div class = "occupants-header--title" >
< span class = "occupants-heading" > $ { n } < / s p a n >
< / d i v >
< / d i v >
< div class = "dragresize dragresize-occupants-left" > < / d i v >
< ul class = "occupant-list" > $ { s } < / u l >
` })(Object.assign(this.model.toJSON(),{occupants:[...this.model.occupants.models],closeSidebar:e=>this.closeSidebar(e),onOccupantClicked:e=>this.onOccupantClicked(e)}))}closeSidebar(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),m_.safeSave(this.model,{hidden_occupants:!0})}onOccupantClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=va.chatboxviews.get(this.getAttribute("jid"));null==n||n.getBottomPanel().insertIntoTextArea( ` @ $ { e . target . textContent } ` )}});const{u:f_}=jl.env;Cl.elements.define("converse-muc-chatarea",class extends Uf{static get properties(){return{jid:{type:String},show_help_messages:{type:Boolean},type:{type:String}}}connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){this.model=await Cl.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=>{var t;return Qc `
< 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 >
$ { null !== ( t = e . model ) && void 0 !== t && t . get ( "show_help_messages" ) ? Qc ` <div class="chat-content__help">
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . getHelpMessages ( ) }
type = "info"
chat _type = "${va.CHATROOMS_TYPE}"
> < / 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 >
$ { e . model ? Qc `
< 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 > ` : " " }
` })({getHelpMessages:()=>this.getHelpMessages(),jid:this.jid,model:this.model,onMousedown:e=>this.onMousedown(e),show_send_button:va.show_send_button,shouldShowSidebar:()=>this.shouldShowSidebar(),type:this.type})}shouldShowSidebar(){return!this.model.get("hidden_occupants")&&this.model.session.get("connection_status")===jl.ROOMSTATUS.ENTERED}getHelpMessages(){const e=Cl.settings.get("muc_disable_slash_commands"),t=Array.isArray(e)?e:[];return[ ` < strong > / a d m i n < / s t r o n g > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 > : $ { v h ( " 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 ) { f _ . 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 ) ; f _ . 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 : g _ } = j l . e n v , p _ = j l . e n v . u t i l s , { s i z z l e : v _ } = j l . e n v , b _ = j l . e n v . u t i l s ; C l . 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 - c o n f i g - f o r m " , c l a s s e x t e n d s U f { 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 = v a . 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 = C l . 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 ) { v a r o , a ; c o n s t c = p _ . t o S t a n z a ( n ) ; i = g _ ( " f i e l d " , c ) , 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 l = { 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 = > p _ . x F o r m 2 T e m p l a t e R e s u l t ( e , c , l ) ) ) , r = n u l l = = = ( o = c . q u e r y S e l e
< form class = "converse-form chatroom-form ${i.length?" ":" converse - form -- spinner "}"
autocomplete = "off"
@ submit = $ { e . submitConfigForm } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< legend class = "centered" > $ { s } < / l e g e n d >
$ { s !== r ? Qc ` <p class="form-help"> ${ r } </p> ` : "" }
$ { i . length ? i : Iv ( { classes : "hor_centered" } ) }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2021-11-11 22:06:49 +01:00
$ { i . length ? Qc `
< fieldset >
< input type = "submit" class = "btn btn-primary" value = "${c}" >
< input type = "button" class = "btn btn-secondary button-cancel" value = "${l}" @ click = $ { e . closeConfigForm } >
< / f i e l d s e t > ` : " " }
< / f o r m >
` })({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=v_(":input:not([type=button]):not([type=submit])",e.target).map(b_.webForm2xForm).filter((e=>e));try{await this.model.sendConfiguration(t)}catch(e){M.error(e);const t=vh("Sorry, an error occurred while trying to submit the config form.")+" "+vh("Check your browser's developer console for details.");Cl.alert("error",vh("Error"),t)}await this.model.refreshDiscoInfo(),this.closeForm()}closeForm(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.session.set("view",null)}});Cl.elements.define("converse-muc-destroyed",class extends Uf{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=va.chatboxes.get(this.jid)}render(){const e=this.model.get("destroyed_reason");return(e=>{const t=vh("This groupchat no longer exists"),n=vh('The following reason was given: "%1 $ s"',e.reason||"");return Qc `
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { t } < / h 3 >
< / d i v >
$ { e . reason ? Qc ` <p class="destroyed-reason"> ${ n } </p> ` : "" }
$ { e . moved _jid ? ( e => { const t = vh ( "The conversation has moved to a new address. Click the link below to enter." ) ; return Qc `
< 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 ) : " " }
` })({moved_jid:this.model.get("moved_jid"),reason:e,onSwitch:e=>this.onSwitch(e)})}async onSwitch(e){e.preventDefault();const t=this.model.get("moved_jid");(await Cl.rooms.get(t,{},!0)).maybeShow(!0),this.model.destroy()}}),Cl.elements.define("converse-muc-disconnected",class extends Uf{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=va.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(vh("This action was done by %1 $ s.",n));const s=this.model.session.get("disconnection_reason");return s&&t.push(vh('The reason given is: "%1 $ s".',s)),(e=>Qc `
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { e [ 0 ] } < / h 3 >
$ { e . slice ( 1 ) . map ( ( e => Qc ` <p class="disconnect-msg"> ${ e } </p> ` ) ) }
< / d i v > ` ) ( t ) } } ) ; c o n s t y _ = j l . e n v . u t i l s , _ _ = K g . e x t e n d ( { i d : " m u c - i n v i t e - m o d a l " , i n i t i a l i z e ( ) { K g . p r o t o t y p e . i n i t i a l i z e . a p p l y ( t h i s , a r g u m e n t 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 n d e r ) , t h i s . i n i t I n v i t e W i d g e t ( ) } , t o H T M L ( ) { r e t u r n ( e = > { c o n s t t = v h ( " I n v i t e " ) , n = v h ( " I n v i t e s o m e o n e t o t h i s g r o u p c h a t " ) , s = v h ( " u s e r @ e x a m p l e . o r g " ) , i = v h ( " 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 " ) , r = v h ( " X M P P A d d r e s s " ) , o = v h ( " O p t i o n a l r e a s o n f o r t h e i n v i t a t i o n " ) ; r e t u r n Q c `
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "add-chatroom-modal-label" > $ { n } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "suggestion-box room-invite" >
< form @ submit = $ { e . submitInviteForm } >
< div class = "form-group" >
< label class = "clearfix" for = "invitee_jids" > $ { r } : < / l a b e l >
$ { e . invalid _invite _jid ? Qc ` <div class="error error-feedback"> ${ i } </div> ` : "" }
< input class = "form-control suggestion-box__input"
required = "required"
name = "invitee_jids"
id = "invitee_jids"
placeholder = "${s}"
type = "text" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< ul class = "suggestion-box__results suggestion-box__results--below" hidden = "" > < / u l >
< / d i v >
< div class = "form-group" >
< label > $ { o } : < / 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" >
< button type = "submit" class = "btn btn-primary" > $ { t } < / b u t t o n >
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
` })(Object.assign(this.model.toJSON(),{submitInviteForm:e=>this.submitInviteForm(e)}))},initInviteWidget(){this.invite_auto_complete&&this.invite_auto_complete.destroy();const e=va.roster.map((e=>({label:e.getDisplayName(),value:e.get("jid")}))),t=this.el.querySelector(".suggestion-box").parentElement;this.invite_auto_complete=new va.AutoComplete(t,{min_chars:1,list:e})},submitInviteForm(e){e.preventDefault();const t=new FormData(e.target),n=t.get("invitee_jids"),s=t.get("reason");y_.isValidJID(n)?(this.chatroomview.model.directInvite(n,s),this.modal.hide()):this.model.set({invalid_invite_jid:!0})}}),w_=Kg.extend({id:"muc-details-modal",initialize(){Kg.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.listenTo(this.model.features,"change",this.render),this.listenTo(this.model.occupants,"add",this.render),this.listenTo(this.model.occupants,"change",this.render)},toHTML(){return(e=>{const t=vh("Groupchat XMPP address"),n=vh("Message archiving"),s=vh("Messages are archived on the server"),i=vh("Description"),r=vh("Features"),o=vh("Hidden"),a=vh("This groupchat is not publicly searchable"),c=vh("This groupchat is restricted to members only"),l=vh("Members only"),d=vh("Moderated"),u=vh("Participants entering this groupchat need to request permission to write"),h=vh("Name"),m=vh("This groupchat does not require a password upon entry"),f=vh("No password required"),g=vh("Not anonymous"),p=vh("All other groupchat participants can see your XMPP address"),v=vh("Not moderated"),b=vh("Participants entering this groupchat can write right away"),y=vh("Online users"),_=vh("Open"),w=vh("Anyone can join this groupchat"),S=vh("This groupchat requires a password before entry"),x=vh("Password protected"),E=vh("Persistent"),A=vh("This groupchat persists even if it's unoccupied"),C=vh("Public"),T=vh("Semi-anonymous"),k=vh("Only moderators can see your XMPP address"),j=vh("Temporary"),N=vh("This groupchat will disappear once the last person leaves");return Qc `
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "muc-details-modal-label" > $ { e . display _name } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "room-info" >
< p class = "room-info" > < strong > $ { h } < / s t r o n g > : $ { e . n a m e } < / p >
< p class = "room-info" > < strong > $ { t } < / s t r o n g > : $ { e . j i d } < / p >
< p class = "room-info" > < strong > $ { i } < / s t r o n g > : $ { e . c o n f i g . d e s c r i p t i o n } < / p >
$ { e . subject ? ( e => { const t = vh ( "Topic" ) , n = vh ( "Topic author" ) ; return Qc `
< p class = "room-info" > < strong > $ { t } < / s t r o n g > : $ { e . s u b j e c t . t e x t } < / p >
< 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 >
` })(e):""}
< p class = "room-info" > < strong > $ { y } < / s t r o n g > : $ { e . n u m _ o c c u p a n t s } < / p >
< p class = "room-info" > < strong > $ { r } < / s t r o n g > :
< div class = "chatroom-features" >
< ul class = "features-list" >
$ { e . features . passwordprotected ? Qc ` <li class="feature" ><span class="fa fa-lock"></span> ${ x } - <em> ${ S } </em></li> ` : "" }
$ { e . features . unsecured ? Qc ` <li class="feature" ><span class="fa fa-unlock"></span> ${ f } - <em> ${ m } </em></li> ` : "" }
$ { e . features . hidden ? Qc ` <li class="feature" ><span class="fa fa-eye-slash"></span> ${ o } - <em> ${ a } </em></li> ` : "" }
$ { e . features . public _room ? Qc ` <li class="feature" ><span class="fa fa-eye"></span> ${ C } - <em> ${ e . _ _ ( "This groupchat is publicly searchable" ) } </em></li> ` : "" }
$ { e . features . membersonly ? Qc ` <li class="feature" ><span class="fa fa-address-book"></span> ${ l } - <em> ${ c } </em></li> ` : "" }
$ { e . features . open ? Qc ` <li class="feature" ><span class="fa fa-globe"></span> ${ _ } - <em> ${ w } </em></li> ` : "" }
$ { e . features . persistent ? Qc ` <li class="feature" ><span class="fa fa-save"></span> ${ E } - <em> ${ A } </em></li> ` : "" }
$ { e . features . temporary ? Qc ` <li class="feature" ><span class="fa fa-snowflake-o"></span> ${ j } - <em> ${ N } </em></li> ` : "" }
$ { e . features . nonanonymous ? Qc ` <li class="feature" ><span class="fa fa-id-card"></span> ${ g } - <em> ${ p } </em></li> ` : "" }
$ { e . features . semianonymous ? Qc ` <li class="feature" ><span class="fa fa-user-secret"></span> ${ T } - <em> ${ k } </em></li> ` : "" }
$ { e . features . moderated ? Qc ` <li class="feature" ><span class="fa fa-gavel"></span> ${ d } - <em> ${ u } </em></li> ` : "" }
$ { e . features . unmoderated ? Qc ` <li class="feature" ><span class="fa fa-info-circle"></span> ${ v } - <em> ${ b } </em></li> ` : "" }
$ { e . features . mam _enabled ? Qc ` <li class="feature" ><span class="fa fa-database"></span> ${ n } - <em> ${ s } </em></li> ` : "" }
< / u l >
< / d i v >
< / p >
< / d i v >
< / d i v >
< div class = "modal-footer" > $ { Yg } < / d i v >
< / d i v >
< / d i v >
` })(Object.assign(this.model.toJSON(),{config:this.model.config.toJSON(),display_name:vh("Groupchat info for %1 $ s",this.model.getDisplayName()),features:this.model.features.toJSON(),num_occupants:this.model.occupants.length}))}});Cl.elements.define("converse-rich-text",class extends Uf{static get properties(){return{embed_audio:{type:Boolean},embed_videos:{type:Boolean},mentions:{type:Array},nick:{type:String},offset:{type:Number},onImgClick:{type:Function},onImgLoad:{type:Function},render_styling:{type:Boolean},show_images:{type:Boolean},hide_media_urls:{type:Boolean},show_me_message:{type:Boolean},text:{type:String}}}constructor(){super(),this.embed_audio=!1,this.embed_videos=!1,this.hide_media_urls=!1,this.mentions=[],this.offset=0,this.render_styling=!1,this.show_image_urls=!0,this.show_images=!1,this.show_me_message=!1}render(){const e={embed_audio:this.embed_audio,embed_videos:this.embed_videos,nick:this.nick,onImgClick:this.onImgClick,onImgLoad:this.onImgLoad,render_styling:this.render_styling,show_images:this.show_images,show_me_message:this.show_me_message,hide_media_urls:this.hide_media_urls};return sv(this.text,this.offset,this.mentions,e)}});var S_=n(679),x_={};x_.styleTagTransform=eg(),x_.setAttributes=Yf(),x_.insert=Jf().bind(null,"head"),x_.domAPI=Wf(),x_.insertStyleElement=Xf(),Hf()(S_.Z,x_),S_.Z&&S_.Z.locals&&S_.Z.locals,Cl.elements.define("converse-muc-heading",class extends mg{async connectedCallback(){super.connectedCallback(),this.model=va.chatboxes.get(this.getAttribute("jid")),this.debouncedRender=hc(this.render,100),this.listenTo(this.model,"change",this.debouncedRender);const e=await va.api.user.settings.getModel();this.listenTo(e,"change:mucs_with_hidden_subject",this.debouncedRender),await this.model.initialized,this.listenTo(this.model.features,"change:open",this.debouncedRender),this.model.occupants.forEach((e=>this.onOccupantAdded(e))),this.listenTo(this.model.occupants,"add",this.onOccupantAdded),this.listenTo(this.model.occupants,"change:affiliation",this.onOccupantAffiliationChanged),this.render()}async render(){const e=await this.generateHeadingTemplate();tl(e,this)}onOccupantAdded(e){e.get("jid")===va.bare_jid&&this.debouncedRender()}onOccupantAffiliationChanged(e){e.get("jid")===va.bare_jid&&this.debouncedRender()}showRoomDetailsModal(e){e.preventDefault(),Cl.modal.show(w_,{model:this.model},e)}showInviteModal(e){e.preventDefault(),Cl.modal.show(__,{model:new Zo,chatroomview:this},e)}toggleTopic(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.toggleSubjectHiddenState()}getAndRenderConfigurationForm(){this.model.session.set("view",jl.MUC.VIEWS.CONFIG)}close(e){e.preventDefault(),this.model.close()}destroy(e){e.preventDefault(),Jy(this.model)}getHeadingButtons(e){const t=[];t.push({i18n_text:vh("Details"),i18n_title:vh("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:vh("Configure"),i18n_title:vh("Configure this groupchat"),handler:()=>this.getAndRenderConfigurationForm(),a_class:"configure-chatroom-button",icon_class:"fa-wrench",name:"configure"}),this.model.invitesAllowed()&&t.push({i18n_text:vh("Invite"),i18n_title:vh("Invite someone to join this groupchat"),handler:e=>this.showInviteModal(e),a_class:"open-invite-modal",icon_class:"fa-user-plus",name:"invite"});const n=this.model.get("subject");if(n&&n.text&&t.push({i18n_text:vh(e?"Show topic":"Hide topic"),i18n_title:vh(e?"Show the topic message in the heading":"Hide the topic in the heading"),handler:e=>this.toggleTopic(e),a_class:"hide-topic",icon_class:"fa-minus-square",name:"toggle-topic"}),this.model.session.get("connection_status")===jl.ROOMSTATUS.ENTERED){const e=this.model.getAllowedCommands();e.includes("modtools")&&t.push({i18n_text:vh("Moderate"),i18n_title:vh("Moderate this groupchat"),handler:()=>t_(this.model),a_class:"moderate-chatroom-button",icon_class:"fa-user-cog",name:"moderate"}),e.includes("destroy")&&t.
< div class = "chatbox-title ${i?" ":" chatbox - title -- no - desc "}" >
$ { va . api . settings . get ( "singleton" ) ? "" : Qc ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
< div class = "chatbox-title__text" title = "${" hidden "!==va.locked_muc_domain?e.jid:" "}" > $ { e . title }
$ { e . bookmarked ? Qc ` <i class="fa fa-bookmark chatbox-title__text--bookmarked" title=" ${ n } "></i> ` : "" }
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
$ { e . standalone _btns . length ? ( e => e . standalone _btns . reverse ( ) . map ( ( e => dp ( e , "" ) ) ) ) ( e ) : "" }
$ { e . dropdown _btns . length ? Qc ` <converse-dropdown class="dropleft" color="var(--chatroom-head-color)" .items= ${ e . dropdown _btns } ></converse-dropdown> ` : "" }
< / d i v >
< / d i v >
$ { i ? Qc ` <p class="chat-head__desc" title=" ${ t } ">
< converse - rich - text text = $ { s } render _styling > < / c o n v e r s e - r i c h - t e x t >
< / p > ` : " " }
` })(Object.assign(this.model.toJSON(),{_converse:va,subject_hidden:e,dropdown_btns:s.map((e=>sb(e))),standalone_btns:n.map((e=>ib(e))),title:this.model.getDisplayName()}))}});Cl.elements.define("converse-muc-nickname-form",class extends Uf{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=va.chatboxes.get(this.jid)}render(){return a_(this.model)}});function E_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Cl.elements.define("converse-muc-password-form",class extends Uf{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=va.chatboxes.get(this.jid),this.listenTo(this.model,"change:password_validation_message",this.render),this.render()}render(){return(e=>{const t=vh("This groupchat requires a password"),n=vh("Password: "),s=vh("Submit");return Qc `
< 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" >
2021-11-11 22:06:49 +01:00
< input class = "btn btn-primary" type = "submit" value = "${s}" / >
< / f i e l d s e t >
2021-03-19 19:26:15 +01:00
< / f o r m >
2021-11-11 22:06:49 +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)}});class A_ extends gb{constructor(...e){super(...e),E_(this,"length",300),E_(this,"is_chatroom",!0)}connectedCallback(){super.connectedCallback(),this.initialize()}async initialize(){this.model=await Cl.rooms.get(this.jid),va.chatboxviews.add(this.jid,this),this.setAttribute("id",this.model.get("box_id")),this.listenTo(va,"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(),Cl.trigger("chatRoomViewInitialized",this)}render(){return(e=>Qc `
< 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 >
$ { e . model ? Qc `
< 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 >
< div class = "chat-body chatroom-body row no-gutters" > $ { function ( e ) { const t = e . model . session . get ( "view" ) , n = e . model . get ( "jid" ) , s = jl . ROOMSTATUS , i = e . model . session . get ( "connection_status" ) ; return t === jl . MUC . VIEWS . CONFIG ? Qc ` <converse-muc-config-form class="muc-form-container" jid=" ${ n } "></converse-muc-config-form> ` : t === jl . MUC . VIEWS . BOOKMARK ? Qc ` <converse-muc-bookmark-form class="muc-form-container" jid=" ${ n } "></converse-muc-bookmark-form> ` : Qc `
$ { i == s . PASSWORD _REQUIRED ? Qc ` <converse-muc-password-form class="muc-form-container" jid=" ${ n } "></converse-muc-password-form> ` : "" }
$ { i == s . ENTERED ? Qc ` <converse-muc-chatarea jid=" ${ n } "></converse-muc-chatarea> ` : "" }
$ { i == s . CONNECTING ? Iv ( ) : "" }
$ { i == s . NICKNAME _REQUIRED ? function ( e ) { const t = e . get ( "jid" ) ; return Cl . settings . get ( "muc_show_logs_before_join" ) ? Qc ` <converse-muc-chatarea jid=" ${ t } "></converse-muc-chatarea> ` : Qc ` <converse-muc-nickname-form jid=" ${ t } "></converse-muc-nickname-form> ` } ( e . model ) : "" }
$ { i == s . DISCONNECTED ? Qc ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . BANNED ? Qc ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . DESTROYED ? Qc ` <converse-muc-destroyed jid=" ${ n } "></converse-muc-destroyed> ` : "" }
` }(e)}</div>
` :""}
2021-11-12 22:09:04 +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 " ) = = = j l . 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 ( ) } } C l . 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 " , A _ ) ; v a r C _ = n ( 1 5 5 7 ) , T _ = { } ; T _ . s t y l e T a g T r a n s f o r m = e g ( ) , T _ . s e t A t t r i b u t e s = Y f ( ) , T _ . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , T _ . d o m A P I = W f ( ) , T _ . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( C _ . Z , T _ ) , C _ . Z & & C _ . Z . l o c a l s & & C _ . Z . l o c a l s , j l . M U C . V I E W S = { C O N F I G : " c o n f i g - f o r m " , B O O K M A R K : " b o o k m a r k - f o r m " } , j l . 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 ; C l . 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 = A _ , C l . 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 ) } ) ) , C l . l i s t e n . o n ( " c o n t r o l B o x I n i t i a l i z e d " , ( e = > { C l . s e t t i n g s . g e t ( " a l l o w _ m u c " ) & & ( Y y ( e ) , e . m o d e l . o n ( " c h a n g e : c o n n e c t e d " , ( ( ) = > Y y ( e ) ) ) ) } ) ) , C l . 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 " ) , v a . 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 } ` & & v a . r o u t e r . n a v i g a t e ( " " ) ) } ) ) } } ) ; v a r k _ = n ( 4 0 2 3 ) , j _ = n . n ( k _ ) ; c o n s t { S t r o p h e : N _ } = j l . e n v , O _ = " N o t i f i c a t i o n " i n w i n d o w ; l e t $ _ ; f u n c t i o n I _ ( e ) { v a r t ; r e t u r n v a . i s T e s t E n v ( ) | | ( ( n u l l = = = ( t = v a . c h a t b o x e s . g e t ( e . f r o m ) ) | | v o i d 0 = = = t ? v o i d 0 : t . i s H i d d e n ( ) ) ? ? ! 1 ) } f u n c t i o n M _ ( ) { r e t u r n v a . i s T e s t E n v ( ) | | O _ & & C l . s e t t i n g s . g e t ( " s h o w _ d e s k t o p _ n o t i f i c a t i o n s " ) & & " g r a n t e d " = = = N o t i f i c a t i o n . p e r m i s s i o n } f u n c t i o n R _ ( ) { v a r e , t ; $ _ = n u l l , n u l l = = = ( e = ( t = n a v i g a t o r ) . c l e a r A p p B a d g e ) | | v o i d 0 = = = e | | e . c a l l ( t ) . c a t c h ( ( e = > M . e r r o r ( " C o u l d n o t c l e a r u n r e a d c o u n t i n a p p b a d g e " + e ) ) ) } f u n c t i o n D _ ( ) { i f ( C l . s e t t i n g s . g e t ( " s h o w _ t a b _ n o t i f i c a t i o n s " ) ) { v a r e , t ; $ _ = $ _ ? ? n e w j l . e n v . F a v i c o ( { t y p e : " c i r c l e " , a n i m a t i o n : " p o p " } ) ; c o n s t n = v a . c h a t b o x e s . m o d e l s . r e d u c e ( ( ( e , t ) = > e + ( t . g e t ( " n u m _ u n r e a d " ) | | 0 ) ) , 0 ) ; $ _ . b a d g e ( n ) , n u l l = = = ( e = ( t = n a v i g a t o r ) . s e t A p p B a d g e ) | | v o i d 0 = = = e | | e . c a l l ( t , n ) . c a t c h ( ( e = > M . e r r o r ( " C o u l d s e t u n r e a d c o u n t i n a p p b a d g e - " + e ) ) ) } } f u n c t i o n L _ ( e , t , n ) { r e t u r n e . r e d u c e ( ( ( e , s ) = > e | | ( e = > [ v a . b a r e _ j i d , ` $ { t } / $ { n } ` ] . i n c l u d e s ( e . u r i . r e p l a c e ( / ^ x m p p : / , " " ) ) ) ( s ) ) , ! 1 ) } a s y n c f u n c t i o n z _ ( e ) { i f ( ! a w a i t f u n c t i o n ( 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 ( ! ( n u l l ! = e & & e . b o d y | | n u l l ! = e & & 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 = C l . 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 = v a . c h a t b o x e s . g e t ( n ) , r = N _ . g e t R e s o u r c e F r o m J i d ( t ) , o = r & & N _ . 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 " ) ; C l . 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 y ) ) ; c o n s t l = o ! = = c , d = ! 0 = = = s | | A r r a y . i s A r r a y ( s ) & & s . i n c l u d e s ( n ) | | L _ ( e . r e f e r e n c e s , n , c ) | | a ; r e t u r n ! ( ! l | | ! d ) & & a w a i t C l . h o o k ( " s h o u l d N o t i f y O f G r o u p M e s s a g e " , e , ! 0 ) } ( t ) ; i f ( " i n f o " = = = 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 . f r o m _ m u c ) r e t u r n ! 1 ; c o n s t t = a w a i t C l . r o o m s . g e t ( e . f r o m _ m u c ) ; i f ( ! t ) r e t u r n ! 1 ; c o n s t n = t . g e t ( " n i c k " ) , s = e . f r o m _ m u c , i = C l . 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 " ) ; r e t u r n ! 0 = = = i | | A r r a y . i s A r r a y ( i ) & & i . i n c l u d e s ( s ) | | L _ ( e . r e f e r e n c e s , s , n ) } ( t ) ; i f ( t . i s _ h e a d l i n e ) r e t u r n I _ ( t ) ; c o n s t n = N _ . g e t B a r e J i d F r o m J i d ( t . f r o m ) = = = v a . b a r e _ j i d ; r e t u r n ! e a ( t ) & & ! n & & ( " a l l " = = = C l . s e t t i n g s . g e t ( " s h o w _ d e s k t o p _ n o t i f i c a t i o n s " ) | | I _ ( t ) ) } ( e ) ) r e t u r n ! 1 ; C l . t r i g g e r ( " m e s s a g e N o t i f i c a t i o n " , e ) , f u n c t i o n ( ) { i f ( C l . s e t t i n g s . g e t ( " p l a y _ s o u n d s " ) & & v o i d 0 ! = = w i n d o w . A u d i o ) { c o n s t e = n e w A u d i o ( C l . s e t t i n g s . g e t ( " s o u n d s _ p a t h " ) + " m s g _ r e c e i v e d . o g g " ) , t = e . c a n P l a y T y p e ( " a u d i o / o g g " ) ; i f ( " p r o b a b l y " = = = t ) r e t u r n e . p l a y ( ) ; c o n s t n = n e w A u d i o ( C l . s e t t i n g s . g e t ( " s o u n d s _ p a t h " ) + " m s g _ r e c e i v e d . m p 3 " ) , s = n . c a n P l a y T y p e ( " a u d i o / m p 3 " ) ; " p r o b a b l y " = = = s ? n . p l a y ( ) : " m a y b e " = = = t ? e . p l a y (
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "converse-modtools-modal-label" > $ { t } < / h 5 >
2021-11-11 22:06:49 +01:00
$ { Qg }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body" >
2021-11-11 22:06:49 +01:00
$ { i && r ? ( e => { const t = vh ( "About" ) , n = vh ( "Commands" ) ; return Qc `
2021-03-19 19:26:15 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link active" id = "about-tab" href = "#about-tabpanel" aria - controls = "about-tabpanel" role = "tab" data - toggle = "tab" @ click = $ { e . switchTab } > $ { t } < / a >
< / l i >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link" id = "commands-tab" href = "#commands-tabpanel" aria - controls = "commands-tabpanel" role = "tab" data - toggle = "tab" @ click = $ { e . switchTab } > $ { n } < / a >
< / l i >
< / u l >
` })(e):""}
< div class = "tab-content" >
< div class = "tab-pane tab-pane--columns ${i?" 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 >
< p class = "brand-subtitle" > $ { e . version _name } < / p >
2021-11-11 22:06:49 +01:00
< p class = "brand-subtitle" > $ { Gv ( No ( ) . sanitize ( n ) ) } < / p >
< p class = "brand-subtitle" > $ { Gv ( No ( ) . sanitize ( s ) ) } < / p >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "tab-pane tab-pane--columns ${!i&&r?" active ":" "}"
2021-03-19 19:26:15 +01:00
id = "commands-tabpanel"
role = "tabpanel"
aria - labelledby = "commands-tab" >
< converse - adhoc - commands / >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
` })(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{version_name:q_.VERSION_NAME}))}});Cl.elements.define("converse-user-profile",class extends Pg{async initialize(){this.model=va.xmppstatus,this.listenTo(this.model,"change",this.render),await Cl.waitUntil("VCardsInitialized"),this.listenTo(this.model.vcard,"change",this.render),this.render()}render(){const e=this.model.get("status")||"offline";var t;tl((e=>{const t=vh("Log out"),n=vh("Click to change your chat status"),s=vh("Show details about this chat client"),i=Cl.settings.get("show_client_info")||Cl.settings.get("allow_adhoc_commands");return Qc `
< div class = "userinfo controlbox-padded" >
< div class = "controlbox-section profile d-flex" >
< a class = "show-profile" href = "#" @ click = $ { e . showProfileModal } >
< canvas class = "avatar align-self-center" height = "40" width = "40" > < / c a n v a s >
< / a >
< span class = "username w-100 align-self-center" > $ { e . fullname } < / s p a n >
$ { i ? Qc ` <a class="controlbox-heading__btn show-client-info fa fa-cog align-self-center" title=" ${ s } " @click= ${ e . showUserSettingsModal } ></a> ` : "" }
$ { Cl . settings . get ( "allow_logout" ) ? Qc ` <a class="controlbox-heading__btn logout fa fa-sign-out-alt align-self-center" title=" ${ t } " @click= ${ e . logout } ></a> ` : "" }
< / d i v >
< div class = "d-flex xmpp-status" >
< a class = "change-status" title = "${n}" data - toggle = "modal" data - target = "#changeStatusModal" @ click = $ { e . showStatusChangeModal } >
< span class = "${e.chat_status} w-100 align-self-center" data - value = "${e.chat_status}" >
< span class = "
$ { "online" === e . chat _status && "fa fa-circle chat-status chat-status--online" }
$ { "dnd" === e . chat _status && "fa fa-minus-circle chat-status chat-status--busy" }
$ { "away" === e . chat _status && "fa fa-circle chat-status chat-status--away" }
$ { "xa" === e . chat _status && "far fa-circle chat-status chat-status--xa " }
$ { "offline" === e . chat _status && "fa fa-circle chat-status chat-status--offline" } " > < / s p a n > $ { e . s t a t u s _ m e s s a g e } < / s p a n >
< / a >
< / d i v >
< / d i v >
` })(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{chat_status:e,fullname:this.model.vcard.get("fullname")||va.bare_jid,showUserSettingsModal:e=>this.showUserSettingsModal(e),status_message:this.model.get("status_message")||vh("I am %1 $ s",(t=e,"chat"===t?vh("online"):"dnd"===t?vh("busy"):"xa"===t?vh("away for long"):"away"===t?vh("away"):"offline"===t?vh("offline"):vh(t)||vh("online"))),logout:this.logout,showStatusChangeModal:()=>this.showStatusChangeModal(),showProfileModal:()=>this.showProfileModal()})),this),this.renderAvatar()}showProfileModal(e){null==e||e.preventDefault(),Cl.modal.show(va.ProfileModal,{model:this.model},e)}showStatusChangeModal(e){null==e||e.preventDefault(),Cl.modal.show(va.ChatStatusModal,{model:this.model},e)}showUserSettingsModal(e){null==e||e.preventDefault(),Cl.modal.show(H_,{model:this.model,_converse:va},e)}logout(e){null==e||e.preventDefault(),!0===confirm(vh("Are you sure you want to log out?"))&&Cl.user.logout()}});const G_=jl.env.utils,W_=Kg.extend({id:"modal-status-change",events:{"submit form#set-xmpp-status":"onFormSubmitted","click .clear-input":"clearStatusMessage"},toHTML(){return(e=>Qc `
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "changeStatusModalLabel" > $ { e . modal _title } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< form class = "converse-form set-xmpp-status" id = "set-xmpp-status" >
< div class = "form-group" >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "online" === e . status }
type = "radio" id = "radio-online" value = "online" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-online" >
< span class = "fa fa-circle chat-status chat-status--online" > < / s p a n > $ { e . l a b e l _ o n l i n e } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "busy" === e . status }
type = "radio" id = "radio-busy" value = "dnd" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-busy" >
< span class = "fa fa-minus-circle chat-status chat-status--busy" > < / s p a n > $ { e . l a b e l _ b u s y } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "away" === e . status }
type = "radio" id = "radio-away" value = "away" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-away" >
< span class = "fa fa-circle chat-status chat-status--away" > < / s p a n > $ { e . l a b e l _ a w a y } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "xa" === e . status }
type = "radio" id = "radio-xa" value = "xa" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-xa" >
< span class = "far fa-circle chat-status chat-status--xa" > < / s p a n > $ { e . l a b e l _ x a } < / 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"
value = "${e.status_message||" "}" placeholder = "${e.placeholder_status_message}" / >
< span class = "clear-input fa fa-times ${e.status_message?" ":" hidden "}" > < / s p a n >
< / d i v >
< / d i v >
< button type = "submit" class = "btn btn-primary" > $ { e . label _save } < / b u t t o n >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
` )(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{label_away:vh("Away"),label_busy:vh("Busy"),label_cancel:vh("Cancel"),label_close:vh("Close"),label_custom_status:vh("Custom status"),label_offline:vh("Offline"),label_online:vh("Online"),label_save:vh("Save"),label_xa:vh("Away for long"),modal_title:vh("Change chat status"),placeholder_status_message:vh("Personal status message")}))},afterRender(){this.el.addEventListener("shown.bs.modal",(()=>{this.el.querySelector('input[name="status_message"]').focus()}),!1)},clearStatusMessage(e){e&&e.preventDefault&&(e.preventDefault(),G_.hideElement(this.el.querySelector(".clear-input"))),this.el.querySelector('input[name="status_message"]').value=""},onFormSubmitted(e){e.preventDefault();const t=new FormData(e.target);this.model.save({status_message:t.get("status_message"),status:t.get("chat_status")}),this.modal.hide()}});va.ChatStatusModal=W_;const V_=vh("Your profile picture");Cl.elements.define("converse-image-picker",class extends Uf{static get properties(){return{height:{type:Number},image:{type:String},width:{type:Number}}}render(){const e={height:this.height,image:this.image,width:this.width};return Qc `
< a class = "change-avatar" @ click = $ { this . openFileSelection } title = "${V_}" >
$ { _v ( e ) }
2021-03-19 19:26:15 +01:00
< / a >
< input @ change = $ { this . updateFilePreview } class = "hidden" name = "image" type = "file" / >
2021-11-11 22:06:49 +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.image=n.result,n.readAsDataURL(t)}});const J_=jl.env.utils,K_=e=>{var t;const n=vh("This device's OMEMO fingerprint"),s=vh("Generate new keys and fingerprint");return Qc `
< div class = "tab-pane" id = "omemo-tabpanel" role = "tabpanel" aria - labelledby = "omemo-tab" >
< form class = "converse-form fingerprint-removal" >
< ul class = "list-group fingerprints" >
< li class = "list-group-item active" > $ { n } < / l i >
< li class = "list-group-item" >
$ { e . view . current _device && e . view . current _device . get ( "bundle" ) && e . view . current _device . get ( "bundle" ) . fingerprint ? ( e => Qc `
< span class = "fingerprint" > $ { J _ . formatFingerprint ( e . view . current _device . get ( "bundle" ) . fingerprint ) } < / s p a n > ` ) ( e ) : I v ( ) }
< / l i >
< / u l >
< div class = "form-group" >
< button type = "button" class = "generate-bundle btn btn-danger" > $ { s } < / b u t t o n >
< / d i v >
$ { null !== ( t = e . view . other _devices ) && void 0 !== t && t . length ? ( e => { var t ; const n = vh ( "Other OMEMO-enabled devices" ) , s = vh ( "Checkbox to select fingerprints of all other OMEMO devices" ) , i = vh ( "Remove checked devices and close" ) , r = vh ( "Select all" ) ; return Qc `
< ul class = "list-group fingerprints" >
< li class = "list-group-item nopadding active" >
< label >
< input type = "checkbox" class = "select-all" title = "${r}" aria - label = "${s}" / >
$ { n }
< / l a b e l >
< / l i >
$ { null === ( t = e . view . other _devices ) || void 0 === t ? void 0 : t . map ( ( t => ( e => Qc `
$ { e . device . get ( "bundle" ) && e . device . get ( "bundle" ) . fingerprint ? ( e => { const t = vh ( "Checkbox for selecting the following fingerprint" ) ; return Qc `
2021-03-19 19:26:15 +01:00
< li class = "fingerprint-removal-item list-group-item nopadding" >
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${t}" / >
2021-11-11 22:06:49 +01:00
< span class = "fingerprint" > $ { J _ . formatFingerprint ( e . device . get ( "bundle" ) . fingerprint ) } < / s p a n >
2021-03-19 19:26:15 +01:00
< / l a b e l >
< / l i >
2021-11-11 22:06:49 +01:00
` })(e):(e=>{const t=vh("Device without a fingerprint"),n=vh("Checkbox for selecting the following device");return Qc `
2021-03-19 19:26:15 +01:00
< li class = "fingerprint-removal-item list-group-item nopadding" >
< 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)}
2021-11-11 22:06:49 +01:00
` )(Object.assign({device:t},e))))}
2021-03-19 19:26:15 +01:00
< / u l >
2021-11-11 22:06:49 +01:00
< div class = "form-group" > < button type = "submit" class = "save-form btn btn-primary" > $ { i } < / b u t t o n > < / d i v >
2021-03-19 19:26:15 +01:00
` })(e):""}
< / f o r m >
2021-11-11 22:06:49 +01:00
< / d i v > ` } , { s i z z l e : Y _ } = c o n v e r s e . e n v , Q _ = K g . e x t e n d ( { i d : " u s e r - p r o f i l e - m o d a l " , e v e n t s : { " s u b m i t . p r o f i l e - f o r m " : " o n F o r m S u b m i t t e d " } , 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 ) , K g . p r o t o t y p e . i n i t i a l i z e . a p p l y ( t h i s , a r g u m e n t s ) , C l . t r i g g e r ( " p r o f i l e M o d a l I n i t i a l i z e d " , t h i s . m o d e l ) } , t o H T M L ( ) { r e t u r n ( e = > { c o n s t t = v h ( " Y o u r P r o f i l e " ) , n = v h ( " E m a i l " ) , s = v h ( " F u l l N a m e " ) , i = v h ( " X M P P A d d r e s s " ) , r = v h ( " N i c k n a m e " ) , o = v h ( " R o l e " ) , a = v h ( " S a v e a n d c l o s e " ) , c = v h ( " U s e c o m m a s t o s e p a r a t e m u l t i p l e r o l e s . Y o u r r o l e s a r e s h o w n n e x t t o y o u r n a m e o n y o u r c h a t m e s s a g e s . " ) , l = v h ( " U R L " ) , d = v h ( " O M E M O " ) , u = v h ( " P r o f i l e " ) , h = e . v i e w . c u r r e n t _ d e v i c e ? Q c ` < u l c l a s s = " n a v n a v - p i l l s j u s t i f y - c o n t e n t - c e n t e r " >
2021-03-19 19:26:15 +01:00
< li role = "presentation" class = "nav-item" >
2021-11-11 22:06:49 +01:00
< a class = "nav-link active" id = "profile-tab" href = "#profile-tabpanel" aria - controls = "profile-tabpanel" role = "tab" data - toggle = "tab" > $ { u } < / a >
2021-03-19 19:26:15 +01:00
< / l i >
< li role = "presentation" class = "nav-item" >
2021-11-11 22:06:49 +01:00
< a class = "nav-link" id = "omemo-tab" href = "#omemo-tabpanel" aria - controls = "omemo-tabpanel" role = "tab" data - toggle = "tab" > $ { d } < / a >
2021-03-19 19:26:15 +01:00
< / l i >
2021-11-11 22:06:49 +01:00
< / u l > ` : " " ; r e t u r n Q c `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "user-profile-modal-label" > $ { t } < / h 5 >
2021-11-11 22:06:49 +01:00
$ { Qg }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
2021-11-11 22:06:49 +01:00
$ { va . pluggable . plugins [ "converse-omemo" ] . enabled ( va ) && h || "" }
2021-03-19 19:26:15 +01:00
< div class = "tab-content" >
< div class = "tab-pane active" id = "profile-tabpanel" role = "tabpanel" aria - labelledby = "profile-tab" >
< form class = "converse-form converse-form--modal profile-form" action = "#" >
< div class = "row" >
< div class = "col-auto" >
< converse - image - picker image = "${e.image}" width = "${e.width}" height = "${e.height}" > < / c o n v e r s e - i m a g e - p i c k e r >
< / d i v >
< div class = "col" >
< div class = "form-group" >
< label class = "col-form-label" > $ { i } : < / l a b e l >
< div > $ { e . jid } < / d i v >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< label for = "vcard-fullname" class = "col-form-label" > $ { s } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-fullname" type = "text" class = "form-control" name = "fn" value = "${e.fullname||" "}" / >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< label for = "vcard-nickname" class = "col-form-label" > $ { r } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-nickname" type = "text" class = "form-control" name = "nickname" value = "${e.nickname||" "}" / >
< / d i v >
< div class = "form-group" >
< 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 = "${e.url||" "}" / >
< / d i v >
< div class = "form-group" >
< 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 = "${e.email||" "}" / >
< / d i v >
< div class = "form-group" >
< 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 = "${e.role||" "}" aria - describedby = "vcard-role-help" / >
< small id = "vcard-role-help" class = "form-text text-muted" > $ { c } < / s m a l l >
< / d i v >
< hr / >
< div class = "form-group" >
< button type = "submit" class = "save-form btn btn-primary" > $ { a } < / b u t t o n >
< / d i v >
< / f o r m >
< / d i v >
2021-11-11 22:06:49 +01:00
$ { va . pluggable . plugins [ "converse-omemo" ] . enabled ( va ) && K _ ( e ) || "" }
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
` })(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),this.getAvatarData(),{view:this}))},getAvatarData(){return{height:128,width:128,image:"data:"+this.model.vcard.get("image_type")+";base64,"+this.model.vcard.get("image")}},afterRender(){this.tabs=Y_(".nav-item .nav-link",this.el).map((e=>new(Hg().Tab)(e)))},async setVCard(e){try{await Cl.vcard.set(va.bare_jid,e)}catch(e){return M.fatal(e),void this.alert([vh("Sorry, an error happened while trying to save your profile data."),vh("You can check your browser's developer console for any error output.")].join(" "))}this.modal.hide()},onFormSubmitted(e){e.preventDefault();const t=new FileReader,n=new FormData(e.target),s=n.get("image"),i={fn:n.get("fn"),nickname:n.get("nickname"),role:n.get("role"),email:n.get("email"),url:n.get("url")};s.size?(t.onloadend=()=>{Object.assign(i,{image:btoa(t.result),image_type:s.type}),this.setVCard(i)},t.readAsBinaryString(s)):(Object.assign(i,{image:this.model.vcard.get("image"),image_type:this.model.vcard.get("image_type")}),this.setVCard(i))}});va.ProfileModal=Q_,jl.plugins.add("converse-profile",{dependencies:["converse-status","converse-modal","converse-vcard","converse-chatboxviews"],initialize(){Cl.settings.extend({allow_adhoc_commands:!0,show_client_info:!0})}});const X_={aac:"audio/aac",abw:"application/x-abiword",arc:"application/x-freearc",avi:"video/x-msvideo",azw:"application/vnd.amazon.ebook",bin:"application/octet-stream",bmp:"image/bmp",bz:"application/x-bzip",bz2:"application/x-bzip2",cda:"application/x-cdf",csh:"application/x-csh",css:"text/css",csv:"text/csv",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",eot:"application/vnd.ms-fontobject",epub:"application/epub+zip",gif:"image/gif",gz:"application/gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",ics:"text/calendar",jar:"application/java-archive",jpeg:"image/jpeg",jpg:"image/jpeg",js:"text/javascript",json:"application/json",jsonld:"application/ld+json",m4a:"audio/mp4",mid:"audio/midi",midi:"audio/midi",mjs:"text/javascript",mp3:"audio/mpeg",mp4:"video/mp4",mpeg:"video/mpeg",mpkg:"application/vnd.apple.installer+xml",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",oga:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",opus:"audio/opus",otf:"font/otf",png:"image/png",pdf:"application/pdf",php:"application/x-httpd-php",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",rar:"application/vnd.rar",rtf:"application/rtf",sh:"application/x-sh",svg:"image/svg+xml",swf:"application/x-shockwave-flash",tar:"application/x-tar",tif:"image/tiff",tiff:"image/tiff",ts:"video/mp2t",ttf:"font/ttf",txt:"text/plain",vsd:"application/vnd.visio",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webp:"image/webp",woff:"font/woff",woff2:"font/woff2",xhtml:"application/xhtml+xml",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xml:"text/xml",xul:"application/vnd.mozilla.xul+xml",zip:"application/zip","3gp":"video/3gpp","3g2":"video/3gpp2","7z":"application/x-7z-compressed"},Z_={name:"AES-GCM",length:128},{u:ew}=jl.env;function tw(e,t){const n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer}function nw(e){return Array.prototype.map.call(new Uint8Array(e),(e=>("00"+e.toString(16)).slice(-2))).join("")}function sw(e){return new TextDecoder("utf-8").decode(e)}function iw(e){return new TextEncoder("utf-8").encode(e).buffer}function rw(e){return btoa(new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),""))}function ow(e){const t=window.atob(e),n=t.length,s=new Uint8Array(n);for(let e=0;e<n;e++)s[e]=t.charCodeAt(e);return s.buffer}function aw(e){return new Uint8Array(e.match(/[ \d a-f]{2}/gi).map((e=>parseInt(e,16)))).buffer}Object.assign(ew,{arrayBufferToHex:nw,arrayBufferToString:sw,stringToArrayBuffer:iw,ar
< button class = "toggle-omemo" title = "${i}" data - disabled = $ { ! n . get ( "omemo_supported" ) } @ click = $ { jw } >
< converse - icon
class = "fa ${n.get(" omemo _active ")?" fa - lock ":" fa - unlock "}"
path - prefix = "${Cl.settings.get(" assets _path ")}"
size = "1em"
color = "${r}"
> < / c o n v e r s e - i c o n >
< / b u t t o n >
` ),t}const Ow={async sendMessage(e){var t;if(this.get("omemo_active")&&null!==(t=e)&&void 0!==t&&t.body){var n;const t=null===(n=e)||void 0===n?void 0:n.body;let s,i;(e=this.getOutgoingMessageAttributes(e)).is_encrypted=!0,e.plaintext=t;try{const t=await async function(e){const t=vh("Sorry, no devices found to which we can send an OMEMO encrypted message.");let n;if(e.get("type")===va.CHATROOMS_TYPE){const t=await Promise.all(e.occupants.map((e=>Ew(e.get("jid")))));n=t.reduce(((e,t)=>function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],s=e;s--;)t[s-1]=arguments[s];return Xt(ot(n)?_i(n):[n],Ao(t,1))}(e,t.models)),[])}else if(e.get("type")===va.PRIVATE_CHAT_TYPE){const s=await Ew(e.get("jid"));if(0===s.length){const e=new Error(t);throw e.user_facing=!0,e}const i=va.devicelists.get(va.bare_jid).devices;n=[...i.models,...s.models]}const s=va.omemo_store.get("device_id");n=n.filter((e=>e.get("id")!==s)),await Promise.all(n.map((e=>e.getBundle())));const i=n.filter((e=>e)).map((e=>async function(e){if(!e.get("bundle"))return M.error( ` Could not build an OMEMO session for device $ { e . get ( "id" ) } because we don ' t have its bundle ` ),null;const t=new libsignal.SignalProtocolAddress(e.get("jid"),e.get("id")),n=await va.omemo_store.loadSession(t.toString());if(n)return n;try{return await async function(e){const t=new libsignal.SignalProtocolAddress(e.get("jid"),e.get("id")),n=new libsignal.SessionBuilder(va.omemo_store,t),s=e.getRandomPreKey(),i=await e.getBundle();return n.processPreKey({registrationId:parseInt(e.get("id"),10),identityKey:ow(i.identity_key),signedPreKey:{keyId:i.signed_prekey.id,publicKey:ow(i.signed_prekey.public_key),signature:ow(i.signed_prekey.signature)},preKey:{keyId:s.id,publicKey:ow(s.key)}})}(e)}catch(t){return M.error( ` Could not build an OMEMO session for device $ { e . get ( "id" ) } ` ),M.error(t),null}}(e)));if(await Promise.all(i),i.includes(null)&&(n=n.filter((e=>i[n.indexOf(e)])),0===n.length)){const e=new Error(t);throw e.user_facing=!0,e}return n}(this);s=await this.createMessage(e),i=await function(e,t,n){const s=vh("This is an OMEMO encrypted message which your client doesn’ t seem to support. Find more information on https://conversations.im/omemo");if(!t.get("message"))throw new Error("No message body to encrypt!");const i=cw({from:va.connection.jid,to:e.get("jid"),type:e.get("message_type"),id:t.get("msgid")}).c("body").t(s).up();return"chat"===t.get("type")&&i.c("request",{xmlns:lw.NS.RECEIPTS}).up(),i.c("encrypted",{xmlns:lw.NS.OMEMO}).c("header",{sid:va.omemo_store.get("device_id")}),mw.encryptMessage(t.get("message")).then((t=>{const s=n.filter((e=>-1!=e.get("trusted")&&e.get("active"))).map((n=>e.encryptKey(t.key_and_tag,n)));return Promise.all(s).then((e=>function(e,t,n){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s].payload,r=t[s].device,o=3==parseInt(i.type,10);e.c("key",{rid:r.get("id")}).t(btoa(i.body)),o&&e.attrs({prekey:o}),e.up(),s==t.length-1&&e.c("iv").t(n).up().up()}return Promise.resolve(e)}(i,e,t.iv))).then((e=>(e.c("payload").t(t.payload).up().up(),e.c("store",{xmlns:lw.NS.HINTS}).up(),e.c("encryption",{xmlns:lw.NS.EME,namespace:lw.NS.OMEMO}),e)))}))}(this,s,t)}catch(e){return this.handleMessageSendError(e),null}return va.api.send(i),s}return this.__super__.sendMessage.apply(this,arguments)}}, $ w={generateFingerprints:async function(e){const t=await Ew(e);return Promise.all(t.map((e=>xw(e))))},getDeviceForContact:function(e,t){return Ew(e).then((e=>e.get(t)))},contactHasOMEMOSupport:async function(e){return(await Ew(e)).length>0}};class Iw extends Error{constructor(e,t){super(e,t),this.name="IQError",this.iq=t}}const{Strophe:Mw,sizzle:Rw,u:Dw, $ iq:Lw}=jl.env,zw=Zo.extend({defaults:{trusted:0,active:!0},getRandomPreKey(){const e=this.get("bundle");return e.prekeys[Dw.getRandomInt(e.prekeys.length)]},async fetchBundleFromServer(){const e=Lw({type:"get",from:va.bare_jid,to:this.get("jid")}).c("pubsub",{xmlns:Mw.NS.PUBSUB}).c("items",{node: ` $ { Mw . NS . OMEMO _BUNDLES } : $ { this . get ( "id" ) } ` });let t;try{t=await Cl.sendIQ(e)}catch(t){ret
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
$ { 0 === e . model . get ( "registration_status" ) ? ( ( ) => { const e = Cl . settings . get ( "registration_domain" ) , t = vh ( "Create your account" ) , n = vh ( "Please enter the XMPP provider to register with:" ) ; return Qc `
< form id = "converse-register" class = "converse-form" >
< legend class = "col-form-label" > $ { t } < / l e g e n d >
< div class = "form-group" >
< label > $ { n } < / l a b e l >
< div class = "form-errors hidden" > < / d i v >
$ { e || ( ( ) => { const e = Cl . settings . get ( "domain_placeholder" ) , t = vh ( "Tip: A list of public XMPP providers is available" ) , n = vh ( "here" ) , s = Cl . settings . get ( "providers_link" ) ; return Qc `
< input class = "form-control" required = "required" type = "text" name = "domain" placeholder = "${e}" / >
< p class = "form-text text-muted" >
$ { t }
< a href = "${s}" class = "url" target = "_blank" rel = "noopener" > $ { n } < / a > .
< / p >
` })()}
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
$ { e ? "" : ( ( ) => { const e = vh ( "Fetch registration form" ) , t = vh ( "Already have a chat account?" ) , n = vh ( "Log in here" ) ; return Qc `
< 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 >
` })()}
< / f o r m >
` })():""}
$ { 1 === e . model . get ( "registration_status" ) ? ( ( ) => { const e = Cl . settings . get ( "registration_domain" ) , t = vh ( "Hold tight, we're fetching the registration form…" ) , n = vh ( "Cancel" ) ; return Qc `
< form id = "converse-register" class = "converse-form no-scrolling" >
$ { Iv ( { classes : "hor_centered" } ) }
< p class = "info" > $ { t } < / p >
$ { e ? "" : Qc `
< button class = "btn btn-secondary button-cancel hor_centered" > $ { n } < / b u t t o n >
` }
< / f o r m >
` })():""}
$ { 2 === e . model . get ( "registration_status" ) ? ( e => { const t = vh ( "Choose a different provider" ) , n = vh ( "Already have a chat account?" ) , s = vh ( "Account Registration:" ) , i = vh ( "Log in here" ) , r = vh ( "Register" ) , o = Cl . settings . get ( "registration_domain" ) ; return Qc `
< form id = "converse-register" class = "converse-form" >
< legend class = "col-form-label" > $ { s } $ { e . domain } < / l e g e n d >
< 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" >
$ { e . fields ? Qc `
< input type = "submit" class = "btn btn-primary" value = "${r}" / >
` :""}
$ { o ? "" : Qc `
< input
type = "button"
class = "btn btn-secondary button-cancel"
value = "${t}"
/ >
` }
< div class = "switch-form" >
< p > $ { n } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { i } < / a > < / p >
< / d i v >
< / f i e l d s e t >
< / f o r m >
` })(e):""}
` ;function gS(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Strophe:pS,sizzle:vS, $ iq:bS}=jl.env,yS=jl.env.utils,_S=1,wS=2;Cl.elements.define("converse-register-panel",class extends mg{constructor(...e){super(...e),gS(this,"id","converse-register-panel"),gS(this,"className","controlbox-pane fade-in"),gS(this,"events",{"submit form#converse-register":"onFormSubmission","click .button-cancel":"renderProviderChoiceForm"})}initialize(){this.reset();const e=va.chatboxes.get("controlbox");this.model=e,this.listenTo(va,"connectionInitialized",this.registerHooks),this.listenTo(this.model,"change:registration_status",this.render);const t=Cl.settings.get("registration_domain");t?this.fetchRegistrationForm(t):this.model.set("registration_status",0)}render(){tl(fS({domain:this.domain,fields:this.fields,form_fields:this.form_fields,instructions:this.instructions,model:this.model,title:this.title}),this)}registerHooks(){const e=va.connection,t=e._connect_cb.bind(e);e._connect_cb=(e,n,s)=>{this._registering?this.getRegistrationFields(e,n)&&(this._registering=!1):t(e,n,s)}}connectedCallback(){super.connectedCallback(),this.render()}getRegistrationFields(e,t){const n=va.connection;n.connected=!0;const s=n._proto._reqToData(e);if(!s)return;if(n._proto._connect_cb(s)===pS.Status.CONNFAIL)return this.showValidationError(vh("Sorry, we're unable to connect to your chosen provider.")),!1;const i=s.getElementsByTagName("register"),r=s.getElementsByTagName("mechanism");if(0===i.length&&0===r.length)return n._proto._no_auth_received(t),!1;if(0===i.length)return n._changeConnectStatus(pS.Status.REGIFAIL),this.showValidationError(vh("Sorry, the given provider does not support in band account registration. Please try with a different provider.")),!0;n._addSysHandler(this.onRegistrationFields.bind(this),null,"iq",null,null);const o=bS({type:"get"}).c("query",{xmlns:pS.NS.REGISTER}).tree();return o.setAttribute("id",n.getUniqueId("sendIQ")),n.send(o),n.connected=!1,!0}onRegistrationFields(e){return"error"===e.getAttribute("type")?(va.connection._changeConnectStatus(pS.Status.REGIFAIL,vh('Something went wrong while establishing a connection with "%1 $ s". Are you sure it exists?',this.domain)),!1):1!==e.getElementsByTagName("query").length?(va.connection._changeConnectStatus(pS.Status.REGIFAIL,"unknown"),!1):(this.setFields(e),this.model.get("registration_status")===_S&&this.renderRegistrationForm(e),!1)}reset(e){const t={fields:{},urls:[],title:"",instructions:"",registered:!1,_registering:!1,domain:null,form_type:null};Object.assign(this,t),e&&Object.assign(this,ko(e,Object.keys(t)))}onFormSubmission(e){e&&e.preventDefault&&e.preventDefault(),null===e.target.querySelector("input[name=domain]")?this.submitRegistrationForm(e.target):this.onProviderChosen(e.target)}onProviderChosen(e){const t=e.querySelector("input[name=domain]"),n=null==t?void 0:t.value;n?(e.querySelector("input[type=submit]").classList.add("hidden"),this.fetchRegistrationForm(n.trim())):t.classList.add("error")}async fetchRegistrationForm(e){var t;return this.model.set("registration_status",_S),this.reset({domain:pS.getDomainFromJid(e),_registering:!0}),await va.initConnection(this.domain),null===(t=va.connection)||void 0===t||t.connect(this.domain,"",(e=>this.onConnectStatusChanged(e))),!1}giveFeedback(e,t){let n=this.querySelector(".reg-feedback");null!==n&&n.parentNode.removeChild(n);const s=this.querySelector("form");s.insertAdjacentHTML("afterbegin",'<span class="reg-feedback"></span>'),n=s.querySelector(".reg-feedback"),n.textContent=e,t&&n.classList.add(t)}showSpinner(){const e=this.querySelector("form");return tl(Iv(),e),this}onConnectStatusChanged(e){M.debug("converse-register: onConnectStatusChanged"),[pS.Status.DISCONNECTED,pS.Status.CONNFAIL,pS.Status.REGIFAIL,pS.Status.NOTACCEPTABLE,pS.Status.CONFLICT].includes(e)?(M.error( ` Problem during registration : Strophe . Status is $ { va . CONNECTION _STATUS [ e ] } ` ),this.abortRegistration()):e===pS.Status.REGISTERED&&(M.debug("Registered successfully."),va.connection.re
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "add-chatroom-modal-label" > $ { n } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< form class = "converse-form add-chatroom" >
< div class = "form-group" >
< label for = "chatroom" > $ { e . label _room _address } : < / l a b e l >
$ { e . muc _roomid _policy _error _msg ? Qc ` <label class="roomid-policy-error"> ${ e . muc _roomid _policy _error _msg } </label> ` : "" }
< input type = "text" required = "required" name = "chatroom" class = "form-control roomjid-input" placeholder = "${e.chatroom_placeholder}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
$ { e . muc _roomid _policy _hint ? Qc ` <div class="form-group"> ${ Gv ( No ( ) . sanitize ( e . muc _roomid _policy _hint , { ALLOWED _TAGS : [ "b" , "br" , "em" ] } ))}</div> ` : "" }
$ { e . _converse . locked _muc _nickname ? "" : ( e => { const t = vh ( "Nickname" ) , n = vh ( "This field is required" ) ; return Qc `
< div class = "form-group" >
< label for = "nickname" > $ { t } : < / l a b e l >
< input type = "text" title = "${n}" required = "required" name = "nickname" value = "${e.nick||" "}" class = "form-control" / >
< / d i v >
` })(e)}
< input type = "submit" class = "btn btn-primary" name = "join" value = "${t||" "}" ? disabled = $ { e . muc _roomid _policy _error _msg } >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
` })(Object.assign(this.model.toJSON(),{_converse:va,label_room_address:Cl.settings.get("muc_domain")?vh("Groupchat name"):vh("Groupchat address"),chatroom_placeholder:e,muc_roomid_policy_error_msg:this.muc_roomid_policy_error_msg,muc_roomid_policy_hint:Cl.settings.get("muc_roomid_policy_hint")}))},afterRender(){this.el.addEventListener("shown.bs.modal",(()=>{this.el.querySelector('input[name="chatroom"]').focus()}),!1)},parseRoomDataFromEvent(e){const t=new FormData(e),n=t.get("chatroom");let s;if(Cl.settings.get("locked_muc_nickname")){if(s=va.getDefaultMUCNickname(),!s)throw new Error("Using locked_muc_nickname but no nickname found!")}else s=t.get("nickname").trim();return{jid:n,nick:s}},openChatRoom(e){e.preventDefault();const t=this.parseRoomDataFromEvent(e.target);let n;""===t.nick&&(t.nick=void 0),Cl.settings.get("locked_muc_domain")||Cl.settings.get("muc_domain")&&!ES.isValidJID(t.jid)?n= ` $ { AS . escapeNode ( t . jid ) } @ $ { Cl . settings . get ( "muc_domain" ) } ` :(n=t.jid,this.model.setDomain(n)),Cl.rooms.open(n,Object.assign(t,{jid:n}),!0),this.modal.hide(),e.target.reset()},checkRoomidPolicy(){if(Cl.settings.get("muc_roomid_policy")&&Cl.settings.get("muc_domain")){let e=this.el.querySelector(".roomjid-input").value;!jl.locked_muc_domain&&ES.isValidJID(e)||(e= ` $ { AS . escapeNode ( e ) } @ $ { Cl . settings . get ( "muc_domain" ) } ` );const t=AS.getNodeFromJid(e),n=AS.getDomainFromJid(e);Cl.settings.get("muc_domain")!==n||Cl.settings.get("muc_roomid_policy").test(t)?this.muc_roomid_policy_error_msg=null:this.muc_roomid_policy_error_msg=vh("Groupchat id is invalid."),this.render()}}}),TS=function(e){return e&&e.length?e[0]:void 0},{Strophe:kS, $ iq:jS,sizzle:NS}=jl.env,OS=jl.env.utils;const $ S=Kg.extend({id:"muc-list-modal",persistent:!0,initialize(){this.items=[],this.loading_items=!1,Kg.prototype.initialize.apply(this,arguments),Cl.settings.get("muc_domain")&&!this.model.get("muc_domain")&&this.model.save("muc_domain",Cl.settings.get("muc_domain")),this.listenTo(this.model,"change:muc_domain",this.onDomainChange),this.el.addEventListener("shown.bs.modal",(()=>Cl.settings.get("locked_muc_domain")?this.updateRoomsList():this.el.querySelector('input[name="server"]').focus()))},toHTML(){const e=this.model.get("muc_domain")||Cl.settings.get("muc_domain");return(e=>{const t=vh("Query for Groupchats");return Qc `
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "muc-list-modal-label" > $ { t } < / h 5 >
$ { Qg }
< / d i v >
< div class = "modal-body d-flex flex-column" >
< span class = "modal-alert" > < / s p a n >
$ { e . show _form ? ( e => { const t = vh ( "Show groupchats" ) , n = vh ( "Server address" ) ; return Qc `
< 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"
@ 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):""}
< ul class = "available-chatrooms list-group" >
$ { e . loading _items ? Qc ` <li class="list-group-item"> ${ Iv ( ) } </li> ` : "" }
$ { e . feedback _text ? Qc ` <li class="list-group-item active"> ${ e . feedback _text } </li> ` : "" }
$ { jg ( e . items , ( e => e . jid ) , ( t => ( ( e , t ) => { const n = vh ( "Show more information on this groupchat" ) , s = vh ( "Click to open this groupchat" ) ; return Qc `
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
@ 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 >
< / d i v >
< / l i >
` })(e,t)))}
< / u l >
< / d i v >
< div class = "modal-footer" > $ { Yg } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
` })(Object.assign(this.model.toJSON(),{show_form:!Cl.settings.get("locked_muc_domain"),server_placeholder:e||vh("conference.example.org"),items:this.items,loading_items:this.loading_items,openRoom:e=>this.openRoom(e),setDomainFromEvent:e=>this.setDomainFromEvent(e),submitForm:e=>this.showRooms(e),toggleRoomInfo:e=>this.toggleRoomInfo(e)}))},openRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid"),n=e.target.getAttribute("data-room-name");this.modal.hide(),Cl.rooms.open(t,{name:n},!0)},toggleRoomInfo(e){e.preventDefault(),function(e){const t=OS.ancestor(e.target,".room-item"),n=t.querySelector("div.room-info");n?(OS.slideIn(n).then(OS.removeElement),t.querySelector("a.room-info").classList.remove("selected")):(t.insertAdjacentElement("beforeend",OS.getElementFromTemplateResult(Iv())),Cl.disco.info(e.target.getAttribute("data-room-jid"),null).then((e=>function(e,t){var n,s;e.querySelector("span.spinner").remove(),e.querySelector("a.room-info").classList.add("selected"),e.insertAdjacentHTML("beforeEnd",OS.getElementFromTemplateResult((e=>{const t=vh("Description:"),n=vh("Groupchat XMPP Address:"),s=vh("Participants:"),i=vh("Features:"),r=vh("Requires authentication"),o=vh("Hidden"),a=vh("Requires an invitation"),c=vh("Moderated"),l=vh("Non-anonymous"),d=vh("Open"),u=vh("Permanent"),h=vh("Public"),m=vh("Semi-anonymous"),f=vh("Temporary"),g=vh("Unmoderated");return Qc `
< 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 ? Qc ` <li class="room-info locked"> ${ r } </li> ` : "" }
$ { e . hidden ? Qc ` <li class="room-info"> ${ o } </li> ` : "" }
$ { e . membersonly ? Qc ` <li class="room-info"> ${ a } </li> ` : "" }
$ { e . moderated ? Qc ` <li class="room-info"> ${ c } </li> ` : "" }
$ { e . nonanonymous ? Qc ` <li class="room-info"> ${ l } </li> ` : "" }
$ { e . open ? Qc ` <li class="room-info"> ${ d } </li> ` : "" }
$ { e . persistent ? Qc ` <li class="room-info"> ${ u } </li> ` : "" }
$ { e . publicroom ? Qc ` <li class="room-info"> ${ h } </li> ` : "" }
$ { e . semianonymous ? Qc ` <li class="room-info"> ${ m } </li> ` : "" }
$ { e . temporary ? Qc ` <li class="room-info"> ${ f } </li> ` : "" }
$ { e . unmoderated ? Qc ` <li class="room-info"> ${ g } </li> ` : "" }
< / u l >
< / p >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
` })({jid:t.getAttribute("from"),desc:null===(n=TS(NS('field[var="muc#roominfo_description"] value',t)))||void 0===n?void 0:n.textContent,occ:null===(s=TS(NS('field[var="muc#roominfo_occupants"] value',t)))||void 0===s?void 0:s.textContent,hidden:NS('feature[var="muc_hidden"]',t).length,membersonly:NS('feature[var="muc_membersonly"]',t).length,moderated:NS('feature[var="muc_moderated"]',t).length,nonanonymous:NS('feature[var="muc_nonanonymous"]',t).length,open:NS('feature[var="muc_open"]',t).length,passwordprotected:NS('feature[var="muc_passwordprotected"]',t).length,persistent:NS('feature[var="muc_persistent"]',t).length,publicroom:NS('feature[var="muc_publicroom"]',t).length,semianonymous:NS('feature[var="muc_semianonymous"]',t).length,temporary:NS('feature[var="muc_temporary"]',t).length,unmoderated:NS('feature[var="muc_unmoderated"]',t).length})))}(t,e))).catch((e=>M.error(e))))}(e)},onDomainChange(){Cl.settings.get("auto_list_rooms")&&this.updateRoomsList()},onRoomsFound(e){this.loading_items=!1;const t=e?NS("query item",e):[];return t.length?(this.model.set({feedback_text:vh("Groupchats found")},{silent:!0}),this.items=t.map(dd)):(this.items=[],this.model.set({feedback_text:vh("No groupchats found")},{silent:!0})),this.render(),!0},updateRoomsList(){const e=jS({to:this.model.get("muc_domain"),from:va.connection.jid,type:"get"}).c("query",{xmlns:kS.NS.DISCO_ITEMS});Cl.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})}}),{Strophe:IS}=jl.env,MS=Zo.extend({defaults:function(){return{muc_domain:Cl.settings.get("muc_domain"),nick:va.getDefaultMUCNickname(),"toggle-state":va.OPENED}},setDomain(e){Cl.settings.get("locked_muc_domain")||this.save("muc_domain",IS.getDomainFromJid(e))}}),{Strophe:RS,u:DS}=jl.env;function LS(){if(!Cl.settings.get("auto_insert"))return;const e=Cl.settings.get("root");if(!e.querySelector("converse-root#conversejs")){const t=document.createElement("converse-root"),n=e.querySelector("body");n?n.appendChild(t):e.appendChild(t)}}Cl.elements.define("converse-rooms-list",class extends mg{initialize(){const e= ` converse . roomspanel$ { va . bare _jid } ` ;this.model=new MS({id:e}),_o(this.model,e),this.model.fetch(),this.listenTo(va.chatboxes,"add",this.renderIfChatRoom),this.listenTo(va.chatboxes,"remove",this.renderIfChatRoom),this.listenTo(va.chatboxes,"destroy",this.renderIfChatRoom),this.listenTo(va.chatboxes,"change",this.renderIfRelevantChange),this.render()}renderIfChatRoom(e){DS.isChatRoom(e)&&this.render()}renderIfRelevantChange(e){const t=["bookmarked","hidden","name","num_unread","num_unread_general","has_activity"],n=e.changed||{};DS.isChatRoom(e)&&Object.keys(n).filter((e=>t.includes(e))).length&&this.render()}render(){tl((e=>{const t=vh("Click to toggle the list of open groupchats"),n=vh("Groupchats"),s=vh("Query for groupchats"),i=vh("Add a new groupchat");return Qc `
< div class = "d-flex controlbox-padded" >
< span class = "w-100 controlbox-heading controlbox-heading--groupchats" > $ { n } < / s p a n >
< a class = "controlbox-heading__btn show-list-muc-modal"
@ click = $ { t => Cl . modal . show ( $S , { model : e . model } , t ) }
title = "${s}" data - toggle = "modal" data - target = "#muc-list-modal" >
< converse - icon class = "fa fa-list-ul right" color = "var(--subdued-color)" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / a >
2021-11-11 22:06:49 +01:00
< a class = "controlbox-heading__btn show-add-muc-modal"
@ click = $ { t => Cl . modal . show ( CS , { model : e . model } , t ) }
title = "${i}" data - toggle = "modal" data - target = "#add-chatrooms-modal" >
< converse - icon class = "fa fa-plus right" color = "var(--subdued-color)" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / a >
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "list-container list-container--openrooms ${e.rooms.length?" ":" hidden "}" >
< a class = "list-toggle open-rooms-toggle controlbox-padded" title = "${t}" @ click = $ { e . toggleRoomsList } >
< span class = "fa ${e.toggle_state===va.OPENED?" fa - caret - down ":" fa - caret - right "}" > < / s p a n > $ { v h ( " O p e n G r o u p c h a t s " ) } < / a >
< div class = "items-list rooms-list open-rooms-list ${e.collapsed&&" collapsed "}" >
$ { e . rooms . map ( ( t => ( e => { const t = vh ( "Leave this groupchat" ) , n = e . room . get ( "num_unread_general" ) || e . room . get ( "has_activity" ) ; return Qc `
< div class = "list-item controlbox-padded available-chatroom d-flex flex-row ${e.currently_open(e.room)?" open ":" "} ${n?" unread - msgs ":" "}"
2021-03-19 19:26:15 +01:00
data - room - jid = "${e.room.get(" jid ")}" >
2021-11-11 22:06:49 +01:00
$ { e . room . get ( "num_unread" ) ? ( e => Qc ` <span class="list-item-badge badge badge--muc msgs-indicator"> ${ e . room . get ( "num_unread" ) } </span> ` ) ( e ) : e . room . get ( "has_activity" ) ? Qc ` <span class="list-item-badge badge badge--muc msgs-indicator"></span> ` : "" }
2021-03-19 19:26:15 +01:00
< a class = "list-item-link open-room available-room w-100"
2021-11-11 22:06:49 +01:00
data - room - jid = "${e.room.get(" jid ")}"
title = "${vh(" Click to open this groupchat ")}"
@ click = $ { e . openRoom } > $ { e . room . getDisplayName ( ) } < / a >
2021-03-19 19:26:15 +01:00
2021-11-11 22:06:49 +01:00
$ { e . allow _bookmarks ? ( e => { const t = vh ( "Bookmark this groupchat" ) , n = vh ( "Unbookmark this groupchat" ) ; return e . bookmarked ? Qc `
2021-03-19 19:26:15 +01:00
< a class = "list-item-action fa fa-bookmark remove-bookmark button-on"
data - room - jid = "${e.room.get(" jid ")}"
data - bookmark - name = "${e.room.getDisplayName()}"
@ click = $ { e . removeBookmark }
2021-11-11 22:06:49 +01:00
title = "${e.bookmarked?n:t}" > < / a > ` : Q c `
2021-03-19 19:26:15 +01:00
< a class = "list-item-action fa fa-bookmark add-bookmark"
data - room - jid = "${e.room.get(" jid ")}"
data - bookmark - name = "${e.room.getDisplayName()}"
@ click = $ { e . addBookmark }
title = "${e.bookmarked?n:t}" > < / a > ` } ) ( e ) : " " }
< a class = "list-item-action room-info fa fa-info-circle"
2021-11-11 22:06:49 +01:00
data - room - jid = "${e.room.get(" jid ")}"
title = "${vh(" Show more information on this groupchat ")}"
@ click = $ { e . showRoomDetailsModal } > < / a >
2021-03-19 19:26:15 +01:00
< a class = "list-item-action fa fa-sign-out-alt close-room"
2021-11-11 22:06:49 +01:00
data - room - jid = "${e.room.get(" jid ")}"
data - room - name = "${e.room.getDisplayName()}"
title = "${t}"
@ click = $ { e . closeRoom } > < / a >
< / d i v > ` } ) ( O b j e c t . a s s i g n ( { r o o m : t } , e ) ) ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v > ` } ) ( { a d d B o o k m a r k : e = > t h i s . a d d B o o k m a r k ( e ) , a l l o w _ b o o k m a r k s : v a . a l l o w _ b o o k m a r k s & & v a . b o o k m a r k s , c l o s e R o o m : e = > t h i s . c l o s e R o o m ( e ) , c o l l a p s e d : t h i s . m o d e l . g e t ( " t o g g l e - s t a t e " ) ! = = v a . O P E N E D , c u r r e n t l y _ o p e n : e = > v a . i s U n i V i e w ( ) & & ! e . g e t ( " h i d d e n " ) , m o d e l : t h i s . m o d e l , o p e n R o o m : e = > t h i s . o p e n R o o m ( e ) , r e m o v e B o o k m a r k : e = > t h i s . r e m o v e B o o k m a r k ( e ) , r o o m s : v a . c h a t b o x e s . f i l t e r ( ( e = > e . g e t ( " t y p e " ) = = = v a . C H A T R O O M S _ T Y P E ) ) , s h o w R o o m D e t a i l s M o d a l : e = > t h i s . s h o w R o o m D e t a i l s M o d a l ( e ) , t o g g l e R o o m s L i s t : e = > t h i s . t o g g l e R o o m s L i s t ( e ) , t o g g l e _ s t a t e : t h i s . m o d e l . g e t ( " t o g g l e - s t a t e " ) } ) , t h i s ) } 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 . 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 = v a . 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 ( ) , C l . m o d a l . s h o w ( w _ , { 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 | | R S . u n e s c a p e N o d e ( R S . g e t N o d e F r o m J i d ( n ) ) | | n } ; a w a i t C l . 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 . 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 " ) ; i f ( c o n f i r m ( v h ( " 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 ) ) ) { 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 - r o o m - j i d " ) ; ( a w a i t C l . r o o m s . g e t ( t ) ) . c l o s e ( ) } } r e m o v e B o o k m a r k ( e ) { v a . r e m o v e B o o k m a r k V i a E v e n t ( e ) } a d d B o o k m a r k ( e ) { v a . a d d B o o k m a r k V i a E v e n t ( e ) } t o g g l e R o o m s L i s t ( e ) { v a r t ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) ; c o n s t n = e . t a r g e t . m a t c h e s ( " . f a " ) ? e . t a r g e t : e . t a r g e t . q u e r y S e l e c t o r ( " . f a " ) ; n . c l a s s L i s t . c o n t a i n s ( " f a - c a r e t - d o w n " ) ? D S . s l i d e I n ( 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 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 " : v a . C L O S E D } ) , n . c l a s s L i s t . r e m o v e ( " f a - c a r e t - d o w n " ) , n . c l a s s L i s t . a d d ( " f a - c a r e t - r i g h t " ) } ) ) : D S . s l i d e O u 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 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 " : v a . O P E N E D } ) , n . c l a s s L i s t . r e m o v e ( " f a - c a r e t - r i g h t " ) , n . c l a s s L i s t . a d d ( " f a - c a r e t - d o w n " ) } ) ) } } ) , j l . 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 ( ) { C l . l i s t e n . o n ( " c o n n e c t e d " , ( a s y n c ( ) = > { v a . a l l o w _ b o o k m a r k s ? a w a i t C l . w a i t U n t i l ( " b o o k m a r k s I n i t i a l i z e d " ) : a w a i t P r o m i s e . a l l ( [ C l . 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 " ) ] ) } ) ) } } ) , w i n d o w . c u s t o m 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 U f { r e n d e r ( ) { r e t u r n Q c `
< ? 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 >
< 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 >
< / s v g >
` }}),customElements.define("converse-root",class extends Uf{render(){return(()=>{let e=Cl.settings.get("singleton")?"converse-singleton":"";return e+= ` converse - $ { Cl . settings . get ( "view_mode" ) } ` ,Qc `
< converse - chats class = "converse-chatboxes row no-gutters ${e}" > < / c o n v e r s e - c h a t s >
< 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 >
` })()}connectedCallback(){super.connectedCallback(),this.classList.add("conversejs"),this.classList.add( ` converse - $ { Cl . settings . get ( "view_mode" ) } ` ),this.classList.add( ` theme - $ { Cl . settings . get ( "theme" ) } ` ),this.setAttribute("id","conversejs")}}),jl.plugins.add("converse-rootview",{initialize(){Cl.settings.extend({auto_insert:!0}),Cl.listen.on("chatBoxesInitialized",LS)}});const{Strophe:zS}=jl.env,PS=jl.env.utils,FS=Kg.extend({id:"add-contact-modal",events:{"submit form":"addContactFromForm"},initialize(){Kg.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render)},toHTML(){const e=Cl.settings.get("xhr_user_search_url")?vh("Contact name"):vh("Optional nickname");return(e=>{const t=vh("name@example.org"),n=vh("Add"),s=vh("Please enter a valid XMPP address"),i=vh("Add a Contact"),r=vh("XMPP Address"),o=vh("Nickname");return Qc `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "addContactModalLabel" > $ { i } < / h 5 >
2021-11-11 22:06:49 +01:00
$ { Qg }
2021-03-19 19:26:15 +01:00
< / d i v >
< form class = "converse-form add-xmpp-contact" >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "form-group add-xmpp-contact__jid" >
2021-11-11 22:06:49 +01:00
< label class = "clearfix" for = "jid" > $ { r } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< div class = "suggestion-box suggestion-box__jid" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< input type = "text" name = "jid" ? required = $ { ! e . _converse . xhr _user _search _url }
value = "${e.jid||" "}"
class = "form-control suggestion-box__input"
placeholder = "${t}" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
< / d i v >
< div class = "form-group add-xmpp-contact__name" >
< label class = "clearfix" for = "name" > $ { o } : < / 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.nickname||" "}"
class = "form-control suggestion-box__input"
placeholder = "${o}" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< div class = "invalid-feedback" > $ { s } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
< button type = "submit" class = "btn btn-primary" > $ { n } < / b u t t o n >
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
` })(Object.assign(this.model.toJSON(),{_converse:va,label_nickname:e}))},afterRender(){"string"==typeof Cl.settings.get("xhr_user_search_url")?this.initXHRAutoComplete():this.initJIDAutoComplete();const e=this.el.querySelector('input[name="jid"]');this.el.addEventListener("shown.bs.modal",(()=>e.focus()),!1)},initJIDAutoComplete(){if(!Cl.settings.get("autocomplete_add_contact"))return;const e=this.el.querySelector(".suggestion-box__jid").parentElement;this.jid_auto_complete=new va.AutoComplete(e,{data:(e,t)=> ` $ { t . slice ( 0 , t . indexOf ( "@" ) ) } @ $ { e } ` ,filter:va.FILTER_STARTSWITH,list:[...new Set(va.roster.map((e=>zS.getDomainFromJid(e.get("jid")))))]})},initXHRAutoComplete(){if(!Cl.settings.get("autocomplete_add_contact"))return this.initXHRFetch();const e=this.el.querySelector(".suggestion-box__name").parentElement;this.name_auto_complete=new va.AutoComplete(e,{auto_evaluate:!1,filter:va.FILTER_STARTSWITH,list:[]});const t=new window.XMLHttpRequest;t.onload=()=>{if(t.responseText){const e=t.responseText;this.name_auto_complete.list=JSON.parse(e).map((e=>({label:e.fullname||e.jid,value:e.jid}))),this.name_auto_complete.auto_completing=!0,this.name_auto_complete.evaluate()}};const n=this.el.querySelector('input[name="name"]');n.addEventListener("input",hc((()=>{t.open("GET", ` $ { Cl . settings . get ( "xhr_user_search_url" ) } q = $ { encodeURIComponent ( n . value ) } ` ,!0),t.send()}),300)),this.name_auto_complete.on("suggestion-box-selectcomplete",(e=>{this.el.querySelector('input[name="name"]').value=e.text.label,this.el.querySelector('input[name="jid"]').value=e.text.value}))},initXHRFetch(){this.xhr=new window.XMLHttpRequest,this.xhr.onload=()=>{if(this.xhr.responseText){const e=this.xhr.responseText,t=JSON.parse(e).map((e=>({label:e.fullname||e.jid,value:e.jid})));if(1!==t.length){const e=this.el.querySelector(".invalid-feedback");return e.textContent=vh("Sorry, could not find a contact with that name"),void PS.addClass("d-block",e)}const n=t[0].value;if(this.validateSubmission(n)){const e=this.el.querySelector("form"),s=t[0].label;this.afterSubmission(e,n,s)}}}},validateSubmission(e){const t=this.el.querySelector(".invalid-feedback");return!e||Oo(e.split("@")).length<2?(PS.addClass("is-invalid",this.el.querySelector('input[name="jid"]')),PS.addClass("d-block",t),!1):va.roster.get(zS.getBareJidFromJid(e))?(t.textContent=vh("This contact has already been added"),PS.addClass("d-block",t),!1):(PS.removeClass("d-block",t),!0)},afterSubmission(e,t,n){va.roster.addAndSubscribe(t,n),this.model.clear(),this.modal.hide()},addContactFromForm(e){e.preventDefault();const t=new FormData(e.target),n=(t.get("jid")||"").trim();if(!n&&"string"==typeof Cl.settings.get("xhr_user_search_url")){const e=this.el.querySelector('input[name="name"]');return this.xhr.open("GET", ` $ { Cl . settings . get ( "xhr_user_search_url" ) } q = $ { encodeURIComponent ( e . value ) } ` ,!0),void this.xhr.send()}this.validateSubmission(n)&&this.afterSubmission(e.target,n,t.get("name"))}});function US(e){var t,n;null===(t=va.roster)||void 0===t||null===(n=t.findWhere({jid:e.get("jid")}))||void 0===n||n.trigger("highlight")}function BS(e,t){const n=va.roster_filter,s=n.get("filter_type"),i="state"===s?n.get("chat_state").toLowerCase():n.get("filter_text").toLowerCase();return!!i&&("state"===s?![va.HEADER_REQUESTING_CONTACTS,va.HEADER_UNREAD].includes(t)&&("unread_messages"===i?0===e.get("num_unread"):"online"===i?["offline","unavailable"].includes(e.presence.get("show")):!e.presence.get("show").includes(i)):"contacts"===s?!e.getFilterCriteria().includes(i):void 0)}function qS(e){const t=va.roster_filter;if("groups"===t.get("filter_type")){var n;const s=null===(n=t.get("filter_text"))||void 0===n?void 0:n.toLowerCase();if(!s)return!0;if(!e.toLowerCase().includes(s))return!1}return!0}va.AddContactModal=FS;const{u:HS}=jl.env;function GS(e){const t=e.get("jid"),n=[];if(va.isUniView()){const e=va.chatboxes.get(t);e&&!e.get("hidden")&&n.push("open")}const s=e.get("ask"),i=e.get("requesting"),r=e.get("subscription");return"subscribe"===s||"from"===r?n.push("pending-xmpp-contact"):!0===i?n.push("requesting-xmpp-c
< 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 >
< / l i > ` } c o n s t W S = e = > { c o n s t t = v h ( " C o n t a c t s " ) , n = v h ( " A d d a c o n t a c t " ) , s = v h ( " R e - s y n c y o u r c o n t a c t s " ) , i = ( v a . 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 ( " s u b s c r i b e " = = = t . g e t ( " a s k " ) ) { c o n s t n = v a . H E A D E R _ P E N D 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 i f ( t . g e t ( " r e q u e s t i n g " ) ) { c o n s t n = v a . 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 ; C l . 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 ? [ v a . H E A D E R _ U N G R O U P E D ] : n ) : n = [ v a . 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 = v a . 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 ) ) , { } ) , r = O b j e c t . k e y s ( i ) . f i l t e r ( q S ) ; r e t u r n r . s o r t ( t f ) , Q c `
< div class = "d-flex controlbox-padded" >
< span class = "w-100 controlbox-heading controlbox-heading--contacts" > $ { t } < / s p a n >
< a class = "controlbox-heading__btn sync-contacts" @ click = $ { t => e . syncContacts ( t ) } title = "${s}" >
< converse - icon class = "fa fa-sync right ${e.syncing_contacts?" fa - spin ":" "}" color = "var(--subdued-color)" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
$ { Cl . settings . get ( "allow_contact_requests" ) ? Qc `
< a class = "controlbox-heading__btn add-contact"
@ click = $ { t => e . showAddContactModal ( t ) }
title = "${n}"
data - toggle = "modal"
data - target = "#add-contact-modal" >
< converse - icon class = "fa fa-user-plus right" color = "var(--subdued-color)" path - prefix = "/dist" size = "1.25em" > < / c o n v e r s e - i c o n >
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< converse - roster - filter > < / c o n v e r s e - r o s t e r - f i l t e r >
< div class = "list-container roster-contacts" >
$ { jg ( r , ( e => e ) , ( e => { const t = i [ e ] . filter ( ( t => function ( e , t ) { const n = e . presence . get ( "show" ) ; return Cl . settings . get ( "hide_offline_users" ) && "offline" === n ? ( "subscribe" === e . get ( "ask" ) || "from" === e . get ( "subscription" ) || ! 0 === e . get ( "requesting" ) ) && ! BS ( e , t ) : ! BS ( e , t ) } ( t , e ) ) ) ; return t . sort ( ef ) , t . length ? ( e => { const t = vh ( "Click to hide these contacts" ) , n = va . roster . state . get ( "collapsed_groups" ) ; return Qc `
< div class = "roster-group" data - group = "${e.name}" >
< a href = "#" class = "list-toggle group-toggle controlbox-padded" title = "${t}" @ click = $ { t => function ( e , t ) { var n ; null == e || null === ( n = e . preventDefault ) || void 0 === n || n . call ( e ) ; const s = va . roster . state . get ( "collapsed_groups" ) ; s . includes ( t ) ? va . roster . state . save ( "collapsed_groups" , s . filter ( ( e => e !== t ) ) ) : va . roster . state . save ( "collapsed_groups" , [ ... s , t ] ) } ( t , e . name ) } >
< converse - icon color = "var(--chat-head-color)" 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}" >
$ { e . contacts . map ( GS ) }
< / u l >
< / d i v > ` } ) ( { c o n t a c t s : t , n a m e : e } ) : " " } ) ) }
< / d i v >
` };Cl.elements.define("converse-roster",class extends Uf{constructor(){super(),this.initialize()}async initialize(){await Cl.waitUntil("rosterInitialized"),this.listenTo(va,"rosterContactsFetched",this.requestUpdate),this.listenTo(va.presences,"change:show",this.requestUpdate),this.listenTo(va.roster,"add",this.requestUpdate),this.listenTo(va.roster,"destroy",this.requestUpdate),this.listenTo(va.roster,"remove",this.requestUpdate),this.listenTo(va.roster,"change",this.requestUpdate),this.listenTo(va.roster.state,"change",this.requestUpdate),Cl.trigger("rosterViewInitialized")}firstUpdated(){this.listenToRosterFilter()}render(){return WS(this)}listenToRosterFilter(){this.filter_view=this.querySelector("converse-roster-filter"),this.filter_view.addEventListener("update",(()=>this.requestUpdate()))}showAddContactModal(e){Cl.modal.show(va.AddContactModal,{model:new Zo},e)}async syncContacts(e){e.preventDefault(),this.syncing_contacts=!0,this.requestUpdate(),va.roster.data.save("version",null),await va.roster.fetchFromServer(),Cl.user.presence.send(),this.syncing_contacts=!1,this.requestUpdate()}});const VS=e=>Qc ` < span class = "pending-contact-name" title = "JID: ${e.jid}" > $ { e . display _name } < / s p a n > ` , J S = e = > Q c ` < s p a n c l a s s = " r e q - c o n t a c t - n a m e w - 1 0 0 " t i t l e = " J I D : $ { e . j i d } " > $ { e . d i s p l a y _ n a m e } < / s p a n > ` , K S = j l . e n v . u t i l s ; c l a s s Y S e x t e n d s U f { 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 } } } 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 . 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 , " h i g h l i g h 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 , " 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 ( ) { c o n s t e = t h i s . m o d e l . g e t ( " a s k " ) , t = t h i s . m o d e l . g e t ( " r e q u e s t i n g " ) , n = t h i s . m o d e l . g e t ( " s u b s c r i p t i o n " ) , s = t h i s . m o d e l . g e t ( " j i d " ) ; i f ( " s u b s c r i b e " = = = e | | " f r o m " = = = n ) { c o n s t e = t h i s . 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 ( e = > { c o n s t t = v h ( " C l i c k t o r e m o v e % 1 $ s a s a c o n t a c t " , e . d i s p l a y _ n a m e ) ; r e t u r n Q c `
$ { Cl . settings . get ( "allow_chat_pending_contacts" ) ? Qc ` <a class="list-item-link open-chat w-100" href="#" @click= ${ e . openChat } > ${ VS ( e ) } </a> ` : VS ( e ) }
< a class = "list-item-action remove-xmpp-contact far fa-trash-alt" @ click = $ { e . removeContact } title = "${t}" href = "#" > < / 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 ) , r e m o v e C o n t a c t : e = > t h i s . r e m o v e C o n t a c t ( e ) } ) ) } i f ( ! 0 = = = t ) { c o n s t e = t h i s . 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 ( e = > Q c `
$ { Cl . settings . get ( "allow_chat_pending_contacts" ) ? Qc ` <a class="open-chat w-100" href="#" @click= ${ e . openChat } > ${ JS ( e ) } </a> ` : JS ( e ) }
< a class = "accept-xmpp-request list-item-action list-item-action--visible fa fa-check"
@ click = $ { e . acceptRequest }
aria - label = "${e.desc_accept}" title = "${e.desc_accept}" href = "#" > < / a >
< a class = "decline-xmpp-request list-item-action list-item-action--visible fa fa-times"
@ click = $ { e . declineRequest }
aria - label = "${e.desc_decline}" title = "${e.desc_decline}" href = "#" > < / 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 : v h ( " 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 : v h ( " 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 ) , a l l o w _ c h a t _ p e n d i n g _ c o n t a c t s : C l . s e t t i n g s . g e t ( " a l l o w _ c h a t _ p e n d i n g _ c o n t a c t s " ) } ) ) } i f ( " b o t h " = = = n | | " t o " = = = n | | K S . i s S a m e B a r e J I D ( s , v a . c o n n e c t i o n . j i d ) ) r e t u r n t h i s . r e n d e r R o s t e r I t e m ( t h i s . m o d e l ) } r e n d e r R o s t e r I t e m ( e ) { c o n s t t = { d n d : v h ( " T h i s c o n t a c t i s b u s y " ) , o n l i n e : v h ( " T h i s c o n t a c t i s o n l i n e " ) , o f f l i n e : v h ( " T h i s c o n t a c t i s o f f l i n e " ) , u n a v a i l a b l e : v h ( " T h i s c o n t a c t i s u n a v a i l a b l e " ) , x a : v h ( " T h i s c o n t a c t i s a w a y f o r a n e x t e n d e d p e r i o d " ) , a w a y : v h ( " T h i s c o n t a c t i s a w a y " ) } , n = e . p r e s e n c e . g e t ( " s h o w " ) | | " o f f l i n e " ; l e t s ; s = " o n l i n e " = = = n ? " 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 " : " a w a y " = = = n ? " 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 " : " x a " = = = n ? " f a r 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 - x a " : " d n d " = = = n ? " 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 " : " f a f a - t i m e 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 - - o f f l i n e " ; c o n s t i = e . g e t D i s p l a y N a m e ( ) ; r e t u r n ( e = > { c o n s t t = v h ( " C l i c k t o c h a t w i t h % 1 $ s ( X M P P a d d r e s s : % 2 $ s ) " , e . d i s p l a y _ n a m e , e . j i d ) , n = v h ( " C l i c k t o r e m o v e % 1 $ s a s a c o n t a c t " , e . d i s p l a y _ n a m e ) ; r e t u r n Q c `
< a class = "list-item-link cbox-list-item open-chat ${e.num_unread?" unread - msgs ":" "}" title = "${t}" href = "#" @ click = $ { e . openChat } >
$ { _v ( e . getAvatarData ( ) ) }
< span class = "${e.status_icon}" title = "${e.desc_status}" > < / s p a n >
$ { e . num _unread ? Qc ` <span class="msgs-indicator"> ${ e . num _unread } </span> ` : "" }
< span class = "contact-name contact-name--${e.show} ${e.num_unread?" unread - msgs ":" "}" > $ { e . display _name } < / s p a n >
< / a >
$ { Cl . settings . get ( "allow_contact_removal" ) ? Qc ` <a class="list-item-action remove-xmpp-contact far fa-trash-alt" @click= ${ e . removeContact } title=" ${ n } " href="#"></a> ` : "" } ` })(Object.assign(e.toJSON(),{show:n,display_name:i,status_icon:s,openChat:e=>this.openChat(e),removeContact:e=>this.removeContact(e),getAvatarData:()=>this.getAvatarData(),desc_status:t[n],num_unread:e.get("num_unread")||0}))}getAvatarData(){var e,t;return{classes:"avatar",height:30,width:30,image:"data:"+((null===(e=this.model.vcard)||void 0===e?void 0:e.get("image_type"))||va.DEFAULT_IMAGE_TYPE)+";base64,"+((null===(t=this.model.vcard)||void 0===t?void 0:t.get("image"))||va.DEFAULT_IMAGE)}}openChat(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.openChat()}removeContact(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),Cl.settings.get("allow_contact_removal")&&confirm(vh("Are you sure you want to remove this contact?")))try{this.model.removeFromRoster(),this.model.collection&&this.model.destroy()}catch(e){M.error(e),Cl.alert("error",vh("Error"),[vh("Sorry, there was an error while trying to remove %1 $ s as a contact.",this.model.getDisplayName())])}}async acceptRequest(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),await va.roster.sendContactAddIQ(this.model.get("jid"),this.model.getFullname(),[]),this.model.authorize().subscribe()}declineRequest(e){return e&&e.preventDefault&&e.preventDefault(),!0===confirm(vh("Are you sure you want to decline this contact request?"))&&this.model.unauthorize().destroy(),this}}Cl.elements.define("converse-roster-contact",YS);const QS=Zo.extend({initialize(){this.set({filter_text:"",filter_type:"contacts",chat_state:"online"})}});class XS extends Uf{constructor(){super(),this.initialize()}initialize(){const e=new va.RosterFilter;e.id= ` _converse . rosterfilter - $ { va . bare _jid } ` ,_o(e,e.id),this.model=e,va.roster_filter=e,this.liveFilter=hc((()=>{this.model.save({filter_text:this.querySelector(".roster-filter").value})}),250),this.listenTo(va,"rosterContactsFetched",this.requestUpdate),this.listenTo(va.presences,"change:show",this.requestUpdate),this.listenTo(va.roster,"add",this.requestUpdate),this.listenTo(va.roster,"destroy",this.requestUpdate),this.listenTo(va.roster,"remove",this.requestUpdate),this.listenTo(this.model,"change",this.dispatchUpdateEvent),this.listenTo(this.model,"change",this.requestUpdate),this.model.fetch()}render(){return(e=>{const t=vh("Filter"),n=vh("Filter by contact name"),s=vh("Filter by group name"),i=vh("Filter by status"),r=vh("Any"),o=vh("Unread"),a=vh("Online"),c=vh("Chatty"),l=vh("Busy"),d=vh("Away"),u=vh("Extended Away"),h=vh("Offline");return Qc `
< 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" >
< span @ click = $ { e . changeTypeFilter } class = "fa fa-user ${" contacts "===e.filter_type?" selected ":" "}" data - type = "contacts" title = "${n}" > < / s p a n >
< span @ click = $ { e . changeTypeFilter } class = "fa fa-users ${" groups "===e.filter_type?" selected ":" "}" data - type = "groups" title = "${s}" > < / s p a n >
< span @ click = $ { e . changeTypeFilter } class = "fa fa-circle ${" state "===e.filter_type?" selected ":" "}" data - type = "state" title = "${i}" > < / s p a n >
< / 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}" / >
< span class = "clear-input fa fa-times ${e.filter_text&&" state "!==e.filter_type?" ":" hidden "}"
@ click = $ { e . clearFilter } >
< / s p a n >
< / d i v >
< select class = "form-control state-type ${" state "!==e.filter_type?" hidden ":" "}"
@ change = $ { e . changeChatStateFilter } >
< 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 >
< 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 >
2021-11-12 22:09:04 +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 = e . t a r g e t . d a t a s e t . t y p e ; " 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 ( ) { v a r e ; r e t u r n ( n u l l = = = ( e = v a . r o s t e r ) | | v o i d 0 = = = e ? v o i d 0 : e . 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 : " " } ) } } C l . 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 " , X S ) ; v a r Z S = n ( 7 4 ) , e x = { } ; e x . s t y l e T a g T r a n s f o r m = e g ( ) , e x . s e t A t t r i b u t e s = Y f ( ) , e x . i n s e r t = J f ( ) . b i n d ( n u l l , " h e a d " ) , e x . d o m A P I = W f ( ) , e x . i n s e r t S t y l e E l e m e n t = X f ( ) , H f ( ) ( Z S . Z , e x ) , Z S . Z & & Z S . Z . l o c a l s & & Z S . Z . l o c a l s , j l . 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 ( ) { C l . 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 h a t _ p e n d i n g _ c o n t a c t s : ! 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 } ) , C l . 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 " ) , v a . R o s t e r F i l t e r = Q S , v a . R o s t e r F i l t e r V i e w = X S , v a . R o s t e r C o n t a c t V i e w = Y S , C l . 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 " , ( ( ) = > { v a . c h a t b o x e s . o n ( " d e s t r o y " , ( e = > U S ( e ) ) ) , v a . c h a t b o x e s . o n ( " c h a n g e : h i d d e n " , ( e = > U S ( e ) ) ) } ) ) , C l . l i s t e n . o n ( " a f t e r T e a r D o w n " , ( ( ) = > { v a r e ; r e t u r n n u l l = = = ( e = v a . r o t e r g r o u p s ) | | v o i d 0 = = = e ? v o i d 0 : e . o f f ( ) . r e s e t ( ) } ) ) } } ) , v a . C u s t o m E l e m e n t = U f ; c o n s t t x = j l . i n i t i a l i z e ; j l . i n i t i a l i z e = f u n c t i o n ( e , t ) { r e t u r n A r r a y . i s A r r a y ( e . w h i t e l i s t e d _ p l u g i n s ) ? e . w h i t e l i s t e d _ p l u g i n s = e . w h i t e l i s t e d _ p l u g i n s . c o n c a t ( B f ) : e . w h i t e l i s t e d _ p l u g i n s = B f , t x ( e , t ) } ; c o n s t n x = j l } , 2 2 4 2 : ( e , t , n ) = > { e . e x p o r t s = { d e f a u l t : n ( 3 3 9 1 ) , _ _ e s M o d u l e : ! 0 } } , 8 9 0 2 : ( e , t , n ) = > { e . e x p o r t s = { d e f a u l t : n ( 8 6 1 3 ) , _ _ e s M o d u l e : ! 0 } } , 6 5 9 3 : ( e , t , n ) = > { e . e x p o r t s = { d e f a u l t : n ( 1 1 2 ) , _ _ e s M o d u l e : ! 0 } } , 6 8 0 3 : ( e , t , n ) = > { " u s e s t r i c t " ; t . _ _ e s M o d u l e = ! 0 ; v a r s , i = ( s = n ( 6 5 9 3 ) ) & & s . _ _ e s M o d u l e ? s : { d e f a u l t : s } ; t . d e f a u l t = f u n c t i o n ( e ) { r e t u r n f u n c t i o n ( ) { v a r t = e . a p p l y ( t h i s , a r g u m e n t s ) ; r e t u r n n e w i . d e f a u l t ( ( f u n c t i o n ( e , n ) { r e t u r n f u n c t i o n s ( r , o ) { t r y { v a r a = t [ r ] ( o ) , c = a . v a l u e } c a t c h ( e ) { r e t u r n v o i d n ( e ) } i f ( ! a . d o n e ) r e t u r n i . d e f a u l t . r e s o l v e ( c ) . t h e n ( ( f u n c t i o n ( e ) { s ( " n e x t " , e ) } ) , ( f u n c t i o n ( e ) { s ( " t h r o w " , e ) } ) ) ; e ( c ) } ( " n e x t " ) } ) ) } } } , 8 1 0 6 : ( e , t , n ) = > { " u s e s t r i c t " ; t . _ _ e s M o d u l e = ! 0 ; v a r s , i = ( s = n ( 2 2 4 2 ) ) & & s . _ _ e s M o d u l e ? s : { d e f a u l t : s } ; t . d e f a u l t = f u n c t i o n ( e , t , n ) { r e t u r n t i n e ? ( 0 , i . d e f a u l t ) ( e , t , { v a l u e : n , e n u m e r a b l e : ! 0 , c o n f i g u r a b l e : ! 0 , w r i t a b l e : ! 0 } ) : e [ t ] = n , e } } , 2 5 4 8 : ( e , t , n ) = > { v a r s = f u n c t i o n ( ) { r e t u r n t h i s } ( ) | | F u n c t i o n ( " r e t u r n t h i s " ) ( ) , i = s . r e g e n e r a t o r R u n t i m e & & O b j e c t . g e t O w n P r o p e r t y N a m e s ( s ) . i n d e x O f ( " r e g e n e r a t o r R u n t i m e " ) > = 0 , r = i & & s . r e g e n e r a t o r R u n t i m e ; i f ( s . r e g e n e r a t o r R u n t i m e = v o i d 0 , e . e x p o r t s = n ( 8 5 4 4 ) , i ) s . r e g e n e r a t o r R u n t i m e = r ; e l s e t r y { d e l e t e s . r e g e n e r a t o r R u n t i m e } c a t c h ( e ) { s . r e g e n e r a t o r R u n t i m e = v o i d 0 } } , 8 5 4 4 : e = > { ! f u n c t i o n ( t ) { " u s e s t r i c t " ; v a r n , s = O b j e c t . p r o t o t y p e , i = s . h a s O w n P r o p e r t y , r = " f u n c t i o n " = = t y p e o f S y m b o l ? S y m b o l : { } , o = r . i t e r a t o r | | " @ @ i t e r a t o r " , a = r . a s y n c I t e r a t o r | | " @ @ a s y n c I t e r a t o r " , c = r . t o S t r i n g T a g | | " @ @ t o S t r i n g T a g " , l = t . r e g e n e r a t o r R u n t i m e ; i f ( l ) e . e x p o r t s = l ; e l s e { ( l = t . r e g e n e r a t o r R u n t i m e = e . e x p o r t s ) . w r a p = y ; v a r d = " s u s p e n d e d S t a r t " , u = " s u s p e n d e d Y i e l d " , h = " e x e c u t i n g " , m = " c o m p l e t e d " , f = { } , g = { } ; g [ o ] = f u n c t i o n ( ) { r e t u r n t h i s } ; v a r p = O b j e c t . g e t P r o t o t y p e O f , v = p & & p ( p ( N ( [ ] ) ) ) ; v & & v ! = = s & & i . c a l l ( v , o ) & & ( g = v ) ; v a r b = x . p r o t o t y p e = w . p r o t o t y p e = O b j e c t . c r e a t e ( g ) ; S . p r o t o t y p e = b . c o n s t r u c t o r = x , x . c o n s t r u c t o r = S , x [ c ] = S . d i s p l a y N a m e = " G e n e r a t o r F u n c t i o n " , l . i s G e n e r a t o r F u n c t i o n = f u n c t i o n ( e ) { v a r t = " f u n c t i o n " = = t y p e o f e & & e . c o n s t r u c t o r ; r e t u r n ! ! t & & ( t = = = S | | " G e n e r a t o r F u n c t i o n " = = = ( t . d i s p l a y N a m e | | t . n a m e ) ) } , l . m a r k = f u n c t i o n ( e ) { r e t u r n O b j e c t . s e t P r o t o t y p
2021-01-29 23:34:36 +01:00
//# sourceMappingURL=converse.min.js.map