System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:bt,ensureJQuerySupport:lt,getAppNames:Tt,getAppStatus:Ot,getMountedApps:yt,mountRootParcel:W,navigateToUrl:et,pathToActiveWhen:_t,registerApplication:Pt,removeErrorHandler:s,setBootstrapMaxTime:H,setMountMaxTime:J,setUnloadMaxTime:V,setUnmountMaxTime:Q,start:It,triggerAppChange:Mt,unloadApplication:At});var n=Object.freeze({__proto__:null,get start(){return It},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return H},get setMountMaxTime(){return J},get setUnmountMaxTime(){return Q},get setUnloadMaxTime(){return V},get registerApplication(){return Pt},get getMountedApps(){return yt},get getAppStatus(){return Ot},get unloadApplication(){return At},get checkActivityFunctions(){return bt},get getAppNames(){return Tt},get pathToActiveWhen(){return _t},get navigateToUrl(){return et},get triggerAppChange(){return Mt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return W},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return O}});function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e},u=[];function a(t,n,e){var r=l(t,n,e);u.length?u.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(e){var r=e===t;return n=n||r,!r})),n}function f(t,n){for(var e=arguments.length,r=new Array(e>2?e-2:0),o=2;o0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var e=0;e=0&&tt[e].forEach((function(e){try{e.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function ot(){Lt([],arguments)}function it(t,n){return function(){var e=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Y&&e===o||ot(ut(window.history.state,n)),r}}function ut(t,n){var e;try{e=new PopStateEvent("popstate",{state:t})}catch(n){(e=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return e.singleSpa=!0,e.singleSpaTrigger=n,e}if(Z){window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var at=window.addEventListener,ct=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||D(tt[t],(function(t){return t===n})))return at.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return ct.apply(this,arguments);tt[t]=tt[t].filter((function(t){return t!==n}))},window.history.pushState=it(window.history.pushState,"pushState"),window.history.replaceState=it(window.history.replaceState,"replaceState"),window.singleSpaNavigate=et}function st(t){var n=document.createElement("a");return n.href=t,n}var ft=!1;function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return pt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return pt.call(this,e,window.removeEventListener,t,n,arguments)},ft=!0}}function pt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach((function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))})),""===e.trim()?this:t.apply(this,o))}var ht={};function mt(t){return Promise.resolve().then((function(){var n=ht[A(t)];return n?t.status===p?(dt(t,n),t):"UNLOADING"===t.status?n.promise.then((function(){return t})):t.status!==v?t:(t.status="UNLOADING",q(t,"unload").then((function(){return dt(t,n),t})).catch((function(e){return function(t,n,e){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(e,t,O),n.reject(e)}(t,n,e),t}))):t}))}function dt(t,n){delete ht[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function vt(t,n,e,r){ht[A(t)]={app:t,resolve:e,reject:r},Object.defineProperty(ht[A(t)],"promise",{get:n})}function wt(t){return ht[t]}var gt=[];function Et(){var t=[],n=[],e=[],r=[],o=(new Date).getTime();return gt.forEach((function(i){var u=i.status!==O&&b(i);switch(i.status){case T:o-i.loadErrorTime>=200&&e.push(i);break;case p:u&&e.push(i);break;case m:case v:!u&&wt(A(i))?t.push(i):u&&r.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:e,appsToMount:r}}function yt(){return gt.filter(P).map(A)}function Tt(){return gt.map(A)}function Ot(t){var n=D(gt,(function(n){return A(n)===t}));return n?n.status:null}function Pt(t,n,r,o){var i=function(t,n,r,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===e(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],r=Object.keys(t).reduce((function(t,e){return n.indexOf(e)>=0?t:t.concat(e)}),[]);if(0!==r.length)throw Error(f(38,!1,n.join(", "),r.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==e(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!St(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,e,r){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof e)throw Error(f(24,!1));if(!St(r))throw Error(f(22,!1))}(t,n,r,o),u.name=t,u.loadApp=n,u.activeWhen=r,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:_t(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,r,o);if(-1!==Tt().indexOf(i.name))throw Error(f(21,!1,i.name));gt.push(_({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),Z&&(lt(),Lt())}function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return gt.filter((function(n){return n.activeWhen(t)})).map(A)}function At(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var e=D(gt,(function(n){return A(n)===t}));if(!e)throw Error(f(27,!1,t));var r,o=wt(A(e));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){vt(e,(function(){return i}),t,n)}));return i}return o?(r=o.promise,Nt(e,o.resolve,o.reject)):r=new Promise((function(t,n){vt(e,(function(){return r}),t,n),Nt(e,t,n)})),r}function Nt(t,n,e){j(t).then(mt).then((function(){n(),setTimeout((function(){Lt()}))})).catch(e)}function St(t){return!t||"function"==typeof t||"object"===e(t)&&null!==t&&!Array.isArray(t)}function _t(t){var n=function(t){for(var n=0,e=!1,r="^",o=0;o0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Dt)return new Promise((function(t,e){Ut.push({resolve:t,reject:e,eventArguments:n})}));var e,o=Et(),u=o.appsToUnload,a=o.appsToUnmount,c=o.appsToLoad,s=o.appsToMount;return xt()?(Dt=!0,e=u.concat(c,a,s),l()):(e=c,f());function f(){return Promise.resolve().then((function(){var t=c.map(X);return Promise.all(t).then(m).then((function(){return[]})).catch((function(t){throw m(),t}))}))}function l(){return Promise.resolve().then((function(){window.dispatchEvent(new i(0===e.length?"single-spa:before-no-app-change":"single-spa:before-app-change",d(!0))),window.dispatchEvent(new i("single-spa:before-routing-event",d(!0)));var n=u.map(mt),r=a.map(j).map((function(t){return t.then(mt)})).concat(n),o=Promise.all(r);o.then((function(){window.dispatchEvent(new i("single-spa:before-mount-routing-event",d(!0)))}));var f=c.map((function(t){return X(t).then((function(t){return Rt(t,o)}))})),l=s.filter((function(t){return c.indexOf(t)<0})).map((function(t){return Rt(t,o)}));return o.catch((function(t){throw m(),t})).then((function(){return m(),Promise.all(f.concat(l)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(h)}))}))}function h(){var n=yt();t.forEach((function(t){return t.resolve(n)}));try{var r=0===e.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new i(r,d())),window.dispatchEvent(new i("single-spa:routing-event",d()))}catch(t){setTimeout((function(){throw t}))}if(Dt=!1,Ut.length>0){var o=Ut;Ut=[],Lt(o)}return n}function m(){t.forEach((function(t){rt(t.eventArguments)})),rt(n)}function d(){var t,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i={},f=(r(t={},g,[]),r(t,v,[]),r(t,p,[]),r(t,O,[]),t);return o?(c.concat(s).forEach((function(t,n){l(t,g)})),u.forEach((function(t){l(t,p)})),a.forEach((function(t){l(t,v)}))):e.forEach((function(t){l(t)})),{detail:{newAppStatuses:i,appsByNewStatus:f,totalAppChanges:e.length,originalEvent:null==n?void 0:n[0]}};function l(t,n){var e=A(t);n=n||Ot(e),i[e]=n,(f[n]=f[n]||[]).push(e)}}}function Rt(t,n){return b(t)?R(t).then((function(t){return n.then((function(){return b(t)?B(t):t}))})):n.then((function(){return t}))}var jt=!1;function It(t){var n;jt=!0,t&&t.urlRerouteOnly&&(n=t.urlRerouteOnly,Y=n),Z&&Lt()}function xt(){return jt}Z&&setTimeout((function(){jt||console.warn(f(1,!1))}),5e3);var Bt={getRawAppData:function(){return[].concat(gt)},reroute:Lt,NOT_LOADED:p,toLoadPromise:X,toBootstrapPromise:R,unregisterApplication:function(t){if(!gt.find((function(n){return A(n)===t})))throw Error(f(25,!1,t));return At(t).then((function(){var n=gt.findIndex((function(n){return A(n)===t}));gt.splice(n,1)}))}};Z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Bt)}}}));