(()=>{var e={"./node_modules/loglevel/lib/loglevel.js":function(e,t,o){var n,r;!function(){"use strict";n=function(){var e=function(){},t="undefined",o=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],r={},l=null;function i(e,t){var o=e[t];if("function"==typeof o.bind)return o.bind(e);try{return Function.prototype.bind.call(o,e)}catch(t){return function(){return Function.prototype.apply.apply(o,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&o?a:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}function c(){for(var o=this.getLevel(),r=0;r=0&&t<=p.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?u+=":"+e:"symbol"==typeof e&&(u=void 0),p.name=e,p.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},p.methodFactory=o||d,p.getLevel=function(){return null!=s?s:null!=a?a:i},p.setLevel=function(e,t){return s=g(e),!1!==t&&f(s),c.call(p)},p.setDefaultLevel=function(e){a=g(e),m()||p.setLevel(e,!1)},p.resetLevel=function(){s=null,v(),c.call(p)},p.enableAll=function(e){p.setLevel(p.levels.TRACE,e)},p.disableAll=function(e){p.setLevel(p.levels.SILENT,e)},p.rebuild=function(){if(l!==p&&(i=g(l.getLevel())),c.call(p),l===p)for(var e in r)r[e].rebuild()},i=g(l?l.getLevel():"WARN");var h=m();null!=h&&(s=g(h)),c.call(p)}(l=new u).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=r[e];return t||(t=r[e]=new u(e,l.methodFactory)),t};var f=typeof window!==t?window.log:void 0;return l.noConflict=function(){return typeof window!==t&&window.log===l&&(window.log=f),l},l.getLoggers=function(){return r},l.default=l,l},void 0===(r="function"==typeof n?n.call(t,o,t,e):n)||(e.exports=r)}()}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var l=t[n]={exports:{}};return e[n].call(l.exports,l,l.exports,o),l.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{if(void 0!==o){var e=o.u,t=o.e,n={},r={};o.u=function(t){return e(t)+(n.hasOwnProperty(t)?"?"+n[t]:"")},o.e=function(l){return t(l).catch(function(t){var i=r.hasOwnProperty(l)?r[l]:3;if(i<1){var a=e(l);throw t.message="Loading chunk "+l+" failed after 3 retries.\n("+a+")",t.request=a,t}return new Promise(function(e){setTimeout(function(){var t=Date.now();n[l]=t,r[l]=i-1,e(o.e(l))},500)})})}}})(),(()=>{"use strict";var e=o("./node_modules/loglevel/lib/loglevel.js"),t=o.n(e);t().methodFactory=function(e,t,o){return function(...t){this.prefix&&t.unshift(this.prefix);return"error"===e||"warn"===e||"trace"===e||"info"===e||"debug"===e?console[e](...t):console.log(...t)}};const n=function e(o){const n="matrix"+(void 0===o?"":`-${o}`),r=t().getLogger(n);return void 0===r.getChild&&(r.prefix=o,r.getChild=t=>{const n=e((null!=o?o:"")+t);return n.methodFactory=r.methodFactory,n.rebuild(),n},r.setLevel(t().levels.DEBUG,!1)),r}();async function r(e){const t=new URL(e,window.location.href);t.searchParams.set("cachebuster",Date.now().toString());const o=await fetch(t,{cache:"no-cache",method:"GET"});return 404===o.status||0===o.status?{}:o.ok?o.json():void 0}let l=function(e){return e.Classic="element-classic",e.X="element",e.Pro="element-pro",e}({});const i={[l.Classic]:{name:"Element",appleAppId:"id1083446067",appStoreUrl:"https://apps.apple.com/app/element-messenger/id1083446067",playStoreUrl:"https://play.google.com/store/apps/details?id=im.vector.app",fDroidUrl:"https://f-droid.org/packages/im.vector.app",deepLinkPath:"",usesLegacyDeepLink:!0,isProApp:!1},[l.X]:{name:"Element X",appleAppId:"id1631335820",appStoreUrl:"https://apps.apple.com/app/element-x-secure-chat-call/id1631335820",playStoreUrl:"https://play.google.com/store/apps/details?id=io.element.android.x",fDroidUrl:"https://f-droid.org/packages/io.element.android.x",deepLinkPath:"/element",usesLegacyDeepLink:!1,isProApp:!1},[l.Pro]:{name:"Element Pro",appleAppId:"id6502951615",appStoreUrl:"https://apps.apple.com/app/element-pro-for-work/id6502951615",playStoreUrl:"https://play.google.com/store/apps/details?id=io.element.enterprise",deepLinkPath:"/element-pro",usesLegacyDeepLink:!1,isProApp:!0}};function a(){document.cookie="element_mobile_redirect_to_guide=false;path=/;max-age=14400",window.location.href="../"}function s(e){e=`

Error loading Element

${e}

If this is unexpected, please contact your system administrator or technical support representative.

`;const t=document.getElementsByClassName("mx_HomePage_container"),o=document.getElementsByClassName("mx_HomePage_errorContainer");for(const e of t)e.innerHTML="";for(const t of o)t.style.display="block",t.innerHTML=e}!async function(){var e,t,o;const c=await async function(e=""){""===e||e.endsWith("/")||(e+="/");let t=window.location.hostname.trimEnd();t.endsWith(".")&&(t=t.slice(0,-1));const o=r(`${e}config.${t}.json`),n=r(e+"config.json");try{const e=await o;if(!e||0===Object.keys(e).length)throw new Error;return e}catch{return n}}(".."),p=null==c?void 0:c.default_server_config;let d=null==c?void 0:c.default_server_name;const u=null==c?void 0:c.default_hs_url,f=null==c?void 0:c.default_is_url,m=null!==(e=null==c?void 0:c.mobile_guide_app_variant)&&void 0!==e?e:l.X,v=null!==(t=i[m])&&void 0!==t?t:i[l.X],g=[p,d,u].filter(e=>!!e);if(u&&(p||d))return s("Invalid configuration: a default_hs_url can't be specified along with default_server_name or default_server_config");if(g.length<1)return s("Invalid configuration: no default server specified.");let h,y;var w;if(d||"string"!=typeof(null==p||null===(o=p["m.homeserver"])||void 0===o?void 0:o.base_url)||(h=p["m.homeserver"].base_url,d=p["m.homeserver"].server_name,"string"==typeof(null===(w=p["m.identity_server"])||void 0===w?void 0:w.base_url)&&(y=p["m.identity_server"].base_url)),d)try{const e=await fetch(`https://${d}/.well-known/matrix/client`),t=await e.json();null!=t&&t["m.homeserver"]&&(h=t["m.homeserver"].base_url,t["m.identity_server"]&&(y=t["m.identity_server"].base_url))}catch(e){if(null==p||!p["m.homeserver"])return n.error(e),s("Unable to fetch homeserver configuration");h=p["m.homeserver"].base_url||void 0,p["m.identity_server"]&&(y=p["m.identity_server"].base_url||void 0)}if(u&&(h=u,y=f),!h)return s("Unable to locate homeserver");h&&!h.endsWith("/")&&(h+="/"),y&&!y.endsWith("/")&&(y+="/");let _=`https://mobile.element.io${v.deepLinkPath}`;v.usesLegacyDeepLink?(_+=`?hs_url=${encodeURIComponent(h)}`,y&&(_+=`&is_url=${encodeURIComponent(y)}`)):d&&(_+=`?account_provider=${d}`),document.getElementById("back_to_element_button").onclick=a,function(e,t,o){document.querySelector('meta[name="apple-itunes-app"]').setAttribute("content",`app-id=${e.appleAppId}`),o&&(document.getElementById("header_title").innerText=`Join ${o} on Element`),document.getElementById("app_store_link").href=e.appStoreUrl,document.getElementById("play_store_link").href=e.playStoreUrl,e.fDroidUrl?document.getElementById("f_droid_link").href=e.fDroidUrl:document.getElementById("f_droid_section").style.display="none";const n=document.getElementById("step1_heading");n.innerHTML=n.innerHTML.replace("Element",e.name),document.getElementById("step2_container")&&(document.getElementById("step2_container").style.display="block",e.isProApp&&(document.getElementById("step2_description").innerHTML="Use your work email to join"),document.getElementById("deep_link_button").href=t)}(v,_,null!=d?d:h)}()})()})(); //# sourceMappingURL=mobileguide.js.map