/*! For license information please see vendors~element-web-app.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[29],{1425:function(e,t,a){"use strict";(function(e){var t=a(136);if(e.__js_sdk_entrypoint)throw new Error("Multiple matrix-js-sdk entrypoints detected!");let n;e.__js_sdk_entrypoint=!0;try{n=e.indexedDB}catch(e){}n&&t.setCryptoStoreFactory((()=>new t.IndexedDBCryptoStore(n,"matrix-js-sdk:crypto")));e.matrixcs=t}).call(this,a(14))},1426:function(e,t,a){"use strict";var n=a(13),i=a.n(n),s=a(1),r=a(122),o=a(124),l=a(329);var c;!function(e){e.Online="online",e.Offline="offline",e.Unavailable="unavailable"}(c||(c={}));t.a=new class{constructor(){i()(this,"unavailableTimer",null),i()(this,"dispatcherRef",null),i()(this,"state",null),i()(this,"onAction",(e=>{var t;"user_activity"===e.action&&(this.setState(c.Online),null===(t=this.unavailableTimer)||void 0===t||t.restart())}))}async start(){for(this.unavailableTimer=new l.a(18e4),this.dispatcherRef=o.a.register(this.onAction);this.unavailableTimer;)try{await this.unavailableTimer.finished(),this.setState(c.Unavailable)}catch(e){}}stop(){this.dispatcherRef&&(o.a.unregister(this.dispatcherRef),this.dispatcherRef=null),this.unavailableTimer&&(this.unavailableTimer.abort(),this.unavailableTimer=null)}getState(){return this.state}async setState(e){if(e===this.state)return;const t=this.state;if(this.state=e,!r.a.get().isGuest())try{await r.a.get().setPresence({presence:this.state}),s.a.info("Presence:",e)}catch(e){s.a.error("Failed to set presence:",e),this.state=t}}}},1427:function(e,t){e.exports="fonts/Twemoji_Mozilla/TwemojiMozilla-colr.4d2d834.woff2"},1428:function(e,t){e.exports="fonts/Twemoji_Mozilla/TwemojiMozilla-sbix.b1b6461.woff2"},1429:function(e,t,a){"use strict";a.r(t),a.d(t,"Icon",(function(){return r}));var n,i=a(120);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=o.b.get().brand,a=Object(r.a)("%(brand)s now uses 3-5x less memory, by only loading information about other users when needed. Please wait whilst we resynchronise with the server!",{brand:t});return i.a.createElement(s.a,{hasCancelButton:!1,title:Object(r.a)("Updating %(brand)s",{brand:t}),description:i.a.createElement("div",null,a),button:Object(r.a)("OK"),onFinished:e.onFinished})}},1432:function(e,t,a){"use strict";var n=a(120),i=a.n(n),s=a(155),r=a(121),o=a(131);t.a=e=>{const t=o.b.get().brand,a=Object(r.a)("You've previously used %(brand)s on %(host)s with lazy loading of members enabled. In this version lazy loading is disabled. As the local cache is not compatible between these two settings, %(brand)s needs to resync your account.",{brand:t,host:e.host}),n=Object(r.a)("If the other version of %(brand)s is still open in another tab, please close it as using %(brand)s on the same host with both lazy loading enabled and disabled simultaneously will cause issues.",{brand:t});return i.a.createElement(s.a,{hasCancelButton:!1,title:Object(r.a)("Incompatible local cache"),description:i.a.createElement("div",null,i.a.createElement("p",null,a),i.a.createElement("p",null,n)),button:Object(r.a)("Clear cache and resync"),onFinished:e.onFinished})}},1433:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(13),i=a.n(n),s=a(120),r=a.n(s),o=a(131),l=a(127),c=a(121),d=a(155),m=a(276),u=a(135),h=a(145);class p extends r.a.Component{constructor(){super(...arguments),i()(this,"sendBugReport",(()=>{l.b.createDialog(m.a,{error:this.props.error})})),i()(this,"onClearStorageClick",(()=>{l.b.createDialog(d.a,{title:Object(c.a)("Sign out"),description:r.a.createElement("div",null,Object(c.a)("Sign out and remove encryption keys?")),button:Object(c.a)("Sign out"),danger:!0,onFinished:this.props.onFinished})})),i()(this,"onRefreshClick",(()=>{window.location.reload()}))}render(){const e=o.b.get().brand,t=r.a.createElement("button",{onClick:this.onClearStorageClick,className:"danger"},Object(c.a)("Clear Storage and Sign Out"));let a;return a=o.b.get().bug_report_endpoint_url?r.a.createElement(h.a,{primaryButton:Object(c.a)("Send Logs"),onPrimaryButtonClick:this.sendBugReport,focus:!0,hasCancel:!1},t):r.a.createElement(h.a,{primaryButton:Object(c.a)("Refresh"),onPrimaryButtonClick:this.onRefreshClick,focus:!0,hasCancel:!1},t),r.a.createElement(u.a,{className:"mx_ErrorDialog",onFinished:this.props.onFinished,title:Object(c.a)("Unable to restore session"),contentId:"mx_Dialog_content",hasCancel:!1},r.a.createElement("div",{className:"mx_Dialog_content",id:"mx_Dialog_content"},r.a.createElement("p",null,Object(c.a)("We encountered an error trying to restore your previous session.")),r.a.createElement("p",null,Object(c.a)("If you have previously used a more recent version of %(brand)s, your session may be incompatible with this version. Close this window and return to the more recent version.",{brand:e})),r.a.createElement("p",null,Object(c.a)("Clearing your browser's storage may fix the problem, but will sign you out and cause any encrypted chat history to become unreadable."))),a)}}},1434:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(13),i=a.n(n),s=a(120),r=a.n(s),o=a(131),l=a(127),c=a(121),d=a(135),m=a(145),u=a(276),h=a(123);class p extends r.a.Component{constructor(){super(...arguments),i()(this,"sendBugReport",(e=>{e.preventDefault(),l.b.createDialog(u.a,{})})),i()(this,"onSignOutClick",(()=>{this.props.onFinished(!0)}))}render(){let e;return o.b.get().bug_report_endpoint_url&&(e=Object(c.a)("To help us prevent this in future, please send us logs.",{},{a:e=>r.a.createElement(h.a,{kind:"link_inline",onClick:this.sendBugReport},e)})),r.a.createElement(d.a,{className:"mx_ErrorDialog",onFinished:this.props.onFinished,title:Object(c.a)("Missing session data"),contentId:"mx_Dialog_content",hasCancel:!1},r.a.createElement("div",{className:"mx_Dialog_content",id:"mx_Dialog_content"},r.a.createElement("p",null,Object(c.a)("Some session data, including encrypted message keys, is missing. Sign out and sign in to fix this, restoring keys from backup.")),r.a.createElement("p",null,Object(c.a)("Your browser likely removed this data when running low on disk space.")," ",e)),r.a.createElement(m.a,{primaryButton:Object(c.a)("Sign out"),onPrimaryButtonClick:this.onSignOutClick,focus:!0,hasCancel:!1}))}}},1435:function(e,t,a){"use strict";a.r(t),a.d(t,"Icon",(function(){return r}));var n,i=a(120);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.warnInConsole()})),r()(this,"warnInConsole",Object(p.throttle)((()=>{const t="15px",a=Object(R.a)("Wait!"),n=Object(R.a)("If someone told you to copy/paste something here, there is a high likelihood you're being scammed!"),i=Object(R.a)("If you know what you're doing, Element is open-source, be sure to check out our GitHub (https://github.com/vector-im/element-web/) and contribute!");e.mx_rage_logger.bypassRageshake("log",`%c${a}\n%c${n}\n%c${i}`,"font-size:50px; color:blue;",`font-size:${t}; color:red;`,`font-size:${t};`)}),1e3)),r()(this,"onAction",(e=>{var t;if(null!==(t=f.a.get())&&void 0!==t&&t.isGuest()&&qe.includes(e.action))return _.a.dispatch({action:H.a.DoAfterSyncPrepared,deferred_action:e}),void _.a.dispatch({action:"require_registration"});switch(e.action){case"MatrixActions.accountData":if("m.identity_server"===e.event_type){const t=e.event_content?e.event_content.base_url:null;t?(f.a.get().setIdentityServerUrl(t),localStorage.removeItem("mx_is_access_token"),localStorage.setItem("mx_is_url",t)):(f.a.get().setIdentityServerUrl(null),localStorage.removeItem("mx_is_access_token"),localStorage.removeItem("mx_is_url")),_.a.dispatch({action:"id_server_changed"})}break;case"logout":Oe.b.instance.hangupAllCalls(),Promise.all([...[...Ie.a.instance.activeCalls].map((e=>e.disconnect())),Object(Ue.D)(this.stores)]).finally((()=>x.i()));break;case"require_registration":Object(N.b)(e);break;case"start_registration":if(x.g()){this.onSoftLogout();break}e.screenAfterLogin&&(this.screenAfterLogin=e.screenAfterLogin),this.startRegistration(e.params||{});break;case"start_login":if(x.g()){this.onSoftLogout();break}e.screenAfterLogin&&(this.screenAfterLogin=e.screenAfterLogin),this.viewLogin();break;case"start_password_recovery":this.setStateForNewView({view:je.a.FORGOT_PASSWORD}),this.notifyNewScreen("forgot_password");break;case"start_chat":Object(k.b)({dmUserId:e.user_id});break;case"leave_room":this.leaveRoom(e.room_id);break;case"forget_room":this.forgetRoom(e.room_id);break;case"copy_room":this.copyRoom(e.room_id);break;case"reject_invite":S.b.createDialog(ie.a,{title:Object(R.a)("Reject invitation"),description:Object(R.a)("Are you sure you want to reject the invitation?"),onFinished:t=>{if(t){const t=S.b.createDialog(ne.a,void 0,"mx_Dialog_spinner");f.a.get().leave(e.room_id).then((()=>{t.close(),this.state.currentRoomId===e.room_id&&_.a.dispatch({action:H.a.ViewHomePage})}),(e=>{t.close(),S.b.createDialog(K.a,{title:Object(R.a)("Failed to reject invitation"),description:e.toString()})}))}}});break;case"view_user_info":this.viewUser(e.userId,e.subAction);break;case"MatrixActions.RoomState.events":{const t=e.event;t.getType()===c.EventType.RoomCanonicalAlias&&t.getRoomId()===this.state.currentRoomId&&this.viewRoom({action:H.a.ViewRoom,room_id:this.state.currentRoomId,metricsTrigger:void 0});break}case H.a.ViewRoom:{const t=this.viewRoom(e);e.deferred_action&&t.then((()=>{_.a.dispatch(e.deferred_action)}));break}case H.a.ViewUserDeviceSettings:Object(Le.a)(I.b.getValue("feature_new_device_manager"));break;case H.a.ViewUserSettings:{const t=e;S.b.createDialog(se.a,{initialTabId:t.initialTabId},null,!1,!0),this.viewSomethingBehindModal();break}case"view_create_room":this.createRoom(e.public,e.defaultName,e.type),this.viewSomethingBehindModal();break;case H.a.ViewRoomDirectory:S.b.createDialog(Be.b,{initialText:e.initialText,initialFilter:Be.a.PublicRooms},"mx_SpotlightDialog_wrapper",!1,!0),this.viewSomethingBehindModal();break;case"view_welcome_page":this.viewWelcome();break;case H.a.ViewHomePage:this.viewHome(e.justRegistered);break;case H.a.ViewStartChatOrReuse:this.chatCreateOrReuse(e.user_id);break;case"view_create_chat":Object(O.f)(e.initialText||""),this.viewSomethingBehindModal();break;case"view_invite":{const t=f.a.get().getRoom(e.roomId);null!=t&&t.isSpaceRoom()?Object(Ce.i)(t):Object(O.e)(e.roomId);break}case"view_last_screen":this.showScreenAfterLogin();break;case"hide_left_panel":this.setState({collapseLhs:!0},(()=>{this.state.resizeNotifier.notifyLeftHandleResized()}));break;case"show_left_panel":this.setState({collapseLhs:!1},(()=>{this.state.resizeNotifier.notifyLeftHandleResized()}));break;case H.a.OpenDialPad:S.b.createDialog(Q.a,{},"mx_Dialog_dialPadWrapper");break;case H.a.OnLoggedIn:this.stores.client=f.a.get(),this.tokenLogin||x.g()||this.state.view===je.a.LOGIN||this.state.view===je.a.REGISTER||this.state.view===je.a.COMPLETE_SECURITY||this.state.view===je.a.E2E_SETUP||this.state.view===je.a.USE_CASE_SELECTION||this.onLoggedIn();break;case"on_client_not_viable":this.onSoftLogout();break;case H.a.OnLoggedOut:this.onLoggedOut();break;case"will_start_client":this.setState({ready:!1},(()=>{this.onWillStartClient()}));break;case"client_started":this.onClientStarted();break;case"send_event":this.onSendEvent(e.room_id,e.event);break;case"aria_hide_main_app":this.setState({hideToSRUsers:!0});break;case"aria_unhide_main_app":this.setState({hideToSRUsers:!1});break;case H.a.PseudonymousAnalyticsAccept:Object(z.b)(),I.b.setValue("pseudonymousAnalyticsOptIn",null,$.a.ACCOUNT,!0);break;case H.a.PseudonymousAnalyticsReject:Object(z.b)(),I.b.setValue("pseudonymousAnalyticsOptIn",null,$.a.ACCOUNT,!1);break;case H.a.ShowThread:{const{rootEvent:t,initialEvent:a,highlighted:n,scrollIntoView:i,push:s}=e,r={phase:Te.a.ThreadView,state:{threadHeadEvent:t,initialEvent:a,isInitialEventHighlighted:n,initialEventScrollIntoView:i}};null!=s&&s?Ne.a.instance.pushCard(r):Ne.a.instance.setCards([{phase:Te.a.ThreadPanel},r]),_.a.dispatch({action:H.a.FocusSendMessageComposer,context:Pe.a.Thread});break}}})),r()(this,"handleResize",(()=>{const e=1e3,t=fe.b.instance.windowWidth;this.prevWindowWidth=e&&_.a.dispatch({action:"show_left_panel"}),this.prevWindowWidth>=e&&t{this.showScreen("register")})),r()(this,"onLoginClick",(()=>{this.showScreen("login")})),r()(this,"onForgotPasswordClick",(()=>{this.showScreen("forgot_password")})),r()(this,"onRegisterFlowComplete",((e,t)=>this.onUserCompletedLoginFlow(e,t))),r()(this,"onUpdateStatusIndicator",((e,t)=>{const a=e.numUnreadStates;y.a.get()&&(y.a.get().setErrorStatus(t===d.b.Error),y.a.get().setNotificationCount(a)),this.subTitleStatus="",t===d.b.Error&&(this.subTitleStatus+=`[${Object(R.a)("Offline")}] `),a>0?this.subTitleStatus+=`[${a}]`:e.color>=He.a.Bold&&(this.subTitleStatus+="*"),this.setPageSubtitle()})),r()(this,"onServerConfigChange",(e=>{this.setState({serverConfig:e})})),r()(this,"makeRegistrationUrl",(e=>(this.props.startingFragmentQueryParams.referrer&&(e.referrer=this.props.startingFragmentQueryParams.referrer),this.props.makeRegistrationUrl(e)))),r()(this,"onUserCompletedLoginFlow",(async(e,t)=>{this.stores.accountPasswordStore.setPassword(t),await x.k(e),await this.postLoginSetup(),be.b.instance.stop(be.a.LOGIN),be.b.instance.stop(be.a.REGISTER)})),r()(this,"onCompleteSecurityE2eSetupFinished",(()=>{this.onLoggedIn()})),this.stores=Ae.b.instance,this.stores.constructEagerStores(),this.state={view:je.a.LOADING,collapseLhs:!1,hideToSRUsers:!1,syncError:null,resizeNotifier:new D.a,ready:!1},this.loggedInView=Object(o.createRef)(),E.b.put(this.props.config),this.firstSyncComplete=!1,this.firstSyncPromise=Object(u.m)(),this.props.config.sync_timeline_limit&&(f.a.opts.initialSyncLimit=this.props.config.sync_timeline_limit),this.screenAfterLogin=this.props.initialScreenAfterLogin,this.screenAfterLogin){const e=this.screenAfterLogin.params||{};if(this.screenAfterLogin.screen.startsWith("room/")&&e.signurl&&e.email){const t=this.screenAfterLogin.screen.substring("room/".length);Y.a.instance.storeInvite(t,e)}}this.prevWindowWidth=fe.b.instance.windowWidth||1e3,fe.b.instance.on(fe.a.Resize,this.handleResize),this.state.resizeNotifier.on("middlePanelResized",this.dispatchTimelineResize),q.a.instance.on(q.b,this.onUpdateStatusIndicator),x.g()&&x.h(),this.dispatcherRef=_.a.register(this.onAction),this.themeWatcher=new L.a,this.fontWatcher=new U.a,this.themeWatcher.start(),this.fontWatcher.start(),this.focusComposer=!1,this.subTitleStatus="",x.g()||x.a(this.props.realQueryParams,this.props.defaultDeviceDisplayName,this.getFragmentAfterLogin()).then((async e=>{var t;if(null!==(t=this.props.realQueryParams)&&void 0!==t&&t.loginToken&&this.props.onTokenLoginCompleted(),e)return this.tokenLogin=!0,await x.j({ignoreGuest:!0}),this.postLoginSetup();const a=this.screenAfterLogin?this.screenAfterLogin.screen:null;return!!await this.loadSession()||("login"!==a&&"register"!==a&&"forgot_password"!==a||this.showScreenAfterLogin(),!1)})),Object(Se.a)(E.b.get("sentry"))}async postLoginSetup(){const e=f.a.get(),t=e.isCryptoEnabled();t||this.onLoggedIn();const a=[this.firstSyncPromise.promise];let n=!1;t&&a.push((async()=>{n=await e.userHasCrossSigningKeys()})()),this.setState({pendingInitialSync:!0}),await Promise.all(a),t?(n?!1===ae.a.SHOW_ENCRYPTION_SETUP_UI?this.onLoggedIn():this.setStateForNewView({view:je.a.COMPLETE_SECURITY}):await e.doesServerSupportUnstableFeature("org.matrix.e2e_cross_signing")?this.setStateForNewView({view:je.a.E2E_SETUP}):this.onLoggedIn(),this.setState({pendingInitialSync:!1})):this.setState({pendingInitialSync:!1})}setState(e,t){this.shouldTrackPageChange(this.state,Ge(Ge({},this.state),e))&&this.startPageChangeTimer(),super.setState(e,t)}componentDidMount(){window.addEventListener("resize",this.onWindowResized)}componentDidUpdate(e,t){if(this.shouldTrackPageChange(t,this.state)){const e=this.stopPageChangeTimer();v.b.instance.trackPageChange(this.state.view,this.state.page_type,e)}this.focusComposer&&(_.a.fire(H.a.FocusSendMessageComposer),this.focusComposer=!1)}componentWillUnmount(){x.m(),_.a.unregister(this.dispatcherRef),this.themeWatcher.stop(),this.fontWatcher.stop(),fe.b.destroy(),this.state.resizeNotifier.removeListener("middlePanelResized",this.dispatchTimelineResize),window.removeEventListener("resize",this.onWindowResized),this.stores.accountPasswordStore.clearPassword(),this.voiceBroadcastResumer&&this.voiceBroadcastResumer.destroy()}getFallbackHsUrl(){var e;return null!==(e=this.props.serverConfig)&&void 0!==e&&e.isDefault?this.props.config.fallback_hs_url:null}getServerProperties(){let e=this.state.serverConfig;return e||(e=this.props.serverConfig),e||(e=E.b.get("validated_server_config")),{serverConfig:e}}loadSession(){return Promise.resolve().then((()=>x.h({fragmentQueryParams:this.props.startingFragmentQueryParams,enableGuest:this.props.enableGuest,guestHsUrl:this.getServerProperties().serverConfig.hsUrl,guestIsUrl:this.getServerProperties().serverConfig.isUrl,defaultDeviceDisplayName:this.props.defaultDeviceDisplayName}))).then((e=>(e||(Y.a.instance.pickBestInvite()?_.a.dispatch({action:"start_registration"}):_.a.dispatch({action:"view_welcome_page"})),e)))}startPageChangeTimer(){be.b.instance.start(be.a.PAGE_CHANGE)}stopPageChangeTimer(){const e=be.b.instance;e.stop(be.a.PAGE_CHANGE);const t=e.getEntries({name:be.a.PAGE_CHANGE}).pop();return t?t.duration:null}shouldTrackPageChange(e,t){return e.currentRoomId!==t.currentRoomId||e.view!==t.view||e.page_type!==t.page_type}setStateForNewView(e){if(void 0===e.view)throw new Error("setStateForNewView with no view!");this.setState(Ge({currentUserId:void 0,justRegistered:!1},e))}setPage(e){this.setState({page_type:e})}async startRegistration(e){const t={view:je.a.REGISTER};if(e.client_secret&&e.session_id&&e.hs_url&&e.is_url&&e.sid){t.serverConfig=await M.a.validateServerConfigWithStaticUrls(e.hs_url,e.is_url);const a=E.b.get("validated_server_config");a&&a.hsUrl===t.serverConfig.hsUrl&&(t.serverConfig.hsName=a.hsName,t.serverConfig.hsNameIsDifferent=a.hsNameIsDifferent,t.serverConfig.isDefault=a.isDefault,t.serverConfig.isNameResolvable=a.isNameResolvable),t.register_client_secret=e.client_secret,t.register_session_id=e.session_id,t.register_id_sid=e.sid}this.setStateForNewView(t),T.a.isLogin=!0,this.themeWatcher.recheck(),this.notifyNewScreen("register")}async viewRoom(e){if(this.focusComposer=!0,e.room_alias?h.a.log(`Switching to room alias ${e.room_alias} at event ${e.event_id}`):h.a.log(`Switching to room id ${e.room_id} at event ${e.event_id}`),!this.firstSyncComplete){if(!this.firstSyncPromise)return void h.a.warn("Cannot view a room before first sync. room_id:",e.room_id);await this.firstSyncPromise.promise}let t=e.room_alias||e.room_id;const a=f.a.get().getRoom(e.room_id);if(a){var n;a.decryptAllEvents();const e=C.b(a);e&&(t=e,Object(F.b)(e,a.roomId)),null===(n=localStorage)||void 0===n||n.setItem("mx_last_room_id",a.roomId)}let i="#"===t[0]&&e.room_id===this.state.currentRoomId;var s,r,o,l;(Object(Me.a)(this.state.currentRoomId)&&(i=!0),e.room_id===this.state.currentRoomId)&&(e.threepid_invite=null!==(s=e.threepid_invite)&&void 0!==s?s:this.state.threepidInvite,e.oob_data=null!==(r=e.oob_data)&&void 0!==r?r:this.state.roomOobData,e.forceTimeline=null!==(o=e.forceTimeline)&&void 0!==o?o:this.state.forceTimeline,e.justCreatedOpts=null!==(l=e.justCreatedOpts)&&void 0!==l?l:this.state.roomJustCreatedOpts);e.event_id&&e.highlighted&&(t+="/"+e.event_id),this.setState({view:je.a.LOGGED_IN,currentRoomId:e.room_id||null,page_type:j.a.RoomView,threepidInvite:e.threepid_invite,roomOobData:e.oob_data,forceTimeline:e.forceTimeline,ready:!0,roomJustCreatedOpts:e.justCreatedOpts},(()=>{T.a.isLogin=!1,this.themeWatcher.recheck(),this.notifyNewScreen("room/"+t,i)}))}viewSomethingBehindModal(){this.state.view===je.a.LOGGED_IN?this.state.currentRoomId||this.state.currentUserId||this.viewHome():this.viewWelcome()}viewWelcome(){if(Object(Z.b)(E.b.get()))return this.viewLogin();this.setStateForNewView({view:je.a.WELCOME}),this.notifyNewScreen("welcome"),T.a.isLogin=!0,this.themeWatcher.recheck()}viewLogin(e){this.setStateForNewView(Ge({view:je.a.LOGIN},e)),this.notifyNewScreen("login"),T.a.isLogin=!0,this.themeWatcher.recheck()}viewHome(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setStateForNewView({view:je.a.LOGGED_IN,justRegistered:e,currentRoomId:null}),this.setPage(j.a.HomePage),this.notifyNewScreen("home"),T.a.isLogin=!1,this.themeWatcher.recheck()}viewUser(e,t){(this.firstSyncPromise?this.firstSyncPromise.promise:Promise.resolve()).then((()=>{"chat"!==t?(this.notifyNewScreen("user/"+e),this.setState({currentUserId:e}),this.setPage(j.a.UserView)):this.chatCreateOrReuse(e)}))}async createRoom(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,a=arguments.length>2?arguments[2]:void 0;const n=S.b.createDialog(re.a,{type:a,defaultPublic:e,defaultName:t}),[i,s]=await n.finished;i&&Object(k.b)(s)}chatCreateOrReuse(e){const t=new ke.a(this.props.config);if(f.a.get().isGuest())return e!==t.get("welcome_user_id")&&_.a.dispatch({action:H.a.DoAfterSyncPrepared,deferred_action:{action:H.a.ViewStartChatOrReuse,user_id:e}}),void _.a.dispatch({action:"require_registration",go_welcome_on_cancel:!0,screen_after:{screen:`user/${t.get("welcome_user_id")}`,params:{action:"chat"}}});const a=f.a.get(),n=Object(Ve.a)(a,e);n?_.a.dispatch({action:H.a.ViewRoom,room_id:n.roomId,metricsTrigger:"MessageUser"}):_.a.dispatch({action:"start_chat",user_id:e})}leaveRoomWarnings(e){const t=f.a.get().getRoom(e),a=null==t?void 0:t.isSpaceRoom(),n=[];if(1===t.currentState.getJoinedMemberCount())return n.push(l.a.createElement("span",{className:"warning",key:"only_member_warning"}," ",Object(R.a)("You are the only person here. If you leave, no one will be able to join in the future, including you."))),n;const i=t.currentState.getStateEvents("m.room.join_rules","");if(i){"public"!==i.getContent().join_rule&&n.push(l.a.createElement("span",{className:"warning",key:"non_public_warning"}," ",a?Object(R.a)("This space is not public. You will not be able to rejoin without an invite."):Object(R.a)("This room is not public. You will not be able to rejoin without an invite.")))}return n}leaveRoom(e){const t=f.a.get().getRoom(e),a=this.leaveRoomWarnings(e),n=null==t?void 0:t.isSpaceRoom();S.b.createDialog(ie.a,{title:n?Object(R.a)("Leave space"):Object(R.a)("Leave room"),description:l.a.createElement("span",null,n?Object(R.a)("Are you sure you want to leave the space '%(spaceName)s'?",{spaceName:t.name}):Object(R.a)("Are you sure you want to leave the room '%(roomName)s'?",{roomName:t.name}),a),button:Object(R.a)("Leave"),onFinished:t=>{t&&(Object(Re.a)(e),_.a.dispatch({action:H.a.AfterLeaveRoom,room_id:e}))}})}forgetRoom(e){const t=f.a.get().getRoom(e);f.a.get().forget(e).then((()=>{this.state.currentRoomId===e&&_.a.dispatch({action:H.a.ViewHomePage}),ee.c.instance.manualRoomUpdate(t,te.c.RoomRemoved)})).catch((e=>{const t=e.errcode||Object(R.c)("unknown error code");S.b.createDialog(K.a,{title:Object(R.a)("Failed to forget room %(errCode)s",{errCode:t}),description:e&&e.message?e.message:Object(R.a)("Operation failed")})}))}async copyRoom(e){const t=Object(Ee.h)(e);await Object(_e.b)(t)||S.b.createDialog(K.a,{title:Object(R.a)("Unable to copy room link"),description:Object(R.a)("Unable to copy a link to the room to the clipboard.")})}async startWelcomeUserChat(){let e;e=this.firstSyncComplete?Promise.resolve():this.firstSyncPromise.promise,await e;const t=new ke.a(this.props.config);if(0===A.a.shared().getDMRoomsForUserId(t.get("welcome_user_id")).length){const e=await Object(k.b)({dmUserId:t.get("welcome_user_id"),andView:!this.state.currentRoomId,spinner:!1}),a=e=>{e.getType()===c.EventType.Direct&&e.getContent()[t.get("welcome_user_id")]&&(f.a.get().store.save(!0),f.a.get().removeListener(c.ClientEvent.AccountData,a))};return f.a.get().on(c.ClientEvent.AccountData,a),e}return null}async onLoggedIn(){if(T.a.isLogin=!1,this.themeWatcher.recheck(),V.f(),!f.a.currentUserIsJustRegistered()||null!==I.b.getValue("FTUE.useCaseSelection"))return this.onShowPostLoginScreen();this.setStateForNewView({view:je.a.USE_CASE_SELECTION}),I.b.watchSetting("FTUE.useCaseSelection",null,((e,t,a,n,i)=>{null!==i&&this.state.view===je.a.USE_CASE_SELECTION&&this.onShowPostLoginScreen()}))}async onShowPostLoginScreen(e){if(e&&(we.a.instance.setProperty("ftueUseCaseSelection",e),I.b.setValue("FTUE.useCaseSelection",null,$.a.ACCOUNT,e)),this.setStateForNewView({view:je.a.LOGGED_IN}),this.screenAfterLogin&&this.screenAfterLogin.screen)this.showScreen(this.screenAfterLogin.screen,this.screenAfterLogin.params),this.screenAfterLogin=null;else if(f.a.currentUserIsJustRegistered()){f.a.setJustRegisteredUserId(null);if(new ke.a(this.props.config).get("welcome_user_id")&&Object(R.e)().startsWith("en")){null===await this.startWelcomeUserChat()&&_.a.dispatch({action:H.a.ViewHomePage,justRegistered:!0})}else if(Y.a.instance.pickBestInvite()){const e=Y.a.instance.pickBestInvite(),t=Y.a.instance.translateToWireFormat(e);this.showScreen(`room/${e.roomId}`,t)}else _.a.dispatch({action:H.a.ViewHomePage,justRegistered:!0})}else this.showScreenAfterLogin();E.b.get("mobile_guide_toast")&&Object(X.a)();const t=E.b.get("user_notice");if(t){const e="user_notice_"+t.title;t.show_once&&localStorage.getItem(e)||B.a.sharedInstance().addOrReplaceToast({key:e,title:t.title,props:{description:l.a.createElement(We.a,null,t.description),acceptLabel:Object(R.a)("OK"),onAccept:()=>{B.a.sharedInstance().dismissToast(e),localStorage.setItem(e,"1")}},component:Fe.a,className:"mx_AnalyticsToast",priority:100})}}initPosthogAnalyticsToast(){null===I.b.getValue("pseudonymousAnalyticsOptIn")&&Object(z.c)(),I.b.watchSetting("pseudonymousAnalyticsOptIn",null,((e,t,a,n,i)=>{null===i?Object(z.c)():Object(z.b)()}))}showScreenAfterLogin(){this.screenAfterLogin&&this.screenAfterLogin.screen?(this.showScreen(this.screenAfterLogin.screen,this.screenAfterLogin.params),this.screenAfterLogin=null):localStorage&&localStorage.getItem("mx_last_room_id")?this.viewLastRoom():f.a.get().isGuest()?_.a.dispatch({action:"view_welcome_page"}):_.a.dispatch({action:H.a.ViewHomePage})}viewLastRoom(){_.a.dispatch({action:H.a.ViewRoom,room_id:localStorage.getItem("mx_last_room_id"),metricsTrigger:void 0})}onLoggedOut(){this.viewLogin({ready:!1,collapseLhs:!1,currentRoomId:null}),this.subTitleStatus="",this.setPageSubtitle()}onSoftLogout(){this.notifyNewScreen("soft_logout"),this.setStateForNewView({view:je.a.SOFT_LOGOUT,ready:!1,collapseLhs:!1,currentRoomId:null}),this.subTitleStatus="",this.setPageSubtitle()}onWillStartClient(){this.firstSyncComplete=!1,this.firstSyncPromise=Object(u.m)();const e=f.a.get();e.setCanResetTimelineCallback((e=>(h.a.log("Request to reset timeline in room ",e," viewing:",this.state.currentRoomId),e!==this.state.currentRoomId||(!this.loggedInView.current||this.loggedInView.current.canResetTimelineInRoom(e))))),e.on(c.ClientEvent.Sync,((e,t,a)=>{e===d.b.Error||e===d.b.Reconnecting?(a.error instanceof m.c&&x.d(a.error),this.setState({syncError:a.error})):this.state.syncError&&this.setState({syncError:null}),e===d.b.Syncing&&t===d.b.Syncing||(h.a.info("MatrixClient sync state => %s",e),e===d.b.Prepared&&(this.firstSyncComplete=!0,this.firstSyncPromise.resolve(),w.default.shouldShowPrompt()&&!f.a.userRegisteredWithinLastHours(24)&&Object(G.b)(!1),_.a.fire(H.a.FocusSendMessageComposer),this.setState({ready:!0})))})),e.on(c.HttpApiEvent.SessionLoggedOut,(function(e){if(!x.f()){if(S.b.closeCurrentModal("Session.logged_out"),401===e.httpStatus&&e.data&&e.data.soft_logout)return h.a.warn("Soft logout issued by server - avoiding data deletion"),void x.l();S.b.createDialog(K.a,{title:Object(R.a)("Signed Out"),description:Object(R.a)("For security, this session has been signed out. Please sign in again.")}),_.a.dispatch({action:"logout"})}})),e.on(c.HttpApiEvent.NoConsent,(function(t,a){S.b.createDialog(ie.a,{title:Object(R.a)("Terms and Conditions"),description:l.a.createElement("div",null,l.a.createElement("p",null," ",Object(R.a)("To continue using the %(homeserverDomain)s homeserver you must review and agree to our terms and conditions.",{homeserverDomain:e.getDomain()}))),button:Object(R.a)("Review terms and conditions"),cancelButton:Object(R.a)("Dismiss"),onFinished:e=>{if(e){window.open(a,"_blank").opener=null}}},null,!0)}));const t=b.a.instance;t.start(),e.on(c.HttpApiEvent.SessionLoggedOut,(()=>t.stop())),e.on(c.MatrixEventEvent.Decrypted,((e,a)=>t.eventDecrypted(e,a))),e.on(c.ClientEvent.Room,(e=>{if(f.a.get().isCryptoEnabled()){const t=I.b.getValueAt($.a.ROOM_DEVICE,"blacklistUnverifiedDevices",e.roomId,!0);e.setBlacklistUnverifiedDevices(t)}})),e.on(g.b.Warning,(e=>{if("CRYPTO_WARNING_OLD_VERSION_DETECTED"===e)S.b.createDialog(K.a,{title:Object(R.a)("Old cryptography data detected"),description:Object(R.a)("Data from an older version of %(brand)s has been detected. This will have caused end-to-end cryptography to malfunction in the older version. End-to-end encrypted messages exchanged recently whilst using the older version may not be decryptable in this version. This may also cause messages exchanged with this version to fail. If you experience problems, log out and back in again. To retain message history, export and re-import your keys.",{brand:E.b.get().brand})})})),e.on(g.b.KeyBackupFailed,(async e=>{let t,n;if(f.a.get().getKeyBackupEnabled())t=!0;else try{n=await f.a.get().getKeyBackupVersion(),null!==n&&(t=!0)}catch(e){return void h.a.error("Saw key backup error but failed to check backup version!",e)}t?S.b.createDialogAsync(a.e(39).then(a.bind(null,1534)),{newVersionInfo:n}):S.b.createDialogAsync(a.e(40).then(a.bind(null,1535)))})),e.on(g.b.KeySignatureUploadFailure,((e,t,a)=>{S.b.createDialog(oe.a,{failures:e,source:t,continuation:a})})),e.on(g.b.VerificationRequest,(e=>{e.verifier?S.b.createDialog(le.a,{verifier:e.verifier},null,!1,!0):e.pending&&B.a.sharedInstance().addOrReplaceToast({key:"verifreq_"+e.channel.transactionId,title:Object(R.a)("Verification requested"),icon:"verification",props:{request:e},component:ve.a,priority:90})})),this.voiceBroadcastResumer=new Ue.z(e)}onClientStarted(){const e=f.a.get();if(e.isCryptoEnabled()){const t=I.b.getValueAt($.a.DEVICE,"blacklistUnverifiedDevices");e.setGlobalBlacklistUnverifiedDevices(t),e.setGlobalErrorOnUnknownDevices(!1)}we.a.instance.isEnabled()&&I.b.isLevelSupported($.a.ACCOUNT)&&this.initPosthogAnalyticsToast()}showScreen(e,t){const a=f.a.get();if(!a||a.isGuest()||!Ke.includes(e))if("register"===e)_.a.dispatch({action:"start_registration",params:t}),be.b.instance.start(be.a.REGISTER);else if("login"===e)_.a.dispatch({action:"start_login",params:t}),be.b.instance.start(be.a.LOGIN);else if("forgot_password"===e)_.a.dispatch({action:"start_password_recovery",params:t});else if("soft_logout"===e)a.getUserId()&&!x.g()?this.viewLastRoom():_.a.dispatch({action:"start_login",params:t});else if("new"===e)_.a.dispatch({action:"view_create_room"});else if("dm"===e)_.a.dispatch({action:"view_create_chat"});else if("settings"===e)_.a.fire(H.a.ViewUserSettings);else if("welcome"===e)_.a.dispatch({action:"view_welcome_page"});else if("home"===e)_.a.dispatch({action:H.a.ViewHomePage});else if("start"===e)this.showScreen("home"),_.a.dispatch({action:"require_registration"});else if("directory"===e)_.a.fire(H.a.ViewRoomDirectory);else if("start_sso"===e||"start_cas"===e){let t=f.a.get();if(!t){const{hsUrl:e,isUrl:a}=this.props.serverConfig;t=Object(c.createClient)({baseUrl:e,idBaseUrl:a})}const a="start_sso"===e?"sso":"cas";y.a.get().startSingleSignOn(t,a,this.getFragmentAfterLogin())}else if(0===e.indexOf("room/")){var n,i,s;const a=e.substring(5),r=a.indexOf(":")+1;let o=a.length;a.substring(r).indexOf("/")>-1&&(o=r+a.substring(r).indexOf("/"));const l=a.substring(0,o);let c,d=a.substring(o+1);if(d||(d=void 0),t.signurl&&t.email&&(c=Y.a.instance.storeInvite(l,t)),!c){c=Y.a.instance.getInvites().find((e=>e.roomId===l))}let m=[];t.via&&(m="string"==typeof t.via?[t.via]:t.via);const u={action:H.a.ViewRoom,event_id:d,via_servers:m,highlighted:Boolean(d),threepid_invite:c,oob_data:{name:null===(n=c)||void 0===n?void 0:n.roomName,avatarUrl:null===(i=c)||void 0===i?void 0:i.roomAvatarUrl,inviterName:null===(s=c)||void 0===s?void 0:s.inviterName},room_alias:void 0,room_id:void 0,metricsTrigger:void 0};"#"===l[0]?u.room_alias=l:u.room_id=l,_.a.dispatch(u)}else if(0===e.indexOf("user/")){const a=e.substring(5);_.a.dispatch({action:"view_user_info",userId:a,subAction:t.action})}else h.a.info("Ignoring showScreen for '%s'",e);else _.a.dispatch({action:H.a.ViewHomePage})}notifyNewScreen(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.props.onNewScreen&&this.props.onNewScreen(e,t),this.setPageSubtitle()}onLogoutClick(e){_.a.dispatch({action:"logout"}),e.stopPropagation(),e.preventDefault()}dispatchTimelineResize(){_.a.dispatch({action:"timeline_resize"})}onRegistered(e){return x.k(e)}onSendEvent(e,t){const a=f.a.get();a&&a.sendEvent(e,t.getType(),t.getContent()).then((()=>{_.a.dispatch({action:"message_sent"})}))}setPageSubtitle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this.state.currentRoomId){const t=f.a.get(),a=t&&t.getRoom(this.state.currentRoomId);a&&(e=`${this.subTitleStatus} | ${a.name} ${e}`)}else e=`${this.subTitleStatus} ${e}`;const t=`${E.b.get().brand} ${e}`;document.title!==t&&(document.title=t)}getFragmentAfterLogin(){let e="";const t=this.props.initialScreenAfterLogin;return t&&!["welcome","login","register","start_sso","start_cas"].includes(t.screen)&&(e=`/${t.screen}`),e}render(){const e=this.getFragmentAfterLogin();let t;if(this.state.view===je.a.LOADING)t=l.a.createElement("div",{className:"mx_MatrixChat_splash"},l.a.createElement(ne.a,null));else if(this.state.view===je.a.COMPLETE_SECURITY)t=l.a.createElement(ce.a,{onFinished:this.onCompleteSecurityE2eSetupFinished});else if(this.state.view===je.a.E2E_SETUP)t=l.a.createElement(ue.a,{onFinished:this.onCompleteSecurityE2eSetupFinished,accountPassword:this.stores.accountPasswordStore.getPassword(),tokenLogin:!!this.tokenLogin});else if(this.state.view===je.a.LOGGED_IN){const e=this.state.syncError&&this.state.syncError instanceof m.c;if(this.state.ready&&this.state.page_type&&!e)t=l.a.createElement(W.a,i()({},this.props,this.state,{ref:this.loggedInView,matrixClient:f.a.get(),onRegistered:this.onRegistered,currentRoomId:this.state.currentRoomId}));else{let a;this.state.syncError&&!e&&(a=l.a.createElement("div",{className:"mx_MatrixChat_syncError"},Object(P.b)(this.state.syncError))),t=l.a.createElement("div",{className:"mx_MatrixChat_splash"},a,l.a.createElement(ne.a,null),l.a.createElement("div",{className:"mx_MatrixChat_splashButtons"},l.a.createElement(xe.a,{kind:"link_inline",onClick:this.onLogoutClick},Object(R.a)("Logout"))))}}else if(this.state.view===je.a.WELCOME)t=l.a.createElement(de.a,null);else if(this.state.view===je.a.REGISTER&&I.b.getValue(J.b.Registration)){var a;const n=null===(a=Y.a.instance.pickBestInvite())||void 0===a?void 0:a.toEmail;t=l.a.createElement(he.a,i()({clientSecret:this.state.register_client_secret,sessionId:this.state.register_session_id,idSid:this.state.register_id_sid,email:n,brand:this.props.config.brand,makeRegistrationUrl:this.makeRegistrationUrl,onLoggedIn:this.onRegisterFlowComplete,onLoginClick:this.onLoginClick,onServerConfigChange:this.onServerConfigChange,defaultDeviceDisplayName:this.props.defaultDeviceDisplayName,fragmentAfterLogin:e},this.getServerProperties()))}else if(this.state.view===je.a.FORGOT_PASSWORD&&I.b.getValue(J.b.PasswordReset))t=l.a.createElement(me.a,i()({onComplete:this.onLoginClick,onLoginClick:this.onLoginClick},this.getServerProperties()));else if(this.state.view===je.a.LOGIN){const a=I.b.getValue(J.b.PasswordReset);t=l.a.createElement(pe.a,i()({isSyncing:this.state.pendingInitialSync,onLoggedIn:this.onUserCompletedLoginFlow,onRegisterClick:this.onRegisterClick,fallbackHsUrl:this.getFallbackHsUrl(),defaultDeviceDisplayName:this.props.defaultDeviceDisplayName,onForgotPasswordClick:a?this.onForgotPasswordClick:void 0,onServerConfigChange:this.onServerConfigChange,fragmentAfterLogin:e,defaultUsername:this.props.startingFragmentQueryParams.defaultUsername},this.getServerProperties()))}else if(this.state.view===je.a.SOFT_LOGOUT)t=l.a.createElement(ye.a,{realQueryParams:this.props.realQueryParams,onTokenLoginCompleted:this.props.onTokenLoginCompleted,fragmentAfterLogin:e});else{if(this.state.view!==je.a.USE_CASE_SELECTION)return h.a.error(`Unknown view ${this.state.view}`),null;t=l.a.createElement(De.a,{onFinished:e=>this.onShowPostLoginScreen(e)})}return l.a.createElement(ge.a,null,l.a.createElement(Ae.a.Provider,{value:this.stores},t))}}r()($e,"displayName","MatrixChat"),r()($e,"defaultProps",{realQueryParams:{},startingFragmentQueryParams:{},config:{},onTokenLoginCompleted:()=>{}})}).call(this,a(14))},1437:function(e,t,a){!function(){"use strict";function e(e){var t=!0,a=!1,n=null,i={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function r(e){var t=e.type,a=e.tagName;return!("INPUT"!==a||!i[t]||e.readOnly)||"TEXTAREA"===a&&!e.readOnly||!!e.isContentEditable}function o(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(a){a.metaKey||a.altKey||a.ctrlKey||(s(e.activeElement)&&o(e.activeElement),t=!0)}function d(e){t=!1}function m(e){s(e.target)&&(t||r(e.target))&&o(e.target)}function u(e){s(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(a=!0,window.clearTimeout(n),n=window.setTimeout((function(){a=!1}),100),l(e.target))}function h(e){"hidden"===document.visibilityState&&(a&&(t=!0),p())}function p(){document.addEventListener("mousemove",v),document.addEventListener("mousedown",v),document.addEventListener("mouseup",v),document.addEventListener("pointermove",v),document.addEventListener("pointerdown",v),document.addEventListener("pointerup",v),document.addEventListener("touchmove",v),document.addEventListener("touchstart",v),document.addEventListener("touchend",v)}function g(){document.removeEventListener("mousemove",v),document.removeEventListener("mousedown",v),document.removeEventListener("mouseup",v),document.removeEventListener("pointermove",v),document.removeEventListener("pointerdown",v),document.removeEventListener("pointerup",v),document.removeEventListener("touchmove",v),document.removeEventListener("touchstart",v),document.removeEventListener("touchend",v)}function v(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,g())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",d,!0),document.addEventListener("pointerdown",d,!0),document.addEventListener("touchstart",d,!0),document.addEventListener("visibilitychange",h,!0),p(),e.addEventListener("focus",m,!0),e.addEventListener("blur",u,!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}()},1438:function(e,t,a){var n;n=function(){return function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}return a.m=e,a.c=t,a.p="",a(0)}([function(e,t){"use strict";e.exports=function(){if("undefined"==typeof document||"undefined"==typeof window)return{ask:function(){return"initial"},element:function(){return null},ignoreKeys:function(){},specificKeys:function(){},registerOnChange:function(){},unRegisterOnChange:function(){}};var e=document.documentElement,t=null,a="initial",n=a,i=Date.now(),s=!1,r=["button","input","select","textarea"],o=[],l=[16,17,18,91,93],c=[],d={keydown:"keyboard",keyup:"keyboard",mousedown:"mouse",mousemove:"mouse",MSPointerDown:"pointer",MSPointerMove:"pointer",pointerdown:"pointer",pointermove:"pointer",touchstart:"touch",touchend:"touch"},m=!1,u={x:null,y:null},h={2:"touch",3:"touch",4:"mouse"},p=!1;try{var g=Object.defineProperty({},"passive",{get:function(){p=!0}});window.addEventListener("test",null,g)}catch(e){}var v=function(){var e=!p||{passive:!0,capture:!0};document.addEventListener("DOMContentLoaded",b,!0),window.PointerEvent?(window.addEventListener("pointerdown",f,!0),window.addEventListener("pointermove",E,!0)):window.MSPointerEvent?(window.addEventListener("MSPointerDown",f,!0),window.addEventListener("MSPointerMove",E,!0)):(window.addEventListener("mousedown",f,!0),window.addEventListener("mousemove",E,!0),"ontouchstart"in window&&(window.addEventListener("touchstart",f,e),window.addEventListener("touchend",f,!0))),window.addEventListener(x(),E,e),window.addEventListener("keydown",f,!0),window.addEventListener("keyup",f,!0),window.addEventListener("focusin",_,!0),window.addEventListener("focusout",w,!0)},b=function(){if(s=!("false"===e.getAttribute("data-whatpersist")||"false"===document.body.getAttribute("data-whatpersist")))try{window.sessionStorage.getItem("what-input")&&(a=window.sessionStorage.getItem("what-input")),window.sessionStorage.getItem("what-intent")&&(n=window.sessionStorage.getItem("what-intent"))}catch(e){}y("input"),y("intent")},f=function(e){var t=e.which,i=d[e.type];"pointer"===i&&(i=O(e));var s=!c.length&&-1===l.indexOf(t),o=c.length&&-1!==c.indexOf(t),m="keyboard"===i&&t&&(s||o)||"mouse"===i||"touch"===i;if(C(i)&&(m=!1),m&&a!==i&&(S("input",a=i),y("input")),m&&n!==i){var u=document.activeElement;u&&u.nodeName&&(-1===r.indexOf(u.nodeName.toLowerCase())||"button"===u.nodeName.toLowerCase()&&!R(u,"form"))&&(S("intent",n=i),y("intent"))}},y=function(t){e.setAttribute("data-what"+t,"input"===t?a:n),j(t)},E=function(e){var t=d[e.type];"pointer"===t&&(t=O(e)),k(e),(!m&&!C(t)||m&&"wheel"===e.type||"mousewheel"===e.type||"DOMMouseScroll"===e.type)&&n!==t&&(S("intent",n=t),y("intent"))},_=function(a){a.target.nodeName?(t=a.target.nodeName.toLowerCase(),e.setAttribute("data-whatelement",t),a.target.classList&&a.target.classList.length&&e.setAttribute("data-whatclasses",a.target.classList.toString().replace(" ",","))):w()},w=function(){t=null,e.removeAttribute("data-whatelement"),e.removeAttribute("data-whatclasses")},S=function(e,t){if(s)try{window.sessionStorage.setItem("what-"+e,t)}catch(e){}},O=function(e){return"number"==typeof e.pointerType?h[e.pointerType]:"pen"===e.pointerType?"touch":e.pointerType},C=function(e){var t=Date.now(),n="mouse"===e&&"touch"===a&&t-i<200;return i=t,n},x=function(){return"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"},j=function(e){for(var t=0,i=o.length;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,l=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){l=!0,r=e},f:function(){try{o||null==a.return||a.return()}finally{if(l)throw r}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a1&&void 0!==arguments[1]?arguments[1]:{withProps:!1};return e=e.filter((function(e){return!!e})),{getInitialState:function(){return this.constructor.calculateState||r(!1),t.withProps?this.constructor.calculateState(null,this.props):this.constructor.calculateState(null,void 0)},componentWillMount:function(){var a=this,n=!1,i=function(){n=!0};this._fluxMixinSubscriptions=e.map((function(e){return e.addListener(i)}));this._fluxMixinStoreGroup=new s(e,(function(){n&&a.setState((function(e){return t.withProps?a.constructor.calculateState(e,a.props):a.constructor.calculateState(e,void 0)})),n=!1}))},componentWillUnmount:function(){this._fluxMixinStoreGroup.release();var e,t=n(this._fluxMixinSubscriptions);try{for(t.s();!(e=t.n()).done;){e.value.remove()}}catch(e){t.e(e)}finally{t.f()}this._fluxMixinSubscriptions=[]}}}},1445:function(e,t,a){"use strict";function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var i=a(878),s=a(1451),r=a(253),o=function(e){var t,a;function i(t){var a,n,i,s;return a=e.call(this,t)||this,n=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(a),s=void 0,(i="_state")in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,a._state=a.getInitialState(),a}a=e,(t=i).prototype=Object.create(a.prototype),t.prototype.constructor=t,n(t,a);var o=i.prototype;return o.getState=function(){return this._state},o.getInitialState=function(){return s("FluxReduceStore","getInitialState")},o.reduce=function(e,t){return s("FluxReduceStore","reduce")},o.areEqual=function(e,t){return e===t},o.__invokeOnDispatch=function(e){this.__changed=!1;var t=this._state,a=this.reduce(t,e);void 0===a&&r(!1),this.areEqual(t,a)||(this._state=a,this.__emitChange()),this.__changed&&this.__emitter.emit(this.__changeEvent)},i}(i);e.exports=o},1446:function(e,t,a){var n={EventEmitter:a(1447),EmitterSubscription:a(879)};e.exports=n},1447:function(e,t,a){"use strict";var n=a(879),i=a(1449),s=a(253),r=a(1450),o=function(){function e(){this._subscriber=new i,this._currentSubscription=null}var t=e.prototype;return t.addListener=function(e,t,a){return this._subscriber.addSubscription(e,new n(this._subscriber,t,a))},t.once=function(e,t,a){var n=this;return this.addListener(e,(function(){n.removeCurrentListener(),t.apply(a,arguments)}))},t.removeAllListeners=function(e){this._subscriber.removeAllSubscriptions(e)},t.removeCurrentListener=function(){this._currentSubscription||s(!1),this._subscriber.removeSubscription(this._currentSubscription)},t.listeners=function(e){var t=this._subscriber.getSubscriptionsForType(e);return t?t.filter(r.thatReturnsTrue).map((function(e){return e.listener})):[]},t.emit=function(e){var t=this._subscriber.getSubscriptionsForType(e);if(t){for(var a=Object.keys(t),n=0;n6e4&&(await this.updateState({lastRageshakeTime:n}),await Object(l.a)(o.b.get().bug_report_endpoint_url,{userText:`Auto-reporting decryption error (sender)\nRecipient rageshake: ${a}`,sendLogs:!0,labels:["Z-UISI","web","uisi-sender"],customApp:o.b.get().uisi_autorageshake_app,customFields:{recipient_rageshake:a,auto_uisi:JSON.stringify(t)}}))}async onReportKeyBackupNotEnabled(){m.b.getValue("automaticKeyBackNotEnabledReporting")&&await Object(l.a)(o.b.get().bug_report_endpoint_url,{userText:"Auto-reporting key backup not enabled",sendLogs:!0,labels:["web",u.a.ReportKeyBackupNotEnabled]})}}i()(v,"internalInstance",(()=>{const e=new v;return e.start(),e})()),window.mxAutoRageshakeStore=v.instance},1453:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(13),i=a.n(n),s=a(17),r=a(149);class o extends s.EventEmitter{constructor(){super(...arguments),i()(this,"_isResizing",!1),i()(this,"throttledMiddlePanel",Object(r.throttle)((()=>this.emit("middlePanelResized")),200))}get isResizing(){return this._isResizing}startResizing(){this._isResizing=!0,this.emit("isResizing",!0)}stopResizing(){this._isResizing=!1,this.emit("isResizing",!1)}noisyMiddlePanel(){this.emit("middlePanelResizedNoisy")}updateMiddlePanel(){this.throttledMiddlePanel(),this.noisyMiddlePanel()}notifyLeftHandleResized(){this.updateMiddlePanel()}notifyRightHandleResized(){this.updateMiddlePanel()}notifyTimelineHeightChanged(){this.updateMiddlePanel()}notifyWindowResized(){this.updateMiddlePanel()}}},1454:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));var n=a(120);const i=100;function s(e,t,a){Object(n.useEffect)((()=>{let n=null;const s=()=>{n=null,t(...a)};if(!1!==e)return n=window.setTimeout(s,i),()=>{n&&clearTimeout(n)}}),[e,t,a])}},1455:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(120),i=a(122),s=a(137),r=a(125),o=a(146);const l=()=>{const[e,t]=Object(n.useState)((()=>{const e=i.a.get(),t=r.b.getValue("SpotlightSearch.recentSearches",null);return Object(o.n)(t.map((t=>e.getRoom(t))))}));return[e,()=>{r.b.setValue("SpotlightSearch.recentSearches",null,s.a.ACCOUNT,[]),t([])}]}},1456:function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(120),i=a(122),s=a(627);const r=()=>{const[e,t]=Object(n.useState)(null),[a,r]=Object(n.useState)(!1),[o,l]=Object(s.a)(t);return{ready:!0,loading:a,profile:e,search:Object(n.useCallback)((async e=>{let{query:a}=e;if(o(a),null==a||!a.length||!a.startsWith("@")||!a.includes(":"))return t(null),!0;r(!0);try{const e=await i.a.get().getProfileInfo(a);return l(a,{user_id:a,avatar_url:e.avatar_url,display_name:e.displayname}),!0}catch(e){return console.error("Could not fetch profile info for params",{term:a},e),l(a,null),!1}finally{r(!1)}}),[o,l])}}},1457:function(e,t,a){"use strict";a.d(t,"a",(function(){return g}));var n=a(120),i=a(122),s=a(131),r=a(125),o=a(627),l=a(167);const c="ALL_ROOMS",d="mx_last_room_directory_server",m="mx_last_room_directory_instance";let u;const h="nsfw",p=e=>{var t,a;return!(null!==(t=e.name)&&void 0!==t&&t.toLocaleLowerCase().includes(h)||null!==(a=e.topic)&&void 0!==a&&a.toLocaleLowerCase().includes(h))},g=()=>{const[e,t]=Object(n.useState)([]),[a,h]=Object(n.useState)(void 0),[g,v]=Object(n.useState)(null),[b,f]=Object(n.useState)(!1),[y,E]=Object(n.useState)(!1),[_,w]=Object(o.a)(t),S=Object(l.b)("SpotlightSearch.showNsfwPublicRooms");const O=Object(n.useCallback)((async e=>{let{limit:t=20,query:n,roomTypes:s}=e;const r={limit:t};(null==a?void 0:a.roomServer)!=i.a.getHomeserverName()&&(r.server=null==a?void 0:a.roomServer),(null==a?void 0:a.instanceId)===c?r.include_all_networks=!0:null!=a&&a.instanceId&&(r.third_party_instance_id=a.instanceId),(n||s)&&(r.filter={generic_search_term:n,room_types:await i.a.get().doesServerSupportUnstableFeature("org.matrix.msc3827.stable")?Array.from(s):void 0}),_(r);try{E(!0);const{chunk:e}=await i.a.get().publicRooms(r);return w(r,S?e:e.filter(p)),!0}catch(e){return console.error("Could not fetch public rooms for params",r,e),w(r,[]),!1}finally{E(!1)}}),[a,_,w,S]);return Object(n.useEffect)((()=>{!async function(){if(i.a.get())if(u)v(u);else{const e=await i.a.get().getThirdpartyProtocols();u=e,v(e)}else f(!0)}()}),[]),Object(n.useEffect)((()=>{var e,t,a,n;if(null===g)return;const o=i.a.getHomeserverName(),l=localStorage.getItem(d),u=null!==(e=localStorage.getItem(m))&&void 0!==e?e:void 0;let p,v=o;(null!==(t=s.b.getObject("room_directory"))&&void 0!==t&&null!==(a=t.get("servers"))&&void 0!==a&&a.includes(l)||null!==(n=r.b.getValue("room_directory_servers"))&&void 0!==n&&n.includes(l))&&(v=l),v!==o||u!==c&&!Object.values(g).some((e=>{e.instances.some((e=>e.instance_id===u))}))||(p=u),f(!0),h({roomServer:v,instanceId:p})}),[g]),Object(n.useEffect)((()=>{localStorage.setItem(d,null==a?void 0:a.roomServer),null!=a&&a.instanceId?localStorage.setItem(m,null==a?void 0:a.instanceId):localStorage.removeItem(m)}),[a]),{ready:b,loading:y,publicRooms:e,protocols:g,config:a,search:O,setConfig:function(e){if(!b)throw new Error("public room configuration not initialised yet");h(e)}}}},1458:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(120),i=a(136),s=a(882),r=a(16),o=a(122);const l=(e,t)=>{var a;const[l,c]=Object(n.useState)([]),[d,m]=Object(n.useState)(),u=Object(n.useCallback)((()=>{m(e?new s.a(e,50):null)}),[e]);Object(n.useEffect)(u,[u]),Object(n.useEffect)((()=>{if(!e||!d)return;let t=!1;return(async()=>{for(;null!=d&&d.canLoadMore&&!t&&e===d.root;)await d.load(),d.canLoadMore&&d.load(),c(d.rooms)})(),()=>{t=!0}}),[e,d]);return[Object(n.useMemo)((()=>{const e=t.trim(),a=e.toLowerCase(),n=Object(r.B)(e),s=o.a.get();return null==l?void 0:l.filter((e=>{var t;return e.room_type!==i.RoomType.Space&&"join"!==(null===(t=s.getRoom(e.room_id))||void 0===t?void 0:t.getMyMembership())&&(Object(r.B)(e.name||"").includes(n)||(e.canonical_alias||"").includes(a))}))}),[l,t]),null!==(a=null==d?void 0:d.loading)&&void 0!==a&&a]}},1459:function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var n=a(120),i=a(122),s=a(405),r=a(627);const o=()=>{const[e,t]=Object(n.useState)([]),[a,o]=Object(n.useState)(!1),[l,c]=Object(r.a)(t);return{ready:!0,loading:a,users:e,search:Object(n.useCallback)((async e=>{let{limit:a=20,query:n}=e;const r={limit:a,term:n};if(l(r),null==n||!n.length)return t([]),!0;try{o(!0);const{results:e}=await i.a.get().searchUserDirectory(r);return c(r,e.map((e=>new s.a(e)))),!0}catch(e){return console.error("Could not fetch user in user directory for params",{limit:a,term:n},e),c(r,[]),!1}finally{o(!1)}}),[l,c])}}},1460:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(130),i=a.n(n),s=a(132),r=a.n(s),o=a(126),l=a.n(o),c=a(120),d=a.n(c),m=a(169),u=a(123);const h=["inputRef","children","endAdornment","className"],p=e=>{let{inputRef:t,children:a,endAdornment:n,className:s}=e,o=r()(e,h);const[c,p,g]=Object(m.i)(t);return d.a.createElement(u.a,i()({},o,{className:l()(s,"mx_SpotlightDialog_option"),onFocus:c,inputRef:g,tabIndex:-1,"aria-selected":p,role:"option"}),a,d.a.createElement("div",{className:"mx_SpotlightDialog_option--endAdornment"},d.a.createElement("kbd",{className:"mx_SpotlightDialog_enterPrompt","aria-hidden":!0},"↵"),n))}},1461:function(e,t,a){"use strict";a.d(t,"a",(function(){return d}));var n=a(120),i=a.n(n),s=a(196),r=a(121),o=a(285);const l=80,c=800;function d(e){var t,a,n;let{room:d,labelId:m,descriptionId:u,detailsId:h}=e,p=d.name||Object(o.a)(null!==(t=d.canonical_alias)&&void 0!==t?t:"",null!==(a=d.aliases)&&void 0!==a?a:[])||Object(r.a)("Unnamed room");p.length>l&&(p=`${p.substring(0,l)}...`);let g=d.topic||"";return g.length>c&&(g=`${g.substring(0,c)}...`),i.a.createElement("div",{className:"mx_SpotlightDialog_result_publicRoomDetails"},i.a.createElement("div",{className:"mx_SpotlightDialog_result_publicRoomHeader"},i.a.createElement("span",{id:m,className:"mx_SpotlightDialog_result_publicRoomName"},p),i.a.createElement("span",{id:u,className:"mx_SpotlightDialog_result_publicRoomAlias"},null!==(n=d.canonical_alias)&&void 0!==n?n:d.room_id)),i.a.createElement("div",{id:h,className:"mx_SpotlightDialog_result_publicRoomDescription"},i.a.createElement("span",{className:"mx_SpotlightDialog_result_publicRoomMemberCount"},Object(r.a)("%(count)s Members",{count:d.num_joined_members})),g&&i.a.createElement(i.a.Fragment,null," · ",i.a.createElement("span",{className:"mx_SpotlightDialog_result_publicRoomTopic",dangerouslySetInnerHTML:{__html:Object(s.g)(g)}}))))}},1462:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var n=a(130),i=a.n(n),s=a(126),r=a.n(s),o=a(120),l=a.n(o),c=a(328),d=a(591),m=a(121),u=a(264),h=a(819),p=a(818),g=a(629),v=a(450);function b(e){let{room:t}=e;const[a]=Object(d.a)(t),[n,s]=Object(o.useState)(null),[b,f]=Object(o.useState)(null);let y,E;null!==n&&(y=t.isSpaceRoom()?l.a.createElement(g.a,i()({},Object(v.a)(n),{space:t,onFinished:()=>s(null)})):l.a.createElement(h.a,i()({},Object(v.a)(n),{room:t,onFinished:()=>s(null)}))),null!==b&&(E=l.a.createElement(p.a,i()({},Object(v.a)(b),{room:t,onFinished:()=>f(null)})));const _=r()("mx_SpotlightDialog_option--notifications",{mx_RoomNotificationContextMenu_iconBell:a===u.a.AllMessages,mx_RoomNotificationContextMenu_iconBellDot:a===u.a.AllMessagesLoud,mx_RoomNotificationContextMenu_iconBellMentions:a===u.a.MentionsOnly,mx_RoomNotificationContextMenu_iconBellCrossed:a===u.a.Mute});return l.a.createElement(o.Fragment,null,l.a.createElement(c.a,{className:"mx_SpotlightDialog_option--menu",onClick:e=>{e.preventDefault(),e.stopPropagation();const t=e.target;s(t.getBoundingClientRect())},title:t.isSpaceRoom()?Object(m.a)("Space options"):Object(m.a)("Room options"),isExpanded:null!==n}),!t.isSpaceRoom()&&l.a.createElement(c.a,{className:_,onClick:e=>{e.preventDefault(),e.stopPropagation();const t=e.target;f(t.getBoundingClientRect())},title:Object(m.a)("Notification options"),isExpanded:null!==b}),y,E)}},1463:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(130),i=a.n(n),s=a(132),r=a.n(s),o=a(126),l=a.n(o),c=a(120),d=a.n(c),m=a(169),u=a(148);const h=["inputRef","className"],p=e=>{let{inputRef:t,className:a}=e,n=r()(e,h);const[s,o,c]=Object(m.i)(t);return d.a.createElement(u.a,i()({},n,{className:l()(a,"mx_SpotlightDialog_option"),onFocus:s,inputRef:c,tabIndex:-1,"aria-selected":o,role:"option"}))}},1464:function(e,t,a){"use strict";a.r(t),a.d(t,"Icon",(function(){return r}));var n,i=a(120);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}r(t,e);var a=t.prototype;return a.componentDidMount=function(){this.unbind=O(window,[{eventName:"error",fn:this.onWindowError}])},a.componentDidCatch=function(e){if(!(e instanceof j))throw e;this.setState({})},a.componentWillUnmount=function(){this.unbind()},a.render=function(){return this.props.children(this.setCallbacks)},t}(s.Component),I=function(e){return e+1},T=function(e,t){var a=e.droppableId===t.droppableId,n=I(e.index),i=I(t.index);return a?"\n You have moved the item from position "+n+"\n to position "+i+"\n ":"\n You have moved the item from position "+n+"\n in list "+e.droppableId+"\n to list "+t.droppableId+"\n in position "+i+"\n "},N=function(e,t,a){return t.droppableId===a.droppableId?"\n The item "+e+"\n has been combined with "+a.draggableId:"\n The item "+e+"\n in list "+t.droppableId+"\n has been combined with "+a.draggableId+"\n in list "+a.droppableId+"\n "},P=function(e){return"\n The item has returned to its starting position\n of "+I(e.index)+"\n"},D={dragHandleUsageInstructions:"\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:function(e){return"\n You have lifted an item in position "+I(e.source.index)+"\n"},onDragUpdate:function(e){var t=e.destination;if(t)return T(e.source,t);var a=e.combine;return a?N(e.draggableId,e.source,a):"You are over an area that cannot be dropped on"},onDragEnd:function(e){if("CANCEL"===e.reason)return"\n Movement cancelled.\n "+P(e.source)+"\n ";var t=e.destination,a=e.combine;return t?"\n You have dropped the item.\n "+T(e.source,t)+"\n ":a?"\n You have dropped the item.\n "+N(e.draggableId,e.source,a)+"\n ":"\n The item has been dropped while not over a drop area.\n "+P(e.source)+"\n "}},M={x:0,y:0},A=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},L=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},U=function(e,t){return e.x===t.x&&e.y===t.y},F=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},B=function(e,t,a){var n;return void 0===a&&(a=0),(n={})[e]=t,n["x"===e?"y":"x"]=a,n},V=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},W=function(e,t){return Math.min.apply(Math,t.map((function(t){return V(e,t)})))},H=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},z=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},G=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}]},K=function(e,t){return t&&t.shouldClipSubject?function(e,t){var a=m.getRect({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return a.width<=0||a.height<=0?null:a}(t.pageMarginBox,e):m.getRect(e)},q=function(e){var t=e.page,a=e.withPlaceholder,n=e.axis,i=e.frame,s=function(e,t){return t?z(e,t.scroll.diff.displacement):e}(t.marginBox,i),r=function(e,t,a){var n;return a&&a.increasedBy?o({},e,((n={})[t.end]=e[t.end]+a.increasedBy[t.line],n)):e}(s,n,a);return{page:t,withPlaceholder:a,active:K(r,i)}},$=function(e,t){e.frame||k(!1);var a=e.frame,n=L(t,a.scroll.initial),i=F(n),s=o({},a,{scroll:{initial:a.scroll.initial,current:t,diff:{value:n,displacement:i},max:a.scroll.max}}),r=q({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:s});return o({},e,{frame:s,subject:r})};function Y(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function J(e,t){if(e.findIndex)return e.findIndex(t);for(var a=0;ae.bottom,o=n.lefte.right;return!(!r||!o)||(r&&s||o&&i)}},he=function(e){var t=me(e.top,e.bottom),a=me(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&a(e.left)&&a(e.right)}},pe={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},ge={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},ve=function(e){var t=e.target,a=e.destination,n=e.viewport,i=e.withDroppableDisplacement,s=e.isVisibleThroughFrameFn,r=i?function(e,t){var a=t.frame?t.frame.scroll.diff.displacement:M;return z(e,a)}(t,a):t;return function(e,t,a){return!!t.subject.active&&a(t.subject.active)(e)}(r,a,s)&&function(e,t,a){return a(t)(e)}(r,n,s)},be=function(e){return ve(o({},e,{isVisibleThroughFrameFn:ue}))},fe=function(e){return ve(o({},e,{isVisibleThroughFrameFn:he}))},ye=function(e,t,a){if("boolean"==typeof a)return a;if(!t)return!0;var n=t.invisible,i=t.visible;if(n[e])return!1;var s=i[e];return!s||s.shouldAnimate};function Ee(e){var t=e.afterDragging,a=e.destination,n=e.displacedBy,i=e.viewport,s=e.forceShouldAnimate,r=e.last;return t.reduce((function(e,t){var o=function(e,t){var a=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return m.getRect(m.expand(a,n))}(t,n),l=t.descriptor.id;if(e.all.push(l),!be({target:o,destination:a,viewport:i,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:l,shouldAnimate:ye(l,r,s)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function _e(e){var t=e.insideDestination,a=e.inHomeList,n=e.displacedBy,i=e.destination,s=function(e,t){if(!e.length)return 0;var a=e[e.length-1].descriptor.index;return t.inHomeList?a:a+1}(t,{inHomeList:a});return{displaced:ce,displacedBy:n,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:s}}}}function we(e){var t=e.draggable,a=e.insideDestination,n=e.destination,i=e.viewport,s=e.displacedBy,r=e.last,o=e.index,l=e.forceShouldAnimate,c=oe(t,n);if(null==o)return _e({insideDestination:a,inHomeList:c,displacedBy:s,destination:n});var d=Q(a,(function(e){return e.descriptor.index===o}));if(!d)return _e({insideDestination:a,inHomeList:c,displacedBy:s,destination:n});var m=re(t,a),u=a.indexOf(d);return{displaced:Ee({afterDragging:m.slice(u),destination:n,displacedBy:s,last:r,viewport:i.frame,forceShouldAnimate:l}),displacedBy:s,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:o}}}}function Se(e,t){return Boolean(t.effected[e])}var Oe=function(e){var t=e.isMovingForward,a=e.isInHomeList,n=e.draggable,i=e.draggables,s=e.destination,r=e.insideDestination,o=e.previousImpact,l=e.viewport,c=e.afterCritical,d=o.at;if(d||k(!1),"REORDER"===d.type){var m=function(e){var t=e.isMovingForward,a=e.isInHomeList,n=e.insideDestination,i=e.location;if(!n.length)return null;var s=i.index,r=t?s+1:s-1,o=n[0].descriptor.index,l=n[n.length-1].descriptor.index;return r(a?l:l+1)?null:r}({isMovingForward:t,isInHomeList:a,location:d.destination,insideDestination:r});return null==m?null:we({draggable:n,insideDestination:r,destination:s,viewport:l,last:o.displaced,displacedBy:o.displacedBy,index:m})}var u=function(e){var t=e.isMovingForward,a=e.destination,n=e.draggables,i=e.combine,s=e.afterCritical;if(!a.isCombineEnabled)return null;var r=i.draggableId,o=n[r].descriptor.index;return Se(r,s)?t?o:o-1:t?o+1:o}({isMovingForward:t,destination:s,displaced:o.displaced,draggables:i,combine:d.combine,afterCritical:c});return null==u?null:we({draggable:n,insideDestination:r,destination:s,viewport:l,last:o.displaced,displacedBy:o.displacedBy,index:u})},Ce=function(e){var t=e.afterCritical,a=e.impact,n=e.draggables,i=se(a);i||k(!1);var s=i.draggableId,r=n[s].page.borderBox.center,o=function(e){var t=e.displaced,a=e.afterCritical,n=e.combineWith,i=e.displacedBy,s=Boolean(t.visible[n]||t.invisible[n]);return Se(n,a)?s?M:F(i.point):s?i.point:M}({displaced:a.displaced,afterCritical:t,combineWith:s,displacedBy:a.displacedBy});return A(r,o)},xe=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},je=function(e,t,a){return t[e.crossAxisStart]+a.margin[e.crossAxisStart]+a.borderBox[e.crossAxisSize]/2},ke=function(e){var t=e.axis,a=e.moveRelativeTo,n=e.isMoving;return B(t.line,a.marginBox[t.end]+xe(t,n),je(t,a.marginBox,n))},Re=function(e){var t=e.axis,a=e.moveRelativeTo,n=e.isMoving;return B(t.line,a.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,n),je(t,a.marginBox,n))},Ie=function(e){var t=e.impact,a=e.draggable,n=e.draggables,i=e.droppable,s=e.afterCritical,r=ne(i.descriptor.id,n),o=a.page,l=i.axis;if(!r.length)return function(e){var t=e.axis,a=e.moveInto,n=e.isMoving;return B(t.line,a.contentBox[t.start]+xe(t,n),je(t,a.contentBox,n))}({axis:l,moveInto:i.page,isMoving:o});var c=t.displaced,d=t.displacedBy,u=c.all[0];if(u){var h=n[u];if(Se(u,s))return Re({axis:l,moveRelativeTo:h.page,isMoving:o});var p=m.offset(h.page,d.point);return Re({axis:l,moveRelativeTo:p,isMoving:o})}var g=r[r.length-1];if(g.descriptor.id===a.descriptor.id)return o.borderBox.center;if(Se(g.descriptor.id,s)){var v=m.offset(g.page,F(s.displacedBy.point));return ke({axis:l,moveRelativeTo:v,isMoving:o})}return ke({axis:l,moveRelativeTo:g.page,isMoving:o})},Te=function(e,t){var a=e.frame;return a?A(t,a.scroll.diff.displacement):t},Ne=function(e){var t=function(e){var t=e.impact,a=e.draggable,n=e.droppable,i=e.draggables,s=e.afterCritical,r=a.page.borderBox.center,o=t.at;return n&&o?"REORDER"===o.type?Ie({impact:t,draggable:a,draggables:i,droppable:n,afterCritical:s}):Ce({impact:t,draggables:i,afterCritical:s}):r}(e),a=e.droppable;return a?Te(a,t):t},Pe=function(e,t){var a=L(t,e.scroll.initial),n=F(a);return{frame:m.getRect({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:a,displacement:n}}}};function De(e,t){return e.map((function(e){return t[e]}))}var Me=function(e){var t=e.pageBorderBoxCenter,a=e.draggable,n=function(e,t){return A(e.scroll.diff.displacement,t)}(e.viewport,t),i=L(n,a.page.borderBox.center);return A(a.client.borderBox.center,i)},Ae=function(e){var t=e.draggable,a=e.destination,n=e.newPageBorderBoxCenter,i=e.viewport,s=e.withDroppableDisplacement,r=e.onlyOnMainAxis,l=void 0!==r&&r,c=L(n,t.page.borderBox.center),d={target:z(t.page.borderBox,c),destination:a,withDroppableDisplacement:s,viewport:i};return l?function(e){return ve(o({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var a=me(e.top,e.bottom),n=me(e.left,e.right);return function(e){return t===pe?a(e.top)&&a(e.bottom):n(e.left)&&n(e.right)}})}));var t}(d):fe(d)},Le=function(e){var t=e.isMovingForward,a=e.draggable,n=e.destination,i=e.draggables,s=e.previousImpact,r=e.viewport,l=e.previousPageBorderBoxCenter,c=e.previousClientSelection,d=e.afterCritical;if(!n.isEnabled)return null;var m=ne(n.descriptor.id,i),u=oe(a,n),h=function(e){var t=e.isMovingForward,a=e.draggable,n=e.destination,i=e.insideDestination,s=e.previousImpact;if(!n.isCombineEnabled)return null;if(!ie(s))return null;function r(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:n.descriptor.id}};return o({},s,{at:t})}var l=s.displaced.all,c=l.length?l[0]:null;if(t)return c?r(c):null;var d=re(a,i);if(!c)return d.length?r(d[d.length-1].descriptor.id):null;var m=J(d,(function(e){return e.descriptor.id===c}));-1===m&&k(!1);var u=m-1;return u<0?null:r(d[u].descriptor.id)}({isMovingForward:t,draggable:a,destination:n,insideDestination:m,previousImpact:s})||Oe({isMovingForward:t,isInHomeList:u,draggable:a,draggables:i,destination:n,insideDestination:m,previousImpact:s,viewport:r,afterCritical:d});if(!h)return null;var p=Ne({impact:h,draggable:a,droppable:n,draggables:i,afterCritical:d});if(Ae({draggable:a,destination:n,newPageBorderBoxCenter:p,viewport:r.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:Me({pageBorderBoxCenter:p,draggable:a,viewport:r}),impact:h,scrollJumpRequest:null};var g=L(p,l),v=function(e){var t=e.impact,a=e.viewport,n=e.destination,i=e.draggables,s=e.maxScrollChange,r=Pe(a,A(a.scroll.current,s)),l=n.frame?$(n,A(n.frame.scroll.current,s)):n,c=t.displaced,d=Ee({afterDragging:De(c.all,i),destination:n,displacedBy:t.displacedBy,viewport:r.frame,last:c,forceShouldAnimate:!1}),m=Ee({afterDragging:De(c.all,i),destination:l,displacedBy:t.displacedBy,viewport:a.frame,last:c,forceShouldAnimate:!1}),u={},h={},p=[c,d,m];return c.all.forEach((function(e){var t=function(e,t){for(var a=0;a1?d.sort((function(e,t){return Ue(e)[o.start]-Ue(t)[o.start]}))[0]:c.sort((function(e,t){var n=W(a,G(Ue(e))),i=W(a,G(Ue(t)));return n!==i?n-i:Ue(e)[o.start]-Ue(t)[o.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:a,source:i,droppables:r,viewport:o});if(!c)return null;var d=ne(c.descriptor.id,s),m=function(e){var t=e.pageBorderBoxCenter,a=e.viewport,n=e.destination,i=e.insideDestination,s=e.afterCritical,r=i.filter((function(e){return fe({target:Be(e,s),destination:n,viewport:a.frame,withDroppableDisplacement:!0})})).sort((function(e,a){var i=V(t,Te(n,Fe(e,s))),r=V(t,Te(n,Fe(a,s)));return in.left&&a.topn.top))return!1;if($e(i)(t.center))return!0;var s=e.axis,r=i.center[s.crossAxisLine],o=t[s.crossAxisStart],l=t[s.crossAxisEnd],c=me(i[s.crossAxisStart],i[s.crossAxisEnd]),d=c(o),m=c(l);return!d&&!m||(d?or)}));return i.length?1===i.length?i[0].descriptor.id:function(e){var t=e.pageBorderBox,a=e.draggable,n=e.candidates,i=a.page.borderBox.center,s=n.map((function(e){var a=e.axis,n=B(e.axis.line,t.center[a.line],e.page.borderBox.center[a.crossAxisLine]);return{id:e.descriptor.id,distance:V(i,n)}})).sort((function(e,t){return t.distance-e.distance}));return s[0]?s[0].id:null}({pageBorderBox:t,draggable:a,candidates:i}):null}var Je=function(e,t){return m.getRect(z(e,t))};function Qe(e){var t=e.displaced,a=e.id;return Boolean(t.visible[a]||t.invisible[a])}var Xe=function(e){var t=e.pageOffset,a=e.draggable,n=e.draggables,i=e.droppables,s=e.previousImpact,r=e.viewport,o=e.afterCritical,l=Je(a.page.borderBox,t),c=Ye({pageBorderBox:l,draggable:a,droppables:i});if(!c)return de;var d=i[c],m=ne(d.descriptor.id,n),u=function(e,t){var a=e.frame;return a?Je(t,a.scroll.diff.value):t}(d,l);return function(e){var t=e.draggable,a=e.pageBorderBoxWithDroppableScroll,n=e.previousImpact,i=e.destination,s=e.insideDestination,r=e.afterCritical;if(!i.isCombineEnabled)return null;var o=i.axis,l=Ve(i.axis,t.displaceBy),c=l.value,d=a[o.start],m=a[o.end],u=Q(re(t,s),(function(e){var t=e.descriptor.id,a=e.page.borderBox,i=a[o.size]/4,s=Se(t,r),l=Qe({displaced:n.displaced,id:t});return s?l?m>a[o.start]+i&&ma[o.start]-c+i&&da[o.start]+c+i&&ma[o.start]+i&&dt.descriptor.index?a.descriptor.index-1:a.descriptor.index:null}({draggable:a,closest:Q(re(a,i),(function(e){var t=e.descriptor.id,a=e.page.borderBox.center[l.line],n=Se(t,o),i=Qe({displaced:s,id:t});return n?i?u<=a:m=1500)return Ut;var s=Lt+Ft*(i/1500);return Number(("CANCEL"===n?.6*s:s).toFixed(2))}({current:i.current.client.offset,destination:b,reason:s});a(function(e){return{type:"DROP_ANIMATE",payload:e}}({newHomeClientOffset:b,dropDuration:y,completed:f}))}else a(xt({completed:f}))}}else a(function(e){return{type:"DROP_PENDING",payload:e}}({reason:s}))}else e(n)}}},Vt=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Wt(e){var t=e.onWindowScroll;var a=h((function(){t(Vt())})),n=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(a),i=S;function s(){return i!==S}return{start:function(){s()&&k(!1),i=O(window,[n])},stop:function(){s()||k(!1),a.cancel(),i(),i=S},isActive:s}}var Ht=function(e){var t=Wt({onWindowScroll:function(t){e.dispatch({type:"MOVE_BY_WINDOW_SCROLL",payload:{newScroll:t}})}});return function(e){return function(a){t.isActive()||"INITIAL_PUBLISH"!==a.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(a)&&t.stop(),e(a)}}},zt=function(){var e=[];return{add:function(t){var a=setTimeout((function(){return function(t){var a=J(e,(function(e){return e.timerId===t}));-1===a&&k(!1),e.splice(a,1)[0].callback()}(a)})),n={timerId:a,callback:t};e.push(n)},flush:function(){if(e.length){var t=[].concat(e);e.length=0,t.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}},Gt=function(e,t){rt(),t(),ot()},Kt=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},qt=function(e,t,a,n){if(e){var i=function(e){var t=!1,a=!1,n=setTimeout((function(){a=!0})),i=function(i){t||a||(t=!0,e(i),clearTimeout(n))};return i.wasCalled=function(){return t},i}(a);e(t,{announce:i}),i.wasCalled()||a(n(t))}else a(n(t))},$t=function(e,t){var a=function(e,t){var a=zt(),n=null,i=function(a){n||k(!1),n=null,Gt(0,(function(){return qt(e().onDragEnd,a,t,D.onDragEnd)}))};return{beforeCapture:function(t,a){n&&k(!1),Gt(0,(function(){var n=e().onBeforeCapture;n&&n({draggableId:t,mode:a})}))},beforeStart:function(t,a){n&&k(!1),Gt(0,(function(){var n=e().onBeforeDragStart;n&&n(Kt(t,a))}))},start:function(i,s){n&&k(!1);var r=Kt(i,s);n={mode:s,lastCritical:i,lastLocation:r.source,lastCombine:null},a.add((function(){Gt(0,(function(){return qt(e().onDragStart,r,t,D.onDragStart)}))}))},update:function(i,s){var r=ie(s),l=se(s);n||k(!1);var c=!function(e,t){if(e===t)return!0;var a=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,n=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return a&&n}(i,n.lastCritical);c&&(n.lastCritical=i);var d,m,u=(m=r,!(null==(d=n.lastLocation)&&null==m||null!=d&&null!=m&&d.droppableId===m.droppableId&&d.index===m.index));u&&(n.lastLocation=r);var h=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(n.lastCombine,l);if(h&&(n.lastCombine=l),c||u||h){var p=o({},Kt(i,n.mode),{combine:l,destination:r});a.add((function(){Gt(0,(function(){return qt(e().onDragUpdate,p,t,D.onDragUpdate)}))}))}},flush:function(){n||k(!1),a.flush()},drop:i,abort:function(){if(n){var e=o({},Kt(n.lastCritical,n.mode),{combine:null,destination:null,reason:"CANCEL"});i(e)}}}}(e,t);return function(e){return function(t){return function(n){if("BEFORE_INITIAL_CAPTURE"!==n.type){if("INITIAL_PUBLISH"===n.type){var i=n.payload.critical;return a.beforeStart(i,n.payload.movementMode),t(n),void a.start(i,n.payload.movementMode)}if("DROP_COMPLETE"===n.type){var s=n.payload.completed.result;return a.flush(),t(n),void a.drop(s)}if(t(n),"FLUSH"!==n.type){var r=e.getState();"DRAGGING"===r.phase&&a.update(r.critical,r.impact)}else a.abort()}else a.beforeCapture(n.payload.draggableId,n.payload.movementMode)}}}},Yt=function(e){return function(t){return function(a){if("DROP_ANIMATION_FINISHED"===a.type){var n=e.getState();"DROP_ANIMATING"!==n.phase&&k(!1),e.dispatch(xt({completed:n.completed}))}else t(a)}}},Jt=function(e){var t=null,a=null;return function(n){return function(i){if("FLUSH"!==i.type&&"DROP_COMPLETE"!==i.type&&"DROP_ANIMATION_FINISHED"!==i.type||(a&&(cancelAnimationFrame(a),a=null),t&&(t(),t=null)),n(i),"DROP_ANIMATE"===i.type){var s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};a=requestAnimationFrame((function(){a=null,t=O(window,[s])}))}}}},Qt=function(e){return function(t){return function(a){if(t(a),"PUBLISH_WHILE_DRAGGING"===a.type){var n=e.getState();"DROP_PENDING"===n.phase&&(n.isWaiting||e.dispatch(jt({reason:n.reason})))}}}},Xt=l.compose,Zt=function(e){var t,a=e.dimensionMarshal,n=e.focusMarshal,i=e.styleMarshal,s=e.getResponders,r=e.announce,o=e.autoScroller;return l.createStore(ht,Xt(l.applyMiddleware((t=i,function(){return function(e){return function(a){"INITIAL_PUBLISH"===a.type&&t.dragging(),"DROP_ANIMATE"===a.type&&t.dropping(a.payload.completed.result.reason),"FLUSH"!==a.type&&"DROP_COMPLETE"!==a.type||t.resting(),e(a)}}}),function(e){return function(){return function(t){return function(a){"DROP_COMPLETE"!==a.type&&"FLUSH"!==a.type&&"DROP_ANIMATE"!==a.type||e.stopPublishing(),t(a)}}}}(a),function(e){return function(t){var a=t.getState,n=t.dispatch;return function(t){return function(i){if("LIFT"===i.type){var s=i.payload,r=s.id,o=s.clientSelection,l=s.movementMode,c=a();"DROP_ANIMATING"===c.phase&&n(xt({completed:c.completed})),"IDLE"!==a().phase&&k(!1),n(Ct()),n({type:"BEFORE_INITIAL_CAPTURE",payload:{draggableId:r,movementMode:l}});var d={draggableId:r,scrollOptions:{shouldPublishImmediately:"SNAP"===l}},m=e.startPublishing(d),u=m.critical,h=m.dimensions,p=m.viewport;n({type:"INITIAL_PUBLISH",payload:{critical:u,dimensions:h,clientSelection:o,movementMode:l,viewport:p}})}else t(i)}}}}(a),Bt,Yt,Jt,Qt,function(e){return function(t){return function(a){return function(n){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n))return e.stop(),void a(n);if("INITIAL_PUBLISH"===n.type){a(n);var i=t.getState();return"DRAGGING"!==i.phase&&k(!1),void e.start(i)}a(n),e.scroll(t.getState())}}}}(o),Ht,function(e){var t=!1;return function(){return function(a){return function(n){if("INITIAL_PUBLISH"===n.type)return t=!0,e.tryRecordFocus(n.payload.critical.draggable.id),a(n),void e.tryRestoreFocusRecorded();if(a(n),t){if("FLUSH"===n.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===n.type){t=!1;var i=n.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(n),$t(s,r))))},ea=function(){return{additions:{},removals:{},modified:{}}};var ta=function(e){var t=e.scrollHeight,a=e.scrollWidth,n=e.height,i=e.width,s=L({x:a,y:t},{x:i,y:n});return{x:Math.max(0,s.x),y:Math.max(0,s.y)}},aa=function(){var e=document.documentElement;return e||k(!1),e},na=function(){var e=aa();return ta({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})},ia=function(e){var t=e.critical,a=e.scrollOptions,n=e.registry;rt();var i=function(){var e=Vt(),t=na(),a=e.y,n=e.x,i=aa(),s=n+i.clientWidth,r=a+i.clientHeight;return{frame:m.getRect({top:a,left:n,right:s,bottom:r}),scroll:{initial:e,current:e,max:t,diff:{value:M,displacement:M}}}}(),s=i.scroll.current,r=t.droppable,o=n.droppable.getAllByType(r.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(s,a)})),l=n.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(s)})),c={draggables:ee(l),droppables:Z(o)};return ot(),{dimensions:c,critical:t,viewport:i}};function sa(e,t,a){return a.descriptor.id!==t.id&&(a.descriptor.type===t.type&&"virtual"===e.droppable.getById(a.descriptor.droppableId).descriptor.mode)}var ra,oa,la=function(e,t){var a=null,n=function(e){var t=e.registry,a=e.callbacks,n=ea(),i=null,s=function(){i||(a.collectionStarting(),i=requestAnimationFrame((function(){i=null,rt();var e=n,s=e.additions,r=e.removals,o=e.modified,l=Object.keys(s).map((function(e){return t.draggable.getById(e).getDimension(M)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(o).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),d={additions:l,removals:Object.keys(r),modified:c};n=ea(),ot(),a.publish(d)})))};return{add:function(e){var t=e.descriptor.id;n.additions[t]=e,n.modified[e.descriptor.droppableId]=!0,n.removals[t]&&delete n.removals[t],s()},remove:function(e){var t=e.descriptor;n.removals[t.id]=!0,n.modified[t.droppableId]=!0,n.additions[t.id]&&delete n.additions[t.id],s()},stop:function(){i&&(cancelAnimationFrame(i),i=null,n=ea())}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(t){a||k(!1);var i=a.critical.draggable;"ADDITION"===t.type&&sa(e,i,t.value)&&n.add(t.value),"REMOVAL"===t.type&&sa(e,i,t.value)&&n.remove(t.value)},s={updateDroppableIsEnabled:function(n,i){e.droppable.exists(n)||k(!1),a&&t.updateDroppableIsEnabled({id:n,isEnabled:i})},updateDroppableIsCombineEnabled:function(n,i){a&&(e.droppable.exists(n)||k(!1),t.updateDroppableIsCombineEnabled({id:n,isCombineEnabled:i}))},scrollDroppable:function(t,n){a&&e.droppable.getById(t).callbacks.scroll(n)},updateDroppableScroll:function(n,i){a&&(e.droppable.exists(n)||k(!1),t.updateDroppableScroll({id:n,newScroll:i}))},startPublishing:function(t){a&&k(!1);var n=e.draggable.getById(t.draggableId),s=e.droppable.getById(n.descriptor.droppableId),r={draggable:n.descriptor,droppable:s.descriptor},o=e.subscribe(i);return a={critical:r,unsubscribe:o},ia({critical:r,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(a){n.stop();var t=a.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),a.unsubscribe(),a=null}}};return s},ca=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&(e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason)},da=function(e){window.scrollBy(e.x,e.y)},ma=u((function(e){return te(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),ua=function(e){var t=e.center,a=e.destination,n=e.droppables;if(a){var i=n[a];return i.frame?i:null}var s=function(e,t){var a=Q(ma(t),(function(t){return t.frame||k(!1),$e(t.frame.pageMarginBox)(e)}));return a}(t,n);return s},ha=.25,pa=.05,ga=28,va=function(e){return Math.pow(e,2)},ba={stopDampeningAt:1200,accelerateAt:360},fa=function(e){var t=e.startOfRange,a=e.endOfRange,n=e.current,i=a-t;return 0===i?0:(n-t)/i},ya=ba.accelerateAt,Ea=ba.stopDampeningAt,_a=function(e){var t=e.distanceToEdge,a=e.thresholds,n=e.dragStartTime,i=e.shouldUseTimeDampening,s=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return ga;if(e===t.startScrollingFrom)return 1;var a=fa({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=ga*va(1-a);return Math.ceil(n)}(t,a);return 0===s?0:i?Math.max(function(e,t){var a=t,n=Ea,i=Date.now()-a;if(i>=Ea)return e;if(it.height,s=a.width>t.width;return s||i?s&&i?null:{x:s?0:n.x,y:i?0:n.y}:n}({container:a,subject:n,proposedScroll:c});return d?U(d,M)?null:d:null},Ca=H((function(e){return 0===e?0:e>0?1:-1})),xa=(ra=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,a=e.max,n=e.change,i=A(t,n),s={x:ra(i.x,a.x),y:ra(i.y,a.y)};return U(s,M)?null:s}),ja=function(e){var t=e.max,a=e.current,n=e.change,i={x:Math.max(a.x,t.x),y:Math.max(a.y,t.y)},s=Ca(n),r=xa({max:i,current:a,change:s});return!r||(0!==s.x&&0===r.x||0!==s.y&&0===r.y)},ka=function(e,t){return ja({current:e.scroll.current,max:e.scroll.max,change:t})},Ra=function(e,t){var a=e.frame;return!!a&&ja({current:a.scroll.current,max:a.scroll.max,change:t})},Ia=function(e){var t=e.state,a=e.dragStartTime,n=e.shouldUseTimeDampening,i=e.scrollWindow,s=e.scrollDroppable,r=t.current.page.borderBoxCenter,o=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var l=function(e){var t=e.viewport,a=e.subject,n=e.center,i=e.dragStartTime,s=e.shouldUseTimeDampening,r=Oa({dragStartTime:i,container:t.frame,subject:a,center:n,shouldUseTimeDampening:s});return r&&ka(t,r)?r:null}({dragStartTime:a,viewport:t.viewport,subject:o,center:r,shouldUseTimeDampening:n});if(l)return void i(l)}var c=ua({center:r,destination:Ge(t.impact),droppables:t.dimensions.droppables});if(c){var d=function(e){var t=e.droppable,a=e.subject,n=e.center,i=e.dragStartTime,s=e.shouldUseTimeDampening,r=t.frame;if(!r)return null;var o=Oa({dragStartTime:i,container:r.pageMarginBox,subject:a,center:n,shouldUseTimeDampening:s});return o&&Ra(t,o)?o:null}({dragStartTime:a,droppable:c,subject:o,center:r,shouldUseTimeDampening:n});d&&s(c.descriptor.id,d)}},Ta=function(e){var t=e.move,a=e.scrollDroppable,n=e.scrollWindow,i=function(e,t){if(!Ra(e,t))return t;var n=function(e,t){var a=e.frame;return a&&Ra(e,t)?xa({current:a.scroll.current,max:a.scroll.max,change:t}):null}(e,t);if(!n)return a(e.descriptor.id,t),null;var i=L(t,n);return a(e.descriptor.id,i),L(t,i)},s=function(e,t,a){if(!e)return a;if(!ka(t,a))return a;var i=function(e,t){if(!ka(e,t))return null;var a=e.scroll.max,n=e.scroll.current;return xa({current:n,max:a,change:t})}(t,a);if(!i)return n(a),null;var s=L(a,i);return n(s),L(a,s)};return function(e){var a=e.scrollJumpRequest;if(a){var n=Ge(e.impact);n||k(!1);var r=i(e.dimensions.droppables[n],a);if(r){var o=e.viewport,l=s(e.isWindowScrollAllowed,o,r);l&&function(e,a){var n=A(e.current.client.selection,a);t({client:n})}(e,l)}}}},Na=function(e){var t=e.scrollDroppable,a=e.scrollWindow,n=e.move,i=function(e){var t=e.scrollWindow,a=e.scrollDroppable,n=h(t),i=h(a),s=null,r=function(e){s||k(!1);var t=s,a=t.shouldUseTimeDampening,r=t.dragStartTime;Ia({state:e,scrollWindow:n,scrollDroppable:i,dragStartTime:r,shouldUseTimeDampening:a})};return{start:function(e){rt(),s&&k(!1);var t=Date.now(),a=!1,n=function(){a=!0};Ia({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:n,scrollDroppable:n}),s={dragStartTime:t,shouldUseTimeDampening:a},ot(),a&&r(e)},stop:function(){s&&(n.cancel(),i.cancel(),s=null)},scroll:r}}({scrollWindow:a,scrollDroppable:t}),s=Ta({move:n,scrollWindow:a,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&s(e):i.scroll(e))},start:i.start,stop:i.stop}},Pa="data-rbd",Da={base:oa=Pa+"-drag-handle",draggableId:oa+"-draggable-id",contextId:oa+"-context-id"},Ma=function(){var e=Pa+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),Aa=function(){var e=Pa+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),La={contextId:Pa+"-scroll-container-context-id"},Ua=function(e,t){return e.map((function(e){var a=e.styles[t];return a?e.selector+" { "+a+" }":""})).join(" ")},Fa=function(e){var t,a,n,i=(t=e,function(e){return"["+e+'="'+t+'"]'}),s=(a="\n cursor: -webkit-grab;\n cursor: grab;\n ",{selector:i(Da.contextId),styles:{always:"\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",resting:a,dragging:"pointer-events: none;",dropAnimating:a}}),r=[(n="\n transition: "+Dt.outOfTheWay+";\n ",{selector:i(Ma.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),s,{selector:i(Aa.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n "}}];return{always:Ua(r,"always"),resting:Ua(r,"resting"),dragging:Ua(r,"dragging"),dropAnimating:Ua(r,"dropAnimating"),userCancel:Ua(r,"userCancel")}},Ba="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect,Va=function(){var e=document.querySelector("head");return e||k(!1),e},Wa=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};var Ha=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function za(e){return e instanceof Ha(e).HTMLElement}function Ga(e,t){var a="["+Da.contextId+'="'+e+'"]',n=X(document.querySelectorAll(a));if(!n.length)return null;var i=Q(n,(function(e){return e.getAttribute(Da.draggableId)===t}));return i&&za(i)?i:null}function Ka(){var e={draggables:{},droppables:{}},t=[];function a(e){t.length&&t.forEach((function(t){return t(e)}))}function n(t){return e.draggables[t]||null}function i(t){return e.droppables[t]||null}return{draggable:{register:function(t){e.draggables[t.descriptor.id]=t,a({type:"ADDITION",value:t})},update:function(t,a){var n=e.draggables[a.descriptor.id];n&&n.uniqueId===t.uniqueId&&(delete e.draggables[a.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var i=t.descriptor.id,s=n(i);s&&t.uniqueId===s.uniqueId&&(delete e.draggables[i],a({type:"REMOVAL",value:t}))},getById:function(e){var t=n(e);return t||k(!1),t},findById:n,exists:function(e){return Boolean(n(e))},getAllByType:function(t){return Y(e.draggables).filter((function(e){return e.descriptor.type===t}))}},droppable:{register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var a=i(t.descriptor.id);a&&t.uniqueId===a.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||k(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return Y(e.droppables).filter((function(e){return e.descriptor.type===t}))}},subscribe:function(e){return t.push(e),function(){var a=t.indexOf(e);-1!==a&&t.splice(a,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var qa=s.createContext(null),$a=function(){var e=document.body;return e||k(!1),e},Ya={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},Ja=function(e){return"rbd-announcement-"+e};var Qa=0,Xa={separator:"::"};function Za(e,t){return void 0===t&&(t=Xa),d.useMemo((function(){return""+e+t.separator+Qa++}),[t.separator,e])}var en=s.createContext(null);function tn(e){0}function an(e,t){tn()}function nn(e){var t=i.useRef(e);return i.useEffect((function(){t.current=e})),t}var sn,rn=27,on=32,ln=37,cn=38,dn=39,mn=40,un=((sn={})[13]=!0,sn[9]=!0,sn),hn=function(e){un[e.keyCode]&&e.preventDefault()},pn=function(){var e="visibilitychange";return"undefined"==typeof document?e:Q([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),gn=0,vn=5;var bn,fn={type:"IDLE"};function yn(e){var t=e.cancel,a=e.completed,n=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,a=e.clientX,s=e.clientY;if(t===gn){var r={x:a,y:s},o=n();if("DRAGGING"===o.type)return e.preventDefault(),void o.actions.move(r);"PENDING"!==o.type&&k(!1);var l=o.point;if(c=l,d=r,Math.abs(d.x-c.x)>=vn||Math.abs(d.y-c.y)>=vn){var c,d;e.preventDefault();var m=o.actions.fluidLift(r);i({type:"DRAGGING",actions:m})}}}},{eventName:"mouseup",fn:function(e){var i=n();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),a()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===n().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==n().type)return e.keyCode===rn?(e.preventDefault(),void t()):void hn(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===n().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var a=n();"IDLE"===a.type&&k(!1),a.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:pn,fn:t}]}function En(e){var t=i.useRef(fn),a=i.useRef(S),n=d.useMemo((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&t.button===gn&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var n=e.findClosestDraggableId(t);if(n){var i=e.tryGetLock(n,o,{sourceEvent:t});if(i){t.preventDefault();var s={x:t.clientX,y:t.clientY};a.current(),m(i,s)}}}}}}),[e]),s=d.useMemo((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var a=e.findClosestDraggableId(t);if(a){var n=e.findOptionsForDraggable(a);n&&(n.shouldRespectForcePress||e.canGetLock(a)&&t.preventDefault())}}}}}),[e]),r=d.useCallback((function(){a.current=O(window,[s,n],{passive:!1,capture:!0})}),[s,n]),o=d.useCallback((function(){"IDLE"!==t.current.type&&(t.current=fn,a.current(),r())}),[r]),l=d.useCallback((function(){var e=t.current;o(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[o]),c=d.useCallback((function(){var e=yn({cancel:l,completed:o,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});a.current=O(window,e,{capture:!0,passive:!1})}),[l,o]),m=d.useCallback((function(e,a){"IDLE"!==t.current.type&&k(!1),t.current={type:"PENDING",point:a,actions:e},c()}),[c]);Ba((function(){return r(),function(){a.current()}}),[r])}function _n(){}var wn=((bn={})[34]=!0,bn[33]=!0,bn[36]=!0,bn[35]=!0,bn);function Sn(e,t){function a(){t(),e.cancel()}return[{eventName:"keydown",fn:function(n){return n.keyCode===rn?(n.preventDefault(),void a()):n.keyCode===on?(n.preventDefault(),t(),void e.drop()):n.keyCode===mn?(n.preventDefault(),void e.moveDown()):n.keyCode===cn?(n.preventDefault(),void e.moveUp()):n.keyCode===dn?(n.preventDefault(),void e.moveRight()):n.keyCode===ln?(n.preventDefault(),void e.moveLeft()):void(wn[n.keyCode]?n.preventDefault():hn(n))}},{eventName:"mousedown",fn:a},{eventName:"mouseup",fn:a},{eventName:"click",fn:a},{eventName:"touchstart",fn:a},{eventName:"resize",fn:a},{eventName:"wheel",fn:a,options:{passive:!0}},{eventName:pn,fn:a}]}function On(e){var t=i.useRef(_n),a=d.useMemo((function(){return{eventName:"keydown",fn:function(a){if(!a.defaultPrevented&&a.keyCode===on){var i=e.findClosestDraggableId(a);if(i){var s=e.tryGetLock(i,l,{sourceEvent:a});if(s){a.preventDefault();var r=!0,o=s.snapLift();t.current(),t.current=O(window,Sn(o,l),{capture:!0,passive:!1})}}}function l(){r||k(!1),r=!1,t.current(),n()}}}}),[e]),n=d.useCallback((function(){t.current=O(window,[a],{passive:!1,capture:!0})}),[a]);Ba((function(){return n(),function(){t.current()}}),[n])}var Cn={type:"IDLE"},xn=120,jn=.15;function kn(e){var t=i.useRef(Cn),a=i.useRef(S),n=d.useCallback((function(){return t.current}),[]),s=d.useCallback((function(e){t.current=e}),[]),r=d.useMemo((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var i=e.tryGetLock(n,l,{sourceEvent:t});if(i){var s=t.touches[0],r={x:s.clientX,y:s.clientY};a.current(),h(i,r)}}}}}}),[e]),o=d.useCallback((function(){a.current=O(window,[r],{capture:!0,passive:!1})}),[r]),l=d.useCallback((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),s(Cn),a.current(),o())}),[o,s]),c=d.useCallback((function(){var e=t.current;l(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[l]),m=d.useCallback((function(){var e={capture:!0,passive:!1},t={cancel:c,completed:l,getPhase:n},i=O(window,function(e){var t=e.cancel,a=e.completed,n=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var a=n();if("DRAGGING"===a.type){a.hasMoved=!0;var i=e.touches[0],s={x:i.clientX,y:i.clientY};e.preventDefault(),a.actions.move(s)}else t()}},{eventName:"touchend",fn:function(e){var i=n();"DRAGGING"===i.type?(e.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),a()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===n().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var a=n();"IDLE"===a.type&&k(!1);var i=e.touches[0];if(i&&i.force>=jn){var s=a.actions.shouldRespectForcePress();if("PENDING"!==a.type)return s?a.hasMoved?void e.preventDefault():void t():void e.preventDefault();s&&t()}}},{eventName:pn,fn:t}]}(t),e),s=O(window,function(e){var t=e.cancel,a=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===a().type?(e.keyCode===rn&&e.preventDefault(),t()):t()}},{eventName:pn,fn:t}]}(t),e);a.current=function(){i(),s()}}),[c,n,l]),u=d.useCallback((function(){var e=n();"PENDING"!==e.type&&k(!1);var t=e.actions.fluidLift(e.point);s({type:"DRAGGING",actions:t,hasMoved:!1})}),[n,s]),h=d.useCallback((function(e,t){"IDLE"!==n().type&&k(!1);var a=setTimeout(u,xn);s({type:"PENDING",point:t,actions:e,longPressTimerId:a}),m()}),[m,n,s,u]);Ba((function(){return o(),function(){a.current();var e=n();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),s(Cn))}}),[n,o,s]),Ba((function(){return O(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}var Rn={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function In(e,t){if(null==t)return!1;if(Boolean(Rn[t.tagName.toLowerCase()]))return!0;var a=t.getAttribute("contenteditable");return"true"===a||""===a||t!==e&&In(e,t.parentElement)}function Tn(e,t){var a=t.target;return!!za(a)&&In(e,a)}var Nn=function(e){return m.getRect(e.getBoundingClientRect()).center};var Pn=function(){var e="matches";return"undefined"==typeof document?e:Q([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}))||e}();function Dn(e,t){return null==e?null:e[Pn](t)?e:Dn(e.parentElement,t)}function Mn(e,t){return e.closest?e.closest(t):Dn(e,t)}function An(e,t){var a,n=t.target;if(!((a=n)instanceof Ha(a).Element))return null;var i=function(e){return"["+Da.contextId+'="'+e+'"]'}(e),s=Mn(n,i);return s&&za(s)?s:null}function Ln(e){e.preventDefault()}function Un(e){var t=e.expected,a=e.phase,n=e.isLockActive;e.shouldWarn;return!!n()&&t===a}function Fn(e){var t=e.lockAPI,a=e.store,n=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var s=n.draggable.findById(i);return!!s&&(!!s.options.isEnabled&&!!ca(a.getState(),i))}function Bn(e){var t=e.lockAPI,a=e.contextId,n=e.store,i=e.registry,s=e.draggableId,r=e.forceSensorStop,l=e.sourceEvent;if(!Fn({lockAPI:t,store:n,registry:i,draggableId:s}))return null;var c=i.draggable.getById(s),d=function(e,t){var a="["+Ma.contextId+'="'+e+'"]',n=Q(X(document.querySelectorAll(a)),(function(e){return e.getAttribute(Ma.id)===t}));return n&&za(n)?n:null}(a,c.descriptor.id);if(!d)return null;if(l&&!c.options.canDragInteractiveElements&&Tn(d,l))return null;var m=t.claim(r||S),u="PRE_DRAG";function p(){return c.options.shouldRespectForcePress}function g(){return t.isActive(m)}var v=function(e,t){Un({expected:e,phase:u,isLockActive:g,shouldWarn:!0})&&n.dispatch(t())}.bind(null,"DRAGGING");function b(e){function a(){t.release(),u="COMPLETED"}function i(t,i){if(void 0===i&&(i={shouldBlockNextClick:!1}),e.cleanup(),i.shouldBlockNextClick){var s=O(window,[{eventName:"click",fn:Ln,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(s)}a(),n.dispatch(jt({reason:t}))}return"PRE_DRAG"!==u&&(a(),"PRE_DRAG"!==u&&k(!1)),n.dispatch(pt(e.liftActionArgs)),u="DRAGGING",o({isActive:function(){return Un({expected:"DRAGGING",phase:u,isLockActive:g,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(e){return i("DROP",e)},cancel:function(e){return i("CANCEL",e)}},e.actions)}return{isActive:function(){return Un({expected:"PRE_DRAG",phase:u,isLockActive:g,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:function(e){var t=h((function(e){v((function(){return Et({client:e})}))})),a=b({liftActionArgs:{id:s,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return o({},a,{move:t})},snapLift:function(){var e={moveUp:function(){return v(_t)},moveRight:function(){return v(St)},moveDown:function(){return v(wt)},moveLeft:function(){return v(Ot)}};return b({liftActionArgs:{id:s,clientSelection:Nn(d),movementMode:"SNAP"},cleanup:S,actions:e})},abort:function(){Un({expected:"PRE_DRAG",phase:u,isLockActive:g,shouldWarn:!0})&&t.release()}}}var Vn=[En,On,kn];function Wn(e){var t=e.contextId,a=e.store,n=e.registry,s=e.customSensors,r=e.enableDefaultSensors,o=[].concat(r?Vn:[],s||[]),l=i.useState((function(){return function(){var e=null;function t(){e||k(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&k(!1);var a={abandon:t};return e=a,a},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],c=d.useCallback((function(e,t){e.isDragging&&!t.isDragging&&l.tryAbandon()}),[l]);Ba((function(){var e=a.getState();return a.subscribe((function(){var t=a.getState();c(e,t),e=t}))}),[l,a,c]),Ba((function(){return l.tryAbandon}),[l.tryAbandon]);var m=d.useCallback((function(e){return Fn({lockAPI:l,registry:n,store:a,draggableId:e})}),[l,n,a]),u=d.useCallback((function(e,i,s){return Bn({lockAPI:l,registry:n,contextId:t,store:a,draggableId:e,forceSensorStop:i,sourceEvent:s&&s.sourceEvent?s.sourceEvent:null})}),[t,l,n,a]),h=d.useCallback((function(e){return function(e,t){var a=An(e,t);return a?a.getAttribute(Da.draggableId):null}(t,e)}),[t]),p=d.useCallback((function(e){var t=n.draggable.findById(e);return t?t.options:null}),[n.draggable]),g=d.useCallback((function(){l.isClaimed()&&(l.tryAbandon(),"IDLE"!==a.getState().phase&&a.dispatch(Ct()))}),[l,a]),v=d.useCallback(l.isClaimed,[l]),b=d.useMemo((function(){return{canGetLock:m,tryGetLock:u,findClosestDraggableId:h,findOptionsForDraggable:p,tryReleaseLock:g,isLockClaimed:v}}),[m,u,h,p,g,v]);tn();for(var f=0;f=0;n--){var i=t[n](e);if(i)return i}return function(t,n){throw new Error("Invalid value of type "+typeof e+" for "+a+" argument when connecting component "+n.wrappedComponentName+".")}}function p(e,t){return e===t}function g(e){var t=void 0===e?{}:e,a=t.connectHOC,n=void 0===a?r.default:a,g=t.mapStateToPropsFactories,v=void 0===g?c.default:g,b=t.mapDispatchToPropsFactories,f=void 0===b?l.default:b,y=t.mergePropsFactories,E=void 0===y?d.default:y,_=t.selectorFactory,w=void 0===_?m.default:_;return function(e,t,a,r){void 0===r&&(r={});var l=r,c=l.pure,d=void 0===c||c,m=l.areStatesEqual,g=void 0===m?p:m,b=l.areOwnPropsEqual,y=void 0===b?o.default:b,_=l.areStatePropsEqual,S=void 0===_?o.default:_,O=l.areMergedPropsEqual,C=void 0===O?o.default:O,x=(0,s.default)(l,u),j=h(e,v,"mapStateToProps"),k=h(t,f,"mapDispatchToProps"),R=h(a,E,"mergeProps");return n(w,(0,i.default)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:j,initMapDispatchToProps:k,initMergeProps:R,pure:d,areStatesEqual:g,areOwnPropsEqual:y,areStatePropsEqual:S,areMergedPropsEqual:C},x))}}var v=g();t.default=v},1477:function(e,t,a){"use strict";var n=a(171).default;t.__esModule=!0,t.default=void 0,t.whenMapDispatchToPropsIsFunction=r,t.whenMapDispatchToPropsIsMissing=o,t.whenMapDispatchToPropsIsObject=l;var i=n(a(1478)),s=a(888);function r(e){return"function"==typeof e?(0,s.wrapMapToPropsFunc)(e,"mapDispatchToProps"):void 0}function o(e){return e?void 0:(0,s.wrapMapToPropsConstant)((function(e){return{dispatch:e}}))}function l(e){return e&&"object"==typeof e?(0,s.wrapMapToPropsConstant)((function(t){return(0,i.default)(e,t)})):void 0}var c=[r,o,l];t.default=c},1478:function(e,t,a){"use strict";t.__esModule=!0,t.default=function(e,t){var a={},n=function(n){var i=e[n];"function"==typeof i&&(a[n]=function(){return t(i.apply(void 0,arguments))})};for(var i in e)n(i);return a}},1479:function(e,t,a){"use strict";t.__esModule=!0,t.default=function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var a=t;for(;null!==Object.getPrototypeOf(a);)a=Object.getPrototypeOf(a);return t===a}},1480:function(e,t,a){"use strict";t.__esModule=!0,t.default=void 0,t.whenMapStateToPropsIsFunction=i,t.whenMapStateToPropsIsMissing=s;var n=a(888);function i(e){return"function"==typeof e?(0,n.wrapMapToPropsFunc)(e,"mapStateToProps"):void 0}function s(e){return e?void 0:(0,n.wrapMapToPropsConstant)((function(){return{}}))}var r=[i,s];t.default=r},1481:function(e,t,a){"use strict";var n=a(171).default;t.__esModule=!0,t.default=void 0,t.defaultMergeProps=s,t.whenMergePropsIsFunction=o,t.whenMergePropsIsOmitted=l,t.wrapMergePropsFunc=r;var i=n(a(130));n(a(889));function s(e,t,a){return(0,i.default)({},a,e,t)}function r(e){return function(t,a){a.displayName;var n,i=a.pure,s=a.areMergedPropsEqual,r=!1;return function(t,a,o){var l=e(t,a,o);return r?i&&s(l,n)||(n=l):(r=!0,n=l),n}}}function o(e){return"function"==typeof e?r(e):void 0}function l(e){return e?void 0:function(){return s}}var c=[o,l];t.default=c},1482:function(e,t,a){"use strict";var n=a(171).default;t.__esModule=!0,t.default=function(e,t){var a=t.initMapStateToProps,n=t.initMapDispatchToProps,l=t.initMergeProps,c=(0,i.default)(t,s),d=a(e,c),m=n(e,c),u=l(e,c);0;return(c.pure?o:r)(d,m,u,e,c)},t.impureFinalPropsSelectorFactory=r,t.pureFinalPropsSelectorFactory=o;var i=n(a(408)),s=(n(a(1483)),["initMapStateToProps","initMapDispatchToProps","initMergeProps"]);function r(e,t,a,n){return function(i,s){return a(e(i,s),t(n,s),s)}}function o(e,t,a,n,i){var s,r,o,l,c,d=i.areStatesEqual,m=i.areOwnPropsEqual,u=i.areStatePropsEqual,h=!1;function p(i,h){var p,g,v=!m(h,r),b=!d(i,s,h,r);return s=i,r=h,v&&b?(o=e(s,r),t.dependsOnOwnProps&&(l=t(n,r)),c=a(o,l,r)):v?(e.dependsOnOwnProps&&(o=e(s,r)),t.dependsOnOwnProps&&(l=t(n,r)),c=a(o,l,r)):b?(p=e(s,r),g=!u(p,o),o=p,g&&(c=a(o,l,r)),c):c}return function(i,d){return h?p(i,d):(o=e(s=i,r=d),l=t(n,r),c=a(o,l,r),h=!0,c)}}},1483:function(e,t,a){"use strict";var n=a(171).default;t.__esModule=!0,t.default=function(e,t,a,n){s(e,"mapStateToProps",n),s(t,"mapDispatchToProps",n),s(a,"mergeProps",n)};var i=n(a(890));function s(e,t,a){if(!e)throw new Error("Unexpected value for "+t+" in "+a+".");"mapStateToProps"!==t&&"mapDispatchToProps"!==t||Object.prototype.hasOwnProperty.call(e,"dependsOnOwnProps")||(0,i.default)("The selector for "+t+" of "+a+" did not specify a value for dependsOnOwnProps.")}},1484:function(e,t,a){"use strict";t.__esModule=!0,t.createDispatchHook=s,t.useDispatch=void 0;var n=a(311),i=a(891);function s(e){void 0===e&&(e=n.ReactReduxContext);var t=e===n.ReactReduxContext?i.useStore:(0,i.createStoreHook)(e);return function(){return t().dispatch}}var r=s();t.useDispatch=r},1485:function(e,t,a){"use strict";t.__esModule=!0,t.createSelectorHook=c,t.useSelector=void 0;var n=a(120),i=a(892),s=a(631),r=a(632),o=a(311),l=function(e,t){return e===t};function c(e){void 0===e&&(e=o.ReactReduxContext);var t=e===o.ReactReduxContext?i.useReduxContext:function(){return(0,n.useContext)(e)};return function(e,a){void 0===a&&(a=l);var i=t(),o=function(e,t,a,i){var o,l=(0,n.useReducer)((function(e){return e+1}),0)[1],c=(0,n.useMemo)((function(){return(0,s.createSubscription)(a,i)}),[a,i]),d=(0,n.useRef)(),m=(0,n.useRef)(),u=(0,n.useRef)(),h=(0,n.useRef)(),p=a.getState();try{if(e!==m.current||p!==u.current||d.current){var g=e(p);o=void 0!==h.current&&t(g,h.current)?h.current:g}else o=h.current}catch(e){throw d.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+d.current.stack+"\n\n"),e}return(0,r.useIsomorphicLayoutEffect)((function(){m.current=e,u.current=p,h.current=o,d.current=void 0})),(0,r.useIsomorphicLayoutEffect)((function(){function e(){try{var e=a.getState();if(e===u.current)return;var n=m.current(e);if(t(n,h.current))return;h.current=n,u.current=e}catch(e){d.current=e}l()}return c.onStateChange=e,c.trySubscribe(),e(),function(){return c.tryUnsubscribe()}}),[a,c]),o}(e,a,i.store,i.subscription);return(0,n.useDebugValue)(o),o}}var d=c();t.useSelector=d},1486:function(e,t,a){"use strict";t.__esModule=!0,t.unstable_batchedUpdates=void 0;var n=a(186);t.unstable_batchedUpdates=n.unstable_batchedUpdates},1487:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(120);function i(e,t){var a=n.useState((function(){return{inputs:t,result:e()}}))[0],i=n.useRef(!0),s=n.useRef(a),r=i.current||Boolean(t&&s.current.inputs&&function(e,t){if(e.length!==t.length)return!1;for(var a=0;a. Exported by at %(exportDate)s.",{exportDate:u},{roomName:()=>r.a.createElement("b",null,this.room.name),exporterDetails:()=>r.a.createElement("a",{href:`https://matrix.to/#/${g}`,target:"_blank",rel:"noopener noreferrer"},v?r.a.createElement(r.a.Fragment,null,r.a.createElement("b",null,v)," ("+g+")"):r.a.createElement("b",null,g))}))),w=f?Object(y.a)("Topic: %(topic)s",{topic:f}):"",S=Object(d.renderToStaticMarkup)(0!==t?r.a.createElement("div",{style:{textAlign:"center"}},r.a.createElement("a",{href:`./messages${1===t?"":t}.html`,style:{fontWeight:"bold"}},"Previous group of messages")):r.a.createElement(r.a.Fragment,null)),O=Object(d.renderToStaticMarkup)(t\n \n \n \n \n \n \n