@telia-ace/widget-site 1.0.13-next.2 → 1.1.76-rc.2

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/index.js CHANGED
@@ -2,26 +2,26 @@
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const L=globalThis,J=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ht=Symbol(),F=new WeakMap;let ut=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ht)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(J&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&F.set(e,t))}return t}toString(){return this.cssText}};const $t=n=>new ut(typeof n=="string"?n:n+"",void 0,ht),gt=(n,t)=>{if(J)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=L.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},G=J?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $t(e)})(n):n;/**
5
+ */const L=globalThis,J=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,at=Symbol(),Z=new WeakMap;let ut=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==at)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(J&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Z.set(e,t))}return t}toString(){return this.cssText}};const $t=n=>new ut(typeof n=="string"?n:n+"",void 0,at),_t=(n,t)=>{if(J)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=L.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},F=J?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $t(e)})(n):n;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:ft,defineProperty:_t,getOwnPropertyDescriptor:mt,getOwnPropertyNames:yt,getOwnPropertySymbols:wt,getPrototypeOf:At}=Object,f=globalThis,Q=f.trustedTypes,vt=Q?Q.emptyScript:"",z=f.reactiveElementPolyfillSupport,T=(n,t)=>n,D={toAttribute(n,t){switch(t){case Boolean:n=n?vt: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}},K=(n,t)=>!ft(n,t),Y={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&_t(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=mt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const c=s==null?void 0:s.call(this);r.call(this,o),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=At(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,i=[...yt(e),...wt(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(G(s))}else t!==void 0&&e.push(G(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var r;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:D).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var r;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:D;this._$Em=s,this[s]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??K)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[T("elementProperties")]=new Map,b[T("finalized")]=new Map,z==null||z({ReactiveElement:b}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:ft,defineProperty:gt,getOwnPropertyDescriptor:mt,getOwnPropertyNames:yt,getOwnPropertySymbols:At,getPrototypeOf:wt}=Object,f=globalThis,G=f.trustedTypes,vt=G?G.emptyScript:"",B=f.reactiveElementPolyfillSupport,T=(n,t)=>n,D={toAttribute(n,t){switch(t){case Boolean:n=n?vt: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}},K=(n,t)=>!ft(n,t),Q={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:K};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Q){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&gt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=mt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const c=s==null?void 0:s.call(this);r.call(this,o),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Q}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=wt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,i=[...yt(e),...At(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(F(s))}else t!==void 0&&e.push(F(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _t(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var r;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:D).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var r;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:D;this._$Em=s,this[s]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??K)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[T("elementProperties")]=new Map,b[T("finalized")]=new Map,B==null||B({ReactiveElement:b}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const M=globalThis,W=M.trustedTypes,X=W?W.createPolicy("lit-html",{createHTML:n=>n}):void 0,ct="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,dt="?"+g,bt=`<${dt}>`,A=document,N=()=>A.createComment(""),H=n=>n===null||typeof n!="object"&&typeof n!="function",Z=Array.isArray,Et=n=>Z(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",B=`[
14
- \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,y=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,st=/"/g,lt=/^(?:script|style|textarea|title)$/i,S=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),nt=new WeakMap,w=A.createTreeWalker(A,129);function pt(n,t){if(!Z(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return X!==void 0?X.createHTML(t):t}const St=(n,t)=>{const e=n.length-1,i=[];let s,r=t===2?"<svg>":t===3?"<math>":"",o=x;for(let c=0;c<e;c++){const a=n[c];let l,p,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===x?p[1]==="!--"?o=tt:p[1]!==void 0?o=et:p[2]!==void 0?(lt.test(p[2])&&(s=RegExp("</"+p[2],"g")),o=y):p[3]!==void 0&&(o=y):o===y?p[0]===">"?(o=s??x,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?y:p[3]==='"'?st:it):o===st||o===it?o=y:o===tt||o===et?o=x:(o=y,s=void 0);const $=o===y&&n[c+1].startsWith("/>")?" ":"";r+=o===x?a+bt:h>=0?(i.push(l),a.slice(0,h)+ct+a.slice(h)+g+$):a+g+(h===-2?c:$)}return[pt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class I{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const c=t.length-1,a=this.parts,[l,p]=St(t,e);if(this.el=I.createElement(l,i),w.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=w.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(ct)){const u=p[o++],$=s.getAttribute(h).split(g),j=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:j[2],strings:$,ctor:j[1]==="."?Pt:j[1]==="?"?Ct:j[1]==="@"?Ot:k}),s.removeAttribute(h)}else h.startsWith(g)&&(a.push({type:6,index:r}),s.removeAttribute(h));if(lt.test(s.tagName)){const h=s.textContent.split(g),u=h.length-1;if(u>0){s.textContent=W?W.emptyScript:"";for(let $=0;$<u;$++)s.append(h[$],N()),w.nextNode(),a.push({type:2,index:++r});s.append(h[u],N())}}}else if(s.nodeType===8)if(s.data===dt)a.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(g,h+1))!==-1;)a.push({type:7,index:r}),h+=g.length-1}r++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function U(n,t,e=n,i){var o,c;if(t===S)return t;let s=i!==void 0?(o=e.o)==null?void 0:o[i]:e.l;const r=H(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((c=s==null?void 0:s._$AO)==null||c.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,e,i)),i!==void 0?(e.o??(e.o=[]))[i]=s:e.l=s),s!==void 0&&(t=U(n,s._$AS(n,t.values),s,i)),t}class Ut{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??A).importNode(e,!0);w.currentNode=s;let r=w.nextNode(),o=0,c=0,a=i[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new R(r,r.nextSibling,this,t):a.type===1?l=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(l=new xt(r,this,t)),this._$AV.push(l),a=i[++c]}o!==(a==null?void 0:a.index)&&(r=w.nextNode(),o++)}return w.currentNode=A,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class R{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this.v}constructor(t,e,i,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this.v=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),H(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Et(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=I.createElement(pt(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(e);else{const o=new Ut(s,this),c=o.u(this.options);o.p(e),this.T(c),this._$AH=o}}_$AC(t){let e=nt.get(t.strings);return e===void 0&&nt.set(t.strings,e=new I(t)),e}k(t){Z(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new R(this.O(N()),this.O(N()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(r===void 0)t=U(this,t,e,0),o=!H(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const c=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=U(this,c[i+a],e,a),l===S&&(l=this._$AH[a]),o||(o=!H(l)||l!==this._$AH[a]),l===d?t=d:t!==d&&(t+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Pt extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Ct extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Ot extends k{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??d)===S)return;const i=this._$AH,s=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==d&&(i===d||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class xt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const q=M.litHtmlPolyfillSupport;q==null||q(I,R),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.2.0");const Tt=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const r=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new R(t.insertBefore(N(),r),r,void 0,e??{})}return s._$AI(n),s};/**
13
+ */const H=globalThis,W=H.trustedTypes,X=W?W.createPolicy("lit-html",{createHTML:n=>n}):void 0,ht="$lit$",_=`lit$${(Math.random()+"").slice(9)}$`,ct="?"+_,bt=`<${ct}>`,w=document,N=()=>w.createComment(""),M=n=>n===null||typeof n!="object"&&typeof n!="function",dt=Array.isArray,Et=n=>dt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",z=`[
14
+ \f\r]`,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y=/-->/g,tt=/>/g,y=RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),et=/'/g,it=/"/g,lt=/^(?:script|style|textarea|title)$/i,S=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),st=new WeakMap,A=w.createTreeWalker(w,129);function pt(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return X!==void 0?X.createHTML(t):t}const St=(n,t)=>{const e=n.length-1,i=[];let s,r=t===2?"<svg>":"",o=x;for(let c=0;c<e;c++){const a=n[c];let l,p,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===x?p[1]==="!--"?o=Y:p[1]!==void 0?o=tt:p[2]!==void 0?(lt.test(p[2])&&(s=RegExp("</"+p[2],"g")),o=y):p[3]!==void 0&&(o=y):o===y?p[0]===">"?(o=s??x,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?y:p[3]==='"'?it:et):o===it||o===et?o=y:o===Y||o===tt?o=x:(o=y,s=void 0);const $=o===y&&n[c+1].startsWith("/>")?" ":"";r+=o===x?a+bt:h>=0?(i.push(l),a.slice(0,h)+ht+a.slice(h)+_+$):a+_+(h===-2?c:$)}return[pt(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),i]};class R{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const c=t.length-1,a=this.parts,[l,p]=St(t,e);if(this.el=R.createElement(l,i),A.currentNode=this.el.content,e===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=A.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(ht)){const u=p[o++],$=s.getAttribute(h).split(_),j=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:j[2],strings:$,ctor:j[1]==="."?Ut:j[1]==="?"?Pt:j[1]==="@"?Ot:k}),s.removeAttribute(h)}else h.startsWith(_)&&(a.push({type:6,index:r}),s.removeAttribute(h));if(lt.test(s.tagName)){const h=s.textContent.split(_),u=h.length-1;if(u>0){s.textContent=W?W.emptyScript:"";for(let $=0;$<u;$++)s.append(h[$],N()),A.nextNode(),a.push({type:2,index:++r});s.append(h[u],N())}}}else if(s.nodeType===8)if(s.data===ct)a.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(_,h+1))!==-1;)a.push({type:7,index:r}),h+=_.length-1}r++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function C(n,t,e=n,i){var o,c;if(t===S)return t;let s=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const r=M(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((c=s==null?void 0:s._$AO)==null||c.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=C(n,s._$AS(n,t.values),s,i)),t}class Ct{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??w).importNode(e,!0);A.currentNode=s;let r=A.nextNode(),o=0,c=0,a=i[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new I(r,r.nextSibling,this,t):a.type===1?l=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(l=new xt(r,this,t)),this._$AV.push(l),a=i[++c]}o!==(a==null?void 0:a.index)&&(r=A.nextNode(),o++)}return A.currentNode=w,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class I{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),M(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==S&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Et(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==d&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=R.createElement(pt(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(e);else{const o=new Ct(s,this),c=o.u(this.options);o.p(e),this.T(c),this._$AH=o}}_$AC(t){let e=st.get(t.strings);return e===void 0&&st.set(t.strings,e=new R(t)),e}k(t){dt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new I(this.S(N()),this.S(N()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(r===void 0)t=C(this,t,e,0),o=!M(t)||t!==this._$AH&&t!==S,o&&(this._$AH=t);else{const c=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=C(this,c[i+a],e,a),l===S&&(l=this._$AH[a]),o||(o=!M(l)||l!==this._$AH[a]),l===d?t=d:t!==d&&(t+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ut extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Pt extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Ot extends k{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??d)===S)return;const i=this._$AH,s=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==d&&(i===d||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class xt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}}const q=H.litHtmlPolyfillSupport;q==null||q(R,I),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.1.2");const Tt=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const r=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new I(t.insertBefore(N(),r),r,void 0,e??{})}return s._$AI(n),s};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */class E extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=Tt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return S}}var at;E._$litElement$=!0,E.finalized=!0,(at=globalThis.litElementHydrateSupport)==null||at.call(globalThis,{LitElement:E});const V=globalThis.litElementPolyfillSupport;V==null||V({LitElement:E});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");/**
19
+ */class E extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Tt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}}var ot;E._$litElement$=!0,E.finalized=!0,(ot=globalThis.litElementHydrateSupport)==null||ot.call(globalThis,{LitElement:E});const V=globalThis.litElementPolyfillSupport;V==null||V({LitElement:E});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const Mt={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:K},Nt=(n=Mt,t,e)=>{const{kind:i,metadata:s}=e;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(e.name,n),i==="accessor"){const{name:o}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,a,n)},init(c){return c!==void 0&&this.P(o,void 0,n),c}}}if(i==="setter"){const{name:o}=e;return function(c){const a=this[o];t.call(this,c),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+i)};function v(n){return(t,e)=>typeof e=="object"?Nt(n,t,e):((i,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(s,r):void 0})(n,t,e)}/**
23
+ */const Ht={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:K},Nt=(n=Ht,t,e)=>{const{kind:i,metadata:s}=e;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(e.name,n),i==="accessor"){const{name:o}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,a,n)},init(c){return c!==void 0&&this.P(o,void 0,n),c}}}if(i==="setter"){const{name:o}=e;return function(c){const a=this[o];t.call(this,c),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+i)};function v(n){return(t,e)=>typeof e=="object"?Nt(n,t,e):((i,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(s,r):void 0})(n,t,e)}/**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */function P(n){return v({...n,state:!0,attribute:!1})}var Ht=Object.defineProperty,It=Object.getOwnPropertyDescriptor,C=(n,t,e,i)=>{for(var s=i>1?void 0:i?It(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Ht(t,e,s),s};const rt="https://widgets.ace.teliacompany.net",ot="https://embed.webprovisions.io",Rt=()=>{if(typeof window<"u"){const n=history.pushState,t=history.replaceState;history.pushState=function(...e){n.apply(history,e),window.dispatchEvent(new Event("locationchange"))},history.replaceState=function(...e){t.apply(history,e),window.dispatchEvent(new Event("locationchange"))}}};class _ extends E{constructor(){var t;super(...arguments),this.apiUrl=rt,this.embedUrl=ot,this._site=null,this._widgets={},this._path=((t=window==null?void 0:window.location)==null?void 0:t.pathname)||"",this.routeChangeListener=()=>{this._path=window.location.pathname,this.requestUpdate()}}async connectedCallback(){super.connectedCallback(),Rt(),await this.loadSite(),window.addEventListener("locationchange",this.routeChangeListener)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("locationchange",this.routeChangeListener)}async loadSite(){var i;const e=await(await fetch(`${this.apiUrl}/api/site/${this.siteId}`)).json();this._site=e,(((i=this._site)==null?void 0:i.widgets)||[]).forEach(async s=>{this.addWidgetEl(s.widgetId)})}addWidgetEl(t){const e=`ace-widget_${t}`;let i=document.getElementById(e);i||(i=document.createElement("ace-widget-wrapper"),i.setAttribute("id",e),i.setAttribute("widgetId",t),this.apiUrl!==rt&&i.setAttribute("apiUrl",this.apiUrl),this.embedUrl!==ot&&i.setAttribute("embedUrl",this.embedUrl),document.body.appendChild(i)),this._widgets={...this._widgets,[t]:i},window.ace=window.ace||{_c:[],_w:[],widget:function(s,r){window.ace._w.push([s,r])},configure:function(s){window.ace._c.push(s)}}}render(){if(!this._site)return d;const t=jt(this._site);for(const[e,i]of Object.entries(this._widgets)){const s=t.find(r=>r.widgetId===e);s&&!i.isActivated()?i.activate():!s&&i.isActivated()&&i.deactivate()}return d}}C([v({attribute:!0})],_.prototype,"siteId",2);C([v()],_.prototype,"apiUrl",2);C([v()],_.prototype,"embedUrl",2);C([P()],_.prototype,"_site",2);C([P()],_.prototype,"_widgets",2);C([P()],_.prototype,"_path",2);const jt=n=>{const t=[];return(n.triggers||[]).filter(e=>e.triggerType==="visit").forEach(e=>{const i=window.location.pathname,s=e.condition.outputs||[];e.condition.type==="url"&&s.forEach(r=>{const o=r.action.type==="render_widget";if((r.value===i||r.value==="*")&&o){let a={widgetId:""};try{a=JSON.parse(r.action.data)}catch{a={widgetId:""}}const l=t.findIndex(h=>h.widgetId===a.widgetId)>-1,p=((n==null?void 0:n.widgets)||[]).find(h=>h.widgetId===a.widgetId);p&&!l&&t.push(p)}})}),t};window.customElements.get("ace-site")||window.customElements.define("ace-site",_);var Lt=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,O=(n,t,e,i)=>{for(var s=i>1?void 0:i?Dt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Lt(t,e,s),s};const Wt="https://widgets.ace.teliacompany.net",kt="https://embed.webprovisions.io";class m extends E{constructor(){super(...arguments),this.apiUrl=Wt,this.embedUrl=kt,this.widget=null,this.scriptEl=null,this.activated=!1}async connectedCallback(){super.connectedCallback(),this.widget=await this._loadWidget(this.widgetId)}async _loadWidget(t){return await(await fetch(`${this.apiUrl}/api/widget/${t}`)).json()}_createEmbedScript(){var e;if(!((e=this.widget)!=null&&e.distributionName))return;let t=document.createElement("script");t.setAttribute("type","module"),t.setAttribute("async","true"),t.setAttribute("src",`${this.embedUrl}/d/${this.widget.organization}/${this.widget.distributionName}@latest/index.js`),this.scriptEl=t}isActivated(){return this.activated}async activate(){var e;this.widget||(this.widget=await this._loadWidget(this.widgetId)),this._createEmbedScript(),this.activated=!0;const t=(((e=window.ace)==null?void 0:e.applications)||[]).find(i=>i.id===this.widgetId);t&&(t.storage.get("open")&&t.appendToDOM(),t.trigger.showTrigger())}async deactivate(){this.activated=!1;const t=window.ace.applications.find(e=>e.id===this.widgetId);if(t){const e=t.storage.get("open");t.hide(),t.trigger.hideTrigger(),e&&t.storage.set("open",!0,"necessary")}}render(){return this.scriptEl?this.scriptEl:d}}O([v({attribute:!0})],m.prototype,"widgetId",2);O([v()],m.prototype,"apiUrl",2);O([v()],m.prototype,"embedUrl",2);O([P()],m.prototype,"widget",2);O([P()],m.prototype,"scriptEl",2);O([P()],m.prototype,"activated",2);customElements.get("ace-widget-wrapper")||customElements.define("ace-widget-wrapper",m);exports.SiteComponent=_;exports.WidgetComponent=m;
27
+ */function U(n){return v({...n,state:!0,attribute:!1})}var Mt=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,P=(n,t,e,i)=>{for(var s=i>1?void 0:i?Rt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Mt(t,e,s),s};const nt="https://widgets.ace.teliacompany.net",rt="https://embed.webprovisions.io",It=()=>{if(typeof window<"u"){const n=history.pushState,t=history.replaceState;history.pushState=function(...e){n.apply(history,e),window.dispatchEvent(new Event("locationchange"))},history.replaceState=function(...e){t.apply(history,e),window.dispatchEvent(new Event("locationchange"))}}};class g extends E{constructor(){var t;super(...arguments),this.apiUrl=nt,this.embedUrl=rt,this._site=null,this._widgets={},this._path=((t=window==null?void 0:window.location)==null?void 0:t.pathname)||"",this.routeChangeListener=()=>{this._path=window.location.pathname,this.requestUpdate()}}async connectedCallback(){super.connectedCallback(),It(),await this.loadSite(),window.addEventListener("locationchange",this.routeChangeListener)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("locationchange",this.routeChangeListener)}async loadSite(){var i;const e=await(await fetch(`${this.apiUrl}/api/site/${this.siteId}`)).json();this._site=e,(((i=this._site)==null?void 0:i.widgets)||[]).forEach(async s=>{this.addWidgetEl(s.widgetId)})}addWidgetEl(t){const e=`ace-widget_${t}`;let i=document.getElementById(e);i||(i=document.createElement("ace-widget-wrapper"),i.setAttribute("id",e),i.setAttribute("widgetId",t),this.apiUrl!==nt&&i.setAttribute("apiUrl",this.apiUrl),this.embedUrl!==rt&&i.setAttribute("embedUrl",this.embedUrl),document.body.appendChild(i)),this._widgets={...this._widgets,[t]:i},window.ace=window.ace||{_c:[],_w:[],widget:function(s,r){window.ace._w.push([s,r])},configure:function(s){window.ace._c.push(s)}}}render(){if(!this._site)return d;const t=jt(this._site);for(const[e,i]of Object.entries(this._widgets)){const s=t.find(r=>r.widgetId===e);s&&!i.isActivated()?i.activate():!s&&i.isActivated()&&i.deactivate()}return d}}P([v({attribute:!0})],g.prototype,"siteId",2);P([v()],g.prototype,"apiUrl",2);P([v()],g.prototype,"embedUrl",2);P([U()],g.prototype,"_site",2);P([U()],g.prototype,"_widgets",2);P([U()],g.prototype,"_path",2);const jt=n=>{const t=[];return(n.triggers||[]).filter(e=>e.triggerType==="visit").forEach(e=>{const i=window.location.pathname,s=e.condition.outputs||[];e.condition.type==="url"&&s.forEach(r=>{const o=r.action.type==="render_widget";if((r.value===i||r.value==="*")&&o){let a={widgetId:""};try{a=JSON.parse(r.action.data)}catch{a={widgetId:""}}const l=t.findIndex(h=>h.widgetId===a.widgetId)>-1,p=((n==null?void 0:n.widgets)||[]).find(h=>h.widgetId===a.widgetId);p&&!l&&t.push(p)}})}),t};window.customElements.get("ace-site")||window.customElements.define("ace-site",g);var Lt=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,O=(n,t,e,i)=>{for(var s=i>1?void 0:i?Dt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Lt(t,e,s),s};const Wt="https://widgets.ace.teliacompany.net",kt="https://embed.webprovisions.io";class m extends E{constructor(){super(...arguments),this.apiUrl=Wt,this.embedUrl=kt,this.widget=null,this.scriptEl=null,this.activated=!1}async connectedCallback(){super.connectedCallback(),this.widget=await this._loadWidget(this.widgetId)}async _loadWidget(t){return await(await fetch(`${this.apiUrl}/api/widget/${t}`)).json()}_createEmbedScript(){var e;if(!((e=this.widget)!=null&&e.distributionName))return;const t=document.createElement("script");t.setAttribute("type","module"),t.setAttribute("async","true"),t.setAttribute("src",`${this.embedUrl}/d/${this.widget.organization}/${this.widget.distributionName}@latest/index.js`),this.scriptEl=t}isActivated(){return this.activated}async activate(){var e;this.widget||(this.widget=await this._loadWidget(this.widgetId)),this._createEmbedScript(),this.activated=!0;const t=(((e=window.ace)==null?void 0:e.applications)||[]).find(i=>i.id===this.widgetId);t&&(t.storage.get("open")&&t.appendToDOM(),t.trigger.showTrigger())}async deactivate(){this.activated=!1;const t=window.ace.applications.find(e=>e.id===this.widgetId);if(t){const e=t.storage.get("open");t.hide(),t.trigger.hideTrigger(),e&&t.storage.set("open",!0,"necessary")}}render(){return this.scriptEl?this.scriptEl:d}}O([v({attribute:!0})],m.prototype,"widgetId",2);O([v()],m.prototype,"apiUrl",2);O([v()],m.prototype,"embedUrl",2);O([U()],m.prototype,"widget",2);O([U()],m.prototype,"scriptEl",2);O([U()],m.prototype,"activated",2);customElements.get("ace-widget-wrapper")||customElements.define("ace-widget-wrapper",m);exports.SiteComponent=g;exports.WidgetComponent=m;
package/index.mjs CHANGED
@@ -3,10 +3,10 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const L = globalThis, J = L.ShadowRoot && (L.ShadyCSS === void 0 || L.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, ht = Symbol(), F = /* @__PURE__ */ new WeakMap();
6
+ const L = globalThis, J = L.ShadowRoot && (L.ShadyCSS === void 0 || L.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, at = Symbol(), Z = /* @__PURE__ */ new WeakMap();
7
7
  let ut = class {
8
8
  constructor(t, e, i) {
9
- if (this._$cssResult$ = !0, i !== ht)
9
+ if (this._$cssResult$ = !0, i !== at)
10
10
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
11
  this.cssText = t, this.t = e;
12
12
  }
@@ -15,7 +15,7 @@ let ut = class {
15
15
  const e = this.t;
16
16
  if (J && t === void 0) {
17
17
  const i = e !== void 0 && e.length === 1;
18
- i && (t = F.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && F.set(e, t));
18
+ i && (t = Z.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Z.set(e, t));
19
19
  }
20
20
  return t;
21
21
  }
@@ -23,7 +23,7 @@ let ut = class {
23
23
  return this.cssText;
24
24
  }
25
25
  };
26
- const $t = (n) => new ut(typeof n == "string" ? n : n + "", void 0, ht), ft = (n, t) => {
26
+ const $t = (n) => new ut(typeof n == "string" ? n : n + "", void 0, at), _t = (n, t) => {
27
27
  if (J)
28
28
  n.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
29
29
  else
@@ -31,7 +31,7 @@ const $t = (n) => new ut(typeof n == "string" ? n : n + "", void 0, ht), ft = (n
31
31
  const i = document.createElement("style"), s = L.litNonce;
32
32
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, n.appendChild(i);
33
33
  }
34
- }, G = J ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
34
+ }, F = J ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((t) => {
35
35
  let e = "";
36
36
  for (const i of t.cssRules)
37
37
  e += i.cssText;
@@ -42,7 +42,7 @@ const $t = (n) => new ut(typeof n == "string" ? n : n + "", void 0, ht), ft = (n
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
44
  */
45
- const { is: gt, defineProperty: _t, getOwnPropertyDescriptor: mt, getOwnPropertyNames: yt, getOwnPropertySymbols: wt, getPrototypeOf: At } = Object, g = globalThis, Q = g.trustedTypes, vt = Q ? Q.emptyScript : "", B = g.reactiveElementPolyfillSupport, T = (n, t) => n, D = { toAttribute(n, t) {
45
+ const { is: ft, defineProperty: gt, getOwnPropertyDescriptor: mt, getOwnPropertyNames: yt, getOwnPropertySymbols: At, getPrototypeOf: wt } = Object, f = globalThis, G = f.trustedTypes, vt = G ? G.emptyScript : "", W = f.reactiveElementPolyfillSupport, T = (n, t) => n, D = { toAttribute(n, t) {
46
46
  switch (t) {
47
47
  case Boolean:
48
48
  n = n ? vt : null;
@@ -70,8 +70,8 @@ const { is: gt, defineProperty: _t, getOwnPropertyDescriptor: mt, getOwnProperty
70
70
  }
71
71
  }
72
72
  return e;
73
- } }, K = (n, t) => !gt(n, t), Y = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: K };
74
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), g.litPropertyMetadata ?? (g.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
73
+ } }, K = (n, t) => !ft(n, t), Q = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: K };
74
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), f.litPropertyMetadata ?? (f.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
75
75
  class b extends HTMLElement {
76
76
  static addInitializer(t) {
77
77
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
@@ -79,10 +79,10 @@ class b extends HTMLElement {
79
79
  static get observedAttributes() {
80
80
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
81
81
  }
82
- static createProperty(t, e = Y) {
82
+ static createProperty(t, e = Q) {
83
83
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
84
84
  const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
85
- s !== void 0 && _t(this.prototype, t, s);
85
+ s !== void 0 && gt(this.prototype, t, s);
86
86
  }
87
87
  }
88
88
  static getPropertyDescriptor(t, e, i) {
@@ -99,19 +99,19 @@ class b extends HTMLElement {
99
99
  }, configurable: !0, enumerable: !0 };
100
100
  }
101
101
  static getPropertyOptions(t) {
102
- return this.elementProperties.get(t) ?? Y;
102
+ return this.elementProperties.get(t) ?? Q;
103
103
  }
104
104
  static _$Ei() {
105
105
  if (this.hasOwnProperty(T("elementProperties")))
106
106
  return;
107
- const t = At(this);
107
+ const t = wt(this);
108
108
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
109
109
  }
110
110
  static finalize() {
111
111
  if (this.hasOwnProperty(T("finalized")))
112
112
  return;
113
113
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
114
- const e = this.properties, i = [...yt(e), ...wt(e)];
114
+ const e = this.properties, i = [...yt(e), ...At(e)];
115
115
  for (const s of i)
116
116
  this.createProperty(s, e[s]);
117
117
  }
@@ -134,9 +134,9 @@ class b extends HTMLElement {
134
134
  if (Array.isArray(t)) {
135
135
  const i = new Set(t.flat(1 / 0).reverse());
136
136
  for (const s of i)
137
- e.unshift(G(s));
137
+ e.unshift(F(s));
138
138
  } else
139
- t !== void 0 && e.push(G(t));
139
+ t !== void 0 && e.push(F(t));
140
140
  return e;
141
141
  }
142
142
  static _$Eu(t, e) {
@@ -166,7 +166,7 @@ class b extends HTMLElement {
166
166
  }
167
167
  createRenderRoot() {
168
168
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
169
- return ft(t, this.constructor.elementStyles), t;
169
+ return _t(t, this.constructor.elementStyles), t;
170
170
  }
171
171
  connectedCallback() {
172
172
  var t;
@@ -283,40 +283,40 @@ class b extends HTMLElement {
283
283
  firstUpdated(t) {
284
284
  }
285
285
  }
286
- b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[T("elementProperties")] = /* @__PURE__ */ new Map(), b[T("finalized")] = /* @__PURE__ */ new Map(), B == null || B({ ReactiveElement: b }), (g.reactiveElementVersions ?? (g.reactiveElementVersions = [])).push("2.0.4");
286
+ b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[T("elementProperties")] = /* @__PURE__ */ new Map(), b[T("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: b }), (f.reactiveElementVersions ?? (f.reactiveElementVersions = [])).push("2.0.4");
287
287
  /**
288
288
  * @license
289
289
  * Copyright 2017 Google LLC
290
290
  * SPDX-License-Identifier: BSD-3-Clause
291
291
  */
292
- const N = globalThis, k = N.trustedTypes, X = k ? k.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ct = "$lit$", f = `lit$${Math.random().toFixed(9).slice(2)}$`, dt = "?" + f, bt = `<${dt}>`, y = document, H = () => y.createComment(""), M = (n) => n === null || typeof n != "object" && typeof n != "function", Z = Array.isArray, Et = (n) => Z(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", W = `[
293
- \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, tt = /-->/g, et = />/g, _ = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
294
- \f\r"'\`<>=]|("|')|))|$)`, "g"), it = /'/g, st = /"/g, lt = /^(?:script|style|textarea|title)$/i, S = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129);
292
+ const H = globalThis, k = H.trustedTypes, X = k ? k.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, ht = "$lit$", _ = `lit$${(Math.random() + "").slice(9)}$`, ct = "?" + _, bt = `<${ct}>`, y = document, N = () => y.createComment(""), M = (n) => n === null || typeof n != "object" && typeof n != "function", dt = Array.isArray, Et = (n) => dt(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", z = `[
293
+ \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Y = /-->/g, tt = />/g, g = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
294
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), et = /'/g, it = /"/g, lt = /^(?:script|style|textarea|title)$/i, S = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), st = /* @__PURE__ */ new WeakMap(), m = y.createTreeWalker(y, 129);
295
295
  function pt(n, t) {
296
- if (!Z(n) || !n.hasOwnProperty("raw"))
296
+ if (!Array.isArray(n) || !n.hasOwnProperty("raw"))
297
297
  throw Error("invalid template strings array");
298
298
  return X !== void 0 ? X.createHTML(t) : t;
299
299
  }
300
300
  const St = (n, t) => {
301
301
  const e = n.length - 1, i = [];
302
- let s, r = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = x;
302
+ let s, r = t === 2 ? "<svg>" : "", o = x;
303
303
  for (let c = 0; c < e; c++) {
304
304
  const a = n[c];
305
305
  let l, p, h = -1, u = 0;
306
306
  for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); )
307
- u = o.lastIndex, o === x ? p[1] === "!--" ? o = tt : p[1] !== void 0 ? o = et : p[2] !== void 0 ? (lt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = _) : p[3] !== void 0 && (o = _) : o === _ ? p[0] === ">" ? (o = s ?? x, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, l = p[1], o = p[3] === void 0 ? _ : p[3] === '"' ? st : it) : o === st || o === it ? o = _ : o === tt || o === et ? o = x : (o = _, s = void 0);
308
- const $ = o === _ && n[c + 1].startsWith("/>") ? " " : "";
309
- r += o === x ? a + bt : h >= 0 ? (i.push(l), a.slice(0, h) + ct + a.slice(h) + f + $) : a + f + (h === -2 ? c : $);
307
+ u = o.lastIndex, o === x ? p[1] === "!--" ? o = Y : p[1] !== void 0 ? o = tt : p[2] !== void 0 ? (lt.test(p[2]) && (s = RegExp("</" + p[2], "g")), o = g) : p[3] !== void 0 && (o = g) : o === g ? p[0] === ">" ? (o = s ?? x, h = -1) : p[1] === void 0 ? h = -2 : (h = o.lastIndex - p[2].length, l = p[1], o = p[3] === void 0 ? g : p[3] === '"' ? it : et) : o === it || o === et ? o = g : o === Y || o === tt ? o = x : (o = g, s = void 0);
308
+ const $ = o === g && n[c + 1].startsWith("/>") ? " " : "";
309
+ r += o === x ? a + bt : h >= 0 ? (i.push(l), a.slice(0, h) + ht + a.slice(h) + _ + $) : a + _ + (h === -2 ? c : $);
310
310
  }
311
- return [pt(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
311
+ return [pt(n, r + (n[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
312
312
  };
313
- class I {
313
+ class R {
314
314
  constructor({ strings: t, _$litType$: e }, i) {
315
315
  let s;
316
316
  this.parts = [];
317
317
  let r = 0, o = 0;
318
318
  const c = t.length - 1, a = this.parts, [l, p] = St(t, e);
319
- if (this.el = I.createElement(l, i), m.currentNode = this.el.content, e === 2 || e === 3) {
319
+ if (this.el = R.createElement(l, i), m.currentNode = this.el.content, e === 2) {
320
320
  const h = this.el.content.firstChild;
321
321
  h.replaceWith(...h.childNodes);
322
322
  }
@@ -324,27 +324,27 @@ class I {
324
324
  if (s.nodeType === 1) {
325
325
  if (s.hasAttributes())
326
326
  for (const h of s.getAttributeNames())
327
- if (h.endsWith(ct)) {
328
- const u = p[o++], $ = s.getAttribute(h).split(f), j = /([.?@])?(.*)/.exec(u);
329
- a.push({ type: 1, index: r, name: j[2], strings: $, ctor: j[1] === "." ? Pt : j[1] === "?" ? Ct : j[1] === "@" ? Ot : z }), s.removeAttribute(h);
327
+ if (h.endsWith(ht)) {
328
+ const u = p[o++], $ = s.getAttribute(h).split(_), j = /([.?@])?(.*)/.exec(u);
329
+ a.push({ type: 1, index: r, name: j[2], strings: $, ctor: j[1] === "." ? Ut : j[1] === "?" ? Pt : j[1] === "@" ? Ot : B }), s.removeAttribute(h);
330
330
  } else
331
- h.startsWith(f) && (a.push({ type: 6, index: r }), s.removeAttribute(h));
331
+ h.startsWith(_) && (a.push({ type: 6, index: r }), s.removeAttribute(h));
332
332
  if (lt.test(s.tagName)) {
333
- const h = s.textContent.split(f), u = h.length - 1;
333
+ const h = s.textContent.split(_), u = h.length - 1;
334
334
  if (u > 0) {
335
335
  s.textContent = k ? k.emptyScript : "";
336
336
  for (let $ = 0; $ < u; $++)
337
- s.append(h[$], H()), m.nextNode(), a.push({ type: 2, index: ++r });
338
- s.append(h[u], H());
337
+ s.append(h[$], N()), m.nextNode(), a.push({ type: 2, index: ++r });
338
+ s.append(h[u], N());
339
339
  }
340
340
  }
341
341
  } else if (s.nodeType === 8)
342
- if (s.data === dt)
342
+ if (s.data === ct)
343
343
  a.push({ type: 2, index: r });
344
344
  else {
345
345
  let h = -1;
346
- for (; (h = s.data.indexOf(f, h + 1)) !== -1; )
347
- a.push({ type: 7, index: r }), h += f.length - 1;
346
+ for (; (h = s.data.indexOf(_, h + 1)) !== -1; )
347
+ a.push({ type: 7, index: r }), h += _.length - 1;
348
348
  }
349
349
  r++;
350
350
  }
@@ -354,15 +354,15 @@ class I {
354
354
  return i.innerHTML = t, i;
355
355
  }
356
356
  }
357
- function U(n, t, e = n, i) {
357
+ function C(n, t, e = n, i) {
358
358
  var o, c;
359
359
  if (t === S)
360
360
  return t;
361
- let s = i !== void 0 ? (o = e.o) == null ? void 0 : o[i] : e.l;
361
+ let s = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
362
362
  const r = M(t) ? void 0 : t._$litDirective$;
363
- return (s == null ? void 0 : s.constructor) !== r && ((c = s == null ? void 0 : s._$AO) == null || c.call(s, !1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, e, i)), i !== void 0 ? (e.o ?? (e.o = []))[i] = s : e.l = s), s !== void 0 && (t = U(n, s._$AS(n, t.values), s, i)), t;
363
+ return (s == null ? void 0 : s.constructor) !== r && ((c = s == null ? void 0 : s._$AO) == null || c.call(s, !1), r === void 0 ? s = void 0 : (s = new r(n), s._$AT(n, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = C(n, s._$AS(n, t.values), s, i)), t;
364
364
  }
365
- class Ut {
365
+ class Ct {
366
366
  constructor(t, e) {
367
367
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
368
368
  }
@@ -379,7 +379,7 @@ class Ut {
379
379
  for (; a !== void 0; ) {
380
380
  if (o === a.index) {
381
381
  let l;
382
- a.type === 2 ? l = new R(r, r.nextSibling, this, t) : a.type === 1 ? l = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (l = new xt(r, this, t)), this._$AV.push(l), a = i[++c];
382
+ a.type === 2 ? l = new I(r, r.nextSibling, this, t) : a.type === 1 ? l = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (l = new xt(r, this, t)), this._$AV.push(l), a = i[++c];
383
383
  }
384
384
  o !== (a == null ? void 0 : a.index) && (r = m.nextNode(), o++);
385
385
  }
@@ -391,13 +391,13 @@ class Ut {
391
391
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
392
392
  }
393
393
  }
394
- class R {
394
+ class I {
395
395
  get _$AU() {
396
396
  var t;
397
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this.v;
397
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
398
398
  }
399
399
  constructor(t, e, i, s) {
400
- this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this.v = (s == null ? void 0 : s.isConnected) ?? !0;
400
+ this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
401
401
  }
402
402
  get parentNode() {
403
403
  let t = this._$AA.parentNode;
@@ -411,37 +411,37 @@ class R {
411
411
  return this._$AB;
412
412
  }
413
413
  _$AI(t, e = this) {
414
- t = U(this, t, e), M(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Et(t) ? this.k(t) : this._(t);
414
+ t = C(this, t, e), M(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Et(t) ? this.k(t) : this._(t);
415
415
  }
416
- O(t) {
416
+ S(t) {
417
417
  return this._$AA.parentNode.insertBefore(t, this._$AB);
418
418
  }
419
419
  T(t) {
420
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
420
+ this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
421
421
  }
422
422
  _(t) {
423
423
  this._$AH !== d && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(y.createTextNode(t)), this._$AH = t;
424
424
  }
425
425
  $(t) {
426
426
  var r;
427
- const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = I.createElement(pt(i.h, i.h[0]), this.options)), i);
427
+ const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = R.createElement(pt(i.h, i.h[0]), this.options)), i);
428
428
  if (((r = this._$AH) == null ? void 0 : r._$AD) === s)
429
429
  this._$AH.p(e);
430
430
  else {
431
- const o = new Ut(s, this), c = o.u(this.options);
431
+ const o = new Ct(s, this), c = o.u(this.options);
432
432
  o.p(e), this.T(c), this._$AH = o;
433
433
  }
434
434
  }
435
435
  _$AC(t) {
436
- let e = nt.get(t.strings);
437
- return e === void 0 && nt.set(t.strings, e = new I(t)), e;
436
+ let e = st.get(t.strings);
437
+ return e === void 0 && st.set(t.strings, e = new R(t)), e;
438
438
  }
439
439
  k(t) {
440
- Z(this._$AH) || (this._$AH = [], this._$AR());
440
+ dt(this._$AH) || (this._$AH = [], this._$AR());
441
441
  const e = this._$AH;
442
442
  let i, s = 0;
443
443
  for (const r of t)
444
- s === e.length ? e.push(i = new R(this.O(H()), this.O(H()), this, this.options)) : i = e[s], i._$AI(r), s++;
444
+ s === e.length ? e.push(i = new I(this.S(N()), this.S(N()), this, this.options)) : i = e[s], i._$AI(r), s++;
445
445
  s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
446
446
  }
447
447
  _$AR(t = this._$AA.nextSibling, e) {
@@ -453,10 +453,10 @@ class R {
453
453
  }
454
454
  setConnected(t) {
455
455
  var e;
456
- this._$AM === void 0 && (this.v = t, (e = this._$AP) == null || e.call(this, t));
456
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
457
457
  }
458
458
  }
459
- class z {
459
+ class B {
460
460
  get tagName() {
461
461
  return this.element.tagName;
462
462
  }
@@ -470,12 +470,12 @@ class z {
470
470
  const r = this.strings;
471
471
  let o = !1;
472
472
  if (r === void 0)
473
- t = U(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
473
+ t = C(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== S, o && (this._$AH = t);
474
474
  else {
475
475
  const c = t;
476
476
  let a, l;
477
477
  for (t = r[0], a = 0; a < r.length - 1; a++)
478
- l = U(this, c[i + a], e, a), l === S && (l = this._$AH[a]), o || (o = !M(l) || l !== this._$AH[a]), l === d ? t = d : t !== d && (t += (l ?? "") + r[a + 1]), this._$AH[a] = l;
478
+ l = C(this, c[i + a], e, a), l === S && (l = this._$AH[a]), o || (o = !M(l) || l !== this._$AH[a]), l === d ? t = d : t !== d && (t += (l ?? "") + r[a + 1]), this._$AH[a] = l;
479
479
  }
480
480
  o && !s && this.j(t);
481
481
  }
@@ -483,7 +483,7 @@ class z {
483
483
  t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
484
484
  }
485
485
  }
486
- class Pt extends z {
486
+ class Ut extends B {
487
487
  constructor() {
488
488
  super(...arguments), this.type = 3;
489
489
  }
@@ -491,7 +491,7 @@ class Pt extends z {
491
491
  this.element[this.name] = t === d ? void 0 : t;
492
492
  }
493
493
  }
494
- class Ct extends z {
494
+ class Pt extends B {
495
495
  constructor() {
496
496
  super(...arguments), this.type = 4;
497
497
  }
@@ -499,12 +499,12 @@ class Ct extends z {
499
499
  this.element.toggleAttribute(this.name, !!t && t !== d);
500
500
  }
501
501
  }
502
- class Ot extends z {
502
+ class Ot extends B {
503
503
  constructor(t, e, i, s, r) {
504
504
  super(t, e, i, s, r), this.type = 5;
505
505
  }
506
506
  _$AI(t, e = this) {
507
- if ((t = U(this, t, e, 0) ?? d) === S)
507
+ if ((t = C(this, t, e, 0) ?? d) === S)
508
508
  return;
509
509
  const i = this._$AH, s = t === d && i !== d || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== d && (i === d || s);
510
510
  s && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
@@ -522,17 +522,17 @@ class xt {
522
522
  return this._$AM._$AU;
523
523
  }
524
524
  _$AI(t) {
525
- U(this, t);
525
+ C(this, t);
526
526
  }
527
527
  }
528
- const q = N.litHtmlPolyfillSupport;
529
- q == null || q(I, R), (N.litHtmlVersions ?? (N.litHtmlVersions = [])).push("3.2.0");
528
+ const q = H.litHtmlPolyfillSupport;
529
+ q == null || q(R, I), (H.litHtmlVersions ?? (H.litHtmlVersions = [])).push("3.1.2");
530
530
  const Tt = (n, t, e) => {
531
531
  const i = (e == null ? void 0 : e.renderBefore) ?? t;
532
532
  let s = i._$litPart$;
533
533
  if (s === void 0) {
534
534
  const r = (e == null ? void 0 : e.renderBefore) ?? null;
535
- i._$litPart$ = s = new R(t.insertBefore(H(), r), r, void 0, e ?? {});
535
+ i._$litPart$ = s = new I(t.insertBefore(N(), r), r, void 0, e ?? {});
536
536
  }
537
537
  return s._$AI(n), s;
538
538
  };
@@ -543,7 +543,7 @@ const Tt = (n, t, e) => {
543
543
  */
544
544
  class E extends b {
545
545
  constructor() {
546
- super(...arguments), this.renderOptions = { host: this }, this.o = void 0;
546
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
547
547
  }
548
548
  createRenderRoot() {
549
549
  var e;
@@ -552,31 +552,31 @@ class E extends b {
552
552
  }
553
553
  update(t) {
554
554
  const e = this.render();
555
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this.o = Tt(e, this.renderRoot, this.renderOptions);
555
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Tt(e, this.renderRoot, this.renderOptions);
556
556
  }
557
557
  connectedCallback() {
558
558
  var t;
559
- super.connectedCallback(), (t = this.o) == null || t.setConnected(!0);
559
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
560
560
  }
561
561
  disconnectedCallback() {
562
562
  var t;
563
- super.disconnectedCallback(), (t = this.o) == null || t.setConnected(!1);
563
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
564
564
  }
565
565
  render() {
566
566
  return S;
567
567
  }
568
568
  }
569
- var at;
570
- E._$litElement$ = !0, E.finalized = !0, (at = globalThis.litElementHydrateSupport) == null || at.call(globalThis, { LitElement: E });
569
+ var ot;
570
+ E._$litElement$ = !0, E.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: E });
571
571
  const V = globalThis.litElementPolyfillSupport;
572
572
  V == null || V({ LitElement: E });
573
- (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.0");
573
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.4");
574
574
  /**
575
575
  * @license
576
576
  * Copyright 2017 Google LLC
577
577
  * SPDX-License-Identifier: BSD-3-Clause
578
578
  */
579
- const Nt = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: K }, Ht = (n = Nt, t, e) => {
579
+ const Ht = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: K }, Nt = (n = Ht, t, e) => {
580
580
  const { kind: i, metadata: s } = e;
581
581
  let r = globalThis.litPropertyMetadata.get(s);
582
582
  if (r === void 0 && globalThis.litPropertyMetadata.set(s, r = /* @__PURE__ */ new Map()), r.set(e.name, n), i === "accessor") {
@@ -597,8 +597,8 @@ const Nt = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged:
597
597
  }
598
598
  throw Error("Unsupported decorator location: " + i);
599
599
  };
600
- function w(n) {
601
- return (t, e) => typeof e == "object" ? Ht(n, t, e) : ((i, s, r) => {
600
+ function A(n) {
601
+ return (t, e) => typeof e == "object" ? Nt(n, t, e) : ((i, s, r) => {
602
602
  const o = s.hasOwnProperty(r);
603
603
  return s.constructor.createProperty(r, o ? { ...i, wrapped: !0 } : i), o ? Object.getOwnPropertyDescriptor(s, r) : void 0;
604
604
  })(n, t, e);
@@ -608,15 +608,15 @@ function w(n) {
608
608
  * Copyright 2017 Google LLC
609
609
  * SPDX-License-Identifier: BSD-3-Clause
610
610
  */
611
- function P(n) {
612
- return w({ ...n, state: !0, attribute: !1 });
611
+ function U(n) {
612
+ return A({ ...n, state: !0, attribute: !1 });
613
613
  }
614
- var Mt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, C = (n, t, e, i) => {
615
- for (var s = i > 1 ? void 0 : i ? It(t, e) : t, r = n.length - 1, o; r >= 0; r--)
614
+ var Mt = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, P = (n, t, e, i) => {
615
+ for (var s = i > 1 ? void 0 : i ? Rt(t, e) : t, r = n.length - 1, o; r >= 0; r--)
616
616
  (o = n[r]) && (s = (i ? o(t, e, s) : o(s)) || s);
617
617
  return i && s && Mt(t, e, s), s;
618
618
  };
619
- const rt = "https://widgets.ace.teliacompany.net", ot = "https://embed.webprovisions.io", Rt = () => {
619
+ const nt = "https://widgets.ace.teliacompany.net", rt = "https://embed.webprovisions.io", It = () => {
620
620
  if (typeof window < "u") {
621
621
  const n = history.pushState, t = history.replaceState;
622
622
  history.pushState = function(...e) {
@@ -626,15 +626,15 @@ const rt = "https://widgets.ace.teliacompany.net", ot = "https://embed.webprovis
626
626
  };
627
627
  }
628
628
  };
629
- class A extends E {
629
+ class w extends E {
630
630
  constructor() {
631
631
  var t;
632
- super(...arguments), this.apiUrl = rt, this.embedUrl = ot, this._site = null, this._widgets = {}, this._path = ((t = window == null ? void 0 : window.location) == null ? void 0 : t.pathname) || "", this.routeChangeListener = () => {
632
+ super(...arguments), this.apiUrl = nt, this.embedUrl = rt, this._site = null, this._widgets = {}, this._path = ((t = window == null ? void 0 : window.location) == null ? void 0 : t.pathname) || "", this.routeChangeListener = () => {
633
633
  this._path = window.location.pathname, this.requestUpdate();
634
634
  };
635
635
  }
636
636
  async connectedCallback() {
637
- super.connectedCallback(), Rt(), await this.loadSite(), window.addEventListener("locationchange", this.routeChangeListener);
637
+ super.connectedCallback(), It(), await this.loadSite(), window.addEventListener("locationchange", this.routeChangeListener);
638
638
  }
639
639
  disconnectedCallback() {
640
640
  super.disconnectedCallback(), window.removeEventListener("locationchange", this.routeChangeListener);
@@ -649,7 +649,7 @@ class A extends E {
649
649
  addWidgetEl(t) {
650
650
  const e = `ace-widget_${t}`;
651
651
  let i = document.getElementById(e);
652
- i || (i = document.createElement("ace-widget-wrapper"), i.setAttribute("id", e), i.setAttribute("widgetId", t), this.apiUrl !== rt && i.setAttribute("apiUrl", this.apiUrl), this.embedUrl !== ot && i.setAttribute("embedUrl", this.embedUrl), document.body.appendChild(i)), this._widgets = {
652
+ i || (i = document.createElement("ace-widget-wrapper"), i.setAttribute("id", e), i.setAttribute("widgetId", t), this.apiUrl !== nt && i.setAttribute("apiUrl", this.apiUrl), this.embedUrl !== rt && i.setAttribute("embedUrl", this.embedUrl), document.body.appendChild(i)), this._widgets = {
653
653
  ...this._widgets,
654
654
  [t]: i
655
655
  }, window.ace = window.ace || {
@@ -676,24 +676,24 @@ class A extends E {
676
676
  return d;
677
677
  }
678
678
  }
679
- C([
680
- w({ attribute: !0 })
681
- ], A.prototype, "siteId", 2);
682
- C([
683
- w()
684
- ], A.prototype, "apiUrl", 2);
685
- C([
686
- w()
687
- ], A.prototype, "embedUrl", 2);
688
- C([
689
- P()
690
- ], A.prototype, "_site", 2);
691
- C([
692
- P()
693
- ], A.prototype, "_widgets", 2);
694
- C([
695
- P()
696
- ], A.prototype, "_path", 2);
679
+ P([
680
+ A({ attribute: !0 })
681
+ ], w.prototype, "siteId", 2);
682
+ P([
683
+ A()
684
+ ], w.prototype, "apiUrl", 2);
685
+ P([
686
+ A()
687
+ ], w.prototype, "embedUrl", 2);
688
+ P([
689
+ U()
690
+ ], w.prototype, "_site", 2);
691
+ P([
692
+ U()
693
+ ], w.prototype, "_widgets", 2);
694
+ P([
695
+ U()
696
+ ], w.prototype, "_path", 2);
697
697
  const jt = (n) => {
698
698
  const t = [];
699
699
  return (n.triggers || []).filter((e) => e.triggerType === "visit").forEach((e) => {
@@ -717,16 +717,16 @@ const jt = (n) => {
717
717
  });
718
718
  }), t;
719
719
  };
720
- window.customElements.get("ace-site") || window.customElements.define("ace-site", A);
720
+ window.customElements.get("ace-site") || window.customElements.define("ace-site", w);
721
721
  var Lt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, O = (n, t, e, i) => {
722
722
  for (var s = i > 1 ? void 0 : i ? Dt(t, e) : t, r = n.length - 1, o; r >= 0; r--)
723
723
  (o = n[r]) && (s = (i ? o(t, e, s) : o(s)) || s);
724
724
  return i && s && Lt(t, e, s), s;
725
725
  };
726
- const kt = "https://widgets.ace.teliacompany.net", zt = "https://embed.webprovisions.io";
726
+ const kt = "https://widgets.ace.teliacompany.net", Bt = "https://embed.webprovisions.io";
727
727
  class v extends E {
728
728
  constructor() {
729
- super(...arguments), this.apiUrl = kt, this.embedUrl = zt, this.widget = null, this.scriptEl = null, this.activated = !1;
729
+ super(...arguments), this.apiUrl = kt, this.embedUrl = Bt, this.widget = null, this.scriptEl = null, this.activated = !1;
730
730
  }
731
731
  async connectedCallback() {
732
732
  super.connectedCallback(), this.widget = await this._loadWidget(this.widgetId);
@@ -738,7 +738,7 @@ class v extends E {
738
738
  var e;
739
739
  if (!((e = this.widget) != null && e.distributionName))
740
740
  return;
741
- let t = document.createElement("script");
741
+ const t = document.createElement("script");
742
742
  t.setAttribute("type", "module"), t.setAttribute("async", "true"), t.setAttribute(
743
743
  "src",
744
744
  `${this.embedUrl}/d/${this.widget.organization}/${this.widget.distributionName}@latest/index.js`
@@ -770,25 +770,25 @@ class v extends E {
770
770
  }
771
771
  }
772
772
  O([
773
- w({ attribute: !0 })
773
+ A({ attribute: !0 })
774
774
  ], v.prototype, "widgetId", 2);
775
775
  O([
776
- w()
776
+ A()
777
777
  ], v.prototype, "apiUrl", 2);
778
778
  O([
779
- w()
779
+ A()
780
780
  ], v.prototype, "embedUrl", 2);
781
781
  O([
782
- P()
782
+ U()
783
783
  ], v.prototype, "widget", 2);
784
784
  O([
785
- P()
785
+ U()
786
786
  ], v.prototype, "scriptEl", 2);
787
787
  O([
788
- P()
788
+ U()
789
789
  ], v.prototype, "activated", 2);
790
790
  customElements.get("ace-widget-wrapper") || customElements.define("ace-widget-wrapper", v);
791
791
  export {
792
- A as SiteComponent,
792
+ w as SiteComponent,
793
793
  v as WidgetComponent
794
794
  };
package/index.umd.js CHANGED
@@ -1,27 +1,27 @@
1
- (function(w,f){typeof exports=="object"&&typeof module<"u"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(w=typeof globalThis<"u"?globalThis:w||self,f(w["@telia-ace/widget-site"]={}))})(this,function(w){var ut;"use strict";/**
1
+ (function(w,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(w=typeof globalThis<"u"?globalThis:w||self,$(w["@telia-ace/widget-site"]={}))})(this,function(w){var ut;"use strict";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const f=globalThis,B=f.ShadowRoot&&(f.ShadyCSS===void 0||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,G=Symbol(),Q=new WeakMap;let ft=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==G)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(B&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Q.set(e,t))}return t}toString(){return this.cssText}};const $t=n=>new ft(typeof n=="string"?n:n+"",void 0,G),gt=(n,t)=>{if(B)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=f.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},Y=B?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $t(e)})(n):n;/**
5
+ */const $=globalThis,z=$.ShadowRoot&&($.ShadyCSS===void 0||$.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,F=Symbol(),G=new WeakMap;let $t=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==F)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(z&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=G.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&G.set(e,t))}return t}toString(){return this.cssText}};const ft=n=>new $t(typeof n=="string"?n:n+"",void 0,F),_t=(n,t)=>{if(z)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=$.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},Q=z?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return ft(e)})(n):n;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:_t,defineProperty:mt,getOwnPropertyDescriptor:yt,getOwnPropertyNames:wt,getOwnPropertySymbols:At,getPrototypeOf:vt}=Object,$=globalThis,X=$.trustedTypes,bt=X?X.emptyScript:"",q=$.reactiveElementPolyfillSupport,M=(n,t)=>n,D={toAttribute(n,t){switch(t){case Boolean:n=n?bt: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}},V=(n,t)=>!_t(n,t),tt={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:V};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=tt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&mt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=yt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const c=s==null?void 0:s.call(this);r.call(this,o),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;const t=vt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(M("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(M("properties"))){const e=this.properties,i=[...wt(e),...At(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Y(s))}else t!==void 0&&e.push(Y(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return gt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var r;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:D).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var r;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:D;this._$Em=s,this[s]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??V)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[M("elementProperties")]=new Map,S[M("finalized")]=new Map,q==null||q({ReactiveElement:S}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:gt,defineProperty:mt,getOwnPropertyDescriptor:yt,getOwnPropertyNames:wt,getOwnPropertySymbols:At,getPrototypeOf:vt}=Object,f=globalThis,X=f.trustedTypes,bt=X?X.emptyScript:"",q=f.reactiveElementPolyfillSupport,H=(n,t)=>n,D={toAttribute(n,t){switch(t){case Boolean:n=n?bt: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}},V=(n,t)=>!gt(n,t),Y={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:V};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),f.litPropertyMetadata??(f.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&mt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=yt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const c=s==null?void 0:s.call(this);r.call(this,o),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Y}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=vt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){const e=this.properties,i=[...wt(e),...At(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Q(s))}else t!==void 0&&e.push(Q(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _t(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var r;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:D).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var r;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),c=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:D;this._$Em=s,this[s]=c.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??V)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[H("elementProperties")]=new Map,S[H("finalized")]=new Map,q==null||q({ReactiveElement:S}),(f.reactiveElementVersions??(f.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const N=globalThis,W=N.trustedTypes,et=W?W.createPolicy("lit-html",{createHTML:n=>n}):void 0,it="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+g,Et=`<${st}>`,A=document,H=()=>A.createComment(""),I=n=>n===null||typeof n!="object"&&typeof n!="function",J=Array.isArray,St=n=>J(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",K=`[
14
- \f\r]`,R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,rt=/>/g,v=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ht=/^(?:script|style|textarea|title)$/i,U=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ct=new WeakMap,b=A.createTreeWalker(A,129);function dt(n,t){if(!J(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}const Ut=(n,t)=>{const e=n.length-1,i=[];let s,r=t===2?"<svg>":t===3?"<math>":"",o=R;for(let c=0;c<e;c++){const a=n[c];let l,p,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===R?p[1]==="!--"?o=nt:p[1]!==void 0?o=rt:p[2]!==void 0?(ht.test(p[2])&&(s=RegExp("</"+p[2],"g")),o=v):p[3]!==void 0&&(o=v):o===v?p[0]===">"?(o=s??R,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?v:p[3]==='"'?at:ot):o===at||o===ot?o=v:o===nt||o===rt?o=R:(o=v,s=void 0);const y=o===v&&n[c+1].startsWith("/>")?" ":"";r+=o===R?a+Et:h>=0?(i.push(l),a.slice(0,h)+it+a.slice(h)+g+y):a+g+(h===-2?c:y)}return[dt(n,r+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class j{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const c=t.length-1,a=this.parts,[l,p]=Ut(t,e);if(this.el=j.createElement(l,i),b.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=b.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(it)){const u=p[o++],y=s.getAttribute(h).split(g),z=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:z[2],strings:y,ctor:z[1]==="."?Ct:z[1]==="?"?Ot:z[1]==="@"?xt:k}),s.removeAttribute(h)}else h.startsWith(g)&&(a.push({type:6,index:r}),s.removeAttribute(h));if(ht.test(s.tagName)){const h=s.textContent.split(g),u=h.length-1;if(u>0){s.textContent=W?W.emptyScript:"";for(let y=0;y<u;y++)s.append(h[y],H()),b.nextNode(),a.push({type:2,index:++r});s.append(h[u],H())}}}else if(s.nodeType===8)if(s.data===st)a.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(g,h+1))!==-1;)a.push({type:7,index:r}),h+=g.length-1}r++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function P(n,t,e=n,i){var o,c;if(t===U)return t;let s=i!==void 0?(o=e.o)==null?void 0:o[i]:e.l;const r=I(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((c=s==null?void 0:s._$AO)==null||c.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,e,i)),i!==void 0?(e.o??(e.o=[]))[i]=s:e.l=s),s!==void 0&&(t=P(n,s._$AS(n,t.values),s,i)),t}class Pt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??A).importNode(e,!0);b.currentNode=s;let r=b.nextNode(),o=0,c=0,a=i[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new L(r,r.nextSibling,this,t):a.type===1?l=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(l=new Tt(r,this,t)),this._$AV.push(l),a=i[++c]}o!==(a==null?void 0:a.index)&&(r=b.nextNode(),o++)}return b.currentNode=A,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class L{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this.v}constructor(t,e,i,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this.v=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),I(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==U&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):St(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=j.createElement(dt(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(e);else{const o=new Pt(s,this),c=o.u(this.options);o.p(e),this.T(c),this._$AH=o}}_$AC(t){let e=ct.get(t.strings);return e===void 0&&ct.set(t.strings,e=new j(t)),e}k(t){J(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new L(this.O(H()),this.O(H()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this.v=t,(e=this._$AP)==null||e.call(this,t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(r===void 0)t=P(this,t,e,0),o=!I(t)||t!==this._$AH&&t!==U,o&&(this._$AH=t);else{const c=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=P(this,c[i+a],e,a),l===U&&(l=this._$AH[a]),o||(o=!I(l)||l!==this._$AH[a]),l===d?t=d:t!==d&&(t+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Ot extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class xt extends k{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=P(this,t,e,0)??d)===U)return;const i=this._$AH,s=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==d&&(i===d||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Tt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const Z=N.litHtmlPolyfillSupport;Z==null||Z(j,L),(N.litHtmlVersions??(N.litHtmlVersions=[])).push("3.2.0");const Mt=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const r=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new L(t.insertBefore(H(),r),r,void 0,e??{})}return s._$AI(n),s};/**
13
+ */const N=globalThis,W=N.trustedTypes,tt=W?W.createPolicy("lit-html",{createHTML:n=>n}):void 0,et="$lit$",_=`lit$${(Math.random()+"").slice(9)}$`,it="?"+_,Et=`<${it}>`,A=document,M=()=>A.createComment(""),R=n=>n===null||typeof n!="object"&&typeof n!="function",st=Array.isArray,St=n=>st(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",J=`[
14
+ \f\r]`,I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,rt=/>/g,v=RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ht=/^(?:script|style|textarea|title)$/i,C=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ct=new WeakMap,b=A.createTreeWalker(A,129);function dt(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return tt!==void 0?tt.createHTML(t):t}const Ct=(n,t)=>{const e=n.length-1,i=[];let s,r=t===2?"<svg>":"",o=I;for(let c=0;c<e;c++){const a=n[c];let l,p,h=-1,u=0;for(;u<a.length&&(o.lastIndex=u,p=o.exec(a),p!==null);)u=o.lastIndex,o===I?p[1]==="!--"?o=nt:p[1]!==void 0?o=rt:p[2]!==void 0?(ht.test(p[2])&&(s=RegExp("</"+p[2],"g")),o=v):p[3]!==void 0&&(o=v):o===v?p[0]===">"?(o=s??I,h=-1):p[1]===void 0?h=-2:(h=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?v:p[3]==='"'?at:ot):o===at||o===ot?o=v:o===nt||o===rt?o=I:(o=v,s=void 0);const y=o===v&&n[c+1].startsWith("/>")?" ":"";r+=o===I?a+Et:h>=0?(i.push(l),a.slice(0,h)+et+a.slice(h)+_+y):a+_+(h===-2?c:y)}return[dt(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),i]};class j{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const c=t.length-1,a=this.parts,[l,p]=Ct(t,e);if(this.el=j.createElement(l,i),b.currentNode=this.el.content,e===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=b.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(et)){const u=p[o++],y=s.getAttribute(h).split(_),B=/([.?@])?(.*)/.exec(u);a.push({type:1,index:r,name:B[2],strings:y,ctor:B[1]==="."?Pt:B[1]==="?"?Ot:B[1]==="@"?xt:k}),s.removeAttribute(h)}else h.startsWith(_)&&(a.push({type:6,index:r}),s.removeAttribute(h));if(ht.test(s.tagName)){const h=s.textContent.split(_),u=h.length-1;if(u>0){s.textContent=W?W.emptyScript:"";for(let y=0;y<u;y++)s.append(h[y],M()),b.nextNode(),a.push({type:2,index:++r});s.append(h[u],M())}}}else if(s.nodeType===8)if(s.data===it)a.push({type:2,index:r});else{let h=-1;for(;(h=s.data.indexOf(_,h+1))!==-1;)a.push({type:7,index:r}),h+=_.length-1}r++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function U(n,t,e=n,i){var o,c;if(t===C)return t;let s=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const r=R(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((c=s==null?void 0:s._$AO)==null||c.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=U(n,s._$AS(n,t.values),s,i)),t}class Ut{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??A).importNode(e,!0);b.currentNode=s;let r=b.nextNode(),o=0,c=0,a=i[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new L(r,r.nextSibling,this,t):a.type===1?l=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(l=new Tt(r,this,t)),this._$AV.push(l),a=i[++c]}o!==(a==null?void 0:a.index)&&(r=b.nextNode(),o++)}return b.currentNode=A,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class L{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),R(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==C&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):St(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==d&&R(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=j.createElement(dt(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(e);else{const o=new Ut(s,this),c=o.u(this.options);o.p(e),this.T(c),this._$AH=o}}_$AC(t){let e=ct.get(t.strings);return e===void 0&&ct.set(t.strings,e=new j(t)),e}k(t){st(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new L(this.S(M()),this.S(M()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(r===void 0)t=U(this,t,e,0),o=!R(t)||t!==this._$AH&&t!==C,o&&(this._$AH=t);else{const c=t;let a,l;for(t=r[0],a=0;a<r.length-1;a++)l=U(this,c[i+a],e,a),l===C&&(l=this._$AH[a]),o||(o=!R(l)||l!==this._$AH[a]),l===d?t=d:t!==d&&(t+=(l??"")+r[a+1]),this._$AH[a]=l}o&&!s&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Pt extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Ot extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class xt extends k{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??d)===C)return;const i=this._$AH,s=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==d&&(i===d||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Tt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const K=N.litHtmlPolyfillSupport;K==null||K(j,L),(N.litHtmlVersions??(N.litHtmlVersions=[])).push("3.1.2");const Ht=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const r=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new L(t.insertBefore(M(),r),r,void 0,e??{})}return s._$AI(n),s};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */class C extends S{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=Mt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this.o)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.o)==null||t.setConnected(!1)}render(){return U}}C._$litElement$=!0,C.finalized=!0,(ut=globalThis.litElementHydrateSupport)==null||ut.call(globalThis,{LitElement:C});const F=globalThis.litElementPolyfillSupport;F==null||F({LitElement:C}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");/**
19
+ */class P extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ht(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return C}}P._$litElement$=!0,P.finalized=!0,(ut=globalThis.litElementHydrateSupport)==null||ut.call(globalThis,{LitElement:P});const Z=globalThis.litElementPolyfillSupport;Z==null||Z({LitElement:P}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const Nt={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:V},Ht=(n=Nt,t,e)=>{const{kind:i,metadata:s}=e;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(e.name,n),i==="accessor"){const{name:o}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,a,n)},init(c){return c!==void 0&&this.P(o,void 0,n),c}}}if(i==="setter"){const{name:o}=e;return function(c){const a=this[o];t.call(this,c),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+i)};function E(n){return(t,e)=>typeof e=="object"?Ht(n,t,e):((i,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(s,r):void 0})(n,t,e)}/**
23
+ */const Nt={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:V},Mt=(n=Nt,t,e)=>{const{kind:i,metadata:s}=e;let r=globalThis.litPropertyMetadata.get(s);if(r===void 0&&globalThis.litPropertyMetadata.set(s,r=new Map),r.set(e.name,n),i==="accessor"){const{name:o}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(o,a,n)},init(c){return c!==void 0&&this.P(o,void 0,n),c}}}if(i==="setter"){const{name:o}=e;return function(c){const a=this[o];t.call(this,c),this.requestUpdate(o,a,n)}}throw Error("Unsupported decorator location: "+i)};function E(n){return(t,e)=>typeof e=="object"?Mt(n,t,e):((i,s,r)=>{const o=s.hasOwnProperty(r);return s.constructor.createProperty(r,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(s,r):void 0})(n,t,e)}/**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */function O(n){return E({...n,state:!0,attribute:!1})}var It=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,x=(n,t,e,i)=>{for(var s=i>1?void 0:i?Rt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&It(t,e,s),s};const lt="https://widgets.ace.teliacompany.net",pt="https://embed.webprovisions.io",jt=()=>{if(typeof window<"u"){const n=history.pushState,t=history.replaceState;history.pushState=function(...e){n.apply(history,e),window.dispatchEvent(new Event("locationchange"))},history.replaceState=function(...e){t.apply(history,e),window.dispatchEvent(new Event("locationchange"))}}};class _ extends C{constructor(){var t;super(...arguments),this.apiUrl=lt,this.embedUrl=pt,this._site=null,this._widgets={},this._path=((t=window==null?void 0:window.location)==null?void 0:t.pathname)||"",this.routeChangeListener=()=>{this._path=window.location.pathname,this.requestUpdate()}}async connectedCallback(){super.connectedCallback(),jt(),await this.loadSite(),window.addEventListener("locationchange",this.routeChangeListener)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("locationchange",this.routeChangeListener)}async loadSite(){var i;const e=await(await fetch(`${this.apiUrl}/api/site/${this.siteId}`)).json();this._site=e,(((i=this._site)==null?void 0:i.widgets)||[]).forEach(async s=>{this.addWidgetEl(s.widgetId)})}addWidgetEl(t){const e=`ace-widget_${t}`;let i=document.getElementById(e);i||(i=document.createElement("ace-widget-wrapper"),i.setAttribute("id",e),i.setAttribute("widgetId",t),this.apiUrl!==lt&&i.setAttribute("apiUrl",this.apiUrl),this.embedUrl!==pt&&i.setAttribute("embedUrl",this.embedUrl),document.body.appendChild(i)),this._widgets={...this._widgets,[t]:i},window.ace=window.ace||{_c:[],_w:[],widget:function(s,r){window.ace._w.push([s,r])},configure:function(s){window.ace._c.push(s)}}}render(){if(!this._site)return d;const t=Lt(this._site);for(const[e,i]of Object.entries(this._widgets)){const s=t.find(r=>r.widgetId===e);s&&!i.isActivated()?i.activate():!s&&i.isActivated()&&i.deactivate()}return d}}x([E({attribute:!0})],_.prototype,"siteId",2),x([E()],_.prototype,"apiUrl",2),x([E()],_.prototype,"embedUrl",2),x([O()],_.prototype,"_site",2),x([O()],_.prototype,"_widgets",2),x([O()],_.prototype,"_path",2);const Lt=n=>{const t=[];return(n.triggers||[]).filter(e=>e.triggerType==="visit").forEach(e=>{const i=window.location.pathname,s=e.condition.outputs||[];e.condition.type==="url"&&s.forEach(r=>{const o=r.action.type==="render_widget";if((r.value===i||r.value==="*")&&o){let a={widgetId:""};try{a=JSON.parse(r.action.data)}catch{a={widgetId:""}}const l=t.findIndex(h=>h.widgetId===a.widgetId)>-1,p=((n==null?void 0:n.widgets)||[]).find(h=>h.widgetId===a.widgetId);p&&!l&&t.push(p)}})}),t};window.customElements.get("ace-site")||window.customElements.define("ace-site",_);var Dt=Object.defineProperty,Wt=Object.getOwnPropertyDescriptor,T=(n,t,e,i)=>{for(var s=i>1?void 0:i?Wt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Dt(t,e,s),s};const kt="https://widgets.ace.teliacompany.net",zt="https://embed.webprovisions.io";class m extends C{constructor(){super(...arguments),this.apiUrl=kt,this.embedUrl=zt,this.widget=null,this.scriptEl=null,this.activated=!1}async connectedCallback(){super.connectedCallback(),this.widget=await this._loadWidget(this.widgetId)}async _loadWidget(t){return await(await fetch(`${this.apiUrl}/api/widget/${t}`)).json()}_createEmbedScript(){var e;if(!((e=this.widget)!=null&&e.distributionName))return;let t=document.createElement("script");t.setAttribute("type","module"),t.setAttribute("async","true"),t.setAttribute("src",`${this.embedUrl}/d/${this.widget.organization}/${this.widget.distributionName}@latest/index.js`),this.scriptEl=t}isActivated(){return this.activated}async activate(){var e;this.widget||(this.widget=await this._loadWidget(this.widgetId)),this._createEmbedScript(),this.activated=!0;const t=(((e=window.ace)==null?void 0:e.applications)||[]).find(i=>i.id===this.widgetId);t&&(t.storage.get("open")&&t.appendToDOM(),t.trigger.showTrigger())}async deactivate(){this.activated=!1;const t=window.ace.applications.find(e=>e.id===this.widgetId);if(t){const e=t.storage.get("open");t.hide(),t.trigger.hideTrigger(),e&&t.storage.set("open",!0,"necessary")}}render(){return this.scriptEl?this.scriptEl:d}}T([E({attribute:!0})],m.prototype,"widgetId",2),T([E()],m.prototype,"apiUrl",2),T([E()],m.prototype,"embedUrl",2),T([O()],m.prototype,"widget",2),T([O()],m.prototype,"scriptEl",2),T([O()],m.prototype,"activated",2),customElements.get("ace-widget-wrapper")||customElements.define("ace-widget-wrapper",m),w.SiteComponent=_,w.WidgetComponent=m,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
27
+ */function O(n){return E({...n,state:!0,attribute:!1})}var Rt=Object.defineProperty,It=Object.getOwnPropertyDescriptor,x=(n,t,e,i)=>{for(var s=i>1?void 0:i?It(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Rt(t,e,s),s};const lt="https://widgets.ace.teliacompany.net",pt="https://embed.webprovisions.io",jt=()=>{if(typeof window<"u"){const n=history.pushState,t=history.replaceState;history.pushState=function(...e){n.apply(history,e),window.dispatchEvent(new Event("locationchange"))},history.replaceState=function(...e){t.apply(history,e),window.dispatchEvent(new Event("locationchange"))}}};class g extends P{constructor(){var t;super(...arguments),this.apiUrl=lt,this.embedUrl=pt,this._site=null,this._widgets={},this._path=((t=window==null?void 0:window.location)==null?void 0:t.pathname)||"",this.routeChangeListener=()=>{this._path=window.location.pathname,this.requestUpdate()}}async connectedCallback(){super.connectedCallback(),jt(),await this.loadSite(),window.addEventListener("locationchange",this.routeChangeListener)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("locationchange",this.routeChangeListener)}async loadSite(){var i;const e=await(await fetch(`${this.apiUrl}/api/site/${this.siteId}`)).json();this._site=e,(((i=this._site)==null?void 0:i.widgets)||[]).forEach(async s=>{this.addWidgetEl(s.widgetId)})}addWidgetEl(t){const e=`ace-widget_${t}`;let i=document.getElementById(e);i||(i=document.createElement("ace-widget-wrapper"),i.setAttribute("id",e),i.setAttribute("widgetId",t),this.apiUrl!==lt&&i.setAttribute("apiUrl",this.apiUrl),this.embedUrl!==pt&&i.setAttribute("embedUrl",this.embedUrl),document.body.appendChild(i)),this._widgets={...this._widgets,[t]:i},window.ace=window.ace||{_c:[],_w:[],widget:function(s,r){window.ace._w.push([s,r])},configure:function(s){window.ace._c.push(s)}}}render(){if(!this._site)return d;const t=Lt(this._site);for(const[e,i]of Object.entries(this._widgets)){const s=t.find(r=>r.widgetId===e);s&&!i.isActivated()?i.activate():!s&&i.isActivated()&&i.deactivate()}return d}}x([E({attribute:!0})],g.prototype,"siteId",2),x([E()],g.prototype,"apiUrl",2),x([E()],g.prototype,"embedUrl",2),x([O()],g.prototype,"_site",2),x([O()],g.prototype,"_widgets",2),x([O()],g.prototype,"_path",2);const Lt=n=>{const t=[];return(n.triggers||[]).filter(e=>e.triggerType==="visit").forEach(e=>{const i=window.location.pathname,s=e.condition.outputs||[];e.condition.type==="url"&&s.forEach(r=>{const o=r.action.type==="render_widget";if((r.value===i||r.value==="*")&&o){let a={widgetId:""};try{a=JSON.parse(r.action.data)}catch{a={widgetId:""}}const l=t.findIndex(h=>h.widgetId===a.widgetId)>-1,p=((n==null?void 0:n.widgets)||[]).find(h=>h.widgetId===a.widgetId);p&&!l&&t.push(p)}})}),t};window.customElements.get("ace-site")||window.customElements.define("ace-site",g);var Dt=Object.defineProperty,Wt=Object.getOwnPropertyDescriptor,T=(n,t,e,i)=>{for(var s=i>1?void 0:i?Wt(t,e):t,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=(i?o(t,e,s):o(s))||s);return i&&s&&Dt(t,e,s),s};const kt="https://widgets.ace.teliacompany.net",Bt="https://embed.webprovisions.io";class m extends P{constructor(){super(...arguments),this.apiUrl=kt,this.embedUrl=Bt,this.widget=null,this.scriptEl=null,this.activated=!1}async connectedCallback(){super.connectedCallback(),this.widget=await this._loadWidget(this.widgetId)}async _loadWidget(t){return await(await fetch(`${this.apiUrl}/api/widget/${t}`)).json()}_createEmbedScript(){var e;if(!((e=this.widget)!=null&&e.distributionName))return;const t=document.createElement("script");t.setAttribute("type","module"),t.setAttribute("async","true"),t.setAttribute("src",`${this.embedUrl}/d/${this.widget.organization}/${this.widget.distributionName}@latest/index.js`),this.scriptEl=t}isActivated(){return this.activated}async activate(){var e;this.widget||(this.widget=await this._loadWidget(this.widgetId)),this._createEmbedScript(),this.activated=!0;const t=(((e=window.ace)==null?void 0:e.applications)||[]).find(i=>i.id===this.widgetId);t&&(t.storage.get("open")&&t.appendToDOM(),t.trigger.showTrigger())}async deactivate(){this.activated=!1;const t=window.ace.applications.find(e=>e.id===this.widgetId);if(t){const e=t.storage.get("open");t.hide(),t.trigger.hideTrigger(),e&&t.storage.set("open",!0,"necessary")}}render(){return this.scriptEl?this.scriptEl:d}}T([E({attribute:!0})],m.prototype,"widgetId",2),T([E()],m.prototype,"apiUrl",2),T([E()],m.prototype,"embedUrl",2),T([O()],m.prototype,"widget",2),T([O()],m.prototype,"scriptEl",2),T([O()],m.prototype,"activated",2),customElements.get("ace-widget-wrapper")||customElements.define("ace-widget-wrapper",m),w.SiteComponent=g,w.WidgetComponent=m,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-site",
3
- "version": "1.0.13-next.2",
3
+ "version": "1.1.76-rc.2",
4
4
  "dependencies": {
5
- "lit": "^3.0.2",
6
- "lit-html": "^3.0.2"
5
+ "lit": "^3.0.2"
7
6
  },
8
7
  "main": "./index.js",
9
8
  "module": "./index.mjs",