!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.au={})}(this,function(e){"use strict";function t(e,t,i){if(t){if(t.innerError&&i)return t;const n="\n------------------------------------------------\n";e+=`${n}Inner Error:\n`,"string"==typeof t?e+=`Message: ${t}`:(t.message?e+=`Message: ${t.message}`:e+=`Unknown Inner Error Type. Displaying Inner Error as JSON:\n ${JSON.stringify(t,null," ")}`,t.stack&&(e+=`\nInner Error Stack:\n${t.stack}`,e+="\nEnd Inner Error Stack")),e+=n}let n=new Error(e);return t&&(n.innerError=t),n}const i={},n={noop(){},eachModule(){},moduleName:e=>e};n.global="undefined"!=typeof self?self:"undefined"!=typeof global?global:new Function("return this")();const r={};function s(t){e.isInitialized||(e.isInitialized=!0,"function"!=typeof Object.getPropertyDescriptor&&(Object.getPropertyDescriptor=function(e,t){let i=Object.getOwnPropertyDescriptor(e,t),n=Object.getPrototypeOf(e);for(;void 0===i&&null!==n;)i=Object.getOwnPropertyDescriptor(n,t),n=Object.getPrototypeOf(n);return i}),t(n,i,r))}e.isInitialized=!1,String.prototype.endsWith&&!function(){try{return!"ab".endsWith("a",1)}catch(e){return!0}}()||(String.prototype.endsWith=function(e,t){let i=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=e.length;let n=i.indexOf(e,t);return-1!==n&&n===t}),String.prototype.startsWith&&!function(){try{return!"ab".startsWith("b",1)}catch(e){return!0}}()||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e});{const e=Object.freeze({}),t="__metadata__";"function"!=typeof Reflect.getOwnMetadata&&(Reflect.getOwnMetadata=function(i,n,r){if(n.hasOwnProperty(t))return(n[t][r]||e)[i]}),"function"!=typeof Reflect.defineMetadata&&(Reflect.defineMetadata=function(e,i,n,r){let s=n.hasOwnProperty(t)?n[t]:n[t]={};(s[r]||(s[r]={}))[e]=i}),"function"!=typeof Reflect.metadata&&(Reflect.metadata=function(e,t){return function(i,n){Reflect.defineMetadata(e,t,i,n)}})}const o={location:window.location,history:window.history,addEventListener(e,t,i){this.global.addEventListener(e,t,i)},removeEventListener(e,t,i){this.global.removeEventListener(e,t,i)},performance:window.performance,requestAnimationFrame(e){return this.global.requestAnimationFrame(e)}};if(Element&&!Element.prototype.matches){let e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}const a={shadowDOM:!!HTMLElement.prototype.attachShadow,scopedCSS:"scoped"in document.createElement("style"),htmlTemplateElement:function(){let e=document.createElement("div");return e.innerHTML="","content"in e.children[0]}(),mutationObserver:!(!window.MutationObserver&&!window.WebKitMutationObserver),ensureHTMLTemplateElement:e=>e};let l=window.ShadowDOMPolyfill||null;const h={Element,NodeList,SVGElement,boundary:"aurelia-dom-boundary",addEventListener(e,t,i){document.addEventListener(e,t,i)},removeEventListener(e,t,i){document.removeEventListener(e,t,i)},adoptNode:e=>document.adoptNode(e),createAttribute:e=>document.createAttribute(e),createElement:e=>document.createElement(e),createTextNode:e=>document.createTextNode(e),createComment:e=>document.createComment(e),createDocumentFragment:()=>document.createDocumentFragment(),createTemplateElement(){let e=document.createElement("template");return a.ensureHTMLTemplateElement(e)},createMutationObserver:e=>new(window.MutationObserver||window.WebKitMutationObserver)(e),createCustomEvent:(e,t)=>new window.CustomEvent(e,t),dispatchEvent(e){document.dispatchEvent(e)},getComputedStyle:e=>window.getComputedStyle(e),getElementById:e=>document.getElementById(e),querySelector:e=>document.querySelector(e),querySelectorAll:e=>document.querySelectorAll(e),nextElementSibling(e){if(e.nextElementSibling)return e.nextElementSibling;do{e=e.nextSibling}while(e&&1!==e.nodeType);return e},createTemplateFromMarkup(e){let t=document.createElement("div");t.innerHTML=e;let i=t.firstElementChild;if(!i||"TEMPLATE"!==i.nodeName)throw new Error("Template markup must be wrapped in a element e.g. \x3c!-- markup here --\x3e ");return a.ensureHTMLTemplateElement(i)},appendNode(e,t){(t||document.body).appendChild(e)},replaceNode(e,t,i){t.parentNode?t.parentNode.replaceChild(e,t):null!==l?l.unwrap(i).replaceChild(l.unwrap(e),l.unwrap(t)):i.replaceChild(e,t)},removeNode(e,t){e.parentNode?e.parentNode.removeChild(e):t&&(null!==l?l.unwrap(t).removeChild(l.unwrap(e)):t.removeChild(e))},injectStyles(e,t,i,n){if(n){let t=document.getElementById(n);if(t){if("style"===t.tagName.toLowerCase())return void(t.innerHTML=e);throw new Error("The provided id does not indicate a style tag.")}}let r=document.createElement("style");return r.innerHTML=e,r.type="text/css",n&&(r.id=n),t=t||document.head,i&&t.childNodes.length>0?t.insertBefore(r,t.childNodes[0]):t.appendChild(r),r}};var c=Object.assign||function(e){for(var t=1;t{if("object"==typeof r)for(let s in r)try{if(r[s]===t)return p.set(t,i=new e(n,s)),!0}catch(e){}return r===t&&(p.set(t,i=new e(n,"default")),!0)}),i||g}static set(e,t){p.set(e,t)}};function f(e){const t=Object.keys(e);return function(i){let n=function(i){let n="function"==typeof i?i.prototype:i,r=t.length;for(;r--;){let i=t[r];Object.defineProperty(n,i,{value:e[i],writable:!0})}};return i?n(i):n}}function v(){return!0}function b(){}function w(e){return void 0===e?e={}:"function"==typeof e&&(e={validate:e}),e.validate||(e.validate=v),e.compose||(e.compose=b),e}function y(e){return function(t){return!0===e(t)}}function x(e,t){return function(i){let n=t(i);if(!0!==n)throw new Error(n||`${e} was not correctly implemented.`)}}function C(e,t){t=w(t);let i=function(n){let r="function"==typeof n?n.prototype:n;t.compose(r),i.assert(r),Object.defineProperty(r,"protocol:"+e,{enumerable:!1,configurable:!1,writable:!1,value:!0})};return i.validate=y(t.validate),i.assert=x(e,t.validate),i}function k(e,t){let i=t&&t.split("/"),n=e.trim().split("/");if("."===n[0].charAt(0)&&i){let e=i.slice(0,i.length-1);n.unshift(...e)}return function(e){for(let t=0;t0&&(e.splice(t-1,2),t-=2)}}}(n),n.join("/")}function _(e,t){if(!e)return t;if(!t)return e;let i,n=e.match(/^([^\/]*?:)\//),r=n&&n.length>0?n[1]:"";i=0===(e=e.substr(r.length)).indexOf("///")&&"file:"===r?"///":0===e.indexOf("//")?"//":0===e.indexOf("/")?"/":"";let s="/"===t.slice(-1)?"/":"",o=e.split("/"),a=t.split("/"),l=[];for(let e=0,t=o.length;eS(e).replace("%24","$");function A(e,t,i){let n=[];if(null==t)return n;if(Array.isArray(t))for(let r=0,s=t.length;r=2){let e=i[1]?decodeURIComponent(i[1]):"";o?V(t,s,e):t[r]=P(t[r],e)}else t[r]=!0}return t}let N=class{constructor(e,t){this.src=e,this.name=t}},T=class{constructor(e){this.templateIsLoaded=!1,this.factoryIsReady=!1,this.resources=null,this.dependencies=null,this.address=e,this.onReady=null,this._template=null,this._factory=null}get template(){return this._template}set template(e){let t,i,n,r,s=this.address;this._template=e,this.templateIsLoaded=!0,t=e.content.querySelectorAll("require"),r=this.dependencies=new Array(t.length);for(let e=0,o=t.length;e element in ${s} has no "from" attribute.`);r[e]=new N(k(n,s),i.getAttribute("as")),i.parentNode&&i.parentNode.removeChild(i)}}get factory(){return this._factory}set factory(e){this._factory=e,this.factoryIsReady=!0}addDependency(e,t){let i="string"==typeof e?k(e,this.address):m.get(e).moduleId;this.dependencies.push(new N(i,t))}},M=class{constructor(){this.templateRegistry={}}map(e,t){throw new Error("Loaders must implement map(id, source).")}normalizeSync(e,t){throw new Error("Loaders must implement normalizeSync(moduleId, relativeTo).")}normalize(e,t){throw new Error("Loaders must implement normalize(moduleId: string, relativeTo: string): Promise.")}loadModule(e){throw new Error("Loaders must implement loadModule(id).")}loadAllModules(e){throw new Error("Loader must implement loadAllModules(ids).")}loadTemplate(e){throw new Error("Loader must implement loadTemplate(url).")}loadText(e){throw new Error("Loader must implement loadText(url).")}applyPluginToUrl(e,t){throw new Error("Loader must implement applyPluginToUrl(url, pluginName).")}addPlugin(e,t){throw new Error("Loader must implement addPlugin(pluginName, implementation).")}getOrCreateTemplateRegistryEntry(e){return this.templateRegistry[e]||(this.templateRegistry[e]=new T(e))}};class I{async loadTemplate(e,t){const i=await e.loadText(t.address);t.template=r.createTemplateFromMarkup(i)}}n.Loader=class extends M{constructor(){super(),this.moduleRegistry=Object.create(null),this.loaderPlugins=Object.create(null),this.modulesBeingLoaded=new Map,this.baseUrl=location.origin||`${location.protocol}//${location.hostname}${location.port?`:${location.port}`:""}`,this.useTemplateLoader(new I),this.addPlugin("template-registry-entry",{fetch:async e=>{const t=this.getOrCreateTemplateRegistryEntry(e);return t.templateIsLoaded||await this.templateLoader.loadTemplate(this,t),t}}),n.eachModule=(e=>{const t=this.moduleRegistry;Object.getOwnPropertyNames(t).some(i=>{const n=t[i].exports;return"object"==typeof n&&e(i,n)})})}async _import(e){const t=e.split("!"),i=t.splice(t.length-1,1)[0],n=1===t.length?t[0]:null;if(n){const e=this.loaderPlugins[n];if(!e)throw new Error(`Plugin ${n} is not registered in the loader.`);return await e.fetch(i)}return import(_(this.baseUrl,i)).then(e=>(this.moduleRegistry[i]=e,e))}map(e,t){}normalizeSync(e,t){return e}normalize(e,t){return Promise.resolve(e)}useTemplateLoader(e){this.templateLoader=e}loadAllModules(e){return Promise.all(e.map(e=>this.loadModule(e)))}async loadModule(e){let t=this.moduleRegistry[e];if(t)return t;let i=this.modulesBeingLoaded.get(e);if(i)return i;i=this._import(e),this.modulesBeingLoaded.set(e,i);const n=await i;return this.moduleRegistry[e]=function(e,t){let i,n,r=e;if(m.set(r,new m(t,"")),"object"==typeof r)for(i in r)"function"==typeof(n=r[i])&&m.set(n,new m(t,i));return e}(n,e),this.modulesBeingLoaded.delete(e),n}loadTemplate(e){return this.loadModule(this.applyPluginToUrl(e,"template-registry-entry"))}async loadText(e){return fetch(e).then(e=>e.text())}applyPluginToUrl(e,t){return`${t}!${e}`}addPlugin(e,t){this.loaderPlugins[e]=t}};const L={none:0,error:10,warn:20,info:30,debug:40};let j={},B=[],F=L.none;const q=["none","error","warn","info","debug"];function z(e){return q.filter(t=>t===e).length>0}function $(){return[this,...arguments]}function D(e){const t=L[e];return function(){if(this.levelt!==e)},getAppenders:function(){return[...B]},clearAppenders:function(){B=[],function(){let e=K.prototype;for(let t in L)"none"!==t&&(e[t]=function(){})}()},addCustomLevel:function(e,t){if(void 0!==L[e])throw Error(`Log level "${e}" already exists.`);if(isNaN(t))throw Error("Value must be a number.");L[e]=t,B.length>0?U():K.prototype[e]=function(){}},removeCustomLevel:function(e){if(void 0!==L[e]){if(z(e))throw Error(`Built-in log level "${e}" cannot be removed.`);delete L[e],delete K.prototype[e]}},setLevel:G,getLevel:function(){return F},Logger:K});const re=C.create("aurelia:resolver",function(e){return"function"==typeof e.get||"Resolvers must implement: get(container: Container, key: any): any"});let se=re()(X=class{constructor(e,t){this.strategy=e,this.state=t}get(e,t){switch(this.strategy){case 0:return this.state;case 1:let i=e.invoke(this.state);return this.state=i,this.strategy=0,i;case 2:return e.invoke(this.state);case 3:return this.state(e,t,this);case 4:return this.state[0].get(e,t);case 5:return e.get(this.state);default:throw new Error("Invalid strategy: "+this.strategy)}}})||X,oe=re()(Y=class e{constructor(e){this._key=e}get(e){return()=>e.get(this._key)}static of(t){return new e(t)}})||Y,ae=re()(J=class e{constructor(e){this._key=e}get(e){return e.getAll(this._key)}static of(t){return new e(t)}})||J,le=re()(Z=class e{constructor(e,t=!0){this._key=e,this._checkParent=t}get(e){return e.hasResolver(this._key,this._checkParent)?e.get(this._key):null}static of(t,i=!0){return new e(t,i)}})||Z,he=re()(ee=class e{constructor(e){this._key=e}get(e){return e.parent?e.parent.get(this._key):null}static of(t){return new e(t)}})||ee,ce=re()(te=class e{constructor(e){this._key=e}get(e){let t=this._key,i=e.getResolver(t);return i&&3===i.strategy&&(t=i.state),(...i)=>e.invoke(t,i)}static of(t){return new e(t)}})||te,ue=re()(ie=class e{constructor(e,...t){this.key=e,this.asKey=e,this.dynamicDependencies=t}get(e){let t=this.dynamicDependencies.length>0?this.dynamicDependencies.map(t=>t["protocol:aurelia:resolver"]?t.get(e):e.get(t)):void 0,i=this.key,n=e.getResolver(i);n&&3===n.strategy&&(i=n.state);const r=e.invoke(i,t);return e.registerInstance(this.asKey,r),r}as(e){return this.asKey=e,this}static of(t,...i){return new e(t,...i)}})||ie;function de(e){return _e(e),e.inject}let pe=class{invoke(e,t,i){let n=i.length,r=new Array(n);for(;n--;)r[n]=e.get(i[n]);return t.apply(void 0,r)}invokeWithDynamicDependencies(e,t,i,n){let r=i.length,s=new Array(r);for(;r--;)s[r]=e.get(i[r]);return void 0!==n&&(s=s.concat(n)),t.apply(void 0,s)}};function ge(e){return function(t){d.define(d.registration,e,t)}}pe.instance=new pe;let me=class{constructor(e){this._key=e}registerResolver(e,t,i){let n=e.getResolver(this._key||t);return void 0===n?e.registerTransient(this._key||t,i):n}},fe=class{constructor(e,t=!1){"boolean"==typeof e?this._registerInChild=e:(this._key=e,this._registerInChild=t)}registerResolver(e,t,i){let n=this._registerInChild?e:e.root,r=n.getResolver(this._key||t);return void 0===r?n.registerSingleton(this._key||t,i):r}};function ve(e){if(null==e)throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?")}const be=Object.freeze([]);d.registration="aurelia:registration",d.invoker="aurelia:invoker";let we=re.decorates,ye=class{constructor(e,t,i){this.fn=e,this.invoker=t,this.dependencies=i}invoke(e,t){return void 0!==t?this.invoker.invokeWithDynamicDependencies(e,this.fn,this.dependencies,t):this.invoker.invoke(e,this.fn,this.dependencies)}};function xe(e,t,i,n){let r,s=i.length,o=new Array(s);for(;s--;){if(null==(r=i[s]))throw new Error("Constructor Parameter with index "+s+" cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?");o[s]=e.get(r)}return void 0!==n&&(o=o.concat(n)),Reflect.construct(t,o)}let Ce={0:{invoke:(e,t)=>new t,invokeWithDynamicDependencies:xe},1:{invoke:(e,t,i)=>new t(e.get(i[0])),invokeWithDynamicDependencies:xe},2:{invoke:(e,t,i)=>new t(e.get(i[0]),e.get(i[1])),invokeWithDynamicDependencies:xe},3:{invoke:(e,t,i)=>new t(e.get(i[0]),e.get(i[1]),e.get(i[2])),invokeWithDynamicDependencies:xe},4:{invoke:(e,t,i)=>new t(e.get(i[0]),e.get(i[1]),e.get(i[2]),e.get(i[3])),invokeWithDynamicDependencies:xe},5:{invoke:(e,t,i)=>new t(e.get(i[0]),e.get(i[1]),e.get(i[2]),e.get(i[3]),e.get(i[4])),invokeWithDynamicDependencies:xe},fallback:{invoke:xe,invokeWithDynamicDependencies:xe}};let ke=class e{constructor(e){void 0===e&&(e={}),this._configuration=e,this._onHandlerCreated=e.onHandlerCreated,this._handlers=e.handlers||(e.handlers=new Map),this._resolvers=new Map,this.root=this,this.parent=null}makeGlobal(){return e.instance=this,this}setHandlerCreatedCallback(e){this._onHandlerCreated=e,this._configuration.onHandlerCreated=e}registerInstance(e,t){return this.registerResolver(e,new se(0,void 0===t?e:t))}registerSingleton(e,t){return this.registerResolver(e,new se(1,void 0===t?e:t))}registerTransient(e,t){return this.registerResolver(e,new se(2,void 0===t?e:t))}registerHandler(e,t){return this.registerResolver(e,new se(3,t))}registerAlias(e,t){return this.registerResolver(t,new se(5,e))}registerResolver(e,t){ve(e);let i=this._resolvers,n=i.get(e);return void 0===n?i.set(e,t):4===n.strategy?n.state.push(t):i.set(e,new se(4,[n,t])),t}autoRegister(e,t){if("function"==typeof(t=void 0===t?e:t)){let i=d.get(d.registration,t);return void 0===i?this.registerResolver(e,new se(1,t)):i.registerResolver(this,e,t)}return this.registerResolver(e,new se(0,t))}autoRegisterAll(e){let t=e.length;for(;t--;)this.autoRegister(e[t])}unregister(e){this._resolvers.delete(e)}hasResolver(e,t=!1){return ve(e),this._resolvers.has(e)||t&&null!==this.parent&&this.parent.hasResolver(e,t)}getResolver(e){return this._resolvers.get(e)}get(t){if(ve(t),t===e)return this;if(we(t))return t.get(this,t);let i=this._resolvers.get(t);if(void 0===i){if(null===this.parent)return this.autoRegister(t).get(this,t);let e=d.get(d.registration,t);return void 0===e?this.parent._get(t):e.registerResolver(this,t,t).get(this,t)}return i.get(this,t)}_get(e){let t=this._resolvers.get(e);return void 0===t?null===this.parent?this.autoRegister(e).get(this,e):this.parent._get(e):t.get(this,e)}getAll(e){ve(e);let t=this._resolvers.get(e);if(void 0===t)return null===this.parent?be:this.parent.getAll(e);if(4===t.strategy){let i=t.state,n=i.length,r=new Array(n);for(;n--;)r[n]=i[n].get(this,e);return r}return[t.get(this,e)]}createChild(){let t=new e(this._configuration);return t.root=this.root,t.parent=this,t}invoke(e,i){try{let n=this._handlers.get(e);return void 0===n&&(n=this._createInvocationHandler(e),this._handlers.set(e,n)),n.invoke(this,i)}catch(i){throw new t(`Error invoking ${e.name}. Check the inner error for details.`,i,!0)}}_createInvocationHandler(e){let t;if(void 0===e.inject)t=d.getOwn(d.paramTypes,e)||be;else{t=[];let n=e;for(;"function"==typeof n;)t.push(...(i=n,i.hasOwnProperty("inject")?"function"==typeof i.inject?i.inject():i.inject:[])),n=Object.getPrototypeOf(n)}var i;let n=d.getOwn(d.invoker,e)||Ce[t.length]||Ce.fallback,r=new ye(e,n,t);return void 0!==this._onHandlerCreated?this._onHandlerCreated(r):r}};function _e(e){let t=function(e){e.hasOwnProperty("inject")||(e.inject=(d.getOwn(d.paramTypes,e)||be).slice())};return e?t(e):t}function Se(...e){return function(t,i,n){if("number"==typeof n)return _e(t),void(1===e.length&&(t.inject[n]=e[0]));if(n){n.value.inject=e}else t.inject=e}}function Ee(e){return function(){let t=setTimeout(n,0),i=setInterval(n,50);function n(){clearTimeout(t),clearInterval(i),e()}}}let Ae=class{constructor(){this.flushing=!1,this.longStacks=!1,this.microTaskQueue=[],this.microTaskQueueCapacity=1024,this.taskQueue=[],i.mutationObserver?this.requestFlushMicroTaskQueue=function(e){let t=r.createMutationObserver(e),i="a",n=r.createTextNode("a"),s=Object.create(null);return s.a="b",s.b="a",t.observe(n,{characterData:!0}),function(){n.data=i=s[i]}}(()=>this.flushMicroTaskQueue()):this.requestFlushMicroTaskQueue=Ee(()=>this.flushMicroTaskQueue()),this.requestFlushTaskQueue=Ee(()=>this.flushTaskQueue())}_flushQueue(e,t){let i,n=0;try{for(this.flushing=!0;nt){for(let t=0,i=e.length-n;t{throw e},0)}(e,i,this.longStacks)}finally{this.flushing=!1}}queueMicroTask(e){this.microTaskQueue.length<1&&this.requestFlushMicroTaskQueue(),this.longStacks&&(e.stack=this.prepareQueueStack("\nEnqueued in MicroTaskQueue by:\n")),this.microTaskQueue.push(e)}queueTask(e){this.taskQueue.length<1&&this.requestFlushTaskQueue(),this.longStacks&&(e.stack=this.prepareQueueStack("\nEnqueued in TaskQueue by:\n")),this.taskQueue.push(e)}flushTaskQueue(){let e=this.taskQueue;this.taskQueue=[],this._flushQueue(e,Number.MAX_VALUE)}flushMicroTaskQueue(){let e=this.microTaskQueue;this._flushQueue(e,this.microTaskQueueCapacity),e.length=0}prepareQueueStack(e){let t=e+function(e){return e.replace(/^[\s\S]*?\bqueue(Micro)?Task\b[^\n]*\n/,"")}(function(){let e=new Error;if(e.stack)return e.stack;try{throw e}catch(e){return e.stack}}());return"string"==typeof this.stack&&(t=Oe(t)+this.stack),t}};function Oe(e){let t=e.lastIndexOf("flushMicroTaskQueue");return t<0&&(t=e.lastIndexOf("flushTaskQueue"))<0?e:(t=e.lastIndexOf("\n",t))<0?e:e.substr(0,t)}var Pe,Ve,Re,Ne,Te,Me,Ie,Le,je,Be,Fe,qe,ze;const $e="Binding:source",De=Object.create(null);function He(e){if(e in De)return De[e];const t=e.charAt(0).toLowerCase()+e.slice(1).replace(/[_.-](\w|$)/g,(e,t)=>t.toUpperCase());return De[e]=t,t}function Ue(e,t){return{bindingContext:e,parentOverrideContext:t||null}}function We(e,t,i){let n=t.overrideContext;if(i){for(;i&&n;)i--,n=n.parentOverrideContext;if(i||!n)return;return e in n?n:n.bindingContext}for(;n&&!(e in n)&&!(n.bindingContext&&e in n.bindingContext);)n=n.parentOverrideContext;return n?e in n?n:n.bindingContext:t.bindingContext||t.overrideContext}const Qe=[],Ge=[];for(let e=0;e<100;e++)Qe.push(`_observer${e}`),Ge.push(`_observerVersion${e}`);function Ke(e){let t=void 0===this._observerSlots?0:this._observerSlots,i=t;for(;i--&&this[Qe[i]]!==e;);if(-1===i){for(i=0;this[Qe[i]];)i++;this[Qe[i]]=e,e.subscribe($e,this),i===t&&(this._observerSlots=i+1)}void 0===this._version&&(this._version=0),this[Ge[i]]=this._version}function Xe(e,t){let i=this.observerLocator.getObserver(e,t);Ke.call(this,i)}function Ye(e){let t=this.observerLocator.getArrayObserver(e);Ke.call(this,t)}function Je(e){let t=this._observerSlots;for(;t--;)if(e||this[Ge[t]]!==this._version){let e=this[Qe[t]];this[Qe[t]]=null,e&&e.unsubscribe($e,this)}}function Ze(){return function(e){e.prototype.observeProperty=Xe,e.prototype.observeArray=Ye,e.prototype.unobserve=Je,e.prototype.addObserver=Ke}}const et=[],tt={};let it=0;const nt=100,rt=15;let st=!1,ot=0;function at(e){const t=et.length;let i=0;for(;irt)break}et.splice(0,i),et.length?n.requestAnimationFrame(at):(st=!1,ot=0)}function lt(e){if(otr;)r++;return!(r>=i.length)&&(n.splice(r,1),i.splice(r,1),!0)}let ut=[],dt=[],pt=[];function gt(e,t){let i,n,r,s,o=this._context0,a=this._callable0,l=this._context1,h=this._callable1,c=this._context2,u=this._callable2,d=this._contextsRest?this._contextsRest.length:0;if(d){for(r=pt.length;r--&&pt[r];);for(r<0?(r=pt.length,i=[],n=[],pt.push(!0),ut.push(i),dt.push(n)):(pt[r]=!0,i=ut[r],n=dt[r]),s=d;s--;)i[s]=this._contextsRest[s],n[s]=this._callablesRest[s]}if(o&&(a?a.call(o,e,t):o(e,t)),l&&(h?h.call(l,e,t):l(e,t)),c&&(u?u.call(c,e,t):c(e,t)),d){for(s=0;s{this.unsubscribe(e,t)}}}unsubscribe(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&(this.unobserve(!0),this.oldValue=void 0)}call(){let e=this.expression.evaluate(this.scope,this.lookupFunctions),t=this.oldValue;e!==t&&(this.oldValue=e,this.callSubscribers(e,t)),this._version++,this.expression.connect(this,this.scope),this.unobserve(!1)}})||Pe)||Pe;function wt(e){return+e}function yt(e,t,i){return{index:e,removed:t,addedCount:i}}function xt(){}xt.prototype={calcEditDistances:function(e,t,i,n,r,s){let o,a,l=s-r+1,h=i-t+1,c=new Array(l);for(let e=0;e0||i>0;){if(0===t){r.push(2),i--;continue}if(0===i){r.push(3),t--;continue}let s,o=e[t-1][i-1],a=e[t-1][i],l=e[t][i-1];(s=a=0){e.splice(t,1),t--,o-=i.addedCount-i.removed.length,r.addedCount+=i.addedCount-n;let a=r.removed.length+i.removed.length-n;if(r.addedCount||a){let e=i.removed;if(r.indexi.index+i.addedCount){let t=r.removed.slice(i.index+i.addedCount-r.index);Array.prototype.push.apply(e,t)}r.removed=e,i.index>>0)continue;let e=wt(r.name);if(e<0)continue;_t(i,e,[r.oldValue],"delete"===r.type?0:1);break;default:console.error("Unexpected record type: "+JSON.stringify(r))}}var n;return i}(0,t).forEach(function(t){1!==t.addedCount||1!==t.removed.length?i=i.concat(kt(e,t.index,t.index+t.addedCount,t.removed,0,t.removed.length)):t.removed[0]!==e[t.index]&&i.push(t)}),i}function Et(e){let t,i=new Array(e.size),n=e.keys(),r=0;for(;(t=n.next())&&!t.done;)i[r]=(s="added",o=e,a=t.value,{type:s,object:o,key:a,oldValue:void 0}),r++;var s,o,a;return i}let At=vt()(Ve=class{constructor(e,t){this.taskQueue=e,this.queued=!1,this.changeRecords=null,this.oldCollection=null,this.collection=t,this.lengthPropertyName=t instanceof Map||t instanceof Set?"size":"length"}subscribe(e,t){this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)}addChangeRecord(e){if(this.hasSubscribers()||this.lengthObserver){if("splice"===e.type){let t=e.index,i=e.object.length;t>i?t=i-e.addedCount:t<0&&(t=i+e.removed.length+t-e.addedCount),t<0&&(t=0),e.index=t}null===this.changeRecords?this.changeRecords=[e]:this.changeRecords.push(e),this.queued||(this.queued=!0,this.taskQueue.queueMicroTask(this))}}flushChangeRecords(){(this.changeRecords&&this.changeRecords.length||this.oldCollection)&&this.call()}reset(e){this.oldCollection=e,this.hasSubscribers()&&!this.queued&&(this.queued=!0,this.taskQueue.queueMicroTask(this))}getLengthObserver(){return this.lengthObserver||(this.lengthObserver=new Ot(this.collection))}call(){let e,t=this.changeRecords,i=this.oldCollection;this.queued=!1,this.changeRecords=[],this.oldCollection=null,this.hasSubscribers()&&(e=i?this.collection instanceof Map||this.collection instanceof Set?Et(i):kt(this.collection,0,this.collection.length,i,0,i.length):this.collection instanceof Map||this.collection instanceof Set?t:St(this.collection,t),this.callSubscribers(e)),this.lengthObserver&&this.lengthObserver.call(this.collection[this.lengthPropertyName])}})||Ve,Ot=vt()(Re=class{constructor(e){this.collection=e,this.lengthPropertyName=e instanceof Map||e instanceof Set?"size":"length",this.currentValue=e[this.lengthPropertyName]}getValue(){return this.collection[this.lengthPropertyName]}setValue(e){this.collection[this.lengthPropertyName]=e}subscribe(e,t){this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)}call(e){let t=this.currentValue;this.callSubscribers(e,t),this.currentValue=e}})||Re;const Pt=Array.prototype,Vt=Pt.pop,Rt=Pt.push,Nt=Pt.reverse,Tt=Pt.shift,Mt=Pt.sort,It=Pt.splice,Lt=Pt.unshift;function jt(e,t){return Bt.for(e,t)}Pt.__au_patched__?W("array-observation").warn("Detected 2nd attempt of patching array from Aurelia binding. This is probably caused by dependency mismatch between core modules and a 3rd party plugin. Please see https://github.com/aurelia/cli/pull/906 if you are using webpack."):(Reflect.defineProperty(Pt,"__au_patched__",{value:1}),Pt.pop=function(){let e=this.length>0,t=Vt.apply(this,arguments);return e&&void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"delete",object:this,name:this.length,oldValue:t}),t},Pt.push=function(){let e=Rt.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:this.length-arguments.length,removed:[],addedCount:arguments.length}),e},Pt.reverse=function(){let e;void 0!==this.__array_observer__&&(this.__array_observer__.flushChangeRecords(),e=this.slice());let t=Nt.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.reset(e),t},Pt.shift=function(){let e=this.length>0,t=Tt.apply(this,arguments);return e&&void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"delete",object:this,name:0,oldValue:t}),t},Pt.sort=function(){let e;void 0!==this.__array_observer__&&(this.__array_observer__.flushChangeRecords(),e=this.slice());let t=Mt.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.reset(e),t},Pt.splice=function(){let e=It.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:+arguments[0],removed:e,addedCount:arguments.length>2?arguments.length-2:0}),e},Pt.unshift=function(){let e=Lt.apply(this,arguments);return void 0!==this.__array_observer__&&this.__array_observer__.addChangeRecord({type:"splice",object:this,index:0,removed:[],addedCount:arguments.length}),e});let Bt=class e extends At{constructor(e,t){super(e,t)}static for(t,i){return"__array_observer__"in i||Reflect.defineProperty(i,"__array_observer__",{value:e.create(t,i),enumerable:!1,configurable:!1}),i.__array_observer__}static create(t,i){return new e(t,i)}},Ft=class{constructor(){this.isAssignable=!1}evaluate(e,t,i){throw new Error(`Binding expression "${this}" cannot be evaluated.`)}assign(e,t,i){throw new Error(`Binding expression "${this}" cannot be assigned to.`)}toString(){return super.toString()}},qt=class extends Ft{constructor(e,t,i){super(),this.expression=e,this.name=t,this.args=i}evaluate(e,t){return this.expression.evaluate(e,t)}assign(e,t,i){return this.expression.assign(e,t,i)}accept(e){return e.visitBindingBehavior(this)}connect(e,t){this.expression.connect(e,t)}bind(e,t,i){this.expression.expression&&this.expression.bind&&this.expression.bind(e,t,i);let n=i.bindingBehaviors(this.name);if(!n)throw new Error(`No BindingBehavior named "${this.name}" was found!`);let r=`behavior-${this.name}`;if(e[r])throw new Error(`A binding behavior named "${this.name}" has already been applied to "${this.expression}"`);e[r]=n,n.bind.apply(n,[e,t].concat(ri(t,this.args,e.lookupFunctions)))}unbind(e,t){let i=`behavior-${this.name}`;e[i].unbind(e,t),e[i]=null,this.expression.expression&&this.expression.unbind&&this.expression.unbind(e,t)}},zt=class extends Ft{constructor(e,t,i){super(),this.expression=e,this.name=t,this.args=i,this.allArgs=[e].concat(i)}evaluate(e,t){let i=t.valueConverters(this.name);if(!i)throw new Error(`No ValueConverter named "${this.name}" was found!`);return"toView"in i?i.toView.apply(i,ri(e,this.allArgs,t)):this.allArgs[0].evaluate(e,t)}assign(e,t,i){let n=i.valueConverters(this.name);if(!n)throw new Error(`No ValueConverter named "${this.name}" was found!`);return"fromView"in n&&(t=n.fromView.apply(n,[t].concat(ri(e,this.args,i)))),this.allArgs[0].assign(e,t,i)}accept(e){return e.visitValueConverter(this)}connect(e,t){let i=this.allArgs,n=i.length;for(;n--;)i[n].connect(e,t);let r=e.lookupFunctions.valueConverters(this.name);if(!r)throw new Error(`No ValueConverter named "${this.name}" was found!`);let s=r.signals;if(void 0!==s)for(n=s.length;n--;)jr(e,s[n])}},$t=class extends Ft{constructor(e,t){super(),this.target=e,this.value=t,this.isAssignable=!0}evaluate(e,t){return this.target.assign(e,this.value.evaluate(e,t))}accept(e){e.visitAssign(this)}connect(e,t){}assign(e,t){this.value.assign(e,t),this.target.assign(e,t)}},Dt=class extends Ft{constructor(e,t,i){super(),this.condition=e,this.yes=t,this.no=i}evaluate(e,t){return this.condition.evaluate(e,t)?this.yes.evaluate(e,t):this.no.evaluate(e,t)}accept(e){return e.visitConditional(this)}connect(e,t){this.condition.connect(e,t),this.condition.evaluate(t)?this.yes.connect(e,t):this.no.connect(e,t)}},Ht=class extends Ft{constructor(e){super(),this.ancestor=e}evaluate(e,t){let i=e.overrideContext,n=this.ancestor;for(;n--&&i;)i=i.parentOverrideContext;return n<1&&i?i.bindingContext:void 0}accept(e){return e.visitAccessThis(this)}connect(e,t){}},Ut=class extends Ft{constructor(e,t){super(),this.name=e,this.ancestor=t,this.isAssignable=!0}evaluate(e,t){return We(this.name,e,this.ancestor)[this.name]}assign(e,t){let i=We(this.name,e,this.ancestor);return i?i[this.name]=t:void 0}accept(e){return e.visitAccessScope(this)}connect(e,t){let i=We(this.name,t,this.ancestor);e.observeProperty(i,this.name)}},Wt=class extends Ft{constructor(e,t){super(),this.object=e,this.name=t,this.isAssignable=!0}evaluate(e,t){let i=this.object.evaluate(e,t);return null==i?i:i[this.name]}assign(e,t){let i=this.object.evaluate(e);return null==i&&(i={},this.object.assign(e,i)),i[this.name]=t,t}accept(e){return e.visitAccessMember(this)}connect(e,t){this.object.connect(e,t);let i=this.object.evaluate(t);i&&e.observeProperty(i,this.name)}},Qt=class extends Ft{constructor(e,t){super(),this.object=e,this.key=t,this.isAssignable=!0}evaluate(e,t){return function(e,t){if(Array.isArray(e))return e[parseInt(t,10)];if(e)return e[t];if(null==e)return;return e[t]}(this.object.evaluate(e,t),this.key.evaluate(e,t))}assign(e,t){return function(e,t,i){if(Array.isArray(e)){let n=parseInt(t,10);e.length<=n&&(e.length=n+1),e[n]=i}else e[t]=i;return i}(this.object.evaluate(e),this.key.evaluate(e),t)}accept(e){return e.visitAccessKeyed(this)}connect(e,t){this.object.connect(e,t);let i=this.object.evaluate(t);if(i instanceof Object){this.key.connect(e,t);let n=this.key.evaluate(t);null==n||Array.isArray(i)&&"number"==typeof n||e.observeProperty(i,n)}}},Gt=class extends Ft{constructor(e,t,i){super(),this.name=e,this.args=t,this.ancestor=i}evaluate(e,t,i){let n=ri(e,this.args,t),r=We(this.name,e,this.ancestor),s=si(r,this.name,i);if(s)return s.apply(r,n)}accept(e){return e.visitCallScope(this)}connect(e,t){let i=this.args,n=i.length;for(;n--;)i[n].connect(e,t)}},Kt=class extends Ft{constructor(e,t,i){super(),this.object=e,this.name=t,this.args=i}evaluate(e,t,i){let n=this.object.evaluate(e,t),r=ri(e,this.args,t),s=si(n,this.name,i);if(s)return s.apply(n,r)}accept(e){return e.visitCallMember(this)}connect(e,t){if(this.object.connect(e,t),si(this.object.evaluate(t),this.name,!1)){let i=this.args,n=i.length;for(;n--;)i[n].connect(e,t)}}},Xt=class extends Ft{constructor(e,t){super(),this.func=e,this.args=t}evaluate(e,t,i){let n=this.func.evaluate(e,t);if("function"==typeof n)return n.apply(null,ri(e,this.args,t));if(i||null!=n)throw new Error(`${this.func} is not a function`)}accept(e){return e.visitCallFunction(this)}connect(e,t){if(this.func.connect(e,t),"function"==typeof this.func.evaluate(t)){let i=this.args,n=i.length;for(;n--;)i[n].connect(e,t)}}},Yt=class extends Ft{constructor(e,t,i){super(),this.operation=e,this.left=t,this.right=i}evaluate(e,t){let i=this.left.evaluate(e,t);switch(this.operation){case"&&":return i&&this.right.evaluate(e,t);case"||":return i||this.right.evaluate(e,t)}let n=this.right.evaluate(e,t);switch(this.operation){case"==":return i==n;case"===":return i===n;case"!=":return i!=n;case"!==":return i!==n;case"instanceof":return"function"==typeof n&&i instanceof n;case"in":return"object"==typeof n&&null!==n&&i in n}if(null===i||null===n||void 0===i||void 0===n){switch(this.operation){case"+":return null!=i?i:null!=n?n:0;case"-":return null!=i?i:null!=n?0-n:0}return null}switch(this.operation){case"+":return function(e,t){if(null!==e&&null!==t)return"string"==typeof e&&"string"!=typeof t?e+t.toString():"string"!=typeof e&&"string"==typeof t?e.toString()+t:e+t;if(null!==e)return e;if(null!==t)return t;return 0}(i,n);case"-":return i-n;case"*":return i*n;case"/":return i/n;case"%":return i%n;case"<":return i":return i>n;case"<=":return i<=n;case">=":return i>=n;case"^":return i^n}throw new Error(`Internal error [${this.operation}] not handled`)}accept(e){return e.visitBinary(this)}connect(e,t){this.left.connect(e,t);let i=this.left.evaluate(t);"&&"===this.operation&&!i||"||"===this.operation&&i||this.right.connect(e,t)}},Jt=class extends Ft{constructor(e,t){super(),this.operation=e,this.expression=t}evaluate(e,t){switch(this.operation){case"!":return!this.expression.evaluate(e,t);case"typeof":return typeof this.expression.evaluate(e,t);case"void":return void this.expression.evaluate(e,t)}throw new Error(`Internal error [${this.operation}] not handled`)}accept(e){return e.visitPrefix(this)}connect(e,t){this.expression.connect(e,t)}},Zt=class extends Ft{constructor(e){super(),this.value=e}evaluate(e,t){return this.value}accept(e){return e.visitLiteralPrimitive(this)}connect(e,t){}},ei=class extends Ft{constructor(e){super(),this.value=e}evaluate(e,t){return this.value}accept(e){return e.visitLiteralString(this)}connect(e,t){}},ti=class extends Ft{constructor(e,t,i,n){if(super(),this.cooked=e,this.expressions=t||[],this.length=this.expressions.length,this.tagged=void 0!==n,this.tagged)if(this.cooked.raw=i,this.tag=n,n instanceof Ut)this.contextType="Scope";else{if(!(n instanceof Wt||n instanceof Qt))throw new Error(`${this.tag} is not a valid template tag`);this.contextType="Object"}}getScopeContext(e,t){return We(this.tag.name,e,this.tag.ancestor)}getObjectContext(e,t){return this.tag.object.evaluate(e,t)}evaluate(e,t,i){const n=new Array(this.length);for(let i=0;i=this.len?this.err("Unexpected end of expression"):this.err()}if(e&bi)return t;let i=this.val;for(;this.tkn&Ni;)switch(this.tkn){case Di:if(this.nextToken(),this.tkn&Ai||this.err(),i=this.val,this.nextToken(),e=e&vi|(e&(di|pi))<<1|e&gi|(e&mi)>>1|(e&fi)>>2,this.tkn===zi)continue;t=e&pi?new Ut(i,t.ancestor):new Wt(t,i);continue;case Qi:this.nextToken(),e=mi,t=new Qt(t,this.parseExpression()),this.expect(Gi);break;case zi:this.nextToken();const n=[];for(;this.tkn!==Ui&&(n.push(this.parseExpression()),this.opt(Wi)););this.expect(Ui),t=e&pi?new Gt(i,n,t.ancestor):e&(gi|vi)?new Kt(t,i,n):new Xt(t,n),e=fi;break;case Ti:t=new ti([this.val],[],[this.raw],t),this.nextToken();break;case Mi:t=this.parseTemplate(e|wi,t)}return t}parseTemplate(e,t){const i=[this.val],n=e&wi?[this.raw]:void 0;this.expect(Mi);const r=[this.parseExpression()];for(;(this.tkn=this.scanTemplateTail())!==Ti;)i.push(this.val),e&wi&&n.push(this.raw),this.expect(Mi),r.push(this.parseExpression());return i.push(this.val),e&wi&&n.push(this.raw),this.nextToken(),new ti(i,r,n,t)}nextToken(){for(;this.idx=97&&this.ch<=122)return void(this.tkn=this.scanIdentifier());if(null!==(this.tkn=Tn[this.ch](this)))return}this.tkn=Si}next(){return this.ch=this.src.charCodeAt(++this.idx)}scanIdentifier(){for(;Rn.has(this.next())||this.ch>127&&Nn[this.ch];);return Cn[this.val=this.raw]||Ei}scanNumber(e){if(e)this.val=0;else for(this.val=this.ch-48;this.next()<=57&&this.ch>=48;)this.val=10*this.val+this.ch-48;if(e||46===this.ch){e||this.next();const t=this.idx;let i=this.ch-48;for(;this.next()<=57&&this.ch>=48;)i=10*i+this.ch-48;this.val=this.val+i/Math.pow(10,this.idx-t)}if(101===this.ch||69===this.ch){const e=this.idx;for(this.next(),45!==this.ch&&43!==this.ch||this.next(),this.ch>=48&&this.ch<=57||(this.idx=e,this.err("Invalid exponent"));this.next()<=57&&this.ch>=48;);this.val=parseFloat(this.src.slice(this.start,this.idx))}return Pi}scanString(){let e,t=this.ch;this.next();let i=this.idx;for(;this.ch!==t;)if(92===this.ch){let t;if(e||(e=[]),e.push(this.src.slice(i,this.idx)),this.next(),117===this.ch)if(this.next(),this.idx+4=this.len?this.err("Unterminated quote"):this.next();let n=this.src.slice(i,this.idx);this.next();let r=n;return null!=e&&(e.push(n),r=e.join("")),this.val=r,Vi}scanTemplate(){let e=!0,t="";for(;96!==this.next();)if(36===this.ch){if(this.idx+1=this.len&&this.err("Unterminated template"),this.idx--,this.scanTemplate()}err(e=`Unexpected token ${this.raw}`,t=this.start){throw new Error(`Parser Error: ${e} at column ${t} in expression [${this.src}]`)}opt(e){return this.tkn===e&&(this.nextToken(),!0)}expect(e){this.tkn===e?this.nextToken():this.err(`Missing expected token ${kn[e&xi]}`,this.idx)}};function ui(e){switch(e){case 102:return 12;case 110:return 10;case 114:return 13;case 116:return 9;case 118:return 11;default:return e}}const di=1024,pi=2048,gi=4096,mi=8192,fi=16384,vi=32768,bi=65536,wi=1<<17,yi=511,xi=63,Ci=448,ki=2048,_i=16384,Si=65536|_i|ki,Ei=1<<17,Ai=32768|Ei,Oi=1<<18,Pi=1<<19|Oi,Vi=1<<20|Oi,Ri=1<<21,Ni=1<<24,Ti=1<<25|Ni,Mi=1<<26|Ni,Ii=32768|Oi,Li=32769|Oi,ji=32770|Oi,Bi=32771|Oi,Fi=4|Ai,qi=5|Ai,zi=8198|_i|Ni,$i=8199,Di=8388616|Ni,Hi=4105|_i|ki,Ui=4106|_i|ki,Wi=11|_i,Qi=8204|_i|1<<23|Ni,Gi=4109|ki,Ki=14|_i,Xi=15,Yi=18|_i,Ji=19|_i,Zi=84|Ri,en=149|Ri,tn=214|Ri,nn=279|Ri,rn=280|Ri,sn=281|Ri,on=282|Ri,an=347|Ri,ln=348|Ri,hn=349|Ri,cn=350|Ri,un=33119|Ri,dn=33120|Ri,pn=417|Ri|1<<22,gn=418|Ri|1<<22,mn=4227107,fn=4227108,vn=485|Ri,bn=486|Ri,wn=487|Ri,yn=40,xn=4194345,Cn=Object.create(null);Cn.true=Li,Cn.null=ji,Cn.false=Ii,Cn.undefined=Bi,Cn.$this=Fi,Cn.$parent=qi,Cn.in=un,Cn.instanceof=dn,Cn.typeof=mn,Cn.void=fn;const kn=[!1,!0,null,void 0,"$this","$parent","(","{",".","}",")",",","[","]",":","?","'",'"',"&","|","||","&&","^","==","!=","===","!==","<",">","<=",">=","in","instanceof","+","-","typeof","void","*","%","/","=","!"],_n=[36,0,48,58,65,91,95,0,97,123],Sn=[36,0,65,91,95,0,97,123,170,0,186,0,192,215,216,247,248,697,736,741,7424,7462,7468,7517,7522,7526,7531,7544,7545,7615,7680,7936,8305,0,8319,0,8336,8349,8490,8492,8498,0,8526,0,8544,8585,11360,11392,42786,42888,42891,42927,42928,42936,42999,43008,43824,43867,43868,43877,64256,64263,65313,65339,65345,65371],En=[48,58],An=[0,33,127,161];function On(e,t,i,n){let r=i.length;for(let s=0;s0?o:r+1,e){let t=r;for(;t(t.next(),e)}function Vn(e){return e.err(`Unexpected character [${hi(e.ch)}]`),null}const Rn=new Set;On(null,Rn,_n,!0);const Nn=new Uint8Array(65535);On(Nn,null,Sn,1),On(Nn,null,En,1);const Tn=new Array(65535);let Mn=0;for(;Mn<65535;)Tn[Mn]=Vn,Mn++;On(Tn,null,An,e=>(e.next(),null)),On(Tn,null,Sn,e=>e.scanIdentifier()),On(Tn,null,En,e=>e.scanNumber(!1)),Tn[34]=Tn[39]=(e=>e.scanString()),Tn[96]=(e=>e.scanTemplate()),Tn[33]=(e=>61!==e.next()?xn:61!==e.next()?rn:(e.next(),on)),Tn[61]=(e=>61!==e.next()?yn:61!==e.next()?nn:(e.next(),sn)),Tn[38]=(e=>38!==e.next()?Yi:(e.next(),en)),Tn[124]=(e=>124!==e.next()?Ji:(e.next(),Zi)),Tn[46]=(e=>e.next()<=57&&e.ch>=48?e.scanNumber(!0):Di),Tn[60]=(e=>61!==e.next()?an:(e.next(),hn)),Tn[62]=(e=>61!==e.next()?ln:(e.next(),cn)),Tn[37]=Pn(bn),Tn[40]=Pn(zi),Tn[41]=Pn(Ui),Tn[42]=Pn(vn),Tn[43]=Pn(pn),Tn[44]=Pn(Wi),Tn[45]=Pn(gn),Tn[47]=Pn(wn),Tn[58]=Pn(Ki),Tn[63]=Pn(Xi),Tn[91]=Pn(Qi),Tn[93]=Pn(Gi),Tn[94]=Pn(tn),Tn[123]=Pn($i),Tn[125]=Pn(Hi);let In=Map.prototype;function Ln(e,t){return jn.for(e,t)}let jn=class e extends At{constructor(e,t){super(e,t)}static for(t,i){return"__map_observer__"in i||Reflect.defineProperty(i,"__map_observer__",{value:e.create(t,i),enumerable:!1,configurable:!1}),i.__map_observer__}static create(t,i){let n=new e(t,i),r=In;return r.set===i.set&&r.delete===i.delete&&r.clear===i.clear||(r={set:i.set,delete:i.delete,clear:i.clear}),i.set=function(){let e=i.has(arguments[0]),t=e?"update":"add",s=i.get(arguments[0]),o=r.set.apply(i,arguments);return e&&s===i.get(arguments[0])||n.addChangeRecord({type:t,object:i,key:arguments[0],oldValue:s}),o},i.delete=function(){let e=i.has(arguments[0]),t=i.get(arguments[0]),s=r.delete.apply(i,arguments);return e&&n.addChangeRecord({type:"delete",object:i,key:arguments[0],oldValue:t}),s},i.clear=function(){let e=r.clear.apply(i,arguments);return n.addChangeRecord({type:"clear",object:i}),e},n}};function Bn(e){return e.path&&e.path[0]||e.deepPath&&e.deepPath[0]||e.target}function Fn(){this.standardStopPropagation(),this.propagationStopped=!0}function qn(e){e.propagationStopped=!1;let t=Bn(e),i=[];for(;t;){if(t.capturedCallbacks){let n=t.capturedCallbacks[e.type];n&&(e.stopPropagation!==Fn&&(e.standardStopPropagation=e.stopPropagation,e.stopPropagation=Fn),i.push(n))}t=t.parentNode}for(let t=i.length-1;t>=0&&!e.propagationStopped;t--){let n=i[t];"handleEvent"in n?n.handleEvent(e):n(e)}}function zn(e){e.propagationStopped=!1;let t=Bn(e);for(;t&&!e.propagationStopped;){if(t.delegatedCallbacks){let i=t.delegatedCallbacks[e.type];i&&(e.stopPropagation!==Fn&&(e.standardStopPropagation=e.stopPropagation,e.stopPropagation=Fn),"handleEvent"in i?i.handleEvent(e):i(e))}t=t.parentNode}}let $n=class{constructor(e,t,i){this.entry=e,this.lookup=t,this.targetEvent=i}dispose(){this.entry.decrement(),this.lookup[this.targetEvent]=null}};const Dn={none:0,capturing:1,bubbling:2};let Hn=class{constructor(){this.elementHandlerLookup={},this.eventStrategyLookup={},this.registerElementConfig({tagName:"input",properties:{value:["change","input"],checked:["change","input"],files:["change","input"]}}),this.registerElementConfig({tagName:"textarea",properties:{value:["change","input"]}}),this.registerElementConfig({tagName:"select",properties:{value:["change"]}}),this.registerElementConfig({tagName:"content editable",properties:{value:["change","input","blur","keyup","paste"]}}),this.registerElementConfig({tagName:"scrollable element",properties:{scrollTop:["scroll"],scrollLeft:["scroll"]}}),this.defaultEventStrategy=new class{constructor(){this.delegatedHandlers={},this.capturedHandlers={}}subscribe(e,t,i,n,s){let o,a,l;if(n===Dn.bubbling){o=this.delegatedHandlers,l=o[t]||(o[t]=new class{constructor(e){this.eventName=e,this.count=0}increment(){this.count++,1===this.count&&r.addEventListener(this.eventName,zn,!1)}decrement(){this.count--,0===this.count&&r.removeEventListener(this.eventName,zn,!1)}}(t));let n=e.delegatedCallbacks||(e.delegatedCallbacks={});return l.increment(),n[t]=i,!0===s?new $n(l,n,t):function(){l.decrement(),n[t]=null}}if(n===Dn.capturing){a=this.capturedHandlers,l=a[t]||(a[t]=new class{constructor(e){this.eventName=e,this.count=0}increment(){this.count++,1===this.count&&r.addEventListener(this.eventName,qn,!0)}decrement(){this.count--,0===this.count&&r.removeEventListener(this.eventName,qn,!0)}}(t));let n=e.capturedCallbacks||(e.capturedCallbacks={});return l.increment(),n[t]=i,!0===s?new $n(l,n,t):function(){l.decrement(),n[t]=null}}return e.addEventListener(t,i),!0===s?new class{constructor(e,t,i){this.target=e,this.targetEvent=t,this.callback=i}dispose(){this.target.removeEventListener(this.targetEvent,this.callback)}}(e,t,i):function(){e.removeEventListener(t,i)}}}}registerElementConfig(e){let t,i=e.tagName.toLowerCase(),n=e.properties,r=this.elementHandlerLookup[i]={};for(t in n)n.hasOwnProperty(t)&&(r[t]=n[t])}registerEventStrategy(e,t){this.eventStrategyLookup[e]=t}getElementHandler(e,t){let i,n=this.elementHandlerLookup;if(e.tagName){if(n[i=e.tagName.toLowerCase()]&&n[i][t])return new Un(n[i][t]);if("textContent"===t||"innerHTML"===t)return new Un(n["content editable"].value);if("scrollTop"===t||"scrollLeft"===t)return new Un(n["scrollable element"][t])}return null}addEventListener(e,t,i,n,r){return(this.eventStrategyLookup[t]||this.defaultEventStrategy).subscribe(e,t,i,n,r)}},Un=class{constructor(e){this.events=e,this.element=null,this.handler=null}subscribe(e,t){this.element=e,this.handler=t;let i=this.events;for(let n=0,r=i.length;r>n;++n)e.addEventListener(i[n],t)}dispose(){if(null===this.element)return;let e=this.element,t=this.handler,i=this.events;for(let n=0,r=i.length;r>n;++n)e.removeEventListener(i[n],t);this.element=this.handler=null}},Wn=class{constructor(){this.tracked=[],this.checkDelay=120}addProperty(e){let t=this.tracked;t.push(e),1===t.length&&this.scheduleDirtyCheck()}removeProperty(e){let t=this.tracked;t.splice(t.indexOf(e),1)}scheduleDirtyCheck(){setTimeout(()=>this.check(),this.checkDelay)}check(){let e=this.tracked,t=e.length;for(;t--;){let i=e[t];i.isDirty()&&i.call()}e.length&&this.scheduleDirtyCheck()}},Qn=vt()(Ne=class{constructor(e,t,i){this.dirtyChecker=e,this.obj=t,this.propertyName=i}getValue(){return this.obj[this.propertyName]}setValue(e){this.obj[this.propertyName]=e}call(){let e=this.oldValue,t=this.getValue();this.callSubscribers(t,e),this.oldValue=t}isDirty(){return this.oldValue!==this.obj[this.propertyName]}subscribe(e,t){this.hasSubscribers()||(this.oldValue=this.getValue(),this.dirtyChecker.addProperty(this)),this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.dirtyChecker.removeProperty(this)}})||Ne;const Gn=W("property-observation"),Kn={getValue:(e,t)=>e[t],setValue:(e,t,i)=>{t[i]=e}};let Xn=class{constructor(e,t){this.doNotCache=!0,this.primitive=e,this.propertyName=t}getValue(){return this.primitive[this.propertyName]}setValue(){let e=typeof this.primitive;throw new Error(`The ${this.propertyName} property of a ${e} (${this.primitive}) cannot be assigned.`)}subscribe(){}unsubscribe(){}},Yn=vt()(Te=class{constructor(e,t,i){this.taskQueue=e,this.obj=t,this.propertyName=i,this.queued=!1,this.observing=!1}getValue(){return this.obj[this.propertyName]}setValue(e){this.obj[this.propertyName]=e}getterValue(){return this.currentValue}setterValue(e){let t=this.currentValue;t!==e&&(this.queued||(this.oldValue=t,this.queued=!0,this.taskQueue.queueMicroTask(this)),this.currentValue=e)}call(){let e=this.oldValue,t=this.currentValue;this.queued=!1,this.callSubscribers(t,e)}subscribe(e,t){this.observing||this.convertProperty(),this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)}convertProperty(){this.observing=!0,this.currentValue=this.obj[this.propertyName],this.setValue=this.setterValue,this.getValue=this.getterValue,Reflect.defineProperty(this.obj,this.propertyName,{configurable:!0,enumerable:!(this.propertyName in this.obj)||this.obj.propertyIsEnumerable(this.propertyName),get:this.getValue.bind(this),set:this.setValue.bind(this)})||Gn.warn(`Cannot observe property '${this.propertyName}' of object`,this.obj)}})||Te,Jn=class{constructor(e,t,i){this.element=e,this.propertyName=t,this.attributeName=i}getValue(){return this.element.getAttributeNS("http://www.w3.org/1999/xlink",this.attributeName)}setValue(e){return this.element.setAttributeNS("http://www.w3.org/1999/xlink",this.attributeName,e)}subscribe(){throw new Error(`Observation of a "${this.element.nodeName}" element's "${this.propertyName}" property is not supported.`)}};const Zn={getValue:(e,t)=>e.getAttribute(t),setValue:(e,t,i)=>{null==e?t.removeAttribute(i):t.setAttribute(i,e)}};let er=class{constructor(e,t){this.element=e,this.propertyName=t}getValue(){return this.element.getAttribute(this.propertyName)}setValue(e){return null==e?this.element.removeAttribute(this.propertyName):this.element.setAttribute(this.propertyName,e)}subscribe(){throw new Error(`Observation of a "${this.element.nodeName}" element's "${this.propertyName}" property is not supported.`)}},tr=class{constructor(e,t){this.element=e,this.propertyName=t,this.styles=null,this.version=0}getValue(){return this.element.style.cssText}_setProperty(e,t){let i="";null!=t&&"function"==typeof t.indexOf&&-1!==t.indexOf("!important")&&(i="important",t=t.replace("!important","")),this.element.style.setProperty(e,t,i)}setValue(e){let t,i=this.styles||{},n=this.version;if(null!=e)if(e instanceof Object){let r;for(t in e)e.hasOwnProperty(t)&&(r=e[t],i[t=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase())]=n,this._setProperty(t,r))}else if(e.length){let r,s=/\s*([\w\-]+)\s*:\s*((?:(?:[\w\-]+\(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[\w\-]+\(\s*(?:^"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^\)]*)\),?|[^\)]*)\),?|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^;]*),?\s*)+);?/g;for(;null!==(r=s.exec(e));)(t=r[1])&&(i[t]=n,this._setProperty(t,r[2]))}if(this.styles=i,this.version+=1,0!==n)for(t in n-=1,i)i.hasOwnProperty(t)&&i[t]===n&&this.element.style.removeProperty(t)}subscribe(){throw new Error(`Observation of a "${this.element.nodeName}" element's "${this.propertyName}" property is not supported.`)}},ir=vt()(Me=class{constructor(e,t,i){this.element=e,this.propertyName=t,this.handler=i,"files"===t&&(this.setValue=(()=>{}))}getValue(){return this.element[this.propertyName]}setValue(e){e=null==e?"":e,this.element[this.propertyName]!==e&&(this.element[this.propertyName]=e,this.notify())}notify(){let e=this.oldValue,t=this.getValue();this.callSubscribers(t,e),this.oldValue=t}handleEvent(){this.notify()}subscribe(e,t){this.hasSubscribers()||(this.oldValue=this.getValue(),this.handler.subscribe(this.element,this)),this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()}})||Me;let nr=vt()(Ie=class{constructor(e,t,i){this.element=e,this.handler=t,this.observerLocator=i}getValue(){return this.value}setValue(e){this.initialSync&&this.value===e||(this.arrayObserver&&(this.arrayObserver.unsubscribe("CheckedObserver:array",this),this.arrayObserver=null),"checkbox"===this.element.type&&Array.isArray(e)&&(this.arrayObserver=this.observerLocator.getArrayObserver(e),this.arrayObserver.subscribe("CheckedObserver:array",this)),this.oldValue=this.value,this.value=e,this.synchronizeElement(),this.notify(),this.initialSync||(this.initialSync=!0,this.observerLocator.taskQueue.queueMicroTask(this)))}call(e,t){this.synchronizeElement(),this.valueObserver||(this.valueObserver=this.element.__observers__.model||this.element.__observers__.value,this.valueObserver&&this.valueObserver.subscribe("CheckedObserver:value",this))}synchronizeElement(){let e=this.value,t=this.element,i=t.hasOwnProperty("model")?t.model:t.value,n="radio"===t.type,r=t.matcher||((e,t)=>e===t);t.checked=n&&!!r(e,i)||!n&&!0===e||!n&&Array.isArray(e)&&-1!==e.findIndex(e=>!!r(e,i))}synchronizeValue(){let e,t=this.value,i=this.element,n=i.hasOwnProperty("model")?i.model:i.value,r=i.matcher||((e,t)=>e===t);if("checkbox"===i.type){if(Array.isArray(t))return e=t.findIndex(e=>!!r(e,n)),void(i.checked&&-1===e?t.push(n):i.checked||-1===e||t.splice(e,1));t=i.checked}else{if(!i.checked)return;t=n}this.oldValue=this.value,this.value=t,this.notify()}notify(){let e=this.oldValue,t=this.value;t!==e&&this.callSubscribers(t,e)}handleEvent(){this.synchronizeValue()}subscribe(e,t){this.hasSubscribers()||this.handler.subscribe(this.element,this),this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()}unbind(){this.arrayObserver&&(this.arrayObserver.unsubscribe("CheckedObserver:array",this),this.arrayObserver=null),this.valueObserver&&this.valueObserver.unsubscribe("CheckedObserver:value",this)}})||Ie;let rr=vt()(Le=class{constructor(e,t,i){this.element=e,this.handler=t,this.observerLocator=i}getValue(){return this.value}setValue(e){if(null!=e&&this.element.multiple&&!Array.isArray(e))throw new Error("Only null or Array instances can be bound to a multi-select.");this.value!==e&&(this.arrayObserver&&(this.arrayObserver.unsubscribe("SelectValueObserver:array",this),this.arrayObserver=null),Array.isArray(e)&&(this.arrayObserver=this.observerLocator.getArrayObserver(e),this.arrayObserver.subscribe("SelectValueObserver:array",this)),this.oldValue=this.value,this.value=e,this.synchronizeOptions(),this.notify(),this.initialSync||(this.initialSync=!0,this.observerLocator.taskQueue.queueMicroTask(this)))}call(e,t){this.synchronizeOptions()}synchronizeOptions(){let e,t=this.value;Array.isArray(t)&&(e=!0);let i=this.element.options,n=i.length,r=this.element.matcher||((e,t)=>e===t);for(;n--;){let s=i.item(n),o=s.hasOwnProperty("model")?s.model:s.value;e?s.selected=-1!==t.findIndex(e=>!!r(o,e)):s.selected=!!r(o,t)}}synchronizeValue(){let e=this.element.options,t=0,i=[];for(let n=0,r=e.length;ne===t),t=0;for(;te(n,t))?this.value.splice(t,1):t++}for(t=0;te(n,t))&&this.value.push(n),t++}return}}else i=0===t?null:i[0];i!==this.value&&(this.oldValue=this.value,this.value=i,this.notify())}notify(){let e=this.oldValue,t=this.value;this.callSubscribers(t,e)}handleEvent(){this.synchronizeValue()}subscribe(e,t){this.hasSubscribers()||this.handler.subscribe(this.element,this),this.addSubscriber(e,t)}unsubscribe(e,t){this.removeSubscriber(e,t)&&!this.hasSubscribers()&&this.handler.dispose()}bind(){this.domObserver=r.createMutationObserver(()=>{this.synchronizeOptions(),this.synchronizeValue()}),this.domObserver.observe(this.element,{childList:!0,subtree:!0,characterData:!0})}unbind(){this.domObserver.disconnect(),this.domObserver=null,this.arrayObserver&&(this.arrayObserver.unsubscribe("SelectValueObserver:array",this),this.arrayObserver=null)}})||Le,sr=class{constructor(e){this.element=e,this.doNotCache=!0,this.value="",this.version=0}getValue(){return this.value}setValue(e){let t,i,n=this.nameIndex||{},r=this.version;if(null!=e&&e.length)for(let s=0,o=(t=e.split(/\s+/)).length;s").firstElementChild.nodeName&&pr.altGlyph&&(pr.altglyph=pr.altGlyph,delete pr.altGlyph,pr.altglyphdef=pr.altGlyphDef,delete pr.altGlyphDef,pr.altglyphitem=pr.altGlyphItem,delete pr.altGlyphItem,pr.glyphref=pr.glyphRef,delete pr.glyphRef)}isStandardSvgAttribute(e,t){return gr[e]&&mr[t]||pr[e]&&-1!==pr[e].indexOf(t)}}}const pr=ar,gr=lr,mr=hr,fr=cr||class{isStandardSvgAttribute(){return!1}};let vr=(Be=je=class{constructor(e,t,i,n,r){this.taskQueue=e,this.eventManager=t,this.dirtyChecker=i,this.svgAnalyzer=n,this.parser=r,this.adapters=[],this.logger=W("observer-locator")}getObserver(e,t){let i,n=e.__observers__;return n&&t in n?n[t]:((i=this.createPropertyObserver(e,t)).doNotCache||(void 0===n&&(n=this.getOrCreateObserversLookup(e)),n[t]=i),i)}getOrCreateObserversLookup(e){return e.__observers__||this.createObserversLookup(e)}createObserversLookup(e){let t={};return Reflect.defineProperty(e,"__observers__",{enumerable:!1,configurable:!1,writable:!1,value:t})||this.logger.warn("Cannot add observers to object",e),t}addAdapter(e){this.adapters.push(e)}getAdapterObserver(e,t,i){for(let n=0,r=this.adapters.length;nthis.callSource(e))}unbind(){this.isBound&&(this.isBound=!1,this.sourceExpression.unbind&&this.sourceExpression.unbind(this,this.source),this.source=null,this.targetProperty.setValue(null))}},Cr=class e{constructor(e){this.name=e}static convention(t){if(t.endsWith("ValueConverter"))return new e(He(t.substring(0,t.length-14)))}initialize(e,t){this.instance=e.get(t)}register(e,t){e.registerValueConverter(t||this.name,this.instance)}load(e,t){}};function kr(e){if(void 0===e||"string"==typeof e)return function(t){d.define(d.resource,new Cr(e),t)};d.define(d.resource,new Cr,e)}let _r=class e{constructor(e){this.name=e}static convention(t){if(t.endsWith("BindingBehavior"))return new e(He(t.substring(0,t.length-15)))}initialize(e,t){this.instance=e.get(t)}register(e,t){e.registerBindingBehavior(t||this.name,this.instance)}load(e,t){}};function Sr(e){if(void 0===e||"string"==typeof e)return function(t){d.define(d.resource,new _r(e),t)};d.define(d.resource,new _r,e)}let Er=class{constructor(e,t,i,n,r,s){this.eventManager=e,this.targetEvent=t,this.sourceExpression=i,this.delegationStrategy=n,this.discrete=!0,this.preventDefault=r,this.lookupFunctions=s}createBinding(e){return new Ar(this.eventManager,this.targetEvent,this.delegationStrategy,this.sourceExpression,e,this.preventDefault,this.lookupFunctions)}},Ar=class{constructor(e,t,i,n,r,s,o){this.eventManager=e,this.targetEvent=t,this.delegationStrategy=i,this.sourceExpression=n,this.target=r,this.preventDefault=s,this.lookupFunctions=o}callSource(e){let t=this.source.overrideContext;t.$event=e;let i=this.sourceExpression.evaluate(this.source,this.lookupFunctions,!0);return delete t.$event,!0!==i&&this.preventDefault&&e.preventDefault(),i}handleEvent(e){this.callSource(e)}bind(e){if(this.isBound){if(this.source===e)return;this.unbind()}this.isBound=!0,this.source=e,this.sourceExpression.bind&&this.sourceExpression.bind(this,e,this.lookupFunctions),this._handler=this.eventManager.addEventListener(this.target,this.targetEvent,this,this.delegationStrategy,!0)}unbind(){this.isBound&&(this.isBound=!1,this.sourceExpression.unbind&&this.sourceExpression.unbind(this,this.source),this.source=null,this._handler.dispose(),this._handler=null)}};function Or(e){let t=e.au;if(void 0===t)throw new Error(`No Aurelia APIs are defined for the element: "${e.tagName}".`);return t}let Pr=class e{constructor(e,t,i){this.sourceExpression=e,this.apiName=t,this.lookupFunctions=i,this.discrete=!0}createBinding(t){return new Vr(this.sourceExpression,e.locateAPI(t,this.apiName),this.lookupFunctions)}static locateAPI(e,t){switch(t){case"element":return e;case"controller":return Or(e).controller;case"view-model":return Or(e).controller.viewModel;case"view":return Or(e).controller.view;default:let i=Or(e)[t];if(void 0===i)throw new Error(`Attempted to reference "${t}", but it was not found amongst the target's API.`);return i.viewModel}}},Vr=class{constructor(e,t,i){this.sourceExpression=e,this.target=t,this.lookupFunctions=i}bind(e){if(this.isBound){if(this.source===e)return;this.unbind()}this.isBound=!0,this.source=e,this.sourceExpression.bind&&this.sourceExpression.bind(this,e,this.lookupFunctions),this.sourceExpression.assign(this.source,this.target,this.lookupFunctions)}unbind(){this.isBound&&(this.isBound=!1,this.sourceExpression.evaluate(this.source,this.lookupFunctions)===this.target&&this.sourceExpression.assign(this.source,null,this.lookupFunctions),this.sourceExpression.unbind&&this.sourceExpression.unbind(this,this.source),this.source=null)}};const Rr={bindingBehaviors:e=>null,valueConverters:e=>null};let Nr=(ze=qe=class{constructor(e,t){this.observerLocator=e,this.parser=t}createBindingExpression(e,t,i=ai.toView,n=Rr){return new br(this.observerLocator,e,this.parser.parse(t),i,n)}propertyObserver(e,t){return{subscribe:i=>{let n=this.observerLocator.getObserver(e,t);return n.subscribe(i),{dispose:()=>n.unsubscribe(i)}}}}collectionObserver(e){return{subscribe:t=>{let i;if(e instanceof Array)i=this.observerLocator.getArrayObserver(e);else if(e instanceof Map)i=this.observerLocator.getMapObserver(e);else{if(!(e instanceof Set))throw new Error("collection must be an instance of Array, Map or Set.");i=this.observerLocator.getSetObserver(e)}return i.subscribe(t),{dispose:()=>i.unsubscribe(t)}}}}expressionObserver(e,t){let i={bindingContext:e,overrideContext:Ue(e)};return new bt(i,this.parser.parse(t),this.observerLocator,Rr)}parseExpression(e){return this.parser.parse(e)}registerAdapter(e){this.observerLocator.addAdapter(e)}},qe.inject=[vr,li],ze),Tr=Set.prototype;function Mr(e,t){return Ir.for(e,t)}let Ir=class e extends At{constructor(e,t){super(e,t)}static for(t,i){return"__set_observer__"in i||Reflect.defineProperty(i,"__set_observer__",{value:e.create(t,i),enumerable:!1,configurable:!1}),i.__set_observer__}static create(t,i){let n=new e(t,i),r=Tr;return r.add===i.add&&r.delete===i.delete&&r.clear===i.clear||(r={add:i.add,delete:i.delete,clear:i.clear}),i.add=function(){let e=i.size,t=r.add.apply(i,arguments);return i.size===e||n.addChangeRecord({type:"add",object:i,value:Array.from(i).pop()}),t},i.delete=function(){let e=i.has(arguments[0]),t=r.delete.apply(i,arguments);return e&&n.addChangeRecord({type:"delete",object:i,value:arguments[0]}),t},i.clear=function(){let e=r.clear.apply(i,arguments);return n.addChangeRecord({type:"clear",object:i}),e},n}};const Lr={};function jr(e,t){Lr.hasOwnProperty(t)||(Lr[t]=0),e.observeProperty(Lr,t)}var Br,Fr,qr,zr,$r,Dr,Hr,Ur,Wr,Qr,Gr,Kr,Xr,Yr,Jr,Zr,es,ts,is,ns;let rs=class{enter(e){return Promise.resolve(!1)}leave(e){return Promise.resolve(!1)}removeClass(e,t){return e.classList.remove(t),Promise.resolve(!1)}addClass(e,t){return e.classList.add(t),Promise.resolve(!1)}animate(e,t){return Promise.resolve(!1)}runSequence(e){}registerEffect(e,t){}unregisterEffect(e){}},ss=class{constructor(e){this.owner=e,this.owner._compositionCount++}done(){this.owner._compositionCount--,this.owner._tryCompleteTransaction()}},os=class{constructor(e){this.owner=e,this.owner._ownershipToken=this,this.thenable=this._createThenable()}waitForCompositionComplete(){return this.owner._tryCompleteTransaction(),this.thenable}resolve(){this._resolveCallback()}_createThenable(){return new Promise((e,t)=>{this._resolveCallback=e})}},as=class{constructor(){this._ownershipToken=null,this._compositionCount=0}tryCapture(){return null===this._ownershipToken?new os(this):null}enlist(){return new ss(this)}_tryCompleteTransaction(){if(this._compositionCount<=0&&(this._compositionCount=0,null!==this._ownershipToken)){let e=this._ownershipToken;this._ownershipToken=null,e.resolve()}}};const ls=/([A-Z])/g;function hs(e){return"-"+e.toLowerCase()}function cs(e){return(e.charAt(0).toLowerCase()+e.slice(1)).replace(ls,hs)}function us(e){return!(e.auInterpolationTarget||/[^\t\n\r ]/.test(e.textContent))}let ds=class e{constructor(){}initialize(e,t){this.instance=e.get(t)}register(e,t){e.registerViewEngineHooks(this.instance)}load(e,t){}static convention(t){if(t.endsWith("ViewEngineHooks"))return new e}};let ps=class{constructor(e){this.element=e,this.subscriptions={}}_enqueueHandler(e){this.subscriptions[e.eventName]=this.subscriptions[e.eventName]||[],this.subscriptions[e.eventName].push(e)}_dequeueHandler(e){let t,i=this.subscriptions[e.eventName];return i&&(t=i.indexOf(e))>-1&&i.splice(t,1),e}publish(e,t={},i=!0,n=!0){let s=r.createCustomEvent(e,{cancelable:n,bubbles:i,detail:t});this.element.dispatchEvent(s)}subscribe(e,t,i=!0){if("function"==typeof t){return new gs(this,e,t,i,!1)}}subscribeOnce(e,t,i=!0){if("function"==typeof t){return new gs(this,e,t,i,!0)}}dispose(e){if(e&&"string"==typeof e){let t=this.subscriptions[e];if(t)for(;t.length;){let e=t.pop();e&&e.dispose()}}else this.disposeAll()}disposeAll(){for(let e in this.subscriptions)this.dispose(e)}},gs=class{constructor(e,t,i,n,r){this.owner=e,this.eventName=t,this.handler=i,this.capture="boolean"==typeof n?n:n.capture,this.bubbles=!this.capture,this.captureOrOptions=n,this.once=r,e.element.addEventListener(t,this,n),e._enqueueHandler(this)}handleEvent(e){(0,this.handler)(e),this.once&&this.dispose()}dispose(){this.owner.element.removeEventListener(this.eventName,this,this.captureOrOptions),this.owner._dequeueHandler(this),this.owner=this.handler=null}},ms=class{constructor(){this.dependencies={}}addDependency(e){this.dependencies[e]=!0}hasDependency(e){return e in this.dependencies}},fs=class{constructor(e=!1,t=!1){this.targetShadowDOM=e,this.compileSurrogate=t,this.associatedModuleId=null}};fs.normal=new fs;let vs=class e{static enhance(){let t=new e;return t.enhance=!0,t}static unitTest(t,i){let n=new e;return n.type=t,n.attributes=i||{},n}static element(t,i){let n=new e;return n.type=i,n.attributes={},n.anchorIsContainer=!(t.hasAttribute("containerless")||i.containerless),n.initiatedByBehavior=!0,n}static attribute(t,i){let n=new e;return n.attrName=t,n.type=i||null,n.attributes={},n}static dynamic(t,i,n){let r=new e;return r.host=t,r.viewModel=i,r.viewFactory=n,r.inheritBindingContext=!0,r}};const bs=vs.prototype;bs.initiatedByBehavior=!1,bs.enhance=!1,bs.partReplacements=null,bs.viewFactory=null,bs.originalAttrName=null,bs.skipContentProcessing=!1,bs.contentFactory=null,bs.viewModel=null,bs.anchorIsContainer=!1,bs.host=null,bs.attributes=null,bs.type=null,bs.attrName=null,bs.inheritBindingContext=!1,vs.normal=new vs;let ws=(Fr=Br=class e{static shadowSlot(t){let i=new e;return i.parentInjectorId=t,i.shadowSlot=!0,i}static contentExpression(t){let i=new e;return i.contentExpression=t,i}static letElement(t){let i=new e;return i.expressions=t,i.letElement=!0,i}static lifting(t,i){let n=new e;return n.parentInjectorId=t,n.expressions=e.noExpressions,n.behaviorInstructions=[i],n.viewFactory=i.viewFactory,n.providers=[i.type.target],n.lifting=!0,n}static normal(t,i,n,r,s,o){let a=new e;return a.injectorId=t,a.parentInjectorId=i,a.providers=n,a.behaviorInstructions=r,a.expressions=s,a.anchorIsContainer=!o||o.anchorIsContainer,a.elementInstruction=o,a}static surrogate(t,i,n,r){let s=new e;return s.expressions=n,s.behaviorInstructions=i,s.providers=t,s.values=r,s}},Br.noExpressions=Object.freeze([]),Fr);const ys=ws.prototype;ys.injectorId=null,ys.parentInjectorId=null,ys.shadowSlot=!1,ys.slotName=null,ys.slotFallbackFactory=null,ys.contentExpression=null,ys.letElement=!1,ys.expressions=null,ys.expressions=null,ys.providers=null,ys.viewFactory=null,ys.anchorIsContainer=!1,ys.elementInstruction=null,ys.lifting=!1,ys.values=null;const xs=C.create("aurelia:view-strategy",{validate:e=>"function"==typeof e.loadViewFactory||"View strategies must implement: loadViewFactory(viewEngine: ViewEngine, compileInstruction: ViewCompileInstruction, loadContext?: ResourceLoadContext): Promise",compose(e){"function"!=typeof e.makeRelativeTo&&(e.makeRelativeTo=n.noop)}});let Cs=xs()(qr=class{constructor(e){this.path=e,this.absolutePath=null}loadViewFactory(e,t,i,n){return null===this.absolutePath&&this.moduleId&&(this.absolutePath=k(this.path,this.moduleId)),t.associatedModuleId=this.moduleId,e.loadViewFactory(this.absolutePath||this.path,t,i,n)}makeRelativeTo(e){null===this.absolutePath&&(this.absolutePath=k(this.path,e))}})||qr,ks=xs()(zr=class{constructor(e,t){this.moduleId=t.moduleId,this.viewUrl=e.convertOriginToViewUrl(t)}loadViewFactory(e,t,i,n){return t.associatedModuleId=this.moduleId,e.loadViewFactory(this.viewUrl,t,i,n)}})||zr,_s=xs()($r=class{constructor(e,t){this.dependencies=e||null,this.dependencyBaseUrl=t||""}loadViewFactory(e,t,i,n){let r=this.entry,s=this.dependencies;if(r&&r.factoryIsReady)return Promise.resolve(null);if(this.entry=r=new T(this.moduleId||this.dependencyBaseUrl),r.dependencies=[],r.templateIsLoaded=!0,null!==s)for(let e=0,t=s.length;e{const r=e.container,s=e.appResources,o=e.viewCompiler,a=new Bs(s);let l,h=[];n&&a.autoRegister(r,n);for(let e of i)if("function"==typeof e)null!==(l=a.autoRegister(r,e)).elementName&&h.push(l);else{if(!e||"object"!=typeof e)throw new Error(`dependency neither function nor object. Received: "${typeof e}"`);for(let t in e){let i=e[t];"function"==typeof i&&null!==(l=a.autoRegister(r,i)).elementName&&h.push(l)}}return Promise.all(h.map(e=>e.load(r,e.target))).then(()=>{const e=null!==this.template?o.compile(this.template,a,t):null;return this.factoryIsReady=!0,this.factory=e,e})})}})||Ur,Os=(Qr=Wr=class e{getViewStrategy(t){if(!t)return null;if("object"==typeof t&&"getViewStrategy"in t){let e=m.get(t.constructor);return"string"==typeof(t=t.getViewStrategy())&&(t=new Cs(t)),xs.assert(t),e.moduleId&&t.makeRelativeTo(e.moduleId),t}if("string"==typeof t&&(t=new Cs(t)),xs.validate(t))return t;if("function"!=typeof t&&(t=t.constructor),"$view"in t){let i,n=t.$view;return i=null===(n="function"==typeof n?n.call(t):n)?new _s:n instanceof As?n:new As(n),d.define(e.viewStrategyMetadataKey,i,t),i}let i=m.get(t),n=d.get(e.viewStrategyMetadataKey,t);if(n)i.moduleId&&(n.moduleId=i.moduleId);else{if(!i.moduleId)throw new Error("Cannot determine default view strategy for object.",t);n=this.createFallbackViewStrategy(i)}return n}createFallbackViewStrategy(e){return new ks(this,e)}convertOriginToViewUrl(e){let t=e.moduleId;return(t.endsWith(".js")||t.endsWith(".ts")?t.substring(0,t.length-3):t)+".html"}},Wr.viewStrategyMetadataKey="aurelia:view-strategy",Qr);function Ps(e){throw new Error(`BindingLanguage must implement ${e}().`)}let Vs=class{inspectAttribute(e,t,i,n){Ps("inspectAttribute")}createAttributeInstruction(e,t,i,n){Ps("createAttributeInstruction")}createLetExpressions(e,t){Ps("createLetExpressions")}inspectTextContent(e,t){Ps("inspectTextContent")}},Rs=Object.freeze([]),Ns=class{static inject(){return[r.Element]}constructor(e){this.element=e,this.element.auSlotAttribute=this}valueChanged(e,t){}},Ts=class e{constructor(e,t,i,n){this.anchor=e,this.anchor.viewSlot=this,this.name=t,this.destinationName=i,this.fallbackFactory=n,this.destinationSlot=null,this.projections=0,this.contentView=null,new Ns(this.anchor).value=this.destinationName}get needsFallbackRendering(){return this.fallbackFactory&&0===this.projections}renderFallbackContent(e,t,i,n){if(null===this.contentView){this.contentView=this.fallbackFactory.create(this.ownerView.container),this.contentView.bind(this.ownerView.bindingContext,this.ownerView.overrideContext);let e=Object.create(null);e[this.destinationSlot.name]=this.destinationSlot,Is.distributeView(this.contentView,e,i,n,this.destinationSlot.name)}}passThroughTo(e){this.destinationSlot=e}addNode(t,i,n,r){null!==this.contentView&&(this.contentView.removeNodes(),this.contentView.detached(),this.contentView.unbind(),this.contentView=null),i.viewSlot instanceof e?i.viewSlot.passThroughTo(this):(this.projections++,this.destinationSlot.addNode(t,i,n,r))}removeView(e,t){this.projections--,this.destinationSlot.removeView(e,t),this.needsFallbackRendering&&this.renderFallbackContent(null,Rs,t)}removeAll(e){this.projections=0,this.destinationSlot.removeAll(e),this.needsFallbackRendering&&this.renderFallbackContent(null,Rs,e)}projectFrom(e,t){this.destinationSlot.projectFrom(e,t)}created(e){this.ownerView=e}bind(e){this.contentView&&this.contentView.bind(e.bindingContext,e.overrideContext)}attached(){this.contentView&&this.contentView.attached()}detached(){this.contentView&&this.contentView.detached()}unbind(){this.contentView&&this.contentView.unbind()}},Ms=class{constructor(e,t,i){this.anchor=e,this.anchor.isContentProjectionSource=!0,this.anchor.viewSlot=this,this.name=t,this.fallbackFactory=i,this.contentView=null,this.projections=0,this.children=[],this.projectFromAnchors=null,this.destinationSlots=null}get needsFallbackRendering(){return this.fallbackFactory&&0===this.projections}addNode(e,t,i,n,r){if(null!==this.contentView&&(this.contentView.removeNodes(),this.contentView.detached(),this.contentView.unbind(),this.contentView=null),t.viewSlot instanceof Ts)t.viewSlot.passThroughTo(this);else if(null!==this.destinationSlots)Is.distributeNodes(e,[t],this.destinationSlots,this,n);else{t.auOwnerView=e,t.auProjectionSource=i,t.auAssignedSlot=this;let r=this._findAnchor(e,t,i,n);r.parentNode.insertBefore(t,r),this.children.push(t),this.projections++}}removeView(e,t){if(null!==this.destinationSlots)Is.undistributeView(e,this.destinationSlots,this);else if(this.contentView&&this.contentView.hasSlots)Is.undistributeView(e,this.contentView.slots,t);else{let i=this.children.find(e=>e.auSlotProjectFrom===t);if(i){let n=i.auProjectionChildren;for(let t=0,i=n.length;tt.auSlotProjectFrom===e);if(t){let i=t.auProjectionChildren;for(let e=0,t=i.length;ee.auSlotProjectFrom===i);if(r){if(void 0!==n){let i,s=r.auProjectionChildren,o=-1;for(let r=0,a=s.length;r=n&&i!==e))return s.splice(r,0,t),a}}return r.auProjectionChildren.push(t),r}}return this.anchor}projectTo(e){this.destinationSlots=e}projectFrom(e,t){let i=r.createComment("anchor"),n=this.anchor.parentNode;i.auSlotProjectFrom=t,i.auOwnerView=e,i.auProjectionChildren=[],n.insertBefore(i,this.anchor),this.children.push(i),null===this.projectFromAnchors&&(this.projectFromAnchors=[]),this.projectFromAnchors.push(i)}renderFallbackContent(e,t,i,n){if(null===this.contentView&&(this.contentView=this.fallbackFactory.create(this.ownerView.container),this.contentView.bind(this.ownerView.bindingContext,this.ownerView.overrideContext),this.contentView.insertNodesBefore(this.anchor)),this.contentView.hasSlots){let r=this.contentView.slots,s=this.projectFromAnchors;if(null!==s)for(let e in r){let t=r[e];for(let e=0,i=s.length;en;++n){let s=t[n];if(!s||"string"!=typeof s&&!s.name)throw new Error(`Invalid bindable property at "${n}" for class "${e.name}". Expected either a string or an object with "name" property.`);let o=new uo(s),a=!1;for(let e=0,t=r.length;t>e;++e)if(r[e].name===o.name){a=!0;break}a||o.registerWith(e,i)}}}return i}constructor(e,t){this.bindingLanguage=null,this.parent=e||null,this.hasParent=null!==this.parent,this.viewUrl=t||"",this.lookupFunctions={valueConverters:this.getValueConverter.bind(this),bindingBehaviors:this.getBindingBehavior.bind(this)},this.attributes=Object.create(null),this.elements=Object.create(null),this.valueConverters=Object.create(null),this.bindingBehaviors=Object.create(null),this.attributeMap=Object.create(null),this.values=Object.create(null),this.beforeCompile=this.afterCompile=this.beforeCreate=this.afterCreate=this.beforeBind=this.beforeUnbind=!1}_tryAddHook(e,t){if("function"==typeof e[t]){let i,n=e[t].bind(e),r=1;for(;void 0!==this[i=t+r.toString()];)r++;this[t]=!0,this[i]=n}}_invokeHook(e,t,i,n,r){if(this.hasParent&&this.parent._invokeHook(e,t,i,n,r),this[e]){this[e+"1"](t,i,n,r);let s=e+"2";if(this[s]&&(this[s](t,i,n,r),this[s=e+"3"])){this[s](t,i,n,r);let o=4;for(;void 0!==this[s=e+o.toString()];)this[s](t,i,n,r),o++}}}registerViewEngineHooks(e){this._tryAddHook(e,"beforeCompile"),this._tryAddHook(e,"afterCompile"),this._tryAddHook(e,"beforeCreate"),this._tryAddHook(e,"afterCreate"),this._tryAddHook(e,"beforeBind"),this._tryAddHook(e,"beforeUnbind")}getBindingLanguage(e){return this.bindingLanguage||(this.bindingLanguage=e)}patchInParent(e){let t=this.parent;this.parent=e||null,this.hasParent=null!==this.parent,null===e.parent&&(e.parent=t,e.hasParent=null!==t)}relativeToView(e){return k(e,this.viewUrl)}registerElement(e,t){Ls(this.elements,e,t,"an Element")}getElement(e){return this.elements[e]||(this.hasParent?this.parent.getElement(e):null)}mapAttribute(e){return this.attributeMap[e]||(this.hasParent?this.parent.mapAttribute(e):null)}registerAttribute(e,t,i){this.attributeMap[e]=i,Ls(this.attributes,e,t,"an Attribute")}getAttribute(e){return this.attributes[e]||(this.hasParent?this.parent.getAttribute(e):null)}registerValueConverter(e,t){Ls(this.valueConverters,e,t,"a ValueConverter")}getValueConverter(e){return this.valueConverters[e]||(this.hasParent?this.parent.getValueConverter(e):null)}registerBindingBehavior(e,t){Ls(this.bindingBehaviors,e,t,"a BindingBehavior")}getBindingBehavior(e){return this.bindingBehaviors[e]||(this.hasParent?this.parent.getBindingBehavior(e):null)}registerValue(e,t){Ls(this.values,e,t,"a value")}getValue(e){return this.values[e]||(this.hasParent?this.parent.getValue(e):null)}autoRegister(t,i){let n=d.getOwn(d.resource,i);return n?n instanceof fo&&(e.convention(i,n),null===n.attributeName&&null===n.elementName&&fo.convention(i.name,n),null===n.attributeName&&null===n.elementName&&(n.elementName=cs(i.name))):((n=e.convention(i)||fo.convention(i.name)||Cr.convention(i.name)||_r.convention(i.name)||ds.convention(i.name))||((n=new fo).elementName=cs(i.name)),d.define(d.resource,n,i)),n.initialize(t,i),n.register(this),n}},Fs=class{constructor(e,t,i,n,r,s,o){this.container=e,this.viewFactory=t,this.resources=t.resources,this.fragment=i,this.firstChild=i.firstChild,this.lastChild=i.lastChild,this.controllers=n,this.bindings=r,this.children=s,this.slots=o,this.hasSlots=!1,this.fromCache=!1,this.isBound=!1,this.isAttached=!1,this.bindingContext=null,this.overrideContext=null,this.controller=null,this.viewModelScope=null,this.animatableElement=void 0,this._isUserControlled=!1,this.contentView=null;for(let e in o){this.hasSlots=!0;break}}returnToCache(){this.viewFactory.returnViewToCache(this)}created(){let e,t,i=this.controllers;for(e=0,t=i.length;e=n?this.add(t):(t.insertNodesBefore(i[e].firstChild),i.splice(e,0,t),this.isAttached?(t.attached(),this.animateView(t,"enter")):void 0)}move(e,t){if(e===t)return;const i=this.children,n=i[e];n.removeNodes(),n.insertNodesBefore(i[t].firstChild),i.splice(e,1),i.splice(t,0,n)}remove(e,t,i){return this.removeAt(this.children.indexOf(e),t,i)}removeMany(e,t,i){const n=this.children;let r,s=e.length,o=[];e.forEach(e=>{if(i)return void e.removeNodes();let t=this.animateView(e,"leave");t?o.push(t.then(()=>e.removeNodes())):e.removeNodes()});let a=()=>{if(this.isAttached)for(r=0;r=0&&n.splice(t,1)}};return o.length>0?Promise.all(o).then(()=>a()):a()}removeAt(e,t,i){let n=this.children[e],r=()=>(e=this.children.indexOf(n),n.removeNodes(),this.children.splice(e,1),this.isAttached&&n.detached(),t&&n.returnToCache(),n);if(!i){let e=this.animateView(n,"leave");if(e)return e.then(()=>r())}return r()}removeAll(e,t){let i,n=this.children,r=n.length,s=[];n.forEach(e=>{if(t)return void e.removeNodes();let i=this.animateView(e,"leave");i?s.push(i.then(()=>e.removeNodes())):e.removeNodes()});let o=()=>{if(this.isAttached)for(i=0;i0?Promise.all(s).then(()=>o()):o()}attached(){let e,t,i,n;if(!this.isAttached)for(this.isAttached=!0,e=0,t=(i=this.children).length;eIs.distributeView(t,e,this))}_projectionAdd(e){Is.distributeView(e,this.projectToSlots,this),this.children.push(e),this.isAttached&&e.attached()}_projectionInsert(e,t){0===e&&!this.children.length||e>=this.children.length?this.add(t):(Is.distributeView(t,this.projectToSlots,this,e),this.children.splice(e,0,t),this.isAttached&&t.attached())}_projectionMove(e,t){if(e===t)return;const i=this.children,n=i[e];Is.undistributeView(n,this.projectToSlots,this),Is.distributeView(n,this.projectToSlots,this,t),i.splice(e,1),i.splice(t,0,n)}_projectionRemove(e,t){Is.undistributeView(e,this.projectToSlots,this),this.children.splice(this.children.indexOf(e),1),this.isAttached&&e.detached(),t&&e.returnToCache()}_projectionRemoveAt(e,t){let i=this.children[e];Is.undistributeView(i,this.projectToSlots,this),this.children.splice(e,1),this.isAttached&&i.detached(),t&&i.returnToCache()}_projectionRemoveMany(e,t){e.forEach(e=>this.remove(e,t))}_projectionRemoveAll(e){Is.undistributeAll(this.projectToSlots,this);let t=this.children,i=t.length;for(let n=0;n0?this.cache=[]:this.cache=null,this.isCaching=this.cacheSize>0}getCachedView(){return null!==this.cache&&this.cache.pop()||null}returnViewToCache(e){e.isAttached&&e.detached(),e.isBound&&e.unbind(),null!==this.cache&&this.cache.length{const r=e.address;return e.onReady?i.hasDependency(r)?null===e.template?e.onReady:Promise.resolve(new class{constructor(e){e.then(e=>this.viewFactory=e)}create(e,t,i,n){return this.viewFactory.create(e,t,i,n)}get isCaching(){return this.viewFactory.isCaching}setCacheSize(e,t){this.viewFactory.setCacheSize(e,t)}getCachedView(){return this.viewFactory.getCachedView()}returnViewToCache(e){this.viewFactory.returnViewToCache(e)}}(e.onReady)):(i.addDependency(r),e.onReady):(i.addDependency(r),e.onReady=this.loadTemplateResources(e,t,i,n).then(i=>{if(e.resources=i,null===e.template)return e.factory=null;let n=this.viewCompiler.compile(e.template,i,t);return e.factory=n}),e.onReady)})}loadTemplateResources(t,i,n,r){let s,o,a=new Bs(this.appResources,t.address),l=t.dependencies;if(i=i||fs.normal,0===l.length&&!i.associatedModuleId)return Promise.resolve(a);if(s=l.map(e=>e.src),o=l.map(e=>e.name),so.debug(`importing resources for ${t.address}`,s),r){let n=d.get(e.viewModelRequireMetadataKey,r);if(n){let e=s.length;for(let e=0,i=n.length;e{let n=m.get(i).moduleId,r=this.moduleAnalyzer.analyze(n,i,t);if(!r.mainResource)throw new Error(`No view model found in module "${e}".`);return r.initialize(this.container),r.mainResource})}importViewResources(e,t,i,n,r){return r=r||new ms,n=n||fs.normal,e=e.map(e=>this._applyLoaderPlugin(e)),this.loader.loadAllModules(e).then(e=>{let s,o,a,l,h,c,u=this.container,d=this.moduleAnalyzer,p=new Array(e.length);for(s=0,o=e.length;si)})}_applyLoaderPlugin(e){let t=e.lastIndexOf(".");if(-1!==t){let i=e.substring(t),n=this._pluginMap[i];return void 0===n?e:this.loader.applyPluginToUrl(e,n)}return e}},Zr.viewModelRequireMetadataKey="aurelia:view-model-require",Jr=es))||Jr,lo=class{constructor(e,t,i,n){this.behavior=e,this.instruction=t,this.viewModel=i,this.isAttached=!1,this.view=null,this.isBound=!1,this.scope=null,this.container=n,this.elementEvents=n.elementEvents||null;let r,s,o=e.observerLocator.getOrCreateObserversLookup(i),a=e.handlesBind,l=t.attributes,h=this.boundProperties=[],c=e.properties;for(e._ensurePropertiesDefined(i,o),r=0,s=c.length;r{e[r](t,i),e.propertyChanged(s,t,i)}:(t,i)=>e[r](t,i);else if("propertyChanged"in e)i=((t,i)=>e.propertyChanged(s,t,i));else if(null!==r)throw new Error(`Change handler ${r} was specified but not declared on the class.`);return void 0!==n&&(t="function"==typeof n?n.call(e):n),new ho(this.owner.taskQueue,e,this.name,i,t)}}_initialize(e,t,i,n,r){let s,o,a,l=this.defaultValue;if(this.isDynamic)for(let s in i)this._createDynamicProperty(e,t,n,s,i[s],r);else this.hasOptions||(o=t[this.name],null!==i&&(s=o.selfSubscriber,a=i[this.attribute],n&&(o.selfSubscriber=null),"string"==typeof a?(e[this.name]=a,o.call()):a?r.push({observer:o,binding:a.createBinding(e)}):void 0!==l&&o.call(),o.selfSubscriber=s),o.publishing=!0)}_createDynamicProperty(e,t,i,n,r,s){let o,a,l=n+"Changed",h=null;l in e?h="propertyChanged"in e?(t,i)=>{e[l](t,i),e.propertyChanged(n,t,i)}:(t,i)=>e[l](t,i):"propertyChanged"in e&&(h=((t,i)=>e.propertyChanged(n,t,i))),o=t[n]=new ho(this.owner.taskQueue,e,n,h),Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:o.getValue.bind(o),set:o.setValue.bind(o)}),i&&(o.selfSubscriber=null),"string"==typeof r?(e[n]=r,o.call()):r&&(a={observer:o,binding:r.createBinding(e)},s.push(a)),o.publishing=!0,o.selfSubscriber=h}},po=0;function go(){return!0}function mo(){}let fo=class e{constructor(){this.elementName=null,this.attributeName=null,this.attributeDefaultBindingMode=void 0,this.liftsContent=!1,this.targetShadowDOM=!1,this.shadowDOMOptions=null,this.processAttributes=mo,this.processContent=go,this.usesShadowDOM=!1,this.childBindings=null,this.hasDynamicOptions=!1,this.containerless=!1,this.properties=[],this.attributes={},this.isInitialized=!1,this.primaryProperty=null}static convention(t,i){let n;return t.endsWith("CustomAttribute")&&((n=i||new e).attributeName=cs(t.substring(0,t.length-15))),t.endsWith("CustomElement")&&((n=i||new e).elementName=cs(t.substring(0,t.length-13))),n}addChildBinding(e){null===this.childBindings&&(this.childBindings=[]),this.childBindings.push(e)}initialize(e,t){let n,r,s,o=t.prototype,a=this.properties,l=this.attributeName,h=this.attributeDefaultBindingMode;if(!this.isInitialized)if(this.isInitialized=!0,t.__providerId__=++po,this.observerLocator=e.get(vr),this.taskQueue=e.get(Ae),this.target=t,this.usesShadowDOM=this.targetShadowDOM&&i.shadowDOM,this.handlesCreated="created"in o,this.handlesBind="bind"in o,this.handlesUnbind="unbind"in o,this.handlesAttached="attached"in o,this.handlesDetached="detached"in o,this.htmlName=this.elementName||this.attributeName,null!==l)if(0===a.length&&new uo({name:"value",changeHandler:"valueChanged"in o?"valueChanged":null,attribute:l,defaultBindingMode:h}).registerWith(t,this),s=a[0],1===a.length&&"value"===s.name)s.isDynamic=s.hasOptions=this.hasDynamicOptions,s.defineOn(t,this);else{for(n=0,r=a.length;n{e.registerAttribute(t,this,this.attributeName)})),null!==this.elementName&&e.registerElement(t||this.elementName,this)}load(e,t,i,n,r){let s;return null!==this.elementName?(n=e.get(Os).getViewStrategy(n||this.viewStrategy||t),s=new fs(this.targetShadowDOM,!0),n.moduleId||(n.moduleId=m.get(t).moduleId),n.loadViewFactory(e.get(ao),s,i,t).then(e=>(r&&this.viewFactory||(this.viewFactory=e),e))):Promise.resolve(this)}compile(e,t,i,n,s){if(this.liftsContent){if(!n.viewFactory){let o=r.createElement("template"),a=r.createDocumentFragment(),l=i.getAttribute("view-cache"),h=i.getAttribute("part");i.removeAttribute(n.originalAttrName),r.replaceNode(o,i,s),a.appendChild(i),n.viewFactory=e.compile(a,t),h&&(n.viewFactory.part=h,i.removeAttribute("part")),l&&(n.viewFactory.setCacheSize(l),i.removeAttribute("view-cache")),i=o}}else if(null!==this.elementName){let o={};if(this.processContent(e,t,i,n)&&i.hasChildNodes()){let a,l,h=i.firstChild,c=this.usesShadowDOM?null:r.createElement("au-content");for(;h;)a=h.nextSibling,"TEMPLATE"===h.tagName&&(l=h.getAttribute("replace-part"))?(o[l]=e.compile(h,t),r.removeNode(h,s),n.partReplacements=o):null!==c&&(3===h.nodeType&&us(h)?r.removeNode(h,s):c.appendChild(h)),h=a;null!==c&&c.hasChildNodes()&&i.appendChild(c),n.skipContentProcessing=!1}else n.skipContentProcessing=!0}else this.processContent(e,t,i,n)||(n.skipContentProcessing=!0);return i}create(e,t,i,n){let s,o=null;t=t||vs.normal,i=i||null,n=n||null,null!==this.elementName&&i&&(this.usesShadowDOM?(s=i.attachShadow(this.shadowDOMOptions),e.registerInstance(r.boundary,s)):(s=i,this.targetShadowDOM&&e.registerInstance(r.boundary,s))),null!==i&&(i.au=o=i.au||{});let a,l=t.viewModel||e.get(this.target),h=new lo(this,t,l,e),c=this.childBindings;if(this.liftsContent)o.controller=h;else if(null!==this.elementName){if(a=t.viewFactory||this.viewFactory,e.viewModel=l,a&&(h.view=a.create(e,t,i)),null!==i){if(o.controller=h,h.view){if(!this.usesShadowDOM&&(1===i.childNodes.length||i.contentElement)){let e=i.childNodes[0]||i.contentElement;h.view.contentView={fragment:e},e.parentNode&&r.removeNode(e)}if(t.anchorIsContainer){if(null!==c)for(let e=0,t=c.length;ee.name===t.name)||new uo(t).registerWith(n,this)}}};function vo(e,t){return function(i,n,r){let s="string"==typeof n?i.constructor:i,o=d.getOrCreateOwn(d.resource,fo,s);"string"==typeof e&&(e={selector:e,name:n}),r&&(r.writable=!0,r.configurable=!0),e.all=t,o.addChildBinding(new bo(e))}}let bo=class{constructor(e){this.name=e.name,this.changeHandler=e.changeHandler||this.name+"Changed",this.selector=e.selector,this.all=e.all}create(e,t,i){return new Co(this.selector,e,this.name,t,i,this.changeHandler,this.all)}};const wo=[];function yo(e,t,i){let n=e.get(t);n||(n=[],e.set(t,n)),n.push(i)}function xo(e,t){let i=t.binders,n=i.length,r=new Map;for(let t=0,s=e.length;t{null!==t.changeHandler&&t.viewModel[t.changeHandler](e)})}let Co=class{constructor(e,t,i,n,r,s,o){this.selector=e,this.viewHost=t,this.property=i,this.viewModel=n,this.controller=r,this.changeHandler=s in n?s:null,this.usesShadowDOM=r.behavior.usesShadowDOM,this.all=o,!this.usesShadowDOM&&r.view&&r.view.contentView?this.contentView=r.view.contentView:this.contentView=null}matches(e){if(e.matches(this.selector)){if(null===this.contentView)return!0;let t=this.contentView,i=e.auAssignedSlot;if(i&&i.projectFromAnchors){let e=i.projectFromAnchors;for(let i=0,n=e.length;ivoid 0===t?i():i().then(()=>ko(e,t)),with:(e,t,i)=>void 0===t?i():Promise.all([ko(e,t),i()]),after:(e,t,i)=>Promise.resolve(e.removeAll(!0)).then(i)};function So(e){return e.skipActivation||"function"!=typeof e.viewModel.activate?Promise.resolve():e.viewModel.activate(e.model)||Promise.resolve()}let Eo=Se(ao,Os)(is=class{constructor(e,t){this.viewEngine=e,this.viewLocator=t}_swap(e,t){let i=_o[e.swapOrder]||_o.after,n=e.viewSlot.children.slice();return i(e.viewSlot,n,()=>Promise.resolve(e.viewSlot.add(t)).then(()=>{e.currentController&&e.currentController.unbind()})).then(()=>{e.compositionTransactionNotifier&&e.compositionTransactionNotifier.done()})}_createControllerAndSwap(e){return this.createController(e).then(t=>e.compositionTransactionOwnershipToken?e.compositionTransactionOwnershipToken.waitForCompositionComplete().then(()=>(t.automate(e.overrideContext,e.owningView),this._swap(e,t.view))).then(()=>t):(t.automate(e.overrideContext,e.owningView),this._swap(e,t.view).then(()=>t)))}createController(e){let t,i,n,r;return this.ensureViewModel(e).then(So).then(()=>{t=e.childContainer,i=e.viewModel,n=e.viewModelResource,r=n.metadata;let s=this.viewLocator.getViewStrategy(e.view||i);return e.viewResources&&s.makeRelativeTo(e.viewResources.viewUrl),r.load(t,n.value,null,s,!0)}).then(n=>r.create(t,vs.dynamic(e.host,i,n)))}ensureViewModel(e){let t=e.childContainer=e.childContainer||e.container.createChild();if("string"==typeof e.viewModel)return e.viewModel=e.viewResources?e.viewResources.relativeToView(e.viewModel):e.viewModel,this.viewEngine.importViewModelResource(e.viewModel).then(i=>(t.autoRegister(i.value),e.host&&t.registerInstance(r.Element,e.host),e.viewModel=t.viewModel=t.get(i.value),e.viewModelResource=i,e));let i=e.viewModel.constructor,n="function"==typeof e.viewModel;n&&(i=e.viewModel,t.autoRegister(i));let s=d.getOrCreateOwn(d.resource,fo,i);return s.elementName=s.elementName||"dynamic-element",s.initialize(n?t:e.container||t,i),e.viewModelResource={metadata:s,value:i},e.host&&t.registerInstance(r.Element,e.host),t.viewModel=e.viewModel=n?t.get(i):e.viewModel,Promise.resolve(e)}compose(e){e.childContainer=e.childContainer||e.container.createChild(),e.view=this.viewLocator.getViewStrategy(e.view);let t=e.childContainer.get(as),i=t.tryCapture();return i?e.compositionTransactionOwnershipToken=i:e.compositionTransactionNotifier=t.enlist(),e.viewModel?this._createControllerAndSwap(e):e.view?(e.viewResources&&e.view.makeRelativeTo(e.viewResources.viewUrl),e.view.loadViewFactory(this.viewEngine,new fs).then(t=>{let i=t.create(e.childContainer);return i.bind(e.bindingContext,e.overrideContext),e.compositionTransactionOwnershipToken?e.compositionTransactionOwnershipToken.waitForCompositionComplete().then(()=>this._swap(e,i)).then(()=>i):this._swap(e,i).then(()=>i)})):e.viewSlot?(e.viewSlot.removeAll(),e.compositionTransactionNotifier&&e.compositionTransactionNotifier.done(),Promise.resolve(null)):Promise.resolve(null)}})||is,Ao=class{initialize(e,t){}register(e,t){}load(e,t){let i=new t;e.get(Hn).registerElementConfig(i)}};function Oo(e){return function(t){"string"==typeof e||Object.getPrototypeOf(e)===Object.prototype?t.$resource=e:d.define(d.resource,e,t)}}function Po(e){return function(t){d.getOrCreateOwn(d.resource,fo,t).elementName=js(e,"custom element")}}function Vo(e,t,i){return function(n){let r=d.getOrCreateOwn(d.resource,fo,n);r.attributeName=js(e,"custom attribute"),r.attributeDefaultBindingMode=t,r.aliases=i}}function Ro(e){let t=function(e){d.getOrCreateOwn(d.resource,fo,e).liftsContent=!0};return e?t(e):t}function No(e,t,i){let n=function(t,i,n){let r,s=i?t.constructor:t,o=d.getOrCreateOwn(d.resource,fo,s);return i&&((e=e||{}).name=i),(r=new uo(e)).registerWith(s,o,n)};if(!e)return n;if(t){let r=e;return e=null,n(r,t,i)}return n}const To={mode:"open"};function Mo(){return!1}function Io(e){return function(t){d.define(Os.viewStrategyMetadataKey,e,t)}}function Lo(e){return Io(new Cs(e))}function jo(e,t,i){return Io(new Es(e,t,i))}function Bo(e,t){let i,n;"function"==typeof e?i=e:(n=e,i=void 0);let r=function(e){d.define(Os.viewStrategyMetadataKey,new _s(n,t),e)};return i?r(i):r}let Fo=Se(ke,ro,to,Eo)(ns=class{constructor(e,t,i,n){this._container=e,this._moduleAnalyzer=t,this._viewCompiler=i,this._compositionEngine=n,e.registerInstance(rs,rs.instance=new rs)}configureAnimator(e){this._container.unregister(rs),this._container.registerInstance(rs,rs.instance=e)}compose(e){return this._compositionEngine.compose(e)}enhance(e){e instanceof r.Element&&(e={element:e});let t={letExpressions:[]},i=e.resources||this._container.get(Bs);this._viewCompiler._compileNode(e.element,i,t,e.element.parentNode,"root",!0);let n=new Xs(e.element,t,i),s=e.container||this._container.createChild(),o=n.create(s,vs.enhance());return o.bind(e.bindingContext||{},e.overrideContext),o.firstChild=o.lastChild=o.fragment,o.fragment=r.createDocumentFragment(),o.attached(),o}})||ns;const qo=W("aurelia"),zo=/\.[^\/.]+$/;function $o(e,t){let i,n=()=>(i=t.shift())?Promise.resolve(i(e)).then(n):Promise.resolve();return n()}function Do(e,t,i){if(0===Object.keys(t).length)return Promise.resolve();let n=e.container.get(ao);return Promise.all(Object.keys(t).map(i=>(function(t){let i=t.moduleId,n=Ho(i);r(i)&&(i=s(i));return e.loader.normalize(i,t.relativeTo).then(e=>({name:t.moduleId,importId:r(t.moduleId)?function(e,t){return s(e)+"."+t}(e,n):e}))})(t[i]))).then(e=>{let t=[],r=[];return e.forEach(e=>{t.push(void 0),r.push(e.importId)}),n.importViewResources(r,t,i)});function r(e){let t=Ho(e);return!!t&&(""!==t&&(".js"!==t&&".ts"!==t))}function s(e){return e.replace(zo,"")}}function Ho(e){let t=e.match(zo);if(t&&t.length>0)return t[0].split(".")[1]}function Uo(e){return Promise.all(e.behaviorsToLoad.map(t=>t.load(e.container,t.target))).then(()=>{e.behaviorsToLoad=null})}function Wo(e){if(e.processed)throw new Error("This config instance has already been applied. To load more plugins or global resources, create a new FrameworkConfiguration instance.")}function Qo(e,t){return`Invalid ${t} [${e}], ${t} must be specified as functions or relative module IDs.`}let Go=class{constructor(e){this.aurelia=e,this.container=e.container,this.info=[],this.processed=!1,this.preTasks=[],this.postTasks=[],this.behaviorsToLoad=[],this.configuredPlugins=[],this.resourcesToLoad={},this.preTask(()=>e.loader.normalize("aurelia-bootstrapper").then(e=>this.bootstrapperName=e)),this.postTask(()=>Do(e,this.resourcesToLoad,e.resources))}instance(e,t){return this.container.registerInstance(e,t),this}singleton(e,t){return this.container.registerSingleton(e,t),this}transient(e,t){return this.container.registerTransient(e,t),this}preTask(e){return Wo(this),this.preTasks.push(e),this}postTask(e){return Wo(this),this.postTasks.push(e),this}feature(e,t={}){switch(typeof e){case"string":let i=/\/index$/i.test(e),n=i||Ho(e)?e:e+"/index",r=i?e.substr(0,e.length-6):e;this.info.push({moduleId:n,resourcesRelativeTo:[r,""],config:t});break;case"function":this.info.push({configure:e,config:t||{}});break;default:throw new Error(Qo(e,"feature"))}return this}globalResources(e){Wo(this);let t,i=Array.isArray(e)?e:arguments,n=this.resourcesRelativeTo||["",""];for(let e=0,r=i.length;eUo(this));break;default:throw new Error(Qo(t,"resource"))}return this}globalName(e,t){return Wo(this),this.resourcesToLoad[e]={moduleId:t,relativeTo:""},this}plugin(e,t){let i;switch(Wo(this),typeof e){case"string":i={moduleId:e,resourcesRelativeTo:[e,""],config:t||{}};break;case"function":i={configure:e,config:t||{}};break;default:throw new Error(Qo(e,"plugin"))}return this.info.push(i),this}_addNormalizedPlugin(e,t){let i={moduleId:e,resourcesRelativeTo:[e,""],config:t||{}};return this.info.push(i),this.preTask(()=>{let t=[e,this.bootstrapperName];return i.moduleId=e,i.resourcesRelativeTo=t,Promise.resolve()}),this}defaultBindingLanguage(){return this._addNormalizedPlugin("aurelia-templating-binding")}router(){return this._addNormalizedPlugin("aurelia-templating-router")}history(){return this._addNormalizedPlugin("aurelia-history-browser")}defaultResources(){return this._addNormalizedPlugin("aurelia-templating-resources")}eventAggregator(){return this._addNormalizedPlugin("aurelia-event-aggregator")}basicConfiguration(){return this.defaultBindingLanguage().defaultResources().eventAggregator()}standardConfiguration(){return this.basicConfiguration().history().router()}developmentLogging(e){let t=e?L[e]:void 0;return void 0===t&&(t=L.debug),this.preTask(()=>this.aurelia.loader.normalize("aurelia-logging-console",this.bootstrapperName).then(e=>this.aurelia.loader.loadModule(e).then(e=>{Q(new e.ConsoleAppender),G(t)}))),this}apply(){return this.processed?Promise.resolve():$o(this,this.preTasks).then(()=>{let e,t=this.aurelia.loader,i=this.info,n=()=>(e=i.shift())?function(e,t,i){if(qo.debug(`Loading plugin ${i.moduleId}.`),"string"==typeof i.moduleId){e.resourcesRelativeTo=i.resourcesRelativeTo;let r=i.moduleId;return i.resourcesRelativeTo.length>1?t.normalize(i.moduleId,i.resourcesRelativeTo[1]).then(e=>n(e)):n(r)}if("function"==typeof i.configure)return-1!==e.configuredPlugins.indexOf(i.configure)?Promise.resolve():(e.configuredPlugins.push(i.configure),Promise.resolve(i.configure.call(null,e,i.config||{})));throw new Error(Qo(i.moduleId||i.configure,"plugin"));function n(n){return t.loadModule(n).then(t=>{if("configure"in t)return-1!==e.configuredPlugins.indexOf(t.configure)?Promise.resolve():Promise.resolve(t.configure(e,i.config||{})).then(()=>{e.configuredPlugins.push(t.configure),e.resourcesRelativeTo=null,qo.debug(`Configured plugin ${i.moduleId}.`)});e.resourcesRelativeTo=null,qo.debug(`Loaded plugin ${i.moduleId}.`)})}}(this,t,e).then(n):(this.processed=!0,this.configuredPlugins=null,Promise.resolve());return n().then(()=>$o(this,this.postTasks))})}};const Ko=ne;var Xo,Yo,Jo,Zo,ea,ta,ia,na;let ra=(Yo=Xo=class{constructor(e){this.elements=Object.create(null),this.allElements=Object.create(null),this.svg=e,this.registerUniversal("accesskey","accessKey"),this.registerUniversal("contenteditable","contentEditable"),this.registerUniversal("tabindex","tabIndex"),this.registerUniversal("textcontent","textContent"),this.registerUniversal("innerhtml","innerHTML"),this.registerUniversal("scrolltop","scrollTop"),this.registerUniversal("scrollleft","scrollLeft"),this.registerUniversal("readonly","readOnly"),this.register("label","for","htmlFor"),this.register("img","usemap","useMap"),this.register("input","maxlength","maxLength"),this.register("input","minlength","minLength"),this.register("input","formaction","formAction"),this.register("input","formenctype","formEncType"),this.register("input","formmethod","formMethod"),this.register("input","formnovalidate","formNoValidate"),this.register("input","formtarget","formTarget"),this.register("textarea","maxlength","maxLength"),this.register("td","rowspan","rowSpan"),this.register("td","colspan","colSpan"),this.register("th","rowspan","rowSpan"),this.register("th","colspan","colSpan")}register(e,t,i){e=e.toLowerCase(),t=t.toLowerCase(),(this.elements[e]=this.elements[e]||Object.create(null))[t]=i}registerUniversal(e,t){e=e.toLowerCase(),this.allElements[e]=t}map(e,t){if(this.svg.isStandardSvgAttribute(e,t))return t;e=e.toLowerCase(),t=t.toLowerCase();const i=this.elements[e];return void 0!==i&&t in i?i[t]:t in this.allElements?this.allElements[t]:/(?:^data-)|(?:^aria-)|:/.test(t)?t:He(t)}},Xo.inject=[fr],Yo),sa=class{constructor(e,t,i,n,r,s){this.observerLocator=e,this.targetProperty=t,this.parts=i,this.mode=n,this.lookupFunctions=r,this.attribute=this.attrToRemove=s,this.discrete=!1}createBinding(e){return 3===this.parts.length?new la(e,this.observerLocator,this.parts[1],this.mode,this.lookupFunctions,this.targetProperty,this.parts[0],this.parts[2]):new aa(this.observerLocator,this.parts,e,this.targetProperty,this.mode,this.lookupFunctions)}};function oa(e,t){if("style"===t)W("templating-binding").info('Internet Explorer does not support interpolation in "style" attributes. Use the style attribute\'s alias, "css" instead.');else if(e.parentElement&&"TEXTAREA"===e.parentElement.nodeName&&"textContent"===t)throw new Error('Interpolation binding cannot be used in the content of a textarea element. Use instead.')}let aa=class{constructor(e,t,i,n,r,s){oa(i,n),this.observerLocator=e,this.parts=t,this.target=i,this.targetProperty=n,this.targetAccessor=e.getAccessor(i,n),this.mode=r,this.lookupFunctions=s}interpolate(){if(this.isBound){let e="",t=this.parts;for(let i=0,n=t.length;i=ai.oneTime?i.attributes[t].defaultBindingMode:ai.oneWay}bind(e,t,i,n,r){let s=n||vs.attribute(i.attrName);return s.attributes[i.attrName]=new br(this.observerLocator,this.attributeMap.map(t.tagName,i.attrName),this.parser.parse(i.attrValue),void 0===i.defaultBindingMode||null===i.defaultBindingMode?this.determineDefaultBindingMode(t,i.attrName,r):i.defaultBindingMode,e.lookupFunctions),s}trigger(e,t,i){return new Er(this.eventManager,i.attrName,this.parser.parse(i.attrValue),Dn.none,!0,e.lookupFunctions)}capture(e,t,i){return new Er(this.eventManager,i.attrName,this.parser.parse(i.attrValue),Dn.capturing,!0,e.lookupFunctions)}delegate(e,t,i){return new Er(this.eventManager,i.attrName,this.parser.parse(i.attrValue),Dn.bubbling,!0,e.lookupFunctions)}call(e,t,i,n){let r=n||vs.attribute(i.attrName);return r.attributes[i.attrName]=new yr(this.observerLocator,i.attrName,this.parser.parse(i.attrValue),e.lookupFunctions),r}options(e,t,i,n,r){let s,o,a,l=n||vs.attribute(i.attrName),h=i.attrValue,c=this.language,u=null,d="",p=!1,g=!1,m=!1;for(o=0,a=h.length;ot;++t)if(r=(i=l[t]).name,s=i.nodeValue,n=r.split("."),r!==h)if(2===n.length){if("bind"!==(o=n[1])){W("templating-binding-language").warn(`Detected invalid let command. Expected "${n[0]}.bind", given "${r}"`);continue}a.push(new ha(this.observerLocator,He(n[0]),this.parser.parse(s),e.lookupFunctions,c))}else r=He(r),null===(n=this.parseInterpolation(e,s))&&W("templating-binding-language").warn(`Detected string literal in let bindings. Did you mean "${r}.bind=${s}" or "${r}=\${${s}}" ?`),n?a.push(new ua(this.observerLocator,r,n,e.lookupFunctions,c)):a.push(new ha(this.observerLocator,r,new ei(s),e.lookupFunctions,c));return a}inspectTextContent(e,t){const i=this.parseInterpolation(e,t);return null===i?null:new sa(this.observerLocator,"textContent",i,ai.oneWay,e.lookupFunctions,"textContent")}parseInterpolation(e,t){let i,n,r,s=t.indexOf("${",0),o=t.length,a=0,l=0,h=null,c=0;for(;s>=0&&s0&&s{e.currentController=t,e.currentViewModel=t?t.viewModel:null})}else if(e.pendingTask=function(e,t){if(e&&"function"==typeof e.activate)return Promise.resolve(e.activate(t))}(e.currentViewModel,t.model),!e.pendingTask)return;e.pendingTask=e.pendingTask.then(()=>{Aa(e)},t=>{throw Aa(e),t})}function Aa(e){e.pendingTask=null,function(e){for(const t in e)return!1;return!0}(e.changes)||Ea(e)}function Oa(e){e.pendingTask||e.updateRequested||(e.updateRequested=!0,e.taskQueue.queueMicroTask(()=>{e.updateRequested=!1,Ea(e)}))}let Pa=class{constructor(e,t){this.viewFactory=e,this.viewSlot=t,this.view=null,this.bindingContext=null,this.overrideContext=null,this.showing=!1}bind(e,t){this.bindingContext=e,this.overrideContext=t}unbind(){null!==this.view&&(this.view.unbind(),this.viewFactory.isCaching&&(this.showing?(this.showing=!1,this.viewSlot.remove(this.view,!0,!0)):this.view.returnToCache(),this.view=null))}_show(){if(!this.showing)return null===this.view&&(this.view=this.viewFactory.create()),this.view.isBound||this.view.bind(this.bindingContext,this.overrideContext),this.showing=!0,this.viewSlot.add(this.view);this.view.isBound||this.view.bind(this.bindingContext,this.overrideContext)}_hide(){if(!this.showing)return;this.showing=!1;let e=this.viewSlot.remove(this.view);if(e instanceof Promise)return e.then(()=>this.view.unbind());this.view.unbind()}};var Va,Ra,Na,Ta,Ma,Ia,La;function ja(e,t,i,n){i&&Object.defineProperty(e,t,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(n):void 0})}function Ba(e,t,i,n,r){var s={};return Object.keys(n).forEach(function(e){s[e]=n[e]}),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=i.slice().reverse().reduce(function(i,n){return n(e,t,i)||i},s),r&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(r):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s}let Fa=(Va=Vo("if"),Ra=Se(Ks,qs),Na=No({primaryProperty:!0}),Va(Ta=Ro(Ta=Ra((Ia=Ba((Ma=class extends Pa{constructor(...e){var t;return t=super(...e),ja(this,"condition",Ia,this),ja(this,"swapOrder",La,this),t}bind(e,t){super.bind(e,t),this.condition?this._show():this._hide()}conditionChanged(e){this._update(e)}_update(e){if(this.animating)return;let t;(t=this.elseVm?e?this._swap(this.elseVm,this):this._swap(this,this.elseVm):e?this._show():this._hide())&&(this.animating=!0,t.then(()=>{this.animating=!1,this.condition!==this.showing&&this._update(this.condition)}))}_swap(e,t){switch(this.swapOrder){case"before":return Promise.resolve(t._show()).then(()=>e._hide());case"with":return Promise.all([e._hide(),t._show()]);default:let i=e._hide();return i?i.then(()=>t._show()):t._show()}}}).prototype,"condition",[Na],{enumerable:!0,initializer:null}),La=Ba(Ma.prototype,"swapOrder",[No],{enumerable:!0,initializer:null}),Ta=Ma))||Ta)||Ta)||Ta);var qa;let za=Vo("else")(qa=Ro(qa=Se(Ks,qs)(qa=class extends Pa{constructor(e,t){super(e,t),this._registerInIf()}bind(e,t){super.bind(e,t),this.ifVm.condition?this._hide():this._show()}_registerInIf(){let e=this.viewSlot.anchor.previousSibling;for(;e&&!e.au;)e=e.previousSibling;if(!e||!e.au.if)throw new Error("Can't find matching If for Else custom attribute.");this.ifVm=e.au.if.viewModel,this.ifVm.elseVm=this}})||qa)||qa)||qa;var $a;let Da=Vo("with")($a=Ro($a=Se(Ks,qs)($a=class{constructor(e,t){this.viewFactory=e,this.viewSlot=t,this.parentOverrideContext=null,this.view=null}bind(e,t){this.parentOverrideContext=t,this.valueChanged(this.value)}valueChanged(e){let t=Ue(e,this.parentOverrideContext);this.view?this.view.bind(e,t):(this.view=this.viewFactory.create(),this.view.bind(e,t),this.viewSlot.add(this.view))}unbind(){this.parentOverrideContext=null,this.view&&this.view.unbind()}})||$a)||$a)||$a;const Ha=ai.oneTime;function Ua(e,t){let i=e.length;for(t>0&&(t-=1);tnull==e,new class{instanceChanged(e,t){e.removeAllViews(!0)}getCollectionObserver(e,t){}}),this.addStrategy(e=>e instanceof Array,new class{getCollectionObserver(e,t){return e.getArrayObserver(t)}instanceChanged(e,t){const i=t.length;if(!t||0===i)return void e.removeAllViews(!0,!e.viewsRequireLifecycle);const n=e.views(),r=n.length;if(0!==r)if(e.viewsRequireLifecycle){const s=n.slice(0),o=e.local,a=e.matcher();let l=[];const h=[];for(let e=0;e0?(u=e.removeViews(h,!0,!e.viewsRequireLifecycle),c=(()=>{for(let r=0;rthis._standardProcessInstanceChanged(e,t))),u instanceof Promise?u.then(c):c()}else this._inPlaceProcessItems(e,t);else this._standardProcessInstanceChanged(e,t)}_standardProcessInstanceChanged(e,t){for(let i=0,n=t.length;ii;)n--,e.removeView(n,!0,!e.viewsRequireLifecycle);let r=e.local;for(let s=0;s{if(!t.length)return e.__queuedSplices=void 0,void(e.__array=void 0);let n=this._runSplices(e,e.__array,t)||Promise.resolve();t=e.__queuedSplices=[],n.then(i)};n.then(i)}}_runSplices(e,t,i){let n=0,r=[];for(let t=0,s=i.length;t0)return Promise.all(r).then(()=>{let n=this._handleAddedSplices(e,t,i);Ua(e.views(),n)});let s=this._handleAddedSplices(e,t,i);Ua(e.views(),s)}_handleAddedSplices(e,t,i){let n,r,s=t.length;for(let o=0,a=i.length;oa.index)&&(r=n);le instanceof Map,new class{getCollectionObserver(e,t){return e.getMapObserver(t)}instanceChanged(e,t){let i=e.removeAllViews(!0,!e.viewsRequireLifecycle);i instanceof Promise?i.then(()=>this._standardProcessItems(e,t)):this._standardProcessItems(e,t)}_standardProcessItems(e,t){let i,n=0;t.forEach((r,s)=>{i=Wa(e,r,n,t.size,s),e.addView(i.bindingContext,i),++n})}instanceMutated(e,t,i){let n,r,s,o,a,l,h,c,u=[];for(r=0,s=i.length;r0?Promise.all(u).then(()=>{Ua(e.views(),0)}):Ua(e.views(),0)}_getViewIndexByKey(e,t){let i,n,r;for(i=0,n=e.viewCount();ie instanceof Set,new class{getCollectionObserver(e,t){return e.getSetObserver(t)}instanceChanged(e,t){let i=e.removeAllViews(!0,!e.viewsRequireLifecycle);i instanceof Promise?i.then(()=>this._standardProcessItems(e,t)):this._standardProcessItems(e,t)}_standardProcessItems(e,t){let i,n=0;t.forEach(r=>{i=Wa(e,r,n,t.size),e.addView(i.bindingContext,i),++n})}instanceMutated(e,t,i){let n,r,s,o,a,l,h,c=[];for(r=0,s=i.length;r0?Promise.all(c).then(()=>{Ua(e.views(),0)}):Ua(e.views(),0)}_getViewIndexByValue(e,t){let i,n,r;for(i=0,n=e.viewCount();i"number"==typeof e,new class{getCollectionObserver(){return null}instanceChanged(e,t){let i=e.removeAllViews(!0,!e.viewsRequireLifecycle);i instanceof Promise?i.then(()=>this._standardProcessItems(e,t)):this._standardProcessItems(e,t)}_standardProcessItems(e,t){let i,n,r,s,o=e.viewCount();if((s=o-(t=Math.floor(t)))>0)for(s>o&&(s=o),i=0,n=s;ie.originalAttrName===t)[0].attributes.items.sourceExpression}(this.instruction,"repeat.for"),this.isOneTime=function(e){for(;e instanceof qt;){if("oneTime"===e.name)return!0;e=e.expression}return!1}(this.sourceExpression),this.viewsRequireLifecycle=Za(e)}call(e,t){this[e](this.items,t)}bind(e,t){this.scope={bindingContext:e,overrideContext:t},this.matcherBinding=this._captureAndRemoveMatcherBinding(),this.itemsChanged()}unbind(){this.scope=null,this.items=null,this.matcherBinding=null,this.viewSlot.removeAll(!0,!0),this._unsubscribeCollection()}_unsubscribeCollection(){this.collectionObserver&&(this.collectionObserver.unsubscribe(this.callContext,this),this.collectionObserver=null,this.callContext=null)}itemsChanged(){if(this._unsubscribeCollection(),!this.scope)return;let e=this.items;if(this.strategy=this.strategyLocator.getStrategy(e),!this.strategy)throw new Error(`Value for '${this.sourceExpression}' is non-repeatable`);this.isOneTime||this._observeInnerCollection()||this._observeCollection(),this.ignoreMutation=!0,this.strategy.instanceChanged(this,e),this.observerLocator.taskQueue.queueMicroTask(()=>{this.ignoreMutation=!1})}_getInnerCollection(){let e=function(e){let t=!1;for(;e instanceof qt;)e=e.expression;for(;e instanceof zt;)e=e.expression,t=!0;return t?e:null}(this.sourceExpression);return e?e.evaluate(this.scope,null):null}handleCollectionMutated(e,t){this.collectionObserver&&(this.ignoreMutation||this.strategy.instanceMutated(this,e,t))}handleInnerCollectionMutated(e,t){if(!this.collectionObserver)return;if(this.ignoreMutation)return;this.ignoreMutation=!0;let i=this.sourceExpression.evaluate(this.scope,this.lookupFunctions);this.observerLocator.taskQueue.queueMicroTask(()=>this.ignoreMutation=!1),i===this.items?this.itemsChanged():this.items=i}_observeInnerCollection(){let e=this._getInnerCollection(),t=this.strategyLocator.getStrategy(e);return!!t&&(this.collectionObserver=t.getCollectionObserver(this.observerLocator,e),!!this.collectionObserver&&(this.callContext="handleInnerCollectionMutated",this.collectionObserver.subscribe(this.callContext,this),!0))}_observeCollection(){let e=this.items;this.collectionObserver=this.strategy.getCollectionObserver(this.observerLocator,e),this.collectionObserver&&(this.callContext="handleCollectionMutated",this.collectionObserver.subscribe(this.callContext,this))}_captureAndRemoveMatcherBinding(){if(this.viewFactory.viewFactory){const e=this.viewFactory.viewFactory.instructions,t=Object.keys(e);for(let i=0;i)<[^<]*)*<\/script>/gi;var fl;let vl=kr("sanitizeHTML")(fl=Se(class{sanitize(e){return e.replace(ml,"")}})(fl=class{constructor(e){this.sanitizer=e}toView(e){return null==e?null:this.sanitizer.sanitize(e)}})||fl)||fl;var bl;let wl=Vo("replaceable")(bl=Ro(bl=Se(Ks,qs)(bl=class{constructor(e,t){this.viewFactory=e,this.viewSlot=t,this.view=null}bind(e,t){null===this.view&&(this.view=this.viewFactory.create(),this.viewSlot.add(this.view)),this.view.bind(e,t)}unbind(){this.view.unbind()}})||bl)||bl)||bl;var yl;let xl=Vo("focus",ai.twoWay)(yl=class{static inject(){return[r.Element,Ae]}constructor(e,t){this.element=e,this.taskQueue=t,this.isAttached=!1,this.needsApply=!1}valueChanged(e){this.isAttached?this._apply():this.needsApply=!0}_apply(){this.value?this.taskQueue.queueMicroTask(()=>{this.value&&this.element.focus()}):this.element.blur()}attached(){this.isAttached=!0,this.needsApply&&(this.needsApply=!1,this._apply()),this.element.addEventListener("focus",this),this.element.addEventListener("blur",this)}detached(){this.isAttached=!1,this.element.removeEventListener("focus",this),this.element.removeEventListener("blur",this)}handleEvent(e){"focus"===e.type?this.value=!0:r.activeElement!==this.element&&(this.value=!1)}})||yl,Cl=/url\((?!['"]data)([^)]+)\)/gi;let kl=class{constructor(e){this.address=e,this._scoped=null,this._global=!1,this._alreadyGloballyInjected=!1}initialize(e,t){this._scoped=new t(this)}register(e,t){"scoped"===t?e.registerViewEngineHooks(this._scoped):this._global=!0}load(e){return e.get(M).loadText(this.address).catch(e=>null).then(e=>{e=function(e,t){if("string"!=typeof t)throw new Error(`Failed loading required CSS file: ${e}`);return t.replace(Cl,(t,i)=>{let n=i.charAt(0);return"'"!==n&&'"'!==n||(i=i.substr(1,i.length-2)),"url('"+k(i,e)+"')"})}(this.address,e),this._scoped.css=e,this._global&&(this._alreadyGloballyInjected=!0,r.injectStyles(e))})}},_l=class{constructor(e){this.owner=e,this.css=null}beforeCompile(e,t,n){if(n.targetShadowDOM)r.injectStyles(this.css,e,!0);else if(i.scopedCSS){r.injectStyles(this.css,e,!0).setAttribute("scoped","scoped")}else this._global&&!this.owner._alreadyGloballyInjected&&(r.injectStyles(this.css),this.owner._alreadyGloballyInjected=!0)}};var Sl;let El=Sr("attr")(Sl=class{bind(e,t){e.targetObserver=new er(e.target,e.targetProperty)}unbind(e,t){}})||Sl;var Al,Ol,Pl,Vl,Rl;let Nl={bind(e,t,i){e.originalMode=e.mode,e.mode=this.mode},unbind(e,t){e.mode=e.originalMode,e.originalMode=null}},Tl=f(Nl)(Al=Sr("oneTime")(Al=class{constructor(){this.mode=ai.oneTime}})||Al)||Al,Ml=f(Nl)(Ol=Sr("oneWay")(Ol=class{constructor(){this.mode=ai.toView}})||Ol)||Ol,Il=f(Nl)(Pl=Sr("toView")(Pl=class{constructor(){this.mode=ai.toView}})||Pl)||Pl,Ll=f(Nl)(Vl=Sr("fromView")(Vl=class{constructor(){this.mode=ai.fromView}})||Vl)||Vl,jl=f(Nl)(Rl=Sr("twoWay")(Rl=class{constructor(){this.mode=ai.twoWay}})||Rl)||Rl;var Bl;function Fl(e){let t=this.throttleState,i=+new Date-t.last;if(i>=t.delay)return clearTimeout(t.timeoutId),t.timeoutId=null,t.last=+new Date,void this.throttledMethod(e);t.newValue=e,null===t.timeoutId&&(t.timeoutId=setTimeout(()=>{t.timeoutId=null,t.last=+new Date,this.throttledMethod(t.newValue)},t.delay-i))}let ql=Sr("throttle")(Bl=class{bind(e,t,i=200){let n="updateTarget";e.callSource?n="callSource":e.updateSource&&e.mode===ai.twoWay&&(n="updateSource"),e.throttledMethod=e[n],e.throttledMethod.originalName=n,e[n]=Fl,e.throttleState={delay:i,last:0,timeoutId:null}}unbind(e,t){e[e.throttledMethod.originalName]=e.throttledMethod,e.throttledMethod=null,clearTimeout(e.throttleState.timeoutId),e.throttleState=null}})||Bl;var zl;const $l={};function Dl(e){const t=this.debounceState;clearTimeout(t.timeoutId),t.timeoutId=setTimeout(()=>this.debouncedMethod(e),t.delay)}function Hl(e,t,i){const n=this.debounceState;if(clearTimeout(n.timeoutId),e!==n.callContextToDebounce)return n.oldValue=$l,void this.debouncedMethod(e,t,i);n.oldValue===$l&&(n.oldValue=i),n.timeoutId=setTimeout(()=>{const i=n.oldValue;n.oldValue=$l,this.debouncedMethod(e,t,i)},n.delay)}let Ul=Sr("debounce")(zl=class{bind(e,t,i=200){const n=void 0!==e.callSource,r=n?"callSource":"call",s=n?Dl:Hl,o=e.mode,a=o===ai.twoWay||o===ai.fromView?"Binding:target":$e;e.debouncedMethod=e[r],e.debouncedMethod.originalName=r,e[r]=s,e.debounceState={callContextToDebounce:a,delay:i,timeoutId:0,oldValue:$l}}unbind(e,t){e[e.debouncedMethod.originalName]=e.debouncedMethod,e.debouncedMethod=null,clearTimeout(e.debounceState.timeoutId),e.debounceState=null}})||zl;var Wl;function Ql(e){let t=function(e){return e.path&&e.path[0]||e.deepPath&&e.deepPath[0]||e.target}(e);this.target===t&&this.selfEventCallSource(e)}let Gl=Sr("self")(Wl=class{bind(e,t){if(!e.callSource||!e.targetEvent)throw new Error("Self binding behavior only supports event.");e.selfEventCallSource=e.callSource,e.callSource=Ql}unbind(e,t){e.callSource=e.selfEventCallSource,e.selfEventCallSource=null}})||Wl;var Kl;let Xl=Sr("signal")(Kl=class{static inject(){return[class{constructor(){this.signals={}}signal(e){let t=this.signals[e];if(!t)return;let i=t.length;for(;i--;)t[i].call($e)}}]}constructor(e){this.signals=e.signals}bind(e,t){if(!e.updateTarget)throw new Error("Only property bindings and string interpolation bindings can be signaled. Trigger, delegate and call bindings cannot be signaled.");if(3===arguments.length){let t=arguments[2];(this.signals[t]||(this.signals[t]=[])).push(e),e.signalName=t}else{if(!(arguments.length>3))throw new Error("Signal name is required.");{let t=Array.prototype.slice.call(arguments,2),i=t.length;for(;i--;){let n=t[i];(this.signals[n]||(this.signals[n]=[])).push(e)}e.signalName=t}}}unbind(e,t){let i=e.signalName;if(e.signalName=null,Array.isArray(i)){let t=i,n=t.length;for(;n--;){let i=t[n],r=this.signals[i];r.splice(r.indexOf(e),1)}}else{let t=this.signals[i];t.splice(t.indexOf(e),1)}}})||Kl;var Yl;const Jl="The updateTrigger binding behavior can only be applied to two-way/ from-view bindings on input/select elements.";let Zl=Sr("updateTrigger")(Yl=class{bind(e,t,...i){if(0===i.length)throw new Error("The updateTrigger binding behavior requires at least one event name argument: eg ");if(e.mode!==ai.twoWay&&e.mode!==ai.fromView)throw new Error(Jl);let n=e.observerLocator.getObserver(e.target,e.targetProperty);if(!n.handler)throw new Error(Jl);e.targetObserver=n,n.originalHandler=e.targetObserver.handler;let r=new Un(i);n.handler=r}unbind(e,t){e.targetObserver.handler.dispose(),e.targetObserver.handler=e.targetObserver.originalHandler,e.targetObserver.originalHandler=null}})||Yl;function eh(e){let t=e.container.get(ao),i=e.aurelia.loader;t.addResourcePlugin(".html",{fetch:function(e){return i.loadTemplate(e).then(t=>{let i=t.template.getAttribute("bindable"),n=function(e){return/([^\/^\?]+)\.html/i.exec(e)[1].toLowerCase()}(e);return i?(i=i.split(",").map(e=>e.trim()),t.template.removeAttribute("bindable")):i=[],{[n]:function(e,t,i){var n;let r=Po(e)(n=Lo(t)(n=class{bind(e){this.$parent=e}})||n)||n;for(let e=0,t=i.length;e({[e]:function(e){var t;return Oo(new kl(e))(t=class extends _l{})||t}(e)})};[".css",".less",".sass",".scss",".styl"].forEach(e=>t.addResourcePlugin(e,i))}const ih=W("event-aggregator");function nh(e,t,i){try{e(t,i)}catch(e){ih.error(e)}}function rh(e,t){try{e.handle(t)}catch(e){ih.error(e)}}let sh=class{constructor(){this.eventLookup={},this.messageHandlers=[]}publish(e,t){let i,n;if(!e)throw new Error("Event was invalid.");if("string"==typeof e){if(i=this.eventLookup[e])for(n=(i=i.slice()).length;n--;)nh(i[n],t,e)}else for(n=(i=this.messageHandlers.slice()).length;n--;)rh(i[n],e)}subscribe(e,t){let i,n;if(!e)throw new Error("Event channel/type was invalid.");return"string"==typeof e?(i=t,n=this.eventLookup[e]||(this.eventLookup[e]=[])):(i=new class{constructor(e,t){this.messageType=e,this.callback=t}handle(e){e instanceof this.messageType&&this.callback.call(null,e)}}(e,t),n=this.messageHandlers),n.push(i),{dispose(){let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}subscribeOnce(e,t){let i=this.subscribe(e,(e,n)=>(i.dispose(),t(e,n)));return i}};function oh(e){let t=new sh;return e.subscribeOnce=function(e,i){return t.subscribeOnce(e,i)},e.subscribe=function(e,i){return t.subscribe(e,i)},e.publish=function(e,i){t.publish(e,i)},t}function ah(e){e.instance(sh,oh(e.aurelia))}function lh(e){throw new Error(`History must implement ${e}().`)}let hh=class{activate(e){lh("activate")}deactivate(){lh("deactivate")}getAbsoluteRoot(){lh("getAbsoluteRoot")}navigate(e,t){lh("navigate")}navigateBack(){lh("navigateBack")}setTitle(e){lh("setTitle")}setState(e,t){lh("setState")}getState(e){lh("getState")}};var ch,uh;let dh=class{activate(e){}deactivate(){}},ph=class e extends dh{constructor(){super(),this.handler=(t=>{let{shouldHandleEvent:i,href:n}=e.getEventInfo(t);i&&(t.preventDefault(),this.history.navigate(n))})}activate(e){e._hasPushState&&(this.history=e,r.addEventListener("click",this.handler,!0))}deactivate(){r.removeEventListener("click",this.handler)}static getEventInfo(t){let i={shouldHandleEvent:!1,href:null,anchor:null},n=e.findClosestAnchor(t.target);if(!n||!e.targetIsThisWindow(n))return i;if(n.hasAttribute("download")||n.hasAttribute("router-ignore"))return i;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return i;let r=n.getAttribute("href");i.anchor=n,i.href=r;let s=1===t.which,o=r&&!("#"===r.charAt(0)||/^[a-z]+:/i.test(r));return i.shouldHandleEvent=s&&o,i}static findClosestAnchor(e){for(;e;){if("A"===e.tagName)return e;e=e.parentNode}}static targetIsThisWindow(e){let t=e.getAttribute("target"),i=n.global;return!t||t===i.name||"_self"===t}};function gh(e){e.singleton(hh,mh),e.transient(dh,ph)}let mh=(uh=ch=class extends hh{constructor(e){super(),this._isActive=!1,this._checkUrlCallback=this._checkUrl.bind(this),this.location=n.location,this.history=n.history,this.linkHandler=e}activate(e){if(this._isActive)throw new Error("History has already been activated.");let t,i=!!e.pushState;if(this._isActive=!0,this.options=Object.assign({},{root:"/"},this.options,e),this.root=("/"+this.options.root+"/").replace(vh,"/"),this._wantsHashChange=!1!==this.options.hashChange,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState),this._hasPushState?t="popstate":this._wantsHashChange&&(t="hashchange"),n.addEventListener(t,this._checkUrlCallback),this._wantsHashChange&&i){let e=this.location,t=e.pathname.replace(/[^\/]$/,"$&/")===this.root;if(!this._hasPushState&&!t)return this.fragment=this._getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0;this._hasPushState&&t&&e.hash&&(this.fragment=this._getHash().replace(fh,""),this.history.replaceState({},r.title,this.root+this.fragment+e.search))}if(this.fragment||(this.fragment=this._getFragment()),this.linkHandler.activate(this),!this.options.silent)return this._loadUrl()}deactivate(){n.removeEventListener("popstate",this._checkUrlCallback),n.removeEventListener("hashchange",this._checkUrlCallback),this._isActive=!1,this.linkHandler.deactivate()}getAbsoluteRoot(){var e,t,i;return`${e=this.location.protocol,t=this.location.hostname,i=this.location.port,`${e}//${t}${i?":"+i:""}`}${this.root}`}navigate(e,{trigger:t=!0,replace:i=!1}={}){if(e&&wh.test(e))return this.location.href=e,!0;if(!this._isActive)return!1;if(e=this._getFragment(e||""),this.fragment===e&&!i)return!1;this.fragment=e;let n=this.root+e;return""===e&&"/"!==n&&(n=n.slice(0,-1)),this._hasPushState?(n=n.replace("//","/"),this.history[i?"replaceState":"pushState"]({},r.title,n)):this._wantsHashChange?function(e,t,i){if(i){let i=e.href.replace(/(javascript:|#).*$/,"");e.replace(i+"#"+t)}else e.hash="#"+t}(this.location,e,i):this.location.assign(n),!t||this._loadUrl(e)}navigateBack(){this.history.back()}setTitle(e){r.title=e}setState(e,t){let i=Object.assign({},this.history.state),{pathname:n,search:r,hash:s}=this.location;i[e]=t,this.history.replaceState(i,null,`${n}${r}${s}`)}getState(e){return Object.assign({},this.history.state)[e]}_getHash(){return this.location.hash.substr(1)}_getFragment(e,t){let i;return e||(this._hasPushState||!this._wantsHashChange||t?(e=this.location.pathname+this.location.search,i=this.root.replace(bh,""),e.indexOf(i)||(e=e.substr(i.length))):e=this._getHash()),"/"+e.replace(fh,"")}_checkUrl(){this._getFragment()!==this.fragment&&this._loadUrl()}_loadUrl(e){let t=this.fragment=this._getFragment(e);return!!this.options.routeHandler&&this.options.routeHandler(t)}},ch.inject=[dh],uh);const fh=/^#?\/*|\s+$/g,vh=/^\/+|\/+$/g,bh=/\/$/,wh=/^([a-z][a-z0-9+\-.]*:)?\/\//i;const yh=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");let xh=class{constructor(e,t){this.string=e,this.caseSensitive=t}eachChar(e){let t=this.string;for(let i=0,n=t.length;ithis.add(e));let t=this.rootState,i=[],n="^",r={statics:0,dynamics:0,stars:0},s=[],o=e.handler.name,a=!0,l=function(e,t,i,n){let r=e;"/"===e.charAt(0)&&(r=e.substr(1));let s=[],o=r.split("/");for(let r=0,a=o.length;r1&&"/"===r.charAt(o-1)&&(r=r.substr(0,o-1),n=!0);for(let e=0,i=r.length;e{if(e.types.stars!==t.types.stars)return e.types.stars-t.types.stars;if(e.types.stars){if(e.types.statics!==t.types.statics)return t.types.statics-e.types.statics;if(e.types.dynamics!==t.types.dynamics)return t.types.dynamics-e.types.dynamics}return e.types.dynamics!==t.types.dynamics?e.types.dynamics-t.types.dynamics:e.types.statics!==t.types.statics?t.types.statics-e.types.statics:0})}(a);let l=a[0];if(l&&l.handlers)return n&&"(.+)$"===l.regex.source.slice(-5)&&(r+="/"),function(e,t,i){let n=e.handlers,r=e.regex,s=t.match(r),o=1,a=new Eh(i);for(let e=0,t=n.length;e{n=n.put(e)}),[i,n]}function Ph(e,t,i=!1){return t||"#"===e[0]||(e="#"+e),t&&i&&(e=e.substring(1,e.length)),e}function Vh(e,t,i,n){if(Th.test(e))return e;let r="";return t.length&&"/"!==t[0]&&(r+="/"),(r+=t).length&&"/"===r[r.length-1]||"/"===e[0]||(r+="/"),r.length&&"/"===r[r.length-1]&&"/"===e[0]&&(r=r.substring(0,r.length-1)),Ph(r+e,i,n)}function Rh(e){let t=[];if(Array.isArray(e.route))for(let i=0,n=e.route.length;i(e._updateTitle(),t()))}},Ih=class{constructor(e){this.plan=null,this.options={},Object.assign(this,e),this.params=this.params||{},this.viewPortInstructions={};let t=[],i=this;do{let e=Object.assign({},i.params);i.config&&i.config.hasChildRouter&&delete e[i.getWildCardName()],t.unshift(e),i=i.parentInstruction}while(i);let n=Object.assign({},this.queryParams,...t);this.lifecycleArgs=[n,this.config,this]}getAllInstructions(){let e=[this];for(let t in this.viewPortInstructions){let i=this.viewPortInstructions[t].childNavigationInstruction;i&&e.push(...i.getAllInstructions())}return e}getAllPreviousInstructions(){return this.getAllInstructions().map(e=>e.previousInstruction).filter(e=>e)}addViewPortInstruction(e,t,i,n){const r=Object.assign({},this.lifecycleArgs[1],{currentViewPort:e});return this.viewPortInstructions[e]={name:e,strategy:t,moduleId:i,component:n,childRouter:n.childRouter,lifecycleArgs:[].concat(this.lifecycleArgs[0],r,this.lifecycleArgs[2])}}getWildCardName(){let e=this.config.route.lastIndexOf("*");return this.config.route.substr(e+1)}getWildcardPath(){let e=this.getWildCardName(),t=this.params[e]||"";return this.queryString&&(t+="?"+this.queryString),t}getBaseUrl(){let e=decodeURI(this.fragment);if(""===e){let t=this.router.routes.find(e=>e.name===this.config.name&&""!==e.route);t&&(e=t.route)}if(!this.params)return encodeURI(e);let t=this.getWildCardName(),i=this.params[t]||"";return i?encodeURI(e.substr(0,e.lastIndexOf(i))):encodeURI(e)}_commitChanges(e){let t=this.router;t.currentInstruction=this,this.previousInstruction&&(this.previousInstruction.config.navModel.isActive=!1),this.config.navModel.isActive=!0,t.refreshNavigation();let i=[],n=[];for(let r in this.viewPortInstructions){let s=this.viewPortInstructions[r],o=t.viewPorts[r];if(!o)throw new Error(`There was no router-view found in the view for ${s.moduleId}.`);s.strategy===Dh.replace?s.childNavigationInstruction&&s.childNavigationInstruction.parentCatchHandler?i.push(s.childNavigationInstruction._commitChanges(e)):(e&&n.push({viewPort:o,viewPortInstruction:s}),i.push(o.process(s,e).then(t=>{if(s.childNavigationInstruction)return s.childNavigationInstruction._commitChanges(e)}))):s.childNavigationInstruction&&i.push(s.childNavigationInstruction._commitChanges(e))}return Promise.all(i).then(()=>(n.forEach(e=>e.viewPort.swap(e.viewPortInstruction)),null)).then(()=>(function(e){e.previousInstruction=null,e.plan=null})(this))}_updateTitle(){let e=this._buildTitle(this.router.titleSeparator);e&&this.router.history.setTitle(e)}_buildTitle(e=" | "){let t="",i=[];this.config.navModel.title&&(t=this.router.transformTitle(this.config.navModel.title));for(let t in this.viewPortInstructions){let n=this.viewPortInstructions[t];if(n.childNavigationInstruction){let t=n.childNavigationInstruction._buildTitle(e);t&&i.push(t)}}return i.length&&(t=i.join(e)+(t?e:"")+t),this.router.title&&(t+=(t?e:"")+this.router.transformTitle(this.router.title)),t}};let Lh=class{constructor(e,t){this.isActive=!1,this.title=null,this.href=null,this.relativeHref=null,this.settings={},this.config=null,this.router=e,this.relativeHref=t}setTitle(e){this.title=e,this.isActive&&this.router.updateTitle()}};function jh(e){return e&&"function"==typeof e.navigate}let Bh=class{constructor(e,t={}){this.url=e,this.options=Object.assign({trigger:!0,replace:!0},t),this.shouldContinueProcessing=!1}setRouter(e){this.router=e}navigate(e){(this.options.useAppRouter?e:this.router||e).navigate(this.url,this.options)}};const Fh={completed:"completed",canceled:"canceled",rejected:"rejected",running:"running"};let qh=class{constructor(){this.steps=[]}addStep(e){let t;if("function"==typeof e)t=e;else{if("function"==typeof e.getSteps){let t=e.getSteps();for(let e=0,i=t.length;ePromise.resolve({status:t,output:e,completed:t===Fh.completed})}let $h=class{constructor(){this.instructions=[],this.options={},this.pipelineSteps=[]}addPipelineStep(e,t){if(null==t)throw new Error("Pipeline step cannot be null or undefined.");return this.pipelineSteps.push({name:e,step:t}),this}addAuthorizeStep(e){return this.addPipelineStep("authorize",e)}addPreActivateStep(e){return this.addPipelineStep("preActivate",e)}addPreRenderStep(e){return this.addPipelineStep("preRender",e)}addPostRenderStep(e){return this.addPipelineStep("postRender",e)}fallbackRoute(e){return this._fallbackRoute=e,this}map(e){return Array.isArray(e)?(e.forEach(this.map.bind(this)),this):this.mapRoute(e)}useViewPortDefaults(e){return this.viewPortDefaults=e,this}mapRoute(e){return this.instructions.push(t=>{let i,n=Rh(e);for(let e=0,r=n.length;ei instanceof Bh?t.cancel(i):(e.plan=i,t())).catch(t.cancel)}};function Uh(e,t){let i=e.config;if("redirect"in i){let t=e.router;return t._createNavigationInstruction(i.redirect).then(i=>{let n={};for(let t in i.params){let r=i.params[t];"string"==typeof r&&":"===r[0]?(r=r.slice(1))in e.params&&(n[t]=e.params[r]):n[t]=i.params[t]}let r=t.generate(i.config.name,n,e.options);return e.queryString&&(r+="?"+e.queryString),Promise.resolve(new Bh(r))})}let n=e.previousInstruction,r={},s=e.router.viewPortDefaults;if(n){let o=function(e,t){let i=e.params,n=t.params,r=t.config.hasChildRouter?t.getWildCardName():null;for(let e in n)if(e!==r&&i[e]!==n[e])return!0;for(let e in i)if(e!==r&&i[e]!==n[e])return!0;if(!t.options.compareQueryParams)return!1;let s=e.queryParams,o=t.queryParams;for(let e in o)if(s[e]!==o[e])return!0;for(let e in s)if(s[e]!==o[e])return!0;return!1}(n,e),a=[];for(let l in n.viewPortInstructions){let h=n.viewPortInstructions[l],c=l in i.viewPorts?i.viewPorts[l]:h;null===c.moduleId&&l in e.router.viewPortDefaults&&(c=s[l]);let u=r[l]={name:l,config:c,prevComponent:h.component,prevModuleId:h.moduleId};if(h.moduleId!==c.moduleId?u.strategy=Dh.replace:"determineActivationStrategy"in h.component.viewModel?u.strategy=h.component.viewModel.determineActivationStrategy(...e.lifecycleArgs):i.activationStrategy?u.strategy=i.activationStrategy:u.strategy=o||t?Dh.invokeLifecycle:Dh.noChange,u.strategy!==Dh.replace&&h.childRouter){let t=e.getWildcardPath(),i=h.childRouter._createNavigationInstruction(t,e).then(e=>(u.childNavigationInstruction=e,Uh(e,u.strategy===Dh.invokeLifecycle).then(t=>{if(t instanceof Bh)return Promise.reject(t);e.plan=t})));a.push(i)}}return Promise.all(a).then(()=>r)}for(let t in i.viewPorts){let n=i.viewPorts[t];null===n.moduleId&&t in e.router.viewPortDefaults&&(n=s[t]),r[t]={name:t,strategy:Dh.replace,config:n}}return Promise.resolve(r)}let Wh=class e{constructor(e,t){this.parent=null,this.options={},this.viewPortDefaults={},this.transformTitle=(e=>this.parent?this.parent.transformTitle(e):e),this.container=e,this.history=t,this.reset()}reset(){this.viewPorts={},this.routes=[],this.baseUrl="",this.isConfigured=!1,this.isNavigating=!1,this.isExplicitNavigation=!1,this.isExplicitNavigationBack=!1,this.isNavigatingFirst=!1,this.isNavigatingNew=!1,this.isNavigatingRefresh=!1,this.isNavigatingForward=!1,this.isNavigatingBack=!1,this.couldDeactivate=!1,this.navigation=[],this.currentInstruction=null,this.viewPortDefaults={},this._fallbackOrder=100,this._recognizer=new Sh,this._childRecognizer=new Sh,this._configuredPromise=new Promise(e=>{this._resolveConfiguredPromise=e})}get isRoot(){return!this.parent}registerViewPort(e,t){t=t||"default",this.viewPorts[t]=e}ensureConfigured(){return this._configuredPromise}configure(e){this.isConfigured=!0;let t,i=e;return"function"==typeof e&&(i=e(t=new $h)),Promise.resolve(i).then(e=>{e&&e.exportToRouter&&(t=e),t.exportToRouter(this),this.isConfigured=!0,this._resolveConfiguredPromise()})}navigate(e,t){return!this.isConfigured&&this.parent?this.parent.navigate(e,t):(this.isExplicitNavigation=!0,this.history.navigate(function(e,t,i){return Nh.test(e)?Ph(e,i):Vh(e,t,i)}(e,this.baseUrl,this.history._hasPushState),t))}navigateToRoute(e,t,i){let n=this.generate(e,t);return this.navigate(n,i)}navigateBack(){this.isExplicitNavigationBack=!0,this.history.navigateBack()}createChild(t){let i=new e(t||this.container.createChild(),this.history);return i.parent=this,i}generate(e,t,i={}){let n=this._recognizer.hasRoute(e);if((!this.isConfigured||!n)&&this.parent)return this.parent.generate(e,t,i);if(!n)throw new Error(`A route with name '${e}' could not be found. Check that \`name: '${e}'\` was specified in the route's config.`);let r=Vh(this._recognizer.generate(e,t),this.baseUrl,this.history._hasPushState,i.absolute);return i.absolute?`${this.history.getAbsoluteRoot()}${r}`:r}createNavModel(e){let t=new Lh(this,"href"in e?e.href:e.route);return t.title=e.title,t.order=e.nav,t.href=e.href,t.settings=e.settings,t.config=e,t}addRoute(e,t){if(Array.isArray(e.route)){return void Rh(e).forEach(this.addRoute.bind(this))}Gh(e,this.routes),"viewPorts"in e||e.navigationStrategy||(e.viewPorts={default:{moduleId:e.moduleId,view:e.view}}),t||(t=this.createNavModel(e)),this.routes.push(e);let i=e.route;"/"===i.charAt(0)&&(i=i.substr(1));let n=!0===e.caseSensitive,r=this._recognizer.add({path:i,handler:e,caseSensitive:n});if(i){let r=e.settings;delete e.settings;let s=JSON.parse(JSON.stringify(e));e.settings=r,s.route=`${i}/*childRoute`,s.hasChildRouter=!0,this._childRecognizer.add({path:s.route,handler:s,caseSensitive:n}),s.navModel=t,s.settings=e.settings,s.navigationStrategy=e.navigationStrategy}if(e.navModel=t,(t.order||0===t.order)&&-1===this.navigation.indexOf(t)){if(!t.href&&""!==t.href&&(r.types.dynamics||r.types.stars))throw new Error('Invalid route config for "'+e.route+'" : dynamic routes must specify an "href:" to be included in the navigation model.');"number"!=typeof t.order&&(t.order=++this._fallbackOrder),this.navigation.push(t),this.navigation=this.navigation.sort((e,t)=>e.order-t.order)}}hasRoute(e){return!!(this._recognizer.hasRoute(e)||this.parent&&this.parent.hasRoute(e))}hasOwnRoute(e){return this._recognizer.hasRoute(e)}handleUnknownRoutes(e){if(!e)throw new Error("Invalid unknown route handler");this.catchAllHandler=(t=>this._createRouteConfig(e,t).then(e=>(t.config=e,t)))}updateTitle(){if(this.parent)return this.parent.updateTitle();this.currentInstruction&&this.currentInstruction._updateTitle()}refreshNavigation(){let e=this.navigation;for(let t=0,i=e.length;t"string"==typeof e?{moduleId:e}:"function"==typeof e?e(t):e).then(e=>"string"==typeof e?{moduleId:e}:e).then(e=>(e.route=t.params.path,Gh(e,this.routes),e.navModel||(e.navModel=this.createNavModel(e)),e))}};function Qh(e,t){return`${e.baseUrl||""}${t.getBaseUrl()||""}`}function Gh(e,t){if("object"!=typeof e)throw new Error("Invalid Route Config");if("string"!=typeof e.route){let t=e.name||"(no name)";throw new Error('Invalid Route Config for "'+t+'": You must specify a "route:" pattern.')}if(!("redirect"in e||e.moduleId||e.navigationStrategy||e.viewPorts))throw new Error('Invalid Route Config for "'+e.route+'": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".')}function Kh(e,t,i){return Promise.resolve(t.call(i,e)).then(()=>("viewPorts"in e.config||(e.config.viewPorts={default:{moduleId:e.config.moduleId}}),e))}let Xh=class{run(e,t){return ec(e,"canDeactivate",t)}},Yh=class{run(e,t){return ic(e,"canActivate",t)}},Jh=class{run(e,t){return ec(e,"deactivate",t,!0)}},Zh=class{run(e,t){return ic(e,"activate",t,!0)}};function ec(e,t,i,n){let r=function e(t,i,n=[]){for(let r in t){let s=t[r],o=s.prevComponent;if((s.strategy===Dh.invokeLifecycle||s.strategy===Dh.replace)&&o){let e=o.viewModel;i in e&&n.push(e)}s.strategy===Dh.replace&&o?tc(o,i,n):s.childNavigationInstruction&&e(s.childNavigationInstruction.plan,i,n)}return n}(e.plan,t),s=r.length;function o(e){return n||nc(e)?a():i.cancel(e)}function a(){if(s--)try{return sc(r[s][t](e),o,i.cancel)}catch(e){return i.cancel(e)}return e.router.couldDeactivate=!0,i()}return a()}function tc(e,t,i){let n=e.childRouter;if(n&&n.currentInstruction){let e=n.currentInstruction.viewPortInstructions;for(let n in e){let r=e[n].component,s=r.viewModel;t in s&&i.push(s),tc(r,t,i)}}}function ic(e,t,i,n){let r=function e(t,i,n=[],r){let s=t.plan;Object.keys(s).filter(o=>{let a=s[o],l=t.viewPortInstructions[o],h=l.component.viewModel;(a.strategy===Dh.invokeLifecycle||a.strategy===Dh.replace)&&i in h&&n.push({viewModel:h,lifecycleArgs:l.lifecycleArgs,router:r}),a.childNavigationInstruction&&e(a.childNavigationInstruction,i,n,l.component.childRouter||r)});return n}(e,t),s=r.length,o=-1;function a(){if(++o(function(e,t){return n||nc(e,t)?a():i.cancel(e)})(t,e.router),i.cancel)}catch(e){return i.cancel(e)}return i()}return a()}function nc(e,t){return!(e instanceof Error)&&(jh(e)?("function"==typeof e.setRouter&&e.setRouter(t),!!e.shouldContinueProcessing):void 0===e||e)}let rc=class{constructor(e){this._subscribed=!0,this._subscription=e(this),this._subscribed||this.unsubscribe()}get subscribed(){return this._subscribed}unsubscribe(){this._subscribed&&this._subscription&&this._subscription.unsubscribe(),this._subscribed=!1}};function sc(e,t,i){if(e&&"function"==typeof e.then)return Promise.resolve(e).then(t).catch(i);if(e&&"function"==typeof e.subscribe){let n=e;return new rc(r=>n.subscribe({next(){r.subscribed&&(r.unsubscribe(),t(e))},error(e){r.subscribed&&(r.unsubscribe(),i(e))},complete(){r.subscribed&&(r.unsubscribe(),t(e))}}))}try{return t(e)}catch(e){return i(e)}}let oc=class{loadRoute(e,t,i){throw Error('Route loaders must implement "loadRoute(router, config, navigationInstruction)".')}},ac=class{static inject(){return[oc]}constructor(e){this.routeLoader=e}run(e,t){return lc(this.routeLoader,e).then(t).catch(t.cancel)}};function lc(e,t){let i=function e(t,i=[]){let n=t.plan;for(let r in n){let s=n[r];if(s.strategy===Dh.replace)i.push({viewPortPlan:s,navigationInstruction:t}),s.childNavigationInstruction&&e(s.childNavigationInstruction,i);else{let n=t.addViewPortInstruction(r,s.strategy,s.prevModuleId,s.prevComponent);s.childNavigationInstruction&&(n.childNavigationInstruction=s.childNavigationInstruction,e(s.childNavigationInstruction,i))}}return i}(t).map(t=>(function(e,t,i){let n=i.config?i.config.moduleId:null;return function(e,t,i){let n=t.router,r=t.lifecycleArgs;return e.loadRoute(n,i,t).then(e=>{let{viewModel:t,childContainer:s}=e;if(e.router=n,e.config=i,"configureRouter"in t){let i=s.getChildRouter();return e.childRouter=i,i.configure(e=>t.configureRouter(e,i,...r)).then(()=>e)}return e})}(e,t,i.config).then(r=>{let s=t.addViewPortInstruction(i.name,i.strategy,n,r),o=r.childRouter;if(o){let n=t.getWildcardPath();return o._createNavigationInstruction(n,t).then(t=>(i.childNavigationInstruction=t,Uh(t).then(i=>i instanceof Bh?Promise.reject(i):(t.plan=i,s.childNavigationInstruction=t,lc(e,t)))))}})})(e,t.navigationInstruction,t.viewPortPlan));return Promise.all(i)}let hc=class{static inject(){return[ke]}constructor(e){this.container=e,this.steps=[Hh,Xh,ac,this._createPipelineSlot("authorize"),Yh,this._createPipelineSlot("preActivate","modelbind"),Jh,Zh,this._createPipelineSlot("preRender","precommit"),Mh,this._createPipelineSlot("postRender","postcomplete")]}createPipeline(e=!0){let t=new qh;return this.steps.forEach(i=>{(e||i!==Xh)&&t.addStep(this.container.get(i))}),t}_findStep(e){return this.steps.find(t=>t.slotName===e||t.slotAlias===e)}addStep(e,t){let i=this._findStep(e);if(!i)throw new Error(`Invalid pipeline slot name: ${e}.`);i.steps.includes(t)||i.steps.push(t)}removeStep(e,t){let i=this._findStep(e);i&&i.steps.splice(i.steps.indexOf(t),1)}_clearSteps(e=""){let t=this._findStep(e);t&&(t.steps=[])}reset(){this._clearSteps("authorize"),this._clearSteps("preActivate"),this._clearSteps("preRender"),this._clearSteps("postRender")}_createPipelineSlot(e,t){return new class{constructor(e,t,i){this.steps=[],this.container=e,this.slotName=t,this.slotAlias=i}getSteps(){return this.steps.map(e=>this.container.get(e))}}(this.container,e,t)}};const cc=W("app-router");let uc=class extends Wh{static inject(){return[ke,hh,hc,sh]}constructor(e,t,i,n){super(e,t),this.pipelineProvider=i,this.events=n}reset(){super.reset(),this.maxInstructionCount=10,this._queue?this._queue.length=0:this._queue=[]}loadUrl(e){return this._createNavigationInstruction(e).then(e=>this._queueInstruction(e)).catch(e=>{cc.error(e),dc(this)})}registerViewPort(e,t){if(super.registerViewPort(e,t),this.isActive)this._dequeueInstruction();else{let t=this._findViewModel(e);if("configureRouter"in t){if(!this.isConfigured){let e=this._resolveConfiguredPromise;return this._resolveConfiguredPromise=(()=>{}),this.configure(e=>t.configureRouter(e,this)).then(()=>{this.activate(),e()})}}else this.activate()}return Promise.resolve()}activate(e){this.isActive||(this.isActive=!0,this.options=Object.assign({routeHandler:this.loadUrl.bind(this)},this.options,e),this.history.activate(this.options),this._dequeueInstruction())}deactivate(){this.isActive=!1,this.history.deactivate()}_queueInstruction(e){return new Promise(t=>{e.resolve=t,this._queue.unshift(e),this._dequeueInstruction()})}_dequeueInstruction(e=0){return Promise.resolve().then(()=>{if(this.isNavigating&&!e)return;let t=this._queue.shift();if(this._queue.length=0,!t)return;this.isNavigating=!0;let i=this.history.getState("NavigationTracker");if(i||this.currentNavigationTracker?i?this.currentNavigationTracker?this.currentNavigationTrackeri&&(this.isNavigatingBack=!0):this.isNavigatingRefresh=!0:this.isNavigatingNew=!0:(this.isNavigatingFirst=!0,this.isNavigatingNew=!0),i||(i=Date.now(),this.history.setState("NavigationTracker",i)),this.currentNavigationTracker=i,t.previousInstruction=this.currentInstruction,e){if(e===this.maxInstructionCount-1)return cc.error(`${e+1} navigation instructions have been attempted without success. Restoring last known good location.`),dc(this),this._dequeueInstruction(e+1);if(e>this.maxInstructionCount)throw new Error("Maximum navigation attempts exceeded. Giving up.")}else this.events.publish("router:navigation:processing",{instruction:t});return this.pipelineProvider.createPipeline(!this.couldDeactivate).run(t).then(t=>(function(e,t,i,n){t&&"completed"in t&&"output"in t||((t=t||{}).output=new Error(`Expected router pipeline to return a navigation result, but got [${JSON.stringify(t)}] instead.`));let r=null,s=null;jh(t.output)?s=t.output.navigate(n):(r=t,t.completed||(t.output instanceof Error&&cc.error(t.output),dc(n)));return Promise.resolve(s).then(e=>n._dequeueInstruction(i+1)).then(e=>r||e||t)})(0,t,e,this)).catch(e=>({output:e instanceof Error?e:new Error(e)})).then(i=>(function(e,t,i,n){e.resolve(t);let r={instruction:e,result:t};if(i)n.events.publish("router:navigation:child:complete",r);else{let i;if(n.isNavigating=!1,n.isExplicitNavigation=!1,n.isExplicitNavigationBack=!1,n.isNavigatingFirst=!1,n.isNavigatingNew=!1,n.isNavigatingRefresh=!1,n.isNavigatingForward=!1,n.isNavigatingBack=!1,n.couldDeactivate=!1,t.output instanceof Error)i="error";else if(t.completed){let t=e.queryString?"?"+e.queryString:"";n.history.previousLocation=e.fragment+t,i="success"}else i="canceled";n.events.publish(`router:navigation:${i}`,r),n.events.publish("router:navigation:complete",r)}return t})(t,i,!!e,this))})}_findViewModel(e){if(this.container.viewModel)return this.container.viewModel;if(e.container){let t=e.container;for(;t;){if(t.viewModel)return this.container.viewModel=t.viewModel,t.viewModel;t=t.parent}}}};function dc(e){e.history.previousLocation?e.navigate(e.history.previousLocation,{trigger:!1,replace:!0}):e.fallbackRoute?e.navigate(e.fallbackRoute,{trigger:!0,replace:!0}):cc.error("Router navigation failed, and no previous location or fallbackRoute could be restored.")}var pc,gc,mc,fc,vc,bc;function wc(e,t,i,n){i&&Object.defineProperty(e,t,{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.initializer?i.initializer.call(n):void 0})}function yc(e,t,i,n,r){var s={};return Object.keys(n).forEach(function(e){s[e]=n[e]}),s.enumerable=!!s.enumerable,s.configurable=!!s.configurable,("value"in s||s.initializer)&&(s.writable=!0),s=i.slice().reverse().reduce(function(i,n){return n(e,t,i)||i},s),r&&void 0!==s.initializer&&(s.value=s.initializer?s.initializer.call(r):void 0,s.initializer=void 0),void 0===s.initializer&&(Object.defineProperty(e,t,s),s=null),s}let xc=Po("router-view")(pc=Bo((mc=yc((gc=class{static inject(){return[r.Element,ke,qs,Wh,Os,as,Eo]}constructor(e,t,i,n,r,s,o){wc(this,"swapOrder",mc,this),wc(this,"layoutView",fc,this),wc(this,"layoutViewModel",vc,this),wc(this,"layoutModel",bc,this),this.element=e,this.container=t,this.viewSlot=i,this.router=n,this.viewLocator=r,this.compositionTransaction=s,this.compositionEngine=o,this.router.registerViewPort(this,this.element.getAttribute("name")),"initialComposition"in s||(s.initialComposition=!0,this.compositionTransactionNotifier=s.enlist())}created(e){this.owningView=e}bind(e,t){this.container.viewModel=e,this.overrideContext=t}process(e,t){let i=e.component,n=i.childContainer,r=i.viewModel,s=i.viewModelResource,o=s.metadata,a=i.router.currentInstruction.config,l=a.viewPorts&&a.viewPorts[e.name]||{};n.get(Cc)._notify(this);let h={viewModel:l.layoutViewModel||a.layoutViewModel||this.layoutViewModel,view:l.layoutView||a.layoutView||this.layoutView,model:l.layoutModel||a.layoutModel||this.layoutModel,router:e.component.router,childContainer:n,viewSlot:this.viewSlot},c=this.viewLocator.getViewStrategy(i.view||r);return c&&i.view&&c.makeRelativeTo(m.get(i.router.container.viewModel.constructor).moduleId),o.load(n,s.value,null,c,!0).then(i=>{if(this.compositionTransactionNotifier||(this.compositionTransactionOwnershipToken=this.compositionTransaction.tryCapture()),(h.viewModel||h.view)&&(e.layoutInstruction=h),e.controller=o.create(n,vs.dynamic(this.element,r,i)),t)return null;this.swap(e)})}swap(e){let t=e.layoutInstruction,i=this.view,n=()=>{let e=_o[this.swapOrder]||_o.after,t=this.viewSlot;e(t,i,()=>Promise.resolve(t.add(this.view))).then(()=>{this._notify()})},r=t=>(e.controller.automate(this.overrideContext,t),this.compositionTransactionOwnershipToken?this.compositionTransactionOwnershipToken.waitForCompositionComplete().then(()=>(this.compositionTransactionOwnershipToken=null,n())):n());return t?(t.viewModel||(t.viewModel={}),this.compositionEngine.createController(t).then(i=>(Is.distributeView(e.controller.view,i.slots||i.view.slots),i.automate(Ue(t.viewModel),this.owningView),i.view.children.push(e.controller.view),i.view||i)).then(e=>(this.view=e,r(e)))):(this.view=e.controller.view,r(this.owningView))}_notify(){this.compositionTransactionNotifier&&(this.compositionTransactionNotifier.done(),this.compositionTransactionNotifier=null)}}).prototype,"swapOrder",[No],{enumerable:!0,initializer:null}),fc=yc(gc.prototype,"layoutView",[No],{enumerable:!0,initializer:null}),vc=yc(gc.prototype,"layoutViewModel",[No],{enumerable:!0,initializer:null}),bc=yc(gc.prototype,"layoutModel",[No],{enumerable:!0,initializer:null}),pc=gc))||pc)||pc,Cc=class{constructor(){this.promise=new Promise(e=>this.resolve=e)}findNearest(){return this.promise}_notify(e){this.resolve(e)}};var kc,_c;let Sc=jo("")(kc=class{})||kc,Ec=Se(Eo)(_c=class extends oc{constructor(e){super(),this.compositionEngine=e}loadRoute(e,t){let i,n=e.container.createChild(),r={viewModel:i=null===t.moduleId?Sc:/\.html/i.test(t.moduleId)?function(e){var t,i,n;let r=/([^\/^\?]+)\.html/i.exec(e)[1];return t=Po(r),i=Lo(e),t(n=i(n=class{bind(e){this.$parent=e}})||n)||n}(t.moduleId):k(t.moduleId,m.get(e.container.viewModel.constructor).moduleId),childContainer:n,view:t.view||t.viewStrategy,router:e};return n.registerSingleton(Cc),n.getChildRouter=function(){let t;return n.registerHandler(Wh,i=>t||(t=e.createChild(n))),n.get(Wh)},this.compositionEngine.ensureViewModel(r)}})||_c;var Ac;const Oc=W("route-href");let Pc=Vo("route-href")(Ac=No({name:"route",changeHandler:"processChange",primaryProperty:!0})(Ac=No({name:"params",changeHandler:"processChange"})(Ac=No({name:"attribute",defaultValue:"href"})(Ac=class{static inject(){return[Wh,r.Element]}constructor(e,t){this.router=e,this.element=t}bind(){this.isActive=!0,this.processChange()}unbind(){this.isActive=!1}attributeChanged(e,t){t&&this.element.removeAttribute(t),this.processChange()}processChange(){return this.router.ensureConfigured().then(()=>{if(!this.isActive)return null;let e=this.router.generate(this.route,this.params);return this.element.au.controller?this.element.au.controller.viewModel[this.attribute]=e:this.element.setAttribute(this.attribute,e),null}).catch(e=>{Oc.error(e)})}})||Ac)||Ac)||Ac)||Ac;function Vc(e){e.singleton(oc,Ec).singleton(Wh,uc).globalResources(xc,Pc),e.container.registerAlias(Wh,uc)}var Rc;e.isInitialized||s((e,t,i)=>{Object.assign(e,o),Object.assign(t,a),Object.assign(i,h),Object.defineProperty(i,"title",{get:()=>document.title,set:e=>{document.title=e}}),Object.defineProperty(i,"activeElement",{get:()=>document.activeElement}),Object.defineProperty(e,"XMLHttpRequest",{get:()=>e.global.XMLHttpRequest})}),(Rc=Go.prototype).developmentLogging=function(){return Ko.addAppender(new class{debug(e,...t){console.debug(`DEBUG [${e.id}]`,...t)}info(e,...t){console.info(`INFO [${e.id}]`,...t)}warn(e,...t){console.warn(`WARN [${e.id}]`,...t)}error(e,...t){console.error(`ERROR [${e.id}]`,...t)}}),Ko.setLevel(Ko.logLevel.debug),this},Rc.defaultBindingLanguage=function(){return this.plugin(fa)},Rc.defaultResources=function(){return this.plugin(th)},Rc.eventAggregator=function(){return this.plugin(ah)},Rc.history=function(){return this.plugin(gh)},Rc.router=function(){return this.plugin(Vc)},e.EventAggregator=sh,e.includeEventsIn=oh,e.CommitChangesStep=Mh,e.NavigationInstruction=Ih,e.NavModel=Lh,e.isNavigationCommand=jh,e.Redirect=Bh,e.RedirectToRoute=class{constructor(e,t={},i={}){this.route=e,this.params=t,this.options=Object.assign({trigger:!0,replace:!0},i),this.shouldContinueProcessing=!1}setRouter(e){this.router=e}navigate(e){(this.options.useAppRouter?e:this.router||e).navigateToRoute(this.route,this.params,this.options)}},e.pipelineStatus=Fh,e.Pipeline=qh,e.RouterConfiguration=$h,e.activationStrategy=Dh,e.BuildNavigationPlanStep=Hh,e.Router=Wh,e.CanDeactivatePreviousStep=Xh,e.CanActivateNextStep=Yh,e.DeactivatePreviousStep=Jh,e.ActivateNextStep=Zh,e.RouteLoader=oc,e.LoadRouteStep=ac,e.PipelineProvider=hc,e.AppRouter=uc,e.Aurelia=class e{constructor(t,i,r){this.loader=t||new n.Loader,this.container=i||(new ke).makeGlobal(),this.resources=r||new Bs,this.use=new Go(this),this.logger=W("aurelia"),this.hostConfigured=!1,this.host=null,this.use.instance(e,this),this.use.instance(M,this.loader),this.use.instance(Bs,this.resources)}start(){return this._started?this._started:(this.logger.info("Aurelia Starting"),this._started=this.use.apply().then(()=>{if(r.addEventListener("submit",e=>{const t=e.target,i=t.action;"form"!==t.tagName.toLowerCase()||i||e.preventDefault()}),!this.container.hasResolver(Vs)){let e="You must configure Aurelia with a BindingLanguage implementation.";throw this.logger.error(e),new Error(e)}this.logger.info("Aurelia Started");let e=r.createCustomEvent("aurelia-started",{bubbles:!0,cancelable:!0});return r.dispatchEvent(e),this}))}enhance(e={},t=null){return this._configureHost(t||r.querySelectorAll("body")[0]),new Promise(t=>{let i=this.container.get(Fo);this.root=i.enhance({container:this.container,element:this.host,resources:this.resources,bindingContext:e}),this.root.attached(),this._onAureliaComposed(),t(this)})}setRoot(e=null,t=null){let i={};this.root&&this.root.viewModel&&this.root.viewModel.router&&(this.root.viewModel.router.deactivate(),this.root.viewModel.router.reset()),this._configureHost(t);let n=this.container.get(Fo);return delete this.container.get(as).initialComposition,e||(e=this.configModuleId?k("./app",this.configModuleId):"app"),i.viewModel=e,i.container=i.childContainer=this.container,i.viewSlot=this.hostSlot,i.host=this.host,n.compose(i).then(e=>(this.root=e,i.viewSlot.attached(),this._onAureliaComposed(),this))}_configureHost(e){if(!this.hostConfigured){if(e=e||this.host,this.host=e&&"string"!=typeof e?e:r.getElementById(e||"applicationHost"),!this.host)throw new Error("No applicationHost was specified.");this.hostConfigured=!0,this.host.aurelia=this,this.hostSlot=new qs(this.host,!0),this.hostSlot.transformChildNodesIntoView(),this.container.registerInstance(r.boundary,this.host)}}_onAureliaComposed(){let e=r.createCustomEvent("aurelia-composed",{bubbles:!0,cancelable:!0});setTimeout(()=>r.dispatchEvent(e),1)}},e.FrameworkConfiguration=Go,e.LogManager=Ko,e.resolver=re,e.StrategyResolver=se,e.Lazy=oe,e.All=ae,e.Optional=le,e.Parent=he,e.Factory=ce,e.NewInstance=ue,e.getDecoratorDependencies=de,e.lazy=function(e){return function(t,i,n){de(t)[n]=oe.of(e)}},e.all=function(e){return function(t,i,n){de(t)[n]=ae.of(e)}},e.optional=function(e=!0){let t=function(e){return function(t,i,n){let r=de(t);r[n]=le.of(r[n],e)}};return t("boolean"!=typeof e||e)},e.parent=function(e,t,i){let n=de(e);n[i]=he.of(n[i])},e.factory=function(e){return function(t,i,n){de(t)[n]=ce.of(e)}},e.newInstance=function(e,...t){let i=function(e){return function(i,n,r){let s=de(i);s[r]=ue.of(s[r],...t),e&&s[r].as(e)}};return arguments.length>=1?i(e):i()},e.invoker=function(e){return function(t){d.define(d.invoker,e,t)}},e.invokeAsFactory=function(e){let t=function(e){d.define(d.invoker,pe.instance,e)};return e?t(e):t},e.FactoryInvoker=pe,e.registration=ge,e.transient=function(e){return ge(new me(e))},e.singleton=function(e,t=!1){return ge(new fe(e,t))},e.TransientRegistration=me,e.SingletonRegistration=fe,e._emptyParameters=be,e.InvocationHandler=ye,e.Container=ke,e.autoinject=_e,e.inject=Se,e.targetContext="Binding:target",e.sourceContext=$e,e.camelCase=He,e.createOverrideContext=Ue,e.getContextFor=We,e.createScopeForTest=function(e,t){return t?{bindingContext:e,overrideContext:Ue(e,Ue(t))}:{bindingContext:e,overrideContext:Ue(e)}},e.connectable=Ze,e.enqueueBindingConnect=lt,e.subscriberCollection=vt,e.ExpressionObserver=bt,e.calcSplices=kt,e.mergeSplice=_t,e.projectArraySplices=St,e.getChangeRecords=Et,e.ModifyCollectionObserver=At,e.CollectionLengthObserver=Ot,e.getArrayObserver=jt,e.Expression=Ft,e.BindingBehavior=qt,e.ValueConverter=zt,e.Assign=$t,e.Conditional=Dt,e.AccessThis=Ht,e.AccessScope=Ut,e.AccessMember=Wt,e.AccessKeyed=Qt,e.CallScope=Gt,e.CallMember=Kt,e.CallFunction=Xt,e.Binary=Yt,e.Unary=Jt,e.LiteralPrimitive=Zt,e.LiteralString=ei,e.LiteralTemplate=ti,e.LiteralArray=ii,e.LiteralObject=ni,e.ExpressionCloner=oi,e.cloneExpression=function(e){let t=new oi;return e.accept(t)},e.bindingMode=ai,e.Parser=li,e.ParserImplementation=ci,e.getMapObserver=Ln,e.delegationStrategy=Dn,e.EventManager=Hn,e.EventSubscriber=Un,e.DirtyChecker=Wn,e.DirtyCheckProperty=Qn,e.propertyAccessor=Kn,e.PrimitiveObserver=Xn,e.SetterObserver=Yn,e.XLinkAttributeObserver=Jn,e.dataAttributeAccessor=Zn,e.DataAttributeObserver=er,e.StyleObserver=tr,e.ValueAttributeObserver=ir,e.CheckedObserver=nr,e.SelectValueObserver=rr,e.ClassObserver=sr,e.hasDeclaredDependencies=or,e.declarePropertyDependencies=function(e,t,i){Object.getOwnPropertyDescriptor(e.prototype,t).get.dependencies=i},e.computedFrom=function(...e){return function(t,i,n){return n.get.dependencies=e,n}},e.ComputedExpression=ur,e.createComputedObserver=dr,e.elements=pr,e.presentationElements=gr,e.presentationAttributes=mr,e.SVGAnalyzer=fr,e.ObserverLocator=vr,e.ObjectObservationAdapter=class{getObserver(e,t,i){throw new Error("BindingAdapters must implement getObserver(object, propertyName).")}},e.BindingExpression=br,e.Binding=wr,e.CallExpression=yr,e.Call=xr,e.ValueConverterResource=Cr,e.valueConverter=kr,e.BindingBehaviorResource=_r,e.bindingBehavior=Sr,e.ListenerExpression=Er,e.Listener=Ar,e.NameExpression=Pr,e.BindingEngine=Nr,e.getSetObserver=Mr,e.observable=function(e,t,i){function n(e,t,i,n){const r=void 0===t;r&&(e=e.prototype,t="string"==typeof n?n:n.name);let s=`_${t}`;const o={configurable:!0,enumerable:!1,writable:!0},a=n&&n.changeHandler||`${t}Changed`;if(i?"function"==typeof i.initializer&&(o.value=i.initializer()):i={},"enumerable"in i||(i.enumerable=!0),delete i.value,delete i.writable,delete i.initializer,Reflect.defineProperty(e,s,o),i.get=function(){return this[s]},i.set=function(e){let i=this[s];e!==i&&(this[s]=e,Reflect.defineProperty(this,s,{enumerable:!1}),this[a]&&this[a](e,i,t))},i.get.dependencies=[s],!r)return i;Reflect.defineProperty(e,t,i)}return void 0===t?(t,i,r)=>n(t,i,r,e):n(e,t,i)},e.connectBindingToSignal=jr,e.signalBindings=function(e){Lr.hasOwnProperty(e)&&Lr[e]++},e.metadata=d,e.Origin=m,e.decorators=function(...e){let t=function(t,i,n){let r=e.length;if(i){for(n=n||{value:t[i],writable:!0,configurable:!0,enumerable:!0};r--;)n=e[r](t,i,n)||n;Object.defineProperty(t,i,n)}else for(;r--;)t=e[r](t)||t;return t};return t.on=t,t},e.deprecated=function(e,t,i){function n(i,n,r){const s=`${i.constructor.name}#${n}`;let o=t?{}:e||{},a=`DEPRECATION - ${s}`;if("function"!=typeof r.value)throw new SyntaxError("Only methods can be marked as deprecated.");return o.message&&(a+=` - ${o.message}`),c({},r,{value:function(){if(o.error)throw new Error(a);return console.warn(a),r.value.apply(this,arguments)}})}return t?n(e,t,i):n},e.mixin=f,e.protocol=C,e.animationEvent={enterBegin:"animation:enter:begin",enterActive:"animation:enter:active",enterDone:"animation:enter:done",enterTimeout:"animation:enter:timeout",leaveBegin:"animation:leave:begin",leaveActive:"animation:leave:active",leaveDone:"animation:leave:done",leaveTimeout:"animation:leave:timeout",staggerNext:"animation:stagger:next",removeClassBegin:"animation:remove-class:begin",removeClassActive:"animation:remove-class:active",removeClassDone:"animation:remove-class:done",removeClassTimeout:"animation:remove-class:timeout",addClassBegin:"animation:add-class:begin",addClassActive:"animation:add-class:active",addClassDone:"animation:add-class:done",addClassTimeout:"animation:add-class:timeout",animateBegin:"animation:animate:begin",animateActive:"animation:animate:active",animateDone:"animation:animate:done",animateTimeout:"animation:animate:timeout",sequenceBegin:"animation:sequence:begin",sequenceDone:"animation:sequence:done"},e.Animator=rs,e.CompositionTransactionNotifier=ss,e.CompositionTransactionOwnershipToken=os,e.CompositionTransaction=as,e._hyphenate=cs,e._isAllWhitespace=us,e.ViewEngineHooksResource=ds,e.viewEngineHooks=function(e){let t=function(e){d.define(d.resource,new ds,e)};return e?t(e):t},e.ElementEvents=ps,e.ResourceLoadContext=ms,e.ViewCompileInstruction=fs,e.BehaviorInstruction=vs,e.TargetInstruction=ws,e.viewStrategy=xs,e.RelativeViewStrategy=Cs,e.ConventionalViewStrategy=ks,e.NoViewStrategy=_s,e.TemplateRegistryViewStrategy=Ss,e.InlineViewStrategy=Es,e.StaticViewStrategy=As,e.ViewLocator=Os,e.BindingLanguage=Vs,e.SlotCustomAttribute=Ns,e.PassThroughSlot=Ts,e.ShadowSlot=Ms,e.ShadowDOM=Is,e.validateBehaviorName=js,e.ViewResources=Bs,e.View=Fs,e.ViewSlot=qs,e.BoundViewFactory=Ks,e.ViewFactory=Xs,e.ViewCompiler=to,e.ResourceModule=io,e.ResourceDescription=no,e.ModuleAnalyzer=ro,e.ViewEngine=ao,e.Controller=lo,e.BehaviorPropertyObserver=ho,e.BindableProperty=uo,e.HtmlBehaviorResource=fo,e.children=function(e){return vo(e,!0)},e.child=function(e){return vo(e,!1)},e.SwapStrategies=_o,e.CompositionEngine=Eo,e.ElementConfigResource=Ao,e.resource=Oo,e.behavior=function(e){return function(t){if(e instanceof fo)d.define(d.resource,e,t);else{let i=d.getOrCreateOwn(d.resource,fo,t);Object.assign(i,e)}}},e.customElement=Po,e.customAttribute=Vo,e.templateController=Ro,e.bindable=No,e.dynamicOptions=function(e){let t=function(e){d.getOrCreateOwn(d.resource,fo,e).hasDynamicOptions=!0};return e?t(e):t},e.useShadowDOM=function(e){let t="function"!=typeof e&&e?e:To,i=function(e){let i=d.getOrCreateOwn(d.resource,fo,e);i.targetShadowDOM=!0,i.shadowDOMOptions=t};return"function"==typeof e?i(e):i},e.processAttributes=function(e){return function(t){d.getOrCreateOwn(d.resource,fo,t).processAttributes=function(t,i,n,r,s){try{e(t,i,n,r,s)}catch(e){W("templating").error(e)}}}},e.processContent=function(e){return function(t){d.getOrCreateOwn(d.resource,fo,t).processContent=e?function(t,i,n,r){try{return e(t,i,n,r)}catch(e){return W("templating").error(e),!1}}:Mo}},e.containerless=function(e){let t=function(e){d.getOrCreateOwn(d.resource,fo,e).containerless=!0};return e?t(e):t},e.useViewStrategy=Io,e.useView=Lo,e.inlineView=jo,e.noView=Bo,e.view=function(e){return function(t){t.$view=e}},e.elementConfig=function(e){let t=function(e){d.define(d.resource,new Ao,e)};return e?t(e):t},e.viewResources=function(...e){return function(t){d.define(ao.viewModelRequireMetadataKey,e,t)}},e.TemplatingEngine=Fo,e.TemplateDependency=N,e.TemplateRegistryEntry=T,e.Loader=M,e.TaskQueue=Ae,e.relativeToFile=k,e.join=_,e.buildQueryString=O,e.parseQueryString=R,e.AggregateError=t,e.FEATURE=i,e.PLATFORM=n,e.DOM=r,e.initializePAL=s,e.reset=function(){e.isInitialized=!1},Object.defineProperty(e,"__esModule",{value:!0})});