@telia-ace/widget-runtime-flamingo 1.0.16 → 1.0.37
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.
- package/{dist/component-platform-factory.d.ts → component-platform-factory.d.ts} +1 -2
- package/context/children.context.d.ts +4 -0
- package/context/component-node.context.d.ts +4 -0
- package/{dist/context → context}/container.context.d.ts +0 -1
- package/{dist/context → context}/context.context.d.ts +0 -1
- package/{dist/context → context}/layout.context.d.ts +0 -1
- package/{dist/context → context}/properties.context.d.ts +0 -1
- package/{dist/controllers → controllers}/actions-controller.d.ts +1 -2
- package/{dist/core → core}/create-lit-component.d.ts +1 -2
- package/{dist/core → core}/get-render-state.d.ts +1 -2
- package/{dist/data-provider → data-provider}/data-provider.d.ts +1 -2
- package/{dist/data-provider → data-provider}/providers/guide-provider.plugin.d.ts +0 -1
- package/index-0d792c3e.js +206 -0
- package/index-19a13f23.mjs +3405 -0
- package/{dist/index-9688347a.js → index-5087564d.mjs} +1 -2
- package/index-6dd00f59.js +1 -0
- package/{dist/index.d.ts → index.d.ts} +0 -1
- package/index.js +1 -0
- package/{dist/index.js → index.mjs} +3 -4
- package/{dist/mixins → mixins}/widget-component.mixin.d.ts +1 -2
- package/package.json +14 -40
- package/{dist/render-369a79dd.js → render-8ecc38bd.mjs} +125 -152
- package/render-938224a8.js +118 -0
- package/{dist/services.d.ts → services.d.ts} +3 -4
- package/{dist/ui → ui}/area.d.ts +0 -1
- package/{dist/ui → ui}/branding.d.ts +0 -1
- package/{dist/ui → ui}/get-css-props.d.ts +0 -1
- package/{dist/ui → ui}/get-layout-props.d.ts +0 -1
- package/{dist/ui → ui}/html-element-handlers.d.ts +0 -1
- package/{dist/ui → ui}/prepare-dom.d.ts +2 -2
- package/{dist/ui → ui}/render.d.ts +0 -2
- package/{dist/ui → ui}/trigger-component.d.ts +6 -4
- package/{dist/ui → ui}/view-outlet.d.ts +2 -3
- package/{dist/ui → ui}/wrapper.d.ts +1 -2
- package/{dist/widget.d.ts → widget.d.ts} +1 -2
- package/LICENSE.txt +0 -6
- package/README.md +0 -3
- package/dist/component-platform-factory.d.ts.map +0 -1
- package/dist/context/children.context.d.ts +0 -5
- package/dist/context/children.context.d.ts.map +0 -1
- package/dist/context/component-node.context.d.ts +0 -5
- package/dist/context/component-node.context.d.ts.map +0 -1
- package/dist/context/container.context.d.ts.map +0 -1
- package/dist/context/context.context.d.ts.map +0 -1
- package/dist/context/layout.context.d.ts.map +0 -1
- package/dist/context/properties.context.d.ts.map +0 -1
- package/dist/controllers/actions-controller.d.ts.map +0 -1
- package/dist/core/create-lit-component.d.ts.map +0 -1
- package/dist/core/get-render-state.d.ts.map +0 -1
- package/dist/data-provider/data-provider.d.ts.map +0 -1
- package/dist/data-provider/providers/guide-provider.plugin.d.ts.map +0 -1
- package/dist/index-9688347a.js.map +0 -1
- package/dist/index-bd7f8b31.js +0 -3837
- package/dist/index-bd7f8b31.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mixins/widget-component.mixin.d.ts.map +0 -1
- package/dist/render-369a79dd.js.map +0 -1
- package/dist/services.d.ts.map +0 -1
- package/dist/ui/area.d.ts.map +0 -1
- package/dist/ui/branding.d.ts.map +0 -1
- package/dist/ui/get-css-props.d.ts.map +0 -1
- package/dist/ui/get-layout-props.d.ts.map +0 -1
- package/dist/ui/html-element-handlers.d.ts.map +0 -1
- package/dist/ui/index.d.ts +0 -2
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/prepare-dom.d.ts.map +0 -1
- package/dist/ui/render.d.ts.map +0 -1
- package/dist/ui/trigger-component.d.ts.map +0 -1
- package/dist/ui/view-outlet.d.ts.map +0 -1
- package/dist/ui/wrapper.d.ts.map +0 -1
- package/dist/widget.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangesetOptions, ChangesetProvider, ComponentNodeSettings, ComponentPlatform, ComponentQuery } from '@telia-ace/widget-core
|
|
1
|
+
import { ChangesetOptions, ChangesetProvider, ComponentNodeSettings, ComponentPlatform, ComponentQuery } from '@telia-ace/widget-core';
|
|
2
2
|
import { StorageWriter } from '@telia-ace/widget-services';
|
|
3
3
|
import { Container, Widget } from '@webprovisions/platform';
|
|
4
4
|
export declare class LocalStorageChangesetProvider implements ChangesetProvider {
|
|
@@ -11,4 +11,3 @@ export declare class LocalStorageChangesetProvider implements ChangesetProvider
|
|
|
11
11
|
load(platform: ComponentPlatform): Promise<any>;
|
|
12
12
|
}
|
|
13
13
|
export declare const createPlatform: (widget: Widget) => Promise<ComponentPlatform>;
|
|
14
|
-
//# sourceMappingURL=component-platform-factory.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost, ReactiveElement } from 'lit';
|
|
2
2
|
import { Container } from '@webprovisions/platform';
|
|
3
|
-
import { ComponentDescriptor } from '@telia-ace/widget-core
|
|
3
|
+
import { ComponentDescriptor } from '@telia-ace/widget-core';
|
|
4
4
|
export declare class ActionsController implements ReactiveController {
|
|
5
5
|
host: ReactiveControllerHost;
|
|
6
6
|
private _container?;
|
|
@@ -12,4 +12,3 @@ export declare class ActionsController implements ReactiveController {
|
|
|
12
12
|
setContainer(container: Container): void;
|
|
13
13
|
dispatch(key: string, value: Record<string, any> | string): Promise<void>;
|
|
14
14
|
}
|
|
15
|
-
//# sourceMappingURL=actions-controller.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtendComponentHandler, ExtendComponentOptions } from '@telia-ace/widget-core
|
|
1
|
+
import { ExtendComponentHandler, ExtendComponentOptions } from '@telia-ace/widget-core';
|
|
2
2
|
import { Container } from '@webprovisions/platform';
|
|
3
3
|
/**
|
|
4
4
|
* Registers a Lit component on the component platform.
|
|
@@ -9,4 +9,3 @@ import { Container } from '@webprovisions/platform';
|
|
|
9
9
|
*/
|
|
10
10
|
declare const createLitComponent: (container: Container, type: string, component: any, fn?: ExtendComponentHandler, options?: ExtendComponentOptions) => Promise<void>;
|
|
11
11
|
export default createLitComponent;
|
|
12
|
-
//# sourceMappingURL=create-lit-component.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { WidgetRenderState } from '@telia-ace/widget-core
|
|
1
|
+
import { WidgetRenderState } from '@telia-ace/widget-core';
|
|
2
2
|
import { Container } from '@webprovisions/platform';
|
|
3
3
|
export declare const getRenderState: (container: Container) => Promise<WidgetRenderState>;
|
|
4
4
|
export declare const subscribeToRenderState: (container: Container, subscriptionFn: (origin: string, action: string) => void) => Promise<import("@webprovisions/platform").EventSubscriptionCancellation>;
|
|
5
|
-
//# sourceMappingURL=get-render-state.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentNodeController } from '@telia-ace/widget-core
|
|
1
|
+
import { ComponentNodeController } from '@telia-ace/widget-core';
|
|
2
2
|
import { Container } from '@webprovisions/platform';
|
|
3
3
|
type DataResource = {
|
|
4
4
|
query: (input: Record<string, any>, providerSettings: Record<string, any>) => Promise<any>;
|
|
@@ -22,4 +22,3 @@ export declare class DataProvider {
|
|
|
22
22
|
applyComponentNodeSettings(nodeId: string, value: DataProviderSettings): void;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
25
|
-
//# sourceMappingURL=data-provider.d.ts.map
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";const Lt=(n,t,e,...s)=>{const i=`[${n.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(i,...s);break;case"warning":console.warn(i,...s);break;case"error":console.error(i,...s);break}},ms=n=>{const t=n.container||n;return{info:(e,...s)=>Lt(t,"info",e,...s),warn:(e,...s)=>Lt(t,"warning",e,...s),error:(e,...s)=>Lt(t,"error",e,...s)}};var st=(n=>(n.Implementation="implementation",n.Widget="widget",n))(st||{}),D=(n=>(n.Pre="pre",n.Post="post",n))(D||{});const fs=(n,t,e,s)=>{try{const i=new t(e,s);return{name:n,invoke:(r,o)=>{let a;return i[r]&&(a=i[r].call(i,o)),Promise.resolve(a)},getInstance:()=>i}}catch(i){if(i.message&&i.message.indexOf("is not a constructor")>=0)return{name:n,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw i}};function de(n,t){return typeof n>"u"?t:n}let vs=class{constructor(t={}){this.part=t}createCommand(t,e,s){let i;typeof e=="function"?i={scope:st.Widget,stage:D.Post,defaultArgs:void 0,handlerResolver:e}:i={scope:de(e.scope,st.Widget),stage:de(e.stage,D.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]=()=>i):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Re=n=>{const t=new vs({});return n(t),t.get()};Re(n=>{n.createCommand("types.register",{scope:st.Implementation,stage:D.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:D.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:D.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:D.Pre},t=>(e,s,i)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=i);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=fs(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ms(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 ys(n){const t={};return[].filter.call(n.attributes,e=>/^data-/.test(e.name)).map(e=>e.name).forEach(e=>t[e.substr(5)]=n.getAttribute(e)),t}const ue=(n,t,e)=>{const s=ys(n);e({sourceDOMElement:n,eventType:t,data:s})};function pe(n,t,e){n.forEach(s=>{s.dataset.attached!=="true"&&(t==="load"?ue(s,t,e):s.addEventListener(t,i=>{i.preventDefault(),ue(s,t,e)}),s.dataset.monitored="true")})}function bs(n,t,e){const s=n.container.get("bootstrapping.monitor");s&&s.events.subscribe("bootstrap:trigger-elements-updated",(r,o)=>{pe(o.triggerElements,t,e)});const i=n.container.get("triggerElements");i&&pe(i,t,e)}Re(n=>{n.createCommand("ready",{scope:st.Implementation,stage:D.Pre},t=>e=>{const{container:s}=t,i=s.owner;s.get("bootstrapping").ready?e(i):i.events.subscribeOnce("bootstrap:ready",()=>{e(i)})})});const Mt=(n,t,e,...s)=>{const i=`[${n.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(i,...s);break;case"warning":console.warn(i,...s);break;case"error":console.error(i,...s);break}},ws=n=>{const t=n.container||n;return{info:(e,...s)=>Mt(t,"info",e,...s),warn:(e,...s)=>Mt(t,"warning",e,...s),error:(e,...s)=>Mt(t,"error",e,...s)}};var vt=(n=>(n.Implementation="implementation",n.Widget="widget",n))(vt||{}),R=(n=>(n.Pre="pre",n.Post="post",n))(R||{});const $s=(n,t,e,s)=>{try{const i=new t(e,s);return{name:n,invoke:(r,o)=>{let a;return i[r]&&(a=i[r].call(i,o)),Promise.resolve(a)},getInstance:()=>i}}catch(i){if(i.message&&i.message.indexOf("is not a constructor")>=0)return{name:n,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw i}};function ge(n,t){return typeof n>"u"?t:n}let _s=class{constructor(t={}){this.part=t}createCommand(t,e,s){let i;typeof e=="function"?i={scope:vt.Widget,stage:R.Post,defaultArgs:void 0,handlerResolver:e}:i={scope:ge(e.scope,vt.Widget),stage:ge(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]=()=>i):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}};const Te=n=>{const t=new _s({});return n(t),t.get()};Te(n=>{n.createCommand("types.register",{scope:vt.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,i)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=i);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=$s(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){ws(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)})});var je=(n=>(n.Activating="activating",n.Loading="loading",n.Activated="activated",n.Deactivating="deactivating",n.Deactivated="deactivated",n))(je||{});class Es{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 Ct=(n,t,...e)=>typeof t=="string"?n(`[humany] ${t}`,...e):n(t,...e),tt=class{constructor(){this.keys=[],this.log=(t,...e)=>this.lookup(t,()=>tt.log(...e)),this.warn=(t,...e)=>this.lookup(t,()=>tt.warn(...e)),this.error=(t,...e)=>this.lookup(t,()=>tt.error(...e)),this.info=(t,...e)=>this.lookup(t,()=>tt.info(...e))}lookup(t,e){this.keys.indexOf(t)===-1&&(this.keys.push(t),e())}};let b=tt;b.log=(...n)=>Ct(console.log,...n);b.warn=(...n)=>Ct(console.warn,...n);b.error=(...n)=>Ct(console.error,...n);b.info=(...n)=>Ct(console.info,...n);const Ve=n=>{let t={},e,s;if(typeof n!="object"||n===null)return n;t=Array.isArray(n)?[]:{};for(s in n)e=n[s],t[s]=typeof e=="object"&&e!==null?Ve(e):e;return t},Cs=Ve;function me(n){let t=0;if(n.length===0)return t.toString();for(let e=0;e<n.length;e++){const s=n.charCodeAt(e);t=(t<<5)-t+s,t=t&t}return t.toString()}let As=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,i){this.tasks.push({task:t,resolve:e,reject:s,done:i}),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),i=Promise.resolve(t.task()).then(r=>(clearTimeout(s),clearTimeout(e),r));return Promise.resolve(i).then(this.next).then(()=>i.then(r=>{t.done(),t.resolve(r)})).catch(r=>(t.done(),t.reject(r),this.next()))}return Promise.resolve()})}};const lt=new WeakMap;function A(n,t=5e3,e=1e3){return lt.has(n)||lt.set(n,new As(t,e)),s=>new Promise((i,r)=>{const o=lt.get(n);o.add(s,i,r,()=>{o.tasks.length||lt.delete(n)})})}const xs=(n,t)=>{const e=()=>t.querySelectorAll("[data-loading=true]").length>0,s=(()=>{let i=!1;return()=>{i||(n.get("$widget").events.dispatch("widget:data-loaded",{element:t}),i=!0)}})();if(!e())return s();new MutationObserver((i,r)=>{i.find(o=>o.type==="attributes"&&o.attributeName==="data-loading")&&!e()&&(r.disconnect(),s())}).observe(t,{attributes:!0,childList:!0,subtree:!0})},Os=(n,t)=>{n.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),[]),i=!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),!i&&s.length===0&&(i=!0,xs(n,t),o.disconnect())}})}).observe(t,{attributes:!1,characterData:!1,childList:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})})})},Ss=Os,P=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);function ot(){return P()+P()+"-"+P()+"-"+P()+"-"+P()+"-"+P()+P()+P()}var Ps=Object.defineProperty,ks=Object.defineProperties,Ns=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertySymbols,Ds=Object.prototype.hasOwnProperty,Ls=Object.prototype.propertyIsEnumerable,ve=(n,t,e)=>t in n?Ps(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ms=(n,t)=>{for(var e in t||(t={}))Ds.call(t,e)&&ve(n,e,t[e]);if(fe)for(var e of fe(t))Ls.call(t,e)&&ve(n,e,t[e]);return n},Is=(n,t)=>ks(n,Ns(t));class Rs{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:i,value:r,target:o})=>t===o&&e(t,i,r))}}const Ue=n=>{const t=[];return[(e,s)=>{t.push(n.subscribe(e,s))},()=>{t.forEach(e=>{e()})}]};let Y=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 Ts(this.platform,this)}},ee=class{constructor(t,e,s){this.platform=t,this.node=e,this.actions=new At(t,new Y(t).withId(e.id),s);const[i,r]=Ue(this.platform.events);this.subscribe=i,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 Ts{constructor(t,e,s=!0){this.platform=t,this.target=e,this.clearOnDispose=s,this.removes=[],this.actions=new At(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 js=(n,t,e)=>{const s=n.concat(),i=(r,o,a)=>{let h=!0;if(s.length){const c=s.shift(),l=(d,u)=>(h=!1,i(d,Object.assign({},o,u),a));return Promise.resolve(c(r,l,a)).then(d=>Is(Ms({},d),{cancelled:h}))}return Promise.resolve({data:r,cancelled:!1,options:o})};return i(t,{},e)};let At=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 i=()=>{const r=this.platform.actionsState.handlers.indexOf(s);r>-1&&this.platform.actionsState.handlers.splice(r,1)};return this.subscriptions.push(i),i}dispatch(t,e){const s=this.platform.nodes.all.concat(this.platform.nodes.detached),i={},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 ee(this.platform,c,this.ns);return js(h,e,l).then(d=>{const{data:u={},options:p,cancelled:v}=d;return Promise.resolve(v?{}:o.fn(u,p,l)).then(y=>{i[c.id]=y})})}))})).then(()=>i)}watch(t,e){let s=t,i=this.ns;const r=t.split(".");r.length>1&&(i=r[0],s=r.splice(1).join("."));const o={fn:e,target:this.target,key:s,ns:i};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())}};Te(n=>{n.createCommand("components",t=>e=>{t.events.subscribeOnce("components:platform-created",(s,{platform:i})=>{e.handlers&&e.handlers.forEach(([r,o])=>{i.addComponentHandler(r,o)})})})});let Gt=class{constructor(t,e){this.events=t,this.tags=[],this.children={},this.changesets=[],this.mountCount=0,this.id=ot(),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 i=[{properties:t},e];return this.changesets.push(i),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeProperties(t,e={},s){const i=[{properties:t},e];return this.changesets.push(i),this.events.dispatch("components:set-properties",{node:this}),()=>{if(s){const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-properties",{node:this}))}}}writeLayout(t,e={},s){const i=[{layout:t},e];return this.changesets.push(i),this.events.dispatch("components:set-layout",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(i);r>-1&&(this.changesets.splice(r,1),this.events.dispatch("components:set-layout",{node:this}))}}writeContext(t,e={},s){const i=[{context:t},e];return this.changesets.push(i),this.events.dispatch("components:set-context",{node:this}),()=>{if(!s)return;const r=this.changesets.indexOf(i);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,i,r)=>{const{order:o=r}=i.attributes.layout;return s[o]?s.splice(o,0,i):s[o]=i,s},Array(e.length))}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){Object.keys(this.children).forEach(e=>{const s=this.children[e],i=s.indexOf(t);i>-1&&(s.splice(i,1),this.events.dispatch("components:node-removed",{node:t,parentNode:this}))}),delete t.parent}};const He=(n,t,e)=>{for(let s=0,i=n.length;s<i&&e(n[s])!==!0;s++){const r=t[n[s].id]||"default",o=n[s].getChildren(r);He(o,t,e)}},xt=(n,t,e)=>{if(e(n)!==!0){const s=t[n.id]||"default",i=n.children[s];He(i,t,e)}},pt=(n,t)=>{const e=[];return xt(n,t,s=>{e.push(s)}),e},ze=(n,t,e)=>{let s;return xt(n,t,i=>{if(e(i))return s=i,!0}),s};class Vs{constructor(t,e,s){this.root=t,this.switches=e,this.all=[],this.visible=[],this.detached=[],s.subscribe("components:node-appended",(i,r)=>{this.all.push(r.node),this.visible=pt(t,e)}),s.subscribe("components:node-removed",(i,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=pt(t,e)}),s.subscribe("components:node-switched",(i,r)=>{this.visible=pt(t,e)})}query(t={}){const e=[];return xt(this.root,this.switches,s=>{Object.keys(t).every(i=>t[i]===s[i])&&e.push(s)}),e}get(t){return ze(this.root,this.switches,e=>e.id===t)||this.detached.find(e=>e.id===t)}}class Us{constructor(){this.handlers=new Map}add(t,e){this.handlers.set(t,e)}get(t){return this.handlers.get(t)}}const Hs=n=>{let t=n,e=0;for(;t.parent;)e=e+1,t=t.parent;return e},zs=n=>n.map(([t,e])=>[Hs(t),t,e]).sort(([t],[e])=>t-e).map(([,t,e])=>[t,e]),It=n=>n instanceof Date?!1:n&&typeof n=="object"&&!Array.isArray(n),x=(n,...t)=>{if(!t.length)return n;const e=t.shift();if(It(n)&&It(e))for(const s in e)It(e[s])?(n[s]||Object.assign(n,{[s]:{}}),x(n[s],e[s])):Object.assign(n,{[s]:e[s]});return x(n,...t)},Bs=(n,t)=>!n||n==="all"?!0:n.some(e=>t.indexOf(e)>-1),Ws=(n,t)=>{let e=[],s=[],i;const r=()=>{process.env.NODE_ENV!=="production"&&console.time("state-processor.flush");const a=new Map,h=zs(e.map((l,d)=>[l,s[d]])),c=(l,d)=>{var u;const p=a.get(l)||{},v=d.context&&!p.context,y=d.properties&&!p.properties,C=d.layout&&!p.layout;a.set(l,{context:p.context||v,properties:p.properties||y,layout:p.layout||C}),y&&(l.attributes.properties={}),C&&(l.attributes.layout={}),v&&(l.attributes.context=x({},(u=l.parent)==null?void 0:u.attributes.context));const ht=[],kt=[],Nt=[];if(l.changesets.forEach(_=>{const[E,Dt]=_;Bs(Dt.breakpoints,n.breakpoints)&&(y&&(typeof E.properties=="function"?ht.push(E.properties):x(l.attributes.properties,E.properties)),C&&(typeof E.layout=="function"?kt.push(E.layout):x(l.attributes.layout,E.layout)),v&&(typeof E.context=="function"?Nt.push(E.context):x(l.attributes.context,E.context)))}),ht.forEach(_=>{x(l.attributes.properties,_(l.attributes.properties))}),kt.forEach(_=>{x(l.attributes.layout,_(l.attributes.layout))}),Nt.forEach(_=>{x(l.attributes.context,_(l.attributes.context))}),v||d.recursive){const _=n.getBranch(l),E=d.recursive?d:{context:!!v};l.getChildren(_).forEach(Dt=>{c(Dt,E)})}};process.env.NODE_ENV!=="production"&&console.timeEnd("state-processor.flush"),h.forEach(([l,d])=>{c(l,d)}),e=[],s=[],t(a)},o=()=>{clearTimeout(i),i=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 Z{constructor(t,e={}){this.providers=e,this.breakpoints=[],this.actionsState={handlers:[],watchers:[]},this.switches={},this.changesets=[],this.subscriptions=[],this.customComponentHandler=new Us,this.events=t.events.createChild(this);const s=new Gt(this.events,"root");s.name=`root-${t.name}`,this.nodes=new Vs(s,this.switches,this.events);const i=this.processNode=Ws(this,r=>{const o=Array.from(r.keys());process.env.NODE_ENV!=="production"&&console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
|
|
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)=>{i(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-properties",(r,o)=>{i(o.node,{properties:!0})})),this.subscriptions.push(this.events.subscribe("components:set-context",(r,o)=>{i(o.node,{properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:set-indent",(r,o)=>{i(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:set-layout",(r,o)=>{i(o.node,{layout:!0})})),this.subscriptions.push(this.events.subscribe("components:node-switched",(r,{node:o,branch:a})=>{i(o,{layout:!0,recursive:!0,properties:!0,context:!0})})),this.subscriptions.push(this.events.subscribe("components:node-removed",(r,{parentNode:o})=>{i(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 Gt(this.events,t);return e.detached&&this.nodes.detached.push(s),s}components(){return new Y(this)}actions(t,e){return new At(this,t,e)}write(t){const{provider:e,target:s,attributes:i,options:r={},removable:o}=t,a=t.key||ot(),h={changeset:[i,r],target:s,removes:[]};if(e){const c=this.providers[e];c.write(a,s,i,r),h.removes.push(()=>{c.remove(a)})}return this.changesets.push(h),this.nodes.all.forEach(c=>{if(s.match(c)){let l=()=>{};i.properties&&(l=c.writeProperties(i.properties,r,o)),i.context&&(l=c.writeContext(i.context,r,o)),i.layout&&(l=c.writeContext(i.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 qs=n=>{if(Array.isArray(n)){const[t,...e]=n;return{definitionId:t,overrides:e}}return{definitionId:n,overrides:[]}},yt=(n,t,e,s,i,r)=>{e.forEach(o=>{const a=qs(o),h=s[a.definitionId];if(a.definitionId==="view"){const c=n.createNode("view");c.name="view",Object.keys(i).forEach(l=>{const d=i[l];yt(n,c,[d.entry],s,i,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(n.getComponentHandler(h.type)){const c=n.getComponentHandler(h.type);c&&c(a,{platform:n,node:t,references:e,definitions:s,views:i,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=n.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&&yt(n,l,c.children,s,i)}})},Be=(n,t)=>{const{entry:e,components:s,breakpoints:i,views:r}=t,o=[];return Object.keys(i).forEach(a=>{const h=i[a],c=window.matchMedia(h);c.matches&&n.breakpoints.push(a);const l=d=>{d.matches?n.addBreakpoint(a):n.removeBreakpoint(a)};c.addListener(l),o.push(()=>c.removeListener(l))}),yt(n,n.nodes.root,[e],s,r),()=>o.forEach(a=>{a()})},Yt=(n,t)=>({id:n.id,type:n.type,name:n.name,branch:t||"default"}),We=(n,t,e,s=ot(),i={})=>n.getAsync("components").then(r=>{let o;if(typeof t=="string"){const c=new Y(r);c.ofType(t),o=c}else o=t;const a={},h=c=>{const l=a[c.id];return l?Promise.resolve(l.controller):Z.getInstance(n).then(d=>new ee(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(),i.reuseController||(d.controller.dispose(),delete a[l.id]))})});class Js{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,i)=>{if(i===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)}}}var $=(n=>(n.open="open",n.closed="closed",n.hidden="hidden",n))($||{});const se=Object.freeze(Object.defineProperty({__proto__:null,ActionResolver:Rs,ActionsController:At,ComponentNode:Gt,ComponentNodeController:ee,ComponentPlatform:Z,ComponentQuery:Y,ComponentResolver:Js,WidgetRenderState:$,asDescriptor:Yt,createChildren:yt,createComponentModel:Be,createEventSubscriber:Ue,extendComponent:We,findComponent:ze,findVisibleComponents:pt,traverseComponents:xt},Symbol.toStringTag,{value:"Module"}));var Fs=Object.defineProperty,ye=Object.getOwnPropertySymbols,Ks=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,be=(n,t,e)=>t in n?Fs(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,z=(n,t)=>{for(var e in t||(t={}))Ks.call(t,e)&&be(n,e,t[e]);if(ye)for(var e of ye(t))Gs.call(t,e)&&be(n,e,t[e]);return n},dt=(n,t,e)=>new Promise((s,i)=>{var r=h=>{try{a(e.next(h))}catch(c){i(c)}},o=h=>{try{a(e.throw(h))}catch(c){i(c)}},a=h=>h.done?s(h.value):Promise.resolve(h.value).then(r,o);a((e=e.apply(n,t)).next())}),m=(n=>(n.Cookie="cookie",n.Local="local",n.Session="session",n))(m||{}),Q=(n=>(n.Tenant="tenant",n.Implementation="implementation",n.Widget="widget",n))(Q||{}),g=(n=>(n.Necessary="necessary",n.Functional="functional",n.Analytical="analytical",n.Marketing="marketing",n))(g||{});const k=(n,t,e,s={})=>we(n,e).then(i=>(process.env.NODE_ENV!=="production"&&i&&b.warn(`createStorageWriter: Attempted to create storage writer using unallowed category.
|
|
4
|
+
Key: ${t}
|
|
5
|
+
Category: ${JSON.stringify(e)}
|
|
6
|
+
Options: ${JSON.stringify(s)}`),r=>(re(n),we(n,e).then(o=>{if(o){process.env.NODE_ENV!=="production"&&b.warn(`storageWriter: Attempted to write to storage using unallowed category.
|
|
7
|
+
Key: ${t}
|
|
8
|
+
Category: ${JSON.stringify(e)}
|
|
9
|
+
Value: ${JSON.stringify(r)}
|
|
10
|
+
Options: ${JSON.stringify(s)}`);return}const{scope:a=Q.Widget,medium:h=m.Session,duration:c}=s,l=Zs();return l[a][t]=ie(r,e,c),h===m.Cookie?en(n,l):nn(n,h,l)})))),S=(n,t,e=m.Session)=>(re(n),typeof t>"u"?(process.env.NODE_ENV!=="production"&&b.warn("readStorage: Undefined key passed when reading storage. ",t,e),Promise.resolve(void 0)):e===m.Cookie?tn(n).then(s=>wt(s,t)):sn(n,e).then(s=>wt(s,t))),q=n=>!!Object.entries(n).filter(([t,e])=>typeof e<"u").length,Rt=n=>Object.entries(n).filter(([t,e])=>typeof e<"u").forEach(([t,{value:e}])=>{typeof e>"u"&&delete n[t]}),qe=(n,t)=>{const e={tenant:z(z({},n.tenant),t.tenant),implementation:z(z({},n.implementation),t.implementation),widget:z(z({},n.widget),t.widget)};return Rt(e.tenant),Rt(e.implementation),Rt(e.widget),e},Ys=n=>Object.entries(n).reduce((t,e)=>{const[s,i]=e;return Object.entries(i).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()||St(),Ot=n=>{const{name:t,implementation:{name:e,tenant:s}}=n.get("$widget");return[`humany_${s}`,`humany_${me(s+e)}`,`humany_${me(s+e+t)}`]},Tt=n=>{const t=new RegExp(`(?:^|;)\\s?${n}=(.*?)(?:;|$)`,"i"),e=document.cookie.match(t);return e&&e[1]&&JSON.parse(e[1])||void 0},jt=(n,t,e)=>{const s=`${n}=${JSON.stringify(t).trim()}`,i=`expires=${new Date(e).toUTCString()}`,r="path=/",o="SameSite=None;Secure";return document.cookie=`${s}; ${i}; ${r}; ${o}`},ne=n=>{const[t,e,s]=Ot(n),i=Tt(t)||{},r=Tt(e)||{},o=Tt(s)||{};return{tenant:i,implementation:r,widget:o}},Je=(n,t)=>{const e=ne(n),s=qe(e,t),[i,r,o]=Ot(n),{tenant:a,implementation:h,widget:c}=s,l=Ys(t),d=St({days:-1});jt(i,a,q(a)?l:d),jt(r,h,q(h)?l:d),jt(o,c,q(c)?l:d)},bt=(n,t)=>{const[e,s,i]=Ot(n),r=t.getItem(e)||"{}",o=t.getItem(s)||"{}",a=t.getItem(i)||"{}";return{tenant:JSON.parse(r),implementation:JSON.parse(o),widget:JSON.parse(a)}},Zt=(n,t,e)=>{const s=bt(n,t),i=qe(s,e),[r,o,a]=Ot(n),{tenant:h,implementation:c,widget:l}=i;q(h)?t.setItem(r,JSON.stringify(h)):t.removeItem(r),q(c)?t.setItem(o,JSON.stringify(c)):t.removeItem(o),q(l)?t.setItem(a,JSON.stringify(l)):t.removeItem(a)},Zs=()=>({tenant:{},implementation:{},widget:{}}),Qs=n=>n?!!n&&new Date>new Date(n):!1,wt=(n,t)=>{const e=n.widget[t]||n.implementation[t]||n.tenant[t];return e==null?void 0:e.value},ie=(n,t,e)=>e?{value:n,category:t,expiration:typeof e=="object"?St(e):e}:{value:n,category:t},gt=(n,t)=>{const e=Cs(n);return Object.entries(e).forEach(([s,i])=>{Object.entries(i).forEach(([r,o])=>{const{expiration:a,category:h}=o;(Qs(a)||Xs(t,h))&&(i[r]=ie(void 0,h,a))})}),e},we=(n,t)=>S(n,"storagePolicy",m.Cookie).then((e=[g.Necessary])=>!!t&&e.indexOf(t)===-1),Xs=(n=[g.Necessary],t)=>!!t&&n.indexOf(t)===-1,re=n=>{const t=ne(n),e=bt(n,window.localStorage),s=bt(n,sessionStorage),i=wt(t,"storagePolicy"),[r,o,a]=[t,e,s].map(h=>gt(h,i));Je(n,r),Zt(n,window.localStorage,o),Zt(n,window.sessionStorage,a)},St=(n={days:30})=>{const{days:t=0,hours:e=0,minutes:s=0,seconds:i=0}=n,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()+i*1e3),r.toISOString()},tn=n=>A(document)(()=>ne(n)),en=(n,t)=>A(document)(()=>Je(n,t)),sn=(n,t)=>{const e=t===m.Local?window.localStorage:window.sessionStorage;return A(e)(()=>bt(n,e))},nn=(n,t,e)=>{const s=t===m.Local?window.localStorage:window.sessionStorage;return A(s)(()=>Zt(n,s,e))};let mt=class{constructor(){this.memory={tenant:{},implementation:{},widget:{}}}setItem(t,e){return dt(this,arguments,function*(s,i,r={}){return A(this)(()=>{const o=gt(this.memory,[g.Necessary]),{scope:a=Q.Tenant,expiration:h}=r;o[a][s]=ie(i,g.Necessary,(h==null?void 0:h.toISOString())||St()),this.memory=o,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value stored temporarily in memory.
|
|
11
|
+
Key: ${s}
|
|
12
|
+
Value: ${JSON.stringify(i)}
|
|
13
|
+
Options: ${JSON.stringify(r)}
|
|
14
|
+
Memory: ${JSON.stringify(o)}`)})})}getItem(t){return dt(this,null,function*(){return A(this)(()=>{const e=gt(this.memory,[g.Necessary]);process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value fetched from legacy memory storage.
|
|
15
|
+
Key: ${t}
|
|
16
|
+
Memory: ${JSON.stringify(e)}`);const s=wt(e,t);return this.memory=e,s})})}removeItem(t){return dt(this,null,function*(){return A(this)(()=>{const e=gt(this.memory,[g.Necessary]);delete e.tenant[t],delete e.implementation[t],delete e.widget[t],this.memory=e,process.env.NODE_ENV!=="production"&&b.warn(`StorageProvider: StorageProvider is deprecated, use createStorageWriter and readStorage instead, value removed from memory.
|
|
17
|
+
Key: ${t}
|
|
18
|
+
Memory: ${JSON.stringify(e)}`)})})}clear(){return dt(this,null,function*(){return Promise.resolve()})}};class rn{constructor(){this.cookies=new mt,this.session=new mt,this.local=new mt}}const Vt=(n,t,e,...s)=>{const i=`[${n.get("$environment").name||"webprovisions"}] ${e}`;switch(t){case"info":console.info(i,...s);break;case"warning":console.warn(i,...s);break;case"error":console.error(i,...s);break}},on=n=>{const t=n.container||n;return{info:(e,...s)=>Vt(t,"info",e,...s),warn:(e,...s)=>Vt(t,"warning",e,...s),error:(e,...s)=>Vt(t,"error",e,...s)}};var $t=(n=>(n.Implementation="implementation",n.Widget="widget",n))($t||{}),T=(n=>(n.Pre="pre",n.Post="post",n))(T||{});const an=(n,t,e,s)=>{try{const i=new t(e,s);return{name:n,invoke:(r,o)=>{let a;return i[r]&&(a=i[r].call(i,o)),Promise.resolve(a)},getInstance:()=>i}}catch(i){if(i.message&&i.message.indexOf("is not a constructor")>=0)return{name:n,invoke:r=>{let o;return r==="initialize"&&(o=t(e,s)),Promise.resolve(o)},getInstance:()=>t};throw i}};function $e(n,t){return typeof n>"u"?t:n}class cn{constructor(t={}){this.part=t}createCommand(t,e,s){let i;typeof e=="function"?i={scope:$t.Widget,stage:T.Post,defaultArgs:void 0,handlerResolver:e}:i={scope:$e(e.scope,$t.Widget),stage:$e(e.stage,T.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]=()=>i):r=this.part[a]=this.part[a]||{}}),this}get(){return this.part}}const Fe=n=>{const t=new cn({});return n(t),t.get()};Fe(n=>{n.createCommand("types.register",{scope:$t.Implementation,stage:T.Pre},t=>(e,s)=>{t.container.get("$types")[e]=s}).createCommand("type",{stage:T.Pre},t=>e=>{t.container.register("$type",e)}).createCommand("settings",{stage:T.Pre,defaultArgs:[null]},t=>e=>{t.events.dispatch("settings:change",e,{bubbles:!0}),t.container.register("$settings",e)}).createCommand("plugin",{stage:T.Pre},t=>(e,s,i)=>{const{container:r}=t;let o=null,a=e,h=s;typeof e=="string"&&(o=e,a=s,h=i);const c=l=>{const{transformPluginSettings:d}=t.container.get("$environmentOptions"),u=d?d(h||{},o,t.container,a):s;try{const p=an(o,a,r,u);r.get("$plugins").push(p),l&&p.invoke("initialize",null)}catch(p){on(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)})});Fe(n=>{n.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
|
+
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
|
+
Passed consent: ${JSON.stringify(s)}`);return}const i=[g.Necessary,g.Functional,g.Analytical,g.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 i.indexOf(g.Necessary)===-1&&(process.env.NODE_ENV!=="production"&&b.warn(`storagePolicyConfigurationApi: passed consent does not include category: '${g.Necessary}'. Consent has to atleast include the '${g.Necessary}' category.
|
|
21
|
+
Passed consent: ${JSON.stringify(s)}`),i.unshift(g.Necessary)),k(t.container,"storagePolicy",g.Necessary,{medium:m.Cookie,scope:Q.Tenant,duration:{days:365}}).then(r=>r(i)).then(()=>{re(t.container),t.events.dispatch("storage:policy-changed",i)})}})});const hn=Object.freeze(Object.defineProperty({__proto__:null,StorageCategory:g,StorageMedium:m,StorageProvider:rn,StorageScope:Q,StorageService:mt,createStorageWriter:k,readStorage:S},Symbol.toStringTag,{value:"Module"})),ln=n=>{const t=(i,r)=>{i&&(r?i.classList.add("ace-tabbing"):i.classList.remove("ace-tabbing"))},e=i=>{i.key==="Tab"?t(n,!0):i.key==="Enter"&&document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")||t(n,!1)},s=i=>{document.activeElement&&document.activeElement.classList.contains("ace-widget-trigger")&&document.activeElement.classList.contains("ace-tabbing")||t(n,!1)};return document.addEventListener("keydown",e),document.addEventListener("click",s),()=>{document.removeEventListener("keydown",e),document.removeEventListener("click",s)}};function dn(n,t){const{widgetName:e,label:s="",ariaLabel:i="",tooltip:r=""}=t;return n.classList.add("ace-widget-trigger"),n.classList.add(`ace-widget_${e}`),s.length&&n.classList.add("trigger-has-text"),i.length&&!n.getAttribute("aria-label")&&n.setAttribute("aria-label",i),i.length&&!n.getAttribute("tabindex")&&n.setAttribute("tabindex","0"),r.length&&!n.getAttribute("title")&&n.setAttribute("title",r),ln(n)}function un(n,t){n instanceof HTMLElement?(t&&n.setAttribute("title",t),n.classList.remove("ace-trigger-active"),n.classList.remove("ace-trigger-loading")):n instanceof Array&&n.forEach(e=>{t&&e.setAttribute("title",t),e.classList.remove("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}function pn(n){n instanceof HTMLElement?(n.classList.remove("ace-trigger-active"),n.classList.add("ace-trigger-loading")):n instanceof Array&&n.forEach(t=>{t.classList.remove("ace-trigger-active"),t.classList.add("ace-trigger-loading")})}function Ke(n,t){n instanceof HTMLElement?(t&&n.setAttribute("title",t),n.classList.add("ace-trigger-active"),n.classList.remove("ace-trigger-loading")):n instanceof Array&&n.forEach(e=>{t&&e.setAttribute("title",t),e.classList.add("ace-trigger-active"),e.classList.remove("ace-trigger-loading")})}/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2019 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*/const ft=window,oe=ft.ShadowRoot&&(ft.ShadyCSS===void 0||ft.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ae=Symbol(),_e=new WeakMap;let Ge=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ae)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(oe&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=_e.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_e.set(e,t))}return t}toString(){return this.cssText}};const gn=n=>new Ge(typeof n=="string"?n:n+"",void 0,ae),ce=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((s,i,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.")})(i)+n[r+1],n[0]);return new Ge(e,n,ae)},mn=(n,t)=>{oe?n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{const s=document.createElement("style"),i=ft.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,n.appendChild(s)})},Ee=oe?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return gn(e)})(n):n;/**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright 2017 Google LLC
|
|
28
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
+
*/var Ut;const _t=window,Ce=_t.trustedTypes,fn=Ce?Ce.emptyScript:"",Ae=_t.reactiveElementPolyfillSupport,Qt={toAttribute(n,t){switch(t){case Boolean:n=n?fn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},Ye=(n,t)=>t!==n&&(t==t||n==n),Ht={attribute:!0,type:String,converter:Qt,reflect:!1,hasChanged:Ye},Xt="finalized";let B=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach((e,s)=>{const i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i))}),t}static createProperty(t,e=Ht){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||Ht}static finalize(){if(this.hasOwnProperty(Xt))return!1;this[Xt]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of s)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(Ee(i))}else t!==void 0&&e.push(Ee(t));return e}static _$Ep(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;const e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return mn(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=Ht){var i;const r=this.constructor._$Ep(t,s);if(r!==void 0&&s.reflect===!0){const o=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:Qt).toAttribute(e,s.type);this._$El=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Ev.get(t);if(r!==void 0&&this._$El!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?o.converter:Qt;this._$El=r,this[r]=a.fromAttribute(e,o.type),this._$El=null}}requestUpdate(t,e,s){let i=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||Ye)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,r)=>this[r]=i),this._$Ei=void 0);let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var r;return(r=i.hostUpdate)===null||r===void 0?void 0:r.call(i)}),this.update(s)):this._$Ek()}catch(i){throw e=!1,this._$Ek(),i}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return(i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};B[Xt]=!0,B.elementProperties=new Map,B.elementStyles=[],B.shadowRootOptions={mode:"open"},Ae==null||Ae({ReactiveElement:B}),((Ut=_t.reactiveElementVersions)!==null&&Ut!==void 0?Ut:_t.reactiveElementVersions=[]).push("1.6.3");/**
|
|
30
|
+
* @license
|
|
31
|
+
* Copyright 2017 Google LLC
|
|
32
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
+
*/var zt;const Et=window,F=Et.trustedTypes,xe=F?F.createPolicy("lit-html",{createHTML:n=>n}):void 0,te="$lit$",N=`lit$${(Math.random()+"").slice(9)}$`,Ze="?"+N,vn=`<${Ze}>`,U=document,nt=()=>U.createComment(""),it=n=>n===null||typeof n!="object"&&typeof n!="function",Qe=Array.isArray,yn=n=>Qe(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Bt=`[
|
|
34
|
+
\f\r]`,X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Oe=/-->/g,Se=/>/g,M=RegExp(`>|${Bt}(?:([^\\s"'>=/]+)(${Bt}*=${Bt}*(?:[^
|
|
35
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Pe=/'/g,ke=/"/g,Xe=/^(?:script|style|textarea|title)$/i,bn=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),et=bn(1),L=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ne=new WeakMap,j=U.createTreeWalker(U,129,null,!1);function ts(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return xe!==void 0?xe.createHTML(t):t}const wn=(n,t)=>{const e=n.length-1,s=[];let i,r=t===2?"<svg>":"",o=X;for(let a=0;a<e;a++){const h=n[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===X?l[1]==="!--"?o=Oe:l[1]!==void 0?o=Se:l[2]!==void 0?(Xe.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=M):l[3]!==void 0&&(o=M):o===M?l[0]===">"?(o=i??X,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,c=l[1],o=l[3]===void 0?M:l[3]==='"'?ke:Pe):o===ke||o===Pe?o=M:o===Oe||o===Se?o=X:(o=M,i=void 0);const p=o===M&&n[a+1].startsWith("/>")?" ":"";r+=o===X?h+vn:d>=0?(s.push(c),h.slice(0,d)+te+h.slice(d)+N+p):h+N+(d===-2?(s.push(void 0),a):p)}return[ts(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),s]};class rt{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const a=t.length-1,h=this.parts,[c,l]=wn(t,e);if(this.el=rt.createElement(c,s),j.currentNode=this.el.content,e===2){const d=this.el.content,u=d.firstChild;u.remove(),d.append(...u.childNodes)}for(;(i=j.nextNode())!==null&&h.length<a;){if(i.nodeType===1){if(i.hasAttributes()){const d=[];for(const u of i.getAttributeNames())if(u.endsWith(te)||u.startsWith(N)){const p=l[o++];if(d.push(u),p!==void 0){const v=i.getAttribute(p.toLowerCase()+te).split(N),y=/([.?@])?(.*)/.exec(p);h.push({type:1,index:r,name:y[2],strings:v,ctor:y[1]==="."?_n:y[1]==="?"?Cn:y[1]==="@"?An:Pt})}else h.push({type:6,index:r})}for(const u of d)i.removeAttribute(u)}if(Xe.test(i.tagName)){const d=i.textContent.split(N),u=d.length-1;if(u>0){i.textContent=F?F.emptyScript:"";for(let p=0;p<u;p++)i.append(d[p],nt()),j.nextNode(),h.push({type:2,index:++r});i.append(d[u],nt())}}}else if(i.nodeType===8)if(i.data===Ze)h.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(N,d+1))!==-1;)h.push({type:7,index:r}),d+=N.length-1}r++}}static createElement(t,e){const s=U.createElement("template");return s.innerHTML=t,s}}function K(n,t,e=n,s){var i,r,o,a;if(t===L)return t;let h=s!==void 0?(i=e._$Co)===null||i===void 0?void 0:i[s]:e._$Cl;const c=it(t)?void 0:t._$litDirective$;return(h==null?void 0:h.constructor)!==c&&((r=h==null?void 0:h._$AO)===null||r===void 0||r.call(h,!1),c===void 0?h=void 0:(h=new c(n),h._$AT(n,e,s)),s!==void 0?((o=(a=e)._$Co)!==null&&o!==void 0?o:a._$Co=[])[s]=h:e._$Cl=h),h!==void 0&&(t=K(n,h._$AS(n,t.values),h,s)),t}class $n{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){var e;const{el:{content:s},parts:i}=this._$AD,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:U).importNode(s,!0);j.currentNode=r;let o=j.nextNode(),a=0,h=0,c=i[0];for(;c!==void 0;){if(a===c.index){let l;c.type===2?l=new at(o,o.nextSibling,this,t):c.type===1?l=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(l=new xn(o,this,t)),this._$AV.push(l),c=i[++h]}a!==(c==null?void 0:c.index)&&(o=j.nextNode(),a++)}return j.currentNode=U,r}v(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 at{constructor(t,e,s,i){var r;this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cp=(r=i==null?void 0:i.isConnected)===null||r===void 0||r}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}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=K(this,t,e),it(t)?t===f||t==null||t===""?(this._$AH!==f&&this._$AR(),this._$AH=f):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):yn(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==f&&it(this._$AH)?this._$AA.nextSibling.data=t:this.$(U.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=rt.createElement(ts(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===r)this._$AH.v(s);else{const o=new $n(r,this),a=o.u(this.options);o.v(s),this.$(a),this._$AH=o}}_$AC(t){let e=Ne.get(t.strings);return e===void 0&&Ne.set(t.strings,e=new rt(t)),e}T(t){Qe(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new at(this.k(nt()),this.k(nt()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}}class Pt{constructor(t,e,s,i,r){this.type=1,this._$AH=f,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=f}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(r===void 0)t=K(this,t,e,0),o=!it(t)||t!==this._$AH&&t!==L,o&&(this._$AH=t);else{const a=t;let h,c;for(t=r[0],h=0;h<r.length-1;h++)c=K(this,a[s+h],e,h),c===L&&(c=this._$AH[h]),o||(o=!it(c)||c!==this._$AH[h]),c===f?t=f:t!==f&&(t+=(c??"")+r[h+1]),this._$AH[h]=c}o&&!i&&this.j(t)}j(t){t===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class _n extends Pt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===f?void 0:t}}const En=F?F.emptyScript:"";class Cn extends Pt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==f?this.element.setAttribute(this.name,En):this.element.removeAttribute(this.name)}}class An extends Pt{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){var s;if((t=(s=K(this,t,e,0))!==null&&s!==void 0?s:f)===L)return;const i=this._$AH,r=t===f&&i!==f||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==f&&(i===f||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}}class xn{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){K(this,t)}}const De=Et.litHtmlPolyfillSupport;De==null||De(rt,at),((zt=Et.litHtmlVersions)!==null&&zt!==void 0?zt:Et.litHtmlVersions=[]).push("2.8.0");const On=(n,t,e)=>{var s,i;const r=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:t;let o=r._$litPart$;if(o===void 0){const a=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:null;r._$litPart$=o=new at(t.insertBefore(nt(),a),a,void 0,e??{})}return o._$AI(n),o};/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2017 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*/var Wt,qt;let J=class extends B{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=On(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return L}};J.finalized=!0,J._$litElement$=!0,(Wt=globalThis.litElementHydrateSupport)===null||Wt===void 0||Wt.call(globalThis,{LitElement:J});const Le=globalThis.litElementPolyfillSupport;Le==null||Le({LitElement:J});((qt=globalThis.litElementVersions)!==null&&qt!==void 0?qt:globalThis.litElementVersions=[]).push("3.3.3");/**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2017 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*/const Sn=(n,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,n)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,n)}},Pn=(n,t,e)=>{t.constructor.createProperty(e,n)};function G(n){return(t,e)=>e!==void 0?Pn(n,t,e):Sn(n,t)}/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2017 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/function O(n){return G({...n,state:!0})}/**
|
|
48
|
+
* @license
|
|
49
|
+
* Copyright 2017 Google LLC
|
|
50
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
+
*/const kn=({finisher:n,descriptor:t})=>(e,s)=>{var i;if(s===void 0){const r=(i=e.originalKey)!==null&&i!==void 0?i:e.key,o=t!=null?{kind:"method",placement:"prototype",key:r,descriptor:t(e.key)}:{...e,key:r};return n!=null&&(o.finisher=function(a){n(a,r)}),o}{const r=e.constructor;t!==void 0&&Object.defineProperty(e,s,t(s)),n==null||n(r,s)}};/**
|
|
52
|
+
* @license
|
|
53
|
+
* Copyright 2021 Google LLC
|
|
54
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
+
*/var Jt;((Jt=window.HTMLSlotElement)===null||Jt===void 0?void 0:Jt.prototype.assignedElements)!=null;/**
|
|
56
|
+
* @license
|
|
57
|
+
* Copyright 2017 Google LLC
|
|
58
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
+
*/const es={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ss=n=>(...t)=>({_$litDirective$:n,values:t});let ns=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
60
|
+
* @license
|
|
61
|
+
* Copyright 2018 Google LLC
|
|
62
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
+
*/const Nn=ss(class extends ns{constructor(n){var t;if(super(n),n.type!==es.ATTRIBUTE||n.name!=="class"||((t=n.strings)===null||t===void 0?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(n){return" "+Object.keys(n).filter(t=>n[t]).join(" ")+" "}update(n,[t]){var e,s;if(this.it===void 0){this.it=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in t)t[r]&&!(!((e=this.nt)===null||e===void 0)&&e.has(r))&&this.it.add(r);return this.render(t)}const i=n.element.classList;this.it.forEach(r=>{r in t||(i.remove(r),this.it.delete(r))});for(const r in t){const o=!!t[r];o===this.it.has(r)||!((s=this.nt)===null||s===void 0)&&s.has(r)||(o?(i.add(r),this.it.add(r)):(i.remove(r),this.it.delete(r)))}return L}}),w=(n,t,e)=>{n&&e.style.setProperty(t,n)},he=(n,t)=>{var e,s,i,r,o,a,h,c,l,d,u;w((e=n.colors)==null?void 0:e.primary,"--primary-color",t),w((s=n.colors)==null?void 0:s.secondary,"--secondary-color",t),w((i=n.colors)==null?void 0:i.text,"--text-color",t),w((r=n.colors)==null?void 0:r.link,"--link-color",t),w((o=n.colors)==null?void 0:o.gray,"--gray-color",t),w((a=n.colors)==null?void 0:a.grayDark,"--gray-dark-color",t),w((h=n.spacing)==null?void 0:h.xs,"--spacing-xs",t),w((c=n.spacing)==null?void 0:c.sm,"--spacing-sm",t),w((l=n.spacing)==null?void 0:l.md,"--spacing-md",t),w((d=n.spacing)==null?void 0:d.lg,"--spacing-lg",t),w((u=n.spacing)==null?void 0:u.xl,"--spacing-xl",t),w(n.boxShadow,"--box-shadow",t),w(n.borderRadius,"--border-radius",t),w(n.borderRadiusSm,"--border-radius-sm",t),w(n.fontFamily,"--font-family",t)};var Dn=Object.defineProperty,Ln=Object.getOwnPropertyDescriptor,ct=(n,t,e,s)=>{for(var i=s>1?void 0:s?Ln(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&Dn(t,e,i),i};class H extends J{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 s;const t=((s=this.container)==null?void 0:s.get("$settings"))??{},e=t==null?void 0:t.components[t==null?void 0:t.entry];e&&he(e.context,this)}async _renderSymbol(t){const e=async r=>await Promise.resolve().then(()=>require("./index-6dd00f59.js")).then(a=>a[r]);if(!t)return f;const{type:s,content:i}=t;switch(s){case"Telia":{const r=await e(i);return r?et`<telia-icon
|
|
64
|
+
class="trigger-icon"
|
|
65
|
+
svg=${r.svg}
|
|
66
|
+
size="lg"
|
|
67
|
+
></telia-icon>`:f}case"FontAwesome":return et`<i class="trigger-fa-icon fa fa-${i}"></i>`;case"Uri":return et`<i
|
|
68
|
+
class="trigger-custom-icon"
|
|
69
|
+
style="background: url(${i}) no-repeat center center;background-size: contain;"
|
|
70
|
+
></i>`;default:return f}}render(){return et`<button
|
|
71
|
+
class=${Nn({trigger:!0,active:this.active,rendered:this.loaded})}
|
|
72
|
+
@click=${this._toggleActive}
|
|
73
|
+
>
|
|
74
|
+
${this.icon}
|
|
75
|
+
<span class="trigger-close">
|
|
76
|
+
<svg
|
|
77
|
+
width="18"
|
|
78
|
+
height="9"
|
|
79
|
+
viewBox="0 0 18 9"
|
|
80
|
+
fill="none"
|
|
81
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
82
|
+
>
|
|
83
|
+
<path
|
|
84
|
+
d="M9 9C8.81794 9.00045 8.63759 8.96634 8.46939 8.89965C8.3012 8.83295 8.14851 8.735 8.02015 8.61145L0.194523 1.12367C0.068294 0.99862 -0.00155266 0.831133 2.61958e-05 0.657285C0.00160506 0.483436 0.0744832 0.317136 0.202964 0.194202C0.331445 0.0712675 0.505249 0.00153576 0.686941 2.50649e-05C0.868634 -0.00148563 1.04368 0.0653456 1.17437 0.186125L9 7.6739L16.8256 0.186125C16.9563 0.0653456 17.1314 -0.00148563 17.3131 2.50649e-05C17.4948 0.00153576 17.6686 0.0712675 17.797 0.194202C17.9255 0.317136 17.9984 0.483436 18 0.657285C18.0016 0.831133 17.9317 0.99862 17.8055 1.12367L9.97985 8.61145C9.85149 8.735 9.6988 8.83295 9.53061 8.89965C9.36241 8.96634 9.18206 9.00045 9 9Z"
|
|
85
|
+
fill="white"
|
|
86
|
+
/>
|
|
87
|
+
</svg>
|
|
88
|
+
</span>
|
|
89
|
+
<span class="trigger-loader">
|
|
90
|
+
<svg viewBox="25 25 50 50">
|
|
91
|
+
<circle
|
|
92
|
+
cx="50"
|
|
93
|
+
cy="50"
|
|
94
|
+
r="20"
|
|
95
|
+
fill="none"
|
|
96
|
+
stroke="#000"
|
|
97
|
+
stroke-width="2"
|
|
98
|
+
stroke-miterlimit="10"
|
|
99
|
+
/>
|
|
100
|
+
</svg>
|
|
101
|
+
</span>
|
|
102
|
+
</button>`}}H.styles=[ce`
|
|
103
|
+
:host {
|
|
104
|
+
--voca-rem-multiplier: 0.625;
|
|
105
|
+
display: block;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.trigger {
|
|
110
|
+
position: fixed;
|
|
111
|
+
transform: scale(0);
|
|
112
|
+
box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 40px;
|
|
113
|
+
bottom: 20px;
|
|
114
|
+
right: 20px;
|
|
115
|
+
z-index: 5;
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
border: none;
|
|
120
|
+
line-height: 55px;
|
|
121
|
+
height: 55px;
|
|
122
|
+
width: 55px;
|
|
123
|
+
border-radius: 55px;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
background-color: var(--trigger-bg, var(--primary-color));
|
|
126
|
+
font-family: Lato;
|
|
127
|
+
text-decoration: none;
|
|
128
|
+
border: 3px dashed transparent;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
transition: transform 200ms ease-out;
|
|
131
|
+
}
|
|
132
|
+
.trigger:hover {
|
|
133
|
+
transform: scale(1.1) !important;
|
|
134
|
+
}
|
|
135
|
+
.trigger.rendered {
|
|
136
|
+
transform: scale(1);
|
|
137
|
+
}
|
|
138
|
+
.trigger.active .trigger-icon {
|
|
139
|
+
opacity: 0;
|
|
140
|
+
transform: rotate(-180deg) scale(0);
|
|
141
|
+
}
|
|
142
|
+
.trigger.active .trigger-close {
|
|
143
|
+
opacity: 1;
|
|
144
|
+
transform: rotate(0deg) scale(1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.trigger-icon {
|
|
148
|
+
display: inline-block;
|
|
149
|
+
line-height: inherit;
|
|
150
|
+
text-align: center;
|
|
151
|
+
opacity: 1;
|
|
152
|
+
transform: rotate(0deg) scale(1);
|
|
153
|
+
transition: opacity 200ms ease-out, transform 200ms ease-out;
|
|
154
|
+
color: var(--trigger-text-color, #fff);
|
|
155
|
+
}
|
|
156
|
+
.trigger-close {
|
|
157
|
+
opacity: 0;
|
|
158
|
+
transition: transform 200ms ease-out;
|
|
159
|
+
transform: rotate(180deg) scale(0);
|
|
160
|
+
position: absolute;
|
|
161
|
+
top: 0;
|
|
162
|
+
bottom: 0;
|
|
163
|
+
left: 0;
|
|
164
|
+
right: 0;
|
|
165
|
+
display: flex;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
align-items: center;
|
|
168
|
+
fill: var(--trigger-text-color, #fff);
|
|
169
|
+
}
|
|
170
|
+
`];ct([G({attribute:!1})],H.prototype,"symbol",2);ct([G({attribute:!1})],H.prototype,"container",2);ct([O()],H.prototype,"active",2);ct([O()],H.prototype,"loaded",2);ct([O()],H.prototype,"icon",2);var V=(n=>(n.Inline="inline",n.Link="link",n.Badge="badge",n.Unsupported="unsupported",n))(V||{});const Mn=(n,t)=>n&&t?"both":n?"widgetDOM":t?"triggerDOM":"none",is=n=>n?typeof n=="boolean"&&n?"link":typeof n=="object"&&!Array.isArray(n)?"badge":"unsupported":"inline",In=async(n,t,e,s,i,r=!1)=>{var l,d;const o=Mn(e,s),a=is(i),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",H);const p=document.createElement("ace-widget-trigger");p.symbol=i.symbol,p.container=n,document.body.appendChild(p),console.log("Created trigger"),c.triggerDOMElement=p}break}}return c},Rn="modals";class Tn{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 i=t.get("widgetDOMElements")||[];t.register("widgetDOMElements",[...i,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===V.Badge&&pn(e),Promise.resolve().then(()=>require("./render-938224a8.js")).then(i=>i.default(this.container,t)).then(()=>{if(t.setAttribute("data-rendered","true"),e&&this.options.triggerType===V.Badge){const r=this.options.triggerOptions.openTooltip;Ke(e,r)}Ss(this.container,t);const i=this.container.get("$environment").widgets.all();S(this.container,Rn,m.Session).then(r=>{r&&r.forEach(o=>{i.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:i,symbol:r,ariaLabel:o,closedTooltip:a,openTooltip:h}=t,c={closedTooltip:a,openTooltip:h};this.options.triggerOptions=c;const l=dn(e,{label:i,symbol:r,ariaLabel:o,widgetName:s,tooltip:a});this.unsubscribe.push(l)}async dispose(){var s,i,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&&((i=t.parentNode)==null||i.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 ut="changesets",jn=n=>{const t={tags:n.tags};return n.context&&typeof n.context!="function"&&(t.context=n.context),n.properties&&typeof n.properties!="function"&&(t.properties=n.properties),n.layout&&typeof n.layout!="function"&&(t.layout=n.layout),t};class le{constructor(t,e){this.container=t,this.storageWriter=e}static create(t){return k(t,ut,g.Necessary,{medium:m.Local}).then(e=>new le(t,e))}write(t,e,s,i){return A(this)(()=>S(this.container,ut,m.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:i,attributes:jn(s),rules:e.rules},this.storageWriter({keys:o,items:a})}))}remove(t){return A(this)(()=>S(this.container,ut,m.Local).then((e={})=>{const{keys:s=[],items:i={}}=e,r=s.indexOf(t);if(r>-1)return s.splice(r,1),delete i[t],this.storageWriter(e)}))}load(t){return A(this)(()=>S(this.container,ut,m.Local).then((e={})=>{const{keys:s=[],items:i={}}=e;s.forEach(r=>{const o=i[r];if(o){const{rules:a,attributes:h,options:c}=o;t.write({attributes:h,options:c,target:new Y(t,a)})}})}))}}const Vn=n=>{const{container:t}=n;return le.create(t).then(e=>{const s=t.get("$settings"),i={localStorage:e},r=new Z(n,i),o=Be(r,s);return n.events.subscribe("widget:state-change",(a,h)=>{h.state===je.Deactivating&&o()}),r})},Un=n=>Promise.resolve().then(()=>hn).then(({StorageProvider:t})=>new t),Hn=n=>Promise.resolve().then(()=>se).then(({ActionResolver:t})=>new t(n)),zn=n=>Promise.resolve().then(()=>se).then(({ComponentResolver:t})=>new t(n)),Bn=n=>Promise.resolve().then(()=>se).then(()=>Vn(n.get("$widget"))),Ft="$settings",Kt="open",Me="activeStickyWidget";class Wn extends Es{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(i=>{const{activate:r}=i;(typeof r>"u"||r===null||r===!0)&&(this.activated=(this.activated||this.widget.activate()).then(()=>this.attach(s)))})},this.container.registerAsync("storage",()=>Un(this.container)),this.container.registerFactory("settings",()=>S(this.container,Ft,m.Local).then((e={})=>({...this.container.get("$settings"),...e}))),bs(this,"load",this.handleBootstrapping),this.container.registerAsync("componentResolver",()=>zn(this.container)),this.container.registerAsync("actionResolver",()=>Hn(this.container)),this.container.register("matchMedia",window.matchMedia),this.container.registerAsync("components",()=>Bn(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:i},r])=>(s.subscribe(this.widget.name,(h,c,l)=>this.onAction(c,l)),(h=>{i.nodes.query({type:"view"}).forEach(c=>{i.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:i=ot(),triggerDOMElement:r,withRenderState:o}=t,h=is(e)===V.Inline&&((r==null?void 0:r.childElementCount)||0)>0,c=await In(this.container,this.widget.name,s,r,e,h);this.outlets.size<1&&!o&&this.setRenderState("unset");const l=()=>{const v=()=>y.querySelectorAll("[data-loading=true]").length===0,[y]=this.widget.container.get("widgetDOMElements"),C=(Nt,_)=>{v()&&(c.callback&&c.callback(),_.disconnect())},ht={attributes:!0,subtree:!0,childList:!0};v()&&c.callback&&c.callback(),new MutationObserver(C).observe(y,ht)};h&&this.widget.container.getAsync("dataClient").then(({events:v})=>{v.subscribe("data-client:fetched",(y,C)=>{C.unresolvedQueries===0&&l()})});const d=this.getOrCreateViewOutlet(i,c);if(this.outlets.set(i,d),this.widget.events.dispatch("widget:attached",{},{bubbles:!0}),c.triggerType===V.Badge&&e&&((u=c.triggerDOMElement)==null||u.setAttribute("aria-expanded","false"),d==null||d.renderBadge(e)),c.triggerType!==V.Inline&&((p=c.triggerDOMElement)==null||p.addEventListener("click",v=>{v.preventDefault(),this.container.get("settings").then(({trigger:y})=>{d.render().then(()=>this.renderState()).then(C=>y&&y.action&&y.action==="hide"?C===$.open?this.hide():this.open():C===$.open?this.close():this.open())})})),this.outlets.size>1)return this.renderState().then(v=>{this.triggerStateIfApplicable(v)});if(o)return o==="storage"?this.renderState().then(v=>{if(c.triggerType===V.Inline){this.triggerStateIfApplicable("open");return}this.triggerStateIfApplicable(v)}):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 Tn(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"),k(this.container,Ft,g.Necessary,{medium:m.Local})]).then(([e,s])=>Promise.resolve(t(e)).then(i=>s(i).then(()=>{const r={...e,...i};return this.widget.events.dispatch("widget:settings-updated",r),r})))}clearSettings(){return k(this.container,Ft,g.Necessary,{medium:m.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(()=>S(this.container,Kt,m.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(i=>{var r;return(r=i.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}}setRenderState(t){const{invoke:e,events:s}=this.container.get("$widget");return Promise.all([k(this.container,Kt,g.Necessary,{medium:m.Session}),k(this.container,Kt,g.Necessary,{medium:m.Local,duration:{minutes:5}}),e("renderState")]).then(([i,r,o])=>{t==="unset"||!t?(r(),i()):i(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:i}=this.container.get("$settings");return s.activate!==i?this.setSettings(()=>Promise.resolve({activate:i})):Promise.resolve()}))().then(()=>t).then(({components:s})=>{this.outlets.forEach(i=>{var r;return(r=i.options.triggerDOMElement)==null?void 0:r.setAttribute("aria-expanded","false")})})}setTriggerState(t){this.outlets.forEach(e=>{const{options:{triggerDOMElement:s,triggerOptions:i}}=e,{openTooltip:r,closedTooltip:o}=i||{};s&&(t?Ke(s,r):un(s,o))})}deactivate(){this.subs.forEach(e=>e());const t=[];return this.outlets.forEach(e=>t.push(e.dispose())),S(this.container,Me,m.Local).then(e=>e===this.widget.name?k(this.container,Me,g.Necessary,{medium:m.Local,scope:Q.Implementation}).then(s=>s()).then(()=>Promise.all(t)):Promise.all(t))}}/**
|
|
171
|
+
* @license
|
|
172
|
+
* Copyright 2021 Google LLC
|
|
173
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
174
|
+
*/let rs=class extends Event{constructor(t,e,s){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=e,this.subscribe=s!=null&&s}};/**
|
|
175
|
+
* @license
|
|
176
|
+
* Copyright 2021 Google LLC
|
|
177
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
178
|
+
*//**
|
|
179
|
+
* @license
|
|
180
|
+
* Copyright 2021 Google LLC
|
|
181
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
182
|
+
*/let qn=class{constructor(t,e,s,i){var r;if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,a)=>{this.unsubscribe&&(this.unsubscribe!==a&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,a)),this.unsubscribe=a},this.host=t,e.context!==void 0){const o=e;this.context=o.context,this.callback=o.callback,this.subscribe=(r=o.subscribe)!==null&&r!==void 0&&r}else this.context=e,this.callback=s,this.subscribe=i!=null&&i;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new rs(this.context,this.t,this.subscribe))}};/**
|
|
183
|
+
* @license
|
|
184
|
+
* Copyright 2021 Google LLC
|
|
185
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
186
|
+
*/class Jn{constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[e,{disposer:s}]of this.subscriptions)e(this.o,s)},t!==void 0&&(this.value=t)}get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:i}=this.subscriptions.get(t);t(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
187
|
+
* @license
|
|
188
|
+
* Copyright 2021 Google LLC
|
|
189
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
190
|
+
*/class Fn extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class W extends Jn{constructor(t,e,s){super(e.context!==void 0?e.initialValue:s),this.onContextRequest=i=>{const r=i.composedPath()[0];i.context===this.context&&r!==this.host&&(i.stopPropagation(),this.addCallback(i.callback,r,i.subscribe))},this.onProviderRequest=i=>{const r=i.composedPath()[0];if(i.context!==this.context||r===this.host)return;const o=new Set;for(const[a,{consumerHost:h}]of this.subscriptions)o.has(a)||(o.add(a),h.dispatchEvent(new rs(this.context,a,!0)));i.stopPropagation()},this.host=t,e.context!==void 0?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Fn(this.context))}}/**
|
|
191
|
+
* @license
|
|
192
|
+
* Copyright 2022 Google LLC
|
|
193
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
194
|
+
*/function Kn({context:n,subscribe:t}){return kn({finisher:(e,s)=>{e.addInitializer(i=>{new qn(i,{context:n,callback:r=>{i[s]=r},subscribe:t})})}})}const os="children",as="descriptor",cs="container",hs="context",ls="layout",ds="properties";class us{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 Z.getInstance(this._container),i=new Y(s).withId(this._descriptor.id);await s.actions(i,this._descriptor.type||ot()).dispatch(t,e)}}const Gn=async(n,t)=>{const e=n.properties().provider;let s={},i="";Array.isArray(e)?(i=e[0],s=e[1]):i=e||"";const r=await t.getAsync(i);if(!r)throw new Error("No provider defined in ListComponent");return r.applyComponentNodeSettings(n.node.id,s),{provider:r,settings:s}},Yn=async(n,t)=>{const{provider:e,settings:s={}}=await Gn(n,t);return{addResource:(i,r)=>e.addResource(i,r),getData:(i,r)=>e.getData(i,r,s)}};class ps{constructor(t){this.container=t,this.resources=new Map,this.nodeConfiguration=new Map}async getData(t,e,s){const i=this.resources.get(t);if(!i)throw new Error(`Unable to get EntityProvider for "${t}"`);return await i.query(e,s)}addResource(t,e){this.resources.set(t,e)}applyComponentNodeSettings(t,e){this.nodeConfiguration.set(t,e)}}const Ie=n=>({title:n.Title,id:n.Id.toString()});class Zn extends ps{constructor(t){super(t),this.addResource("item",{query:async(e,s)=>{const i=e.itemId,r="78aacc09-ae6f-5485-5ca3-9dacebb95825",o=t.get("$widget").name,a=s.projection||"",c=await(await fetch(`${a}/guides/${i}?client=${r}&funnel=${o}&site=%2F%2Fdemo.humany.cc%2Fadmin%2Finterfaces&phrase=&connectionId=&p.LastGuideId=2857`)).json();return c?Ie(c):null}}),this.addResource("items",{query:async(e,s)=>{const i="",r=t.get("$widget").name,o=s.projection||"",d=await(await fetch(`${o}/guides?client=${i}&funnel=${r}&site=&phrase=&skip=0&take=10&sorting.type=popularity&sorting.direction=descending`)).json();return{items:(d.Matches||[]).map(u=>Ie(u)),totalItems:(d==null?void 0:d.TotalMatches)||0}}})}}const Qn=async n=>{n.registerAsync("guideProvider",()=>new Zn(n))},Xn=(n,t,e,s,i)=>n.getAsync("componentResolver").then(r=>(r.registerComponent(t,e),We(n,t,s||(()=>{}),t,i))),ti=n=>{const t={};return Object.keys(n).forEach(e=>{e.indexOf("css-")>-1&&(t[e]=n[e])}),t},gs=(n,t)=>{const e=ti(t);Object.entries(e).forEach(([s,i])=>{n.style.setProperty(s.replace("css-",""),i)})};var ei=Object.defineProperty,si=Object.getOwnPropertyDescriptor,I=(n,t,e,s)=>{for(var i=s>1?void 0:s?si(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(t,e,i):o(i))||i);return s&&i&&ei(t,e,i),i};const ni=n=>{class t extends n{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new W(this,as,void 0),this._childrenProvider=new W(this,os,[]),this._propertiesProvider=new W(this,ds,{}),this._contextProvider=new W(this,hs,{}),this._layoutProvider=new W(this,ls,{}),this.actions=new us(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),Z.getInstance(this.container).then(async s=>{var r;const i=s.nodes.get(this.entry);if(i){this._propertyChangeListener=s.events.subscribe("components:properties-changed",(l,d)=>{i.id===d.node.id&&this._setProperties(d.node.attributes.properties)}),this._contextChangeListener=s.events.subscribe("components:context-changed",(l,d)=>{i.id===d.node.id&&this._setContext(d.node.attributes.context)}),this._layoutChangeListener=s.events.subscribe("components:layout-changed",(l,d)=>{i.id===d.node.id&&this._setLayout(d.node.attributes.layout)});const o="default";this._unmountNode=i.mount(this.container),this._setDescriptor(Yt(i,o)),this._setProperties(i.attributes.properties),this._setContext(i.attributes.context),this._setLayout(this.layout);const a=i.getChildren(o).map(l=>Yt(l));this._childrenProvider.setValue(a);const c=(await this.container.getAsync("componentResolver")).getComponent(((r=this.descriptor)==null?void 0:r.type)||"");c.then&&c.then(l=>{this.component=l.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),he(this.context,this.renderRoot.host),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),gs(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=[n.styles??[],ce`
|
|
195
|
+
:host {
|
|
196
|
+
font-family: var(--font-family);
|
|
197
|
+
grid-column: span var(--width);
|
|
198
|
+
max-width: 100%;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
box-sizing: border-box;
|
|
201
|
+
display: block;
|
|
202
|
+
}
|
|
203
|
+
* {
|
|
204
|
+
box-sizing: border-box;
|
|
205
|
+
}
|
|
206
|
+
`],I([Kn({context:cs}),G({attribute:!1})],t.prototype,"container",2),I([G()],t.prototype,"entry",2),I([O()],t.prototype,"descriptor",2),I([O()],t.prototype,"component",2),I([O()],t.prototype,"context",2),I([O()],t.prototype,"layout",2),I([O()],t.prototype,"properties",2),t};console.log("test12323425324222");exports.A=f;exports.ActionsController=us;exports.DataProvider=ps;exports.GuideProviderPlugin=Qn;exports.T=L;exports.Widget=Wn;exports.WidgetComponent=ni;exports.appendStyleFromProperties=gs;exports.childrenContext=os;exports.containerContext=cs;exports.contextCtx=hs;exports.createDataProvider=Yn;exports.createLitComponent=Xn;exports.descriptorContext=as;exports.e=ss;exports.i=ns;exports.i$1=W;exports.i$2=ce;exports.layoutCtx=ls;exports.mapBranding=he;exports.mt=$;exports.n=G;exports.propertiesCtx=ds;exports.pt=Z;exports.s=J;exports.t=es;exports.t$1=O;exports.x=et;
|