/*! For license information please see vendors~init.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[17],[function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(4),r=n.n(o);r.a.methodFactory=function(e,t,n){return function(...t){return"error"===e||"warn"===e||"trace"===e||"info"===e?console[e](...t):console.log(...t)}};const i=r.a.getLogger("matrix");i.setLevel(r.a.levels.DEBUG)},function(e,t,n){"use strict";n.d(t,"e",(function(){return i})),n.d(t,"f",(function(){return s})),n.d(t,"u",(function(){return a})),n.d(t,"j",(function(){return c})),n.d(t,"t",(function(){return l})),n.d(t,"B",(function(){return u})),n.d(t,"l",(function(){return d})),n.d(t,"k",(function(){return h})),n.d(t,"y",(function(){return p})),n.d(t,"q",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"a",(function(){return _})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return v})),n.d(t,"i",(function(){return b})),n.d(t,"o",(function(){return E})),n.d(t,"v",(function(){return y})),n.d(t,"s",(function(){return S})),n.d(t,"z",(function(){return C})),n.d(t,"h",(function(){return T})),n.d(t,"n",(function(){return k})),n.d(t,"g",(function(){return x})),n.d(t,"A",(function(){return O})),n.d(t,"r",(function(){return R})),n.d(t,"d",(function(){return D})),n.d(t,"w",(function(){return I})),n.d(t,"x",(function(){return A})),n.d(t,"m",(function(){return N}));var o=n(13),r=n.n(o);function i(e){let t="";for(const n in e)e.hasOwnProperty(n)&&(t+="&"+encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.substring(1)}function s(e,t){for(const n in t)t.hasOwnProperty(n)&&(e=e.replace(n,encodeURIComponent(t[n])));return e}function a(e,t){const n=new Array(e.length);for(let o=0;o=0;o--)if(t(e[o],o,e))return e[o]}else for(o=0;o=0;o--)if(t(e[o],o,e))return r=e[o],e.splice(o,1),r}else for(o=0;o{setTimeout(n,e,t)})}function R(e){return null==e}function D(){let e,t;const n=new Promise((n,o)=>{e=n,t=o});return{resolve:e,reject:t,promise:n}}async function I(e,t){for(const n of await e)await t(await n)}function A(e){return new Promise(t=>t(e()))}let F;function N(){return F}},,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var o,r;!function(i,s){"use strict";void 0===(r="function"==typeof(o=function(){var e=function(){},t="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function o(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function i(n){return"debug"===n&&(n="log"),"undefined"!=typeof console&&("trace"===n&&t?r:void 0!==console[n]?o(console,n):void 0!==console.log?o(console,"log"):e)}function s(t,o){for(var r=0;r=0&&t<=i.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(r=t,!1!==o&&function(e){var t=(n[e]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[a]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(a)+"="+t+";"}catch(e){}}}(t),s.call(i,t,e),"undefined"==typeof console&&tthis.readyPromiseResolve=e),window.addEventListener("message",e=>{if(e.origin!==this.origin)return;if(!e.data)return;if(e.data.widgetId!==this.widgetId)return;const t=e.data;if(t.api===c.ToWidget&&t.action)console.log("[WidgetAPI] Got request: "+JSON.stringify(t)),t.action===a.GetCapabilities?(this.onCapabilitiesRequest(t),this.expectingExplicitReady||this.readyPromiseResolve()):t.action===a.ClientReady?(this.readyPromiseResolve(),this.replyToRequest(t,{})):console.warn("[WidgetAPI] Got unexpected action: "+t.action);else if(t.api===c.FromWidget&&this.inFlightRequests[t.requestId]){console.log("[WidgetAPI] Got reply: "+JSON.stringify(t));const e=this.inFlightRequests[t.requestId];delete this.inFlightRequests[t.requestId],e(t)}else console.warn("[WidgetAPI] Unhandled payload: "+JSON.stringify(t))})}waitReady(){return this.readyPromise}replyToRequest(e,t){if(!window.parent)return;const n=JSON.parse(JSON.stringify(e));n.response=t,window.parent.postMessage(n,this.origin)}onCapabilitiesRequest(e){return this.replyToRequest(e,{capabilities:this.requestedCapabilities})}callAction(e,t,n){if(!window.parent)return;const o={api:c.FromWidget,widgetId:this.widgetId,action:e,requestId:Object(i.a)(160),data:t,response:{}};n&&(this.inFlightRequests[o.requestId]=n),console.log("[WidgetAPI] Sending request: ",o),window.parent.postMessage(o,"*")}setAlwaysOnScreen(e){return new Promise(t=>{this.callAction(a.SetAlwaysOnScreen,{value:e},null),t()})}}},,,function(e,t,n){var o,r,i;r=[],void 0===(i="function"==typeof(o=function(){var e=XMLHttpRequest;if(!e)throw new Error("missing XMLHttpRequest");function t(i,s){if("function"!=typeof s)throw new Error("Bad callback given: "+s);if(!i)throw new Error("No options given");var a=i.onResponse;if((i="string"==typeof i?{uri:i}:JSON.parse(JSON.stringify(i))).onResponse=a,i.verbose&&(t.log=function(){var e,t,n={},i=["trace","debug","info","warn","error"];for(t=0;t>18&63,i=c>>12&63,s=c>>6&63,a=63&c,p[d++]=l.charAt(r)+l.charAt(i)+l.charAt(s)+l.charAt(a)}while(u299)&&o.error){for(var r in e=new Error("CouchDB error: "+(o.error.reason||o.error.error)),o)e[r]=o[r];return n(e,t,o)}return n(e,t,o)}))},t})?o.apply(t,r):o)||(e.exports=i)},function(e,t,n){"use strict";function o(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let o=0;o{this.accountData[e.type]=e})}_accumulateRooms(e){e.rooms&&(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(t=>{this._accumulateRoom(t,"invite",e.rooms.invite[t])}),e.rooms.join&&Object.keys(e.rooms.join).forEach(t=>{this._accumulateRoom(t,"join",e.rooms.join[t])}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(t=>{this._accumulateRoom(t,"leave",e.rooms.leave[t])}))}_accumulateRoom(e,t,n){switch(t){case"invite":this._accumulateInviteState(e,n);break;case"join":this.inviteRooms[e]&&delete this.inviteRooms[e],this._accumulateJoinState(e,n);break;case"leave":this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:o.a.error("Unknown cateogory: ",t)}}_accumulateInviteState(e,t){if(!t.invite_state||!t.invite_state.events)return;if(!this.inviteRooms[e])return void(this.inviteRooms[e]={invite_state:t.invite_state});const n=this.inviteRooms[e];t.invite_state.events.forEach(e=>{let t=!1;for(let o=0;o{n._accountData[e.type]=e}),t.unread_notifications&&(n._unreadNotifications=t.unread_notifications),t.summary){const e="m.heroes",o="m.invited_member_count",r="m.joined_member_count",i=n._summary,s=t.summary;i[e]=s[e]||i[e],i[r]=s[r]||i[r],i[o]=s[o]||i[o]}if(t.ephemeral&&t.ephemeral.events&&t.ephemeral.events.forEach(e=>{"m.receipt"===e.type&&e.content&&Object.keys(e.content).forEach(t=>{e.content[t]["m.read"]&&Object.keys(e.content[t]["m.read"]).forEach(o=>{n._readReceipts[o]={data:e.content[t]["m.read"][o],eventId:t}})})}),t.timeline&&t.timeline.limited&&(n._timeline=[]),t.state&&t.state.events&&t.state.events.forEach(e=>{s(n._currentState,e)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((e,o)=>{s(n._currentState,e),n._timeline.push({event:e,token:0===o?t.timeline.prev_batch:null})}),n._timeline.length>this.opts.maxTimelineEntries){for(let e=n._timeline.length-this.opts.maxTimelineEntries;e{this._accumulateGroup(t,"invite",e.groups.invite[t])}),e.groups.join&&Object.keys(e.groups.join).forEach(t=>{this._accumulateGroup(t,"join",e.groups.join[t])}),e.groups.leave&&Object.keys(e.groups.leave).forEach(t=>{this._accumulateGroup(t,"leave",e.groups.leave[t])}))}_accumulateGroup(e,t,n){for(const t of["invite","join","leave"])delete this.groups[t][e];this.groups[t][e]=n}getJSON(){const e={join:{},invite:{},leave:{}};Object.keys(this.inviteRooms).forEach(t=>{e.invite[t]=this.inviteRooms[t]}),Object.keys(this.joinRooms).forEach(t=>{const n=this.joinRooms[t],o={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:n._unreadNotifications,summary:n._summary};Object.keys(n._accountData).forEach(e=>{o.account_data.events.push(n._accountData[e])});const i={type:"m.receipt",room_id:t,content:{}};Object.keys(n._readReceipts).forEach(e=>{const t=n._readReceipts[e];i.content[t.eventId]||(i.content[t.eventId]={"m.read":{}}),i.content[t.eventId]["m.read"][e]=t.data}),Object.keys(i.content).length>0&&o.ephemeral.events.push(i),n._timeline.forEach(e=>{if(!o.timeline.prev_batch){if(!e.token)return;o.timeline.prev_batch=e.token}o.timeline.events.push(e.event)});const a=Object.create(null);for(let e=o.timeline.events.length-1;e>=0;e--){const t=o.timeline.events[e];if(null===t.state_key||void 0===t.state_key)continue;const n=Object(r.c)(t);n.unsigned&&(n.unsigned.prev_content&&(n.content=n.unsigned.prev_content),n.unsigned.prev_sender&&(n.sender=n.unsigned.prev_sender)),s(a,n)}Object.keys(n._currentState).forEach(e=>{Object.keys(n._currentState[e]).forEach(t=>{let r=n._currentState[e][t];a[e]&&a[e][t]&&(r=a[e][t]),o.state.events.push(r)})}),e.join[t]=o});const t=[];return Object.keys(this.accountData).forEach(e=>{t.push(this.accountData[e])}),{nextBatch:this.nextBatch,roomsData:e,groupsData:this.groups,accountData:t}}getNextBatchToken(){return this.nextBatch}}function s(e,t){null!==t.state_key&&void 0!==t.state_key&&t.type&&(e[t.type]||(e[t.type]=Object.create(null)),e[t.type][t.state_key]=t)}},function(e,t,n){"use strict";function o(e,t){return new Promise((n,o)=>{let r=!0;const i=e.open(t);i.onupgradeneeded=()=>{r=!1},i.onblocked=()=>o(),i.onsuccess=()=>{i.result.close(),r||e.deleteDatabase(t),n(r)},i.onerror=e=>o(e.target.error)})}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(10),r=n(1),i=n(11),s=n(0);function a(e,t,n){const o=e.openCursor(t);return new Promise((e,t)=>{const r=[];o.onerror=e=>{t(new Error("Query failed: "+e.target.errorCode))},o.onsuccess=t=>{const o=t.target.result;o?(r.push(n(o)),o.continue()):e(r)}})}function c(e){return new Promise((t,n)=>{e.oncomplete=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function l(e){return new Promise((t,n)=>{e.onsuccess=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function u(e){return l(e).then(e=>e.target.result)}function d(e,t){this.indexedDB=e,this._dbName="matrix-js-sdk:"+(t||"default"),this.db=null,this._disconnected=!0,this._syncAccumulator=new o.a,this._isNewlyCreated=!1}d.exists=function(e,t){return t="matrix-js-sdk:"+(t||"default"),i.a(e,t)},d.prototype={connect:function(){if(!this._disconnected)return s.a.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this._disconnected=!1,s.a.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this._dbName,3);return e.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;s.a.log("LocalIndexedDBStoreBackend.connect: upgrading from "+n),n<1&&(this._isNewlyCreated=!0,function(e){e.createObjectStore("users",{keyPath:["userId"]}),e.createObjectStore("accountData",{keyPath:["type"]}),e.createObjectStore("sync",{keyPath:["clobber"]})}(t)),n<2&&function(e){e.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]}).createIndex("room","room_id")}(t),n<3&&function(e){e.createObjectStore("client_options",{keyPath:["clobber"]})}(t)},e.onblocked=()=>{s.a.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},s.a.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),l(e).then(e=>(s.a.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.target.result,this.db.onversionchange=()=>{this.db.close()},this._init()))},isNewlyCreated:function(){return Promise.resolve(this._isNewlyCreated)},_init:function(){return Promise.all([this._loadAccountData(),this._loadSyncData()]).then(([e,t])=>{s.a.log("LocalIndexedDBStoreBackend: loaded initial data"),this._syncAccumulator.accumulate({next_batch:t.nextBatch,rooms:t.roomsData,groups:t.groupsData,account_data:{events:e}})})},getOutOfBandMembers:function(e){return new Promise((t,n)=>{const o=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),r=IDBKeyRange.only(e),i=o.openCursor(r),s=[];let a=!1;i.onsuccess=e=>{const n=e.target.result;if(!n)return s.length||a?t(s):t(null);const o=n.value;o.oob_written?a=!0:s.push(o),n.continue()},i.onerror=e=>{n(e)}}).then(t=>(s.a.log("LL: got "+(t&&t.length)+` membershipEvents from storage for room ${e} ...`),t))},setOutOfBandMembers:async function(e,t){s.a.log("LL: backend about to store "+t.length+" members for "+e);const n=this.db.transaction(["oob_membership_events"],"readwrite"),o=n.objectStore("oob_membership_events");t.forEach(e=>{o.put(e)});const r={room_id:e,oob_written:!0,state_key:0};o.put(r),await c(n),s.a.log(`LL: backend done storing for ${e}!`)},clearOutOfBandMembers:async function(e){const t=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),n=IDBKeyRange.only(e),o=u(t.openKeyCursor(n,"next")).then(e=>e&&e.primaryKey[1]),r=u(t.openKeyCursor(n,"prev")).then(e=>e&&e.primaryKey[1]),[i,a]=await Promise.all([o,r]),c=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),l=IDBKeyRange.bound([e,i],[e,a]);var d;s.a.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,i],[e,a]),await(d=c.delete(l),new Promise((e,t)=>{d.onsuccess=()=>e(d),d.onerror=e=>t(e)}))},clearDatabase:function(){return new Promise((e,t)=>{s.a.log("Removing indexeddb instance: "+this._dbName);const n=this.indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{s.a.log("can't yet delete indexeddb "+this._dbName+" because it is open elsewhere")},n.onerror=t=>{s.a.warn("unable to delete js-sdk store indexeddb: "+t.target.error),e()},n.onsuccess=()=>{s.a.log("Removed indexeddb instance: "+this._dbName),e()}})},getSavedSync:function(e){void 0===e&&(e=!0);const t=this._syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(r.c(t)):Promise.resolve(t):Promise.resolve(null)},getNextBatchToken:function(){return Promise.resolve(this._syncAccumulator.getNextBatchToken())},setSyncData:function(e){return Promise.resolve().then(()=>{this._syncAccumulator.accumulate(e)})},syncToDatabase:function(e){const t=this._syncAccumulator.getJSON();return Promise.all([this._persistUserPresenceEvents(e),this._persistAccountData(t.accountData),this._persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])},_persistSyncData:function(e,t,n){return s.a.log("Persisting sync data up to ",e),r.x(()=>{const o=this.db.transaction(["sync"],"readwrite");return o.objectStore("sync").put({clobber:"-",nextBatch:e,roomsData:t,groupsData:n}),c(o)})},_persistAccountData:function(e){return r.x(()=>{const t=this.db.transaction(["accountData"],"readwrite"),n=t.objectStore("accountData");for(let t=0;t{const t=this.db.transaction(["users"],"readwrite"),n=t.objectStore("users");for(const t of e)n.put({userId:t[0],event:t[1]});return c(t)})},getUserPresenceEvents:function(){return r.x(()=>a(this.db.transaction(["users"],"readonly").objectStore("users"),void 0,e=>[e.value.userId,e.value.event]))},_loadAccountData:function(){return s.a.log("LocalIndexedDBStoreBackend: loading account data..."),r.x(()=>a(this.db.transaction(["accountData"],"readonly").objectStore("accountData"),void 0,e=>e.value).then(e=>(s.a.log("LocalIndexedDBStoreBackend: loaded account data"),e)))},_loadSyncData:function(){return s.a.log("LocalIndexedDBStoreBackend: loading sync data..."),r.x(()=>a(this.db.transaction(["sync"],"readonly").objectStore("sync"),void 0,e=>e.value).then(e=>(s.a.log("LocalIndexedDBStoreBackend: loaded sync data"),e.length>1&&s.a.warn("loadSyncData: More than 1 sync row found."),e.length>0?e[0]:{})))},getClientOptions:function(){return Promise.resolve().then(()=>a(this.db.transaction(["client_options"],"readonly").objectStore("client_options"),void 0,e=>{if(e.value&&e.value&&e.value.options)return e.value.options}).then(e=>e[0]))},storeClientOptions:async function(e){const t=this.db.transaction(["client_options"],"readwrite");t.objectStore("client_options").put({clobber:"-",options:e}),await c(t)}}},function(e,t,n){"use strict";var o=n(18);var r=RegExp(Object.keys(o).map((function(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")})).join("|"),"g");function i(e){return o[e]}e.exports=function(e){return e.replace(r,i)}},,,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e){e.exports=JSON.parse('{"0":"O","1":"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ","ﱞ":"ﹲّ","ࣲ":"ٍ","ﱟ":"ﹴّ","ﳲ":"ﹷّ","ﱠ":"ﹶّ","ﳳ":"ﹹّ","ﱡ":"ﹸّ","ؚ":"ِ","̗":"ِ","ﳴ":"ﹻّ","ﱢ":"ﹺّ","ﱣ":"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\\u2028":" ","\\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":","ː":":","ꓽ":":","⩴":"::=","⧴":":→","!":"!","ǃ":"!","ⵑ":"!","‼":"!!","⁉":"!?","ʔ":"?","Ɂ":"?","ॽ":"?","Ꭾ":"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·","ᐧ":"·","⋯":"···","ⵈ":"···","ᑄ":"·<","⋗":"·>","ᐷ":"·>","ᑀ":"·>","ᔯ":"·4","ᑾ":"·b","ᒀ":"·ḃ","ᑺ":"·d","ᒘ":"·J","ᒶ":"·L","ᑶ":"·P","ᑗ":"·U","ᐺ":"·V","ᐼ":"·Ʌ","ᒮ":"·Γ","ᐎ":"·Δ","ᑙ":"·Ո","ᐌ":"·ᐁ","ᐐ":"·ᐄ","ᐒ":"·ᐅ","ᐔ":"·ᐆ","ᐗ":"·ᐊ","ᐙ":"·ᐋ","ᐾ":"·ᐲ","ᑂ":"·ᐴ","ᑆ":"·ᐹ","ᑛ":"·ᑏ","ᑔ":"·ᑐ","ᑝ":"·ᑐ","ᑟ":"·ᑑ","ᑡ":"·ᑕ","ᑣ":"·ᑖ","ᑴ":"·ᑫ","ᑸ":"·ᑮ","ᑼ":"·ᑰ","ᒒ":"·ᒉ","ᒔ":"·ᒋ","ᒖ":"·ᒌ","ᒚ":"·ᒎ","ᒜ":"·ᒐ","ᒞ":"·ᒑ","ᒬ":"·ᒣ","ᒰ":"·ᒦ","ᒲ":"·ᒧ","ᒴ":"·ᒨ","ᒸ":"·ᒫ","ᓉ":"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ","ᓋ":"·ᓇ","ᓍ":"·ᓈ","ᓜ":"·ᓓ","ᓞ":"·ᓕ","ᓠ":"·ᓖ","ᓢ":"·ᓗ","ᓤ":"·ᓘ","ᓦ":"·ᓚ","ᓨ":"·ᓛ","ᓶ":"·ᓭ","ᓸ":"·ᓯ","ᓺ":"·ᓰ","ᓼ":"·ᓱ","ᓾ":"·ᓲ","ᔀ":"·ᓴ","ᔂ":"·ᓵ","ᔗ":"·ᔐ","ᔙ":"·ᔑ","ᔛ":"·ᔒ","ᔝ":"·ᔓ","ᔟ":"·ᔔ","ᔡ":"·ᔕ","ᔣ":"·ᔖ","ᔱ":"·ᔨ","ᔳ":"·ᔩ","ᔵ":"·ᔪ","ᔷ":"·ᔫ","ᔹ":"·ᔭ","ᔻ":"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ","ᕎ":"·ᕌ","ᕛ":"·ᕚ","ᕨ":"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"\'","'":"\'","‘":"\'","’":"\'","‛":"\'","′":"\'","‵":"\'","՚":"\'","׳":"\'","`":"\'","`":"\'","`":"\'","´":"\'","΄":"\'","´":"\'","᾽":"\'","᾿":"\'","῾":"\'","ʹ":"\'","ʹ":"\'","ˈ":"\'","ˊ":"\'","ˋ":"\'","˴":"\'","ʻ":"\'","ʽ":"\'","ʼ":"\'","ʾ":"\'","ꞌ":"\'","י":"\'","ߴ":"\'","ߵ":"\'","ᑊ":"\'","ᛌ":"\'","𖽑":"\'","𖽒":"\'","᳓":"\'\'","\\"":"\'\'",""":"\'\'","“":"\'\'","”":"\'\'","‟":"\'\'","″":"\'\'","‶":"\'\'","〃":"\'\'","״":"\'\'","˝":"\'\'","ʺ":"\'\'","˶":"\'\'","ˮ":"\'\'","ײ":"\'\'","‴":"\'\'\'","‷":"\'\'\'","⁗":"\'\'\'\'","Ɓ":"\'B","Ɗ":"\'D","ʼn":"\'n","Ƥ":"\'P","Ƭ":"\'T","Ƴ":"\'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬","く":"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/","〳":"/","Ⳇ":"/","ノ":"/","丿":"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\\\","﹨":"\\\\","∖":"\\\\","⟍":"\\\\","⧵":"\\\\","⧹":"\\\\","𝈏":"\\\\","𝈻":"\\\\","㇔":"\\\\","丶":"\\\\","⼂":"\\\\","⳹":"\\\\\\\\","⑊":"\\\\\\\\","⟈":"\\\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ","ъ":"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵","ð":"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<","ᐸ":"<","ᚲ":"<","⋖":"<·","Ⲵ":"<·","ᑅ":"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">","ᐳ":">","𖼿":">","ᑁ":">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー","ᅳ":"ー","ㅡ":"ー","一":"ー","⼀":"ー","ᆖ":"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ","ᆕ":"ーᅮ","ᅴ":"ー丨","ㅢ":"ー丨","ᆗ":"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2","Ƨ":"2","Ϩ":"2","Ꙅ":"2","ᒿ":"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁","ƻ":"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3","Ȝ":"3","Ʒ":"3","Ꝫ":"3","Ⳍ":"3","З":"3","Ӡ":"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂","Ҙ":"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4","Ꮞ":"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.","ᔰ":"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5","Ƽ":"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6","б":"6","Ꮾ":"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8","ȣ":"8","Ȣ":"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a","a":"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a","ɑ":"a","α":"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a","а":"a","ⷶ":"ͣ","A":"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A","Α":"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A","А":"A","Ꭺ":"A","ᗅ":"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲","ǎ":"ă","Ǎ":"Ă","ȧ":"å","Ȧ":"Å","ẚ":"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA","æ":"ae","ӕ":"ae","Æ":"AE","Ӕ":"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ","ᗄ":"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b","Ƅ":"b","Ь":"b","Ꮟ":"b","ᑲ":"b","ᖯ":"b","B":"B","ℬ":"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B","Β":"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B","В":"B","Ᏼ":"B","ᗷ":"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B","ɓ":"b̔","ᑳ":"ḃ","ƃ":"b̄","Ƃ":"b̄","Б":"b̄","ƀ":"b̵","ҍ":"b̵","Ҍ":"b̵","ѣ":"b̵","Ѣ":"b̵","ᑿ":"b·","ᒁ":"ḃ·","ᒈ":"b\'","Ы":"bl","в":"ʙ","ᏼ":"ʙ","c":"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c","ϲ":"c","ⲥ":"c","с":"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C","C":"C","Ⅽ":"C","ℂ":"C","ℭ":"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C","С":"C","Ꮯ":"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠","ç":"c̦","ҫ":"c̦","Ç":"C̦","Ҫ":"C̦","Ƈ":"C\'","℅":"c/o","℆":"c/u","🅭":"㏄\\t⃝","⋴":"ꞓ","ɛ":"ꞓ","ε":"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ","є":"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ","Є":"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d","Ꮷ":"d","ᑯ":"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D","Ꭰ":"D","ᗞ":"D","ᗪ":"D","ꓓ":"D","ɗ":"d̔","ɖ":"d̨","ƌ":"d̄","đ":"d̵","Đ":"D̵","Ð":"D̵","Ɖ":"D̵","₫":"ḏ̵","ꝺ":"Ꝺ","ᑻ":"d·","ᒇ":"d\'","ʤ":"dȝ","dz":"dz","ʣ":"dz","Dz":"Dz","DZ":"DZ","dž":"dž","Dž":"Dž","DŽ":"DŽ","ʥ":"dʑ","ꭰ":"ᴅ","⸹":"ẟ","δ":"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ","ծ":"ẟ","ᕷ":"ẟ","℮":"e","e":"e","ℯ":"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e","е":"e","ҽ":"e","ⷷ":"ͤ","⋿":"E","E":"E","ℰ":"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E","Ε":"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E","Е":"E","ⴹ":"E","Ꭼ":"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E","ě":"ĕ","Ě":"Ĕ","ɇ":"e̸","Ɇ":"E̸","ҿ":"ę","ꭼ":"ᴇ","ə":"ǝ","ә":"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ","ɚ":"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵","Ә":"Ə","𝈡":"Ɛ","ℇ":"Ɛ","Ԑ":"Ɛ","Ꮛ":"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ","з":"ɜ","ҙ":"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f","ſ":"f","ẝ":"f","ք":"f","𝈓":"F","ℱ":"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F","Ϝ":"F","𝟊":"F","ᖴ":"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F","ƒ":"f̦","Ƒ":"F̦","ᵮ":"f̴","℻":"FAX","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ʩ":"fŋ","ᖵ":"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ","ᖷ":"ꟻ","g":"g","ℊ":"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g","ɡ":"g","ᶃ":"g","ƍ":"g","ց":"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G","Ꮐ":"G","Ᏻ":"G","ꓖ":"G","ᶢ":"ᵍ","ɠ":"g̔","ǧ":"ğ","Ǧ":"Ğ","ǵ":"ģ","ǥ":"g̵","Ǥ":"G̵","Ɠ":"G\'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ","h":"h","ℎ":"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h","һ":"h","հ":"h","Ꮒ":"h","H":"H","ℋ":"H","ℌ":"H","ℍ":"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H","Η":"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H","Н":"H","Ꮋ":"H","ᕼ":"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ","ɦ":"h̔","ꚕ":"h̔","Ᏺ":"h̔","Ⱨ":"H̩","Ң":"H̩","ħ":"h̵","ℏ":"h̵","ћ":"h̵","Ħ":"H̵","Ӊ":"H̦","Ӈ":"H̦","н":"ʜ","ꮋ":"ʜ","ң":"ʜ̩","ӊ":"ʜ̦","ӈ":"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ","Ꭸ":"Ⱶ","Ꮀ":"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i","i":"i","ⅰ":"i","ℹ":"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i","ı":"i","𝚤":"i","ɪ":"i","ɩ":"i","ι":"i","ι":"i","ͺ":"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i","і":"i","ꙇ":"i","ӏ":"i","ꭵ":"i","Ꭵ":"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲","ǐ":"ĭ","Ǐ":"Ĭ","ɨ":"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii","ij":"ij","ⅳ":"iv","ⅸ":"ix","j":"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j","ϳ":"j","ј":"j","J":"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J","Ј":"J","Ꭻ":"J","ᒍ":"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵","ᒙ":"J·","𝚥":"ȷ","յ":"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k","K":"K","K":"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K","Κ":"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K","К":"K","Ꮶ":"K","ᛕ":"K","ꓗ":"K","𐔘":"K","ƙ":"k̔","Ⱪ":"K̩","Қ":"K̩","₭":"K̵","Ꝁ":"K̵","Ҟ":"K̵","Ƙ":"K\'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l","I":"l","I":"l","Ⅰ":"l","ℐ":"l","ℑ":"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l","Ɩ":"l","l":"l","ⅼ":"l","ℓ":"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l","ǀ":"l","Ι":"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l","І":"l","Ӏ":"l","ו":"l","ן":"l","ا":"l","𞸀":"l","𞺀":"l","ﺎ":"l","ﺍ":"l","ߊ":"l","ⵏ":"l","ᛁ":"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L","ℒ":"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L","Ꮮ":"L","ᒪ":"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L","ﴼ":"l̋","ﴽ":"l̋","ł":"l̸","Ł":"L̸","ɭ":"l̨","Ɨ":"l̵","ƚ":"l̵","ɫ":"l̴","إ":"lٕ","ﺈ":"lٕ","ﺇ":"lٕ","ٳ":"lٕ","ŀ":"l·","Ŀ":"l·","ᒷ":"l·","🄂":"l,","⒈":"l.","ױ":"l\'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点","lj":"lj","IJ":"lJ","Lj":"Lj","LJ":"LJ","‖":"ll","∥":"ll","Ⅱ":"ll","ǁ":"ll","װ":"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点","Ю":"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点","ʪ":"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX","ɮ":"lȝ","ʫ":"lz","أ":"lٴ","ﺄ":"lٴ","ﺃ":"lٴ","ٲ":"lٴ","ٵ":"lٴ","ﷳ":"lكبر","ﷲ":"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ","M":"M","Ⅿ":"M","ℳ":"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M","Μ":"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M","М":"M","Ꮇ":"M","ᗰ":"M","ᛖ":"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"n","𝑛":"n","𝒏":"n","𝓃":"n","𝓷":"n","𝔫":"n","𝕟":"n","𝖓":"n","𝗇":"n","𝗻":"n","𝘯":"n","𝙣":"n","𝚗":"n","ո":"n","ռ":"n","N":"N","ℕ":"N","𝐍":"N","𝑁":"N","𝑵":"N","𝒩":"N","𝓝":"N","𝔑":"N","𝕹":"N","𝖭":"N","𝗡":"N","𝘕":"N","𝙉":"N","𝙽":"N","Ν":"N","𝚴":"N","𝛮":"N","𝜨":"N","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊","ɳ":"n̨","ƞ":"n̩","η":"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩","Ɲ":"N̦","ᵰ":"n̴","nj":"nj","Nj":"Nj","NJ":"NJ","№":"No","ͷ":"ᴎ","и":"ᴎ","𐑍":"ᴎ","ņ":"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o","o":"o","ℴ":"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o","ο":"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o","σ":"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o","о":"o","ჿ":"o","օ":"o","ס":"o","ه":"o","𞸤":"o","𞹤":"o","𞺄":"o","ﻫ":"o","ﻬ":"o","ﻪ":"o","ﻩ":"o","ھ":"o","ﮬ":"o","ﮭ":"o","ﮫ":"o","ﮪ":"o","ہ":"o","ﮨ":"o","ﮩ":"o","ﮧ":"o","ﮦ":"o","ە":"o","ഠ":"o","ဝ":"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O","O":"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O","Ο":"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O","О":"O","Օ":"O","ⵔ":"O","ዐ":"O","ଠ":"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º","ǒ":"ŏ","Ǒ":"Ŏ","ۿ":"ô","Ő":"Ö","ø":"o̸","ꬾ":"o̸","Ø":"O̸","ⵁ":"O̸","Ǿ":"Ó̸","ɵ":"o̵","ꝋ":"o̵","ө":"o̵","ѳ":"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵","Ɵ":"O̵","Ꝋ":"O̵","θ":"O̵","ϑ":"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵","Θ":"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵","Ө":"O̵","Ѳ":"O̵","ⴱ":"O̵","Ꮎ":"O̵","Ꮻ":"O̵","ꭴ":"ơ","ﳙ":"oٰ","🄁":"O,","🄀":"O.","ơ":"o\'","Ơ":"O\'","Ꭴ":"O\'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀","œ":"oe","Œ":"OE","ɶ":"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO","ﳗ":"oج","ﱑ":"oج","ﳘ":"oم","ﱒ":"oم","ﶓ":"oمج","ﶔ":"oمم","ﱓ":"oى","ﱔ":"oى","ൟ":"oരo","တ":"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p","p":"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p","ρ":"p","ϱ":"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p","р":"p","P":"P","ℙ":"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P","Ρ":"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P","Р":"P","Ꮲ":"P","ᑭ":"P","ꓑ":"P","𐊕":"P","ƥ":"p̔","ᵽ":"p̵","ᑷ":"p·","ᒆ":"P\'","ᴩ":"ᴘ","ꮲ":"ᴘ","φ":"ɸ","ϕ":"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ","ф":"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q","գ":"q","զ":"q","ℚ":"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q","ʠ":"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ","κ":"ĸ","ϰ":"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ","к":"ĸ","ꮶ":"ĸ","қ":"ĸ̩","ҟ":"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r","г":"r","ꮁ":"r","𝈖":"R","ℛ":"R","ℜ":"R","ℝ":"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R","Ʀ":"R","Ꭱ":"R","Ꮢ":"R","𐒴":"R","ᖇ":"R","ꓣ":"R","𖼵":"R","ɽ":"r̨","ɼ":"r̩","ɍ":"r̵","ғ":"r̵","ᵲ":"r̴","ґ":"r\'","𑣣":"rn","m":"rn","ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸","ɱ":"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ","я":"ᴙ","ᵳ":"ɾ̴","℩":"ɿ","s":"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s","ƽ":"s","ѕ":"s","ꮪ":"s","𑣁":"s","𐑈":"s","S":"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S","Ѕ":"S","Տ":"S","Ꮥ":"S","Ꮪ":"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S","ʂ":"s̨","ᵴ":"s̴","ꞵ":"ß","β":"ß","ϐ":"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß","Ᏸ":"ß","🝜":"sss","st":"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ","Σ":"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T","T":"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T","Τ":"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T","Т":"T","Ꭲ":"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T","ƭ":"t̔","⍡":"T̈","Ⱦ":"T̸","Ț":"Ţ","Ʈ":"T̨","Ҭ":"T̩","₮":"T⃫","ŧ":"t̵","Ŧ":"T̵","ᵵ":"t̴","Ⴀ":"Ꞇ","Ꜩ":"T3","ʨ":"tɕ","℡":"TEL","ꝷ":"tf","ʦ":"ts","ʧ":"tʃ","ꜩ":"tȝ","τ":"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ","т":"ᴛ","ꭲ":"ᴛ","ҭ":"ᴛ̩","ţ":"ƫ","ț":"ƫ","Ꮏ":"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u","ʋ":"u","υ":"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u","ս":"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U","Ս":"U","ሀ":"U","𐓎":"U","ᑌ":"U","ꓴ":"U","𖽂":"U","𑢸":"U","ǔ":"ŭ","Ǔ":"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵","Ꮜ":"U̵","ᑘ":"U·","ᑧ":"U\'","ᵫ":"ue","ꭣ":"uo","ṃ":"ꭑ","պ":"ɰ","ሣ":"ɰ","℧":"Ʊ","ᘮ":"Ʊ","ᘴ":"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v","v":"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v","ν":"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v","ѵ":"v","ט":"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V","Ѵ":"V","ⴸ":"V","Ꮩ":"V","ᐯ":"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵","ᐻ":"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ","Λ":"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ","Л":"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ","ᐱ":"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦","ᐽ":"Ʌ·","ɯ":"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w","ѡ":"w","ԝ":"w","ա":"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W","Ꮃ":"W","Ꮤ":"W","ꓪ":"W","ѽ":"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ","м":"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x","x":"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x","х":"x","ᕁ":"x","ᕽ":"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X","X":"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X","Χ":"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X","Х":"X","ⵝ":"X","ᚷ":"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ","Ҳ":"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll","ɣ":"y","ᶌ":"y","y":"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y","ʏ":"y","ỿ":"y","ꭚ":"y","γ":"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y","у":"y","ү":"y","ყ":"y","𑣜":"y","Y":"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y","Υ":"Y","ϒ":"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y","У":"Y","Ү":"Y","Ꭹ":"Y","Ꮍ":"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y","ƴ":"y̔","ɏ":"y̵","ұ":"y̵","¥":"Y̵","Ɏ":"Y̵","Ұ":"Y̵","ʒ":"ȝ","ꝫ":"ȝ","ⳍ":"ȝ","ӡ":"ȝ","ჳ":"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z","Z":"Z","ℤ":"Z","ℨ":"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z","Ζ":"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z","Ꮓ":"Z","ꓜ":"Z","𑢩":"Z","ʐ":"z̨","ƶ":"z̵","Ƶ":"Z̵","ȥ":"z̦","Ȥ":"Z̦","ᵶ":"z̴","ƿ":"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ","ϩ":"ƨ","ꙅ":"ƨ","ь":"ƅ","ꮟ":"ƅ","ы":"ƅi","ꭾ":"ɂ","ˤ":"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ","Г":"Γ","Ꮁ":"Γ","ᒥ":"Γ","𖼇":"Γ","Ғ":"Γ̵","ᒯ":"Γ·","Ґ":"Γ\'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ","ᐃ":"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲","ᐏ":"Δ·","ᐬ":"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ","µ":"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ","ϖ":"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π","п":"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π","П":"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ","ϛ":"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ","Ф":"Φ","Փ":"Φ","ቀ":"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ","ѱ":"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ","Ѱ":"Ψ","𐓑":"Ψ","ᛘ":"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω","Ω":"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω","ᘯ":"Ω","ᘵ":"Ω","𐊶":"Ω","⍹":"ω̲","ώ":"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ","җ":"ж̩","Җ":"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И","Й":"Ѝ","Ҋ":"Ѝ̦","ѝ":"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ","Ꮗ":"Ѡ","ᗯ":"Ѡ","Ѽ":"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ","ӌ":"ҷ","Ӌ":"Ҷ","Ҿ":"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ","և":"եւ","ኔ":"ձ","ﬔ":"մե","ﬕ":"մի","ﬗ":"մխ","ﬓ":"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո","በ":"Ո","ᑎ":"Ո","ꓵ":"Ո","ᑚ":"Ո·","ᑨ":"Ո\'","ﬖ":"վն","₽":"Ք","˓":"ՙ","ʿ":"ՙ","ℵ":"א","ﬡ":"א","אָ":"אַ","אּ":"אַ","ﭏ":"אל","ℶ":"ב","ℷ":"ג","ℸ":"ד","ﬢ":"ד","ﬣ":"ה","יּ":"יִ","ﬤ":"כ","ﬥ":"ל","ﬦ":"ם","ﬠ":"ע","ﬧ":"ר","שׂ":"שׁ","שּ":"שׁ","שּׂ":"שּׁ","ﬨ":"ת","ﺀ":"ء","۽":"ء͈","ﺂ":"آ","ﺁ":"آ","ﭑ":"ٱ","ﭐ":"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب","ﺑ":"ب","ﺒ":"ب","ﺐ":"ب","ﺏ":"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ","ﲠ":"بo","ﳢ":"بo","ﲜ":"بج","ﰅ":"بج","ﲝ":"بح","ﰆ":"بح","ﷂ":"بحى","ﲞ":"بخ","ﰇ":"بخ","ﳒ":"بخ","ﱋ":"بخ","ﶞ":"بخى","ﱪ":"بر","ﱫ":"بز","ﲟ":"بم","ﳡ":"بم","ﱬ":"بم","ﰈ":"بم","ﱭ":"بن","ﱮ":"بى","ﰉ":"بى","ﱯ":"بى","ﰊ":"بى","ﭔ":"ٻ","ﭕ":"ٻ","ﭓ":"ٻ","ﭒ":"ٻ","ې":"ٻ","ﯦ":"ٻ","ﯧ":"ٻ","ﯥ":"ٻ","ﯤ":"ٻ","ﭜ":"ڀ","ﭝ":"ڀ","ﭛ":"ڀ","ﭚ":"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة","ö":"ة","ﺔ":"ة","ﺓ":"ة","ۃ":"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت","ﺗ":"ت","ﺘ":"ت","ﺖ":"ت","ﺕ":"ت","ﲥ":"تo","ﳤ":"تo","ﲡ":"تج","ﰋ":"تج","ﵐ":"تجم","ﶠ":"تجى","ﶟ":"تجى","ﲢ":"تح","ﰌ":"تح","ﵒ":"تحج","ﵑ":"تحج","ﵓ":"تحم","ﲣ":"تخ","ﰍ":"تخ","ﵔ":"تخم","ﶢ":"تخى","ﶡ":"تخى","ﱰ":"تر","ﱱ":"تز","ﲤ":"تم","ﳣ":"تم","ﱲ":"تم","ﰎ":"تم","ﵕ":"تمج","ﵖ":"تمح","ﵗ":"تمخ","ﶤ":"تمى","ﶣ":"تمى","ﱳ":"تن","ﱴ":"تى","ﰏ":"تى","ﱵ":"تى","ﰐ":"تى","ﭠ":"ٺ","ﭡ":"ٺ","ﭟ":"ٺ","ﭞ":"ٺ","ﭤ":"ٿ","ﭥ":"ٿ","ﭣ":"ٿ","ﭢ":"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج","ﺟ":"ج","ﺠ":"ج","ﺞ":"ج","ﺝ":"ج","ﲧ":"جح","ﰕ":"جح","ﶦ":"جحى","ﶾ":"جحى","ﷻ":"جل جلlلo","ﲨ":"جم","ﰖ":"جم","ﵙ":"جمح","ﵘ":"جمح","ﶧ":"جمى","ﶥ":"جمى","ﴝ":"جى","ﴁ":"جى","ﴞ":"جى","ﴂ":"جى","ﭸ":"ڃ","ﭹ":"ڃ","ﭷ":"ڃ","ﭶ":"ڃ","ﭴ":"ڄ","ﭵ":"ڄ","ﭳ":"ڄ","ﭲ":"ڄ","ﭼ":"چ","ﭽ":"چ","ﭻ":"چ","ﭺ":"چ","ﮀ":"ڇ","ﮁ":"ڇ","ﭿ":"ڇ","ﭾ":"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح","ﺣ":"ح","ﺤ":"ح","ﺢ":"ح","ﺡ":"ح","څ":"حۛ","ځ":"حٔ","ݲ":"حٔ","ﲩ":"حج","ﰗ":"حج","ﶿ":"حجى","ﲪ":"حم","ﰘ":"حم","ﵛ":"حمى","ﵚ":"حمى","ﴛ":"حى","ﳿ":"حى","ﴜ":"حى","ﴀ":"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ","ﺧ":"خ","ﺨ":"خ","ﺦ":"خ","ﺥ":"خ","ﲫ":"خج","ﰙ":"خج","ﰚ":"خح","ﲬ":"خم","ﰛ":"خم","ﴟ":"خى","ﴃ":"خى","ﴠ":"خى","ﴄ":"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د","ﺪ":"د","ﺩ":"د","ڈ":"دؕ","ﮉ":"دؕ","ﮈ":"دؕ","ڎ":"دۛ","ﮇ":"دۛ","ﮆ":"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ","ﺬ":"ذ","ﺫ":"ذ","ﱛ":"ذٰ","ڋ":"ڊؕ","ﮅ":"ڌ","ﮄ":"ڌ","ﮃ":"ڍ","ﮂ":"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر","ﺮ":"ر","ﺭ":"ر","ڑ":"رؕ","ﮍ":"رؕ","ﮌ":"رؕ","ژ":"رۛ","ﮋ":"رۛ","ﮊ":"رۛ","ڒ":"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ","ﱜ":"رٰ","ﷶ":"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز","ﺰ":"ز","ﺯ":"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س","ﺳ":"س","ﺴ":"س","ﺲ":"س","ﺱ":"س","ش":"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ","ﺷ":"سۛ","ﺸ":"سۛ","ﺶ":"سۛ","ﺵ":"سۛ","ݾ":"س̂","ﴱ":"سo","ﳨ":"سo","ﴲ":"سۛo","ﳪ":"سۛo","ﲭ":"سج","ﴴ":"سج","ﰜ":"سج","ﴭ":"سۛج","ﴷ":"سۛج","ﴥ":"سۛج","ﴉ":"سۛج","ﵝ":"سجح","ﵞ":"سجى","ﵩ":"سۛجى","ﲮ":"سح","ﴵ":"سح","ﰝ":"سح","ﴮ":"سۛح","ﴸ":"سۛح","ﴦ":"سۛح","ﴊ":"سۛح","ﵜ":"سحج","ﵨ":"سۛحم","ﵧ":"سۛحم","ﶪ":"سۛحى","ﲯ":"سخ","ﴶ":"سخ","ﰞ":"سخ","ﴯ":"سۛخ","ﴹ":"سۛخ","ﴧ":"سۛخ","ﴋ":"سۛخ","ﶨ":"سخى","ﷆ":"سخى","ﴪ":"سر","ﴎ":"سر","ﴩ":"سۛر","ﴍ":"سۛر","ﲰ":"سم","ﳧ":"سم","ﰟ":"سم","ﴰ":"سۛم","ﳩ":"سۛم","ﴨ":"سۛم","ﴌ":"سۛم","ﵡ":"سمج","ﵠ":"سمح","ﵟ":"سمح","ﵫ":"سۛمخ","ﵪ":"سۛمخ","ﵣ":"سمم","ﵢ":"سمم","ﵭ":"سۛمم","ﵬ":"سۛمم","ﴗ":"سى","ﳻ":"سى","ﴘ":"سى","ﳼ":"سى","ﴙ":"سۛى","ﳽ":"سۛى","ﴚ":"سۛى","ﳾ":"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص","ﺻ":"ص","ﺼ":"ص","ﺺ":"ص","ﺹ":"ص","ڞ":"صۛ","ࢯ":"ص̤̣","ﲱ":"صح","ﰠ":"صح","ﵥ":"صحح","ﵤ":"صحح","ﶩ":"صحى","ﲲ":"صخ","ﴫ":"صر","ﴏ":"صر","ﷵ":"صلعم","ﷹ":"صلى","ﷰ":"صلى","ﷺ":"صلى lللo علىo وسلم","ﲳ":"صم","ﰡ":"صم","ﷅ":"صمم","ﵦ":"صمم","ﴡ":"صى","ﴅ":"صى","ﴢ":"صى","ﴆ":"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض","ﺿ":"ض","ﻀ":"ض","ﺾ":"ض","ﺽ":"ض","ﲴ":"ضج","ﰢ":"ضج","ﲵ":"ضح","ﰣ":"ضح","ﵮ":"ضحى","ﶫ":"ضحى","ﲶ":"ضخ","ﰤ":"ضخ","ﵰ":"ضخم","ﵯ":"ضخم","ﴬ":"ضر","ﴐ":"ضر","ﲷ":"ضم","ﰥ":"ضم","ﴣ":"ضى","ﴇ":"ضى","ﴤ":"ضى","ﴈ":"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط","ﻃ":"ط","ﻄ":"ط","ﻂ":"ط","ﻁ":"ط","ڟ":"طۛ","ﲸ":"طح","ﰦ":"طح","ﴳ":"طم","ﴺ":"طم","ﰧ":"طم","ﵲ":"طمح","ﵱ":"طمح","ﵳ":"طمم","ﵴ":"طمى","ﴑ":"طى","ﳵ":"طى","ﴒ":"طى","ﳶ":"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ","ﻇ":"ظ","ﻈ":"ظ","ﻆ":"ظ","ﻅ":"ظ","ﲹ":"ظم","ﴻ":"ظم","ﰨ":"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع","ﻋ":"ع","ﻌ":"ع","ﻊ":"ع","ﻉ":"ع","ﲺ":"عج","ﰩ":"عج","ﷄ":"عجم","ﵵ":"عجم","ﷷ":"علىo","ﲻ":"عم","ﰪ":"عم","ﵷ":"عمم","ﵶ":"عمم","ﵸ":"عمى","ﶶ":"عمى","ﴓ":"عى","ﳷ":"عى","ﴔ":"عى","ﳸ":"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ","ﻏ":"غ","ﻐ":"غ","ﻎ":"غ","ﻍ":"غ","ﲼ":"غج","ﰫ":"غج","ﲽ":"غم","ﰬ":"غم","ﵹ":"غمم","ﵻ":"غمى","ﵺ":"غمى","ﴕ":"غى","ﳹ":"غى","ﴖ":"غى","ﳺ":"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف","ﻓ":"ف","ﻔ":"ف","ﻒ":"ف","ﻑ":"ف","ڧ":"ف","ﲾ":"فج","ﰭ":"فج","ﲿ":"فح","ﰮ":"فح","ﳀ":"فخ","ﰯ":"فخ","ﵽ":"فخم","ﵼ":"فخم","ﳁ":"فم","ﰰ":"فم","ﷁ":"فمى","ﱼ":"فى","ﰱ":"فى","ﱽ":"فى","ﰲ":"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ","ڤ":"ڡۛ","ﭬ":"ڡۛ","ﭭ":"ڡۛ","ﭫ":"ڡۛ","ﭪ":"ڡۛ","ڨ":"ڡۛ","ࢤ":"ڢۛ","ﭰ":"ڦ","ﭱ":"ڦ","ﭯ":"ڦ","ﭮ":"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق","ﻗ":"ق","ﻘ":"ق","ﻖ":"ق","ﻕ":"ق","ﳂ":"قح","ﰳ":"قح","ﷱ":"قلى","ﳃ":"قم","ﰴ":"قم","ﶴ":"قمح","ﵾ":"قمح","ﵿ":"قمم","ﶲ":"قمى","ﱾ":"قى","ﰵ":"قى","ﱿ":"قى","ﰶ":"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك","ﻛ":"ك","ﻜ":"ك","ﻚ":"ك","ﻙ":"ك","ک":"ك","ﮐ":"ك","ﮑ":"ك","ﮏ":"ك","ﮎ":"ك","ڪ":"ك","ڭ":"كۛ","ﯕ":"كۛ","ﯖ":"كۛ","ﯔ":"كۛ","ﯓ":"كۛ","ݣ":"كۛ","ﲀ":"كl","ﰷ":"كl","ﳄ":"كج","ﰸ":"كج","ﳅ":"كح","ﰹ":"كح","ﳆ":"كخ","ﰺ":"كخ","ﳇ":"كل","ﳫ":"كل","ﲁ":"كل","ﰻ":"كل","ﳈ":"كم","ﳬ":"كم","ﲂ":"كم","ﰼ":"كم","ﷃ":"كمم","ﶻ":"كمم","ﶷ":"كمى","ﲃ":"كى","ﰽ":"كى","ﲄ":"كى","ﰾ":"كى","ݢ":"ڬ","ﮔ":"گ","ﮕ":"گ","ﮓ":"گ","ﮒ":"گ","ࢰ":"گ","ڴ":"گۛ","ﮜ":"ڱ","ﮝ":"ڱ","ﮛ":"ڱ","ﮚ":"ڱ","ﮘ":"ڳ","ﮙ":"ڳ","ﮗ":"ڳ","ﮖ":"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل","ﻟ":"ل","ﻠ":"ل","ﻞ":"ل","ﻝ":"ل","ڷ":"لۛ","ڵ":"ل̆","ﻼ":"لl","ﻻ":"لl","ﻺ":"لlٕ","ﻹ":"لlٕ","ﻸ":"لlٴ","ﻷ":"لlٴ","ﳍ":"لo","ﻶ":"لآ","ﻵ":"لآ","ﳉ":"لج","ﰿ":"لج","ﶃ":"لجج","ﶄ":"لجج","ﶺ":"لجم","ﶼ":"لجم","ﶬ":"لجى","ﳊ":"لح","ﱀ":"لح","ﶵ":"لحم","ﶀ":"لحم","ﶂ":"لحى","ﶁ":"لحى","ﳋ":"لخ","ﱁ":"لخ","ﶆ":"لخم","ﶅ":"لخم","ﳌ":"لم","ﳭ":"لم","ﲅ":"لم","ﱂ":"لم","ﶈ":"لمح","ﶇ":"لمح","ﶭ":"لمى","ﲆ":"لى","ﱃ":"لى","ﲇ":"لى","ﱄ":"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م","ﻣ":"م","ﻤ":"م","ﻢ":"م","ﻡ":"م","ࢧ":"مۛ","۾":"م͈","ﲈ":"مl","ﳎ":"مج","ﱅ":"مج","ﶌ":"مجح","ﶒ":"مجخ","ﶍ":"مجم","ﷀ":"مجى","ﳏ":"مح","ﱆ":"مح","ﶉ":"محج","ﶊ":"محم","ﷴ":"محمد","ﶋ":"محى","ﳐ":"مخ","ﱇ":"مخ","ﶎ":"مخج","ﶏ":"مخم","ﶹ":"مخى","ﳑ":"مم","ﲉ":"مم","ﱈ":"مم","ﶱ":"ممى","ﱉ":"مى","ﱊ":"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن","ﻧ":"ن","ﻨ":"ن","ﻦ":"ن","ﻥ":"ن","ݨ":"نؕ","ݩ":"ن̆","ﳖ":"نo","ﳯ":"نo","ﶸ":"نجح","ﶽ":"نجح","ﶘ":"نجم","ﶗ":"نجم","ﶙ":"نجى","ﷇ":"نجى","ﳓ":"نح","ﱌ":"نح","ﶕ":"نحم","ﶖ":"نحى","ﶳ":"نحى","ﳔ":"نخ","ﱍ":"نخ","ﲊ":"نر","ﲋ":"نز","ﳕ":"نم","ﳮ":"نم","ﲌ":"نم","ﱎ":"نم","ﶛ":"نمى","ﶚ":"نمى","ﲍ":"نن","ﲎ":"نى","ﱏ":"نى","ﲏ":"نى","ﱐ":"نى","ۂ":"ۀ","ﮥ":"ۀ","ﮤ":"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و","ﻮ":"و","ﻭ":"و","ࢱ":"و","ۋ":"وۛ","ﯟ":"وۛ","ﯞ":"وۛ","ۇ":"و̓","ﯘ":"و̓","ﯗ":"و̓","ۆ":"و̆","ﯚ":"و̆","ﯙ":"و̆","ۉ":"و̂","ﯣ":"و̂","ﯢ":"و̂","ۈ":"وٰ","ﯜ":"وٰ","ﯛ":"وٰ","ؤ":"وٴ","ﺆ":"وٴ","ﺅ":"وٴ","ٶ":"وٴ","ٷ":"و̓ٴ","ﯝ":"و̓ٴ","ﷸ":"وسلم","ﯡ":"ۅ","ﯠ":"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى","ں":"ى","𞸝":"ى","𞹝":"ى","ﮟ":"ى","ﮞ":"ى","ࢽ":"ى","ﯨ":"ى","ﯩ":"ى","ﻰ":"ى","ﻯ":"ى","ي":"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى","ﻳ":"ى","ﻴ":"ى","ﻲ":"ى","ﻱ":"ى","ی":"ى","ﯾ":"ى","ﯿ":"ى","ﯽ":"ى","ﯼ":"ى","ے":"ى","ﮯ":"ى","ﮮ":"ى","ٹ":"ىؕ","ﭨ":"ىؕ","ﭩ":"ىؕ","ﭧ":"ىؕ","ﭦ":"ىؕ","ڻ":"ىؕ","ﮢ":"ىؕ","ﮣ":"ىؕ","ﮡ":"ىؕ","ﮠ":"ىؕ","پ":"ىۛ","ﭘ":"ىۛ","ﭙ":"ىۛ","ﭗ":"ىۛ","ﭖ":"ىۛ","ث":"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ","ﺛ":"ىۛ","ﺜ":"ىۛ","ﺚ":"ىۛ","ﺙ":"ىۛ","ڽ":"ىۛ","ۑ":"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆","ێ":"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ","ﲐ":"ىٰ","ﱝ":"ىٰ","ﳞ":"ىo","ﳱ":"ىo","ﳦ":"ىۛo","ئ":"ىٴ","ﺋ":"ىٴ","ﺌ":"ىٴ","ﺊ":"ىٴ","ﺉ":"ىٴ","ٸ":"ىٴ","ﯫ":"ىٴl","ﯪ":"ىٴl","ﲛ":"ىٴo","ﳠ":"ىٴo","ﯭ":"ىٴo","ﯬ":"ىٴo","ﯸ":"ىٴٻ","ﯷ":"ىٴٻ","ﯶ":"ىٴٻ","ﲗ":"ىٴج","ﰀ":"ىٴج","ﲘ":"ىٴح","ﰁ":"ىٴح","ﲙ":"ىٴخ","ﱤ":"ىٴر","ﱥ":"ىٴز","ﲚ":"ىٴم","ﳟ":"ىٴم","ﱦ":"ىٴم","ﰂ":"ىٴم","ﱧ":"ىٴن","ﯯ":"ىٴو","ﯮ":"ىٴو","ﯱ":"ىٴو̓","ﯰ":"ىٴو̓","ﯳ":"ىٴو̆","ﯲ":"ىٴو̆","ﯵ":"ىٴوٰ","ﯴ":"ىٴوٰ","ﯻ":"ىٴى","ﯺ":"ىٴى","ﱨ":"ىٴى","ﯹ":"ىٴى","ﰃ":"ىٴى","ﱩ":"ىٴى","ﰄ":"ىٴى","ﳚ":"ىج","ﱕ":"ىج","ﰑ":"ىۛج","ﶯ":"ىجى","ﳛ":"ىح","ﱖ":"ىح","ﶮ":"ىحى","ﳜ":"ىخ","ﱗ":"ىخ","ﲑ":"ىر","ﱶ":"ىۛر","ﲒ":"ىز","ﱷ":"ىۛز","ﳝ":"ىم","ﳰ":"ىم","ﲓ":"ىم","ﱘ":"ىم","ﲦ":"ىۛم","ﳥ":"ىۛم","ﱸ":"ىۛم","ﰒ":"ىۛم","ﶝ":"ىمم","ﶜ":"ىمم","ﶰ":"ىمى","ﲔ":"ىن","ﱹ":"ىۛن","ﲕ":"ىى","ﱙ":"ىى","ﲖ":"ىى","ﱚ":"ىى","ﱺ":"ىۛى","ﰓ":"ىۛى","ﱻ":"ىۛى","ﰔ":"ىۛى","ﮱ":"ۓ","ﮰ":"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ","Մ":"ሆ","Ռ":"ቡ","Ի":"ኮ","Պ":"ጣ","आ":"अा","ऒ":"अाॆ","ओ":"अाे","औ":"अाै","ऄ":"अॆ","ऑ":"अॉ","ऍ":"एॅ","ऎ":"एॆ","ऐ":"एे","ई":"र्इ","ઽ":"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्","আ":"অা","ৠ":"ঋৃ","ৡ":"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ","ਉ":"ੳੁ","ਊ":"ੳੂ","ਆ":"ਅਾ","ਐ":"ਅੈ","ਔ":"ਅੌ","ਇ":"ੲਿ","ਈ":"ੲੀ","ਏ":"ੲੇ","આ":"અા","ઑ":"અાૅ","ઓ":"અાે","ઔ":"અાૈ","ઍ":"અૅ","એ":"અે","ઐ":"અૈ","ଆ":"ଅା","௮":"அ","ர":"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ","ഉ":"உ","ஊ":"உள","ഊ":"உൗ","௭":"எ","௷":"எவ","ஜ":"ஐ","ജ":"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி","ണ":"ண","௺":"நீ","௴":"மீ","௰":"ய","ഴ":"ழ","ௗ":"ள","ை":"ன","ശ":"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ","ಅ":"అ","ಆ":"ఆ","ಇ":"ఇ","ౠ":"ఋా","ౡ":"ఌా","ಒ":"ఒ","ఔ":"ఒౌ","ಔ":"ఒౌ","ఓ":"ఒౕ","ಓ":"ఒౕ","ಜ":"జ","ಞ":"ఞ","ఢ":"డ̣","ಣ":"ణ","థ":"ధּ","భ":"బ̣","ಯ":"య","ఠ":"రּ","ಱ":"ఱ","ಲ":"ల","ష":"వ̣","హ":"వా","మ":"వు","ూ":"ుా","ౄ":"ృా","ೡ":"ಌಾ","ഈ":"ഇൗ","ഐ":"എെ","ഓ":"ഒാ","ഔ":"ഒൗ","ൡ":"ഞ","൫":"ദ്ര","൹":"നു","ഌ":"നു","ങ":"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ","റ":"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳","ฃ":"ข","ด":"ค","ต":"ค","ม":"ฆ","ຈ":"จ","ซ":"ช","ฏ":"ฎ","ท":"ฑ","ບ":"บ","ປ":"ป","ຝ":"ฝ","ພ":"พ","ຟ":"ฟ","ฦ":"ภ","ຍ":"ย","។":"ฯ","ๅ":"า","ำ":"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู","แ":"เเ","ໜ":"ຫນ","ໝ":"ຫມ","ຳ":"̊າ","༂":"འུྂཿ","༃":"འུྂ༔","ཪ":"ར","ༀ":"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ","က":"ဂာ","ၰ":"ဃှ","ၦ":"ပှ","ဟ":"ပာ","ၯ":"ပာှ","ၾ":"ၽှ","ဩ":"သြ","ဪ":"သြော်","႞":"ႃ̊","ឣ":"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ","ᢖ":"ᡜ","ᡕ":"ᠵ","ῶ":"Ꮿ","ᐍ":"ᐁ·","ᐫ":"ᐁᐠ","ᐑ":"ᐄ·","ᐓ":"ᐅ·","ᐭ":"ᐅᐠ","ᐕ":"ᐆ·","ᐘ":"ᐊ·","ᐮ":"ᐊᐠ","ᐚ":"ᐋ·","ᣝ":"ᐞᣟ","ᓑ":"ᐡ","ᕀ":"ᐩ","ᐿ":"ᐲ·","ᑃ":"ᐴ·","⍩":"ᐵ","ᑇ":"ᐹ·","ᑜ":"ᑏ·","⸧":"ᑐ","⊃":"ᑐ","ᑞ":"ᑐ·","ᑩ":"ᑐ\'","⟉":"ᑐ/","⫗":"ᑐᑕ","ᑠ":"ᑑ·","⸦":"ᑕ","⊂":"ᑕ","ᑢ":"ᑕ·","ᑪ":"ᑕ\'","ᑤ":"ᑖ·","ᑵ":"ᑫ·","ᒅ":"ᑫ\'","ᑹ":"ᑮ·","ᑽ":"ᑰ·","ᘃ":"ᒉ","ᒓ":"ᒉ·","ᒕ":"ᒋ·","ᒗ":"ᒌ·","ᒛ":"ᒎ·","ᘂ":"ᒐ","ᒝ":"ᒐ·","ᒟ":"ᒑ·","ᒭ":"ᒣ·","ᒱ":"ᒦ·","ᒳ":"ᒧ·","ᒵ":"ᒨ·","ᒹ":"ᒫ·","ᓊ":"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·","ᓌ":"ᓇ·","ᓎ":"ᓈ·","ᘄ":"ᓓ","ᓝ":"ᓓ·","ᓟ":"ᓕ·","ᓡ":"ᓖ·","ᓣ":"ᓗ·","ᓥ":"ᓘ·","ᘇ":"ᓚ","ᓧ":"ᓚ·","ᓩ":"ᓛ·","ᓷ":"ᓭ·","ᓹ":"ᓯ·","ᓻ":"ᓰ·","ᓽ":"ᓱ·","ᓿ":"ᓲ·","ᔁ":"ᓴ·","ᔃ":"ᓵ·","ᔌ":"ᔋ<","ᔎ":"ᔋb","ᔍ":"ᔋᑕ","ᔏ":"ᔋᒐ","ᔘ":"ᔐ·","ᔚ":"ᔑ·","ᔜ":"ᔒ·","ᔞ":"ᔓ·","ᔠ":"ᔔ·","ᔢ":"ᔕ·","ᔤ":"ᔖ·","ᔲ":"ᔨ·","ᔴ":"ᔩ·","ᔶ":"ᔪ·","ᔸ":"ᔫ·","ᔺ":"ᔭ·","ᔼ":"ᔮ·","ᘢ":"ᕃ","ᣠ":"ᕃ·","ᘣ":"ᕆ","ᘤ":"ᕊ","ᕏ":"ᕌ·","ᖃ":"ᕐb","ᖄ":"ᕐḃ","ᖁ":"ᕐd","ᕿ":"ᕐP","ᙯ":"ᕐᑫ","ᕾ":"ᕐᑬ","ᖀ":"ᕐᑮ","ᖂ":"ᕐᑰ","ᖅ":"ᕐᒃ","ᕜ":"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·","ᕩ":"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·","ᖑ":"ᖕJ","ᙰ":"ᖕᒉ","ᖎ":"ᖕᒊ","ᖏ":"ᖕᒋ","ᖐ":"ᖕᒌ","ᖒ":"ᖕᒎ","ᖓ":"ᖕᒐ","ᖔ":"ᖕᒑ","ᙳ":"ᖖJ","ᙱ":"ᖖᒋ","ᙲ":"ᖖᒌ","ᙴ":"ᖖᒎ","ᙵ":"ᖖᒐ","ᙶ":"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ","ˡ":"ᣳ","ʳ":"ᣴ","ˢ":"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ","ᛡ":"ᚼ","⍿":"ᚽ","ᛂ":"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥","ㄱ":"ᄀ","ᆨ":"ᄀ","ᄁ":"ᄀᄀ","ㄲ":"ᄀᄀ","ᆩ":"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ","ᇃ":"ᄀᄅ","ᇻ":"ᄀᄇ","ᆪ":"ᄀᄉ","ㄳ":"ᄀᄉ","ᇄ":"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ","ㄴ":"ᄂ","ᆫ":"ᄂ","ᄓ":"ᄂᄀ","ᇅ":"ᄂᄀ","ᄔ":"ᄂᄂ","ㅥ":"ᄂᄂ","ᇿ":"ᄂᄂ","ᄕ":"ᄂᄃ","ㅦ":"ᄂᄃ","ᇆ":"ᄂᄃ","ퟋ":"ᄂᄅ","ᄖ":"ᄂᄇ","ᅛ":"ᄂᄉ","ᇇ":"ᄂᄉ","ㅧ":"ᄂᄉ","ᅜ":"ᄂᄌ","ᆬ":"ᄂᄌ","ㄵ":"ᄂᄌ","ퟌ":"ᄂᄎ","ᇉ":"ᄂᄐ","ᅝ":"ᄂᄒ","ᆭ":"ᄂᄒ","ㄶ":"ᄂᄒ","ᇈ":"ᄂᅀ","ㅨ":"ᄂᅀ","ㄷ":"ᄃ","ᆮ":"ᄃ","ᄗ":"ᄃᄀ","ᇊ":"ᄃᄀ","ᄄ":"ᄃᄃ","ㄸ":"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ","ᇋ":"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ","ㄹ":"ᄅ","ᆯ":"ᄅ","ꥤ":"ᄅᄀ","ᆰ":"ᄅᄀ","ㄺ":"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ","ᇌ":"ᄅᄀᄉ","ㅩ":"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ","ᄘ":"ᄅᄂ","ᇍ":"ᄅᄂ","ꥦ":"ᄅᄃ","ᇎ":"ᄅᄃ","ㅪ":"ᄅᄃ","ꥧ":"ᄅᄃᄃ","ᇏ":"ᄅᄃᄒ","ᄙ":"ᄅᄅ","ᇐ":"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ","ᆱ":"ᄅᄆ","ㄻ":"ᄅᄆ","ᇑ":"ᄅᄆᄀ","ᇒ":"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ","ᆲ":"ᄅᄇ","ㄼ":"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ","ᇓ":"ᄅᄇᄉ","ㅫ":"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ","ᇕ":"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ","ᇔ":"ᄅᄇᄒ","ꥬ":"ᄅᄉ","ᆳ":"ᄅᄉ","ㄽ":"ᄅᄉ","ᇖ":"ᄅᄉᄉ","ᄛ":"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ","ᇘ":"ᄅᄏ","ᆴ":"ᄅᄐ","ㄾ":"ᄅᄐ","ᆵ":"ᄅᄑ","ㄿ":"ᄅᄑ","ᄚ":"ᄅᄒ","ㅀ":"ᄅᄒ","ᄻ":"ᄅᄒ","ᆶ":"ᄅᄒ","ퟲ":"ᄅᄒ","ᇗ":"ᄅᅀ","ㅬ":"ᄅᅀ","ퟛ":"ᄅᅌ","ᇙ":"ᄅᅙ","ㅭ":"ᄅᅙ","ퟜ":"ᄅᅙᄒ","ㅁ":"ᄆ","ᆷ":"ᄆ","ꥯ":"ᄆᄀ","ᇚ":"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ","ᇛ":"ᄆᄅ","ퟠ":"ᄆᄆ","ᄜ":"ᄆᄇ","ㅮ":"ᄆᄇ","ᇜ":"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ","ᇝ":"ᄆᄉ","ㅯ":"ᄆᄉ","ᇞ":"ᄆᄉᄉ","ᄝ":"ᄆᄋ","ㅱ":"ᄆᄋ","ᇢ":"ᄆᄋ","ퟢ":"ᄆᄌ","ᇠ":"ᄆᄎ","ᇡ":"ᄆᄒ","ᇟ":"ᄆᅀ","ㅰ":"ᄆᅀ","ㅂ":"ᄇ","ᆸ":"ᄇ","ᄞ":"ᄇᄀ","ㅲ":"ᄇᄀ","ᄟ":"ᄇᄂ","ᄠ":"ᄇᄃ","ㅳ":"ᄇᄃ","ퟣ":"ᄇᄃ","ᇣ":"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ","ᄈ":"ᄇᄇ","ㅃ":"ᄇᄇ","ퟦ":"ᄇᄇ","ᄬ":"ᄇᄇᄋ","ㅹ":"ᄇᄇᄋ","ᄡ":"ᄇᄉ","ㅄ":"ᄇᄉ","ᆹ":"ᄇᄉ","ᄢ":"ᄇᄉᄀ","ㅴ":"ᄇᄉᄀ","ᄣ":"ᄇᄉᄃ","ㅵ":"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ","ᄤ":"ᄇᄉᄇ","ᄥ":"ᄇᄉᄉ","ᄦ":"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ","ᄫ":"ᄇᄋ","ㅸ":"ᄇᄋ","ᇦ":"ᄇᄋ","ᄧ":"ᄇᄌ","ㅶ":"ᄇᄌ","ퟨ":"ᄇᄌ","ᄨ":"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ","ᄩ":"ᄇᄐ","ㅷ":"ᄇᄐ","ᄪ":"ᄇᄑ","ᇤ":"ᄇᄑ","ꥴ":"ᄇᄒ","ᇥ":"ᄇᄒ","ㅅ":"ᄉ","ᆺ":"ᄉ","ᄭ":"ᄉᄀ","ㅺ":"ᄉᄀ","ᇧ":"ᄉᄀ","ᄮ":"ᄉᄂ","ㅻ":"ᄉᄂ","ᄯ":"ᄉᄃ","ㅼ":"ᄉᄃ","ᇨ":"ᄉᄃ","ᄰ":"ᄉᄅ","ᇩ":"ᄉᄅ","ᄱ":"ᄉᄆ","ퟪ":"ᄉᄆ","ᄲ":"ᄉᄇ","ㅽ":"ᄉᄇ","ᇪ":"ᄉᄇ","ᄳ":"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ","ᄊ":"ᄉᄉ","ㅆ":"ᄉᄉ","ᆻ":"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ","ᄴ":"ᄉᄉᄉ","ᄵ":"ᄉᄋ","ᄶ":"ᄉᄌ","ㅾ":"ᄉᄌ","ퟯ":"ᄉᄌ","ᄷ":"ᄉᄎ","ퟰ":"ᄉᄎ","ᄸ":"ᄉᄏ","ᄹ":"ᄉᄐ","ퟱ":"ᄉᄐ","ᄺ":"ᄉᄑ","ퟮ":"ᄉᅀ","ㅇ":"ᄋ","ᆼ":"ᄋ","ᅁ":"ᄋᄀ","ᇬ":"ᄋᄀ","ᇭ":"ᄋᄀᄀ","ᅂ":"ᄋᄃ","ꥶ":"ᄋᄅ","ᅃ":"ᄋᄆ","ᅄ":"ᄋᄇ","ᅅ":"ᄋᄉ","ᇱ":"ᄋᄉ","ㆂ":"ᄋᄉ","ᅇ":"ᄋᄋ","ㆀ":"ᄋᄋ","ᇮ":"ᄋᄋ","ᅈ":"ᄋᄌ","ᅉ":"ᄋᄎ","ᇯ":"ᄋᄏ","ᅊ":"ᄋᄐ","ᅋ":"ᄋᄑ","ꥷ":"ᄋᄒ","ᅆ":"ᄋᅀ","ᇲ":"ᄋᅀ","ㆃ":"ᄋᅀ","ㅈ":"ᄌ","ᆽ":"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ","ᅍ":"ᄌᄋ","ᄍ":"ᄌᄌ","ㅉ":"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ","ㅊ":"ᄎ","ᆾ":"ᄎ","ᅒ":"ᄎᄏ","ᅓ":"ᄎᄒ","ㅋ":"ᄏ","ᆿ":"ᄏ","ㅌ":"ᄐ","ᇀ":"ᄐ","ꥹ":"ᄐᄐ","ㅍ":"ᄑ","ᇁ":"ᄑ","ᅖ":"ᄑᄇ","ᇳ":"ᄑᄇ","ퟺ":"ᄑᄉ","ᅗ":"ᄑᄋ","ㆄ":"ᄑᄋ","ᇴ":"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ","ㅎ":"ᄒ","ᇂ":"ᄒ","ᇵ":"ᄒᄂ","ᇶ":"ᄒᄅ","ᇷ":"ᄒᄆ","ᇸ":"ᄒᄇ","ꥻ":"ᄒᄉ","ᅘ":"ᄒᄒ","ㆅ":"ᄒᄒ","ᄽ":"ᄼᄼ","ᄿ":"ᄾᄾ","ㅿ":"ᅀ","ᇫ":"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ","ㆁ":"ᅌ","ᇰ":"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ","ᅏ":"ᅎᅎ","ᅑ":"ᅐᅐ","ㆆ":"ᅙ","ᇹ":"ᅙ","ꥼ":"ᅙᅙ","ㅤ":"ᅠ","ㅏ":"ᅡ","ᆣ":"ᅡー","ᅶ":"ᅡᅩ","ᅷ":"ᅡᅮ","ᅢ":"ᅡ丨","ㅐ":"ᅡ丨","ㅑ":"ᅣ","ᅸ":"ᅣᅩ","ᅹ":"ᅣᅭ","ᆤ":"ᅣᅮ","ᅤ":"ᅣ丨","ㅒ":"ᅣ丨","ㅓ":"ᅥ","ᅼ":"ᅥー","ᅺ":"ᅥᅩ","ᅻ":"ᅥᅮ","ᅦ":"ᅥ丨","ㅔ":"ᅥ丨","ㅕ":"ᅧ","ᆥ":"ᅧᅣ","ᅽ":"ᅧᅩ","ᅾ":"ᅧᅮ","ᅨ":"ᅧ丨","ㅖ":"ᅧ丨","ㅗ":"ᅩ","ᅪ":"ᅩᅡ","ㅘ":"ᅩᅡ","ᅫ":"ᅩᅡ丨","ㅙ":"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨","ᅿ":"ᅩᅥ","ᆀ":"ᅩᅥ丨","ힰ":"ᅩᅧ","ᆁ":"ᅩᅧ丨","ᆂ":"ᅩᅩ","ힱ":"ᅩᅩ丨","ᆃ":"ᅩᅮ","ᅬ":"ᅩ丨","ㅚ":"ᅩ丨","ㅛ":"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨","ᆄ":"ᅭᅣ","ㆇ":"ᅭᅣ","ᆆ":"ᅭᅣ","ᆅ":"ᅭᅣ丨","ㆈ":"ᅭᅣ丨","ힴ":"ᅭᅥ","ᆇ":"ᅭᅩ","ᆈ":"ᅭ丨","ㆉ":"ᅭ丨","ㅜ":"ᅮ","ᆉ":"ᅮᅡ","ᆊ":"ᅮᅡ丨","ᅯ":"ᅮᅥ","ㅝ":"ᅮᅥ","ᆋ":"ᅮᅥー","ᅰ":"ᅮᅥ丨","ㅞ":"ᅮᅥ丨","ힵ":"ᅮᅧ","ᆌ":"ᅮᅧ丨","ᆍ":"ᅮᅮ","ᅱ":"ᅮ丨","ㅟ":"ᅮ丨","ힶ":"ᅮ丨丨","ㅠ":"ᅲ","ᆎ":"ᅲᅡ","ힷ":"ᅲᅡ丨","ᆏ":"ᅲᅥ","ᆐ":"ᅲᅥ丨","ᆑ":"ᅲᅧ","ㆊ":"ᅲᅧ","ᆒ":"ᅲᅧ丨","ㆋ":"ᅲᅧ丨","ힸ":"ᅲᅩ","ᆓ":"ᅲᅮ","ᆔ":"ᅲ丨","ㆌ":"ᅲ丨","ㆍ":"ᆞ","ퟅ":"ᆞᅡ","ᆟ":"ᆞᅥ","ퟆ":"ᆞᅥ丨","ᆠ":"ᆞᅮ","ᆢ":"ᆞᆞ","ᆡ":"ᆞ丨","ㆎ":"ᆞ丨","ヘ":"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄","不":"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨","ᅵ":"丨","ㅣ":"丨","⼁":"丨","ᆜ":"丨ー","ᆘ":"丨ᅡ","ᆙ":"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨","ᆚ":"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ","ᆛ":"丨ᅮ","ퟃ":"丨ᅲ","ᆝ":"丨ᆞ","ퟄ":"丨丨","串":"串","丸":"丸","丹":"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀","亂":"亂","㇚":"亅","⼅":"亅","了":"了","ニ":"二","⼆":"二","𠄢":"𠄢","⼇":"亠","亮":"亮","⼈":"人","イ":"亻","⺅":"亻","什":"什","仌":"仌","令":"令","你":"你","倂":"併","倂":"併","侀":"侀","來":"來","例":"例","侮":"侮","侮":"侮","侻":"侻","便":"便","值":"値","倫":"倫","偺":"偺","備":"備","像":"像","僚":"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿","兀":"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全","兩":"兩","ハ":"八","⼋":"八","六":"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况","冷":"冷","凉":"凉","凌":"凌","凜":"凜","凞":"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃","切":"切","切":"切","列":"列","利":"利","㓟":"㓟","刺":"刺","刻":"刻","剆":"剆","割":"割","剷":"剷","劉":"劉","𠠄":"𠠄","カ":"力","力":"力","⼒":"力","劣":"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉","勒":"勒","勞":"勞","勤":"勤","勤":"勤","勵":"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕","北":"北","北":"北","⼕":"匚","⼖":"匸","匿":"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博","ト":"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即","卵":"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶","參":"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣","ロ":"口","⼝":"口","囗":"口","⼞":"口","句":"句","叫":"叫","叱":"叱","吆":"吆","吏":"吏","吝":"吝","吸":"吸","呂":"呂","呈":"呈","周":"周","咞":"咞","咢":"咢","咽":"咽","䎛":"㖈","哶":"哶","唐":"唐","啓":"啓","啟":"啓","啕":"啕","啣":"啣","善":"善","善":"善","喇":"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳","嗀":"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器","囹":"囹","圖":"圖","圗":"圗","⼟":"土","士":"土","⼠":"土","型":"型","城":"城","㦳":"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀","塚":"塚","塚":"塚","塞":"塞","填":"塡","壿":"墫","墬":"墬","墳":"墳","壘":"壘","壟":"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊","タ":"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄","奈":"奈","契":"契","奔":"奔","奢":"奢","女":"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦","嬀":"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀","宅":"宅","𡧈":"𡧈","寃":"寃","寘":"寘","寧":"寧","寧":"寧","寧":"寧","寮":"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸","尿":"尿","屠":"屠","屢":"屢","層":"層","履":"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦","崙":"崙","嵃":"嵃","嵐":"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲","嶺":"嶺","⼮":"巛","巢":"巢","エ":"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾","帲":"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干","年":"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广","度":"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶","廊":"廊","廊":"廊","廉":"廉","廒":"廒","廓":"廓","廙":"廙","廬":"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱","弄":"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳","律":"律","㣣":"㣣","徚":"徚","復":"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志","念":"念","忹":"忹","怒":"怒","怜":"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘","惡":"惡","𢛔":"𢛔","愈":"愈","慨":"慨","慄":"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎","憐":"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲","懶":"懶","懶":"懶","戀":"戀","⼽":"戈","成":"成","戛":"戛","戮":"戮","戴":"戴","⼾":"戶","戸":"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱","拉":"拉","拏":"拏","拓":"拓","拔":"拔","拼":"拼","拾":"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨","捻":"捻","掃":"掃","掠":"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮","搉":"㩁","撚":"撚","撝":"撝","擄":"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬","數":"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗","料":"料","⽄":"斤","⽅":"方","旅":"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日","易":"易","曶":"㫚","㫤":"㫤","晉":"晉","晩":"晚","晴":"晴","晴":"晴","暑":"暑","暑":"暑","暈":"暈","㬈":"㬈","暜":"暜","暴":"暴","曆":"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰","更":"更","書":"書","⽉":"月","𣍟":"𣍟","肦":"朌","胐":"朏","胊":"朐","脁":"朓","胶":"㬵","朗":"朗","朗":"朗","朗":"朗","脧":"朘","望":"望","望":"望","幐":"㬺","䐠":"㬻","𣎓":"𣎓","膧":"朣","𣎜":"𣎜","⽊":"木","李":"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃","柿":"杮","杻":"杻","枅":"枅","林":"林","㭉":"㭉","𣏕":"𣏕","柳":"柳","柺":"柺","栗":"栗","栟":"栟","桒":"桒","𣑭":"𣑭","梁":"梁","梅":"梅","梅":"梅","梎":"梎","梨":"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝","槩":"㮣","樧":"榝","榣":"榣","槪":"槪","樂":"樂","樂":"樂","樂":"樂","樓":"樓","𣚣":"𣚣","檨":"檨","櫓":"櫓","櫛":"櫛","欄":"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲","歷":"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟","殮":"殮","⽎":"殳","殺":"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧","沈":"沈","沿":"沿","泌":"泌","泍":"泍","泥":"泥","𣲼":"𣲼","洛":"洛","洞":"洞","洴":"洴","派":"派","流":"流","流":"流","流":"流","洖":"洖","浩":"浩","浪":"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞","淋":"淋","淚":"淚","淪":"淪","淹":"淹","渚":"渚","港":"港","湮":"湮","潙":"溈","滋":"滋","滋":"滋","溜":"溜","溺":"溺","滇":"滇","滑":"滑","滛":"滛","㴳":"㴳","漏":"漏","漢":"漢","漢":"漢","漣":"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆","濫":"濫","濾":"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災","炙":"炙","炭":"炭","烈":"烈","烙":"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅","煉":"煉","𤋮":"𤋮","熜":"熜","燎":"燎","燐":"燐","𤎫":"𤎫","爐":"爐","爛":"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛","牢":"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯","狀":"狀","𤜵":"𤜵","狼":"狼","猪":"猪","猪":"猪","𤠔":"𤠔","獵":"獵","獺":"獺","⽞":"玄","率":"率","率":"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥","玲":"玲","㺸":"㺸","㺸":"㺸","珞":"珞","琉":"琉","理":"理","琢":"琢","瑇":"瑇","瑜":"瑜","瑩":"瑩","瑱":"瑱","瑱":"瑱","璅":"璅","璉":"璉","璘":"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶","留":"留","略":"略","異":"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒","痢":"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝","療":"療","癩":"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼","益":"益","益":"益","盛":"盛","盧":"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳","省":"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹","晣":"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝","硏":"研","硎":"硎","硫":"硫","碌":"碌","碌":"碌","碑":"碑","磊":"磊","磌":"磌","磌":"磌","磻":"磻","䃣":"䃣","礪":"礪","⽰":"示","⺭":"礻","礼":"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝","神":"神","祥":"祥","視":"視","視":"視","祿":"祿","𥚚":"𥚚","禍":"禍","禎":"禎","福":"福","福":"福","𥛅":"𥛅","禮":"禮","⽱":"禸","⽲":"禾","秊":"秊","䄯":"䄯","秫":"秫","稜":"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱","立":"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹","笠":"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐","簾":"簾","籠":"籠","⽶":"米","类":"类","粒":"粒","精":"精","糒":"糒","糖":"糖","糨":"糨","䊠":"䊠","糣":"糣","糧":"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀","紐":"紐","索":"索","累":"累","絶":"絕","絣":"絣","絛":"絛","綠":"綠","綾":"綾","緇":"緇","練":"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉","縷":"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙","罹":"罹","罺":"罺","羅":"羅","𦌾":"𦌾","⽺":"羊","羕":"羕","羚":"羚","羽":"羽","⽻":"羽","翺":"翺","老":"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳","聆":"聆","聠":"聠","𦖨":"𦖨","聯":"聯","聰":"聰","聾":"聾","⾀":"聿","⺺":"肀","⾁":"肉","肋":"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙","腁":"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵","朦":"䑃","臘":"臘","⾂":"臣","臨":"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮","良":"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽","若":"若","若":"若","苦":"苦","𦬼":"𦬼","茶":"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓","菉":"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華","菱":"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭","落":"落","葉":"葉","蔿":"蒍","𦳕":"𦳕","𦵫":"𦵫","蓮":"蓮","蓱":"蓱","蓳":"蓳","蓼":"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬","藍":"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡","藺":"藺","蘆":"蘆","䕫":"䕫","蘒":"蘒","蘭":"蘭","𧃒":"𧃒","虁":"蘷","蘿":"蘿","⾌":"虍","⻁":"虎","虐":"虐","虜":"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊","螺":"螺","蠁":"蠁","䗹":"䗹","蠟":"蠟","⾎":"血","行":"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤","裂":"裂","𧙧":"𧙧","裏":"裏","裗":"裗","裞":"裞","裡":"裡","裸":"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁","襤":"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆","見":"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦","詽":"訮","訞":"䚶","䚾":"䚾","䛇":"䛇","誠":"誠","說":"說","說":"說","調":"調","請":"請","諒":"諒","論":"論","諭":"諭","諭":"諭","諸":"諸","諸":"諸","諾":"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹","識":"識","讀":"讀","讏":"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆","豈":"豈","豕":"豕","⾗":"豕","豣":"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁","賂":"賂","賈":"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起","趆":"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼","跺":"跥","路":"路","跰":"跰","躛":"躗","⾝":"身","車":"車","⾞":"車","軔":"軔","輧":"軿","輦":"輦","輪":"輪","輸":"輸","輸":"輸","輻":"輻","轢":"轢","⻋":"车","⾟":"辛","辞":"辞","辰":"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡","連":"連","逸":"逸","逸":"逸","遲":"遲","遼":"遼","𨗒":"𨗒","𨗭":"𨗭","邏":"邏","⾢":"邑","邔":"邔","郎":"郎","郞":"郎","郞":"郎","郱":"郱","都":"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉","酪":"酪","醙":"醙","醴":"醴","⾤":"釆","里":"里","⾥":"里","量":"量","金":"金","⾦":"金","鈴":"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼","錄":"錄","鍊":"鍊","鎮":"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕","閭":"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝","阮":"阮","陋":"陋","降":"降","陵":"陵","陸":"陸","陼":"陼","隆":"隆","隣":"隣","䧦":"䧦","⾪":"隶","隷":"隷","隸":"隷","隸":"隷","⾫":"隹","雃":"雃","離":"離","難":"難","難":"難","⾬":"雨","零":"零","雷":"雷","霣":"霣","𩅅":"𩅅","露":"露","靈":"靈","⾭":"靑","⻘":"青","靖":"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋","領":"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻","類":"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢","飯":"飯","飼":"飼","䬳":"䬳","館":"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂","駱":"駱","駾":"駾","驪":"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚","魯":"魯","鱀":"鱀","鱗":"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎","鶴":"鶴","𪄅":"𪄅","䳸":"䳸","鷺":"鷺","𪈎":"𪈎","鸞":"鸞","鹃":"鹂","⿄":"鹵","鹿":"鹿","⿅":"鹿","𪊑":"𪊑","麗":"麗","麟":"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍","黎":"黎","䵖":"䵖","⿊":"黑","黒":"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿","龍":"龍","⿓":"龍","龎":"龎","⻰":"龙","龜":"龜","龜":"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"}')},,,,,,,,,,,,,,,function(e,t,n){"use strict";e.exports=n(494)},function(e,t,n){"use strict";n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return m})),n.d(t,"k",(function(){return _})),n.d(t,"c",(function(){return f})),n.d(t,"f",(function(){return v})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return E})),n.d(t,"i",(function(){return y})),n.d(t,"d",(function(){return S})),n.d(t,"j",(function(){return C}));var o=n(8),r=n.n(o),i=n(497),s=n.n(i),a=n(33),c=n.n(a),l=n(40),u=n(51),d=n(1178);function h(e){const t=new Error(e);return t.translatedMessage=m(e),t}function p(e){return e}function m(e,t,n){const o=function(e,t,n){let o=e;if(void 0!==t){const e={};for(const n in t)e[`%\\(${n}\\)s`]=t[n];o=g(o,e)}if(void 0!==n){const e={};for(const t in n)e[`(<${t}>(.*?)<\\/${t}>|<${t}>|<${t}\\s*\\/>)`]=n[t];o=g(o,e)}return o}(function(e,t){let n;t&&"object"==typeof t&&(n=t.count,Object.keys(t).forEach(e=>{void 0===t[e]&&(console.warn("safeCounterpartTranslate called with undefined interpolation name: "+e),t[e]="undefined"),null===t[e]&&(console.warn("safeCounterpartTranslate called with null interpolation name: "+e),t[e]="null")}));let o=s.a.translate(e,t);return void 0===o&&void 0!==n&&(o=s.a.translate(e,Object.assign({},t,{locale:"en"}))),o}(e,Object.assign({interpolate:!1},t)),t,n);return o}function g(e,t){const n=[e];let o=!1;for(const r in t){const i=new RegExp(r,"g");let s=!1;for(const e in n){const a=n[e];if("string"!=typeof a)continue;let c=i.exec(a);if(!c)continue;s=!0;const l=a.substr(0,c.index),u=[];let d;for(;c;){d=c;const e=c.slice(2);let n,s;if(n=t[r]instanceof Function?t[r].apply(null,e):t[r],"object"==typeof n&&(o=!0),"string"==typeof n&&""===n||u.push(n),c=i.exec(a),c){const e=d.index+d[0].length;s=a.substr(e,c.index-e)}else s=a.substr(d.index+d[0].length);s&&u.push(s)}n.splice(e,1,...u),""!==l&&n.splice(e,0,l)}s||"%\\(count\\)s"!==r&&console.log(`Could not find ${i} in ${e}`)}return o?c.a.createElement("span",null,...n):n.join("")}function _(e){Array.isArray(e)||(e=[e]);const t=u.a.get();let n,o;return t&&t.setLanguage(e),w().then(t=>{o=t;for(let t=0;t{if(s.a.registerTranslations(n,e),s.a.setLocale(n),l.b.setValue("language",null,l.a.DEVICE,n),console.log("set language to "+n),"en"!==n)return T("i18n/"+o.en.fileName)}).then(e=>{e&&s.a.registerTranslations("en",e)})}function f(){return w().then(e=>{const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push({value:n,label:e[n].label});return t})}function v(){return navigator.languages&&navigator.languages.length?navigator.languages:navigator.language?[navigator.language]:[navigator.userLanguage||"en"]}function b(){return v()[0]}function E(e){const t=[],n=y(e),o=n.split("-");return 2===o.length&&o[0]===o[1]?t.push(o[0]):(t.push(n),2===o.length&&t.push(o[0])),t}function y(e){return e.toLowerCase().replace("_","-")}function S(){return s.a.getLocale()}function C(e){const t=S(),n=e.map(y);{const o=n.indexOf(t);if(o>-1)return e[o]}{const o=n.find(e=>e.substr(0,2)===t.substr(0,2));if(o>-1)return e[o]}{const t=n.find(e=>e.startsWith("en"));if(t>-1)return e[t]}return e[0]}function w(){return new Promise(async(e,t)=>{let n;n="string"==typeof d.a?d.a:"i18n/languages.json",r()({method:"GET",url:n},(n,o,r)=>{n||o.status<200||o.status>=300?t({err:n,response:o}):e(JSON.parse(r))})})}function T(e){return new Promise((t,n)=>{r()({method:"GET",url:e},(e,o,r)=>{e||o.status<200||o.status>=300?n({err:e,response:o}):t(function(e){const t={};for(const n of Object.keys(e)){const o=n.split("|",2);if(2===o.length){let r=t[o[0]];void 0===r&&(r={},t[o[0]]=r),r[o[1]]=e[n]}else t[n]=e[n]}return t}(JSON.parse(r)))})})}s.a.setSeparator("|"),s.a.setFallbackLocale("en")},function(e,t,n){e.exports=n(512)()},function(e,t,n){"use strict";n.r(t),n.d(t,"loadSkin",(function(){return r})),n.d(t,"resetSkin",(function(){return i})),n.d(t,"getComponent",(function(){return s}));var o=n(509);function r(e){o.a.load(e)}function i(){o.a.reset()}function s(e){return o.a.getComponent(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return I}));var o=n(3),r=n.n(o),i=n(166),s=n(1),a=n(92),c=n(245),l=n(36),u=n(415),d=n(40),h=n(38);function p(e,t,n){return{action:"MatrixActions.sync",state:t,prevState:n,matrixClient:e}}function m(e,t){return{action:"MatrixActions.accountData",event:t,event_type:t.getType(),event_content:t.getContent()}}function g(e,t,n){return{action:"MatrixActions.Room.accountData",event:t,event_type:t.getType(),event_content:t.getContent(),room:n}}function _(e,t){return{action:"MatrixActions.Room",room:t}}function f(e,t,n){return{action:"MatrixActions.Room.tags",room:n}}function v(e,t,n){return{action:"MatrixActions.Room.receipt",event:t,room:n,matrixClient:e}}function b(e,t,n,o,r,i){return{action:"MatrixActions.Room.timeline",event:t,isLiveEvent:i.liveEvent,isLiveUnfilteredRoomTimelineEvent:n&&i.timeline.getTimelineSet()===n.getUnfilteredTimelineSet()}}function E(e,t,n,o){return{action:"MatrixActions.Room.myMembership",room:t,membership:n,oldMembership:o}}function y(e,t){return{action:"MatrixActions.Event.decrypted",event:t}}var S={_matrixClientListenersStop:[],start(e){this._addMatrixClientListener(e,"sync",p),this._addMatrixClientListener(e,"accountData",m),this._addMatrixClientListener(e,"Room.accountData",g),this._addMatrixClientListener(e,"Room",_),this._addMatrixClientListener(e,"Room.tags",f),this._addMatrixClientListener(e,"Room.receipt",v),this._addMatrixClientListener(e,"Room.timeline",b),this._addMatrixClientListener(e,"Room.myMembership",E),this._addMatrixClientListener(e,"Event.decrypted",y)},_addMatrixClientListener(e,t,n){const o=(...t)=>{const o=n(e,...t);o&&h.a.dispatch(o,!0)};e.on(t,o),this._matrixClientListenersStop.push(()=>{e.removeListener(t,o)})},stop(){this._matrixClientListenersStop.forEach(e=>e())}},C=n(41),w=n(135),T=n(244),k=n(303),x=n(108),O=n(90),R=n(136);class D{constructor(){r()(this,"opts",{initialSyncLimit:20}),r()(this,"matrixClient",null),r()(this,"justRegisteredUserId",void 0),r()(this,"currentClientCreds",void 0)}setIndexedDbWorkerScript(e){u.a.indexedDbWorkerScript=e}get(){return this.matrixClient}unset(){this.matrixClient=null,S.stop()}setJustRegisteredUserId(e){this.justRegisteredUserId=e}currentUserIsJustRegistered(){return this.matrixClient&&this.matrixClient.credentials.userId===this.justRegisteredUserId}replaceUsingCreds(e){this.currentClientCreds=e,this.createClient(e)}async assign(){for(const e of["indexeddb","memory"])try{const e=this.matrixClient.store.startup();console.log("MatrixClientPeg: waiting for MatrixClient store to initialise"),await e;break}catch(t){if("indexeddb"!==e)throw console.error("Failed to start memory store!",t),t;console.error("Error starting matrixclient store - falling back to memory store",t),this.matrixClient.store=new i.a({localStorage:localStorage})}k.c(this.matrixClient);try{!d.b.getValue("lowBandwidth")&&this.matrixClient.initCrypto&&(await this.matrixClient.initCrypto(),this.matrixClient.setCryptoTrustCrossSignedDevices(!d.b.getValue("e2ee.manuallyVerifyAllSessions")),k.b(!0))}catch(e){if(e&&"InvalidCryptoStoreError"===e.name){const e=l.getComponent("views.dialogs.CryptoStoreTooNewDialog");C.a.createDialog(e)}console.warn("Unable to initialise e2e",e)}const e=s.c(this.opts);return e.pendingEventOrdering="detached",e.lazyLoadMembers=!0,S.start(this.matrixClient),T.a.matrixClient=this.matrixClient,e}async start(){const e=await this.assign();console.log("MatrixClientPeg: really starting MatrixClient"),await this.get().startClient(e),console.log("MatrixClientPeg: MatrixClient started")}getCredentials(){return{homeserverUrl:this.matrixClient.baseUrl,identityServerUrl:this.matrixClient.idBaseUrl,userId:this.matrixClient.credentials.userId,deviceId:this.matrixClient.getDeviceId(),accessToken:this.matrixClient.getAccessToken(),guest:this.matrixClient.isGuest()}}getHomeserverName(){const e=/^@.+:(.+)$/.exec(this.matrixClient.credentials.userId);if(null===e||e.length<1)throw new Error("Failed to derive homeserver name from user ID!");return e[1]}createClient(e){const t={baseUrl:e.homeserverUrl,idBaseUrl:e.identityServerUrl,accessToken:e.accessToken,userId:e.userId,deviceId:e.deviceId,pickleKey:e.pickleKey,timelineSupport:!0,forceTURN:!d.b.getValue("webRtcAllowPeerToPeer",!1),fallbackICEServerAllowed:!!d.b.getValue("fallbackICEServerAllowed"),verificationMethods:[w.d.SAS,R.d,w.d.RECIPROCATE_QR_CODE],unstableClientRelationAggregation:!0,identityServer:new x.a,cryptoCallbacks:{}};Object.assign(t.cryptoCallbacks,O.c),this.matrixClient=Object(u.a)(t),this.matrixClient.setMaxListeners(500),this.matrixClient.setGuest(Boolean(e.guest));const n=new c.a(null,{timelineSupport:!0});n.getLiveTimeline().setPaginationToken("",a.a.BACKWARDS),this.matrixClient.setNotifTimelineSet(n)}}window.mxMatrixClientPeg||(window.mxMatrixClientPeg=new D);const I=window.mxMatrixClientPeg},function(e,t,n){"use strict";(function(e){var o=n(510),r=n(167);class i extends o.Dispatcher{dispatch(e,t=!1){e instanceof r.a?e.fn(e=>{this.dispatch(e,t)}):t?super.dispatch(e):setTimeout(super.dispatch.bind(this,e),0)}fire(e,t=!1){this.dispatch({action:e},t)}}const s=new i,a=e;a.mxDispatcher||(a.mxDispatcher=s),t.a=s}).call(this,n(17))},function(e,t,n){"use strict";var o=n(33),r=n(679);if(void 0===o)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var i=(new o.Component).updater;e.exports=r(o.Component,o.isValidElement,i)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return T}));var o=n(3),r=n.n(o),i=n(508),s=n(1170),a=n(1171),c=n(1172),l=n(1173),u=n(1174),d=n(1175),h=n(34),p=n(45),m=n(38),g=n(1193),_=n(1176),f=n(1177);const v={DEVICE:"device",ROOM_DEVICE:"room-device",ROOM_ACCOUNT:"room-account",ACCOUNT:"account",ROOM:"room",CONFIG:"config",DEFAULT:"default"},b=new f.a,E={},y={},S=[];for(const e of Object.keys(g.a))E[e]=g.a[e].default,g.a[e].isFeature&&S.push(e),g.a[e].invertedSettingName&&(y[e]=!g.a[e].default);const C={device:new i.a(S,b),"room-device":new s.a(b),"room-account":new c.a(b),account:new l.a(b),room:new u.a(b),config:new d.a,default:new a.a(E,y)};for(const e of Object.keys(C))C[e]=new _.a(C[e]);const w=["device","room-device","room-account","account","room","config","default"];class T{static watchSetting(e,t,n){const o=g.a[e],r=e;if(!o)throw new Error(e+" is not a setting");o.invertedSettingName&&(e=o.invertedSettingName);const i=`${(new Date).getTime()}_${T._watcherCount++}_${e}_${t}`,s=(e,t,o)=>{const i=T.getValue(r);n(r,e,t,o,i)};return console.log(`Starting watcher for ${e}@${t||""} as ID ${i}`),T._watchers[i]=s,b.watchSetting(e,t,s),i}static unwatchSetting(e){T._watchers[e]?(console.log("Ending watcher ID "+e),b.unwatchSetting(T._watchers[e]),delete T._watchers[e]):console.warn("Ending non-existent watcher ID "+e)}static monitorSetting(e,t){this._monitors[e]||(this._monitors[e]={});const n=()=>{this._monitors[e][t]=T.watchSetting(e,t,(e,t,n,o,r)=>{m.a.dispatch({action:"setting_updated",settingName:e,roomId:t,level:n,newValueAtLevel:o,newValue:r})})};if(Object.keys(this._monitors[e]).find(e=>e===t||null===e)){if(null===t){for(const t of Object.keys(this._monitors[e]))T.unwatchSetting(this._monitors[e][t]);this._monitors[e]={},n()}}else n()}static getDisplayName(e,t="default"){if(!g.a[e]||!g.a[e].displayName)return null;let n=g.a[e].displayName;return n instanceof Object&&(n=n[t]?n[t]:n.default),Object(h.a)(n)}static getLabsFeatures(){const e=Object.keys(g.a).filter(e=>T.isFeature(e));return p.a.get().enableLabs?e:e.filter(e=>"labs"===T._getFeatureState(e))}static isFeature(e){return!!g.a[e]&&g.a[e].isFeature}static isFeatureEnabled(e,t=null){if(!T.isFeature(e))throw new Error("Setting "+e+" is not a feature");return T.getValue(e,t)}static setFeatureEnabled(e,t){if(!g.a[e])throw new Error("Setting '"+e+"' does not appear to be a setting.");if(!T.isFeature(e))throw new Error("Setting "+e+" is not a feature");return T.setValue(e,null,"device",t)}static getValue(e,t=null,n=!1){if(!g.a[e])throw new Error("Setting '"+e+"' does not appear to be a setting.");const o=g.a[e],r=o.supportedLevelsAreOrdered?o.supportedLevels:w;return T.getValueAt(r[0],e,t,!1,n)}static getValueAt(e,t,n=null,o=!1,r=!1){const i=g.a[t];if(!i)throw new Error("Setting '"+t+"' does not appear to be a setting.");const s=i.supportedLevelsAreOrdered?i.supportedLevels:w;s.includes("default")||s.push("default");const a=s.indexOf(e);if(-1===a)throw new Error("Level "+e+" is not prioritized");if(T.isFeature(t)){const e=T._getFeatureState(t);if("enable"===e)return!0;if("disable"===e)return!1}const c=T._getHandlers(t);if(i.invertedSettingName&&(t=i.invertedSettingName),o){const o=c[e];if(!o)return T._getFinalValue(i,e,n,null,null);const r=o.getValue(t,n);return T._getFinalValue(i,e,n,r,e)}for(let o=a;o")),console.log("--- default level order: "+JSON.stringify(w)),console.log("--- registered handlers: "+JSON.stringify(Object.keys(C)));const o=e=>{for(const n of Object.keys(C)){const o=C[n];try{const r=o.getValue(e,t);console.log(`--- ${n}@${t||""} = ${JSON.stringify(r)}`)}catch(e){console.log(`--- ${o}@${t||""} THREW ERROR: ${e.message}`),console.error(e)}if(t)try{const t=o.getValue(e,null);console.log(`--- ${n}@ = ${JSON.stringify(t)}`)}catch(e){console.log(`--- ${o}@ THREW ERROR: ${e.message}`),console.error(e)}}console.log("--- calculating as returned by SettingsStore"),console.log("--- these might not match if the setting uses a controller - be warned!");try{const n=T.getValue(e,t);console.log(`--- SettingsStore#generic@${t||""} = ${JSON.stringify(n)}`)}catch(e){console.log(`--- SettingsStore#generic@${t||""} THREW ERROR: ${e.message}`),console.error(e)}if(t)try{const t=T.getValue(e,null);console.log("--- SettingsStore#generic@ = "+JSON.stringify(t))}catch(e){console.log("--- SettingsStore#generic@$ THREW ERROR: "+e.message),console.error(e)}for(const n of w){try{const o=T.getValueAt(n,e,t);console.log(`--- SettingsStore#${n}@${t||""} = ${JSON.stringify(o)}`)}catch(e){console.log(`--- SettingsStore#${n}@${t||""} THREW ERROR: ${e.message}`),console.error(e)}if(t)try{const t=T.getValueAt(n,e,null);console.log(`--- SettingsStore#${n}@ = ${JSON.stringify(t)}`)}catch(e){console.log(`--- SettingsStore#${n}@$ THREW ERROR: ${e.message}`),console.error(e)}}};o(e),n.invertedSettingName&&(console.log("--- TESTING INVERTED SETTING NAME"),console.log("--- inverted: "+n.invertedSettingName),o(n.invertedSettingName)),console.log("--- END DEBUG")}static _getHandler(e,t){const n=T._getHandlers(e);return n[t]?n[t]:null}static _getHandlers(e){if(!g.a[e])return{};const t={};for(const n of g.a[e].supportedLevels){if(!C[n])throw new Error("Unexpected level "+n);T.isLevelSupported(n)&&(t[n]=C[n])}return t.default||(t.default=C.default),t}static _getFeatureState(e){const t=p.a.get().features;let n=p.a.get().enableLabs?"labs":"disable";t&&void 0!==t[e]&&(n=t[e]);return["enable","disable","labs"].includes(n)||(console.warn("Feature state '"+n+"' is invalid for "+e),n="disable"),n}}r()(T,"_watchers",{}),r()(T,"_monitors",{}),r()(T,"_watcherCount",1),e.mxSettingsStore=T}).call(this,n(17))},function(e,t,n){"use strict";(function(e){var o=n(46),r=n.n(o),i=n(33),s=n.n(i),a=n(64),c=n.n(a),l=n(59),u=n(38),d=n(76),h=n(401);class p{constructor(){this._counter=0,this._priorityModal=null,this._staticModal=null,this._modals=[],this.onBackgroundClick=this.onBackgroundClick.bind(this)}hasDialogs(){return this._priorityModal||this._staticModal||this._modals.length>0}getOrCreateContainer(){let e=document.getElementById("mx_Dialog_Container");return e||(e=document.createElement("div"),e.id="mx_Dialog_Container",document.body.appendChild(e)),e}getOrCreateStaticContainer(){let e=document.getElementById("mx_Dialog_StaticContainer");return e||(e=document.createElement("div"),e.id="mx_Dialog_StaticContainer",document.body.appendChild(e)),e}createTrackedDialog(e,t,...n){return l.a.trackEvent("Modal",e,t),this.createDialog(...n)}appendTrackedDialog(e,t,...n){return l.a.trackEvent("Modal",e,t),this.appendDialog(...n)}createDialog(e,...t){return this.createDialogAsync(Promise.resolve(e),...t)}appendDialog(e,...t){return this.appendDialogAsync(Promise.resolve(e),...t)}createTrackedDialogAsync(e,t,...n){return l.a.trackEvent("Modal",e,t),this.createDialogAsync(...n)}appendTrackedDialogAsync(e,t,...n){return l.a.trackEvent("Modal",e,t),this.appendDialogAsync(...n)}_buildModal(e,t,n,o){const i={},[a,c]=this._getCloseFn(i,t),l=this._counter++;return i.elem=s.a.createElement(h.a,r()({key:l,prom:e},t,{onFinished:a})),i.onFinished=t?t.onFinished:null,i.className=n,i.onBeforeClose=o.onBeforeClose,i.beforeClosePromise=null,i.close=a,i.closeReason=null,{modal:i,closeDialog:a,onFinishedProm:c}}_getCloseFn(e,t){const n=Object(d.b)();return[async(...o)=>{if(e.beforeClosePromise)await e.beforeClosePromise;else if(e.onBeforeClose){e.beforeClosePromise=e.onBeforeClose(e.closeReason);const t=await e.beforeClosePromise;if(e.beforeClosePromise=null,!t)return}n.resolve(o),t&&t.onFinished&&t.onFinished.apply(null,o);const r=this._modals.indexOf(e);r>=0&&this._modals.splice(r,1),this._priorityModal===e&&(this._priorityModal=null,this._modals=[]),this._staticModal===e&&(this._staticModal=null,this._modals=[]),this._reRender()},n.promise]}createDialogAsync(e,t,n,o,r,i={}){const{modal:s,closeDialog:a,onFinishedProm:c}=this._buildModal(e,t,n,i);return o?this._priorityModal=s:r?this._staticModal=s:this._modals.unshift(s),this._reRender(),{close:a,finished:c}}appendDialogAsync(e,t,n){const{modal:o,closeDialog:r,onFinishedProm:i}=this._buildModal(e,t,n,{});return this._modals.push(o),this._reRender(),{close:r,finished:i}}onBackgroundClick(){const e=this._getCurrentModal();e&&(e.closeReason="backgroundClick",e.close(),e.closeReason=null)}_getCurrentModal(){return this._priorityModal?this._priorityModal:this._modals[0]||this._staticModal}_reRender(){if(0===this._modals.length&&!this._priorityModal&&!this._staticModal)return u.a.dispatch({action:"aria_unhide_main_app"}),c.a.unmountComponentAtNode(this.getOrCreateContainer()),void c.a.unmountComponentAtNode(this.getOrCreateStaticContainer());if(u.a.dispatch({action:"aria_hide_main_app"}),this._staticModal){const e="mx_Dialog_wrapper mx_Dialog_staticWrapper "+(this._staticModal.className?this._staticModal.className:""),t=s.a.createElement("div",{className:e},s.a.createElement("div",{className:"mx_Dialog"},this._staticModal.elem),s.a.createElement("div",{className:"mx_Dialog_background mx_Dialog_staticBackground",onClick:this.onBackgroundClick}));c.a.render(t,this.getOrCreateStaticContainer())}else c.a.unmountComponentAtNode(this.getOrCreateStaticContainer());const e=this._getCurrentModal();if(e!==this._staticModal){const t="mx_Dialog_wrapper "+(this._staticModal?"mx_Dialog_wrapperWithStaticUnder ":"")+(e.className?e.className:""),n=s.a.createElement("div",{className:t},s.a.createElement("div",{className:"mx_Dialog"},e.elem),s.a.createElement("div",{className:"mx_Dialog_background",onClick:this.onBackgroundClick}));c.a.render(n,this.getOrCreateContainer())}else c.a.unmountComponentAtNode(this.getOrCreateContainer())}}e.singletonModalManager||(e.singletonModalManager=new p),t.a=e.singletonModalManager}).call(this,n(17))},function(e,t,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t",BACKTICK:"`",SPACE:" ",SLASH:"/",SQUARE_BRACKET_LEFT:"[",SQUARE_BRACKET_RIGHT:"]",A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",J:"j",K:"k",L:"l",M:"m",N:"n",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",U:"u",V:"v",W:"w",X:"x",Y:"y",Z:"z"},r=navigator.platform.toUpperCase().indexOf("MAC")>=0;function i(e){return r?e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey:e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.shiftKey}function s(e){return r?e.metaKey&&!e.altKey&&!e.ctrlKey:e.ctrlKey&&!e.altKey&&!e.metaKey}},function(e,t,n){"use strict";var o,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};o=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,o){var r,i,s,a;if(l(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=o?[n,s]:[s,n]:o?s.unshift(n):s.push(n),(r=u(e))>0&&s.length>r&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=h.bind(o);return r.listener=n,o.wrapFn=r,r}function m(e,t,n){var o=e._events;if(void 0===o)return[];var r=o[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var l=c.length,u=_(c,l);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;o--)this.removeListener(e,t[o]);return this},a.prototype.listeners=function(e){return m(this,e,!0)},a.prototype.rawListeners=function(e){return m(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(e,t,n){"use strict";let o;n.d(t,"a",(function(){return o})),function(e){e.ViewUser="view_user",e.ViewUserSettings="view_user_settings",e.ViewTooltip="view_tooltip",e.RecheckTheme="recheck_theme",e.CheckUpdates="check_updates"}(o||(o={}))},function(e,t,n){"use strict";(function(e){class n{constructor(){this.platform=null}get(){return this.platform}set(e){this.platform=e}}e.mxPlatformPeg||(e.mxPlatformPeg=new n),t.a=e.mxPlatformPeg}).call(this,n(17))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return T})),n.d(t,"d",(function(){return k})),n.d(t,"c",(function(){return x})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return R})),n.d(t,"j",(function(){return D})),n.d(t,"g",(function(){return I})),n.d(t,"k",(function(){return A})),n.d(t,"i",(function(){return F})),n.d(t,"h",(function(){return N}));var o=n(46),r=n.n(o),i=n(55),s=n.n(i),a=n(3),c=n.n(a),l=n(33),u=n.n(l),d=n(64),h=n.n(d),p=n(35),m=n.n(p),g=n(42),_=n.n(g),f=n(48),v=n(36),b=n(43);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function y(e){for(var t=1;t{if(!e)return;let t=e.querySelector('[role^="menuitem"]');t||(t=e.querySelector("[tab-index]")),t&&t.focus(),this.setState({contextMenuElem:e})}),c()(this,"onContextMenu",t=>{if(this.props.onFinished){this.props.onFinished(),t.preventDefault();const n=t.clientX,o=t.clientY;e(()=>{const e=document.createEvent("MouseEvents");e.initMouseEvent("contextmenu",!0,!0,window,0,0,0,n,o,!1,!1,!1,!1,0,null),document.elementFromPoint(n,o).dispatchEvent(e)})}}),c()(this,"_onMoveFocus",(e,t)=>{let n=!1;do{const o=t?e.lastElementChild:e.firstElementChild,r=t?e.previousElementSibling:e.nextElementSibling;n?o?e=o:r?e=r:(n=!1,e=e.parentElement):r?(e=r,n=!0):e=e.parentElement,e&&e.classList.contains("mx_ContextualMenu")&&(e=t?e.lastElementChild:e.firstElementChild,n=!0)}while(e&&!C.has(e.getAttribute("role")));e&&e.focus()}),c()(this,"_onMoveFocusHomeEnd",(e,t)=>{let n=e.querySelectorAll('[role^="menuitem"]');n||(n=e.querySelectorAll("[tab-index]")),n&&n.length&&(t?n[0].focus():n[n.length-1].focus())}),c()(this,"_onKeyDown",e=>{if(!this.props.managed)return void(e.key===f.a.ESCAPE&&(this.props.onFinished(),e.stopPropagation(),e.preventDefault()));let t=!0;switch(e.key){case f.a.TAB:case f.a.ESCAPE:this.props.onFinished();break;case f.a.ARROW_UP:this._onMoveFocus(e.target,!0);break;case f.a.ARROW_DOWN:this._onMoveFocus(e.target,!1);break;case f.a.HOME:this._onMoveFocusHomeEnd(this.state.contextMenuElem,!0);break;case f.a.END:this._onMoveFocusHomeEnd(this.state.contextMenuElem,!1);break;default:t=!1}t&&(e.stopPropagation(),e.preventDefault())}),this.state={contextMenuElem:null},this.initialFocus=document.activeElement}componentWillUnmount(){this.initialFocus.focus()}renderMenu(e=this.props.hasBackground){const t={};let n=null;const o=this.props;o.top?t.top=o.top:t.bottom=o.bottom,o.left?(t.left=o.left,n="left"):(t.right=o.right,n="right");const r=this.state.contextMenuElem?this.state.contextMenuElem.getBoundingClientRect():null,i={};o.chevronFace&&(n=o.chevronFace);const s=n&&"none"!==n;if("top"===n||"bottom"===n)i.left=o.chevronOffset;else if(void 0!==t.top){const e=t.top;let n=e;if(r){const e=10;n=Math.min(t.top,document.body.clientHeight-r.height+e)}t.top=n,i.top=Math.max(o.chevronOffset,o.chevronOffset+e-n)}let a;s&&(a=u.a.createElement("div",{style:i,className:"mx_ContextualMenu_chevron_"+n}));const c=_()({mx_ContextualMenu:!0,mx_ContextualMenu_left:!s&&t.left,mx_ContextualMenu_right:!s&&t.right,mx_ContextualMenu_top:!s&&t.top,mx_ContextualMenu_bottom:!s&&t.bottom,mx_ContextualMenu_withChevron_left:"left"===n,mx_ContextualMenu_withChevron_right:"right"===n,mx_ContextualMenu_withChevron_top:"top"===n,mx_ContextualMenu_withChevron_bottom:"bottom"===n}),l={};o.menuWidth&&(l.width=o.menuWidth),o.menuHeight&&(l.height=o.menuHeight),isNaN(Number(o.menuPaddingTop))||(l.paddingTop=o.menuPaddingTop),isNaN(Number(o.menuPaddingLeft))||(l.paddingLeft=o.menuPaddingLeft),isNaN(Number(o.menuPaddingBottom))||(l.paddingBottom=o.menuPaddingBottom),isNaN(Number(o.menuPaddingRight))||(l.paddingRight=o.menuPaddingRight);const d={};let h;return isNaN(Number(o.zIndex))||(l.zIndex=o.zIndex+1,d.zIndex=o.zIndex),e&&(h=u.a.createElement("div",{className:"mx_ContextualMenu_background",style:d,onClick:o.onFinished,onContextMenu:this.onContextMenu})),u.a.createElement("div",{className:"mx_ContextualMenu_wrapper",style:y(y({},t),d),onKeyDown:this._onKeyDown},u.a.createElement("div",{className:c,style:l,ref:this.collectContextMenuRect,role:this.props.managed?"menu":void 0},a,o.children),h)}render(){return h.a.createPortal(this.renderMenu(),S())}}c()(w,"propTypes",{top:m.a.number,bottom:m.a.number,left:m.a.number,right:m.a.number,menuWidth:m.a.number,menuHeight:m.a.number,chevronOffset:m.a.number,chevronFace:m.a.string,onFinished:m.a.func.isRequired,menuPaddingTop:m.a.number,menuPaddingRight:m.a.number,menuPaddingBottom:m.a.number,menuPaddingLeft:m.a.number,zIndex:m.a.number,hasBackground:m.a.bool,windowResize:m.a.func,managed:m.a.bool}),c()(w,"defaultProps",{hasBackground:!0,managed:!0});const T=e=>{let{label:t,isExpanded:n,children:o}=e,i=s()(e,["label","isExpanded","children"]);const a=v.getComponent("elements.AccessibleButton");return u.a.createElement(a,r()({},i,{title:t,"aria-label":t,"aria-haspopup":!0,"aria-expanded":n}),o)};T.propTypes=y(y({},b.a.propTypes),{},{label:m.a.string,isExpanded:m.a.bool.isRequired});const k=e=>{let{children:t,label:n}=e,o=s()(e,["children","label"]);const i=v.getComponent("elements.AccessibleButton");return u.a.createElement(i,r()({},o,{role:"menuitem",tabIndex:-1,"aria-label":n}),t)};k.propTypes=y(y({},b.a.propTypes),{},{label:m.a.string,className:m.a.string,onClick:m.a.func.isRequired});const x=e=>{let{children:t,label:n}=e,o=s()(e,["children","label"]);return u.a.createElement("div",r()({},o,{role:"group","aria-label":n}),t)};x.propTypes={label:m.a.string.isRequired,className:m.a.string};const O=e=>{let{children:t,label:n,active:o=!1,disabled:i=!1}=e,a=s()(e,["children","label","active","disabled"]);const c=v.getComponent("elements.AccessibleButton");return u.a.createElement(c,r()({},a,{role:"menuitemcheckbox","aria-checked":o,"aria-disabled":i,tabIndex:-1,"aria-label":n}),t)};O.propTypes=y(y({},b.a.propTypes),{},{label:m.a.string,active:m.a.bool.isRequired,disabled:m.a.bool,className:m.a.string,onClick:m.a.func.isRequired});const R=e=>{let{children:t,label:n,active:o=!1,disabled:i=!1}=e,a=s()(e,["children","label","active","disabled"]);const c=v.getComponent("elements.AccessibleButton");return u.a.createElement(c,r()({},a,{role:"menuitemradio","aria-checked":o,"aria-disabled":i,tabIndex:-1,"aria-label":n}),t)};R.propTypes=y(y({},b.a.propTypes),{},{label:m.a.string,active:m.a.bool.isRequired,disabled:m.a.bool,className:m.a.string,onClick:m.a.func.isRequired});const D=(e,t=12)=>{const n=e.right+window.pageXOffset+3;let o=e.top+e.height/2+window.pageYOffset;return o-=t+8,{left:n,top:o,chevronOffset:t}},I=(e,t="none")=>{const n={chevronFace:t},o=e.right+window.pageXOffset,r=e.bottom+window.pageYOffset,i=e.top+window.pageYOffset;return n.right=window.innerWidth-o,r{const e=Object(l.useRef)(null),[t,n]=Object(l.useState)(!1);return[t,e,()=>{n(!0)},()=>{n(!1)},n]};class F extends w{render(){return this.renderMenu(!1)}}function N(e,t){const n=function(...e){h.a.unmountComponentAtNode(S()),t&&t.onFinished&&t.onFinished.apply(null,e)},o=u.a.createElement(F,r()({},t,{onFinished:n,windowResize:n}),u.a.createElement(e,r()({},t,{onFinished:n})));return h.a.render(o,S()),{close:n}}}).call(this,n(318).setImmediate)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(33),r=n.n(o);class i extends r.a.Component{constructor(e){super(e),this._collectContainerRef=this._collectContainerRef.bind(this)}_collectContainerRef(e){e&&!this.containerRef&&(this.containerRef=e),this.props.wrappedRef&&this.props.wrappedRef(e)}getScrollTop(){return this.containerRef.scrollTop}render(){return r.a.createElement("div",{ref:this._collectContainerRef,style:this.props.style,className:["mx_AutoHideScrollbar",this.props.className].join(" "),onScroll:this.props.onScroll,onWheel:this.props.onWheel},this.props.children)}}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){var o=n(215);e.exports=function(e,t){if(null==e)return{};var n,r,i=o(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"d",(function(){return g})),n.d(t,"g",(function(){return _})),n.d(t,"f",(function(){return f})),n.d(t,"e",(function(){return v})),n.d(t,"c",(function(){return b})),n.d(t,"i",(function(){return E})),n.d(t,"j",(function(){return y})),n.d(t,"b",(function(){return S})),n.d(t,"h",(function(){return w}));var o=n(37),r=n(713),i=n.n(r),s=n(1),a=n(407),c=n(294),l=n(3),u=n.n(l);class d extends c.b{constructor(e){if(super(),u()(this,"_riotUrl",void 0),this._riotUrl=e,!this._riotUrl.startsWith("http:")&&!this._riotUrl.startsWith("https:"))throw new Error("Riot prefix URL does not appear to be an HTTP(S) URL")}forEvent(e,t,n){return`${this._riotUrl}/#/room/${e}/${t}${this.encodeServerCandidates(n)}`}forRoom(e,t){return`${this._riotUrl}/#/room/${e}${this.encodeServerCandidates(t)}`}forUser(e){return`${this._riotUrl}/#/user/${e}`}forGroup(e){return`${this._riotUrl}/#/group/${e}`}forEntity(e){if("!"===e[0]||"#"===e[0])return this.forRoom(e);if("@"===e[0])return this.forUser(e);if("+"===e[0])return this.forGroup(e);throw new Error("Unrecognized entity")}isPermalinkHost(e){const t=new URL(this._riotUrl);return e===(t.host||t.hostname)}encodeServerCandidates(e){return e&&0!==e.length?"?via="+e.map(e=>encodeURIComponent(e)).join("&via="):""}parsePermalink(e){if(!e||!e.startsWith(this._riotUrl))throw new Error("Does not appear to be a permalink");const t=e.substring((this._riotUrl+"/#/").length).split("/");if(t.length<2)throw new Error("URL is missing parts");const n=t[0],o=t[1];if("user"===n)return c.a.forUser(o);if("group"===n)return c.a.forGroup(o);if("room"===n){if(2===t.length)return c.a.forRoom(o,[]);const e=(t.length>2?t.slice(2).join("/"):"").split("?"),n=e[0],r=(e.length>1?e[1]:"").split("via=").filter(e=>!!e);return c.a.forEvent(o,n,r)}throw new Error("Unknown entity type in permalink")}}var h=n(295),p=n(45);class m{constructor(e,t=null){if(this._room=e,this._roomId=e?e.roomId:t,this._highestPlUserId=null,this._populationMap=null,this._bannedHostsRegexps=null,this._allowedHostsRegexps=null,this._serverCandidates=null,this._started=!1,!this._roomId)throw new Error("Failed to resolve a roomId for the permalink creator to use");this.onMembership=this.onMembership.bind(this),this.onRoomState=this.onRoomState.bind(this)}load(){this._room&&this._room.currentState?(this._updateAllowedServers(),this._updateHighestPlUser(),this._updatePopulationMap(),this._updateServerCandidates()):console.warn("Tried to load a permalink creator with no room state")}start(){this.load(),this._room.on("RoomMember.membership",this.onMembership),this._room.on("RoomState.events",this.onRoomState),this._started=!0}stop(){this._room.removeListener("RoomMember.membership",this.onMembership),this._room.removeListener("RoomState.events",this.onRoomState),this._started=!1}isStarted(){return this._started}forEvent(e){return C().forEvent(this._roomId,e,this._serverCandidates)}forRoom(){return C().forRoom(this._roomId,this._serverCandidates)}onRoomState(e){switch(e.getType()){case"m.room.server_acl":return this._updateAllowedServers(),this._updateHighestPlUser(),this._updatePopulationMap(),void this._updateServerCandidates();case"m.room.power_levels":return this._updateHighestPlUser(),void this._updateServerCandidates()}}onMembership(e,t,n){const o=t.userId,r=t.membership,i=T(o),s="join"!==n&&"join"===r;"join"===n&&"join"!==r?this._populationMap[i]--:s&&this._populationMap[i]++,this._updateHighestPlUser(),this._updateServerCandidates()}_updateHighestPlUser(){const e=this._room.currentState.getStateEvents("m.room.power_levels","");if(e){const t=e.getContent();if(t){const e=t.users;if(e){const t=Object.entries(e).filter(([e])=>{const t=this._room.getMember(e);if(!t||"join"!==t.membership)return!1;const n=T(e);return!O(n)&&!x(n,this._bannedHostsRegexps)&&x(n,this._allowedHostsRegexps)}).reduce((e,t)=>t[1]>e[1]?t:e,[null,0]),[n,o]=t;if(null!==n&&o>=50)return void(this._highestPlUserId=n)}}}this._highestPlUserId=null}_updateAllowedServers(){const e=[];let t=[new RegExp(".*")];if(this._room.currentState){const n=this._room.currentState.getStateEvents("m.room.server_acl","");if(n&&n.getContent()){const o=e=>new RegExp("^"+s.n(e,!1)+"$");(n.getContent().deny||[]).forEach(t=>e.push(o(t)));const r=n.getContent().allow||[];t=[],r.forEach(e=>t.push(o(e)))}}this._bannedHostsRegexps=e,this._allowedHostsRegexps=t}_updatePopulationMap(){const e={};for(const t of this._room.getJoinedMembers()){const n=T(t.userId);e[n]||(e[n]=0),e[n]++}this._populationMap=e}_updateServerCandidates(){let e=[];this._highestPlUserId&&e.push(T(this._highestPlUserId));const t=Object.keys(this._populationMap).sort((e,t)=>this._populationMap[t]-this._populationMap[e]).filter(t=>!e.includes(t)&&!O(t)&&!x(t,this._bannedHostsRegexps)&&x(t,this._allowedHostsRegexps)).slice(0,3-e.length);e=e.concat(t),this._serverCandidates=e}}function g(e){return C().forEntity(e)}function _(e){return C().forUser(e)}function f(e){if(!e)throw new Error("can't permalink a falsey roomId");if("!"!==e[0])return C().forRoom(e,[]);const t=o.a.get().getRoom(e);if(!t)return C().forRoom(e,[]);const n=new m(t);return n.load(),n.forRoom()}function v(e){return C().forGroup(e)}function b(e){return!!(new a.b).isPermalinkHost(e)||C().isPermalinkHost(e)}function E(e){return e?"#"===e[0]||"!"===e[0]?f(e):"@"===e[0]?_(e):"+"===e[0]?v(e):y(e):null}function y(e){if(!e.startsWith("http:")&&!e.startsWith("https:"))return e;const t=e.match(h.a.VECTOR_URL_PATTERN);if(t)return t[1];try{const t=w(e);if(t)if(t.roomIdOrAlias){const n=t.eventId?"/"+t.eventId:"";e=`#/room/${t.roomIdOrAlias}${n}`}else t.groupId?e="#/group/"+t.groupId:t.userId&&(e="#/user/"+t.userId)}catch(e){}return e}function S(e){try{let t=w(e);if(!t){const n=e.match(h.a.VECTOR_URL_PATTERN);if(n){const e=new d("http://localhost"),o=n[1].split("#").slice(1).join("#");t=e.parsePermalink("http://localhost/#"+o)}}if(!t)return null;if(t.userId)return t.userId;if(t.groupId)return t.groupId;if(t.roomIdOrAlias)return t.roomIdOrAlias}catch(e){}return null}function C(){const e=p.a.get().permalinkPrefix;return e&&e!==a.a?new d(e):new a.b}function w(e){const t=p.a.get().permalinkPrefix;return e.startsWith(a.a)?(new a.b).parsePermalink(e):t&&e.startsWith(t)?new d(t).parsePermalink(e):null}function T(e){return e.split(":").splice(1).join(":")}function k(e){return e?new URL("https://"+e).hostname:null}function x(e,t){if(!(e=k(e)))return!0;if(t.length>0&&!t[0].test)throw new Error(t[0]);return t.filter(t=>t.test(e)).length>0}function O(e){return!!(e=k(e))&&(e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),i()(e))}},function(e,t,n){"use strict";var o=n(514),r=n(515);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){r.isString(e)&&(e=b(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(l),d=["%","/","?",";","#"].concat(u),h=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(2);function b(e,t,n){if(e&&r.isObject(e)&&e instanceof i)return e;var o=new i;return o.parse(e,t,n),o}i.prototype.parse=function(e,t,n){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i127?F+="x":F+=A[N];if(!F.match(p)){var P=D.slice(0,x),L=D.slice(x+1),U=A.match(m);U&&(P.push(U[1]),L.unshift(U[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var B=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+B,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[S])for(x=0,I=u.length;x0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=e.search,n.query=e.query,r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=C.slice(-1)[0],k=(n.host||e.host||C.length>1)&&("."===T||".."===T)||""===T,x=0,O=C.length;O>=0;O--)"."===(T=C[O])?C.splice(O,1):".."===T?(C.splice(O,1),x++):x&&(C.splice(O,1),x--);if(!y&&!S)for(;x--;x)C.unshift("..");!y||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),k&&"/"!==C.join("/").substr(-1)&&C.push("");var R,D=""===C[0]||C[0]&&"/"===C[0].charAt(0);w&&(n.hostname=n.host=D?"":C.length?C.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(y=y||n.host&&C.length)&&!D&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"b",(function(){return l}));var o=n(34);function r(e){return e<1e3?e:e<1e4?(e/1e3).toFixed(1)+"K":e<1e5?(e/1e3).toFixed(0)+"K":e<1e7?(e/1e6).toFixed(1)+"M":e<1e8?(e/1e6).toFixed(0)+"M":(e/1e9).toFixed(1)+"B"}function i(e){return(new Intl.NumberFormat).format(e)}function s(e,t=2){if(0===e)return"0 Bytes";const n=t<0?0:t,o=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,o)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}function a(e){return e.match(/.{1,4}/g).join(" ")}function c(e){return"mx_Username_color"+(function(e){let t,n,o=0;if(0===e.length)return o;for(t=0;t0)return e=e.slice(0,t),Object(o.a)("%(items)s and %(count)s others",{items:e.join(", "),count:n});{const t=e.pop();return Object(o.a)("%(items)s and %(lastItem)s",{items:e.join(", "),lastItem:t})}}},function(e,t,n){"use strict";(function(e){var o=n(3),r=n.n(o),i=n(33),s=n.n(i),a=n(34),c=n(51),l=n(45),u=n(41),d=n(36);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t"):e.replace(m,"#/$1"):(console.warn(`Unexpected hash location "${e}"`),"#/")}(t)}const f={"App Platform":{id:1,expl:Object(a.b)("The platform you're on"),example:"Electron Platform"},"App Version":{id:2,expl:Object(a.b)("The version of Riot"),example:"15.0.0"},"User Type":{id:3,expl:Object(a.b)("Whether or not you're logged in (we don't record your username)"),example:"Logged In"},"Chosen Language":{id:4,expl:Object(a.b)("Your language of choice"),example:"en"},Instance:{id:5,expl:Object(a.b)("Which officially provided instance you are using, if any"),example:"app"},"RTE: Uses Richtext Mode":{id:6,expl:Object(a.b)("Whether or not you're using the Richtext mode of the Rich Text Editor"),example:"off"},"Homeserver URL":{id:7,expl:Object(a.b)("Your homeserver's URL"),example:"https://matrix.org"},"Touch Input":{id:8,expl:Object(a.b)("Whether you're using Riot on a device where touch is the primary input mechanism"),example:"false"},Breadcrumbs:{id:9,expl:Object(a.b)("Whether or not you're using the 'breadcrumbs' feature (avatars above the room list)"),example:"disabled"},"Installed PWA":{id:10,expl:Object(a.b)("Whether you're using Riot as an installed Progressive Web App"),example:"false"}};const v="mx_Riot_Analytics_uid";class b{constructor(){r()(this,"showDetailsModal",()=>{let e=[];e=this.disabled?Object.keys(f).map(e=>[e,Object(a.a)("e.g. %(exampleValue)s",{exampleValue:f[e].example})]):Object.values(this.visitVariables);const t=`${window.screen.width}x${window.screen.height}`,n=[{expl:Object(a.b)("Every page you use in the app"),value:Object(a.a)("e.g. ",{},{CurrentPageURL:_()})},{expl:Object(a.b)("Your user agent"),value:navigator.userAgent},{expl:Object(a.b)("Your device resolution"),value:t}],o=d.getComponent("dialogs.ErrorDialog");u.a.createTrackedDialog("Analytics Details","",o,{title:Object(a.a)("Analytics"),description:s.a.createElement("div",{className:"mx_AnalyticsModal"},s.a.createElement("div",null,Object(a.a)("The information being sent to us to help make Riot better includes:")),s.a.createElement("table",null,e.map(e=>s.a.createElement("tr",{key:e[0]},s.a.createElement("td",null,Object(a.a)(f[e[0]].expl)),void 0!==e[1]&&s.a.createElement("td",null,s.a.createElement("code",null,e[1])))),n.map((e,t)=>s.a.createElement("tr",{key:t},s.a.createElement("td",null,Object(a.a)(e.expl)),s.a.createElement("td",null,s.a.createElement("code",null,e.value))))),s.a.createElement("div",null,Object(a.a)("Where this page includes identifiable information, such as a room, user or group ID, that data is removed before being sent to the server.")))})}),this.baseUrl=null,this.siteId=null,this.visitVariables={},this.firstPage=!0,this._heartbeatIntervalID=null,this.creationTs=localStorage&&localStorage.getItem("mx_Riot_Analytics_cts"),!this.creationTs&&localStorage&&localStorage.setItem("mx_Riot_Analytics_cts",this.creationTs=(new Date).getTime()),this.lastVisitTs=localStorage&&localStorage.getItem("mx_Riot_Analytics_lvts"),this.visitCount=localStorage&&localStorage.getItem("mx_Riot_Analytics_vc")||0,localStorage&&localStorage.setItem("mx_Riot_Analytics_vc",parseInt(this.visitCount,10)+1)}get disabled(){return!this.baseUrl}async enable(){if(!this.disabled)return;const e=l.a.get();if(!(e&&e.piwik&&e.piwik.url&&e.piwik.siteId))return;this.baseUrl=new URL("piwik.php",e.piwik.url),this.baseUrl.searchParams.set("rec",1),this.baseUrl.searchParams.set("idsite",e.piwik.siteId),this.baseUrl.searchParams.set("apiv",1),this.baseUrl.searchParams.set("send_image",0),this.baseUrl.searchParams.set("_id",function(){try{let e=localStorage&&localStorage.getItem(v);return!e&&localStorage&&localStorage.setItem(v,e=[...Array(16)].map(()=>Math.random().toString(16)[2]).join("")),e}catch(e){return console.error("Analytics error: ",e),""}}()),this.baseUrl.searchParams.set("_idts",this.creationTs),this.baseUrl.searchParams.set("_idvc",parseInt(this.visitCount,10)+1),this.lastVisitTs&&this.baseUrl.searchParams.set("_viewts",this.lastVisitTs);const t=c.a.get();this._setVisitVariable("App Platform",t.getHumanReadableName());try{this._setVisitVariable("App Version",await t.getAppVersion())}catch(e){this._setVisitVariable("App Version","unknown")}this._setVisitVariable("Chosen Language",Object(a.d)()),"riot.im"===window.location.hostname&&this._setVisitVariable("Instance",window.location.pathname);let n="unknown";try{n=window.matchMedia("(display-mode: standalone)").matches}catch(e){}this._setVisitVariable("Installed PWA",n);let o="unknown";try{o=window.matchMedia("(pointer: coarse)").matches}catch(e){}this._setVisitVariable("Touch Input",o),this._heartbeatIntervalID=window.setInterval(this.ping.bind(this),3e4)}disable(){this.disabled||(this.trackEvent("Analytics","opt-out"),window.clearInterval(this._heartbeatIntervalID),this.baseUrl=null,this.visitVariables={},localStorage.removeItem(v),localStorage.removeItem("mx_Riot_Analytics_cts"),localStorage.removeItem("mx_Riot_Analytics_vc"),localStorage.removeItem("mx_Riot_Analytics_lvts"))}async _track(e){if(this.disabled)return;const t=new Date,n=p(p({},e),{},{url:_(),_cvar:JSON.stringify(this.visitVariables),res:`${window.screen.width}x${window.screen.height}`,rand:String(Math.random()).slice(2,8),h:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}),o=new URL(this.baseUrl);for(const e in n)o.searchParams.set(e,n[e]);try{await window.fetch(o,{method:"GET",mode:"no-cors",cache:"no-cache",redirect:"follow"})}catch(e){console.error("Analytics error: ",e)}}ping(){this._track({ping:1}),localStorage.setItem("mx_Riot_Analytics_lvts",(new Date).getTime())}trackPageChange(e){this.disabled||(this.firstPage?this.firstPage=!1:("number"!=typeof e&&console.warn("Analytics.trackPageChange: expected generationTimeMs to be a number"),this._track({gt_ms:e})))}trackEvent(e,t,n,o){this.disabled||this._track({e_c:e,e_a:t,e_n:n,e_v:o})}_setVisitVariable(e,t){this.disabled||(this.visitVariables[f[e].id]=[e,t])}setLoggedIn(e,t,n){if(this.disabled)return;const o=l.a.get();if(!o.piwik)return;const r=o.piwik.whitelistedHSUrls||[];var i;this._setVisitVariable("User Type",e?"Guest":"Logged In"),this._setVisitVariable("Homeserver URL",(i=t,r.includes(i)?i:""))}setBreadcrumbs(e){this.disabled||this._setVisitVariable("Breadcrumbs",e?"enabled":"disabled")}}e.mxAnalytics||(e.mxAnalytics=new b),t.a=e.mxAnalytics}).call(this,n(17))},function(e,t,n){"use strict";var o=n(3),r=n.n(o),i=n(49),s=n.n(i),a=n(179),c=n(106),l=n(37),u=n(38);function d(e){return e.chunk.map(e=>Object(a.c)(e))}function h(e){return e.chunk.map(e=>Object(a.d)(e))}let p=0;const m=[];async function g(e){p>=3&&await new Promise((e,t)=>{m.push(e)}),p++;try{return await e()}catch(e){throw e}finally{p--,function(){const e=m.shift();"function"==typeof e&&e()}()}}class _ extends s.a{constructor(){super(),r()(this,"STATE_KEY",{GroupMembers:"GroupMembers",GroupInvitedMembers:"GroupInvitedMembers",Summary:"Summary",GroupRooms:"GroupRooms"}),this._state={},this._state[this.STATE_KEY.Summary]={},this._state[this.STATE_KEY.GroupRooms]={},this._state[this.STATE_KEY.GroupMembers]={},this._state[this.STATE_KEY.GroupInvitedMembers]={},this._ready={},this._ready[this.STATE_KEY.Summary]={},this._ready[this.STATE_KEY.GroupRooms]={},this._ready[this.STATE_KEY.GroupMembers]={},this._ready[this.STATE_KEY.GroupInvitedMembers]={},this._fetchResourcePromise={[this.STATE_KEY.Summary]:{},[this.STATE_KEY.GroupRooms]:{},[this.STATE_KEY.GroupMembers]:{},[this.STATE_KEY.GroupInvitedMembers]:{}},this._resourceFetcher={[this.STATE_KEY.Summary]:e=>g(()=>l.a.get().getGroupSummary(e)),[this.STATE_KEY.GroupRooms]:e=>g(()=>l.a.get().getGroupRooms(e).then(h)),[this.STATE_KEY.GroupMembers]:e=>g(()=>l.a.get().getGroupUsers(e).then(d)),[this.STATE_KEY.GroupInvitedMembers]:e=>g(()=>l.a.get().getGroupInvitedUsers(e).then(d))}}_fetchResource(e,t){if(this._fetchResourcePromise[e][t])return;const n=this._resourceFetcher[e](t);return this._fetchResourcePromise[e][t]=n,n.then(n=>{this._state[e][t]=n,this._ready[e][t]=!0,this._notifyListeners()}).catch(n=>{e===this.STATE_KEY.GroupInvitedMembers&&403===n.httpStatus||(console.error(`Failed to get resource ${e} for ${t}`,n),this.emit("error",n,t,e))}).finally(()=>{delete this._fetchResourcePromise[e][t]}),n}_notifyListeners(){this.emit("update")}registerListener(e,t){return this.on("update",t),this.emit("update"),e&&(this._fetchResource(this.STATE_KEY.Summary,e),this._fetchResource(this.STATE_KEY.GroupRooms,e),this._fetchResource(this.STATE_KEY.GroupMembers,e),this._fetchResource(this.STATE_KEY.GroupInvitedMembers,e)),{unregister:()=>{this.unregisterListener(t)}}}unregisterListener(e){this.removeListener("update",e)}isStateReady(e,t){return this._ready[t][e]}getGroupIdsForRoomId(e){return Object.keys(this._state[this.STATE_KEY.GroupRooms]).filter(t=>(this._state[this.STATE_KEY.GroupRooms][t]||[]).some(t=>t.roomId===e))}getSummary(e){return this._state[this.STATE_KEY.Summary][e]||{}}getGroupRooms(e){return this._state[this.STATE_KEY.GroupRooms][e]||[]}getGroupMembers(e){return this._state[this.STATE_KEY.GroupMembers][e]||[]}getGroupInvitedMembers(e){return this._state[this.STATE_KEY.GroupInvitedMembers][e]||[]}getGroupPublicity(e){return(this._state[this.STATE_KEY.Summary][e]||{}).user?(this._state[this.STATE_KEY.Summary][e]||{}).user.is_publicised:null}isUserPrivileged(e){return(this._state[this.STATE_KEY.Summary][e]||{}).user?(this._state[this.STATE_KEY.Summary][e]||{}).user.is_privileged:null}refreshGroupRooms(e){return this._fetchResource(this.STATE_KEY.GroupRooms,e)}refreshGroupMembers(e){return this._fetchResource(this.STATE_KEY.GroupMembers,e)}addRoomToGroup(e,t,n){return l.a.get().addRoomToGroup(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e))}updateGroupRoomVisibility(e,t,n){return l.a.get().updateGroupRoomVisibility(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e))}removeRoomFromGroup(e,t){return l.a.get().removeRoomFromGroup(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e))}inviteUserToGroup(e,t){return l.a.get().inviteUserToGroup(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.GroupInvitedMembers,e))}acceptGroupInvite(e){return l.a.get().acceptGroupInvite(e).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupMembers,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupInvitedMembers,e))}joinGroup(e){return l.a.get().joinGroup(e).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupMembers,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupInvitedMembers,e))}leaveGroup(e){return u.a.dispatch({action:"deselect_tags",tag:e}),l.a.get().leaveGroup(e).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupMembers,e))}addRoomToGroupSummary(e,t,n){return l.a.get().addRoomToGroupSummary(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}addUserToGroupSummary(e,t,n){return l.a.get().addUserToGroupSummary(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}removeRoomFromGroupSummary(e,t){return l.a.get().removeRoomFromGroupSummary(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}removeUserFromGroupSummary(e,t){return l.a.get().removeUserFromGroupSummary(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}setGroupPublicity(e,t){return l.a.get().setGroupPublicity(e,t).then(()=>{c.a.invalidatePublicisedGroups(l.a.get().credentials.userId)}).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}}let f=null;f||(f=new _),t.a=f},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(37),r=n(289),i=n.n(r);n(119);class s{constructor(e){this.matrixClient=e,this.roomToUser=null,this._hasSentOutPatchDirectAccountDataPatch=!1,this._onAccountData=this._onAccountData.bind(this);const t=e.getAccountData("m.direct");this.mDirectEvent=t?t.getContent():{},this.userToRooms=null}static makeShared(){return s._sharedInstance=new s(o.a.get()),s._sharedInstance}static shared(){return s._sharedInstance}start(){this._populateRoomToUser(),this.matrixClient.on("accountData",this._onAccountData)}stop(){this.matrixClient.removeListener("accountData",this._onAccountData)}_onAccountData(e){"m.direct"==e.getType()&&(this.mDirectEvent=this.matrixClient.getAccountData("m.direct").getContent()||{},this.userToRooms=null,this.roomToUser=null)}_patchUpSelfDMs(e){const t=this.matrixClient.getUserId(),n=e[t];if(n){const o=n.map(e=>{const n=this.matrixClient.getRoom(e);if(n){const o=n.guessDMUserId();if(o&&o!==t)return{userId:o,roomId:e}}}).filter(e=>!!e);return!!o.length&&(e[t]=n.filter(e=>!o.some(t=>t.roomId===e)),o.forEach(({userId:t,roomId:n})=>{const o=e[t];o?(o.push(n),e[t]=i()(o)):e[t]=[n]}),!0)}}getDMRoomsForUserId(e){return this._getUserToRooms()[e]||[]}getDMRoomForIdentifiers(e){let t=this.getDMRoomsForUserId(e[0]);for(let n=1;no.includes(e))}return t.map(e=>o.a.get().getRoom(e)).filter(e=>e&&"join"===e.getMyMembership())[0]}getUserIdForRoomId(e){if(null==this.roomToUser&&this._populateRoomToUser(),void 0===this.roomToUser[e]){const t=this.matrixClient.getRoom(e);if(t)return t.getDMInviter()}return this.roomToUser[e]}getUniqueRoomsWithIndividuals(){return this.roomToUser?Object.keys(this.roomToUser).map(e=>({userId:this.getUserIdForRoomId(e),room:this.matrixClient.getRoom(e)})).filter(e=>e.userId&&e.room&&2===e.room.getInvitedAndJoinedMemberCount()).reduce((e,t)=>(e[t.userId]=t.room)&&e,{}):{}}_getUserToRooms(){if(!this.userToRooms){const e=this.mDirectEvent,t=e[this.matrixClient.getUserId()];if(t&&t.length){const t=this._patchUpSelfDMs(e);console.warn("Invalid m.direct account data detected (self-chats that shouldn't be), patching it up."),t&&!this._hasSentOutPatchDirectAccountDataPatch&&(this._hasSentOutPatchDirectAccountDataPatch=!0,this.matrixClient.setAccountData("m.direct",e))}this.userToRooms=e}return this.userToRooms}_populateRoomToUser(){this.roomToUser={};for(const e of Object.keys(this._getUserToRooms()))for(const t of this.userToRooms[e])this.roomToUser[t]=e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o=n(55),r=n.n(o),i=n(3),s=n.n(i),a=n(33),c=n.n(a),l=n(42),u=n.n(l),d=n(36),h=n(151);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function m(e){for(var t=1;t{this.validate({focused:!0})},200)),s()(this,"onFocus",e=>{this.setState({focused:!0}),this.validate({focused:!0}),this.props.onFocus&&this.props.onFocus(e)}),s()(this,"onChange",e=>{this.validateOnChange(),this.props.onChange&&this.props.onChange(e)}),s()(this,"onBlur",e=>{this.setState({focused:!1}),this.validate({focused:!1}),this.props.onBlur&&this.props.onBlur(e)}),this.state={valid:void 0,feedback:void 0,feedbackVisible:!1,focused:!1},this.id=this.props.id||"mx_Field_"+g++}focus(){this.input.focus()}async validate({focused:e,allowEmpty:t=!0}){if(!this.props.onValidate)return;const n=this.input?this.input.value:null,{valid:o,feedback:r}=await this.props.onValidate({value:n,focused:e,allowEmpty:t});this.state.focused&&r?this.setState({valid:o,feedback:r,feedbackVisible:!0}):this.setState({valid:o,feedbackVisible:!1})}render(){const e=this.props,{element:t,prefixComponent:n,postfixComponent:o,className:i,onValidate:s,children:a,tooltipContent:l,flagInvalid:h,tooltipClassName:p,list:g}=e,_=r()(e,["element","prefixComponent","postfixComponent","className","onValidate","children","tooltipContent","flagInvalid","tooltipClassName","list"]);_.placeholder=_.placeholder||_.label,_.id=this.id,_.onFocus=this.onFocus,_.onChange=this.onChange,_.onBlur=this.onBlur;const f=m(m({},_),{},{ref:e=>this.input=e,list:g}),v=c.a.createElement(this.props.element,f,a);let b=null;n&&(b=c.a.createElement("span",{className:"mx_Field_prefix"},n));let E=null;o&&(E=c.a.createElement("span",{className:"mx_Field_postfix"},o));const y=null!=h,S=u()("mx_Field","mx_Field_"+this.props.element,i,{mx_Field_labelAlwaysTopLeft:n,mx_Field_valid:s&&!0===this.state.valid,mx_Field_invalid:y?h:s&&!1===this.state.valid}),C=d.getComponent("elements.Tooltip");let w;if(l||this.state.feedback){const e=p||"";w=c.a.createElement(C,{tooltipClassName:"mx_Field_tooltip "+e,visible:this.state.feedbackVisible,label:l||this.state.feedback})}return c.a.createElement("div",{className:S},b,v,c.a.createElement("label",{htmlFor:this.id},this.props.label),E,w)}}s()(_,"defaultProps",{element:"input",type:"text"})},function(e,t,n){"use strict";var o=n(38),r=n(148),i=n(37),s=n(36),a=n(41),c=n(34),l=n(429);const u={joining:!1,joinError:null,roomId:null,initialEventId:null,isInitialEventHighlighted:!1,roomAlias:null,roomLoading:!1,roomLoadError:null,forwardingEvent:null,quotingEvent:null};class d extends r.Store{constructor(){super(o.a),this._state=u}_setState(e){let t=!1;for(const n of Object.keys(e))if(this._state[n]!==e[n]){t=!0;break}t&&(this._state=Object.assign(this._state,e),this.__emitChange())}__onDispatch(e){switch(e.action){case"view_room":this._viewRoom(e);break;case"view_my_groups":case"view_group":this._setState({roomId:null,roomAlias:null});break;case"view_room_error":this._viewRoomError(e);break;case"will_join":this._setState({joining:!0});break;case"cancel_join":this._setState({joining:!1});break;case"join_room":this._joinRoom(e);break;case"join_room_error":this._joinRoomError(e);break;case"join_room_ready":this._setState({shouldPeek:!1});break;case"on_client_not_viable":case"on_logged_out":this.reset();break;case"forward_event":this._setState({forwardingEvent:e.event});break;case"reply_to_event":e.event&&e.event.getRoomId()!==this._state.roomId?o.a.dispatch({action:"view_room",room_id:e.event.getRoomId(),replyingToEvent:e.event}):this._setState({replyingToEvent:e.event});break;case"open_room_settings":{const t=s.getComponent("dialogs.RoomSettingsDialog");a.a.createTrackedDialog("Room settings","",t,{roomId:e.room_id||this._state.roomId},null,!1,!0);break}}}async _viewRoom(e){if(e.room_id){const t={roomId:e.room_id,roomAlias:e.room_alias,initialEventId:e.event_id,isInitialEventHighlighted:e.highlighted,forwardingEvent:null,roomLoading:!1,roomLoadError:null,shouldPeek:void 0===e.should_peek||e.should_peek,joining:e.joining||!1,replyingToEvent:null,isEditingSettings:!1};e.replyingToEvent&&e.replyingToEvent.getRoomId()===e.room_id&&(t.replyingToEvent=e.replyingToEvent),this._state.forwardingEvent&&o.a.dispatch({action:"send_event",room_id:t.roomId,event:this._state.forwardingEvent}),this._setState(t),e.auto_join&&this._joinRoom(e)}else if(e.room_alias){let t=Object(l.a)(e.room_alias);if(!t){this._setState({roomId:null,initialEventId:null,initialEventPixelOffset:null,isInitialEventHighlighted:null,roomAlias:e.room_alias,roomLoading:!0,roomLoadError:null});try{const n=await i.a.get().getRoomIdForAlias(e.room_alias);Object(l.b)(e.room_alias,n.room_id),t=n.room_id}catch(t){return console.error("RVS failed to get room id for alias: ",t),void o.a.dispatch({action:"view_room_error",room_id:null,room_alias:e.room_alias,err:t})}}o.a.dispatch({action:"view_room",room_id:t,event_id:e.event_id,highlighted:e.highlighted,room_alias:e.room_alias,auto_join:e.auto_join,oob_data:e.oob_data})}}_viewRoomError(e){this._setState({roomId:e.room_id,roomAlias:e.room_alias,roomLoading:!1,roomLoadError:e.err})}_joinRoom(e){this._setState({joining:!0}),i.a.get().joinRoom(this._state.roomAlias||this._state.roomId,e.opts).then(()=>{o.a.dispatch({action:"join_room_ready"})},e=>{o.a.dispatch({action:"join_room_error",err:e});let t=e.message?e.message:JSON.stringify(e);console.log("Failed to join room:",t),"ConnectionError"===e.name&&(t=Object(c.a)("There was an error joining the room")),"M_INCOMPATIBLE_ROOM_VERSION"===e.errcode&&(t=React.createElement("div",null,Object(c.a)("Sorry, your homeserver is too old to participate in this room."),React.createElement("br",null),Object(c.a)("Please contact your homeserver administrator.")));const n=s.getComponent("dialogs.ErrorDialog");a.a.createTrackedDialog("Failed to join room","",n,{title:Object(c.a)("Failed to join room"),description:t})})}_joinRoomError(e){this._setState({joining:!1,joinError:e.err})}reset(){this._state=Object.assign({},u)}getRoomId(){return this._state.roomId}getInitialEventId(){return this._state.initialEventId}isInitialEventHighlighted(){return this._state.isInitialEventHighlighted}getRoomAlias(){return this._state.roomAlias}isRoomLoading(){return this._state.roomLoading}getRoomLoadError(){return this._state.roomLoadError}isJoining(){return this._state.joining}getJoinError(){return this._state.joinError}getForwardingEvent(){return this._state.forwardingEvent}getQuotingEvent(){return this._state.replyingToEvent}shouldPeek(){return this._state.shouldPeek}}let h=null;h||(h=new d),t.a=h},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(493)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closest=t.distance=t.patch=t.absolute=t.negate=t.isEqual=t.subtract=t.add=void 0;var o=i(n(212)),r=i(n(84));function i(e){return e&&e.__esModule?e:{default:e}}t.add=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},t.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},t.isEqual=function(e,t){return e.x===t.x&&e.y===t.y},t.negate=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},t.absolute=function(e){return{x:Math.abs(e.x),y:Math.abs(e.y)}},t.patch=function(e,t){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n={},(0,r.default)(n,e,t),(0,r.default)(n,"x"===e?"y":"x",o),n};var s=t.distance=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};t.closest=function(e,t){return Math.min.apply(Math,(0,o.default)(t.map((function(t){return s(e,t)}))))}},function(e,t,n){"use strict";n.r(t),function(e,o){n.d(t,"OLM_ALGORITHM",(function(){return c})),n.d(t,"MEGOLM_ALGORITHM",(function(){return l})),n.d(t,"MEGOLM_BACKUP_ALGORITHM",(function(){return u})),n.d(t,"encryptMessageForDevice",(function(){return d})),n.d(t,"getExistingOlmSessions",(function(){return h})),n.d(t,"ensureOlmSessionsForDevices",(function(){return p})),n.d(t,"verifySignature",(function(){return g})),n.d(t,"pkSign",(function(){return _})),n.d(t,"pkVerify",(function(){return f})),n.d(t,"encodeBase64",(function(){return v})),n.d(t,"encodeUnpaddedBase64",(function(){return b})),n.d(t,"decodeBase64",(function(){return E}));var r=n(0),i=n(1),s=n(251),a=n.n(s);const c="m.olm.v1.curve25519-aes-sha2",l="m.megolm.v1.aes-sha2",u="m.megolm_backup.v1.curve25519-aes-sha2";async function d(e,t,n,o,s,a,c){const l=a.getIdentityKey(),u=await o.getSessionIdForDevice(l);if(null===u)return;r.a.log("Using sessionid "+u+" for device "+s+":"+a.deviceId);const d={sender:t,sender_device:n,keys:{ed25519:o.deviceEd25519Key},recipient:s,recipient_keys:{ed25519:a.getFingerprint()}};i.i(d,c),e[l]=await o.encryptMessage(l,u,JSON.stringify(d))}async function h(e,t,n){const o={},r={},i=[];for(const[t,s]of Object.entries(n))for(const n of s){const s=n.deviceId,a=n.getIdentityKey();i.push((async()=>{const i=await e.getSessionIdForDevice(a,!0);null===i?(o[t]=o[t]||[],o[t].push(n)):(r[t]=r[t]||{},r[t][s]={device:n,sessionId:i})})())}return await Promise.all(i),[o,r]}async function p(e,t,n,o,i,s){"number"==typeof o&&(s=i,i=o,o=!1);const a=[],c={},l={};for(const[t,i]of Object.entries(n)){c[t]={};for(const n of i){const i=n.deviceId,s=n.getIdentityKey();if(s===e.deviceCurve25519Key){r.a.info("Attempted to start session with ourself! Ignoring"),c[t][i]={device:n,sessionId:null};continue}e._sessionsInProgress[s]||(e._sessionsInProgress[s]=new Promise((t,n)=>{l[s]={resolve:(...n)=>{delete e._sessionsInProgress[s],t(...n)},reject:(...t)=>{delete e._sessionsInProgress[s],n(...t)}}}));const u=await e.getSessionIdForDevice(s,l[s]);null!==u&&l[s]&&(delete e._sessionsInProgress[s],l[s].resolve(),delete l[s]),(null===u||o)&&(o?r.a.info("Forcing new Olm session for "+t+":"+i):r.a.info("Making new Olm session for "+t+":"+i),a.push([t,i])),c[t][i]={device:n,sessionId:u}}}if(0===a.length)return c;let u;try{u=await t.claimOneTimeKeys(a,"signed_curve25519",i)}catch(e){for(const e of Object.values(l))e.resolve();throw r.a.log("failed to claim one-time keys",e,a),e}s&&"failures"in u&&s.push(...Object.keys(u.failures));const d=u.one_time_keys||{},h=[];for(const[t,i]of Object.entries(n)){const n=d[t]||{};for(let s=0;s{l[d]&&l[d].resolve(e),c[t][u].sessionId=e},e=>{throw l[d]&&l[d].resolve(),e}));else{const e="No one-time keys (alg=signed_curve25519) for device "+t+":"+u;r.a.warn(e),l[d]&&l[d].resolve()}}}return await Promise.all(h),c}async function m(e,t,n,o){const i=o.deviceId;try{await g(e,t,n,i,o.getFingerprint())}catch(e){return r.a.error("Unable to verify signature on one-time key for device "+n+":"+i+":",e),null}let s;try{s=await e.createOutboundSession(o.getIdentityKey(),t.key)}catch(e){return r.a.error("Error starting olm session with device "+n+":"+i+": "+e),null}return r.a.log("Started new olm sessionid "+s+" for device "+n+":"+i),s}async function g(e,t,n,o,r){const i="ed25519:"+o,s=((t.signatures||{})[n]||{})[i];if(!s)throw Error("No signature");const c=Object.assign({},t);delete c.unsigned,delete c.signatures;const l=a.a.stringify(c);e.verifySignature(r,l,s)}function _(t,n,o,r){let i=!1;if(n instanceof Uint8Array){const t=new e.Olm.PkSigning;r=t.init_with_seed(n),n=t,i=!0}const s=t.signatures||{};delete t.signatures;const c=t.unsigned;t.unsigned&&delete t.unsigned;try{const e=s[o]||{};return s[o]=e,e["ed25519:"+r]=n.sign(a.a.stringify(t))}finally{t.signatures=s,c&&(t.unsigned=c),i&&n.free()}}function f(t,n,o){const r="ed25519:"+n;if(!(t.signatures&&t.signatures[o]&&t.signatures[o][r]))throw new Error("No signature");const i=t.signatures[o][r],s=new e.Olm.Utility,c=t.signatures;delete t.signatures;const l=t.unsigned;t.unsigned&&delete t.unsigned;try{s.ed25519_verify(n,a.a.stringify(t),i)}finally{t.signatures=c,l&&(t.unsigned=l),s.free()}}function v(e){return o.from(e).toString("base64")}function b(e){return v(e).replace(/=+$/g,"")}function E(e){return o.from(e,"base64")}}.call(this,n(17),n(78).Buffer)},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=void 0,r=[],i=void 0,s=!1,a=function(e,n){return t(e,r[n])},c=function(){for(var t=arguments.length,o=Array(t),c=0;ct===e||t===e.message)}static authComponentStateForError(e,t="login"){if(!e)return{serverIsAlive:!0,serverErrorIsFatal:!1,serverDeadError:null};let n=Object(c.a)("Cannot reach homeserver"),o=Object(c.a)("Ensure you have a stable internet connection, or get in touch with the server admin");p.isLivelinessError(e)||(n=Object(c.a)("Your Riot is misconfigured"),o=Object(c.a)("Ask your Riot admin to check your config for incorrect or duplicate entries.",{},{a:e=>s.a.createElement("a",{href:"https://github.com/vector-im/riot-web/blob/master/docs/config.md",target:"_blank",rel:"noreferrer noopener"},e)}));let r=!0;return(e.message?e.message:e)===a.a.ERROR_INVALID_IDENTITY_SERVER&&(r=!1,n=Object(c.a)("Cannot reach identity server"),o="register"===t?Object(c.a)("You can register, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin."):"reset_password"===t?Object(c.a)("You can reset your password, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin."):Object(c.a)("You can log in, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.")),{serverIsAlive:!1,serverErrorIsFatal:r,serverDeadError:s.a.createElement("div",null,s.a.createElement("strong",null,n),s.a.createElement("div",null,o))}}static async validateServerConfigWithStaticUrls(e,t,n=!1){if(!e)throw Object(c.h)(Object(c.b)("No homeserver URL provided"));const o={"m.homeserver":{base_url:e}};t&&(o["m.identity_server"]={base_url:t});const r=await a.a.fromDiscoveryConfig(o),i=new URL(e).hostname;return p.buildValidatedConfigFromDiscovery(i,r,n)}static async validateServerName(e){const t=await a.a.findClientConfig(e);return p.buildValidatedConfigFromDiscovery(e,t)}static buildValidatedConfigFromDiscovery(e,t,n=!1){if(!t||!t["m.homeserver"])throw console.error("Ended up in a state of not knowing which homeserver to connect to."),Object(c.h)(Object(c.b)("Unexpected error resolving homeserver configuration"));const o=t["m.homeserver"],r=t["m.identity_server"],i=u.a.get().validated_server_config;let s=i&&i.isUrl;if(r&&r.state===a.a.SUCCESS)s=r.base_url;else if(r&&r.state!==a.a.PROMPT){if(console.error("Error determining preferred identity server URL:",r),r.state===a.a.FAIL_ERROR){if(-1!==a.a.ALL_ERRORS.indexOf(r.error))throw Object(c.h)(r.error);throw Object(c.h)(Object(c.b)("Unexpected error resolving identity server configuration"))}o.error=a.a.ERROR_INVALID_IDENTITY_SERVER,r.base_url&&(s=r.base_url)}if(o.state!==a.a.SUCCESS&&(console.error("Error processing homeserver config:",o),!n||!p.isLivelinessError(o.error))){if(-1!==a.a.ALL_ERRORS.indexOf(o.error))throw Object(c.h)(o.error);throw Object(c.h)(Object(c.b)("Unexpected error resolving homeserver configuration"))}const d=o.base_url;let m=e||o.server_name;const g=new URL(d);if(m||(m=g.hostname),!m)throw console.error("Failed to parse homeserver name from homeserver URL"),Object(c.h)(Object(c.b)("Unexpected error resolving homeserver configuration"));return Object(l.a)(h,{hsUrl:d,hsName:m,hsNameIsDifferent:g.hostname!==m,isUrl:s,isDefault:!1,warning:o.error})}}},function(e,t,n){"use strict";n.d(t,"h",(function(){return D})),n.d(t,"g",(function(){return I})),n.d(t,"f",(function(){return A})),n.d(t,"c",(function(){return F})),n.d(t,"a",(function(){return B})),n.d(t,"e",(function(){return j})),n.d(t,"d",(function(){return G})),n.d(t,"b",(function(){return q}));var o=n(182),r=n(33),i=n.n(r),s=n(328),a=n.n(s),c=n(861),l=n(295),u=n(866),d=n.n(u),h=n(868),p=n.n(h),m=n(42),g=n.n(m),_=n(37),f=n(57),v=n.n(f),b=n(871),E=n.n(b),y=n(56),S=n(196);Object(l.a)(c);const C=/([\ud800-\udbff])([\udc00-\udfff])/,w=/([\u2100-\u2bff])/,T=new RegExp("‍| ","g"),k=new RegExp("\\s","g"),x=new RegExp(`^(${E.a.source})+$`,"i"),O=/^#[0-9a-fA-F]{6}$/,R=["http","https","ftp","mailto","magnet"];function D(e){const t=Object(S.e)(e);return t&&t.shortcodes?`:${t.shortcodes[0]}:`:""}function I(e){e=e.slice(1,e.length-1);const t=S.d.get(e);return t?t.unicode:null}function A(e){const t=a()(e,M);return i.a.createElement("div",{dangerouslySetInnerHTML:{__html:t},dir:"auto"})}function F(e){try{const t=v.a.parse(e);return!!t.protocol&&R.includes(t.protocol.slice(0,-1))}catch(e){return!1}}const N={a:function(e,t){if(t.href){t.target="_blank";const e=Object(y.j)(t.href);(e!==t.href||t.href.match(l.a.VECTOR_URL_PATTERN))&&(t.href=e,delete t.target)}return t.rel="noreferrer noopener",{tagName:e,attribs:t}},img:function(e,t){return t.src&&t.src.startsWith("mxc://")?(t.src=_.a.get().mxcUrlToHttp(t.src,t.width||800,t.height||600),{tagName:e,attribs:t}):{tagName:e,attribs:{}}},code:function(e,t){if(void 0!==t.class){const e=t.class.split(/\s/).filter((function(e){return e.startsWith("language-")}));t.class=e.join(" ")}return{tagName:e,attribs:t}},"*":function(e,t){delete t.style;const n={"data-mx-color":"color","data-mx-bg-color":"background-color"};let o="";return Object.keys(n).forEach(e=>{const r=n[e],i=t[e];i&&"string"==typeof i&&O.test(i)&&(o+=r+":"+i+";",delete t[e])}),o&&(t.style=o),{tagName:e,attribs:t}}},M={allowedTags:["font","del","h1","h2","h3","h4","h5","h6","blockquote","p","a","ul","ol","sup","sub","nl","li","b","i","u","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre","span","img"],allowedAttributes:{font:["color","data-mx-bg-color","data-mx-color","style"],span:["data-mx-bg-color","data-mx-color","data-mx-spoiler","style"],a:["href","name","target","rel"],img:["src","width","height","alt","title"],ol:["start"],code:["class"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:R,allowProtocolRelative:!1,transformTags:N},P=Object.assign({},M);P.transformTags={code:N.code,"*":N["*"]};class L{constructor(e,t){this.highlightClass=e,this.highlightLink=t}applyHighlights(e,t){let n,o=0,r=[];const i=t[0];for(;(n=e.toLowerCase().indexOf(i.toLowerCase(),o))>=0;){if(n>o){var s=e.substring(o,n);r=r.concat(this._applySubHighlights(s,t))}const a=n+i.length;r.push(this._processSnippet(e.substring(n,a),!0)),o=a}return o!==e.length&&(s=e.substring(o,void 0),r=r.concat(this._applySubHighlights(s,t))),r}_applySubHighlights(e,t){return t[1]?this.applyHighlights(e,t.slice(1)):[this._processSnippet(e,!1)]}}class U extends L{_processSnippet(e,t){if(!t)return e;let n=''+e+"";return this.highlightLink&&(n=''+n+""),n}}function B(e,t,n={}){const r="org.matrix.custom.html"===e.format&&e.formatted_body;let s,c,l,u=!1,d=M;n.forComposerQuote&&(d=P);try{if(t&&t.length>0){const e=new U("mx_EventTile_searchHighlight",n.highlightLink),o=t.map((function(e){return a()(e,d)}));d.textFilter=function(t){return e.applyHighlights(t,o).join("")}}let i="string"==typeof e.formatted_body?e.formatted_body:null;const p="string"==typeof e.body?e.body:null;n.stripReplyFallback&&i&&(i=o.a.stripHTMLReply(i)),s=n.stripReplyFallback?o.a.stripPlainReply(p):p,h=r?i:p,u=C.test(h)||w.test(h),r&&(l=!0,c=a()(i,d))}finally{delete d.textFilter}var h;if(n.returnString)return l?c:s;let p=!1;if(!n.disableBigEmoji&&u){let t=void 0!==s?s.trim():"";t=t.replace(k,""),t=t.replace(T,"");const n=x.exec(t);p=n&&n[0]&&n[0].length===t.length&&(s===c||void 0===e.formatted_body||!e.formatted_body.includes("http:")&&!e.formatted_body.includes("https:"))}const m=g()({mx_EventTile_body:!0,mx_EventTile_bigEmoji:p,"markdown-body":r&&!p});return l?i.a.createElement("span",{key:"body",ref:n.ref,className:m,dangerouslySetInnerHTML:{__html:c},dir:"auto"}):i.a.createElement("span",{key:"body",ref:n.ref,className:m,dir:"auto"},s)}function j(e,t=l.a.options){return d()(e,t)}function G(e,t=l.a.options){return a()(function(e,t=l.a.options){return p()(e,t)}(e,t),M)}function q(e){switch(e.nodeName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":case"PRE":case"BLOCKQUOTE":case"DIV":case"P":case"UL":case"OL":case"LI":case"HR":case"TABLE":case"THEAD":case"TBODY":case"TR":case"TH":case"TD":return!0;default:return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return p}));var o=n(34);function r(){return[Object(o.a)("Sun"),Object(o.a)("Mon"),Object(o.a)("Tue"),Object(o.a)("Wed"),Object(o.a)("Thu"),Object(o.a)("Fri"),Object(o.a)("Sat")]}function i(){return[Object(o.a)("Jan"),Object(o.a)("Feb"),Object(o.a)("Mar"),Object(o.a)("Apr"),Object(o.a)("May"),Object(o.a)("Jun"),Object(o.a)("Jul"),Object(o.a)("Aug"),Object(o.a)("Sep"),Object(o.a)("Oct"),Object(o.a)("Nov"),Object(o.a)("Dec")]}function s(e){return(e<10?"0":"")+e}function a(e,t=!1){let n=e.getHours()%12;const r=s(e.getMinutes()),i=e.getHours()>=12?Object(o.a)("PM"):Object(o.a)("AM");if(n=n||12,t){return`${n}:${r}:${s(e.getSeconds())}${i}`}return`${n}:${r}${i}`}function c(e,t=!1){const n=new Date,s=r(),a=i();return e.toDateString()===n.toDateString()?h(e,t):n.getTime()-e.getTime()<5184e5?Object(o.a)("%(weekDayName)s %(time)s",{weekDayName:s[e.getDay()],time:h(e,t)}):n.getFullYear()===e.getFullYear()?Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(time)s",{weekDayName:s[e.getDay()],monthName:a[e.getMonth()],day:e.getDate(),time:h(e,t)}):u(e,t)}function l(e){const t=r(),n=i();return Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s",{weekDayName:t[e.getDay()],monthName:n[e.getMonth()],day:e.getDate(),fullYear:e.getFullYear()})}function u(e,t=!1){const n=r(),s=i();return Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s",{weekDayName:n[e.getDay()],monthName:s[e.getMonth()],day:e.getDate(),fullYear:e.getFullYear(),time:d(e,t)})}function d(e,t=!1){return t?a(e,!0):s(e.getHours())+":"+s(e.getMinutes())+":"+s(e.getSeconds())}function h(e,t=!1){return t?a(e):s(e.getHours())+":"+s(e.getMinutes())}function p(e,t){return!(!t||!e)&&(Math.abs(e.getTime()-t.getTime())>864e5||e.getDay()!==t.getDay())}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return m}));var o=n(3),r=n.n(o),i=n(45),s=n(36),a=n(41),c=n(1194),l=n(77),u=n(37),d=n(44),h=n(40);const p=[c.b,c.d,c.c];class m{static sharedInstance(){return m._instance||(m._instance=new m),m._instance}constructor(){r()(this,"_managers",[]),r()(this,"_client",void 0),r()(this,"_wellknownRefreshTimerId",null),r()(this,"_primaryManager",void 0),r()(this,"_onAccountData",e=>{"m.widgets"===e.getType()&&this._compileManagers()}),this._compileManagers()}startWatching(){this.stopWatching(),this._client=u.a.get(),this._client.on("accountData",this._onAccountData),this._compileManagers(),setInterval(()=>this._setupHomeserverManagers(),288e5)}stopWatching(){this._client&&(this._client.removeListener("accountData",this._onAccountData),null!==this._wellknownRefreshTimerId&&clearInterval(this._wellknownRefreshTimerId))}_compileManagers(){this._managers=[],this._setupConfiguredManager(),this._setupHomeserverManagers(),this._setupAccountManagers()}_setupConfiguredManager(){const e=i.a.get().integrations_rest_url,t=i.a.get().integrations_ui_url;e&&t&&(this._managers.push(new c.a(c.c,e,t)),this._primaryManager=null)}async _setupHomeserverManagers(){if(u.a.get())try{console.log("Updating homeserver-configured integration managers...");const e=u.a.getHomeserverName(),t=await d.a.getRawClientConfig(e);if(t&&t["m.integrations"]){let e=t["m.integrations"].managers;Array.isArray(e)||(e=[]),console.log(`Homeserver has ${e.length} integration managers`),this._managers=this._managers.filter(e=>e.kind!==c.d);for(const t of e)t.api_url&&this._managers.push(new c.a(c.d,t.api_url,t.ui_url));this._primaryManager=null}else console.log("Homeserver has no integration managers")}catch(e){console.error(e)}}_setupAccountManagers(){if(!this._client||!this._client.getUserId())return;l.a.getIntegrationManagerWidgets().forEach(e=>{const t=e.content.data;if(!t)return;const n=e.content.url,o=t.api_url;if(!o||!n)return;const r=new c.a(c.b,o,n);r.id=e.id||e.state_key||"",this._managers.push(r)}),this._primaryManager=null}hasManager(){return this._managers.length>0}getOrderedManagers(){const e=[];for(const t of p){const n=this._managers.filter(e=>e.kind===t);n&&n.length&&(t===c.b&&n.sort((e,t)=>e.id.localeCompare(t.id)),e.push(...n))}return e}getPrimaryManager(){return this.hasManager()?(this._primaryManager||(this._primaryManager=this.getOrderedManagers()[0]),this._primaryManager):null}openNoManagerDialog(){const e=s.getComponent("dialogs.IntegrationsImpossibleDialog");a.a.createTrackedDialog("Integrations impossible","",e)}openAll(e=null,t=null,n=null){if(!h.b.getValue("integrationProvisioning"))return this.showDisabledDialog();if(0===this._managers.length)return this.openNoManagerDialog();const o=s.getComponent("views.dialogs.TabbedIntegrationManagerDialog");a.a.createTrackedDialog("Tabbed Integration Manager","",o,{room:e,screen:t,integrationId:n},"mx_TabbedIntegrationManagerDialog")}showDisabledDialog(){const e=s.getComponent("dialogs.IntegrationsDisabledDialog");a.a.createTrackedDialog("Integrations disabled","",e)}async overwriteManagerOnAccount(e){await l.a.removeIntegrationManagerWidgets(),await l.a.addIntegrationManagerWidget(e.name,e.uiUrl,e.apiUrl)}async tryDiscoverManager(e){if(console.log("Looking up integration manager via .well-known"),e.startsWith("http:")||e.startsWith("https:")){const t=t.parse(e);e=t.host}let t;try{const n=await fetch(`https://${e}/.well-known/matrix/integrations`);t=await n.json()}catch(e){return console.error(e),console.warn("Failed to locate integration manager"),null}if(!t||!t["m.integrations_widget"])return console.warn("Missing integrations widget on .well-known response"),null;const n=t["m.integrations_widget"];if(!n.url||!n.data||!n.data.api_url)return console.warn("Malformed .well-known response for integrations widget"),null;const o=new c.a(c.b,n.data.api_url,n.url);return console.log("Got an integration manager (untested)"),o}}r()(m,"_instance",void 0),e.mxIntegrationManagers=m}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(3),r=n.n(o),i=n(49),s=n.n(i);class a extends s.a{constructor(...e){super(...e),r()(this,"toasts",[]),r()(this,"countSeen",0)}static sharedInstance(){return window.mx_ToastStore||(window.mx_ToastStore=new a),window.mx_ToastStore}reset(){this.toasts=[],this.countSeen=0}addOrReplaceToast(e){const t=this.toasts.findIndex(t=>t.key===e.key);if(-1===t){let t=this.toasts.length;for(;t>0&&this.toasts[t-1].priorityt.key!==e),t!==this.toasts.length&&(0===this.toasts.length&&(this.countSeen=0),this.emit("update"))}getToasts(){return this.toasts}getCountSeen(){return this.countSeen}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var o=n(1);function r(e,t,n,r,i,s){if("string"!=typeof t||!t)return"";if(0!==t.indexOf("mxc://"))return s?t:"";let a=t.slice(6),c="/_matrix/media/r0/download/";const l={};n&&(l.width=Math.round(n)),r&&(l.height=Math.round(r)),i&&(l.method=i),o.t(l).length>0&&(c="/_matrix/media/r0/thumbnail/");const u=a.indexOf("#");let d="";return u>=0&&(d=a.substr(u),a=a.substr(0,u)),e+c+a+(0===o.t(l).length?"":"?"+o.e(l))+d}function i(e,t,n,r){if(!t)return null;n||(n=96),r||(r=96);const i={width:n,height:r};return e+o.f("/_matrix/media/unstable/identicon/$ident",{$ident:t})+(0===o.t(i).length?"":"?"+o.e(i))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return l}));var o=n(49),r=n(1),i=n(0);const s={NOT_SENT:"not_sent",ENCRYPTING:"encrypting",SENDING:"sending",QUEUED:"queued",SENT:"sent",CANCELLED:"cancelled"},a={};function c(e){return a[e]||(a[e]=e),a[e]}const l=function(e){["state_key","type","sender","room_id","membership"].forEach(t=>{e[t]&&(e[t]=c(e[t]))}),["membership","avatar_url","displayname"].forEach(t=>{e.content&&e.content[t]&&(e.content[t]=c(e.content[t]))}),["rel_type"].forEach(t=>{e.content&&e.content["m.relates_to"]&&e.content["m.relates_to"][t]&&(e.content["m.relates_to"][t]=c(e.content["m.relates_to"][t]))}),this.event=e||{},this.sender=null,this.target=null,this.status=null,this.error=null,this.forwardLooking=!0,this._pushActions=null,this._replacingEvent=null,this._localRedactionEvent=null,this._isCancelled=!1,this._clearEvent={},this._senderCurve25519Key=null,this._claimedEd25519Key=null,this._forwardingCurve25519KeyChain=[],this._decryptionPromise=null,this._retryDecryption=!1,this.verificationRequest=null};r.o(l,o.EventEmitter),r.i(l.prototype,{getId:function(){return this.event.event_id},getSender:function(){return this.event.sender||this.event.user_id},getType:function(){return this._clearEvent.type||this.event.type},getWireType:function(){return this.event.type},getRoomId:function(){return this.event.room_id},getTs:function(){return this.event.origin_server_ts},getDate:function(){return this.event.origin_server_ts?new Date(this.event.origin_server_ts):null},getOriginalContent:function(){return this._localRedactionEvent?{}:this._clearEvent.content||this.event.content||{}},getContent:function(){return this._localRedactionEvent?{}:this._replacingEvent?this._replacingEvent.getContent()["m.new_content"]||{}:this.getOriginalContent()},getWireContent:function(){return this.event.content||{}},getPrevContent:function(){return this.getUnsigned().prev_content||this.event.prev_content||{}},getDirectionalContent:function(){return this.forwardLooking?this.getContent():this.getPrevContent()},getAge:function(){return this.getUnsigned().age||this.event.age},getLocalAge:function(){return Date.now()-this.getTs()},getStateKey:function(){return this.event.state_key},isState:function(){return void 0!==this.event.state_key},makeEncrypted:function(e,t,n,o){this._clearEvent={type:this.event.type,content:this.event.content},this.event.type=e,this.event.content=t,this._senderCurve25519Key=n,this._claimedEd25519Key=o},isBeingDecrypted:function(){return null!=this._decryptionPromise},isDecryptionFailure:function(){return this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"===this._clearEvent.content.msgtype},attemptDecryption:async function(e,t){if(!this.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");if(this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"!==this._clearEvent.content.msgtype)throw new Error("Attempt to decrypt event which has already been decrypted");return this._decryptionPromise?(i.a.log(`Event ${this.getId()} already being decrypted; queueing a retry`),this._retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this._decryptionLoop(e,t),this._decryptionPromise)},cancelAndResendKeyRequest:function(e,t){const n=this.getWireContent();return e.requestRoomKey({algorithm:n.algorithm,room_id:this.getRoomId(),session_id:n.session_id,sender_key:n.sender_key},this.getKeyRequestRecipients(t),!0)},getKeyRequestRecipients:function(e){const t=this.getWireContent(),n=[{userId:e,deviceId:"*"}],o=this.getSender();return o!==e&&n.push({userId:o,deviceId:t.device_id}),n},_decryptionLoop:async function(e,t){for(await Promise.resolve();;){let n,o;this._retryDecryption=!1;try{e?(n=await e.decryptEvent(this),t&&i.a.info(`Decrypted event on retry (id=${this.getId()})`)):n=this._badEncryptedMessage("Encryption not enabled")}catch(e){if("DecryptionError"!==e.name){const n=t?"re":"";return i.a.error(`Error ${n}decrypting event (id=${this.getId()}): ${e.stack||e}`),this._decryptionPromise=null,void(this._retryDecryption=!1)}if(o=e,this._retryDecryption){i.a.log(`Got error decrypting event (id=${this.getId()}: `+e+"), but retrying");continue}i.a.warn(`Error decrypting event (id=${this.getId()}): ${e.detailedString}`),n=this._badEncryptedMessage(e.message)}return this._decryptionPromise=null,this._retryDecryption=!1,this._setClearData(n),this.setPushActions(null),void this.emit("Event.decrypted",this,o)}},_badEncryptedMessage:function(e){return{clearEvent:{type:"m.room.message",content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: "+e+" **"}}}},_setClearData:function(e){this._clearEvent=e.clearEvent,this._senderCurve25519Key=e.senderCurve25519Key||null,this._claimedEd25519Key=e.claimedEd25519Key||null,this._forwardingCurve25519KeyChain=e.forwardingCurve25519KeyChain||[]},getClearContent:function(){const e=this._clearEvent;return e&&e.content?e.content:null},isEncrypted:function(){return"m.room.encrypted"===this.event.type},getSenderKey:function(){return this._senderCurve25519Key},getKeysClaimed:function(){return{ed25519:this._claimedEd25519Key}},getClaimedEd25519Key:function(){return this._claimedEd25519Key},getForwardingCurve25519KeyChain:function(){return this._forwardingCurve25519KeyChain},getUnsigned:function(){return this.event.unsigned||{}},unmarkLocallyRedacted:function(){const e=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=null),!!e},markLocallyRedacted:function(e){this._localRedactionEvent||(this.emit("Event.beforeRedaction",this,e),this._localRedactionEvent=e,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event)},makeRedacted:function(e){if(!e.event)throw new Error("invalid redaction_event in makeRedacted");let t;for(t in this._localRedactionEvent=null,this.emit("Event.beforeRedaction",this,e),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event,this.event)this.event.hasOwnProperty(t)&&(u[t]||delete this.event[t]);const n=d[this.getType()]||{},o=this.getContent();for(t in o)o.hasOwnProperty(t)&&(n[t]||delete o[t])},isRedacted:function(){return Boolean(this.getUnsigned().redacted_because)},isRedaction:function(){return"m.room.redaction"===this.getType()},getPushActions:function(){return this._pushActions},setPushActions:function(e){this._pushActions=e},handleRemoteEcho:function(e){const t=this.getUnsigned(),n=this.getId();this.event=e,t.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=t.redacted_because),this.setStatus(null),this.getId()!==n&&this.emit("Event.localEventIdReplaced",this)},isSending(){return!!this.status},setStatus(e){this.status=e,this.emit("Event.status",this,e)},replaceLocalEventId(e){this.event.event_id=e,this.emit("Event.localEventIdReplaced",this)},isRelation(e){const t=this.getWireContent(),n=t&&t["m.relates_to"];return n&&n.rel_type&&n.event_id&&(e&&n.rel_type===e||!e)},getRelation(){return this.isRelation()?this.getWireContent()["m.relates_to"]:null},makeReplaced(e){this.isRedacted()&&e||this._replacingEvent!==e&&(this._replacingEvent=e,this.emit("Event.replaced",this))},getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status},getServerAggregatedRelation(e){const t=this.getUnsigned()["m.relations"];if(t)return t[e]},replacingEventId(){const e=this.getServerAggregatedRelation("m.replace");return e?e.event_id:this._replacingEvent?this._replacingEvent.getId():void 0},replacingEvent(){return this._replacingEvent},replacingEventDate(){const e=this.getServerAggregatedRelation("m.replace");if(e){const t=e.origin_server_ts;if(Number.isFinite(t))return new Date(t)}else if(this._replacingEvent)return this._replacingEvent.getDate()},localRedactionEvent(){return this._localRedactionEvent},getAssociatedId(){const e=this.getRelation();return e?e.event_id:this.isRedaction()?this.event.redacts:void 0},hasAssocation(){return!!this.getAssociatedId()},updateAssociatedId(e){const t=this.getRelation();t?t.event_id=e:this.isRedaction()&&(this.event.redacts=e)},flagCancelled(e=!0){this._isCancelled=e},isCancelled(){return this._isCancelled},toJSON(){const e={type:this.getType(),sender:this.getSender(),content:this.getContent(),event_id:this.getId(),origin_server_ts:this.getTs(),unsigned:this.getUnsigned(),room_id:this.getRoomId()};return this.isRedaction()&&(e.redacts=this.event.redacts),this.isEncrypted()?{decrypted:e,encrypted:this.event}:e},setVerificationRequest:function(e){this.verificationRequest=e}});const u=["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"].reduce((function(e,t){return e[t]=1,e}),{}),d={"m.room.member":{membership:1},"m.room.create":{creator:1},"m.room.join_rules":{join_rule:1},"m.room.power_levels":{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1},"m.room.aliases":{aliases:1}}},function(e,t,n){"use strict";function o(e,t){return new Promise(n=>{setTimeout(n,e,t)})}async function r(e,t,n){const o=new Promise(o=>{const r=setTimeout(o,n,t);e.then(()=>{clearTimeout(r)})});return Promise.race([e,o])}function i(){let e,t;const n=new Promise((n,o)=>{e=n,t=o});return{resolve:e,reject:t,promise:n}}function s(e){return Promise.allSettled?Promise.allSettled(e):Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))}n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(37),r=n(45),i=n(38),s=n(57),a=n(224),c=n(40),l=n(150),u=n(72),d=n(5),h=(n(202),n(107));class p{static canUserModifyWidgets(e){if(!e)return console.warn("No room ID specified"),!1;const t=o.a.get();if(!t)return console.warn("User must be be logged in"),!1;const n=t.getRoom(e);if(!n)return console.warn(`Room ID ${e} is not recognised`),!1;const r=t.credentials.userId;return r?"join"!==n.getMyMembership()?(console.warn(`User ${r} is not in room ${e}`),!1):n.currentState.maySendStateEvent("im.vector.modular.widgets",r):(console.warn("Failed to get user ID"),!1)}static isScalarUrl(e){if(!e)return console.error("Scalar URL check failed. No URL specified"),!1;const t=s.parse(e);let n=r.a.get().integrations_widgets_urls;if(!n||0===n.length){const e=u.a.sharedInstance().getPrimaryManager();n=e?[e.apiUrl]:[]}for(let e=0;e{function i(n){return!(!n||!n.getContent())&&(t?void 0!==n.getContent()[e]:void 0===n.getContent()[e])}if(i(o.a.get().getAccountData("m.widgets")))return void n();function s(e){i(o.a.get().getAccountData("m.widgets"))&&(o.a.get().removeListener("accountData",s),clearTimeout(a),n())}const a=setTimeout(()=>{o.a.get().removeListener("accountData",s),r(new Error("Timed out waiting for widget ID "+e+" to appear"))},2e4);o.a.get().on("accountData",s)})}static waitForRoomWidget(e,t,n){return new Promise((r,i)=>{function s(t){const o=t.some(t=>t.getContent()&&t.getContent().id===e);return n?o:!o}const a=o.a.get().getRoom(t);if(s(a.currentState.getStateEvents("im.vector.modular.widgets")))return void r();function c(e){if(e.getRoomId()!==t)return;s(a.currentState.getStateEvents("im.vector.modular.widgets"))&&(o.a.get().removeListener("RoomState.events",c),clearTimeout(l),r())}const l=setTimeout(()=>{o.a.get().removeListener("RoomState.events",c),i(new Error("Timed out waiting for widget ID "+e+" to appear"))},2e4);o.a.get().on("RoomState.events",c)})}static setUserWidget(e,t,n,r,s){const a={type:t.preferred,url:n,name:r,data:s},c=o.a.get(),l=JSON.parse(JSON.stringify(p.getUserWidgets()));try{delete l[e]}catch(e){console.error("$widgetId is non-configurable")}const u=Boolean(n);return u&&(l[e]={content:a,sender:c.getUserId(),state_key:e,type:"m.widget",id:e}),c.setAccountData("m.widgets",l).then(()=>p.waitForUserWidget(e,u)).then(()=>{i.a.dispatch({action:"user_widget_updated"})})}static setRoomWidget(e,t,n,r,i,s){let c;const l=Boolean(r);c=l?{type:n.legacy,url:r,name:i,data:s}:{},a.a.setRoomWidgetEcho(e,t,c);return o.a.get().sendStateEvent(e,"im.vector.modular.widgets",c,t).then(()=>p.waitForRoomWidget(t,e,l)).finally(()=>{a.a.removeRoomWidgetEcho(e,t)})}static getRoomWidgets(e){const t=e.currentState.getStateEvents("im.vector.modular.widgets");return t?t.filter(e=>e.getContent().type&&e.getContent().url):[]}static getUserWidgets(){const e=o.a.get();if(!e)throw new Error("User not logged in");const t=e.getAccountData("m.widgets");return t&&t.getContent()?t.getContent():{}}static getUserWidgetsArray(){return Object.values(p.getUserWidgets())}static getStickerpickerWidgets(){return p.getUserWidgetsArray().filter(e=>e.content&&"m.stickerpicker"===e.content.type)}static getIntegrationManagerWidgets(){return p.getUserWidgetsArray().filter(e=>e.content&&"m.integration_manager"===e.content.type)}static getRoomWidgetsOfType(e,t){return(p.getRoomWidgets(e)||[]).filter(e=>{const n=e.getContent();return n.url&&t.matches(n.type)})}static removeIntegrationManagerWidgets(){const e=o.a.get();if(!e)throw new Error("User not logged in");const t=e.getAccountData("m.widgets");if(!t)return;const n=t.getContent()||{};return Object.entries(n).forEach(([e,t])=>{t.content&&"m.integration_manager"===t.content.type&&delete n[e]}),e.setAccountData("m.widgets",n)}static addIntegrationManagerWidget(e,t,n){return p.setUserWidget("integration_manager_"+(new Date).getTime(),h.a.INTEGRATION_MANAGER,t,"Integration Manager: "+e,{api_url:n})}static removeStickerpickerWidgets(){const e=o.a.get();if(!e)throw new Error("User not logged in");const t=e.getAccountData("m.widgets");if(!t)return;const n=t.getContent()||{};return Object.entries(n).forEach(([e,t])=>{t.content&&"m.stickerpicker"===t.content.type&&delete n[e]}),e.setAccountData("m.widgets",n)}static makeAppConfig(e,t,n,o,r){if(!n)throw new Error("Widgets must be created by someone - provide a senderUserId");return t.creatorUserId=n,t.id=e,t.eventId=r,t.name=t.name||t.type,t}static getCapWhitelistForAppTypeInRoomId(e,t){const n=c.b.getValue("enableWidgetScreenshots",t)?[d.a.Screenshot]:[];return h.a.JITSI.matches(e)&&n.push(d.a.AlwaysOnScreen),n}static getWidgetSecurityKey(e,t,n){let o=l.a.getRoomId(e);if(n){const n=p.getUserWidgetsArray().find(n=>n.id===e&&n.content&&n.content.url===t);if(!n)throw new Error("No matching user widget to form security key");o=n.sender}if(!o)throw new Error("Failed to locate where the widget resides");return encodeURIComponent(`${o}::${t}`)}static getLocalJitsiWrapperUrl(e={}){const t=["conferenceDomain=$domain","conferenceId=$conferenceId","isAudioOnly=$isAudioOnly","displayName=$matrix_display_name","avatarUrl=$matrix_avatar_url","userId=$matrix_user_id"].join("&");let n=window.location;"https:"===window.location.protocol||e.forLocalRender||(n="https://riot.im/app/");return new URL("jitsi.html#"+t,n).href}}},function(e,t,n){"use strict";(function(e){var o=n(521),r=n(522),i=n(523);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(o)return j(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,n){var o=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return x(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function _(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}function f(e,t,n,o,r){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=c.from(t,o)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,o,r);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,o,r){var i,s=1,a=e.length,c=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){var u=-1;for(i=n;ia&&(n=a-c),i=n;i>=0;i--){for(var d=!0,h=0;hr&&(o=r):o=r;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");o>i/2&&(o=i/2);for(var s=0;s>8,r=n%256,i.push(r),i.push(o);return i}(t,e.length-n),e,n,o)}function T(e,t,n){return 0===t&&n===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var o=[],r=t;r239?4:l>223?3:l>191?2:1;if(r+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:128==(192&(i=e[r+1]))&&(c=(31&l)<<6|63&i)>127&&(u=c);break;case 3:i=e[r+1],s=e[r+2],128==(192&i)&&128==(192&s)&&(c=(15&l)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[r+1],s=e[r+2],a=e[r+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,d=1):u>65535&&(u-=65536,o.push(u>>>10&1023|55296),u=56320|1023&u),o.push(u),r+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",o=0;for(;o0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,o,r){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),t<0||n>e.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&t>=n)return 0;if(o>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(r>>>=0)-(o>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),l=this.slice(o,r),u=e.slice(t,n),d=0;dr)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function x(e,t,n){var o="";n=Math.min(e.length,n);for(var r=t;ro)&&(n=o);for(var r="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,o,r,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function F(e,t,n,o){t<0&&(t=65535+t+1);for(var r=0,i=Math.min(e.length-n,2);r>>8*(o?r:1-r)}function N(e,t,n,o){t<0&&(t=4294967295+t+1);for(var r=0,i=Math.min(e.length-n,4);r>>8*(o?r:3-r)&255}function M(e,t,n,o,r,i){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,o,i){return i||M(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function L(e,t,n,o,i){return i||M(e,0,n,8),r.write(e,t,n,o,52,8),n+8}c.prototype.slice=function(e,t){var n,o=this.length;if((e=~~e)<0?(e+=o)<0&&(e=0):e>o&&(e=o),(t=void 0===t?o:~~t)<0?(t+=o)<0&&(t=0):t>o&&(t=o),t0&&(r*=256);)o+=this[e+--t]*r;return o},c.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var o=this[e],r=1,i=0;++i=(r*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var o=t,r=1,i=this[e+--o];o>0&&(r*=256);)i+=this[e+--o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,o){(e=+e,t|=0,n|=0,o)||A(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+r]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,o){if(e=+e,t|=0,!o){var r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}var i=0,s=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,o){if(e=+e,t|=0,!o){var r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):F(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):F(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,o){if(n||(n=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return o.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,o){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}}).call(this,n(17))},function(e,t,n){var o=n(261)("wks"),r=n(210),i=n(95).Symbol,s="function"==typeof i;(e.exports=function(e){return o[e]||(o[e]=s&&i[e]||(s?i:r)("Symbol."+e))}).store=o},function(e,t,n){var o=n(380);function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var a=i?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(n,s,a):n[s]=e[s]}return n.default=e,t&&t.set(e,n),n}},function(e,t,n){"use strict";var o=n(33),r=n.n(o),i=n(413);t.a=({description:e,acceptLabel:t,rejectLabel:n,onAccept:o,onReject:s})=>r.a.createElement("div",null,r.a.createElement("div",{className:"mx_Toast_description"},e),r.a.createElement("div",{className:"mx_Toast_buttons","aria-live":"off"},s&&n&&r.a.createElement(i.a,{label:n,kind:"danger",onClick:s}),r.a.createElement(i.a,{label:t,onClick:o})))},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));const o=Object.freeze({RoomMemberList:"RoomMemberList",FilePanel:"FilePanel",NotificationPanel:"NotificationPanel",RoomMemberInfo:"RoomMemberInfo",EncryptionPanel:"EncryptionPanel",Room3pidMemberInfo:"Room3pidMemberInfo",GroupMemberList:"GroupMemberList",GroupRoomList:"GroupRoomList",GroupRoomInfo:"GroupRoomInfo",GroupMemberInfo:"GroupMemberInfo"}),r=[o.NotificationPanel,o.FilePanel,o.RoomMemberList,o.GroupMemberList,o.GroupRoomList]},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(354),i=(o=r)&&o.__esModule?o:{default:o};t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var o=n(370),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();e.exports=i},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"n",(function(){return d})),n.d(t,"m",(function(){return h})),n.d(t,"h",(function(){return p})),n.d(t,"g",(function(){return m})),n.d(t,"i",(function(){return g})),n.d(t,"j",(function(){return _})),n.d(t,"l",(function(){return f})),n.d(t,"k",(function(){return v}));var o=n(37),r=n(132);const i="all_messages_loud",s="all_messages",a="mentions_only",c="mute",l=[s,i],u=[...l,a];function d(e){return l.includes(e)}function h(e){return u.includes(e)}function p(e){return e.reduce((e,t,n)=>{const r=_(t.roomId),i=t.getUnreadNotificationCount("highlight")>0,s=t.getUnreadNotificationCount()>0&&d(r),a=i&&h(r),c=t.hasMembershipState(o.a.get().credentials.userId,"invite");return(s||a||c)&&(e.count++,i&&(e.highlight=!0)),e},{count:0,highlight:!1})}function m(e){return e.reduce((e,t,n)=>{const o=_(t.roomId),r=t.getUnreadNotificationCount("highlight")>0,i=t.getUnreadNotificationCount(),s=i>0&&d(o),a=r&&h(o);return(s||a)&&(e.count+=i,r&&(e.highlight=!0)),e},{count:0,highlight:!1})}function g(e){const t=_(e.roomId),n=e.getUnreadNotificationCount("highlight")>0,o=e.getUnreadNotificationCount()>0&&d(t),r=n&&h(t);return o||r}function _(e){if(o.a.get().isGuest())return s;if(b(e))return c;let t=null;try{t=o.a.get().getRoomPushRule("global",e)}catch(e){return null}if(!t||!t.enabled)return s;if(y(t))return a;return r.a.actionListToActionsObject(t.actions).tweaks.sound?i:null}function f(e,t){return t===c?function(e){const t=o.a.get(),n=[],r=t.getRoomPushRule("global",e);r&&n.push(t.deletePushRule("global","room",r.rule_id));return n.push(t.addPushRule("global","override",e,{conditions:[{kind:"event_match",key:"room_id",pattern:e}],actions:["dont_notify"]})),Promise.all(n)}(e):function(e,t){const n=o.a.get(),r=[],i=b(e);i&&r.push(n.deletePushRule("global","override",i.rule_id));if("all_messages"===t){const t=n.getRoomPushRule("global",e);t&&r.push(n.deletePushRule("global","room",t.rule_id))}else"mentions_only"===t?(r.push(n.addPushRule("global","room",e,{actions:["dont_notify"]})),r.push(n.setPushRuleEnabled("global","room",e,!0))):(r.push(n.addPushRule("global","room",e,{actions:["notify",{set_tweak:"sound",value:"default"}]})),r.push(n.setPushRuleEnabled("global","room",e,!0)));return Promise.all(r)}(e,t)}function v(e,t=null){let n=e.getUnreadNotificationCount(t);const r=e.currentState.getStateEvents("m.room.create","");if(r&&r.getContent().predecessor){const e=r.getContent().predecessor.room_id,t=o.a.get().getRoom(e);t&&(n+=t.getUnreadNotificationCount("highlight"))}return n}function b(e){if(!o.a.get().pushRules||!o.a.get().pushRules.global||!o.a.get().pushRules.global.override)return null;for(const t of o.a.get().pushRules.global.override)if(E(e,t)&&y(t)&&t.enabled)return t;return null}function E(e,t){if(1!==t.conditions.length)return!1;const n=t.conditions[0];return"event_match"===n.kind&&"room_id"===n.key&&n.pattern===e}function y(e){return 1===e.actions.length&&"dont_notify"===e.actions[0]}},function(e,t,n){"use strict";(function(e){var o=n(37),r=n(51),i=n(41),s=n(36),a=n(34),c=n(44),l=n(38),u=n(296),d=n(77),h=n(224),p=n(40),m=n(716),g=n(298),_=n(107);e.mxCalls={};const f=e.mxCalls;let v=null;const b={};function E(e){const t=document.getElementById(e);if(t){const n=async()=>{try{await t.play()}catch(e){console.log("Unable to play audio clip",e)}};b[e]?b[e]=b[e].then(()=>(t.load(),n())):b[e]=n()}}function y(e){const t=document.getElementById(e);t&&(b[e]?b[e]=b[e].then(()=>t.pause()):b[e]=t.pause())}function S(e){e.on("error",(function(t){if(console.error("Call error:",t),"unknown_devices"===t.code){const t=s.getComponent("dialogs.QuestionDialog");i.a.createTrackedDialog("Call Failed","",t,{title:Object(a.a)("Call Failed"),description:Object(a.a)("There are unknown sessions in this room: if you proceed without verifying them, it will be possible for someone to eavesdrop on your call."),button:Object(a.a)("Review Sessions"),onFinished:function(t){if(t){const t=o.a.get().getRoom(e.roomId);Object(u.c)(o.a.get(),t,()=>{!function(e){"outbound"===e.direction?l.a.dispatch({action:"place_call",room_id:e.roomId,type:e.type}):e.answer()}(e)},"outbound"===e.direction?Object(a.a)("Call Anyway"):Object(a.a)("Answer Anyway"),"outbound"===e.direction?Object(a.a)("Call"):Object(a.a)("Answer"))}}})}else{if(0===o.a.get().getTurnServers().length&&null===p.b.getValue("fallbackICEServerAllowed"))return void function(){const e=o.a.get(),t=s.getComponent("dialogs.QuestionDialog"),n=e=>React.createElement("code",null,e);i.a.createTrackedDialog("No TURN servers","",t,{title:Object(a.a)("Call failed due to misconfigured server"),description:React.createElement("div",null,React.createElement("p",null,Object(a.a)("Please ask the administrator of your homeserver (%(homeserverDomain)s) to configure a TURN server in order for calls to work reliably.",{homeserverDomain:e.getDomain()},{code:n})),React.createElement("p",null,Object(a.a)("Alternatively, you can try to use the public server at turn.matrix.org, but this will not be as reliable, and it will share your IP address with that server. You can also manage this in Settings.",null,{code:n}))),button:Object(a.a)("Try using turn.matrix.org"),cancelButton:Object(a.a)("OK"),onFinished:t=>{p.b.setValue("fallbackICEServerAllowed",null,p.a.DEVICE,t),e.setFallbackICEServerAllowed(t)}},null,!0)}();const e=s.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Call Failed","",e,{title:Object(a.a)("Call Failed"),description:t.message})}})),e.on("hangup",(function(){C(void 0,e.roomId,"ended")})),e.on("state",(function(t,n){if("ringing"===t)C(e,e.roomId,"ringing"),y("ringbackAudio");else if("invite_sent"===t)C(e,e.roomId,"ringback"),E("ringbackAudio");else if("ended"===t&&"connected"===n)C(void 0,e.roomId,"ended"),y("ringbackAudio"),E("callendAudio");else if("ended"===t&&"invite_sent"===n&&("remote"===e.hangupParty||"local"===e.hangupParty&&"invite_timeout"===e.hangupReason)){C(e,e.roomId,"busy"),y("ringbackAudio"),E("busyAudio");const t=s.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Call Handler","Call Timeout",t,{title:Object(a.a)("Call Timeout"),description:Object(a.a)("The remote side failed to pick up")+"."})}else"invite_sent"===n?(C(e,e.roomId,"stop_ringback"),y("ringbackAudio")):"ringing"===n?(C(e,e.roomId,"stop_ringing"),y("ringbackAudio")):"connected"===t&&(C(e,e.roomId,"connected"),y("ringbackAudio"))}))}function C(e,t,n){console.log(`Call state in ${t} changed to ${n} (${e?e.call_state:"-"})`),f[t]=e,"ringing"===n?E("ringAudio"):e&&"ringing"===e.call_state&&y("ringAudio"),e&&(e.call_state=n),l.a.dispatch({action:"call_state",room_id:t,state:n})}e.mxCallHandler||(l.a.register((function(e){switch(e.action){case"place_call":{if(w.getAnyActiveCall()){const e=s.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","Existing Call",e,{title:Object(a.a)("Existing Call"),description:Object(a.a)("You are already in a call.")})}if(!o.a.get().supportsVoip()){const e=s.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","VoIP is unsupported",e,{title:Object(a.a)("VoIP is unsupported"),description:Object(a.a)("You cannot place VoIP calls in this browser.")})}const t=o.a.get().getRoom(e.room_id);if(!t)return void console.error("Room %s does not exist.",e.room_id);const n=t.getJoinedMembers();if(n.length<=1){const e=s.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","Cannot place call with self",e,{description:Object(a.a)("You cannot place a call with yourself.")})}if(2===n.length){console.info("Place %s call in %s",e.type,e.room_id);!function(t){if(S(t),"voice"===e.type)t.placeVoiceCall();else if("video"===e.type)t.placeVideoCall(e.remote_element,e.local_element);else if("screensharing"===e.type){const n=r.a.get().screenCaptureErrorString();if(n){C(void 0,t.roomId,"ended"),console.log("Can't capture screen: "+n);const e=s.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","Unable to capture screen",e,{title:Object(a.a)("Unable to capture screen"),description:n})}t.placeScreenSharingCall(e.remote_element,e.local_element)}else console.error("Unknown conf call type: %s",e.type)}(c.s.createNewMatrixCall(o.a.get(),e.room_id))}else l.a.dispatch({action:"place_conference_call",room_id:e.room_id,type:e.type,remote_element:e.remote_element,local_element:e.local_element})}break;case"place_conference_call":console.info("Place conference call in %s",e.room_id),async function(e,t){l.a.dispatch({action:"appsDrawer",show:!0});const n=o.a.get().getRoom(e),r=d.a.getRoomWidgetsOfType(n,_.a.JITSI);if(h.a.roomHasPendingWidgetsOfType(e,r,_.a.JITSI)){const e=s.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call already in progress","",e,{title:Object(a.a)("Call in Progress"),description:Object(a.a)("A call is currently being placed!")})}if(r.length>0){console.warn("Refusing to start conference call widget in "+e+" a conference call widget is already present");const t=s.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Already have Jitsi Widget","",t,{title:Object(a.a)("Call in Progress"),description:Object(a.a)("A call is already in progress!")})}const c="JitsiConference"+Object(m.a)(),u=g.a.getInstance().preferredDomain;let p=d.a.getLocalJitsiWrapperUrl();const f=new URL(p);f.search="",f.searchParams.set("confId",c),p=f.toString();const v={conferenceId:c,isAudioOnly:"voice"===t,domain:u},b="jitsi_"+o.a.get().credentials.userId+"_"+Date.now();d.a.setRoomWidget(e,b,_.a.JITSI,p,"Jitsi",v).then(()=>{console.log("Jitsi widget added")}).catch(e=>{if("M_FORBIDDEN"===e.errcode){const e=s.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Call Failed","",e,{title:Object(a.a)("Permission Required"),description:Object(a.a)("You do not have permission to start a conference call in this room")})}console.error(e)})}(e.room_id,e.type);break;case"incoming_call":{if(w.getAnyActiveCall())return;if(!o.a.get().supportsVoip())return;const t=e.call;S(t),C(t,t.roomId,"ringing")}break;case"hangup":if(!f[e.room_id])return;f[e.room_id].hangup(),C(null,e.room_id,"ended");break;case"answer":if(!f[e.room_id])return;f[e.room_id].answer(),C(f[e.room_id],e.room_id,"connected"),l.a.dispatch({action:"view_room",room_id:e.room_id})}})),navigator.mediaSession&&(navigator.mediaSession.setActionHandler("play",(function(){})),navigator.mediaSession.setActionHandler("pause",(function(){})),navigator.mediaSession.setActionHandler("seekbackward",(function(){})),navigator.mediaSession.setActionHandler("seekforward",(function(){})),navigator.mediaSession.setActionHandler("previoustrack",(function(){})),navigator.mediaSession.setActionHandler("nexttrack",(function(){}))));const w={getCallForRoom:function(e){let t=w.getCall(e);return t||(v&&(t=v.getConferenceCallForRoom(e)),t||null)},getCall:function(e){return f[e]||null},getAnyActiveCall:function(){const e=Object.keys(f);for(let t=0;te.getRoom(t)).filter(e=>{if(e&&"join"===e.getMyMembership()){const n=e.getMember(t);return n&&("invite"===n.membership||"join"===n.membership)}return!1}).sort((e,t)=>t.getLastActiveTimestamp()-e.getLastActiveTimestamp());if(n.length)return n[0]}async function m(e,t){const n=await e.downloadKeys(t);return Object.values(n).every(e=>Object.keys(e).length>0)}async function g(e,t){const n=p(e,t);let o;if(n)o=n.roomId;else{let n;d.b.getValue("feature_cross_signing")&&(n=m(e,[t])),o=await h({encryption:n,dmUserId:t,spinner:!1,andView:!1}),await async function(e,t,n,o={timeout:1500}){const{timeout:r}=o;let i;return new Promise(o=>{i=function(e,r,i){i.userId===n&&i.roomId===t&&o(!0)},e.on("RoomState.newMember",i),setTimeout(o,r,!1)}).finally(()=>{e.removeListener("RoomState.newMember",i)})}(e,o,t)}return o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(33),r=n.n(o),i=n(35),s=n.n(i),a=n(42),c=n.n(a),l=n(34),u=n(411),d=n(43),h=n(300);const p={VERIFIED:"verified",WARNING:"warning",UNKNOWN:"unknown",NORMAL:"normal"},m={[p.WARNING]:Object(l.b)("This user has not verified all of their sessions."),[p.NORMAL]:Object(l.b)("You have not verified this user."),[p.VERIFIED]:Object(l.b)("You have verified this user. This user has verified all of their sessions.")},g={[p.WARNING]:Object(l.b)("Someone is using an unknown session"),[p.NORMAL]:Object(l.b)("This room is end-to-end encrypted"),[p.VERIFIED]:Object(l.b)("Everyone in this room is verified")},_={[p.WARNING]:Object(l.b)("Some sessions for this user are not trusted"),[p.VERIFIED]:Object(l.b)("All sessions for this user are trusted")},f={[p.WARNING]:Object(l.b)("Some sessions in this encrypted room are not trusted"),[p.VERIFIED]:Object(l.b)("All sessions in this encrypted room are trusted")},v=({isUser:e,status:t,className:n,size:i,onClick:s,hideTooltip:a})=>{const[v,b]=Object(o.useState)(!1),E=c()({mx_E2EIcon:!0,mx_E2EIcon_warning:t===p.WARNING,mx_E2EIcon_normal:t===p.NORMAL,mx_E2EIcon_verified:t===p.VERIFIED},n);let y;const S=Object(u.a)("feature_cross_signing");let C;S&&e?y=m[t]:S&&!e?y=g[t]:!S&&e?y=_[t]:S||e||(y=f[t]),i&&(C={width:i+"px",height:i+"px"});const w=()=>b(!0),T=()=>b(!1);let k;return v&&!a&&(k=r.a.createElement(h.a,{label:y?Object(l.a)(y):""})),s?r.a.createElement(d.a,{onClick:s,onMouseOver:w,onMouseOut:T,className:E,style:C},k):r.a.createElement("div",{onMouseOver:w,onMouseOut:T,className:E,style:C},k)};v.propTypes={isUser:s.a.bool,status:s.a.oneOf(Object.values(p)),className:s.a.string,size:s.a.number,onClick:s.a.func},t.b=v},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return g})),n.d(t,"d",(function(){return _})),n.d(t,"b",(function(){return f}));var o=n(41),r=n(36),i=n(37),s=n(255),a=n(256),c=n(34),l=n(40),u=n(66);let d={},h=!1;function p(){return h||l.b.getValue("keepSecretStoragePassphraseForSession")}class m extends Error{constructor(){super("Secret storage access canceled")}}const g={getSecretStorageKey:async function({keys:e},t){const n=Object.entries(e);if(n.length>1)throw new Error("Multiple storage key requests not implemented");const[l,u]=n[0];if(p()&&d[l])return[l,d[l]];const h=async({passphrase:e,recoveryKey:t})=>e?Object(s.a)(e,u.passphrase.salt,u.passphrase.iterations):Object(a.a)(t),g=r.getComponent("dialogs.secretstorage.AccessSecretStorageDialog"),{finished:_}=o.a.createTrackedDialog("Access Secret Storage dialog","",g,{keyInfo:u,checkPrivateKey:async e=>{const t=await h(e);return await i.a.get().checkSecretStorageKey(t,u)}},null,!1,!1,{onBeforeClose:async e=>"backgroundClick"!==e||async function(e){let t;t="m.cross_signing.user_signing"===e?Object(c.a)("If you cancel now, you won't complete verifying the other user."):"m.cross_signing.self_signing"===e?Object(c.a)("If you cancel now, you won't complete verifying your other session."):Object(c.a)("If you cancel now, you won't complete your operation.");const n=r.getComponent("dialogs.QuestionDialog"),[i]=await o.a.createDialog(n,{title:Object(c.a)("Cancel entering passphrase?"),description:t,danger:!0,cancelButton:Object(c.a)("Enter passphrase"),button:Object(c.a)("Cancel")}).finished;return i}(t)}),[f]=await _;if(!f)throw new m;const v=await h(f);return p()&&(d[l]=v),[l,v]},onSecretRequested:async function({user_id:e,device_id:t,request_id:n,name:o,device_trust:r}){console.log("onSecretRequested",e,t,n,o,r);const s=i.a.get();if(e===s.getUserId())if(r&&r.isVerified()){if(o.startsWith("m.cross_signing")){const e=s.getCrossSigningCacheCallbacks();if(!e.getCrossSigningKeyCache)return;if("m.cross_signing.self_signing"===o){const n=await e.getCrossSigningKeyCache("self_signing");return n||console.log(`self_signing requested by ${t}, but not found in cache`),n&&Object(u.encodeBase64)(n)}if("m.cross_signing.user_signing"===o){const n=await e.getCrossSigningKeyCache("user_signing");return n||console.log(`user_signing requested by ${t}, but not found in cache`),n&&Object(u.encodeBase64)(n)}}else if("m.megolm_backup.v1"===o){const e=await s._crypto.getSessionBackupPrivateKey();return e||console.log(`session backup key requested by ${t}, but not found in cache`),e&&Object(u.encodeBase64)(e)}console.warn("onSecretRequested didn't recognise the secret named ",o)}else console.log("CrossSigningManager: Ignoring request from untrusted device "+t)}};async function _(){let e;const t=r.getComponent("dialogs.keybackup.RestoreKeyBackupDialog"),{finished:n}=o.a.createTrackedDialog("Restore Backup","",t,{showSummary:!1,keyCallback:t=>e=t},null,!1,!0);if(!await n)throw new Error("Key backup prompt cancelled");return e}async function f(e=(async()=>{}),t=!1){const s=i.a.get();h=!0;try{if(!await s.hasSecretStorageKey()||t){const{finished:e}=o.a.createTrackedDialogAsync("Create Secret Storage dialog","",n.e(2).then(n.bind(null,1182)),{force:t},null,!1,!0),[r]=await e;if(!r)throw new Error("Secret storage creation canceled")}else{const e=r.getComponent("dialogs.InteractiveAuthDialog");await s.bootstrapSecretStorage({authUploadDeviceSigningKeys:async t=>{const{finished:n}=o.a.createTrackedDialog("Cross-signing keys dialog","",e,{title:Object(c.a)("Setting up keys"),matrixClient:i.a.get(),makeRequest:t}),[r]=await n;if(!r)throw new Error("Cross-signing key upload auth canceled")},getBackupPassphrase:_})}return await e()}finally{h=!1,p()||(d={})}}},function(e,t,n){"use strict";class o{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const o of Object.keys(n))"function"==typeof n[o]&&(t[o]=e[o],e[o]=n[o])}_getOverriddenMethods(){throw new Error("Not implemented")}}o.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n0)throw new Error("Cannot initialise state after events are added");for(const t of e)Object.freeze(t);this._startState.setStateEvents(e),this._endState.setStateEvents(e)},r.prototype.forkLive=function(e){const t=this.getState(e),n=new r(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t,this._endState=t.clone(),n},r.prototype.fork=function(e){const t=this.getState(e),n=new r(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t.clone(),n},r.prototype.getRoomId=function(){return this._roomId},r.prototype.getFilter=function(){return this._eventTimelineSet.getFilter()},r.prototype.getTimelineSet=function(){return this._eventTimelineSet},r.prototype.getBaseIndex=function(){return this._baseIndex},r.prototype.getEvents=function(){return this._events},r.prototype.getState=function(e){if(e==r.BACKWARDS)return this._startState;if(e==r.FORWARDS)return this._endState;throw new Error("Invalid direction '"+e+"'")},r.prototype.getPaginationToken=function(e){return this.getState(e).paginationToken},r.prototype.setPaginationToken=function(e,t){this.getState(t).paginationToken=e},r.prototype.getNeighbouringTimeline=function(e){if(e==r.BACKWARDS)return this._prevTimeline;if(e==r.FORWARDS)return this._nextTimeline;throw new Error("Invalid direction '"+e+"'")},r.prototype.setNeighbouringTimeline=function(e,t){if(this.getNeighbouringTimeline(t))throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: "+t+")");if(t==r.BACKWARDS)this._prevTimeline=e;else{if(t!=r.FORWARDS)throw new Error("Invalid direction '"+t+"'");this._nextTimeline=e}this.setPaginationToken(null,t)},r.prototype.addEvent=function(e,t){const n=t?this._startState:this._endState,o=this.getTimelineSet();let i;o.room&&o.room.getUnfilteredTimelineSet()===o&&(r.setEventMetadata(e,n,t),e.isState()&&(n.setStateEvents([e]),e.sender&&("m.room.member"!==e.getType()||t)||r.setEventMetadata(e,n,t))),i=t?0:this._events.length,this._events.splice(i,0,e),t&&this._baseIndex++},r.setEventMetadata=function(e,t,n){e.sender=t.getSentinelMember(e.getSender()),"m.room.member"===e.getType()&&(e.target=t.getSentinelMember(e.getStateKey())),e.isState()&&n&&(e.forwardLooking=!1)},r.prototype.removeEvent=function(e){for(let t=this._events.length-1;t>=0;t--){const n=this._events[t];if(n.getId()==e)return this._events.splice(t,1),t{this._usersPending[t].resolve=e,this._usersPending[t].reject=n}).then(e=>(this._userGroups[t]=e,setTimeout(()=>{delete this._userGroups[t]},18e5),this._userGroups[t])).catch(e=>{if("M_UNRECOGNIZED"===e.errcode)return console.warn("Cannot display flair, server does not support groups"),void(i=!1);throw console.error("Could not get groups for user",t,e),e}).finally(()=>{delete this._usersInFlight[t]}),this._debounceTimeoutID&&clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this._batchedGetPublicGroups(e)},200),this._usersPending[t].prom)}async _batchedGetPublicGroups(e){this._usersInFlight=this._usersPending,this._usersPending={};let t={users:[]};try{t=await e.getPublicisedGroups(Object.keys(this._usersInFlight))}catch(e){return void Object.keys(this._usersInFlight).forEach(t=>{this._usersInFlight[t]&&this._usersInFlight[t].reject(e)})}const n=t.users;Object.keys(this._usersInFlight).forEach(e=>{this._usersInFlight[e]&&this._usersInFlight[e].resolve(n[e]||[])})}async getGroupProfileCached(e,t){if(this._groupProfiles[t])return this._groupProfiles[t];if(this._groupProfilesPromise[t]){try{await this._groupProfilesPromise[t]}catch(e){return null}return this._groupProfiles[t]}let n;console.log("FlairStore: Request group profile of "+t),this._groupProfilesPromise[t]=e.getGroupProfile(t);try{n=await this._groupProfilesPromise[t]}catch(e){return console.log("FlairStore: Failed to get group profile for "+t,e),delete this._groupProfilesPromise[t],null}return this._groupProfiles[t]={groupId:t,avatarUrl:n.avatar_url,name:n.name,shortDescription:n.short_description},delete this._groupProfilesPromise[t],console.log("FlairStore: Emit updateGroupProfile for "+t),this.emit("updateGroupProfile"),setTimeout(()=>{this.refreshGroupProfile(e,t)},18e5),this._groupProfiles[t]}refreshGroupProfile(e,t){return delete this._groupProfiles[t],this.getGroupProfileCached(e,t)}}void 0===e.singletonFlairStore&&(e.singletonFlairStore=new s),t.a=e.singletonFlairStore}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(3),r=n.n(o);class i{constructor(e,t){this.preferred=e,this.legacy=t}matches(e){return e===this.preferred||e===this.legacy}static fromString(e){const t=Object.values(i).filter(e=>e instanceof i).find(t=>t.matches(e));return t||new i(e,e)}}r()(i,"JITSI",new i("m.jitsi","jitsi")),r()(i,"STICKERPICKER",new i("m.stickerpicker","m.stickerpicker")),r()(i,"INTEGRATION_MANAGER",new i("m.integration_manager","m.integration_manager")),r()(i,"CUSTOM",new i("m.custom","m.custom"))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(44),r=n(37),i=n(41),s=n(36),a=n(34),c=n(183),l=n(186),u=n(154);class d extends Error{}class h{constructor(e=null){this.accessToken=null,this.authEnabled=!0,this.tempClient=e?Object(o.q)({baseUrl:"",idBaseUrl:e}):null}get _matrixClient(){return this.tempClient?this.tempClient:r.a.get()}_writeToken(){this.tempClient||window.localStorage.setItem("mx_is_access_token",this.accessToken)}_readToken(){return this.tempClient?null:window.localStorage.getItem("mx_is_access_token")}hasCredentials(){return null!=this.accessToken}async getAccessToken({check:e=!0}={}){if(!this.authEnabled)return null;let t=this.accessToken;if(t||(t=this._readToken()),!t)return t=await this.registerForToken(e),t&&(this.accessToken=t,this._writeToken()),t;if(e)try{await this._checkToken(t)}catch(e){if(e instanceof c.b||e instanceof d)throw e;t=await this.registerForToken(),t&&(this.accessToken=t,this._writeToken())}return t}async _checkToken(e){const t=this._matrixClient.getIdentityServerUrl();try{await this._matrixClient.getIdentityAccount(e)}catch(n){if("M_TERMS_NOT_SIGNED"===n.errcode)return console.log("Identity Server requires new terms to be agreed to"),void await Object(c.d)([new c.a(o.m.IS,t,e)]);throw n}if(!this.tempClient&&!Object(l.a)()&&!await Object(l.b)(t)){const e=s.getComponent("dialogs.QuestionDialog"),{finished:n}=i.a.createTrackedDialog("Default identity server terms warning","",e,{title:Object(a.a)("Identity server has no terms of service"),description:React.createElement("div",null,React.createElement("p",null,Object(a.a)("This action requires accessing the default identity server to validate an email address or phone number, but the server does not have any terms of service.",{},{server:()=>React.createElement("b",null,Object(u.a)(t))})),React.createElement("p",null,Object(a.a)("Only continue if you trust the owner of the server."))),button:Object(a.a)("Trust")}),[o]=await n;if(!o)throw new d("User aborted identity server action without terms");Object(l.d)()}}async registerForToken(e=!0){const t=await r.a.get().getOpenIdToken(),{access_token:n,token:o}=await this._matrixClient.registerWithIdentityServer(t),i=o||n;return e&&await this._checkToken(i),i}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FOCUS_GROUP="data-focus-lock",t.FOCUS_DISABLED="data-focus-lock-disabled",t.FOCUS_ALLOW="data-no-focus-lock",t.FOCUS_AUTO="data-autofocus-inside"},function(e,t,n){"use strict";var o="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var o in n)r(n,o)&&(e[o]=n[o])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,o,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+o),r);else for(var i=0;i{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));o.a.log("connecting to indexeddb "+this._dbName);const n=this._indexedDB.open(this._dbName,s.b);n.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;s.c(t,n)},n.onblocked=()=>{o.a.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{o.a.log("Error connecting to indexeddb",e),t(e.target.error)},n.onsuccess=t=>{const n=t.target.result;o.a.log("connected to indexeddb "+this._dbName),e(new s.a(n))}}).then(e=>e.doTxn("readonly",[l.STORE_INBOUND_GROUP_SESSIONS,l.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],t=>{e.getEndToEndInboundGroupSession("","",t,()=>{})}).then(()=>e)).catch(t=>{if("VersionError"===t.name)throw o.a.warn("Crypto DB is too new for us to use!",t),new a.a(a.a.TOO_NEW);o.a.warn("unable to connect to indexeddb "+this._dbName+": falling back to localStorage store: "+t);try{return new r.a(e.localStorage)}catch(t){return o.a.warn("unable to open localStorage: falling back to in-memory store: "+t),new i.a}}).then(e=>{this._backend=e})),this._backendPromise}deleteAllData(){return new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));o.a.log("Removing indexeddb instance: "+this._dbName);const n=this._indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{o.a.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{o.a.log("Error deleting data from indexeddb",e),t(e.target.error)},n.onsuccess=()=>{o.a.log("Removed indexeddb instance: "+this._dbName),e()}}).catch(e=>{o.a.warn("unable to delete IndexedDBCryptoStore: "+e)})}getOrAddOutgoingRoomKeyRequest(e){return this._backend.getOrAddOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequest(e){return this._backend.getOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequestByState(e){return this._backend.getOutgoingRoomKeyRequestByState(e)}getAllOutgoingRoomKeyRequestsByState(e){return this._backend.getAllOutgoingRoomKeyRequestsByState(e)}getOutgoingRoomKeyRequestsByTarget(e,t,n){return this._backend.getOutgoingRoomKeyRequestsByTarget(e,t,n)}updateOutgoingRoomKeyRequest(e,t,n){return this._backend.updateOutgoingRoomKeyRequest(e,t,n)}deleteOutgoingRoomKeyRequest(e,t){return this._backend.deleteOutgoingRoomKeyRequest(e,t)}getAccount(e,t){this._backend.getAccount(e,t)}storeAccount(e,t){this._backend.storeAccount(e,t)}getCrossSigningKeys(e,t){this._backend.getCrossSigningKeys(e,t)}getSecretStorePrivateKey(e,t,n){this._backend.getSecretStorePrivateKey(e,t,n)}storeCrossSigningKeys(e,t){this._backend.storeCrossSigningKeys(e,t)}storeSecretStorePrivateKey(e,t,n){this._backend.storeSecretStorePrivateKey(e,t,n)}countEndToEndSessions(e,t){this._backend.countEndToEndSessions(e,t)}getEndToEndSession(e,t,n,o){this._backend.getEndToEndSession(e,t,n,o)}getEndToEndSessions(e,t,n){this._backend.getEndToEndSessions(e,t,n)}getAllEndToEndSessions(e,t){this._backend.getAllEndToEndSessions(e,t)}storeEndToEndSession(e,t,n,o){this._backend.storeEndToEndSession(e,t,n,o)}storeEndToEndSessionProblem(e,t,n){return this._backend.storeEndToEndSessionProblem(e,t,n)}getEndToEndSessionProblem(e,t){return this._backend.getEndToEndSessionProblem(e,t)}filterOutNotifiedErrorDevices(e){return this._backend.filterOutNotifiedErrorDevices(e)}getEndToEndInboundGroupSession(e,t,n,o){this._backend.getEndToEndInboundGroupSession(e,t,n,o)}getAllEndToEndInboundGroupSessions(e,t){this._backend.getAllEndToEndInboundGroupSessions(e,t)}addEndToEndInboundGroupSession(e,t,n,o){this._backend.addEndToEndInboundGroupSession(e,t,n,o)}storeEndToEndInboundGroupSession(e,t,n,o){this._backend.storeEndToEndInboundGroupSession(e,t,n,o)}storeEndToEndInboundGroupSessionWithheld(e,t,n,o){this._backend.storeEndToEndInboundGroupSessionWithheld(e,t,n,o)}storeEndToEndDeviceData(e,t){this._backend.storeEndToEndDeviceData(e,t)}getEndToEndDeviceData(e,t){this._backend.getEndToEndDeviceData(e,t)}storeEndToEndRoom(e,t,n){this._backend.storeEndToEndRoom(e,t,n)}getEndToEndRooms(e,t){this._backend.getEndToEndRooms(e,t)}getSessionsNeedingBackup(e){return this._backend.getSessionsNeedingBackup(e)}countSessionsNeedingBackup(e){return this._backend.countSessionsNeedingBackup(e)}unmarkSessionsNeedingBackup(e,t){return this._backend.unmarkSessionsNeedingBackup(e,t)}markSessionsNeedingBackup(e,t){return this._backend.markSessionsNeedingBackup(e,t)}doTxn(e,t,n){return this._backend.doTxn(e,t,n)}}l.STORE_ACCOUNT="account",l.STORE_SESSIONS="sessions",l.STORE_INBOUND_GROUP_SESSIONS="inbound_group_sessions",l.STORE_INBOUND_GROUP_SESSIONS_WITHHELD="inbound_group_sessions_withheld",l.STORE_DEVICE_DATA="device_data",l.STORE_ROOMS="rooms",l.STORE_BACKUP="sessions_needing_backup"}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"i",(function(){return u})),n.d(t,"j",(function(){return d})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return p})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return g})),n.d(t,"d",(function(){return _})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return b})),n.d(t,"k",(function(){return E}));var o=n(3),r=n.n(o),i=n(0),s=n(49),a=n(171),c=n(136);const l="m.key.verification.",u=l+"request",d=l+"start",h=l+"cancel",p=l+"ready",m=1,g=2,_=3,f=4,v=5,b=6;class E extends s.EventEmitter{constructor(e,t,n){super(),r()(this,"_cancelOnTimeout",()=>{try{this.cancel({reason:"Other party didn't accept in time",code:"m.timeout"})}catch(e){i.a.error("Error while cancelling verification request",e)}}),this.channel=e,this.channel._request=this,this._verificationMethods=t,this._client=n,this._commonMethods=[],this._setPhase(m,!1),this._eventsByUs=new Map,this._eventsByThem=new Map,this._observeOnly=!1,this._timeoutTimer=null,this._accepting=!1,this._declining=!1,this._verifierHasFinished=!1,this._cancelled=!1,this._chosenMethod=null,this._qrCodeData=null}static validateEvent(e,t,n){const o=t.getContent();return!(!e||!e.startsWith(l))&&(o?e!==u&&e!==p||Array.isArray(o.methods)?e!==u&&e!==p&&e!==d||"string"==typeof o.from_device&&0!==o.from_device.length||(i.a.log("VerificationRequest: validateEvent: fail because from_device"),!1):(i.a.log("VerificationRequest: validateEvent: fail because methods"),!1):(i.a.log("VerificationRequest: validateEvent: no content"),!1))}get invalid(){return this.phase===m}get requested(){return this.phase===g}get cancelled(){return this.phase===v}get ready(){return this.phase===_}get started(){return this.phase===f}get done(){return this.phase===b}get methods(){return this._commonMethods}get chosenMethod(){return this._chosenMethod}get timeout(){const e=this._getEventByEither(u);if(e){const t=Date.now()-this.channel.getTimestamp(e);return Math.max(0,6e5-t)}return 0}get requestEvent(){return this._getEventByEither(u)}get phase(){return this._phase}get verifier(){return this._verifier}get canAccept(){return this.phase<_&&!this._accepting&&!this._declining}get accepting(){return this._accepting}get declining(){return this._declining}get pending(){return!this.observeOnly&&this._phase!==b&&this._phase!==v}get qrCodeData(){return this._qrCodeData}otherPartySupportsMethod(e,t=!1){if(!t&&!this.ready&&!this.started)return!1;const n=this._eventsByThem.get(u)||this._eventsByThem.get(p);if(!n){if(this.started&&this.initiatedByMe){const t=this._eventsByUs.get(d),n=t&&t.getContent();return e==(n&&n.method)}return!1}const o=n.getContent();if(!o)return!1;const{methods:r}=o;return!!Array.isArray(r)&&r.includes(e)}get initiatedByMe(){const e=this._eventsByUs.size+this._eventsByThem.size===0;if(this._phase===m&&e)return!0;const t=this._eventsByUs.has(u),n=this._eventsByThem.has(u);if(t&&!n)return!0;if(!t&&n)return!1;const o=this._eventsByUs.has(d),r=this._eventsByThem.has(d);return!(!o||r)}get requestingUserId(){return this.initiatedByMe?this._client.getUserId():this.otherUserId}get receivingUserId(){return this.initiatedByMe?this.otherUserId:this._client.getUserId()}get otherUserId(){return this.channel.userId}get isSelfVerification(){return this._client.getUserId()===this.otherUserId}get cancellingUserId(){const e=this._eventsByUs.get(h),t=this._eventsByThem.get(h);return e&&(!t||e.getId(){const o=()=>{let r=!1;return e(this)?(t(this),r=!0):this.cancelled&&(n(new Error("cancelled")),r=!0),r&&this.off("change",o),r};o()||this.on("change",o)})}_setPhase(e,t=!0){this._phase=e,t&&this.emit("change")}_getEventByEither(e){return this._eventsByThem.get(e)||this._eventsByUs.get(e)}_getEventBy(e,t){return t?this._eventsByThem.get(e):this._eventsByUs.get(e)}_calculatePhaseTransitions(){const e=[{phase:m}],t=()=>e[e.length-1].phase,n=this._eventsByThem.has(u),o=this._getEventBy(u,n);o&&e.push({phase:g,event:o});const r=o&&this._getEventBy(p,!n);let i;if(r&&t()===g&&e.push({phase:_,event:r}),r||!o){const e=this._eventsByThem.get(d),t=this._eventsByUs.get(d);i=e&&t?e.getSender()this._verificationMethods.has(e))}if(this.observeOnly||t!==g&&t!==f&&t!==_||this.channel.receiveStartFromOtherDevices&&this._wasSentByOwnUser(n)&&!this._wasSentByOwnDevice(n)&&(this._observeOnly=!0),t===f){const{method:e}=n.getContent();this._verifier||this.observeOnly||(this._verifier=this._createVerifier(e,n),this._verifier?this._chosenMethod=e:this.cancel({code:"m.unknown_method",reason:"Unknown method: "+e}))}}_applyPhaseTransitions(){const e=this._calculatePhaseTransitions(),t=e.findIndex(e=>e.phase===this.phase),n=e.slice(t+1);for(const e of n)this._transitionToPhase(e);return n}_isWinningStartRace(e){if(e.getType()!==d)return!1;const t=this._verifier.startEvent;let n,o;if(this.isSelfVerification)if(t){const e=t.getContent();n=e&&e.from_device}else n=this._client.getDeviceId();else n=t?t.getSender():this._client.getUserId();if(this.isSelfVerification){const t=e.getContent();o=t&&t.from_device}else o=e.getSender();return oe.phase===_)){this.otherPartySupportsMethod(c.c,!0)&&(this._qrCodeData=await c.a.create(this,this._client))}const e=l[l.length-1],{phase:t}=e;this._setupTimeout(t),this._setPhase(t)}else this._observeOnly!==s&&this.emit("change")}finally{i.a.log(`Verification request ${this.channel.transactionId}: ${e} event with id:${t.getId()}, content:${JSON.stringify(t.getContent())} deviceId:${this.channel.deviceId}, sender:${t.getSender()}, isSentByUs:${r}, isLiveEvent:${n}, isRemoteEcho:${o}, phase:${a}=>${this.phase}, observeOnly:${s}=>${this._observeOnly}`)}}_setupTimeout(e){if(!this._timeoutTimer&&!this.observeOnly&&e===g&&this.initiatedByMe&&(this._timeoutTimer=setTimeout(this._cancelOnTimeout,this.timeout)),this._timeoutTimer){(e===f||e===_||e===b||e===v)&&(clearTimeout(this._timeoutTimer),this._timeoutTimer=null)}}async _cancelOnError(e,t){if(e===d){const e=t.getContent().method;if(!this._verificationMethods.has(e))return await this.cancel(Object(a.b)(Object(a.g)())),!0}const n=e===u&&this.phase!==m,o=e===p&&this.phase!==g;if(this.phase!==m&&(n||o)){i.a.warn(`Cancelling, unexpected ${e} verification event from `+t.getSender());const n=`Unexpected ${e} event in phase ${this.phase}`;return await this.cancel(Object(a.b)(Object(a.f)({reason:n}))),!0}return!1}_adjustObserveOnly(e,t){t||(this._observeOnly=!0);const n=this.channel.getTimestamp(e);if(Number.isFinite(n)){const e=Date.now()-n;(e>597e3||e<-3e5)&&(this._observeOnly=!0)}}_addEvent(e,t,n){if(n?this._eventsByUs.set(e,t):this._eventsByThem.set(e,t),e===u)for(const[e,t]of this._eventsByThem.entries())t.getSender()!==this.otherUserId&&this._eventsByThem.delete(e)}_createVerifier(e,t=null,n=null){n||(n=this.targetDevice);const{userId:o,deviceId:r}=n,s=this._verificationMethods.get(e);if(s)return new s(this.channel,this._client,o,r,t,this);i.a.warn("could not find verifier constructor for method",e)}_wasSentByOwnUser(e){return e.getSender()===this._client.getUserId()}_wasSentByOwnDevice(e){if(!this._wasSentByOwnUser(e))return!1;const t=e.getContent();return!(!t||t.from_device!==this._client.getDeviceId())}onVerifierCancelled(){this._cancelled=!0;const e=this._applyPhaseTransitions();e.length&&this._setPhase(e[e.length-1].phase)}onVerifierFinished(){this.channel.send("m.key.verification.done",{}),this._verifierHasFinished=!0;const e=this._applyPhaseTransitions();e.length&&this._setPhase(e[e.length-1].phase)}getEventFromOtherParty(e){return this._eventsByThem.get(e)}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(585),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default||function(e){for(var t=1;tnew o.a;function N(e){F=e}function M(t){return"string"==typeof t&&(t={baseUrl:t}),t.request=t.request||R,t.store=t.store||new r.a({localStorage:e.localStorage}),t.scheduler=t.scheduler||new i.a,t.cryptoStore=t.cryptoStore||F(),new s.b(t)}}.call(this,n(17))},function(e,t,n){var o=n(685),r=n(688);e.exports=function(e,t){var n=r(e,t);return o(n)?n:void 0}},function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return a}));var o=n(37),r=n(181),i=(n(36),n(149));function s(e){return(!e.sender||e.sender.userId!=o.a.get().credentials.userId)&&("m.room.member"!=e.getType()&&("m.room.third_party_invite"!=e.getType()&&("m.call.answer"!=e.getType()&&"m.call.hangup"!=e.getType()&&(("m.room.message"!=e.getType()||"m.notify"!=e.getContent().msgtype)&&("m.room.aliases"!=e.getType()&&"m.room.canonical_alias"!=e.getType()&&("m.room.server_acl"!=e.getType()&&Object(i.b)(e)))))))}function a(e){const t=o.a.get().credentials.userId,n=e.getEventReadUpTo(t);if(e.timeline.length&&e.timeline[e.timeline.length-1].sender&&e.timeline[e.timeline.length-1].sender.userId===t)return!1;for(let t=e.timeline.length-1;t>=0;--t){const o=e.timeline[t];if(o.getId()==n)return!1;if(!Object(r.a)(o)&&s(o))return!0}return!0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(e){this._timeout=e,this._onTimeout=this._onTimeout.bind(this),this._setNotStarted()}_setNotStarted(){this._timerHandle=null,this._startTs=null,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}).finally(()=>{this._timerHandle=null})}_onTimeout(){const e=Date.now()-this._startTs;if(e>=this._timeout)this._resolve(),this._setNotStarted();else{const t=this._timeout-e;this._timerHandle=setTimeout(this._onTimeout,t)}}changeTimeout(e){if(e===this._timeout)return;const t=e40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return o[e]},t.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},function(e,t,n){var o=n(431),r=n(432);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return r.testNumeric(e)?t.NUMERIC:r.testAlphanumeric(e)?t.ALPHANUMERIC:r.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},function(e,t,n){"use strict";var o=n(33),r=n.n(o),i=n(39),s=n.n(i);t.a=s()({displayName:"Spinner",render:function(){const e=this.props.w||32,t=this.props.h||32,o=this.props.imgClassName||"";return r.a.createElement("div",{className:"mx_Spinner"},r.a.createElement("img",{src:n(163),width:e,height:t,className:o}))}})},function(e,t,n){"use strict";const o=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},t.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};const r=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};t.SPECIAL_ELEMENTS={[o.HTML]:{[r.ADDRESS]:!0,[r.APPLET]:!0,[r.AREA]:!0,[r.ARTICLE]:!0,[r.ASIDE]:!0,[r.BASE]:!0,[r.BASEFONT]:!0,[r.BGSOUND]:!0,[r.BLOCKQUOTE]:!0,[r.BODY]:!0,[r.BR]:!0,[r.BUTTON]:!0,[r.CAPTION]:!0,[r.CENTER]:!0,[r.COL]:!0,[r.COLGROUP]:!0,[r.DD]:!0,[r.DETAILS]:!0,[r.DIR]:!0,[r.DIV]:!0,[r.DL]:!0,[r.DT]:!0,[r.EMBED]:!0,[r.FIELDSET]:!0,[r.FIGCAPTION]:!0,[r.FIGURE]:!0,[r.FOOTER]:!0,[r.FORM]:!0,[r.FRAME]:!0,[r.FRAMESET]:!0,[r.H1]:!0,[r.H2]:!0,[r.H3]:!0,[r.H4]:!0,[r.H5]:!0,[r.H6]:!0,[r.HEAD]:!0,[r.HEADER]:!0,[r.HGROUP]:!0,[r.HR]:!0,[r.HTML]:!0,[r.IFRAME]:!0,[r.IMG]:!0,[r.INPUT]:!0,[r.LI]:!0,[r.LINK]:!0,[r.LISTING]:!0,[r.MAIN]:!0,[r.MARQUEE]:!0,[r.MENU]:!0,[r.META]:!0,[r.NAV]:!0,[r.NOEMBED]:!0,[r.NOFRAMES]:!0,[r.NOSCRIPT]:!0,[r.OBJECT]:!0,[r.OL]:!0,[r.P]:!0,[r.PARAM]:!0,[r.PLAINTEXT]:!0,[r.PRE]:!0,[r.SCRIPT]:!0,[r.SECTION]:!0,[r.SELECT]:!0,[r.SOURCE]:!0,[r.STYLE]:!0,[r.SUMMARY]:!0,[r.TABLE]:!0,[r.TBODY]:!0,[r.TD]:!0,[r.TEMPLATE]:!0,[r.TEXTAREA]:!0,[r.TFOOT]:!0,[r.TH]:!0,[r.THEAD]:!0,[r.TITLE]:!0,[r.TR]:!0,[r.TRACK]:!0,[r.UL]:!0,[r.WBR]:!0,[r.XMP]:!0},[o.MATHML]:{[r.MI]:!0,[r.MO]:!0,[r.MN]:!0,[r.MS]:!0,[r.MTEXT]:!0,[r.ANNOTATION_XML]:!0},[o.SVG]:{[r.TITLE]:!0,[r.FOREIGN_OBJECT]:!0,[r.DESC]:!0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return E})),n.d(t,"c",(function(){return T})),n.d(t,"d",(function(){return O}));var o=n(3),r=n.n(o),i=n(33),s=n.n(i),a=n(39),c=n.n(a),l=n(35),u=n.n(l),d=n(57),h=n.n(d),p=n(42),m=n.n(p),g=n(36),_=n(34),f=n(40),v=n(43);const b=0,E=c()({displayName:"PasswordAuthEntry",statics:{LOGIN_TYPE:"m.login.password"},propTypes:{matrixClient:u.a.object.isRequired,submitAuthDict:u.a.func.isRequired,errorText:u.a.string,busy:u.a.bool,onPhaseChange:u.a.func.isRequired},componentDidMount:function(){this.props.onPhaseChange(b)},getInitialState:function(){return{password:""}},_onSubmit:function(e){e.preventDefault(),this.props.busy||this.props.submitAuthDict({type:E.LOGIN_TYPE,user:this.props.matrixClient.credentials.userId,identifier:{type:"m.id.user",user:this.props.matrixClient.credentials.userId},password:this.state.password})},_onPasswordFieldChange:function(e){this.setState({password:e.target.value})},render:function(){const e=m()({error:this.props.errorText});let t,n;if(this.props.busy){const e=g.getComponent("elements.Spinner");t=s.a.createElement(e,null)}else t=s.a.createElement("input",{type:"submit",className:"mx_Dialog_primary",disabled:!this.state.password,value:Object(_.a)("Continue")});this.props.errorText&&(n=s.a.createElement("div",{className:"error",role:"alert"},this.props.errorText));const o=g.getComponent("elements.Field");return s.a.createElement("div",null,s.a.createElement("p",null,Object(_.a)("Confirm your identity by entering your account password below.")),s.a.createElement("form",{onSubmit:this._onSubmit,className:"mx_InteractiveAuthEntryComponents_passwordSection"},s.a.createElement(o,{className:e,type:"password",name:"passwordField",label:Object(_.a)("Password"),autoFocus:!0,value:this.state.password,onChange:this._onPasswordFieldChange}),s.a.createElement("div",{className:"mx_button_row"},t)),n)}}),y=c()({displayName:"RecaptchaAuthEntry",statics:{LOGIN_TYPE:"m.login.recaptcha"},propTypes:{submitAuthDict:u.a.func.isRequired,stageParams:u.a.object.isRequired,errorText:u.a.string,busy:u.a.bool,onPhaseChange:u.a.func.isRequired},componentDidMount:function(){this.props.onPhaseChange(b)},_onCaptchaResponse:function(e){this.props.submitAuthDict({type:y.LOGIN_TYPE,response:e})},render:function(){if(this.props.busy){const e=g.getComponent("elements.Spinner");return s.a.createElement(e,null)}let e=this.props.errorText;const t=g.getComponent("views.auth.CaptchaForm");let n,o;return this.props.stageParams&&this.props.stageParams.public_key?n=this.props.stageParams.public_key:e=Object(_.a)("Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator."),e&&(o=s.a.createElement("div",{className:"error",role:"alert"},e)),s.a.createElement("div",null,s.a.createElement(t,{sitePublicKey:n,onCaptchaResponse:this._onCaptchaResponse}),o)}}),S=c()({displayName:"TermsAuthEntry",statics:{LOGIN_TYPE:"m.login.terms"},propTypes:{submitAuthDict:u.a.func.isRequired,stageParams:u.a.object.isRequired,errorText:u.a.string,busy:u.a.bool,showContinue:u.a.bool,onPhaseChange:u.a.func.isRequired},componentDidMount:function(){this.props.onPhaseChange(b)},componentWillMount:function(){const e=this.props.stageParams.policies||{},t=f.b.getValue("language"),n={},o=[];for(const r of Object.keys(e)){const i=e[r];let s=i[t];if(s||(s=i.en),!s){s=i[Object.keys(i).find(e=>"version"!==e)]}if(!s)throw new Error("Failed to find a policy to show the user");n[r]=!1,s.id=r,o.push(s)}this.setState({toggledPolicies:n,policies:o})},tryContinue:function(){this._trySubmit()},_togglePolicy:function(e){const t={};for(const n of this.state.policies){let o=this.state.toggledPolicies[n.id];n.id===e&&(o=!o),t[n.id]=o}this.setState({toggledPolicies:t})},_trySubmit:function(){let e=!0;for(const t of this.state.policies){const n=this.state.toggledPolicies[t.id];e=e&&n}e?this.props.submitAuthDict({type:S.LOGIN_TYPE}):this.setState({errorText:Object(_.a)("Please review and accept all of the homeserver's policies")})},render:function(){if(this.props.busy){const e=g.getComponent("elements.Spinner");return s.a.createElement(e,null)}const e=[];let t,n,o=!0;for(const t of this.state.policies){const n=this.state.toggledPolicies[t.id];o=o&&n,e.push(s.a.createElement("label",{key:"policy_checkbox_"+t.id,className:"mx_InteractiveAuthEntryComponents_termsPolicy"},s.a.createElement("input",{type:"checkbox",onChange:()=>this._togglePolicy(t.id),checked:n}),s.a.createElement("a",{href:t.url,target:"_blank",rel:"noreferrer noopener"},t.name)))}return(this.props.errorText||this.state.errorText)&&(t=s.a.createElement("div",{className:"error",role:"alert"},this.props.errorText||this.state.errorText)),!1!==this.props.showContinue&&(n=s.a.createElement("button",{className:"mx_InteractiveAuthEntryComponents_termsSubmit mx_GeneralButton",onClick:this._trySubmit,disabled:!o},Object(_.a)("Accept"))),s.a.createElement("div",null,s.a.createElement("p",null,Object(_.a)("Please review and accept the policies of this homeserver:")),e,t,n)}}),C=c()({displayName:"EmailIdentityAuthEntry",statics:{LOGIN_TYPE:"m.login.email.identity"},propTypes:{matrixClient:u.a.object.isRequired,submitAuthDict:u.a.func.isRequired,authSessionId:u.a.string.isRequired,clientSecret:u.a.string.isRequired,inputs:u.a.object.isRequired,stageState:u.a.object.isRequired,fail:u.a.func.isRequired,setEmailSid:u.a.func.isRequired,onPhaseChange:u.a.func.isRequired},componentDidMount:function(){this.props.onPhaseChange(b)},render:function(){if(void 0===this.props.inputs.emailAddress){const e=g.getComponent("elements.Spinner");return s.a.createElement(e,null)}return s.a.createElement("div",null,s.a.createElement("p",null,Object(_.a)("An email has been sent to %(emailAddress)s",{emailAddress:e=>s.a.createElement("i",null,this.props.inputs.emailAddress)})),s.a.createElement("p",null,Object(_.a)("Please check your email to continue registration.")))}}),w=c()({displayName:"MsisdnAuthEntry",statics:{LOGIN_TYPE:"m.login.msisdn"},propTypes:{inputs:u.a.shape({phoneCountry:u.a.string,phoneNumber:u.a.string}),fail:u.a.func,clientSecret:u.a.func,submitAuthDict:u.a.func.isRequired,matrixClient:u.a.object,onPhaseChange:u.a.func.isRequired},getInitialState:function(){return{token:"",requestingToken:!1}},componentDidMount:function(){this.props.onPhaseChange(b),this._submitUrl=null,this._sid=null,this._msisdn=null,this._tokenBox=null,this.setState({requestingToken:!0}),this._requestMsisdnToken().catch(e=>{this.props.fail(e)}).finally(()=>{this.setState({requestingToken:!1})})},_requestMsisdnToken:function(){return this.props.matrixClient.requestRegisterMsisdnToken(this.props.inputs.phoneCountry,this.props.inputs.phoneNumber,this.props.clientSecret,1).then(e=>{this._submitUrl=e.submit_url,this._sid=e.sid,this._msisdn=e.msisdn})},_onTokenChange:function(e){this.setState({token:e.target.value})},_onFormSubmit:async function(e){if(e.preventDefault(),""!=this.state.token){this.setState({errorText:null});try{const e=await this.props.matrixClient.doesServerRequireIdServerParam();let t;if(this._submitUrl)t=await this.props.matrixClient.submitMsisdnTokenOtherUrl(this._submitUrl,this._sid,this.props.clientSecret,this.state.token);else{if(!e)throw new Error("The registration with MSISDN flow is misconfigured");t=await this.props.matrixClient.submitMsisdnToken(this._sid,this.props.clientSecret,this.state.token)}if(t.success){const t={sid:this._sid,client_secret:this.props.clientSecret};if(e){const e=h.a.parse(this.props.matrixClient.getIdentityServerUrl());t.id_server=e.host}this.props.submitAuthDict({type:w.LOGIN_TYPE,threepid_creds:t,threepidCreds:t})}else this.setState({errorText:Object(_.a)("Token incorrect")})}catch(e){this.props.fail(e),console.log("Failed to submit msisdn token")}}},render:function(){if(this.state.requestingToken){const e=g.getComponent("elements.Spinner");return s.a.createElement(e,null)}{const e=Boolean(this.state.token),t=m()({mx_InteractiveAuthEntryComponents_msisdnSubmit:!0,mx_GeneralButton:!0});let n;return this.state.errorText&&(n=s.a.createElement("div",{className:"error",role:"alert"},this.state.errorText)),s.a.createElement("div",null,s.a.createElement("p",null,Object(_.a)("A text message has been sent to %(msisdn)s",{msisdn:s.a.createElement("i",null,this._msisdn)})),s.a.createElement("p",null,Object(_.a)("Please enter the code it contains:")),s.a.createElement("div",{className:"mx_InteractiveAuthEntryComponents_msisdnWrapper"},s.a.createElement("form",{onSubmit:this._onFormSubmit},s.a.createElement("input",{type:"text",className:"mx_InteractiveAuthEntryComponents_msisdnEntry",value:this.state.token,onChange:this._onTokenChange,"aria-label":Object(_.a)("Code")}),s.a.createElement("br",null),s.a.createElement("input",{type:"submit",value:Object(_.a)("Submit"),className:t,disabled:!e})),n))}}});class T extends s.a.Component{constructor(e){super(e),r()(this,"_ssoUrl",void 0),r()(this,"onStartAuthClick",()=>{window.open(this._ssoUrl,"_blank"),this.setState({phase:T.PHASE_POSTAUTH}),this.props.onPhaseChange(T.PHASE_POSTAUTH)}),r()(this,"onConfirmClick",()=>{this.props.submitAuthDict({})}),this._ssoUrl=e.matrixClient.getFallbackAuthUrl(this.props.loginType,this.props.authSessionId),this.state={phase:T.PHASE_PREAUTH}}componentDidMount(){this.props.onPhaseChange(T.PHASE_PREAUTH)}render(){let e=null;const t=s.a.createElement(v.a,{onClick:this.props.onCancel,kind:this.props.continueKind?this.props.continueKind+"_outline":"primary_outline"},Object(_.a)("Cancel"));return e=this.state.phase===T.PHASE_PREAUTH?s.a.createElement(v.a,{onClick:this.onStartAuthClick,kind:this.props.continueKind||"primary"},this.props.continueText||Object(_.a)("Single Sign On")):s.a.createElement(v.a,{onClick:this.onConfirmClick,kind:this.props.continueKind||"primary"},this.props.continueText||Object(_.a)("Confirm")),s.a.createElement("div",{className:"mx_InteractiveAuthEntryComponents_sso_buttons"},t,e)}}r()(T,"propTypes",{matrixClient:u.a.object.isRequired,authSessionId:u.a.string.isRequired,loginType:u.a.string.isRequired,submitAuthDict:u.a.func.isRequired,errorText:u.a.string,onPhaseChange:u.a.func.isRequired,continueText:u.a.string,continueKind:u.a.string,onCancel:u.a.func}),r()(T,"LOGIN_TYPE","m.login.sso"),r()(T,"UNSTABLE_LOGIN_TYPE","org.matrix.login.sso"),r()(T,"PHASE_PREAUTH",1),r()(T,"PHASE_POSTAUTH",2);const k=c()({displayName:"FallbackAuthEntry",propTypes:{matrixClient:u.a.object.isRequired,authSessionId:u.a.string.isRequired,loginType:u.a.string.isRequired,submitAuthDict:u.a.func.isRequired,errorText:u.a.string,onPhaseChange:u.a.func.isRequired},componentDidMount:function(){this.props.onPhaseChange(b)},UNSAFE_componentWillMount:function(){this._popupWindow=null,window.addEventListener("message",this._onReceiveMessage),this._fallbackButton=Object(i.createRef)()},componentWillUnmount:function(){window.removeEventListener("message",this._onReceiveMessage),this._popupWindow&&this._popupWindow.close()},focus:function(){this._fallbackButton.current&&this._fallbackButton.current.focus()},_onShowFallbackClick:function(e){e.preventDefault(),e.stopPropagation();const t=this.props.matrixClient.getFallbackAuthUrl(this.props.loginType,this.props.authSessionId);this._popupWindow=window.open(t),this._popupWindow.opener=null},_onReceiveMessage:function(e){"authDone"===e.data&&e.origin===this.props.matrixClient.getHomeserverUrl()&&this.props.submitAuthDict({})},render:function(){let e;return this.props.errorText&&(e=s.a.createElement("div",{className:"error",role:"alert"},this.props.errorText)),s.a.createElement("div",null,s.a.createElement("a",{href:"",ref:this._fallbackButton,onClick:this._onShowFallbackClick},Object(_.a)("Start authentication")),e)}}),x=[E,y,C,w,S,T];function O(e){for(const t of x)if(t.LOGIN_TYPE===e||t.UNSTABLE_LOGIN_TYPE===e)return t;return k}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{getValue(e,t){return console.error("Invalid operation: getValue was not overridden"),null}setValue(e,t,n){return console.error("Invalid operation: setValue was not overridden"),Promise.reject()}canSetValue(e,t){return!1}isSupported(){return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(49),r=n(74),i=n(1);function s(e,t){this.roomId=e,this.userId=t,this.typing=!1,this.name=t,this.rawDisplayName=t,this.powerLevel=0,this.powerLevelNorm=0,this.user=null,this.membership=null,this.events={member:null},this._isOutOfBand=!1,this._updateModifiedTime()}i.o(s,o.EventEmitter),s.prototype.markOutOfBand=function(){this._isOutOfBand=!0},s.prototype.isOutOfBand=function(){return this._isOutOfBand},s.prototype.setMembershipEvent=function(e,t){if("m.room.member"!==e.getType())return;this._isOutOfBand=!1,this.events.member=e;const n=this.membership;this.membership=e.getDirectionalContent().membership;const o=this.name;this.name=function(e,t,n){if(!t||t===e)return e;if(!i.z(t))return e;if(!n)return t;let o=/@.+:.+/.test(t);o||(o=/[\u200E\u200F\u202A-\u202F]/.test(t));if(!o){const r=n.getUserIdsWithDisplayName(t);o=r.some(t=>t!==e)}if(o)return t+" ("+e+")";return t}(this.userId,e.getDirectionalContent().displayname,t),this.rawDisplayName=e.getDirectionalContent().displayname||this.userId,n!==this.membership&&(this._updateModifiedTime(),this.emit("RoomMember.membership",e,this,n)),o!==this.name&&(this._updateModifiedTime(),this.emit("RoomMember.name",e,this,o))},s.prototype.setPowerLevelEvent=function(e){if("m.room.power_levels"!==e.getType())return;const t=e.getDirectionalContent();let n=t.users_default||0;i.l(i.B(t.users),(function(e){n=Math.max(n,e)}));const o=this.powerLevel,r=this.powerLevelNorm;t.users&&void 0!==t.users[this.userId]?this.powerLevel=t.users[this.userId]:void 0!==t.users_default?this.powerLevel=t.users_default:this.powerLevel=0,this.powerLevelNorm=0,n>0&&(this.powerLevelNorm=100*this.powerLevel/n),o===this.powerLevel&&r===this.powerLevelNorm||(this._updateModifiedTime(),this.emit("RoomMember.powerLevel",e,this))},s.prototype.setTypingEvent=function(e){if("m.typing"!==e.getType())return;const t=this.typing;this.typing=!1;const n=e.getContent().user_ids;i.p(n)&&(-1!==n.indexOf(this.userId)&&(this.typing=!0),t!==this.typing&&(this._updateModifiedTime(),this.emit("RoomMember.typing",e,this)))},s.prototype._updateModifiedTime=function(){this._modified=Date.now()},s.prototype.getLastModifiedTime=function(){return this._modified},s.prototype.isKicked=function(){return"leave"===this.membership&&this.events.member.getSender()!==this.events.member.getStateKey()},s.prototype.getDMInviter=function(){if(this.events.member){const e=this.events.member;let t=e.getContent(),n=e.getSender();if("join"===t.membership&&(t=e.getPrevContent(),n=e.getUnsigned().prev_sender),"invite"===t.membership&&t.is_direct)return n}},s.prototype.getAvatarUrl=function(e,t,n,o,i,s){void 0===i&&(i=!0);const a=this.getMxcAvatarUrl();if(!a&&!i)return null;const c=Object(r.a)(e,a,t,n,o,s);return c||(i?Object(r.b)(e,this.userId,t,n):null)},s.prototype.getMxcAvatarUrl=function(){return this.events.member?this.events.member.getDirectionalContent().avatar_url:this.user?this.user.avatarUrl:null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(1);const r=["override","content","room","sender","underride"],i=[{rule_id:".m.rule.tombstone",default:!0,enabled:!0,conditions:[{kind:"event_match",key:"type",pattern:"m.room.tombstone"},{kind:"event_match",key:"state_key",pattern:""}],actions:["notify",{set_tweak:"highlight",value:!0}]},{rule_id:".m.rule.reaction",default:!0,enabled:!0,conditions:[{kind:"event_match",key:"type",pattern:"m.reaction"}],actions:["dont_notify"]}];function s(e){const t={},n=(e,t,n)=>{for(let o=0;o]*)([0-9]*)$/);if(!i)return!1;const s=i[1],a=parseInt(i[2]);if(isNaN(a))return!1;switch(s){case"":case"==":return r==a;case"<":return r":return r>a;case"<=":return r<=a;case">=":return r>=a;default:return!1}},u=function(t,n){let r=n.getContent();if(n.isEncrypted()&&n.getClearContent()&&(r=n.getClearContent()),!r||!r.body||"string"!=typeof r.body)return!1;const i=e.getRoom(n.getRoomId());if(!(i&&i.currentState&&i.currentState.members&&i.currentState.getMember(e.credentials.userId)))return!1;const s=i.currentState.getMember(e.credentials.userId).name,a=new RegExp("(^|\\W)"+Object(o.h)(s)+"(\\W|$)","i");return r.body.search(a)>-1},d=function(e,t){return!1},h=function(e,t){if(!e.key)return!1;const n=m(e.key,t);if("string"!=typeof n)return!1;if(e.value)return e.value===n;let o;return o="content.body"==e.key?p("(^|\\W)",e.pattern,"(\\W|$)"):p("^",e.pattern,"$"),!!n.match(o)},p=function(e,n,r){return t[n]||(t[n]=new RegExp(e+Object(o.n)(n)+r,"i")),t[n]},m=function(e,t){const n=e.split(".");let r;const i=n[0];for("content"===i?(r=t.getContent(),n.shift()):"type"===i?(r=t.getType(),n.shift()):r=t.event;n.length>0;){const e=n.shift();if(Object(o.r)(r[e]))return null;r=r[e]}return r},g=function(t,o){const r=function(t,o){if(!o||!o.device)return null;if(t.getSender()==e.credentials.userId)return null;const r=Object.keys(o.device);for(let e=0;et.rule_id===e.rule_id);if(t)t.default=e.default,t.conditions=e.conditions,t.actions=e.actions;else{const t=e.rule_id;console.warn("Adding default global override for "+t),n.push(e)}}return t}},function(e,t,n){"use strict";function o(e,t){const n=`Store is invalid because ${e}, please stop the client, delete all data and start the client again`,o=Reflect.construct(Error,[n]);return Reflect.setPrototypeOf(o,Reflect.getPrototypeOf(this)),o.reason=e,o.value=t,o}function r(e){const t=`Crypto store is invalid because ${e}, please stop the client, delete all data and start the client again`,n=Reflect.construct(Error,[t]);return Reflect.setPrototypeOf(n,Reflect.getPrototypeOf(this)),n.reason=e,n.name="InvalidCryptoStoreError",n}n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),o.TOGGLED_LAZY_LOADING="TOGGLED_LAZY_LOADING",o.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Reflect.setPrototypeOf(o,Error),r.TOO_NEW="TOO_NEW",r.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Reflect.setPrototypeOf(r,Error);class i extends Error{constructor(e,t){super(e),this.value=t}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return O})),n.d(t,"b",(function(){return R})),n.d(t,"d",(function(){return D})),n.d(t,"a",(function(){return I}));var o=n(0),r=n(49),i=n(1);function s(e){this.roomId=e.roomId,this.client=e.client,this.webRtc=e.webRtc,this.forceTURN=e.forceTURN,this.URL=e.URL,this.turnServers=e.turnServers||[],0===this.turnServers.length&&this.client.isFallbackICEServerAllowed()&&this.turnServers.push({urls:[s.FALLBACK_ICE_SERVER]}),i.l(this.turnServers,(function(e){i.a(e,["urls"])})),this.callId="c"+(new Date).getTime()+Math.random(),this.state="fledgling",this.didConnect=!1,this.candidateSendQueue=[],this.candidateSendTries=0,this.mediaPromises=Object.create(null),this.screenSharingStream=null,this._answerContent=null}s.CALL_TIMEOUT_MS=6e4,s.FALLBACK_ICE_SERVER="stun:turn.matrix.org",s.ERR_LOCAL_OFFER_FAILED="local_offer_failed",s.ERR_NO_USER_MEDIA="no_user_media",s.ERR_UNKNOWN_DEVICES="unknown_devices",s.ERR_SEND_INVITE="send_invite",s.ERR_SEND_ANSWER="send_answer",i.o(s,r.EventEmitter),s.prototype.placeVoiceCall=function(){v("placeVoiceCall"),_(this),E(this,S("voice")),this.type="voice"},s.prototype.placeVideoCall=function(e,t){v("placeVideoCall"),_(this),this.localVideoElement=t,this.remoteVideoElement=e,E(this,S("video")),this.type="video",m(this)},s.prototype.placeScreenSharingCall=async function(e,t){v("placeScreenSharingCall"),_(this),this.localVideoElement=t,this.remoteVideoElement=e;const n=this;try{n.screenSharingStream=await this.webRtc.getDisplayMedia({audio:!1}),v("Got screen stream, requesting audio stream...");const e=S("voice");E(n,e)}catch(e){n.emit("error",f(s.ERR_NO_USER_MEDIA,"Failed to get screen-sharing stream: "+e))}this.type="video",m(this)},s.prototype.playElement=function(e,t){o.a.log("queuing play on "+t+" and element "+e),this.mediaPromises[t]?this.mediaPromises[t]=this.mediaPromises[t].then((function(){return o.a.log("previous promise completed for "+t),e.play()}),(function(){return o.a.log("previous promise failed for "+t),e.play()})):this.mediaPromises[t]=e.play()},s.prototype.pauseElement=function(e,t){o.a.log("queuing pause on "+t+" and element "+e),this.mediaPromises[t]?this.mediaPromises[t]=this.mediaPromises[t].then((function(){return o.a.log("previous promise completed for "+t),e.pause()}),(function(){return o.a.log("previous promise failed for "+t),e.pause()})):this.mediaPromises[t]=e.pause()},s.prototype.assignElement=function(e,t,n){o.a.log("queuing assign on "+n+" element "+e+" for "+t),this.mediaPromises[n]?this.mediaPromises[n]=this.mediaPromises[n].then((function(){o.a.log("previous promise completed for "+n),e.srcObject=t}),(function(){o.a.log("previous promise failed for "+n),e.srcObject=t})):e.srcObject=t},s.prototype.getLocalVideoElement=function(){return this.localVideoElement},s.prototype.getRemoteVideoElement=function(){return this.remoteVideoElement},s.prototype.getRemoteAudioElement=function(){return this.remoteAudioElement},s.prototype.setLocalVideoElement=function(e){if(this.localVideoElement=e,e&&this.localAVStream&&"video"===this.type){e.autoplay=!0,this.assignElement(e,this.localAVStream,"localVideo"),e.muted=!0;const t=this;setTimeout((function(){const e=t.getLocalVideoElement();e.play&&t.playElement(e,"localVideo")}),0)}},s.prototype.setRemoteVideoElement=function(e){this.remoteVideoElement=e,m(this)},s.prototype.setRemoteAudioElement=function(e){this.remoteVideoElement.muted=!0,this.remoteAudioElement=e,this.remoteAudioElement.muted=!1,g(this)},s.prototype._initWithInvite=function(e){this.msg=e.getContent(),this.peerConn=y(this);const t=this;this.peerConn&&this.peerConn.setRemoteDescription(new this.webRtc.RtcSessionDescription(this.msg.offer),C(t,t._onSetRemoteDescriptionSuccess),C(t,t._onSetRemoteDescriptionError)),l(this,"ringing"),this.direction="inbound",this.msg.offer&&this.msg.offer.sdp&&this.msg.offer.sdp.indexOf("m=video")>-1?this.type="video":this.type="voice",e.getAge()&&setTimeout((function(){"ringing"==t.state&&(v("Call invite has expired. Hanging up."),t.hangupParty="remote",l(t,"ended"),p(t),"closed"!=t.peerConn.signalingState&&t.peerConn.close(),t.emit("hangup",t))}),this.msg.lifetime-e.getAge())},s.prototype._initWithHangup=function(e){this.msg=e.getContent(),l(this,"ended")},s.prototype.answer=function(){v("Answering call %s of type %s",this.callId,this.type);const e=this;e._answerContent?e._sendAnswer():this.localAVStream||this.waitForLocalAVStream?this.localAVStream?this._maybeGotUserMediaForAnswer(this.localAVStream):this.waitForLocalAVStream&&l(this,"wait_local_media"):(this.webRtc.getUserMedia(S(this.type),C(e,e._maybeGotUserMediaForAnswer),C(e,e._maybeGotUserMediaForAnswer)),l(this,"wait_local_media"))},s.prototype._replacedBy=function(e){v(this.callId+" being replaced by "+e.callId),"wait_local_media"==this.state?(v("Telling new call to wait for local media"),e.waitForLocalAVStream=!0):("create_offer"==this.state||"invite_sent"==this.state)&&(v("Handing local stream to new call"),e._maybeGotUserMediaForAnswer(this.localAVStream),delete this.localAVStream),e.localVideoElement=this.localVideoElement,e.remoteVideoElement=this.remoteVideoElement,e.remoteAudioElement=this.remoteAudioElement,this.successor=e,this.emit("replaced",e),this.hangup(!0)},s.prototype.hangup=function(e,t){if("ended"==this.state)return;v("Ending call "+this.callId),h(this,"local",e,!t);const n={version:0,call_id:this.callId,reason:e};u(this,"m.call.hangup",n)},s.prototype.setLocalVideoMuted=function(e){this.localAVStream&&a(this.localAVStream.getVideoTracks(),!e)},s.prototype.isLocalVideoMuted=function(){return!!this.localAVStream&&!c(this.localAVStream.getVideoTracks())},s.prototype.setMicrophoneMuted=function(e){this.localAVStream&&a(this.localAVStream.getAudioTracks(),!e)},s.prototype.isMicrophoneMuted=function(){return!!this.localAVStream&&!c(this.localAVStream.getAudioTracks())},s.prototype._maybeGotUserMediaForInvite=function(e){if(this.successor)return void this.successor._maybeGotUserMediaForAnswer(e);if("ended"==this.state)return;v("_maybeGotUserMediaForInvite -> "+this.type);const t=this,n=e,o={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:"video"===t.type}};if(e instanceof MediaStream){const n=this.getLocalVideoElement();n&&"video"==this.type&&(n.autoplay=!0,this.screenSharingStream?(v("Setting screen sharing stream to the local video element"),this.assignElement(n,this.screenSharingStream,"localVideo")):this.assignElement(n,e,"localVideo"),n.muted=!0,setTimeout((function(){const e=t.getLocalVideoElement();e.play&&t.playElement(e,"localVideo")}),0)),this.screenSharingStream&&(this.screenSharingStream.addTrack(e.getAudioTracks()[0]),e=this.screenSharingStream),this.localAVStream=e,a(e.getAudioTracks(),!0),this.peerConn=y(this),this.peerConn.addStream(e)}else{if("PermissionDeniedError"!==n.name)return v("Failed to getUserMedia: "+n.name),void this._getUserMediaFailed(n);v("User denied access to camera/microphone. Or possibly you are using an insecure domain. Receiving only."),this.peerConn=y(this)}this.peerConn.createOffer(C(t,t._gotLocalOffer),C(t,t._getLocalOfferFailed),o),l(t,"create_offer")},s.prototype._sendAnswer=function(e){u(this,"m.call.answer",this._answerContent).then(()=>{l(this,"connecting"),b(this)}).catch(e=>{l(this,"ringing"),this.client.cancelPendingEvent(e.event);let t=s.ERR_SEND_ANSWER,n="Failed to send answer";throw"UnknownDeviceError"==e.name&&(t=s.ERR_UNKNOWN_DEVICES,n="Unknown devices present in the room"),this.emit("error",f(t,n)),e})},s.prototype._maybeGotUserMediaForAnswer=function(e){const t=this;if("ended"==t.state)return;const n=e;if(e instanceof MediaStream){const n=t.getLocalVideoElement();n&&"video"==t.type&&(n.autoplay=!0,this.assignElement(n,e,"localVideo"),n.muted=!0,setTimeout((function(){const e=t.getLocalVideoElement();e.play&&t.playElement(e,"localVideo")}),0)),t.localAVStream=e,a(e.getAudioTracks(),!0),t.peerConn.addStream(e)}else{if("PermissionDeniedError"!==n.name)return v("Failed to getUserMedia: "+n.name),void this._getUserMediaFailed(n);v("User denied access to camera/microphone. Or possibly you are using an insecure domain. Receiving only.")}const o={mandatory:{OfferToReceiveAudio:!0,OfferToReceiveVideo:"video"===t.type}};t.peerConn.createAnswer((function(e){v("Created answer: ",e),t.peerConn.setLocalDescription(e,(function(){t._answerContent={version:0,call_id:t.callId,answer:{sdp:t.peerConn.localDescription.sdp,type:t.peerConn.localDescription.type}},t._sendAnswer()}),(function(){v("Error setting local description!")}),o)}),(function(e){v("Failed to create answer: "+e)})),l(t,"create_answer")},s.prototype._gotLocalIceCandidate=function(e){if(e.candidate){if(v("Got local ICE "+e.candidate.sdpMid+" candidate: "+e.candidate.candidate),"ended"==this.state)return;const t={candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex};d(this,t)}},s.prototype._gotRemoteIceCandidate=function(e){"ended"!=this.state&&(v("Got remote ICE "+e.sdpMid+" candidate: "+e.candidate),this.peerConn.addIceCandidate(new this.webRtc.RtcIceCandidate(e),(function(){}),(function(e){})))},s.prototype._receivedAnswer=function(e){if("ended"==this.state)return;this.peerConn.setRemoteDescription(new this.webRtc.RtcSessionDescription(e.answer),C(this,this._onSetRemoteDescriptionSuccess),C(this,this._onSetRemoteDescriptionError)),l(this,"connecting")},s.prototype._gotLocalOffer=function(e){const t=this;v("Created offer: ",e),"ended"!=t.state?t.peerConn.setLocalDescription(e,(function(){const e={version:0,call_id:t.callId,offer:{sdp:t.peerConn.localDescription.sdp,type:t.peerConn.localDescription.type},lifetime:s.CALL_TIMEOUT_MS};u(t,"m.call.invite",e).then(()=>{l(t,"invite_sent"),setTimeout((function(){"invite_sent"==t.state&&t.hangup("invite_timeout")}),s.CALL_TIMEOUT_MS)}).catch(e=>{let n=s.ERR_SEND_INVITE,o="Failed to send invite";throw"UnknownDeviceError"==e.name&&(n=s.ERR_UNKNOWN_DEVICES,o="Unknown devices present in the room"),t.client.cancelPendingEvent(e.event),h(t,"local",n,!1),t.emit("error",f(n,o)),e})}),(function(){v("Error setting local description!")})):v("Ignoring newly created offer on call ID "+t.callId+" because the call has ended")},s.prototype._getLocalOfferFailed=function(e){this.emit("error",f(s.ERR_LOCAL_OFFER_FAILED,"Failed to start audio for call!"))},s.prototype._getUserMediaFailed=function(e){h(this,"local","user_media_failed",!1),this.emit("error",f(s.ERR_NO_USER_MEDIA,"Couldn't start capturing media! Is your microphone set up and does this app have permission?"))},s.prototype._onIceConnectionStateChanged=function(){"ended"!=this.state&&(v("Ice connection state changed to: "+this.peerConn.iceConnectionState),"completed"==this.peerConn.iceConnectionState||"connected"==this.peerConn.iceConnectionState?(l(this,"connected"),this.didConnect=!0):"failed"==this.peerConn.iceConnectionState&&this.hangup("ice_failed"))},s.prototype._onSignallingStateChanged=function(){v("call "+this.callId+": Signalling state changed to: "+this.peerConn.signalingState)},s.prototype._onSetRemoteDescriptionSuccess=function(){v("Set remote description")},s.prototype._onSetRemoteDescriptionError=function(e){v("Failed to set remote description"+e)},s.prototype._onAddStream=function(e){v("Stream id "+e.stream.id+" added");const t=e.stream;t.getVideoTracks().length>0?(this.type="video",this.remoteAVStream=t,this.remoteAStream=t):(this.type="voice",this.remoteAStream=t);const n=this;w(t,(function(e){v("Track id "+e.id+" added"),e.onstarted=C(n,n._onRemoteStreamTrackStarted)})),void 0!==e.stream.oninactive?e.stream.oninactive=C(n,n._onRemoteStreamEnded):e.stream.onended=C(n,n._onRemoteStreamEnded),e.stream.onstarted=C(n,n._onRemoteStreamStarted),"video"===this.type?(m(this),g(this)):g(this)},s.prototype._onRemoteStreamStarted=function(e){l(this,"connected")},s.prototype._onRemoteStreamEnded=function(e){v("Remote stream ended"),this.hangupParty="remote",l(this,"ended"),p(this),"closed"!=this.peerConn.signalingState&&this.peerConn.close(),this.emit("hangup",this)},s.prototype._onRemoteStreamTrackStarted=function(e){l(this,"connected")},s.prototype._onHangupReceived=function(e){v("Hangup received"),h(this,"remote",e.reason,!0)},s.prototype._onAnsweredElsewhere=function(e){v("Answered elsewhere"),h(this,"remote","answered_elsewhere",!0)};const a=function(e,t){for(let n=0;n5)return v("Failed to send candidates on attempt %s. Giving up for now.",e.candidateSendTries),void(e.candidateSendTries=0);const o=500*Math.pow(2,e.candidateSendTries);++e.candidateSendTries,v("Failed to send candidates. Retrying in "+o+"ms"),setTimeout((function(){b(e)}),o)}))},E=function(e,t){e.client.callList[e.callId]=e,e.webRtc.getUserMedia(t,C(e,e._maybeGotUserMediaForInvite),C(e,e._maybeGotUserMediaForInvite)),l(e,"wait_local_media"),e.direction="outbound",e.config=t},y=function(e){const t=new e.webRtc.RtcPeerConnection({iceTransportPolicy:e.forceTURN?"relay":void 0,iceServers:e.turnServers});return t.oniceconnectionstatechange=C(e,e._onIceConnectionStateChanged),t.onsignalingstatechange=C(e,e._onSignallingStateChanged),t.onicecandidate=C(e,e._gotLocalIceCandidate),t.onaddstream=C(e,e._onAddStream),t},S=function(t){const n=!!e.window.navigator.webkitGetUserMedia;switch(t){case"voice":return{audio:{deviceId:k?{ideal:k}:void 0},video:!1};case"video":return{audio:{deviceId:k?{ideal:k}:void 0},video:{deviceId:x?{ideal:x}:void 0,width:n?{exact:640}:{ideal:640},height:n?{exact:360}:{ideal:360}}}}},C=function(e,t){return function(){return t.apply(e,arguments)}},w=function(e,t){!function(e,t){const n=e.getVideoTracks();for(let e=0;e-1)return!0;return!1}},l=i.navigator.getUserMedia||i.navigator.webkitGetUserMedia||i.navigator.mozGetUserMedia;l&&(c.getUserMedia=function(){return l.apply(i.navigator,arguments)});const u=i.navigator.mediaDevices&&i.navigator.mediaDevices.getDisplayMedia||i.navigator.getDisplayMedia;u&&(c.getDisplayMedia=u.bind(i.navigator.mediaDevices));try{c.RtcPeerConnection=i.RTCPeerConnection||i.webkitRTCPeerConnection||i.mozRTCPeerConnection,c.RtcSessionDescription=i.RTCSessionDescription||i.webkitRTCSessionDescription||i.mozRTCSessionDescription,c.RtcIceCandidate=i.RTCIceCandidate||i.webkitRTCIceCandidate||i.mozRTCIceCandidate,c.vendor=null,i.mozRTCPeerConnection?c.vendor="mozilla":i.webkitRTCPeerConnection?c.vendor="webkit":i.RTCPeerConnection&&(c.vendor="generic")}catch(e){return o.a.error("Failed to set up WebRTC object: possible browser interference?"),o.a.error(e),null}if(!(c.RtcIceCandidate&&c.RtcSessionDescription&&c.RtcPeerConnection&&c.getUserMedia))return null;const d=!!r&&r.forceTURN;return new s({webRtc:c,client:t,URL:i.URL,roomId:n,turnServers:t.getTurnServers(),forceTURN:t._forceTURN||d})}}).call(this,n(17))},function(e,t,n){"use strict";(function(e,o){n.d(t,"d",(function(){return A})),n.d(t,"c",(function(){return F})),n.d(t,"a",(function(){return N})),n.d(t,"b",(function(){return M}));var r=n(251),i=n.n(r),s=n(49),a=n(250),c=n(0),l=n(1),u=n(353),d=n(66),h=n(526),p=n(207),m=n(488),g=n(252),_=n(527),f=n(528),v=n(115),b=n(136),E=n(529),y=n(255),S=n(256),C=n(116),w=n(533),T=n(534),k=n(169),x=n(535),O=n(133),R=n(253);const D=p.a.DeviceVerification,I={[b.b.NAME]:b.b,[E.a.NAME]:E.a,[b.d]:x.a,[b.c]:x.a},A={RECIPROCATE_QR_CODE:b.b.NAME,SAS:E.a.NAME};function F(){return Boolean(e.Olm)}function N(e,t,n,o,r,i,s,c){if(this._onDeviceListUserCrossSigningUpdated=this._onDeviceListUserCrossSigningUpdated.bind(this),this._trustCrossSignedDevices=!0,this._reEmitter=new a.a(this),this._baseApis=e,this._sessionStore=t,this._userId=n,this._deviceId=o,this._clientStore=r,this._cryptoStore=i,this._roomList=s,c){this._verificationMethods=new Map;for(const e of c)"string"==typeof e?I[e]&&this._verificationMethods.set(e,I[e]):e.NAME?this._verificationMethods.set(e.NAME,e):console.warn("Excluding unknown verification method "+e)}else this._verificationMethods=I;this.backupInfo=null,this.backupKey=null,this._checkedForBackup=!1,this._sendingBackups=!1,this._olmDevice=new u.a(i),this._deviceList=new h.a(e,i,this._olmDevice),this._deviceList.on("userCrossSigningUpdated",this._onDeviceListUserCrossSigningUpdated),this._reEmitter.reEmit(this._deviceList,["crypto.devicesUpdated","crypto.willUpdateDevices"]),this._lastOneTimeKeyCheck=null,this._oneTimeKeyCheckInProgress=!1,this._roomEncryptors={},this._roomDecryptors={},this._supportedAlgorithms=l.t(m.a),this._deviceKeys={},this._globalBlacklistUnverifiedDevices=!1,this._globalErrorOnUnknownDevices=!0,this._outgoingRoomKeyRequestManager=new f.a(e,this._deviceId,this._cryptoStore),this._receivedRoomKeyRequests=[],this._receivedRoomKeyRequestCancellations=[],this._processingRoomKeyRequests=!1,this._lazyLoadMembers=!1,this._roomDeviceTrackingState={},this._lastNewSessionForced={},this._toDeviceVerificationRequests=new T.b,this._inRoomVerificationRequests=new w.b,this._sendKeyRequestsImmediately=!1;const d=this._baseApis._cryptoCallbacks||{},p=Object(g.e)(i,this._olmDevice);this._crossSigningInfo=new g.a(n,d,p),this._secretStorage=new _.b(e,d),!d.getCrossSigningKey&&d.getSecretStorageKey&&(d.getCrossSigningKey=async e=>g.a.getFromSecretStorage(e,this._secretStorage))}function M(e){if("string"!=typeof e||e.indexOf(",")<0)return null;const t=Uint8Array.from(e.split(","),e=>parseInt(e));return d.encodeBase64(t)}function P(e){if(e._oneTimeKeyCheckInProgress)return;const t=Date.now();if(null!==e._lastOneTimeKeyCheck&&t-e._lastOneTimeKeyCheck<6e4)return;e._lastOneTimeKeyCheck=t;const n=e._olmDevice.maxNumberOfOneTimeKeys(),o=Math.floor(n/2);function r(t){if(o<=t)return Promise.resolve();const n=Math.min(o-t,5);return e._olmDevice.generateOneTimeKeys(n).then(()=>async function(e){const t=await e._olmDevice.getOneTimeKeys(),n={},o=[];for(const r in t.curve25519)if(t.curve25519.hasOwnProperty(r)){const i={key:t.curve25519[r]};n["signed_curve25519:"+r]=i,o.push(e._signObject(i))}await Promise.all(o);const r=await e._baseApis.uploadKeysRequest({one_time_keys:n});return await e._olmDevice.markKeysAsPublished(),r}(e)).then(e=>{if(e.one_time_key_counts&&e.one_time_key_counts.signed_curve25519)return r(e.one_time_key_counts.signed_curve25519);throw new Error("response for uploading keys does not contain one_time_key_counts.signed_curve25519")})}e._oneTimeKeyCheckInProgress=!0,Promise.resolve().then(()=>void 0!==e._oneTimeKeyCount?Promise.resolve(e._oneTimeKeyCount):e._baseApis.uploadKeysRequest({}).then(e=>e.one_time_key_counts.signed_curve25519||0)).then(e=>r(e)).catch(e=>{c.a.error("Error uploading one-time keys",e.stack||e)}).finally(()=>{e._oneTimeKeyCount=void 0,e._oneTimeKeyCheckInProgress=!1})}l.o(N,s.EventEmitter),N.prototype.init=async function(t){const{exportedOlmDevice:n,pickleKey:o}=t||{};c.a.log("Crypto: initialising Olm..."),await e.Olm.init(),c.a.log(n?"Crypto: initialising Olm device from exported device...":"Crypto: initialising Olm device..."),await this._olmDevice.init({fromExportedDevice:n,pickleKey:o}),c.a.log("Crypto: loading device list..."),await this._deviceList.load(),this._deviceKeys["ed25519:"+this._deviceId]=this._olmDevice.deviceEd25519Key,this._deviceKeys["curve25519:"+this._deviceId]=this._olmDevice.deviceCurve25519Key,c.a.log("Crypto: fetching own devices...");let r=this._deviceList.getRawStoredDevicesForUser(this._userId);if(r||(r={}),!r[this._deviceId]){c.a.log("Crypto: adding this device to the store...");const e={keys:this._deviceKeys,algorithms:this._supportedAlgorithms,verified:D.VERIFIED,known:!0};r[this._deviceId]=e,this._deviceList.storeDevicesForUser(this._userId,r),this._deviceList.saveIfDirty()}await this._cryptoStore.doTxn("readonly",[v.a.STORE_ACCOUNT],e=>{this._cryptoStore.getCrossSigningKeys(e,e=>{e&&0!==Object.keys(e).length&&(c.a.log("Loaded cross-signing public keys from crypto store"),this._crossSigningInfo.setKeys(e))})}),this._deviceList.startTrackingDeviceList(this._userId),c.a.log("Crypto: checking for key backup..."),this._checkAndStartKeyBackup()},N.prototype.getCryptoTrustCrossSignedDevices=function(){return this._trustCrossSignedDevices},N.prototype.setCryptoTrustCrossSignedDevices=function(e){this._trustCrossSignedDevices=e;for(const e of this._deviceList.getKnownUserIds()){const t=this._deviceList.getRawStoredDevicesForUser(e);for(const n of Object.keys(t)){const t=this.checkDeviceTrust(e,n);if(!t.isLocallyVerified()&&t.isCrossSigningVerified()){const t=this._deviceList.getStoredDevice(e,n);this.emit("deviceVerificationChanged",e,n,t)}}}},N.prototype.createRecoveryKeyFromPassphrase=async function(t){const n=new e.Olm.PkDecryption;try{const e={};if(t){const o=await Object(y.c)(t);e.passphrase={algorithm:"m.pbkdf2",iterations:o.iterations,salt:o.salt},e.pubkey=n.init_with_private_key(o.key)}else e.pubkey=n.generate_key();const o=n.get_private_key();return{keyInfo:e,encodedPrivateKey:Object(S.b)(o),privateKey:o}}finally{n&&n.free()}},N.prototype.isCrossSigningReady=async function(){const e=this._crossSigningInfo.getId(),t=await this._crossSigningInfo.isStoredInSecretStorage(this._secretStorage),n=await this._secretStorage.hasKey();return e&&t&&n},N.prototype.bootstrapSecretStorage=async function({authUploadDeviceSigningKeys:e,createSecretStorageKey:t=(async()=>({})),keyBackupInfo:n,setupNewKeyBackup:o,setupNewSecretStorage:r,getKeyBackupPassphrase:i}={}){c.a.log("Bootstrapping Secure Secret Storage");const s={},a=Object.assign({},this._baseApis._cryptoCallbacks);let l=null;const u={};this._baseApis._cryptoCallbacks.getSecretStorageKey=async({keys:e},t)=>{for(const t of Object.keys(e))if(u[t])return[t,u[t]];const n=await a.getSecretStorageKey({keys:e},t);if(n){const[e,t]=n;u[e]=t}return n};const h=async(e,t)=>{e=e||{},t&&(e.key=t);const n=await this.addSecretStorageKey(_.a,e);return await this.setDefaultSecretStorageKeyId(n),t&&(u[n]=t),n},p=async()=>{this._baseApis._cryptoCallbacks.saveCrossSigningKeys=e=>Object.assign(s,e),this._baseApis._cryptoCallbacks.getCrossSigningKey=e=>s[e],await this.resetCrossSigningKeys(g.b.MASTER,{authUploadDeviceSigningKeys:e})},m=async(e,t)=>{if(!t.mac){const n=await this._baseApis._cryptoCallbacks.getSecretStorageKey({keys:{[e]:t}},"");if(n){const o=n[1];u[e]=o;const{iv:r,mac:i}=await _.b._calculateKeyCheck(o);t.iv=r,t.mac=i,await this._baseApis.setAccountData("m.secret_storage.key."+e,t)}}};try{const e=await this.getSecretStorageKey(),[u,f]=e||[null,null],v=await this._crossSigningInfo.isStoredInSecretStorage(this._secretStorage),b=!r&&v;if(b||n)if(!b&&n){c.a.log("Secret storage default key not found, using key backup key");const e=await this.getSessionBackupPrivateKey()||await i();await p();const t={};n.auth_data.private_key_salt&&n.auth_data.private_key_iterations&&(t.passphrase={algorithm:"m.pbkdf2",iterations:n.auth_data.private_key_iterations,salt:n.auth_data.private_key_salt,bits:256}),l=await h(t,e),await this.storeSecret("m.megolm_backup.v1",d.encodeBase64(e),[l]),c.a.log("Adding cross signing signature to key backup"),await this._crossSigningInfo.signObject(n.auth_data,"master"),await this._baseApis._http.authedRequest(void 0,"PUT","/room_keys/version/"+n.version,void 0,n,{prefix:k.i})}else this._crossSigningInfo.getId()?(c.a.log("Cross signing keys are present in secret storage"),f&&f.algorithm===_.a&&await m(u,f)):(c.a.log("Cross-signing private keys found in secret storage"),await this.checkOwnCrossSigningTrust(),f&&f.algorithm===_.a&&await m(u,f));else{if(c.a.log("Cross-signing private keys not found in secret storage, creating new keys"),await p(),r||!f||f.algorithm!==_.a){const{keyInfo:e,privateKey:n}=await t();l=await h(e,n)}f&&f.algorithm===_.a&&await m(u,f)}if(Object.keys(s).length&&(c.a.log("Storing cross-signing private keys in secret storage"),a.saveCrossSigningKeys||await g.a.storeInSecretStorage(s,this._secretStorage)),o&&!n){const e=await this._baseApis.prepareKeyBackupVersion(null,{secureSecretStorage:!0});await this._baseApis.createKeyBackupVersion(e)}if(this._crossSigningInfo._cacheCallbacks)for(const e of["self_signing","user_signing"])c.a.log(`Cache ${e} cross-signing private key locally`),await this._crossSigningInfo.getCrossSigningKey(e);const E=await this.getSecret("m.megolm_backup.v1");if(E){c.a.info("Got session backup key from secret storage: caching");const e=M(E);e&&await this.storeSecret("m.megolm_backup.v1",e,[l||u]);const t=new Uint8Array(d.decodeBase64(e||E));await this.storeSessionBackupPrivateKey(t)}}finally{for(const e of Object.keys(this._baseApis._cryptoCallbacks))delete this._baseApis._cryptoCallbacks[e];Object.assign(this._baseApis._cryptoCallbacks,a)}c.a.log("Secure Secret Storage ready")},N.prototype.addSecretStorageKey=function(e,t,n){return this._secretStorage.addKey(e,t,n)},N.prototype.hasSecretStorageKey=function(e){return this._secretStorage.hasKey(e)},N.prototype.getSecretStorageKey=function(e){return this._secretStorage.getKey(e)},N.prototype.storeSecret=function(e,t,n){return this._secretStorage.store(e,t,n)},N.prototype.getSecret=function(e){return this._secretStorage.get(e)},N.prototype.isSecretStored=function(e,t){return this._secretStorage.isStored(e,t)},N.prototype.requestSecret=function(e,t){return t||(t=Object.keys(this._deviceList.getRawStoredDevicesForUser(this._userId))),this._secretStorage.request(e,t)},N.prototype.getDefaultSecretStorageKeyId=function(){return this._secretStorage.getDefaultKeyId()},N.prototype.setDefaultSecretStorageKeyId=function(e){return this._secretStorage.setDefaultKeyId(e)},N.prototype.checkSecretStorageKey=function(e,t){return this._secretStorage.checkKey(e,t)},N.prototype.checkSecretStoragePrivateKey=function(t,n){let o=null;try{o=new e.Olm.PkDecryption;return o.init_with_private_key(t)===n}finally{o&&o.free()}},N.prototype.getSessionBackupPrivateKey=async function(){let e=await new Promise(e=>{this._cryptoStore.doTxn("readonly",[v.a.STORE_ACCOUNT],t=>{this._cryptoStore.getSecretStorePrivateKey(t,e,"m.megolm_backup.v1")})});if(e&&"string"==typeof e&&(e=new Uint8Array(d.decodeBase64(M(e)||e)),await this.storeSessionBackupPrivateKey(e)),e&&e.ciphertext){const t=o.from(this._olmDevice._pickleKey),n=await Object(R.a)(e,t,"m.megolm_backup.v1");e=d.decodeBase64(n)}return e},N.prototype.storeSessionBackupPrivateKey=async function(e){if(!(e instanceof Uint8Array))throw new Error("storeSessionBackupPrivateKey expects Uint8Array, got "+e);const t=o.from(this._olmDevice._pickleKey);return e=await Object(R.b)(d.encodeBase64(e),t,"m.megolm_backup.v1"),this._cryptoStore.doTxn("readwrite",[v.a.STORE_ACCOUNT],t=>{this._cryptoStore.storeSecretStorePrivateKey(t,"m.megolm_backup.v1",e)})},N.prototype.checkCrossSigningPrivateKey=function(t,n){let o=null;try{o=new e.Olm.PkSigning;return o.init_with_seed(t)===n}finally{o&&o.free()}},N.prototype.resetCrossSigningKeys=async function(e,{authUploadDeviceSigningKeys:t=(async e=>await e())}={}){c.a.info("Resetting cross-signing keys at level "+e);const n=Object.assign({},this._crossSigningInfo.keys);try{await this._crossSigningInfo.resetKeys(e),await this._signObject(this._crossSigningInfo.keys.master);const n={};for(const[e,t]of Object.entries(this._crossSigningInfo.keys))n[e+"_key"]=t;await t(async e=>{await this._baseApis.uploadDeviceSigningKeys(e,n)}),await this._cryptoStore.doTxn("readwrite",[v.a.STORE_ACCOUNT],e=>{this._cryptoStore.storeCrossSigningKeys(e,this._crossSigningInfo.keys)})}catch(e){throw c.a.error("Resetting cross-signing keys failed, revert to previous keys",e),this._crossSigningInfo.keys=n,e}this._baseApis.emit("crossSigning.keysChanged",{}),await this._afterCrossSigningLocalKeyChange(),c.a.info("Cross-signing key reset complete")},N.prototype._afterCrossSigningLocalKeyChange=async function(){c.a.info("Starting cross-signing key change post-processing");const e=this._deviceList.getStoredDevice(this._userId,this._deviceId),t=await this._crossSigningInfo.signDevice(this._userId,e);c.a.info("Starting background key sig upload for "+this._deviceId);const n=({shouldEmit:e})=>this._baseApis.uploadKeySignatures({[this._userId]:{[this._deviceId]:t}}).then(t=>{const{failures:o}=t||{};if(Object.keys(o||[]).length>0)throw e&&this._baseApis.emit("crypto.keySignatureUploadFailure",o,"_afterCrossSigningLocalKeyChange",n),new O.c("Key upload failed",{failures:o});c.a.info("Finished background key sig upload for "+this._deviceId)}).catch(e=>{c.a.error("Error during background key sig upload for "+this._deviceId,e)});n({shouldEmit:!0});const o=this._baseApis._cryptoCallbacks.shouldUpgradeDeviceVerifications;if(o){c.a.info("Starting device verification upgrade");const e={};for(const[t,n]of Object.entries(this._deviceList._crossSigningInfo)){const o=await this._checkForDeviceVerificationUpgrade(t,g.a.fromStorage(n,t));o&&(e[t]=o)}if(Object.keys(e).length>0){c.a.info(`Found ${Object.keys(e).length} verif users to upgrade`);try{const t=await o({users:e});if(t)for(const n of t)n in e&&await this._baseApis.setDeviceVerified(n,e[n].crossSigningInfo.getId())}catch(e){c.a.log("shouldUpgradeDeviceVerifications threw an error: not upgrading",e)}}c.a.info("Finished device verification upgrade")}c.a.info("Finished cross-signing key change post-processing")},N.prototype._checkForDeviceVerificationUpgrade=async function(e,t){const n=this._crossSigningInfo.checkUserTrust(t);if(t.firstUse&&!n.verified){const n=this._deviceList.getRawStoredDevicesForUser(e),o=await this._checkForValidDeviceSignature(e,t.keys.master,n);if(o.length)return{devices:o.map(e=>p.a.fromStorage(n[e],e)),crossSigningInfo:t}}},N.prototype._checkForValidDeviceSignature=async function(e,t,n){const o=[];if(n&&t.signatures&&t.signatures[e])for(const r of Object.keys(t.signatures[e])){const[,i]=r.split(":",2);if(i in n&&n[i].verified===D.VERIFIED)try{await d.verifySignature(this._olmDevice,t,e,i,n[i].keys[r]),o.push(i)}catch(e){}}return o},N.prototype.getCrossSigningId=function(e){return this._crossSigningInfo.getId(e)},N.prototype.getStoredCrossSigningForUser=function(e){return this._deviceList.getStoredCrossSigningForUser(e)},N.prototype.checkUserTrust=function(e){const t=this._deviceList.getStoredCrossSigningForUser(e);return t?this._crossSigningInfo.checkUserTrust(t):new g.d(!1,!1,!1)},N.prototype.checkDeviceTrust=function(e,t){const n=this._deviceList.getStoredDevice(e,t);return this._checkDeviceInfoTrust(e,n)},N.prototype._checkDeviceInfoTrust=function(e,t){const n=!(!t||!t.isVerified()),o=this._deviceList.getStoredCrossSigningForUser(e);if(t&&o){const r=this._trustCrossSignedDevices||e===this._userId;return this._crossSigningInfo.checkDeviceTrust(o,t,n,r)}return new g.c(!1,!1,n,!1)},N.prototype._onDeviceListUserCrossSigningUpdated=async function(e){if(e===this._userId){const t=this._deviceList.getStoredCrossSigningForUser(e),n=t?t.getId():null,o=this._crossSigningInfo.getId(),r=o!==n;o&&n&&!r?await this.checkOwnCrossSigningTrust():(this._storeTrustedSelfKeys(null),this.emit("crossSigning.keysChanged",{}),this.emit("userTrustStatusChanged",this._userId,this.checkUserTrust(e)))}else{await this._checkDeviceVerifications(e);const t=this._deviceList.getStoredCrossSigningForUser(e);t&&(t.updateCrossSigningVerifiedBefore(this.checkUserTrust(e).isCrossSigningVerified()),this._deviceList.setRawStoredCrossSigningForUser(e,t.toStorage())),this.emit("userTrustStatusChanged",e,this.checkUserTrust(e))}},N.prototype.checkOwnCrossSigningTrust=async function(){const e=this._userId;await this.downloadKeys([this._userId]);const t=this._deviceList.getStoredCrossSigningForUser(e);if(!t)return void c.a.error("Got cross-signing update event for user "+e+" but no new cross-signing information found!");const n=t.getId(),o=this._crossSigningInfo.getId()!==n;if(o){c.a.info("Got new master public key",n);let e=null;try{if(e=(await this._crossSigningInfo.getCrossSigningKey("master",n))[1],!e)throw new Error("Cross-signing master private key not available")}finally{e&&e.free()}c.a.info("Got matching private key from callback for new public master key")}const r=this._crossSigningInfo.getId("self_signing"),i=this._crossSigningInfo.getId("user_signing");this._storeTrustedSelfKeys(t.keys);const s={};if(r!==t.getId("self_signing")){c.a.info("Got new self-signing key",t.getId("self_signing"));const e=this._deviceList.getStoredDevice(this._userId,this._deviceId),n=await this._crossSigningInfo.signDevice(this._userId,e);s[this._deviceId]=n}if(i!==t.getId("user_signing")&&c.a.info("Got new user-signing key",t.getId("user_signing")),o){const e=this._crossSigningInfo.keys.master;await this._signObject(e);const t=e.signatures[this._userId]["ed25519:"+this._deviceId];s[this._crossSigningInfo.getId()]=Object.assign({},e,{signatures:{[this._userId]:{["ed25519:"+this._deviceId]:t}}})}const a=Object.keys(s);if(a.length){const e=({shouldEmit:t})=>(c.a.info("Starting background key sig upload for "+a),this._baseApis.uploadKeySignatures({[this._userId]:s}).then(n=>{const{failures:o}=n||{};if(c.a.info("Finished background key sig upload for "+a),Object.keys(o||[]).length>0)throw t&&this._baseApis.emit("crypto.keySignatureUploadFailure",o,"checkOwnCrossSigningTrust",e),new O.c("Key upload failed",{failures:o})}).catch(e=>{c.a.error("Error during background key sig upload for "+a,e)}));e({shouldEmit:!0})}this.emit("userTrustStatusChanged",e,this.checkUserTrust(e)),o&&(this._baseApis.emit("crossSigning.keysChanged",{}),await this._afterCrossSigningLocalKeyChange()),await this.checkKeyBackup()},N.prototype._storeTrustedSelfKeys=async function(e){e?this._crossSigningInfo.setKeys(e):this._crossSigningInfo.clearKeys(),await this._cryptoStore.doTxn("readwrite",[v.a.STORE_ACCOUNT],e=>{this._cryptoStore.storeCrossSigningKeys(e,this._crossSigningInfo.keys)})},N.prototype._checkDeviceVerifications=async function(e){const t=this._baseApis._cryptoCallbacks.shouldUpgradeDeviceVerifications;if(t){if(c.a.info("Starting device verification upgrade for "+e),this._crossSigningInfo.keys.user_signing){const n=this._deviceList.getStoredCrossSigningForUser(e);if(n){const o=await this._checkForDeviceVerificationUpgrade(e,n);if(o){(await t({users:{[e]:o}})).includes(e)&&await this._baseApis.setDeviceVerified(e,n.getId())}}}c.a.info("Finished device verification upgrade for "+e)}},N.prototype._checkAndStartKeyBackup=async function(){if(c.a.log("Checking key backup status..."),this._baseApis.isGuest())return c.a.log("Skipping key backup check since user is guest"),this._checkedForBackup=!0,null;let e;try{e=await this._baseApis.getKeyBackupVersion()}catch(e){return c.a.log("Error checking for active key backup",e),404===e.httpStatus&&(this._checkedForBackup=!0),null}this._checkedForBackup=!0;const t=await this.isKeyBackupTrusted(e);return t.usable&&!this.backupInfo?(c.a.log("Found usable key backup v"+e.version+": enabling key backups"),this._baseApis.enableKeyBackup(e)):!t.usable&&this.backupInfo?(c.a.log("No usable key backup: disabling key backup"),this._baseApis.disableKeyBackup()):t.usable||this.backupInfo?t.usable&&this.backupInfo&&(e.version!==this.backupInfo.version?(c.a.log("On backup version "+this.backupInfo.version+" but found version "+e.version+": switching."),this._baseApis.disableKeyBackup(),this._baseApis.enableKeyBackup(e)):c.a.log("Backup version "+e.version+" still current")):c.a.log("No usable key backup: not enabling key backup"),{backupInfo:e,trustInfo:t}},N.prototype.setTrustedBackupPubKey=async function(e){this._sessionStore.setLocalTrustedBackupPubKey(e),await this.checkKeyBackup()},N.prototype.checkKeyBackup=async function(){return this._checkedForBackup=!1,this._checkAndStartKeyBackup()},N.prototype.isKeyBackupTrusted=async function(e){const t={usable:!1,trusted_locally:!1,sigs:[]};if(!(e&&e.algorithm&&e.auth_data&&e.auth_data.public_key&&e.auth_data.signatures))return c.a.info("Key backup is absent or missing required data"),t;const n=this._sessionStore.getLocalTrustedBackupPubKey();e.auth_data.public_key===n&&(c.a.info("Backup public key "+n+" is trusted locally"),t.trusted_locally=!0);const o=e.auth_data.signatures[this._userId]||[];for(const n of Object.keys(o)){const o=n.split(":");if("ed25519"!==o[0]){c.a.log("Ignoring unknown signature type: "+o[0]);continue}const r={deviceId:o[1]},i=this._crossSigningInfo.getId();if(i===r.deviceId){r.crossSigningId=!0;try{await d.verifySignature(this._olmDevice,e.auth_data,this._userId,r.deviceId,i),r.valid=!0}catch(e){c.a.warning("Bad signature from cross signing key "+i,e),r.valid=!1}t.sigs.push(r);continue}const s=this._deviceList.getStoredDevice(this._userId,r.deviceId);if(s){r.device=s,r.deviceTrust=await this.checkDeviceTrust(this._userId,r.deviceId);try{await d.verifySignature(this._olmDevice,e.auth_data,this._userId,s.deviceId,s.getFingerprint()),r.valid=!0}catch(t){c.a.info("Bad signature from key ID "+n+" userID "+this._userId+" device ID "+s.deviceId+" fingerprint: "+s.getFingerprint(),e.auth_data,t),r.valid=!1}}else r.valid=null,c.a.info("Ignoring signature from unknown key "+n);t.sigs.push(r)}return t.usable=t.sigs.some(e=>e.valid&&(e.device&&e.deviceTrust.isVerified()||e.crossSigningId)),t.usable|=t.trusted_locally,t},N.prototype.enableLazyLoading=function(){this._lazyLoadMembers=!0},N.prototype.registerEventHandlers=function(e){const t=this;e.on("RoomMember.membership",(function(e,n,o){try{t._onRoomMembership(e,n,o)}catch(e){c.a.error("Error handling membership change:",e)}})),e.on("toDeviceEvent",t._onToDeviceEvent.bind(t));const n=t._onTimelineEvent.bind(t);e.on("Room.timeline",n),e.on("Event.decrypted",n)},N.prototype.start=function(){this._outgoingRoomKeyRequestManager.start()},N.prototype.stop=function(){this._outgoingRoomKeyRequestManager.stop(),this._deviceList.stop()},N.getOlmVersion=function(){return u.a.getOlmVersion()},N.prototype.getDeviceEd25519Key=function(){return this._olmDevice.deviceEd25519Key},N.prototype.getDeviceCurve25519Key=function(){return this._olmDevice.deviceCurve25519Key},N.prototype.setGlobalBlacklistUnverifiedDevices=function(e){this._globalBlacklistUnverifiedDevices=e},N.prototype.getGlobalBlacklistUnverifiedDevices=function(){return this._globalBlacklistUnverifiedDevices},N.prototype.setGlobalErrorOnUnknownDevices=function(e){this._globalErrorOnUnknownDevices=e},N.prototype.getGlobalErrorOnUnknownDevices=function(){return this._globalErrorOnUnknownDevices},N.prototype.uploadDeviceKeys=function(){const e=this,t=e._userId,n=e._deviceId,o={algorithms:e._supportedAlgorithms,device_id:n,keys:e._deviceKeys,user_id:t};return e._signObject(o).then(()=>e._baseApis.uploadKeysRequest({device_keys:o}))},N.prototype.updateOneTimeKeyCount=function(e){if(!isFinite(e))throw new TypeError("Parameter for updateOneTimeKeyCount has to be a number");this._oneTimeKeyCount=e},N.prototype.downloadKeys=function(e,t){return this._deviceList.downloadKeys(e,t)},N.prototype.getStoredDevicesForUser=function(e){return this._deviceList.getStoredDevicesForUser(e)},N.prototype.getStoredDevice=function(e,t){return this._deviceList.getStoredDevice(e,t)},N.prototype.saveDeviceList=function(e){return this._deviceList.saveIfDirty(e)},N.prototype.setDeviceVerification=async function(e,t,n,o,r){void 0===n&&(n=null),void 0===o&&(o=null),void 0===r&&(r=null);const i=this._deviceList.getStoredCrossSigningForUser(e);if(i&&i.getId()===t){if(null!==o||null!==r)throw new Error("Cannot set blocked or known for a cross-signing key");if(!n)throw new Error("Cannot set a cross-signing key as unverified");if(this._crossSigningInfo.getId()||e!==this._crossSigningInfo.userId||(this._storeTrustedSelfKeys(i.keys),this.emit("userTrustStatusChanged",this._userId,this.checkUserTrust(e))),e!==this._userId){c.a.info("Master key "+i.getId()+" for "+e+" marked verified. Signing...");const n=await this._crossSigningInfo.signUser(i);if(n){const o=async({shouldEmit:r})=>{c.a.info("Uploading signature for "+e+"...");const i=await this._baseApis.uploadKeySignatures({[e]:{[t]:n}}),{failures:s}=i||{};if(Object.keys(s||[]).length>0)throw r&&this._baseApis.emit("crypto.keySignatureUploadFailure",s,"setDeviceVerification",o),new O.c("Key upload failed",{failures:s})};await o({shouldEmit:!0})}return n}return i}const s=this._deviceList.getRawStoredDevicesForUser(e);if(!s||!s[t])throw new Error("Unknown device "+e+":"+t);const a=s[t];let l=a.verified;n?l=D.VERIFIED:null!==n&&l==D.VERIFIED&&(l=D.UNVERIFIED),o?l=D.BLOCKED:null!==o&&l==D.BLOCKED&&(l=D.UNVERIFIED);let u=a.known;if(null!==r&&(u=r),a.verified===l&&a.known===u||(a.verified=l,a.known=u,this._deviceList.storeDevicesForUser(e,s),this._deviceList.saveIfDirty()),n&&e===this._userId){c.a.info("Own device "+t+" marked verified: signing");const n=await this._crossSigningInfo.signDevice(e,p.a.fromStorage(a,t));if(n){const o=async({shouldEmit:r})=>{c.a.info("Uploading signature for "+t);const i=await this._baseApis.uploadKeySignatures({[e]:{[t]:n}}),{failures:s}=i||{};if(Object.keys(s||[]).length>0)throw r&&this._baseApis.emit("crypto.keySignatureUploadFailure",s,"setDeviceVerification",o),new O.c("Key upload failed",{failures:s})};await o({shouldEmit:!0})}}const d=p.a.fromStorage(a,t);return this.emit("deviceVerificationChanged",e,t,d),d},N.prototype.findVerificationRequestDMInProgress=function(e){return this._inRoomVerificationRequests.findRequestInProgress(e)},N.prototype.requestVerificationDM=function(e,t){const n=this._inRoomVerificationRequests.findRequestInProgress(t);if(n)return Promise.resolve(n);const o=new w.a(this._baseApis,t,e);return this._requestVerificationWithChannel(e,o,this._inRoomVerificationRequests)},N.prototype.requestVerification=function(e,t){t||(t=Object.keys(this._deviceList.getRawStoredDevicesForUser(e)));const n=this._toDeviceVerificationRequests.findRequestInProgress(e,t);if(n)return Promise.resolve(n);const o=new T.a(this._baseApis,e,t,T.a.makeTransactionId());return this._requestVerificationWithChannel(e,o,this._toDeviceVerificationRequests)},N.prototype._requestVerificationWithChannel=async function(e,t,n){let o=new C.k(t,this._verificationMethods,this._baseApis);t.transactionId&&n.setRequestByChannel(t,o),await o.sendRequest();const r=n.getRequestByChannel(t);return r?o=r:(c.a.log(`Crypto: adding new request to requestsByTxnId with id ${t.transactionId} ${t.roomId}`),n.setRequestByChannel(t,o)),o},N.prototype.beginKeyVerification=function(e,t,n,o=null){let r;if(o){if(r=this._toDeviceVerificationRequests.getRequestBySenderAndTxnId(t,o),!r)throw new Error(`No request found for user ${t} with transactionId `+o)}else{o=T.a.makeTransactionId();const e=new T.a(this._baseApis,t,[n],o,n);r=new C.k(e,this._verificationMethods,this._baseApis),this._toDeviceVerificationRequests.setRequestBySenderAndTxnId(t,o,r)}return r.beginKeyVerification(e,{userId:t,deviceId:n})},N.prototype.legacyDeviceVerification=async function(e,t,n){const o=T.a.makeTransactionId(),r=new T.a(this._baseApis,e,[t],o,t),i=new C.k(r,this._verificationMethods,this._baseApis);this._toDeviceVerificationRequests.setRequestBySenderAndTxnId(e,o,i);const s=i.beginKeyVerification(n,{userId:e,deviceId:t});return await Promise.race([s.verify(),i.waitFor(e=>e.started)]),i},N.prototype.getOlmSessionsForUser=async function(e){const t=this.getStoredDevicesForUser(e)||[],n={};for(let e=0;e0)return null;const o=this._deviceList.getDeviceByIdentityKey(n,t);if(null===o)return null;const r=e.getClaimedEd25519Key();return r?r!==o.getFingerprint()?(c.a.warn("Event "+e.getId()+" claims ed25519 key "+r+"but sender device has key "+o.getFingerprint()),null):o:(c.a.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),null)},N.prototype.forceDiscardSession=function(e){const t=this._roomEncryptors[e];if(void 0===t)throw new Error("Room not encrypted");if(void 0===t.forceDiscardSession)throw new Error("Room encryption algorithm doesn't support session discarding");t.forceDiscardSession()},N.prototype.setRoomEncryption=async function(e,t,n){if(!t.algorithm)return void c.a.log("Ignoring setRoomEncryption with no algorithm");const o=this._roomList.getRoomEncryption(e);if(o&&JSON.stringify(o)!=JSON.stringify(t))return void c.a.error("Ignoring m.room.encryption event which requests a change of config in "+e);if(this._roomEncryptors[e])return;let r=null;o||(r=this._roomList.setRoomEncryption(e,t));const i=m.c[t.algorithm];if(!i)throw new Error("Unable to encrypt with "+t.algorithm);const s=new i({userId:this._userId,deviceId:this._deviceId,crypto:this,olmDevice:this._olmDevice,baseApis:this._baseApis,roomId:e,config:t});this._roomEncryptors[e]=s,r&&await r,this._lazyLoadMembers?c.a.log("Enabling encryption in "+e):(c.a.log("Enabling encryption in "+e+"; starting to track device lists for all users therein"),await this.trackRoomDevices(e),this.inhibitDeviceQuery||this._deviceList.refreshOutdatedDeviceLists())},N.prototype.trackRoomDevices=function(e){const t=async()=>{if(!this._roomEncryptors[e])return;const t=this._clientStore.getRoom(e);if(!t)throw new Error("Unable to start tracking devices in unknown room "+e);c.a.log(`Starting to track devices for room ${e} ...`);(await t.getEncryptionTargetMembers()).forEach(e=>{this._deviceList.startTrackingDeviceList(e.userId)})};let n=this._roomDeviceTrackingState[e];return n||(n=t(),this._roomDeviceTrackingState[e]=n),n},N.prototype.ensureOlmSessionsForUsers=function(e){const t={};for(let n=0;n{this._cryptoStore.getAllEndToEndInboundGroupSessions(t,t=>{if(null===t)return;const n=this._olmDevice.exportInboundGroupSession(t.senderKey,t.sessionId,t.sessionData);delete n.first_known_index,n.algorithm=d.MEGOLM_ALGORITHM,e.push(n)})}),e},N.prototype.importRoomKeys=function(e,t={}){let n=0,o=0;const r=e.length;function i(){t.progressCallback({stage:"load_keys",successes:n,failures:o,total:r})}return Promise.all(e.map(e=>{if(!e.room_id||!e.algorithm)return c.a.warn("ignoring room key entry with missing fields",e),o++,t.progressCallback&&i(),null;return this._getRoomDecryptor(e.room_id,e.algorithm).importRoomKey(e).finally(e=>{n++,t.progressCallback&&i()})}))},N.prototype.scheduleKeyBackupSend=async function(e=1e4){if(!this._sendingBackups){this._sendingBackups=!0;try{const t=Math.random()*e;await Object(l.A)(t);let n=0;for(;;){if(!this.backupKey)return;try{if(0===await this._backupPendingKeys(200))return;n=0}catch(e){if(n++,c.a.log("Key backup request failed",e),e.data&&("M_NOT_FOUND"==e.data.errcode||"M_WRONG_ROOM_KEYS_VERSION"==e.data.errcode))throw await this.checkKeyBackup(),this.emit("crypto.keyBackupFailed",e.data.errcode),e}n&&await Object(l.A)(1e3*Math.pow(2,Math.min(n-1,4)))}}finally{this._sendingBackups=!1}}},N.prototype._backupPendingKeys=async function(e){const t=await this._cryptoStore.getSessionsNeedingBackup(e);if(!t.length)return 0;let n=await this._cryptoStore.countSessionsNeedingBackup();this.emit("crypto.keyBackupSessionsRemaining",n);const o={};for(const e of t){const t=e.sessionData.room_id;void 0===o[t]&&(o[t]={sessions:{}});const n=await this._olmDevice.exportInboundGroupSession(e.senderKey,e.sessionId,e.sessionData);n.algorithm=d.MEGOLM_ALGORITHM,delete n.session_id,delete n.room_id;const r=n.first_known_index;delete n.first_known_index;const i=this.backupKey.encrypt(JSON.stringify(n)),s=(n.forwarding_curve25519_key_chain||[]).length,a=this._deviceList.getUserByIdentityKey(d.MEGOLM_ALGORITHM,e.senderKey),c=this._deviceList.getDeviceByIdentityKey(d.MEGOLM_ALGORITHM,e.senderKey),l=this._checkDeviceInfoTrust(a,c).isVerified();o[t].sessions[e.sessionId]={first_message_index:r,forwarded_count:s,is_verified:l,session_data:i}}return await this._baseApis.sendKeyBackup(void 0,void 0,this.backupInfo.version,{rooms:o}),await this._cryptoStore.unmarkSessionsNeedingBackup(t),n=await this._cryptoStore.countSessionsNeedingBackup(),this.emit("crypto.keyBackupSessionsRemaining",n),t.length},N.prototype.backupGroupSession=async function(e,t,n,o,r,i,s){if(!this.backupInfo)throw new Error("Key backups are not enabled");await this._cryptoStore.markSessionsNeedingBackup([{senderKey:t,sessionId:o}]),this.scheduleKeyBackupSend()},N.prototype.scheduleAllGroupSessionsForBackup=async function(){await this.flagAllGroupSessionsForBackup(),this.scheduleKeyBackupSend(0)},N.prototype.flagAllGroupSessionsForBackup=async function(){await this._cryptoStore.doTxn("readwrite",[v.a.STORE_INBOUND_GROUP_SESSIONS,v.a.STORE_BACKUP],e=>{this._cryptoStore.getAllEndToEndInboundGroupSessions(e,t=>{null!==t&&this._cryptoStore.markSessionsNeedingBackup([t],e)})});const e=await this._cryptoStore.countSessionsNeedingBackup();return this.emit("crypto.keyBackupSessionsRemaining",e),e},N.prototype.prepareToEncrypt=function(e){const t=e.roomId,n=this._roomEncryptors[t];n&&n.prepareToEncrypt(e)},N.prototype.encryptEvent=async function(e,t){if(!t)throw new Error("Cannot send encrypted messages in unknown rooms");const n=e.getRoomId(),o=this._roomEncryptors[n];if(!o)throw new Error("Room was previously configured to use encryption, but is no longer. Perhaps the homeserver is hiding the configuration event.");this._roomDeviceTrackingState[n]||this.trackRoomDevices(n),await this._roomDeviceTrackingState[n];let r=e.getContent();const i=r["m.relates_to"];i&&(r=Object.assign({},r),delete r["m.relates_to"]);const s=await o.encryptMessage(t,e.getType(),r);i&&(s["m.relates_to"]=i),e.makeEncrypted("m.room.encrypted",s,this._olmDevice.deviceCurve25519Key,this._olmDevice.deviceEd25519Key)},N.prototype.decryptEvent=function(e){if(e.isRedacted())return Promise.resolve({clearEvent:{room_id:e.getRoomId(),type:"m.room.message",content:{}}});const t=e.getWireContent();return this._getRoomDecryptor(e.getRoomId(),t.algorithm).decryptEvent(e)},N.prototype.handleDeviceListChanges=async function(e,t){e.oldSyncToken&&await this._evalDeviceListChanges(t)},N.prototype.requestRoomKey=function(e,t,n=!1){return this._outgoingRoomKeyRequestManager.queueRoomKeyRequest(e,t,n).then(()=>{this._sendKeyRequestsImmediately&&this._outgoingRoomKeyRequestManager.sendQueuedRequests()}).catch(e=>{c.a.error("Error requesting key for event",e)})},N.prototype.cancelRoomKeyRequest=function(e){this._outgoingRoomKeyRequestManager.cancelRoomKeyRequest(e).catch(e=>{c.a.warn("Error clearing pending room key requests",e)})},N.prototype.cancelAndResendAllOutgoingKeyRequests=function(){return this._outgoingRoomKeyRequestManager.cancelAndResendAllOutgoingRequests()},N.prototype.onCryptoEvent=async function(e){const t=e.getRoomId(),n=e.getContent();try{await this.setRoomEncryption(t,n,!0)}catch(e){c.a.error("Error configuring encryption in room "+t+":",e)}},N.prototype.onSyncWillProcess=async function(e){e.oldSyncToken||(c.a.log("Initial sync performed - resetting device tracking state"),this._deviceList.stopTrackingAllDeviceLists(),this._deviceList.startTrackingDeviceList(this._userId),this._roomDeviceTrackingState={}),this._sendKeyRequestsImmediately=!1},N.prototype.onSyncCompleted=async function(e){const t=e.nextSyncToken;this._deviceList.setSyncToken(e.nextSyncToken),this._deviceList.saveIfDirty(),this._deviceList.lastKnownSyncToken=t,this._deviceList.startTrackingDeviceList(this._userId),this._deviceList.refreshOutdatedDeviceLists(),e.catchingUp||(P(this),this._processReceivedRoomKeyRequests(),this._outgoingRoomKeyRequestManager.sendQueuedRequests(),this._sendKeyRequestsImmediately=!0)},N.prototype._evalDeviceListChanges=async function(e){if(e.changed&&Array.isArray(e.changed)&&e.changed.forEach(e=>{this._deviceList.invalidateUserDeviceList(e)}),e.left&&Array.isArray(e.left)&&e.left.length){const t=new Set(await this._getTrackedE2eUsers());e.left.forEach(e=>{t.has(e)||this._deviceList.stopTrackingDeviceList(e)})}},N.prototype._getTrackedE2eUsers=async function(){const e=[];for(const t of this._getTrackedE2eRooms()){const n=await t.getEncryptionTargetMembers();for(const t of n)e.push(t.userId)}return e},N.prototype._getTrackedE2eRooms=function(){return this._clientStore.getRooms().filter(e=>{if(!this._roomEncryptors[e.roomId])return!1;if(!this._roomDeviceTrackingState[e.roomId])return!1;const t=e.getMyMembership();return"join"===t||"invite"===t})},N.prototype._onToDeviceEvent=function(e){try{c.a.log(`received to_device ${e.getType()} from: ${e.getSender()} id: ${e.getId()}`),"m.room_key"==e.getType()||"m.forwarded_room_key"==e.getType()?this._onRoomKeyEvent(e):"m.room_key_request"==e.getType()?this._onRoomKeyRequestEvent(e):"m.secret.request"===e.getType()?this._secretStorage._onRequestReceived(e):"m.secret.send"===e.getType()?this._secretStorage._onSecretReceived(e):"org.matrix.room_key.withheld"===e.getType()?this._onRoomKeyWithheldEvent(e):e.getContent().transaction_id?this._onKeyVerificationMessage(e):"m.bad.encrypted"===e.getContent().msgtype?this._onToDeviceBadEncrypted(e):e.isBeingDecrypted()&&e.once("Event.decrypted",e=>{this._onToDeviceEvent(e)})}catch(e){c.a.error("Error handling toDeviceEvent:",e)}},N.prototype._onRoomKeyEvent=function(e){const t=e.getContent();if(!t.room_id||!t.algorithm)return void c.a.error("key event is missing fields");this._checkedForBackup||this._checkAndStartKeyBackup();this._getRoomDecryptor(t.room_id,t.algorithm).onRoomKeyEvent(e)},N.prototype._onRoomKeyWithheldEvent=function(e){const t=e.getContent();if(!(("m.no_olm"===t.code||t.room_id&&t.session_id)&&t.algorithm&&t.sender_key))return void c.a.error("key withheld event is missing fields");c.a.info(`Got room key withheld event from ${e.getSender()} (${t.sender_key}) for ${t.algorithm}/${t.room_id}/${t.session_id} with reason ${t.code} (${t.reason})`);const n=this._getRoomDecryptor(t.room_id,t.algorithm);if(n.onRoomKeyWithheldEvent&&n.onRoomKeyWithheldEvent(e),!t.room_id){const e=this._getRoomDecryptors(t.algorithm);for(const n of e)n.retryDecryptionFromSender(t.sender_key)}},N.prototype._onKeyVerificationMessage=function(e){if(!T.a.validateEvent(e,this._baseApis))return;this._handleVerificationEvent(e,this._toDeviceVerificationRequests,e=>{if(!T.a.canCreateRequest(T.a.getEventType(e)))return;const t=e.getContent(),n=t&&t.from_device;if(!n)return;const o=e.getSender(),r=new T.a(this._baseApis,o,[n]);return new C.k(r,this._verificationMethods,this._baseApis)})},N.prototype._onTimelineEvent=function(e,t,n,o,{liveEvent:r}={}){if(!w.a.validateEvent(e,this._baseApis))return;this._handleVerificationEvent(e,this._inRoomVerificationRequests,e=>{const t=new w.a(this._baseApis,e.getRoomId());return new C.k(t,this._verificationMethods,this._baseApis)},r)},N.prototype._handleVerificationEvent=async function(e,t,n,o=!0){let r=t.getRequest(e),i=!1;if(!r){if(r=n(e),!r)return void c.a.log("Crypto: could not find VerificationRequest for "+e.getType()+", and could not create one, so ignoring.");i=!0,t.setRequest(e,r)}e.setVerificationRequest(r);try{await r.channel.handleEvent(e,r,o)}catch(e){c.a.error("error while handling verification event: "+e.message)}i&&!r.initiatedByMe&&!r.invalid&&!r.observeOnly&&this._baseApis.emit("crypto.verification.request",r)},N.prototype._onToDeviceBadEncrypted=async function(e){const t=e.getWireContent(),n=e.getSender(),o=t.algorithm,r=t.sender_key,i=()=>{const e=this._getRoomDecryptors(d.MEGOLM_ALGORITHM);for(const t of e)t.retryDecryptionFromSender(r)};if(void 0===n||void 0===r||void 0===r)return;this._lastNewSessionForced[n]=this._lastNewSessionForced[n]||{};const s=this._lastNewSessionForced[n][r]||0;if(s+36e5>Date.now())return c.a.debug("New session already forced with device "+n+":"+r+" at "+s+": not forcing another"),await this._olmDevice.recordSessionProblem(r,"wedged",!0),void i();let a=this._deviceList.getDeviceByIdentityKey(o,r);if(!a&&(await this.downloadKeys([n],!1),a=this._deviceList.getDeviceByIdentityKey(o,r),!a))return c.a.info("Couldn't find device for identity key "+r+": not re-establishing session"),await this._olmDevice.recordSessionProblem(r,"wedged",!1),void i();const l={};l[n]=[a],await d.ensureOlmSessionsForDevices(this._olmDevice,this._baseApis,l,!0),this._lastNewSessionForced[n][r]=Date.now();const u={algorithm:d.OLM_ALGORITHM,sender_key:this._olmDevice.deviceCurve25519Key,ciphertext:{}};await d.encryptMessageForDevice(u.ciphertext,this._userId,this._deviceId,this._olmDevice,n,a,{type:"m.dummy"}),await this._olmDevice.recordSessionProblem(r,"wedged",!0),i(),await this._baseApis.sendToDevice("m.room.encrypted",{[n]:{[a.deviceId]:u}});const h=await this._outgoingRoomKeyRequestManager.getOutgoingSentRoomKeyRequest(n,a.deviceId);for(const e of h)this.requestRoomKey(e.requestBody,e.recipients,!0)},N.prototype._onRoomMembership=function(e,t,n){const o=t.roomId,r=this._roomEncryptors[o];r&&(this._roomDeviceTrackingState[o]&&("join"==t.membership?(c.a.log("Join event for "+t.userId+" in "+o),this._deviceList.startTrackingDeviceList(t.userId)):"invite"==t.membership&&this._clientStore.getRoom(o).shouldEncryptForInvitedMembers()&&(c.a.log("Invite event for "+t.userId+" in "+o),this._deviceList.startTrackingDeviceList(t.userId))),r.onRoomMembership(e,t,n))},N.prototype._onRoomKeyRequestEvent=function(e){const t=e.getContent();if("request"===t.action){const t=new L(e);this._receivedRoomKeyRequests.push(t)}else if("request_cancellation"===t.action){const t=new U(e);this._receivedRoomKeyRequestCancellations.push(t)}},N.prototype._processReceivedRoomKeyRequests=async function(){if(!this._processingRoomKeyRequests){this._processingRoomKeyRequests=!0;try{const e=this._receivedRoomKeyRequests;this._receivedRoomKeyRequests=[];const t=this._receivedRoomKeyRequestCancellations;this._receivedRoomKeyRequestCancellations=[],await Promise.all(e.map(e=>this._processReceivedRoomKeyRequest(e))),await Promise.all(t.map(e=>this._processReceivedRoomKeyRequestCancellation(e)))}catch(e){c.a.error("Error processing room key requsts: "+e)}finally{this._processingRoomKeyRequests=!1}}},N.prototype._processReceivedRoomKeyRequest=async function(e){const t=e.userId,n=e.deviceId,o=e.requestBody,r=o.room_id,i=o.algorithm;if(c.a.log(`m.room_key_request from ${t}:${n} for ${r} / ${o.session_id} (id ${e.requestId})`),t!==this._userId){if(!this._roomEncryptors[r])return void c.a.debug("room key request for unencrypted room "+r);const e=this._roomEncryptors[r],i=this._deviceList.getStoredDevice(t,n);if(!i)return void c.a.debug(`Ignoring keyshare for unknown device ${t}:${n}`);try{await e.reshareKeyWithDevice(o.sender_key,o.session_id,t,i)}catch(e){c.a.warn("Failed to re-share keys for session "+o.session_id+" with device "+t+":"+i.deviceId,e)}return}if(n===this._deviceId)return void c.a.log("Ignoring room key request from ourselves");if(!this._roomDecryptors[r])return void c.a.log("room key request for unencrypted room "+r);const s=this._roomDecryptors[r][i];if(s)if(await s.hasKeysForKeyRequest(e)){if(e.share=()=>{s.shareKeysWithDevice(e)},this.checkDeviceTrust(t,n).isVerified())return c.a.log("device is already verified: sharing keys"),void e.share();this.emit("crypto.roomKeyRequest",e)}else c.a.log(`room key request for unknown session ${r} / `+o.session_id);else c.a.log(`room key request for unknown alg ${i} in room ${r}`)},N.prototype._processReceivedRoomKeyRequestCancellation=async function(e){c.a.log(`m.room_key_request cancellation for ${e.userId}:${e.deviceId} (id ${e.requestId})`),this.emit("crypto.roomKeyRequestCancellation",e)},N.prototype._getRoomDecryptor=function(e,t){let n,o;if((e=e||null)&&(n=this._roomDecryptors[e],n||(this._roomDecryptors[e]=n={}),o=n[t],o))return o;const r=m.a[t];if(!r)throw new m.b("UNKNOWN_ENCRYPTION_ALGORITHM",'Unknown encryption algorithm "'+t+'".');return o=new r({userId:this._userId,crypto:this,olmDevice:this._olmDevice,baseApis:this._baseApis,roomId:e}),n&&(n[t]=o),o},N.prototype._getRoomDecryptors=function(e){const t=[];for(const n of Object.values(this._roomDecryptors))e in n&&t.push(n[e]);return t},N.prototype._signObject=async function(e){const t=e.signatures||{},n=e.unsigned;delete e.signatures,delete e.unsigned,t[this._userId]=t[this._userId]||{},t[this._userId]["ed25519:"+this._deviceId]=await this._olmDevice.sign(i.a.stringify(e)),e.signatures=t,void 0!==n&&(e.unsigned=n)};class L{constructor(e){const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id,this.requestBody=t.body||{},this.share=()=>{throw new Error("don't know how to share keys for this request yet")}}}class U{constructor(e){const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id}}}).call(this,n(17),n(78).Buffer)},function(e,t,n){"use strict";(function(e,o){n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return p}));var r=n(254),i=n(171),s=n(66);const a="m.qr_code.show.v1",c="m.qr_code.scan.v1";class l extends r.b{static factory(...e){return new l(...e)}static get NAME(){return"m.reciprocate.v1"}async _doVerification(){if(!this.startEvent)throw new Error("It is not currently possible to start verificationwith this method yet.");const{qrCodeData:e}=this.request;if(this.startEvent.getContent().secret!==e.encodedSharedSecret)throw Object(i.d)();await new Promise((e,t)=>{this.reciprocateQREvent={confirm:e,cancel:()=>t(Object(i.h)())},this.emit("show_reciprocate_qr",this.reciprocateQREvent)});const t={};switch(e.mode){case u:{const n=e.otherUserMasterKey;t["ed25519:"+n]=n;break}case d:{const n=this.request.targetDevice.deviceId;t["ed25519:"+n]=e.otherDeviceKey;break}case h:{const n=e.myMasterKey;t["ed25519:"+n]=n;break}}await this._verifyKeys(this.userId,t,(e,n,o)=>{const r=t[e];if(!r)throw Object(i.d)();if(o!==r)throw console.error("key ID from key info does not match"),Object(i.d)();for(const e in n.keys){if(!e.startsWith("ed25519"))continue;const o=t[e];if(!o)throw Object(i.d)();if(n.keys[e]!==o)throw console.error("master key does not match"),Object(i.d)()}})}}const u=0,d=1,h=2;class p{constructor(e,t,n,o,r,i){this._sharedSecret=t,this._mode=e,this._otherUserMasterKey=n,this._otherDeviceKey=o,this._myMasterKey=r,this._buffer=i}static async create(e,t){const n=p._generateSharedSecret(),o=p._determineMode(e,t);let r=null,i=null,s=null;if(o===u){r=t.getStoredCrossSigningForUser(e.otherUserId).getId("master")}else if(o===d)i=await p._getOtherDeviceKey(e,t);else if(o===h){const e=t.getUserId();s=t.getStoredCrossSigningForUser(e).getId("master")}const a=p._generateQrData(e,t,o,n,r,i,s),c=p._generateBuffer(a);return new p(o,n,r,i,s,c)}get buffer(){return this._buffer}get mode(){return this._mode}get otherDeviceKey(){return this._otherDeviceKey}get otherUserMasterKey(){return this._otherUserMasterKey}get myMasterKey(){return this._myMasterKey}get encodedSharedSecret(){return this._sharedSecret}static _generateSharedSecret(){const t=new Uint8Array(11);return e.crypto.getRandomValues(t),Object(s.encodeUnpaddedBase64)(t)}static async _getOtherDeviceKey(e,t){const n=t.getUserId(),o=e.targetDevice,r=o?o.deviceId:null,i=t.getStoredDevice(n,r);if(!i)throw new Error("could not find device "+r);return i.getFingerprint()}static _determineMode(e,t){const n=t.getUserId(),o=e.otherUserId;let r=u;if(n===o){r=t.checkUserTrust(n).isCrossSigningVerified()?d:h}return r}static _generateQrData(e,t,n,o,r,i,s){const a=t.getUserId(),c={prefix:"MATRIX",version:2,mode:n,transactionId:e.channel.transactionId,firstKeyB64:"",secondKeyB64:"",secretB64:o},l=t.getStoredCrossSigningForUser(a);return n===u?(c.firstKeyB64=l.getId("master"),c.secondKeyB64=r):n===d?(c.firstKeyB64=l.getId("master"),c.secondKeyB64=i):n===h&&(c.firstKeyB64=t.getDeviceEd25519Key(),c.secondKeyB64=s),c}static _generateBuffer(e){let t=o.alloc(0);const n=e=>{const n=o.from([e]);t=o.concat([t,n])},r=(e,n,r=!0)=>{const i=o.from(e,n);r&&(e=>{const n=o.alloc(2);n.writeInt16BE(e,0),t=o.concat([t,n])})(i.byteLength),t=o.concat([t,i])},i=e=>{const n=Object(s.decodeBase64)(e),r=o.from(n);t=o.concat([t,r])};return r(e.prefix,"ascii",!1),n(e.version),n(e.mode),r(e.transactionId,"utf-8"),i(e.firstKeyB64),i(e.secondKeyB64),i(e.secretB64),t}}}).call(this,n(17),n(78).Buffer)},function(e,t,n){var o=n(96),r=n(172);e.exports=n(97)?function(e,t,n){return o.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var o=n(139);e.exports=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var o=n(259);e.exports=function(e){return Object(o(e))}},function(e,t,n){var o=n(363),r=n(259);e.exports=function(e){return o(r(e))}},function(e,t,n){var o=n(175),r=n(573),i=n(574),s=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?r(e):i(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.top,n=e.right,o=e.bottom,r=e.left;return{top:t,right:n,bottom:o,left:r,width:n-r,height:o-t,center:{x:(n+r)/2,y:(o+t)/2}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(103)),r=i(n(68));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,r.default)((function(e,t){return(0,o.default)(t).map((function(e){return t[e]})).filter((function(t){return e.descriptor.id===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}))}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(374)),r=i(n(272));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.draggable,n=e.destination,i=e.previousImpact,s=e.viewport,a=t.descriptor.id,c=(0,o.default)(i.movement.displaced),l=(0,r.default)({target:t.page.withMargin,destination:n,viewport:s}),u=function(){if(!l)return!1;var e=c[a];return!e||e.shouldAnimate}();return{draggableId:a,isVisible:l,shouldAnimate:u}}},function(e,t,n){e.exports.Container=n(668),e.exports.MapStore=n(670),e.exports.Mixin=n(678),e.exports.ReduceStore=n(398),e.exports.Store=n(399)},function(e,t,n){"use strict";n.d(t,"b",(function(){return N}));var o=n(3),r=n.n(o),i=n(46),s=n.n(i),a=n(182),c=n(33),l=n.n(c),u=n(35),d=n.n(u),h=n(39),p=n.n(h),m=n(42),g=n.n(m),_=n(34),f=n(223),v=n(36),b=n(38),E=n(40),y=n(44),S=n(71),C=n(37),w=n(225),T=n(226),k=n(47),x=n(89),O=n(188);const R={"m.room.message":"messages.MessageEvent","m.sticker":"messages.MessageEvent","m.key.verification.cancel":"messages.MKeyVerificationConclusion","m.key.verification.done":"messages.MKeyVerificationConclusion","m.room.encryption":"messages.EncryptionEvent","m.call.invite":"messages.TextualEvent","m.call.answer":"messages.TextualEvent","m.call.hangup":"messages.TextualEvent"},D={"m.room.encryption":"messages.EncryptionEvent","m.room.canonical_alias":"messages.TextualEvent","m.room.create":"messages.RoomCreate","m.room.member":"messages.TextualEvent","m.room.name":"messages.TextualEvent","m.room.avatar":"messages.RoomAvatarEvent","m.room.third_party_invite":"messages.TextualEvent","m.room.history_visibility":"messages.TextualEvent","m.room.topic":"messages.TextualEvent","m.room.power_levels":"messages.TextualEvent","m.room.pinned_events":"messages.TextualEvent","m.room.server_acl":"messages.TextualEvent","im.vector.modular.widgets":"messages.TextualEvent","m.room.tombstone":"messages.TextualEvent","m.room.join_rules":"messages.TextualEvent","m.room.guest_access":"messages.TextualEvent","m.room.related_groups":"messages.TextualEvent"};for(const e of w.a)D[e]="messages.TextualEvent";function I(e){const t=e.getType();if("m.room.message"===t){const t=e.getContent();if(t&&"m.key.verification.request"===t.msgtype){const n=C.a.get(),o=n&&n.getUserId();return e.getSender()!==o&&t.to!==o?void 0:"messages.MKeyVerificationRequest"}}if("m.key.verification.done"===t){const t=C.a.get(),n=t&&t.getUserId();if(e.getSender()!==n)return}if("m.key.verification.cancel"===t&&E.b.getValue("showHiddenEventsInTimeline")){if(!v.getComponent("messages.MKeyVerificationConclusion").prototype._shouldRender.call(null,e,e.request))return}return e.isState()?D[t]:R[t]}t.a=p()({displayName:"EventTile",propTypes:{mxEvent:d.a.object.isRequired,isRedacted:d.a.bool,continuation:d.a.bool,last:d.a.bool,contextual:d.a.bool,highlights:d.a.array,highlightLink:d.a.string,showUrlPreview:d.a.bool,isSelectedEvent:d.a.bool,onHeightChanged:d.a.func,readReceipts:d.a.arrayOf(d.a.object),readReceiptMap:d.a.object,checkUnmounting:d.a.func,eventSendStatus:d.a.string,tileShape:d.a.string,isTwelveHour:d.a.bool,getRelationsForEvent:d.a.func,showReactions:d.a.bool,useIRCLayout:d.a.bool},getDefaultProps:function(){return{onHeightChanged:function(){}}},getInitialState:function(){return{actionBarFocused:!1,allReadAvatars:!1,verified:null,previouslyRequestedKeys:!1,reactions:this.getReactions()}},statics:{contextType:k.a},UNSAFE_componentWillMount:function(){this._suppressReadReceiptAnimation=!0,this._verifyEvent(this.props.mxEvent),this._tile=Object(c.createRef)(),this._replyThread=Object(c.createRef)()},componentDidMount:function(){this._suppressReadReceiptAnimation=!1;const e=this.context;e.on("deviceVerificationChanged",this.onDeviceVerificationChanged),e.on("userTrustStatusChanged",this.onUserVerificationChanged),this.props.mxEvent.on("Event.decrypted",this._onDecrypted),this.props.showReactions&&this.props.mxEvent.on("Event.relationsCreated",this._onReactionsCreated)},UNSAFE_componentWillReceiveProps:function(e){e.eventSendStatus!==this.props.eventSendStatus&&this._verifyEvent(e.mxEvent)},shouldComponentUpdate:function(e,t){return!T.a(this.state,t)||!this._propsEqual(this.props,e)},componentWillUnmount:function(){const e=this.context;e.removeListener("deviceVerificationChanged",this.onDeviceVerificationChanged),e.removeListener("userTrustStatusChanged",this.onUserVerificationChanged),this.props.mxEvent.removeListener("Event.decrypted",this._onDecrypted),this.props.showReactions&&this.props.mxEvent.removeListener("Event.relationsCreated",this._onReactionsCreated)},_onDecrypted:function(){this._verifyEvent(this.props.mxEvent),this.forceUpdate()},onDeviceVerificationChanged:function(e,t){e===this.props.mxEvent.getSender()&&this._verifyEvent(this.props.mxEvent)},onUserVerificationChanged:function(e,t){e===this.props.mxEvent.getSender()&&this._verifyEvent(this.props.mxEvent)},_verifyEvent:async function(e){if(!e.isEncrypted())return;if(await this.context.isEventSenderVerified(e))return void this.setState({verified:x.a.VERIFIED},()=>{this.props.onHeightChanged()});if(!E.b.getValue("feature_cross_signing"))return void this.setState({verified:x.a.WARNING},this.props.onHeightChanged);if(!this.context.checkUserTrust(e.getSender()).isCrossSigningVerified())return void this.setState({verified:x.a.NORMAL},this.props.onHeightChanged);const t=await this.context.checkEventSenderTrust(e);t?this.setState({verified:t.isVerified()?x.a.VERIFIED:x.a.WARNING},this.props.onHeightChanged):this.setState({verified:x.a.UNKNOWN},this.props.onHeightChanged)},_propsEqual:function(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let o=0;o0&&(r=l.a.createElement("span",{className:"mx_EventTile_readAvatarRemainder",onClick:this.toggleAllReadAvatars,style:{right:"calc("+Object(O.b)(-n)+" + 15px)"}},e,"+"))}return l.a.createElement("span",{className:"mx_EventTile_readAvatars"},r,t)},onSenderProfileClick:function(e){const t=this.props.mxEvent;b.a.dispatch({action:"insert_mention",user_id:t.getSender()})},onRequestKeysClick:function(){this.setState({previouslyRequestedKeys:!0}),this.context.cancelAndResendEventRoomKeyRequest(this.props.mxEvent)},onPermalinkClicked:function(e){e.preventDefault(),b.a.dispatch({action:"view_room",event_id:this.props.mxEvent.getId(),highlighted:!0,room_id:this.props.mxEvent.getRoomId()})},_renderE2EPadlock:function(){const e=this.props.mxEvent;if("m.bad.encrypted"===e.getContent().msgtype)return l.a.createElement(M,null);if(e.isEncrypted())return this.state.verified===x.a.NORMAL||this.state.verified===x.a.VERIFIED?void 0:this.state.verified===x.a.UNKNOWN?l.a.createElement(U,null):l.a.createElement(P,null);if(this.context.isRoomEncrypted(e.getRoomId())){if(e.status===y.b.ENCRYPTING)return;if(e.status===y.b.NOT_SENT)return;if(e.isState())return;return l.a.createElement(L,null)}return null},onActionBarFocusChange(e){this.setState({actionBarFocused:e})},getTile(){return this._tile.current},getReplyThread(){return this._replyThread.current},getReactions(){if(!this.props.showReactions||!this.props.getRelationsForEvent)return null;const e=this.props.mxEvent.getId();return e||(console.error("EventTile attempted to get relations for an event without an ID"),console.log(JSON.stringify(this.props.mxEvent,null,4)),console.trace("Stacktrace for https://github.com/vector-im/riot-web/issues/11120")),this.props.getRelationsForEvent(e,"m.annotation","m.reaction")},_onReactionsCreated(e,t){"m.annotation"===e&&"m.reaction"===t&&(this.props.mxEvent.removeListener("Event.relationsCreated",this._onReactionsCreated),this.setState({reactions:this.getReactions()}))},render:function(){const e=v.getComponent("messages.MessageTimestamp"),t=v.getComponent("messages.SenderProfile"),n=v.getComponent("avatars.MemberAvatar"),o=this.props.mxEvent.getContent().msgtype,r=this.props.mxEvent.getType(),i=r.startsWith("m.key.verification")||"m.room.message"===r&&o&&o.startsWith("m.key.verification")||"m.room.encryption"===r;let s=!i&&"m.room.message"!==r&&"m.sticker"!==r&&"m.room.create"!==r,c=I(this.props.mxEvent);if((!c||this.props.mxEvent.isRelation("m.replace"))&&E.b.getValue("showHiddenEventsInTimeline")&&(c="messages.ViewSourceEvent",s=!0),!c){const{mxEvent:e}=this.props;return console.warn(`Event type not supported: type:${e.getType()} isState:${e.isState()}`),l.a.createElement("div",{className:"mx_EventTile mx_EventTile_info mx_MNoticeBody"},l.a.createElement("div",{className:"mx_EventTile_line"},Object(_.a)("This event could not be displayed")))}const u=v.getComponent(c),d=-1!==["sending","queued","encrypting"].indexOf(this.props.eventSendStatus),h=F(this.props.mxEvent)&&this.props.isRedacted,p=this.props.mxEvent.isDecryptionFailure(),m=!!this.props.editState,f=g()({mx_EventTile_bubbleContainer:i,mx_EventTile:!0,mx_EventTile_isEditing:m,mx_EventTile_info:s,mx_EventTile_12hr:this.props.isTwelveHour,mx_EventTile_encrypting:"encrypting"===this.props.eventSendStatus,mx_EventTile_sending:!m&&d,mx_EventTile_notSent:"not_sent"===this.props.eventSendStatus,mx_EventTile_highlight:"notif"!==this.props.tileShape&&this.shouldHighlight(),mx_EventTile_selected:this.props.isSelectedEvent,mx_EventTile_continuation:this.props.tileShape?"":this.props.continuation,mx_EventTile_last:this.props.last,mx_EventTile_contextual:this.props.contextual,mx_EventTile_actionBarFocused:this.state.actionBarFocused,mx_EventTile_verified:!i&&this.state.verified===x.a.VERIFIED,mx_EventTile_unverified:!i&&this.state.verified===x.a.WARNING,mx_EventTile_unknown:!i&&this.state.verified===x.a.UNKNOWN,mx_EventTile_bad:p,mx_EventTile_emote:"m.emote"===o});let b="#";this.props.permalinkCreator&&(b=this.props.permalinkCreator.forEvent(this.props.mxEvent.getId()));const y=this.getReadAvatars();let C,w,T,k;if("notif"===this.props.tileShape?(T=24,k=!0):"messages.RoomCreate"===c||i?(T=0,k=!1):s?(T=14,k=!1):this.props.useIRCLayout?(T=14,k=!0):this.props.continuation&&"file_grid"!==this.props.tileShape?(T=0,k=!1):(T=30,k=!0),this.props.mxEvent.sender&&T&&(C=l.a.createElement("div",{className:"mx_EventTile_avatar"},l.a.createElement(n,{member:this.props.mxEvent.sender,width:T,height:T,viewUserOnClick:!0}))),k){let e=null;this.props.tileShape&&"reply"!==this.props.tileShape&&"reply_preview"!==this.props.tileShape?w=l.a.createElement(t,{mxEvent:this.props.mxEvent,enableFlair:!0}):("m.image"===o?e=Object(_.b)("%(senderName)s sent an image"):"m.video"===o?e=Object(_.b)("%(senderName)s sent a video"):"m.file"===o&&(e=Object(_.b)("%(senderName)s uploaded a file")),w=l.a.createElement(t,{onClick:this.onSenderProfileClick,mxEvent:this.props.mxEvent,enableFlair:!e,text:e}))}const O=v.getComponent("messages.MessageActionBar"),R=m?void 0:l.a.createElement(O,{mxEvent:this.props.mxEvent,reactions:this.state.reactions,permalinkCreator:this.props.permalinkCreator,getTile:this.getTile,getReplyThread:this.getReplyThread,onFocusChange:this.onActionBarFocusChange}),D=this.props.mxEvent.getTs()?l.a.createElement(e,{showTwelveHour:this.props.isTwelveHour,ts:this.props.mxEvent.getTs()}):null,A=l.a.createElement("div",{className:"mx_EventTile_keyRequestInfo_tooltip_contents"},l.a.createElement("p",null,this.state.previouslyRequestedKeys?Object(_.a)("Your key share request has been sent - please check your other sessions for key share requests."):Object(_.a)("Key share requests are sent to your other sessions automatically. If you rejected or dismissed the key share request on your other sessions, click here to request the keys for this session again.")),l.a.createElement("p",null,Object(_.a)("If your other sessions do not have the key for this message you will not be able to decrypt them."))),N=this.state.previouslyRequestedKeys?Object(_.a)("Key request sent."):Object(_.a)("Re-request encryption keys from your other sessions.",{},{requestLink:e=>l.a.createElement("a",{onClick:this.onRequestKeysClick},e)}),M=v.getComponent("elements.TooltipButton"),P=p?l.a.createElement("div",{className:"mx_EventTile_keyRequestInfo"},l.a.createElement("span",{className:"mx_EventTile_keyRequestInfo_text"},N),l.a.createElement(M,{helpText:A})):null;let L;if(!h){const e=v.getComponent("messages.ReactionsRow");L=l.a.createElement(e,{mxEvent:this.props.mxEvent,reactions:this.state.reactions})}const U=l.a.createElement("a",{href:b,onClick:this.onPermalinkClicked,"aria-label":Object(S.d)(new Date(this.props.mxEvent.getTs()),this.props.isTwelveHour)},D),B=this.props.useIRCLayout?null:U,j=this.props.useIRCLayout?U:null,G=!this.props.useIRCLayout&&!i&&this._renderE2EPadlock(),q=this.props.useIRCLayout&&!i&&this._renderE2EPadlock();switch(this.props.tileShape){case"notif":{const e=this.context.getRoom(this.props.mxEvent.getRoomId());return l.a.createElement("div",{className:f},l.a.createElement("div",{className:"mx_EventTile_roomName"},l.a.createElement("a",{href:b,onClick:this.onPermalinkClicked},e?e.name:"")),l.a.createElement("div",{className:"mx_EventTile_senderDetails"},C,l.a.createElement("a",{href:b,onClick:this.onPermalinkClicked},w,D)),l.a.createElement("div",{className:"mx_EventTile_line"},l.a.createElement(u,{ref:this._tile,mxEvent:this.props.mxEvent,highlights:this.props.highlights,highlightLink:this.props.highlightLink,showUrlPreview:this.props.showUrlPreview,onHeightChanged:this.props.onHeightChanged})))}case"file_grid":return l.a.createElement("div",{className:f},l.a.createElement("div",{className:"mx_EventTile_line"},l.a.createElement(u,{ref:this._tile,mxEvent:this.props.mxEvent,highlights:this.props.highlights,highlightLink:this.props.highlightLink,showUrlPreview:this.props.showUrlPreview,tileShape:this.props.tileShape,onHeightChanged:this.props.onHeightChanged})),l.a.createElement("a",{className:"mx_EventTile_senderDetailsLink",href:b,onClick:this.onPermalinkClicked},l.a.createElement("div",{className:"mx_EventTile_senderDetails"},w,D)));case"reply":case"reply_preview":{let e;return"reply_preview"===this.props.tileShape&&(e=a.a.makeThread(this.props.mxEvent,this.props.onHeightChanged,this.props.permalinkCreator,this._replyThread)),l.a.createElement("div",{className:f},j,C,w,q,l.a.createElement("div",{className:"mx_EventTile_reply"},B,G,e,l.a.createElement(u,{ref:this._tile,mxEvent:this.props.mxEvent,highlights:this.props.highlights,highlightLink:this.props.highlightLink,onHeightChanged:this.props.onHeightChanged,showUrlPreview:!1})))}default:{const e=a.a.makeThread(this.props.mxEvent,this.props.onHeightChanged,this.props.permalinkCreator,this._replyThread,this.props.useIRCLayout);return l.a.createElement("div",{className:f,tabIndex:-1},j,l.a.createElement("div",{className:"mx_EventTile_msgOption"},y),w,q,l.a.createElement("div",{className:"mx_EventTile_line"},B,G,e,l.a.createElement(u,{ref:this._tile,mxEvent:this.props.mxEvent,replacingEventId:this.props.replacingEventId,editState:this.props.editState,highlights:this.props.highlights,highlightLink:this.props.highlightLink,showUrlPreview:this.props.showUrlPreview,onHeightChanged:this.props.onHeightChanged}),P,L,R),C)}}}});const A=["m.room.message","m.sticker"];function F(e){return A.includes(e.getType())}function N(e){if(e.isRedacted()&&!F(e))return!1;if(e.isRelation("m.replace"))return!1;const t=I(e);return void 0!==t&&("messages.TextualEvent"===t?""!==f.a(e):"messages.RoomCreate"!==t||Boolean(e.getContent().predecessor))}function M(e){return l.a.createElement(B,s()({title:Object(_.a)("This message cannot be decrypted"),icon:"undecryptable"},e))}function P(e){return l.a.createElement(B,s()({title:Object(_.a)("Encrypted by an unverified session"),icon:"unverified"},e))}function L(e){return l.a.createElement(B,s()({title:Object(_.a)("Unencrypted"),icon:"unencrypted"},e))}function U(e){return l.a.createElement(B,s()({title:Object(_.a)("Encrypted by a deleted session"),icon:"unknown"},e))}class B extends l.a.Component{constructor(){super(),r()(this,"onHoverStart",()=>{this.setState({hover:!0})}),r()(this,"onHoverEnd",()=>{this.setState({hover:!1})}),this.state={hover:!1}}render(){let e=null;if(this.state.hover){const t=v.getComponent("elements.Tooltip");e=l.a.createElement(t,{className:"mx_EventTile_e2eIcon_tooltip",label:this.props.title,dir:"auto"})}let t="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_"+this.props.icon;return E.b.getValue("alwaysShowEncryptionIcons")||(t+=" mx_EventTile_e2eIcon_hidden"),l.a.createElement("div",{className:t,onClick:this.onClick,onMouseEnter:this.onHoverStart,onMouseLeave:this.onHoverEnd},e)}}r()(B,"propTypes",{icon:d.a.string.isRequired,title:d.a.string.isRequired})},function(e,t,n){"use strict";(function(e){var o=n(49),r=n.n(o),i=n(37);class s extends r.a{constructor(){super(),this._persistentWidgetId=null,this._capsByWidgetId={},this._widgetMessagingByWidgetId={},this._roomIdByWidgetId={},this.onRoomStateEvents=this.onRoomStateEvents.bind(this),this.dispatcherRef=null}start(){i.a.get().on("RoomState.events",this.onRoomStateEvents)}stop(){i.a.get()&&i.a.get().removeListener("RoomState.events",this.onRoomStateEvents),this._capsByWidgetId={},this._widgetMessagingByWidgetId={},this._roomIdByWidgetId={}}onRoomStateEvents(e,t){"im.vector.modular.widgets"===e.getType()&&e.getStateKey()===this._persistentWidgetId&&this.destroyPersistentWidget(this._persistentWidgetId)}destroyPersistentWidget(e){if(e!==this._persistentWidgetId)return;const t=this._persistentWidgetId;this.setWidgetPersistence(t,!1),this.delWidgetMessaging(t),this.delWidgetCapabilities(t),this.delRoomId(t)}setWidgetPersistence(e,t){this._persistentWidgetId!==e||t?this._persistentWidgetId!==e&&t&&(this._persistentWidgetId=e):this._persistentWidgetId=null,this.emit("update")}getWidgetPersistence(e){return this._persistentWidgetId===e}getPersistentWidgetId(){return this._persistentWidgetId}setWidgetCapabilities(e,t){this._capsByWidgetId[e]=t,this.emit("update")}widgetHasCapability(e,t){return this._capsByWidgetId[e]&&this._capsByWidgetId[e].includes(t)}delWidgetCapabilities(e){delete this._capsByWidgetId[e],this.emit("update")}setWidgetMessaging(e,t){this.delWidgetMessaging(e),this._widgetMessagingByWidgetId[e]=t,this.emit("update")}getWidgetMessaging(e){return this._widgetMessagingByWidgetId[e]}delWidgetMessaging(e){if(this._widgetMessagingByWidgetId[e]){try{this._widgetMessagingByWidgetId[e].stop()}catch(e){console.error("Failed to stop listening for widgetMessaging events",e.message)}delete this._widgetMessagingByWidgetId[e],this.emit("update")}}getRoomId(e){return this._roomIdByWidgetId[e]}setRoomId(e,t){this._roomIdByWidgetId[e]=t,this.emit("update")}delRoomId(e){delete this._roomIdByWidgetId[e],this.emit("update")}}void 0===e.singletonActiveWidgetStore&&(e.singletonActiveWidgetStore=new s),t.a=e.singletonActiveWidgetStore}).call(this,n(17))},function(e,t,n){(function(e,o){var r;(function(){var i="Expected a function",s="__lodash_placeholder__",a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",l="[object Array]",u="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",_="[object Number]",f="[object Object]",v="[object RegExp]",b="[object Set]",E="[object String]",y="[object Symbol]",S="[object WeakMap]",C="[object ArrayBuffer]",w="[object DataView]",T="[object Float32Array]",k="[object Float64Array]",x="[object Int8Array]",O="[object Int16Array]",R="[object Int32Array]",D="[object Uint8Array]",I="[object Uint16Array]",A="[object Uint32Array]",F=/\b__p \+= '';/g,N=/\b(__p \+=) '' \+/g,M=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,U=RegExp(P.source),B=RegExp(L.source),j=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(z.source),W=/^\s+|\s+$/g,$=/^\s+/,Q=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oe=/\w*$/,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,se=/^\[object .+?Constructor\]$/,ae=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",me="[\\ud800-\\udfff]",ge="["+pe+"]",_e="["+he+"]",fe="\\d+",ve="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+pe+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ye="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",Ce="(?:\\ud83c[\\udde6-\\uddff]){2}",we="[\\ud800-\\udbff][\\udc00-\\udfff]",Te="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ke="(?:"+be+"|"+Ee+")",xe="(?:"+Te+"|"+Ee+")",Oe="(?:"+_e+"|"+ye+")"+"?",Re="[\\ufe0e\\ufe0f]?"+Oe+("(?:\\u200d(?:"+[Se,Ce,we].join("|")+")[\\ufe0e\\ufe0f]?"+Oe+")*"),De="(?:"+[ve,Ce,we].join("|")+")"+Re,Ie="(?:"+[Se+_e+"?",_e,Ce,we,me].join("|")+")",Ae=RegExp("['’]","g"),Fe=RegExp(_e,"g"),Ne=RegExp(ye+"(?="+ye+")|"+Ie+Re,"g"),Me=RegExp([Te+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ge,Te,"$"].join("|")+")",xe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ge,Te+ke,"$"].join("|")+")",Te+"?"+ke+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fe,De].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ue=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,je={};je[T]=je[k]=je[x]=je[O]=je[R]=je[D]=je["[object Uint8ClampedArray]"]=je[I]=je[A]=!0,je[c]=je[l]=je[C]=je[u]=je[w]=je[d]=je[h]=je[p]=je[g]=je[_]=je[f]=je[v]=je[b]=je[E]=je[S]=!1;var Ge={};Ge[c]=Ge[l]=Ge[C]=Ge[w]=Ge[u]=Ge[d]=Ge[T]=Ge[k]=Ge[x]=Ge[O]=Ge[R]=Ge[g]=Ge[_]=Ge[f]=Ge[v]=Ge[b]=Ge[E]=Ge[y]=Ge[D]=Ge["[object Uint8ClampedArray]"]=Ge[I]=Ge[A]=!0,Ge[h]=Ge[p]=Ge[S]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,He=parseInt,Ke="object"==typeof e&&e&&e.Object===Object&&e,ze="object"==typeof self&&self&&self.Object===Object&&self,Ye=Ke||ze||Function("return this")(),We=t&&!t.nodeType&&t,$e=We&&"object"==typeof o&&o&&!o.nodeType&&o,Qe=$e&&$e.exports===We,Xe=Qe&&Ke.process,Je=function(){try{var e=$e&&$e.require&&$e.require("util").types;return e||Xe&&Xe.binding&&Xe.binding("util")}catch(e){}}(),Ze=Je&&Je.isArrayBuffer,et=Je&&Je.isDate,tt=Je&&Je.isMap,nt=Je&&Je.isRegExp,ot=Je&&Je.isSet,rt=Je&&Je.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function st(e,t,n,o){for(var r=-1,i=null==e?0:e.length;++r-1}function ht(e,t,n){for(var o=-1,r=null==e?0:e.length;++o-1;);return n}function Nt(e,t){for(var n=e.length;n--&&yt(t,e[n],0)>-1;);return n}function Mt(e,t){for(var n=e.length,o=0;n--;)e[n]===t&&++o;return o}var Pt=kt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ut(e){return"\\"+qe[e]}function Bt(e){return Pe.test(e)}function jt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function Gt(e,t){return function(n){return e(t(n))}}function qt(e,t){for(var n=-1,o=e.length,r=0,i=[];++n",""":'"',"'":"'"});var Wt=function e(t){var n,o=(t=null==t?Ye:Wt.defaults(Ye.Object(),t,Wt.pick(Ye,Ue))).Array,r=t.Date,he=t.Error,pe=t.Function,me=t.Math,ge=t.Object,_e=t.RegExp,fe=t.String,ve=t.TypeError,be=o.prototype,Ee=pe.prototype,ye=ge.prototype,Se=t["__core-js_shared__"],Ce=Ee.toString,we=ye.hasOwnProperty,Te=0,ke=(n=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",xe=ye.toString,Oe=Ce.call(ge),Re=Ye._,De=_e("^"+Ce.call(we).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Qe?t.Buffer:void 0,Ne=t.Symbol,Pe=t.Uint8Array,qe=Ie?Ie.allocUnsafe:void 0,Ke=Gt(ge.getPrototypeOf,ge),ze=ge.create,We=ye.propertyIsEnumerable,$e=be.splice,Xe=Ne?Ne.isConcatSpreadable:void 0,Je=Ne?Ne.iterator:void 0,vt=Ne?Ne.toStringTag:void 0,kt=function(){try{var e=ei(ge,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==Ye.clearTimeout&&t.clearTimeout,Qt=r&&r.now!==Ye.Date.now&&r.now,Xt=t.setTimeout!==Ye.setTimeout&&t.setTimeout,Jt=me.ceil,Zt=me.floor,en=ge.getOwnPropertySymbols,tn=Ie?Ie.isBuffer:void 0,nn=t.isFinite,on=be.join,rn=Gt(ge.keys,ge),sn=me.max,an=me.min,cn=r.now,ln=t.parseInt,un=me.random,dn=be.reverse,hn=ei(t,"DataView"),pn=ei(t,"Map"),mn=ei(t,"Promise"),gn=ei(t,"Set"),_n=ei(t,"WeakMap"),fn=ei(ge,"create"),vn=_n&&new _n,bn={},En=xi(hn),yn=xi(pn),Sn=xi(mn),Cn=xi(gn),wn=xi(_n),Tn=Ne?Ne.prototype:void 0,kn=Tn?Tn.valueOf:void 0,xn=Tn?Tn.toString:void 0;function On(e){if(Hs(e)&&!Fs(e)&&!(e instanceof An)){if(e instanceof In)return e;if(we.call(e,"__wrapped__"))return Oi(e)}return new In(e)}var Rn=function(){function e(){}return function(t){if(!Vs(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Dn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function An(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Qn(e,t,n,o,r,i){var s,a=1&t,l=2&t,h=4&t;if(n&&(s=r?n(e,o,r,i):n(e)),void 0!==s)return s;if(!Vs(e))return e;var S=Fs(e);if(S){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&we.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!a)return vr(e,s)}else{var F=oi(e),N=F==p||F==m;if(Ls(e))return hr(e,a);if(F==f||F==c||N&&!r){if(s=l||N?{}:ii(e),!a)return l?function(e,t){return br(e,ni(e),t)}(e,function(e,t){return e&&br(t,ya(t),e)}(s,e)):function(e,t){return br(e,ti(e),t)}(e,zn(s,e))}else{if(!Ge[F])return r?e:{};s=function(e,t,n){var o=e.constructor;switch(t){case C:return pr(e);case u:case d:return new o(+e);case w:return function(e,t){var n=t?pr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case k:case x:case O:case R:case D:case"[object Uint8ClampedArray]":case I:case A:return mr(e,n);case g:return new o;case _:case E:return new o(e);case v:return function(e){var t=new e.constructor(e.source,oe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new o;case y:return r=e,kn?ge(kn.call(r)):{}}var r}(e,F,a)}}i||(i=new Ln);var M=i.get(e);if(M)return M;i.set(e,s),$s(e)?e.forEach((function(o){s.add(Qn(o,t,n,o,e,i))})):Ks(e)&&e.forEach((function(o,r){s.set(r,Qn(o,t,n,r,e,i))}));var P=S?void 0:(h?l?Yr:zr:l?ya:Ea)(e);return at(P||e,(function(o,r){P&&(o=e[r=o]),Vn(s,r,Qn(o,t,n,r,e,i))})),s}function Xn(e,t,n){var o=n.length;if(null==e)return!o;for(e=ge(e);o--;){var r=n[o],i=t[r],s=e[r];if(void 0===s&&!(r in e)||!i(s))return!1}return!0}function Jn(e,t,n){if("function"!=typeof e)throw new ve(i);return Ei((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,o){var r=-1,i=dt,s=!0,a=e.length,c=[],l=t.length;if(!a)return c;n&&(t=pt(t,Dt(n))),o?(i=ht,s=!1):t.length>=200&&(i=At,s=!1,t=new Pn(t));e:for(;++r-1},Nn.prototype.set=function(e,t){var n=this.__data__,o=Hn(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Fn,map:new(pn||Nn),string:new Fn}},Mn.prototype.delete=function(e){var t=Jr(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Jr(this,e).get(e)},Mn.prototype.has=function(e){return Jr(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Jr(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},Pn.prototype.add=Pn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Pn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new Nn,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Nn){var o=n.__data__;if(!pn||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(o)}return n.set(e,t),this.size=n.size,this};var eo=Sr(co),to=Sr(lo,!0);function no(e,t){var n=!0;return eo(e,(function(e,o,r){return n=!!t(e,o,r)})),n}function oo(e,t,n){for(var o=-1,r=e.length;++o0&&n(a)?t>1?io(a,t-1,n,o,r):mt(r,a):o||(r[r.length]=a)}return r}var so=Cr(),ao=Cr(!0);function co(e,t){return e&&so(e,t,Ea)}function lo(e,t){return e&&ao(e,t,Ea)}function uo(e,t){return ut(t,(function(t){return js(e[t])}))}function ho(e,t){for(var n=0,o=(t=cr(t,e)).length;null!=e&&nt}function _o(e,t){return null!=e&&we.call(e,t)}function fo(e,t){return null!=e&&t in ge(e)}function vo(e,t,n){for(var r=n?ht:dt,i=e[0].length,s=e.length,a=s,c=o(s),l=1/0,u=[];a--;){var d=e[a];a&&t&&(d=pt(d,Dt(t))),l=an(d.length,l),c[a]=!n&&(t||i>=120&&d.length>=120)?new Pn(a&&d):void 0}d=e[0];var h=-1,p=c[0];e:for(;++h=a)return c;var l=n[o];return c*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function No(e,t,n){for(var o=-1,r=t.length,i={};++o-1;)a!==e&&$e.call(a,c,1),$e.call(e,c,1);return e}function Po(e,t){for(var n=e?t.length:0,o=n-1;n--;){var r=t[n];if(n==o||r!==i){var i=r;ai(r)?$e.call(e,r,1):er(e,r)}}return e}function Lo(e,t){return e+Zt(un()*(t-e+1))}function Uo(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Zt(t/2))&&(e+=e)}while(t);return n}function Bo(e,t){return yi(gi(e,t,za),e+"")}function jo(e){return Bn(Ra(e))}function Go(e,t){var n=Ra(e);return wi(n,$n(t,0,n.length))}function qo(e,t,n,o){if(!Vs(e))return e;for(var r=-1,i=(t=cr(t,e)).length,s=i-1,a=e;null!=a&&++ri?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=o(i);++r>>1,s=e[i];null!==s&&!Xs(s)&&(n?s<=t:s=200){var l=t?null:Ur(e);if(l)return Vt(l);s=!1,r=At,c=new Pn}else c=t?[]:a;e:for(;++o=o?e:zo(e,t,n)}var dr=$t||function(e){return Ye.clearTimeout(e)};function hr(e,t){if(t)return e.slice();var n=e.length,o=qe?qe(n):new e.constructor(n);return e.copy(o),o}function pr(e){var t=new e.constructor(e.byteLength);return new Pe(t).set(new Pe(e)),t}function mr(e,t){var n=t?pr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function gr(e,t){if(e!==t){var n=void 0!==e,o=null===e,r=e==e,i=Xs(e),s=void 0!==t,a=null===t,c=t==t,l=Xs(t);if(!a&&!l&&!i&&e>t||i&&s&&c&&!a&&!l||o&&s&&c||!n&&c||!r)return 1;if(!o&&!i&&!l&&e1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,s&&ci(n[0],n[1],s)&&(i=r<3?void 0:i,r=1),t=ge(t);++o-1?r[i?t[s]:s]:void 0}}function Or(e){return Kr((function(t){var n=t.length,o=n,r=In.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new ve(i);if(r&&!a&&"wrapper"==$r(s))var a=new In([],!0)}for(o=a?o:n;++o1&&b.reverse(),d&&la))return!1;var l=i.get(e);if(l&&i.get(t))return l==t;var u=-1,d=!0,h=2&n?new Pn:void 0;for(i.set(e,t),i.set(t,e);++u-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return at(a,(function(n){var o="_."+n[0];t&n[1]&&!dt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(J);return t?t[1].split(Z):[]}(o),n)))}function Ci(e){var t=0,n=0;return function(){var o=cn(),r=16-(o-n);if(n=o,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function wi(e,t){var n=-1,o=e.length,r=o-1;for(t=void 0===t?o:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Wi(e,n)}));function ts(e){var t=On(e);return t.__chain__=!0,t}function ns(e,t){return t(e)}var os=Kr((function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return Wn(t,e)};return!(t>1||this.__actions__.length)&&o instanceof An&&ai(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:ns,args:[r],thisArg:void 0}),new In(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(r)}));var rs=Er((function(e,t,n){we.call(e,n)?++e[n]:Yn(e,n,1)}));var is=xr(Ai),ss=xr(Fi);function as(e,t){return(Fs(e)?at:eo)(e,Xr(t,3))}function cs(e,t){return(Fs(e)?ct:to)(e,Xr(t,3))}var ls=Er((function(e,t,n){we.call(e,n)?e[n].push(t):Yn(e,n,[t])}));var us=Bo((function(e,t,n){var r=-1,i="function"==typeof t,s=Ms(e)?o(e.length):[];return eo(e,(function(e){s[++r]=i?it(t,e,n):bo(e,t,n)})),s})),ds=Er((function(e,t,n){Yn(e,n,t)}));function hs(e,t){return(Fs(e)?pt:Oo)(e,Xr(t,3))}var ps=Er((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ms=Bo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ci(e,t[0],t[1])?t=[]:n>2&&ci(t[0],t[1],t[2])&&(t=[t[0]]),Fo(e,io(t,1),[])})),gs=Qt||function(){return Ye.Date.now()};function _s(e,t,n){return t=n?void 0:t,jr(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fs(e,t){var n;if("function"!=typeof t)throw new ve(i);return e=oa(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var vs=Bo((function(e,t,n){var o=1;if(n.length){var r=qt(n,Qr(vs));o|=32}return jr(e,o,t,n,r)})),bs=Bo((function(e,t,n){var o=3;if(n.length){var r=qt(n,Qr(bs));o|=32}return jr(t,o,e,n,r)}));function Es(e,t,n){var o,r,s,a,c,l,u=0,d=!1,h=!1,p=!0;if("function"!=typeof e)throw new ve(i);function m(t){var n=o,i=r;return o=r=void 0,u=t,a=e.apply(i,n)}function g(e){return u=e,c=Ei(f,t),d?m(e):a}function _(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=s}function f(){var e=gs();if(_(e))return v(e);c=Ei(f,function(e){var n=t-(e-l);return h?an(n,s-(e-u)):n}(e))}function v(e){return c=void 0,p&&o?m(e):(o=r=void 0,a)}function b(){var e=gs(),n=_(e);if(o=arguments,r=this,l=e,n){if(void 0===c)return g(l);if(h)return dr(c),c=Ei(f,t),m(l)}return void 0===c&&(c=Ei(f,t)),a}return t=ia(t)||0,Vs(n)&&(d=!!n.leading,s=(h="maxWait"in n)?sn(ia(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==c&&dr(c),u=0,o=l=r=c=void 0},b.flush=function(){return void 0===c?a:v(gs())},b}var ys=Bo((function(e,t){return Jn(e,1,t)})),Ss=Bo((function(e,t,n){return Jn(e,ia(t)||0,n)}));function Cs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ve(i);var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var s=e.apply(this,o);return n.cache=i.set(r,s)||i,s};return n.cache=new(Cs.Cache||Mn),n}function ws(e){if("function"!=typeof e)throw new ve(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Cs.Cache=Mn;var Ts=lr((function(e,t){var n=(t=1==t.length&&Fs(t[0])?pt(t[0],Dt(Xr())):pt(io(t,1),Dt(Xr()))).length;return Bo((function(o){for(var r=-1,i=an(o.length,n);++r=t})),As=Eo(function(){return arguments}())?Eo:function(e){return Hs(e)&&we.call(e,"callee")&&!We.call(e,"callee")},Fs=o.isArray,Ns=Ze?Dt(Ze):function(e){return Hs(e)&&mo(e)==C};function Ms(e){return null!=e&&qs(e.length)&&!js(e)}function Ps(e){return Hs(e)&&Ms(e)}var Ls=tn||ic,Us=et?Dt(et):function(e){return Hs(e)&&mo(e)==d};function Bs(e){if(!Hs(e))return!1;var t=mo(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ys(e)}function js(e){if(!Vs(e))return!1;var t=mo(e);return t==p||t==m||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Gs(e){return"number"==typeof e&&e==oa(e)}function qs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Hs(e){return null!=e&&"object"==typeof e}var Ks=tt?Dt(tt):function(e){return Hs(e)&&oi(e)==g};function zs(e){return"number"==typeof e||Hs(e)&&mo(e)==_}function Ys(e){if(!Hs(e)||mo(e)!=f)return!1;var t=Ke(e);if(null===t)return!0;var n=we.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ce.call(n)==Oe}var Ws=nt?Dt(nt):function(e){return Hs(e)&&mo(e)==v};var $s=ot?Dt(ot):function(e){return Hs(e)&&oi(e)==b};function Qs(e){return"string"==typeof e||!Fs(e)&&Hs(e)&&mo(e)==E}function Xs(e){return"symbol"==typeof e||Hs(e)&&mo(e)==y}var Js=rt?Dt(rt):function(e){return Hs(e)&&qs(e.length)&&!!je[mo(e)]};var Zs=Mr(xo),ea=Mr((function(e,t){return e<=t}));function ta(e){if(!e)return[];if(Ms(e))return Qs(e)?zt(e):vr(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=oi(e);return(t==g?jt:t==b?Vt:Ra)(e)}function na(e){return e?(e=ia(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=na(e),n=t%1;return t==t?n?t-n:t:0}function ra(e){return e?$n(oa(e),0,4294967295):0}function ia(e){if("number"==typeof e)return e;if(Xs(e))return NaN;if(Vs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(W,"");var n=ie.test(e);return n||ae.test(e)?He(e.slice(2),n?2:8):re.test(e)?NaN:+e}function sa(e){return br(e,ya(e))}function aa(e){return null==e?"":Jo(e)}var ca=yr((function(e,t){if(hi(t)||Ms(t))br(t,Ea(t),e);else for(var n in t)we.call(t,n)&&Vn(e,n,t[n])})),la=yr((function(e,t){br(t,ya(t),e)})),ua=yr((function(e,t,n,o){br(t,ya(t),e,o)})),da=yr((function(e,t,n,o){br(t,Ea(t),e,o)})),ha=Kr(Wn);var pa=Bo((function(e,t){e=ge(e);var n=-1,o=t.length,r=o>2?t[2]:void 0;for(r&&ci(t[0],t[1],r)&&(o=1);++n1),t})),br(e,Yr(e),n),o&&(n=Qn(n,7,Vr));for(var r=t.length;r--;)er(n,t[r]);return n}));var Ta=Kr((function(e,t){return null==e?{}:function(e,t){return No(e,t,(function(t,n){return _a(e,n)}))}(e,t)}));function ka(e,t){if(null==e)return{};var n=pt(Yr(e),(function(e){return[e]}));return t=Xr(t),No(e,n,(function(e,n){return t(e,n[0])}))}var xa=Br(Ea),Oa=Br(ya);function Ra(e){return null==e?[]:It(e,Ea(e))}var Da=Tr((function(e,t,n){return t=t.toLowerCase(),e+(n?Ia(t):t)}));function Ia(e){return Ba(aa(e).toLowerCase())}function Aa(e){return(e=aa(e))&&e.replace(le,Pt).replace(Fe,"")}var Fa=Tr((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Na=Tr((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ma=wr("toLowerCase");var Pa=Tr((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var La=Tr((function(e,t,n){return e+(n?" ":"")+Ba(t)}));var Ua=Tr((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ba=wr("toUpperCase");function ja(e,t,n){return e=aa(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Me)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Ga=Bo((function(e,t){try{return it(e,void 0,t)}catch(e){return Bs(e)?e:new he(e)}})),qa=Kr((function(e,t){return at(t,(function(t){t=ki(t),Yn(e,t,vs(e[t],e))})),e}));function Va(e){return function(){return e}}var Ha=Or(),Ka=Or(!0);function za(e){return e}function Ya(e){return wo("function"==typeof e?e:Qn(e,1))}var Wa=Bo((function(e,t){return function(n){return bo(n,e,t)}})),$a=Bo((function(e,t){return function(n){return bo(e,n,t)}}));function Qa(e,t,n){var o=Ea(t),r=uo(t,o);null!=n||Vs(t)&&(r.length||!o.length)||(n=t,t=e,e=this,r=uo(t,Ea(t)));var i=!(Vs(n)&&"chain"in n&&!n.chain),s=js(e);return at(r,(function(n){var o=t[n];e[n]=o,s&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),r=n.__actions__=vr(this.__actions__);return r.push({func:o,args:arguments,thisArg:e}),n.__chain__=t,n}return o.apply(e,mt([this.value()],arguments))})})),e}function Xa(){}var Ja=Ar(pt),Za=Ar(lt),ec=Ar(ft);function tc(e){return li(e)?Tt(ki(e)):function(e){return function(t){return ho(t,e)}}(e)}var nc=Nr(),oc=Nr(!0);function rc(){return[]}function ic(){return!1}var sc=Ir((function(e,t){return e+t}),0),ac=Lr("ceil"),cc=Ir((function(e,t){return e/t}),1),lc=Lr("floor");var uc,dc=Ir((function(e,t){return e*t}),1),hc=Lr("round"),pc=Ir((function(e,t){return e-t}),0);return On.after=function(e,t){if("function"!=typeof t)throw new ve(i);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},On.ary=_s,On.assign=ca,On.assignIn=la,On.assignInWith=ua,On.assignWith=da,On.at=ha,On.before=fs,On.bind=vs,On.bindAll=qa,On.bindKey=bs,On.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Fs(e)?e:[e]},On.chain=ts,On.chunk=function(e,t,n){t=(n?ci(e,t,n):void 0===t)?1:sn(oa(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var i=0,s=0,a=o(Jt(r/t));ir?0:r+n),(o=void 0===o||o>r?r:oa(o))<0&&(o+=r),o=n>o?0:ra(o);n>>0)?(e=aa(e))&&("string"==typeof t||null!=t&&!Ws(t))&&!(t=Jo(t))&&Bt(e)?ur(zt(e),0,n):e.split(t,n):[]},On.spread=function(e,t){if("function"!=typeof e)throw new ve(i);return t=null==t?0:sn(oa(t),0),Bo((function(n){var o=n[t],r=ur(n,0,t);return o&&mt(r,o),it(e,this,r)}))},On.tail=function(e){var t=null==e?0:e.length;return t?zo(e,1,t):[]},On.take=function(e,t,n){return e&&e.length?zo(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},On.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?zo(e,(t=o-(t=n||void 0===t?1:oa(t)))<0?0:t,o):[]},On.takeRightWhile=function(e,t){return e&&e.length?nr(e,Xr(t,3),!1,!0):[]},On.takeWhile=function(e,t){return e&&e.length?nr(e,Xr(t,3)):[]},On.tap=function(e,t){return t(e),e},On.throttle=function(e,t,n){var o=!0,r=!0;if("function"!=typeof e)throw new ve(i);return Vs(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),Es(e,t,{leading:o,maxWait:t,trailing:r})},On.thru=ns,On.toArray=ta,On.toPairs=xa,On.toPairsIn=Oa,On.toPath=function(e){return Fs(e)?pt(e,ki):Xs(e)?[e]:vr(Ti(aa(e)))},On.toPlainObject=sa,On.transform=function(e,t,n){var o=Fs(e),r=o||Ls(e)||Js(e);if(t=Xr(t,4),null==n){var i=e&&e.constructor;n=r?o?new i:[]:Vs(e)&&js(i)?Rn(Ke(e)):{}}return(r?at:co)(e,(function(e,o,r){return t(n,e,o,r)})),n},On.unary=function(e){return _s(e,1)},On.union=Hi,On.unionBy=Ki,On.unionWith=zi,On.uniq=function(e){return e&&e.length?Zo(e):[]},On.uniqBy=function(e,t){return e&&e.length?Zo(e,Xr(t,2)):[]},On.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zo(e,void 0,t):[]},On.unset=function(e,t){return null==e||er(e,t)},On.unzip=Yi,On.unzipWith=Wi,On.update=function(e,t,n){return null==e?e:tr(e,t,ar(n))},On.updateWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:tr(e,t,ar(n),o)},On.values=Ra,On.valuesIn=function(e){return null==e?[]:It(e,ya(e))},On.without=$i,On.words=ja,On.wrap=function(e,t){return ks(ar(t),e)},On.xor=Qi,On.xorBy=Xi,On.xorWith=Ji,On.zip=Zi,On.zipObject=function(e,t){return ir(e||[],t||[],Vn)},On.zipObjectDeep=function(e,t){return ir(e||[],t||[],qo)},On.zipWith=es,On.entries=xa,On.entriesIn=Oa,On.extend=la,On.extendWith=ua,Qa(On,On),On.add=sc,On.attempt=Ga,On.camelCase=Da,On.capitalize=Ia,On.ceil=ac,On.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ia(n))==n?n:0),void 0!==t&&(t=(t=ia(t))==t?t:0),$n(ia(e),t,n)},On.clone=function(e){return Qn(e,4)},On.cloneDeep=function(e){return Qn(e,5)},On.cloneDeepWith=function(e,t){return Qn(e,5,t="function"==typeof t?t:void 0)},On.cloneWith=function(e,t){return Qn(e,4,t="function"==typeof t?t:void 0)},On.conformsTo=function(e,t){return null==t||Xn(e,t,Ea(t))},On.deburr=Aa,On.defaultTo=function(e,t){return null==e||e!=e?t:e},On.divide=cc,On.endsWith=function(e,t,n){e=aa(e),t=Jo(t);var o=e.length,r=n=void 0===n?o:$n(oa(n),0,o);return(n-=t.length)>=0&&e.slice(n,r)==t},On.eq=Rs,On.escape=function(e){return(e=aa(e))&&B.test(e)?e.replace(L,Lt):e},On.escapeRegExp=function(e){return(e=aa(e))&&Y.test(e)?e.replace(z,"\\$&"):e},On.every=function(e,t,n){var o=Fs(e)?lt:no;return n&&ci(e,t,n)&&(t=void 0),o(e,Xr(t,3))},On.find=is,On.findIndex=Ai,On.findKey=function(e,t){return bt(e,Xr(t,3),co)},On.findLast=ss,On.findLastIndex=Fi,On.findLastKey=function(e,t){return bt(e,Xr(t,3),lo)},On.floor=lc,On.forEach=as,On.forEachRight=cs,On.forIn=function(e,t){return null==e?e:so(e,Xr(t,3),ya)},On.forInRight=function(e,t){return null==e?e:ao(e,Xr(t,3),ya)},On.forOwn=function(e,t){return e&&co(e,Xr(t,3))},On.forOwnRight=function(e,t){return e&&lo(e,Xr(t,3))},On.get=ga,On.gt=Ds,On.gte=Is,On.has=function(e,t){return null!=e&&ri(e,t,_o)},On.hasIn=_a,On.head=Mi,On.identity=za,On.includes=function(e,t,n,o){e=Ms(e)?e:Ra(e),n=n&&!o?oa(n):0;var r=e.length;return n<0&&(n=sn(r+n,0)),Qs(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&yt(e,t,n)>-1},On.indexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:oa(n);return r<0&&(r=sn(o+r,0)),yt(e,t,r)},On.inRange=function(e,t,n){return t=na(t),void 0===n?(n=t,t=0):n=na(n),function(e,t,n){return e>=an(t,n)&&e=-9007199254740991&&e<=9007199254740991},On.isSet=$s,On.isString=Qs,On.isSymbol=Xs,On.isTypedArray=Js,On.isUndefined=function(e){return void 0===e},On.isWeakMap=function(e){return Hs(e)&&oi(e)==S},On.isWeakSet=function(e){return Hs(e)&&"[object WeakSet]"==mo(e)},On.join=function(e,t){return null==e?"":on.call(e,t)},On.kebabCase=Fa,On.last=Bi,On.lastIndexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=o;return void 0!==n&&(r=(r=oa(n))<0?sn(o+r,0):an(r,o-1)),t==t?function(e,t,n){for(var o=n+1;o--;)if(e[o]===t)return o;return o}(e,t,r):Et(e,Ct,r,!0)},On.lowerCase=Na,On.lowerFirst=Ma,On.lt=Zs,On.lte=ea,On.max=function(e){return e&&e.length?oo(e,za,go):void 0},On.maxBy=function(e,t){return e&&e.length?oo(e,Xr(t,2),go):void 0},On.mean=function(e){return wt(e,za)},On.meanBy=function(e,t){return wt(e,Xr(t,2))},On.min=function(e){return e&&e.length?oo(e,za,xo):void 0},On.minBy=function(e,t){return e&&e.length?oo(e,Xr(t,2),xo):void 0},On.stubArray=rc,On.stubFalse=ic,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return!0},On.multiply=dc,On.nth=function(e,t){return e&&e.length?Ao(e,oa(t)):void 0},On.noConflict=function(){return Ye._===this&&(Ye._=Re),this},On.noop=Xa,On.now=gs,On.pad=function(e,t,n){e=aa(e);var o=(t=oa(t))?Kt(e):0;if(!t||o>=t)return e;var r=(t-o)/2;return Fr(Zt(r),n)+e+Fr(Jt(r),n)},On.padEnd=function(e,t,n){e=aa(e);var o=(t=oa(t))?Kt(e):0;return t&&ot){var o=e;e=t,t=o}if(n||e%1||t%1){var r=un();return an(e+r*(t-e+Ve("1e-"+((r+"").length-1))),t)}return Lo(e,t)},On.reduce=function(e,t,n){var o=Fs(e)?gt:xt,r=arguments.length<3;return o(e,Xr(t,4),n,r,eo)},On.reduceRight=function(e,t,n){var o=Fs(e)?_t:xt,r=arguments.length<3;return o(e,Xr(t,4),n,r,to)},On.repeat=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:oa(t),Uo(aa(e),t)},On.replace=function(){var e=arguments,t=aa(e[0]);return e.length<3?t:t.replace(e[1],e[2])},On.result=function(e,t,n){var o=-1,r=(t=cr(t,e)).length;for(r||(r=1,e=void 0);++o9007199254740991)return[];var n=4294967295,o=an(e,4294967295);e-=4294967295;for(var r=Rt(o,t=Xr(t));++n=i)return e;var a=n-Kt(o);if(a<1)return o;var c=s?ur(s,0,a).join(""):e.slice(0,a);if(void 0===r)return c+o;if(s&&(a+=c.length-a),Ws(r)){if(e.slice(a).search(r)){var l,u=c;for(r.global||(r=_e(r.source,aa(oe.exec(r))+"g")),r.lastIndex=0;l=r.exec(u);)var d=l.index;c=c.slice(0,void 0===d?a:d)}}else if(e.indexOf(Jo(r),a)!=a){var h=c.lastIndexOf(r);h>-1&&(c=c.slice(0,h))}return c+o},On.unescape=function(e){return(e=aa(e))&&U.test(e)?e.replace(P,Yt):e},On.uniqueId=function(e){var t=++Te;return aa(e)+t},On.upperCase=Ua,On.upperFirst=Ba,On.each=as,On.eachRight=cs,On.first=Mi,Qa(On,(uc={},co(On,(function(e,t){we.call(On.prototype,t)||(uc[t]=e)})),uc),{chain:!1}),On.VERSION="4.17.15",at(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){On[e].placeholder=On})),at(["drop","take"],(function(e,t){An.prototype[e]=function(n){n=void 0===n?1:sn(oa(n),0);var o=this.__filtered__&&!t?new An(this):this.clone();return o.__filtered__?o.__takeCount__=an(n,o.__takeCount__):o.__views__.push({size:an(n,4294967295),type:e+(o.__dir__<0?"Right":"")}),o},An.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),at(["filter","map","takeWhile"],(function(e,t){var n=t+1,o=1==n||3==n;An.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xr(e,3),type:n}),t.__filtered__=t.__filtered__||o,t}})),at(["head","last"],(function(e,t){var n="take"+(t?"Right":"");An.prototype[e]=function(){return this[n](1).value()[0]}})),at(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");An.prototype[e]=function(){return this.__filtered__?new An(this):this[n](1)}})),An.prototype.compact=function(){return this.filter(za)},An.prototype.find=function(e){return this.filter(e).head()},An.prototype.findLast=function(e){return this.reverse().find(e)},An.prototype.invokeMap=Bo((function(e,t){return"function"==typeof e?new An(this):this.map((function(n){return bo(n,e,t)}))})),An.prototype.reject=function(e){return this.filter(ws(Xr(e)))},An.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new An(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},An.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},An.prototype.toArray=function(){return this.take(4294967295)},co(An.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=On[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);r&&(On.prototype[t]=function(){var t=this.__wrapped__,s=o?[1]:arguments,a=t instanceof An,c=s[0],l=a||Fs(t),u=function(e){var t=r.apply(On,mt([e],s));return o&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(a=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=i&&!d,m=a&&!h;if(!i&&l){t=m?t:new An(this);var g=e.apply(t,s);return g.__actions__.push({func:ns,args:[u],thisArg:void 0}),new In(g,d)}return p&&m?e.apply(this,s):(g=this.thru(u),p?o?g.value()[0]:g.value():g)})})),at(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);On.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var r=this.value();return t.apply(Fs(r)?r:[],e)}return this[n]((function(n){return t.apply(Fs(n)?n:[],e)}))}})),co(An.prototype,(function(e,t){var n=On[t];if(n){var o=n.name+"";we.call(bn,o)||(bn[o]=[]),bn[o].push({name:t,func:n})}})),bn[Rr(void 0,2).name]=[{name:"wrapper",func:void 0}],An.prototype.clone=function(){var e=new An(this.__wrapped__);return e.__actions__=vr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vr(this.__views__),e},An.prototype.reverse=function(){if(this.__filtered__){var e=new An(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},An.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Fs(e),o=t<0,r=n?e.length:0,i=function(e,t,n){var o=-1,r=n.length;for(;++o=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},On.prototype.plant=function(e){for(var t,n=this;n instanceof Dn;){var o=Oi(n);o.__index__=0,o.__values__=void 0,t?r.__wrapped__=o:t=o;var r=o;n=n.__wrapped__}return r.__wrapped__=e,t},On.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof An){var t=e;return this.__actions__.length&&(t=new An(this)),(t=t.reverse()).__actions__.push({func:ns,args:[Vi],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(Vi)},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return or(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,Je&&(On.prototype[Je]=function(){return this}),On}();Ye._=Wt,void 0===(r=function(){return Wt}.call(t,n,t,o))||(o.exports=r)}).call(this)}).call(this,n(17),n(168)(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"e",(function(){return h})),n.d(t,"d",(function(){return p})),n.d(t,"c",(function(){return m})),n.d(t,"b",(function(){return g}));var o=n(33),r=n.n(o),i=n(37),s=n(184),a=n(41),c=n(36),l=n(34),u=n(489);function d(e,t){const n=new s.a(e);return n.invite(t).then(e=>Promise.resolve({states:e,inviter:n}))}function h(){const e=c.getComponent("dialogs.InviteDialog");a.a.createTrackedDialog("Start DM","",e,{kind:u.a},null,!1,!0)}function p(e){const t=c.getComponent("dialogs.InviteDialog");a.a.createTrackedDialog("Invite Users","",t,{kind:u.b,roomId:e},null,!1,!0)}function m(e){if(!e||"m.room.third_party_invite"!==e.getType())return!1;const t=["key_validity_url","public_key","display_name"];for(let n=0;n{const n=i.a.get().getRoom(e);return function(e,t,n){const o=Object.keys(e).filter(t=>"error"===e[t]);if(1===o.length&&n.fatal){const e=c.getComponent("dialogs.ErrorDialog");a.a.createTrackedDialog("Failed to invite users to the room","",e,{title:Object(l.a)("Failed to invite users to the room:",{roomName:t.name}),description:n.getErrorText(o[0])})}else{const i=[];for(const t of o)if("error"===e[t]){const e=n.getErrorText(t);i.push(t+": "+e)}if(i.length>0){const e=r.a.createElement("div",null,i.map(e=>r.a.createElement("div",{key:e},e))),n=c.getComponent("dialogs.ErrorDialog");a.a.createTrackedDialog("Failed to invite the following users to the room","",n,{title:Object(l.a)("Failed to invite the following users to the %(roomName)s room:",{roomName:t.name}),description:e})}}return e}(t.states,n,t.inviter)}).catch(e=>{console.error(e.stack);const t=c.getComponent("dialogs.ErrorDialog");a.a.createTrackedDialog("Failed to invite","",t,{title:Object(l.a)("Failed to invite"),description:e&&e.message?e.message:Object(l.a)("Operation failed")})})}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return u}));var o=n(35),r=n.n(o);const i=/^\S+@\S+\.\S+$/,s=/^@\S+:\S+$/,a=/^!\S+:\S+$/,c=["mx-user-id","mx-room-id","email"],l=r.a.shape({addressType:r.a.oneOf(c).isRequired,address:r.a.string.isRequired,displayName:r.a.string,avatarMxc:r.a.string,isKnown:r.a.bool});function u(e){const t=i.test(e),n=s.test(e),o=a.test(e);return t?"email":n?"mx-user-id":o?"mx-room-id":null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));var o=n(57),r=n.n(o);function i(e){if(!e)return"";const t=r.a.parse(e);return t&&"/"===t.path?t.host:e}function s(e){if(!e)return"";let t=e;e.startsWith("https://")||(t="https://"+e);return null===r.a.parse(t).hostname?e:t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return c}));var o=n(37);function r(e){return e.getCanonicalAlias()||e.getAltAliases()[0]}const i={};function s(e,t,n){if(void 0!==i[e.roomId])return i[e.roomId];const o=function(e,t,n){if(!n)return!1;if("join"!=e.getMyMembership())return!1;const o=function(e,t){return 2===e.currentState.getJoinedMemberCount()?e.getJoinedMembers().filter((function(e){return e.userId!==t}))[0]:null}(e,t);return!!o&&!!n.isConferenceUser(o.userId)}(e,t,n);return i[e.roomId]=o,o}function a(e,t){let n;if(t){n=function(e,t){let n,o;for(const r of e.getJoinedMembers())r.userId!=t&&(void 0===n||r.events.member&&r.events.member.getTs()-1&&o.splice(t,1)}}if(t){const n=r[t]||[];-1==n.indexOf(e)&&n.push(e),r[t]=n}return o.a.get().setAccountData("m.direct",r)}},function(e,t,n){"use strict";let o;n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),function(e){e.Invite="im.vector.fake.invite",e.Untagged="im.vector.fake.recent",e.Archived="im.vector.fake.archived",e.LowPriority="m.lowpriority",e.Favourite="m.favourite",e.DM="im.vector.fake.direct",e.ServerNotice="m.server_notice"}(o||(o={}));const r=[o.Invite,o.Favourite,o.DM,o.Untagged,o.LowPriority,o.ServerNotice,o.Archived];let i;!function(e){e.Timeline="TIMELINE",e.RoomRead="ROOM_READ"}(i||(i={}))},function(e,t,n){"use strict";(function(e){class n{constructor(){this.keyRgb=["rgb(118, 207, 166)","rgb(234, 245, 240)","rgb(211, 239, 225)"],this.keyHex=["#76CFA6","#EAF5F0","#D3EFE1","#FFFFFF","#000000"],this.colors=[this.keyHex[0],this.keyHex[1],this.keyHex[2],this.keyHex[3],this.keyHex[4]],this.currentTint=[void 0,void 0,void 0,void 0,void 0],this.cssFixups=[],this.cssAttrs=["color","backgroundColor","borderColor","borderTopColor","borderBottomColor","borderLeftColor"],this.svgAttrs=["fill","stroke"],this.tintables=[],this.theme=void 0,this.forceTint=!1}registerTintable(e){this.tintables.push(e),e()}getKeyRgb(){return this.keyRgb}tint(e,t,n){}tintSvgWhite(e){this.currentTint[3]=e,e||(e=this.colors[3]),this.colors[3]!==e&&(this.colors[3]=e,this.tintables.forEach((function(e){e()})))}tintSvgBlack(e){this.currentTint[4]=e,e||(e=this.colors[4]),this.colors[4]!==e&&(this.colors[4]=e,this.tintables.forEach((function(e){e()})))}setTheme(e){this.theme=e,document.getElementById("mx_theme_accentColor")&&(this.keyRgb[0]=window.getComputedStyle(document.getElementById("mx_theme_accentColor")).color),document.getElementById("mx_theme_secondaryAccentColor")&&(this.keyRgb[1]=window.getComputedStyle(document.getElementById("mx_theme_secondaryAccentColor")).color),document.getElementById("mx_theme_tertiaryAccentColor")&&(this.keyRgb[2]=window.getComputedStyle(document.getElementById("mx_theme_tertiaryAccentColor")).color),this.calcCssFixups(),this.forceTint=!0,this.tint(this.currentTint[0],this.currentTint[1],this.currentTint[2]),"dark"===e?(this.tintSvgWhite("#2d2d2d"),this.tintSvgBlack("#dddddd")):(this.tintSvgWhite("#ffffff"),this.tintSvgBlack("#000000"))}calcCssFixups(){if(!this.cssFixups[this.theme]){0,this.cssFixups[this.theme]=[];for(let e=0;eo.getComponent(e)||t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return d}));var o=n(3),r=n.n(o),i=n(38),s=n(50),a=n(313);const c="mx_hs_url",l="mx_is_url";let u;!function(e){e.Checking="CHECKING",e.Error="ERROR",e.NotAvailable="NOTAVAILABLE",e.Downloading="DOWNLOADING",e.Ready="READY"}(u||(u={}));class d{constructor(){r()(this,"notificationCount",0),r()(this,"errorDidOccur",!1),r()(this,"onAction",e=>{switch(e.action){case"on_client_not_viable":case"on_logged_out":this.setNotificationCount(0)}}),i.a.register(this.onAction),this.startUpdateCheck=this.startUpdateCheck.bind(this)}setNotificationCount(e){this.notificationCount=e}setErrorStatus(e){this.errorDidOccur=e}async canSelfUpdate(){return!1}startUpdateCheck(){Object(a.a)(),localStorage.removeItem("mx_defer_update"),i.a.dispatch({action:s.a.CheckUpdates,status:u.Checking})}installUpdate(){}shouldShowUpdate(e){try{const[t,n]=JSON.parse(localStorage.getItem("mx_defer_update"));return e!==t||Date.now()>n}catch(e){return!0}}deferUpdate(e){const t=new Date(Date.now()+864e5);t.setHours(8,0,0,0),localStorage.setItem("mx_defer_update",JSON.stringify([e,t.getTime()])),Object(a.a)()}supportsNotifications(){return!1}maySendNotifications(){return!1}loudNotification(e,t){}screenCaptureErrorString(){return"Not implemented"}supportsAutoLaunch(){return!1}async getAutoLaunchEnabled(){return!1}async setAutoLaunchEnabled(e){throw new Error("Unimplemented")}supportsAutoHideMenuBar(){return!1}async getAutoHideMenuBarEnabled(){return!1}async setAutoHideMenuBarEnabled(e){throw new Error("Unimplemented")}supportsMinimizeToTray(){return!1}async getMinimizeToTrayEnabled(){return!1}async setMinimizeToTrayEnabled(e){throw new Error("Unimplemented")}getEventIndexingManager(){return null}setLanguage(e){}getSSOCallbackUrl(e){const t=new URL(window.location.href);return t.hash=e||"",t}startSingleSignOn(e,t,n){localStorage.setItem(c,e.getHomeserverUrl()),e.getIdentityServerUrl()&&localStorage.setItem(l,e.getIdentityServerUrl());const o=this.getSSOCallbackUrl(n);window.location.href=e.getSsoLoginUrl(o.toString(),t)}onKeyDown(e){return!1}async getPickleKey(e,t){return null}async createPickleKey(e,t){return null}async destroyPickleKey(e,t){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(33),r=n.n(o),i=n(42),s=n.n(i);function a({description:e,rules:t}){return async function({value:n,focused:o,allowEmpty:i=!0}){if(!n&&i)return{valid:null,feedback:null};const a=[];let c,l,u,d=!0;if(t&&t.length)for(const e of t){if(!e.key||!e.test)continue;if(!d&&e.final)continue;const t={value:n,allowEmpty:i};if(e.skip&&e.skip.call(this,t))continue;const o=await e.test.call(this,t);if(d=d&&o,o&&e.valid){const t=e.valid.call(this);if(!t)continue;a.push({key:e.key,valid:!0,text:t})}else if(!o&&e.invalid){const t=e.invalid.call(this);if(!t)continue;a.push({key:e.key,valid:!1,text:t})}}if(!o)return{valid:d,feedback:null};if(a&&a.length&&(c=r.a.createElement("ul",{className:"mx_Validation_details"},a.map(e=>{const t=s()({mx_Validation_detail:!0,mx_Validation_valid:e.valid,mx_Validation_invalid:!e.valid});return r.a.createElement("li",{key:e.key,className:t},e.text)}))),e){const t=e.call(this);l=r.a.createElement("div",{className:"mx_Validation_description"},t)}return(l||c)&&(u=r.a.createElement("div",{className:"mx_Validation"},l,c)),{valid:d,feedback:u}}}},function(e,t,n){"use strict";var o=n(316);i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var r=i.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function i(e,t,n){return i.TYPED_ARRAY_SUPPORT||this instanceof i?"number"==typeof e?c(this,e):function(e,t,n,o){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer)return function(e,t,n,o){if(n<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function a(e,t){var n;return i.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=i.prototype:(null===(n=e)&&(n=new i(t)),n.length=t),n}function c(e,t){var n=a(e,t<0?0:0|s(t));if(!i.TYPED_ARRAY_SUPPORT)for(var o=0;o55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function d(e){return i.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:u(e).length)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(e,t,n){void 0===t||void 0===n&&"string"==typeof t?(n=this.length,t=0):isFinite(t)&&(t|=0,isFinite(n)?n|=0:n=void 0);var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,n,o){return function(e,t,n,o){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}(u(t,e.length-n),e,n,o)}(this,e,t,n)},i.prototype.slice=function(e,t){var n,o=this.length;if((e=~~e)<0?(e+=o)<0&&(e=0):e>o&&(e=o),(t=void 0===t?o:~~t)<0?(t+=o)<0&&(t=0):t>o&&(t=o),t=e.length&&(t=e.length),t||(t=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(s<1e3||!i.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",c="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),u=/[\\&]/,d="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",h=new RegExp("\\\\"+d+"|"+s,"gi"),p=new RegExp('[&<>"]',"g"),m=new RegExp(s+'|[&<>"]',"gi"),g=function(e){return 92===e.charCodeAt(0)?e.charAt(1):i(e)},_=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}};e.exports={unescapeString:function(e){return u.test(e)?e.replace(h,g):e},normalizeURI:function(e){try{return o(r(e))}catch(t){return e}},escapeXml:function(e,t){return p.test(e)?t?e.replace(m,_):e.replace(p,_):e},reHtmlTag:l,OPENTAG:a,CLOSETAG:c,ENTITY:s,ESCAPABLE:d}},function(e,t){e.exports="img/warning.05cc423.svg"},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(114),r=n(1);function i(e){return"string"==typeof e&&!!e&&"undefined"!==e&&"null"!==e||"number"==typeof e}function s(e){e=e||{},this.rooms={},this.groups={},this.users={},this.syncToken=null,this.filters={},this.accountData={},this.localStorage=e.localStorage,this._oobMembers={},this._clientOptions={}}s.prototype={getSyncToken:function(){return this.syncToken},isNewlyCreated:function(){return Promise.resolve(!0)},setSyncToken:function(e){this.syncToken=e},storeGroup:function(e){this.groups[e.groupId]=e},getGroup:function(e){return this.groups[e]||null},getGroups:function(){return r.B(this.groups)},storeRoom:function(e){this.rooms[e.roomId]=e,e.currentState.on("RoomState.members",this._onRoomMember.bind(this));const t=this;e.currentState.getMembers().forEach((function(n){t._onRoomMember(null,e.currentState,n)}))},_onRoomMember:function(e,t,n){if("invite"===n.membership)return;const r=this.users[n.userId]||new o.a(n.userId);n.name&&(r.setDisplayName(n.name),n.events.member&&r.setRawDisplayName(n.events.member.getDirectionalContent().displayname)),n.events.member&&n.events.member.getContent().avatar_url&&r.setAvatarUrl(n.events.member.getContent().avatar_url),this.users[r.userId]=r},getRoom:function(e){return this.rooms[e]||null},getRooms:function(){return r.B(this.rooms)},removeRoom:function(e){this.rooms[e]&&this.rooms[e].removeListener("RoomState.members",this._onRoomMember),delete this.rooms[e]},getRoomSummaries:function(){return r.u(r.B(this.rooms),(function(e){return e.summary}))},storeUser:function(e){this.users[e.userId]=e},getUser:function(e){return this.users[e]||null},getUsers:function(){return r.B(this.users)},scrollback:function(e,t){return[]},storeEvents:function(e,t,n,o){},storeFilter:function(e){e&&(this.filters[e.userId]||(this.filters[e.userId]={}),this.filters[e.userId][e.filterId]=e)},getFilter:function(e,t){return this.filters[e]&&this.filters[e][t]?this.filters[e][t]:null},getFilterIdByName:function(e){if(!this.localStorage)return null;const t="mxjssdk_memory_filter_"+e;try{const e=this.localStorage.getItem(t);if(i(e))return e}catch(e){}return null},setFilterIdByName:function(e,t){if(!this.localStorage)return;const n="mxjssdk_memory_filter_"+e;try{i(t)?this.localStorage.setItem(n,t):this.localStorage.removeItem(n)}catch(e){}},storeAccountDataEvents:function(e){const t=this;e.forEach((function(e){t.accountData[e.getType()]=e}))},getAccountData:function(e){return this.accountData[e]},setSyncData:function(e){return Promise.resolve()},wantsSave:function(){return!1},save:function(e){},startup:function(){return Promise.resolve()},getSavedSync:function(){return Promise.resolve(null)},getSavedSyncToken:function(){return Promise.resolve(null)},deleteAllData:function(){return this.rooms={},this.users={},this.syncToken=null,this.filters={},this.accountData={},Promise.resolve()},getOutOfBandMembers:function(e){return Promise.resolve(this._oobMembers[e]||null)},setOutOfBandMembers:function(e,t){return this._oobMembers[e]=t,Promise.resolve()},clearOutOfBandMembers:function(){return this._oobMembers={},Promise.resolve()},getClientOptions:function(){return Promise.resolve(this._clientOptions)},storeClientOptions:function(e){return this._clientOptions=Object.assign({},e),Promise.resolve()}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(3),r=n.n(o);class i{get action(){return"NOT_USED"}constructor(e){r()(this,"fn",void 0),this.fn=e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";(function(e){n.d(t,"h",(function(){return a})),n.d(t,"i",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return _})),n.d(t,"j",(function(){return f}));var o=n(517),r=n(1),i=n(0),s=n(518);const a="/_matrix/client/r0",c="/_matrix/client/unstable",l="/_matrix/identity/api/v1",u="/_matrix/identity/v2",d="/_matrix/media/r0";function h(e,t){r.a(t,["baseUrl","request","prefix"]),t.onlyData=t.onlyData||!1,this.event_emitter=e,this.opts=t,this.useAuthorizationHeader=Boolean(t.useAuthorizationHeader),this.uploads=[]}h.prototype={setIdBaseUrl:function(e){this.opts.idBaseUrl=e},getContentUri:function(){const e={access_token:this.opts.accessToken};return{base:this.opts.baseUrl,path:"/_matrix/media/r0/upload",params:e}},uploadContent:function(t,n){r.q(n)?n={callback:n}:void 0===n&&(n={});const o=!1!==n.includeFilename,a=n.type||t.type||"application/octet-stream",c=n.name||t.name;let l=t;l.stream&&"function"!=typeof l.stream&&(i.a.warn("Using `file.stream` as the content to upload. Future versions of the js-sdk will change this to expect `file` to be the content directly."),l=l.stream);let u=n.rawResponse;void 0===u&&(e.XMLHttpRequest?u=!1:(i.a.warn("Returning the raw JSON from uploadContent(). Future versions of the js-sdk will change this default, to return the parsed object. Set opts.rawResponse=false to change this behaviour now."),u=!0));let d=n.onlyContentUri;u||void 0!==d||(e.XMLHttpRequest?(i.a.warn("Returning only the content-uri from uploadContent(). Future versions of the js-sdk will change this default, to return the whole response object. Set opts.onlyContentUri=false to change this behaviour now."),d=!0):d=!1);const h={loaded:0,total:0};let m,g=null;if(u||(g=function(e){let t=JSON.parse(e);if(d&&(t=t.content_uri,void 0===t))throw Error("Bad response");return t}),e.XMLHttpRequest){const t=r.d(),i=new e.XMLHttpRequest;h.xhr=i;const u=p(t,n.callback,this.opts.onlyData),d=function(){i.abort(),u(new Error("Timeout"))};i.timeout_timer=s.b(d,3e4),i.onreadystatechange=function(){switch(i.readyState){case e.XMLHttpRequest.DONE:var t;s.a(i.timeout_timer);try{if(0===i.status)throw new _;if(!i.responseText)throw new Error("No response body.");t=i.responseText,g&&(t=g(t))}catch(e){return e.http_status=i.status,void u(e)}u(void 0,i,t)}},i.upload.addEventListener("progress",(function(e){s.a(i.timeout_timer),h.loaded=e.loaded,h.total=e.total,i.timeout_timer=s.b(d,3e4),n.progressHandler&&n.progressHandler({loaded:e.loaded,total:e.total})}));let f=this.opts.baseUrl+"/_matrix/media/r0/upload";const v=[];o&&c&&v.push("filename="+encodeURIComponent(c)),this.useAuthorizationHeader||v.push("access_token="+encodeURIComponent(this.opts.accessToken)),v.length>0&&(f+="?"+v.join("&")),i.open("POST",f),this.useAuthorizationHeader&&i.setRequestHeader("Authorization","Bearer "+this.opts.accessToken),i.setRequestHeader("Content-Type",a),i.send(l),m=t.promise,m.abort=i.abort.bind(i)}else{const e={};o&&c&&(e.filename=c),m=this.authedRequest(n.callback,"POST","/upload",e,l,{prefix:"/_matrix/media/r0",headers:{"Content-Type":a},json:!1,bodyParser:g})}const f=this,v=m.finally((function(){for(let e=0;e{v&&(g&&s.a(g),g=s.b((function(){f=!0,_&&_.abort&&_.abort(),h.reject(new m({error:"Locally timed out waiting for a response",errcode:"ORG.MATRIX.JSSDK_TIMEOUT",timeout:v}))}),v))};b();const E=h.promise;try{_=this.opts.request({uri:n,method:t,withCredentials:!1,qs:o,qsStringifyOptions:a.qsStringifyOptions,useQuerystring:!0,body:i,json:!1,timeout:v,headers:l||{},_matrix_opts:this.opts},(function(t,n,o){if(v&&(s.a(g),f))return;p(h,e,c.opts.onlyData,d)(t,n,o)})),_&&("onprogress"in _&&(_.onprogress=e=>{b()}),_.abort&&(E.abort=_.abort.bind(_)))}catch(t){h.reject(t),e&&e(t)}return E}};const p=function(e,t,n,r){return t=t||function(){},function(i,s,a){if(i){"AbortError"===i.name||"aborted"===i||i instanceof m||(i=new g("request failed",i))}if(!i)try{s.statusCode>=400?i=function(e,t){const n=e.statusCode,r=function(e){let t;e.getResponseHeader?t=e.getResponseHeader("Content-Type"):e.headers&&(t=e.headers["content-type"]||null);if(!t)return null;try{return Object(o.parse)(t)}catch(e){throw new Error(`Error parsing Content-Type '${t}': ${e}`)}}(e);let i;if(r)if("application/json"===r.type){const e="object"==typeof t?t:JSON.parse(t);i=new m(e)}else"text/plain"===r.type&&(i=new Error(`Server returned ${n} error: ${t}`));i||(i=new Error(`Server returned ${n} error`));return i.httpStatus=n,i}(s,a):r&&(a=r(a))}catch(e){i=new Error("Error parsing server response: "+e)}if(i)e.reject(i),t(i);else{const o={code:s.statusCode,headers:s.headers,data:a};e.resolve(n?a:o),t(null,n?a:o)}}};class m extends Error{constructor(e){super("MatrixError: "+(e=e||{}).errcode),this.errcode=e.errcode,this.name=e.errcode||"Unknown error code",this.message=e.error||"Unknown message",this.data=e}}class g extends Error{constructor(e,t){super(e+(t?": "+t.message:"")),this._cause=t}get name(){return"ConnectionError"}get cause(){return this._cause}}class _ extends Error{constructor(){super("Operation aborted")}get name(){return"AbortError"}}async function f(e,t){let n=0,o=null;for(;n0){const e=1e3*Math.pow(2,n);console.log(`network operation failed ${n} times, retrying in ${e}ms...`),await new Promise(t=>setTimeout(t,e))}return await t()}catch(e){if(!(e instanceof g))throw e;n+=1,o=e}throw o}}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(3),r=n.n(o),i=n(0),s=n(1);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t{const n=this._getOutgoingRoomKeyRequest(t);return n?(i.a.log(`already have key request outstanding for ${t.room_id} / ${t.session_id}: not sending another`),n):(i.a.log(`enqueueing key request for ${t.room_id} / `+t.session_id),this._outgoingRoomKeyRequests.push(e),e)})}getOutgoingRoomKeyRequest(e){return Promise.resolve(this._getOutgoingRoomKeyRequest(e))}_getOutgoingRoomKeyRequest(e){for(const t of this._outgoingRoomKeyRequests)if(s.b(t.requestBody,e))return t;return null}getOutgoingRoomKeyRequestByState(e){for(const t of this._outgoingRoomKeyRequests)for(const n of e)if(t.state===n)return Promise.resolve(t);return Promise.resolve(null)}getAllOutgoingRoomKeyRequestsByState(e){return Promise.resolve(this._outgoingRoomKeyRequests.filter(t=>t.state==e))}getOutgoingRoomKeyRequestsByTarget(e,t,n){const o=[];for(const r of this._outgoingRoomKeyRequests)for(const i of n)r.state===i&&r.recipients.includes({userId:e,deviceId:t})&&o.push(r);return Promise.resolve(o)}updateOutgoingRoomKeyRequest(e,t,n){for(const o of this._outgoingRoomKeyRequests)if(o.requestId===e)return o.state!=t?(i.a.warn(`Cannot update room key request from ${t} as it was already updated to `+o.state),Promise.resolve(null)):(Object.assign(o,n),Promise.resolve(o));return Promise.resolve(null)}deleteOutgoingRoomKeyRequest(e,t){for(let n=0;n{Object.entries(n).forEach(([n,o])=>{t(c(c({},o),{},{deviceKey:e,sessionId:n}))})})}storeEndToEndSession(e,t,n,o){let r=this._sessions[e];void 0===r&&(r={},this._sessions[e]=r),r[t]=n}async storeEndToEndSessionProblem(e,t,n){const o=this._sessionProblems[e]=this._sessionProblems[e]||[];o.push({type:t,fixed:n,time:Date.now()}),o.sort((e,t)=>e.time-t.time)}async getEndToEndSessionProblem(e,t){const n=this._sessionProblems[e]||[];if(!n.length)return null;const o=n[n.length-1];for(const e of n)if(e.time>t)return Object.assign({},e,{fixed:o.fixed});return o.fixed?null:o}async filterOutNotifiedErrorDevices(e){const t=this._notifiedErrorDevices,n=[];for(const o of e){const{userId:e,deviceInfo:r}=o;e in t?r.deviceId in t[e]||(n.push(o),t[e][r.deviceId]=!0):(n.push(o),t[e]={[r.deviceId]:!0})}return n}getEndToEndInboundGroupSession(e,t,n,o){const r=e+"/"+t;o(this._inboundGroupSessions[r]||null,this._inboundGroupSessionsWithheld[r]||null)}getAllEndToEndInboundGroupSessions(e,t){for(const e of Object.keys(this._inboundGroupSessions))t({senderKey:e.substr(0,43),sessionId:e.substr(44),sessionData:this._inboundGroupSessions[e]});t(null)}addEndToEndInboundGroupSession(e,t,n,o){const r=e+"/"+t;void 0===this._inboundGroupSessions[r]&&(this._inboundGroupSessions[r]=n)}storeEndToEndInboundGroupSession(e,t,n,o){this._inboundGroupSessions[e+"/"+t]=n}storeEndToEndInboundGroupSessionWithheld(e,t,n,o){const r=e+"/"+t;this._inboundGroupSessionsWithheld[r]=n}getEndToEndDeviceData(e,t){t(this._deviceData)}storeEndToEndDeviceData(e,t){this._deviceData=e}storeEndToEndRoom(e,t,n){this._rooms[e]=t}getEndToEndRooms(e,t){t(this._rooms)}getSessionsNeedingBackup(e){const t=[];for(const n in this._sessionsNeedingBackup)if(this._inboundGroupSessions[n]&&(t.push({senderKey:n.substr(0,43),sessionId:n.substr(44),sessionData:this._inboundGroupSessions[n]}),e&&n.length>=e))break;return Promise.resolve(t)}countSessionsNeedingBackup(){return Promise.resolve(Object.keys(this._sessionsNeedingBackup).length)}unmarkSessionsNeedingBackup(e){for(const t of e){const e=t.senderKey+"/"+t.sessionId;delete this._sessionsNeedingBackup[e]}return Promise.resolve()}markSessionsNeedingBackup(e){for(const t of e){const e=t.senderKey+"/"+t.sessionId;this._sessionsNeedingBackup[e]=!0}return Promise.resolve()}doTxn(e,t,n){return Promise.resolve(n(null))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"h",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return a})),n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return d}));var o=n(75);function r(e,t){return function(n){return function(e,t,n){const r=Object.assign({},{code:e,reason:t},n);return new o.b({type:"m.key.verification.cancel",content:r})}(e,t,n)}}const i=r("m.user","Cancelled by user"),s=r("m.timeout","Timed out"),a=(r("m.unknown_transaction","Unknown transaction"),r("m.unknown_method","Unknown method")),c=r("m.unexpected_message","Unexpected message"),l=r("m.key_mismatch","Key mismatch"),u=(r("m.user_error","User mismatch"),r("m.invalid_message","Invalid message"));function d(e){const t=e.getContent();if(t){const{code:e,reason:n}=t;return{code:e,reason:n}}return{code:"Unknown error",reason:"m.unknown"}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t,n){var o=n(362),r=n(266);e.exports=Object.keys||function(e){return o(e,r)}},function(e,t,n){var o=n(85).Symbol;e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCorners=t.offset=t.isEqual=t.addPosition=t.add=void 0;var o,r=n(118),i=(o=r)&&o.__esModule?o:{default:o};t.add=function(e,t){return{top:e.top+t.top,left:e.left+t.left,right:e.right+t.right,bottom:e.bottom+t.bottom}},t.addPosition=function(e,t){return(0,i.default)({},e,{right:e.right+t.x,bottom:e.bottom+t.y})},t.isEqual=function(e,t){return e.top===t.top&&e.right===t.right&&e.bottom===t.bottom&&e.left===t.left},t.offset=function(e,t){return{top:e.top+t.y,right:e.right+t.x,bottom:e.bottom+t.y,left:e.left+t.x}},t.getCorners=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(65);t.default=function(e){var t=e.source,n=e.sourceEdge,r=e.destination,i=e.destinationEdge,s=e.destinationAxis,a=function(e){return(0,o.patch)(s.line,e[s[i]],e[s.crossAxisStart])},c=a(r),l=(0,o.absolute)((0,o.subtract)(t.center,a(t))),u=(0,o.patch)(s.line,("end"===n?-1:1)*l[s.line],l[s.crossLine]);return(0,o.add)(c,u)}},function(e,t,n){"use strict";(function(e){var o=n(148),r=n(38),i=n(60),s=n(59),a=n(86),c=n(37),l=n(40);const u={orderedTags:null,orderedTagsAccountData:null,hasSynced:!1,joinedGroupIds:null,selectedTags:[],anchorTag:null};class d extends o.Store{constructor(){super(r.a),this._state=Object.assign({},u),l.b.monitorSetting("TagPanel.enableTagPanel",null)}_setState(e){this._state=Object.assign(this._state,e),this.__emitChange()}__onDispatch(e){switch(e.action){case"view_room":{const t=i.a.getGroupIdsForRoomId(e.room_id);this._updateBadges(t);break}case"MatrixActions.sync":{if("SYNCING"!==e.state&&"PREPARED"!==e.state||this._updateBadges(),"PREPARED"===e.prevState||"PREPARED"!==e.state)break;const t=e.matrixClient.getAccountData("im.vector.web.tag_ordering"),n=t?t.getContent():{};this._setState({orderedTagsAccountData:n.tags||null,removedTagsAccountData:n.removedTags||null,hasSynced:!0}),this._updateOrderedTags();break}case"MatrixActions.accountData":if("im.vector.web.tag_ordering"!==e.event_type)break;if(e.event_content._storeId===this.getStoreId())break;this._setState({orderedTagsAccountData:e.event_content?e.event_content.tags:null,removedTagsAccountData:e.event_content?e.event_content.removedTags:null}),this._updateOrderedTags();break;case"GroupActions.fetchJoinedGroups.success":this._setState({joinedGroupIds:e.result.groups.sort(),hasFetchedJoinedGroups:!0}),this._updateOrderedTags();break;case"TagOrderActions.moveTag.pending":this._setState({orderedTags:e.request.tags,removedTagsAccountData:e.request.removedTags});break;case"TagOrderActions.removeTag.pending":this._setState({removedTagsAccountData:e.request.removedTags}),this._updateOrderedTags();break;case"select_tag":{let t=[];if(e.shiftKey){let n=this._state.orderedTags.indexOf(this._state.anchorTag),o=this._state.orderedTags.indexOf(e.tag);if(-1===n&&(n=o),n>o){const e=n;n=o,o=e}t=e.ctrlOrCmdKey?this._state.selectedTags:[],t=[...new Set(this._state.orderedTags.slice(n,o+1).concat(t))]}else t=e.ctrlOrCmdKey?this._state.selectedTags.includes(e.tag)?this._state.selectedTags.filter(t=>t!==e.tag):[...this._state.selectedTags,e.tag]:1===this._state.selectedTags.length&&this._state.selectedTags.includes(e.tag)?[]:[e.tag],this._state.selectedTags.includes(e.tag)||this._setState({anchorTag:e.tag});this._setState({selectedTags:t}),s.a.trackEvent("FilterStore","select_tag")}break;case"deselect_tags":e.tag?this._setState({selectedTags:this._state.selectedTags.filter(t=>t!==e.tag)}):this._setState({selectedTags:[]}),s.a.trackEvent("FilterStore","deselect_tags");break;case"on_client_not_viable":case"on_logged_out":this._state=Object.assign({},u);break;case"setting_updated":"TagPanel.enableTagPanel"!==e.settingName||e.newValue||(this._setState({selectedTags:[]}),s.a.trackEvent("FilterStore","disable_tags"))}}_updateBadges(e=this._state.joinedGroupIds){if(e&&e.length){const t=c.a.get(),n={};e.forEach(e=>{const o=i.a.getGroupRooms(e).map(e=>t.getRoom(e.roomId)).filter(e=>null!=e),r=o&&a.g(o);n[e]=r&&0!==r.count?r:void 0});const o=Object.assign({},this._state.badges,n);this._setState({badges:o})}}_updateOrderedTags(){this._setState({orderedTags:this._state.hasSynced&&this._state.hasFetchedJoinedGroups?this._mergeGroupsAndTags():null})}_mergeGroupsAndTags(){const e=this._state.joinedGroupIds||[],t=this._state.orderedTagsAccountData||[],n=new Set(this._state.removedTagsAccountData||[]),o=t.filter(t=>("+"!==t[0]||e.includes(t))&&!n.has(t)),r=e.filter(e=>!t.includes(e)&&!n.has(e));return o.concat(r)}getGroupBadge(e){const t=this._state.badges;return t&&t[e]}getOrderedTags(){return this._state.orderedTags}getRemovedTagsAccountData(){return this._state.removedTagsAccountData}getStoreId(){return this._id||(this._id=Math.random().toString(16).slice(2,10)),this._id}getSelectedTags(){return this._state.selectedTags}}void 0===e.singletonTagOrderStore&&(e.singletonTagOrderStore=new d),t.a=e.singletonTagOrderStore}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return l}));var o=n(35),r=n.n(o),i=n(34);const s=r.a.shape({userId:r.a.string.isRequired,displayname:r.a.string,avatarUrl:r.a.string}),a=r.a.shape({displayname:r.a.string,name:r.a.string,roomId:r.a.string.isRequired,canonicalAlias:r.a.string,avatarUrl:r.a.string});function c(e){return{userId:e.user_id,displayname:e.displayname,avatarUrl:e.avatar_url,isPrivileged:e.is_privileged}}function l(e){return{displayname:e.name||e.canonical_alias||Object(i.a)("Unnamed Room"),name:e.name,roomId:e.room_id,canonicalAlias:e.canonical_alias,avatarUrl:e.avatar_url,topic:e.topic,numJoinedMembers:e.num_joined_members,worldReadable:e.world_readable,guestCanJoin:e.guest_can_join,isPublic:!1!==e.is_public}}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(40);function r(e){const t=t=>o.b.getValue(t,e.getRoomId());if(e.isRedacted()&&!t("showRedactions"))return!0;if(e.isRelation("m.replace"))return!0;const n=function(e){const t={isMemberEvent:"m.room.member"===e.getType()};if(!t.isMemberEvent)return t;const n=e.getContent(),o=e.getPrevContent(),r=n.membership!==o.membership;t.isJoin=r&&"join"===n.membership,t.isPart=r&&"leave"===n.membership&&e.getStateKey()===e.getSender();const i=!r&&"join"===n.membership;return t.isDisplaynameChange=i&&n.displayname!==o.displayname,t.isAvatarChange=i&&n.avatar_url!==o.avatar_url,t}(e);if(n.isMemberEvent){if((n.isJoin||n.isPart)&&!t("showJoinLeaves"))return!0;if(n.isAvatarChange&&!t("showAvatarChanges"))return!0;if(n.isDisplaynameChange&&!t("showDisplaynameChanges"))return!0}return!1}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var o=n(3),r=n.n(o),i=n(33),s=n.n(i),a=n(36),c=n(34),l=n(35),u=n.n(l),d=n(38),h=n(71),p=n(44),m=n(56),g=n(40),_=n(715),f=n.n(_),v=n(47);class b extends s.a.Component{constructor(e){super(e),r()(this,"onRoomRedaction",(e,t)=>{this.unmounted||this.state.events.some(t=>t.getId()===e.getId())&&this.forceUpdate()}),this.state={events:[],loadedEv:null,loading:!0,err:!1},this.onQuoteClick=this.onQuoteClick.bind(this),this.canCollapse=this.canCollapse.bind(this),this.collapse=this.collapse.bind(this)}static getParentEventId(e){if(!e||e.isRedacted())return;const t=e.getWireContent()["m.relates_to"];if(t&&t["m.in_reply_to"]){const e=t["m.in_reply_to"];if(e&&e.event_id)return e.event_id}}static stripPlainReply(e){const t=e.split("\n");for(;t.length&&t[0].startsWith("> ");)t.shift();return""===t[0]&&t.shift(),t.join("\n")}static stripHTMLReply(e){return e.replace(/^[\s\S]+?<\/mx-reply>/,"")}static getNestedReplyText(e,t){if(!e)return null;let{body:n,formatted_body:o}=e.getContent();this.getParentEventId(e)&&(n&&(n=this.stripPlainReply(n)),o&&(o=this.stripHTMLReply(o))),n||(n=""),o||(o=f()(n).replace(/\n/g,"
"));const r=t.forEvent(e.getId()),i=Object(m.g)(e.getSender()),s=e.getSender();switch(e.getContent().msgtype){case"m.text":case"m.notice":{o=`
In reply to ${s}
${o}
`;const e=n.trim().split("\n");e.length>0&&(e[0]=`<${s}> ${e[0]}`,n=e.map(e=>"> "+e).join("\n")+"\n\n");break}case"m.image":o=`
In reply to ${s}
sent an image.
`,n=`> <${s}> sent an image.\n\n`;break;case"m.video":o=`
In reply to ${s}
sent a video.
`,n=`> <${s}> sent a video.\n\n`;break;case"m.audio":o=`
In reply to ${s}
sent an audio file.
`,n=`> <${s}> sent an audio file.\n\n`;break;case"m.file":o=`
In reply to ${s}
sent a file.
`,n=`> <${s}> sent a file.\n\n`;break;case"m.emote":{o=`
In reply to * ${s}
${o}
`;const e=n.trim().split("\n");e.length>0&&(e[0]=`* <${s}> ${e[0]}`,n=e.map(e=>"> "+e).join("\n")+"\n\n");break}default:return null}return{body:n,html:o}}static makeReplyMixIn(e){return e?{"m.relates_to":{"m.in_reply_to":{event_id:e.getId()}}}:{}}static makeThread(e,t,n,o,r){return b.getParentEventId(e)?s.a.createElement(b,{parentEv:e,onHeightChanged:t,ref:o,permalinkCreator:n,useIRCLayout:r}):s.a.createElement("div",{className:"mx_ReplyThread_wrapper_empty"})}componentDidMount(){this.unmounted=!1,this.room=this.context.getRoom(this.props.parentEv.getRoomId()),this.room.on("Room.redaction",this.onRoomRedaction),this.room.on("Room.redactionCancelled",this.onRoomRedaction),this.initialize()}componentDidUpdate(){this.props.onHeightChanged()}componentWillUnmount(){this.unmounted=!0,this.room&&(this.room.removeListener("Room.redaction",this.onRoomRedaction),this.room.removeListener("Room.redactionCancelled",this.onRoomRedaction))}async initialize(){const{parentEv:e}=this.props,t=await this.getEvent(b.getParentEventId(e));this.unmounted||(t?this.setState({events:[t]},this.loadNextEvent):this.setState({err:!0}))}async loadNextEvent(){if(this.unmounted)return;const e=this.state.events[0],t=b.getParentEventId(e);if(!t)return void this.setState({loading:!1});const n=await this.getEvent(t);this.unmounted||(n?this.setState({loadedEv:n}):this.setState({err:!0}))}async getEvent(e){const t=this.room.findEventById(e);if(t)return t;try{await this.context.getEventTimeline(this.room.getUnfilteredTimelineSet(),e)}catch(e){return null}return this.room.findEventById(e)}canCollapse(){return this.state.events.length>1}collapse(){this.initialize()}onQuoteClick(){const e=[this.state.loadedEv,...this.state.events];this.setState({loadedEv:null,events:e},this.loadNextEvent),d.a.dispatch({action:"focus_composer"})}render(){let e=null;if(this.state.err)e=s.a.createElement("blockquote",{className:"mx_ReplyThread mx_ReplyThread_error"},Object(c.a)("Unable to load event that was replied to, it either does not exist or you do not have permission to view it."));else if(this.state.loadedEv){const t=this.state.loadedEv,n=a.getComponent("elements.Pill"),o=this.context.getRoom(t.getRoomId());e=s.a.createElement("blockquote",{className:"mx_ReplyThread"},Object(c.a)("In reply to ",{},{a:e=>s.a.createElement("a",{onClick:this.onQuoteClick,className:"mx_ReplyThread_show"},e),pill:s.a.createElement(n,{type:n.TYPE_USER_MENTION,room:o,url:Object(m.g)(t.getSender()),shouldShowPillAvatar:!0})}))}else if(this.state.loading){const t=a.getComponent("elements.Spinner");e=s.a.createElement(t,{w:16,h:16})}const t=a.getComponent("views.rooms.EventTile"),n=a.getComponent("messages.DateSeparator"),o=this.state.events.map(e=>{let o=null;return Object(h.e)(this.props.parentEv.getDate(),e.getDate())&&(o=s.a.createElement("a",{href:this.props.url},s.a.createElement(n,{ts:e.getTs()}))),s.a.createElement("blockquote",{className:"mx_ReplyThread",key:e.getId()},o,s.a.createElement(t,{mxEvent:e,tileShape:"reply",onHeightChanged:this.props.onHeightChanged,permalinkCreator:this.props.permalinkCreator,isRedacted:e.isRedacted(),isTwelveHour:g.b.getValue("showTwelveHourTimestamps"),useIRCLayout:this.props.useIRCLayout}))});return s.a.createElement("div",{className:"mx_ReplyThread_wrapper"},s.a.createElement("div",null,e),s.a.createElement("div",null,o))}}r()(b,"propTypes",{parentEv:u.a.instanceOf(p.j),onHeightChanged:u.a.func.isRequired,permalinkCreator:u.a.instanceOf(m.a).isRequired,useIRCLayout:u.a.bool}),r()(b,"contextType",v.a)},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return d}));var o=n(42),r=n.n(o),i=n(37),s=n(36),a=n(41);class c extends Error{}class l{constructor(e,t,n){this.serviceType=e,this.baseUrl=t,this.accessToken=n}}async function u(e,t=d){const n=e.map(e=>i.a.get().getTerms(e.serviceType,e.baseUrl)),o=(await Promise.all(n)).map((t,n)=>({service:e[n],policies:t.policies})),r=await i.a.get().getAccountData("m.accepted_terms");let s;s=r&&r.getContent()&&r.getContent().accepted?new Set(r.getContent().accepted):new Set;const a=[];for(const{service:e,policies:t}of o){const n={};for(const[e,o]of Object.entries(t)){let t=!1;for(const e of Object.keys(o))if("version"!==e&&s.has(o[e].url)){t=!0;break}t||(n[e]=o)}Object.keys(n).length>0&&a.push({service:e,policies:n})}const c=s.size;if(a.length>0){const e=await t(a,[...s]);console.log("User has agreed to URLs",e),e.forEach(e=>s.add(e))}else console.log("User has already agreed to all required policies");if(s.size!==c){const e={accepted:Array.from(s)};await i.a.get().setAccountData("m.accepted_terms",e)}const l=o.map(e=>{const t=Array.from(s).filter(t=>{for(const n of Object.values(e.policies))for(const e of Object.keys(n))if("version"!==e&&n[e].url===t)return!0;return!1});return 0===t.length?Promise.resolve():i.a.get().agreeToTerms(e.service.serviceType,e.service.baseUrl,e.service.accessToken,t)});return Promise.all(l)}function d(e,t,n){return new Promise((o,i)=>{console.log("Terms that need agreement",e);const l=s.getComponent("views.dialogs.TermsDialog");a.a.createTrackedDialog("Terms of Service","",l,{policiesAndServicePairs:e,agreedUrls:t,onFinished:(e,t)=>{e?o(t):i(new c)}},r()("mx_TermsDialog",n))})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(37),r=n(153),i=n(60),s=n(34),a=n(36),c=n(41),l=n(40),u=n(76);class d{constructor(e){"+"===e[0]?(this.roomId=null,this.groupId=e):(this.roomId=e,this.groupId=null),this.canceled=!1,this.addrs=[],this.busy=!1,this.completionStates={},this.errors={},this.deferred=null}invite(e){if(this.addrs.length>0)throw new Error("Already inviting/invited");this.addrs.push(...e);for(const e of this.addrs)null===Object(r.c)(e)&&(this.completionStates[e]="error",this.errors[e]={errcode:"M_INVALID",errorText:Object(s.a)("Unrecognised address")});return this.deferred=Object(u.b)(),this._inviteMore(0),this.deferred.promise}cancel(){this.busy&&(this._canceled=!0,this.deferred.reject(new Error("canceled")))}getCompletionState(e){return this.completionStates[e]}getErrorText(e){return this.errors[e]?this.errors[e].errorText:null}async _inviteToRoom(e,t,n){const i=Object(r.c)(t);if("email"===i)return o.a.get().inviteByEmail(e,t);if("mx-user-id"===i){const r=o.a.get().getRoom(e);if(!r)throw new Error("Room not found");const i=r.getMember(t);if(i&&["join","invite"].includes(i.membership))throw{errcode:"RIOT.ALREADY_IN_ROOM",error:"Member already invited"};if(!n&&l.b.getValue("promptBeforeInviteUnknownUsers",this.roomId))try{if(!await o.a.get().getProfileInfo(t))throw new Error("User has no profile")}catch(e){throw{errcode:"RIOT.USER_NOT_FOUND",error:"User does not have a profile or does not exist."}}return o.a.get().invite(e,t)}throw new Error("Unsupported address")}_doInvite(e,t){return new Promise((n,o)=>{let r;console.log("Inviting "+e),r=null!==this.groupId?i.a.inviteUserToGroup(this.groupId,e):this._inviteToRoom(this.roomId,e,t),r.then(()=>{this._canceled||(this.completionStates[e]="invited",delete this.errors[e],n())}).catch(r=>{if(this._canceled)return;let i;console.error(r);let a=!1;if("M_FORBIDDEN"===r.errcode)a=!0,i=Object(s.a)("You do not have permission to invite people to this room.");else if("RIOT.ALREADY_IN_ROOM"===r.errcode)i=Object(s.a)("User %(userId)s is already in the room",{userId:e});else{if("M_LIMIT_EXCEEDED"===r.errcode)return void setTimeout(()=>{this._doInvite(e,t).then(n,o)},5e3);["M_NOT_FOUND","M_USER_NOT_FOUND","RIOT.USER_NOT_FOUND"].includes(r.errcode)?i=Object(s.a)("User %(user_id)s does not exist",{user_id:e}):"M_PROFILE_UNDISCLOSED"===r.errcode?i=Object(s.a)("User %(user_id)s may or may not exist",{user_id:e}):"M_PROFILE_NOT_FOUND"!==r.errcode||t?i="M_BAD_STATE"===r.errcode?Object(s.a)("The user must be unbanned before they can be invited."):"M_UNSUPPORTED_ROOM_VERSION"===r.errcode?Object(s.a)("The user's homeserver does not support the version of the room."):Object(s.a)("Unknown server error"):(console.warn(`User ${e} does not have a profile - inviting anyways automatically`),this._doInvite(e,!0).then(n,o))}this.completionStates[e]="error",this.errors[e]={errorText:i,errcode:r.errcode},this.busy=!a,this.fatal=a,a?o():n()})})}_inviteMore(e,t){if(this._canceled)return;if(e===this.addrs.length){if(this.busy=!1,Object.keys(this.errors).length>0&&!this.groupId){const e=["M_NOT_FOUND","M_USER_NOT_FOUND","M_PROFILE_UNDISCLOSED","M_PROFILE_NOT_FOUND","RIOT.USER_NOT_FOUND"],t=Object.keys(this.errors).filter(t=>e.includes(this.errors[t].errcode));if(t.length>0){const e=()=>{const e=t.map(e=>this._doInvite(e,!0));Promise.all(e).then(()=>this.deferred.resolve(this.completionStates))};if(!l.b.getValue("promptBeforeInviteUnknownUsers",this.roomId))return void e();const n=a.getComponent("dialogs.AskInviteAnywayDialog");return console.log("Showing failed to invite dialog..."),void c.a.createTrackedDialog("Failed to invite the following users to the room","",n,{unknownProfileUsers:t.map(e=>({userId:e,errorText:this.errors[e].errorText})),onInviteAnyways:()=>e(),onGiveUp:()=>{for(const e of t)this.completionStates[e]="invited";this.deferred.resolve(this.completionStates)}})}}return void this.deferred.resolve(this.completionStates)}const n=this.addrs[e];null!==Object(r.c)(n)&&"invited"!==this.completionStates[n]?this._doInvite(n,t).then(()=>{this._inviteMore(e+1,t)}).catch(()=>this.deferred.resolve(this.completionStates)):this._inviteMore(e+1)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const o=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i;function r(e){return o.test(e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var o=n(44),r=n(45),i=n(37);function s(){return r.a.get().validated_server_config.isUrl}function a(){const e=s();i.a.get().setAccountData("m.identity_server",{base_url:e})}async function c(e){let t;try{t=await i.a.get().getTerms(o.m.IS,e)}catch(e){if(console.error(e),"rejected"!==e.cors&&404!==e.httpStatus)throw e;t=null}return t&&t.policies&&Object.keys(t.policies).length>0}function l(){const e=i.a.get().getAccountData("m.identity_server");return e&&e.getContent()&&e.getContent().base_url}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(40),r=n(487),i=n(288),s=n(408);class a{static isUsingNewStore(){return o.b.isFeatureEnabled("feature_new_room_list")}static addListener(e){return a.isUsingNewStore()?r.b.instance.on(s.b,e):i.b.addListener(e)}static getRoomLists(){return a.isUsingNewStore()?r.b.instance.orderedLists:i.b.getRoomLists()}}},function(e,t,n){"use strict";function o(e){return e/15+"rem"}function r(e){return e+"px"}n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.r(t),function(e){var o=n(37),r=n(51),i=n(223),s=n(59),a=n(190),c=n(38),l=n(36),u=n(34),d=n(41),h=n(40),p=n(414);const m={"m.key.verification.request":e=>{const t=(e.sender||{}).name;return Object(u.a)("%(name)s is requesting verification",{name:t})}},g={notifsByRoom:{},pendingEncryptedEventIds:[],notificationMessageForEvent:function(e){return m.hasOwnProperty(e.getContent().msgtype)?m[e.getContent().msgtype](e):i.a(e)},_displayPopupNotification:function(t,n){const o=r.a.get();if(!o)return;if(!o.supportsNotifications()||!o.maySendNotifications())return;if(e.document.hasFocus())return;let i,s=this.notificationMessageForEvent(t);if(!s)return;t.sender&&n.name!==t.sender.name?"m.room.member"===t.getType()?i=n.name:t.sender&&(i=t.sender.name+" ("+n.name+")",t.getContent().body&&!m.hasOwnProperty(t.getContent().msgtype)&&(s=t.getContent().body)):(i=n.name,t.getContent().body&&!m.hasOwnProperty(t.getContent().msgtype)&&(s=t.getContent().body)),this.isBodyEnabled()||(s="");let c=null;t.sender&&!h.b.getValue("lowBandwidth")&&(c=a.a(t.sender,40,40,"crop"));const l=o.displayNotification(i,s,c,n);l&&(void 0===this.notifsByRoom[t.getRoomId()]&&(this.notifsByRoom[t.getRoomId()]=[]),this.notifsByRoom[t.getRoomId()].push(l))},getSoundForRoom:async function(e){const t=h.b.getValue("notificationSound",e);return t?t.url?t.url.startsWith("mxc://")?{url:o.a.get().mxcUrlToHttp(t.url),name:t.name,type:t.type,size:t.size}:(console.warn(e+" has custom notification sound event, but url is not a mxc url"),null):(console.warn(e+" has custom notification sound event, but no url key"),null):null},_playAudioNotification:async function(e,t){const n=await this.getSoundForRoom(t.roomId);console.log(`Got sound ${n&&n.name||"default"} for ${t.roomId}`);try{const e=document.querySelector(n?`audio[src='${n.url}']`:"#messageAudio");let t=e;if(!e){if(!n)return void console.error("No audio element or sound to play for notification");t=new Audio(n.url),n.type&&(t.type=n.type),document.body.appendChild(t)}await t.play()}catch(e){console.warn("Caught error when trying to fetch room notification sound:",e)}},start:function(){this.boundOnEvent=this.boundOnEvent||this.onEvent.bind(this),this.boundOnSyncStateChange=this.boundOnSyncStateChange||this.onSyncStateChange.bind(this),this.boundOnRoomReceipt=this.boundOnRoomReceipt||this.onRoomReceipt.bind(this),this.boundOnEventDecrypted=this.boundOnEventDecrypted||this.onEventDecrypted.bind(this),o.a.get().on("event",this.boundOnEvent),o.a.get().on("Room.receipt",this.boundOnRoomReceipt),o.a.get().on("Event.decrypted",this.boundOnEventDecrypted),o.a.get().on("sync",this.boundOnSyncStateChange),this.toolbarHidden=!1,this.isSyncing=!1},stop:function(){o.a.get()&&(o.a.get().removeListener("Event",this.boundOnEvent),o.a.get().removeListener("Room.receipt",this.boundOnRoomReceipt),o.a.get().removeListener("Event.decrypted",this.boundOnEventDecrypted),o.a.get().removeListener("sync",this.boundOnSyncStateChange)),this.isSyncing=!1},supportsDesktopNotifications:function(){const e=r.a.get();return e&&e.supportsNotifications()},setEnabled:function(e,t){const n=r.a.get();n&&(s.a.trackEvent("Notifier","Set Enabled",e),h.b.isLevelSupported(h.a.DEVICE)&&h.b.setValue("audioNotificationsEnabled",null,h.a.DEVICE,this.isEnabled()),e?n.requestNotificationPermission().then(e=>{if("granted"===e)t&&t(),c.a.dispatch({action:"notifier_enabled",value:!0});else{const t="denied"===e?Object(u.a)("Riot does not have permission to send you notifications - please check your browser settings"):Object(u.a)("Riot was not given permission to send notifications - please try again"),n=l.getComponent("dialogs.ErrorDialog");d.a.createTrackedDialog("Unable to enable Notifications",e,n,{title:Object(u.a)("Unable to enable Notifications"),description:t})}}):c.a.dispatch({action:"notifier_enabled",value:!1}),this.setToolbarHidden(!0))},isEnabled:function(){return this.isPossible()&&h.b.getValue("notificationsEnabled")},isPossible:function(){const e=r.a.get();return!!e&&(!!e.supportsNotifications()&&!!e.maySendNotifications())},isBodyEnabled:function(){return this.isEnabled()&&h.b.getValue("notificationBodyEnabled")},isAudioEnabled:function(){return this.isEnabled()&&h.b.getValue("audioNotificationsEnabled")},setToolbarHidden:function(t,n=!0){this.toolbarHidden=t,s.a.trackEvent("Notifier","Set Toolbar Hidden",t),Object(p.a)(),n&&e.localStorage&&e.localStorage.setItem("notifications_hidden",t)},shouldShowToolbar:function(){const e=o.a.get();if(!e)return!1;return!e.isGuest()&&this.supportsDesktopNotifications()&&!this.isEnabled()&&!this._isToolbarHidden()},_isToolbarHidden:function(){return e.localStorage?"true"===e.localStorage.getItem("notifications_hidden"):this.toolbarHidden},onSyncStateChange:function(e){"SYNCING"===e?this.isSyncing=!0:"STOPPED"!==e&&"ERROR"!==e||(this.isSyncing=!1)},onEvent:function(e){if(this.isSyncing&&(!e.sender||e.sender.userId!==o.a.get().credentials.userId))if(e.isBeingDecrypted()||e.isDecryptionFailure())for(this.pendingEncryptedEventIds.push(e.getId());this.pendingEncryptedEventIds.length>20;)this.pendingEncryptedEventIds.shift();else this._evaluateEvent(e)},onEventDecrypted:function(e){if(e.isDecryptionFailure())return;const t=this.pendingEncryptedEventIds.indexOf(e.getId());-1!==t&&(this.pendingEncryptedEventIds.splice(t,1),this._evaluateEvent(e))},onRoomReceipt:function(e,t){if(0===t.getUnreadNotificationCount()){const e=r.a.get();if(!e)return;if(void 0===this.notifsByRoom[t.roomId])return;for(const n of this.notifsByRoom[t.roomId])e.clearNotification(n);delete this.notifsByRoom[t.roomId]}},_evaluateEvent:function(e){const t=o.a.get().getRoom(e.getRoomId()),n=o.a.get().getPushActionsForEvent(e);n&&n.notify&&(this.isEnabled()&&this._displayPopupNotification(e,t),n.tweaks.sound&&this.isAudioEnabled()&&(r.a.get().loudNotification(e,t),this._playAudioNotification(e,t)))}};e.mxNotifier||(e.mxNotifier=g),t.default=e.mxNotifier}.call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"b",(function(){return d}));var o=n(37),r=n(61),i=n(74);function s(e,t,n,r){let i;return e&&e.getAvatarUrl&&(i=e.getAvatarUrl(o.a.get().getHomeserverUrl(),Math.floor(t*window.devicePixelRatio),Math.floor(n*window.devicePixelRatio),r,!1,!1)),i||(i=l(e?e.userId:"")),i}function a(e,t,n,r){const s=Object(i.a)(o.a.get().getHomeserverUrl(),e.avatarUrl,Math.floor(t*window.devicePixelRatio),Math.floor(n*window.devicePixelRatio),r);return s&&0!==s.length?s:null}const c=new Map;function l(e){const t=["#03b381","#368bd6","#ac3ba8"];let n=0;for(let t=0;tisNaN(parseInt(e,16)))}(i)?s="":(s=function(e){const t=document.createElement("canvas");t.width=40,t.height=40;const n=t.getContext("2d");return n?(n.fillStyle=e,n.fillRect(0,0,40,40),t.toDataURL()):""}(i),c.set(i,s))),s}function u(e){if(!e)return void console.trace("`name` argument to `getInitialLetter` not supplied");if(e.length<1)return;let t=0;const n=e[0];"@"!==n&&"#"!==n&&"+"!==n||!e[1]||t++;let o=1;const r=e.charCodeAt(t);if(r>=55296&&r<=56319&&e[t+1]){const n=e.charCodeAt(t+1);n>=56320&&n<=57343&&o++}return e.substring(t,t+o).toUpperCase()}function d(e,t,n,i){if(!e)return null;const s=e.getAvatarUrl(o.a.get().getHomeserverUrl(),t,n,i,!1);if(s)return s;let a=null;const c=r.a.shared().getUserIdForRoomId(e.roomId);return a=c?e.getMember(c):e.getAvatarFallbackMember(),a?a.getAvatarUrl(o.a.get().getHomeserverUrl(),t,n,i,!1):null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignRef=function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{getValueOverride(e,t,n,o){return null}onChange(e,t,n){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(46),r=n.n(o),i=n(55),s=n.n(i),a=n(3),c=n.n(a),l=n(33),u=n.n(l),d=n(9);const h=n(790);class p extends u.a.PureComponent{constructor(e){super(e),c()(this,"id",void 0),this.id="checkbox_"+Object(d.a)(10)}render(){const e=this.props,{children:t,className:n}=e,o=s()(e,["children","className"]);return u.a.createElement("span",{className:"mx_Checkbox "+n},u.a.createElement("input",r()({id:this.id},o,{type:"checkbox"})),u.a.createElement("label",{htmlFor:this.id},u.a.createElement("div",{className:"mx_Checkbox_background"},u.a.createElement("img",{src:h})),u.a.createElement("div",null,this.props.children)))}}c()(p,"defaultProps",{className:""})},function(e,t,n){var o=n(143),r=n(144);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==o(e)}},function(e,t,n){var o=n(319),r=n(855),i=n(859),s=n(860),a=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),r(e,o(t,1),[])}));e.exports=a},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return a})),n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var o=n(870);const r=new Map,i=new Map,s=new Map,a=e=>r.get(u(e)),c=["people","people","control","nature","foods","places","activity","objects","symbols","flags"],l={people:[],nature:[],foods:[],places:[],activity:[],objects:[],symbols:[],flags:[]};function u(e){return e.replace(/[\uFE00-\uFE0F]$/,"")}o.forEach(e=>{const t=c[e.group];l.hasOwnProperty(t)&&l[t].push(e),e.filterString=`${e.annotation}\n${e.shortcodes.join("\n")}}\n${e.emoticon||""}`.toLowerCase(),r.set(u(e.unicode),e),e.emoticon&&i.set(e.emoticon,e),e.shortcodes&&e.shortcodes.forEach(t=>{s.set(t,e)})});const d=o},function(e,t,n){"use strict";(function(t){!function(t){var n=/^(b|B)$/,o={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},r={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[],s=0,a=void 0,c=void 0,l=void 0,u=void 0,d=void 0,h=void 0,p=void 0,m=void 0,g=void 0,_=void 0,f=void 0,v=void 0,b=void 0,E=void 0;if(isNaN(e))throw new Error("Invalid arguments");return l=!0===t.bits,f=!0===t.unix,c=t.base||2,_=void 0!==t.round?t.round:f?1:2,v=void 0!==t.spacer?t.spacer:f?"":" ",E=t.symbols||t.suffixes||{},b=2===c&&t.standard||"jedec",g=t.output||"string",d=!0===t.fullform,h=t.fullforms instanceof Array?t.fullforms:[],a=void 0!==t.exponent?t.exponent:-1,u=c>2?1e3:1024,(p=(m=Number(e))<0)&&(m=-m),(-1===a||isNaN(a))&&(a=Math.floor(Math.log(m)/Math.log(u)))<0&&(a=0),a>8&&(a=8),0===m?(i[0]=0,i[1]=f?"":o[b][l?"bits":"bytes"][a]):(s=m/(2===c?Math.pow(2,10*a):Math.pow(1e3,a)),l&&(s*=8)>=u&&a<8&&(s/=u,a++),i[0]=Number(s.toFixed(a>0?_:0)),i[1]=10===c&&1===a?l?"kb":"kB":o[b][l?"bits":"bytes"][a],f&&(i[1]="jedec"===b?i[1].charAt(0):a>0?i[1].replace(/B$/,""):i[1],n.test(i[1])&&(i[0]=Math.floor(i[0]),i[1]=""))),p&&(i[0]=-i[0]),i[1]=E[i[1]]||i[1],"array"===g?i:"exponent"===g?a:"object"===g?{value:i[0],suffix:i[1],symbol:i[1]}:(d&&(i[1]=h[a]?h[a]:r[b][a]+(l?"bit":"byte")+(1===i[0]?"":"s")),i.join(v))}i.partial=function(e){return function(t){return i(t,e)}},e.exports=i}("undefined"!=typeof window&&window)}).call(this,n(17))},,,,function(e,t,n){"use strict";n.d(t,"i",(function(){return K})),n.d(t,"d",(function(){return z})),n.d(t,"c",(function(){return Y})),n.d(t,"a",(function(){return W})),n.d(t,"e",(function(){return $})),n.d(t,"b",(function(){return Q})),n.d(t,"l",(function(){return X})),n.d(t,"f",(function(){return J})),n.d(t,"j",(function(){return oe})),n.d(t,"m",(function(){return re})),n.d(t,"h",(function(){return ie})),n.d(t,"g",(function(){return se})),n.d(t,"k",(function(){return ae})),n.d(t,"n",(function(){return le}));var o=n(44),r=n(37),i=n(158),s=n(415),a=n(59),c=n(189),l=n(416),u=n(38),d=n(122);const h=["online","offline","unavailable"];var p=new class{constructor(){this._activitySignal=null,this._unavailableTimer=null,this._onAction=this._onAction.bind(this),this._dispatcherRef=null}async start(){for(this._unavailableTimer=new d.a(18e4),this._dispatcherRef=u.a.register(this._onAction);this._unavailableTimer;)try{await this._unavailableTimer.finished(),this.setState("unavailable")}catch(e){}}stop(){this._dispatcherRef&&(u.a.unregister(this._dispatcherRef),this._dispatcherRef=null),this._unavailableTimer&&(this._unavailableTimer.abort(),this._unavailableTimer=null)}getState(){return this.state}_onAction(e){"user_activity"===e.action&&(this.setState("online"),this._unavailableTimer.restart())}async setState(e){if(e===this.state)return;if(-1===h.indexOf(e))throw new Error("Bad presence state: "+e);const t=this.state;if(this.state=e,!r.a.get().isGuest())try{await r.a.get().setPresence(this.state),console.info("Presence: %s",e)}catch(e){console.error("Failed to set presence: %s",e),this.state=t}}},m=n(61),g=n(41),_=n(36),f=n(150),v=n(51),b=n(229),E=n(303),y=n(40),S=n(417),C=n(73),w=n(72),T=n(304),k=n(3),x=n.n(k),O=n(34),R=n(81);var D=n(418),I=n(90);const A=e=>{switch(e){case M.SET_UP_ENCRYPTION:return Object(O.a)("Set up encryption");case M.UPGRADE_ENCRYPTION:return Object(O.a)("Encryption upgrade available");case M.VERIFY_THIS_SESSION:return Object(O.a)("Verify this session")}},F=e=>{switch(e){case M.SET_UP_ENCRYPTION:return Object(O.a)("Set up");case M.UPGRADE_ENCRYPTION:return Object(O.a)("Upgrade");case M.VERIFY_THIS_SESSION:return Object(O.a)("Verify")}},N=e=>{switch(e){case M.SET_UP_ENCRYPTION:case M.UPGRADE_ENCRYPTION:return Object(O.a)("Verify yourself & others to keep your chats safe");case M.VERIFY_THIS_SESSION:return Object(O.a)("Other users may not trust it")}};let M;!function(e){e.SET_UP_ENCRYPTION="set_up_encryption",e.UPGRADE_ENCRYPTION="upgrade_encryption",e.VERIFY_THIS_SESSION="verify_this_session"}(M||(M={}));const P=()=>{q.sharedInstance().dismissEncryptionSetup()},L=e=>{C.a.sharedInstance().addOrReplaceToast({key:"setupencryption",title:A(e),icon:"verification_warning",props:{description:N(e),acceptLabel:F(e),onAccept:async()=>{if(e===M.VERIFY_THIS_SESSION)g.a.createTrackedDialog("Verify session","Verify session",D.a,{},null,!1,!0);else{const e=_.getComponent("elements.Spinner"),t=g.a.createDialog(e,null,"mx_Dialog_spinner",!1,!0);try{await Object(I.b)()}finally{t.close()}}},rejectLabel:Object(O.a)("Later"),onReject:P},component:R.a,priority:e===M.VERIFY_THIS_SESSION?95:40})};var U=n(425);function B(e){return"unverified_session_"+e}const j=e=>{const t=r.a.get(),n=t.getStoredDevice(t.getUserId(),e);C.a.sharedInstance().addOrReplaceToast({key:B(e),title:Object(O.a)("New login. Was this you?"),icon:"verification_warning",props:{description:Object(O.a)("Verify the new login accessing your account: %(name)s",{name:n.getDisplayName()}),acceptLabel:Object(O.a)("Verify"),onAccept:()=>{g.a.createTrackedDialog("New Session Review","Starting dialog",U.a,{userId:t.getUserId(),device:t.getStoredDevice(t.getUserId(),e),onFinished:t=>{t||q.sharedInstance().dismissUnverifiedSessions([e])}},null,!1,!0)},rejectLabel:Object(O.a)("Later"),onReject:()=>{q.sharedInstance().dismissUnverifiedSessions([e])}},component:R.a,priority:80})},G=e=>{C.a.sharedInstance().dismissToast(B(e))};class q{constructor(){x()(this,"dismissed",new Set),x()(this,"dismissedThisDeviceToast",!1),x()(this,"keyBackupInfo",null),x()(this,"keyBackupFetchedAt",null),x()(this,"ourDeviceIdsAtStart",null),x()(this,"displayingToastsForDeviceIds",new Set),x()(this,"_onWillUpdateDevices",async(e,t)=>{if(t)return;const n=r.a.get().getUserId();e.includes(n)&&this._ensureDeviceIdsAtStartPopulated()}),x()(this,"_onDevicesUpdated",e=>{e.includes(r.a.get().getUserId())&&this._recheck()}),x()(this,"_onDeviceVerificationChanged",e=>{e===r.a.get().getUserId()&&this._recheck()}),x()(this,"_onUserTrustStatusChanged",e=>{e===r.a.get().getUserId()&&this._recheck()}),x()(this,"_onCrossSingingKeysChanged",()=>{this._recheck()}),x()(this,"_onAccountData",e=>{(e.getType().startsWith("m.secret_storage.")||e.getType().startsWith("m.cross_signing."))&&this._recheck()}),x()(this,"_onSync",(e,t)=>{"PREPARED"===e&&null===t&&this._recheck()})}static sharedInstance(){return window.mx_DeviceListener||(window.mx_DeviceListener=new q),window.mx_DeviceListener}start(){r.a.get().on("crypto.willUpdateDevices",this._onWillUpdateDevices),r.a.get().on("crypto.devicesUpdated",this._onDevicesUpdated),r.a.get().on("deviceVerificationChanged",this._onDeviceVerificationChanged),r.a.get().on("userTrustStatusChanged",this._onUserTrustStatusChanged),r.a.get().on("crossSigning.keysChanged",this._onCrossSingingKeysChanged),r.a.get().on("accountData",this._onAccountData),r.a.get().on("sync",this._onSync),this._recheck()}stop(){r.a.get()&&(r.a.get().removeListener("crypto.willUpdateDevices",this._onWillUpdateDevices),r.a.get().removeListener("crypto.devicesUpdated",this._onDevicesUpdated),r.a.get().removeListener("deviceVerificationChanged",this._onDeviceVerificationChanged),r.a.get().removeListener("userTrustStatusChanged",this._onUserTrustStatusChanged),r.a.get().removeListener("crossSigning.keysChanged",this._onCrossSingingKeysChanged),r.a.get().removeListener("accountData",this._onAccountData),r.a.get().removeListener("sync",this._onSync)),this.dismissed.clear(),this.dismissedThisDeviceToast=!1,this.keyBackupInfo=null,this.keyBackupFetchedAt=null,this.ourDeviceIdsAtStart=null,this.displayingToastsForDeviceIds=new Set}async dismissUnverifiedSessions(e){for(const t of e)this.dismissed.add(t);this._recheck()}dismissEncryptionSetup(){this.dismissedThisDeviceToast=!0,this._recheck()}_ensureDeviceIdsAtStartPopulated(){if(null===this.ourDeviceIdsAtStart){const e=r.a.get();this.ourDeviceIdsAtStart=new Set(e.getStoredDevicesForUser(e.getUserId()).map(e=>e.deviceId))}}async _getKeyBackupInfo(){const e=(new Date).getTime();return(!this.keyBackupInfo||this.keyBackupFetchedAt0?(i=n,C.a.sharedInstance().addOrReplaceToast({key:"reviewsessions",title:Object(O.a)("Review where you’re logged in"),icon:"verification_warning",props:{description:Object(O.a)("Verify all your sessions to ensure your account & messages are safe"),acceptLabel:Object(O.a)("Review"),onAccept:()=>{q.sharedInstance().dismissUnverifiedSessions(i),u.a.dispatch({action:"view_user_info",userId:r.a.get().getUserId()})},rejectLabel:Object(O.a)("Later"),onReject:()=>{q.sharedInstance().dismissUnverifiedSessions(i)}},component:R.a,priority:50})):C.a.sharedInstance().dismissToast("reviewsessions");for(const e of o)j(e);for(const e of this.displayingToastsForDeviceIds)o.has(e)||G(e);this.displayingToastsForDeviceIds=o}}var V=n(298),H=n(160);async function K(e){try{let t=e.enableGuest||!1;const n=e.guestHsUrl,r=e.guestIsUrl,i=e.fragmentQueryParams||{},s=e.defaultDeviceDisplayName;if(t&&!n&&(console.warn("Cannot enable guest access: can't determine HS URL to use"),t=!1),t&&i.guest_user_id&&i.guest_access_token)return console.log("Using guest access credentials"),Z({userId:i.guest_user_id,accessToken:i.guest_access_token,homeserverUrl:n,identityServerUrl:r,guest:!0},!0).then(()=>!0);return!!await async function(e){const t=e.ignoreGuest;if(!localStorage)return!1;const{hsUrl:n,isUrl:o,accessToken:r,userId:i,deviceId:s,isGuest:a}=Q();if(r&&i&&n){if(t&&a)return console.log("Ignoring stored guest account: "+i),!1;const e=await v.a.get().getPickleKey(i,s);return console.log("Restoring session for "+i),await Z({userId:i,deviceId:s,accessToken:r,homeserverUrl:n,identityServerUrl:o,guest:a,pickleKey:e},!1),!0}return console.log("No previous session found."),!1}({ignoreGuest:Boolean(e.ignoreGuest)})||!!t&&function(e,t,n){console.log("Doing guest login on "+e);return o.s.createClient({baseUrl:e}).registerGuest({body:{initial_device_display_name:n}}).then(n=>(console.log("Registered as guest: "+n.user_id),Z({userId:n.user_id,deviceId:n.device_id,accessToken:n.access_token,homeserverUrl:e,identityServerUrl:t,guest:!0},!0).then(()=>!0)),e=>(console.error("Failed to register as guest",e),!1))}(n,r,s)}catch(e){return!(e instanceof ee)&&async function(e){console.error("Unable to load session",e);const t=_.getComponent("views.dialogs.SessionRestoreErrorDialog"),n=g.a.createTrackedDialog("Session Restore Error","",t,{error:e.message}),[o]=await n.finished;if(o)return await ce(),!1;return K()}(e)}}function z(){const{hsUrl:e,userId:t,accessToken:n}=Q();return e&&t&&n?t:null}function Y(){const e=Q();return e.hsUrl&&e.userId&&e.accessToken?e.isGuest:null}function W(e,t){if(!e.loginToken)return Promise.resolve(!1);const n=localStorage.getItem(H.a),o=localStorage.getItem(H.b);return n?Object(b.b)(n,o,"m.login.token",{token:e.loginToken,initial_device_display_name:t}).then((function(e){return console.log("Logged in with token"),ce().then(()=>(te(e),!0))})).catch(e=>(console.error("Failed to log in with login token: "+e+" "+e.data),!1)):(console.warn("Cannot log in with token: can't determine HS URL to use"),Promise.resolve(!1))}function $(e){if(e.reason===o.s.InvalidStoreError.TOGGLED_LAZY_LOADING)return Promise.resolve().then(()=>{if(e.value){const e=_.getComponent("views.dialogs.LazyLoadingResyncDialog");return new Promise(t=>{g.a.createDialog(e,{onFinished:t})})}{const e=_.getComponent("views.dialogs.LazyLoadingDisabledDialog");return new Promise(t=>{g.a.createDialog(e,{onFinished:t,host:window.location.host})})}}).then(()=>r.a.get().store.deleteAllData()).then(()=>{v.a.get().reload()})}function Q(){const e=localStorage.getItem(H.a),t=localStorage.getItem(H.b),n=localStorage.getItem("mx_access_token"),o=localStorage.getItem("mx_user_id"),r=localStorage.getItem("mx_device_id");let i;return i=null!==localStorage.getItem("mx_is_guest")?"true"===localStorage.getItem("mx_is_guest"):"true"===localStorage.getItem("matrix-is-guest"),{hsUrl:e,isUrl:t,accessToken:n,userId:o,deviceId:r,isGuest:i}}async function X(e){le();const t=e.userId&&e.deviceId?await v.a.get().createPickleKey(e.userId,e.deviceId):null;return Z(Object.assign({},e,{pickleKey:t}),!0)}function J(e){const t=r.a.get().getUserId(),n=r.a.get().getDeviceId();le(),localStorage.removeItem("mx_soft_logout"),ne=!1;const o=e.userId!==t||e.deviceId!==n;return o&&console.warn("Clearing all data: Old session belongs to a different user/session"),Z(e,o)}async function Z(e,t){e.guest=Boolean(e.guest);const n=ie();console.log("setLoggedIn: mxid: "+e.userId+" deviceId: "+e.deviceId+" guest: "+e.guest+" hs: "+e.homeserverUrl+" softLogout: "+n),u.a.dispatch({action:"on_logging_in"},!0),t&&await ce();const o=await E.a();if(o.dataInLocalStorage&&o.cryptoInited&&!o.dataInCryptoStore){if(await function(){const e=_.getComponent("views.dialogs.StorageEvictedDialog");return new Promise(t=>{g.a.createTrackedDialog("Storage evicted","",e,{onFinished:t})})}())throw await ce(),new ee("Aborting login in progress because of storage inconsistency")}if(a.a.setLoggedIn(e.guest,e.homeserverUrl),localStorage)try{te(e),e.password&&u.a.dispatch({action:"cached_password",cachedPassword:e.password})}catch(e){console.warn("Error using local storage: can't persist session!",e)}else console.warn("No local storage available: can't persist session!");return r.a.replaceUsingCreds(e),u.a.dispatch({action:"on_logged_in"}),await async function(e=!0){console.log("Lifecycle: Starting MatrixClient"),u.a.dispatch({action:"will_start_client"},!0),S.a.sharedInstance().reset(),C.a.sharedInstance().reset(),c.default.start(),l.a.sharedInstance().start(),m.a.makeShared().start(),w.a.sharedInstance().startWatching(),f.a.start(),T.a.sharedInstance().start(),e?(await i.a.init(),await r.a.start()):(console.warn("Caller requested only auxiliary services be started"),await r.a.assign());q.sharedInstance().start(),y.b.getValue("lowBandwidth")||p.start();await V.a.getInstance().update(),u.a.dispatch({action:"client_started"}),ie()&&re()}(!n),r.a.get()}class ee extends Error{}function te(e){localStorage.setItem(H.a,e.homeserverUrl),e.identityServerUrl&&localStorage.setItem(H.b,e.identityServerUrl),localStorage.setItem("mx_user_id",e.userId),localStorage.setItem("mx_access_token",e.accessToken),localStorage.setItem("mx_is_guest",JSON.stringify(e.guest)),e.deviceId&&localStorage.setItem("mx_device_id",e.deviceId),console.log("Session persisted for "+e.userId)}let ne=!1;function oe(){if(!r.a.get())return;if(r.a.get().isGuest())return void ae();ne=!0;const e=r.a.get();v.a.get().destroyPickleKey(e.getUserId(),e.getDeviceId()),e.logout().then(ae,e=>{console.log("Failed to call logout API: token will not be invalidated"),ae()})}function re(){r.a.get()&&(localStorage.setItem("mx_soft_logout","true"),console.log("Soft logout initiated"),ne=!0,u.a.dispatch({action:"on_client_not_viable"}),le(!1))}function ie(){return"true"===localStorage.getItem("mx_soft_logout")}function se(){return ne}async function ae(){ne=!1,u.a.dispatch({action:"on_logged_out"},!0),le(),await ce()}async function ce(){a.a.disable(),window.localStorage&&window.localStorage.clear(),window.sessionStorage&&window.sessionStorage.clear();const e=Object(s.a)({baseUrl:""});await i.a.deleteEventIndex(),await e.clearStores()}function le(e=!0){c.default.stop(),l.a.sharedInstance().stop(),S.a.sharedInstance().reset(),p.stop(),f.a.stop(),w.a.sharedInstance().stopWatching(),T.a.sharedInstance().stop(),q.sharedInstance().stop(),m.a.shared()&&m.a.shared().stop(),i.a.stop();const t=r.a.get();t&&(t.stopClient(),t.removeAllListeners(),e&&(r.a.unset(),i.a.unset()))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(49),r=n(245),i=n(92),s=n(74),a=n(1),c=n(75),l=n(131);function u(e,t){this.roomId=e,this.info=t}var d=n(0),h=n(250);const p=["1","2","3","4","5"];function m(e,t,n){const o={content:{},type:"m.receipt",room_id:t.getRoomId()};return o.content[t.getId()]={},o.content[t.getId()][n]={},o.content[t.getId()][n][e]={ts:t.getTs()},new c.b(o)}function g(e,t,n,o){if((o=o||{}).pendingEventOrdering=o.pendingEventOrdering||"chronological",this.reEmitter=new h.a(this),-1===["chronological","detached"].indexOf(o.pendingEventOrdering))throw new Error("opts.pendingEventOrdering MUST be either 'chronological' or 'detached'. Got: '"+o.pendingEventOrdering+"'");this.myUserId=n,this.roomId=e,this.name=e,this.tags={},this.accountData={},this.summary=null,this.storageToken=o.storageToken,this._opts=o,this._txnToEvent={},this._receipts={},this._receiptCacheByEventId={},this._realReceipts={},this._notificationCounts={},this._timelineSets=[new r.a(this,o)],this.reEmitter.reEmit(this.getUnfilteredTimelineSet(),["Room.timeline","Room.timelineReset"]),this._fixUpLegacyTimelineFields(),this._filteredTimelineSets={},"detached"==this._opts.pendingEventOrdering&&(this._pendingEventList=[]),this._blacklistUnverifiedDevices=null,this._selfMembership=null,this._summaryHeroes=null,this._client=t,this._opts.lazyLoadMembers?this._membersPromise=null:this._membersPromise=Promise.resolve()}a.o(g,o.EventEmitter),g.prototype.getVersion=function(){const e=this.currentState.getStateEvents("m.room.create","");if(!e)return d.a.warn("Room "+this.roomId+" does not have an m.room.create event"),"1";const t=e.getContent().room_version;return void 0===t?"1":t},g.prototype.shouldUpgradeToVersion=function(){return p.includes(this.getVersion())?null:"5"},g.prototype.getRecommendedVersion=async function(){let e=(await this._client.getCapabilities())["m.room_versions"];if(!e){e={default:"5",available:{}};for(const t of p)e.available[t]="stable"}let t=this._checkVersionAgainstCapability(e);if(t.urgent&&t.needsUpgrade){d.a.warn("Refreshing room version capability because the server looks to be supporting a newer room version we don't know about.");if(e=(await this._client.getCapabilities(!0))["m.room_versions"],!e)return d.a.warn("No room version capability - assuming upgrade required."),t;t=this._checkVersionAgainstCapability(e)}return t},g.prototype._checkVersionAgainstCapability=function(e){const t=this.getVersion();d.a.log(`[${this.roomId}] Current version: ${t}`),d.a.log(`[${this.roomId}] Version capability: `,e);const n={version:t,needsUpgrade:!1,urgent:!1};if(t===e.default)return n;return Object.keys(e.available).filter(t=>"stable"===e.available[t]).includes(t)||(n.version=e.default,n.needsUpgrade=!0,n.urgent=!!this.getVersion().match(/^[0-9]+[0-9.]*$/g),n.urgent?d.a.warn("URGENT upgrade required on "+this.roomId):d.a.warn("Non-urgent upgrade required on "+this.roomId)),n},g.prototype.userMayUpgradeRoom=function(e){return this.currentState.maySendStateEvent("m.room.tombstone",e)},g.prototype.getPendingEvents=function(){if("detached"!==this._opts.pendingEventOrdering)throw new Error("Cannot call getPendingEvents with pendingEventOrdering == "+this._opts.pendingEventOrdering);return this._pendingEventList},g.prototype.hasPendingEvent=function(e){if("detached"!==this._opts.pendingEventOrdering)throw new Error("Cannot call hasPendingEvent with pendingEventOrdering == "+this._opts.pendingEventOrdering);return this._pendingEventList.some(t=>t.getId()===e)},g.prototype.getLiveTimeline=function(){return this.getUnfilteredTimelineSet().getLiveTimeline()},g.prototype.getLastActiveTimestamp=function(){const e=this.getLiveTimeline().getEvents();if(e.length){return e[e.length-1].getTs()}return Number.MIN_SAFE_INTEGER},g.prototype.getMyMembership=function(){return this._selfMembership},g.prototype.getDMInviter=function(){if(this.myUserId){const e=this.getMember(this.myUserId);if(e)return e.getDMInviter()}if("invite"===this._selfMembership){if(2==this.getInvitedAndJoinedMemberCount()&&this._summaryHeroes.length)return this._summaryHeroes[0]}},g.prototype.guessDMUserId=function(){const e=this.getMember(this.myUserId);if(e){const t=e.getDMInviter();if(t)return t}if(Array.isArray(this._summaryHeroes)&&this._summaryHeroes.length)return this._summaryHeroes[0];const t=this.currentState.getMembers().find(e=>e.userId!==this.myUserId);return t?t.userId:this.myUserId},g.prototype.getAvatarFallbackMember=function(){if(this.getInvitedAndJoinedMemberCount()>2)return;const e=Array.isArray(this._summaryHeroes)&&this._summaryHeroes.length;if(e){const e=this._summaryHeroes.map(e=>this.getMember(e)).find(e=>!!e);if(e)return e}const t=this.currentState.getMembers();if(t.length<=2){const e=t.find(e=>e.userId!==this.myUserId);if(e)return e}if(e){const e=this._summaryHeroes.map(e=>this._client.getUser(e)).find(e=>!!e);if(e){const t=new l.a(this.roomId,e.userId);return t.user=e,t}}},g.prototype.updateMyMembership=function(e){const t=this._selfMembership;this._selfMembership=e,t!==e&&("leave"===e&&this._cleanupAfterLeaving(),this.emit("Room.myMembership",this,e,t))},g.prototype._loadMembersFromServer=async function(){const e=this._client.store.getSyncToken(),t=a.e({not_membership:"leave",at:e}),n=a.f("/rooms/$roomId/members?"+t,{$roomId:this.roomId}),o=this._client._http;return(await o.authedRequest(void 0,"GET",n)).chunk},g.prototype._loadMembers=async function(){let e=!1,t=await this._client.store.getOutOfBandMembers(this.roomId);null===t&&(e=!0,t=await this._loadMembersFromServer(),d.a.log(`LL: got ${t.length} members from server for room `+this.roomId));return{memberEvents:t.map(this._client.getEventMapper()),fromServer:e}},g.prototype.loadMembersIfNeeded=function(){if(this._membersPromise)return this._membersPromise;this.currentState.markOutOfBandMembersStarted();const e=this._loadMembers().then(e=>(this.currentState.setOutOfBandMembers(e.memberEvents),this._client.isCryptoEnabled()&&this._client.isRoomEncrypted(this.roomId)&&this._client._crypto.trackRoomDevices(this.roomId),e.fromServer)).catch(e=>{throw this._membersPromise=null,this.currentState.markOutOfBandMembersFailed(),e});return e.then(e=>{if(e){const e=this.currentState.getMembers().filter(e=>e.isOutOfBand()).map(e=>e.events.member.event);d.a.log("LL: telling store to write "+e.length+" members for room "+this.roomId);return this._client.store.setOutOfBandMembers(this.roomId,e).catch(e=>{d.a.log("LL: storing OOB room members failed, oh well",e)})}}).catch(e=>{d.a.error(e)}),this._membersPromise=e,this._membersPromise},g.prototype.clearLoadedMembersIfNeeded=async function(){this._opts.lazyLoadMembers&&this._membersPromise&&(await this.loadMembersIfNeeded(),await this._client.store.clearOutOfBandMembers(this.roomId),this.currentState.clearOutOfBandMembers(),this._membersPromise=null)},g.prototype._cleanupAfterLeaving=function(){this.clearLoadedMembersIfNeeded().catch(e=>{d.a.error(`error after clearing loaded members from room ${this.roomId} after leaving`),d.a.log(e)})},g.prototype.resetLiveTimeline=function(e,t){for(let n=0;ne.isUnverified()))return!0}return!1},g.prototype.getTimelineSets=function(){return this._timelineSets},g.prototype.getUnfilteredTimelineSet=function(){return this._timelineSets[0]},g.prototype.getTimelineForEvent=function(e){return this.getUnfilteredTimelineSet().getTimelineForEvent(e)},g.prototype.addTimeline=function(){return this.getUnfilteredTimelineSet().addTimeline()},g.prototype.findEventById=function(e){return this.getUnfilteredTimelineSet().findEventById(e)},g.prototype.getUnreadNotificationCount=function(e){return e=e||"total",this._notificationCounts[e]},g.prototype.setUnreadNotificationCount=function(e,t){this._notificationCounts[e]=t},g.prototype.setSummary=function(e){const t=e["m.heroes"],n=e["m.joined_member_count"],o=e["m.invited_member_count"];Number.isInteger(n)&&this.currentState.setJoinedMemberCount(n),Number.isInteger(o)&&this.currentState.setInvitedMemberCount(o),Array.isArray(t)&&(this._summaryHeroes=t.filter(e=>e!==this.myUserId))},g.prototype.setBlacklistUnverifiedDevices=function(e){this._blacklistUnverifiedDevices=e},g.prototype.getBlacklistUnverifiedDevices=function(){return this._blacklistUnverifiedDevices},g.prototype.getAvatarUrl=function(e,t,n,o,r){const i=this.currentState.getStateEvents("m.room.avatar","");if(void 0===r&&(r=!0),!i&&!r)return null;const a=i?i.getContent().url:null;return a?Object(s.a)(e,a,t,n,o):r?Object(s.b)(e,this.roomId,t,n):null},g.prototype.getAliases=function(){const e=[],t=this.currentState.getStateEvents("m.room.aliases");if(t)for(let n=0;n"string"==typeof e&&("#"===e[0]&&!!e.endsWith(":"+o.getStateKey())));Array.prototype.push.apply(e,t)}}return e},g.prototype.getCanonicalAlias=function(){const e=this.currentState.getStateEvents("m.room.canonical_alias","");return e&&e.getContent().alias||null},g.prototype.getAltAliases=function(){const e=this.currentState.getStateEvents("m.room.canonical_alias","");return e&&e.getContent().alt_aliases||[]},g.prototype.addEventsToTimeline=function(e,t,n,o){n.getTimelineSet().addEventsToTimeline(e,t,n,o)},g.prototype.getMember=function(e){return this.currentState.getMember(e)},g.prototype.getJoinedMembers=function(){return this.getMembersWithMembership("join")},g.prototype.getJoinedMemberCount=function(){return this.currentState.getJoinedMemberCount()},g.prototype.getInvitedMemberCount=function(){return this.currentState.getInvitedMemberCount()},g.prototype.getInvitedAndJoinedMemberCount=function(){return this.getInvitedMemberCount()+this.getJoinedMemberCount()},g.prototype.getMembersWithMembership=function(e){return a.j(this.currentState.getMembers(),(function(t){return t.membership===e}))},g.prototype.getEncryptionTargetMembers=async function(){await this.loadMembersIfNeeded();let e=this.getMembersWithMembership("join");return this.shouldEncryptForInvitedMembers()&&(e=e.concat(this.getMembersWithMembership("invite"))),e},g.prototype.shouldEncryptForInvitedMembers=function(){const e=this.currentState.getStateEvents("m.room.history_visibility","");return e&&e.getContent()&&"joined"!==e.getContent().history_visibility},g.prototype.getDefaultRoomName=function(e){return f(this,e,!0)},g.prototype.hasMembershipState=function(e,t){const n=this.getMember(e);return!!n&&n.membership===t},g.prototype.getOrCreateFilteredTimelineSet=function(e){if(this._filteredTimelineSets[e.filterId])return this._filteredTimelineSets[e.filterId];const t=Object.assign({filter:e},this._opts),n=new r.a(this,t);this.reEmitter.reEmit(n,["Room.timeline","Room.timelineReset"]),this._filteredTimelineSets[e.filterId]=n,this._timelineSets.push(n);const o=this.getLiveTimeline();o.getEvents().forEach((function(e){n.addLiveEvent(e)}));let s=o;for(;s.getNeighbouringTimeline(i.a.BACKWARDS);)s=s.getNeighbouringTimeline(i.a.BACKWARDS);return n.getLiveTimeline().setPaginationToken(s.getPaginationToken(i.a.BACKWARDS),i.a.BACKWARDS),n},g.prototype.removeFilteredTimelineSet=function(e){const t=this._filteredTimelineSets[e.filterId];delete this._filteredTimelineSets[e.filterId];const n=this._timelineSets.indexOf(t);n>-1&&this._timelineSets.splice(n,1)},g.prototype._addLiveEvent=function(e,t,n){if(e.isRedaction()){const t=e.event.redacts,n=this.getUnfilteredTimelineSet().findEventById(t);if(n){if(n.makeRedacted(e),n.getStateKey()){this.currentState.getStateEvents(n.getType(),n.getStateKey()).getId()===n.getId()&&this.currentState.setStateEvents([n])}this.emit("Room.redaction",e,this)}}if(e.getUnsigned().transaction_id){const t=this._txnToEvent[e.getUnsigned().transaction_id];if(t)return void this._handleRemoteEcho(e,t)}for(let o=0;oe.status===c.a.NOT_SENT)&&(d.a.warn("Setting event as NOT_SENT due to messages in the same state"),e.setStatus(c.a.NOT_SENT)),this._pendingEventList.push(e),e.isRelation()&&this._aggregateNonLiveRelation(e),e.isRedaction()){const t=e.event.redacts;let n=this._pendingEventList&&this._pendingEventList.find(e=>e.getId()===t);n||(n=this.getUnfilteredTimelineSet().findEventById(t)),n&&(n.markLocallyRedacted(e),this.emit("Room.redaction",e,this))}}else for(let t=0;t ${o} old status `+r),delete this._txnToEvent[e.getUnsigned().transaction_id],this._pendingEventList&&a.y(this._pendingEventList,(function(e){return e.getId()==n}),!1),t.handleRemoteEcho(e.event);for(let e=0;e{const n=e.getMember(t);return n?n.name:t});else{let n=e.currentState.getMembers().filter(e=>e.userId!==t&&("invite"===e.membership||"join"===e.membership));n.sort((e,t)=>e.userId.localeCompare(t.userId)),n=n.slice(0,5),i=n.map(e=>e.name)}if(r)return v(i,r);if("join"==e.getMyMembership()){const t=e.currentState.getStateEvents("m.room.third_party_invite");if(t&&t.length){return"Inviting "+v(t.map(e=>e.getContent().display_name))}}let s=i;return s.length||(s=e.currentState.getMembers().filter(e=>e.userId!==t&&"invite"!==e.membership&&"join"!==e.membership).map(e=>e.name)),s.length?`Empty room (was ${v(s)})`:"Empty room"}function v(e,t=e.length+1){const n=t-1;if(e.length){if(1===e.length&&n<=1)return e[0];if(2===e.length&&n<=2)return`${e[0]} and ${e[1]}`;return n>1?`${e[0]} and ${n} others`:e[0]+" and 1 other"}return"Empty room"}_[c.a.ENCRYPTING]=[c.a.SENDING,c.a.NOT_SENT],_[c.a.SENDING]=[c.a.ENCRYPTING,c.a.QUEUED,c.a.NOT_SENT,c.a.SENT],_[c.a.QUEUED]=[c.a.SENDING,c.a.CANCELLED],_[c.a.SENT]=[],_[c.a.NOT_SENT]=[c.a.SENDING,c.a.QUEUED,c.a.CANCELLED],_[c.a.CANCELLED]=[],g.prototype.updatePendingEvent=function(e,t,n){if(d.a.log(`setting pendingEvent status to ${t} in ${e.getRoomId()} event ID ${e.getId()} -> ${n}`),t==c.a.SENT&&!n)throw new Error("updatePendingEvent called with status=SENT, but no new event id");if(t==c.a.SENT){if(this.getUnfilteredTimelineSet().eventIdToTimeline(n))return}const o=e.status,r=e.getId();if(!o)throw new Error("updatePendingEventStatus called on an event which is not a local echo.");const i=_[o];if(!i||i.indexOf(t)<0)throw new Error("Invalid EventStatus transition "+o+"->"+t);if(e.setStatus(t),t==c.a.SENT){e.replaceLocalEventId(n);for(let e=0;ee.getId()===r);if(-1!==e){const[t]=this._pendingEventList.splice(e,1);t.isRedaction()&&this._revertRedactionLocalEcho(t)}}this.removeEvent(r)}this.emit("Room.localEchoUpdated",e,this,r,o)},g.prototype._revertRedactionLocalEcho=function(e){const t=e.event.redacts;if(!t)return;const n=this.getUnfilteredTimelineSet().findEventById(t);n&&(n.unmarkLocallyRedacted(),this.emit("Room.redactionCancelled",e,this),n.isRelation()&&this._aggregateNonLiveRelation(n))},g.prototype.addLiveEvents=function(e,t,n){let o;if(t&&-1===["replace","ignore"].indexOf(t))throw new Error("duplicateStrategy MUST be either 'replace' or 'ignore'");for(o=0;o=0;--e){const o=this.timeline[e];if(o.getId()===t)return!1;if(o.getId()===n)return!0}return!1},g.prototype.getReceiptsForEvent=function(e){return this._receiptCacheByEventId[e.getId()]||[]},g.prototype.addReceipt=function(e,t){void 0===t&&(t=!1),t||this._addReceiptsToStructure(e,this._realReceipts),this._addReceiptsToStructure(e,this._receipts),this._receiptCacheByEventId=this._buildReceiptCache(this._receipts),this.emit("Room.receipt",e,this)},g.prototype._addReceiptsToStructure=function(e,t){const n=this;a.t(e.getContent()).forEach((function(o){a.t(e.getContent()[o]).forEach((function(r){a.t(e.getContent()[o][r]).forEach((function(i){const s=e.getContent()[o][r][i];t[r]||(t[r]={});const a=t[r][i];if(a){const e=n.getUnfilteredTimelineSet().compareEventOrdering(a.eventId,o);if(null!==e&&e>=0)return}else t[r][i]={};t[r][i]={eventId:o,data:s}}))}))}))},g.prototype._buildReceiptCache=function(e){const t={};return a.t(e).forEach((function(n){a.t(e[n]).forEach((function(o){const r=e[n][o];t[r.eventId]||(t[r.eventId]=[]),t[r.eventId].push({userId:o,type:n,data:r.data})}))})),t},g.prototype._addLocalEchoReceipt=function(e,t,n){this.addReceipt(m(e,t,n),!0)},g.prototype.addTags=function(e){this.tags=e.getContent().tags||{},this.emit("Room.tags",e,this)},g.prototype.addAccountData=function(e){for(let t=0;t{let i=t,s=n;s>600&&(i=Math.floor(i*(600/s)),s=600),i>800&&(s=Math.floor(s*(800/i)),i=800);const a=document.createElement("canvas");a.width=i,a.height=s,a.getContext("2d").drawImage(e,0,0,i,s),a.toBlob((function(e){r({info:{thumbnail_info:{w:i,h:s,mimetype:e.type,size:e.size},w:t,h:n},thumbnail:e})}),o)})}function S(e,t,n){let o,r="image/png";return"image/jpeg"===n.type&&(r="image/jpeg"),async function(e){const t=document.createElement("img"),n=URL.createObjectURL(e),o=new Promise((e,o)=>{t.onload=function(){URL.revokeObjectURL(n),e(t)},t.onerror=function(e){o(e)}});let r;if(t.src=n,"image/png"===e.type){r=w(e).then(e=>{const t=new Uint8Array(e),n=f()(t);for(const e of n)if("pHYs"===e.name){if(e.data.byteLength!==b.length)return;return e.data.every((e,t)=>e===b[t])}return!1})}const[i]=await Promise.all([r,o]);return{width:i?t.width>>1:t.width,height:i?t.height>>1:t.height,img:t}}(n).then((function(e){return y(e.img,e.width,e.height,r)})).then((function(n){return o=n.info,T(e,t,n.thumbnail)})).then((function(e){return o.thumbnail_url=e.url,o.thumbnail_file=e.file,o}))}function C(e,t,n){let o;return function(e){return new Promise((t,n)=>{const o=document.createElement("video"),r=new FileReader;r.onload=function(e){o.src=e.target.result,o.onloadeddata=function(){t(o)},o.onerror=function(e){n(e)}},r.onerror=function(e){n(e)},r.readAsDataURL(e)})}(n).then((function(e){return y(e,e.videoWidth,e.videoHeight,"image/jpeg")})).then((function(n){return o=n.info,T(e,t,n.thumbnail)})).then((function(e){return o.thumbnail_url=e.url,o.thumbnail_file=e.file,o}))}function w(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=function(e){t(e.target.result)},o.onerror=function(e){n(e)},o.readAsArrayBuffer(e)})}function T(e,t,n,o){let r=!1;if(e.isRoomEncrypted(t)){let t,i;const s=w(n).then((function(e){if(r)throw new E;return g.a.encryptAttachment(e)})).then((function(n){if(r)throw new E;i=n.info;const s=new Blob([n.data]);return t=e.uploadContent(s,{progressHandler:o,includeFilename:!1}),t})).then((function(e){if(r)throw new E;return i.url=e,n.type&&(i.mimetype=n.type),{file:i}}));return s.abort=()=>{r=!0,t&&l.a.get().cancelUpload(t)},s}{const t=e.uploadContent(n,{progressHandler:o}),i=t.then((function(e){if(r)throw new E;return{url:e}}));return i.abort=()=>{r=!0,l.a.get().cancelUpload(t)},i}}class k{constructor(){r()(this,"inprogress",[]),r()(this,"mediaConfig",null)}sendStickerContentToRoom(e,t,n,o,r){return l.a.get().sendStickerMessage(t,e,n,o).catch(n=>{throw console.warn(`Failed to send content with URL ${e} to room ${t}`,n),n})}getUploadLimit(){return null!==this.mediaConfig&&void 0!==this.mediaConfig["m.upload.size"]?this.mediaConfig["m.upload.size"]:null}async sendContentListToRoom(e,t,n){if(n.isGuest())return void c.a.dispatch({action:"require_registration"});if(Boolean(p.a.getQuotingEvent())){const e=u.getComponent("dialogs.QuestionDialog"),{finished:t}=h.a.createTrackedDialog("Upload Reply Warning","",e,{title:Object(d.a)("Replying With Files"),description:s.a.createElement("div",null,Object(d.a)("At this time it is not possible to reply with a file. Would you like to upload this file without replying?")),hasCancelButton:!0,button:Object(d.a)("Continue")}),[n]=await t;if(!n)return}if(!this.mediaConfig){const e=h.a.createDialog(v.a,null,"mx_Dialog_spinner");await this.ensureMediaConfigFetched(),e.close()}const o=[],r=[];for(let t=0;t0){const t=u.getComponent("dialogs.UploadFailureDialog"),{finished:n}=h.a.createTrackedDialog("Upload Failure","",t,{badFiles:o,totalFiles:e.length,contentMessages:this}),[r]=await n;if(!r)return}const i=u.getComponent("dialogs.UploadConfirmDialog");let a=!1,l=Promise.resolve();for(let e=0;e!e.canceled)}cancelUpload(e){let t;for(let n=0;n{0===e.type.indexOf("image/")?(r.msgtype="m.image",S(n,t,e).then(e=>{a(r.info,e),o()},e=>{console.error(e),r.msgtype="m.file",o()})):0===e.type.indexOf("audio/")?(r.msgtype="m.audio",o()):0===e.type.indexOf("video/")?(r.msgtype="m.video",C(n,t,e).then(e=>{a(r.info,e),o()},e=>{r.msgtype="m.file",o()})):(r.msgtype="m.file",o())});i.abort=()=>{s.canceled=!0};const s={fileName:e.name||"Attachment",roomId:t,total:e.size,loaded:0,promise:i};function l(e){s.total=e.total,s.loaded=e.loaded,c.a.dispatch({action:"upload_progress",upload:s})}let p;return this.inprogress.push(s),c.a.dispatch({action:"upload_started"}),c.a.dispatch({action:"focus_composer"}),i.then((function(){if(s.canceled)throw new E;return s.promise=T(n,t,e,l),s.promise.then((function(e){r.file=e.file,r.url=e.url}))})).then(()=>o).then((function(){if(s.canceled)throw new E;return n.sendMessage(t,r)}),(function(e){if(p=e,!s.canceled){let t=Object(d.a)("The file '%(fileName)s' failed to upload.",{fileName:s.fileName});413===e.http_status&&(t=Object(d.a)("The file '%(fileName)s' exceeds this homeserver's size limit for uploads",{fileName:s.fileName}));const n=u.getComponent("dialogs.ErrorDialog");h.a.createTrackedDialog("Upload failed","",n,{title:Object(d.a)("Upload Failed"),description:t})}})).finally(()=>{for(let e=0;ethis.mediaConfig["m.upload.size"])}ensureMediaConfigFetched(){if(null===this.mediaConfig)return console.log("[Media Config] Fetching"),l.a.get().getMediaConfig().then(e=>(console.log("[Media Config] Fetched config:",e),e)).catch(()=>(console.log("[Media Config] Could not fetch config, so not limiting uploads."),{})).then(e=>{this.mediaConfig=e})}static sharedInstance(){return void 0===window.mx_ContentMessages&&(window.mx_ContentMessages=new k),window.mx_ContentMessages}}},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(e){o=s}}();var c,l=[],u=!1,d=-1;function h(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&p())}function p(){if(!u){var e=a(h);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d1)for(var n=1;ne.isBeingDecrypted()))return;const e={};for(let t=n.length-1;t>=0;t--){const o=n[t];"m.call.answer"!==o.getType()&&"m.call.hangup"!==o.getType()||(e[o.getContent().call_id]="yep")}n.forEach((function(t){"m.call.invite"===t.getType()&&e[t.getContent().call_id]||r(t)})),n=[]}}function r(n){const o=n.getContent();let r,i=o.call_id?e.callList[o.call_id]:void 0;if("m.call.invite"===n.getType()){if(n.getSender()===e.credentials.userId)return;if(n.getAge()>o.lifetime)return;if(i&&"ended"===i.state)return;if(i&&y.a.log("WARN: Already have a MatrixCall with id %s but got an invite. Clobbering.",o.call_id),i=Object(p.a)(e,n.getRoomId(),{forceTURN:e._forceTURN}),!i)return void y.a.log("Incoming call ID "+o.call_id+" but this client doesn't support WebRTC");if(i.callId=o.call_id,i._initWithInvite(n),e.callList[i.callId]=i,t[i.callId])for(r=0;ri.callId?(y.a.log("Glare detected: answering incoming call "+i.callId+" and canceling outgoing call "+s.callId),s._replacedBy(i),i.answer()):(y.a.log("Glare detected: rejecting incoming call "+i.callId+" and keeping outgoing call "+s.callId),i.hangup()):e.emit("Call.incoming",i)}else if("m.call.answer"===n.getType()){if(!i)return;n.getSender()===e.credentials.userId?"ringing"===i.state&&i._onAnsweredElsewhere(o):i._receivedAnswer(o)}else if("m.call.candidates"===n.getType()){if(n.getSender()===e.credentials.userId)return;if(i)for(r=0;r{-1!==e.getType().indexOf("m.call.")&&(n.includes(e)?o():r(e))})}))}(this),this._supportsVoip=!0),this._syncingRetry=null,this._syncApi=null,this._peekSync=null,this._isGuest=!1,this._ongoingScrollbacks={},this.timelineSupport=Boolean(e.timelineSupport),this.urlPreviewCache={},this._notifTimelineSet=null,this.unstableClientRelationAggregation=!!e.unstableClientRelationAggregation,this._crypto=null,this._cryptoStore=e.cryptoStore,this._sessionStore=e.sessionStore,this._verificationMethods=e.verificationMethods,this._cryptoCallbacks=e.cryptoCallbacks||{},this._forceTURN=e.forceTURN||!1,this._fallbackICEServerAllowed=e.fallbackICEServerAllowed||!1,this._roomList=new E.a(this._cryptoStore),this._pushProcessor=new k.a(this),this._serverVersionsCache=null,this._cachedCapabilities=null,this.on("Event.decrypted",e=>{const t=e.getPushActions(),n=this._pushProcessor.actionsForEvent(e);e.setPushActions(n);const o=this.getRoom(e.getRoomId());if(!o)return;const r=o.getUnreadNotificationCount("highlight"),i=!(!t||!t.tweaks)&&!!t.tweaks.highlight,s=!(!n||!n.tweaks)&&!!n.tweaks.highlight;if((i!==s||r>0)&&!o.hasUserReadEvent(this.getUserId(),e.getId())){let e=r;s&&!i&&e++,!s&&i&&e--,o.setUnreadNotificationCount("highlight",e);o.getUnreadNotificationCount("total"){if(t&&this.isRoomEncrypted(t.roomId)){const n=e.getContent();if(!(Object.keys(n).filter(e=>Object.keys(n[e]["m.read"]).includes(this.getUserId())).length>0))return;const o=20,r=t.getLiveTimeline().getEvents();let i=0;for(let e=r.length-1;e>=0;e--){if(e===r.length-o)return;const n=r[e];if(t.hasUserReadEvent(this.getUserId(),n.getId()))break;const s=this.getPushActionsForEvent(n);i+=s.tweaks&&s.tweaks.highlight?1:0}t.setUnreadNotificationCount("highlight",i)}})}async function A(e,t,n,o,r,i){if(!e._crypto)throw new Error("End-to-End encryption disabled");await e._crypto.setDeviceVerification(t,n,o,r,i)}function F(e,t){for(const n of t)e.prototype[n]=function(...e){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto[n](...e)}}function N(e,t,n,o){return Promise.resolve().then((function(){const o=function(e,t,n){if(t.isEncrypted())return null;if(!e.isRoomEncrypted(t.getRoomId()))return null;if("m.reaction"===t.getType())return null;if(!e._crypto)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return e._crypto.encryptEvent(t,n)}(e,n,t);return o?(M(t,n,l.a.ENCRYPTING),o.then(()=>{M(t,n,l.a.SENDING)})):null})).then((function(){let o;return e.scheduler&&(o=e.scheduler.queueEvent(n),o&&e.scheduler.getQueueForEvent(n).length>1&&M(t,n,l.a.QUEUED)),o||(o=P(e,n),t&&(o=o.then(e=>(t.updatePendingEvent(n,l.a.SENT,e.event_id),e)))),o})).then((function(e){return o&&o(null,e),e}),(function(e){y.a.error("Error sending event",e.stack||e);try{n.error=e,M(t,n,l.a.NOT_SENT),e.event=n,o&&o(e)}catch(t){y.a.error("Exception in error handler!",t.stack||e)}throw e}))}function M(e,t,n){e?e.updatePendingEvent(t,n):t.setStatus(n)}function P(e,t){const n=t._txnId?t._txnId:e.makeTxnId(),o={$roomId:t.getRoomId(),$eventType:t.getWireType(),$stateKey:t.getStateKey(),$txnId:n};let r;if(t.isState()){let e="/rooms/$roomId/state/$eventType";t.getStateKey()&&t.getStateKey().length>0&&(e="/rooms/$roomId/state/$eventType/$stateKey"),r=m.f(e,o)}else if(t.isRedaction()){const e="/rooms/$roomId/redact/$redactsEventId/$txnId";r=m.f(e,Object.assign({$redactsEventId:t.event.redacts},o))}else r=m.f("/rooms/$roomId/send/$eventType/$txnId",o);return e._http.authedRequest(void 0,"PUT",r,void 0,t.getWireContent()).then(e=>(y.a.log(`Event sent to ${t.getRoomId()} with event id ${e.event_id}`),e))}function L(e,t,n,o,r,i){m.q(r)&&(i=r,r=void 0);const s=m.f("/rooms/$room_id/$membership",{$room_id:t,$membership:o});return e._http.authedRequest(i,"POST",s,void 0,{user_id:n,reason:r})}function U(e,t,n,o){const r=m.f("/presence/list/$userId",{$userId:t.credentials.userId});return t._http.authedRequest(e,o,r,void 0,n)}function B(e,t,n){e&&e(n),t(n)}function j(e,t,n){e&&e(null,n),t(n)}function G(e,t){const n=Boolean(t&&t.preventReEmit);return function(t){const o=new l.b(t);o.isEncrypted()&&(n||e.reEmitter.reEmit(o,["Event.decrypted"]),o.attemptDecryption(e._crypto));const r=e.getRoom(o.getRoomId());return r&&!n&&r.reEmitter.reEmit(o,["Event.replaced"]),o}}m.o(I,i.EventEmitter),m.i(I.prototype,s.a.prototype),I.prototype.exportDevice=async function(){if(this._crypto)return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:await this._crypto._olmDevice.export()};y.a.warn("not exporting device if crypto is not enabled")},I.prototype.clearStores=function(){if(this._clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];return e.push(this.store.deleteAllData()),this._cryptoStore&&e.push(this._cryptoStore.deleteAllData()),Promise.all(e)},I.prototype.getUserId=function(){return this.credentials&&this.credentials.userId?this.credentials.userId:null},I.prototype.getDomain=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null},I.prototype.getUserIdLocalpart=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null},I.prototype.getDeviceId=function(){return this.deviceId},I.prototype.supportsVoip=function(){return this._supportsVoip},I.prototype.setForceTURN=function(e){this._forceTURN=e},I.prototype.getSyncState=function(){return this._syncApi?this._syncApi.getSyncState():null},I.prototype.getSyncStateData=function(){return this._syncApi?this._syncApi.getSyncStateData():null},I.prototype.isInitialSyncComplete=function(){const e=this.getSyncState();return!!e&&("PREPARED"===e||"SYNCING"===e)},I.prototype.isGuest=function(){return this._isGuest},I.prototype.getScheduler=function(){return this.scheduler},I.prototype.setGuest=function(e){this._isGuest=e},I.prototype.retryImmediately=function(){return this._syncApi.retryImmediately()},I.prototype.getNotifTimelineSet=function(){return this._notifTimelineSet},I.prototype.setNotifTimelineSet=function(e){this._notifTimelineSet=e},I.prototype.getCapabilities=function(e=!1){const t=(new Date).getTime();return this._cachedCapabilities&&!e&&t(y.a.error(e),null)).then(e=>{e||(e={});const n=e.capabilities||{},o=Object.keys(n).length?216e5:6e4+5e3*Math.random();return this._cachedCapabilities={capabilities:n,expiration:t+o},y.a.log("Caching capabilities: ",n),n})},I.prototype.initCrypto=async function(){if(!Object(S.c)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this._crypto)return void y.a.warn("Attempt to re-initialise e2e encryption on MatrixClient");if(!this._sessionStore)throw new Error("Cannot enable encryption: no sessionStore provided");if(!this._cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");y.a.log("Crypto: Starting up crypto store..."),await this._cryptoStore.startup(),y.a.log("Crypto: initialising roomlist..."),await this._roomList.init();const e=this.getUserId();if(null===e)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(null===this.deviceId)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new S.a(this,this._sessionStore,e,this.deviceId,this.store,this._cryptoStore,this._roomList,this._verificationMethods);this.reEmitter.reEmit(t,["crypto.keyBackupFailed","crypto.keyBackupSessionsRemaining","crypto.roomKeyRequest","crypto.roomKeyRequestCancellation","crypto.warning","crypto.devicesUpdated","crypto.willUpdateDevices","deviceVerificationChanged","userTrustStatusChanged","crossSigning.keysChanged"]),y.a.log("Crypto: initialising crypto object..."),await t.init({exportedOlmDevice:this._exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this._exportedOlmDeviceToImport,this.olmVersion=S.a.getOlmVersion(),t.registerEventHandlers(this),this._crypto=t},I.prototype.isCryptoEnabled=function(){return null!==this._crypto},I.prototype.getDeviceEd25519Key=function(){return this._crypto?this._crypto.getDeviceEd25519Key():null},I.prototype.getDeviceCurve25519Key=function(){return this._crypto?this._crypto.getDeviceCurve25519Key():null},I.prototype.uploadKeys=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.uploadDeviceKeys()},I.prototype.downloadKeys=function(e,t){return null===this._crypto?Promise.reject(new Error("End-to-end encryption disabled")):this._crypto.downloadKeys(e,t)},I.prototype.getStoredDevicesForUser=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevicesForUser(e)||[]},I.prototype.getStoredDevice=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevice(e,t)||null},I.prototype.setDeviceVerified=function(e,t,n){void 0===n&&(n=!0);const o=A(this,e,t,n,null);return e==this.credentials.userId&&this._crypto.checkKeyBackup(),o},I.prototype.setDeviceBlocked=function(e,t,n){return void 0===n&&(n=!0),A(this,e,t,null,n)},I.prototype.setDeviceKnown=function(e,t,n){return void 0===n&&(n=!0),A(this,e,t,null,null,n)},I.prototype.requestVerificationDM=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerificationDM(e,t)},I.prototype.findVerificationRequestDMInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.findVerificationRequestDMInProgress(e)},I.prototype.requestVerification=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerification(e,t)},I.prototype.beginKeyVerification=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.beginKeyVerification(e,t,n)},I.prototype.setGlobalBlacklistUnverifiedDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalBlacklistUnverifiedDevices(e)},I.prototype.getGlobalBlacklistUnverifiedDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalBlacklistUnverifiedDevices()},I.prototype.setGlobalErrorOnUnknownDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalErrorOnUnknownDevices(e)},I.prototype.getGlobalErrorOnUnknownDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalErrorOnUnknownDevices()},F(I,["resetCrossSigningKeys","getCrossSigningId","getStoredCrossSigningForUser","checkUserTrust","checkDeviceTrust","checkOwnCrossSigningTrust","checkCrossSigningPrivateKey","legacyDeviceVerification","prepareToEncrypt","isCrossSigningReady","getCryptoTrustCrossSignedDevices","setCryptoTrustCrossSignedDevices"]),I.prototype.checkEventSenderTrust=async function(e){const t=await this.getEventSenderDeviceInfo(e);return t?await this._crypto.checkDeviceTrust(e.getSender(),t.deviceId):0},F(I,["createRecoveryKeyFromPassphrase","bootstrapSecretStorage","addSecretStorageKey","hasSecretStorageKey","storeSecret","getSecret","isSecretStored","requestSecret","getDefaultSecretStorageKeyId","setDefaultSecretStorageKeyId","checkSecretStorageKey","checkSecretStoragePrivateKey"]),I.prototype.getEventSenderDeviceInfo=async function(e){return this._crypto?this._crypto.getEventSenderDeviceInfo(e):null},I.prototype.isEventSenderVerified=async function(e){const t=await this.getEventSenderDeviceInfo(e);return!!t&&t.isVerified()},I.prototype.cancelAndResendEventRoomKeyRequest=function(e){return e.cancelAndResendKeyRequest(this._crypto,this.getUserId())},I.prototype.setRoomEncryption=function(e,t){if(!this._crypto)throw new Error("End-to-End encryption disabled");return this._crypto.setRoomEncryption(e,t)},I.prototype.isRoomEncrypted=function(e){const t=this.getRoom(e);if(!t)return!1;return!!t.currentState.getStateEvents("m.room.encryption","")||this._roomList.isRoomEncrypted(e)},I.prototype.forceDiscardSession=function(e){if(!this._crypto)throw new Error("End-to-End encryption disabled");this._crypto.forceDiscardSession(e)},I.prototype.exportRoomKeys=function(){return this._crypto?this._crypto.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))},I.prototype.importRoomKeys=function(e,t){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.importRoomKeys(e,t)},I.prototype.checkKeyBackup=function(){return this._crypto.checkKeyBackup()},I.prototype.getKeyBackupVersion=function(){return this._http.authedRequest(void 0,"GET","/room_keys/version",void 0,void 0,{prefix:g.i}).then(e=>{if(e.algorithm!==v.MEGOLM_BACKUP_ALGORITHM){const t="Unknown backup algorithm: "+e.algorithm;return Promise.reject(t)}if("object"==typeof e.auth_data&&e.auth_data.public_key)return e;{const e="Invalid backup data returned";return Promise.reject(e)}}).catch(e=>{if("M_NOT_FOUND"===e.errcode)return null;throw e})},I.prototype.isKeyBackupTrusted=function(e){return this._crypto.isKeyBackupTrusted(e)},I.prototype.getKeyBackupEnabled=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto._checkedForBackup?Boolean(this._crypto.backupKey):null},I.prototype.enableKeyBackup=function(t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=t,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=new e.Olm.PkEncryption,this._crypto.backupKey.set_recipient_key(t.auth_data.public_key),this.emit("crypto.keyBackupStatus",!0),this._crypto.scheduleKeyBackupSend()},I.prototype.disableKeyBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=null,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=null,this.emit("crypto.keyBackupStatus",!1)},I.prototype.prepareKeyBackupVersion=async function(e,{secureSecretStorage:t=!1}={}){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const{keyInfo:n,encodedPrivateKey:o,privateKey:r}=await this.createRecoveryKeyFromPassphrase(e);t&&(await this.storeSecret("m.megolm_backup.v1",Object(v.encodeBase64)(r)),y.a.info("Key backup private key stored in secret storage"));const i={public_key:n.pubkey};return n.passphrase&&(i.private_key_salt=n.passphrase.salt,i.private_key_iterations=n.passphrase.iterations),{algorithm:v.MEGOLM_BACKUP_ALGORITHM,auth_data:i,recovery_key:o}},I.prototype.isKeyBackupKeyStored=async function(){return this.isSecretStored("m.megolm_backup.v1",!1)},I.prototype.createKeyBackupVersion=async function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const t={algorithm:e.algorithm,auth_data:e.auth_data};await this._crypto._signObject(t.auth_data),this._cryptoCallbacks.getCrossSigningKey&&this._crypto._crossSigningInfo.getId()&&await this._crypto._crossSigningInfo.signObject(t.auth_data,"master");const n=await this._http.authedRequest(void 0,"POST","/room_keys/version",void 0,t,{prefix:g.i});return await this.checkKeyBackup(),this.getKeyBackupEnabled()||y.a.error("Key backup not usable even though we just created it"),n},I.prototype.deleteKeyBackupVersion=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo&&this._crypto.backupInfo.version===e&&this.disableKeyBackup();const t=m.f("/room_keys/version/$version",{$version:e});return this._http.authedRequest(void 0,"DELETE",t,void 0,void 0,{prefix:g.i})},I.prototype._makeKeyBackupPath=function(e,t,n){let o;o=void 0!==t?m.f("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):void 0!==e?m.f("/room_keys/keys/$roomId",{$roomId:e}):"/room_keys/keys";return{path:o,queryData:void 0===n?void 0:{version:n}}},I.prototype.sendKeyBackup=function(e,t,n,o){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const r=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"PUT",r.path,r.queryData,o,{prefix:g.i})},I.prototype.scheduleAllGroupSessionsForBackup=async function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");await this._crypto.scheduleAllGroupSessionsForBackup()},I.prototype.flagAllGroupSessionsForBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.flagAllGroupSessionsForBackup()},I.prototype.isValidRecoveryKey=function(e){try{return Object(C.a)(e),!0}catch(e){return!1}},I.prototype.keyBackupKeyFromPassword=function(e,t){return Object(w.b)(t.auth_data,e)},I.prototype.keyBackupKeyFromRecoveryKey=function(e){return Object(C.a)(e)},I.RESTORE_BACKUP_ERROR_BAD_KEY="RESTORE_BACKUP_ERROR_BAD_KEY",I.prototype.restoreKeyBackupWithPassword=async function(e,t,n,o,r){const i=await Object(w.b)(o.auth_data,e);return this._restoreKeyBackup(i,t,n,o,r)},I.prototype.restoreKeyBackupWithSecretStorage=async function(e,t,n,o){const r=await this.getSecret("m.megolm_backup.v1"),i=Object(S.b)(r);if(i){const[e]=await this._crypto.getSecretStorageKey();await this.storeSecret("m.megolm_backup.v1",i,[e])}const s=Object(v.decodeBase64)(i||r);return this._restoreKeyBackup(s,t,n,e,o)},I.prototype.restoreKeyBackupWithRecoveryKey=function(e,t,n,o,r){const i=Object(C.a)(e);return this._restoreKeyBackup(i,t,n,o,r)},I.prototype.restoreKeyBackupWithCache=async function(e,t,n,o){const r=await this._crypto.getSessionBackupPrivateKey();if(!r)throw new Error("Couldn't get key");return this._restoreKeyBackup(r,e,t,n,o)},I.prototype._restoreKeyBackup=function(t,n,o,r,{cacheCompleteCallback:i,progressCallback:s}={}){if(null===this._crypto)throw new Error("End-to-end encryption disabled");let a=0,c=[];const l=this._makeKeyBackupPath(n,o,r.version),u=new e.Olm.PkDecryption;let d;try{d=u.init_with_private_key(t)}catch(e){throw u.free(),e}return d!==r.auth_data.public_key?Promise.reject({errcode:I.RESTORE_BACKUP_ERROR_BAD_KEY}):(this._crypto.storeSessionBackupPrivateKey(t).catch(e=>{console.warn("Error caching session backup key:",e)}).then(i),s&&s({stage:"fetch"}),this._http.authedRequest(void 0,"GET",l.path,l.queryData,void 0,{prefix:g.i}).then(e=>{if(e.rooms)for(const[t,n]of Object.entries(e.rooms)){if(!n.sessions)continue;a+=Object.keys(n.sessions).length;const e=R(n.sessions,u,t);for(const n of e)n.room_id=t,c.push(n)}else if(e.sessions)a=Object.keys(e.sessions).length,c=R(e.sessions,u,n);else{a=1;try{const t=D(e,u);t.room_id=n,t.session_id=o,c.push(t)}catch(e){y.a.log("Failed to decrypt megolm session from backup",e)}}return this.importRoomKeys(c,{progressCallback:s})}).then(()=>this._crypto.setTrustedBackupPubKey(d)).then(()=>({total:a,imported:c.length})).finally(()=>{u.free()}))},I.prototype.deleteKeysFromBackup=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const o=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"DELETE",o.path,o.queryData,void 0,{prefix:g.i})},I.prototype.getGroup=function(e){return this.store.getGroup(e)},I.prototype.getGroups=function(){return this.store.getGroups()},I.prototype.getMediaConfig=function(e){return this._http.authedRequest(e,"GET","/config",void 0,void 0,{prefix:g.g})},I.prototype.getRoom=function(e){return this.store.getRoom(e)},I.prototype.getRooms=function(){return this.store.getRooms()},I.prototype.getVisibleRooms=function(){const e=this.store.getRooms(),t=new Set;for(const n of e){const e=n.currentState.getStateEvents("m.room.create","");if(e){const n=e.getContent().predecessor;n&&n.room_id&&t.add(n.room_id)}}return e.filter(e=>!e.currentState.getStateEvents("m.room.tombstone","")||!t.has(e.roomId))},I.prototype.getUser=function(e){return this.store.getUser(e)},I.prototype.getUsers=function(){return this.store.getUsers()},I.prototype.setAccountData=function(e,t,n){const o=m.f("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e}),r=Object(g.j)(5,()=>this._http.authedRequest(void 0,"PUT",o,void 0,t));return n&&r.then(e=>n(null,e),n),r},I.prototype.getAccountData=function(e){return this.store.getAccountData(e)},I.prototype.getAccountDataFromServer=async function(e){if(this.isInitialSyncComplete()){const t=this.store.getAccountData(e);return t?t.getContent():null}const t=m.f("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});try{return await this._http.authedRequest(void 0,"GET",t,void 0)}catch(e){if(e.data&&"M_NOT_FOUND"===e.data.errcode)return null;throw e}},I.prototype.getIgnoredUsers=function(){const e=this.getAccountData("m.ignored_user_list");return e&&e.getContent()&&e.getContent().ignored_users?Object.keys(e.getContent().ignored_users):[]},I.prototype.setIgnoredUsers=function(e,t){const n={ignored_users:{}};return e.map(e=>n.ignored_users[e]={}),this.setAccountData("m.ignored_user_list",n,t)},I.prototype.isUserIgnored=function(e){return-1!==this.getIgnoredUsers().indexOf(e)},I.prototype.joinRoom=function(e,t,n){if(m.q(t))throw new Error("Expected 'opts' object, got function.");void 0===(t=t||{}).syncRoom&&(t.syncRoom=!0);const o=this.getRoom(e);if(o&&o.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(o);let r=Promise.resolve();t.inviteSignUrl&&(r=this._http.requestOtherUrl(void 0,"POST",t.inviteSignUrl,{mxid:this.credentials.userId}));const i={};t.viaServers&&(i.server_name=t.viaServers);const s={qsStringifyOptions:{arrayFormat:"repeat"}},a=this;return new Promise((o,l)=>{r.then((function(t){const n={};t&&(n.third_party_signed=t);const o=m.f("/join/$roomid",{$roomid:e});return a._http.authedRequest(void 0,"POST",o,i,n,s)})).then((function(e){const n=e.room_id,o=new c.a(a,a._clientOpts).createRoom(n);return t.syncRoom,Promise.resolve(o)})).then((function(e){j(n,o,e)}),(function(e){B(n,l,e)}))})},I.prototype.resendEvent=function(e,t){return M(t,e,l.a.SENDING),N(this,t,e)},I.prototype.cancelPendingEvent=function(e){if([l.a.QUEUED,l.a.NOT_SENT].indexOf(e.status)<0)throw new Error("cannot cancel an event with status "+e.status);this.scheduler&&this.scheduler.removeEventFromQueue(e);M(this.getRoom(e.getRoomId()),e,l.a.CANCELLED)},I.prototype.setRoomName=function(e,t,n){return this.sendStateEvent(e,"m.room.name",{name:t},void 0,n)},I.prototype.setRoomTopic=function(e,t,n){return this.sendStateEvent(e,"m.room.topic",{topic:t},void 0,n)},I.prototype.getRoomTags=function(e,t){const n=m.f("/user/$userId/rooms/$roomId/tags/",{$userId:this.credentials.userId,$roomId:e});return this._http.authedRequest(t,"GET",n,void 0)},I.prototype.setRoomTag=function(e,t,n,o){const r=m.f("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(o,"PUT",r,void 0,n)},I.prototype.deleteRoomTag=function(e,t,n){const o=m.f("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(n,"DELETE",o,void 0,void 0)},I.prototype.setRoomAccountData=function(e,t,n,o){const r=m.f("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this._http.authedRequest(o,"PUT",r,void 0,n)},I.prototype.setPowerLevel=function(e,t,n,o,r){let i={users:{}};o&&"m.room.power_levels"===o.getType()&&(i=m.c(o.getContent())),i.users[t]=n;const s=m.f("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this._http.authedRequest(r,"PUT",s,void 0,i)},I.prototype.sendEvent=function(e,t,n,o,r){return this._sendCompleteEvent(e,{type:t,content:n},o,r)},I.prototype._sendCompleteEvent=function(e,t,n,o){m.q(n)&&(o=n,n=void 0),n||(n=this.makeTxnId());const r=new l.b(Object.assign(t,{event_id:"~"+e+":"+n,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:(new Date).getTime()})),i=this.getRoom(e),s=r.getAssociatedId();if(s&&s.startsWith("~")){const e=i.getPendingEvents().find(e=>e.getId()===s);e.once("Event.localEventIdReplaced",()=>{r.updateAssociatedId(e.getId())})}const a=r.getType();return y.a.log(`sendEvent of type ${a} in ${e} with txnId ${n}`),r._txnId=n,r.setStatus(l.a.SENDING),i&&i.addPendingEvent(r,n),r.status===l.a.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):N(this,i,r,o)},I.prototype.redactEvent=function(e,t,n,o){return this._sendCompleteEvent(e,{type:"m.room.redaction",content:{},redacts:t},n,o)},I.prototype.sendMessage=function(e,t,n,o){return m.q(n)&&(o=n,n=void 0),this.sendEvent(e,"m.room.message",t,n,o)},I.prototype.sendTextMessage=function(e,t,n,o){const r=f.makeTextMessage(t);return this.sendMessage(e,r,n,o)},I.prototype.sendNotice=function(e,t,n,o){const r=f.makeNotice(t);return this.sendMessage(e,r,n,o)},I.prototype.sendEmoteMessage=function(e,t,n,o){const r=f.makeEmoteMessage(t);return this.sendMessage(e,r,n,o)},I.prototype.sendImageMessage=function(e,t,n,o,r){m.q(o)&&(r=o,o=void 0),o||(o="Image");const i={msgtype:"m.image",url:t,info:n,body:o};return this.sendMessage(e,i,r)},I.prototype.sendStickerMessage=function(e,t,n,o,r){m.q(o)&&(r=o,o=void 0),o||(o="Sticker");const i={url:t,info:n,body:o};return this.sendEvent(e,"m.sticker",i,r,void 0)},I.prototype.sendHtmlMessage=function(e,t,n,o){const r=f.makeHtmlMessage(t,n);return this.sendMessage(e,r,o)},I.prototype.sendHtmlNotice=function(e,t,n,o){const r=f.makeHtmlNotice(t,n);return this.sendMessage(e,r,o)},I.prototype.sendHtmlEmote=function(e,t,n,o){const r=f.makeHtmlEmote(t,n);return this.sendMessage(e,r,o)},I.prototype.sendReceipt=function(e,t,n,o){if("function"==typeof n&&(o=n,n={}),this.isGuest())return Promise.resolve({});const r=m.f("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()}),i=this._http.authedRequest(o,"POST",r,void 0,n||{}),s=this.getRoom(e.getRoomId());return s&&s._addLocalEchoReceipt(this.credentials.userId,e,t),i},I.prototype.sendReadReceipt=async function(e,t,n){"function"==typeof t&&(n=t,t={}),t||(t={});const o=e.getId(),r=this.getRoom(e.getRoomId());if(r&&r.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);const i={"m.hidden":Boolean(t.hidden)};return this.sendReceipt(e,"m.read",i,n)},I.prototype.setRoomReadMarkers=async function(e,t,n,o){const r=this.getRoom(e);if(r&&r.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let i;if(n){if(i=n.getId(),r&&r.hasPendingEvent(i))throw new Error(`Cannot set read receipt to a pending event (${i})`);r&&r._addLocalEchoReceipt(this.credentials.userId,n,"m.read")}return this.setRoomReadMarkersHttpRequest(e,t,i,o)},I.prototype.getUrlPreview=function(e,t,n){const o=t+"_"+e,r=this.urlPreviewCache[o];if(r)return Promise.resolve(r);const i=this;return this._http.authedRequest(n,"GET","/preview_url",{url:e,ts:t},void 0,{prefix:g.g}).then((function(e){return i.urlPreviewCache[o]=e,e}))},I.prototype.sendTyping=function(e,t,n,o){if(this.isGuest())return Promise.resolve({});const r=m.f("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.credentials.userId}),i={typing:t};return t&&(i.timeout=n||2e4),this._http.authedRequest(o,"PUT",r,void 0,i)},I.prototype.getRoomUpgradeHistory=function(e,t=!1){let n=this.getRoom(e);if(!n)return[];const o=[n];let r=n.currentState.getStateEvents("m.room.create","");for(;r;){y.a.log("Looking at "+r.getId());const e=r.getContent().predecessor;if(!e||!e.room_id)break;{y.a.log("Looking at predecessor "+e.room_id);const n=this.getRoom(e.room_id);if(!n)break;if(t){const e=n.currentState.getStateEvents("m.room.tombstone","");if(!e||e.getContent().replacement_room!==n.roomId)break}o.splice(0,0,n),r=n.currentState.getStateEvents("m.room.create","")}}let i=n.currentState.getStateEvents("m.room.tombstone","");for(;i;){const e=this.getRoom(i.getContent().replacement_room);if(!e)break;if(e.roomId===n.roomId)break;if(t){if(r=e.currentState.getStateEvents("m.room.create",""),!r||!r.getContent().predecessor)break;if(r.getContent().predecessor.room_id!==n.roomId)break}o.push(e);if(new Set(o.map(e=>e.roomId)).sizethis.leave(e).then(()=>{r[e]=null}).catch(t=>(r[e]=t,null));for(const e of o)i.push(s(e.roomId));return Promise.all(i).then(()=>r)},I.prototype.ban=function(e,t,n,o){return L(this,e,t,"ban",n,o)},I.prototype.forget=function(e,t,n){void 0===t&&(t=!0);const o=L(this,e,void 0,"forget",void 0,n);if(!t)return o;const r=this;return o.then((function(t){return r.store.removeRoom(e),r.emit("deleteRoom",e),t}))},I.prototype.unban=function(e,t,n){const o=m.f("/rooms/$roomId/unban",{$roomId:e}),r={user_id:t};return this._http.authedRequest(n,"POST",o,void 0,r)},I.prototype.kick=function(e,t,n,o){return function(e,t,n,o,r,i){m.q(r)&&(i=r,r=void 0);const s=m.f("/rooms/$roomId/state/m.room.member/$userId",{$roomId:t,$userId:n});return e._http.authedRequest(i,"PUT",s,void 0,{membership:o,reason:r})}(this,e,t,"leave",n,o)},I.prototype.getPushActionsForEvent=function(e){return e.getPushActions()||e.setPushActions(this._pushProcessor.actionsForEvent(e)),e.getPushActions()},I.prototype.setProfileInfo=function(e,t,n){const o=m.f("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this._http.authedRequest(n,"PUT",o,void 0,t)},I.prototype.setDisplayName=function(e,t){return this.setProfileInfo("displayname",{displayname:e},t)},I.prototype.setAvatarUrl=function(e,t){return this.setProfileInfo("avatar_url",{avatar_url:e},t)},I.prototype.mxcUrlToHttp=function(e,t,n,o,r){return Object(_.a)(this.baseUrl,e,t,n,o,r)},I.prototype._unstable_setStatusMessage=function(e){const t="im.vector.user_status";return Promise.all(this.getRooms().map(n=>{const o="join"===n.getMyMembership(),r=2===n.getInvitedAndJoinedMemberCount();if(!o||!r)return Promise.resolve();return n.currentState.mayClientSendStateEvent(t,this)?this.sendStateEvent(n.roomId,t,{status:e},this.getUserId()):Promise.resolve()}))},I.prototype.setPresence=function(e,t){const n=m.f("/presence/$userId/status",{$userId:this.credentials.userId});"string"==typeof e&&(e={presence:e});if(-1==["offline","online","unavailable"].indexOf(e.presence))throw new Error("Bad presence value: "+e.presence);return this._http.authedRequest(t,"PUT",n,void 0,e)},I.prototype.getPresenceList=function(e){return U(e,this,void 0,"GET")},I.prototype.inviteToPresenceList=function(e,t){return U(e,this,{invite:t},"POST")},I.prototype.dropFromPresenceList=function(e,t){return U(e,this,{drop:t},"POST")},I.prototype.scrollback=function(e,t,n){m.q(t)&&(n=t,t=void 0),t=t||30;let o=0,r=this._ongoingScrollbacks[e.roomId]||{};if(r.promise)return r.promise;if(r.errorTs){const e=Date.now()-r.errorTs;o=Math.max(3e3-e,0)}if(null===e.oldState.paginationToken)return Promise.resolve(e);const i=this.store.scrollback(e,t).length;if(i===t)return Promise.resolve(e);t-=i;const s=this,a=new Promise((r,i)=>{Object(m.A)(o).then((function(){return s._createMessagesRequest(e.roomId,e.oldState.paginationToken,t,"b")})).then((function(t){const o=m.u(t.chunk,G(s));if(t.state){const n=m.u(t.state,G(s));e.currentState.setUnknownStateEvents(n)}e.addEventsToTimeline(o,!0,e.getLiveTimeline()),e.oldState.paginationToken=t.end,0===t.chunk.length&&(e.oldState.paginationToken=null),s.store.storeEvents(e,o,t.end,!0),s._ongoingScrollbacks[e.roomId]=null,j(n,r,e)}),(function(t){s._ongoingScrollbacks[e.roomId]={errorTs:Date.now()},B(n,i,t)}))});return r={promise:a,errorTs:null},this._ongoingScrollbacks[e.roomId]=r,a},I.prototype.getEventTimeline=function(e,t){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(e.getTimelineForEvent(t))return Promise.resolve(e.getTimelineForEvent(t));const n=m.f("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let o=void 0;this._clientOpts.lazyLoadMembers&&(o={filter:JSON.stringify(a.a.LAZY_LOADING_MESSAGES_FILTER)});const r=this;return r._http.authedRequest(void 0,"GET",n,o).then((function(n){if(!n.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);n.events_after.reverse();const o=n.events_after.concat([n.event]).concat(n.events_before),i=m.u(o,r.getEventMapper());let s=e.getTimelineForEvent(i[0].getId());if(s){const e=m.u(n.state,r.getEventMapper());s.getState(u.a.BACKWARDS).setUnknownStateEvents(e)}else s=e.addTimeline(),s.initialiseState(m.u(n.state,r.getEventMapper())),s.getState(u.a.FORWARDS).paginationToken=n.end;e.addEventsToTimeline(i,!0,s,n.start);return e.getTimelineForEvent(t)||s}))},I.prototype._createMessagesRequest=function(e,t,n,o,r){const i=m.f("/rooms/$roomId/messages",{$roomId:e});void 0===n&&(n=30);const s={from:t,limit:n,dir:o};let c=null;return this._clientOpts.lazyLoadMembers&&(c=Object.assign({},a.a.LAZY_LOADING_MESSAGES_FILTER)),r&&(c=c||{},Object.assign(c,r.getRoomTimelineFilterComponent())),c&&(s.filter=JSON.stringify(c)),this._http.authedRequest(void 0,"GET",i,s)},I.prototype.paginateEventTimeline=function(e,t){const n=e.getTimelineSet()===this._notifTimelineSet,o=(t=t||{}).backwards||!1;if(n&&!o)throw new Error("paginateNotifTimeline can only paginate backwards");const r=o?u.a.BACKWARDS:u.a.FORWARDS,i=e.getPaginationToken(r);if(!i)return Promise.resolve(!1);const s=e._paginationRequests[r];if(s)return s;let a,c,l;const d=this;if(n)a="/notifications",c={limit:"limit"in t?t.limit:30,only:"highlight"},i&&"end"!==i&&(c.from=i),l=this._http.authedRequest(void 0,"GET","/notifications",c,void 0).then((function(t){const n=t.next_token,i=[];for(let e=0;e{r.then((function(){o.getPushRules().then((function(t){o.pushRules=t,e()}),(function(e){t(e)}))}),(function(e){o.getPushRules().then((function(n){o.pushRules=n,t(e)}),(function(n){t(e)}))}))})},I.prototype.searchMessageText=function(e,t){const n={search_term:e.query};return"keys"in e&&(n.keys=e.keys),this.search({body:{search_categories:{room_events:n}}},t)},I.prototype.searchRoomEvents=function(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:"recent",event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},n={_query:t,results:[],highlights:[]};return this.search({body:t}).then(this._processRoomEventsSearch.bind(this,n))},I.prototype.backPaginateRoomEventsSearch=function(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;const t={body:e._query,next_batch:e.next_batch},n=this.search(t).then(this._processRoomEventsSearch.bind(this,e)).finally((function(){e.pendingRequest=null}));return e.pendingRequest=n,n},I.prototype._processRoomEventsSearch=function(e,t){const n=t.search_categories.room_events;e.count=n.count,e.next_batch=n.next_batch;const o={};n.highlights.forEach((function(e){o[e]=1})),e.highlights.forEach((function(e){o[e]=1})),e.highlights=Object.keys(o);for(let t=0;te.admin)},I.prototype.whoisSynapseUser=function(e){const t=m.f("/_synapse/admin/v1/whois/$userId",{$userId:e});return this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:""})},I.prototype.deactivateSynapseUser=function(e){const t=m.f("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this._http.authedRequest(void 0,"POST",t,void 0,void 0,{prefix:""})},I.prototype.startClient=async function(e){if(this.clientRunning)return;this.clientRunning=!0,"number"==typeof e&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new x.a(t)),this._crypto&&(this._crypto.uploadDeviceKeys(),this._crypto.start()),function e(t){if(!t._supportsVoip)return;t.turnServer().then((function(n){if(n.uris){y.a.log("Got TURN URIs: "+n.uris+" refresh in "+n.ttl+" secs");const o={urls:n.uris,username:n.username,credential:n.password};t._turnServers=[o],t._checkTurnServersTimeoutID=setTimeout(()=>{e(t)},1e3*(n.ttl||3600)*.9)}}),(function(n){y.a.error("Failed to get TURN URIs"),t._checkTurnServersTimeoutID=setTimeout((function(){e(t)}),6e4)}))}(this),this._syncApi&&(y.a.error("Still have sync object whilst not running: stopping old one"),this._syncApi.stop()),(e=Object.assign({},e)).crypto=this._crypto,e.canResetEntireTimeline=e=>!!this._canResetTimelineCallback&&this._canResetTimelineCallback(e),this._clientOpts=e,this._syncApi=new c.a(this,e),this._syncApi.sync()},I.prototype._storeClientOptions=function(){const e=["boolean","string","number"],t=Object.entries(this._clientOpts).filter(([t,n])=>e.includes(typeof n)).reduce((e,[t,n])=>(e[t]=n,e),{});return this.store.storeClientOptions(t)},I.prototype.stopClient=function(){y.a.log("stopping MatrixClient"),this.clientRunning=!1,this._syncApi&&(this._syncApi.stop(),this._syncApi=null),this._crypto&&this._crypto.stop(),this._peekSync&&this._peekSync.stopPeeking(),e.clearTimeout(this._checkTurnServersTimeoutID)},I.prototype.getVersions=async function(){return null===this._serverVersionsCache&&(this._serverVersionsCache=await this._http.request(void 0,"GET","/_matrix/client/versions",void 0,void 0,{prefix:""})),this._serverVersionsCache},I.prototype.isVersionSupported=async function(e){const{versions:t}=await this.getVersions();return t&&t.includes(e)},I.prototype.doesServerSupportLazyLoading=async function(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,n=e.unstable_features;return t&&t.includes("r0.5.0")||n&&n["m.lazy_load_members"]},I.prototype.doesServerRequireIdServerParam=async function(){const e=await this.getVersions();if(!e)return!0;const t=e.versions;if(t&&t.includes("r0.6.0"))return!1;const n=e.unstable_features;return!n||(void 0===n["m.require_identity_server"]||n["m.require_identity_server"])},I.prototype.doesServerAcceptIdentityAccessToken=async function(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,n=e.unstable_features;return t&&t.includes("r0.6.0")||n&&n["m.id_access_token"]},I.prototype.doesServerSupportSeparateAddAndBind=async function(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,n=e.unstable_features;return t&&t.includes("r0.6.0")||n&&n["m.separate_add_and_bind"]},I.prototype.doesServerSupportUnstableFeature=async function(e){const t=await this.getVersions();if(!t)return!1;const n=t.unstable_features;return n&&!!n[e]},I.prototype.hasLazyLoadMembersEnabled=function(){return!!this._clientOpts.lazyLoadMembers},I.prototype.setCanResetTimelineCallback=function(e){this._canResetTimelineCallback=e},I.prototype.getCanResetTimelineCallback=function(){return this._canResetTimelineCallback},I.prototype.relations=async function(e,t,n,o,r={}){const i=function(e,t,n){return"m.reaction"===n?n:e.isRoomEncrypted(t)?"m.room.encrypted":n}(this,e,o),s=await this.fetchRelations(e,t,n,i,r),a=this.getEventMapper();let c;s.original_event&&(c=a(s.original_event));let l=s.chunk.map(a);if("m.room.encrypted"===i){const e=c?l.concat(c):l;await Promise.all(e.map(e=>new Promise(t=>e.once("Event.decrypted",t)))),l=l.filter(e=>e.getType()===o)}return{originalEvent:c,events:l,nextBatch:s.next_batch}},I.prototype.getEventMapper=function(e){return G(this,e)},I.prototype.getCrossSigningCacheCallbacks=function(){return this._crypto&&this._crypto._crossSigningInfo.getCacheCallbacks()},I.prototype.generateClientSecret=function(){return Object(T.a)(32)}}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(1),r=n(49);function i(e){this.groupId=e,this.name=null,this.avatarUrl=null,this.myMembership=null,this.inviter=null}o.o(i,r.EventEmitter),i.prototype.setProfile=function(e,t){this.name===e&&this.avatarUrl===t||(this.name=e||this.groupId,this.avatarUrl=t,this.emit("Group.profile",this))},i.prototype.setMyMembership=function(e){this.myMembership!==e&&(this.myMembership=e,this.emit("Group.myMembership",this))},i.prototype.setInviter=function(e){this.inviter=e}},function(e,t,n){"use strict";function o(e){Object.defineProperty(this,"deviceId",{enumerable:!0,value:e}),this.algorithms=[],this.keys={},this.verified=r.UNVERIFIED,this.known=!1,this.unsigned={},this.signatures={}}n.d(t,"a",(function(){return o})),o.fromStorage=function(e,t){const n=new o(t);for(const t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},o.prototype.toStorage=function(){return{algorithms:this.algorithms,keys:this.keys,verified:this.verified,known:this.known,unsigned:this.unsigned,signatures:this.signatures}},o.prototype.getFingerprint=function(){return this.keys["ed25519:"+this.deviceId]},o.prototype.getIdentityKey=function(){return this.keys["curve25519:"+this.deviceId]},o.prototype.getDisplayName=function(){return this.unsigned.device_display_name||null},o.prototype.isBlocked=function(){return this.verified==r.BLOCKED},o.prototype.isVerified=function(){return this.verified==r.VERIFIED},o.prototype.isUnverified=function(){return this.verified==r.UNVERIFIED},o.prototype.isKnown=function(){return 1==this.known},o.DeviceVerification={VERIFIED:1,UNVERIFIED:0,BLOCKED:-1};const r=o.DeviceVerification},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(536);Object.defineProperty(t,"DragDropContext",{enumerable:!0,get:function(){return s(o).default}});var r=n(619);Object.defineProperty(t,"Droppable",{enumerable:!0,get:function(){return s(r).default}});var i=n(640);function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Draggable",{enumerable:!0,get:function(){return s(i).default}})},function(e,t){e.exports=!0},function(e,t){var n=0,o=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+o).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(589),i=(o=r)&&o.__esModule?o:{default:o};t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0||(r[n]=e[n]);return r}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.preventDefault(),e.stopPropagation()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(0),r=n(57);class i{static get ERROR_INVALID(){return"Invalid homeserver discovery response"}static get ERROR_GENERIC_FAILURE(){return"Failed to get autodiscovery configuration from server"}static get ERROR_INVALID_HS_BASE_URL(){return"Invalid base_url for m.homeserver"}static get ERROR_INVALID_HOMESERVER(){return"Homeserver URL does not appear to be a valid Matrix homeserver"}static get ERROR_INVALID_IS_BASE_URL(){return"Invalid base_url for m.identity_server"}static get ERROR_INVALID_IDENTITY_SERVER(){return"Identity server URL does not appear to be a valid identity server"}static get ERROR_INVALID_IS(){return"Invalid identity server discovery response"}static get ERROR_MISSING_WELLKNOWN(){return"No .well-known JSON file found"}static get ERROR_INVALID_JSON(){return"Invalid JSON"}static get ALL_ERRORS(){return[i.ERROR_INVALID,i.ERROR_GENERIC_FAILURE,i.ERROR_INVALID_HS_BASE_URL,i.ERROR_INVALID_HOMESERVER,i.ERROR_INVALID_IS_BASE_URL,i.ERROR_INVALID_IDENTITY_SERVER,i.ERROR_INVALID_IS,i.ERROR_MISSING_WELLKNOWN,i.ERROR_INVALID_JSON]}static get FAIL_ERROR(){return"FAIL_ERROR"}static get FAIL_PROMPT(){return"FAIL_PROMPT"}static get PROMPT(){return"PROMPT"}static get SUCCESS(){return"SUCCESS"}static async fromDiscoveryConfig(e){const t={"m.homeserver":{state:i.FAIL_ERROR,error:i.ERROR_INVALID,base_url:null},"m.identity_server":{state:i.PROMPT,error:null,base_url:null}};if(!e||!e["m.homeserver"])return o.a.error("No m.homeserver key in config"),t["m.homeserver"].state=i.FAIL_PROMPT,t["m.homeserver"].error=i.ERROR_INVALID,Promise.resolve(t);if(!e["m.homeserver"].base_url)return o.a.error("No m.homeserver base_url in config"),t["m.homeserver"].state=i.FAIL_PROMPT,t["m.homeserver"].error=i.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const n=this._sanitizeWellKnownUrl(e["m.homeserver"].base_url);if(!n)return o.a.error("Invalid base_url for m.homeserver"),t["m.homeserver"].error=i.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const r=await this._fetchWellKnownObject(n+"/_matrix/client/versions");if(!r||!r.raw.versions)return o.a.error("Invalid /versions response"),t["m.homeserver"].error=i.ERROR_INVALID_HOMESERVER,t["m.homeserver"].base_url=n,Promise.resolve(t);t["m.homeserver"]={state:i.SUCCESS,error:null,base_url:n};let s="";if(e["m.identity_server"]){const n={"m.homeserver":t["m.homeserver"],"m.identity_server":{state:i.FAIL_PROMPT,error:i.ERROR_INVALID_IS,base_url:null}};if(s=this._sanitizeWellKnownUrl(e["m.identity_server"].base_url),!s)return o.a.error("Invalid base_url for m.identity_server"),n["m.identity_server"].error=i.ERROR_INVALID_IS_BASE_URL,Promise.resolve(n);const r=await this._fetchWellKnownObject(s+"/_matrix/identity/api/v1");if(!r||!r.raw||"SUCCESS"!==r.action)return o.a.error("Invalid /api/v1 response"),n["m.identity_server"].error=i.ERROR_INVALID_IDENTITY_SERVER,n["m.identity_server"].base_url=s,Promise.resolve(n)}return s&&s.length>0&&(t["m.identity_server"]={state:i.SUCCESS,error:null,base_url:s}),Object.keys(e).map(n=>{if("m.homeserver"===n||"m.identity_server"===n){const o=["error","state","base_url"];for(const r of Object.keys(e[n]))o.includes(r)||(t[n][r]=e[n][r])}else t[n]=e[n]}),Promise.resolve(t)}static async findClientConfig(e){if(!e||"string"!=typeof e||0===e.length)throw new Error("'domain' must be a string of non-zero length");const t={"m.homeserver":{state:i.FAIL_ERROR,error:i.ERROR_INVALID,base_url:null},"m.identity_server":{state:i.PROMPT,error:null,base_url:null}},n=await this._fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return n&&"SUCCESS"===n.action?i.fromDiscoveryConfig(n.raw):(o.a.error("No response or error when parsing .well-known"),n.reason&&o.a.error(n.reason),"IGNORE"===n.action?t["m.homeserver"]={state:i.PROMPT,error:null,base_url:null}:(t["m.homeserver"].state=i.FAIL_PROMPT,t["m.homeserver"].error=i.ERROR_INVALID),Promise.resolve(t))}static async getRawClientConfig(e){if(!e||"string"!=typeof e||0===e.length)throw new Error("'domain' must be a string of non-zero length");const t=await this._fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return t&&t.raw||{}}static _sanitizeWellKnownUrl(e){if(!e)return!1;try{let t=null;try{t=r.URL?new r.URL(e):new URL(e)}catch(n){t=new URL(e)}if(!t||!t.hostname)return!1;if("http:"!==t.protocol&&"https:"!==t.protocol)return!1;const n=t.port?":"+t.port:"",o=t.pathname?t.pathname:"";let i=`${t.protocol}//${t.hostname}${n}${o}`;return i.endsWith("/")&&(i=i.substring(0,i.length-1)),i}catch(e){return o.a.error(e),!1}}static async _fetchWellKnownObject(e){return new Promise((function(t,o){const r=n(119).getRequest();if(!r)throw new Error("No request library available");r({method:"GET",uri:e,timeout:5e3},(e,n,o)=>{if(e||n&&(n.statusCode<200||n.statusCode>=300)){let o="FAIL_PROMPT",r=(e?e.message:null)||"General failure";return n&&404===n.statusCode&&(o="IGNORE",r=i.ERROR_MISSING_WELLKNOWN),void t({raw:{},action:o,reason:r,error:e})}try{t({raw:JSON.parse(o),action:"SUCCESS"})}catch(e){let n=i.ERROR_INVALID;"SyntaxError"===e.name&&(n=i.ERROR_INVALID_JSON),t({raw:{},action:"FAIL_PROMPT",reason:n,error:e})}})}))}}},function(e,t,n){var o=n(120)(Object,"create");e.exports=o},function(e,t,n){var o=n(693),r=n(694),i=n(695),s=n(696),a=n(697);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t!s.includes(e)),c=s.filter(e=>!o.includes(e));if(a.length||c.length){if(r!==n)return Object(i.a)("%(senderName)s changed the main and alternative addresses for this room.",{senderName:t});if(c.length&&!a.length)return Object(i.a)("%(senderName)s added the alternative addresses %(addresses)s for this room.",{senderName:t,addresses:c.join(", "),count:c.length});if(a.length&&!c.length)return Object(i.a)("%(senderName)s removed the alternative addresses %(addresses)s for this room.",{senderName:t,addresses:a.join(", "),count:a.length});if(a.length&&c.length)return Object(i.a)("%(senderName)s changed the alternative addresses for this room.",{senderName:t})}else{if(r)return Object(i.a)("%(senderName)s set the main address for this room to %(address)s.",{senderName:t,address:e.getContent().alias});if(n)return Object(i.a)("%(senderName)s removed the main address for this room.",{senderName:t})}return Object(i.a)("%(senderName)s changed the addresses for this room.",{senderName:t})},"m.room.name":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();return e.getContent().name&&0!==e.getContent().name.trim().length?e.getPrevContent().name?Object(i.a)("%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.",{senderDisplayName:t,oldRoomName:e.getPrevContent().name,newRoomName:e.getContent().name}):Object(i.a)("%(senderDisplayName)s changed the room name to %(roomName)s.",{senderDisplayName:t,roomName:e.getContent().name}):Object(i.a)("%(senderDisplayName)s removed the room name.",{senderDisplayName:t})},"m.room.topic":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();return Object(i.a)('%(senderDisplayName)s changed the topic to "%(topic)s".',{senderDisplayName:t,topic:e.getContent().topic})},"m.room.member":function(e){const t=e.sender?e.sender.name:e.getSender(),n=e.target?e.target.name:e.getStateKey(),o=e.getPrevContent(),s=e.getContent(),a=r.a.getConferenceHandler(),l=s.reason?Object(i.a)("Reason")+": "+s.reason:"";switch(s.membership){case"invite":{const o=s.third_party_invite;return o?o.display_name?Object(i.a)("%(targetName)s accepted the invitation for %(displayName)s.",{targetName:n,displayName:o.display_name}):Object(i.a)("%(targetName)s accepted an invitation.",{targetName:n}):a&&a.isConferenceUser(e.getStateKey())?Object(i.a)("%(senderName)s requested a VoIP conference.",{senderName:t}):Object(i.a)("%(senderName)s invited %(targetName)s.",{senderName:t,targetName:n})}case"ban":return Object(i.a)("%(senderName)s banned %(targetName)s.",{senderName:t,targetName:n})+" "+l;case"join":return o&&"join"===o.membership?o.displayname&&s.displayname&&o.displayname!==s.displayname?Object(i.a)("%(oldDisplayName)s changed their display name to %(displayName)s.",{oldDisplayName:o.displayname,displayName:s.displayname}):!o.displayname&&s.displayname?Object(i.a)("%(senderName)s set their display name to %(displayName)s.",{senderName:e.getSender(),displayName:s.displayname}):o.displayname&&!s.displayname?Object(i.a)("%(senderName)s removed their display name (%(oldDisplayName)s).",{senderName:t,oldDisplayName:o.displayname}):o.avatar_url&&!s.avatar_url?Object(i.a)("%(senderName)s removed their profile picture.",{senderName:t}):o.avatar_url&&s.avatar_url&&o.avatar_url!==s.avatar_url?Object(i.a)("%(senderName)s changed their profile picture.",{senderName:t}):!o.avatar_url&&s.avatar_url?Object(i.a)("%(senderName)s set a profile picture.",{senderName:t}):c.b.getValue("showHiddenEventsInTimeline")?Object(i.a)("%(senderName)s made no change.",{senderName:t}):"":(e.target||console.warn("Join message has no target! -- "+e.getContent().state_key),a&&a.isConferenceUser(e.getStateKey())?Object(i.a)("VoIP conference started."):Object(i.a)("%(targetName)s joined the room.",{targetName:n}));case"leave":return e.getSender()===e.getStateKey()?a&&a.isConferenceUser(e.getStateKey())?Object(i.a)("VoIP conference finished."):"invite"===o.membership?Object(i.a)("%(targetName)s rejected the invitation.",{targetName:n}):Object(i.a)("%(targetName)s left the room.",{targetName:n}):"ban"===o.membership?Object(i.a)("%(senderName)s unbanned %(targetName)s.",{senderName:t,targetName:n}):"invite"===o.membership?Object(i.a)("%(senderName)s withdrew %(targetName)s's invitation.",{senderName:t,targetName:n})+" "+l:Object(i.a)("%(senderName)s kicked %(targetName)s.",{senderName:t,targetName:n})+" "+l}},"m.room.third_party_invite":function(e){const t=e.sender?e.sender.name:e.getSender();if(!Object(a.c)(e)){const n=e.getPrevContent().display_name||Object(i.a)("Someone");return Object(i.a)("%(senderName)s revoked the invitation for %(targetDisplayName)s to join the room.",{senderName:t,targetDisplayName:n})}return Object(i.a)("%(senderName)s sent an invitation to %(targetDisplayName)s to join the room.",{senderName:t,targetDisplayName:e.getContent().display_name})},"m.room.history_visibility":function(e){const t=e.sender?e.sender.name:e.getSender();switch(e.getContent().history_visibility){case"invited":return Object(i.a)("%(senderName)s made future room history visible to all room members, from the point they are invited.",{senderName:t});case"joined":return Object(i.a)("%(senderName)s made future room history visible to all room members, from the point they joined.",{senderName:t});case"shared":return Object(i.a)("%(senderName)s made future room history visible to all room members.",{senderName:t});case"world_readable":return Object(i.a)("%(senderName)s made future room history visible to anyone.",{senderName:t});default:return Object(i.a)("%(senderName)s made future room history visible to unknown (%(visibility)s).",{senderName:t,visibility:e.getContent().history_visibility})}},"m.room.power_levels":function(e){const t=e.sender?e.sender.name:e.getSender();if(!(e.getPrevContent()&&e.getPrevContent().users&&e.getContent()&&e.getContent().users))return"";const n=e.getContent().users_default||0,o=[];Object.keys(e.getContent().users).forEach(e=>{-1===o.indexOf(e)&&o.push(e)}),Object.keys(e.getPrevContent().users).forEach(e=>{-1===o.indexOf(e)&&o.push(e)});const r=[];return o.forEach(t=>{const o=e.getPrevContent().users[t],a=e.getContent().users[t];a!==o&&r.push(Object(i.a)("%(userId)s from %(fromPowerLevel)s to %(toPowerLevel)s",{userId:t,fromPowerLevel:s.b(o,n),toPowerLevel:s.b(a,n)}))}),r.length?Object(i.a)("%(senderName)s changed the power level of %(powerLevelDiffText)s.",{senderName:t,powerLevelDiffText:r.join(", ")}):""},"m.room.pinned_events":function(e){const t=e.sender?e.sender.name:e.getSender();return Object(i.a)("%(senderName)s changed the pinned messages for the room.",{senderName:t})},"m.room.server_acl":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender(),n=e.getPrevContent(),o=[],r=e.getContent(),i={deny:Array.isArray(n.deny)?n.deny:[],allow:Array.isArray(n.allow)?n.allow:[],allow_ip_literals:!(!1===n.allow_ip_literals)};let s="";if(s=0===i.deny.length&&0===i.allow.length?t+" set server ACLs for this room: ":t+" changed the server ACLs for this room: ",Array.isArray(r.allow)||(r.allow=[]),0===r.allow.length)return s+"🎉 All servers are banned from participating! This room can no longer be used.";Array.isArray(r.deny)||(r.deny=[]);const a=r.deny.filter(e=>"string"==typeof e&&!i.deny.includes(e)),c=i.deny.filter(e=>"string"==typeof e&&!r.deny.includes(e)),l=r.allow.filter(e=>"string"==typeof e&&!i.allow.includes(e)),u=i.allow.filter(e=>"string"==typeof e&&!r.allow.includes(e));if(a.length>0&&o.push(`Servers matching ${a.join(", ")} are now banned.`),c.length>0&&o.push(`Servers matching ${c.join(", ")} were removed from the ban list.`),l.length>0&&o.push(`Servers matching ${l.join(", ")} are now allowed.`),u.length>0&&o.push(`Servers matching ${u.join(", ")} were removed from the allowed list.`),i.allow_ip_literals!==r.allow_ip_literals){const e=r.allow_ip_literals?"allowed":"banned";o.push(`Participating from a server using an IP literal hostname is now ${e}.`)}return s+o.join(" ")},"m.room.tombstone":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();return Object(i.a)("%(senderDisplayName)s upgraded this room.",{senderDisplayName:t})},"m.room.join_rules":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();switch(e.getContent().join_rule){case"public":return Object(i.a)("%(senderDisplayName)s made the room public to whoever knows the link.",{senderDisplayName:t});case"invite":return Object(i.a)("%(senderDisplayName)s made the room invite only.",{senderDisplayName:t});default:return Object(i.a)("%(senderDisplayName)s changed the join rule to %(rule)s",{senderDisplayName:t,rule:e.getContent().join_rule})}},"m.room.guest_access":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();switch(e.getContent().guest_access){case"can_join":return Object(i.a)("%(senderDisplayName)s has allowed guests to join the room.",{senderDisplayName:t});case"forbidden":return Object(i.a)("%(senderDisplayName)s has prevented guests from joining the room.",{senderDisplayName:t});default:return Object(i.a)("%(senderDisplayName)s changed guest access to %(rule)s",{senderDisplayName:t,rule:e.getContent().guest_access})}},"m.room.related_groups":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender(),n=e.getContent().groups||[],o=e.getPrevContent().groups||[],r=n.filter(e=>!o.includes(e)),s=o.filter(e=>!n.includes(e));return r.length&&!s.length?Object(i.a)("%(senderDisplayName)s enabled flair for %(groups)s in this room.",{senderDisplayName:t,groups:r.join(", ")}):!r.length&&s.length?Object(i.a)("%(senderDisplayName)s disabled flair for %(groups)s in this room.",{senderDisplayName:t,groups:s.join(", ")}):r.length&&s.length?Object(i.a)("%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for %(oldGroups)s in this room.",{senderDisplayName:t,newGroups:r.join(", "),oldGroups:s.join(", ")}):""},"im.vector.modular.widgets":function(e){const t=e.getSender(),{name:n,type:o,url:r}=e.getPrevContent(),{name:s,type:a,url:c}=e.getContent()||{};let l=s||n||a||o||"";return l&&l.length>0&&(l=l[0].toUpperCase()+l.slice(1)+" "),c?r?Object(i.a)("%(widgetName)s widget modified by %(senderName)s",{widgetName:l,senderName:t}):Object(i.a)("%(widgetName)s widget added by %(senderName)s",{widgetName:l,senderName:t}):Object(i.a)("%(widgetName)s widget removed by %(senderName)s",{widgetName:l,senderName:t})}};for(const e of l.a)h[e]=u;function p(e){const t=(e.isState()?h:d)[e.getType()];return t?t(e):""}},function(e,t,n){"use strict";var o=n(49),r=n.n(o);n(107);class i extends r.a{constructor(){super(),this._roomWidgetEcho={}}getEchoedRoomWidgets(e,t){const n=[],o=Object.assign({},this._roomWidgetEcho[e]);for(const e of t){const t=e.getStateKey();o[t]&&0===Object.keys(o[t]).length||n.push(e),delete o[t]}return n}roomHasPendingWidgetsOfType(e,t,n){const o=Object.assign({},this._roomWidgetEcho[e]);for(const e of t){delete o[e.getStateKey()]}return void 0===n?Object.keys(o).length>0:Object.values(o).some(e=>n.matches(e.type))}roomHasPendingWidgets(e,t){return this.roomHasPendingWidgetsOfType(e,t)}setRoomWidgetEcho(e,t,n){void 0===this._roomWidgetEcho[e]&&(this._roomWidgetEcho[e]={}),this._roomWidgetEcho[e][t]=n,this.emit("update")}removeRoomWidgetEcho(e,t){delete this._roomWidgetEcho[e][t],0===Object.keys(this._roomWidgetEcho[e]).length&&delete this._roomWidgetEcho[e],this.emit("update")}}let s=null;s||(s=new i),t.a=s},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return c})),n.d(t,"g",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return m}));var o=n(3),r=n.n(o),i=n(490),s=n(37);const a="m.room.rule.user",c="m.room.rule.server",l=[a,"org.matrix.mjolnir.rule.user"],u=["m.room.rule.room","org.matrix.mjolnir.rule.room"],d=[c,"org.matrix.mjolnir.rule.server"],h=[...l,...u,...d];function p(e,t=!0){return l.includes(e)?t?l[l.length-1]:a:u.includes(e)?t?u[u.length-1]:"m.room.rule.room":d.includes(e)?t?d[d.length-1]:c:null}class m{constructor(e){r()(this,"_rules",[]),r()(this,"_roomId",void 0),this._roomId=e,this.updateList()}get roomId(){return this._roomId}get serverRules(){return this._rules.filter(e=>e.kind===c)}get userRules(){return this._rules.filter(e=>e.kind===a)}get roomRules(){return this._rules.filter(e=>"m.room.rule.room"===e.kind)}async banEntity(e,t,n){await s.a.get().sendStateEvent(this._roomId,p(e,!0),{entity:t,reason:n,recommendation:Object(i.c)(i.b,!0)},"rule:"+t),this._rules.push(new i.a(t,i.b,n,p(e,!1)))}async unbanEntity(e,t){await s.a.get().sendStateEvent(this._roomId,p(e,!0),{},"rule:"+t),this._rules=this._rules.filter(n=>n.kind!==p(e,!1)||n.entity!==t)}updateList(){this._rules=[];const e=s.a.get().getRoom(this._roomId);if(e)for(const t of h){const n=e.currentState.getStateEvents(t,void 0);for(const e of n){if(!e.getStateKey())continue;const n=p(t,!1),o=e.getContent().entity,r=e.getContent().recommendation,s=e.getContent().reason;o&&r&&s&&this._rules.push(new i.a(o,r,s,n))}}}}},function(e,t,n){"use strict";function o(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let o=0;o{const t=["mx_ResizeHandle"];return e.vertical?t.push("mx_ResizeHandle_vertical"):t.push("mx_ResizeHandle_horizontal"),e.reverse&&t.push("mx_ResizeHandle_reverse"),r.a.createElement("div",{className:t.join(" "),"data-id":e.id},r.a.createElement("div",null))};a.propTypes={vertical:s.a.bool,reverse:s.a.bool,id:s.a.string},t.a=a},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(301),r=n(412);class i{static createItem(e,t,n){return new o.a(e,t,n)}static createSizer(e,t,n){return new r.a(e,t,n)}constructor(e){this.item=e,this.beforeOffset=e.offset()}resize(e){this.item.setSize(e)}resizeFromContainerOffset(e){this.resize(e-this.beforeOffset)}start(){}finish(){}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var o=n(44);class r{constructor(e,t,n,o){this._hsUrl=e,this._isUrl=t,this._fallbackHsUrl=n,this._currentFlowIndex=0,this._flows=[],this._defaultDeviceDisplayName=o.defaultDeviceDisplayName,this._tempClient=null}getHomeserverUrl(){return this._hsUrl}getIdentityServerUrl(){return this._isUrl}setHomeserverUrl(e){this._tempClient=null,this._hsUrl=e}setIdentityServerUrl(e){this._tempClient=null,this._isUrl=e}createTemporaryClient(){return this._tempClient?this._tempClient:this._tempClient=o.s.createClient({baseUrl:this._hsUrl,idBaseUrl:this._isUrl})}getFlows(){const e=this;return this.createTemporaryClient().loginFlows().then((function(t){return e._flows=t.flows,e._currentFlowIndex=0,e._flows}))}chooseFlow(e){this._currentFlowIndex=e}getCurrentFlowStep(){const e=this._flows[this._currentFlowIndex];return e?e.type:null}loginViaPassword(e,t,n,o){const r=this,s=e.indexOf("@")>0;let a;a=t&&n?{type:"m.id.phone",country:t,number:n}:s?{type:"m.id.thirdparty",medium:"email",address:e}:{type:"m.id.user",user:e};const c={password:o,identifier:a,initial_device_display_name:this._defaultDeviceDisplayName},l=e=>i(r._fallbackHsUrl,this._isUrl,"m.login.password",c).catch(t=>{throw console.log("fallback HS login failed",t),e});let u=null;return i(r._hsUrl,r._isUrl,"m.login.password",c).catch(e=>{if(u=e,403===e.httpStatus&&r._fallbackHsUrl)return l(u);throw u}).catch(e=>{throw console.log("Login failed",e),e})}}async function i(e,t,n,r){const i=o.s.createClient({baseUrl:e,idBaseUrl:t}),s=await i.login(n,r),a=s.well_known;return a&&(a["m.homeserver"]&&a["m.homeserver"].base_url&&(e=a["m.homeserver"].base_url,console.log(`Overrode homeserver setting with ${e} from login response`)),a["m.identity_server"]&&a["m.identity_server"].base_url&&(t=a["m.identity_server"].base_url,console.log(`Overrode IS setting with ${t} from login response`))),{homeserverUrl:e,identityServerUrl:t,userId:s.user_id,deviceId:s.device_id,accessToken:s.access_token}}},function(e,t,n){(function(n){var o,r,i,s,a,c,l,u,d,h,p,m,g,_,f,v,b,E,y,S,C,w,T,k;!function(x){var O="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:{};function R(e,t){return e!==O&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(n,o){return e[n]=t?t(n,o):o}}void 0===(o=function(e){var t,n;t=R(O,R(e)),n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r=function(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,n,s):r(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},c=function(e,t){return function(n,o){t(n,o,e)}},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},u=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))},d=function(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},m=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s},g=function(){for(var e=[],t=0;t1||a(e,t)}))})}function a(e,t){try{(n=r[e](t)).value instanceof f?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}},b=function(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:f(e[o](t)),done:"return"===o}:r?r(t):t}:r}},E=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}},y=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},S=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},C=function(e){return e&&e.__esModule?e:{default:e}},w=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},T=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},t("__extends",r),t("__assign",i),t("__rest",s),t("__decorate",a),t("__param",c),t("__metadata",l),t("__awaiter",u),t("__generator",d),t("__exportStar",h),t("__createBinding",k),t("__values",p),t("__read",m),t("__spread",g),t("__spreadArrays",_),t("__await",f),t("__asyncGenerator",v),t("__asyncDelegator",b),t("__asyncValues",E),t("__makeTemplateObject",y),t("__importStar",S),t("__importDefault",C),t("__classPrivateFieldGet",w),t("__classPrivateFieldSet",T)}.apply(t,[t]))||(e.exports=o)}()}).call(this,n(17))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deferAction=function(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)},t.inlineProp=void 0;t.inlineProp=function(e,t){var n={};return n[e]=t,n}},function(e,t){e.exports="img/e2e/warning.2d79aff.svg"},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var o=n(34),r=n(157),i=n(40),s=n(315);const a="light";function c(){const e={light:Object(o.a)("Light theme"),dark:Object(o.a)("Dark theme")},t=i.b.getValue("custom_themes"),n={};for(const{name:e}of t)n["custom-"+e]=e;return Object.assign({},n,e)}async function l(t){if(!t){const e=new s.a;t=e.getEffectiveTheme()}let n=t;if(t.startsWith("custom-")){const e=function(e){const t=i.b.getValue("custom_themes");if(!t)throw new Error(`No custom themes set, can't set custom theme "${e}"`);const n=t.find(t=>t.name===e);if(!n){const n=t.map(e=>e.name).join(", ");throw new Error(`Can't find custom theme "${e}", only know ${n}`)}return n}(t.substr(7));n=e.is_dark?"dark-custom":"light-custom",function(e){const{style:t}=document.body;function n(e,n,o=!0){t.setProperty("--"+e,n),o&&(t.setProperty(`--${e}-0pct`,n+"00"),t.setProperty(`--${e}-15pct`,n+"26"),t.setProperty(`--${e}-50pct`,n+"7F"))}if(e.colors)for(const[t,o]of Object.entries(e.colors))if(Array.isArray(o))for(let e=0;e{const s=function(){o[n].disabled=!1,Object.values(o).forEach(e=>{e!=o[n]&&(e.disabled=!0)});const s=e.getComputedStyle(document.getElementsByTagName("body")[0]);s.backgroundColor&&(document.querySelector('meta[name="theme-color"]').content=s.backgroundColor),r.a.setTheme(t),i()};let a=!1;o[n].onload=()=>{s()};for(let e=0;et||!!e,invalid:()=>Object(d.a)(this.props.labelEnterPassword)},{key:"complexity",test:async function({value:e}){if(!e)return!1;const{scorePassword:t}=await n.e(18).then(n.bind(null,1184)),o=t(e);this.setState({complexity:o});const r=o.score>=this.props.minScore;return l.a.get().dangerously_allow_unsafe_and_insecure_passwords||r},valid:function(){return this.state.complexity.score>=this.props.minScore?Object(d.a)(this.props.labelStrongPassword):Object(d.a)(this.props.labelAllowedButUnsafe)},invalid:function(){const e=this.state.complexity;if(!e)return null;const{feedback:t}=e;return t.warning||t.suggestions[0]||Object(d.a)("Keep going...")}}]})),r()(this,"onValidate",async e=>{const t=await this.validate(e);return this.props.onValidate(t),t})}render(){return s.a.createElement(h.a,{id:this.props.id,autoFocus:this.props.autoFocus,className:c()("mx_PassphraseField",this.props.className),ref:this.props.fieldRef,type:"password",autoComplete:"new-password",label:Object(d.a)(this.props.label),value:this.props.value,onChange:this.props.onChange,onValidate:this.onValidate})}}r()(p,"defaultProps",{label:Object(d.b)("Password"),labelEnterPassword:Object(d.b)("Enter password"),labelStrongPassword:Object(d.b)("Nice, strong password!"),labelAllowedButUnsafe:Object(d.b)("Password is allowed, but unsafe")}),t.a=p},function(e,t,n){"use strict";async function o(e){try{if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0;{const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t);const n=document.getSelection(),o=document.createRange();o.selectNode(t),n.removeAllRanges(),n.addRange(o);const r=document.execCommand("copy");return n.removeAllRanges(),document.body.removeChild(t),r}}catch(e){console.error("copyPlaintext failed",e)}return!1}function r(e){const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}function i(e){return r(e),document.execCommand("copy")}n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return i}))},function(e,t,n){var o=n(403),r=n(324);e.exports=function(e){return null!=e&&r(e.length)&&!o(e)}},function(e,t,n){var o=n(194);e.exports=function(e){if("string"==typeof e||o(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";t.__esModule=!0,t.inherits=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=Object.create(e.prototype);for(var r in n)o[r]=n[r];return o.constructor=t,t.prototype=o,t}},function(e,t,n){"use strict";const o=n(874),r=n(329),i=n(875),s=n(330),a=r.CODE_POINTS,c=r.CODE_POINT_SEQUENCES,l={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},u="DATA_STATE";function d(e){return e===a.SPACE||e===a.LINE_FEED||e===a.TABULATION||e===a.FORM_FEED}function h(e){return e>=a.DIGIT_0&&e<=a.DIGIT_9}function p(e){return e>=a.LATIN_CAPITAL_A&&e<=a.LATIN_CAPITAL_Z}function m(e){return e>=a.LATIN_SMALL_A&&e<=a.LATIN_SMALL_Z}function g(e){return m(e)||p(e)}function _(e){return g(e)||h(e)}function f(e){return e>=a.LATIN_CAPITAL_A&&e<=a.LATIN_CAPITAL_F}function v(e){return e>=a.LATIN_SMALL_A&&e<=a.LATIN_SMALL_F}function b(e){return e+32}function E(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function y(e){return String.fromCharCode(b(e))}function S(e,t){const n=i[++e];let o=++e,r=o+n-1;for(;o<=r;){const e=o+r>>>1,s=i[e];if(st))return i[e+n];r=e-1}}return-1}class C{constructor(){this.preprocessor=new o,this.tokenQueue=[],this.allowCDATA=!1,this.state=u,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume()}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t)}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:C.HIBERNATION_TOKEN}),!0}return!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}_reconsumeInState(e){this.state=e,this._unconsume()}_consumeSequenceIfMatch(e,t,n){let o=0,r=!0;const i=e.length;let s=0,c=t,l=void 0;for(;s0&&(c=this._consume(),o++),c===a.EOF){r=!1;break}if(l=e[s],c!==l&&(n||c!==b(l))){r=!1;break}}if(!r)for(;o--;)this._unconsume();return r}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==c.SCRIPT_STRING.length)return!1;for(let e=0;e0&&this._err(s.endTagWithAttributes),e.selfClosing&&this._err(s.endTagWithTrailingSolidus)),this.tokenQueue.push(e)}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken()}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}_emitCodePoint(e){let t=C.CHARACTER_TOKEN;d(e)?t=C.WHITESPACE_CHARACTER_TOKEN:e===a.NULL&&(t=C.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,E(e))}_emitSeveralCodePoints(e){for(let t=0;t-1;){const e=i[o],r=e<7;r&&1&e&&(t=2&e?[i[++o],i[++o]]:[i[++o]],n=0);const s=this._consume();if(this.tempBuff.push(s),n++,s===a.EOF)break;o=r?4&e?S(o,s):-1:s===e?++o:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return"ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_UNQUOTED_STATE"===this.returnState}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===a.EQUALS_SIGN||_(e)}return!1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e")):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitChars(r.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitCodePoint(e))}SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE(e){e===a.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE"):g(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE")):(this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE"))}SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE(e){g(e)?(this._createEndTagToken(),this._reconsumeInState("SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE")):(this._emitChars("")):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitChars(r.REPLACEMENT_CHARACTER)):e===a.EOF?(this._err(s.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e))}SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE(e){e===a.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",this._emitChars("/")):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE(e){d(e)||e===a.SOLIDUS||e===a.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?"SCRIPT_DATA_ESCAPED_STATE":"SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e)):p(e)?(this.tempBuff.push(b(e)),this._emitCodePoint(e)):m(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}BEFORE_ATTRIBUTE_NAME_STATE(e){d(e)||(e===a.SOLIDUS||e===a.GREATER_THAN_SIGN||e===a.EOF?this._reconsumeInState("AFTER_ATTRIBUTE_NAME_STATE"):e===a.EQUALS_SIGN?(this._err(s.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state="ATTRIBUTE_NAME_STATE"):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}ATTRIBUTE_NAME_STATE(e){d(e)||e===a.SOLIDUS||e===a.GREATER_THAN_SIGN||e===a.EOF?(this._leaveAttrName("AFTER_ATTRIBUTE_NAME_STATE"),this._unconsume()):e===a.EQUALS_SIGN?this._leaveAttrName("BEFORE_ATTRIBUTE_VALUE_STATE"):p(e)?this.currentAttr.name+=y(e):e===a.QUOTATION_MARK||e===a.APOSTROPHE||e===a.LESS_THAN_SIGN?(this._err(s.unexpectedCharacterInAttributeName),this.currentAttr.name+=E(e)):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.name+=r.REPLACEMENT_CHARACTER):this.currentAttr.name+=E(e)}AFTER_ATTRIBUTE_NAME_STATE(e){d(e)||(e===a.SOLIDUS?this.state="SELF_CLOSING_START_TAG_STATE":e===a.EQUALS_SIGN?this.state="BEFORE_ATTRIBUTE_VALUE_STATE":e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}BEFORE_ATTRIBUTE_VALUE_STATE(e){d(e)||(e===a.QUOTATION_MARK?this.state="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE":e===a.APOSTROPHE?this.state="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE":e===a.GREATER_THAN_SIGN?(this._err(s.missingAttributeValue),this.state=u,this._emitCurrentToken()):this._reconsumeInState("ATTRIBUTE_VALUE_UNQUOTED_STATE"))}ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE(e){e===a.QUOTATION_MARK?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===a.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=r.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=E(e)}ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE(e){e===a.APOSTROPHE?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===a.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=r.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=E(e)}ATTRIBUTE_VALUE_UNQUOTED_STATE(e){d(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===a.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_UNQUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===a.GREATER_THAN_SIGN?(this._leaveAttrValue(u),this._emitCurrentToken()):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentAttr.value+=r.REPLACEMENT_CHARACTER):e===a.QUOTATION_MARK||e===a.APOSTROPHE||e===a.LESS_THAN_SIGN||e===a.EQUALS_SIGN||e===a.GRAVE_ACCENT?(this._err(s.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=E(e)):e===a.EOF?(this._err(s.eofInTag),this._emitEOFToken()):this.currentAttr.value+=E(e)}AFTER_ATTRIBUTE_VALUE_QUOTED_STATE(e){d(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===a.SOLIDUS?this._leaveAttrValue("SELF_CLOSING_START_TAG_STATE"):e===a.GREATER_THAN_SIGN?(this._leaveAttrValue(u),this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._err(s.missingWhitespaceBetweenAttributes),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}SELF_CLOSING_START_TAG_STATE(e){e===a.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInTag),this._emitEOFToken()):(this._err(s.unexpectedSolidusInTag),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}BOGUS_COMMENT_STATE(e){e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.data+=r.REPLACEMENT_CHARACTER):this.currentToken.data+=E(e)}MARKUP_DECLARATION_OPEN_STATE(e){this._consumeSequenceIfMatch(c.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state="COMMENT_START_STATE"):this._consumeSequenceIfMatch(c.DOCTYPE_STRING,e,!1)?this.state="DOCTYPE_STATE":this._consumeSequenceIfMatch(c.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state="CDATA_SECTION_STATE":(this._err(s.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state="BOGUS_COMMENT_STATE"):this._ensureHibernation()||(this._err(s.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState("BOGUS_COMMENT_STATE"))}COMMENT_START_STATE(e){e===a.HYPHEN_MINUS?this.state="COMMENT_START_DASH_STATE":e===a.GREATER_THAN_SIGN?(this._err(s.abruptClosingOfEmptyComment),this.state=u,this._emitCurrentToken()):this._reconsumeInState("COMMENT_STATE")}COMMENT_START_DASH_STATE(e){e===a.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===a.GREATER_THAN_SIGN?(this._err(s.abruptClosingOfEmptyComment),this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}COMMENT_STATE(e){e===a.HYPHEN_MINUS?this.state="COMMENT_END_DASH_STATE":e===a.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state="COMMENT_LESS_THAN_SIGN_STATE"):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.data+=r.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=E(e)}COMMENT_LESS_THAN_SIGN_STATE(e){e===a.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state="COMMENT_LESS_THAN_SIGN_BANG_STATE"):e===a.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState("COMMENT_STATE")}COMMENT_LESS_THAN_SIGN_BANG_STATE(e){e===a.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE":this._reconsumeInState("COMMENT_STATE")}COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE(e){e===a.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE":this._reconsumeInState("COMMENT_END_DASH_STATE")}COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE(e){e!==a.GREATER_THAN_SIGN&&e!==a.EOF&&this._err(s.nestedComment),this._reconsumeInState("COMMENT_END_STATE")}COMMENT_END_DASH_STATE(e){e===a.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===a.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}COMMENT_END_STATE(e){e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EXCLAMATION_MARK?this.state="COMMENT_END_BANG_STATE":e===a.HYPHEN_MINUS?this.currentToken.data+="-":e===a.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState("COMMENT_STATE"))}COMMENT_END_BANG_STATE(e){e===a.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state="COMMENT_END_DASH_STATE"):e===a.GREATER_THAN_SIGN?(this._err(s.incorrectlyClosedComment),this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState("COMMENT_STATE"))}DOCTYPE_STATE(e){d(e)?this.state="BEFORE_DOCTYPE_NAME_STATE":e===a.GREATER_THAN_SIGN?this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"):e===a.EOF?(this._err(s.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingWhitespaceBeforeDoctypeName),this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"))}BEFORE_DOCTYPE_NAME_STATE(e){d(e)||(p(e)?(this._createDoctypeToken(y(e)),this.state="DOCTYPE_NAME_STATE"):e===a.NULL?(this._err(s.unexpectedNullCharacter),this._createDoctypeToken(r.REPLACEMENT_CHARACTER),this.state="DOCTYPE_NAME_STATE"):e===a.GREATER_THAN_SIGN?(this._err(s.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(s.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(E(e)),this.state="DOCTYPE_NAME_STATE"))}DOCTYPE_NAME_STATE(e){d(e)?this.state="AFTER_DOCTYPE_NAME_STATE":e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):p(e)?this.currentToken.name+=y(e):e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.name+=r.REPLACEMENT_CHARACTER):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=E(e)}AFTER_DOCTYPE_NAME_STATE(e){d(e)||(e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(c.PUBLIC_STRING,e,!1)?this.state="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE":this._consumeSequenceIfMatch(c.SYSTEM_STRING,e,!1)?this.state="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE":this._ensureHibernation()||(this._err(s.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE(e){d(e)?this.state="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===a.QUOTATION_MARK?(this._err(s.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===a.APOSTROPHE?(this._err(s.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===a.GREATER_THAN_SIGN?(this._err(s.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE(e){d(e)||(e===a.QUOTATION_MARK?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===a.APOSTROPHE?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===a.GREATER_THAN_SIGN?(this._err(s.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE(e){e===a.QUOTATION_MARK?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.publicId+=r.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(s.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=E(e)}DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE(e){e===a.APOSTROPHE?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.publicId+=r.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(s.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=E(e)}AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE(e){d(e)?this.state="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE":e===a.GREATER_THAN_SIGN?(this.state=u,this._emitCurrentToken()):e===a.QUOTATION_MARK?(this._err(s.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===a.APOSTROPHE?(this._err(s.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE(e){d(e)||(e===a.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=u):e===a.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===a.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE(e){d(e)?this.state="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===a.QUOTATION_MARK?(this._err(s.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===a.APOSTROPHE?(this._err(s.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===a.GREATER_THAN_SIGN?(this._err(s.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE(e){d(e)||(e===a.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===a.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===a.GREATER_THAN_SIGN?(this._err(s.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=u,this._emitCurrentToken()):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE(e){e===a.QUOTATION_MARK?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.systemId+=r.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(s.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=E(e)}DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE(e){e===a.APOSTROPHE?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===a.NULL?(this._err(s.unexpectedNullCharacter),this.currentToken.systemId+=r.REPLACEMENT_CHARACTER):e===a.GREATER_THAN_SIGN?(this._err(s.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=E(e)}AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE(e){d(e)||(e===a.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=u):e===a.EOF?(this._err(s.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(s.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}BOGUS_DOCTYPE_STATE(e){e===a.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=u):e===a.NULL?this._err(s.unexpectedNullCharacter):e===a.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}CDATA_SECTION_STATE(e){e===a.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_BRACKET_STATE":e===a.EOF?(this._err(s.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}CDATA_SECTION_BRACKET_STATE(e){e===a.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_END_STATE":(this._emitChars("]"),this._reconsumeInState("CDATA_SECTION_STATE"))}CDATA_SECTION_END_STATE(e){e===a.GREATER_THAN_SIGN?this.state=u:e===a.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState("CDATA_SECTION_STATE"))}CHARACTER_REFERENCE_STATE(e){this.tempBuff=[a.AMPERSAND],e===a.NUMBER_SIGN?(this.tempBuff.push(e),this.state="NUMERIC_CHARACTER_REFERENCE_STATE"):_(e)?this._reconsumeInState("NAMED_CHARACTER_REFERENCE_STATE"):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}NAMED_CHARACTER_REFERENCE_STATE(e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[a.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===a.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(s.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state="AMBIGUOS_AMPERSAND_STATE"}AMBIGUOS_AMPERSAND_STATE(e){_(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=E(e):this._emitCodePoint(e):(e===a.SEMICOLON&&this._err(s.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}NUMERIC_CHARACTER_REFERENCE_STATE(e){this.charRefCode=0,e===a.LATIN_SMALL_X||e===a.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE"):this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_START_STATE")}HEXADEMICAL_CHARACTER_REFERENCE_START_STATE(e){!function(e){return h(e)||f(e)||v(e)}(e)?(this._err(s.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState("HEXADEMICAL_CHARACTER_REFERENCE_STATE")}DECIMAL_CHARACTER_REFERENCE_START_STATE(e){h(e)?this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_STATE"):(this._err(s.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}HEXADEMICAL_CHARACTER_REFERENCE_STATE(e){f(e)?this.charRefCode=16*this.charRefCode+e-55:v(e)?this.charRefCode=16*this.charRefCode+e-87:h(e)?this.charRefCode=16*this.charRefCode+e-48:e===a.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(s.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}DECIMAL_CHARACTER_REFERENCE_STATE(e){h(e)?this.charRefCode=10*this.charRefCode+e-48:e===a.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(s.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}NUMERIC_CHARACTER_REFERENCE_END_STATE(){if(this.charRefCode===a.NULL)this._err(s.nullCharacterReference),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(s.characterReferenceOutsideUnicodeRange),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(r.isSurrogate(this.charRefCode))this._err(s.surrogateCharacterReference),this.charRefCode=a.REPLACEMENT_CHARACTER;else if(r.isUndefinedCodePoint(this.charRefCode))this._err(s.noncharacterCharacterReference);else if(r.isControlCodePoint(this.charRefCode)||this.charRefCode===a.CARRIAGE_RETURN){this._err(s.controlCharacterReference);const e=l[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}C.CHARACTER_TOKEN="CHARACTER_TOKEN",C.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",C.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",C.START_TAG_TOKEN="START_TAG_TOKEN",C.END_TAG_TOKEN="END_TAG_TOKEN",C.COMMENT_TOKEN="COMMENT_TOKEN",C.DOCTYPE_TOKEN="DOCTYPE_TOKEN",C.EOF_TOKEN="EOF_TOKEN",C.HIBERNATION_TOKEN="HIBERNATION_TOKEN",C.MODE={DATA:u,RCDATA:"RCDATA_STATE",RAWTEXT:"RAWTEXT_STATE",SCRIPT_DATA:"SCRIPT_DATA_STATE",PLAINTEXT:"PLAINTEXT_STATE"},C.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null},e.exports=C},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(3),r=n.n(o),i=n(38),s=n(469),a=n(148),c=n(40),l=n(83);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}const d={showRoomPanel:c.b.getValue("showRightPanelInRoom"),showGroupPanel:c.b.getValue("showRightPanelInGroup"),lastRoomPhase:c.b.getValue("lastRightPanelPhaseForRoom"),lastGroupPhase:c.b.getValue("lastRightPanelPhaseForGroup"),lastRoomPhaseParams:{}},h=Object.keys(l.a).filter(e=>e.startsWith("Group")),p=[l.a.RoomMemberInfo,l.a.Room3pidMemberInfo,l.a.EncryptionPanel];class m extends a.Store{constructor(){super(i.a),this._state=d}get isOpenForRoom(){return this._state.showRoomPanel}get isOpenForGroup(){return this._state.showGroupPanel}get roomPanelPhase(){return this._state.lastRoomPhase}get groupPanelPhase(){return this._state.lastGroupPhase}get visibleRoomPanelPhase(){return this.isOpenForRoom?this.roomPanelPhase:null}get visibleGroupPanelPhase(){return this.isOpenForGroup?this.groupPanelPhase:null}get roomPanelPhaseParams(){return this._state.lastRoomPhaseParams||{}}_setState(e){this._state=Object.assign(this._state,e),c.b.setValue("showRightPanelInRoom",null,c.a.DEVICE,this._state.showRoomPanel),c.b.setValue("showRightPanelInGroup",null,c.a.DEVICE,this._state.showGroupPanel),l.b.includes(this._state.lastRoomPhase)&&c.b.setValue("lastRightPanelPhaseForRoom",null,c.a.DEVICE,this._state.lastRoomPhase),l.b.includes(this._state.lastGroupPhase)&&c.b.setValue("lastRightPanelPhaseForGroup",null,c.a.DEVICE,this._state.lastGroupPhase),this.__emitChange()}__onDispatch(e){switch(e.action){case"view_room":case"view_group":p.includes(this._state.lastRoomPhase)&&this._setState({lastRoomPhase:l.a.RoomMemberList,lastRoomPhaseParams:{}}),this._state.lastGroupPhase===l.a.GroupMemberInfo&&this._setState({lastGroupPhase:l.a.GroupMemberList});break;case"set_right_panel_phase":{let t=e.phase,n=e.refireParams;if(t===l.a.RoomMemberInfo&&e.refireParams){const{member:o}=e.refireParams,r=Object(s.b)(o);r&&(t=l.a.EncryptionPanel,n={verificationRequest:r,member:o})}if(!l.a[t])return void console.warn("Tried to switch right panel to unknown phase: "+t);h.includes(t)?t===this._state.lastGroupPhase?this._setState({showGroupPanel:!this._state.showGroupPanel}):this._setState({lastGroupPhase:t,showGroupPanel:!0}):t!==this._state.lastRoomPhase||n?this._setState({lastRoomPhase:t,showRoomPanel:!0,lastRoomPhaseParams:n||{}}):this._setState({showRoomPanel:!this._state.showRoomPanel}),i.a.dispatch(function(e){for(var t=1;t{const o=r.a.createElement("div",null,r.a.createElement("div",null,Object(c.a)("Who would you like to add to this community?")),r.a.createElement("div",{className:"warning"},Object(c.a)("Warning: any person you add to a community will be publicly visible to anyone who knows the community ID"))),l=s.getComponent("dialogs.AddressPickerDialog");i.a.createTrackedDialog("Group Invite","",l,{title:Object(c.a)("Invite new community members"),description:o,placeholder:Object(c.a)("Name or Matrix ID"),button:Object(c.a)("Invite to Community"),validAddressTypes:["mx-user-id"],onFinished:(o,r)=>{o&&function(e,t){const n=new a.a(e),o=t.map(e=>e.address);return n.invite(o).then(n=>{const o=[];for(const e of Object.keys(n))"error"===t[e]&&o.push(e);if(o.length>0){const t=s.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Failed to invite the following users to the group","",t,{title:Object(c.a)("Failed to invite the following users to %(groupId)s:",{groupId:e}),description:o.join(", ")})}}).catch(t=>{const n=s.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Failed to invite users to group","",n,{title:Object(c.a)("Failed to invite users to community"),description:Object(c.a)("Failed to invite users to %(groupId)s",{groupId:e})})})}(e,r).then(t,n)}},null,!1,!0)})}function m(e){return new Promise((t,n)=>{let o=!1;const a=r.a.createElement("div",null,r.a.createElement("div",null,Object(c.a)("Which rooms would you like to add to this community?"))),p=r.a.createElement(h.a,{className:"mx_GroupAddressPicker_checkboxContainer",onChange:e=>{o=e.target.checked}},Object(c.a)("Show these rooms to non-members on the community page and room list?")),m=s.getComponent("dialogs.AddressPickerDialog");i.a.createTrackedDialog("Add Rooms to Group","",m,{title:Object(c.a)("Add rooms to the community"),description:a,extraNode:p,placeholder:Object(c.a)("Room name or address"),button:Object(c.a)("Add to community"),pickerType:"room",validAddressTypes:["mx-room-id"],onFinished:(r,a)=>{r&&function(e,t,n){const o=l.a.get(),r=[];return Object(d.a)(t.map(t=>u.a.addRoomToGroup(e,t.address,n).catch(()=>{r.push(t.address)}).then(()=>{const n=t.address,r=o.getRoom(n);if(!r||!r.currentState.mayClientSendStateEvent("m.room.related_groups",o))return;const i=r.currentState.getStateEvents("m.room.related_groups",""),s=i&&i.getContent().groups||[];return s.includes(e)?void 0:(s.push(e),l.a.get().sendStateEvent(n,"m.room.related_groups",{groups:s},""))}))).then(()=>{if(0===r.length)return;const t=s.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Failed to add the following room to the group","",t,{title:Object(c.a)("Failed to add the following rooms to %(groupId)s:",{groupId:e}),description:r.join(", ")})})}(e,a,o).then(t,n)}},null,!1,!0)})}},function(e,t,n){"use strict";var o=n(46),r=n.n(o),i=n(55),s=n.n(i),a=n(33),c=n.n(a),l=n(35),u=n.n(l),d=n(42),h=n.n(d),p=n(36);const m=e=>{let{checked:t,disabled:n=!1,onChange:o}=e,i=s()(e,["checked","disabled","onChange"]);const a=h()({mx_ToggleSwitch:!0,mx_ToggleSwitch_on:t,mx_ToggleSwitch_enabled:!n}),l=p.getComponent("elements.AccessibleButton");return c.a.createElement(l,r()({},i,{className:a,onClick:e=>{n||o(!t)},role:"switch","aria-checked":t,"aria-disabled":n}),c.a.createElement("div",{className:"mx_ToggleSwitch_ball"}))};m.propTypes={checked:u.a.bool.isRequired,disabled:u.a.bool,onChange:u.a.func.isRequired},t.a=m},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(3),r=n.n(o),i=n(130);class s extends i.a{static set matrixClient(e){const t=s._matrixClient;s._matrixClient=e;for(const n of s._instances)n.initMatrixClient(t,e)}constructor(){super(),s._instances.push(this)}initMatrixClient(){console.warn("initMatrixClient not overridden")}}r()(s,"_matrixClient",void 0),r()(s,"_instances",[])},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(49),r=n(92),i=n(75),s=n(1),a=n(0),c=n(3),l=n.n(c);class u extends o.EventEmitter{constructor(e,t,n){super(),l()(this,"_onEventStatus",(e,t)=>{e.isSending()?t===i.a.CANCELLED&&(e.removeListener("Event.status",this._onEventStatus),this._removeEvent(e)):e.removeListener("Event.status",this._onEventStatus)}),l()(this,"_onBeforeRedaction",e=>{this._relations.has(e)&&(this._relations.delete(e),"m.annotation"===this.relationType?this._removeAnnotationFromAggregation(e):"m.replace"===this.relationType&&this._targetEvent&&this._targetEvent.makeReplaced(this.getLastReplacement()),e.removeListener("Event.beforeRedaction",this._onBeforeRedaction),this.emit("Relations.redaction",e))}),this.relationType=e,this.eventType=t,this._relations=new Set,this._annotationsByKey={},this._annotationsBySender={},this._sortedAnnotationsByKey=[],this._targetEvent=null}addEvent(e){if(this._relations.has(e))return;const t=e.getRelation();if(!t)return void console.error("Event must have relation info");const n=t.rel_type,o=e.getType();this.relationType===n&&this.eventType===o?(e.isSending()&&e.on("Event.status",this._onEventStatus),this._relations.add(e),"m.annotation"===this.relationType?this._addAnnotationToAggregation(e):"m.replace"===this.relationType&&this._targetEvent&&this._targetEvent.makeReplaced(this.getLastReplacement()),e.on("Event.beforeRedaction",this._onBeforeRedaction),this.emit("Relations.add",e)):console.error("Event relation info doesn't match this container")}_removeEvent(e){if(!this._relations.has(e))return;const t=e.getRelation();if(!t)return void console.error("Event must have relation info");const n=t.rel_type,o=e.getType();this.relationType===n&&this.eventType===o?(this._relations.delete(e),"m.annotation"===this.relationType?this._removeAnnotationFromAggregation(e):"m.replace"===this.relationType&&this._targetEvent&&this._targetEvent.makeReplaced(this.getLastReplacement()),this.emit("Relations.remove",e)):console.error("Event relation info doesn't match this container")}getRelations(){return[...this._relations]}_addAnnotationToAggregation(e){const{key:t}=e.getRelation();if(!t)return;let n=this._annotationsByKey[t];n||(n=this._annotationsByKey[t]=new Set,this._sortedAnnotationsByKey.push([t,n])),n.add(e),this._sortedAnnotationsByKey.sort((e,t)=>{const n=e[1];return t[1].size-n.size});const o=e.getSender();let r=this._annotationsBySender[o];r||(r=this._annotationsBySender[o]=new Set),r.add(e)}_removeAnnotationFromAggregation(e){const{key:t}=e.getRelation();if(!t)return;const n=this._annotationsByKey[t];n&&(n.delete(e),this._sortedAnnotationsByKey.sort((e,t)=>{const n=e[1];return t[1].size-n.size}));const o=e.getSender(),r=this._annotationsBySender[o];r&&r.delete(e)}getSortedAnnotationsByKey(){return"m.annotation"!==this.relationType?null:this._sortedAnnotationsByKey}getAnnotationsBySender(){return"m.annotation"!==this.relationType?null:this._annotationsBySender}getLastReplacement(){if("m.replace"!==this.relationType)return null;if(!this._targetEvent)return null;const e=this._targetEvent.getServerAggregatedRelation("m.replace"),t=e&&e.origin_server_ts;return this.getRelations().reduce((e,n)=>n.getSender()!==this._targetEvent.getSender()||t&&t>n.getTs()||e&&e.getTs()>n.getTs()?e:n,null)}setTargetEvent(e){if(!this._targetEvent&&(this._targetEvent=e,"m.replace"===this.relationType)){const e=this.getLastReplacement();e&&this._targetEvent.makeReplaced(e)}}}let d;function h(e,t){this.room=e,this._timelineSupport=Boolean(t.timelineSupport),this._liveTimeline=new r.a(this),this._unstableClientRelationAggregation=!!t.unstableClientRelationAggregation,this._timelines=[this._liveTimeline],this._eventIdToTimeline={},this._filter=t.filter||null,this._unstableClientRelationAggregation&&(this._relations={})}d=a.a.log.bind(a.a),s.o(h,o.EventEmitter),h.prototype.getTimelines=function(){return this._timelines},h.prototype.getFilter=function(){return this._filter},h.prototype.setFilter=function(e){this._filter=e},h.prototype.getPendingEvents=function(){return this.room?this._filter?this._filter.filterRoomTimeline(this.room.getPendingEvents()):this.room.getPendingEvents():[]},h.prototype.getLiveTimeline=function(){return this._liveTimeline},h.prototype.eventIdToTimeline=function(e){return this._eventIdToTimeline[e]},h.prototype.replaceEventId=function(e,t){const n=this._eventIdToTimeline[e];n&&(delete this._eventIdToTimeline[e],this._eventIdToTimeline[t]=n)},h.prototype.resetLiveTimeline=function(e,t){const n=!this._timelineSupport||!t,o=this._liveTimeline,i=n?o.forkLive(r.a.FORWARDS):o.fork(r.a.FORWARDS);n?(this._timelines=[i],this._eventIdToTimeline={}):this._timelines.push(i),t&&o.setPaginationToken(t,r.a.FORWARDS),i.setPaginationToken(e,r.a.BACKWARDS),this._liveTimeline=i,this.emit("Room.timelineReset",this.room,this,n)},h.prototype.getTimelineForEvent=function(e){const t=this._eventIdToTimeline[e];return void 0===t?null:t},h.prototype.findEventById=function(e){const t=this.getTimelineForEvent(e);if(t)return s.k(t.getEvents(),(function(t){return t.getId()==e}))},h.prototype.addTimeline=function(){if(!this._timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");const e=new r.a(this);return this._timelines.push(e),e},h.prototype.addEventsToTimeline=function(e,t,n,o){if(!n)throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");if(!t&&n==this._liveTimeline)throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");if(this._filter&&!(e=this._filter.filterRoomTimeline(e)).length)return;const i=t?r.a.BACKWARDS:r.a.FORWARDS,s=t?r.a.FORWARDS:r.a.BACKWARDS;let c=!1,l=!1;for(let o=0;o{this.aggregateRelations(e)});const t=e.getRelation();if(!t)return;const n=t.event_id,o=t.rel_type,r=e.getType();let s=this._relations[n];s||(s=this._relations[n]={});let a=s[o];a||(a=s[o]={});let c,l=a[r],d=!1;l||(l=a[r]=new u(o,r,this.room),d=!0,c=this.findEventById(n),c&&l.setTargetEvent(c)),l.addEvent(e),d&&c&&c.emit("Event.relationsCreated",o,r)}},function(e,t,n){"use strict";function o(e){this.filter_json=e,this.types=e.types||null,this.not_types=e.not_types||[],this.rooms=e.rooms||null,this.not_rooms=e.not_rooms||[],this.senders=e.senders||null,this.not_senders=e.not_senders||[],this.contains_url=e.contains_url||null}function r(e,t,n){const o=t.split(".");let r=e;for(let e=0;e0)return!1;const o=i[t];if(o&&o.length>0){if(!o.some(n))return!1}}const s=this.filter_json.contains_url;return void 0===s||s===o},o.prototype.filter=function(e){return e.filter(this.check,this)},o.prototype.limit=function(){return void 0!==this.filter_json.limit?this.filter_json.limit:10},i.LAZY_LOADING_MESSAGES_FILTER={lazy_load_members:!0},i.prototype.getFilterId=function(){return this.filterId},i.prototype.getDefinition=function(){return this.definition},i.prototype.setDefinition=function(e){this.definition=e;const t=e.room,n={};t&&(t.rooms&&(n.rooms=t.rooms),t.rooms&&(n.not_rooms=t.not_rooms),this._include_leave=t.include_leave||!1),this._room_filter=new o(n),this._room_timeline_filter=new o(t&&t.timeline||{})},i.prototype.getRoomTimelineFilterComponent=function(){return this._room_timeline_filter},i.prototype.filterRoomTimeline=function(e){return this._room_timeline_filter.filter(this._room_filter.filter(e))},i.prototype.setTimelineLimit=function(e){r(this.definition,"room.timeline.limit",e)},i.prototype.setLazyLoadMembers=function(e){r(this.definition,"room.state.lazy_load_members",!!e)},i.prototype.setIncludeLeaveRooms=function(e){r(this.definition,"room.include_leave",e)},i.fromJson=function(e,t,n){const o=new i(e,t);return o.setDefinition(n),o}},function(e,t,n){"use strict";var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function s(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,c=s(e),l=1;le!==t);e._displayNameToUserIds[n]=o}}e._userIdsToDisplayNames[t]=n;const r=n&&s.z(n);r&&(e._displayNameToUserIds[r]||(e._displayNameToUserIds[r]=[]),e._displayNameToUserIds[r].push(t))}s.o(a,o.EventEmitter),a.prototype.getJoinedMemberCount=function(){return null!==this._summaryJoinedMemberCount?this._summaryJoinedMemberCount:(null===this._joinedMemberCount&&(this._joinedMemberCount=this.getMembers().reduce((e,t)=>"join"===t.membership?e+1:e,0)),this._joinedMemberCount)},a.prototype.setJoinedMemberCount=function(e){this._summaryJoinedMemberCount=e},a.prototype.getInvitedMemberCount=function(){return null!==this._summaryInvitedMemberCount?this._summaryInvitedMemberCount:(null===this._invitedMemberCount&&(this._invitedMemberCount=this.getMembers().reduce((e,t)=>"invite"===t.membership?e+1:e,0)),this._invitedMemberCount)},a.prototype.setInvitedMemberCount=function(e){this._summaryInvitedMemberCount=e},a.prototype.getMembers=function(){return s.B(this.members)},a.prototype.getMembersExcept=function(e){return s.B(this.members).filter(t=>!e.includes(t.userId))},a.prototype.getMember=function(e){return this.members[e]||null},a.prototype.getSentinelMember=function(e){if(!e)return null;let t=this._sentinels[e];if(void 0===t){t=new r.a(this.roomId,e);const n=this.members[e];n&&t.setMembershipEvent(n.events.member,this),this._sentinels[e]=t}return t},a.prototype.getStateEvents=function(e,t){if(!this.events[e])return void 0===t?[]:null;if(void 0===t)return s.B(this.events[e]);const n=this.events[e][t];return n||null},a.prototype.clone=function(){const e=new a(this.roomId,this._oobMemberFlags),t=this._oobMemberFlags.status;return this._oobMemberFlags.status=1,Object.values(this.events).forEach(t=>{const n=Object.values(t);e.setStateEvents(n)}),this._oobMemberFlags.status=t,null!==this._summaryInvitedMemberCount&&e.setInvitedMemberCount(this.getInvitedMemberCount()),null!==this._summaryJoinedMemberCount&&e.setJoinedMemberCount(this.getJoinedMemberCount()),3==this._oobMemberFlags.status&&this.getMembers().forEach(t=>{if(t.isOutOfBand()){e.getMember(t.userId).markOutOfBand()}}),e},a.prototype.setUnknownStateEvents=function(e){const t=e.filter(e=>void 0===this.events[e.getType()]||void 0===this.events[e.getType()][e.getStateKey()]);this.setStateEvents(t)},a.prototype.setStateEvents=function(e){const t=this;this._updateModifiedTime(),s.l(e,(function(e){e.getRoomId()===t.roomId&&e.isState()&&(t._setStateEvent(e),"m.room.member"===e.getType()&&(c(t,e.getStateKey(),e.getContent().displayname),function(e,t){if(!t.getContent().third_party_invite)return;const n=(t.getContent().third_party_invite.signed||{}).token;if(!n)return;if(!e.getStateEvents("m.room.third_party_invite",n))return;e._tokenToInvite[n]=t}(t,e)),t.emit("RoomState.events",e,t))})),s.l(e,(function(e){if(e.getRoomId()===t.roomId&&e.isState())if("m.room.member"===e.getType()){const n=e.getStateKey();"leave"!==e.getContent().membership&&"ban"!==e.getContent().membership||(e.getContent().avatar_url=e.getContent().avatar_url||e.getPrevContent().avatar_url,e.getContent().displayname=e.getContent().displayname||e.getPrevContent().displayname);const o=t._getOrCreateMember(n,e);o.setMembershipEvent(e,t),t._updateMember(o),t.emit("RoomState.members",e,t,o)}else if("m.room.power_levels"===e.getType()){const n=s.B(t.members);s.l(n,(function(n){n.setPowerLevelEvent(e),t.emit("RoomState.members",e,t,n)})),t._sentinels={}}}))},a.prototype._getOrCreateMember=function(e,t){let n=this.members[e];return n||(n=new r.a(this.roomId,e),this.members[e]=n,this.emit("RoomState.newMember",t,this,n)),n},a.prototype._setStateEvent=function(e){void 0===this.events[e.getType()]&&(this.events[e.getType()]={}),this.events[e.getType()][e.getStateKey()]=e},a.prototype._updateMember=function(e){const t=this.getStateEvents("m.room.power_levels","");t&&e.setPowerLevelEvent(t),delete this._sentinels[e.userId],this.members[e.userId]=e,this._joinedMemberCount=null,this._invitedMemberCount=null},a.prototype.needsOutOfBandMembers=function(){return 1===this._oobMemberFlags.status},a.prototype.markOutOfBandMembersStarted=function(){1===this._oobMemberFlags.status&&(this._oobMemberFlags.status=2)},a.prototype.markOutOfBandMembersFailed=function(){2===this._oobMemberFlags.status&&(this._oobMemberFlags.status=1)},a.prototype.clearOutOfBandMembers=function(){let e=0;Object.keys(this.members).forEach(t=>{this.members[t].isOutOfBand()&&(++e,delete this.members[t])}),i.a.log(`LL: RoomState removed ${e} members...`),this._oobMemberFlags.status=1},a.prototype.setOutOfBandMembers=function(e){i.a.log(`LL: RoomState about to set ${e.length} OOB members ...`),2===this._oobMemberFlags.status&&(i.a.log("LL: RoomState put in OOB_STATUS_FINISHED state ..."),this._oobMemberFlags.status=3,e.forEach(e=>this._setOutOfBandMember(e)))},a.prototype._setOutOfBandMember=function(e){if("m.room.member"!==e.getType())return;const t=e.getStateKey(),n=this.getMember(t);if(n&&!n.isOutOfBand())return;const o=this._getOrCreateMember(t,e);o.setMembershipEvent(e,this),o.markOutOfBand(),c(this,o.userId,o.name),this._setStateEvent(e),this._updateMember(o),this.emit("RoomState.members",e,this,o)},a.prototype.setTypingEvent=function(e){s.l(s.B(this.members),(function(t){t.setTypingEvent(e)}))},a.prototype.getInviteForThreePidToken=function(e){return this._tokenToInvite[e]||null},a.prototype._updateModifiedTime=function(){this._modified=Date.now()},a.prototype.getLastModifiedTime=function(){return this._modified},a.prototype.getUserIdsWithDisplayName=function(e){return this._displayNameToUserIds[s.z(e)]||[]},a.prototype.maySendRedactionForEvent=function(e,t){const n=this.getMember(t);if(!n||"leave"===n.membership)return!1;if(e.status||e.isRedacted())return!1;const o=this.maySendEvent("m.room.redaction",t);return e.getSender()===t?o:this._hasSufficientPowerLevelFor("redact",n.powerLevel)},a.prototype._hasSufficientPowerLevelFor=function(e,t){const n=this.getStateEvents("m.room.power_levels","");let o={};n&&(o=n.getContent());let r=50;return s.s(o[e])&&(r=o[e]),t>=r},a.prototype.maySendMessage=function(e){return this._maySendEventOfType("m.room.message",e,!1)},a.prototype.maySendEvent=function(e,t){return this._maySendEventOfType(e,t,!1)},a.prototype.mayClientSendStateEvent=function(e,t){return!t.isGuest()&&this.maySendStateEvent(e,t.credentials.userId)},a.prototype.maySendStateEvent=function(e,t){return this._maySendEventOfType(e,t,!0)},a.prototype._maySendEventOfType=function(e,t,n){const o=this.getStateEvents("m.room.power_levels","");let r,i={},s=0,a=0,c=0;if(o){r=o.getContent(),i=r.events||{},s=Number.isFinite(r.state_default)?r.state_default:50;const e=r.users&&r.users[t];Number.isFinite(e)?c=e:Number.isFinite(r.users_default)&&(c=r.users_default),Number.isFinite(r.events_default)&&(a=r.events_default)}let l=n?s:a;return Number.isFinite(i[e])&&(l=i[e]),c>=l},a.prototype.mayTriggerNotifOfType=function(e,t){const n=this.getMember(t);if(!n)return!1;const o=this.getStateEvents("m.room.power_levels","");let r=50;return o&&o.getContent()&&o.getContent().notifications&&s.s(o.getContent().notifications[e])&&(r=o.getContent().notifications[e]),n.powerLevel>=r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o=Object.freeze({IS:"SERVICE_TYPE_IS",IM:"SERVICE_TYPE_IM"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{constructor(e){this.target=e,this.boundHandlers={}}_handleEvent(e,...t){this.target.emit(e,...t)}reEmit(e,t){const n=(t,...n)=>{t(...n,e)};for(const o of t){void 0===this.boundHandlers[o]&&(this.boundHandlers[o]=this._handleEvent.bind(this,o));const t=n.bind(this,this.boundHandlers[o]);e.on(o,t)}}}},function(e,t,n){"use strict";for(var o=/[\\\"\x00-\x1F]/g,r={},i=0;i<32;++i)r[String.fromCharCode(i)]="\\U"+("0000"+i.toString(16)).slice(-4).toUpperCase();function s(e){return o.lastIndex=0,e.replace(o,(function(e){return r[e]}))}function a(e){switch(typeof e){case"string":return'"'+s(e)+'"';case"number":return isFinite(e)?e:"null";case"boolean":return e;case"object":return null===e?"null":Array.isArray(e)?function(e){for(var t="[",n="",o=0;o=0;if(!this._callbacks.getCrossSigningKey)throw new Error("No getCrossSigningKey callback supplied");function r(t){if(!t)return;const o=new e.Olm.PkSigning,r=o.init_with_seed(t);if(r===n)return[r,o];o.free()}let i;void 0===n&&(n=this.getId(t)),this._cacheCallbacks.getCrossSigningKeyCache&&o&&(i=await this._cacheCallbacks.getCrossSigningKeyCache(t,n));const s=r(i);if(s)return s;i=await this._callbacks.getCrossSigningKey(t,n);const a=r(i);if(a)return this._cacheCallbacks.storeCrossSigningKeyCache&&o&&await this._cacheCallbacks.storeCrossSigningKeyCache(t,i),a;if(!i)throw new Error("getCrossSigningKey callback for "+t+" returned falsey");throw new Error("Key type "+t+" from getCrossSigningKey callback did not match")}static fromStorage(e,t){const n=new u(t);for(const t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}toStorage(){return{keys:this.keys,firstUse:this.firstUse,crossSigningVerifiedBefore:this.crossSigningVerifiedBefore}}async isStoredInSecretStorage(e){const t=await e.isStored("m.cross_signing.master",!1)||{};function n(e){for(const n of Object.keys(t))e[n]||delete t[n]}for(const t of["self_signing","user_signing"])n(await e.isStored("m.cross_signing."+t,!1)||{});return Object.keys(t).length?t:null}static async storeInSecretStorage(e,t){for(const n of Object.keys(e)){const o=Object(r.encodeBase64)(e[n]);await t.store("m.cross_signing."+n,o)}}static async getFromSecretStorage(e,t){const n=await t.get("m.cross_signing."+e);return Object(r.decodeBase64)(n)}getId(e){if(e=e||"master",!this.keys[e])return null;return l(this.keys[e])}async resetKeys(t){if(!this._callbacks.saveCrossSigningKeys)throw new Error("No saveCrossSigningKeys callback supplied");if(void 0===t||t&d.MASTER||!this.keys.master)t=d.MASTER|d.USER_SIGNING|d.SELF_SIGNING;else if(0===t)return;const n={},o={};let i,s;try{if(t&d.MASTER?(i=new e.Olm.PkSigning,n.master=i.generate_seed(),s=i.init_with_seed(n.master),o.master={user_id:this.userId,usage:["master"],keys:{["ed25519:"+s]:s}}):[s,i]=await this.getCrossSigningKey("master"),t&d.SELF_SIGNING){const t=new e.Olm.PkSigning;try{n.self_signing=t.generate_seed();const e=t.init_with_seed(n.self_signing);o.self_signing={user_id:this.userId,usage:["self_signing"],keys:{["ed25519:"+e]:e}},Object(r.pkSign)(o.self_signing,i,this.userId,s)}finally{t.free()}}if(t&d.USER_SIGNING){const t=new e.Olm.PkSigning;try{n.user_signing=t.generate_seed();const e=t.init_with_seed(n.user_signing);o.user_signing={user_id:this.userId,usage:["user_signing"],keys:{["ed25519:"+e]:e}},Object(r.pkSign)(o.user_signing,i,this.userId,s)}finally{t.free()}}Object.assign(this.keys,o),this._callbacks.saveCrossSigningKeys(n)}finally{i&&i.free()}}clearKeys(){this.keys={}}setKeys(e){const t={};if(e.master){if(e.master.user_id!==this.userId){const t="Mismatched user ID "+e.master.user_id+" in master key from "+this.userId;throw s.a.error(t),new Error(t)}this.keys.master?l(e.master)!==this.getId()&&(this.firstUse=!1):this.firstUse=!0,t.master=e.master}else{if(!this.keys.master)throw new Error("Tried to set cross-signing keys without a master key");t.master=this.keys.master}const n=l(t.master);if(e.user_signing){if(e.user_signing.user_id!==this.userId){const t="Mismatched user ID "+e.master.user_id+" in user_signing key from "+this.userId;throw s.a.error(t),new Error(t)}try{Object(r.pkVerify)(e.user_signing,n,this.userId)}catch(e){throw s.a.error("invalid signature on user-signing key"),e}}if(e.self_signing){if(e.self_signing.user_id!==this.userId){const t="Mismatched user ID "+e.master.user_id+" in self_signing key from "+this.userId;throw s.a.error(t),new Error(t)}try{Object(r.pkVerify)(e.self_signing,n,this.userId)}catch(e){throw s.a.error("invalid signature on self-signing key"),e}}e.master&&(this.keys.master=e.master,this.keys.self_signing=null,this.keys.user_signing=null),e.self_signing&&(this.keys.self_signing=e.self_signing),e.user_signing&&(this.keys.user_signing=e.user_signing)}updateCrossSigningVerifiedBefore(e){!this.crossSigningVerifiedBefore&&e&&(this.crossSigningVerifiedBefore=!0)}async signObject(e,t){if(!this.keys[t])throw new Error("Attempted to sign with "+t+" key but no such key present");const[n,o]=await this.getCrossSigningKey(t);try{return Object(r.pkSign)(e,o,this.userId,n),e}finally{o.free()}}async signUser(e){if(this.keys.user_signing)return this.signObject(e.keys.master,"user_signing");s.a.info("No user signing key: not signing user")}async signDevice(e,t){if(e!==this.userId)throw new Error(`Trying to sign ${e}'s device; can only sign our own device`);if(this.keys.self_signing)return this.signObject({algorithms:t.algorithms,keys:t.keys,device_id:t.deviceId,user_id:e},"self_signing");s.a.info("No self signing key: not signing device")}checkUserTrust(e){if(this.userId===e.userId&&this.getId()&&this.getId()===e.getId()&&this.getId("self_signing")&&this.getId("self_signing")===e.getId("self_signing"))return new h(!0,!0,this.firstUse);if(!this.keys.user_signing)return new h(!1,!1,e.firstUse);let t;const n=e.keys.master,o=this.getId("user_signing");try{Object(r.pkVerify)(n,o,this.userId),t=!0}catch(e){t=!1}return new h(t,e.crossSigningVerifiedBefore,e.firstUse)}checkDeviceTrust(e,t,n,o){const i=this.checkUserTrust(e),s=e.keys.self_signing;if(!s)return new p(!1,!1,n,o);const a=function(e,t){return{algorithms:e.algorithms,keys:e.keys,device_id:e.deviceId,user_id:t,signatures:e.signatures}}(t,e.userId);try{return Object(r.pkVerify)(s,e.getId(),e.userId),Object(r.pkVerify)(a,l(s),e.userId),p.fromUserTrustLevel(i,n,o)}catch(e){return new p(!1,!1,n,o)}}getCacheCallbacks(){return this._cacheCallbacks}}const d={MASTER:4,USER_SIGNING:2,SELF_SIGNING:1};class h{constructor(e,t,n){this._crossSigningVerified=e,this._crossSigningVerifiedBefore=t,this._tofu=n}isVerified(){return this.isCrossSigningVerified()}isCrossSigningVerified(){return this._crossSigningVerified}wasCrossSigningVerified(){return this._crossSigningVerifiedBefore}isTofu(){return this._tofu}}class p{constructor(e,t,n,o){this._crossSigningVerified=e,this._tofu=t,this._localVerified=n,this._trustCrossSignedDevices=o}static fromUserTrustLevel(e,t,n){return new p(e._crossSigningVerified,e._tofu,t,n)}isVerified(){return Boolean(this.isLocallyVerified()||this._trustCrossSignedDevices&&this.isCrossSigningVerified())}isCrossSigningVerified(){return this._crossSigningVerified}isLocallyVerified(){return this._localVerified}isTofu(){return this._tofu}}function m(e,t){return{getCrossSigningKeyCache:async function(n,i){const s=await new Promise(t=>e.doTxn("readonly",[a.a.STORE_ACCOUNT],o=>{e.getSecretStorePrivateKey(o,t,n)}));if(s&&s.ciphertext){const e=o.from(t._pickleKey),i=await Object(c.a)(s,e,n);return Object(r.decodeBase64)(i)}return s},storeCrossSigningKeyCache:async function(n,i){if(!(i instanceof Uint8Array))throw new Error("storeCrossSigningKeyCache expects Uint8Array, got "+i);const s=o.from(t._pickleKey);return i=await Object(c.b)(Object(r.encodeBase64)(i),s,n),e.doTxn("readwrite",[a.a.STORE_ACCOUNT],t=>{e.storeSecretStorePrivateKey(t,n,i)})}}}}).call(this,n(17),n(78).Buffer)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u}));var o=n(1),r=n(66);const i="undefined"!=typeof window&&window.crypto?window.crypto.subtle||window.crypto.webkitSubtle:null,s=new Uint8Array(8);function a(t,n){const r=Object(o.m)(),i=r.createHmac("sha256",s).update(t).digest(),a=e.alloc(1,1),c=r.createHmac("sha256",i).update(n,"utf-8").update(a).digest();a[0]=2;return[c,r.createHmac("sha256",i).update(c).update(n,"utf-8").update(a).digest()]}async function c(e,t){const n=await i.importKey("raw",e,{name:"HKDF"},!1,["deriveBits"]),o=await i.deriveBits({name:"HKDF",salt:s,info:(new TextEncoder).encode(t),hash:"SHA-256"},n,512),r=o.slice(0,32),a=o.slice(32),c=i.importKey("raw",r,{name:"AES-CTR"},!1,["encrypt","decrypt"]),l=i.importKey("raw",a,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]);return await Promise.all([c,l])}function l(...e){return i?async function(e,t,n,o){let s;o?s=Object(r.decodeBase64)(o):(s=new Uint8Array(16),window.crypto.getRandomValues(s)),s[8]&=127;const[a,l]=await c(t,n),u=(new TextEncoder).encode(e),d=await i.encrypt({name:"AES-CTR",counter:s,length:64},a,u),h=await i.sign({name:"HMAC"},l,d);return{iv:Object(r.encodeBase64)(s),ciphertext:Object(r.encodeBase64)(d),mac:Object(r.encodeBase64)(h)}}(...e):async function(e,t,n,i){const s=Object(o.m)();if(!s)throw new Error("No usable crypto implementation");let c;c=i?Object(r.decodeBase64)(i):s.randomBytes(16),c[8]&=127;const[l,u]=a(t,n),d=s.createCipheriv("aes-256-ctr",l,c),h=d.update(e,"utf-8","base64")+d.final("base64"),p=s.createHmac("sha256",u).update(h,"base64").digest("base64");return{iv:Object(r.encodeBase64)(c),ciphertext:h,mac:p}}(...e)}function u(...e){return i?async function(e,t,n){const[o,s]=await c(t,n),a=Object(r.decodeBase64)(e.ciphertext);if(!await i.verify({name:"HMAC"},s,Object(r.decodeBase64)(e.mac),a))throw new Error(`Error decrypting secret ${n}: bad MAC`);const l=await i.decrypt({name:"AES-CTR",counter:Object(r.decodeBase64)(e.iv),length:64},o,a);return(new TextDecoder).decode(new Uint8Array(l))}(...e):async function(e,t,n){const i=Object(o.m)();if(!i)throw new Error("No usable crypto implementation");const[s,c]=a(t,n);if(i.createHmac("sha256",c).update(e.ciphertext,"base64").digest("base64").replace(/=+$/g,"")!==e.mac.replace(/=+$/g,""))throw new Error(`Error decrypting secret ${n}: bad MAC`);const l=i.createDecipheriv("aes-256-ctr",s,Object(r.decodeBase64)(e.iv));return l.update(e.ciphertext,"base64","utf-8")+l.final("utf-8")}(...e)}}).call(this,n(78).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var o=n(3),r=n.n(o),i=n(75),s=n(49),a=n(0),c=n(207),l=n(171),u=n(252),d=n(66);const h=new Error("Verification timed out");class p extends Error{constructor(e){super(),this.startEvent=e}}class m extends s.EventEmitter{constructor(e,t,n,o,r,i){super(),this._channel=e,this._baseApis=t,this.userId=n,this.deviceId=o,this.startEvent=r,this.request=i,this.cancelled=!1,this._done=!1,this._promise=null,this._transactionTimeoutTimer=null}get initiatedByMe(){if(!this.startEvent)return!0;const e=this.startEvent.getSender(),t=this.startEvent.getContent();return e===this._baseApis.getUserId()&&t.from_device===this._baseApis.getDeviceId()}_resetTimer(){a.a.info("Refreshing/starting the verification transaction timeout timer"),null!==this._transactionTimeoutTimer&&clearTimeout(this._transactionTimeoutTimer),this._transactionTimeoutTimer=setTimeout(()=>{this._done||this.cancelled||(a.a.info("Triggering verification timeout"),this.cancel(h))},6e5)}_endTimer(){null!==this._transactionTimeoutTimer&&(clearTimeout(this._transactionTimeoutTimer),this._transactionTimeoutTimer=null)}_send(e,t){return this._channel.send(e,t)}_waitForEvent(e){if(this._done)return Promise.reject(new Error("Verification is already done"));const t=this.request.getEventFromOtherParty(e);return t?Promise.resolve(t):(this._expectedEvent=e,new Promise((e,t)=>{this._resolveEvent=e,this._rejectEvent=t}))}canSwitchStartEvent(){return!1}switchStartEvent(e){if(this.canSwitchStartEvent(e))if(a.a.log("Verification Base: switching verification start event",{restartingFlow:!!this._rejectEvent}),this._rejectEvent){const t=this._rejectEvent;this._rejectEvent=void 0,t(new p(e))}else this.startEvent=e}handleEvent(e){if(!this._done)if(e.getType()===this._expectedEvent)"m.key.verification.done"!==this._expectedEvent&&(this._expectedEvent=void 0,this._rejectEvent=void 0,this._resetTimer(),this._resolveEvent(e));else if("m.key.verification.cancel"===e.getType()){const t=this._reject;if(this._reject=void 0,t){const n=e.getContent(),{reason:o,code:r}=n;t(new Error(`Other side cancelled verification because ${o} (${r})`))}}else if(this._expectedEvent){const t=new Error("Unexpected message: expecting "+this._expectedEvent+" but got "+e.getType());if(this._expectedEvent=void 0,this._rejectEvent){const e=this._rejectEvent;this._rejectEvent=void 0,e(t)}this.cancel(t)}}done(){if(this._endTimer(),!this._done){if(this.request.onVerifierFinished(),this._resolve(),this._baseApis.getUserId()!==this.userId)return;return console.log("VerificationBase.done: Self-verification done; requesting keys"),new Promise((e,t)=>{const n=this._baseApis,o=n._crypto._crossSigningInfo,r=new u.a(o.userId,{getCrossSigningKey:async e=>{console.debug("VerificationBase.done: requesting secret",e,this.deviceId);const{promise:t}=n.requestSecret("m.cross_signing."+e,[this.deviceId]),o=await t,r=Object(d.decodeBase64)(o);return Uint8Array.from(r)}},o._cacheCallbacks);r.keys=o.keys;const i=new Promise((e,t)=>{setTimeout(e,m.keyRequestTimeoutMs,new Error("Timeout"))}),s=new Promise(async e=>{if(!await n._crypto.getSessionBackupPrivateKey()){a.a.info("No cached backup key found. Requesting...");const e=n.requestSecret("m.megolm_backup.v1",[this.deviceId]),t=await e.promise;a.a.info("Got key backup key, decoding...");const o=Object(d.decodeBase64)(t);a.a.info("Decoded backup key, storing..."),n._crypto.storeSessionBackupPrivateKey(Uint8Array.from(o)),a.a.info("Backup key stored. Starting backup restore...");const r=await n.getKeyBackupVersion();n.restoreKeyBackupWithCache(void 0,void 0,r).then(()=>{a.a.info("Backup restored.")})}e()});return Promise.race([Promise.all([r.getCrossSigningKey("self_signing"),r.getCrossSigningKey("user_signing"),s]),i]).then(e,t)}).catch(e=>{console.warn("VerificationBase: failure while requesting keys:",e)})}}cancel(e){if(this._endTimer(),!this._done){if(this.cancelled=!0,this.request.onVerifierCancelled(),this.userId&&this.deviceId)if(e===h){const e=Object(l.e)();this._send(e.getType(),e.getContent())}else if(e instanceof i.b){if(e.getSender()!==this.userId){const t=e.getContent();"m.key.verification.cancel"===e.getType()?(t.code=t.code||"m.unknown",t.reason=t.reason||t.body||"Unknown reason",this._send("m.key.verification.cancel",t)):this._send("m.key.verification.cancel",{code:"m.unknown",reason:t.body||"Unknown reason"})}}else this._send("m.key.verification.cancel",{code:"m.unknown",reason:e.toString()});null!==this._promise?this._reject&&this._reject(e):this._promise=Promise.reject(e),this.emit("cancel",e)}}verify(){return this._promise||(this._promise=new Promise((e,t)=>{this._resolve=(...t)=>{this._done=!0,this._endTimer(),e(...t)},this._reject=(...e)=>{this._done=!0,this._endTimer(),t(...e)}}),this._doVerification&&!this._started&&(this._started=!0,this._resetTimer(),Promise.resolve(this._doVerification()).then(this.done.bind(this),this.cancel.bind(this)))),this._promise}async _verifyKeys(e,t,n){const o=[];for(const[r,i]of Object.entries(t)){const t=r.split(":",2)[1],s=this._baseApis.getStoredDevice(e,t);if(s)await n(r,s,i),o.push(t);else{const s=this._baseApis._crypto._deviceList.getStoredCrossSigningForUser(e);s&&s.getId()===t?(await n(r,c.a.fromStorage({keys:{[r]:t}},t),i),o.push(t)):a.a.warn(`verification: Could not find device ${t} to verify`)}}if(!o.length)throw new Error("No devices could be verified");a.a.info("Verification completed! Marking devices verified: ",o);for(const t of o)await this._baseApis.setDeviceVerified(e,t)}}r()(m,"keyRequestTimeoutMs",6e4)},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return s}));var o=n(9);async function r(t,n){if(!e.Olm)throw new Error("Olm is not available");if(!t.private_key_salt||!t.private_key_iterations)throw new Error("Salt and/or iterations not found: this backup cannot be restored with a passphrase");return await s(n,t.private_key_salt,t.private_key_iterations,t.private_key_bits||256)}async function i(t){if(!e.Olm)throw new Error("Olm is not available");const n=Object(o.a)(32);return{key:await s(t,n,5e5,256),salt:n,iterations:5e5}}async function s(t,n,o,r=256){const i=e.crypto.subtle,s=e.TextEncoder;if(!i||!s)throw new Error("Password-based backup is not avaiable on this platform");const a=await i.importKey("raw",(new s).encode(t),{name:"PBKDF2"},!1,["deriveBits"]),c=await i.deriveBits({name:"PBKDF2",salt:(new s).encode(n),iterations:o,hash:"SHA-512"},a,r);return new Uint8Array(c)}}).call(this,n(17))},function(e,t,n){"use strict";(function(e,o){n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(530),i=n.n(r);const s=[139,1];function a(t){const n=new e(s.length+t.length+1);n.set(s,0),n.set(t,s.length);let o=0;for(let e=0;e0?o:n)(e)}},function(e,t,n){var o=n(138),r=n(547),i=n(266),s=n(260)("IE_PROTO"),a=function(){},c=function(){var e,t=n(356)("iframe"),o=i.length;for(t.style.display="none",n(550).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("