/*! 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 a})),n.d(t,"u",(function(){return s})),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 f})),n.d(t,"c",(function(){return _})),n.d(t,"b",(function(){return v})),n.d(t,"i",(function(){return b})),n.d(t,"o",(function(){return y})),n.d(t,"v",(function(){return E})),n.d(t,"s",(function(){return S})),n.d(t,"z",(function(){return w})),n.d(t,"h",(function(){return x})),n.d(t,"n",(function(){return T})),n.d(t,"g",(function(){return k})),n.d(t,"A",(function(){return R})),n.d(t,"r",(function(){return O})),n.d(t,"d",(function(){return D})),n.d(t,"w",(function(){return I})),n.d(t,"x",(function(){return F})),n.d(t,"m",(function(){return A}));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 a(e,t){for(const n in t)t.hasOwnProperty(n)&&(e=e.replace(n,encodeURIComponent(t[n])));return e}function s(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 O(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 F(e){return new Promise(t=>t(e()))}let N;function A(){return N}},,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,a){"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 a(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[s]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(s)+"="+t+";"}catch(e){}}}(t),a.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: ".concat(JSON.stringify(t))),t.action===s.GetCapabilities?(this.onCapabilitiesRequest(t),this.expectingExplicitReady||this.readyPromiseResolve()):t.action===s.ClientReady?(this.readyPromiseResolve(),this.replyToRequest(t,{})):console.warn("[WidgetAPI] Got unexpected action: ".concat(t.action));else if(t.api===c.FromWidget&&this.inFlightRequests[t.requestId]){console.log("[WidgetAPI] Got reply: ".concat(JSON.stringify(t)));const e=this.inFlightRequests[t.requestId];delete this.inFlightRequests[t.requestId],e(t)}else console.warn("[WidgetAPI] Unhandled payload: ".concat(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(s.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,a){if("function"!=typeof a)throw new Error("Bad callback given: "+a);if(!i)throw new Error("No options given");var s=i.onResponse;if((i="string"==typeof i?{uri:i}:JSON.parse(JSON.stringify(i))).onResponse=s,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,a=c>>6&63,s=63&c,p[d++]=l.charAt(r)+l.charAt(i)+l.charAt(a)+l.charAt(s)}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,a=t.summary;i[e]=a[e]||i[e],i[r]=a[r]||i[r],i[o]=a[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=>{a(n._currentState,e)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((e,o)=>{a(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 s=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)),a(s,n)}Object.keys(n._currentState).forEach(e=>{Object.keys(n._currentState[e]).forEach(t=>{let r=n._currentState[e][t];s[e]&&s[e][t]&&(r=s[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 a(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),a=n(0);function s(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 a.a.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this._disconnected=!1,a.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;a.a.log("LocalIndexedDBStoreBackend.connect: upgrading from ".concat(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=()=>{a.a.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},a.a.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),l(e).then(e=>(a.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])=>{a.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),a=[];let s=!1;i.onsuccess=e=>{const n=e.target.result;if(!n)return a.length||s?t(a):t(null);const o=n.value;o.oob_written?s=!0:a.push(o),n.continue()},i.onerror=e=>{n(e)}}).then(t=>(a.a.log("LL: got ".concat(t&&t.length)+" membershipEvents from storage for room ".concat(e," ...")),t))},setOutOfBandMembers:async function(e,t){a.a.log("LL: backend about to store ".concat(t.length)+" members for ".concat(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),a.a.log("LL: backend done storing for ".concat(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,s]=await Promise.all([o,r]),c=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),l=IDBKeyRange.bound([e,i],[e,s]);var d;a.a.log("LL: Deleting all users + marker in storage for "+"room ".concat(e,", with key range:"),[e,i],[e,s]),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)=>{a.a.log("Removing indexeddb instance: ".concat(this._dbName));const n=this.indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{a.a.log("can't yet delete indexeddb ".concat(this._dbName)+" because it is open elsewhere")},n.onerror=t=>{a.a.warn("unable to delete js-sdk store indexeddb: ".concat(t.target.error)),e()},n.onsuccess=()=>{a.a.log("Removed indexeddb instance: ".concat(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 a.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(()=>s(this.db.transaction(["users"],"readonly").objectStore("users"),void 0,e=>[e.value.userId,e.value.event]))},_loadAccountData:function(){return a.a.log("LocalIndexedDBStoreBackend: loading account data..."),r.x(()=>s(this.db.transaction(["accountData"],"readonly").objectStore("accountData"),void 0,e=>e.value).then(e=>(a.a.log("LocalIndexedDBStoreBackend: loaded account data"),e)))},_loadSyncData:function(){return a.a.log("LocalIndexedDBStoreBackend: loading sync data..."),r.x(()=>s(this.db.transaction(["sync"],"readonly").objectStore("sync"),void 0,e=>e.value).then(e=>(a.a.log("LocalIndexedDBStoreBackend: loaded sync data"),e.length>1&&a.a.warn("loadSyncData: More than 1 sync row found."),e.length>0?e[0]:{})))},getClientOptions:function(){return Promise.resolve().then(()=>s(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.","㏵":"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.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"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点","𝟔":"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点","ଃ":"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点","⍺":"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/o","℆":"c/u","⋴":"ꞓ","ɛ":"ꞓ","ε":"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ","є":"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ","Є":"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"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","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\'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀","œ":"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(720)},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 f})),n.d(t,"c",(function(){return _})),n.d(t,"f",(function(){return v})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return y})),n.d(t,"i",(function(){return E})),n.d(t,"d",(function(){return S})),n.d(t,"j",(function(){return w}));var o=n(8),r=n.n(o),i=n(723),a=n.n(i),s=n(33),c=n.n(s),l=n(40),u=n(50),d=n(1435);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["%\\(".concat(n,"\\)s")]=t[n];o=g(o,e)}if(void 0!==n){const e={};for(const t in n)e["(<".concat(t,">(.*?)<\\/").concat(t,">|<").concat(t,">|<").concat(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=a.a.translate(e,t);return void 0===o&&void 0!==n&&(o=a.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 a=!1;for(const e in n){const s=n[e];if("string"!=typeof s)continue;let c=i.exec(s);if(!c)continue;a=!0;const l=s.substr(0,c.index),u=[];let d;for(;c;){d=c;const e=c.slice(2);let n,a;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(s),c){const e=d.index+d[0].length;a=s.substr(e,c.index-e)}else a=s.substr(d.index+d[0].length);a&&u.push(a)}n.splice(e,1,...u),""!==l&&n.splice(e,0,l)}a||"%\\(count\\)s"!==r&&console.log("Could not find ".concat(i," in ").concat(e))}return o?c.a.createElement("span",null,...n):n.join("")}function f(e){Array.isArray(e)||(e=[e]);const t=u.a.get();let n,o;return t&&t.setLanguage(e),C().then(t=>{o=t;for(let t=0;t{if(a.a.registerTranslations(n,e),a.a.setLocale(n),l.b.setValue("language",null,l.a.DEVICE,n),console.log("set language to "+n),"en"!==n)return x("i18n/"+o.en.fileName)}).then(e=>{e&&a.a.registerTranslations("en",e)})}function _(){return C().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 y(e){const t=[],n=E(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 E(e){return e.toLowerCase().replace("_","-")}function S(){return a.a.getLocale()}function w(e){const t=S(),n=e.map(E);{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 C(){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 x(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)))})})}a.a.setSeparator("|"),a.a.setFallbackLocale("en")},function(e,t,n){e.exports=n(765)()},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 a}));var o=n(762);function r(e){o.a.load(e)}function i(){o.a.reset()}function a(e){return o.a.getComponent(e)}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return b}));var o=n(44),r=n(1),i=n(85),a=n(226),s=n(36),c=n(650),l=n(40),u=n(1426),d=n(41),h=n(124),p=n(225),m=n(289),g=n(102),f=n(84),_=n(125);class v{constructor(){this.matrixClient=null,this._justRegisteredUserId=null,this.opts={initialSyncLimit:20},this._currentClientCreds=null}setIndexedDbWorkerScript(e){c.a.indexedDbWorkerScript=e}get(){return this.matrixClient}unset(){this.matrixClient=null,u.a.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 t of["indexeddb","memory"])try{const e=this.matrixClient.store.startup();console.log("MatrixClientPeg: waiting for MatrixClient store to initialise"),await e;break}catch(n){if("indexeddb"!==t)throw console.error("Failed to start memory store!",n),n;console.error("Error starting matrixclient store - falling back to memory store",n),this.matrixClient.store=new o.l({localStorage:e.localStorage})}m.c(this.matrixClient);try{!l.b.getValue("lowBandwidth")&&this.matrixClient.initCrypto&&(await this.matrixClient.initCrypto(),this.matrixClient.setCryptoTrustCrossSignedDevices(!l.b.getValue("e2ee.manuallyVerifyAllSessions")),m.b(!0))}catch(e){if(e&&"InvalidCryptoStoreError"===e.name){const e=s.getComponent("views.dialogs.CryptoStoreTooNewDialog");d.a.createDialog(e,{host:window.location.host})}console.warn("Unable to initialise e2e",e)}const t=r.c(this.opts);return t.pendingEventOrdering="detached",t.lazyLoadMembers=!0,u.a.start(this.matrixClient),p.a.matrixClient=this.matrixClient,t}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,timelineSupport:!0,forceTURN:!l.b.getValue("webRtcAllowPeerToPeer",!1),fallbackICEServerAllowed:!!l.b.getValue("fallbackICEServerAllowed"),verificationMethods:[h.d.SAS,_.d,h.d.RECIPROCATE_QR_CODE],unstableClientRelationAggregation:!0,identityServer:new g.a,cryptoCallbacks:{}};Object.assign(t.cryptoCallbacks,f.c),this.matrixClient=Object(c.a)(t),this.matrixClient.setMaxListeners(500),this.matrixClient.setGuest(Boolean(e.guest));const n=new a.a(null,{timelineSupport:!0});n.getLiveTimeline().setPaginationToken("",i.a.BACKWARDS),this.matrixClient.setNotifTimelineSet(n)}}e.mxMatrixClientPeg||(e.mxMatrixClientPeg=new v);const b=e.mxMatrixClientPeg}).call(this,n(17))},function(e,t,n){"use strict";var o=n(33),r=n(941);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){var o=n(763),r=n.n(o);class i extends r.a.Dispatcher{dispatch(e,t){"function"!=typeof e?t?super.dispatch(e):setTimeout(super.dispatch.bind(this,e),0):e(e=>{this.dispatch(e,t)})}}void 0===e.mxDispatcher&&(e.mxDispatcher=new i),t.a=e.mxDispatcher}).call(this,n(17))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return x}));var o=n(3),r=n.n(o),i=n(734),a=n(1427),s=n(1428),c=n(1429),l=n(1430),u=n(1431),d=n(1432),h=n(34),p=n(45),m=n(39),g=n(1451),f=n(1433),_=n(1434);const v={DEVICE:"device",ROOM_DEVICE:"room-device",ROOM_ACCOUNT:"room-account",ACCOUNT:"account",ROOM:"room",CONFIG:"config",DEFAULT:"default"},b=new _.a,y={},E={},S=[];for(const e of Object.keys(g.a))y[e]=g.a[e].default,g.a[e].isFeature&&S.push(e),g.a[e].invertedSettingName&&(E[e]=!g.a[e].default);const w={device:new i.a(S,b),"room-device":new a.a(b),"room-account":new c.a(b),account:new l.a(b),room:new u.a(b),config:new d.a,default:new s.a(y,E)};for(const e of Object.keys(w))w[e]=new f.a(w[e]);const C=["device","room-device","room-account","account","room","config","default"];class x{static watchSetting(e,t,n){const o=g.a[e],r=e;if(!o)throw new Error("".concat(e," is not a setting"));o.invertedSettingName&&(e=o.invertedSettingName);const i="".concat((new Date).getTime(),"_").concat(x._watcherCount++,"_").concat(e,"_").concat(t),a=(e,t,o)=>{const i=x.getValue(r);n(r,e,t,o,i)};return console.log("Starting watcher for ".concat(e,"@").concat(t||""," as ID ").concat(i)),x._watchers[i]=a,b.watchSetting(e,t,a),i}static unwatchSetting(e){x._watchers[e]?(console.log("Ending watcher ID ".concat(e)),b.unwatchSetting(x._watchers[e]),delete x._watchers[e]):console.warn("Ending non-existent watcher ID ".concat(e))}static monitorSetting(e,t){this._monitors[e]||(this._monitors[e]={});const n=()=>{this._monitors[e][t]=x.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]))x.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=>x.isFeature(e));return p.a.get().enableLabs?e:e.filter(e=>"labs"===x._getFeatureState(e))}static isFeature(e){return!!g.a[e]&&g.a[e].isFeature}static isFeatureEnabled(e,t=null){if(!x.isFeature(e))throw new Error("Setting "+e+" is not a feature");return x.getValue(e,t)}static setFeatureEnabled(e,t){if(!g.a[e])throw new Error("Setting '"+e+"' does not appear to be a setting.");if(!x.isFeature(e))throw new Error("Setting "+e+" is not a feature");return x.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:C;return x.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 a=i.supportedLevelsAreOrdered?i.supportedLevels:C;a.includes("default")||a.push("default");const s=a.indexOf(e);if(-1===s)throw new Error("Level "+e+" is not prioritized");if(x.isFeature(t)){const e=x._getFeatureState(t);if("enable"===e)return!0;if("disable"===e)return!1}const c=x._getHandlers(t);if(i.invertedSettingName&&(t=i.invertedSettingName),o){const o=c[e];if(!o)return x._getFinalValue(i,e,n,null,null);const r=o.getValue(t,n);return x._getFinalValue(i,e,n,r,e)}for(let o=s;o")),console.log("--- default level order: ".concat(JSON.stringify(C))),console.log("--- registered handlers: ".concat(JSON.stringify(Object.keys(w))));const o=e=>{for(const n of Object.keys(w)){const o=w[n];try{const r=o.getValue(e,t);console.log("--- ".concat(n,"@").concat(t||""," = ").concat(JSON.stringify(r)))}catch(e){console.log("--- ".concat(o,"@").concat(t||""," THREW ERROR: ").concat(e.message)),console.error(e)}if(t)try{const t=o.getValue(e,null);console.log("--- ".concat(n,"@ = ").concat(JSON.stringify(t)))}catch(e){console.log("--- ".concat(o,"@ THREW ERROR: ").concat(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=x.getValue(e,t);console.log("--- SettingsStore#generic@".concat(t||""," = ").concat(JSON.stringify(n)))}catch(e){console.log("--- SettingsStore#generic@".concat(t||""," THREW ERROR: ").concat(e.message)),console.error(e)}if(t)try{const t=x.getValue(e,null);console.log("--- SettingsStore#generic@ = ".concat(JSON.stringify(t)))}catch(e){console.log("--- SettingsStore#generic@$ THREW ERROR: ".concat(e.message)),console.error(e)}for(const n of C){try{const o=x.getValueAt(n,e,t);console.log("--- SettingsStore#".concat(n,"@").concat(t||""," = ").concat(JSON.stringify(o)))}catch(e){console.log("--- SettingsStore#".concat(n,"@").concat(t||""," THREW ERROR: ").concat(e.message)),console.error(e)}if(t)try{const t=x.getValueAt(n,e,null);console.log("--- SettingsStore#".concat(n,"@ = ").concat(JSON.stringify(t)))}catch(e){console.log("--- SettingsStore#".concat(n,"@$ THREW ERROR: ").concat(e.message)),console.error(e)}}};o(e),n.invertedSettingName&&(console.log("--- TESTING INVERTED SETTING NAME"),console.log("--- inverted: ".concat(n.invertedSettingName)),o(n.invertedSettingName)),console.log("--- END DEBUG")}static _getHandler(e,t){const n=x._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(!w[n])throw new Error("Unexpected level "+n);x.isLevelSupported(n)&&(t[n]=w[n])}return t.default||(t.default=w.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()(x,"_watchers",{}),r()(x,"_monitors",{}),r()(x,"_watcherCount",1),e.mxSettingsStore=x}).call(this,n(17))},function(e,t,n){"use strict";(function(e){var o=n(46),r=n.n(o),i=n(33),a=n.n(i),s=n(57),c=n.n(s),l=n(58),u=n(39),d=n(70),h=n(375);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={},[s,c]=this._getCloseFn(i,t),l=this._counter++;return i.elem=a.a.createElement(h.a,r()({key:l,prom:e},t,{onFinished:s})),i.onFinished=t?t.onFinished:null,i.className=n,i.onBeforeClose=o.onBeforeClose,i.beforeClosePromise=null,i.close=s,i.closeReason=null,{modal:i,closeDialog:s,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:a,closeDialog:s,onFinishedProm:c}=this._buildModal(e,t,n,i);return o?this._priorityModal=a:r?this._staticModal=a:this._modals.unshift(a),this._reRender(),{close:s,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=a.a.createElement("div",{className:e},a.a.createElement("div",{className:"mx_Dialog"},this._staticModal.elem),a.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=a.a.createElement("div",{className:t},a.a.createElement("div",{className:"mx_Dialog"},e.elem),a.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 a(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 a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.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?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,o){var r,i,a,s;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),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=o?[n,a]:[a,n]:o?a.unshift(n):a.push(n),(r=u(e))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}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&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var l=c.length,u=f(c,l);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=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},s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},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 C})),n.d(t,"b",(function(){return x})),n.d(t,"d",(function(){return T})),n.d(t,"c",(function(){return k})),n.d(t,"e",(function(){return R})),n.d(t,"f",(function(){return O})),n.d(t,"j",(function(){return D})),n.d(t,"g",(function(){return I})),n.d(t,"k",(function(){return F})),n.d(t,"i",(function(){return N})),n.d(t,"h",(function(){return A}));var o=n(46),r=n.n(o),i=n(56),a=n.n(i),s=n(3),c=n.n(s),l=n(33),u=n.n(l),d=n(57),h=n.n(d),p=n(35),m=n.n(p),g=n(42),f=n.n(g),_=n(48),v=n(36),b=n(43);function y(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 E(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&&!w.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===_.a.ESCAPE&&(this.props.onFinished(),e.stopPropagation(),e.preventDefault()));let t=!0;switch(e.key){case _.a.TAB:case _.a.ESCAPE:this.props.onFinished();break;case _.a.ARROW_UP:this._onMoveFocus(e.target,!0);break;case _.a.ARROW_DOWN:this._onMoveFocus(e.target,!1);break;case _.a.HOME:this._onMoveFocusHomeEnd(this.state.contextMenuElem,!0);break;case _.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 a=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 s;a&&(s=u.a.createElement("div",{style:i,className:"mx_ContextualMenu_chevron_"+n}));const c=f()({mx_ContextualMenu:!0,mx_ContextualMenu_left:!a&&t.left,mx_ContextualMenu_right:!a&&t.right,mx_ContextualMenu_top:!a&&t.top,mx_ContextualMenu_bottom:!a&&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:E({},t,{},d),onKeyDown:this._onKeyDown},u.a.createElement("div",{className:c,style:l,ref:this.collectContextMenuRect,role:this.props.managed?"menu":void 0},s,o.children),h)}render(){return h.a.createPortal(this.renderMenu(),S())}}c()(C,"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()(C,"defaultProps",{hasBackground:!0,managed:!0});const x=e=>{let{label:t,isExpanded:n,children:o}=e,i=a()(e,["label","isExpanded","children"]);const s=v.getComponent("elements.AccessibleButton");return u.a.createElement(s,r()({},i,{title:t,"aria-label":t,"aria-haspopup":!0,"aria-expanded":n}),o)};x.propTypes=E({},b.a.propTypes,{label:m.a.string,isExpanded:m.a.bool.isRequired});const T=e=>{let{children:t,label:n}=e,o=a()(e,["children","label"]);const i=v.getComponent("elements.AccessibleButton");return u.a.createElement(i,r()({},o,{role:"menuitem",tabIndex:-1,"aria-label":n}),t)};T.propTypes=E({},b.a.propTypes,{label:m.a.string,className:m.a.string,onClick:m.a.func.isRequired});const k=e=>{let{children:t,label:n}=e,o=a()(e,["children","label"]);return u.a.createElement("div",r()({},o,{role:"group","aria-label":n}),t)};k.propTypes={label:m.a.string.isRequired,className:m.a.string};const R=e=>{let{children:t,label:n,active:o=!1,disabled:i=!1}=e,s=a()(e,["children","label","active","disabled"]);const c=v.getComponent("elements.AccessibleButton");return u.a.createElement(c,r()({},s,{role:"menuitemcheckbox","aria-checked":o,"aria-disabled":i,tabIndex:-1,"aria-label":n}),t)};R.propTypes=E({},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 O=e=>{let{children:t,label:n,active:o=!1,disabled:i=!1}=e,s=a()(e,["children","label","active","disabled"]);const c=v.getComponent("elements.AccessibleButton");return u.a.createElement(c,r()({},s,{role:"menuitemradio","aria-checked":o,"aria-disabled":i,tabIndex:-1,"aria-label":n}),t)};O.propTypes=E({},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 N extends C{render(){return this.renderMenu(!1)}}function A(e,t){const n=function(...e){h.a.unmountComponentAtNode(S()),t&&t.onFinished&&t.onFinished.apply(null,e)},o=u.a.createElement(N,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(381).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){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"d",(function(){return g})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return _})),n.d(t,"e",(function(){return v})),n.d(t,"c",(function(){return b})),n.d(t,"i",(function(){return y})),n.d(t,"j",(function(){return E})),n.d(t,"b",(function(){return S})),n.d(t,"h",(function(){return C}));var o=n(37),r=n(938),i=n.n(r),a=n(1),s=n(374),c=n(274),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"".concat(this._riotUrl,"/#/room/").concat(e,"/").concat(t).concat(this.encodeServerCandidates(n))}forRoom(e,t){return"".concat(this._riotUrl,"/#/room/").concat(e).concat(this.encodeServerCandidates(t))}forUser(e){return"".concat(this._riotUrl,"/#/user/").concat(e)}forGroup(e){return"".concat(this._riotUrl,"/#/group/").concat(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=".concat(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("".concat(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(275),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 w().forEvent(this._roomId,e,this._serverCandidates)}forRoom(){return w().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=x(o),a="join"!==n&&"join"===r;"join"===n&&"join"!==r?this._populationMap[i]--:a&&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=x(e);return!R(n)&&!k(n,this._bannedHostsRegexps)&&k(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("^"+a.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=x(t.userId);e[n]||(e[n]=0),e[n]++}this._populationMap=e}_updateServerCandidates(){let e=[];this._highestPlUserId&&e.push(x(this._highestPlUserId));const t=Object.keys(this._populationMap).sort((e,t)=>this._populationMap[t]-this._populationMap[e]).filter(t=>!e.includes(t)&&!R(t)&&!k(t,this._bannedHostsRegexps)&&k(t,this._allowedHostsRegexps)).slice(0,3-e.length);e=e.concat(t),this._serverCandidates=e}}function g(e){return w().forEntity(e)}function f(e){return w().forUser(e)}function _(e){if(!e)throw new Error("can't permalink a falsey roomId");if("!"!==e[0])return w().forRoom(e,[]);const t=o.a.get().getRoom(e);if(!t)return w().forRoom(e,[]);const n=new m(t);return n.load(),n.forRoom()}function v(e){return w().forGroup(e)}function b(e){return!!(new s.b).isPermalinkHost(e)||w().isPermalinkHost(e)}function y(e){return e?"#"===e[0]||"!"===e[0]?_(e):"@"===e[0]?f(e):"+"===e[0]?v(e):E(e):null}function E(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=C(e);if(t)if(t.roomIdOrAlias){const n=t.eventId?"/".concat(t.eventId):"";e="#/room/".concat(t.roomIdOrAlias).concat(n)}else t.groupId?e="#/group/".concat(t.groupId):t.userId&&(e="#/user/".concat(t.userId))}catch(e){}return e}function S(e){try{let t=C(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/#".concat(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 w(){const e=p.a.get().permalinkPrefix;return e&&e!==s.a?new d(e):new s.b}function C(e){const t=p.a.get().permalinkPrefix;return e.startsWith(s.a)?(new s.b).parsePermalink(e):t&&e.startsWith(t)?new d(t).parsePermalink(e):null}function x(e){return e.split(":").splice(1).join(":")}function T(e){return e?new URL("https://".concat(e)).hostname:null}function k(e,t){if(!(e=T(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 R(e){return!!(e=T(e))&&(e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),i()(e))}},function(e,t,n){"use strict";var o=n(735),r=n(736);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 a=/^([a-z0-9.+-]+:)/i,s=/:[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},f={javascript:!0,"javascript:":!0},_={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("?"),s=-1!==i&&i127?N+="x":N+=F[A];if(!N.match(p)){var P=D.slice(0,k),L=D.slice(k+1),U=F.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(),O||(this.hostname=o.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[S])for(k=0,I=u.length;k0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.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(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var x=w.slice(-1)[0],T=(n.host||e.host||w.length>1)&&("."===x||".."===x)||""===x,k=0,R=w.length;R>=0;R--)"."===(x=w[R])?w.splice(R,1):".."===x?(w.splice(R,1),k++):k&&(w.splice(R,1),k--);if(!E&&!S)for(;k--;k)w.unshift("..");!E||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),T&&"/"!==w.join("/").substr(-1)&&w.push("");var O,D=""===w[0]||w[0]&&"/"===w[0].charAt(0);C&&(n.hostname=n.host=D?"":w.length?w.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift()));return(E=E||n.host&&w.length)&&!D&&w.unshift(""),w.length?n.pathname=w.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=s.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){var o=n(195);e.exports=function(e,t){if(null==e)return{};var n,r,i=o(e,t);if(Object.getOwnPropertySymbols){var a=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";!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(719)},function(e,t,n){"use strict";(function(e){var o=n(3),r=n.n(o),i=n(33),a=n.n(i),s=n(34),c=n(50),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}const p=/#\/(groups?|room|user|settings|register|login|forgot_password|home|directory)/,m=/#\/(group|room|user)\/.*$/;function g(){const{origin:e,hash:t}=window.location;let{pathname:n}=window.location;return e.startsWith("file://")&&(n="//"),e+n+function(e){return p.exec(e)?m.test(e)?e.replace(m,"#/$1/"):e.replace(p,"#/$1"):(console.warn('Unexpected hash location "'.concat(e,'"')),"#/")}(t)}const f={"App Platform":{id:1,expl:Object(s.b)("The platform you're on"),example:"Electron Platform"},"App Version":{id:2,expl:Object(s.b)("The version of Riot"),example:"15.0.0"},"User Type":{id:3,expl:Object(s.b)("Whether or not you're logged in (we don't record your username)"),example:"Logged In"},"Chosen Language":{id:4,expl:Object(s.b)("Your language of choice"),example:"en"},Instance:{id:5,expl:Object(s.b)("Which officially provided instance you are using, if any"),example:"app"},"RTE: Uses Richtext Mode":{id:6,expl:Object(s.b)("Whether or not you're using the Richtext mode of the Rich Text Editor"),example:"off"},"Homeserver URL":{id:7,expl:Object(s.b)("Your homeserver's URL"),example:"https://matrix.org"},"Touch Input":{id:8,expl:Object(s.b)("Whether you're using Riot on a device where touch is the primary input mechanism"),example:"false"},Breadcrumbs:{id:9,expl:Object(s.b)("Whether or not you're using the 'breadcrumbs' feature (avatars above the room list)"),example:"disabled"},"Installed PWA":{id:10,expl:Object(s.b)("Whether you're using Riot as an installed Progressive Web App"),example:"false"}};const _="mx_Riot_Analytics_uid";class v{constructor(){r()(this,"showDetailsModal",()=>{let e=[];e=this.disabled?Object.keys(f).map(e=>[e,Object(s.a)("e.g. %(exampleValue)s",{exampleValue:f[e].example})]):Object.values(this.visitVariables);const t="".concat(window.screen.width,"x").concat(window.screen.height),n=[{expl:Object(s.b)("Every page you use in the app"),value:Object(s.a)("e.g. ",{},{CurrentPageURL:g()})},{expl:Object(s.b)("Your user agent"),value:navigator.userAgent},{expl:Object(s.b)("Your device resolution"),value:t}],o=d.getComponent("dialogs.ErrorDialog");u.a.createTrackedDialog("Analytics Details","",o,{title:Object(s.a)("Analytics"),description:a.a.createElement("div",{className:"mx_AnalyticsModal"},a.a.createElement("div",null,Object(s.a)("The information being sent to us to help make Riot better includes:")),a.a.createElement("table",null,e.map(e=>a.a.createElement("tr",{key:e[0]},a.a.createElement("td",null,Object(s.a)(f[e[0]].expl)),void 0!==e[1]&&a.a.createElement("td",null,a.a.createElement("code",null,e[1])))),n.map((e,t)=>a.a.createElement("tr",{key:t},a.a.createElement("td",null,Object(s.a)(e.expl)),a.a.createElement("td",null,a.a.createElement("code",null,e.value))))),a.a.createElement("div",null,Object(s.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(_);return!e&&localStorage&&localStorage.setItem(_,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(s.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(_),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=function(e){for(var t=1;t"))}setBreadcrumbs(e){this.disabled||this._setVisitVariable("Breadcrumbs",e?"enabled":"disabled")}}e.mxAnalytics||(e.mxAnalytics=new v),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),a=n.n(i),s=n(168),c=n(101),l=n(37);function u(e){return e.chunk.map(e=>Object(s.c)(e))}function d(e){return e.chunk.map(e=>Object(s.d)(e))}let h=0;const p=[];async function m(e){h>=3&&await new Promise((e,t)=>{p.push(e)}),h++;try{return await e()}catch(e){throw e}finally{h--,function(){const e=p.shift();"function"==typeof e&&e()}()}}class g extends a.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=>m(()=>l.a.get().getGroupSummary(e)),[this.STATE_KEY.GroupRooms]:e=>m(()=>l.a.get().getGroupRooms(e).then(d)),[this.STATE_KEY.GroupMembers]:e=>m(()=>l.a.get().getGroupUsers(e).then(u)),[this.STATE_KEY.GroupInvitedMembers]:e=>m(()=>l.a.get().getGroupInvitedUsers(e).then(u))}}_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 ".concat(e," for ").concat(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 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 g),t.a=f},function(e,t,n){"use strict";var o=n(39),r=n(137),i=n(37),a=n(36),s=n(41),c=n(34),l=n(654);const u={joining:!1,joinError:null,roomId:null,initialEventId:null,isInitialEventHighlighted:!1,roomAlias:null,roomLoading:!1,roomLoadError:null,forwardingEvent:null,quotingEvent:null,matrixClientIsReady:!1};class d extends r.Store{constructor(){super(o.a),this._state=u,i.a.get()&&(this._state.matrixClientIsReady=i.a.get().isInitialSyncComplete())}_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=a.getComponent("dialogs.RoomSettingsDialog");s.a.createTrackedDialog("Room settings","",t,{roomId:e.room_id||this._state.roomId},null,!1,!0);break}case"sync_state":this._setState({matrixClientIsReady:i.a.get()&&i.a.get().isInitialSyncComplete()})}}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 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);t&&t.startsWith("CORS request rejected")&&(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=a.getComponent("dialogs.ErrorDialog");s.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&&this._state.matrixClientIsReady}}let h=null;h||(h=new d),t.a=h},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 f})),n.d(t,"pkVerify",(function(){return _})),n.d(t,"encodeBase64",(function(){return v})),n.d(t,"encodeUnpaddedBase64",(function(){return b})),n.d(t,"decodeBase64",(function(){return y}));var r=n(0),i=n(1),a=n(234),s=n.n(a);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,a,s,c){const l=s.getIdentityKey(),u=await o.getSessionIdForDevice(l);if(null===u)return;r.a.log("Using sessionid "+u+" for device "+a+":"+s.deviceId);const d={sender:t,sender_device:n,keys:{ed25519:o.deviceEd25519Key},recipient:a,recipient_keys:{ed25519:s.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,a]of Object.entries(n))for(const n of a){const a=n.deviceId,s=n.getIdentityKey();i.push((async()=>{const i=await e.getSessionIdForDevice(s,!0);null===i?(o[t]=o[t]||[],o[t].push(n)):(r[t]=r[t]||{},r[t][a]={device:n,sessionId:i})})())}return await Promise.all(i),[o,r]}async function p(e,t,n,o,i,a){"number"==typeof o&&(a=i,i=o,o=!1);const s=[],c={},l={};for(const[t,r]of Object.entries(n)){c[t]={};for(const n of r){const r=n.deviceId,i=n.getIdentityKey();e._sessionsInProgress[i]||(e._sessionsInProgress[i]=new Promise((t,n)=>{l[i]={resolve:(...n)=>{delete e._sessionsInProgress[i],t(...n)},reject:(...t)=>{delete e._sessionsInProgress[i],n(...t)}}}));const a=await e.getSessionIdForDevice(i,l[i]);null!==a&&l[i]&&(delete e._sessionsInProgress[i],l[i].resolve(),delete l[i]),(null===a||o)&&s.push([t,r]),c[t][r]={device:n,sessionId:a}}}if(0===s.length)return c;let u;try{u=await t.claimOneTimeKeys(s,"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,s),e}a&&"failures"in u&&a.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 a=0;a{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 a;try{a=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 "+a+" for device "+n+":"+i),a}async function g(e,t,n,o,r){const i="ed25519:"+o,a=((t.signatures||{})[n]||{})[i];if(!a)throw Error("No signature");const c=Object.assign({},t);delete c.unsigned,delete c.signatures;const l=s.a.stringify(c);e.verifySignature(r,l,a)}function f(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 a=t.signatures||{};delete t.signatures;const c=t.unsigned;t.unsigned&&delete t.unsigned;try{const e=a[o]||{};return a[o]=e,e["ed25519:"+r]=n.sign(s.a.stringify(t))}finally{t.signatures=a,c&&(t.unsigned=c),i&&n.free()}}function _(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],a=new e.Olm.Utility,c=t.signatures;delete t.signatures;const l=t.unsigned;t.unsigned&&delete t.unsigned;try{a.ed25519_verify(n,s.a.stringify(t),i)}finally{t.signatures=c,l&&(t.unsigned=l),a.free()}}function v(e){return o.from(e).toString("base64")}function b(e){return v(e).replace(/=+$/g,"")}function y(e){return o.from(e,"base64")}}.call(this,n(17),n(86).Buffer)},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(192)),r=i(n(80));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 a=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 a(e,t)}))))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(37),r=n(269),i=n.n(r);n(108);class a{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 a._sharedInstance=new a(o.a.get()),a._sharedInstance}static shared(){return a._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,"c",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return s})),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 a(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 s(e){return e.match(/.{1,4}/g).join(" ")}function c(e){const t=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";n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return p}));var o=n(3),r=n.n(o),i=n(33),a=n.n(i),s=n(44),c=n(34),l=n(653),u=n(45);const d=[s.a.ERROR_INVALID_HOMESERVER,s.a.ERROR_INVALID_IDENTITY_SERVER];class h{constructor(){r()(this,"hsUrl",void 0),r()(this,"hsName",void 0),r()(this,"hsNameIsDifferent",void 0),r()(this,"isUrl",void 0),r()(this,"isDefault",void 0),r()(this,"warning",void 0)}}class p{static isLivelinessError(e){return!!e&&!!d.find(t=>t===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=>a.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)===s.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:a.a.createElement("div",null,a.a.createElement("strong",null,n),a.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 s.a.fromDiscoveryConfig(o),i=new URL(e).hostname;return p.buildValidatedConfigFromDiscovery(i,r,n)}static async validateServerName(e){const t=await s.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 a=i&&i.isUrl;if(r&&r.state===s.a.SUCCESS)a=r.base_url;else if(r&&r.state!==s.a.PROMPT){if(console.error("Error determining preferred identity server URL:",r),r.state===s.a.FAIL_ERROR){if(-1!==s.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=s.a.ERROR_INVALID_IDENTITY_SERVER,r.base_url&&(a=r.base_url)}if(o.state!==s.a.SUCCESS&&(console.error("Error processing homeserver config:",o),!n||!p.isLivelinessError(o.error))){if(-1!==s.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:a,isDefault:!1,warning:o.error})}}},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,a=!1,s=function(e,n){return t(e,r[n])},c=function(){for(var t=arguments.length,o=Array(t),c=0;c{const r=n[e],i=t[e];i&&"string"==typeof i&&R.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:O,allowProtocolRelative:!1,transformTags:A},P=Object.assign({},M);P.transformTags={code:A.code,"*":A["*"]};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 a=e.substring(o,n);r=r.concat(this._applySubHighlights(a,t))}const s=n+i.length;r.push(this._processSnippet(e.substring(n,s),!0)),o=s}return o!==e.length&&(a=e.substring(o,void 0),r=r.concat(this._applySubHighlights(a,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 j(e,t,n={}){const r="org.matrix.custom.html"===e.format&&e.formatted_body;let a,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 s()(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)),a=n.stripReplyFallback?o.a.stripPlainReply(p):p,h=r?i:p,u=w.test(h)||C.test(h),r&&(l=!0,c=s()(i,d))}finally{delete d.textFilter}var h;if(n.returnString)return l?c:a;let p=!1;if(!n.disableBigEmoji&&u){let t=void 0!==a?a.trim():"";t=t.replace(T,""),t=t.replace(x,"");const n=k.exec(t);p=n&&n[0]&&n[0].length===t.length&&(null==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"},a)}function B(e,t=l.a.options){return d()(e,t)}function q(e,t=l.a.options){return s()(function(e,t=l.a.options){return p()(e,t)}(e,t),M)}function G(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 a(e){return(e<10?"0":"")+e}function s(e,t=!1){let n=e.getHours()%12;const r=a(e.getMinutes()),i=e.getHours()>=12?Object(o.a)("PM"):Object(o.a)("AM");if(n=n||12,t){const t=a(e.getSeconds());return"".concat(n,":").concat(r,":").concat(t).concat(i)}return"".concat(n,":").concat(r).concat(i)}function c(e,t=!1){const n=new Date,a=r(),s=i();return e.toDateString()===n.toDateString()?h(e,t):n.getTime()-e.getTime()<5184e5?Object(o.a)("%(weekDayName)s %(time)s",{weekDayName:a[e.getDay()],time:h(e,t)}):n.getFullYear()===e.getFullYear()?Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(time)s",{weekDayName:a[e.getDay()],monthName:s[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(),a=i();return Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s",{weekDayName:n[e.getDay()],monthName:a[e.getMonth()],day:e.getDate(),fullYear:e.getFullYear(),time:d(e,t)})}function d(e,t=!1){return t?s(e,!0):a(e.getHours())+":"+a(e.getMinutes())+":"+a(e.getSeconds())}function h(e,t=!1){return t?s(e):a(e.getHours())+":"+a(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";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 a}));const o=(e,t)=>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 a(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}))))}},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),a=n(36),s=n(41),c=n(1452),l=n(73),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 ".concat(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=a.getComponent("dialogs.IntegrationsImpossibleDialog");s.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=a.getComponent("views.dialogs.TabbedIntegrationManagerDialog");s.a.createTrackedDialog("Tabbed Integration Manager","",o,{room:e,screen:t,integrationId:n},"mx_TabbedIntegrationManagerDialog")}showDisabledDialog(){const e=a.getComponent("dialogs.IntegrationsDisabledDialog");s.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://".concat(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 r})),n.d(t,"b",(function(){return i}));var o=n(1);function r(e,t,n,r,i,a){if("string"!=typeof t||!t)return"";if(0!==t.indexOf("mxc://"))return a?t:"";let s=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=s.indexOf("#");let d="";return u>=0&&(d=s.substr(u),s=s.substr(0,u)),e+c+s+(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 h}));var o=n(37),r=n(45),i=n(39),a=n(55),s=n(204),c=n(40),l=n(139),u=n(71),d=n(5);class h{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 ".concat(e," is not recognised")),!1;const r=t.credentials.userId;return r?"join"!==n.getMyMembership()?(console.warn("User ".concat(r," is not in room ").concat(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=a.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 a(e){i(o.a.get().getAccountData("m.widgets"))&&(o.a.get().removeListener("accountData",a),clearTimeout(s),n())}const s=setTimeout(()=>{o.a.get().removeListener("accountData",a),r(new Error("Timed out waiting for widget ID "+e+" to appear"))},2e4);o.a.get().on("accountData",a)})}static waitForRoomWidget(e,t,n){return new Promise((r,i)=>{function a(t){const o=t.some(t=>t.getContent()&&t.getContent().id===e);return n?o:!o}const s=o.a.get().getRoom(t);if(a(s.currentState.getStateEvents("im.vector.modular.widgets")))return void r();function c(e){if(e.getRoomId()!==t)return;a(s.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,a){const s={type:t,url:n,name:r,data:a},c=o.a.get(),l=JSON.parse(JSON.stringify(h.getUserWidgets()));try{delete l[e]}catch(e){console.error("$widgetId is non-configurable")}const u=Boolean(n);return u&&(l[e]={content:s,sender:c.getUserId(),state_key:e,type:"m.widget",id:e}),c.setAccountData("m.widgets",l).then(()=>h.waitForUserWidget(e,u)).then(()=>{i.a.dispatch({action:"user_widget_updated"})})}static setRoomWidget(e,t,n,r,i,a){let c;const l=Boolean(r);return c=l?{type:n,url:r,name:i,data:a}:{},s.a.setRoomWidgetEcho(e,t,c),o.a.get().sendStateEvent(e,"im.vector.modular.widgets",c,t).then(()=>h.waitForRoomWidget(t,e,l)).finally(()=>{s.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(h.getUserWidgets())}static getStickerpickerWidgets(){return h.getUserWidgetsArray().filter(e=>e.content&&"m.stickerpicker"===e.content.type)}static getIntegrationManagerWidgets(){return h.getUserWidgetsArray().filter(e=>e.content&&"m.integration_manager"===e.content.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 h.setUserWidget("integration_manager_"+(new Date).getTime(),"m.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"jitsi"===e&&n.push(d.a.AlwaysOnScreen),n}static getWidgetSecurityKey(e,t,n){let o=l.a.getRoomId(e);if(n){const n=h.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("".concat(o,"::").concat(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;return"https:"===window.location.protocol||e.forLocalRender||(n="https://riot.im/app/"),new URL("jitsi.html#"+t,n).href}}},function(e,t){e.exports="img/cancel.4b9715b.svg"},function(e,t){e.exports="img/warning.05cc423.svg"},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return l}));var o=n(49),r=n(1),i=n(0);const a={NOT_SENT:"not_sent",ENCRYPTING:"encrypting",SENDING:"sending",QUEUED:"queued",SENT:"sent",CANCELLED:"cancelled"},s={};function c(e){return s[e]||(s[e]=e),s[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){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 encrypted");return this._decryptionPromise?(i.a.log("Event ".concat(this.getId()," already being decrypted; queueing a retry")),this._retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this._decryptionLoop(e),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){for(await Promise.resolve();;){let t,n;this._retryDecryption=!1;try{t=e?await e.decryptEvent(this):this._badEncryptedMessage("Encryption not enabled")}catch(e){if("DecryptionError"!==e.name)return i.a.error("Error decrypting event (id=".concat(this.getId(),"): ").concat(e.stack||e)),this._decryptionPromise=null,void(this._retryDecryption=!1);if(n=e,this._retryDecryption){i.a.log("Got error decrypting event (id=".concat(this.getId(),": ")+"".concat(e,"), but retrying"));continue}i.a.warn("Error decrypting event (id=".concat(this.getId(),"): ").concat(e.detailedString)),t=this._badEncryptedMessage(e.message)}return this._decryptionPromise=null,this._retryDecryption=!1,this._setClearData(t),this.setPushActions(null),void this.emit("Event.decrypted",this,n)}},_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){var o=n(244)("wks"),r=n(190),i=n(89).Symbol,a="function"==typeof i;(e.exports=function(e){return o[e]||(o[e]=a&&i[e]||(a?i:r)("Symbol."+e))}).store=o},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){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(327),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(343),r="object"==typeof self&&self&&self.Object===Object&&self,i=o||r||Function("return this")();e.exports=i},function(e,t,n){"use strict";(function(e){var o=n(37),r=n(50),i=n(41),a=n(36),s=n(34),c=n(44),l=n(39),u=n(276),d=n(73),h=n(204),p=n(40),m=n(943),g=n(376);e.mxCalls={};const f=e.mxCalls;let _=null;const v={};function b(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)}};v[e]?v[e]=v[e].then(()=>(t.load(),n())):v[e]=n()}}function y(e){const t=document.getElementById(e);t&&(v[e]?v[e]=v[e].then(()=>t.pause()):v[e]=t.pause())}function E(e){e.on("error",(function(t){if(console.error("Call error:",t),"unknown_devices"===t.code){const t=a.getComponent("dialogs.QuestionDialog");i.a.createTrackedDialog("Call Failed","",t,{title:Object(s.a)("Call Failed"),description:Object(s.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(s.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(s.a)("Call Anyway"):Object(s.a)("Answer Anyway"),"outbound"===e.direction?Object(s.a)("Call"):Object(s.a)("Answer"))}}})}else{if(0===o.a.get().getTurnServers().length&&null===p.b.getValue("fallbackICEServerAllowed"))return void function(){const e=o.a.get(),t=a.getComponent("dialogs.QuestionDialog"),n=e=>React.createElement("code",null,e);i.a.createTrackedDialog("No TURN servers","",t,{title:Object(s.a)("Call failed due to misconfigured server"),description:React.createElement("div",null,React.createElement("p",null,Object(s.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(s.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(s.a)("Try using turn.matrix.org"),cancelButton:Object(s.a)("OK"),onFinished:t=>{p.b.setValue("fallbackICEServerAllowed",null,p.a.DEVICE,t),e.setFallbackICEServerAllowed(t)}},null,!0)}();const e=a.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Call Failed","",e,{title:Object(s.a)("Call Failed"),description:t.message})}})),e.on("hangup",(function(){S(void 0,e.roomId,"ended")})),e.on("state",(function(t,n){if("ringing"===t)S(e,e.roomId,"ringing"),y("ringbackAudio");else if("invite_sent"===t)S(e,e.roomId,"ringback"),b("ringbackAudio");else if("ended"===t&&"connected"===n)S(void 0,e.roomId,"ended"),y("ringbackAudio"),b("callendAudio");else if("ended"===t&&"invite_sent"===n&&("remote"===e.hangupParty||"local"===e.hangupParty&&"invite_timeout"===e.hangupReason)){S(e,e.roomId,"busy"),y("ringbackAudio"),b("busyAudio");const t=a.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Call Handler","Call Timeout",t,{title:Object(s.a)("Call Timeout"),description:Object(s.a)("The remote side failed to pick up")+"."})}else"invite_sent"===n?(S(e,e.roomId,"stop_ringback"),y("ringbackAudio")):"ringing"===n?(S(e,e.roomId,"stop_ringing"),y("ringbackAudio")):"connected"===t&&(S(e,e.roomId,"connected"),y("ringbackAudio"))}))}function S(e,t,n){console.log("Call state in ".concat(t," changed to ").concat(n," (").concat(e?e.call_state:"-",")")),f[t]=e,"ringing"===n?b("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=a.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","Existing Call",e,{title:Object(s.a)("Existing Call"),description:Object(s.a)("You are already in a call.")})}if(!o.a.get().supportsVoip()){const e=a.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","VoIP is unsupported",e,{title:Object(s.a)("VoIP is unsupported"),description:Object(s.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=a.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","Cannot place call with self",e,{description:Object(s.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(E(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){S(void 0,t.roomId,"ended"),console.log("Can't capture screen: "+n);const e=a.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call Handler","Unable to capture screen",e,{title:Object(s.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.u.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.getRoomWidgets(n);if(h.a.roomHasPendingWidgetsOfType(e,r,"jitsi")){const e=a.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Call already in progress","",e,{title:Object(s.a)("Call in Progress"),description:Object(s.a)("A call is currently being placed!")})}if(r.filter(e=>"jitsi"===e.getContent().type).length>0){console.warn("Refusing to start conference call widget in "+e+" a conference call widget is already present");const t=a.getComponent("dialogs.ErrorDialog");return void i.a.createTrackedDialog("Already have Jitsi Widget","",t,{title:Object(s.a)("Call in Progress"),description:Object(s.a)("A call is already in progress!")})}const c="JitsiConference".concat(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 _={conferenceId:c,isAudioOnly:"voice"===t,domain:u},v="jitsi_"+o.a.get().credentials.userId+"_"+Date.now();d.a.setRoomWidget(e,v,"jitsi",p,"Jitsi",_).then(()=>{console.log("Jitsi widget added")}).catch(e=>{if("M_FORBIDDEN"===e.errcode){const e=a.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Call Failed","",e,{title:Object(s.a)("Permission Required"),description:Object(s.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;E(t),S(t,t.roomId,"ringing")}break;case"hangup":if(!f[e.room_id])return;f[e.room_id].hangup(),S(null,e.room_id,"ended");break;case"answer":if(!f[e.room_id])return;f[e.room_id].answer(),S(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||(_&&(t=_.getConferenceCallForRoom(e)),t||null)},getCall:function(e){return f[e]||null},getAnyActiveCall:function(){const e=Object.keys(f);for(let t=0;t{const[v,b]=Object(o.useState)(!1),y=c()({mx_E2EIcon:!0,mx_E2EIcon_warning:t===p.WARNING,mx_E2EIcon_normal:t===p.NORMAL,mx_E2EIcon_verified:t===p.VERIFIED},n);let E;const S=Object(u.a)("feature_cross_signing");let w;S&&e?E=m[t]:S&&!e?E=g[t]:!S&&e?E=f[t]:S||e||(E=_[t]),i&&(w={width:"".concat(i,"px"),height:"".concat(i,"px")});const C=()=>b(!0),x=()=>b(!1);let T;return v&&!s&&(T=r.a.createElement(h.a,{label:E?Object(l.a)(E):""})),a?r.a.createElement(d.a,{onClick:a,onMouseOver:C,onMouseOut:x,className:y,style:w},T):r.a.createElement("div",{onMouseOver:C,onMouseOut:x,className:y,style:w},T)};v.propTypes={isUser:a.a.bool,status:a.a.oneOf(Object.values(p)),className:a.a.string,size:a.a.number,onClick:a.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 f})),n.d(t,"b",(function(){return _}));var o=n(41),r=n(36),i=n(37),a=n(237),s=n(238),c=n(34),l=n(40),u=n(61);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(a.a)(e,u.passphrase.salt,u.passphrase.iterations):Object(s.a)(t),g=r.getComponent("dialogs.secretstorage.AccessSecretStorageDialog"),{finished:f}=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)}),[_]=await f;if(!_)throw new m;const v=await h(_);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 a=i.a.get();if(e===a.getUserId())if(r&&r.isVerified()){if(o.startsWith("m.cross_signing")){const e=a.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 ".concat(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 ".concat(t,", but not found in cache")),n&&Object(u.encodeBase64)(n)}}else if("m.megolm_backup.v1"===o){const e=await a._crypto.getSessionBackupPrivateKey();return e||console.log("session backup key requested by ".concat(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 ".concat(t))}};async function f(){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 _(e=(async()=>{}),t=!1){const a=i.a.get();h=!0;try{if(!await a.hasSecretStorageKey()||t){const{finished:e}=o.a.createTrackedDialogAsync("Create Secret Storage dialog","",Promise.all([n.e(0),n.e(3)]).then(n.bind(null,1441)),{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 a.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:f})}return await e()}finally{h=!1,p()||(d={})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(231);function r(e){this._eventTimelineSet=e,this._roomId=e.room?e.room.roomId:null,this._events=[],this._baseIndex=0,this._startState=new o.a(this._roomId),this._startState.paginationToken=null,this._endState=new o.a(this._roomId),this._endState.paginationToken=null,this._prevTimeline=null,this._nextTimeline=null,this._paginationRequests={b:null,f:null},this._name=this._roomId+":"+(new Date).toISOString()}r.BACKWARDS="b",r.FORWARDS="f",r.prototype.initialiseState=function(e){if(this._events.length>0)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=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().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 B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(o)return B(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 O(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return x(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 f(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}function _(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,a=1,s=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;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(i=n;is&&(n=s-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 a=0;a>8,r=n%256,i.push(r),i.push(o);return i}(t,e.length-n),e,n,o)}function x(e,t,n){return 0===t&&n===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,n))}function T(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],a=e[r+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[r+1],a=e[r+2],s=e[r+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)>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),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),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 y(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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 k(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 F(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 N(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 A(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)||F(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||F(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||F(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(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):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(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):A(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);F(this,e,t,n,r-1,-r)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&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);F(this,e,t,n,r-1,-r)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(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||F(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(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):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(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):A(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(a+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 q(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 G(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){"use strict";e.exports=function(e,t,n,o,r,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,r,i,a,s],u=0;c=new Error("Invariant Violation: "+t.replace(/%s/g,(function(){return l[u++]})))}throw c.framesToPop=1,c}}},function(e,t,n){var o=n(89),r=n(66),i=n(240),a=n(126),s=n(111),c=function(e,t,n){var l,u,d,h=e&c.F,p=e&c.G,m=e&c.S,g=e&c.P,f=e&c.B,_=e&c.W,v=p?r:r[t]||(r[t]={}),b=v.prototype,y=p?o:m?o[t]:(o[t]||{}).prototype;for(l in p&&(n=t),n)(u=!h&&y&&void 0!==y[l])&&s(v,l)||(d=u?y[l]:n[l],v[l]=p&&"function"!=typeof y[l]?n[l]:f&&u?i(d,o):_&&y[l]==d?function(e){var t=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):g&&"function"==typeof d?i(Function.call,d):d,g&&((v.virtual||(v.virtual={}))[l]=d,e&c.R&&b&&!b[l]&&a(b,l,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var o=n(127),r=n(328),i=n(241),a=Object.defineProperty;t.f=n(91)?Object.defineProperty:function(e,t,n){if(o(e),t=i(t,!0),o(n),r)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(129)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){e.exports={default:n(772),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(327),i=(o=r)&&o.__esModule?o:{default:o};t.default=function(){function e(e,t){for(var n=0;n{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 a),t.a=e.singletonFlairStore}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(44),r=n(37),i=n(41),a=n(36),s=n(34),c=n(166),l=n(170),u=n(143);class d extends Error{}class h{constructor(e=null){this.accessToken=null,this.authEnabled=!0,this.tempClient=e?Object(o.s)({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.o.IS,t,e)]);throw n}if(!this.tempClient&&!Object(l.a)()&&!await Object(l.b)(t)){const e=a.getComponent("dialogs.QuestionDialog"),{finished:n}=i.a.createTrackedDialog("Default identity server terms warning","",e,{title:Object(s.a)("Identity server has no terms of service"),description:React.createElement("div",null,React.createElement("p",null,Object(s.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(s.a)("Only continue if you trust the owner of the server."))),button:Object(s.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";n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return p})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return g}));var o=n(37),r=n(41),i=n(36),a=n(34),s=n(39),c=n(144),l=n(63),u=n(142),d=n(40);function h(e){void 0===(e=e||{}).spinner&&(e.spinner=!0),void 0===e.guestAccess&&(e.guestAccess=!0),void 0===e.encryption&&(e.encryption=!1);const t=i.getComponent("dialogs.ErrorDialog"),n=i.getComponent("elements.Spinner"),l=o.a.get();if(l.isGuest())return s.a.dispatch({action:"require_registration"}),Promise.resolve(null);const d=e.dmUserId?"trusted_private_chat":"private_chat",h=e.createOpts||{};if(h.preset=h.preset||d,h.visibility=h.visibility||"private",e.dmUserId&&void 0===h.invite)switch(Object(u.c)(e.dmUserId)){case"mx-user-id":h.invite=[e.dmUserId];break;case"email":h.invite_3pid=[{id_server:o.a.get().getIdentityServerUrl(!0),medium:"email",address:e.dmUserId}]}let p,m;return e.dmUserId&&void 0===h.is_direct&&(h.is_direct=!0),void 0===e.andView&&(e.andView=!0),h.initial_state=h.initial_state||[],e.guestAccess&&h.initial_state.push({type:"m.room.guest_access",state_key:"",content:{guest_access:"can_join"}}),e.encryption&&h.initial_state.push({type:"m.room.encryption",state_key:"",content:{algorithm:"m.megolm.v1.aes-sha2"}}),e.spinner&&(p=r.a.createDialog(n,null,"mx_Dialog_spinner")),l.createRoom(h).finally((function(){p&&p.close()})).then((function(t){return m=t.room_id,e.dmUserId?c.d(m,e.dmUserId):Promise.resolve()})).then((function(){return e.andView&&s.a.dispatch({action:"view_room",room_id:m,should_peek:!1,joining:!0}),m}),(function(n){if(e.inlineErrors)throw n;s.a.dispatch({action:"join_room_error"}),console.error("Failed to create room "+m+" "+n);let o=Object(a.a)("Server may be unavailable, overloaded, or you hit a bug.");return"M_UNSUPPORTED_ROOM_VERSION"===n.errcode&&(o=Object(a.a)("The server does not support the room version specified.")),r.a.createTrackedDialog("Failure to create room","",t,{title:Object(a.a)("Failure to create room"),description:o}),null}))}function p(e,t){const n=l.a.shared().getDMRoomsForUserId(t).map(t=>e.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 r}));var o=n(140);function r(e,t){const n=Object(o.throttle)(e,t,{leading:!0,trailing:!0}),r=n.bind;return n.bind=function(){const e=r.apply(n,arguments);return e.cancelPendingCall=n.cancelPendingCall,e},n.cancelPendingCall=function(){n.cancel()},n}},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;inew o.a;function A(e){N=e}function M(t){return"string"==typeof t&&(t={baseUrl:t}),t.request=t.request||O,t.store=t.store||new r.a({localStorage:e.localStorage}),t.scheduler=t.scheduler||new i.a,t.cryptoStore=t.cryptoStore||N(),new a.b(t)}}.call(this,n(17))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var o=n(0),r=n(320),i=n(151),a=n(746),s=n(154),c=n(11);class l{constructor(e,t){this._indexedDB=e,this._dbName=t,this._backendPromise=null,this._backend=null}static exists(e,t){return c.a(e,t)}startup(){return this._backendPromise||(this._backendPromise=new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));o.a.log("connecting to indexeddb ".concat(this._dbName));const n=this._indexedDB.open(this._dbName,a.b);n.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;a.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 ".concat(this._dbName)),e(new a.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 s.a(s.a.TOO_NEW);o.a.warn("unable to connect to indexeddb ".concat(this._dbName)+": falling back to localStorage store: ".concat(t));try{return new r.a(e.localStorage)}catch(t){return o.a.warn("unable to open localStorage: falling back to in-memory store: ".concat(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: ".concat(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: ".concat(this._dbName)),e()}}).catch(e=>{o.a.warn("unable to delete IndexedDBCryptoStore: ".concat(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 f})),n.d(t,"f",(function(){return _})),n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return b})),n.d(t,"k",(function(){return y}));var o=n(3),r=n.n(o),i=n(0),a=n(49),s=n(155),c=n(125);const l="m.key.verification.",u=l+"request",d=l+"start",h=l+"cancel",p=l+"ready",m=1,g=2,f=3,_=4,v=5,b=6;class y extends a.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===f}get started(){return this.phase===_}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{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:f,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!==_&&t!==f||this.channel.receiveStartFromOtherDevices&&this._wasSentByOwnUser(n)&&!this._wasSentByOwnDevice(n)&&(this._observeOnly=!0),t===_){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: ".concat(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===f)){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!==a&&this.emit("change")}finally{i.a.log("Verification request ".concat(this.channel.transactionId,": ")+"".concat(e," event with id:").concat(t.getId(),", ")+"content:".concat(JSON.stringify(t.getContent())," ")+"deviceId:".concat(this.channel.deviceId,", ")+"sender:".concat(t.getSender(),", isSentByUs:").concat(r,", ")+"isLiveEvent:".concat(n,", isRemoteEcho:").concat(o,", ")+"phase:".concat(s,"=>").concat(this.phase,", ")+"observeOnly:".concat(a,"=>").concat(this._observeOnly))}}_setupTimeout(e){if(!this._timeoutTimer&&!this.observeOnly&&e===g&&this.initiatedByMe&&(this._timeoutTimer=setTimeout(this._cancelOnTimeout,this.timeout)),this._timeoutTimer){(e===_||e===f||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(s.b)(Object(s.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 ".concat(e," verification ")+"event from ".concat(t.getSender()));const n="Unexpected ".concat(e," event in phase ").concat(this.phase);return await this.cancel(Object(s.b)(Object(s.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,a=this._verificationMethods.get(e);if(a)return new a(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(816),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default||function(e){for(var t=1;t{const r=f(t.roomId),i=t.getUnreadNotificationCount("highlight")>0,a=t.getUnreadNotificationCount()>0&&d(r),s=i&&h(r),c=t.hasMembershipState(o.a.get().credentials.userId,"invite");return(a||s||c)&&(e.count++,i&&(e.highlight=!0)),e},{count:0,highlight:!1})}function m(e){return e.reduce((e,t,n)=>{const o=f(t.roomId),r=t.getUnreadNotificationCount("highlight")>0,i=t.getUnreadNotificationCount(),a=i>0&&d(o),s=r&&h(o);return(a||s)&&(e.count+=i,r&&(e.highlight=!0)),e},{count:0,highlight:!1})}function g(e){const t=f(e.roomId),n=e.getUnreadNotificationCount("highlight")>0,o=e.getUnreadNotificationCount()>0&&d(t),r=n&&h(t);return o||r}function f(e){if(o.a.get().isGuest())return a;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 a;if(E(t))return s;return r.a.actionListToActionsObject(t.actions).tweaks.sound?i:null}function _(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(y(e,t)&&E(t)&&t.enabled)return t;return null}function y(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 E(e){return 1===e.actions.length&&"dont_notify"===e.actions[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(674),r=n(675);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";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 i}));var o=n(1),r=n(49);function i(e){this.userId=e,this.presence="offline",this.presenceStatusMsg=null,this._unstable_statusMessage="",this.displayName=e,this.rawDisplayName=e,this.avatarUrl=null,this.lastActiveAgo=0,this.lastPresenceTs=0,this.currentlyActive=!1,this.events={presence:null,profile:null},this._updateModifiedTime()}o.o(i,r.EventEmitter),i.prototype.setPresenceEvent=function(e){if("m.presence"!==e.getType())return;const t=null===this.events.presence;this.events.presence=e;const n=[];(e.getContent().presence!==this.presence||t)&&n.push("User.presence"),e.getContent().avatar_url&&e.getContent().avatar_url!==this.avatarUrl&&n.push("User.avatarUrl"),e.getContent().displayname&&e.getContent().displayname!==this.displayName&&n.push("User.displayName"),void 0!==e.getContent().currently_active&&e.getContent().currently_active!==this.currentlyActive&&n.push("User.currentlyActive"),this.presence=e.getContent().presence,n.push("User.lastPresenceTs"),e.getContent().status_msg&&(this.presenceStatusMsg=e.getContent().status_msg),e.getContent().displayname&&(this.displayName=e.getContent().displayname),e.getContent().avatar_url&&(this.avatarUrl=e.getContent().avatar_url),this.lastActiveAgo=e.getContent().last_active_ago,this.lastPresenceTs=Date.now(),this.currentlyActive=e.getContent().currently_active,this._updateModifiedTime();for(let t=0;t{for(let o=0;o]*)([0-9]*)$/);if(!i)return!1;const a=i[1],s=parseInt(i[2]);if(isNaN(s))return!1;switch(a){case"":case"==":return r==s;case"<":return r":return r>s;case"<=":return r<=s;case">=":return r>=s;default:return!1}},d=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 a=i.currentState.getMember(e.credentials.userId).name,s=new RegExp("(^|\\W)"+Object(o.h)(a)+"(\\W|$)","i");return r.body.search(s)>-1},h=function(e,t){return!1},p=function(e,t){if(!e.key)return!1;const n=g(e.key,t);if("string"!=typeof n)return!1;if(e.value)return e.value===n;let o;return o="content.body"==e.key?m("(^|\\W)",e.pattern,"(\\W|$)"):m("^",e.pattern,"$"),!!n.match(o)},m=function(e,n,r){return t[n]||(t[n]=new RegExp(e+Object(o.n)(n)+r,"i")),t[n]},g=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},f=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)){const t=e.rule_id;console.warn("Adding default global override for ".concat(t)),n.push(e)}}return t}(e.pushRules);return f(t,n)},this.getPushRuleById=function(t){for(const n of["device","global"])if(void 0!==e.pushRules[n])for(const o of r)if(void 0!==e.pushRules[n][o])for(const r of e.pushRules[n][o])if(r.rule_id===t)return r;return null}}a.actionListToActionsObject=function(e){const t={notify:!1,tweaks:{}};for(let n=0;n{const t=i.find(t=>t.rule_id===e.rule_id);return t?(e.default=t.default,e.conditions=t.conditions,e.actions=t.actions,e):e}),t}},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return R})),n.d(t,"b",(function(){return O})),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 a(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:[a.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}a.CALL_TIMEOUT_MS=6e4,a.FALLBACK_ICE_SERVER="stun:turn.matrix.org",a.ERR_LOCAL_OFFER_FAILED="local_offer_failed",a.ERR_NO_USER_MEDIA="no_user_media",a.ERR_UNKNOWN_DEVICES="unknown_devices",a.ERR_SEND_INVITE="send_invite",a.ERR_SEND_ANSWER="send_answer",i.o(a,r.EventEmitter),a.prototype.placeVoiceCall=function(){v("placeVoiceCall"),f(this),y(this,S("voice")),this.type="voice"},a.prototype.placeVideoCall=function(e,t){v("placeVideoCall"),f(this),this.localVideoElement=t,this.remoteVideoElement=e,y(this,S("video")),this.type="video",m(this)},a.prototype.placeScreenSharingCall=async function(e,t){v("placeScreenSharingCall"),f(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");y(n,e)}catch(e){n.emit("error",_(a.ERR_NO_USER_MEDIA,"Failed to get screen-sharing stream: "+e))}this.type="video",m(this)},a.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()},a.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()},a.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},a.prototype.getLocalVideoElement=function(){return this.localVideoElement},a.prototype.getRemoteVideoElement=function(){return this.remoteVideoElement},a.prototype.getRemoteAudioElement=function(){return this.remoteAudioElement},a.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)}},a.prototype.setRemoteVideoElement=function(e){this.remoteVideoElement=e,m(this)},a.prototype.setRemoteAudioElement=function(e){this.remoteVideoElement.muted=!0,this.remoteAudioElement=e,this.remoteAudioElement.muted=!1,g(this)},a.prototype._initWithInvite=function(e){this.msg=e.getContent(),this.peerConn=E(this);const t=this;this.peerConn&&this.peerConn.setRemoteDescription(new this.webRtc.RtcSessionDescription(this.msg.offer),w(t,t._onSetRemoteDescriptionSuccess),w(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())},a.prototype._initWithHangup=function(e){this.msg=e.getContent(),l(this,"ended")},a.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),w(e,e._maybeGotUserMediaForAnswer),w(e,e._maybeGotUserMediaForAnswer)),l(this,"wait_local_media"))},a.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)},a.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)},a.prototype.setLocalVideoMuted=function(e){this.localAVStream&&s(this.localAVStream.getVideoTracks(),!e)},a.prototype.isLocalVideoMuted=function(){return!!this.localAVStream&&!c(this.localAVStream.getVideoTracks())},a.prototype.setMicrophoneMuted=function(e){this.localAVStream&&s(this.localAVStream.getAudioTracks(),!e)},a.prototype.isMicrophoneMuted=function(){return!!this.localAVStream&&!c(this.localAVStream.getAudioTracks())},a.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,s(e.getAudioTracks(),!0),this.peerConn=E(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=E(this)}this.peerConn.createOffer(w(t,t._gotLocalOffer),w(t,t._getLocalOfferFailed),o),l(t,"create_offer")},a.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=a.ERR_SEND_ANSWER,n="Failed to send answer";throw"UnknownDeviceError"==e.name&&(t=a.ERR_UNKNOWN_DEVICES,n="Unknown devices present in the room"),this.emit("error",_(t,n)),e})},a.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,s(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")},a.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)}},a.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){})))},a.prototype._receivedAnswer=function(e){if("ended"==this.state)return;this.peerConn.setRemoteDescription(new this.webRtc.RtcSessionDescription(e.answer),w(this,this._onSetRemoteDescriptionSuccess),w(this,this._onSetRemoteDescriptionError)),l(this,"connecting")},a.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:a.CALL_TIMEOUT_MS};u(t,"m.call.invite",e).then(()=>{l(t,"invite_sent"),setTimeout((function(){"invite_sent"==t.state&&t.hangup("invite_timeout")}),a.CALL_TIMEOUT_MS)}).catch(e=>{let n=a.ERR_SEND_INVITE,o="Failed to send invite";throw"UnknownDeviceError"==e.name&&(n=a.ERR_UNKNOWN_DEVICES,o="Unknown devices present in the room"),t.client.cancelPendingEvent(e.event),h(t,"local",n,!1),t.emit("error",_(n,o)),e})}),(function(){v("Error setting local description!")})):v("Ignoring newly created offer on call ID "+t.callId+" because the call has ended")},a.prototype._getLocalOfferFailed=function(e){this.emit("error",_(a.ERR_LOCAL_OFFER_FAILED,"Failed to start audio for call!"))},a.prototype._getUserMediaFailed=function(e){h(this,"local","user_media_failed",!1),this.emit("error",_(a.ERR_NO_USER_MEDIA,"Couldn't start capturing media! Is your microphone set up and does this app have permission?"))},a.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"))},a.prototype._onSignallingStateChanged=function(){v("call "+this.callId+": Signalling state changed to: "+this.peerConn.signalingState)},a.prototype._onSetRemoteDescriptionSuccess=function(){v("Set remote description")},a.prototype._onSetRemoteDescriptionError=function(e){v("Failed to set remote description"+e)},a.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;C(t,(function(e){v("Track id "+e.id+" added"),e.onstarted=w(n,n._onRemoteStreamTrackStarted)})),void 0!==e.stream.oninactive?e.stream.oninactive=w(n,n._onRemoteStreamEnded):e.stream.onended=w(n,n._onRemoteStreamEnded),e.stream.onstarted=w(n,n._onRemoteStreamStarted),"video"===this.type?(m(this),g(this)):g(this)},a.prototype._onRemoteStreamStarted=function(e){l(this,"connected")},a.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)},a.prototype._onRemoteStreamTrackStarted=function(e){l(this,"connected")},a.prototype._onHangupReceived=function(e){v("Hangup received"),h(this,"remote",e.reason,!0)},a.prototype._onAnsweredElsewhere=function(e){v("Answered elsewhere"),h(this,"remote","answered_elsewhere",!0)};const s=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)}))},y=function(e,t){e.client.callList[e.callId]=e,e.webRtc.getUserMedia(t,w(e,e._maybeGotUserMediaForInvite),w(e,e._maybeGotUserMediaForInvite)),l(e,"wait_local_media"),e.direction="outbound",e.config=t},E=function(e){const t=new e.webRtc.RtcPeerConnection({iceTransportPolicy:e.forceTURN?"relay":void 0,iceServers:e.turnServers});return t.oniceconnectionstatechange=w(e,e._onIceConnectionStateChanged),t.onsignalingstatechange=w(e,e._onSignallingStateChanged),t.onicecandidate=w(e,e._gotLocalIceCandidate),t.onaddstream=w(e,e._onAddStream),t},S=function(t){const n=!!e.window.navigator.webkitGetUserMedia;switch(t){case"voice":return{audio:{deviceId:T?{ideal:T}:void 0},video:!1};case"video":return{audio:{deviceId:T?{ideal:T}:void 0},video:{deviceId:k?{ideal:k}:void 0,width:n?{exact:640}:{ideal:640},height:n?{exact:360}:{ideal:360}}}}},w=function(e,t){return function(){return t.apply(e,arguments)}},C=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 a({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){n.d(t,"d",(function(){return D})),n.d(t,"c",(function(){return I})),n.d(t,"a",(function(){return F})),n.d(t,"b",(function(){return N}));var o=n(234),r=n.n(o),i=n(49),a=n(232),s=n(0),c=n(1),l=n(321),u=n(61),d=n(747),h=n(186),p=n(714),m=n(235),g=n(748),f=n(750),_=n(109),v=n(125),b=n(751),y=n(237),E=n(238),S=n(110),w=n(755),C=n(756),x=n(153),T=n(757),k=n(154);const R=h.a.DeviceVerification,O={[v.b.NAME]:v.b,[b.a.NAME]:b.a,[v.d]:T.a,[v.c]:T.a},D={RECIPROCATE_QR_CODE:v.b.NAME,SAS:b.a.NAME};function I(){return Boolean(e.Olm)}function F(e,t,n,o,r,i,s,u){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,u){this._verificationMethods=new Map;for(const e of u)"string"==typeof e?O[e]&&this._verificationMethods.set(e,O[e]):e.NAME?this._verificationMethods.set(e.NAME,e):console.warn("Excluding unknown verification method ".concat(e))}else this._verificationMethods=O;this.backupInfo=null,this.backupKey=null,this._checkedForBackup=!1,this._sendingBackups=!1,this._olmDevice=new l.a(i),this._deviceList=new d.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=c.t(p.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 C.b,this._inRoomVerificationRequests=new w.b;const h=this._baseApis._cryptoCallbacks||{},_=Object(m.e)(i);this._crossSigningInfo=new m.a(n,h,_),this._secretStorage=new g.b(e,h,this._crossSigningInfo),!h.getCrossSigningKey&&h.getSecretStorageKey&&(h.getCrossSigningKey=async e=>m.a.getFromSecretStorage(e,this._secretStorage))}function N(e){if(e.indexOf(",")<0)return null;const t=Uint8Array.from(e.split(","),e=>parseInt(e));return u.encodeBase64(t)}function A(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=>{s.a.error("Error uploading one-time keys",e.stack||e)}).finally(()=>{e._oneTimeKeyCount=void 0,e._oneTimeKeyCheckInProgress=!1})}c.o(F,i.EventEmitter),F.prototype.init=async function(t){const{exportedOlmDevice:n}=t||{};s.a.log("Crypto: initialising Olm..."),await e.Olm.init(),s.a.log(n?"Crypto: initialising Olm device from exported device...":"Crypto: initialising Olm device..."),await this._olmDevice.init({fromExportedDevice:n}),s.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,s.a.log("Crypto: fetching own devices...");let o=this._deviceList.getRawStoredDevicesForUser(this._userId);if(o||(o={}),!o[this._deviceId]){s.a.log("Crypto: adding this device to the store...");const e={keys:this._deviceKeys,algorithms:this._supportedAlgorithms,verified:R.VERIFIED,known:!0};o[this._deviceId]=e,this._deviceList.storeDevicesForUser(this._userId,o),this._deviceList.saveIfDirty()}await this._cryptoStore.doTxn("readonly",[_.a.STORE_ACCOUNT],e=>{this._cryptoStore.getCrossSigningKeys(e,e=>{e&&0!==Object.keys(e).length&&(s.a.log("Loaded cross-signing public keys from crypto store"),this._crossSigningInfo.setKeys(e))})}),this._deviceList.startTrackingDeviceList(this._userId),s.a.log("Crypto: checking for key backup..."),this._checkAndStartKeyBackup()},F.prototype.getCryptoTrustCrossSignedDevices=function(){return this._trustCrossSignedDevices},F.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)}}}},F.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(E.b)(o),privateKey:o}}finally{n&&n.free()}},F.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},F.prototype.bootstrapSecretStorage=async function({authUploadDeviceSigningKeys:e,createSecretStorageKey:t=(async()=>({})),keyBackupInfo:n,setupNewKeyBackup:o,setupNewSecretStorage:r,getKeyBackupPassphrase:i}={}){s.a.log("Bootstrapping Secure Secret Storage");const a={},c=Object.assign({},this._baseApis._cryptoCallbacks);let l=null;const d={};this._baseApis._cryptoCallbacks.getSecretStorageKey=async({keys:e},t)=>{for(const t of Object.keys(e))if(d[t])return[t,d[t]];const n=await c.getSecretStorageKey({keys:e},t);if(n){const[e,t]=n;d[e]=t}return n};const h=async(e,t)=>{e=e||{},t&&(e.key=t);const n=await this.addSecretStorageKey(g.a,e);return await this.setDefaultSecretStorageKeyId(n),t&&(d[n]=t),n},p=async()=>{this._baseApis._cryptoCallbacks.saveCrossSigningKeys=e=>Object.assign(a,e),this._baseApis._cryptoCallbacks.getCrossSigningKey=e=>a[e],await this.resetCrossSigningKeys(m.b.MASTER,{authUploadDeviceSigningKeys:e})},f=async(e,t)=>{if(!t.mac){const n=await this._baseApis._cryptoCallbacks.getSecretStorageKey({keys:{[e]:t}},"");if(n){const o=n[1];d[e]=o;const{iv:r,mac:i}=await g.b._calculateKeyCheck(o);t.iv=r,t.mac=i,await this._crossSigningInfo.signObject(t,"master"),await this._baseApis.setAccountData("m.secret_storage.key.".concat(e),t)}}};try{const e=await this.getSecretStorageKey(),[_,v]=e||[null,null],b=await this._crossSigningInfo.isStoredInSecretStorage(this._secretStorage),y=!r&&b;if(y||n)if(!y&&n){s.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",u.encodeBase64(e),[l]),s.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:x.i})}else if(Object.values(b).some(e=>e.algorithm===g.a))this._crossSigningInfo.getId()?(s.a.log("Cross signing keys are present in secret storage"),v&&v.algorithm===g.a&&await f(_,v)):(s.a.log("Cross-signing private keys found in secret storage"),await this.checkOwnCrossSigningTrust(),v&&v.algorithm===g.a&&await f(_,v));else{s.a.log("Asymmetric SSSS found. Switching SSSS to symmetric");const e={};this._baseApis._cryptoCallbacks.getCrossSigningKey=e=>a[e];for(const t of["master","self_signing","user_signing"]){const n="m.cross_signing.".concat(t),o=await this.getSecret(n);e[t]=o,a[t]=new Uint8Array(u.decodeBase64(o))}await this.checkOwnCrossSigningTrust();const t={};let n=null;for(const[e,o]of Object.entries(b))if(e in d){n=d[e],o.passphrase&&(t.passphrase=o.passphrase);break}l=await h(t,n),s.a.log("re-encrypting cross-signing keys");for(const t of["master","self_signing","user_signing"]){const n="m.cross_signing.".concat(t);await this.storeSecret(n,e[t],[l])}if(await this.isSecretStored("m.megolm_backup.v1",!1)){s.a.log("re-encrypting backup key");const e=await this.getSecret("m.megolm_backup.v1");await this.storeSecret("m.megolm_backup.v1",N(e)||e,[l])}}else{if(s.a.log("Cross-signing private keys not found in secret storage, creating new keys"),await p(),r||!v||v.algorithm!==g.a){const{keyInfo:e,privateKey:n}=await t();l=await h(e,n)}v&&v.algorithm===g.a&&await f(_,v)}if(Object.keys(a).length&&(s.a.log("Storing cross-signing private keys in secret storage"),await this._secretStorage.signKey(),c.saveCrossSigningKeys||await m.a.storeInSecretStorage(a,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"])s.a.log("Cache ".concat(e," cross-signing private key locally")),await this._crossSigningInfo.getCrossSigningKey(e);const E=await this.getSecret("m.megolm_backup.v1");if(E){s.a.info("Got session backup key from secret storage: caching");const e=N(E);e&&await this.storeSecret("m.megolm_backup.v1",e,[l||_]);const t=new Uint8Array(u.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,c)}s.a.log("Secure Secret Storage ready")},F.prototype.addSecretStorageKey=function(e,t,n){return this._secretStorage.addKey(e,t,n)},F.prototype.hasSecretStorageKey=function(e){return this._secretStorage.hasKey(e)},F.prototype.secretStorageKeyNeedsUpgrade=function(e){return this._secretStorage.keyNeedsUpgrade(e)},F.prototype.getSecretStorageKey=function(e){return this._secretStorage.getKey(e)},F.prototype.storeSecret=function(e,t,n){return this._secretStorage.store(e,t,n)},F.prototype.getSecret=function(e){return this._secretStorage.get(e)},F.prototype.isSecretStored=function(e,t){return this._secretStorage.isStored(e,t)},F.prototype.requestSecret=function(e,t){return t||(t=Object.keys(this._deviceList.getRawStoredDevicesForUser(this._userId))),this._secretStorage.request(e,t)},F.prototype.getDefaultSecretStorageKeyId=function(){return this._secretStorage.getDefaultKeyId()},F.prototype.setDefaultSecretStorageKeyId=function(e){return this._secretStorage.setDefaultKeyId(e)},F.prototype.checkSecretStorageKey=function(e,t){return this._secretStorage.checkKey(e,t)},F.prototype.checkSecretStoragePrivateKey=function(t,n){let o=null;try{return o=new e.Olm.PkDecryption,o.init_with_private_key(t)===n}finally{o&&o.free()}},F.prototype.getSessionBackupPrivateKey=async function(){let e=await new Promise(e=>{this._cryptoStore.doTxn("readonly",[_.a.STORE_ACCOUNT],t=>{this._cryptoStore.getSecretStorePrivateKey(t,e,"m.megolm_backup.v1")})});return e&&(e=new Uint8Array(u.decodeBase64(N(e)||e)),await this.storeSessionBackupPrivateKey(e)),e},F.prototype.storeSessionBackupPrivateKey=async function(e){if(!(e instanceof Uint8Array))throw new Error("storeSessionBackupPrivateKey expects Uint8Array, got ".concat(e));return this._cryptoStore.doTxn("readwrite",[_.a.STORE_ACCOUNT],t=>{this._cryptoStore.storeSecretStorePrivateKey(t,"m.megolm_backup.v1",e)})},F.prototype.checkCrossSigningPrivateKey=function(t,n){let o=null;try{return o=new e.Olm.PkSigning,o.init_with_seed(t)===n}finally{o&&o.free()}},F.prototype.resetCrossSigningKeys=async function(e,{authUploadDeviceSigningKeys:t=(async e=>await e())}={}){s.a.info("Resetting cross-signing keys at level ".concat(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",[_.a.STORE_ACCOUNT],e=>{this._cryptoStore.storeCrossSigningKeys(e,this._crossSigningInfo.keys)})}catch(e){throw s.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(),s.a.info("Cross-signing key reset complete")},F.prototype._afterCrossSigningLocalKeyChange=async function(){s.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);s.a.info("Starting background key sig upload for ".concat(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 k.c("Key upload failed",{failures:o});s.a.info("Finished background key sig upload for ".concat(this._deviceId))}).catch(e=>{s.a.error("Error during background key sig upload for ".concat(this._deviceId),e)});n({shouldEmit:!0});const o=this._baseApis._cryptoCallbacks.shouldUpgradeDeviceVerifications;if(o){s.a.info("Starting device verification upgrade");const e={};for(const[t,n]of Object.entries(this._deviceList._crossSigningInfo)){const o=await this._checkForDeviceVerificationUpgrade(t,m.a.fromStorage(n,t));o&&(e[t]=o)}if(Object.keys(e).length>0){s.a.info("Found ".concat(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){s.a.log("shouldUpgradeDeviceVerifications threw an error: not upgrading",e)}}s.a.info("Finished device verification upgrade")}s.a.info("Finished cross-signing key change post-processing")},F.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=>h.a.fromStorage(n[e],e)),crossSigningInfo:t}}},F.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===R.VERIFIED)try{await u.verifySignature(this._olmDevice,t,e,i,n[i].keys[r]),o.push(i)}catch(e){}}return o},F.prototype.getCrossSigningId=function(e){return this._crossSigningInfo.getId(e)},F.prototype.getStoredCrossSigningForUser=function(e){return this._deviceList.getStoredCrossSigningForUser(e)},F.prototype.checkUserTrust=function(e){const t=this._deviceList.getStoredCrossSigningForUser(e);return t?this._crossSigningInfo.checkUserTrust(t):new m.d(!1,!1,!1)},F.prototype.checkDeviceTrust=function(e,t){const n=this._deviceList.getStoredDevice(e,t);return this._checkDeviceInfoTrust(e,n)},F.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 m.c(!1,!1,n,!1)},F.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))}},F.prototype.checkOwnCrossSigningTrust=async function(){const e=this._userId;await this.downloadKeys([this._userId]);const t=this._deviceList.getStoredCrossSigningForUser(e);if(!t)return void s.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){s.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()}s.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 a={};if(r!==t.getId("self_signing")){s.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);a[this._deviceId]=n}if(i!==t.getId("user_signing")&&s.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];a[this._crossSigningInfo.getId()]=Object.assign({},e,{signatures:{[this._userId]:{["ed25519:"+this._deviceId]:t}}})}const c=Object.keys(a);if(c.length){const e=({shouldEmit:t})=>(s.a.info("Starting background key sig upload for ".concat(c)),this._baseApis.uploadKeySignatures({[this._userId]:a}).then(n=>{const{failures:o}=n||{};if(s.a.info("Finished background key sig upload for ".concat(c)),Object.keys(o||[]).length>0)throw t&&this._baseApis.emit("crypto.keySignatureUploadFailure",o,"checkOwnCrossSigningTrust",e),new k.c("Key upload failed",{failures:o})}).catch(e=>{s.a.error("Error during background key sig upload for ".concat(c),e)}));e({shouldEmit:!0})}this.emit("userTrustStatusChanged",e,this.checkUserTrust(e)),o&&(this._baseApis.emit("crossSigning.keysChanged",{}),await this._afterCrossSigningLocalKeyChange()),await this.checkKeyBackup()},F.prototype._storeTrustedSelfKeys=async function(e){e?this._crossSigningInfo.setKeys(e):this._crossSigningInfo.clearKeys(),await this._cryptoStore.doTxn("readwrite",[_.a.STORE_ACCOUNT],e=>{this._cryptoStore.storeCrossSigningKeys(e,this._crossSigningInfo.keys)})},F.prototype._checkDeviceVerifications=async function(e){const t=this._baseApis._cryptoCallbacks.shouldUpgradeDeviceVerifications;if(t){if(s.a.info("Starting device verification upgrade for ".concat(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())}}}s.a.info("Finished device verification upgrade for ".concat(e))}},F.prototype._checkAndStartKeyBackup=async function(){if(s.a.log("Checking key backup status..."),this._baseApis.isGuest())return s.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 s.a.log("Error checking for active key backup",e),e.httpStatus/100==4&&(this._checkedForBackup=!0),null}this._checkedForBackup=!0;const t=await this.isKeyBackupTrusted(e);return t.usable&&!this.backupInfo?(s.a.log("Found usable key backup v"+e.version+": enabling key backups"),this._baseApis.enableKeyBackup(e)):!t.usable&&this.backupInfo?(s.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?(s.a.log("On backup version "+this.backupInfo.version+" but found version "+e.version+": switching."),this._baseApis.disableKeyBackup(),this._baseApis.enableKeyBackup(e)):s.a.log("Backup version "+e.version+" still current")):s.a.log("No usable key backup: not enabling key backup"),{backupInfo:e,trustInfo:t}},F.prototype.setTrustedBackupPubKey=async function(e){this._sessionStore.setLocalTrustedBackupPubKey(e),await this.checkKeyBackup()},F.prototype.checkKeyBackup=async function(){return this._checkedForBackup=!1,this._checkAndStartKeyBackup()},F.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 s.a.info("Key backup is absent or missing required data"),t;const n=this._sessionStore.getLocalTrustedBackupPubKey();e.auth_data.public_key===n&&(s.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]){s.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 u.verifySignature(this._olmDevice,e.auth_data,this._userId,r.deviceId,i),r.valid=!0}catch(e){s.a.warning("Bad signature from cross signing key "+i,e),r.valid=!1}t.sigs.push(r);continue}const a=this._deviceList.getStoredDevice(this._userId,r.deviceId);if(a){r.device=a,r.deviceTrust=await this.checkDeviceTrust(this._userId,r.deviceId);try{await u.verifySignature(this._olmDevice,e.auth_data,this._userId,a.deviceId,a.getFingerprint()),r.valid=!0}catch(t){s.a.info("Bad signature from key ID "+n+" userID "+this._userId+" device ID "+a.deviceId+" fingerprint: "+a.getFingerprint(),e.auth_data,t),r.valid=!1}}else r.valid=null,s.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},F.prototype.enableLazyLoading=function(){this._lazyLoadMembers=!0},F.prototype.registerEventHandlers=function(e){const t=this;e.on("RoomMember.membership",(function(e,n,o){try{t._onRoomMembership(e,n,o)}catch(e){s.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)},F.prototype.start=function(){this._outgoingRoomKeyRequestManager.start()},F.prototype.stop=function(){this._outgoingRoomKeyRequestManager.stop(),this._deviceList.stop()},F.getOlmVersion=function(){return l.a.getOlmVersion()},F.prototype.getDeviceEd25519Key=function(){return this._olmDevice.deviceEd25519Key},F.prototype.getDeviceCurve25519Key=function(){return this._olmDevice.deviceCurve25519Key},F.prototype.setGlobalBlacklistUnverifiedDevices=function(e){this._globalBlacklistUnverifiedDevices=e},F.prototype.getGlobalBlacklistUnverifiedDevices=function(){return this._globalBlacklistUnverifiedDevices},F.prototype.setGlobalErrorOnUnknownDevices=function(e){this._globalErrorOnUnknownDevices=e},F.prototype.getGlobalErrorOnUnknownDevices=function(){return this._globalErrorOnUnknownDevices},F.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}))},F.prototype.updateOneTimeKeyCount=function(e){if(!isFinite(e))throw new TypeError("Parameter for updateOneTimeKeyCount has to be a number");this._oneTimeKeyCount=e},F.prototype.downloadKeys=function(e,t){return this._deviceList.downloadKeys(e,t)},F.prototype.getStoredDevicesForUser=function(e){return this._deviceList.getStoredDevicesForUser(e)},F.prototype.getStoredDevice=function(e,t){return this._deviceList.getStoredDevice(e,t)},F.prototype.saveDeviceList=function(e){return this._deviceList.saveIfDirty(e)},F.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){s.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})=>{s.a.info("Uploading signature for "+e+"...");const i=await this._baseApis.uploadKeySignatures({[e]:{[t]:n}}),{failures:a}=i||{};if(Object.keys(a||[]).length>0)throw r&&this._baseApis.emit("crypto.keySignatureUploadFailure",a,"setDeviceVerification",o),new k.c("Key upload failed",{failures:a})};await o({shouldEmit:!0})}return n}return i}const a=this._deviceList.getRawStoredDevicesForUser(e);if(!a||!a[t])throw new Error("Unknown device "+e+":"+t);const c=a[t];let l=c.verified;n?l=R.VERIFIED:null!==n&&l==R.VERIFIED&&(l=R.UNVERIFIED),o?l=R.BLOCKED:null!==o&&l==R.BLOCKED&&(l=R.UNVERIFIED);let u=c.known;if(null!==r&&(u=r),c.verified===l&&c.known===u||(c.verified=l,c.known=u,this._deviceList.storeDevicesForUser(e,a),this._deviceList.saveIfDirty()),n&&e===this._userId){s.a.info("Own device "+t+" marked verified: signing");const n=await this._crossSigningInfo.signDevice(e,h.a.fromStorage(c,t));if(n){const o=async({shouldEmit:r})=>{s.a.info("Uploading signature for "+t);const i=await this._baseApis.uploadKeySignatures({[e]:{[t]:n}}),{failures:a}=i||{};if(Object.keys(a||[]).length>0)throw r&&this._baseApis.emit("crypto.keySignatureUploadFailure",a,"setDeviceVerification",o),new k.c("Key upload failed",{failures:a})};await o({shouldEmit:!0})}}const d=h.a.fromStorage(c,t);return this.emit("deviceVerificationChanged",e,t,d),d},F.prototype.findVerificationRequestDMInProgress=function(e){return this._inRoomVerificationRequests.findRequestInProgress(e)},F.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)},F.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 C.a(this._baseApis,e,t,C.a.makeTransactionId());return this._requestVerificationWithChannel(e,o,this._toDeviceVerificationRequests)},F.prototype._requestVerificationWithChannel=async function(e,t,n){let o=new S.k(t,this._verificationMethods,this._baseApis);t.transactionId&&n.setRequestByChannel(t,o),await o.sendRequest();const r=n.getRequestByChannel(t);return r?o=r:(s.a.log("Crypto: adding new request to "+"requestsByTxnId with id ".concat(t.transactionId," ").concat(t.roomId)),n.setRequestByChannel(t,o)),o},F.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 ".concat(t," with ")+"transactionId ".concat(o))}else{o=C.a.makeTransactionId();const e=new C.a(this._baseApis,t,[n],o,n);r=new S.k(e,this._verificationMethods,this._baseApis),this._toDeviceVerificationRequests.setRequestBySenderAndTxnId(t,o,r)}return r.beginKeyVerification(e,{userId:t,deviceId:n})},F.prototype.legacyDeviceVerification=async function(e,t,n){const o=C.a.makeTransactionId(),r=new C.a(this._baseApis,e,[t],o,t),i=new S.k(r,this._verificationMethods,this._baseApis);this._toDeviceVerificationRequests.setRequestBySenderAndTxnId(e,o,i);const a=i.beginKeyVerification(n,{userId:e,deviceId:t});return await Promise.race([a.verify(),i.waitFor(e=>e.started)]),i},F.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()?(s.a.warn("Event "+e.getId()+" claims ed25519 key "+r+"but sender device has key "+o.getFingerprint()),null):o:(s.a.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),null)},F.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()},F.prototype.setRoomEncryption=async function(e,t,n){if(!t.algorithm)return void s.a.log("Ignoring setRoomEncryption with no algorithm");const o=this._roomList.getRoomEncryption(e);if(o&&JSON.stringify(o)!=JSON.stringify(t))return void s.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=p.c[t.algorithm];if(!i)throw new Error("Unable to encrypt with "+t.algorithm);const a=new i({userId:this._userId,deviceId:this._deviceId,crypto:this,olmDevice:this._olmDevice,baseApis:this._baseApis,roomId:e,config:t});this._roomEncryptors[e]=a,r&&await r,this._lazyLoadMembers?s.a.log("Enabling encryption in "+e):(s.a.log("Enabling encryption in "+e+"; starting to track device lists for all users therein"),await this.trackRoomDevices(e),this.inhibitDeviceQuery||this._deviceList.refreshOutdatedDeviceLists())},F.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 ".concat(e));s.a.log("Starting to track devices for room ".concat(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},F.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=u.MEGOLM_ALGORITHM,e.push(n)})}),e},F.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 s.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()})}))},F.prototype.scheduleKeyBackupSend=async function(e=1e4){if(!this._sendingBackups){this._sendingBackups=!0;try{const t=Math.random()*e;await Object(c.A)(t);let n=0;for(;;){if(!this.backupKey)return;try{if(0===await this._backupPendingKeys(200))return;n=0}catch(e){if(n++,s.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(c.A)(1e3*Math.pow(2,Math.min(n-1,4)))}}finally{this._sendingBackups=!1}}},F.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=u.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)),a=(n.forwarding_curve25519_key_chain||[]).length,s=this._deviceList.getUserByIdentityKey(u.MEGOLM_ALGORITHM,e.senderKey),c=this._deviceList.getDeviceByIdentityKey(u.MEGOLM_ALGORITHM,e.senderKey),l=this._checkDeviceInfoTrust(s,c).isVerified();o[t].sessions[e.sessionId]={first_message_index:r,forwarded_count:a,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},F.prototype.backupGroupSession=async function(e,t,n,o,r,i,a){if(!this.backupInfo)throw new Error("Key backups are not enabled");await this._cryptoStore.markSessionsNeedingBackup([{senderKey:t,sessionId:o}]),this.scheduleKeyBackupSend()},F.prototype.scheduleAllGroupSessionsForBackup=async function(){await this.flagAllGroupSessionsForBackup(),this.scheduleKeyBackupSend(0)},F.prototype.flagAllGroupSessionsForBackup=async function(){await this._cryptoStore.doTxn("readwrite",[_.a.STORE_INBOUND_GROUP_SESSIONS,_.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},F.prototype.prepareToEncrypt=function(e){const t=e.roomId,n=this._roomEncryptors[t];n&&n.prepareToEncrypt(e)},F.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 a=await o.encryptMessage(t,e.getType(),r);i&&(a["m.relates_to"]=i),e.makeEncrypted("m.room.encrypted",a,this._olmDevice.deviceCurve25519Key,this._olmDevice.deviceEd25519Key)},F.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)},F.prototype.handleDeviceListChanges=async function(e,t){e.oldSyncToken&&await this._evalDeviceListChanges(t)},F.prototype.requestRoomKey=function(e,t,n=!1){return this._outgoingRoomKeyRequestManager.sendRoomKeyRequest(e,t,n).catch(e=>{s.a.error("Error requesting key for event",e)})},F.prototype.cancelRoomKeyRequest=function(e){this._outgoingRoomKeyRequestManager.cancelRoomKeyRequest(e).catch(e=>{s.a.warn("Error clearing pending room key requests",e)})},F.prototype.cancelAndResendAllOutgoingKeyRequests=function(){return this._outgoingRoomKeyRequestManager.cancelAndResendAllOutgoingRequests()},F.prototype.onCryptoEvent=async function(e){const t=e.getRoomId(),n=e.getContent();try{await this.setRoomEncryption(t,n,!0)}catch(e){s.a.error("Error configuring encryption in room "+t+":",e)}},F.prototype.onSyncWillProcess=async function(e){e.oldSyncToken||(s.a.log("Initial sync performed - resetting device tracking state"),this._deviceList.stopTrackingAllDeviceLists(),this._deviceList.startTrackingDeviceList(this._userId),this._roomDeviceTrackingState={})},F.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||(A(this),this._processReceivedRoomKeyRequests())},F.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)})}},F.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},F.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})},F.prototype._onToDeviceEvent=function(e){try{s.a.log("received to_device ".concat(e.getType()," from: ")+"".concat(e.getSender()," id: ").concat(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){s.a.error("Error handling toDeviceEvent:",e)}},F.prototype._onRoomKeyEvent=function(e){const t=e.getContent();t.room_id&&t.algorithm?(this._checkedForBackup||this._checkAndStartKeyBackup(),this._getRoomDecryptor(t.room_id,t.algorithm).onRoomKeyEvent(e)):s.a.error("key event is missing fields")},F.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 s.a.error("key withheld event is missing fields");s.a.info("Got room key withheld event from ".concat(e.getSender()," (").concat(t.sender_key,") ")+"for ".concat(t.algorithm,"/").concat(t.room_id,"/").concat(t.session_id," ")+"with reason ".concat(t.code," (").concat(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)}},F.prototype._onKeyVerificationMessage=function(e){if(!C.a.validateEvent(e,this._baseApis))return;this._handleVerificationEvent(e,this._toDeviceVerificationRequests,e=>{if(!C.a.canCreateRequest(C.a.getEventType(e)))return;const t=e.getContent(),n=t&&t.from_device;if(!n)return;const o=e.getSender(),r=new C.a(this._baseApis,o,[n]);return new S.k(r,this._verificationMethods,this._baseApis)})},F.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 S.k(t,this._verificationMethods,this._baseApis)},r)},F.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 s.a.log("Crypto: could not find VerificationRequest for "+"".concat(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){s.a.error("error while handling verification event: "+e.message)}i&&!r.initiatedByMe&&!r.invalid&&!r.observeOnly&&this._baseApis.emit("crypto.verification.request",r)},F.prototype._onToDeviceBadEncrypted=async function(e){const t=e.getWireContent(),n=e.getSender(),o=t.algorithm,r=t.sender_key,i=()=>{const e=this._getRoomDecryptors(u.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 a=this._lastNewSessionForced[n][r]||0;if(a+36e5>Date.now())return s.a.debug("New session already forced with device "+n+":"+r+" at "+a+": not forcing another"),await this._olmDevice.recordSessionProblem(r,"wedged",!0),void i();let c=this._deviceList.getDeviceByIdentityKey(o,r);if(!c&&(await this.downloadKeys([n],!1),c=this._deviceList.getDeviceByIdentityKey(o,r),!c))return s.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]=[c],await u.ensureOlmSessionsForDevices(this._olmDevice,this._baseApis,l,!0),this._lastNewSessionForced[n][r]=Date.now();const d={algorithm:u.OLM_ALGORITHM,sender_key:this._olmDevice.deviceCurve25519Key,ciphertext:{}};await u.encryptMessageForDevice(d.ciphertext,this._userId,this._deviceId,this._olmDevice,n,c,{type:"m.dummy"}),await this._olmDevice.recordSessionProblem(r,"wedged",!0),i(),await this._baseApis.sendToDevice("m.room.encrypted",{[n]:{[c.deviceId]:d}});const h=await this._outgoingRoomKeyRequestManager.getOutgoingSentRoomKeyRequest(n,c.deviceId);for(const e of h)this.requestRoomKey(e.requestBody,e.recipients,!0)},F.prototype._onRoomMembership=function(e,t,n){const o=t.roomId,r=this._roomEncryptors[o];r&&(this._roomDeviceTrackingState[o]&&("join"==t.membership?(s.a.log("Join event for "+t.userId+" in "+o),this._deviceList.startTrackingDeviceList(t.userId)):"invite"==t.membership&&this._clientStore.getRoom(o).shouldEncryptForInvitedMembers()&&(s.a.log("Invite event for "+t.userId+" in "+o),this._deviceList.startTrackingDeviceList(t.userId))),r.onRoomMembership(e,t,n))},F.prototype._onRoomKeyRequestEvent=function(e){const t=e.getContent();if("request"===t.action){const t=new M(e);this._receivedRoomKeyRequests.push(t)}else if("request_cancellation"===t.action){const t=new P(e);this._receivedRoomKeyRequestCancellations.push(t)}},F.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){s.a.error("Error processing room key requsts: ".concat(e))}finally{this._processingRoomKeyRequests=!1}}},F.prototype._processReceivedRoomKeyRequest=async function(e){const t=e.userId,n=e.deviceId,o=e.requestBody,r=o.room_id,i=o.algorithm;if(s.a.log("m.room_key_request from ".concat(t,":").concat(n)+" for ".concat(r," / ").concat(o.session_id," (id ").concat(e.requestId,")")),t!==this._userId){if(!this._roomEncryptors[r])return void s.a.debug("room key request for unencrypted room ".concat(r));const e=this._roomEncryptors[r],i=this._deviceList.getStoredDevice(t,n);if(!i)return void s.a.debug("Ignoring keyshare for unknown device ".concat(t,":").concat(n));try{await e.reshareKeyWithDevice(o.sender_key,o.session_id,t,i)}catch(e){s.a.warn("Failed to re-share keys for session "+o.session_id+" with device "+t+":"+i.deviceId,e)}return}if(!this._roomDecryptors[r])return void s.a.log("room key request for unencrypted room ".concat(r));const a=this._roomDecryptors[r][i];if(a)if(await a.hasKeysForKeyRequest(e)){if(e.share=()=>{a.shareKeysWithDevice(e)},this.checkDeviceTrust(t,n).isVerified())return s.a.log("device is already verified: sharing keys"),void e.share();this.emit("crypto.roomKeyRequest",e)}else s.a.log("room key request for unknown session ".concat(r," / ")+o.session_id);else s.a.log("room key request for unknown alg ".concat(i," in room ").concat(r))},F.prototype._processReceivedRoomKeyRequestCancellation=async function(e){s.a.log("m.room_key_request cancellation for ".concat(e.userId,":")+"".concat(e.deviceId," (id ").concat(e.requestId,")")),this.emit("crypto.roomKeyRequestCancellation",e)},F.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=p.a[t];if(!r)throw new p.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},F.prototype._getRoomDecryptors=function(e){const t=[];for(const n of Object.values(this._roomDecryptors))e in n&&t.push(n[e]);return t},F.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(r.a.stringify(e)),e.signatures=t,void 0!==n&&(e.unsigned=n)};class M{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 P{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))},function(e,t,n){"use strict";(function(e,o){n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return p}));var r=n(236),i=n(155),a=n(61);const s="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:".concat(n)]=n;break}case d:{const n=this.request.targetDevice.deviceId;t["ed25519:".concat(n)]=e.otherDeviceKey;break}case h:{const n=e.myMasterKey;t["ed25519:".concat(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,a=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();a=t.getStoredCrossSigningForUser(e).getId("master")}const s=p._generateQrData(e,t,o,n,r,i,a),c=p._generateBuffer(s);return new p(o,n,r,i,a,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(a.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,a){const s=t.getUserId(),c={prefix:"MATRIX",version:2,mode:n,transactionId:e.channel.transactionId,firstKeyB64:"",secondKeyB64:"",secretB64:o},l=t.getStoredCrossSigningForUser(s);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=a),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(a.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(86).Buffer)},function(e,t,n){var o=n(90),r=n(156);e.exports=n(91)?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(128);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(242);e.exports=function(e){return Object(o(e))}},function(e,t,n){var o=n(336),r=n(242);e.exports=function(e){return o(r(e))}},function(e,t,n){var o=n(159),r=n(804),i=n(805),a=o?o.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a 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(97)),r=i(n(67));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(347)),r=i(n(255));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.draggable,n=e.destination,i=e.previousImpact,a=e.viewport,s=t.descriptor.id,c=(0,o.default)(i.movement.displaced),l=(0,r.default)({target:t.page.withMargin,destination:n,viewport:a}),u=function(){if(!l)return!1;var e=c[s];return!e||e.shouldAnimate}();return{draggableId:s,isVisible:l,shouldAnimate:u}}},function(e,t,n){e.exports.Container=n(895),e.exports.MapStore=n(897),e.exports.Mixin=n(905),e.exports.ReduceStore=n(366),e.exports.Store=n(367)},function(e,t,n){"use strict";n.d(t,"b",(function(){return N}));var o=n(3),r=n.n(o),i=n(46),a=n.n(i),s=n(165),c=n(33),l=n.n(c),u=n(35),d=n.n(u),h=n(38),p=n.n(h),m=n(42),g=n.n(m),f=n(34),_=n(203),v=n(36),b=n(39),y=n(40),E=n(44),S=n(69),w=n(37),C=n(205),x=n(206),T=n(47),k=n(83);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"},O={"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 C.a)O[e]="messages.TextualEvent";function D(e){const t=e.getType();if("m.room.message"===t){const t=e.getContent();if(t&&"m.key.verification.request"===t.msgtype){const n=w.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=w.a.get(),n=t&&t.getUserId();if(e.getSender()!==n)return}if("m.key.verification.cancel"===t&&y.b.getValue("showHiddenEventsInTimeline")){if(!v.getComponent("messages.MKeyVerificationConclusion").prototype._shouldRender.call(null,e,e.request))return}return e.isState()?O[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},getDefaultProps:function(){return{onHeightChanged:function(){}}},getInitialState:function(){return{actionBarFocused:!1,allReadAvatars:!1,verified:null,previouslyRequestedKeys:!1,reactions:this.getReactions()}},statics:{contextType:T.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!x.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:k.a.VERIFIED},()=>{this.props.onHeightChanged()});if(!y.b.getValue("feature_cross_signing"))return void this.setState({verified:k.a.WARNING},this.props.onHeightChanged);if(!this.context.checkUserTrust(e.getSender()).isCrossSigningVerified())return void this.setState({verified:k.a.NORMAL},this.props.onHeightChanged);const t=await this.context.checkEventSenderTrust(e);t?this.setState({verified:t.isVerified()?k.a.VERIFIED:k.a.WARNING},this.props.onHeightChanged):this.setState({verified:k.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:-(n-15)}},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(A,null);if(e.isEncrypted())return this.state.verified===k.a.NORMAL||this.state.verified===k.a.VERIFIED?void 0:this.state.verified===k.a.UNKNOWN?l.a.createElement(L,null):l.a.createElement(M,null);if(this.context.isRoomEncrypted(e.getRoomId())){if(e.status===E.b.ENCRYPTING)return;if(e.status===E.b.NOT_SENT)return;if(e.isState())return;return l.a.createElement(P,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 a=!i&&"m.room.message"!==r&&"m.sticker"!==r&&"m.room.create"!==r,c=D(this.props.mxEvent);if((!c||this.props.mxEvent.isRelation("m.replace"))&&y.b.getValue("showHiddenEventsInTimeline")&&(c="messages.ViewSourceEvent",a=!0),!c){const{mxEvent:e}=this.props;return console.warn("Event type not supported: type:".concat(e.getType()," isState:").concat(e.isState())),l.a.createElement("div",{className:"mx_EventTile mx_EventTile_info mx_MNoticeBody"},l.a.createElement("div",{className:"mx_EventTile_line"},Object(f.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,_=g()({mx_EventTile_bubbleContainer:i,mx_EventTile:!0,mx_EventTile_isEditing:m,mx_EventTile_info:a,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===k.a.VERIFIED,mx_EventTile_unverified:!i&&this.state.verified===k.a.WARNING,mx_EventTile_unknown:!i&&this.state.verified===k.a.UNKNOWN,mx_EventTile_bad:p,mx_EventTile_emote:"m.emote"===o,mx_EventTile_redacted:h});let b="#";this.props.permalinkCreator&&(b=this.props.permalinkCreator.forEvent(this.props.mxEvent.getId()));const E=this.getReadAvatars();let w,C,x,T;if("notif"===this.props.tileShape?(x=24,T=!0):"messages.RoomCreate"===c||i?(x=0,T=!1):a?(x=14,T=!1):this.props.continuation&&"file_grid"!==this.props.tileShape?(x=0,T=!1):(x=30,T=!0),this.props.mxEvent.sender&&x&&(w=l.a.createElement("div",{className:"mx_EventTile_avatar"},l.a.createElement(n,{member:this.props.mxEvent.sender,width:x,height:x,viewUserOnClick:!0}))),T){let e=null;this.props.tileShape&&"reply"!==this.props.tileShape&&"reply_preview"!==this.props.tileShape?C=l.a.createElement(t,{mxEvent:this.props.mxEvent,enableFlair:!0}):("m.image"===o?e=Object(f.b)("%(senderName)s sent an image"):"m.video"===o?e=Object(f.b)("%(senderName)s sent a video"):"m.file"===o&&(e=Object(f.b)("%(senderName)s uploaded a file")),C=l.a.createElement(t,{onClick:this.onSenderProfileClick,mxEvent:this.props.mxEvent,enableFlair:!e,text:e}))}const R=v.getComponent("messages.MessageActionBar"),O=m?void 0:l.a.createElement(R,{mxEvent:this.props.mxEvent,reactions:this.state.reactions,permalinkCreator:this.props.permalinkCreator,getTile:this.getTile,getReplyThread:this.getReplyThread,onFocusChange:this.onActionBarFocusChange}),I=this.props.mxEvent.getTs()?l.a.createElement(e,{showTwelveHour:this.props.isTwelveHour,ts:this.props.mxEvent.getTs()}):null,N=l.a.createElement("div",{className:"mx_EventTile_keyRequestInfo_tooltip_contents"},l.a.createElement("p",null,this.state.previouslyRequestedKeys?Object(f.a)("Your key share request has been sent - please check your other sessions for key share requests."):Object(f.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(f.a)("If your other sessions do not have the key for this message you will not be able to decrypt them."))),A=this.state.previouslyRequestedKeys?Object(f.a)("Key request sent."):Object(f.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"},A),l.a.createElement(M,{helpText:N})):null;let L;if(!h){const e=v.getComponent("messages.ReactionsRow");L=l.a.createElement(e,{mxEvent:this.props.mxEvent,reactions:this.state.reactions})}switch(this.props.tileShape){case"notif":{const e=this.context.getRoom(this.props.mxEvent.getRoomId());return l.a.createElement("div",{className:_},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"},w,l.a.createElement("a",{href:b,onClick:this.onPermalinkClicked},C,I)),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:_},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"},C,I)));case"reply":case"reply_preview":{let e;return"reply_preview"===this.props.tileShape&&(e=s.a.makeThread(this.props.mxEvent,this.props.onHeightChanged,this.props.permalinkCreator,this._replyThread)),l.a.createElement("div",{className:_},w,C,l.a.createElement("div",{className:"mx_EventTile_reply"},l.a.createElement("a",{href:b,onClick:this.onPermalinkClicked},I),!i&&this._renderE2EPadlock(),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=s.a.makeThread(this.props.mxEvent,this.props.onHeightChanged,this.props.permalinkCreator,this._replyThread);return l.a.createElement("div",{className:_,tabIndex:-1},l.a.createElement("div",{className:"mx_EventTile_msgOption"},E),C,l.a.createElement("div",{className:"mx_EventTile_line"},l.a.createElement("a",{href:b,onClick:this.onPermalinkClicked,"aria-label":Object(S.d)(new Date(this.props.mxEvent.getTs()),this.props.isTwelveHour)},I),!i&&this._renderE2EPadlock(),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,O),w)}}}});const I=["m.room.message","m.sticker"];function F(e){return I.includes(e.getType())}function N(e){if(e.isRedacted()&&!F(e))return!1;if(e.isRelation("m.replace"))return!1;const t=D(e);return void 0!==t&&("messages.TextualEvent"===t?""!==_.a(e):"messages.RoomCreate"!==t||Boolean(e.getContent().predecessor))}function A(e){return l.a.createElement(U,a()({title:Object(f.a)("This message cannot be decrypted"),icon:"undecryptable"},e))}function M(e){return l.a.createElement(U,a()({title:Object(f.a)("Encrypted by an unverified session"),icon:"unverified"},e))}function P(e){return l.a.createElement(U,a()({title:Object(f.a)("Unencrypted"),icon:"unencrypted"},e))}function L(e){return l.a.createElement(U,a()({title:Object(f.a)("Encrypted by a deleted session"),icon:"unknown"},e))}class U 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_".concat(this.props.icon);return y.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()(U,"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 a 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 a),t.a=e.singletonActiveWidgetStore}).call(this,n(17))},function(e,t,n){(function(e,o){var r;(function(){var i="Expected a function",a="__lodash_placeholder__",s=[["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]",f="[object Number]",_="[object Object]",v="[object RegExp]",b="[object Set]",y="[object String]",E="[object Symbol]",S="[object WeakMap]",w="[object ArrayBuffer]",C="[object DataView]",x="[object Float32Array]",T="[object Float64Array]",k="[object Int8Array]",R="[object Int16Array]",O="[object Int32Array]",D="[object Uint8Array]",I="[object Uint16Array]",F="[object Uint32Array]",N=/\b__p \+= '';/g,A=/\b(__p \+=) '' \+/g,M=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,U=RegExp(P.source),j=RegExp(L.source),B=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,W=RegExp(K.source),Y=/^\s+|\s+$/g,$=/^\s+/,Q=/\s+$/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\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,ae=/^\[object .+?Constructor\]$/,se=/^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+"]",fe="["+he+"]",_e="\\d+",ve="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+pe+_e+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",we="(?:\\ud83c[\\udde6-\\uddff]){2}",Ce="[\\ud800-\\udbff][\\udc00-\\udfff]",xe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Te="(?:"+be+"|"+ye+")",ke="(?:"+xe+"|"+ye+")",Re="(?:"+fe+"|"+Ee+")"+"?",Oe="[\\ufe0e\\ufe0f]?"+Re+("(?:\\u200d(?:"+[Se,we,Ce].join("|")+")[\\ufe0e\\ufe0f]?"+Re+")*"),De="(?:"+[ve,we,Ce].join("|")+")"+Oe,Ie="(?:"+[Se+fe+"?",fe,we,Ce,me].join("|")+")",Fe=RegExp("['’]","g"),Ne=RegExp(fe,"g"),Ae=RegExp(Ee+"(?="+Ee+")|"+Ie+Oe,"g"),Me=RegExp([xe+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ge,xe,"$"].join("|")+")",ke+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ge,xe+Te,"$"].join("|")+")",xe+"?"+Te+"+(?:['’](?:d|ll|m|re|s|t|ve))?",xe+"+(?:['’](?: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_])",_e,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"],je=-1,Be={};Be[x]=Be[T]=Be[k]=Be[R]=Be[O]=Be[D]=Be["[object Uint8ClampedArray]"]=Be[I]=Be[F]=!0,Be[c]=Be[l]=Be[w]=Be[u]=Be[C]=Be[d]=Be[h]=Be[p]=Be[g]=Be[f]=Be[_]=Be[v]=Be[b]=Be[y]=Be[S]=!1;var qe={};qe[c]=qe[l]=qe[w]=qe[C]=qe[u]=qe[d]=qe[x]=qe[T]=qe[k]=qe[R]=qe[O]=qe[g]=qe[f]=qe[_]=qe[v]=qe[b]=qe[y]=qe[E]=qe[D]=qe["[object Uint8ClampedArray]"]=qe[I]=qe[F]=!0,qe[h]=qe[p]=qe[S]=!1;var Ge={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,He=parseInt,ze="object"==typeof e&&e&&e.Object===Object&&e,Ke="object"==typeof self&&self&&self.Object===Object&&self,We=ze||Ke||Function("return this")(),Ye=t&&!t.nodeType&&t,$e=Ye&&"object"==typeof o&&o&&!o.nodeType&&o,Qe=$e&&$e.exports===Ye,Je=Qe&&ze.process,Xe=function(){try{var e=$e&&$e.require&&$e.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Ze=Xe&&Xe.isArrayBuffer,et=Xe&&Xe.isDate,tt=Xe&&Xe.isMap,nt=Xe&&Xe.isRegExp,ot=Xe&&Xe.isSet,rt=Xe&&Xe.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 at(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 At(e,t){for(var n=e.length;n--&&Et(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=Tt({"À":"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=Tt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ut(e){return"\\"+Ge[e]}function jt(e){return Pe.test(e)}function Bt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function qt(e,t){return function(n){return e(t(n))}}function Gt(e,t){for(var n=-1,o=e.length,r=0,i=[];++n",""":'"',"'":"'"});var Yt=function e(t){var n,o=(t=null==t?We:Yt.defaults(We.Object(),t,Yt.pick(We,Ue))).Array,r=t.Date,he=t.Error,pe=t.Function,me=t.Math,ge=t.Object,fe=t.RegExp,_e=t.String,ve=t.TypeError,be=o.prototype,ye=pe.prototype,Ee=ge.prototype,Se=t["__core-js_shared__"],we=ye.toString,Ce=Ee.hasOwnProperty,xe=0,Te=(n=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",ke=Ee.toString,Re=we.call(ge),Oe=We._,De=fe("^"+we.call(Ce).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Qe?t.Buffer:void 0,Ae=t.Symbol,Pe=t.Uint8Array,Ge=Ie?Ie.allocUnsafe:void 0,ze=qt(ge.getPrototypeOf,ge),Ke=ge.create,Ye=Ee.propertyIsEnumerable,$e=be.splice,Je=Ae?Ae.isConcatSpreadable:void 0,Xe=Ae?Ae.iterator:void 0,vt=Ae?Ae.toStringTag:void 0,Tt=function(){try{var e=ei(ge,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,Qt=r&&r.now!==We.Date.now&&r.now,Jt=t.setTimeout!==We.setTimeout&&t.setTimeout,Xt=me.ceil,Zt=me.floor,en=ge.getOwnPropertySymbols,tn=Ie?Ie.isBuffer:void 0,nn=t.isFinite,on=be.join,rn=qt(ge.keys,ge),an=me.max,sn=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"),fn=ei(t,"WeakMap"),_n=ei(ge,"create"),vn=fn&&new fn,bn={},yn=ki(hn),En=ki(pn),Sn=ki(mn),wn=ki(gn),Cn=ki(fn),xn=Ae?Ae.prototype:void 0,Tn=xn?xn.valueOf:void 0,kn=xn?xn.toString:void 0;function Rn(e){if(Ha(e)&&!Na(e)&&!(e instanceof Fn)){if(e instanceof In)return e;if(Ce.call(e,"__wrapped__"))return Ri(e)}return new In(e)}var On=function(){function e(){}return function(t){if(!Va(t))return{};if(Ke)return Ke(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 Fn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Nn(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 a,s=1&t,l=2&t,h=4&t;if(n&&(a=r?n(e,o,r,i):n(e)),void 0!==a)return a;if(!Va(e))return e;var S=Na(e);if(S){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ce.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return vr(e,a)}else{var N=oi(e),A=N==p||N==m;if(La(e))return hr(e,s);if(N==_||N==c||A&&!r){if(a=l||A?{}:ii(e),!s)return l?function(e,t){return br(e,ni(e),t)}(e,function(e,t){return e&&br(t,Es(t),e)}(a,e)):function(e,t){return br(e,ti(e),t)}(e,Kn(a,e))}else{if(!qe[N])return r?e:{};a=function(e,t,n){var o=e.constructor;switch(t){case w:return pr(e);case u:case d:return new o(+e);case C:return function(e,t){var n=t?pr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case x:case T:case k:case R:case O:case D:case"[object Uint8ClampedArray]":case I:case F:return mr(e,n);case g:return new o;case f:case y: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 E:return r=e,Tn?ge(Tn.call(r)):{}}var r}(e,N,s)}}i||(i=new Ln);var M=i.get(e);if(M)return M;i.set(e,a),$a(e)?e.forEach((function(o){a.add(Qn(o,t,n,o,e,i))})):za(e)&&e.forEach((function(o,r){a.set(r,Qn(o,t,n,r,e,i))}));var P=S?void 0:(h?l?Wr:Kr:l?Es:ys)(e);return st(P||e,(function(o,r){P&&(o=e[r=o]),Vn(a,r,Qn(o,t,n,r,e,i))})),a}function Jn(e,t,n){var o=n.length;if(null==e)return!o;for(e=ge(e);o--;){var r=n[o],i=t[r],a=e[r];if(void 0===a&&!(r in e)||!i(a))return!1}return!0}function Xn(e,t,n){if("function"!=typeof e)throw new ve(i);return yi((function(){e.apply(void 0,n)}),t)}function Zn(e,t,n,o){var r=-1,i=dt,a=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=pt(t,Dt(n))),o?(i=ht,a=!1):t.length>=200&&(i=Ft,a=!1,t=new Pn(t));e:for(;++r-1},An.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 Nn,map:new(pn||An),string:new Nn}},Mn.prototype.delete=function(e){var t=Xr(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Xr(this,e).get(e)},Mn.prototype.has=function(e){return Xr(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Xr(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 An,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 An){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(s)?t>1?io(s,t-1,n,o,r):mt(r,s):o||(r[r.length]=s)}return r}var ao=wr(),so=wr(!0);function co(e,t){return e&&ao(e,t,ys)}function lo(e,t){return e&&so(e,t,ys)}function uo(e,t){return ut(t,(function(t){return Ba(e[t])}))}function ho(e,t){for(var n=0,o=(t=cr(t,e)).length;null!=e&&nt}function fo(e,t){return null!=e&&Ce.call(e,t)}function _o(e,t){return null!=e&&t in ge(e)}function vo(e,t,n){for(var r=n?ht:dt,i=e[0].length,a=e.length,s=a,c=o(a),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=pt(d,Dt(t))),l=sn(d.length,l),c[s]=!n&&(t||i>=120&&d.length>=120)?new Pn(s&&d):void 0}d=e[0];var h=-1,p=c[0];e:for(;++h=s)return c;var l=n[o];return c*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function Ao(e,t,n){for(var o=-1,r=t.length,i={};++o-1;)s!==e&&$e.call(s,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;si(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 jo(e,t){return Ei(gi(e,t,Ks),e+"")}function Bo(e){return jn(Os(e))}function qo(e,t){var n=Os(e);return Ci(n,$n(t,0,n.length))}function Go(e,t,n,o){if(!Va(e))return e;for(var r=-1,i=(t=cr(t,e)).length,a=i-1,s=e;null!=s&&++ri?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=o(i);++r>>1,a=e[i];null!==a&&!Ja(a)&&(n?a<=t:a=200){var l=t?null:Ur(e);if(l)return Vt(l);a=!1,r=Ft,c=new Pn}else c=t?[]:s;e:for(;++o=o?e:Ko(e,t,n)}var dr=$t||function(e){return We.clearTimeout(e)};function hr(e,t){if(t)return e.slice();var n=e.length,o=Ge?Ge(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=Ja(e),a=void 0!==t,s=null===t,c=t==t,l=Ja(t);if(!s&&!l&&!i&&e>t||i&&a&&c&&!s&&!l||o&&a&&c||!n&&c||!r)return 1;if(!o&&!i&&!l&&e1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,a&&ci(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),t=ge(t);++o-1?r[i?t[a]:a]:void 0}}function Rr(e){return zr((function(t){var n=t.length,o=n,r=In.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new ve(i);if(r&&!s&&"wrapper"==$r(a))var s=new In([],!0)}for(o=s?o:n;++o1&&b.reverse(),d&&ls))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(J,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return st(s,(function(n){var o="_."+n[0];t&n[1]&&!dt(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Z):[]}(o),n)))}function wi(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 Ci(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,Yi(e,n)}));function ta(e){var t=Rn(e);return t.__chain__=!0,t}function na(e,t){return t(e)}var oa=zr((function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Fn&&si(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:na,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 ra=yr((function(e,t,n){Ce.call(e,n)?++e[n]:Wn(e,n,1)}));var ia=kr(Fi),aa=kr(Ni);function sa(e,t){return(Na(e)?st:eo)(e,Jr(t,3))}function ca(e,t){return(Na(e)?ct:to)(e,Jr(t,3))}var la=yr((function(e,t,n){Ce.call(e,n)?e[n].push(t):Wn(e,n,[t])}));var ua=jo((function(e,t,n){var r=-1,i="function"==typeof t,a=Ma(e)?o(e.length):[];return eo(e,(function(e){a[++r]=i?it(t,e,n):bo(e,t,n)})),a})),da=yr((function(e,t,n){Wn(e,n,t)}));function ha(e,t){return(Na(e)?pt:Ro)(e,Jr(t,3))}var pa=yr((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ma=jo((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]]),No(e,io(t,1),[])})),ga=Qt||function(){return We.Date.now()};function fa(e,t,n){return t=n?void 0:t,Br(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var n;if("function"!=typeof t)throw new ve(i);return e=os(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var va=jo((function(e,t,n){var o=1;if(n.length){var r=Gt(n,Qr(va));o|=32}return Br(e,o,t,n,r)})),ba=jo((function(e,t,n){var o=3;if(n.length){var r=Gt(n,Qr(ba));o|=32}return Br(t,o,e,n,r)}));function ya(e,t,n){var o,r,a,s,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,s=e.apply(i,n)}function g(e){return u=e,c=yi(_,t),d?m(e):s}function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=a}function _(){var e=ga();if(f(e))return v(e);c=yi(_,function(e){var n=t-(e-l);return h?sn(n,a-(e-u)):n}(e))}function v(e){return c=void 0,p&&o?m(e):(o=r=void 0,s)}function b(){var e=ga(),n=f(e);if(o=arguments,r=this,l=e,n){if(void 0===c)return g(l);if(h)return dr(c),c=yi(_,t),m(l)}return void 0===c&&(c=yi(_,t)),s}return t=is(t)||0,Va(n)&&(d=!!n.leading,a=(h="maxWait"in n)?an(is(n.maxWait)||0,t):a,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?s:v(ga())},b}var Ea=jo((function(e,t){return Xn(e,1,t)})),Sa=jo((function(e,t,n){return Xn(e,is(t)||0,n)}));function wa(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 a=e.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(wa.Cache||Mn),n}function Ca(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)}}wa.Cache=Mn;var xa=lr((function(e,t){var n=(t=1==t.length&&Na(t[0])?pt(t[0],Dt(Jr())):pt(io(t,1),Dt(Jr()))).length;return jo((function(o){for(var r=-1,i=sn(o.length,n);++r=t})),Fa=yo(function(){return arguments}())?yo:function(e){return Ha(e)&&Ce.call(e,"callee")&&!Ye.call(e,"callee")},Na=o.isArray,Aa=Ze?Dt(Ze):function(e){return Ha(e)&&mo(e)==w};function Ma(e){return null!=e&&Ga(e.length)&&!Ba(e)}function Pa(e){return Ha(e)&&Ma(e)}var La=tn||ic,Ua=et?Dt(et):function(e){return Ha(e)&&mo(e)==d};function ja(e){if(!Ha(e))return!1;var t=mo(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Wa(e)}function Ba(e){if(!Va(e))return!1;var t=mo(e);return t==p||t==m||"[object AsyncFunction]"==t||"[object Proxy]"==t}function qa(e){return"number"==typeof e&&e==os(e)}function Ga(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Va(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ha(e){return null!=e&&"object"==typeof e}var za=tt?Dt(tt):function(e){return Ha(e)&&oi(e)==g};function Ka(e){return"number"==typeof e||Ha(e)&&mo(e)==f}function Wa(e){if(!Ha(e)||mo(e)!=_)return!1;var t=ze(e);if(null===t)return!0;var n=Ce.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&we.call(n)==Re}var Ya=nt?Dt(nt):function(e){return Ha(e)&&mo(e)==v};var $a=ot?Dt(ot):function(e){return Ha(e)&&oi(e)==b};function Qa(e){return"string"==typeof e||!Na(e)&&Ha(e)&&mo(e)==y}function Ja(e){return"symbol"==typeof e||Ha(e)&&mo(e)==E}var Xa=rt?Dt(rt):function(e){return Ha(e)&&Ga(e.length)&&!!Be[mo(e)]};var Za=Mr(ko),es=Mr((function(e,t){return e<=t}));function ts(e){if(!e)return[];if(Ma(e))return Qa(e)?Kt(e):vr(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=oi(e);return(t==g?Bt:t==b?Vt:Os)(e)}function ns(e){return e?(e=is(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function os(e){var t=ns(e),n=t%1;return t==t?n?t-n:t:0}function rs(e){return e?$n(os(e),0,4294967295):0}function is(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(Va(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Y,"");var n=ie.test(e);return n||se.test(e)?He(e.slice(2),n?2:8):re.test(e)?NaN:+e}function as(e){return br(e,Es(e))}function ss(e){return null==e?"":Xo(e)}var cs=Er((function(e,t){if(hi(t)||Ma(t))br(t,ys(t),e);else for(var n in t)Ce.call(t,n)&&Vn(e,n,t[n])})),ls=Er((function(e,t){br(t,Es(t),e)})),us=Er((function(e,t,n,o){br(t,Es(t),e,o)})),ds=Er((function(e,t,n,o){br(t,ys(t),e,o)})),hs=zr(Yn);var ps=jo((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,Wr(e),n),o&&(n=Qn(n,7,Vr));for(var r=t.length;r--;)er(n,t[r]);return n}));var xs=zr((function(e,t){return null==e?{}:function(e,t){return Ao(e,t,(function(t,n){return fs(e,n)}))}(e,t)}));function Ts(e,t){if(null==e)return{};var n=pt(Wr(e),(function(e){return[e]}));return t=Jr(t),Ao(e,n,(function(e,n){return t(e,n[0])}))}var ks=jr(ys),Rs=jr(Es);function Os(e){return null==e?[]:It(e,ys(e))}var Ds=xr((function(e,t,n){return t=t.toLowerCase(),e+(n?Is(t):t)}));function Is(e){return js(ss(e).toLowerCase())}function Fs(e){return(e=ss(e))&&e.replace(le,Pt).replace(Ne,"")}var Ns=xr((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),As=xr((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ms=Cr("toLowerCase");var Ps=xr((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ls=xr((function(e,t,n){return e+(n?" ":"")+js(t)}));var Us=xr((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),js=Cr("toUpperCase");function Bs(e,t,n){return e=ss(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 qs=jo((function(e,t){try{return it(e,void 0,t)}catch(e){return ja(e)?e:new he(e)}})),Gs=zr((function(e,t){return st(t,(function(t){t=Ti(t),Wn(e,t,va(e[t],e))})),e}));function Vs(e){return function(){return e}}var Hs=Rr(),zs=Rr(!0);function Ks(e){return e}function Ws(e){return Co("function"==typeof e?e:Qn(e,1))}var Ys=jo((function(e,t){return function(n){return bo(n,e,t)}})),$s=jo((function(e,t){return function(n){return bo(e,n,t)}}));function Qs(e,t,n){var o=ys(t),r=uo(t,o);null!=n||Va(t)&&(r.length||!o.length)||(n=t,t=e,e=this,r=uo(t,ys(t)));var i=!(Va(n)&&"chain"in n&&!n.chain),a=Ba(e);return st(r,(function(n){var o=t[n];e[n]=o,a&&(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 Js(){}var Xs=Fr(pt),Zs=Fr(lt),ec=Fr(_t);function tc(e){return li(e)?xt(Ti(e)):function(e){return function(t){return ho(t,e)}}(e)}var nc=Ar(),oc=Ar(!0);function rc(){return[]}function ic(){return!1}var ac=Ir((function(e,t){return e+t}),0),sc=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 Rn.after=function(e,t){if("function"!=typeof t)throw new ve(i);return e=os(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=fa,Rn.assign=cs,Rn.assignIn=ls,Rn.assignInWith=us,Rn.assignWith=ds,Rn.at=hs,Rn.before=_a,Rn.bind=va,Rn.bindAll=Gs,Rn.bindKey=ba,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Na(e)?e:[e]},Rn.chain=ta,Rn.chunk=function(e,t,n){t=(n?ci(e,t,n):void 0===t)?1:an(os(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var i=0,a=0,s=o(Xt(r/t));ir?0:r+n),(o=void 0===o||o>r?r:os(o))<0&&(o+=r),o=n>o?0:rs(o);n>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Ya(t))&&!(t=Xo(t))&&jt(e)?ur(Kt(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new ve(i);return t=null==t?0:an(os(t),0),jo((function(n){var o=n[t],r=ur(n,0,t);return o&&mt(r,o),it(e,this,r)}))},Rn.tail=function(e){var t=null==e?0:e.length;return t?Ko(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?Ko(e,0,(t=n||void 0===t?1:os(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?Ko(e,(t=o-(t=n||void 0===t?1:os(t)))<0?0:t,o):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?nr(e,Jr(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?nr(e,Jr(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,n){var o=!0,r=!0;if("function"!=typeof e)throw new ve(i);return Va(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),ya(e,t,{leading:o,maxWait:t,trailing:r})},Rn.thru=na,Rn.toArray=ts,Rn.toPairs=ks,Rn.toPairsIn=Rs,Rn.toPath=function(e){return Na(e)?pt(e,Ti):Ja(e)?[e]:vr(xi(ss(e)))},Rn.toPlainObject=as,Rn.transform=function(e,t,n){var o=Na(e),r=o||La(e)||Xa(e);if(t=Jr(t,4),null==n){var i=e&&e.constructor;n=r?o?new i:[]:Va(e)&&Ba(i)?On(ze(e)):{}}return(r?st:co)(e,(function(e,o,r){return t(n,e,o,r)})),n},Rn.unary=function(e){return fa(e,1)},Rn.union=Hi,Rn.unionBy=zi,Rn.unionWith=Ki,Rn.uniq=function(e){return e&&e.length?Zo(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?Zo(e,Jr(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zo(e,void 0,t):[]},Rn.unset=function(e,t){return null==e||er(e,t)},Rn.unzip=Wi,Rn.unzipWith=Yi,Rn.update=function(e,t,n){return null==e?e:tr(e,t,sr(n))},Rn.updateWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:tr(e,t,sr(n),o)},Rn.values=Os,Rn.valuesIn=function(e){return null==e?[]:It(e,Es(e))},Rn.without=$i,Rn.words=Bs,Rn.wrap=function(e,t){return Ta(sr(t),e)},Rn.xor=Qi,Rn.xorBy=Ji,Rn.xorWith=Xi,Rn.zip=Zi,Rn.zipObject=function(e,t){return ir(e||[],t||[],Vn)},Rn.zipObjectDeep=function(e,t){return ir(e||[],t||[],Go)},Rn.zipWith=ea,Rn.entries=ks,Rn.entriesIn=Rs,Rn.extend=ls,Rn.extendWith=us,Qs(Rn,Rn),Rn.add=ac,Rn.attempt=qs,Rn.camelCase=Ds,Rn.capitalize=Is,Rn.ceil=sc,Rn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=is(n))==n?n:0),void 0!==t&&(t=(t=is(t))==t?t:0),$n(is(e),t,n)},Rn.clone=function(e){return Qn(e,4)},Rn.cloneDeep=function(e){return Qn(e,5)},Rn.cloneDeepWith=function(e,t){return Qn(e,5,t="function"==typeof t?t:void 0)},Rn.cloneWith=function(e,t){return Qn(e,4,t="function"==typeof t?t:void 0)},Rn.conformsTo=function(e,t){return null==t||Jn(e,t,ys(t))},Rn.deburr=Fs,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=cc,Rn.endsWith=function(e,t,n){e=ss(e),t=Xo(t);var o=e.length,r=n=void 0===n?o:$n(os(n),0,o);return(n-=t.length)>=0&&e.slice(n,r)==t},Rn.eq=Oa,Rn.escape=function(e){return(e=ss(e))&&j.test(e)?e.replace(L,Lt):e},Rn.escapeRegExp=function(e){return(e=ss(e))&&W.test(e)?e.replace(K,"\\$&"):e},Rn.every=function(e,t,n){var o=Na(e)?lt:no;return n&&ci(e,t,n)&&(t=void 0),o(e,Jr(t,3))},Rn.find=ia,Rn.findIndex=Fi,Rn.findKey=function(e,t){return bt(e,Jr(t,3),co)},Rn.findLast=aa,Rn.findLastIndex=Ni,Rn.findLastKey=function(e,t){return bt(e,Jr(t,3),lo)},Rn.floor=lc,Rn.forEach=sa,Rn.forEachRight=ca,Rn.forIn=function(e,t){return null==e?e:ao(e,Jr(t,3),Es)},Rn.forInRight=function(e,t){return null==e?e:so(e,Jr(t,3),Es)},Rn.forOwn=function(e,t){return e&&co(e,Jr(t,3))},Rn.forOwnRight=function(e,t){return e&&lo(e,Jr(t,3))},Rn.get=gs,Rn.gt=Da,Rn.gte=Ia,Rn.has=function(e,t){return null!=e&&ri(e,t,fo)},Rn.hasIn=fs,Rn.head=Mi,Rn.identity=Ks,Rn.includes=function(e,t,n,o){e=Ma(e)?e:Os(e),n=n&&!o?os(n):0;var r=e.length;return n<0&&(n=an(r+n,0)),Qa(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&Et(e,t,n)>-1},Rn.indexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:os(n);return r<0&&(r=an(o+r,0)),Et(e,t,r)},Rn.inRange=function(e,t,n){return t=ns(t),void 0===n?(n=t,t=0):n=ns(n),function(e,t,n){return e>=sn(t,n)&&e=-9007199254740991&&e<=9007199254740991},Rn.isSet=$a,Rn.isString=Qa,Rn.isSymbol=Ja,Rn.isTypedArray=Xa,Rn.isUndefined=function(e){return void 0===e},Rn.isWeakMap=function(e){return Ha(e)&&oi(e)==S},Rn.isWeakSet=function(e){return Ha(e)&&"[object WeakSet]"==mo(e)},Rn.join=function(e,t){return null==e?"":on.call(e,t)},Rn.kebabCase=Ns,Rn.last=ji,Rn.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=os(n))<0?an(o+r,0):sn(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):yt(e,wt,r,!0)},Rn.lowerCase=As,Rn.lowerFirst=Ms,Rn.lt=Za,Rn.lte=es,Rn.max=function(e){return e&&e.length?oo(e,Ks,go):void 0},Rn.maxBy=function(e,t){return e&&e.length?oo(e,Jr(t,2),go):void 0},Rn.mean=function(e){return Ct(e,Ks)},Rn.meanBy=function(e,t){return Ct(e,Jr(t,2))},Rn.min=function(e){return e&&e.length?oo(e,Ks,ko):void 0},Rn.minBy=function(e,t){return e&&e.length?oo(e,Jr(t,2),ko):void 0},Rn.stubArray=rc,Rn.stubFalse=ic,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=dc,Rn.nth=function(e,t){return e&&e.length?Fo(e,os(t)):void 0},Rn.noConflict=function(){return We._===this&&(We._=Oe),this},Rn.noop=Js,Rn.now=ga,Rn.pad=function(e,t,n){e=ss(e);var o=(t=os(t))?zt(e):0;if(!t||o>=t)return e;var r=(t-o)/2;return Nr(Zt(r),n)+e+Nr(Xt(r),n)},Rn.padEnd=function(e,t,n){e=ss(e);var o=(t=os(t))?zt(e):0;return t&&ot){var o=e;e=t,t=o}if(n||e%1||t%1){var r=un();return sn(e+r*(t-e+Ve("1e-"+((r+"").length-1))),t)}return Lo(e,t)},Rn.reduce=function(e,t,n){var o=Na(e)?gt:kt,r=arguments.length<3;return o(e,Jr(t,4),n,r,eo)},Rn.reduceRight=function(e,t,n){var o=Na(e)?ft:kt,r=arguments.length<3;return o(e,Jr(t,4),n,r,to)},Rn.repeat=function(e,t,n){return t=(n?ci(e,t,n):void 0===t)?1:os(t),Uo(ss(e),t)},Rn.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.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=sn(e,4294967295);e-=4294967295;for(var r=Ot(o,t=Jr(t));++n=i)return e;var s=n-zt(o);if(s<1)return o;var c=a?ur(a,0,s).join(""):e.slice(0,s);if(void 0===r)return c+o;if(a&&(s+=c.length-s),Ya(r)){if(e.slice(s).search(r)){var l,u=c;for(r.global||(r=fe(r.source,ss(oe.exec(r))+"g")),r.lastIndex=0;l=r.exec(u);)var d=l.index;c=c.slice(0,void 0===d?s:d)}}else if(e.indexOf(Xo(r),s)!=s){var h=c.lastIndexOf(r);h>-1&&(c=c.slice(0,h))}return c+o},Rn.unescape=function(e){return(e=ss(e))&&U.test(e)?e.replace(P,Wt):e},Rn.uniqueId=function(e){var t=++xe;return ss(e)+t},Rn.upperCase=Us,Rn.upperFirst=js,Rn.each=sa,Rn.eachRight=ca,Rn.first=Mi,Qs(Rn,(uc={},co(Rn,(function(e,t){Ce.call(Rn.prototype,t)||(uc[t]=e)})),uc),{chain:!1}),Rn.VERSION="4.17.15",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rn[e].placeholder=Rn})),st(["drop","take"],(function(e,t){Fn.prototype[e]=function(n){n=void 0===n?1:an(os(n),0);var o=this.__filtered__&&!t?new Fn(this):this.clone();return o.__filtered__?o.__takeCount__=sn(n,o.__takeCount__):o.__views__.push({size:sn(n,4294967295),type:e+(o.__dir__<0?"Right":"")}),o},Fn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,o=1==n||3==n;Fn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Jr(e,3),type:n}),t.__filtered__=t.__filtered__||o,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Fn.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Fn.prototype[e]=function(){return this.__filtered__?new Fn(this):this[n](1)}})),Fn.prototype.compact=function(){return this.filter(Ks)},Fn.prototype.find=function(e){return this.filter(e).head()},Fn.prototype.findLast=function(e){return this.reverse().find(e)},Fn.prototype.invokeMap=jo((function(e,t){return"function"==typeof e?new Fn(this):this.map((function(n){return bo(n,e,t)}))})),Fn.prototype.reject=function(e){return this.filter(Ca(Jr(e)))},Fn.prototype.slice=function(e,t){e=os(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Fn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=os(t))<0?n.dropRight(-t):n.take(t-e)),n)},Fn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Fn.prototype.toArray=function(){return this.take(4294967295)},co(Fn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=Rn[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);r&&(Rn.prototype[t]=function(){var t=this.__wrapped__,a=o?[1]:arguments,s=t instanceof Fn,c=a[0],l=s||Na(t),u=function(e){var t=r.apply(Rn,mt([e],a));return o&&d?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=i&&!d,m=s&&!h;if(!i&&l){t=m?t:new Fn(this);var g=e.apply(t,a);return g.__actions__.push({func:na,args:[u],thisArg:void 0}),new In(g,d)}return p&&m?e.apply(this,a):(g=this.thru(u),p?o?g.value()[0]:g.value():g)})})),st(["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);Rn.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var r=this.value();return t.apply(Na(r)?r:[],e)}return this[n]((function(n){return t.apply(Na(n)?n:[],e)}))}})),co(Fn.prototype,(function(e,t){var n=Rn[t];if(n){var o=n.name+"";Ce.call(bn,o)||(bn[o]=[]),bn[o].push({name:t,func:n})}})),bn[Or(void 0,2).name]=[{name:"wrapper",func:void 0}],Fn.prototype.clone=function(){var e=new Fn(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},Fn.prototype.reverse=function(){if(this.__filtered__){var e=new Fn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Fn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Na(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__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof Dn;){var o=Ri(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},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Fn){var t=e;return this.__actions__.length&&(t=new Fn(this)),(t=t.reverse()).__actions__.push({func:na,args:[Vi],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(Vi)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return or(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,Xe&&(Rn.prototype[Xe]=function(){return this}),Rn}();We._=Yt,void 0===(r=function(){return Yt}.call(t,n,t,o))||(o.exports=r)}).call(this)}).call(this,n(17),n(152)(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),a=n(167),s=n(41),c=n(36),l=n(34),u=n(715);function d(e,t){const n=new a.a(e);return n.invite(t).then(e=>Promise.resolve({states:e,inviter:n}))}function h(){const e=c.getComponent("dialogs.InviteDialog");s.a.createTrackedDialog("Start DM","",e,{kind:u.a},null,!1,!0)}function p(e){const t=c.getComponent("dialogs.InviteDialog");s.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");s.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");s.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");s.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+$/,a=/^@\S+:\S+$/,s=/^!\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=a.test(e),o=s.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 a}));var o=n(55),r=n.n(o);function i(e){if(!e)return"";const t=r.a.parse(e);return t&&"/"===t.path?t.host:e}function a(e){if(!e)return"";let t=e;return e.startsWith("https://")||(t="https://"+e),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 a})),n.d(t,"b",(function(){return s})),n.d(t,"d",(function(){return c}));var o=n(37);function r(e){return e.getCanonicalAlias()||e.getAltAliases()[0]}const i={};function a(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 s(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";(function(e){var o=n(50),r=n(951),i=n(40);class a{constructor(){this.index=null,this._supportIsInstalled=!1}async init(){const e=o.a.get().getEventIndexingManager();return e?(this._supportIsInstalled=await e.supportsEventIndexing(),this.supportIsInstalled()?i.b.getValueAt(i.a.DEVICE,"enableEventIndexing")?this.initEventIndex():(console.log("EventIndex: Event indexing is disabled, not initializing"),!1):(console.log("EventIndex: Event indexing isn't installed for the platform, not initializing."),!1)):(console.log("EventIndex: Platform doesn't support event indexing, not initializing."),!1)}async initEventIndex(){const e=new r.a;try{await e.init()}catch(e){return console.log("EventIndex: Error initializing the event index",e),!1}return this.index=e,!0}platformHasSupport(){return null!==o.a.get().getEventIndexingManager()}supportIsInstalled(){return this._supportIsInstalled}get(){return this.index}start(){null!==this.index&&this.index.startCrawler()}stop(){null!==this.index&&this.index.stopCrawler()}async unset(){null!==this.index&&(await this.index.close(),this.index=null)}async deleteEventIndex(){const e=o.a.get().getEventIndexingManager();null!==e&&(await this.unset(),console.log("EventIndex: Deleting event index."),await e.deleteEventIndex())}}e.mxEventIndexPeg||(e.mxEventIndexPeg=new a),t.a=e.mxEventIndexPeg}).call(this,n(17))},function(e,t,n){"use strict";n.r(t),function(e){var o=n(37),r=n(50),i=n(203),a=n(58),s=n(147),c=n(39),l=n(36),u=n(34),d=n(41),h=n(40);const p={"m.key.verification.request":e=>{const t=(e.sender||{}).name;return Object(u.a)("%(name)s is requesting verification",{name:t})}},m={notifsByRoom:{},pendingEncryptedEventIds:[],notificationMessageForEvent:function(e){return p.hasOwnProperty(e.getContent().msgtype)?p[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,a=this.notificationMessageForEvent(t);if(!a)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&&!p.hasOwnProperty(t.getContent().msgtype)&&(a=t.getContent().body)):(i=n.name,t.getContent().body&&!p.hasOwnProperty(t.getContent().msgtype)&&(a=t.getContent().body)),this.isBodyEnabled()||(a="");let c=null;t.sender&&!h.b.getValue("lowBandwidth")&&(c=s.a(t.sender,40,40,"crop"));const l=o.displayNotification(i,a,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("".concat(e," has custom notification sound event, but url is not a mxc url")),null):(console.warn("".concat(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 ".concat(n&&n.name||"default"," for ").concat(t.roomId));try{const e=document.querySelector(n?"audio[src='".concat(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&&(a.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,a.a.trackEvent("Notifier","Set Toolbar Hidden",t),c.a.dispatch({action:"notifier_enabled",value:this.isEnabled()}),n&&e.localStorage&&e.localStorage.setItem("notifications_hidden",t)},shouldShowToolbar:function(){const e=o.a.get();return!!e&&(!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=m),t.default=e.mxNotifier}.call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return u}));var o=n(37),r=n(63),i=n(72);function a(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=c(e?e.userId:"")),i}function s(e,t,n,r){const a=Object(i.a)(o.a.get().getHomeserverUrl(),e.avatarUrl,Math.floor(t*window.devicePixelRatio),Math.floor(n*window.devicePixelRatio),r);return a&&0!==a.length?a:null}function c(e){const t=["03b381","368bd6","ac3ba8"];let o=0;for(let t=0;t=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 u(e,t,n,i){if(!e)return null;const a=e.getAvatarUrl(o.a.get().getHomeserverUrl(),t,n,i,!1);if(a)return a;let s=null;const c=r.a.shared().getUserIdForRoomId(e.roomId);return s=c?e.getMember(c):e.getAvatarFallbackMember(),s?s.getAvatarUrl(o.a.get().getHomeserverUrl(),t,n,i,!1):null}},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;e=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function s(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=s(e,t<0?0:0|a(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(a+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(a<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+"|"+a,"gi"),p=new RegExp('[&<>"]',"g"),m=new RegExp(a+'|[&<>"]',"gi"),g=function(e){return 92===e.charCodeAt(0)?e.charAt(1):i(e)},f=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,f):e.replace(p,f):e},reHtmlTag:l,OPENTAG:s,CLOSETAG:c,ENTITY:a,ESCAPABLE:d}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(3),r=n.n(o),i=n(0),a=n(1);function s(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}class c{constructor(){this._outgoingRoomKeyRequests=[],this._account=null,this._crossSigningKeys=null,this._privateKeys={},this._backupKeys={},this._sessions={},this._sessionProblems={},this._notifiedErrorDevices={},this._inboundGroupSessions={},this._inboundGroupSessionsWithheld={},this._deviceData=null,this._rooms={},this._sessionsNeedingBackup={}}async startup(){return this}deleteAllData(){return Promise.resolve()}getOrAddOutgoingRoomKeyRequest(e){const t=e.requestBody;return a.x(()=>{const n=this._getOutgoingRoomKeyRequest(t);return n?(i.a.log("already have key request outstanding for "+"".concat(t.room_id," / ").concat(t.session_id,": ")+"not sending another"),n):(i.a.log("enqueueing key request for ".concat(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(a.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 ".concat(t," ")+"as it was already updated to ".concat(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(function(e){for(var t=1;te.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){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 s})),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 f})),n.d(t,"j",(function(){return _}));var o=n(738),r=n(1),i=n(0),a=n(739);const s="/_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,s=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=a.b(d,3e4),i.onreadystatechange=function(){switch(i.readyState){case e.XMLHttpRequest.DONE:var t;a.a(i.timeout_timer);try{if(0===i.status)throw new f;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){a.a(i.timeout_timer),h.loaded=e.loaded,h.total=e.total,i.timeout_timer=a.b(d,3e4),n.progressHandler&&n.progressHandler({loaded:e.loaded,total:e.total})}));let _=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&&(_+="?"+v.join("&")),i.open("POST",_),this.useAuthorizationHeader&&i.setRequestHeader("Authorization","Bearer "+this.opts.accessToken),i.setRequestHeader("Content-Type",s),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":s},json:!1,bodyParser:g})}const _=this,v=m.finally((function(){for(let e=0;e<_.uploads.length;++e)if(_.uploads[e]===h)return void _.uploads.splice(e,1)}));return v.abort=m.abort,h.promise=v,this.uploads.push(h),v},cancelUpload:function(e){return!!e.abort&&(e.abort(),!0)},getCurrentUploads:function(){return this.uploads},idServerRequest:function(e,t,n,o,i,a){if(!this.opts.idBaseUrl)throw new Error("No Identity Server base URL set");const s=this.opts.idBaseUrl+i+n;if(void 0!==e&&!r.q(e))throw Error("Expected callback to be a function but got "+typeof e);const c={uri:s,method:t,withCredentials:!1,json:!0,_matrix_opts:this.opts,headers:{}};"GET"===t?c.qs=o:"object"==typeof o&&(c.json=o),a&&(c.headers.Authorization="Bearer ".concat(a));const l=r.d();return this.opts.request(c,p(l,e,this.opts.onlyData)),l.promise},authedRequest:function(e,t,n,o,r,i){o||(o={}),this.useAuthorizationHeader?(isFinite(i)&&(i={localTimeoutMs:i}),i||(i={}),i.headers||(i.headers={}),i.headers.Authorization||(i.headers.Authorization="Bearer "+this.opts.accessToken),o.access_token&&delete o.access_token):o.access_token||(o.access_token=this.opts.accessToken);const a=this.request(e,t,n,o,r,i),s=this;return a.catch((function(e){"M_UNKNOWN_TOKEN"==e.errcode?s.event_emitter.emit("Session.logged_out",e):"M_CONSENT_NOT_GIVEN"==e.errcode&&s.event_emitter.emit("no_consent",e.message,e.data.consent_uri)})),a},request:function(e,t,n,o,r,i){const a=void 0!==(i=i||{}).prefix?i.prefix:this.opts.prefix,s=this.opts.baseUrl+a+n;return this.requestOtherUrl(e,t,s,o,r,i)},requestOtherUrl:function(e,t,n,o,r,i){return null==i?i={}:isFinite(i)&&(i={localTimeoutMs:i}),this._request(e,t,n,o,r,i)},getUrl:function(e,t,n){let o="";return t&&(o="?"+r.e(t)),this.opts.baseUrl+n+e+o},_request:function(e,t,n,o,i,s){if(void 0!==e&&!r.q(e))throw Error("Expected callback to be a function but got "+typeof e);s=s||{};const c=this;if(this.opts.extraParams)for(const e in this.opts.extraParams)this.opts.extraParams.hasOwnProperty(e)&&(o[e]=this.opts.extraParams[e]);const l=r.i({},s.headers||{}),u=void 0===s.json||s.json;let d=s.bodyParser;u&&(i&&(i=JSON.stringify(i),l["content-type"]="application/json"),l.accept||(l.accept="application/json"),void 0===d&&(d=function(e){return JSON.parse(e)}));const h=r.d();let g,f,_=!1;const v=s.localTimeoutMs||this.opts.localTimeoutMs,b=()=>{v&&(g&&a.a(g),g=a.b((function(){_=!0,f&&f.abort&&f.abort(),h.reject(new m({error:"Locally timed out waiting for a response",errcode:"ORG.MATRIX.JSSDK_TIMEOUT",timeout:v}))}),v))};b();const y=h.promise;try{f=this.opts.request({uri:n,method:t,withCredentials:!1,qs:o,qsStringifyOptions:s.qsStringifyOptions,useQuerystring:!0,body:i,json:!1,timeout:v,headers:l||{},_matrix_opts:this.opts},(function(t,n,o){if(v&&(a.a(g),_))return;p(h,e,c.opts.onlyData,d)(t,n,o)})),f&&("onprogress"in f&&(f.onprogress=e=>{b()}),f.abort&&(y.abort=f.abort.bind(f)))}catch(t){h.reject(t),e&&e(t)}return y}};const p=function(e,t,n,r){return t=t||function(){},function(i,a,s){if(i){"AbortError"===i.name||"aborted"===i||i instanceof m||(i=new g("request failed",i))}if(!i)try{a.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 '".concat(t,"': ").concat(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 ".concat(n," error: ").concat(t)));i||(i=new Error("Server returned ".concat(n," error")));return i.httpStatus=n,i}(a,s):r&&(s=r(s))}catch(e){i=new Error("Error parsing server response: ".concat(e))}if(i)e.reject(i),t(i);else{const o={code:a.statusCode,headers:a.headers,data:s};e.resolve(n?s:o),t(null,n?s:o)}}};class m extends Error{constructor(e){super("MatrixError: ".concat((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?": ".concat(t.message):"")),this._cause=t}get name(){return"ConnectionError"}get cause(){return this._cause}}class f extends Error{constructor(){super("Operation aborted")}get name(){return"AbortError"}}async function _(e,t){let n=0,o=null;for(;n0){const e=1e3*Math.pow(2,n);console.log("network operation failed ".concat(n," times,")+" retrying in ".concat(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";function o(e,t){const n="Store is invalid because ".concat(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 ".concat(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";n.d(t,"a",(function(){return r})),n.d(t,"h",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"g",(function(){return s})),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(76);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"),a=r("m.timeout","Timed out"),s=(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(335),r=n(249);e.exports=Object.keys||function(e){return o(e,r)}},function(e,t,n){var o=n(81).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(112),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(62);t.default=function(e){var t=e.source,n=e.sourceEdge,r=e.destination,i=e.destinationEdge,a=e.destinationAxis,s=function(e){return(0,o.patch)(a.line,e[a[i]],e[a.crossAxisStart])},c=s(r),l=(0,o.absolute)((0,o.subtract)(t.center,s(t))),u=(0,o.patch)(a.line,("end"===n?-1:1)*l[a.line],l[a.crossLine]);return(0,o.add)(c,u)}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var o=n(137),r=n(39),i=n(63),a=n(202),s=n(40);const c="im.vector.fake.direct",l=["red","grey","bold","idle"],u=(e,t)=>{switch(e){case"im.vector.fake.invite":case"im.vector.fake.recent":case"im.vector.fake.archived":case"m.lowpriority":case c:return t;case"m.favourite":default:return"manual"}},d=new Set(["m.favourite","im.vector.fake.invite","im.vector.fake.recent","im.vector.fake.archived","m.lowpriority",c]);class h extends o.Store{constructor(){super(r.a),this._init(),this._getManualComparator=this._getManualComparator.bind(this),this._recentsComparator=this._recentsComparator.bind(this)}updateSortingAlgorithm(e,t){console.log("Updating room sorting algorithm: ",{algorithm:e,orderImportantFirst:t}),this._setState({algorithm:e,orderImportantFirst:t}),this._generateInitialRoomLists()}_init(){const e={"m.server_notice":[],"im.vector.fake.invite":[],"m.favourite":[],"im.vector.fake.recent":[],[c]:[],"m.lowpriority":[],"im.vector.fake.archived":[]};this._state={lists:e,presentationLists:e,ready:!1,stickyRoomId:null,algorithm:"recent",orderImportantFirst:!1},s.b.monitorSetting("RoomList.orderAlphabetically",null),s.b.monitorSetting("RoomList.orderByImportance",null),s.b.monitorSetting("feature_custom_tags",null)}_setState(e){if(e.lists){const t={};for(const n of Object.keys(e.lists))t[n]=e.lists[n].map(e=>e.room);e.presentationLists=t}this._state=Object.assign(this._state,e),this.__emitChange()}__onDispatch(e){const t=this._matrixClient&&this._state.ready;switch(e.action){case"setting_updated":if(!t)break;switch(e.settingName){case"RoomList.orderAlphabetically":this.updateSortingAlgorithm(e.newValue?"alphabetic":"recent",this._state.orderImportantFirst);break;case"RoomList.orderByImportance":this.updateSortingAlgorithm(this._state.algorithm,e.newValue);break;case"feature_custom_tags":this._setState({tagsEnabled:e.newValue}),this._generateInitialRoomLists()}break;case"MatrixActions.sync":{if("PREPARED"===e.prevState||"PREPARED"!==e.state)break;this._setState({tagsEnabled:s.b.isFeatureEnabled("feature_custom_tags")}),this._matrixClient=e.matrixClient;const t=s.b.getValue("RoomList.orderByImportance"),n=s.b.getValue("RoomList.orderAlphabetically");this.updateSortingAlgorithm(n?"alphabetic":"recent",t)}break;case"MatrixActions.Room.receipt":{if(!t)break;const n=this._matrixClient.getUserId();for(const t of Object.keys(e.event.getContent())){if(Object.keys(e.event.getContent()[t]["m.read"]||{}).includes(n))return void this._roomUpdateTriggered(e.room.roomId)}}break;case"MatrixActions.Room.tags":if(!t)break;this._generateInitialRoomLists();break;case"MatrixActions.Room.timeline":if(!(t&&e.isLiveEvent&&e.isLiveUnfilteredRoomTimelineEvent&&this._eventTriggersRecentReorder(e.event)&&"recent"===this._state.algorithm))break;this._roomUpdateTriggered(e.event.getRoomId());break;case"MatrixActions.Event.decrypted":{if(!t)break;const n=e.event.getRoomId();if(!n)break;const o=this._matrixClient.getRoom(n);if(!o)break;if(o.getLiveTimeline()!==o.getTimelineForEvent(e.event.getId())||!this._eventTriggersRecentReorder(e.event))break;this._roomUpdateTriggered(n)}break;case"MatrixActions.accountData":if(!t)break;if("m.direct"!==e.event_type)break;this._generateInitialRoomLists();break;case"MatrixActions.Room.myMembership":case"MatrixActions.Room":if(!t)break;this._roomUpdateTriggered(e.room.roomId,!0);break;case"on_client_not_viable":case"on_logged_out":this._init(),this._matrixClient=null;break;case"view_room":{if(!t)break;const n=this._state.stickyRoomId;this._setState({stickyRoomId:e.room_id}),n&&this._setRoomCategory(this._matrixClient.getRoom(n),"idle")}}}_roomUpdateTriggered(e,t){if(this._state.stickyRoomId!==e||t){const t=this._matrixClient.getRoom(e);if(!t)return;const n=this._calculateCategory(t);this._setRoomCategory(t,n)}}_filterTags(e){return e=e?Object.keys(e):[],this._state.tagsEnabled?e:e.filter(e=>d.has(e))}_getRecommendedTagsForRoom(e){const t=[],n=e.getMyMembership();if("join"===n||"invite"===n){t.push(...this._filterTags(e.tags));const o=i.a.shared();"invite"===n?t.push("im.vector.fake.invite"):o.getUserIdForRoomId(e.roomId)&&0===t.length?t.push(c):0===t.length&&t.push("im.vector.fake.recent")}else n&&t.push("im.vector.fake.archived");return t}_slotRoomIntoList(e,t,n,o,r,i){const a=l.indexOf(t);let s=(e,t)=>i(e.room)>=i(t.room);const c=u(n,this._state.algorithm);"recent"===c?s=(e,t)=>this._recentsComparator(e,t,i):"alphabetic"===c&&(s=(e,t)=>this._lexicographicalComparator(e,t));let d=0,h=!1,p=!1;for(const n of o)if(n.room.roomId!==e.roomId){if(n.room.roomId!==this._state.stickyRoomId&&!p){const o=l.indexOf(n.category);o>=a&&!h&&(d=r.length-1,h=!0);const i=o>a,c=o===a;(i||c&&s({room:e},n)<=0)&&(i?r.splice(d,0,{room:e,category:t}):r.push({room:e,category:t}),p=!0)}r.push(n)}return!p&&d>=0&&(console.warn("!! Room ".concat(e.roomId," nearly lost: Ran off the end of ").concat(n)),console.warn("!! Inserting at position ".concat(d," with category ").concat(t)),r.splice(d,0,{room:e,category:t}),p=!0),p}_setRoomCategory(e,t){if(!e)return;const n={},o={},r=e=>(o[e.roomId]||(o[e.roomId]=this._tsOfNewestEvent(e)),o[e.roomId]),i=this._getRecommendedTagsForRoom(e),a=[];for(const o of Object.keys(this._state.lists)){if(i.includes(o))if("manual"===u(o,this._state.algorithm))n[o]=this._state.lists[o].filter(t=>t.room.roomId!==e.roomId),n[o].push({room:e,category:t}),a.push(o);else{n[o]=[],this._slotRoomIntoList(e,t,o,this._state.lists[o],n[o],r)||(console.warn("!! Room ".concat(e.roomId," nearly lost: Failed to find a position")),console.warn("!! Inserting at position 0 in the list and flagging as inserted"),console.warn("!! Additional info: ",{category:t,key:o,upToIndex:n[o].length,expectedCount:this._state.lists[o].length}),n[o].splice(0,0,{room:e,category:t})),a.push(o)}else n[o]=this._state.lists[o].filter(t=>t.room.roomId!==e.roomId)}for(const o of i){let r=0;for(const e of a)e===o&&r++;1!==r&&console.warn("!! Room ".concat(e.roomId," inserted ").concat(r," times to ").concat(o)),0===r&&(console.warn("!! Recovering ".concat(e.roomId," for tag ").concat(o," at position 0")),n[o]||(console.warn("!! List for tag ".concat(o," does not exist - creating")),n[o]=[]),n[o].splice(0,0,{room:e,category:t}))}for(const e of Object.keys(n))"manual"===u(e,this._state.algorithm)&&n[e].sort(this._getManualComparator(e));this._setState({lists:n})}_generateInitialRoomLists(){console.log("Generating initial room lists");const e={"m.server_notice":[],"im.vector.fake.invite":[],"m.favourite":[],"im.vector.fake.recent":[],[c]:[],"m.lowpriority":[],"im.vector.fake.archived":[]},t=i.a.shared();this._matrixClient.getRooms().forEach(n=>{const o=this._matrixClient.getUserId(),r=n.getMyMembership(),i=n.getMember(o);if("invite"===r)e["im.vector.fake.invite"].push({room:n,category:"red"});else if("join"===r||"ban"===r||i&&i.isKicked()){let o=Object.keys(n.tags);if(o=o.filter(t=>void 0!==e[t]||!t.startsWith("m.")&&this._state.tagsEnabled),o.length)for(let t=0;t{if(!e)return Number.MAX_SAFE_INTEGER;if(n[e.roomId])return n[e.roomId];const t=this._tsOfNewestEvent(e);return n[e.roomId]=t,t};Object.keys(e).forEach(t=>{let n;switch(u(t,this._state.algorithm)){case"recent":n=(e,t)=>this._recentsComparator(e,t,o);break;case"alphabetic":n=this._lexicographicalComparator;break;case"manual":default:n=this._getManualComparator(t)}this._state.orderImportantFirst?e[t].sort((e,t)=>{if(e.category!==t.category){const n=l.indexOf(e.category),o=l.indexOf(t.category);return n>o?1:n=0;--t){const n=e.timeline[t];if(this._eventTriggersRecentReorder(n))return n.getTs()}return e.timeline.length&&e.timeline[0].getTs()?e.timeline[0].getTs():Number.MAX_SAFE_INTEGER}_calculateCategory(e){if(!this._state.orderImportantFirst)return"idle";if(e.getUnreadNotificationCount("highlight")>0)return"red";let t=e.getUnreadNotificationCount()>0;return t?"grey":(t=a.a(e),t?"bold":"idle")}_recentsComparator(e,t,n){const o=n(e.room);return n(t.room)-o}_lexicographicalComparator(e,t){return e.room.name.localeCompare(t.room.name)}_getManualComparator(e,t){return(n,o)=>{const r=n.room,i=o.room;let a=r.tags[e],s=i.tags[e];t&&r===t.room&&(a=t.metaData),t&&i===t.room&&(s=t.metaData);const c=a?Number(a.order):void 0,l=s?Number(s.order):void 0;return void 0===c&&void 0!==l?1:void 0!==c&&void 0===l?-1:c===l?this._lexicographicalComparator(n,o):c>l?1:-1}}getRoomLists(){return this._state.presentationLists}}void 0===e.singletonRoomListStore&&(e.singletonRoomListStore=new h),t.b=e.singletonRoomListStore}).call(this,n(17))},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),a=n.n(i),s=n(36),c=n(34),l=n(35),u=n.n(l),d=n(39),h=n(69),p=n(44),m=n(54),g=n(40),f=n(940),_=n.n(f),v=n(47);class b extends a.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=_()(n).replace(/\n/g,"
"));const r=t.forEvent(e.getId()),i=Object(m.g)(e.getSender()),a=e.getSender();switch(e.getContent().msgtype){case"m.text":case"m.notice":{o='
In reply to ').concat(a,"")+"
".concat(o,"
");const e=n.trim().split("\n");e.length>0&&(e[0]="<".concat(a,"> ").concat(e[0]),n=e.map(e=>"> ".concat(e)).join("\n")+"\n\n");break}case"m.image":o='
In reply to ').concat(a,"")+"
sent an image.
",n="> <".concat(a,"> sent an image.\n\n");break;case"m.video":o='
In reply to ').concat(a,"")+"
sent a video.
",n="> <".concat(a,"> sent a video.\n\n");break;case"m.audio":o='
In reply to ').concat(a,"")+"
sent an audio file.
",n="> <".concat(a,"> sent an audio file.\n\n");break;case"m.file":o='
In reply to ').concat(a,"")+"
sent a file.
",n="> <".concat(a,"> sent a file.\n\n");break;case"m.emote":{o='
In reply to * ')+'').concat(a,"
").concat(o,"
");const e=n.trim().split("\n");e.length>0&&(e[0]="* <".concat(a,"> ").concat(e[0]),n=e.map(e=>"> ".concat(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){return b.getParentEventId(e)?a.a.createElement(b,{parentEv:e,onHeightChanged:t,ref:o,permalinkCreator:n}):a.a.createElement("div",null)}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=a.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=s.getComponent("elements.Pill"),o=this.context.getRoom(t.getRoomId());e=a.a.createElement("blockquote",{className:"mx_ReplyThread"},Object(c.a)("In reply to ",{},{a:e=>a.a.createElement("a",{onClick:this.onQuoteClick,className:"mx_ReplyThread_show"},e),pill:a.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=s.getComponent("elements.Spinner");e=a.a.createElement(t,{w:16,h:16})}const t=s.getComponent("views.rooms.EventTile"),n=s.getComponent("messages.DateSeparator"),o=this.state.events.map(e=>{let o=null;return Object(h.e)(this.props.parentEv.getDate(),e.getDate())&&(o=a.a.createElement("a",{href:this.props.url},a.a.createElement(n,{ts:e.getTs()}))),a.a.createElement("blockquote",{className:"mx_ReplyThread",key:e.getId()},o,a.a.createElement(t,{mxEvent:e,tileShape:"reply",onHeightChanged:this.props.onHeightChanged,permalinkCreator:this.props.permalinkCreator,isRedacted:e.isRedacted(),isTwelveHour:g.b.getValue("showTwelveHourTimestamps")}))});return a.a.createElement("div",null,a.a.createElement("div",null,e),a.a.createElement("div",null,o))}}r()(b,"propTypes",{parentEv:u.a.instanceOf(p.k),onHeightChanged:u.a.func.isRequired,permalinkCreator:u.a.instanceOf(m.a).isRequired}),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),a=n(36),s=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 a;a=r&&r.getContent()&&r.getContent().accepted?new Set(r.getContent().accepted):new Set;const s=[];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&&a.has(o[e].url)){t=!0;break}t||(n[e]=o)}Object.keys(n).length>0&&s.push({service:e,policies:n})}const c=a.size;if(s.length>0){const e=await t(s,[...a]);console.log("User has agreed to URLs",e),e.forEach(e=>a.add(e))}else console.log("User has already agreed to all required policies");if(a.size!==c){const e={accepted:Array.from(a)};await i.a.get().setAccountData("m.accepted_terms",e)}const l=o.map(e=>{const t=Array.from(a).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=a.getComponent("views.dialogs.TermsDialog");s.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(142),i=n(59),a=n(34),s=n(36),c=n(41),l=n(40),u=n(70);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(a.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 ".concat(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 s=!1;if("M_FORBIDDEN"===r.errcode)s=!0,i=Object(a.a)("You do not have permission to invite people to this room.");else if("RIOT.ALREADY_IN_ROOM"===r.errcode)i=Object(a.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(a.a)("User %(user_id)s does not exist",{user_id:e}):"M_PROFILE_UNDISCLOSED"===r.errcode?i=Object(a.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(a.a)("The user must be unbanned before they can be invited."):"M_UNSUPPORTED_ROOM_VERSION"===r.errcode?Object(a.a)("The user's homeserver does not support the version of the room."):Object(a.a)("Unknown server error"):(console.warn("User ".concat(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=!s,this.fatal=s,s?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=s.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 a})),n.d(t,"b",(function(){return s})),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 a=r.a.shape({userId:r.a.string.isRequired,displayname:r.a.string,avatarUrl:r.a.string}),s=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,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 a})),n.d(t,"d",(function(){return s})),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 a(){return r.a.get().validated_server_config.isUrl}function s(){const e=a();i.a.get().setAccountData("m.identity_server",{base_url:e})}async function c(e){let t;try{t=await i.a.get().getTerms(o.o.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";(function(e){n.d(t,"a",(function(){return s}));var o=n(3),r=n.n(o),i=n(49),a=n.n(i);class s extends a.a{static sharedInstance(){return e.mx_ToastStore||(e.mx_ToastStore=new s),e.mx_ToastStore}constructor(){super(),this._dispatcherRef=null,this._toasts=[]}reset(){this._toasts=[]}addOrReplaceToast(e){void 0===e.priority&&(e.priority=s.PRIORITY_DEFAULT);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].priority>e.priority;)--t;this._toasts.splice(t,0,e)}else this._toasts[t]=e;this.emit("update")}dismissToast(e){this._toasts=this._toasts.filter(t=>t.key!==e),this.emit("update")}getToasts(){return this._toasts}}r()(s,"PRIORITY_REALTIME",0),r()(s,"PRIORITY_DEFAULT",1),r()(s,"PRIORITY_LOW",2)}).call(this,n(17))},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E}));var o=n(1014),r=n(39),i=n(37),a=n(36),s=n(34),c=n(41),l=n(60),u=n(658),d=n.n(u),h=n(1015),p=n.n(h);n(1017);const m=[0,0,22,37,0,0,22,37,1];class g extends Error{}function f(e,t,n,o){return new Promise(r=>{let i=t,a=n;a>600&&(i=Math.floor(i*(600/a)),a=600),i>800&&(a=Math.floor(a*(800/i)),i=800);const s=document.createElement("canvas");s.width=i,s.height=a,s.getContext("2d").drawImage(e,0,0,i,a),s.toBlob((function(e){r({info:{thumbnail_info:{w:i,h:a,mimetype:e.type,size:e.size},w:t,h:n},thumbnail:e})}),o)})}function _(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=b(e).then(e=>{const t=new Uint8Array(e),n=p()(t);for(const e of n)if("pHYs"===e.name){if(e.data.byteLength!==m.length)return;return e.data.every((e,t)=>e===m[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 f(e.img,e.width,e.height,r)})).then((function(n){return o=n.info,y(e,t,n.thumbnail)})).then((function(e){return o.thumbnail_url=e.url,o.thumbnail_file=e.file,o}))}function v(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 f(e,e.videoWidth,e.videoHeight,"image/jpeg")})).then((function(n){return o=n.info,y(e,t,n.thumbnail)})).then((function(e){return o.thumbnail_url=e.url,o.thumbnail_file=e.file,o}))}function b(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 y(e,t,n,o){if(e.isRoomEncrypted(t)){let t,r,a=!1;const s=b(n).then((function(e){if(a)throw new g;return d.a.encryptAttachment(e)})).then((function(n){if(a)throw new g;r=n.info;const i=new Blob([n.data]);return t=e.uploadContent(i,{progressHandler:o,includeFilename:!1}),t})).then((function(e){return r.url=e,n.type&&(r.mimetype=n.type),{file:r}}));return s.abort=()=>{a=!0,t&&i.a.get().cancelUpload(t)},s}{const t=e.uploadContent(n,{progressHandler:o}),r=t.then((function(e){return{url:e}}));return r.abort=t.abort,r}}class E{constructor(){this.inprogress=[],this.nextId=0,this._mediaConfig=null}static sharedInstance(){return void 0===e.mx_ContentMessages&&(e.mx_ContentMessages=new E),e.mx_ContentMessages}_isFileSizeAcceptable(e){return!(null!==this._mediaConfig&&void 0!==this._mediaConfig["m.upload.size"]&&e.size>this._mediaConfig["m.upload.size"])}_ensureMediaConfigFetched(){if(null===this._mediaConfig)return console.log("[Media Config] Fetching"),i.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})}sendStickerContentToRoom(e,t,n,o,r){return i.a.get().sendStickerMessage(t,e,n,o).catch(n=>{throw console.warn("Failed to send content with URL ".concat(e," to room ").concat(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 r.a.dispatch({action:"require_registration"});if(Boolean(l.a.getQuotingEvent())){const e=a.getComponent("dialogs.QuestionDialog");if(!await new Promise(t=>{c.a.createTrackedDialog("Upload Reply Warning","",e,{title:Object(s.a)("Replying With Files"),description:React.createElement("div",null,Object(s.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(s.a)("Continue"),onFinished:e=>{t(e)}})}))return}await this._ensureMediaConfigFetched();const o=[],i=[];for(let t=0;t0){const t=a.getComponent("dialogs.UploadFailureDialog"),n=new Promise(n=>{c.a.createTrackedDialog("Upload Failure","",t,{badFiles:o,totalFiles:e.length,contentMessages:this,onFinished:e=>{n(e)}})});if(!await n)return}const u=a.getComponent("dialogs.UploadConfirmDialog");let d=!1,h=Promise.resolve();for(let e=0;e{c.a.createTrackedDialog("Upload Files confirmation","",u,{file:o,currentIndex:e,totalFiles:i.length,onFinished:(e,n)=>{n&&(d=!0),t(e)}})}))break}h=this._sendContentToRoom(o,t,n,h)}}_sendContentToRoom(e,t,n,i){const l={body:e.name||"Attachment",info:{size:e.size}};e.type&&(l.info.mimetype=e.type);const u=new Promise(r=>{0==e.type.indexOf("image/")?(l.msgtype="m.image",_(n,t,e).then(e=>{Object(o.a)(l.info,e),r()},e=>{console.error(e),l.msgtype="m.file",r()})):0==e.type.indexOf("audio/")?(l.msgtype="m.audio",r()):0==e.type.indexOf("video/")?(l.msgtype="m.video",v(n,t,e).then(e=>{Object(o.a)(l.info,e),r()},e=>{l.msgtype="m.file",r()})):(l.msgtype="m.file",r())}),d={fileName:e.name||"Attachment",roomId:t,total:0,loaded:0};let h;function p(e){d.total=e.total,d.loaded=e.loaded,r.a.dispatch({action:"upload_progress",upload:d})}return this.inprogress.push(d),r.a.dispatch({action:"upload_started"}),r.a.dispatch({action:"focus_composer"}),u.then((function(){return d.promise=y(n,t,e,p),d.promise.then((function(e){l.file=e.file,l.url=e.url}))})).then(e=>i).then((function(){return n.sendMessage(t,l)}),(function(e){if(h=e,!d.canceled){let t=Object(s.a)("The file '%(fileName)s' failed to upload.",{fileName:d.fileName});413==e.http_status&&(t=Object(s.a)("The file '%(fileName)s' exceeds this homeserver's size limit for uploads",{fileName:d.fileName}));const n=a.getComponent("dialogs.ErrorDialog");c.a.createTrackedDialog("Upload failed","",n,{title:Object(s.a)("Upload Failed"),description:t})}})).finally(()=>{const e=Object.keys(this.inprogress);for(let t=0;t!e.canceled)}cancelUpload(e){const t=Object.keys(this.inprogress);let n;for(let o=0;o1&&void 0!==arguments[1]?arguments[1]:{},i=[],a=0,s=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,f=void 0,_=void 0,v=void 0,b=void 0,y=void 0;if(isNaN(e))throw new Error("Invalid arguments");return l=!0===t.bits,_=!0===t.unix,c=t.base||2,f=void 0!==t.round?t.round:_?1:2,v=void 0!==t.spacer?t.spacer:_?"":" ",y=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:[],s=void 0!==t.exponent?t.exponent:-1,u=c>2?1e3:1024,(p=(m=Number(e))<0)&&(m=-m),(-1===s||isNaN(s))&&(s=Math.floor(Math.log(m)/Math.log(u)))<0&&(s=0),s>8&&(s=8),0===m?(i[0]=0,i[1]=_?"":o[b][l?"bits":"bytes"][s]):(a=m/(2===c?Math.pow(2,10*s):Math.pow(1e3,s)),l&&(a*=8)>=u&&s<8&&(a/=u,s++),i[0]=Number(a.toFixed(s>0?f:0)),i[1]=10===c&&1===s?l?"kb":"kB":o[b][l?"bits":"bytes"][s],_&&(i[1]="jedec"===b?i[1].charAt(0):s>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]=y[i[1]]||i[1],"array"===g?i:"exponent"===g?s:"object"===g?{value:i[0],suffix:i[1],symbol:i[1]}:(d&&(i[1]=h[s]?h[s]:r[b][s]+(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";Object.defineProperty(t,"__esModule",{value:!0}),t.assignRef=function(e,t){return"function"==typeof e?e(t):null!=e&&(e.current=t),e}},function(e,t,n){"use strict";var o=n(33),r=n.n(o),i=n(38),a=n.n(i);t.a=a()({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(117),width:e,height:t,className:o}))}})},function(e,t,n){var o=n(132),r=n(133);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==o(e)}},function(e,t,n){var o=n(307),r=n(1406),i=n(1410),a=n(1411),s=i((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,o(t,1),[])}));e.exports=s},,,,function(e,t,n){"use strict";n.d(t,"i",(function(){return R})),n.d(t,"d",(function(){return O})),n.d(t,"c",(function(){return D})),n.d(t,"a",(function(){return I})),n.d(t,"e",(function(){return F})),n.d(t,"b",(function(){return N})),n.d(t,"l",(function(){return A})),n.d(t,"f",(function(){return M})),n.d(t,"j",(function(){return B})),n.d(t,"m",(function(){return q})),n.d(t,"h",(function(){return G})),n.d(t,"g",(function(){return V})),n.d(t,"k",(function(){return H})),n.d(t,"n",(function(){return K}));var o=n(44),r=n(37),i=n(145),a=n(650),s=n(58),c=n(146),l=n(651),u=n(39),d=n(115);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(63),g=n(41),f=n(36),_=n(139),v=n(50),b=n(215),y=n(289),E=n(40),S=n(652),w=n(171),C=n(71),x=n(290),T=n(216),k=n(376);async function R(e){try{let t=e.enableGuest||!1;const n=e.guestHsUrl,r=e.guestIsUrl,i=e.fragmentQueryParams||{},a=e.defaultDeviceDisplayName;return 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?(console.log("Using guest access credentials"),P({userId:i.guest_user_id,accessToken:i.guest_access_token,homeserverUrl:n,identityServerUrl:r,guest:!0},!0).then(()=>!0)):!!await async function(e){const t=e.ignoreGuest;if(!localStorage)return!1;const{hsUrl:n,isUrl:o,accessToken:r,userId:i,deviceId:a,isGuest:s}=N();return r&&i&&n?t&&s?(console.log("Ignoring stored guest account: "+i),!1):(console.log("Restoring session for ".concat(i)),await P({userId:i,deviceId:a,accessToken:r,homeserverUrl:n,identityServerUrl:o,guest:s},!1),!0):(console.log("No previous session found."),!1)}({ignoreGuest:Boolean(e.ignoreGuest)})||!!t&&function(e,t,n){return console.log("Doing guest login on ".concat(e)),o.u.createClient({baseUrl:e}).registerGuest({body:{initial_device_display_name:n}}).then(n=>(console.log("Registered as guest: ".concat(n.user_id)),P({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,a)}catch(e){return!(e instanceof L)&&async function(e){console.error("Unable to load session",e);const t=f.getComponent("views.dialogs.SessionRestoreErrorDialog"),n=g.a.createTrackedDialog("Session Restore Error","",t,{error:e.message}),[o]=await n.finished;if(o)return await z(),!1;return R()}(e)}}function O(){const{hsUrl:e,userId:t,accessToken:n}=N();return e&&t&&n?t:null}function D(){const e=N();return e.hsUrl&&e.userId&&e.accessToken?e.isGuest:null}function I(e,t){return e.loginToken?e.homeserver?Object(b.b)(e.homeserver,e.identityServer,"m.login.token",{token:e.loginToken,initial_device_display_name:t}).then((function(e){return console.log("Logged in with token"),z().then(()=>(U(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)):Promise.resolve(!1)}function F(e){if(e.reason===o.u.InvalidStoreError.TOGGLED_LAZY_LOADING)return Promise.resolve().then(()=>{if(e.value){const e=f.getComponent("views.dialogs.LazyLoadingResyncDialog");return new Promise(t=>{g.a.createDialog(e,{onFinished:t})})}{const e=f.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 N(){const e=localStorage.getItem("mx_hs_url"),t=localStorage.getItem("mx_is_url"),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}}function A(e){return K(),P(e,!0)}function M(e){const t=r.a.get().getUserId(),n=r.a.get().getDeviceId();K(),localStorage.removeItem("mx_soft_logout"),j=!1;const o=e.userId!==t||e.deviceId!==n;return o&&console.warn("Clearing all data: Old session belongs to a different user/session"),P(e,o)}async function P(e,t){e.guest=Boolean(e.guest);const n=G();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 z();const o=await y.a();if(o.dataInLocalStorage&&o.cryptoInited&&!o.dataInCryptoStore){if(await function(){const e=f.getComponent("views.dialogs.StorageEvictedDialog");return new Promise(t=>{g.a.createTrackedDialog("Storage evicted","",e,{onFinished:t})})}())throw await z(),new L("Aborting login in progress because of storage inconsistency")}if(s.a.setLoggedIn(e.guest,e.homeserverUrl),localStorage)try{U(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),c.default.start(),l.a.sharedInstance().start(),S.a.sharedInstance().reset(),w.a.sharedInstance().reset(),m.a.makeShared().start(),C.a.sharedInstance().startWatching(),_.a.start(),x.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());T.a.sharedInstance().start(),E.b.getValue("lowBandwidth")||p.start();await k.a.getInstance().update(),u.a.dispatch({action:"client_started"}),G()&&q()}(!n),r.a.get()}class L extends Error{}function U(e){localStorage.setItem("mx_hs_url",e.homeserverUrl),e.identityServerUrl&&localStorage.setItem("mx_is_url",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 ".concat(e.userId))}let j=!1;function B(){r.a.get()&&(r.a.get().isGuest()?H():(j=!0,r.a.get().logout().then(H,e=>{console.log("Failed to call logout API: token will not be invalidated"),H()})))}function q(){r.a.get()&&(localStorage.setItem("mx_soft_logout","true"),console.log("Soft logout initiated"),j=!0,u.a.dispatch({action:"on_client_not_viable"}),K(!1))}function G(){return"true"===localStorage.getItem("mx_soft_logout")}function V(){return j}async function H(){j=!1,u.a.dispatch({action:"on_logged_out"},!0),K(),await z()}async function z(){s.a.disable(),window.localStorage&&window.localStorage.clear(),window.sessionStorage&&window.sessionStorage.clear();const e=Object(a.a)({baseUrl:""});await i.a.deleteEventIndex(),await e.clearStores()}function K(e=!0){c.default.stop(),l.a.sharedInstance().stop(),S.a.sharedInstance().reset(),p.stop(),_.a.stop(),C.a.sharedInstance().stopWatching(),x.a.sharedInstance().stop(),T.a.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){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(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:a}catch(e){o=a}}();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=s(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&&E.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 E.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?(E.a.log("Glare detected: answering incoming call "+i.callId+" and canceling outgoing call "+a.callId),a._replacedBy(i),i.answer()):(E.a.log("Glare detected: rejecting incoming call "+i.callId+" and keeping outgoing call "+a.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 y.a(this._cryptoStore),this._pushProcessor=new T.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,a=!(!n||!n.tweaks)&&!!n.tweaks.highlight;if((i!==a||r>0)&&!o.hasUserReadEvent(this.getUserId(),e.getId())){let e=r;a&&!i&&e++,!a&&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 a=this.getPushActionsForEvent(n);i+=a.tweaks&&a.tweaks.highlight?1:0}t.setUnreadNotificationCount("highlight",i)}})}async function F(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 N(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 A(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){E.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){E.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=>(E.a.log("Event sent to ".concat(t.getRoomId()," with event id ").concat(e.event_id)),e))}function L(e,t,n,o,r,i){m.q(r)&&(i=r,r=void 0);const a=m.f("/rooms/$room_id/$membership",{$room_id:t,$membership:o});return e._http.authedRequest(i,"POST",a,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 j(e,t,n){e&&e(n),t(n)}function B(e,t,n){e&&e(null,n),t(n)}function q(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,a.a.prototype),I.prototype.exportDevice=async function(){if(this._crypto)return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:await this._crypto._olmDevice.export()};E.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(E.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},E.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 E.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");E.a.log("Crypto: Starting up crypto store..."),await this._cryptoStore.startup(),E.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"]),E.a.log("Crypto: initialising crypto object..."),await t.init({exportedOlmDevice:this._exportedOlmDeviceToImport}),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=F(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),F(this,e,t,null,n)},I.prototype.setDeviceKnown=function(e,t,n){return void 0===n&&(n=!0),F(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()},N(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},N(I,["createRecoveryKeyFromPassphrase","bootstrapSecretStorage","addSecretStorageKey","hasSecretStorageKey","secretStorageKeyNeedsUpgrade","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);return!!t&&(!!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 Boolean(this._crypto.backupKey)},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)),E.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()||E.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;return 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",{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(w.a)(e),!0}catch(e){return!1}},I.prototype.keyBackupKeyFromPassword=function(e,t){return Object(C.b)(t.auth_data,e)},I.prototype.keyBackupKeyFromRecoveryKey=function(e){return Object(w.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(C.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 a=Object(v.decodeBase64)(i||r);return this._restoreKeyBackup(a,t,n,e,o)},I.prototype.restoreKeyBackupWithRecoveryKey=function(e,t,n,o,r){const i=Object(w.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:a}={}){if(null===this._crypto)throw new Error("End-to-end encryption disabled");let s=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),a&&a({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;s+=Object.keys(n.sessions).length;const e=O(n.sessions,u,t);for(const n of e)n.room_id=t,c.push(n)}else if(e.sessions)s=Object.keys(e.sessions).length,c=O(e.sessions,u,n);else{s=1;try{const t=D(e,u);t.room_id=n,t.session_id=o,c.push(t)}catch(e){E.a.log("Failed to decrypt megolm session from backup",e)}}return this.importRoomKeys(c,{progressCallback:a})}).then(()=>this._crypto.setTrustedBackupPubKey(d)).then(()=>({total:s,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 a={qsStringifyOptions:{arrayFormat:"repeat"}},s=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 s._http.authedRequest(void 0,"POST",o,i,n,a)})).then((function(e){const n=e.room_id,o=new c.a(s,s._clientOpts).createRoom(n);return t.syncRoom,Promise.resolve(o)})).then((function(e){B(n,o,e)}),(function(e){j(n,l,e)}))})},I.prototype.resendEvent=function(e,t){return M(t,e,l.a.SENDING),A(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 a=m.f("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this._http.authedRequest(r,"PUT",a,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,room_id:e,origin_server_ts:(new Date).getTime()})),i=this.getRoom(e),a=r.getAssociatedId();if(a&&a.startsWith("~")){const e=i.getPendingEvents().find(e=>e.getId()===a);e.once("Event.localEventIdReplaced",()=>{r.updateAssociatedId(e.getId())})}const s=r.getType();return E.a.log("sendEvent of type ".concat(s," in ").concat(e," with txnId ").concat(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")):A(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=_.makeTextMessage(t);return this.sendMessage(e,r,n,o)},I.prototype.sendNotice=function(e,t,n,o){const r=_.makeNotice(t);return this.sendMessage(e,r,n,o)},I.prototype.sendEmoteMessage=function(e,t,n,o){const r=_.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=_.makeHtmlMessage(t,n);return this.sendMessage(e,r,o)},I.prototype.sendHtmlNotice=function(e,t,n,o){const r=_.makeHtmlNotice(t,n);return this.sendMessage(e,r,o)},I.prototype.sendHtmlEmote=function(e,t,n,o){const r=_.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||{}),a=this.getRoom(e.getRoomId());return a&&a._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 (".concat(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 (".concat(t,")"));let i;if(n){if(i=n.getId(),r&&r.hasPendingEvent(i))throw new Error("Cannot set read receipt to a pending event (".concat(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;){E.a.log("Looking at ".concat(r.getId()));const e=r.getContent().predecessor;if(!e||!e.room_id)break;{E.a.log("Looking at predecessor ".concat(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}if(o.push(e),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(a(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 a=m.f("/rooms/$roomId/state/m.room.member/$userId",{$roomId:t,$userId:n});return e._http.authedRequest(i,"PUT",a,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(f.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();return o&&r&&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 a=this,s=new Promise((r,i)=>{Object(m.A)(o).then((function(){return a._createMessagesRequest(e.roomId,e.oldState.paginationToken,t,"b")})).then((function(t){const o=m.u(t.chunk,q(a));if(t.state){const n=m.u(t.state,q(a));e.currentState.setUnknownStateEvents(n)}e.addEventsToTimeline(o,!0,e.getLiveTimeline()),e.oldState.paginationToken=t.end,0===t.chunk.length&&(e.oldState.paginationToken=null),a.store.storeEvents(e,o,t.end,!0),a._ongoingScrollbacks[e.roomId]=null,B(n,r,e)}),(function(t){a._ongoingScrollbacks[e.roomId]={errorTs:Date.now()},j(n,i,t)}))});return r={promise:s,errorTs:null},this._ongoingScrollbacks[e.roomId]=r,s},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(s.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 a=e.getTimelineForEvent(i[0].getId());if(a){const e=m.u(n.state,r.getEventMapper());a.getState(u.a.BACKWARDS).setUnknownStateEvents(e)}else a=e.addTimeline(),a.initialiseState(m.u(n.state,r.getEventMapper())),a.getState(u.a.FORWARDS).paginationToken=n.end;return e.addEventsToTimeline(i,!0,a,n.start),e.getTimelineForEvent(t)||a}))},I.prototype._createMessagesRequest=function(e,t,n,o,r){const i=m.f("/rooms/$roomId/messages",{$roomId:e});void 0===n&&(n=30);const a={from:t,limit:n,dir:o};let c=null;return this._clientOpts.lazyLoadMembers&&(c=Object.assign({},s.a.LAZY_LOADING_MESSAGES_FILTER)),r&&(c=c||{},Object.assign(c,r.getRoomTimelineFilterComponent())),c&&(a.filter=JSON.stringify(c)),this._http.authedRequest(void 0,"GET",i,a)},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 a=e._paginationRequests[r];if(a)return a;let s,c,l;const d=this;if(n)s="/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 k.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){E.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){E.a.error("Failed to get TURN URIs"),t._checkTurnServersTimeoutID=setTimeout((function(){e(t)}),6e4)}))}(this),this._syncApi&&(E.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(){E.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),a=await this.fetchRelations(e,t,n,i,r),s=this.getEventMapper();let c;a.original_event&&(c=s(a.original_event));let l=a.chunk.map(s);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:a.next_batch}},I.prototype.getEventMapper=function(e){return q(this,e)},I.prototype.getCrossSigningCacheCallbacks=function(){return this._crypto&&this._crypto._crossSigningInfo.getCacheCallbacks()},I.prototype.generateClientSecret=function(){return Object(x.a)(32)}}).call(this,n(17))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(49),r=n(72),i=n(1);function a(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(a,o.EventEmitter),a.prototype.markOutOfBand=function(){this._isOutOfBand=!0},a.prototype.isOutOfBand=function(){return this._isOutOfBand},a.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))},a.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))},a.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)))},a.prototype._updateModifiedTime=function(){this._modified=Date.now()},a.prototype.getLastModifiedTime=function(){return this._modified},a.prototype.isKicked=function(){return"leave"===this.membership&&this.events.member.getSender()!==this.events.member.getStateKey()},a.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}},a.prototype.getAvatarUrl=function(e,t,n,o,i,a){void 0===i&&(i=!0);const s=this.getMxcAvatarUrl();if(!s&&!i)return null;const c=Object(r.a)(e,s,t,n,o,a);return c||(i?Object(r.b)(e,this.userId,t,n):null)},a.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";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";n.d(t,"a",(function(){return i}));var o=n(0),r=n(55);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("".concat(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 a="";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(a=this._sanitizeWellKnownUrl(e["m.identity_server"].base_url),!a)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("".concat(a,"/_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=a,Promise.resolve(n)}return a&&a.length>0&&(t["m.identity_server"]={state:i.SUCCESS,error:null,base_url:a}),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://".concat(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://".concat(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?":".concat(t.port):"",o=t.pathname?t.pathname:"";let i="".concat(t.protocol,"//").concat(t.hostname).concat(n).concat(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(108).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){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(767);Object.defineProperty(t,"DragDropContext",{enumerable:!0,get:function(){return a(o).default}});var r=n(850);Object.defineProperty(t,"Droppable",{enumerable:!0,get:function(){return a(r).default}});var i=n(871);function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Draggable",{enumerable:!0,get:function(){return a(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(820),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){var o=n(113)(Object,"create");e.exports=o},function(e,t,n){var o=n(918),r=n(919),i=n(920),a=n(921),s=n(922);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=0;--t){const o=e.timeline[t];if(o.getId()==n)return!1;if(!Object(r.a)(o)&&a(o))return!0}return!0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(37),r=n(82),i=n(34),a=n(278),s=n(141),c=n(40),l=n(205);function u(e){const t=e.getSender(),{entity:n}=e.getPrevContent(),{entity:o,recommendation:r,reason:a}=e.getContent();return o?r&&a?o===n?l.g.includes(e.getType())?Object(i.a)("%(senderName)s updated the rule banning users matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):l.c.includes(e.getType())?Object(i.a)("%(senderName)s updated the rule banning rooms matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):l.f.includes(e.getType())?Object(i.a)("%(senderName)s updated the rule banning servers matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):Object(i.a)("%(senderName)s updated a ban rule matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):n?l.g.includes(e.getType())?Object(i.a)("%(senderName)s changed a rule that was banning users matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):l.c.includes(e.getType())?Object(i.a)("%(senderName)s changed a rule that was banning rooms matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):l.f.includes(e.getType())?Object(i.a)("%(senderName)s changed a rule that was banning servers matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):Object(i.a)("%(senderName)s updated a ban rule that was matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):l.g.includes(e.getType())?Object(i.a)("%(senderName)s created a rule banning users matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):l.c.includes(e.getType())?Object(i.a)("%(senderName)s created a rule banning rooms matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):l.f.includes(e.getType())?Object(i.a)("%(senderName)s created a rule banning servers matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):Object(i.a)("%(senderName)s created a ban rule matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):Object(i.a)("%(senderName)s updated an invalid ban rule",{senderName:t}):l.g.includes(e.getType())?Object(i.a)("%(senderName)s removed the rule banning users matching %(glob)s",{senderName:t,glob:n}):l.c.includes(e.getType())?Object(i.a)("%(senderName)s removed the rule banning rooms matching %(glob)s",{senderName:t,glob:n}):l.f.includes(e.getType())?Object(i.a)("%(senderName)s removed the rule banning servers matching %(glob)s",{senderName:t,glob:n}):Object(i.a)("%(senderName)s removed a ban rule matching %(glob)s",{senderName:t,glob:n})}const d={"m.room.message":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();let n=t+": "+e.getContent().body;return"m.emote"===e.getContent().msgtype?n="* "+t+" "+n:"m.image"===e.getContent().msgtype&&(n=Object(i.a)("%(senderDisplayName)s sent an image.",{senderDisplayName:t})),n},"m.call.invite":function(e){const t=e.sender?e.sender.name:Object(i.a)("Someone");let n=!0;e.getContent().offer&&e.getContent().offer.sdp&&-1!==e.getContent().offer.sdp.indexOf("m=video")&&(n=!1);const r=o.a.get().supportsVoip();return n&&r?Object(i.a)("%(senderName)s placed a voice call.",{senderName:t}):n&&!r?Object(i.a)("%(senderName)s placed a voice call. (not supported by this browser)",{senderName:t}):!n&&r?Object(i.a)("%(senderName)s placed a video call.",{senderName:t}):n||r?void 0:Object(i.a)("%(senderName)s placed a video call. (not supported by this browser)",{senderName:t})},"m.call.answer":function(e){const t=e.sender?e.sender.name:Object(i.a)("Someone"),n=o.a.get().supportsVoip()?"":Object(i.a)("(not supported by this browser)");return Object(i.a)("%(senderName)s answered the call.",{senderName:t})+" "+n},"m.call.hangup":function(e){const t=e.sender?e.sender.name:Object(i.a)("Someone"),n=e.getContent();let r="";return o.a.get().supportsVoip()?n.reason&&(r="ice_failed"===n.reason?Object(i.a)("(could not connect media)"):"invite_timeout"===n.reason?Object(i.a)("(no answer)"):"user hangup"===n.reason?"":Object(i.a)("(unknown failure: %(reason)s)",{reason:n.reason})):r=Object(i.a)("(not supported by this browser)"),Object(i.a)("%(senderName)s ended the call.",{senderName:t})+" "+r}},h={"m.room.canonical_alias":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender(),n=e.getPrevContent().alias,o=e.getPrevContent().alt_aliases||[],r=e.getContent().alias,a=e.getContent().alt_aliases||[],s=o.filter(e=>!a.includes(e)),c=a.filter(e=>!o.includes(e));if(s.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&&!s.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(s.length&&!c.length)return Object(i.a)("%(senderName)s removed the alternative addresses %(addresses)s for this room.",{senderName:t,addresses:s.join(", "),count:s.length});if(s.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(),a=e.getContent(),s=r.a.getConferenceHandler(),l=a.reason?Object(i.a)("Reason")+": "+a.reason:"";switch(a.membership){case"invite":{const o=a.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}):s&&s.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&&a.displayname&&o.displayname!==a.displayname?Object(i.a)("%(oldDisplayName)s changed their display name to %(displayName)s.",{oldDisplayName:o.displayname,displayName:a.displayname}):!o.displayname&&a.displayname?Object(i.a)("%(senderName)s set their display name to %(displayName)s.",{senderName:e.getSender(),displayName:a.displayname}):o.displayname&&!a.displayname?Object(i.a)("%(senderName)s removed their display name (%(oldDisplayName)s).",{senderName:t,oldDisplayName:o.displayname}):o.avatar_url&&!a.avatar_url?Object(i.a)("%(senderName)s removed their profile picture.",{senderName:t}):o.avatar_url&&a.avatar_url&&o.avatar_url!==a.avatar_url?Object(i.a)("%(senderName)s changed their profile picture.",{senderName:t}):!o.avatar_url&&a.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),s&&s.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()?s&&s.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(s.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],s=e.getContent().users[t];s!==o&&r.push(Object(i.a)("%(userId)s from %(fromPowerLevel)s to %(toPowerLevel)s",{userId:t,fromPowerLevel:a.b(o,n),toPowerLevel:a.b(s,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 a="";if(a=0===i.deny.length&&0===i.allow.length?"".concat(t," set server ACLs for this room: "):"".concat(t," changed the server ACLs for this room: "),Array.isArray(r.allow)||(r.allow=[]),0===r.allow.length)return a+"🎉 All servers are banned from participating! This room can no longer be used.";Array.isArray(r.deny)||(r.deny=[]);const s=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(s.length>0&&o.push("Servers matching ".concat(s.join(", ")," are now banned.")),c.length>0&&o.push("Servers matching ".concat(c.join(", ")," were removed from the ban list.")),l.length>0&&o.push("Servers matching ".concat(l.join(", ")," are now allowed.")),u.length>0&&o.push("Servers matching ".concat(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 ".concat(e,"."))}return a+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)),a=o.filter(e=>!n.includes(e));return r.length&&!a.length?Object(i.a)("%(senderDisplayName)s enabled flair for %(groups)s in this room.",{senderDisplayName:t,groups:r.join(", ")}):!r.length&&a.length?Object(i.a)("%(senderDisplayName)s disabled flair for %(groups)s in this room.",{senderDisplayName:t,groups:a.join(", ")}):r.length&&a.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:a.join(", ")}):""},"im.vector.modular.widgets":function(e){const t=e.getSender(),{name:n,type:o,url:r}=e.getPrevContent(),{name:a,type:s,url:c}=e.getContent()||{};let l=a||n||s||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);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=>e.type===n)}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 a=null;a||(a=new i),t.a=a},function(e,t,n){"use strict";n.d(t,"e",(function(){return s})),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(716),a=n(37);const s="m.room.rule.user",c="m.room.rule.server",l=[s,"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]:s: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===s)}get roomRules(){return this._rules.filter(e=>"m.room.rule.room"===e.kind)}async banEntity(e,t,n){await a.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 a.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=a.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,a=e.getContent().reason;o&&r&&a&&this._rules.push(new i.a(o,r,a,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;oo){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}),a.a.trackEvent("FilterStore","select_tag")}break;case"deselect_tags":this._setState({selectedTags:[]}),a.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:[]}),a.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&&s.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";var o=n(33),r=n.n(o),i=n(35),a=n.n(i);const s=e=>{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))};s.propTypes={vertical:a.a.bool,reverse:a.a.bool,id:a.a.string},t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(279),r=n(380);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";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";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return l}));var o=n(388);const r=new Map,i=new Map,a=new Map,s=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="".concat(e.annotation,"\n").concat(e.shortcodes.join("\n"),"}\n").concat(e.emoticon||"").toLowerCase(),r.set(u(e.unicode),e),e.emoticon&&i.set(e.emoticon,e),e.shortcodes&&e.shortcodes.forEach(t=>{a.set(t,e)})})},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(3),r=n.n(o),i=n(39),a=n(389),s=n(137),c=n(40),l=n(78);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 s.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){const{member:o}=e.refireParams,r=Object(a.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: ".concat(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=a.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 s.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=a.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=a.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 p(e){return new Promise((t,n)=>{let o=!1;const s=r.a.createElement("div",null,r.a.createElement("div",null,Object(c.a)("Which rooms would you like to add to this community?"))),h=r.a.createElement("label",{className:"mx_GroupAddressPicker_checkboxContainer"},r.a.createElement("input",{type:"checkbox",onChange:e=>{o=e.target.checked}}),r.a.createElement("div",null,Object(c.a)("Show these rooms to non-members on the community page and room list?"))),p=a.getComponent("dialogs.AddressPickerDialog");i.a.createTrackedDialog("Add Rooms to Group","",p,{title:Object(c.a)("Add rooms to the community"),description:s,extraNode:h,placeholder:Object(c.a)("Room name or alias"),button:Object(c.a)("Add to community"),pickerType:"room",validAddressTypes:["mx-room-id"],onFinished:(r,s)=>{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",""),a=i&&i.getContent().groups||[];return a.includes(e)?void 0:(a.push(e),l.a.get().sendStateEvent(n,"m.room.related_groups",{groups:a},""))}))).then(()=>{if(0===r.length)return;const t=a.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,s,o).then(t,n)}},null,!1,!0)})}},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.u.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,a=e.indexOf("@")>0;let s;s=t&&n?{type:"m.id.phone",country:t,number:n}:a?{type:"m.id.thirdparty",medium:"email",address:e}:{type:"m.id.user",user:e};const c={password:o,identifier:s,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.u.createClient({baseUrl:e,idBaseUrl:t}),a=await i.login(n,r),s=a.well_known;return s&&(s["m.homeserver"]&&s["m.homeserver"].base_url&&(e=s["m.homeserver"].base_url,console.log("Overrode homeserver setting with ".concat(e," from login response"))),s["m.identity_server"]&&s["m.identity_server"].base_url&&(t=s["m.identity_server"].base_url,console.log("Overrode IS setting with ".concat(t," from login response")))),{homeserverUrl:e,identityServerUrl:t,userId:a.user_id,deviceId:a.device_id,accessToken:a.access_token}}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var o=n(3),r=n.n(o),i=n(37),a=n(40),s=n(36),c=n(34),l=n(171);function u(e){return"unverified_session_"+e}class d{static sharedInstance(){return e.mx_DeviceListener||(e.mx_DeviceListener=new d),e.mx_DeviceListener}constructor(){r()(this,"_onWillUpdateDevices",async(e,t)=>{if(t)return;const n=i.a.get().getUserId();e.includes(n)&&this._ensureDeviceIdsAtStartPopulated()}),r()(this,"_onDevicesUpdated",e=>{e.includes(i.a.get().getUserId())&&this._recheck()}),r()(this,"_onDeviceVerificationChanged",e=>{e===i.a.get().getUserId()&&this._recheck()}),r()(this,"_onUserTrustStatusChanged",(e,t)=>{e===i.a.get().getUserId()&&this._recheck()}),r()(this,"_onCrossSingingKeysChanged",()=>{this._recheck()}),r()(this,"_onAccountData",e=>{(e.getType().startsWith("m.secret_storage.")||e.getType().startsWith("m.cross_signing."))&&this._recheck()}),r()(this,"_onSync",(e,t)=>{"PREPARED"===e&&null===t&&this._recheck()}),this._dismissed=new Set,this._dismissedThisDeviceToast=!1,this._keyBackupInfo=null,this._keyBackupFetchedAt=null,this._ourDeviceIdsAtStart=null,this._displayingToastsForDeviceIds=new Set}start(){i.a.get().on("crypto.willUpdateDevices",this._onWillUpdateDevices),i.a.get().on("crypto.devicesUpdated",this._onDevicesUpdated),i.a.get().on("deviceVerificationChanged",this._onDeviceVerificationChanged),i.a.get().on("userTrustStatusChanged",this._onUserTrustStatusChanged),i.a.get().on("crossSigning.keysChanged",this._onCrossSingingKeysChanged),i.a.get().on("accountData",this._onAccountData),i.a.get().on("sync",this._onSync),this._recheck()}stop(){i.a.get()&&(i.a.get().removeListener("crypto.willUpdateDevices",this._onWillUpdateDevices),i.a.get().removeListener("crypto.devicesUpdated",this._onDevicesUpdated),i.a.get().removeListener("deviceVerificationChanged",this._onDeviceVerificationChanged),i.a.get().removeListener("userTrustStatusChanged",this._onUserTrustStatusChanged),i.a.get().removeListener("crossSigning.keysChanged",this._onCrossSingingKeysChanged),i.a.get().removeListener("accountData",this._onAccountData),i.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=i.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?l.a.sharedInstance().addOrReplaceToast({key:"reviewsessions",title:Object(c.a)("Review where you’re logged in"),icon:"verification_warning",priority:l.a.PRIORITY_LOW,props:{deviceIds:n},component:s.getComponent("toasts.BulkUnverifiedSessionsToast")}):l.a.sharedInstance().dismissToast("reviewsessions");for(const e of o)l.a.sharedInstance().addOrReplaceToast({key:u(e),title:Object(c.a)("New login. Was this you?"),icon:"verification_warning",props:{deviceId:e},component:s.getComponent("toasts.UnverifiedSessionToast")});for(const e of this._displayingToastsForDeviceIds)o.has(e)||l.a.sharedInstance().dismissToast(u(e));this._displayingToastsForDeviceIds=o}}}).call(this,n(17))},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";(function(e){n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return p}));var o=n(3),r=n.n(o),i=n(34),a=n(148),s=n(39),c=n(40),l=n(291);const u="light";class d{constructor(){r()(this,"_onChange",()=>{this.recheck()}),r()(this,"_onAction",e=>{"recheck_theme"===e.action&&this.recheck(e.forceTheme)}),this._themeWatchRef=null,this._systemThemeWatchRef=null,this._dispatcherRef=null,this._preferDark=e.matchMedia("(prefers-color-scheme: dark)"),this._preferLight=e.matchMedia("(prefers-color-scheme: light)"),this._currentTheme=this.getEffectiveTheme()}start(){this._themeWatchRef=c.b.watchSetting("theme",null,this._onChange),this._systemThemeWatchRef=c.b.watchSetting("use_system_theme",null,this._onChange),this._preferDark.addEventListener&&(this._preferDark.addEventListener("change",this._onChange),this._preferLight.addEventListener("change",this._onChange)),this._dispatcherRef=s.a.register(this._onAction)}stop(){this._preferDark.addEventListener&&(this._preferDark.removeEventListener("change",this._onChange),this._preferLight.removeEventListener("change",this._onChange)),c.b.unwatchSetting(this._systemThemeWatchRef),c.b.unwatchSetting(this._themeWatchRef),s.a.unregister(this._dispatcherRef)}recheck(e){const t=this._currentTheme;this._currentTheme=void 0===e?this.getEffectiveTheme():e,t!==this._currentTheme&&p(this._currentTheme)}getEffectiveTheme(){if(l.a.isLogin)return"light";if(c.b.getValueAt(c.a.DEVICE,"use_system_theme",null,!1,!0)){if(console.log("returning explicit system theme"),this._preferDark.matches)return"dark";if(this._preferLight.matches)return"light"}const e=c.b.getValueAt(c.a.DEVICE,"theme",null,!1,!0);if(e)return console.log("returning explicit theme: "+e),e;if(c.b.getValue("use_system_theme")){if(this._preferDark.matches)return"dark";if(this._preferLight.matches)return"light"}return console.log("returning theme value"),c.b.getValue("theme")}isSystemThemeSupported(){return this._preferDark.matches||this._preferLight.matches}}function h(){const e={light:Object(i.a)("Light theme"),dark:Object(i.a)("Dark theme")},t=c.b.getValue("custom_themes"),n={};for(const{name:e}of t)n["custom-".concat(e)]=e;return Object.assign({},n,e)}async function p(e){if(!e){const t=new d;e=t.getEffectiveTheme()}let t=e;if(e.startsWith("custom-")){const n=function(e){const t=c.b.getValue("custom_themes");if(!t)throw new Error("No custom themes set, can't set custom theme \"".concat(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 \"".concat(e,'", only know ').concat(n))}return n}(e.substr(7));t=n.is_dark?"dark-custom":"light-custom",function(e){const{style:t}=document.body;if(e.colors)for(const[n,o]of Object.entries(e.colors))t.setProperty("--".concat(n),o),t.setProperty("--".concat(n,"-0pct"),o+"00"),t.setProperty("--".concat(n,"-50pct"),o+"7F")}(n)}const n=Object.create(null);let o;for(let e=0;o=document.getElementsByTagName("link")[e];e++){const e=o.getAttribute("href").match(/^bundles\/.*\/theme-(.*)\.css$/);e&&(n[e[1]]=o)}if(!(t in n))throw new Error("Unknown theme "+t);return n[t].disabled=!1,new Promise(o=>{const r=function(){n[t].disabled=!1,Object.values(n).forEach(e=>{e!=n[t]&&(e.disabled=!0)}),a.a.setTheme(e),o()};let i=!1;n[t].onload=()=>{r()};for(let e=0;e=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},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 a(e){try{c(o.next(e))}catch(e){i(e)}}function s(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(a,s)}c((o=o.apply(e,t||[])).next())}))},d=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)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 a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=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),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.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 a},g=function(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof _?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){s("next",e)}function l(e){s("throw",e)}function u(e,t){e(t),i.shift(),i.length&&s(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:_(e[o](t)),done:"return"===o}:r?r(t):t}:r}},y=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)}))}}},E=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},w=function(e){return e&&e.__esModule?e:{default:e}},C=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},x=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",a),t("__decorate",s),t("__param",c),t("__metadata",l),t("__awaiter",u),t("__generator",d),t("__exportStar",h),t("__values",p),t("__read",m),t("__spread",g),t("__spreadArrays",f),t("__await",_),t("__asyncGenerator",v),t("__asyncDelegator",b),t("__asyncValues",y),t("__makeTemplateObject",E),t("__importStar",S),t("__importDefault",w),t("__classPrivateFieldGet",C),t("__classPrivateFieldSet",x)}.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,n){"use strict";var o=n(46),r=n.n(o),i=n(56),a=n.n(i),s=n(33),c=n.n(s),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=a()(e,["checked","disabled","onChange"]);const s=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:s,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){var o=n(370),r=n(311);e.exports=function(e){return null!=e&&r(e.length)&&!o(e)}},function(e,t,n){var o=n(176);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";n.d(t,"a",(function(){return a}));var o=n(3),r=n.n(o),i=n(120);class a extends i.a{static set matrixClient(e){const t=a._matrixClient;a._matrixClient=e;for(const n of a._instances)n.initMatrixClient(t,e)}constructor(){super(),a._instances.push(this)}initMatrixClient(){console.warn("initMatrixClient not overridden")}}r()(a,"_matrixClient",void 0),r()(a,"_instances",[])},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(49),r=n(85),i=n(76),a=n(1),s=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=s.a.log.bind(s.a),a.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 a.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,a=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 a=this._relations[n];a||(a=this._relations[n]={});let s=a[o];s||(s=a[o]={});let c,l=s[r],d=!1;l||(l=s[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.map(n))return!1}const a=this.filter_json.contains_url;return void 0===a||a===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 a(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,s,c=a(e),l=1;l0})),(function(t){e._activeQueues.push(t),s("Spinning up queue: '%s'",t),function e(t,n){const r=function(e,t){const n=e._queues[t];if(!o.p(n))return null;return n[0]}(t,n);if(!r){const e=t._activeQueues.indexOf(n);return e>=0&&t._activeQueues.splice(e,1),void s("Stopping queue '%s' as it is now empty",n)}s("Queue '%s' has %s pending events",n,t._queues[n].length),Promise.resolve().then(()=>t._procFn(r.event)).then((function(o){a(t,n),s("Queue '%s' sent event %s",n,r.event.getId()),r.defer.resolve(o),e(t,n)}),(function(o){r.attempts+=1;const i=t.retryAlgorithm(r.event,r.attempts,o);s("retry(%s) err=%s event_id=%s waitTime=%s",r.attempts,o,r.event.getId(),i),-1===i?(s("Queue '%s' giving up on event %s",n,r.event.getId()),a(t,n),r.defer.reject(o),e(t,n)):setTimeout((function(){e(t,n)}),i)}))}(e,t)}))}function a(e,t){const n=e._queues[t];return o.p(n)?n.shift():null}function s(){0}r.prototype.getQueueForEvent=function(e){const t=this.queueAlgorithm(e);return t&&this._queues[t]?o.u(this._queues[t],(function(e){return e.event})):null},r.prototype.removeEventFromQueue=function(e){const t=this.queueAlgorithm(e);if(!t||!this._queues[t])return!1;let n=!1;return o.y(this._queues[t],(function(t){if(t.event.getId()===e.getId())return n=!0,!0})),n},r.prototype.setProcessFunction=function(e){this._procFn=e,i(this)},r.prototype.queueEvent=function(e){const t=this.queueAlgorithm(e);if(!t)return null;this._queues[t]||(this._queues[t]=[]);const n=o.d();return this._queues[t].push({event:e,defer:n,attempts:0}),s("Queue algorithm dumped event %s into queue '%s'",e.getId(),t),i(this),n.promise},r.RETRY_BACKOFF_RATELIMIT=function(e,t,n){if(400===n.httpStatus||403===n.httpStatus||401===n.httpStatus)return-1;if("rejected"===n.cors)return-1;if("M_TOO_LARGE"===n.name)return-1;if("M_LIMIT_EXCEEDED"===n.name){const e=n.data.retry_after_ms;if(e)return e}return t>4?-1:1e3*Math.pow(2,t)},r.QUEUE_MESSAGES=function(e){return"m.room.message"===e.getType()||e.hasAssocation()?"message":null}},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 s}));var o=n(49),r=n(185),i=n(0),a=n(1);function s(e,t){this.roomId=e,this.members={},this.events={},this.paginationToken=null,this._sentinels={},this._updateModifiedTime(),this._displayNameToUserIds={},this._userIdsToDisplayNames={},this._tokenToInvite={},this._joinedMemberCount=null,this._summaryJoinedMemberCount=null,this._invitedMemberCount=null,this._summaryInvitedMemberCount=null,t||(t={status:1}),this._oobMemberFlags=t}function c(e,t,n){const o=e._userIdsToDisplayNames[t];if(delete e._userIdsToDisplayNames[t],o){const n=a.z(o),r=e._displayNameToUserIds[n];if(r){const o=r.filter(e=>e!==t);e._displayNameToUserIds[n]=o}}e._userIdsToDisplayNames[t]=n;const r=n&&a.z(n);r&&(e._displayNameToUserIds[r]||(e._displayNameToUserIds[r]=[]),e._displayNameToUserIds[r].push(t))}a.o(s,o.EventEmitter),s.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)},s.prototype.setJoinedMemberCount=function(e){this._summaryJoinedMemberCount=e},s.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)},s.prototype.setInvitedMemberCount=function(e){this._summaryInvitedMemberCount=e},s.prototype.getMembers=function(){return a.B(this.members)},s.prototype.getMembersExcept=function(e){return a.B(this.members).filter(t=>!e.includes(t.userId))},s.prototype.getMember=function(e){return this.members[e]||null},s.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},s.prototype.getStateEvents=function(e,t){if(!this.events[e])return void 0===t?[]:null;if(void 0===t)return a.B(this.events[e]);const n=this.events[e][t];return n||null},s.prototype.clone=function(){const e=new s(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},s.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)},s.prototype.setStateEvents=function(e){const t=this;this._updateModifiedTime(),a.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))})),a.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=a.B(t.members);a.l(n,(function(n){n.setPowerLevelEvent(e),t.emit("RoomState.members",e,t,n)})),t._sentinels={}}}))},s.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},s.prototype._setStateEvent=function(e){void 0===this.events[e.getType()]&&(this.events[e.getType()]={}),this.events[e.getType()][e.getStateKey()]=e},s.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},s.prototype.needsOutOfBandMembers=function(){return 1===this._oobMemberFlags.status},s.prototype.markOutOfBandMembersStarted=function(){1===this._oobMemberFlags.status&&(this._oobMemberFlags.status=2)},s.prototype.markOutOfBandMembersFailed=function(){2===this._oobMemberFlags.status&&(this._oobMemberFlags.status=1)},s.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 ".concat(e," members...")),this._oobMemberFlags.status=1},s.prototype.setOutOfBandMembers=function(e){i.a.log("LL: RoomState about to set ".concat(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)))},s.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)},s.prototype.setTypingEvent=function(e){a.l(a.B(this.members),(function(t){t.setTypingEvent(e)}))},s.prototype.getInviteForThreePidToken=function(e){return this._tokenToInvite[e]||null},s.prototype._updateModifiedTime=function(){this._modified=Date.now()},s.prototype.getLastModifiedTime=function(){return this._modified},s.prototype.getUserIdsWithDisplayName=function(e){return this._displayNameToUserIds[a.z(e)]||[]},s.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)},s.prototype._hasSufficientPowerLevelFor=function(e,t){const n=this.getStateEvents("m.room.power_levels","");let o={};n&&(o=n.getContent());let r=50;return a.s(o[e])&&(r=o[e]),t>=r},s.prototype.maySendMessage=function(e){return this._maySendEventOfType("m.room.message",e,!1)},s.prototype.maySendEvent=function(e,t){return this._maySendEventOfType(e,t,!1)},s.prototype.mayClientSendStateEvent=function(e,t){return!t.isGuest()&&this.maySendStateEvent(e,t.credentials.userId)},s.prototype.maySendStateEvent=function(e,t){return this._maySendEventOfType(e,t,!0)},s.prototype._maySendEventOfType=function(e,t,n){const o=this.getStateEvents("m.room.power_levels","");let r,i={},a=0,s=0,c=0;if(o){r=o.getContent(),i=r.events||{},a=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)&&(s=r.events_default)}let l=n?a:s;return Number.isFinite(i[e])&&(l=i[e]),c>=l},s.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&&a.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}));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";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";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 a(e){return o.lastIndex=0,e.replace(o,(function(e){return r[e]}))}function s(e){switch(typeof e){case"string":return'"'+a(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 a=r(i);if(a)return a;i=await this._callbacks.getCrossSigningKey(t,n);const s=r(i);if(s)return this._cacheCallbacks.storeCrossSigningKeyCache&&o&&await this._cacheCallbacks.storeCrossSigningKeyCache(t,i),s;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 c(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.".concat(t),!1)||{});return Object.keys(t).length?t:null}static async storeInSecretStorage(e,t){for(const n of Object.keys(e)){const r=Object(o.encodeBase64)(e[n]);await t.store("m.cross_signing.".concat(n),r)}}static async getFromSecretStorage(e,t){const n=await t.get("m.cross_signing.".concat(e));return Object(o.decodeBase64)(n)}getId(e){if(e=e||"master",!this.keys[e])return null;return s(this.keys[e])}async resetKeys(t){if(!this._callbacks.saveCrossSigningKeys)throw new Error("No saveCrossSigningKeys callback supplied");if(void 0===t||t&l.MASTER||!this.keys.master)t=l.MASTER|l.USER_SIGNING|l.SELF_SIGNING;else if(0===t)return;const n={},r={};let i,a;try{if(t&l.MASTER?(i=new e.Olm.PkSigning,n.master=i.generate_seed(),a=i.init_with_seed(n.master),r.master={user_id:this.userId,usage:["master"],keys:{["ed25519:"+a]:a}}):[a,i]=await this.getCrossSigningKey("master"),t&l.SELF_SIGNING){const t=new e.Olm.PkSigning;try{n.self_signing=t.generate_seed();const e=t.init_with_seed(n.self_signing);r.self_signing={user_id:this.userId,usage:["self_signing"],keys:{["ed25519:"+e]:e}},Object(o.pkSign)(r.self_signing,i,this.userId,a)}finally{t.free()}}if(t&l.USER_SIGNING){const t=new e.Olm.PkSigning;try{n.user_signing=t.generate_seed();const e=t.init_with_seed(n.user_signing);r.user_signing={user_id:this.userId,usage:["user_signing"],keys:{["ed25519:"+e]:e}},Object(o.pkSign)(r.user_signing,i,this.userId,a)}finally{t.free()}}Object.assign(this.keys,r),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 i.a.error(t),new Error(t)}this.keys.master?s(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=s(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 i.a.error(t),new Error(t)}try{Object(o.pkVerify)(e.user_signing,n,this.userId)}catch(e){throw i.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 i.a.error(t),new Error(t)}try{Object(o.pkVerify)(e.self_signing,n,this.userId)}catch(e){throw i.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,r]=await this.getCrossSigningKey(t);try{return Object(o.pkSign)(e,r,this.userId,n),e}finally{r.free()}}async signUser(e){if(this.keys.user_signing)return this.signObject(e.keys.master,"user_signing");i.a.info("No user signing key: not signing user")}async signDevice(e,t){if(e!==this.userId)throw new Error("Trying to sign ".concat(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");i.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 u(!0,!0,this.firstUse);if(!this.keys.user_signing)return new u(!1,!1,e.firstUse);let t;const n=e.keys.master,r=this.getId("user_signing");try{Object(o.pkVerify)(n,r,this.userId),t=!0}catch(e){t=!1}return new u(t,e.crossSigningVerifiedBefore,e.firstUse)}checkDeviceTrust(e,t,n,r){const i=this.checkUserTrust(e),a=e.keys.self_signing;if(!a)return new d(!1,!1,n,r);const c=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(o.pkVerify)(a,e.getId(),e.userId),Object(o.pkVerify)(c,s(a),e.userId),d.fromUserTrustLevel(i,n,r)}catch(e){return new d(!1,!1,n,r)}}getCacheCallbacks(){return this._cacheCallbacks}}const l={MASTER:4,USER_SIGNING:2,SELF_SIGNING:1};class u{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 d{constructor(e,t,n,o){this._crossSigningVerified=e,this._tofu=t,this._localVerified=n,this._trustCrossSignedDevices=o}static fromUserTrustLevel(e,t,n){return new d(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 h(e){return{getCrossSigningKeyCache:function(t,n){return new Promise(n=>e.doTxn("readonly",[a.a.STORE_ACCOUNT],o=>{e.getSecretStorePrivateKey(o,n,t)}))},storeCrossSigningKeyCache:function(t,n){if(!(n instanceof Uint8Array))throw new Error("storeCrossSigningKeyCache expects Uint8Array, got ".concat(n));return e.doTxn("readwrite",[a.a.STORE_ACCOUNT],o=>{e.storeSecretStorePrivateKey(o,t,n)})}}}}).call(this,n(17))},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(76),a=n(49),s=n(0),c=n(186),l=n(155),u=n(235),d=n(61);const h=new Error("Verification timed out");class p extends Error{constructor(e){super(),this.startEvent=e}}class m extends a.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(){s.a.info("Refreshing/starting the verification transaction timeout timer"),null!==this._transactionTimeoutTimer&&clearTimeout(this._transactionTimeoutTimer),this._transactionTimeoutTimer=setTimeout(()=>{this._done||this.cancelled||(s.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(s.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 ".concat(o," (").concat(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.".concat(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"))}),a=new Promise(async e=>{if(!await n._crypto.getSessionBackupPrivateKey()){s.a.info("No cached backup key found. Requesting...");const e=n.requestSecret("m.megolm_backup.v1",[this.deviceId]),t=await e.promise;s.a.info("Got key backup key, decoding...");const o=Object(d.decodeBase64)(t);s.a.info("Decoded backup key, storing..."),n._crypto.storeSessionBackupPrivateKey(Uint8Array.from(o)),s.a.info("Backup key stored. Starting backup restore...");const r=await n.getKeyBackupVersion();n.restoreKeyBackupWithCache(void 0,void 0,r).then(()=>{s.a.info("Backup restored.")})}e()});return Promise.race([Promise.all([r.getCrossSigningKey("self_signing"),r.getCrossSigningKey("user_signing"),a]),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],a=this._baseApis.getStoredDevice(e,t);if(a)await n(r,a,i),o.push(t);else{const a=this._baseApis._crypto._deviceList.getStoredCrossSigningForUser(e);a&&a.getId()===t?(await n(r,c.a.fromStorage({keys:{[r]:t}},t),i),o.push(t)):s.a.warn("verification: Could not find device ".concat(t," to verify"))}}if(!o.length)throw new Error("No devices could be verified");s.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 a}));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 a(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 a(t,n,5e5,256),salt:n,iterations:5e5}}async function a(t,n,o,r=256){const i=e.crypto.subtle,a=e.TextEncoder;if(!i||!a)throw new Error("Password-based backup is not avaiable on this platform");const s=await i.importKey("raw",(new a).encode(t),{name:"PBKDF2"},!1,["deriveBits"]),c=await i.deriveBits({name:"PBKDF2",salt:(new a).encode(n),iterations:o,hash:"SHA-512"},s,r);return new Uint8Array(c)}}).call(this,n(17))},function(e,t,n){"use strict";(function(e,o){n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return c}));var r=n(752),i=n.n(r);const a=[139,1];function s(t){const n=new e(a.length+t.length+1);n.set(a,0),n.set(t,a.length);let o=0;for(let e=0;e1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var o=[],i=0;i=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?r+=o.charAt(a):s<128?r+=i[s]:s<2048?r+=i[192|s>>6]+i[128|63&s]:s<55296||s>=57344?r+=i[224|s>>12]+i[128|s>>6&63]+i[128|63&s]:(a+=1,s=65536+((1023&s)<<10|1023&o.charCodeAt(a)),r+=i[240|s>>18]+i[128|s>>12&63]+i[128|s>>6&63]+i[128|63&s])}return r},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,i){if(!n)return t;if("object"!=typeof n){if(r(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(i&&(i.plainObjects||i.allowPrototypes)||!o.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var s=t;return r(t)&&!r(n)&&(s=a(t,i)),r(t)&&r(n)?(n.forEach((function(n,r){if(o.call(t,r)){var a=t[r];a&&"object"==typeof a&&n&&"object"==typeof n?t[r]=e(a,n,i):t.push(n)}else t[r]=n})),t):Object.keys(n).reduce((function(t,r){var a=n[r];return o.call(t,r)?t[r]=e(t[r],a,i):t[r]=a,t}),s)}}},function(e,t,n){var o=n(771);e.exports=function(e,t,n){if(o(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,r){return e.call(t,n,o,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var o=n(128);e.exports=function(e,t){if(!o(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!o(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var o=n(244)("keys"),r=n(190);e.exports=function(e){return o[e]||(o[e]=r(e))}},function(e,t,n){var o=n(66),r=n(89),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:o.version,mode:n(189)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){"use strict";t.__esModule=!0;var o=a(n(774)),r=a(n(786)),i="function"==typeof r.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof r.default&&"symbol"===i(o.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":i(e)}},function(e,t){var n=Math.ceil,o=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?o:n)(e)}},function(e,t,n){var o=n(127),r=n(778),i=n(249),a=n(243)("IE_PROTO"),s=function(){},c=function(){var e,t=n(329)("iframe"),o=i.length;for(t.style.display="none",n(781).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("