@telia-ace/widget-runtime-flamingo 1.1.77 → 1.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- "use strict";const Ht=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},Is=i=>{const t=i.container||i;return{info:(e,...s)=>Ht(t,"info",e,...s),warn:(e,...s)=>Ht(t,"warning",e,...s),error:(e,...s)=>Ht(t,"error",e,...s)}};var ht=(i=>(i.Implementation="implementation",i.Widget="widget",i))(ht||{}),R=(i=>(i.Pre="pre",i.Post="post",i))(R||{});const Ts=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function be(i,t){return typeof i>"u"?t:i}let Rs=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:ht.Widget,stage:R.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:be(e.scope,ht.Widget),stage:be(e.stage,R.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Fe=i=>{const t=new Rs({});return i(t),t.get()};Fe(i=>{i.createCommand("types.register",{scope:ht.Implementation,stage:R.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:R.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:R.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:R.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=Ts(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){Is(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function js(i){const t={};return[].filter.call(i.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=i.getAttribute(e)),t}const we=(i,t,e)=>{const s=js(i);e({sourceDOMElement:i,eventType:t,data:s})};function $e(i,t,e){i.forEach(s=>{s.dataset.attached!=="true"&&(t==="load"?we(s,t,e):s.addEventListener(t,n=>{n.preventDefault(),we(s,t,e)}),s.dataset.monitored="true")})}function Us(i,t,e){const s=i.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{$e(o.triggerElements,t,e)});const n=i.container.get("triggerElements");n&&$e(n,t,e)}const Vs=Fe(i=>{i.createCommand("ready",{scope:ht.Implementation,stage:R.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})}),Wt=new WeakMap;function X(){return i=>(Wt.has(i)||Wt.set(i,{}),Wt.get(i))}const Bt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},$=i=>{const t=i.container||i;return{info:(e,...s)=>Bt(t,"info",e,...s),warn:(e,...s)=>Bt(t,"warning",e,...s),error:(e,...s)=>Bt(t,"error",e,...s)}},y=X(),re=(()=>{let i=0;return()=>++i})(),oe=(i,t,e)=>{const s=y(i).touchQueue.get(t);s&&s.forEach(n=>{n(e,i)})};let zs=class{constructor(t,e,s,n){this.key=t,this.factory=e,this.parent=s,this.container=n,this.id=re(),this.resolved=!1,this.constructed=!1,this.async=!0}resolve(){if(!this.constructed){const t=this.factory(this.parent,this.container);return this.constructed=!0,this.value=Promise.resolve(t).then(e=>(this.resolved=!0,oe(this.container,this.key,e),e))}return this.value}},Hs=class{constructor(t,e,s,n){this.key=t,this.value=e,this.parent=s,this.container=n,this.id=re(),this.async=!1,this.resolved=!1,this.constructed=!0,this.resolve=()=>(this.resolved=!0,oe(this.container,this.key,this.value),this.value)}},Ws=class{constructor(t,e,s,n){this.key=t,this.value=e,this.parent=s,this.container=n,this.id=re(),this.async=!1,this.resolved=!1,this.constructed=!1,this.resolve=()=>{this.resolved=!0,this.constructed=!0;const r=this.value(this.parent,this.container);return oe(this.container,this.key,this.value),r}}},Bs=class Ke{constructor(t,e,s){this.owner=t,this.name=e,this.parent=s,y(this).resolvers=new Map,y(this).touchQueue=new Map,y(this).children=[]}delete(t){const e=y(this).resolvers,s=Array.from(e.values()).find(n=>n.id===t);return s?(y(this).touchQueue.delete(s.key),Promise.resolve(e.delete(s.key))):this.parent?this.parent.delete(t):Promise.resolve(!1)}clear(){const t=y(this).resolvers,e=Array.from(t.values());return Promise.all(e.map(s=>{if(s.constructed)return Promise.resolve(s.resolve()).then(n=>{if(n!==null&&typeof n=="object"&&typeof n.dispose=="function")return n.dispose.call(n,this,s)})})).then(()=>{e.forEach(s=>this.delete(s.id)),y(this).children.forEach(s=>s.clear())})}detach(){if(this.parent){const t=y(this.parent).children,e=t.indexOf(this);e>-1&&(t.splice(e,1),delete this.parent)}}touch(t,e){const s=y(this).resolvers.get(t);if(s&&s.constructed)Promise.resolve(s.resolve()).then(n=>{e(n,this)});else{const n=y(this).touchQueue;let r=n.get(t);r||(r=[],n.set(t,r)),r.push(e)}return this.parent&&!s?this.parent.touch(t,e):Promise.resolve()}registerAsync(t,e){const s=y(this).resolvers.get(t);s&&!s.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${t}') previously used by a non-async resolver.`);const n=new zs(t,e,s,this);return y(this).resolvers.set(t,n),n.id}registerFactory(t,e){const s=y(this).resolvers.get(t);s&&s.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);const n=new Ws(t,e,s,this);return y(this).resolvers.set(t,n),n.id}register(t,e){const s=y(this).resolvers.get(t);s&&s.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);const n=new Hs(t,e,s,this);return y(this).resolvers.set(t,n),n.id}get(t){const e=y(this).resolvers.get(t);if(e)return e.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`You are retrieving an async value (with key '${t}') by the non-async function 'container.get(key)'. This will not be supported in future versions. Use 'container.getAsync(key) instead.'`),e.resolve();if(this.parent)return this.parent.get(t)}getAsync(t){const e=y(this).resolvers.get(t);if(e){if(!e.async)throw process.env.NODE_ENV!=="production"&&$(this).warn(`You are retrieving a non-async value (with key '${t}') by the async function 'container.getAsync(key)'.Use 'container.get(key) instead.'`),"Mismatching resolver type";return e.resolve()}return this.parent?this.parent.getAsync(t):Promise.resolve(void 0)}getMany(...t){const e={};return t.forEach(s=>e[s]=this.get(s)),e}getManyAsync(...t){const e={};return Promise.all(t.map(s=>this.getAsync(s).then(n=>e[s]=n))).then(()=>e)}createChild(t,e){const s=new Ke(t,e,this);return y(this).children.push(s),s}},_e=class{constructor(t,e,s=!1,n=!1){this.type=t,this.target=e,this.cancelable=!!s,this.bubbles=!!n,this.defaultPrevented=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}};const O=X(),Ee=(i,t)=>[].concat(O(i).listenerLookup.get(t.toLowerCase())||[],O(i).listenerLookup.get("*")||[]),Ae=(i,t,e,s)=>{let n,r;return t instanceof _e?(n=t,r=t.type):(n=new _e(t,i.target,!!e.cancelable,!!e.bubbles),r=t),{event:n,type:r,async:s}};let qs=class Ge{constructor(t,e){this.target=t,this.parent=e,O(this).listenerLookup=new Map,O(this).children=[]}clear(){O(this).listenerLookup.clear(),O(this).children.forEach(t=>t.clear())}detach(){if(this.parent){const t=O(this.parent).children,e=t.indexOf(this);e>-1&&t.splice(e,1)}}subscribe(t,e,s){const n=O(this).listenerLookup,r=t.toLowerCase();return n.has(r)||n.set(r,[]),n.get(r).push(e),()=>this.unsubscribe(t,e)}subscribeOnce(t,e){const s=this.subscribe(t,(n,r)=>(s(),e(n,r)))}unsubscribe(t,e){const s=O(this).listenerLookup.get(t.toLowerCase());if(s){const n=s.indexOf(e);n>-1&&s.splice(n,1)}}dispatchAsync(t,e,s={}){const{event:n,type:r}=Ae(this,t,s,!0),o=Ee(this,r);let a=0;const h=o.length;let c=Promise.resolve();for(a=0;a<h;a++)(l=>{c=c.then(d=>d?Promise.resolve(!0):Promise.resolve(l(n,e)).then(()=>n.defaultPrevented))})(o[a]);return c.then(l=>!l&&n.bubbles&&this.parent?this.parent.dispatchAsync(n,e):l)}dispatch(t,e,s={}){const{event:n,type:r}=Ae(this,t,s,!1),o=Ee(this,r);let a=0;const h=o.length;let c=!1;for(a=0;a<h;a++)if(o[a](n,e),n.defaultPrevented){c=!0;break}return!c&&n.bubbles&&this.parent&&(c=this.parent.dispatch(n,e)),c}createChild(t){const e=new Ge(t,this);return O(this).children.push(e),e}};const vt=(i,t,e)=>{const s=i.get("$plugins").map(n=>{try{return n.invoke(t,e)}catch(r){$(i).error("An error occured when invoking a plugin.",n,r)}});return Promise.all(s)};let Js=class{constructor(t){this.widget=t.get("$widget"),this.events=this.widget.events,this.container=this.widget.container,this.initialized=null,this.activated=null,this.initialize=this.initialize.bind(this),this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.invoke=this.invoke.bind(this),this.createInstance()}createInstance(){if(!this.widget.container.get("$instance")){const t=this.widget.container.get("$types"),e=this.widget.container.get("$type");!e&&$(this).error("Unable to create widget. No type is specified.");const s=t[e];!s&&$(this).error(`Unable to create widget. Type '${e}' is not registered.`),this.widget.events.dispatch("widget:create-instance",{},{bubbles:!0});try{this.widget.container.register("$instance",new s(this.container))}catch(n){$(this).error("Unable to create widget type.",n)}this.widget.events.dispatch("widget:instance-created",{},{bubbles:!0})}}initialize(t){return this.initialized=this.initialized||(()=>{const e=this.container.get("$instance"),s=e.initialize||(()=>{});return this.initialized=Promise.resolve(s.call(e,t)).then(()=>vt(this.container,"initialize",t)).then(()=>{})})()}activate(t){return(this.initialized||this.initialize()).then(()=>{this.activated=this.activated||(()=>vt(this.container,"activate").then(()=>{const e=this.container.get("$instance");return this.activated=e.activate(t)}))()})}deactivate(){const t=this.container.get("$instance"),e=t.deactivate||(()=>{});return vt(this.container,"deactivate").then(()=>Promise.resolve(e.call(t))).then(()=>{this.initialized=null,this.activated=null}).then(()=>{})}invoke(t,...e){return vt(this.container,"invoke",{command:t,args:e}).then(()=>{const s=this.container.get("$instance");if(s[t])return s[t].apply(s,e);const n=s.invoke;if(n)return n.call(s,t,...e)})}};const K=(i,t)=>{if(!t)return!0;if(typeof t=="string"){const e=t.split(",");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r===i||r==="*")return!0}}return t instanceof Array?t.indexOf(i)>-1:!1},Fs=(i,t)=>{if(typeof t=="function")return t(i);const e=typeof t=="string"?Ys(t):t;return!(!K(i.implementation.tenant||"",e.tenant||"")||!K(i.implementation.name,e.implementation||"")||!K(i.name,e.widget||"")||!K(i.container.get("$type"),e.type||""))},Ks=(i,t)=>{if(typeof t=="function")return t(i);const e=typeof t=="string"?Qs(t):t;return!(!K(i.tenant||"",e.tenant||"")||!K(i.name,e.implementation||""))},Ye=i=>t=>Fs(t,i),Gs=i=>t=>Ks(t,i),k=i=>i instanceof Array&&i.length===1?i[0]:i,Ys=i=>{const t={},e=i.split(":");return e.length===1?t.widget=k(e[0].split(",")):e.length===2?(t.implementation=k(e[0].split(",")),t.widget=k(e[1].split(","))):(t.tenant=k(e[0].split(",")),t.implementation=k(e[1].split(",")),t.widget=k(e[2].split(","))),t},Qs=i=>{const t={},e=i.split(":");return e.length===1?t.implementation=k(e[0].split(",")):(t.tenant=k(e[0].split(",")),t.implementation=k(e[1].split(","))),t},Ct=X(),xe=(i,t,e)=>i.filter(s=>s.stage===t&&Ye(s.selector)(e));function Zs(i){const t=i.container.get("$environment");let e=Ct(t).configurationCache;e&&(e=e.filter(s=>s[0]!==i),Ct(t).configurationCache=e)}var Ot=(i=>(i.Implementation="implementation",i.Widget="widget",i))(Ot||{}),M=(i=>(i.Pre="pre",i.Post="post",i))(M||{});const Qe=(i,t,e)=>(Object.keys(t).forEach(s=>{const n=t[s];if(typeof n=="function"){const r=n();typeof r.defaultArgs<"u"&&e(r,...r.defaultArgs),i[s]=(...o)=>{const a=Object.assign({},r,{handlerResolver:r.handlerResolver.bind({})});return e(a,...o),i}}else i[s]=Qe({},n,e)}),i),Xs=(i,t)=>{switch(t){case"implementation":return i.implementation;case"widget":return i}},Ce=(i,t,e,s)=>(s.forEach(n=>{Qe(i,n,(r,...o)=>{const a={selector:t,stage:r.stage,handler:h=>{const c=Xs(h,r.scope),l={container:c.container,events:c.events},d=r.handlerResolver,u=d(l);let p=Ct(e.environment).configurationCache;return p||(p=Ct(e.environment).configurationCache=[]),p.find(g=>g.indexOf(c)>-1&&g.indexOf(d)>-1)?Promise.resolve():(p.push([c,d]),Promise.resolve(u(...o)))}};e.instructions.push(a)})}),i);function ti(i,t){function e(s){return Ce({},s,i,t)}return Ce(e,"*",i,t)}const ei=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function Oe(i,t){return typeof i>"u"?t:i}class si{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:Ot.Widget,stage:M.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:Oe(e.scope,Ot.Widget),stage:Oe(e.stage,M.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const ae=i=>{const t=new si({});return i(t),t.get()},ii=ae(i=>{i.createCommand("types.register",{scope:Ot.Implementation,stage:M.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:M.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:M.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:M.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=ei(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){$(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})}),ni=ii;function ri(i,t,e=[]){const s=[ni].concat(e),n=ti(t,s);i(n,t)}class oi{constructor(){this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){const e=Promise.resolve(t.task());return Promise.resolve(e).then(this.next).then(()=>e.then(s=>{t.done(),t.resolve(s)})).catch(s=>(t.done(),t.reject(s),this.next()))}return Promise.resolve()})}}const yt=new WeakMap;function ai(i){return yt.has(i)||yt.set(i,new oi),t=>new Promise((e,s)=>{const n=yt.get(i);n.add(t,e,s,()=>{n.tasks.length||yt.delete(i)})})}const Pe=i=>typeof i<"u";var Ze=(i=>(i.Activating="activating",i.Loading="loading",i.Activated="activated",i.Deactivating="deactivating",i.Deactivated="deactivated",i))(Ze||{});const it=(i,t)=>{i.events.dispatch("widget:state-change",{state:t},{bubbles:!0}),i.state=t,i.events.dispatch("widget:state-changed",{},{bubbles:!0})},x=X(),ci=i=>{const{container:t,events:e}=i;t.get("$controller")||(t.register("$controller",new Js(t)),e.dispatch("widget:controller-created",{},{bubbles:!0}))};let hi=class{constructor(t,e,s){this.state="deactivated",this.name=t,this.implementation=e,this.container=e.container.createChild(this,t),this.events=e.events.createChild(this),x(this).subscriptions=[],s&&e.configure(n=>{const r=n(t);Pe(s.type)&&r.type(s.type),Pe(s.settings)&&r.settings(s.settings),s.plugins&&Object.keys(s.plugins).forEach(o=>{var a;const h=(a=s.plugins)==null?void 0:a[o];r.plugin(o,h)})}),this.load=this.load.bind(this),this.activate=this.activate.bind(this),this.invoke=this.invoke.bind(this),this.deactivate=this.deactivate.bind(this)}load(){return ai(this)(()=>{x(this).deactivatedPromise=null;const t=this.state==="deactivated";t&&(it(this,"activating"),this.container.register("$widget",this),this.container.register("$controller",null),this.container.register("$plugins",[]),this.container.register("$type",null),this.container.register("$instance",null)),it(this,"loading");const e=this.implementation.instructions,s=xe(e,M.Pre,this);return Promise.all(s.map(n=>n.handler(this))).then(()=>{ci(this);const n=xe(e,M.Post,this);return Promise.all(n.map(r=>r.handler(this))).then(()=>{t&&this.container.get("$controller").initialize()})}).then(()=>(it(this,"activated"),this))})}activate(t){x(this).subscriptions.push(this.implementation.events.subscribe("implementation:configured",()=>{["activated","activating","loading"].indexOf(this.state)>-1&&this.load()}));const e=x(this).activatedPromise;return e?(process.env.NODE_ENV!=="production"&&$(this).warn(`Widget '${this.name}' has already been activated. The passed arguments for this activation will be discarded.`,t),e):x(this).activatedPromise=this.load().then(()=>this.container.get("$controller").activate(t))}invoke(t,...e){const s=x(this).activatedPromise,n=(r,...o)=>s.then(this.load).then(()=>this.container.get("$controller").invoke(r,...o));return s?n(t,...e):(process.env.NODE_ENV!=="production"&&$(this).warn("You are invoking a command on a deactivated widget. The invocation will be queued until the widget is activated.",this),new Promise(r=>{const o=this.events.subscribe("widget:state-changed",()=>{this.state==="activated"&&(o(),r(n(t,...e)))})}))}deactivate(){return x(this).deactivatedPromise||(this.state==="deactivated"?Promise.resolve():(it(this,"deactivating"),x(this).deactivatedPromise=this.container.get("$controller").deactivate().then(()=>(x(this).activatedPromise=null,x(this).subscriptions.forEach(e=>e()),x(this).subscriptions=[],this.container.clear().then(()=>{this.events.clear(),Zs(this),it(this,"deactivated")})))))}};class li{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const Se=X();class di{constructor(t,e,s=[]){this.instructions=[],this.widgets=new Map,this.name=t.name,this.tenant=t.tenant,this.environment=e,this.container=e.container.createChild(this,this.name),this.events=e.events.createChild(this),this.container.register("$types",{}),Se(this).configurationApiExtensions=s}load(){const t=Array.from(this.widgets.values());return Promise.all(t.map(e=>e.load())).then(()=>t)}configure(t){return ri(t,this,Se(this).configurationApiExtensions),this.events.dispatch("implementation:configured",{implementation:this},{bubbles:!0}),this}createWidget(t,e){const s=new hi(t,this,e);return this.widgets.set(s.name,s),s}}function ui(i,t,e){const s=new di(i,t,e);return i.widgets&&Object.keys(i.widgets).forEach(n=>{var r;const o=(r=i.widgets)==null?void 0:r[n];s.createWidget(n,o)}),s}let ke=class Xe{constructor(t,e){this.selectorFactory=e,typeof t=="function"?this.resolver=t:this.resolver=()=>t}append(t){const e=typeof t=="function"?t:()=>t;return new Xe(()=>this.all().concat(e()),this.selectorFactory)}all(){return this.resolver().concat([])}query(t){return this.all().filter(this.selectorFactory(t))}find(t){const e=this.query(t);if(e.length)return e[0]}};const ce="#____version____#",qt=X(),pi=i=>i.tenant?`${i.name}:${i.tenant}`:i.name,ts=class{constructor(t,e=[],s={}){this.widgets=new ke(()=>{let n=[];return this.implementations.all().forEach(r=>{n=n.concat(Array.from(r.widgets.values()))}),n},Ye),this.implementations=new ke([],Gs),this.name=t,this.container=new Bs(this,t),this.events=new qs(this),this.container.register("$version",ce),this.container.register("$environment",this),this.container.register("$environmentOptions",s),qt(this).configurationApiExtensions=e}createImplementation(t){const e=pi(t);let s=this.implementations.find(e);if(s)return process.env.NODE_ENV!=="production"&&$(s).warn(`Implementation "${e}" already exist on current environment.`),s;const n=qt(this).configurationApiExtensions;return s=ui(t,this,n),this.implementations=this.implementations.append([s]),this.events.dispatch("implementation:created",{implementation:s}),s}patch(t={}){const{name:e,configurationApiExtensions:s}=t;typeof e<"u"&&e!==null&&(this.name=e),s&&s.forEach(n=>{qt(this).configurationApiExtensions.push(n)})}static create(t={}){return new ts(t.name||"",t.configurationApiExtensions,t.options)}};let es=ts;es.version=ce;const Dt=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),rt=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>rt.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>rt.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>rt.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>rt.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let b=rt;b.log=(...i)=>Dt(console.log,...i);b.warn=(...i)=>Dt(console.warn,...i);b.error=(...i)=>Dt(console.error,...i);b.info=(...i)=>Dt(console.info,...i);const ss=i=>{let t={},e,s;if(typeof i!="object"||i===null)return i;t=Array.isArray(i)?[]:{};for(s in i)e=i[s],t[s]=typeof e=="object"&&e!==null?ss(e):e;return t};function Ne(i){let t=0;if(i.length===0)return t.toString();for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let gi=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&b.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),n=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const bt=new WeakMap;function P(i,t=5e3,e=1e3){return bt.has(i)||bt.set(i,new gi(t,e)),s=>new Promise((n,r)=>{const o=bt.get(i);o.add(s,n,r,()=>{o.tasks.length||bt.delete(i)})})}const mi=(i,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let n=!1;return()=>{n||(i.get("$widget").events.dispatch("widget:data-loaded",{element:t}),n=!0)}})();if(!e())return s();new MutationObserver((n,r)=>{n.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},fi=(i,t)=>{i.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),n=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,l)=>{const d=l.getAttribute&&l.getAttribute("data-name");return d&&s.indexOf(d)>-1&&c.push(d),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!n&&s.length===0&&(n=!0,mi(i,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},L=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function pt(){return L()+L()+"-"+L()+"-"+L()+"-"+L()+"-"+L()+L()+L()}class vi{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:n,value:r,target:o})=>t===o&&e(t,n,r))}}const is=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let tt=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new yi(this.platform,this)}},he=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new Lt(t,new tt(t).withId(e.id),s);const[n,r]=is(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}};class yi{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new Lt(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}}const bi=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,n(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>({...d,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let Lt=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new he(this.platform,c,this.ns);return bi(h,e,l).then(d=>{const{data:u={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:o.fn(u,p,l)).then(w=>{n[c.id]=w})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};ae(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let se=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=pt(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&b.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{s.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const ns=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);ns(o,t,e)}},It=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];ns(n,t,e)}},_t=(i,t)=>{const e=[];return It(i,t,s=>{e.push(s)}),e},rs=(i,t,e)=>{let s;return It(i,t,n=>{if(e(n))return s=n,!0}),s};let wi=class{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=_t(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=_t(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=_t(t,e)})}query(t={}){const e=[];return It(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return rs(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}};class $i{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}}const _i=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},Ei=i=>i.map(([t,e])=>[_i(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),Jt=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),S=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(Jt(i)&&Jt(e))for(const s in e)Jt(e[s])?(i[s]||Object.assign(i,{[s]:{}}),S(i[s],e[s])):Object.assign(i,{[s]:e[s]});return S(i,...t)},Ai=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),xi=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=Ei(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},g=d.context&&!p.context,w=d.properties&&!p.properties,C=d.layout&&!p.layout;a.set(l,{context:p.context||g,properties:p.properties||w,layout:p.layout||C}),w&&(l.attributes.properties={}),C&&(l.attributes.layout={}),g&&(l.attributes.context=S({},(u=l.parent)==null?void 0:u.attributes.context));const ft=[],Ut=[],Vt=[];if(l.changesets.forEach(E=>{const[A,zt]=E;Ai(zt.breakpoints,i.breakpoints)&&(w&&(typeof A.properties=="function"?ft.push(A.properties):S(l.attributes.properties,A.properties)),C&&(typeof A.layout=="function"?Ut.push(A.layout):S(l.attributes.layout,A.layout)),g&&(typeof A.context=="function"?Vt.push(A.context):S(l.attributes.context,A.context)))}),ft.forEach(E=>{S(l.attributes.properties,E(l.attributes.properties))}),Ut.forEach(E=>{S(l.attributes.layout,E(l.attributes.layout))}),Vt.forEach(E=>{S(l.attributes.context,E(l.attributes.context))}),g||d.recursive){const E=i.getBranch(l),A=d.recursive?d:{context:!!g};l.getChildren(E).forEach(zt=>{c(zt,A)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class et{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new $i,this.events=t.events.createChild(this);const s=new se(this.events,"root");s.name=`root-${t.name}`,this.nodes=new wi(s,this.switches,this.events);const n=this.processNode=xi(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
1
+ "use strict";const Ht=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},Is=i=>{const t=i.container||i;return{info:(e,...s)=>Ht(t,"info",e,...s),warn:(e,...s)=>Ht(t,"warning",e,...s),error:(e,...s)=>Ht(t,"error",e,...s)}};var ht=(i=>(i.Implementation="implementation",i.Widget="widget",i))(ht||{}),R=(i=>(i.Pre="pre",i.Post="post",i))(R||{});const Ts=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function we(i,t){return typeof i>"u"?t:i}let Rs=class{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:ht.Widget,stage:R.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:we(e.scope,ht.Widget),stage:we(e.stage,R.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Ke=i=>{const t=new Rs({});return i(t),t.get()};Ke(i=>{i.createCommand("types.register",{scope:ht.Implementation,stage:R.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:R.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:R.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:R.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=Ts(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){Is(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})});function Us(i){const t={};return[].filter.call(i.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=i.getAttribute(e)),t}const $e=(i,t,e)=>{const s=Us(i);e({sourceDOMElement:i,eventType:t,data:s})};function _e(i,t,e){i.forEach(s=>{s.dataset.attached!=="true"&&(t==="load"?$e(s,t,e):s.addEventListener(t,n=>{n.preventDefault(),$e(s,t,e)}),s.dataset.monitored="true")})}function js(i,t,e){const s=i.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{_e(o.triggerElements,t,e)});const n=i.container.get("triggerElements");n&&_e(n,t,e)}const Vs=Ke(i=>{i.createCommand("ready",{scope:ht.Implementation,stage:R.Pre},t=>e=>{const{container:s}=t,n=s.owner;s.get("bootstrapping").ready?e(n):n.events.subscribeOnce("bootstrap:ready",()=>{e(n)})})}),Wt=new WeakMap;function X(){return i=>(Wt.has(i)||Wt.set(i,{}),Wt.get(i))}const Bt=(i,t,e,...s)=>{const n=`[${i.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(n,...s);break;case"warning":console.warn(n,...s);break;case"error":console.error(n,...s);break}},$=i=>{const t=i.container||i;return{info:(e,...s)=>Bt(t,"info",e,...s),warn:(e,...s)=>Bt(t,"warning",e,...s),error:(e,...s)=>Bt(t,"error",e,...s)}},y=X(),re=(()=>{let i=0;return()=>++i})(),oe=(i,t,e)=>{const s=y(i).touchQueue.get(t);s&&s.forEach(n=>{n(e,i)})};let zs=class{constructor(t,e,s,n){this.key=t,this.factory=e,this.parent=s,this.container=n,this.id=re(),this.resolved=!1,this.constructed=!1,this.async=!0}resolve(){if(!this.constructed){const t=this.factory(this.parent,this.container);return this.constructed=!0,this.value=Promise.resolve(t).then(e=>(this.resolved=!0,oe(this.container,this.key,e),e))}return this.value}},Hs=class{constructor(t,e,s,n){this.key=t,this.value=e,this.parent=s,this.container=n,this.id=re(),this.async=!1,this.resolved=!1,this.constructed=!0,this.resolve=()=>(this.resolved=!0,oe(this.container,this.key,this.value),this.value)}},Ws=class{constructor(t,e,s,n){this.key=t,this.value=e,this.parent=s,this.container=n,this.id=re(),this.async=!1,this.resolved=!1,this.constructed=!1,this.resolve=()=>{this.resolved=!0,this.constructed=!0;const r=this.value(this.parent,this.container);return oe(this.container,this.key,this.value),r}}},Bs=class Ge{constructor(t,e,s){this.owner=t,this.name=e,this.parent=s,y(this).resolvers=new Map,y(this).touchQueue=new Map,y(this).children=[]}delete(t){const e=y(this).resolvers,s=Array.from(e.values()).find(n=>n.id===t);return s?(y(this).touchQueue.delete(s.key),Promise.resolve(e.delete(s.key))):this.parent?this.parent.delete(t):Promise.resolve(!1)}clear(){const t=y(this).resolvers,e=Array.from(t.values());return Promise.all(e.map(s=>{if(s.constructed)return Promise.resolve(s.resolve()).then(n=>{if(n!==null&&typeof n=="object"&&typeof n.dispose=="function")return n.dispose.call(n,this,s)})})).then(()=>{e.forEach(s=>this.delete(s.id)),y(this).children.forEach(s=>s.clear())})}detach(){if(this.parent){const t=y(this.parent).children,e=t.indexOf(this);e>-1&&(t.splice(e,1),delete this.parent)}}touch(t,e){const s=y(this).resolvers.get(t);if(s&&s.constructed)Promise.resolve(s.resolve()).then(n=>{e(n,this)});else{const n=y(this).touchQueue;let r=n.get(t);r||(r=[],n.set(t,r)),r.push(e)}return this.parent&&!s?this.parent.touch(t,e):Promise.resolve()}registerAsync(t,e){const s=y(this).resolvers.get(t);s&&!s.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`Mismatching resolver type. You are registering an async resolver with a key ('${t}') previously used by a non-async resolver.`);const n=new zs(t,e,s,this);return y(this).resolvers.set(t,n),n.id}registerFactory(t,e){const s=y(this).resolvers.get(t);s&&s.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);const n=new Ws(t,e,s,this);return y(this).resolvers.set(t,n),n.id}register(t,e){const s=y(this).resolvers.get(t);s&&s.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`Mismatching resolver type. You are registering a non-async resolver with a key ('${t}') previously used by an async resolver.`);const n=new Hs(t,e,s,this);return y(this).resolvers.set(t,n),n.id}get(t){const e=y(this).resolvers.get(t);if(e)return e.async&&process.env.NODE_ENV!=="production"&&$(this).warn(`You are retrieving an async value (with key '${t}') by the non-async function 'container.get(key)'. This will not be supported in future versions. Use 'container.getAsync(key) instead.'`),e.resolve();if(this.parent)return this.parent.get(t)}getAsync(t){const e=y(this).resolvers.get(t);if(e){if(!e.async)throw process.env.NODE_ENV!=="production"&&$(this).warn(`You are retrieving a non-async value (with key '${t}') by the async function 'container.getAsync(key)'.Use 'container.get(key) instead.'`),"Mismatching resolver type";return e.resolve()}return this.parent?this.parent.getAsync(t):Promise.resolve(void 0)}getMany(...t){const e={};return t.forEach(s=>e[s]=this.get(s)),e}getManyAsync(...t){const e={};return Promise.all(t.map(s=>this.getAsync(s).then(n=>e[s]=n))).then(()=>e)}createChild(t,e){const s=new Ge(t,e,this);return y(this).children.push(s),s}},Ee=class{constructor(t,e,s=!1,n=!1){this.type=t,this.target=e,this.cancelable=!!s,this.bubbles=!!n,this.defaultPrevented=!1}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}};const O=X(),Ae=(i,t)=>[].concat(O(i).listenerLookup.get(t.toLowerCase())||[],O(i).listenerLookup.get("*")||[]),xe=(i,t,e,s)=>{let n,r;return t instanceof Ee?(n=t,r=t.type):(n=new Ee(t,i.target,!!e.cancelable,!!e.bubbles),r=t),{event:n,type:r,async:s}};let qs=class Ye{constructor(t,e){this.target=t,this.parent=e,O(this).listenerLookup=new Map,O(this).children=[]}clear(){O(this).listenerLookup.clear(),O(this).children.forEach(t=>t.clear())}detach(){if(this.parent){const t=O(this.parent).children,e=t.indexOf(this);e>-1&&t.splice(e,1)}}subscribe(t,e,s){const n=O(this).listenerLookup,r=t.toLowerCase();return n.has(r)||n.set(r,[]),n.get(r).push(e),()=>this.unsubscribe(t,e)}subscribeOnce(t,e){const s=this.subscribe(t,(n,r)=>(s(),e(n,r)))}unsubscribe(t,e){const s=O(this).listenerLookup.get(t.toLowerCase());if(s){const n=s.indexOf(e);n>-1&&s.splice(n,1)}}dispatchAsync(t,e,s={}){const{event:n,type:r}=xe(this,t,s,!0),o=Ae(this,r);let a=0;const h=o.length;let c=Promise.resolve();for(a=0;a<h;a++)(l=>{c=c.then(d=>d?Promise.resolve(!0):Promise.resolve(l(n,e)).then(()=>n.defaultPrevented))})(o[a]);return c.then(l=>!l&&n.bubbles&&this.parent?this.parent.dispatchAsync(n,e):l)}dispatch(t,e,s={}){const{event:n,type:r}=xe(this,t,s,!1),o=Ae(this,r);let a=0;const h=o.length;let c=!1;for(a=0;a<h;a++)if(o[a](n,e),n.defaultPrevented){c=!0;break}return!c&&n.bubbles&&this.parent&&(c=this.parent.dispatch(n,e)),c}createChild(t){const e=new Ye(t,this);return O(this).children.push(e),e}};const vt=(i,t,e)=>{const s=i.get("$plugins").map(n=>{try{return n.invoke(t,e)}catch(r){$(i).error("An error occured when invoking a plugin.",n,r)}});return Promise.all(s)};let Js=class{constructor(t){this.widget=t.get("$widget"),this.events=this.widget.events,this.container=this.widget.container,this.initialized=null,this.activated=null,this.initialize=this.initialize.bind(this),this.activate=this.activate.bind(this),this.deactivate=this.deactivate.bind(this),this.invoke=this.invoke.bind(this),this.createInstance()}createInstance(){if(!this.widget.container.get("$instance")){const t=this.widget.container.get("$types"),e=this.widget.container.get("$type");!e&&$(this).error("Unable to create widget. No type is specified.");const s=t[e];!s&&$(this).error(`Unable to create widget. Type '${e}' is not registered.`),this.widget.events.dispatch("widget:create-instance",{},{bubbles:!0});try{this.widget.container.register("$instance",new s(this.container))}catch(n){$(this).error("Unable to create widget type.",n)}this.widget.events.dispatch("widget:instance-created",{},{bubbles:!0})}}initialize(t){return this.initialized=this.initialized||(()=>{const e=this.container.get("$instance"),s=e.initialize||(()=>{});return this.initialized=Promise.resolve(s.call(e,t)).then(()=>vt(this.container,"initialize",t)).then(()=>{})})()}activate(t){return(this.initialized||this.initialize()).then(()=>{this.activated=this.activated||(()=>vt(this.container,"activate").then(()=>{const e=this.container.get("$instance");return this.activated=e.activate(t)}))()})}deactivate(){const t=this.container.get("$instance"),e=t.deactivate||(()=>{});return vt(this.container,"deactivate").then(()=>Promise.resolve(e.call(t))).then(()=>{this.initialized=null,this.activated=null}).then(()=>{})}invoke(t,...e){return vt(this.container,"invoke",{command:t,args:e}).then(()=>{const s=this.container.get("$instance");if(s[t])return s[t].apply(s,e);const n=s.invoke;if(n)return n.call(s,t,...e)})}};const K=(i,t)=>{if(!t)return!0;if(typeof t=="string"){const e=t.split(",");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r===i||r==="*")return!0}}return t instanceof Array?t.indexOf(i)>-1:!1},Fs=(i,t)=>{if(typeof t=="function")return t(i);const e=typeof t=="string"?Ys(t):t;return!(!K(i.implementation.tenant||"",e.tenant||"")||!K(i.implementation.name,e.implementation||"")||!K(i.name,e.widget||"")||!K(i.container.get("$type"),e.type||""))},Ks=(i,t)=>{if(typeof t=="function")return t(i);const e=typeof t=="string"?Qs(t):t;return!(!K(i.tenant||"",e.tenant||"")||!K(i.name,e.implementation||""))},Qe=i=>t=>Fs(t,i),Gs=i=>t=>Ks(t,i),k=i=>i instanceof Array&&i.length===1?i[0]:i,Ys=i=>{const t={},e=i.split(":");return e.length===1?t.widget=k(e[0].split(",")):e.length===2?(t.implementation=k(e[0].split(",")),t.widget=k(e[1].split(","))):(t.tenant=k(e[0].split(",")),t.implementation=k(e[1].split(",")),t.widget=k(e[2].split(","))),t},Qs=i=>{const t={},e=i.split(":");return e.length===1?t.implementation=k(e[0].split(",")):(t.tenant=k(e[0].split(",")),t.implementation=k(e[1].split(","))),t},Ct=X(),Ce=(i,t,e)=>i.filter(s=>s.stage===t&&Qe(s.selector)(e));function Zs(i){const t=i.container.get("$environment");let e=Ct(t).configurationCache;e&&(e=e.filter(s=>s[0]!==i),Ct(t).configurationCache=e)}var Ot=(i=>(i.Implementation="implementation",i.Widget="widget",i))(Ot||{}),M=(i=>(i.Pre="pre",i.Post="post",i))(M||{});const Ze=(i,t,e)=>(Object.keys(t).forEach(s=>{const n=t[s];if(typeof n=="function"){const r=n();typeof r.defaultArgs<"u"&&e(r,...r.defaultArgs),i[s]=(...o)=>{const a=Object.assign({},r,{handlerResolver:r.handlerResolver.bind({})});return e(a,...o),i}}else i[s]=Ze({},n,e)}),i),Xs=(i,t)=>{switch(t){case"implementation":return i.implementation;case"widget":return i}},Oe=(i,t,e,s)=>(s.forEach(n=>{Ze(i,n,(r,...o)=>{const a={selector:t,stage:r.stage,handler:h=>{const c=Xs(h,r.scope),l={container:c.container,events:c.events},d=r.handlerResolver,u=d(l);let p=Ct(e.environment).configurationCache;return p||(p=Ct(e.environment).configurationCache=[]),p.find(g=>g.indexOf(c)>-1&&g.indexOf(d)>-1)?Promise.resolve():(p.push([c,d]),Promise.resolve(u(...o)))}};e.instructions.push(a)})}),i);function ti(i,t){function e(s){return Oe({},s,i,t)}return Oe(e,"*",i,t)}const ei=(i,t,e,s)=>{try{const n=new t(e,s);return{name:i,invoke:(r,o)=>{let a;return n[r]&&(a=n[r].call(n,o)),Promise.resolve(a)},getInstance:()=>n}}catch(n){if(n.message&&n.message.indexOf("is not a constructor")>=0)return{name:i,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw n}};function Pe(i,t){return typeof i>"u"?t:i}class si{constructor(t={}){this.part=t}createCommand(t,e,s){let n;typeof e=="function"?n={scope:Ot.Widget,stage:M.Post,defaultArgs:void 0,handlerResolver:e}:n={scope:Pe(e.scope,Ot.Widget),stage:Pe(e.stage,M.Post),defaultArgs:e.defaultArgs,handlerResolver:s};let r=this.part;const o=t.split(".");return o.forEach((a,h)=>{h===o.length-1?r[a]||(r[a]=()=>n):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const ae=i=>{const t=new si({});return i(t),t.get()},ii=ae(i=>{i.createCommand("types.register",{scope:Ot.Implementation,stage:M.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:M.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:M.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:M.Pre},t=>(e,s,n)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=n);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=ei(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){$(t).warn("Error when initializing plugin",p)}};t.container.get("$instance")?c(!0):t.events.subscribeOnce("widget:instance-created",()=>c(!1))}).createCommand("container.register",t=>(e,s)=>{t.container.register(e,s)}).createCommand("container.registerAsync",t=>(e,s)=>{t.container.registerAsync(e,s)}).createCommand("container.registerFactory",t=>(e,s)=>{t.container.registerFactory(e,s)}).createCommand("container.touch",t=>(e,s)=>{t.container.touch(e,s)}).createCommand("csp",{},t=>e=>{t.container.register("csp",e)})}),ni=ii;function ri(i,t,e=[]){const s=[ni].concat(e),n=ti(t,s);i(n,t)}class oi{constructor(){this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){const e=Promise.resolve(t.task());return Promise.resolve(e).then(this.next).then(()=>e.then(s=>{t.done(),t.resolve(s)})).catch(s=>(t.done(),t.reject(s),this.next()))}return Promise.resolve()})}}const yt=new WeakMap;function ai(i){return yt.has(i)||yt.set(i,new oi),t=>new Promise((e,s)=>{const n=yt.get(i);n.add(t,e,s,()=>{n.tasks.length||yt.delete(i)})})}const Se=i=>typeof i<"u";var Xe=(i=>(i.Activating="activating",i.Loading="loading",i.Activated="activated",i.Deactivating="deactivating",i.Deactivated="deactivated",i))(Xe||{});const it=(i,t)=>{i.events.dispatch("widget:state-change",{state:t},{bubbles:!0}),i.state=t,i.events.dispatch("widget:state-changed",{},{bubbles:!0})},x=X(),ci=i=>{const{container:t,events:e}=i;t.get("$controller")||(t.register("$controller",new Js(t)),e.dispatch("widget:controller-created",{},{bubbles:!0}))};let hi=class{constructor(t,e,s){this.state="deactivated",this.name=t,this.implementation=e,this.container=e.container.createChild(this,t),this.events=e.events.createChild(this),x(this).subscriptions=[],s&&e.configure(n=>{const r=n(t);Se(s.type)&&r.type(s.type),Se(s.settings)&&r.settings(s.settings),s.plugins&&Object.keys(s.plugins).forEach(o=>{var a;const h=(a=s.plugins)==null?void 0:a[o];r.plugin(o,h)})}),this.load=this.load.bind(this),this.activate=this.activate.bind(this),this.invoke=this.invoke.bind(this),this.deactivate=this.deactivate.bind(this)}load(){return ai(this)(()=>{x(this).deactivatedPromise=null;const t=this.state==="deactivated";t&&(it(this,"activating"),this.container.register("$widget",this),this.container.register("$controller",null),this.container.register("$plugins",[]),this.container.register("$type",null),this.container.register("$instance",null)),it(this,"loading");const e=this.implementation.instructions,s=Ce(e,M.Pre,this);return Promise.all(s.map(n=>n.handler(this))).then(()=>{ci(this);const n=Ce(e,M.Post,this);return Promise.all(n.map(r=>r.handler(this))).then(()=>{t&&this.container.get("$controller").initialize()})}).then(()=>(it(this,"activated"),this))})}activate(t){x(this).subscriptions.push(this.implementation.events.subscribe("implementation:configured",()=>{["activated","activating","loading"].indexOf(this.state)>-1&&this.load()}));const e=x(this).activatedPromise;return e?(process.env.NODE_ENV!=="production"&&$(this).warn(`Widget '${this.name}' has already been activated. The passed arguments for this activation will be discarded.`,t),e):x(this).activatedPromise=this.load().then(()=>this.container.get("$controller").activate(t))}invoke(t,...e){const s=x(this).activatedPromise,n=(r,...o)=>s.then(this.load).then(()=>this.container.get("$controller").invoke(r,...o));return s?n(t,...e):(process.env.NODE_ENV!=="production"&&$(this).warn("You are invoking a command on a deactivated widget. The invocation will be queued until the widget is activated.",this),new Promise(r=>{const o=this.events.subscribe("widget:state-changed",()=>{this.state==="activated"&&(o(),r(n(t,...e)))})}))}deactivate(){return x(this).deactivatedPromise||(this.state==="deactivated"?Promise.resolve():(it(this,"deactivating"),x(this).deactivatedPromise=this.container.get("$controller").deactivate().then(()=>(x(this).activatedPromise=null,x(this).subscriptions.forEach(e=>e()),x(this).subscriptions=[],this.container.clear().then(()=>{this.events.clear(),Zs(this),it(this,"deactivated")})))))}};class li{constructor(t){this.container=t,this.widget=t.get("$widget"),this.settings=t.get("$settings"),this.events=this.widget.events,this.widget.events.subscribe("settings:change",(e,s)=>{this.settings=s})}}const ke=X();class di{constructor(t,e,s=[]){this.instructions=[],this.widgets=new Map,this.name=t.name,this.tenant=t.tenant,this.environment=e,this.container=e.container.createChild(this,this.name),this.events=e.events.createChild(this),this.container.register("$types",{}),ke(this).configurationApiExtensions=s}load(){const t=Array.from(this.widgets.values());return Promise.all(t.map(e=>e.load())).then(()=>t)}configure(t){return ri(t,this,ke(this).configurationApiExtensions),this.events.dispatch("implementation:configured",{implementation:this},{bubbles:!0}),this}createWidget(t,e){const s=new hi(t,this,e);return this.widgets.set(s.name,s),s}}function ui(i,t,e){const s=new di(i,t,e);return i.widgets&&Object.keys(i.widgets).forEach(n=>{var r;const o=(r=i.widgets)==null?void 0:r[n];s.createWidget(n,o)}),s}let Ne=class ts{constructor(t,e){this.selectorFactory=e,typeof t=="function"?this.resolver=t:this.resolver=()=>t}append(t){const e=typeof t=="function"?t:()=>t;return new ts(()=>this.all().concat(e()),this.selectorFactory)}all(){return this.resolver().concat([])}query(t){return this.all().filter(this.selectorFactory(t))}find(t){const e=this.query(t);if(e.length)return e[0]}};const ce="#____version____#",qt=X(),pi=i=>i.tenant?`${i.name}:${i.tenant}`:i.name,es=class{constructor(t,e=[],s={}){this.widgets=new Ne(()=>{let n=[];return this.implementations.all().forEach(r=>{n=n.concat(Array.from(r.widgets.values()))}),n},Qe),this.implementations=new Ne([],Gs),this.name=t,this.container=new Bs(this,t),this.events=new qs(this),this.container.register("$version",ce),this.container.register("$environment",this),this.container.register("$environmentOptions",s),qt(this).configurationApiExtensions=e}createImplementation(t){const e=pi(t);let s=this.implementations.find(e);if(s)return process.env.NODE_ENV!=="production"&&$(s).warn(`Implementation "${e}" already exist on current environment.`),s;const n=qt(this).configurationApiExtensions;return s=ui(t,this,n),this.implementations=this.implementations.append([s]),this.events.dispatch("implementation:created",{implementation:s}),s}patch(t={}){const{name:e,configurationApiExtensions:s}=t;typeof e<"u"&&e!==null&&(this.name=e),s&&s.forEach(n=>{qt(this).configurationApiExtensions.push(n)})}static create(t={}){return new es(t.name||"",t.configurationApiExtensions,t.options)}};let ss=es;ss.version=ce;const Dt=(i,t,...e)=>typeof t=="string"?i(`[humany] ${t}`,...e):i(t,...e),rt=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>rt.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>rt.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>rt.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>rt.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let b=rt;b.log=(...i)=>Dt(console.log,...i);b.warn=(...i)=>Dt(console.warn,...i);b.error=(...i)=>Dt(console.error,...i);b.info=(...i)=>Dt(console.info,...i);const is=i=>{let t={},e,s;if(typeof i!="object"||i===null)return i;t=Array.isArray(i)?[]:{};for(s in i)e=i[s],t[s]=typeof e=="object"&&e!==null?is(e):e;return t};function Me(i){let t=0;if(i.length===0)return t.toString();for(let e=0;e<i.length;e++){const s=i.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let gi=class{constructor(t,e){this.lockWarningTime=t,this.lockErrorTime=e,this.tasks=[],this.current=Promise.resolve(),this.next=this.next.bind(this)}add(t,e,s,n){this.tasks.push({task:t,resolve:e,reject:s,done:n}),this.next()}next(){this.current=this.current.then(()=>{const t=this.tasks.shift();if(t){let e;const s=setTimeout(()=>{process.env.NODE_ENV!=="production"&&b.warn(`A lock has exceeded ${this.lockWarningTime} ms. Waiting additional ${this.lockErrorTime} ms before rejecting the task.`,t),e=setTimeout(()=>{t.reject("lock timeout exceeded")},this.lockErrorTime)},this.lockWarningTime),n=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(n).then(this.next).then(()=>n.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const bt=new WeakMap;function P(i,t=5e3,e=1e3){return bt.has(i)||bt.set(i,new gi(t,e)),s=>new Promise((n,r)=>{const o=bt.get(i);o.add(s,n,r,()=>{o.tasks.length||bt.delete(i)})})}const mi=(i,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let n=!1;return()=>{n||(i.get("$widget").events.dispatch("widget:data-loaded",{element:t}),n=!0)}})();if(!e())return s();new MutationObserver((n,r)=>{n.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},fi=(i,t)=>{i.get("$widget").container.getAsync("components").then(e=>{e.events.subscribeOnce("components:component-model-initialized",()=>{let s=e.nodes.visible.reduce((r,o)=>(!o.name||!o.type||o.type==="view"||o.type==="root"||o.attributes.layout.size==="none"||t.querySelector(`[data-name="${o.name}"]`)||r.push(o.name),r),[]),n=!1;new MutationObserver((r,o)=>{r.forEach(a=>{if(a.addedNodes){const h=Array.from(a.addedNodes).reduce((c,l)=>{const d=l.getAttribute&&l.getAttribute("data-name");return d&&s.indexOf(d)>-1&&c.push(d),c},[]);s=s.filter(c=>h.indexOf(c)===-1),!n&&s.length===0&&(n=!0,mi(i,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},L=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function pt(){return L()+L()+"-"+L()+"-"+L()+"-"+L()+"-"+L()+L()+L()}class vi{constructor(t){const{events:e}=t.get("$widget");this.events=e.createChild(this)}action(t,e,s){this.events.dispatch("data:action",{action:e,value:s,target:t},{bubbles:!0})}subscribe(t,e){return this.events.subscribe("data:action",(s,{action:n,value:r,target:o})=>t===o&&e(t,n,r))}}const ns=i=>{const t=[];return[(e,s)=>{t.push(i.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let tt=class{constructor(t,e=[]){this.platform=t,this.rules=e}match(t){return this.rules.every(e=>!(e.id&&e.id!==t.id||e.type&&e.type!==t.type))}ofType(t){return this.rules.push({type:t}),this}withId(t){return this.rules.push({id:t}),this}select(){return new yi(this.platform,this)}},he=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new Lt(t,new tt(t).withId(e.id),s);const[n,r]=ns(this.platform.events);this.subscribe=n,this.unsubscribe=r}properties(t){return t&&this.node.touchProperties(e=>t(e)),this.node.attributes.properties}context(t){return t&&this.subscribe("components:context-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.context)}),this.node.attributes.context}layout(t){return t&&this.subscribe("components:layout-changed",(e,{node:s})=>{s===this.node&&t(this.node.attributes.layout)}),this.node.attributes.layout}writeProperties(t,e){this.node.writeProperties(t,e)}writeContext(t,e){this.node.writeProperties(t,e)}writeLayout(t,e){this.node.writeLayout(t,e)}dispose(){this.unsubscribe(),this.actions.dispose()}};class yi{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new Lt(this.platform,this.target)}writeProperties(t,e){this.removes.push(this.platform.write({options:e,attributes:{properties:t},target:this.target,removable:this.clearOnDispose}))}writeContext(t,e){this.removes.push(this.platform.write({options:e,attributes:{context:t},target:this.target,removable:this.clearOnDispose}))}writeLayout(t,e){this.removes.push(this.platform.write({options:e,attributes:{layout:t},target:this.target,removable:this.clearOnDispose}))}dispose(){this.removes.forEach(t=>{t()}),this.actions.dispose()}}const bi=(i,t,e)=>{const s=i.concat(),n=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,n(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>({...d,cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return n(t,{},e)};let Lt=class{constructor(t,e,s){this.platform=t,this.target=e,this.ns=s,this.subscriptions=[],this.create=this.create.bind(this)}create(t,e=()=>{}){const s={key:t,fn:e,target:this.target,ns:this.ns};this.platform.actionsState.handlers.push(s);const n=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(n),n}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),n={},r=this.platform.actionsState.handlers.filter(o=>o.key===t&&(!o.ns||!this.ns||o.ns===this.ns));return Promise.all(r.map(o=>{const a=s.filter(c=>o.target.match(c)&&this.target.match(c)),h=this.platform.actionsState.watchers.filter(c=>c.key===t&&(!c.ns||!this.ns||c.ns===this.ns)&&a.some(l=>c.target.match(l))).map(c=>c.fn);return Promise.all(a.map(c=>{const l=new he(this.platform,c,this.ns);return bi(h,e,l).then(d=>{const{data:u={},options:p,cancelled:g}=d;return Promise.resolve(g?{}:o.fn(u,p,l)).then(w=>{n[c.id]=w})})}))})).then(()=>n)}watch(t,e){let s=t,n=this.ns;const r=t.split(".");r.length>1&&(n=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:n};this.platform.actionsState.watchers.push(o);const a=()=>{const h=this.platform.actionsState.watchers.indexOf(o);h>-1&&this.platform.actionsState.watchers.splice(h,1)};return this.subscriptions.push(a),a}dispose(){this.subscriptions.forEach(t=>t())}};ae(i=>{i.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:n})=>{e.handlers&&e.handlers.forEach(([r,o])=>{n.addComponentHandler(r,o)})})})});let se=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=pt(),this.type=e,this.attributes={context:{},properties:{},layout:{},tags:[]},this.writeLayout({size:"full",indent:0})}mount(t,e){let s=t.get("mounted-nodes");return s||(s=new Map,t.register("mounted-nodes",s)),s.has(this)?(process.env.NODE_ENV!=="production"&&b.error("Trying to mount an already mounted component node.",this),()=>{}):(this.events.dispatch("components:node-mounted",{node:this}),this.mountCount===0&&(this.mountCount=this.mountCount+1,this.events.dispatch("components:node-enter",{node:this})),()=>{s.delete(this),this.events.dispatch("components:node-unmounted",{node:this}),this.mountCount=this.mountCount-1,this.mountCount===0&&this.events.dispatch("components:node-exit",{node:this})})}appendChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].push(t),this.events.dispatch("components:node-appended",{node:t})}prependChild(t,e="default"){if(t.parent){if(t.parent===this)return;t.parent.removeChild(t)}t.parent=this,this.children[e]||(this.children[e]=[]),this.children[e].unshift(t),this.events.dispatch("components:node-appended",{node:t})}touchProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const n=[{properties:t},e];return this.changesets.push(n),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const n=[{layout:t},e];return this.changesets.push(n),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const n=[{context:t},e];return this.changesets.push(n),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(n);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-context",{node:this}))}}getChildren(t="default"){const e=this.children[t]||[];return e.reduce((s,n,r)=>{const{order:o=r}=n.attributes.layout;return s[o]?s.splice(o,0,n):s[o]=n,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],n=s.indexOf(t);n>-1&&(s.splice(n,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const rs=(i,t,e)=>{for(let s=0,n=i.length;s<n&&e(i[s])!==!0;s++){const r=t[i[s].id]||"default",o=i[s].getChildren(r);rs(o,t,e)}},It=(i,t,e)=>{if(e(i)!==!0){const s=t[i.id]||"default",n=i.children[s];rs(n,t,e)}},_t=(i,t)=>{const e=[];return It(i,t,s=>{e.push(s)}),e},os=(i,t,e)=>{let s;return It(i,t,n=>{if(e(n))return s=n,!0}),s};let wi=class{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(n,r)=>{this.all.push(r.node),this.visible=_t(t,e)}),s.subscribe("components:node-removed",(n,r)=>{let o=this.all.indexOf(r.node);o>-1&&this.all.splice(o,1),o=this.visible.indexOf(r.node),o>-1&&this.visible.splice(o,1),this.visible=_t(t,e)}),s.subscribe("components:node-switched",(n,r)=>{this.visible=_t(t,e)})}query(t={}){const e=[];return It(this.root,this.switches,s=>{Object.keys(t).every(n=>t[n]===s[n])&&e.push(s)}),e}get(t){return os(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}};class $i{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}}const _i=i=>{let t=i,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},Ei=i=>i.map(([t,e])=>[_i(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),Jt=i=>i instanceof Date?!1:i&&typeof i=="object"&&!Array.isArray(i),S=(i,...t)=>{if(!t.length)return i;const e=t.shift();if(Jt(i)&&Jt(e))for(const s in e)Jt(e[s])?(i[s]||Object.assign(i,{[s]:{}}),S(i[s],e[s])):Object.assign(i,{[s]:e[s]});return S(i,...t)},Ai=(i,t)=>!i||i==="all"?!0:i.some(e=>t.indexOf(e)>-1),xi=(i,t)=>{let e=[],s=[],n;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=Ei(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},g=d.context&&!p.context,w=d.properties&&!p.properties,C=d.layout&&!p.layout;a.set(l,{context:p.context||g,properties:p.properties||w,layout:p.layout||C}),w&&(l.attributes.properties={}),C&&(l.attributes.layout={}),g&&(l.attributes.context=S({},(u=l.parent)==null?void 0:u.attributes.context));const ft=[],jt=[],Vt=[];if(l.changesets.forEach(E=>{const[A,zt]=E;Ai(zt.breakpoints,i.breakpoints)&&(w&&(typeof A.properties=="function"?ft.push(A.properties):S(l.attributes.properties,A.properties)),C&&(typeof A.layout=="function"?jt.push(A.layout):S(l.attributes.layout,A.layout)),g&&(typeof A.context=="function"?Vt.push(A.context):S(l.attributes.context,A.context)))}),ft.forEach(E=>{S(l.attributes.properties,E(l.attributes.properties))}),jt.forEach(E=>{S(l.attributes.layout,E(l.attributes.layout))}),Vt.forEach(E=>{S(l.attributes.context,E(l.attributes.context))}),g||d.recursive){const E=i.getBranch(l),A=d.recursive?d:{context:!!g};l.getChildren(E).forEach(zt=>{c(zt,A)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(n),n=setTimeout(r,0)};return(a,h)=>{const c=e.indexOf(a);if(c>-1){const l=s[c];return h.context&&(l.context=!0),h.properties&&(l.properties=!0),h.layout&&(l.layout=!0),h.recursive&&(l.recursive=!0),o()}return e.push(a),s.push(h),o()}};class et{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new $i,this.events=t.events.createChild(this);const s=new se(this.events,"root");s.name=`root-${t.name}`,this.nodes=new wi(s,this.switches,this.events);const n=this.processNode=xi(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
2
2
  ${o.map(a=>`${a.name||"<no name>"} (${a.id})
3
- `)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[u,p]=c;l.match(o.node)&&(u.properties&&d.push(a.writeProperties(u.properties,p)),u.context&&d.push(a.writeContext(u.context,p)),u.layout&&d.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new se(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new tt(this)}actions(t,e){return new Lt(this,t,e)}write(t){const{provider:e,target:s,attributes:n,options:r={},removable:o}=t,a=t.key||pt(),h={changeset:[n,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,n,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};n.properties&&(l=c.writeProperties(n.properties,r,o)),n.context&&(l=c.writeContext(n.context,r,o)),n.layout&&(l=c.writeContext(n.layout,r,o)),h.removes.push(l)}}),()=>{if(o){h.removes.forEach(l=>l());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const Ci=i=>{if(Array.isArray(i)){const[t,...e]=i;return{definitionId:t,overrides:e}}return{definitionId:i,overrides:[]}},Pt=(i,t,e,s,n,r)=>{e.forEach(o=>{const a=Ci(o),h=s[a.definitionId];if(a.definitionId==="view"){const c=i.createNode("view");c.name="view",Object.keys(n).forEach(l=>{const d=n[l];Pt(i,c,[d.entry],s,n,l)}),t.appendChild(c),a.overrides.forEach(l=>{l.properties&&c.writeProperties(l.properties,{breakpoints:l.breakpoints}),l.context&&c.writeContext(l.context,{breakpoints:l.breakpoints}),l.layout&&c.writeLayout(l.layout,{breakpoints:l.breakpoints})})}else if(i.getComponentHandler(h.type)){const c=i.getComponentHandler(h.type);c&&c(a,{platform:i,node:t,references:e,definitions:s,views:n,branch:r})}else{const c=s[a.definitionId];if(process.env.NODE_ENV!=="production"&&!c){b.error(`No definition found for component type '${a.definitionId}'.`);return}const l=i.createNode(c.type);l.name=a.definitionId,l.tags=c.tags||[],c.properties&&l.writeProperties(c.properties),c.context&&l.writeContext(c.context),c.layout&&l.writeLayout(c.layout),t.appendChild(l,r),a.overrides.forEach(d=>{const u={breakpoints:d.breakpoints};d.properties&&l.writeProperties(d.properties,u),d.context&&l.writeContext(d.context,u),d.layout&&l.writeLayout(d.layout,u)}),c.children&&Pt(i,l,c.children,s,n)}})},os=(i,t)=>{const{entry:e,components:s,breakpoints:n,views:r}=t,o=[];return Object.keys(n).forEach(a=>{const h=n[a],c=window.matchMedia(h);c.matches&&i.breakpoints.push(a);const l=d=>{d.matches?i.addBreakpoint(a):i.removeBreakpoint(a)};c.addListener(l),o.push(()=>c.removeListener(l))}),Pt(i,i.nodes.root,[e],s,r),()=>o.forEach(a=>{a()})},ie=(i,t)=>({id:i.id,type:i.type,name:i.name,branch:t||"default"}),as=(i,t,e,s=pt(),n={})=>i.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new tt(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const l=a[c.id];return l?Promise.resolve(l.controller):et.getInstance(i).then(d=>new he(d,c,s))};r.events.subscribe("components:node-enter",(c,{node:l})=>{o.match(l)&&h(l).then(d=>{Promise.resolve(e(d)).then(u=>{a[l.id]={dispose:u,controller:d}})})}),r.events.subscribe("components:node-exit",(c,{node:l})=>{const d=a[l.id];d&&(d.dispose&&d.dispose(),n.reuseController||(d.controller.dispose(),delete a[l.id]))})});class Oi{constructor(t){this.aliases=new Map,this.components=new Map,this.logger=new b;const{events:e}=t.get("$widget");this.events=e}getComponent(t){const e=this.aliases.get(t),s=this.components.get(e||t)||null;return process.env.NODE_ENV!=="production"&&(s||this.logger.warn(e||t,`Unable to resolve component: "${e||t}". You most likely forgot to register the required plugin for: ${e||t}.`)),s}registerComponent(t,e){return this.components.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.components.delete(t)}}registerResolver(t,e){return this.events.subscribe("component-resolver:resolve",(s,n)=>{if(n===t){const r=this.getComponent(t);e(r)}})}registerAlias(t,e){return this.aliases.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.aliases.delete(t)}}}const cs="#____version____#",hs=class extends es{constructor(t,e=[]){super(t,e,{transformPluginSettings:(s,n,r)=>{const o=r.get("$settings");return{...o.plugins&&n?o.plugins[n]||{}:{},...s}}})}createImplementation(t){const e=super.createImplementation(t);return e.bindings=t.bindings,e}navigate(t,e,s){this.widgets.query(t).forEach(n=>n.invoke("navigate",{route:e,params:s}))}static create(t={}){const e=[Vs].concat(t.configurationApiExtensions||[]);return new hs("humany",e)}static createFromGlobal(t,e={}){if(this.isRuntime(t))return t.patch(e),t;const s=[],n=t&&t._c;n&&n.forEach(o=>s.push(o));const r=this.create(e);return r.container.register("$runtimecfg",s),r}static isRuntime(t){return!!(t&&typeof t=="object"&&t.container&&typeof t.container.get=="function"&&t.container.get("$environment")===t&&t.container.owner===t)}};let ls=hs;ls.version=`${cs} (${ce})`;var _=(i=>(i.open="open",i.closed="closed",i.hidden="hidden",i))(_||{});const le=Object.freeze(Object.defineProperty({__proto__:null,ActionResolver:vi,ActionsController:Lt,ComponentNode:se,ComponentNodeController:he,ComponentPlatform:et,ComponentQuery:tt,ComponentResolver:Oi,Environment:ls,WidgetRenderState:_,asDescriptor:ie,createChildren:Pt,createComponentModel:os,createEventSubscriber:is,extendComponent:as,findComponent:rs,findVisibleComponents:_t,traverseComponents:It,version:cs},Symbol.toStringTag,{value:"Module"}));var f=(i=>(i.Cookie="cookie",i.Local="local",i.Session="session",i))(f||{}),st=(i=>(i.Tenant="tenant",i.Implementation="implementation",i.Widget="widget",i))(st||{}),m=(i=>(i.Necessary="necessary",i.Functional="functional",i.Analytical="analytical",i.Marketing="marketing",i))(m||{});const I=(i,t,e,s={})=>Me(i,e).then(n=>(process.env.NODE_ENV!=="production"&&n&&b.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
3
+ `)}`),o.forEach(a=>{const h=r.get(a);a.parent&&a.parent.type==="root"&&this.events.dispatch("components:root-children-changed",{node:a}),h!=null&&h.context&&this.events.dispatch("components:context-changed",{node:a}),h!=null&&h.properties&&this.events.dispatch("components:properties-changed",{node:a}),h!=null&&h.layout&&this.events.dispatch("components:layout-changed",{node:a})}),this.events.dispatch("components:component-model-initialized",{},{bubbles:!0})});Promise.all(Object.keys(e).map(r=>e[r].load(this))),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{const{node:a}=o;this.changesets.forEach(h=>{const{changeset:c,target:l,removes:d}=h,[u,p]=c;l.match(o.node)&&(u.properties&&d.push(a.writeProperties(u.properties,p)),u.context&&d.push(a.writeContext(u.context,p)),u.layout&&d.push(a.writeLayout(u.layout,p)))})})),this.subscriptions.push(this.events.subscribe("components:node-appended",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{n(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{n(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{n(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{n(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{n(o,{properties:!0})})),this.events.parent&&this.events.parent.dispatch("components:platform-created",{platform:this})}static getInstance(t){return t.getAsync("components")}addBreakpoint(t){this.breakpoints.indexOf(t)===-1&&(this.breakpoints.push(t),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}removeBreakpoint(t){const e=this.breakpoints.indexOf(t);e>-1&&(this.breakpoints.splice(e,1),this.processNode(this.nodes.root,{context:!0,properties:!0,layout:!0,recursive:!0}))}setSwitch(t,e){this.switches[t.id]=e,this.events.dispatch("components:node-switched",{node:t,branch:e})}getBranch(t){return this.switches[t.id]}createNode(t,e={}){const s=new se(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new tt(this)}actions(t,e){return new Lt(this,t,e)}write(t){const{provider:e,target:s,attributes:n,options:r={},removable:o}=t,a=t.key||pt(),h={changeset:[n,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,n,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};n.properties&&(l=c.writeProperties(n.properties,r,o)),n.context&&(l=c.writeContext(n.context,r,o)),n.layout&&(l=c.writeContext(n.layout,r,o)),h.removes.push(l)}}),()=>{if(o){h.removes.forEach(l=>l());const c=this.changesets.indexOf(h);c>-1&&this.changesets.splice(c,1)}}}addComponentHandler(t,e){this.customComponentHandler.add(t,e)}getComponentHandler(t){return this.customComponentHandler.get(t)}dispose(){this.subscriptions.forEach(t=>t())}}const Ci=i=>{if(Array.isArray(i)){const[t,...e]=i;return{definitionId:t,overrides:e}}return{definitionId:i,overrides:[]}},Pt=(i,t,e,s,n,r)=>{e.forEach(o=>{const a=Ci(o),h=s[a.definitionId];if(a.definitionId==="view"){const c=i.createNode("view");c.name="view",Object.keys(n).forEach(l=>{const d=n[l];Pt(i,c,[d.entry],s,n,l)}),t.appendChild(c),a.overrides.forEach(l=>{l.properties&&c.writeProperties(l.properties,{breakpoints:l.breakpoints}),l.context&&c.writeContext(l.context,{breakpoints:l.breakpoints}),l.layout&&c.writeLayout(l.layout,{breakpoints:l.breakpoints})})}else if(i.getComponentHandler(h.type)){const c=i.getComponentHandler(h.type);c&&c(a,{platform:i,node:t,references:e,definitions:s,views:n,branch:r})}else{const c=s[a.definitionId];if(process.env.NODE_ENV!=="production"&&!c){b.error(`No definition found for component type '${a.definitionId}'.`);return}const l=i.createNode(c.type);l.name=a.definitionId,l.tags=c.tags||[],c.properties&&l.writeProperties(c.properties),c.context&&l.writeContext(c.context),c.layout&&l.writeLayout(c.layout),t.appendChild(l,r),a.overrides.forEach(d=>{const u={breakpoints:d.breakpoints};d.properties&&l.writeProperties(d.properties,u),d.context&&l.writeContext(d.context,u),d.layout&&l.writeLayout(d.layout,u)}),c.children&&Pt(i,l,c.children,s,n)}})},as=(i,t)=>{const{entry:e,components:s,breakpoints:n,views:r}=t,o=[];return Object.keys(n).forEach(a=>{const h=n[a],c=window.matchMedia(h);c.matches&&i.breakpoints.push(a);const l=d=>{d.matches?i.addBreakpoint(a):i.removeBreakpoint(a)};c.addListener(l),o.push(()=>c.removeListener(l))}),Pt(i,i.nodes.root,[e],s,r),()=>o.forEach(a=>{a()})},ie=(i,t)=>({id:i.id,type:i.type,name:i.name,branch:t||"default"}),cs=(i,t,e,s=pt(),n={})=>i.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new tt(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const l=a[c.id];return l?Promise.resolve(l.controller):et.getInstance(i).then(d=>new he(d,c,s))};r.events.subscribe("components:node-enter",(c,{node:l})=>{o.match(l)&&h(l).then(d=>{Promise.resolve(e(d)).then(u=>{a[l.id]={dispose:u,controller:d}})})}),r.events.subscribe("components:node-exit",(c,{node:l})=>{const d=a[l.id];d&&(d.dispose&&d.dispose(),n.reuseController||(d.controller.dispose(),delete a[l.id]))})});class Oi{constructor(t){this.aliases=new Map,this.components=new Map,this.logger=new b;const{events:e}=t.get("$widget");this.events=e}getComponent(t){const e=this.aliases.get(t),s=this.components.get(e||t)||null;return process.env.NODE_ENV!=="production"&&(s||this.logger.warn(e||t,`Unable to resolve component: "${e||t}". You most likely forgot to register the required plugin for: ${e||t}.`)),s}registerComponent(t,e){return this.components.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.components.delete(t)}}registerResolver(t,e){return this.events.subscribe("component-resolver:resolve",(s,n)=>{if(n===t){const r=this.getComponent(t);e(r)}})}registerAlias(t,e){return this.aliases.set(t,e),this.events.dispatch("component-resolver:resolve",t),()=>{this.aliases.delete(t)}}}const hs="#____version____#",ls=class extends ss{constructor(t,e=[]){super(t,e,{transformPluginSettings:(s,n,r)=>{const o=r.get("$settings");return{...o.plugins&&n?o.plugins[n]||{}:{},...s}}})}createImplementation(t){const e=super.createImplementation(t);return e.bindings=t.bindings,e}navigate(t,e,s){this.widgets.query(t).forEach(n=>n.invoke("navigate",{route:e,params:s}))}static create(t={}){const e=[Vs].concat(t.configurationApiExtensions||[]);return new ls("humany",e)}static createFromGlobal(t,e={}){if(this.isRuntime(t))return t.patch(e),t;const s=[],n=t&&t._c;n&&n.forEach(o=>s.push(o));const r=this.create(e);return r.container.register("$runtimecfg",s),r}static isRuntime(t){return!!(t&&typeof t=="object"&&t.container&&typeof t.container.get=="function"&&t.container.get("$environment")===t&&t.container.owner===t)}};let ds=ls;ds.version=`${hs} (${ce})`;var _=(i=>(i.open="open",i.closed="closed",i.hidden="hidden",i))(_||{});const le=Object.freeze(Object.defineProperty({__proto__:null,ActionResolver:vi,ActionsController:Lt,ComponentNode:se,ComponentNodeController:he,ComponentPlatform:et,ComponentQuery:tt,ComponentResolver:Oi,Environment:ds,WidgetRenderState:_,asDescriptor:ie,createChildren:Pt,createComponentModel:as,createEventSubscriber:ns,extendComponent:cs,findComponent:os,findVisibleComponents:_t,traverseComponents:It,version:hs},Symbol.toStringTag,{value:"Module"}));var f=(i=>(i.Cookie="cookie",i.Local="local",i.Session="session",i))(f||{}),st=(i=>(i.Tenant="tenant",i.Implementation="implementation",i.Widget="widget",i))(st||{}),m=(i=>(i.Necessary="necessary",i.Functional="functional",i.Analytical="analytical",i.Marketing="marketing",i))(m||{});const I=(i,t,e,s={})=>De(i,e).then(n=>(process.env.NODE_ENV!=="production"&&n&&b.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
4
4
  Key: ${t}
5
5
  Category: ${JSON.stringify(e)}
6
- Options: ${JSON.stringify(s)}`),r=>(pe(i),Me(i,e).then(o=>{if(o){process.env.NODE_ENV!=="production"&&b.warn(`storageWriter: Attempted to write to storage using unallowed category.
6
+ Options: ${JSON.stringify(s)}`),r=>(pe(i),De(i,e).then(o=>{if(o){process.env.NODE_ENV!=="production"&&b.warn(`storageWriter: Attempted to write to storage using unallowed category.
7
7
  Key: ${t}
8
8
  Category: ${JSON.stringify(e)}
9
9
  Value: ${JSON.stringify(r)}
10
- Options: ${JSON.stringify(s)}`);return}const{scope:a=st.Widget,medium:h=f.Session,duration:c}=s,l=Si();return l[a][t]=ue(r,e,c),h===f.Cookie?Di(i,l):Ii(i,h,l)})))),D=(i,t,e=f.Session)=>(pe(i),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===f.Cookie?Mi(i).then(s=>kt(s,t)):Li(i,e).then(s=>kt(s,t))),G=i=>!!Object.entries(i).filter(([t,e])=>typeof e<"u").length,Ft=i=>Object.entries(i).filter(([t,e])=>typeof e<"u").forEach(([t,{value:e}])=>{typeof e>"u"&&delete i[t]}),ds=(i,t)=>{const e={tenant:{...i.tenant,...t.tenant},implementation:{...i.implementation,...t.implementation},widget:{...i.widget,...t.widget}};return Ft(e.tenant),Ft(e.implementation),Ft(e.widget),e},Pi=i=>Object.entries(i).reduce((t,e)=>{const[s,n]=e;return Object.entries(n).forEach(r=>{const[o,{expiration:a}]=r;a&&t.push(a)}),t},[]).slice().sort((t,e)=>new Date(e).valueOf()-new Date(t).valueOf()).shift()||Rt(),Tt=i=>{const{name:t,implementation:{name:e,tenant:s}}=i.get("$widget");return[`humany_${s}`,`humany_${Ne(s+e)}`,`humany_${Ne(s+e+t)}`]},Kt=i=>{const t=new RegExp(`(?:^|;)\\s?${i}=(.*?)(?:;|$)`,"i"),e=document.cookie.match(t);return e&&e[1]&&JSON.parse(e[1])||void 0},Gt=(i,t,e)=>{const s=`${i}=${JSON.stringify(t).trim()}`,n=`expires=${new Date(e).toUTCString()}`,r="path=/",o="SameSite=None;Secure";return document.cookie=`${s}; ${n}; ${r}; ${o}`},de=i=>{const[t,e,s]=Tt(i),n=Kt(t)||{},r=Kt(e)||{},o=Kt(s)||{};return{tenant:n,implementation:r,widget:o}},us=(i,t)=>{const e=de(i),s=ds(e,t),[n,r,o]=Tt(i),{tenant:a,implementation:h,widget:c}=s,l=Pi(t),d=Rt({days:-1});Gt(n,a,G(a)?l:d),Gt(r,h,G(h)?l:d),Gt(o,c,G(c)?l:d)},St=(i,t)=>{const[e,s,n]=Tt(i),r=t.getItem(e)||"{}",o=t.getItem(s)||"{}",a=t.getItem(n)||"{}";return{tenant:JSON.parse(r),implementation:JSON.parse(o),widget:JSON.parse(a)}},ne=(i,t,e)=>{const s=St(i,t),n=ds(s,e),[r,o,a]=Tt(i),{tenant:h,implementation:c,widget:l}=n;G(h)?t.setItem(r,JSON.stringify(h)):t.removeItem(r),G(c)?t.setItem(o,JSON.stringify(c)):t.removeItem(o),G(l)?t.setItem(a,JSON.stringify(l)):t.removeItem(a)},Si=()=>({tenant:{},implementation:{},widget:{}}),ki=i=>i?!!i&&new Date>new Date(i):!1,kt=(i,t)=>{const e=i.widget[t]||i.implementation[t]||i.tenant[t];return e==null?void 0:e.value},ue=(i,t,e)=>e?{value:i,category:t,expiration:typeof e=="object"?Rt(e):e}:{value:i,category:t},Et=(i,t)=>{const e=ss(i);return Object.entries(e).forEach(([s,n])=>{Object.entries(n).forEach(([r,o])=>{const{expiration:a,category:h}=o;(ki(a)||Ni(t,h))&&(n[r]=ue(void 0,h,a))})}),e},Me=(i,t)=>D(i,"storagePolicy",f.Cookie).then((e=[m.Necessary])=>!!t&&e.indexOf(t)===-1),Ni=(i=[m.Necessary],t)=>!!t&&i.indexOf(t)===-1,pe=i=>{const t=de(i),e=St(i,window.localStorage),s=St(i,sessionStorage),n=kt(t,"storagePolicy"),[r,o,a]=[t,e,s].map(h=>Et(h,n));us(i,r),ne(i,window.localStorage,o),ne(i,window.sessionStorage,a)},Rt=(i={days:30})=>{const{days:t=0,hours:e=0,minutes:s=0,seconds:n=0}=i,r=new Date;return r.setTime(r.getTime()+e*60*60*1e3),r.setTime(r.getTime()+t*24*60*60*1e3),r.setTime(r.getTime()+s*60*1e3),r.setTime(r.getTime()+n*1e3),r.toISOString()},Mi=i=>P(document)(()=>de(i)),Di=(i,t)=>P(document)(()=>us(i,t)),Li=(i,t)=>{const e=t===f.Local?window.localStorage:window.sessionStorage;return P(e)(()=>St(i,e))},Ii=(i,t,e)=>{const s=t===f.Local?window.localStorage:window.sessionStorage;return P(s)(()=>ne(i,s,e))};let At=class{constructor(){this.memory={tenant:{},implementation:{},widget:{}}}async setItem(t,e,s={}){return P(this)(()=>{const n=Et(this.memory,[m.Necessary]),{scope:r=st.Tenant,expiration:o}=s;n[r][t]=ue(e,m.Necessary,(o==null?void 0:o.toISOString())||Rt()),this.memory=n,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
10
+ Options: ${JSON.stringify(s)}`);return}const{scope:a=st.Widget,medium:h=f.Session,duration:c}=s,l=Si();return l[a][t]=ue(r,e,c),h===f.Cookie?Di(i,l):Ii(i,h,l)})))),D=(i,t,e=f.Session)=>(pe(i),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===f.Cookie?Mi(i).then(s=>kt(s,t)):Li(i,e).then(s=>kt(s,t))),G=i=>!!Object.entries(i).filter(([t,e])=>typeof e<"u").length,Ft=i=>Object.entries(i).filter(([t,e])=>typeof e<"u").forEach(([t,{value:e}])=>{typeof e>"u"&&delete i[t]}),us=(i,t)=>{const e={tenant:{...i.tenant,...t.tenant},implementation:{...i.implementation,...t.implementation},widget:{...i.widget,...t.widget}};return Ft(e.tenant),Ft(e.implementation),Ft(e.widget),e},Pi=i=>Object.entries(i).reduce((t,e)=>{const[s,n]=e;return Object.entries(n).forEach(r=>{const[o,{expiration:a}]=r;a&&t.push(a)}),t},[]).slice().sort((t,e)=>new Date(e).valueOf()-new Date(t).valueOf()).shift()||Rt(),Tt=i=>{const{name:t,implementation:{name:e,tenant:s}}=i.get("$widget");return[`humany_${s}`,`humany_${Me(s+e)}`,`humany_${Me(s+e+t)}`]},Kt=i=>{const t=new RegExp(`(?:^|;)\\s?${i}=(.*?)(?:;|$)`,"i"),e=document.cookie.match(t);return e&&e[1]&&JSON.parse(e[1])||void 0},Gt=(i,t,e)=>{const s=`${i}=${JSON.stringify(t).trim()}`,n=`expires=${new Date(e).toUTCString()}`,r="path=/",o="SameSite=None;Secure";return document.cookie=`${s}; ${n}; ${r}; ${o}`},de=i=>{const[t,e,s]=Tt(i),n=Kt(t)||{},r=Kt(e)||{},o=Kt(s)||{};return{tenant:n,implementation:r,widget:o}},ps=(i,t)=>{const e=de(i),s=us(e,t),[n,r,o]=Tt(i),{tenant:a,implementation:h,widget:c}=s,l=Pi(t),d=Rt({days:-1});Gt(n,a,G(a)?l:d),Gt(r,h,G(h)?l:d),Gt(o,c,G(c)?l:d)},St=(i,t)=>{const[e,s,n]=Tt(i),r=t.getItem(e)||"{}",o=t.getItem(s)||"{}",a=t.getItem(n)||"{}";return{tenant:JSON.parse(r),implementation:JSON.parse(o),widget:JSON.parse(a)}},ne=(i,t,e)=>{const s=St(i,t),n=us(s,e),[r,o,a]=Tt(i),{tenant:h,implementation:c,widget:l}=n;G(h)?t.setItem(r,JSON.stringify(h)):t.removeItem(r),G(c)?t.setItem(o,JSON.stringify(c)):t.removeItem(o),G(l)?t.setItem(a,JSON.stringify(l)):t.removeItem(a)},Si=()=>({tenant:{},implementation:{},widget:{}}),ki=i=>i?!!i&&new Date>new Date(i):!1,kt=(i,t)=>{const e=i.widget[t]||i.implementation[t]||i.tenant[t];return e==null?void 0:e.value},ue=(i,t,e)=>e?{value:i,category:t,expiration:typeof e=="object"?Rt(e):e}:{value:i,category:t},Et=(i,t)=>{const e=is(i);return Object.entries(e).forEach(([s,n])=>{Object.entries(n).forEach(([r,o])=>{const{expiration:a,category:h}=o;(ki(a)||Ni(t,h))&&(n[r]=ue(void 0,h,a))})}),e},De=(i,t)=>D(i,"storagePolicy",f.Cookie).then((e=[m.Necessary])=>!!t&&e.indexOf(t)===-1),Ni=(i=[m.Necessary],t)=>!!t&&i.indexOf(t)===-1,pe=i=>{const t=de(i),e=St(i,window.localStorage),s=St(i,sessionStorage),n=kt(t,"storagePolicy"),[r,o,a]=[t,e,s].map(h=>Et(h,n));ps(i,r),ne(i,window.localStorage,o),ne(i,window.sessionStorage,a)},Rt=(i={days:30})=>{const{days:t=0,hours:e=0,minutes:s=0,seconds:n=0}=i,r=new Date;return r.setTime(r.getTime()+e*60*60*1e3),r.setTime(r.getTime()+t*24*60*60*1e3),r.setTime(r.getTime()+s*60*1e3),r.setTime(r.getTime()+n*1e3),r.toISOString()},Mi=i=>P(document)(()=>de(i)),Di=(i,t)=>P(document)(()=>ps(i,t)),Li=(i,t)=>{const e=t===f.Local?window.localStorage:window.sessionStorage;return P(e)(()=>St(i,e))},Ii=(i,t,e)=>{const s=t===f.Local?window.localStorage:window.sessionStorage;return P(s)(()=>ne(i,s,e))};let At=class{constructor(){this.memory={tenant:{},implementation:{},widget:{}}}async setItem(t,e,s={}){return P(this)(()=>{const n=Et(this.memory,[m.Necessary]),{scope:r=st.Tenant,expiration:o}=s;n[r][t]=ue(e,m.Necessary,(o==null?void 0:o.toISOString())||Rt()),this.memory=n,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
11
11
  Key: ${t}
12
12
  Value: ${JSON.stringify(e)}
13
13
  Options: ${JSON.stringify(s)}
@@ -18,25 +18,25 @@
18
18
  Memory: ${JSON.stringify(e)}`)})}async clear(){return Promise.resolve()}},Ti=class{constructor(){this.cookies=new At,this.session=new At,this.local=new At}};ae(i=>{i.createCommand("storage",t=>(e={})=>{const{consent:s}=e;if(typeof s<"u"){if(typeof s!="number"&&typeof s!="string"&&!Array.isArray(s)){process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
19
19
  Passed consent: ${JSON.stringify(s)}`);return}if(Array.isArray(s)&&!s.every(r=>typeof r=="number"||typeof r=="string")){process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent is not valid. Consent either has to be a number, a string, an array of strings or an array of numbers.
20
20
  Passed consent: ${JSON.stringify(s)}`);return}const n=[m.Necessary,m.Functional,m.Analytical,m.Marketing].filter((r,o,a)=>typeof s=="number"?s>o:typeof s=="string"?a.indexOf(s)+1>o:Array.isArray(s)?s.findIndex(h=>h===o+1||h===r)>-1:!0);return n.indexOf(m.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent does not include category: '${m.Necessary}'. Consent has to atleast include the '${m.Necessary}' category.
21
- Passed consent: ${JSON.stringify(s)}`),n.unshift(m.Necessary)),I(t.container,"storagePolicy",m.Necessary,{medium:f.Cookie,scope:st.Tenant,duration:{days:365}}).then(r=>r(n)).then(()=>{pe(t.container),t.events.dispatch("storage:policy-changed",n)})}})});const Ri=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:m,StorageMedium:f,StorageProvider:Ti,StorageScope:st,StorageService:At,createStorageWriter:I,readStorage:D},Symbol.toStringTag,{value:"Module"})),ji=i=>{const t=(n,r)=>{n&&(r?n.classList.add("ace-tabbing"):n.classList.remove("ace-tabbing"))},e=n=>{n.key==="Tab"?t(i,!0):n.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")||t(i,!1)},s=n=>{document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")&&document.activeElement.classList.contains("ace-tabbing")||t(i,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",s),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",s)}};function Ui(i,t){const{widgetName:e,label:s="",ariaLabel:n="",tooltip:r=""}=t;return i.classList.add("ace-widget-trigger"),i.classList.add(`ace-widget_${e}`),s.length&&i.classList.add("trigger-has-text"),n.length&&!i.getAttribute("aria-label")&&i.setAttribute("aria-label",n),n.length&&!i.getAttribute("tabindex")&&i.setAttribute("tabindex","0"),r.length&&!i.getAttribute("title")&&i.setAttribute("title",r),ji(i)}function Vi(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.remove("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.remove("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}function zi(i){i instanceof HTMLElement?(i.classList.remove("ace-trigger-active"),i.classList.add("ace-trigger-loading")):i instanceof Array&&i.forEach(t=>{t.classList.remove("ace-trigger-active"),t.classList.add("ace-trigger-loading")})}function ps(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.add("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.add("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}/**
21
+ Passed consent: ${JSON.stringify(s)}`),n.unshift(m.Necessary)),I(t.container,"storagePolicy",m.Necessary,{medium:f.Cookie,scope:st.Tenant,duration:{days:365}}).then(r=>r(n)).then(()=>{pe(t.container),t.events.dispatch("storage:policy-changed",n)})}})});const Ri=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:m,StorageMedium:f,StorageProvider:Ti,StorageScope:st,StorageService:At,createStorageWriter:I,readStorage:D},Symbol.toStringTag,{value:"Module"})),Ui=i=>{const t=(n,r)=>{n&&(r?n.classList.add("ace-tabbing"):n.classList.remove("ace-tabbing"))},e=n=>{n.key==="Tab"?t(i,!0):n.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")||t(i,!1)},s=n=>{document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")&&document.activeElement.classList.contains("ace-tabbing")||t(i,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",s),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",s)}};function ji(i,t){const{widgetName:e,label:s="",ariaLabel:n="",tooltip:r=""}=t;return i.classList.add("ace-widget-trigger"),i.classList.add(`ace-widget_${e}`),s.length&&i.classList.add("trigger-has-text"),n.length&&!i.getAttribute("aria-label")&&i.setAttribute("aria-label",n),n.length&&!i.getAttribute("tabindex")&&i.setAttribute("tabindex","0"),r.length&&!i.getAttribute("title")&&i.setAttribute("title",r),Ui(i)}function Vi(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.remove("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.remove("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}function zi(i){i instanceof HTMLElement?(i.classList.remove("ace-trigger-active"),i.classList.add("ace-trigger-loading")):i instanceof Array&&i.forEach(t=>{t.classList.remove("ace-trigger-active"),t.classList.add("ace-trigger-loading")})}function gs(i,t){i instanceof HTMLElement?(t&&i.setAttribute("title",t),i.classList.add("ace-trigger-active"),i.classList.remove("ace-trigger-loading")):i instanceof Array&&i.forEach(e=>{t&&e.setAttribute("title",t),e.classList.add("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}/**
22
22
  * @license
23
23
  * Copyright 2019 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
25
- */const xt=globalThis,ge=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,me=Symbol(),De=new WeakMap;let gs=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==me)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ge&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=De.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&De.set(e,t))}return t}toString(){return this.cssText}};const Hi=i=>new gs(typeof i=="string"?i:i+"",void 0,me),fe=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1],i[0]);return new gs(e,i,me)},Wi=(i,t)=>{if(ge)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),n=xt.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},Le=ge?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Hi(e)})(i):i;/**
25
+ */const xt=globalThis,ge=xt.ShadowRoot&&(xt.ShadyCSS===void 0||xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,me=Symbol(),Le=new WeakMap;let ms=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==me)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(ge&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Le.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Le.set(e,t))}return t}toString(){return this.cssText}};const Hi=i=>new ms(typeof i=="string"?i:i+"",void 0,me),fe=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,n,r)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[r+1],i[0]);return new ms(e,i,me)},Wi=(i,t)=>{if(ge)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),n=xt.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)}},Ie=ge?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Hi(e)})(i):i;/**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */const{is:Bi,defineProperty:qi,getOwnPropertyDescriptor:Ji,getOwnPropertyNames:Fi,getOwnPropertySymbols:Ki,getPrototypeOf:Gi}=Object,j=globalThis,Ie=j.trustedTypes,Yi=Ie?Ie.emptyScript:"",Yt=j.reactiveElementPolyfillSupport,at=(i,t)=>i,Nt={toAttribute(i,t){switch(t){case Boolean:i=i?Yi:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ve=(i,t)=>!Bi(i,t),Te={attribute:!0,type:String,converter:Nt,reflect:!1,hasChanged:ve};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),j.litPropertyMetadata??(j.litPropertyMetadata=new WeakMap);class J extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Te){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&qi(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:r}=Ji(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Te}static _$Ei(){if(this.hasOwnProperty(at("elementProperties")))return;const t=Gi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(at("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(at("properties"))){const e=this.properties,s=[...Fi(e),...Ki(e)];for(const n of s)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(Le(n))}else t!==void 0&&e.push(Le(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wi(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:Nt).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const o=s.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Nt;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??ve)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(e)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var n;return(n=s.hostUpdated)==null?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}J.elementStyles=[],J.shadowRootOptions={mode:"open"},J[at("elementProperties")]=new Map,J[at("finalized")]=new Map,Yt==null||Yt({ReactiveElement:J}),(j.reactiveElementVersions??(j.reactiveElementVersions=[])).push("2.0.4");/**
29
+ */const{is:Bi,defineProperty:qi,getOwnPropertyDescriptor:Ji,getOwnPropertyNames:Fi,getOwnPropertySymbols:Ki,getPrototypeOf:Gi}=Object,U=globalThis,Te=U.trustedTypes,Yi=Te?Te.emptyScript:"",Yt=U.reactiveElementPolyfillSupport,at=(i,t)=>i,Nt={toAttribute(i,t){switch(t){case Boolean:i=i?Yi:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ve=(i,t)=>!Bi(i,t),Re={attribute:!0,type:String,converter:Nt,reflect:!1,hasChanged:ve};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),U.litPropertyMetadata??(U.litPropertyMetadata=new WeakMap);class J extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Re){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),n=this.getPropertyDescriptor(t,s,e);n!==void 0&&qi(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){const{get:n,set:r}=Ji(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return n==null?void 0:n.call(this)},set(o){const a=n==null?void 0:n.call(this);r.call(this,o),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Re}static _$Ei(){if(this.hasOwnProperty(at("elementProperties")))return;const t=Gi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(at("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(at("properties"))){const e=this.properties,s=[...Fi(e),...Ki(e)];for(const n of s)this.createProperty(n,e[n])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,n]of e)this.elementProperties.set(s,n)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const n=this._$Eu(e,s);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const n of s)e.unshift(Ie(n))}else t!==void 0&&e.push(Ie(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wi(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var r;const s=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,s);if(n!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:Nt).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(t,e){var r;const s=this.constructor,n=s._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const o=s.getPropertyOptions(n),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Nt;this._$Em=n,this[n]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??ve)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,o]of n)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(n=>{var r;return(r=n.hostUpdate)==null?void 0:r.call(n)}),this.update(e)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var n;return(n=s.hostUpdated)==null?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}J.elementStyles=[],J.shadowRootOptions={mode:"open"},J[at("elementProperties")]=new Map,J[at("finalized")]=new Map,Yt==null||Yt({ReactiveElement:J}),(U.reactiveElementVersions??(U.reactiveElementVersions=[])).push("2.0.4");/**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */const ct=globalThis,Mt=ct.trustedTypes,Re=Mt?Mt.createPolicy("lit-html",{createHTML:i=>i}):void 0,ms="$lit$",T=`lit$${(Math.random()+"").slice(9)}$`,fs="?"+T,Qi=`<${fs}>`,B=document,lt=()=>B.createComment(""),dt=i=>i===null||typeof i!="object"&&typeof i!="function",vs=Array.isArray,Zi=i=>vs(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Qt=`[
34
- \f\r]`,nt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,je=/-->/g,Ue=/>/g,V=RegExp(`>|${Qt}(?:([^\\s"'>=/]+)(${Qt}*=${Qt}*(?:[^
35
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ve=/'/g,ze=/"/g,ys=/^(?:script|style|textarea|title)$/i,Xi=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),ot=Xi(1),U=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),He=new WeakMap,H=B.createTreeWalker(B,129);function bs(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Re!==void 0?Re.createHTML(t):t}const tn=(i,t)=>{const e=i.length-1,s=[];let n,r=t===2?"<svg>":"",o=nt;for(let a=0;a<e;a++){const h=i[a];let c,l,d=-1,u=0;for(;u<h.length&&(o.lastIndex=u,l=o.exec(h),l!==null);)u=o.lastIndex,o===nt?l[1]==="!--"?o=je:l[1]!==void 0?o=Ue:l[2]!==void 0?(ys.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=V):l[3]!==void 0&&(o=V):o===V?l[0]===">"?(o=n??nt,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?V:l[3]==='"'?ze:Ve):o===ze||o===Ve?o=V:o===je||o===Ue?o=nt:(o=V,n=void 0);const p=o===V&&i[a+1].startsWith("/>")?" ":"";r+=o===nt?h+Qi:d>=0?(s.push(c),h.slice(0,d)+ms+h.slice(d)+T+p):h+T+(d===-2?a:p)}return[bs(i,r+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};class ut{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,l]=tn(t,e);if(this.el=ut.createElement(c,s),H.currentNode=this.el.content,e===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(n=H.nextNode())!==null&&h.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const d of n.getAttributeNames())if(d.endsWith(ms)){const u=l[o++],p=n.getAttribute(d).split(T),g=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?sn:g[1]==="?"?nn:g[1]==="@"?rn:jt}),n.removeAttribute(d)}else d.startsWith(T)&&(h.push({type:6,index:r}),n.removeAttribute(d));if(ys.test(n.tagName)){const d=n.textContent.split(T),u=d.length-1;if(u>0){n.textContent=Mt?Mt.emptyScript:"";for(let p=0;p<u;p++)n.append(d[p],lt()),H.nextNode(),h.push({type:2,index:++r});n.append(d[u],lt())}}}else if(n.nodeType===8)if(n.data===fs)h.push({type:2,index:r});else{let d=-1;for(;(d=n.data.indexOf(T,d+1))!==-1;)h.push({type:7,index:r}),d+=T.length-1}r++}}static createElement(t,e){const s=B.createElement("template");return s.innerHTML=t,s}}function Q(i,t,e=i,s){var o,a;if(t===U)return t;let n=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=dt(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=n:e._$Cl=n),n!==void 0&&(t=Q(i,n._$AS(i,t.values),n,s)),t}class en{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=((t==null?void 0:t.creationScope)??B).importNode(e,!0);H.currentNode=n;let r=H.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new gt(r,r.nextSibling,this,t):h.type===1?c=new h.ctor(r,h.name,h.strings,this,t):h.type===6&&(c=new on(r,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(r=H.nextNode(),o++)}return H.currentNode=B,n}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class gt{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),dt(t)?t===v||t==null||t===""?(this._$AH!==v&&this._$AR(),this._$AH=v):t!==this._$AH&&t!==U&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Zi(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==v&&dt(this._$AH)?this._$AA.nextSibling.data=t:this.T(B.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=ut.createElement(bs(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{const o=new en(n,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=He.get(t.strings);return e===void 0&&He.set(t.strings,e=new ut(t)),e}k(t){vs(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const r of t)n===e.length?e.push(s=new gt(this.S(lt()),this.S(lt()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class jt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=v,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=v}_$AI(t,e=this,s,n){const r=this.strings;let o=!1;if(r===void 0)t=Q(this,t,e,0),o=!dt(t)||t!==this._$AH&&t!==U,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=Q(this,a[s+h],e,h),c===U&&(c=this._$AH[h]),o||(o=!dt(c)||c!==this._$AH[h]),c===v?t=v:t!==v&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!n&&this.j(t)}j(t){t===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class sn extends jt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===v?void 0:t}}class nn extends jt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==v)}}class rn extends jt{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??v)===U)return;const s=this._$AH,n=t===v&&s!==v||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==v&&(s===v||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class on{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const Zt=ct.litHtmlPolyfillSupport;Zt==null||Zt(ut,gt),(ct.litHtmlVersions??(ct.litHtmlVersions=[])).push("3.1.2");const an=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let n=s._$litPart$;if(n===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=n=new gt(t.insertBefore(lt(),r),r,void 0,e??{})}return n._$AI(i),n};/**
33
+ */const ct=globalThis,Mt=ct.trustedTypes,Ue=Mt?Mt.createPolicy("lit-html",{createHTML:i=>i}):void 0,fs="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,vs="?"+T,Qi=`<${vs}>`,B=document,lt=()=>B.createComment(""),dt=i=>i===null||typeof i!="object"&&typeof i!="function",ye=Array.isArray,Zi=i=>ye(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Qt=`[
34
+ \f\r]`,nt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,je=/-->/g,Ve=/>/g,V=RegExp(`>|${Qt}(?:([^\\s"'>=/]+)(${Qt}*=${Qt}*(?:[^
35
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),ze=/'/g,He=/"/g,ys=/^(?:script|style|textarea|title)$/i,Xi=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),ot=Xi(1),j=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),We=new WeakMap,H=B.createTreeWalker(B,129);function bs(i,t){if(!ye(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ue!==void 0?Ue.createHTML(t):t}const tn=(i,t)=>{const e=i.length-1,s=[];let n,r=t===2?"<svg>":t===3?"<math>":"",o=nt;for(let a=0;a<e;a++){const h=i[a];let c,l,d=-1,u=0;for(;u<h.length&&(o.lastIndex=u,l=o.exec(h),l!==null);)u=o.lastIndex,o===nt?l[1]==="!--"?o=je:l[1]!==void 0?o=Ve:l[2]!==void 0?(ys.test(l[2])&&(n=RegExp("</"+l[2],"g")),o=V):l[3]!==void 0&&(o=V):o===V?l[0]===">"?(o=n??nt,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?V:l[3]==='"'?He:ze):o===He||o===ze?o=V:o===je||o===Ve?o=nt:(o=V,n=void 0);const p=o===V&&i[a+1].startsWith("/>")?" ":"";r+=o===nt?h+Qi:d>=0?(s.push(c),h.slice(0,d)+fs+h.slice(d)+T+p):h+T+(d===-2?a:p)}return[bs(i,r+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class ut{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,l]=tn(t,e);if(this.el=ut.createElement(c,s),H.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(n=H.nextNode())!==null&&h.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const d of n.getAttributeNames())if(d.endsWith(fs)){const u=l[o++],p=n.getAttribute(d).split(T),g=/([.?@])?(.*)/.exec(u);h.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?sn:g[1]==="?"?nn:g[1]==="@"?rn:Ut}),n.removeAttribute(d)}else d.startsWith(T)&&(h.push({type:6,index:r}),n.removeAttribute(d));if(ys.test(n.tagName)){const d=n.textContent.split(T),u=d.length-1;if(u>0){n.textContent=Mt?Mt.emptyScript:"";for(let p=0;p<u;p++)n.append(d[p],lt()),H.nextNode(),h.push({type:2,index:++r});n.append(d[u],lt())}}}else if(n.nodeType===8)if(n.data===vs)h.push({type:2,index:r});else{let d=-1;for(;(d=n.data.indexOf(T,d+1))!==-1;)h.push({type:7,index:r}),d+=T.length-1}r++}}static createElement(t,e){const s=B.createElement("template");return s.innerHTML=t,s}}function Q(i,t,e=i,s){var o,a;if(t===j)return t;let n=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const r=dt(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==r&&((a=n==null?void 0:n._$AO)==null||a.call(n,!1),r===void 0?n=void 0:(n=new r(i),n._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=n:e._$Cl=n),n!==void 0&&(t=Q(i,n._$AS(i,t.values),n,s)),t}class en{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=((t==null?void 0:t.creationScope)??B).importNode(e,!0);H.currentNode=n;let r=H.nextNode(),o=0,a=0,h=s[0];for(;h!==void 0;){if(o===h.index){let c;h.type===2?c=new gt(r,r.nextSibling,this,t):h.type===1?c=new h.ctor(r,h.name,h.strings,this,t):h.type===6&&(c=new on(r,this,t)),this._$AV.push(c),h=s[++a]}o!==(h==null?void 0:h.index)&&(r=H.nextNode(),o++)}return H.currentNode=B,n}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class gt{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Q(this,t,e),dt(t)?t===v||t==null||t===""?(this._$AH!==v&&this._$AR(),this._$AH=v):t!==this._$AH&&t!==j&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Zi(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==v&&dt(this._$AH)?this._$AA.nextSibling.data=t:this.T(B.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:s}=t,n=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=ut.createElement(bs(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===n)this._$AH.p(e);else{const o=new en(n,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=We.get(t.strings);return e===void 0&&We.set(t.strings,e=new ut(t)),e}k(t){ye(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const r of t)n===e.length?e.push(s=new gt(this.O(lt()),this.O(lt()),this,this.options)):s=e[n],s._$AI(r),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class Ut{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,r){this.type=1,this._$AH=v,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=v}_$AI(t,e=this,s,n){const r=this.strings;let o=!1;if(r===void 0)t=Q(this,t,e,0),o=!dt(t)||t!==this._$AH&&t!==j,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=Q(this,a[s+h],e,h),c===j&&(c=this._$AH[h]),o||(o=!dt(c)||c!==this._$AH[h]),c===v?t=v:t!==v&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!n&&this.j(t)}j(t){t===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class sn extends Ut{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===v?void 0:t}}class nn extends Ut{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==v)}}class rn extends Ut{constructor(t,e,s,n,r){super(t,e,s,n,r),this.type=5}_$AI(t,e=this){if((t=Q(this,t,e,0)??v)===j)return;const s=this._$AH,n=t===v&&s!==v||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==v&&(s===v||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class on{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const Zt=ct.litHtmlPolyfillSupport;Zt==null||Zt(ut,gt),(ct.litHtmlVersions??(ct.litHtmlVersions=[])).push("3.2.1");const an=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let n=s._$litPart$;if(n===void 0){const r=(e==null?void 0:e.renderBefore)??null;s._$litPart$=n=new gt(t.insertBefore(lt(),r),r,void 0,e??{})}return n._$AI(i),n};/**
36
36
  * @license
37
37
  * Copyright 2017 Google LLC
38
38
  * SPDX-License-Identifier: BSD-3-Clause
39
- */let Y=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=an(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return U}};var Je;Y._$litElement$=!0,Y.finalized=!0,(Je=globalThis.litElementHydrateSupport)==null||Je.call(globalThis,{LitElement:Y});const Xt=globalThis.litElementPolyfillSupport;Xt==null||Xt({LitElement:Y});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
39
+ */let Y=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=an(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return j}};var Fe;Y._$litElement$=!0,Y.finalized=!0,(Fe=globalThis.litElementHydrateSupport)==null||Fe.call(globalThis,{LitElement:Y});const Xt=globalThis.litElementPolyfillSupport;Xt==null||Xt({LitElement:Y});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
40
40
  * @license
41
41
  * Copyright 2017 Google LLC
42
42
  * SPDX-License-Identifier: BSD-3-Clause
@@ -52,7 +52,7 @@
52
52
  * @license
53
53
  * Copyright 2018 Google LLC
54
54
  * SPDX-License-Identifier: BSD-3-Clause
55
- */const ln=$s(class extends _s{constructor(i){var t;if(super(i),i.type!==ws.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return U}}),wt=(i,t,e)=>{i&&e.style.setProperty(t,i)},Es=(i,t)=>{var e,s,n,r;wt((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),wt((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),wt((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),wt((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var dn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,mt=(i,t,e,s)=>{for(var n=s>1?void 0:s?un(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&dn(t,e,n),n};class q extends Y{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var e;const t=((e=this.container)==null?void 0:e.get("$settings"))??{};t!=null&&t.branding&&Es(t.branding,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?ot`<telia-icon
55
+ */const ln=$s(class extends _s{constructor(i){var t;if(super(i),i.type!==ws.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,n;if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(t)}const e=i.element.classList;for(const r of this.st)r in t||(e.remove(r),this.st.delete(r));for(const r in t){const o=!!t[r];o===this.st.has(r)||(n=this.nt)!=null&&n.has(r)||(o?(e.add(r),this.st.add(r)):(e.remove(r),this.st.delete(r)))}return j}}),wt=(i,t,e)=>{i&&e.style.setProperty(t,i)},Es=(i,t)=>{var e,s,n,r;wt((e=i.colors)==null?void 0:e.primaryBackground,"--primary-background",t),wt((s=i.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",t),wt((n=i.colors)==null?void 0:n.secondaryBackground,"--secondary-background",t),wt((r=i.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",t)};var dn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,mt=(i,t,e,s)=>{for(var n=s>1?void 0:s?un(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&dn(t,e,n),n};class q extends Y{constructor(){super(...arguments),this.active=!1,this.loaded=!1}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(this.symbol),this.loaded=!0,this._applyBranding()}_toggleActive(){this.active=!this.active}_applyBranding(){var e;const t=((e=this.container)==null?void 0:e.get("$settings"))??{};t!=null&&t.branding&&Es(t.branding,this)}async _renderSymbol(t){const e=async s=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(r=>r[s]);if(t){const{type:s,content:n}=t;switch(s){case"Telia":{const r=await e(n);return r?ot`<telia-icon
56
56
  class="trigger-icon"
57
57
  svg=${r.svg}
58
58
  size="lg"
@@ -159,7 +159,7 @@
159
159
  align-items: center;
160
160
  fill: var(--trigger-text-color, var(--text-on-primary-background));
161
161
  }
162
- `];mt([Z({attribute:!1})],q.prototype,"symbol",2);mt([Z({attribute:!1})],q.prototype,"container",2);mt([N()],q.prototype,"active",2);mt([N()],q.prototype,"loaded",2);mt([N()],q.prototype,"icon",2);var W=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(W||{});const pn=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",As=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",gn=async(i,t,e,s,n,r=!1)=>{var l,d;const o=pn(e,s),a=As(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",q);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},mn="modals";class fn{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===W.Badge&&zi(e),Promise.resolve().then(()=>require("./render-9aea8df4.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===W.Badge){const r=this.options.triggerOptions.openTooltip;ps(e,r)}fi(this.container,t);const n=this.container.get("$environment").widgets.all();D(this.container,mn,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=Ui(e,{label:n,symbol:r,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const $t="changesets",vn=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class ye{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return I(t,$t,m.Necessary,{medium:f.Local}).then(e=>new ye(t,e))}write(t,e,s,n){return P(this)(()=>D(this.container,$t,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:vn(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return P(this)(()=>D(this.container,$t,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return P(this)(()=>D(this.container,$t,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new tt(t,a)})}})}))}}const yn=i=>{const{container:t}=i;return ye.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new et(i,n),o=os(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Ze.Deactivating&&o()}),r})},bn=i=>Promise.resolve().then(()=>Ri).then(({StorageProvider:t})=>new t),wn=i=>Promise.resolve().then(()=>le).then(({ActionResolver:t})=>new t(i)),$n=i=>Promise.resolve().then(()=>le).then(({ComponentResolver:t})=>new t(i)),_n=i=>Promise.resolve().then(()=>le).then(()=>yn(i.get("$widget"))),te="$settings",ee="open",We="activeStickyWidget";class En extends li{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>bn(this.container)),this.container.registerFactory("settings",()=>D(this.container,te,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),Us(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>$n(this.container)),this.container.registerAsync("actionResolver",()=>wn(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>_n(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=pt(),triggerDOMElement:r,withRenderState:o}=t,h=As(e)===W.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await gn(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>w.querySelectorAll("[data-loading=true]").length===0,[w]=this.widget.container.get("widgetDOMElements"),C=(Vt,E)=>{g()&&(c.callback&&c.callback(),E.disconnect())},ft={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(C).observe(w,ft)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(w,C)=>{C.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===W.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==W.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:w})=>{d.render().then(()=>this.renderState()).then(C=>w&&w.action&&w.action==="hide"?C===_.open?this.hide():this.open():C===_.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===W.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new fn(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),I(this.container,te,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return I(this.container,te,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return(()=>D(this.container,ee,f.Session).then((e=_.closed)=>e))()}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?_.open:t==="close"?_.closed:_.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===_.open),s!==_.hidden?s===_.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([I(this.container,ee,m.Necessary,{medium:f.Session}),I(this.container,ee,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return(()=>this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}))().then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?ps(s,r):Vi(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),D(this.container,We,f.Local).then(e=>e===this.widget.name?I(this.container,We,m.Necessary,{medium:f.Local,scope:st.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
162
+ `];mt([Z({attribute:!1})],q.prototype,"symbol",2);mt([Z({attribute:!1})],q.prototype,"container",2);mt([N()],q.prototype,"active",2);mt([N()],q.prototype,"loaded",2);mt([N()],q.prototype,"icon",2);var W=(i=>(i.Inline="inline",i.Link="link",i.Badge="badge",i.Unsupported="unsupported",i))(W||{});const pn=(i,t)=>i&&t?"both":i?"widgetDOM":t?"triggerDOM":"none",As=i=>i?typeof i=="boolean"&&i?"link":typeof i=="object"&&!Array.isArray(i)?"badge":"unsupported":"inline",gn=async(i,t,e,s,n,r=!1)=>{var l,d;const o=pn(e,s),a=As(n),h={widgetDOMElement:e?e.cloneNode(!0):void 0,triggerDOMElement:s?s.cloneNode(!0):void 0},c={triggerType:a,cachedOriginals:h,widgetDOMElement:document.createElement("div")};switch(o){case"both":{c.widgetDOMElement=e||document.createElement("div"),a!=="inline"&&(c.triggerDOMElement=s);break}case"widgetDOM":{if(c.widgetDOMElement=e||document.createElement("div"),a!=="inline"){const u=document.body.appendChild(document.createElement("a"));a==="link"&&(u.innerText=t),c.triggerDOMElement=u}break}case"triggerDOM":{const u=document.createElement("div");c.widgetDOMElement=u,a==="inline"?(u.id=(s==null?void 0:s.id)||"",r?(u.style.display="none",(l=s==null?void 0:s.parentNode)==null||l.appendChild(u),c.callback=()=>{var p;(p=s==null?void 0:s.parentNode)==null||p.replaceChild(u,s),u.style.display=(s==null?void 0:s.style.display)||"block"}):(d=s==null?void 0:s.parentNode)==null||d.replaceChild(u,s),c.cachedOriginals.widgetDOMElement=s,c.cachedOriginals.triggerDOMElement=void 0):(c.widgetDOMElement=document.body.appendChild(u),c.triggerDOMElement=s);break}case"none":{const u=document.body.appendChild(document.createElement("div"));if(c.widgetDOMElement=u,a!=="inline"){customElements.get("ace-widget-trigger")||customElements.define("ace-widget-trigger",q);const p=document.createElement("ace-widget-trigger");p.symbol=n.symbol,p.container=i,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},mn="modals";class fn{constructor(t,e){this.options=e,this.unsubscribe=[],this.container=t.createChild(this),this.container.register("widgetDOMElement",this.options.widgetDOMElement),this.container.register("triggerDOMElement",this.options.triggerDOMElement);const s=this.container.get("$widget");this.options.widgetDOMElement.classList.add("ace-widget"),this.options.widgetDOMElement.classList.add(`ace-widget_${s.name}`);const n=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...n,this.options.widgetDOMElement])}render(){const{widgetDOMElement:t,triggerDOMElement:e}=this.options,s=this.container.get("$widget");return t.getAttribute("data-rendered")==="true"?Promise.resolve():(e&&this.options.triggerType===W.Badge&&zi(e),Promise.resolve().then(()=>require("./render-4cd1b681.js")).then(n=>n.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===W.Badge){const r=this.options.triggerOptions.openTooltip;gs(e,r)}fi(this.container,t);const n=this.container.get("$environment").widgets.all();D(this.container,mn,f.Session).then(r=>{r&&r.forEach(o=>{n.find(a=>a.name===o.name&&a.state==="activated")&&s.events.dispatch("widget:modal-opened",o)})})}))}renderBadge(t){const{triggerDOMElement:e}=this.options;if(!e)return;e.getAttribute("role")||e.setAttribute("role","button");const{name:s}=this.container.get("$widget"),{label:n,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=ji(e,{label:n,symbol:r,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,n,r,o;const{triggerDOMElement:t,widgetDOMElement:e}=this.options;this.options.cachedOriginals.widgetDOMElement&&e&&((s=e.parentNode)==null||s.replaceChild(this.options.cachedOriginals.widgetDOMElement,e)),this.options.cachedOriginals.triggerDOMElement&&t&&((n=t.parentNode)==null||n.replaceChild(this.options.cachedOriginals.triggerDOMElement,t)),this.unsubscribe.forEach(a=>{a()}),(r=e.parentNode)==null||r.removeChild(e),(o=t==null?void 0:t.parentNode)==null||o.removeChild(t)}}const $t="changesets",vn=i=>{const t={tags:i.tags};return i.context&&typeof i.context!="function"&&(t.context=i.context),i.properties&&typeof i.properties!="function"&&(t.properties=i.properties),i.layout&&typeof i.layout!="function"&&(t.layout=i.layout),t};class be{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return I(t,$t,m.Necessary,{medium:f.Local}).then(e=>new be(t,e))}write(t,e,s,n){return P(this)(()=>D(this.container,$t,f.Local).then((r={})=>{const{keys:o=[],items:a={}}=r,h=o.indexOf(t);return h>-1&&o.splice(h,1),o.push(t),a[t]={options:n,attributes:vn(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return P(this)(()=>D(this.container,$t,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete n[t],this.storageWriter(e)}))}load(t){return P(this)(()=>D(this.container,$t,f.Local).then((e={})=>{const{keys:s=[],items:n={}}=e;s.forEach(r=>{const o=n[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new tt(t,a)})}})}))}}const yn=i=>{const{container:t}=i;return be.create(t).then(e=>{const s=t.get("$settings"),n={localStorage:e},r=new et(i,n),o=as(r,s);return i.events.subscribe("widget:state-change",(a,h)=>{h.state===Xe.Deactivating&&o()}),r})},bn=i=>Promise.resolve().then(()=>Ri).then(({StorageProvider:t})=>new t),wn=i=>Promise.resolve().then(()=>le).then(({ActionResolver:t})=>new t(i)),$n=i=>Promise.resolve().then(()=>le).then(({ComponentResolver:t})=>new t(i)),_n=i=>Promise.resolve().then(()=>le).then(()=>yn(i.get("$widget"))),te="$settings",ee="open",Be="activeStickyWidget";class En extends li{constructor(t){super(t),this.outlets=new Map,this.activated=void 0,this.subs=[],this.handleBootstrapping=e=>{const s={triggerDOMElement:e.sourceDOMElement,withRenderState:"storage"};this.container.get("settings").then(n=>{const{activate:r}=n;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>bn(this.container)),this.container.registerFactory("settings",()=>D(this.container,te,f.Local).then((e={})=>({...this.container.get("$settings"),...e}))),js(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>$n(this.container)),this.container.registerAsync("actionResolver",()=>wn(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>_n(this.container))}initialize(){const t=this.container.getManyAsync("actionResolver","components"),e=this.container.get("csp");return e&&(window.webprovisionsEnvironmentVariables||(window.webprovisionsEnvironmentVariables={}),window.webprovisionsEnvironmentVariables.cspNonce=e.nonce),Promise.all([t,this.container.get("settings")]).then(([{actionResolver:s,components:n},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{n.nodes.query({type:"view"}).forEach(c=>{n.setSwitch(c,h)})})("index"),this.events.subscribe("widget:data-loaded",(h,{element:c})=>{this.widget.container.get("seoConfiguration")&&this.events.dispatch("widget:preloaded-replaced",{element:c})}),Promise.resolve()))}attach(t={}){return this.container.get("settings").then(async({trigger:e})=>{var u,p;const{widgetDOMElement:s,key:n=pt(),triggerDOMElement:r,withRenderState:o}=t,h=As(e)===W.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await gn(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const g=()=>w.querySelectorAll("[data-loading=true]").length===0,[w]=this.widget.container.get("widgetDOMElements"),C=(Vt,E)=>{g()&&(c.callback&&c.callback(),E.disconnect())},ft={attributes:!0,subtree:!0,childList:!0};g()&&c.callback&&c.callback(),new MutationObserver(C).observe(w,ft)};h&&this.widget.container.getAsync("dataClient").then(({events:g})=>{g.subscribe("data-client:fetched",(w,C)=>{C.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(n,c);if(this.outlets.set(n,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===W.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==W.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",g=>{g.preventDefault(),this.container.get("settings").then(({trigger:w})=>{d.render().then(()=>this.renderState()).then(C=>w&&w.action&&w.action==="hide"?C===_.open?this.hide():this.open():C===_.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(g=>{this.triggerStateIfApplicable(g)});if(o)return o==="storage"?this.renderState().then(g=>{if(c.triggerType===W.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(g)}):this.triggerStateIfApplicable(o)})}detach(t){if(t){if(this.outlets.has(t)){const e=this.outlets.get(t);e==null||e.dispose(),this.outlets.delete(t);return}process.env.NODE_ENV!=="production"&&console.warn(`detach(): Could not find View Outlet with key ${t}`);return}this.outlets.forEach(e=>{e.dispose()}),this.outlets.clear()}triggerStateIfApplicable(t){switch(t){case"closed":this.close();break;case"open":this.open();break;case"hidden":this.hide();break;default:return}}getOrCreateViewOutlet(t,e){return this.outlets.has(t)?this.outlets.get(t):new fn(this.container,e)}render(t={}){if(process.env.NODE_ENV!=="production"&&console.warn("widget.render() is deprecated. Use widget.attach() instead."),t.open){const e={...t,withRenderState:"open"};return this.attach(e)}return this.attach(t)}activate(t){t!=null&&t.override&&this.setSettings(()=>t.override),t!=null&&t.apiNotificationPriorityBy&&this.container.register("apiNotificationPriorityBy",t.apiNotificationPriorityBy)}setSettings(t){return Promise.all([this.container.get("settings"),I(this.container,te,m.Necessary,{medium:f.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(n=>s(n).then(()=>{const r={...e,...n};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return I(this.container,te,m.Necessary,{medium:f.Local}).then(t=>t()).then(()=>this.container.get("settings")).then(t=>{this.widget.events.dispatch("widget:settings-updated",t)})}action({action:t,value:e}){return this.container.getAsync("actionResolver").then(s=>{s.action(this.widget.name,t,e)})}renderState(){return(()=>D(this.container,ee,f.Session).then((e=_.closed)=>e))()}hide(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("hide(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"hide"}).then(()=>{this.setTriggerState(!1)}))}open(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("open(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):(this.outlets.forEach(t=>t.render()),this.action({action:"open"}).then(()=>(this.widget.events.dispatch("tracking:widget-rendered",{}),this.onOpen())))}close(){return this.outlets.size<1?(process.env.NODE_ENV!=="production"&&console.warn("close(): No-op as no view outlets are registered. Invoke the attach() command first."),Promise.resolve()):this.action({action:"close"}).then(()=>this.onClose())}show(){return process.env.NODE_ENV!=="production"&&console.warn("show(): Command is deprecated and will be removed in the future. Use open() instead."),this.open()}onAction(t,e){switch(t){case"close":case"open":case"hide":const s=t==="open"?_.open:t==="close"?_.closed:_.hidden;return this.setRenderState(s).then(()=>{this.setTriggerState(s===_.open),s!==_.hidden?s===_.open?this.onOpen():this.onClose():this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([I(this.container,ee,m.Necessary,{medium:f.Session}),I(this.container,ee,m.Necessary,{medium:f.Local,duration:{minutes:5}}),e("renderState")]).then(([n,r,o])=>{t==="unset"||!t?(r(),n()):n(t),s.dispatch("widget:render-state-changed",{previous:o,next:t})})}onOpen(){return this.outlets.forEach(t=>{var e;return(e=t.options.triggerDOMElement)==null?void 0:e.setAttribute("aria-expanded","true")}),Promise.resolve()}onClose(){const t=this.container.getManyAsync("components");return(()=>this.container.get("settings").then(s=>{const{activate:n}=this.container.get("$settings");return s.activate!==n?this.setSettings(()=>Promise.resolve({activate:n})):Promise.resolve()}))().then(()=>t).then(({components:s})=>{this.outlets.forEach(n=>{var r;return(r=n.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:n}}=e,{openTooltip:r,closedTooltip:o}=n||{};s&&(t?gs(s,r):Vi(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),D(this.container,Be,f.Local).then(e=>e===this.widget.name?I(this.container,Be,m.Necessary,{medium:f.Local,scope:st.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
163
163
  * @license
164
164
  * Copyright 2021 Google LLC
165
165
  * SPDX-License-Identifier: BSD-3-Clause
@@ -171,7 +171,7 @@
171
171
  * @license
172
172
  * Copyright 2021 Google LLC
173
173
  * SPDX-License-Identifier: BSD-3-Clause
174
- */let Be=class{constructor(t,e,s,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const r=e;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new xs(this.context,this.t,this.subscribe))}};/**
174
+ */let qe=class{constructor(t,e,s,n){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=t,e.context!==void 0){const r=e;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=n??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new xs(this.context,this.t,this.subscribe))}};/**
175
175
  * @license
176
176
  * Copyright 2021 Google LLC
177
177
  * SPDX-License-Identifier: BSD-3-Clause
@@ -183,7 +183,7 @@
183
183
  * @license
184
184
  * Copyright 2022 Google LLC
185
185
  * SPDX-License-Identifier: BSD-3-Clause
186
- */function Cn({context:i,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer(function(){new Be(this,{context:i,callback:n=>{this[s.name]=n},subscribe:t})}):e.constructor.addInitializer(n=>{new Be(n,{context:i,callback:r=>{n[s]=r},subscribe:t})})}}const Cs="children",Os="descriptor",Ps="container",Ss="context",ks="layout",Ns="properties";class Ms{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,e){if(!this._container||!this._descriptor)return;const s=await et.getInstance(this._container),n=new tt(s).withId(this._descriptor.id);await s.actions(n,this._descriptor.type||pt()).dispatch(t,e)}}const On=async(i,t)=>{const e=i.properties().provider;let s={},n="";Array.isArray(e)?(n=e[0],s=e[1]):n=e||"";const r=await t.getAsync(n);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(i.node.id,s),{provider:r,settings:s}},Pn=async(i,t)=>{const{provider:e,settings:s={}}=await On(i,t);return{addResource:(n,r)=>e.addResource(n,r),getData:(n,r)=>e.getData(n,r,s)}};class Ds{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const n=this.resources.get(t);if(!n)throw new Error(`Unable to get EntityProvider for "${t}"`);return await n.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const qe=i=>({title:i.Title,id:i.Id.toString()});class Sn extends Ds{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const n=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${n}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?qe(c):null}}),this.addResource("items",{query:async(e,s)=>{const n="",r=t.get("$widget").name,o=s.projection||"",d=await(await fetch(`${o}/guides?client=${n}&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(d.Matches||[]).map(u=>qe(u)),totalItems:(d==null?void 0:d.TotalMatches)||0}}})}}const kn=async i=>{i.registerAsync("guideProvider",()=>new Sn(i))},Nn=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),as(i,t,s||(()=>{}),t,n))),Mn=i=>{const t={};return Object.keys(i).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=i[e])}),t},Ls=(i,t)=>{const e=Mn(t);Object.entries(e).forEach(([s,n])=>{i.style.setProperty(s.replace("css-",""),n)})};var Dn=Object.defineProperty,Ln=Object.getOwnPropertyDescriptor,z=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ln(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&Dn(t,e,n),n};const In=i=>{class t extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new F(this,Os,void 0),this._childrenProvider=new F(this,Cs,[]),this._propertiesProvider=new F(this,Ns,{}),this._contextProvider=new F(this,Ss,{}),this._layoutProvider=new F(this,ks,{}),this.actions=new Ms(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),et.getInstance(this.container).then(async s=>{var r,o;const n=s.nodes.get(this.entry);if(n){this._propertyChangeListener=s.events.subscribe("components:properties-changed",(d,u)=>{n.id===u.node.id&&this._setProperties(u.node.attributes.properties)}),this._contextChangeListener=s.events.subscribe("components:context-changed",(d,u)=>{n.id===u.node.id&&this._setContext(u.node.attributes.context)}),this._layoutChangeListener=s.events.subscribe("components:layout-changed",(d,u)=>{n.id===u.node.id&&this._setLayout(u.node.attributes.layout)});const a="default";this._unmountNode=n.mount(this.container),this._setDescriptor(ie(n,a)),this._setProperties(n.attributes.properties),this._setContext(n.attributes.context),this._setLayout(this.layout);const h=n.getChildren(a).map(d=>ie(d));this._childrenProvider.setValue(h);const c=await this.container.getAsync("componentResolver");if(((r=this.descriptor)==null?void 0:r.type)==="area")return;const l=c.getComponent(((o=this.descriptor)==null?void 0:o.type)||"");l.then&&l.then(d=>{this.component=d.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),Ls(this.renderRoot.host,this.properties)}_setProperties(s){this._propertiesProvider.setValue(s),this.properties=s}_setContext(s){this._contextProvider.setValue(s),this.context=s}_setLayout(s){this._layoutProvider.setValue(s),this.layout=s}_setDescriptor(s){this.descriptor=s,this._descriptorProvider.setValue(s),this.actions.setDescriptor(s)}}return t.styles=[i.styles??[],fe`
186
+ */function Cn({context:i,subscribe:t}){return(e,s)=>{typeof s=="object"?s.addInitializer(function(){new qe(this,{context:i,callback:n=>{e.set.call(this,n)},subscribe:t})}):e.constructor.addInitializer(n=>{new qe(n,{context:i,callback:r=>{n[s]=r},subscribe:t})})}}const Cs="children",Os="descriptor",Ps="container",Ss="context",ks="layout",Ns="properties";class Ms{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,e){if(!this._container||!this._descriptor)return;const s=await et.getInstance(this._container),n=new tt(s).withId(this._descriptor.id);await s.actions(n,this._descriptor.type||pt()).dispatch(t,e)}}const On=async(i,t)=>{const e=i.properties().provider;let s={},n="";Array.isArray(e)?(n=e[0],s=e[1]):n=e||"";const r=await t.getAsync(n);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(i.node.id,s),{provider:r,settings:s}},Pn=async(i,t)=>{const{provider:e,settings:s={}}=await On(i,t);return{addResource:(n,r)=>e.addResource(n,r),getData:(n,r)=>e.getData(n,r,s)}};class Ds{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const n=this.resources.get(t);if(!n)throw new Error(`Unable to get EntityProvider for "${t}"`);return await n.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const Je=i=>({title:i.Title,id:i.Id.toString()});class Sn extends Ds{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const n=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${n}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?Je(c):null}}),this.addResource("items",{query:async(e,s)=>{const n="",r=t.get("$widget").name,o=s.projection||"",d=await(await fetch(`${o}/guides?client=${n}&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(d.Matches||[]).map(u=>Je(u)),totalItems:(d==null?void 0:d.TotalMatches)||0}}})}}const kn=async i=>{i.registerAsync("guideProvider",()=>new Sn(i))},Nn=(i,t,e,s,n)=>i.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),cs(i,t,s||(()=>{}),t,n))),Mn=i=>{const t={};return Object.keys(i).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=i[e])}),t},Ls=(i,t)=>{const e=Mn(t);Object.entries(e).forEach(([s,n])=>{i.style.setProperty(s.replace("css-",""),n)})};var Dn=Object.defineProperty,Ln=Object.getOwnPropertyDescriptor,z=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ln(t,e):t,r=i.length-1,o;r>=0;r--)(o=i[r])&&(n=(s?o(t,e,n):o(n))||n);return s&&n&&Dn(t,e,n),n};const In=i=>{class t extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new F(this,Os,void 0),this._childrenProvider=new F(this,Cs,[]),this._propertiesProvider=new F(this,Ns,{}),this._contextProvider=new F(this,Ss,{}),this._layoutProvider=new F(this,ks,{}),this.actions=new Ms(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),et.getInstance(this.container).then(async s=>{var r,o;const n=s.nodes.get(this.entry);if(n){this._propertyChangeListener=s.events.subscribe("components:properties-changed",(d,u)=>{n.id===u.node.id&&this._setProperties(u.node.attributes.properties)}),this._contextChangeListener=s.events.subscribe("components:context-changed",(d,u)=>{n.id===u.node.id&&this._setContext(u.node.attributes.context)}),this._layoutChangeListener=s.events.subscribe("components:layout-changed",(d,u)=>{n.id===u.node.id&&this._setLayout(u.node.attributes.layout)});const a="default";this._unmountNode=n.mount(this.container),this._setDescriptor(ie(n,a)),this._setProperties(n.attributes.properties),this._setContext(n.attributes.context),this._setLayout(this.layout);const h=n.getChildren(a).map(d=>ie(d));this._childrenProvider.setValue(h);const c=await this.container.getAsync("componentResolver");if(((r=this.descriptor)==null?void 0:r.type)==="area")return;const l=c.getComponent(((o=this.descriptor)==null?void 0:o.type)||"");l.then&&l.then(d=>{this.component=d.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),Ls(this.renderRoot.host,this.properties)}_setProperties(s){this._propertiesProvider.setValue(s),this.properties=s}_setContext(s){this._contextProvider.setValue(s),this.context=s}_setLayout(s){this._layoutProvider.setValue(s),this.layout=s}_setDescriptor(s){this.descriptor=s,this._descriptorProvider.setValue(s),this.actions.setDescriptor(s)}}return t.styles=[i.styles??[],fe`
187
187
  :host {
188
188
  font-family: var(--font-family);
189
189
  grid-column: span var(--width);
@@ -195,4 +195,4 @@
195
195
  * {
196
196
  box-sizing: border-box;
197
197
  }
198
- `],z([Cn({context:Ps}),Z({attribute:!1})],t.prototype,"container",2),z([Z()],t.prototype,"entry",2),z([N()],t.prototype,"descriptor",2),z([N()],t.prototype,"component",2),z([N()],t.prototype,"context",2),z([N()],t.prototype,"layout",2),z([N()],t.prototype,"properties",2),t};exports.ActionsController=Ms;exports.DataProvider=Ds;exports.GuideProviderPlugin=kn;exports.T=v;exports.Widget=En;exports.WidgetComponent=In;exports.appendStyleFromProperties=Ls;exports.childrenContext=Cs;exports.containerContext=Ps;exports.contextCtx=Ss;exports.createDataProvider=Pn;exports.createLitComponent=Nn;exports.descriptorContext=Os;exports.e=$s;exports.et=et;exports.i=_s;exports.i$1=F;exports.i$2=fe;exports.layoutCtx=ks;exports.mapBranding=Es;exports.n=Z;exports.ot=_;exports.propertiesCtx=Ns;exports.r=N;exports.s=Y;exports.t=ws;exports.w=U;exports.x=ot;
198
+ `],z([Cn({context:Ps}),Z({attribute:!1})],t.prototype,"container",2),z([Z()],t.prototype,"entry",2),z([N()],t.prototype,"descriptor",2),z([N()],t.prototype,"component",2),z([N()],t.prototype,"context",2),z([N()],t.prototype,"layout",2),z([N()],t.prototype,"properties",2),t};exports.ActionsController=Ms;exports.DataProvider=Ds;exports.E=v;exports.GuideProviderPlugin=kn;exports.T=j;exports.Widget=En;exports.WidgetComponent=In;exports.appendStyleFromProperties=Ls;exports.childrenContext=Cs;exports.containerContext=Ps;exports.contextCtx=Ss;exports.createDataProvider=Pn;exports.createLitComponent=Nn;exports.descriptorContext=Os;exports.e=$s;exports.et=et;exports.i=_s;exports.i$1=F;exports.i$2=fe;exports.layoutCtx=ks;exports.mapBranding=Es;exports.n=Z;exports.ot=_;exports.propertiesCtx=Ns;exports.r=Y;exports.r$1=N;exports.t=ws;exports.x=ot;