(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{1455:function(e,o,n){"use strict";n.r(o),function(e){n.d(o,"loadApp",(function(){return U}));var t=n(33),i=n.n(t),r=n(36),a=n(50),s=n(392),c=n(34),l=n(65),d=n(187),f=n(181),u=n(55),g=n.n(u),w=n(15),h=n(37),p=n(45),m=n(82);e.React=i.a;let _=null;function v(e){const o=Object(w.b)(e);return{screen:o.location.substring(1),params:o.params}}function b(e){decodeURIComponent(window.location.hash)!==_&&function(e){if(!window.matrixChat)return;console.log("Routing URL ",e.href);const o=v(e);window.matrixChat.showScreen(o.screen,o.params)}(window.location)}function C(e){console.log("newscreen "+e);const o="#/"+e;_=o,window.location.hash=o}function y(e){let o;o="vector:"===window.location.protocol?"https://riot.im/app/#/register":window.location.protocol+"//"+window.location.host+window.location.pathname+"#/register";const n=Object.keys(e);for(let t=0;t!!e);if(a.length>1)throw Object(c.h)(Object(c.b)("Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url."));if(a.length<1)throw Object(c.h)(Object(c.b)("Invalid configuration: no default server specified."));i&&(console.log("Config uses a default_hs_url - constructing a default_server_config using this information"),console.warn("DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use default_server_config instead."),n={"m.homeserver":{base_url:i}},r&&(n["m.identity_server"]={base_url:r}));let s=null;n&&(console.log("Config uses a default_server_config - validating object"),s=await d.a.fromDiscoveryConfig(n)),t&&(console.log("Config uses a default_server_name - doing .well-known lookup"),console.warn("DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please use default_server_config instead."),s=await d.a.findClientConfig(t)),e=l.b.buildValidatedConfigFromDiscovery(t,s,!0)}catch(o){const{hsUrl:n,isUrl:t,userId:i}=f.b();if(!n||!i)throw o;console.error(o),console.warn("A session was found - suppressing config error and using the session's homeserver"),console.log("Using pre-existing hsUrl and isUrl: ",{hsUrl:n,isUrl:t}),e=await l.b.validateServerConfigWithStaticUrls(n,t,!0)}return e.isDefault=!0,console.log("Using homeserver config:",e),console.log("Updating SdkConfig with validated discovery information"),p.a.add({validated_server_config:e}),p.a.get()}(),_=r.getComponent("structures.MatrixChat");return i.a.createElement(_,{onNewScreen:C,makeRegistrationUrl:y,ConferenceHandler:s,config:g,realQueryParams:t,startingFragmentQueryParams:e,enableGuest:!g.disable_guests,onTokenLoginCompleted:O,initialScreenAfterLogin:v(window.location),defaultDeviceDisplayName:n.getDefaultDeviceDisplayName()})}}.call(this,n(17))}}]);