@telia-ace/widget-core-flamingo 1.1.76-rc.40 → 1.1.76-rc.41
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +20 -20
- package/index.mjs +156 -148
- package/package.json +1 -1
- package/services/storage.service.d.ts +3 -2
- package/types.d.ts +1 -0
- package/widget-manifest.json +3 -0
package/index.js
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function V(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function X(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function V(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function X(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function $(s){return typeof s=="function"}function Qt(s){var t=function(i){Error.call(i),i.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ot=Qt(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
2
2
|
`+e.map(function(i,r){return r+1+") "+i.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(v){t={error:v}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if($(l))try{l()}catch(v){n=v instanceof ot?v.errors:[v]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=mt(d),f=p.next();!f.done;f=p.next()){var g=f.value;try{Ot(g)}catch(v){n=n??[],v instanceof ot?n=X(X([],G(n)),G(v.errors)):n.push(v)}}}catch(v){i={error:v}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&vt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),te=it.EMPTY;function ee(s){return s instanceof it||s&&"closed"in s&&$(s.remove)&&$(s.add)&&$(s.unsubscribe)}function Ot(s){$(s)?s():s.unsubscribe()}var ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=yt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,X([s,t],G(e))):setTimeout.apply(void 0,X([s,t],G(e)))},clearTimeout:function(s){var t=yt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Ee(s){yt.setTimeout(function(){throw s})}function Tt(){}function Z(s){s()}var se=function(s){V(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ee(e)&&e.add(i)):i.destination=Ie,i}return t.create=function(e,i,r){return new bt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(it),Pe=Function.prototype.bind;function at(s,t){return Pe.call(s,t)}var Oe=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){K(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){K(i)}else K(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){K(e)}},s}(),bt=function(s){V(t,s);function t(e,i,r){var n=s.call(this)||this,o;if($(e)||!e)o={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;n&&ie.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return n.unsubscribe()},o={next:e.next&&at(e.next,a),error:e.error&&at(e.error,a),complete:e.complete&&at(e.complete,a)}):o=e}return n.destination=new Oe(o),n}return t}(se);function K(s){Ee(s)}function Te(s){throw s}var Ie={closed:!0,next:Tt,error:Te,complete:Tt},Re=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function ke(s){return s}function Ue(s){return s.length===0?ke:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var It=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,n=Ne(t)?t:new bt(t,e,i);return Z(function(){var o=r,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?r._subscribe(n):r._trySubscribe(n))}),n},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=Rt(e),new e(function(r,n){var o=new bt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:r});i.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Re]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ue(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Rt(t),new t(function(i,r){var n;e.subscribe(function(o){return n=o},function(o){return r(o)},function(){return i(n)})})},s.create=function(t){return new s(t)},s}();function Rt(s){var t;return(t=s??ie.Promise)!==null&&t!==void 0?t:Promise}function Me(s){return s&&$(s.next)&&$(s.error)&&$(s.complete)}function Ne(s){return s&&s instanceof se||Me(s)&&ee(s)}var je=Qt(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),$t=function(s){V(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new kt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new je},t.prototype.next=function(e){var i=this;Z(function(){var r,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=mt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;Z(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;Z(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,n=r.hasError,o=r.isStopped,a=r.observers;return n||o?te:(this.currentObservers=null,a.push(e),new it(function(){i.currentObservers=null,vt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,n=i.thrownError,o=i.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new It;return e.source=this,e},t.create=function(e,i){return new kt(e,i)},t}(It),kt=function(s){V(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:te},t}($t),re=function(s){V(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,n=e._value;if(i)throw r;return this._throwIfClosed(),n},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}($t),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class wt{constructor(t,e){this.state=new re("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
|
4
4
|
* @license
|
5
5
|
* Copyright 2019 Google LLC
|
6
6
|
* SPDX-License-Identifier: BSD-3-Clause
|
7
|
-
*/const J=globalThis,_t=J.ShadowRoot&&(J.ShadyCSS===void 0||J.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),
|
7
|
+
*/const J=globalThis,_t=J.ShadowRoot&&(J.ShadyCSS===void 0||J.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ut=new WeakMap;let oe=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(_t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ut.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const He=s=>new oe(typeof s=="string"?s:s+"",void 0,At),U=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new oe(e,s,At)},Le=(s,t)=>{if(_t)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=J.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Mt=_t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return He(e)})(s):s;/**
|
8
8
|
* @license
|
9
9
|
* Copyright 2017 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/const{is:De,defineProperty:Be,getOwnPropertyDescriptor:ze,getOwnPropertyNames:We,getOwnPropertySymbols:Fe,getPrototypeOf:Ve}=Object,
|
11
|
+
*/const{is:De,defineProperty:Be,getOwnPropertyDescriptor:ze,getOwnPropertyNames:We,getOwnPropertySymbols:Fe,getPrototypeOf:Ve}=Object,x=globalThis,Nt=x.trustedTypes,Ye=Nt?Nt.emptyScript:"",ct=x.reactiveElementPolyfillSupport,H=(s,t)=>s,Q={toAttribute(s,t){switch(t){case Boolean:s=s?Ye:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xt=(s,t)=>!De(s,t),jt={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:xt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),x.litPropertyMetadata??(x.litPropertyMetadata=new WeakMap);let I=class 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=jt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&Be(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=ze(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const a=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??jt}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;const t=Ve(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=[...We(e),...Fe(e)];for(const r of i)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,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 r of i)e.unshift(Mt(r))}else t!==void 0&&e.push(Mt(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 Le(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 n;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){const o=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:Q).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:Q;this._$Em=r,this[r]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??xt)(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[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.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){}};I.elementStyles=[],I.shadowRootOptions={mode:"open"},I[H("elementProperties")]=new Map,I[H("finalized")]=new Map,ct==null||ct({ReactiveElement:I}),(x.reactiveElementVersions??(x.reactiveElementVersions=[])).push("2.0.4");/**
|
12
12
|
* @license
|
13
13
|
* Copyright 2017 Google LLC
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
15
|
-
*/const L=globalThis,tt=L.trustedTypes,Ht=tt?tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",
|
15
|
+
*/const L=globalThis,tt=L.trustedTypes,Ht=tt?tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+A,qe=`<${ce}>`,O=document,B=()=>O.createComment(""),z=s=>s===null||typeof s!="object"&&typeof s!="function",he=Array.isArray,Ke=s=>he(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ht=`[
|
16
16
|
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lt=/-->/g,Dt=/>/g,S=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ze=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),R=Ze(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Wt=new WeakMap,P=O.createTreeWalker(O,129);function de(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Je=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=j;for(let a=0;a<e;a++){const c=s[a];let h,l,d=-1,p=0;for(;p<c.length&&(o.lastIndex=p,l=o.exec(c),l!==null);)p=o.lastIndex,o===j?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=r??j,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?S:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=S:o===Lt||o===Dt?o=j:(o=S,r=void 0);const f=o===S&&s[a+1].startsWith("/>")?" ":"";n+=o===j?c+qe:d>=0?(i.push(h),c.slice(0,d)+ae+c.slice(d)+
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ze=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),R=Ze(1),T=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Wt=new WeakMap,P=O.createTreeWalker(O,129);function de(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Je=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=j;for(let a=0;a<e;a++){const c=s[a];let h,l,d=-1,p=0;for(;p<c.length&&(o.lastIndex=p,l=o.exec(c),l!==null);)p=o.lastIndex,o===j?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=S):l[3]!==void 0&&(o=S):o===S?l[0]===">"?(o=r??j,d=-1):l[1]===void 0?d=-2:(d=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?S:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=S:o===Lt||o===Dt?o=j:(o=S,r=void 0);const f=o===S&&s[a+1].startsWith("/>")?" ":"";n+=o===j?c+qe:d>=0?(i.push(h),c.slice(0,d)+ae+c.slice(d)+A+f):c+A+(d===-2?a:f)}return[de(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class W{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Je(t,e);if(this.el=W.createElement(h,i),P.currentNode=this.el.content,e===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=P.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(ae)){const p=l[o++],f=r.getAttribute(d).split(A),g=/([.?@])?(.*)/.exec(p);c.push({type:1,index:n,name:g[2],strings:f,ctor:g[1]==="."?Xe:g[1]==="?"?Qe:g[1]==="@"?ti:st}),r.removeAttribute(d)}else d.startsWith(A)&&(c.push({type:6,index:n}),r.removeAttribute(d));if(le.test(r.tagName)){const d=r.textContent.split(A),p=d.length-1;if(p>0){r.textContent=tt?tt.emptyScript:"";for(let f=0;f<p;f++)r.append(d[f],B()),P.nextNode(),c.push({type:2,index:++n});r.append(d[p],B())}}}else if(r.nodeType===8)if(r.data===ce)c.push({type:2,index:n});else{let d=-1;for(;(d=r.data.indexOf(A,d+1))!==-1;)c.push({type:7,index:n}),d+=A.length-1}n++}}static createElement(t,e){const i=O.createElement("template");return i.innerHTML=t,i}}function k(s,t,e=s,i){var o,a;if(t===T)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=z(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=k(s,r._$AS(s,t.values),r,i)),t}class Ge{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,r=((t==null?void 0:t.creationScope)??O).importNode(e,!0);P.currentNode=r;let n=P.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new Y(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new ei(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=P.nextNode(),o++)}return P.currentNode=O,r}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 Y{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.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=k(this,t,e),z(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==T&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ke(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!==u&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=W.createElement(de(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Ge(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new W(t)),e}k(t){he(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new Y(this.S(B()),this.S(B()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$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 r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=k(this,t,e,0),o=!z(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=k(this,a[i+c],e,c),h===T&&(h=this._$AH[c]),o||(o=!z(h)||h!==this._$AH[c]),h===u?t=u:t!==u&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xe extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class Qe extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class ti extends st{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===T)return;const i=this._$AH,r=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==u&&(i===u||r);r&&this.element.removeEventListener(this.name,this,i),n&&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 ei{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){k(this,t)}}const lt=L.litHtmlPolyfillSupport;lt==null||lt(W,Y),(L.litHtmlVersions??(L.litHtmlVersions=[])).push("3.1.2");const ii=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new Y(t.insertBefore(B(),n),n,void 0,e??{})}return r._$AI(s),r};/**
|
18
18
|
* @license
|
19
19
|
* Copyright 2017 Google LLC
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
21
|
-
*/let
|
21
|
+
*/let _=class extends I{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=ii(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 T}};var Xt;_._$litElement$=!0,_.finalized=!0,(Xt=globalThis.litElementHydrateSupport)==null||Xt.call(globalThis,{LitElement:_});const dt=globalThis.litElementPolyfillSupport;dt==null||dt({LitElement:_});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
|
22
22
|
* @license
|
23
23
|
* Copyright 2017 Google LLC
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
25
|
-
*/const si={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:xt},ri=(s=si,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,s),i==="accessor"){const{name:o}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=e;return function(a){const c=this[o];t.call(this,a),this.requestUpdate(o,c,s)}}throw Error("Unsupported decorator location: "+i)};function
|
25
|
+
*/const si={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:xt},ri=(s=si,t,e)=>{const{kind:i,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,s),i==="accessor"){const{name:o}=e;return{set(a){const c=t.get.call(this);t.set.call(this,a),this.requestUpdate(o,c,s)},init(a){return a!==void 0&&this.P(o,void 0,s),a}}}if(i==="setter"){const{name:o}=e;return function(a){const c=this[o];t.call(this,a),this.requestUpdate(o,c,s)}}throw Error("Unsupported decorator location: "+i)};function m(s){return(t,e)=>typeof e=="object"?ri(s,t,e):((i,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...i,wrapped:!0}:i),o?Object.getOwnPropertyDescriptor(r,n):void 0})(s,t,e)}/**
|
26
26
|
* @license
|
27
27
|
* Copyright 2017 Google LLC
|
28
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
29
|
-
*/function
|
29
|
+
*/function M(s){return m({...s,state:!0,attribute:!1})}var ni=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ai=(s,t,e,i)=>{for(var r=i>1?void 0:i?oi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ni(t,e,r),r};class rt extends _{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(t){var e;return(e=this.shadowRoot)==null||e.appendChild(t),t}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),u}}rt.styles=[U`
|
30
30
|
:host {
|
31
31
|
position: fixed;
|
32
32
|
display: flex;
|
@@ -42,7 +42,7 @@
|
|
42
42
|
bottom: 20px;
|
43
43
|
left: 20px;
|
44
44
|
}
|
45
|
-
`];ai([
|
45
|
+
`];ai([m({attribute:!0})],rt.prototype,"anchor",2);/**
|
46
46
|
* @license
|
47
47
|
* Copyright 2017 Google LLC
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -58,11 +58,11 @@
|
|
58
58
|
* @license
|
59
59
|
* Copyright 2018 Google LLC
|
60
60
|
* SPDX-License-Identifier: BSD-3-Clause
|
61
|
-
*/const Jt=St(class extends pe{constructor(s){var t;if(super(s),s.type!==Ct.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var i,r;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((i=this.nt)!=null&&i.has(n))&&this.st.add(n);return this.render(t)}const e=s.element.classList;for(const n of this.st)n in t||(e.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||(r=this.nt)!=null&&r.has(n)||(o?(e.add(n),this.st.add(n)):(e.remove(n),this.st.delete(n)))}return T}}),
|
61
|
+
*/const Jt=St(class extends pe{constructor(s){var t;if(super(s),s.type!==Ct.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var i,r;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((i=this.nt)!=null&&i.has(n))&&this.st.add(n);return this.render(t)}const e=s.element.classList;for(const n of this.st)n in t||(e.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||(r=this.nt)!=null&&r.has(n)||(o?(e.add(n),this.st.add(n)):(e.remove(n),this.st.delete(n)))}return T}}),b=(s,t,e)=>{s&&e.style.setProperty(t,s)},ge=(s,t)=>{var e,i,r,n,o,a,c,h,l;b((e=s.colors)==null?void 0:e.primaryBackground,"--primary-background",t),b((i=s.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),b((r=s.colors)==null?void 0:r.secondaryBackground,"--secondary-background",t),b((n=s.colors)==null?void 0:n.textOnSecondaryBackground,"--text-on-secondary-background",t),b((o=s.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",t),b((a=s.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",t),b((c=s.colors)==null?void 0:c.interactivePrimaryBackground,"--interactive-primary-background",t),b((h=s.colors)==null?void 0:h.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",t),b((l=s.colors)==null?void 0:l.focusColor,"--focus-color",t)};/**
|
62
62
|
* @license
|
63
63
|
* Copyright 2020 Google LLC
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
65
|
-
*/const me=()=>new bi;class bi{}const ft=new WeakMap,ve=St(class extends fe{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ft.get(t);e===void 0&&(e=new WeakMap,ft.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ft.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var wi=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,q=(s,t,e,i)=>{for(var r=i>1?void 0:i?$i(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&wi(t,e,r),r};class
|
65
|
+
*/const me=()=>new bi;class bi{}const ft=new WeakMap,ve=St(class extends fe{render(s){return u}update(s,[t]){var i;const e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=s.options)==null?void 0:i.host,this.rt(this.ct=s.element)),u}rt(s){if(typeof this.Y=="function"){const t=this.ht??globalThis;let e=ft.get(t);e===void 0&&(e=new WeakMap,ft.set(t,e)),e.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),e.set(this.Y,s),s!==void 0&&this.Y.call(this.ht,s)}else this.Y.value=s}get lt(){var s,t;return typeof this.Y=="function"?(s=ft.get(this.ht??globalThis))==null?void 0:s.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var wi=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,q=(s,t,e,i)=>{for(var r=i>1?void 0:i?$i(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&wi(t,e,r),r};class y extends _{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=me(),this.widgetActive$=new re(!1),this.componentIsDestroyed$=new $t}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var t;if(!((t=this.application)!=null&&t.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.notify("widget-set-active",{widgetId:this.application.id,active:!0}),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.notify("widget-set-active",{widgetId:this.application.id,active:!1}),this.widgetActive$.next(!1),this.showTrigger())}notify(t,e={}){window!=null&&window.parent&&window.parent.postMessage({type:t,data:e},"*")}_applyBranding(){var t;(t=this.application)!=null&&t.settings&&ge(this.application.settings.branding,this)}async _renderSymbol(){var a,c,h;const t=(a=this.application)==null?void 0:a.branding(),e=(c=t==null?void 0:t.graphics)==null?void 0:c.trigger;if(e)return R` <img src=${e} class="trigger-icon" alt="" /> `;const i=(h=this.application)==null?void 0:h.triggerIcon;if(!i)return u;const r=async l=>yi,{type:n,content:o}=i;switch(n){case"Telia":{const l=await r();return l?R`<telia-icon
|
66
66
|
class="trigger-icon"
|
67
67
|
svg=${l.svg}
|
68
68
|
size="lg"
|
@@ -115,7 +115,7 @@
|
|
115
115
|
</svg>
|
116
116
|
</span>
|
117
117
|
</button>
|
118
|
-
</div>`}}
|
118
|
+
</div>`}}y.styles=[U`
|
119
119
|
:host {
|
120
120
|
--voca-rem-multiplier: 0.625;
|
121
121
|
--trigger-label-bg: #f5e0ff;
|
@@ -244,7 +244,7 @@
|
|
244
244
|
.trigger-label:hover {
|
245
245
|
opacity: 0.8;
|
246
246
|
}
|
247
|
-
`];q([
|
247
|
+
`];q([m({attribute:!1})],y.prototype,"application",2);q([M()],y.prototype,"active",2);q([M()],y.prototype,"triggerVisible",2);q([M()],y.prototype,"loaded",2);q([M()],y.prototype,"icon",2);var _i=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,E=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ai(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&_i(t,e,r),r};const ye=s=>{class t extends s{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(i){this.properties=i}writeLayout(i){this.layout=i}writeContext(i){this.context=i}addChild(i){i.parent=this,this.nodes.push(i)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return t.styles=[U`
|
248
248
|
:host {
|
249
249
|
font-family: var(--font-family);
|
250
250
|
grid-column: span var(--width);
|
@@ -256,7 +256,7 @@
|
|
256
256
|
* {
|
257
257
|
box-sizing: border-box;
|
258
258
|
}
|
259
|
-
`],E([
|
259
|
+
`],E([m()],t.prototype,"properties",2),E([m()],t.prototype,"context",2),E([m()],t.prototype,"layout",2),E([m()],t.prototype,"name",2),E([m()],t.prototype,"type",2),E([m({attribute:!1})],t.prototype,"application",2),E([m({attribute:!1})],t.prototype,"parent",2),t};class Et extends ye(_){render(){return R`Non resolved component`}}Et.styles=[U`
|
260
260
|
:host {
|
261
261
|
display: block;
|
262
262
|
}
|
@@ -264,7 +264,7 @@
|
|
264
264
|
* @license
|
265
265
|
* Copyright 2021 Google LLC
|
266
266
|
* SPDX-License-Identifier: BSD-3-Clause
|
267
|
-
*/function*xi(s,t){if(s!==void 0){let e=0;for(const i of s)yield t(i,e++)}}var
|
267
|
+
*/function*xi(s,t){if(s!==void 0){let e=0;for(const i of s)yield t(i,e++)}}var w=(s=>(s.Inline="inline",s.Trigger="trigger",s))(w||{});/**
|
268
268
|
* @license
|
269
269
|
* Copyright 2021 Google LLC
|
270
270
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -284,9 +284,9 @@
|
|
284
284
|
* @license
|
285
285
|
* Copyright 2017 Google LLC
|
286
286
|
* SPDX-License-Identifier: BSD-3-Clause
|
287
|
-
*/function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Gt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Gt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends
|
287
|
+
*/function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Gt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Gt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends _{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===w.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),R`<div class="widget-container" ${ve(this.wrapperRef)}>
|
288
288
|
${xi(this.nodes,n=>n)}
|
289
|
-
</div>`}}nt.styles=
|
289
|
+
</div>`}}nt.styles=U`
|
290
290
|
:host {
|
291
291
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
292
292
|
--spacing-xs: 0.2rem;
|
@@ -421,8 +421,8 @@
|
|
421
421
|
animation: slideDown 0.3s linear;
|
422
422
|
pointer-events: none;
|
423
423
|
}
|
424
|
-
`;Ii([v({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(d=>{const p=i(d),f=l[p.definitionId];if(!f){console.error(`No definition found for component type '${p.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=p.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&r(a,g,f.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",nt)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new Et;const r=document.createElement(`ace-${e}`);return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const we=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=we.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let $e=we;$e.ResolveWebComponentName=s=>`ace-${s}`;var m=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(m||{});class _e{constructor(t,e,i){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i}set(t,e,i){if(!this.disallowedKeys.includes(t))if(this.policy[i]){const r={value:e,category:i};this.storage.setItem(this._prefixKey(t),JSON.stringify(r))}else console.warn(`Storage policy does not allow storing items in category: ${i}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}enforcePolicy(){var t;for(const[e,i]of Object.entries(this.storage)){const r=(t=JSON.parse(i))==null?void 0:t.category;this.policy[r]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class ki{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ni{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new ki,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new $e,this.components=[],this.trigger=null,this.api=new Ni(this),this.onMessageReceived=async a=>{var h;switch(a.data.type){case"deactivate-widget":{const l=this.storage.get("open");this.hide(),(h=this.trigger)==null||h.hideTrigger(),l&&this.storage.set("open",!0,m.Necessary);return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[m.Necessary]:!0,[m.Functional]:!0,[m.Analytics]:!0};this.storage=new _e(this.id,"sessionStorage",o),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{}),window.addEventListener("message",this.onMessageReceived)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open",!0,m.Necessary)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1,m.Necessary)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0,m.Necessary)}unmute(){this.storage.set("muteAudioNotifications",!1,m.Necessary)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new rt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top}render(){if(this._isEmbeddedInIFrame())return this.root;if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Ui=s=>new F(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,triggers:e.triggers||[],apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let F=xe;F.endpoint="https://widgets.ace.teliacompany.net/api";class Mi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[m.Analytics]:t.includes("analytics"),[m.Necessary]:t.includes("necessary"),[m.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ce{constructor(){this.applications=[],this.container=new wt("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){var e;const t=this.applications.filter(i=>i.autoActivate);(((e=this.site)==null?void 0:e.triggers)||[]).filter(i=>i.triggerType==="visit").forEach(i=>{const r=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===r||o.value==="*")&&a){let h={widgetId:""};try{h=JSON.parse(o.action.data)}catch{h={widgetId:""}}const l=t.findIndex(p=>p.id===h.widgetId)>-1,d=this.applications.find(p=>p.id===h.widgetId);d&&!l&&(d.autoActivate=!0,t.push(d))}})});for await(const i of t)await i.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new wt(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new F,this.api=new Mi(this),this.triggers=[],this.httpClient=new F,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps,this.triggers=e.triggers||[]}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}setHttpClient(t){this.httpClient=t}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class M extends A{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return u;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}M.styles=[N`
|
424
|
+
`;Ii([m({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(d=>{const p=i(d),f=l[p.definitionId];if(!f){console.error(`No definition found for component type '${p.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=p.definitionId,g.application=e,f.properties&&g.writeProperties(f.properties),f.context&&g.writeContext(f.context),f.layout&&g.writeLayout(f.layout),c.addChild(g),f.children&&r(a,g,f.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",nt)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new Et;const r=document.createElement(`ace-${e}`);return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const we=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=we.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let $e=we;$e.ResolveWebComponentName=s=>`ace-${s}`;var C=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(C||{});class _e{constructor(t,e,i,r){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=r}set(t,e){if(this.disallowedKeys.includes(t))return;const i=this.storageEntries[t];if(!i){console.warn(`Storage key '${t}' is not defined.`);return}const r=i.category;if(this.policy[r]){const n={value:e,category:r};this.storage.setItem(this._prefixKey(t),JSON.stringify(n))}else console.warn(`Storage policy does not allow storing items in category: ${r}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}enforcePolicy(){var t;for(const[e,i]of Object.entries(this.storage)){const r=(t=JSON.parse(i))==null?void 0:t.category;this.policy[r]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class ki{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ui{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new ki,this.renderStrategy=w.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new $e,this.components=[],this.trigger=null,this.api=new Ui(this),this.onMessageReceived=async a=>{var h;switch(a.data.type){case"deactivate-widget":{const l=this.storage.get("open");this.hide(),(h=this.trigger)==null||h.hideTrigger(),l&&this.storage.set("open",!0);return}default:return}},this.renderStrategy=this.options.renderStrategy||w.Inline,this.triggerIcon=this.options.triggerIcon;const o={[C.Necessary]:!0,[C.Functional]:!0,[C.Analytics]:!0};this.storage=new _e(this.id,"sessionStorage",o,this.settings.storage),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{}),window.addEventListener("message",this.onMessageReceived)}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open",!0)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0)}unmute(){this.storage.set("muteAudioNotifications",!1)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===w.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new rt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top}render(){if(this._isEmbeddedInIFrame())return this.root;if(this.renderStrategy===w.Trigger){const t=new y;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const Mi=s=>new F(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,triggers:e.triggers||[],apps:e.widgets.map(i=>{let r=w.Inline;return i.renderStrategy==="Trigger"&&(r=w.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let F=xe;F.endpoint="https://widgets.ace.teliacompany.net/api";class Ni{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[C.Analytics]:t.includes("analytics"),[C.Necessary]:t.includes("necessary"),[C.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ce{constructor(){this.applications=[],this.container=new wt("environment",this),this.bootstrapped=!1,this.site=null,this.widgetAPIHandlers=new Map,this.siteConfigurationHandlers=[],setTimeout(()=>{this.notifyWidgetsOfCreation()},1e3)}async bootstrap(){await this.activate(),this.siteConfigurationHandlers.forEach(t=>{this.site&&t(this.site.api)});for(const[t,e]of this.widgetAPIHandlers)e.forEach(i=>{i()});this.bootstrapped=!0}async activate(){var e;const t=this.applications.filter(i=>i.autoActivate);(((e=this.site)==null?void 0:e.triggers)||[]).filter(i=>i.triggerType==="visit").forEach(i=>{const r=window.location.pathname,n=i.condition.outputs||[];i.condition.type==="url"&&n.forEach(o=>{const a=o.action.type==="render_widget";if((o.value===r||o.value==="*")&&a){let h={widgetId:""};try{h=JSON.parse(o.action.data)}catch{h={widgetId:""}}const l=t.findIndex(p=>p.id===h.widgetId)>-1,d=this.applications.find(p=>p.id===h.widgetId);d&&!l&&(d.autoActivate=!0,t.push(d))}})});for await(const i of t)await i.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new wt(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new F,this.api=new Ni(this),this.triggers=[],this.httpClient=new F,typeof t=="string"?this.url=t:(t.httpClient&&(this.httpClient=t.httpClient),this.loadFromConfig(t))}async load(t){const e=await this.httpClient.getSite(t);if(!e){console.warn(`Unable to load site from the url provided: ${t}`);return}this.configurations=e.apps,this.triggers=e.triggers||[]}loadFromConfig(t){this.configurations=t.apps.map(e=>({id:"",renderStrategy:e.renderStrategy,widgetId:e.widgetId,autoActivate:e.autoActivate,anchor:e.anchor,triggerIcon:{type:"Telia",content:e.triggerIcon||"question"}}))}setHttpClient(t){this.httpClient=t}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class N extends _{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return u;if(this.widget.renderStrategy===w.Trigger){const t=new y;return t.application=this.widget,t}return this.widget.render()}}N.styles=[U`
|
425
425
|
:host {
|
426
426
|
display: block;
|
427
427
|
}
|
428
|
-
`];Pt([
|
428
|
+
`];Pt([m({attribute:!0})],N.prototype,"name",2);Pt([M()],N.prototype,"widget",2);Pt([M()],N.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",rt);customElements.get("ace-trigger")||customElements.define("ace-trigger",y);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Et);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",nt);customElements.get("ace-widget")||customElements.define("ace-widget",N);const Li=async(s,t,e={})=>{const i=new Se(s);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)};exports.AceWidget=N;exports.Application=Ae;exports.Container=wt;exports.Environment=Ce;exports.HttpClient=F;exports.Site=Se;exports.StorageCategory=C;exports.StorageService=_e;exports.Trigger=y;exports.WidgetComponent=ye;exports.applicationContext=be;exports.bootstrap=Li;exports.createHttpClient=Mi;
|
package/index.mjs
CHANGED
@@ -53,7 +53,7 @@ function G(s, t, e) {
|
|
53
53
|
(n || !(i in t)) && (n || (n = Array.prototype.slice.call(t, 0, i)), n[i] = t[i]);
|
54
54
|
return s.concat(n || Array.prototype.slice.call(t));
|
55
55
|
}
|
56
|
-
function
|
56
|
+
function w(s) {
|
57
57
|
return typeof s == "function";
|
58
58
|
}
|
59
59
|
function Qt(s) {
|
@@ -93,8 +93,8 @@ var it = function() {
|
|
93
93
|
var h = c.value;
|
94
94
|
h.remove(this);
|
95
95
|
}
|
96
|
-
} catch (
|
97
|
-
t = { error:
|
96
|
+
} catch (v) {
|
97
|
+
t = { error: v };
|
98
98
|
} finally {
|
99
99
|
try {
|
100
100
|
c && !c.done && (e = a.return) && e.call(a);
|
@@ -106,11 +106,11 @@ var it = function() {
|
|
106
106
|
else
|
107
107
|
o.remove(this);
|
108
108
|
var l = this.initialTeardown;
|
109
|
-
if (
|
109
|
+
if (w(l))
|
110
110
|
try {
|
111
111
|
l();
|
112
|
-
} catch (
|
113
|
-
n =
|
112
|
+
} catch (v) {
|
113
|
+
n = v instanceof ot ? v.errors : [v];
|
114
114
|
}
|
115
115
|
var d = this._finalizers;
|
116
116
|
if (d) {
|
@@ -120,12 +120,12 @@ var it = function() {
|
|
120
120
|
var g = f.value;
|
121
121
|
try {
|
122
122
|
Pt(g);
|
123
|
-
} catch (
|
124
|
-
n = n ?? [],
|
123
|
+
} catch (v) {
|
124
|
+
n = n ?? [], v instanceof ot ? n = G(G([], J(n)), J(v.errors)) : n.push(v);
|
125
125
|
}
|
126
126
|
}
|
127
|
-
} catch (
|
128
|
-
i = { error:
|
127
|
+
} catch (v) {
|
128
|
+
i = { error: v };
|
129
129
|
} finally {
|
130
130
|
try {
|
131
131
|
f && !f.done && (r = p.return) && r.call(p);
|
@@ -169,10 +169,10 @@ var it = function() {
|
|
169
169
|
}(), s;
|
170
170
|
}(), te = it.EMPTY;
|
171
171
|
function ee(s) {
|
172
|
-
return s instanceof it || s && "closed" in s &&
|
172
|
+
return s instanceof it || s && "closed" in s && w(s.remove) && w(s.add) && w(s.unsubscribe);
|
173
173
|
}
|
174
174
|
function Pt(s) {
|
175
|
-
|
175
|
+
w(s) ? s() : s.unsubscribe();
|
176
176
|
}
|
177
177
|
var ie = {
|
178
178
|
onUnhandledError: null,
|
@@ -273,7 +273,7 @@ var Ae = function() {
|
|
273
273
|
W(t, s);
|
274
274
|
function t(e, i, r) {
|
275
275
|
var n = s.call(this) || this, o;
|
276
|
-
if (
|
276
|
+
if (w(e) || !e)
|
277
277
|
o = {
|
278
278
|
next: e ?? void 0,
|
279
279
|
error: i ?? void 0,
|
@@ -382,7 +382,7 @@ function It(s) {
|
|
382
382
|
return (t = s ?? ie.Promise) !== null && t !== void 0 ? t : Promise;
|
383
383
|
}
|
384
384
|
function Oe(s) {
|
385
|
-
return s &&
|
385
|
+
return s && w(s.next) && w(s.error) && w(s.complete);
|
386
386
|
}
|
387
387
|
function Te(s) {
|
388
388
|
return s && s instanceof se || Oe(s) && ee(s);
|
@@ -539,7 +539,7 @@ class kt {
|
|
539
539
|
* Copyright 2019 Google LLC
|
540
540
|
* SPDX-License-Identifier: BSD-3-Clause
|
541
541
|
*/
|
542
|
-
const Z = globalThis, $t = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(),
|
542
|
+
const Z = globalThis, $t = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), Ut = /* @__PURE__ */ new WeakMap();
|
543
543
|
let oe = class {
|
544
544
|
constructor(t, e, i) {
|
545
545
|
if (this._$cssResult$ = !0, i !== _t)
|
@@ -551,7 +551,7 @@ let oe = class {
|
|
551
551
|
const e = this.t;
|
552
552
|
if ($t && t === void 0) {
|
553
553
|
const i = e !== void 0 && e.length === 1;
|
554
|
-
i && (t =
|
554
|
+
i && (t = Ut.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Ut.set(e, t));
|
555
555
|
}
|
556
556
|
return t;
|
557
557
|
}
|
@@ -559,7 +559,7 @@ let oe = class {
|
|
559
559
|
return this.cssText;
|
560
560
|
}
|
561
561
|
};
|
562
|
-
const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t),
|
562
|
+
const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), U = (s, ...t) => {
|
563
563
|
const e = s.length === 1 ? s[0] : t.reduce((i, r, n) => i + ((o) => {
|
564
564
|
if (o._$cssResult$ === !0)
|
565
565
|
return o.cssText;
|
@@ -576,7 +576,7 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), N = (s,
|
|
576
576
|
const i = document.createElement("style"), r = Z.litNonce;
|
577
577
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
|
578
578
|
}
|
579
|
-
},
|
579
|
+
}, Nt = $t ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
580
580
|
let e = "";
|
581
581
|
for (const i of t.cssRules)
|
582
582
|
e += i.cssText;
|
@@ -587,7 +587,7 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), N = (s,
|
|
587
587
|
* Copyright 2017 Google LLC
|
588
588
|
* SPDX-License-Identifier: BSD-3-Clause
|
589
589
|
*/
|
590
|
-
const { is:
|
590
|
+
const { is: Ue, defineProperty: Ne, getOwnPropertyDescriptor: Me, getOwnPropertyNames: je, getOwnPropertySymbols: Le, getPrototypeOf: He } = Object, x = globalThis, Mt = x.trustedTypes, De = Mt ? Mt.emptyScript : "", ct = x.reactiveElementPolyfillSupport, j = (s, t) => s, X = { toAttribute(s, t) {
|
591
591
|
switch (t) {
|
592
592
|
case Boolean:
|
593
593
|
s = s ? De : null;
|
@@ -615,8 +615,8 @@ const { is: Ne, defineProperty: Ue, getOwnPropertyDescriptor: Me, getOwnProperty
|
|
615
615
|
}
|
616
616
|
}
|
617
617
|
return e;
|
618
|
-
} }, At = (s, t) => !
|
619
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
618
|
+
} }, At = (s, t) => !Ue(s, t), jt = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged: At };
|
619
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), x.litPropertyMetadata ?? (x.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
620
620
|
let I = class extends HTMLElement {
|
621
621
|
static addInitializer(t) {
|
622
622
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
@@ -627,7 +627,7 @@ let I = class extends HTMLElement {
|
|
627
627
|
static createProperty(t, e = jt) {
|
628
628
|
if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
|
629
629
|
const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
630
|
-
r !== void 0 &&
|
630
|
+
r !== void 0 && Ne(this.prototype, t, r);
|
631
631
|
}
|
632
632
|
}
|
633
633
|
static getPropertyDescriptor(t, e, i) {
|
@@ -679,9 +679,9 @@ let I = class extends HTMLElement {
|
|
679
679
|
if (Array.isArray(t)) {
|
680
680
|
const i = new Set(t.flat(1 / 0).reverse());
|
681
681
|
for (const r of i)
|
682
|
-
e.unshift(
|
682
|
+
e.unshift(Nt(r));
|
683
683
|
} else
|
684
|
-
t !== void 0 && e.push(
|
684
|
+
t !== void 0 && e.push(Nt(t));
|
685
685
|
return e;
|
686
686
|
}
|
687
687
|
static _$Eu(t, e) {
|
@@ -828,15 +828,15 @@ let I = class extends HTMLElement {
|
|
828
828
|
firstUpdated(t) {
|
829
829
|
}
|
830
830
|
};
|
831
|
-
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProperties")] = /* @__PURE__ */ new Map(), I[j("finalized")] = /* @__PURE__ */ new Map(), ct == null || ct({ ReactiveElement: I }), (
|
831
|
+
I.elementStyles = [], I.shadowRootOptions = { mode: "open" }, I[j("elementProperties")] = /* @__PURE__ */ new Map(), I[j("finalized")] = /* @__PURE__ */ new Map(), ct == null || ct({ ReactiveElement: I }), (x.reactiveElementVersions ?? (x.reactiveElementVersions = [])).push("2.0.4");
|
832
832
|
/**
|
833
833
|
* @license
|
834
834
|
* Copyright 2017 Google LLC
|
835
835
|
* SPDX-License-Identifier: BSD-3-Clause
|
836
836
|
*/
|
837
|
-
const L = globalThis, Q = L.trustedTypes, Lt = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$",
|
838
|
-
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ht = /-->/g, Dt = />/g,
|
839
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Bt = /'/g, zt = /"/g, le = /^(?:script|style|textarea|title)$/i, We = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), R = We(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Wt = /* @__PURE__ */ new WeakMap(),
|
837
|
+
const L = globalThis, Q = L.trustedTypes, Lt = Q ? Q.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, ae = "$lit$", A = `lit$${(Math.random() + "").slice(9)}$`, ce = "?" + A, Be = `<${ce}>`, O = document, D = () => O.createComment(""), B = (s) => s === null || typeof s != "object" && typeof s != "function", he = Array.isArray, ze = (s) => he(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", ht = `[
|
838
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ht = /-->/g, Dt = />/g, C = RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
|
839
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Bt = /'/g, zt = /"/g, le = /^(?:script|style|textarea|title)$/i, We = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), R = We(1), T = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), Wt = /* @__PURE__ */ new WeakMap(), E = O.createTreeWalker(O, 129);
|
840
840
|
function de(s, t) {
|
841
841
|
if (!Array.isArray(s) || !s.hasOwnProperty("raw"))
|
842
842
|
throw Error("invalid template strings array");
|
@@ -849,9 +849,9 @@ const Fe = (s, t) => {
|
|
849
849
|
const c = s[a];
|
850
850
|
let h, l, d = -1, p = 0;
|
851
851
|
for (; p < c.length && (o.lastIndex = p, l = o.exec(c), l !== null); )
|
852
|
-
p = o.lastIndex, o === M ? l[1] === "!--" ? o = Ht : l[1] !== void 0 ? o = Dt : l[2] !== void 0 ? (le.test(l[2]) && (r = RegExp("</" + l[2], "g")), o =
|
853
|
-
const f = o ===
|
854
|
-
n += o === M ? c + Be : d >= 0 ? (i.push(h), c.slice(0, d) + ae + c.slice(d) +
|
852
|
+
p = o.lastIndex, o === M ? l[1] === "!--" ? o = Ht : l[1] !== void 0 ? o = Dt : l[2] !== void 0 ? (le.test(l[2]) && (r = RegExp("</" + l[2], "g")), o = C) : l[3] !== void 0 && (o = C) : o === C ? l[0] === ">" ? (o = r ?? M, d = -1) : l[1] === void 0 ? d = -2 : (d = o.lastIndex - l[2].length, h = l[1], o = l[3] === void 0 ? C : l[3] === '"' ? zt : Bt) : o === zt || o === Bt ? o = C : o === Ht || o === Dt ? o = M : (o = C, r = void 0);
|
853
|
+
const f = o === C && s[a + 1].startsWith("/>") ? " " : "";
|
854
|
+
n += o === M ? c + Be : d >= 0 ? (i.push(h), c.slice(0, d) + ae + c.slice(d) + A + f) : c + A + (d === -2 ? a : f);
|
855
855
|
}
|
856
856
|
return [de(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
|
857
857
|
};
|
@@ -861,25 +861,25 @@ class z {
|
|
861
861
|
this.parts = [];
|
862
862
|
let n = 0, o = 0;
|
863
863
|
const a = t.length - 1, c = this.parts, [h, l] = Fe(t, e);
|
864
|
-
if (this.el = z.createElement(h, i),
|
864
|
+
if (this.el = z.createElement(h, i), E.currentNode = this.el.content, e === 2) {
|
865
865
|
const d = this.el.content.firstChild;
|
866
866
|
d.replaceWith(...d.childNodes);
|
867
867
|
}
|
868
|
-
for (; (r =
|
868
|
+
for (; (r = E.nextNode()) !== null && c.length < a; ) {
|
869
869
|
if (r.nodeType === 1) {
|
870
870
|
if (r.hasAttributes())
|
871
871
|
for (const d of r.getAttributeNames())
|
872
872
|
if (d.endsWith(ae)) {
|
873
|
-
const p = l[o++], f = r.getAttribute(d).split(
|
873
|
+
const p = l[o++], f = r.getAttribute(d).split(A), g = /([.?@])?(.*)/.exec(p);
|
874
874
|
c.push({ type: 1, index: n, name: g[2], strings: f, ctor: g[1] === "." ? Ye : g[1] === "?" ? qe : g[1] === "@" ? Ke : st }), r.removeAttribute(d);
|
875
875
|
} else
|
876
|
-
d.startsWith(
|
876
|
+
d.startsWith(A) && (c.push({ type: 6, index: n }), r.removeAttribute(d));
|
877
877
|
if (le.test(r.tagName)) {
|
878
|
-
const d = r.textContent.split(
|
878
|
+
const d = r.textContent.split(A), p = d.length - 1;
|
879
879
|
if (p > 0) {
|
880
880
|
r.textContent = Q ? Q.emptyScript : "";
|
881
881
|
for (let f = 0; f < p; f++)
|
882
|
-
r.append(d[f], D()),
|
882
|
+
r.append(d[f], D()), E.nextNode(), c.push({ type: 2, index: ++n });
|
883
883
|
r.append(d[p], D());
|
884
884
|
}
|
885
885
|
}
|
@@ -888,8 +888,8 @@ class z {
|
|
888
888
|
c.push({ type: 2, index: n });
|
889
889
|
else {
|
890
890
|
let d = -1;
|
891
|
-
for (; (d = r.data.indexOf(
|
892
|
-
c.push({ type: 7, index: n }), d +=
|
891
|
+
for (; (d = r.data.indexOf(A, d + 1)) !== -1; )
|
892
|
+
c.push({ type: 7, index: n }), d += A.length - 1;
|
893
893
|
}
|
894
894
|
n++;
|
895
895
|
}
|
@@ -919,16 +919,16 @@ class Ve {
|
|
919
919
|
}
|
920
920
|
u(t) {
|
921
921
|
const { el: { content: e }, parts: i } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? O).importNode(e, !0);
|
922
|
-
|
923
|
-
let n =
|
922
|
+
E.currentNode = r;
|
923
|
+
let n = E.nextNode(), o = 0, a = 0, c = i[0];
|
924
924
|
for (; c !== void 0; ) {
|
925
925
|
if (o === c.index) {
|
926
926
|
let h;
|
927
927
|
c.type === 2 ? h = new F(n, n.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(n, c.name, c.strings, this, t) : c.type === 6 && (h = new Ze(n, this, t)), this._$AV.push(h), c = i[++a];
|
928
928
|
}
|
929
|
-
o !== (c == null ? void 0 : c.index) && (n =
|
929
|
+
o !== (c == null ? void 0 : c.index) && (n = E.nextNode(), o++);
|
930
930
|
}
|
931
|
-
return
|
931
|
+
return E.currentNode = O, r;
|
932
932
|
}
|
933
933
|
p(t) {
|
934
934
|
let e = 0;
|
@@ -1086,7 +1086,7 @@ const Je = (s, t, e) => {
|
|
1086
1086
|
* Copyright 2017 Google LLC
|
1087
1087
|
* SPDX-License-Identifier: BSD-3-Clause
|
1088
1088
|
*/
|
1089
|
-
let
|
1089
|
+
let $ = class extends I {
|
1090
1090
|
constructor() {
|
1091
1091
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
1092
1092
|
}
|
@@ -1112,9 +1112,9 @@ let _ = class extends I {
|
|
1112
1112
|
}
|
1113
1113
|
};
|
1114
1114
|
var Xt;
|
1115
|
-
_
|
1115
|
+
$._$litElement$ = !0, $.finalized = !0, (Xt = globalThis.litElementHydrateSupport) == null || Xt.call(globalThis, { LitElement: $ });
|
1116
1116
|
const dt = globalThis.litElementPolyfillSupport;
|
1117
|
-
dt == null || dt({ LitElement:
|
1117
|
+
dt == null || dt({ LitElement: $ });
|
1118
1118
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.4");
|
1119
1119
|
/**
|
1120
1120
|
* @license
|
@@ -1142,7 +1142,7 @@ const Ge = { attribute: !0, type: String, converter: X, reflect: !1, hasChanged:
|
|
1142
1142
|
}
|
1143
1143
|
throw Error("Unsupported decorator location: " + i);
|
1144
1144
|
};
|
1145
|
-
function
|
1145
|
+
function m(s) {
|
1146
1146
|
return (t, e) => typeof e == "object" ? Xe(s, t, e) : ((i, r, n) => {
|
1147
1147
|
const o = r.hasOwnProperty(n);
|
1148
1148
|
return r.constructor.createProperty(n, o ? { ...i, wrapped: !0 } : i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
@@ -1153,15 +1153,15 @@ function v(s) {
|
|
1153
1153
|
* Copyright 2017 Google LLC
|
1154
1154
|
* SPDX-License-Identifier: BSD-3-Clause
|
1155
1155
|
*/
|
1156
|
-
function
|
1157
|
-
return
|
1156
|
+
function N(s) {
|
1157
|
+
return m({ ...s, state: !0, attribute: !1 });
|
1158
1158
|
}
|
1159
1159
|
var Qe = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ei = (s, t, e, i) => {
|
1160
1160
|
for (var r = i > 1 ? void 0 : i ? ti(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
1161
1161
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
1162
1162
|
return i && r && Qe(t, e, r), r;
|
1163
1163
|
};
|
1164
|
-
class rt extends
|
1164
|
+
class rt extends $ {
|
1165
1165
|
constructor() {
|
1166
1166
|
super(...arguments), this.anchor = "BottomRight";
|
1167
1167
|
}
|
@@ -1174,7 +1174,7 @@ class rt extends _ {
|
|
1174
1174
|
}
|
1175
1175
|
}
|
1176
1176
|
rt.styles = [
|
1177
|
-
|
1177
|
+
U`
|
1178
1178
|
:host {
|
1179
1179
|
position: fixed;
|
1180
1180
|
display: flex;
|
@@ -1193,7 +1193,7 @@ rt.styles = [
|
|
1193
1193
|
`
|
1194
1194
|
];
|
1195
1195
|
ei([
|
1196
|
-
|
1196
|
+
m({ attribute: !0 })
|
1197
1197
|
], rt.prototype, "anchor", 2);
|
1198
1198
|
/**
|
1199
1199
|
* @license
|
@@ -1531,39 +1531,39 @@ const Jt = Ct(class extends pe {
|
|
1531
1531
|
}
|
1532
1532
|
return T;
|
1533
1533
|
}
|
1534
|
-
}),
|
1534
|
+
}), y = (s, t, e) => {
|
1535
1535
|
s && e.style.setProperty(t, s);
|
1536
1536
|
}, ge = (s, t) => {
|
1537
1537
|
var e, i, r, n, o, a, c, h, l;
|
1538
|
-
|
1538
|
+
y((e = s.colors) == null ? void 0 : e.primaryBackground, "--primary-background", t), y(
|
1539
1539
|
(i = s.colors) == null ? void 0 : i.textOnPrimaryBackground,
|
1540
1540
|
"--text-on-primary-background",
|
1541
1541
|
t
|
1542
|
-
),
|
1542
|
+
), y(
|
1543
1543
|
(r = s.colors) == null ? void 0 : r.secondaryBackground,
|
1544
1544
|
"--secondary-background",
|
1545
1545
|
t
|
1546
|
-
),
|
1546
|
+
), y(
|
1547
1547
|
(n = s.colors) == null ? void 0 : n.textOnSecondaryBackground,
|
1548
1548
|
"--text-on-secondary-background",
|
1549
1549
|
t
|
1550
|
-
),
|
1550
|
+
), y(
|
1551
1551
|
(o = s.colors) == null ? void 0 : o.interactiveDestructiveBackground,
|
1552
1552
|
"--destructive-color",
|
1553
1553
|
t
|
1554
|
-
),
|
1554
|
+
), y(
|
1555
1555
|
(a = s.colors) == null ? void 0 : a.interactiveTextOnDestructiveBackground,
|
1556
1556
|
"--text-on-destructive-color",
|
1557
1557
|
t
|
1558
|
-
),
|
1558
|
+
), y(
|
1559
1559
|
(c = s.colors) == null ? void 0 : c.interactivePrimaryBackground,
|
1560
1560
|
"--interactive-primary-background",
|
1561
1561
|
t
|
1562
|
-
),
|
1562
|
+
), y(
|
1563
1563
|
(h = s.colors) == null ? void 0 : h.interactiveTextOnPrimaryBackground,
|
1564
1564
|
"--interactive-text-on-primary-background",
|
1565
1565
|
t
|
1566
|
-
),
|
1566
|
+
), y((l = s.colors) == null ? void 0 : l.focusColor, "--focus-color", t);
|
1567
1567
|
};
|
1568
1568
|
/**
|
1569
1569
|
* @license
|
@@ -1606,7 +1606,7 @@ var fi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, V = (s, t,
|
|
1606
1606
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
1607
1607
|
return i && r && fi(t, e, r), r;
|
1608
1608
|
};
|
1609
|
-
class
|
1609
|
+
class _ extends $ {
|
1610
1610
|
constructor() {
|
1611
1611
|
super(...arguments), this.active = !1, this.triggerVisible = !0, this.loaded = !1, this.containerRef = me(), this.widgetActive$ = new re(!1), this.componentIsDestroyed$ = new wt();
|
1612
1612
|
}
|
@@ -1739,8 +1739,8 @@ class A extends _ {
|
|
1739
1739
|
</div>`;
|
1740
1740
|
}
|
1741
1741
|
}
|
1742
|
-
|
1743
|
-
|
1742
|
+
_.styles = [
|
1743
|
+
U`
|
1744
1744
|
:host {
|
1745
1745
|
--voca-rem-multiplier: 0.625;
|
1746
1746
|
--trigger-label-bg: #f5e0ff;
|
@@ -1872,21 +1872,21 @@ A.styles = [
|
|
1872
1872
|
`
|
1873
1873
|
];
|
1874
1874
|
V([
|
1875
|
-
|
1876
|
-
],
|
1875
|
+
m({ attribute: !1 })
|
1876
|
+
], _.prototype, "application", 2);
|
1877
1877
|
V([
|
1878
|
-
|
1879
|
-
],
|
1878
|
+
N()
|
1879
|
+
], _.prototype, "active", 2);
|
1880
1880
|
V([
|
1881
|
-
|
1882
|
-
],
|
1881
|
+
N()
|
1882
|
+
], _.prototype, "triggerVisible", 2);
|
1883
1883
|
V([
|
1884
|
-
|
1885
|
-
],
|
1884
|
+
N()
|
1885
|
+
], _.prototype, "loaded", 2);
|
1886
1886
|
V([
|
1887
|
-
|
1888
|
-
],
|
1889
|
-
var mi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor,
|
1887
|
+
N()
|
1888
|
+
], _.prototype, "icon", 2);
|
1889
|
+
var mi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, S = (s, t, e, i) => {
|
1890
1890
|
for (var r = i > 1 ? void 0 : i ? vi(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
1891
1891
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
1892
1892
|
return i && r && mi(t, e, r), r;
|
@@ -1917,7 +1917,7 @@ const yi = (s) => {
|
|
1917
1917
|
}
|
1918
1918
|
return t.styles = [
|
1919
1919
|
// (superClass as unknown as typeof LitElement).styles ?? [],
|
1920
|
-
|
1920
|
+
U`
|
1921
1921
|
:host {
|
1922
1922
|
font-family: var(--font-family);
|
1923
1923
|
grid-column: span var(--width);
|
@@ -1930,29 +1930,29 @@ const yi = (s) => {
|
|
1930
1930
|
box-sizing: border-box;
|
1931
1931
|
}
|
1932
1932
|
`
|
1933
|
-
],
|
1934
|
-
|
1935
|
-
], t.prototype, "properties", 2),
|
1936
|
-
|
1937
|
-
], t.prototype, "context", 2),
|
1938
|
-
|
1939
|
-
], t.prototype, "layout", 2),
|
1940
|
-
|
1941
|
-
], t.prototype, "name", 2),
|
1942
|
-
|
1943
|
-
], t.prototype, "type", 2),
|
1944
|
-
|
1945
|
-
], t.prototype, "application", 2),
|
1946
|
-
|
1933
|
+
], S([
|
1934
|
+
m()
|
1935
|
+
], t.prototype, "properties", 2), S([
|
1936
|
+
m()
|
1937
|
+
], t.prototype, "context", 2), S([
|
1938
|
+
m()
|
1939
|
+
], t.prototype, "layout", 2), S([
|
1940
|
+
m()
|
1941
|
+
], t.prototype, "name", 2), S([
|
1942
|
+
m()
|
1943
|
+
], t.prototype, "type", 2), S([
|
1944
|
+
m({ attribute: !1 })
|
1945
|
+
], t.prototype, "application", 2), S([
|
1946
|
+
m({ attribute: !1 })
|
1947
1947
|
], t.prototype, "parent", 2), t;
|
1948
1948
|
};
|
1949
|
-
class St extends yi(
|
1949
|
+
class St extends yi($) {
|
1950
1950
|
render() {
|
1951
1951
|
return R`Non resolved component`;
|
1952
1952
|
}
|
1953
1953
|
}
|
1954
1954
|
St.styles = [
|
1955
|
-
|
1955
|
+
U`
|
1956
1956
|
:host {
|
1957
1957
|
display: block;
|
1958
1958
|
}
|
@@ -1970,7 +1970,7 @@ function* bi(s, t) {
|
|
1970
1970
|
yield t(i, e++);
|
1971
1971
|
}
|
1972
1972
|
}
|
1973
|
-
var
|
1973
|
+
var b = /* @__PURE__ */ ((s) => (s.Inline = "inline", s.Trigger = "trigger", s))(b || {});
|
1974
1974
|
/**
|
1975
1975
|
* @license
|
1976
1976
|
* Copyright 2021 Google LLC
|
@@ -2103,7 +2103,7 @@ var xi = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Si = (s, t
|
|
2103
2103
|
return i && r && xi(t, e, r), r;
|
2104
2104
|
};
|
2105
2105
|
const Ei = "application";
|
2106
|
-
class nt extends
|
2106
|
+
class nt extends $ {
|
2107
2107
|
constructor() {
|
2108
2108
|
super(...arguments), this.nodes = [], this.wrapperRef = me();
|
2109
2109
|
}
|
@@ -2130,12 +2130,12 @@ class nt extends _ {
|
|
2130
2130
|
render() {
|
2131
2131
|
var i, r;
|
2132
2132
|
const t = this.application.settings.components.conversation;
|
2133
|
-
return ((r = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : r.isThirdPartyWidget) ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy ===
|
2133
|
+
return ((r = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : r.isThirdPartyWidget) ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy === b.Trigger && (this.renderRoot.host.classList.add("floating"), this.application.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.application.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right")), window.self !== window.top && this.renderRoot.host.classList.add("embedded"), R`<div class="widget-container" ${ve(this.wrapperRef)}>
|
2134
2134
|
${bi(this.nodes, (n) => n)}
|
2135
2135
|
</div>`;
|
2136
2136
|
}
|
2137
2137
|
}
|
2138
|
-
nt.styles =
|
2138
|
+
nt.styles = U`
|
2139
2139
|
:host {
|
2140
2140
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
2141
2141
|
--spacing-xs: 0.2rem;
|
@@ -2272,7 +2272,7 @@ nt.styles = N`
|
|
2272
2272
|
}
|
2273
2273
|
`;
|
2274
2274
|
Si([
|
2275
|
-
|
2275
|
+
m({ attribute: !1 }),
|
2276
2276
|
Ai({ context: Ei })
|
2277
2277
|
], nt.prototype, "application", 2);
|
2278
2278
|
class Pi {
|
@@ -2358,20 +2358,27 @@ const ye = class {
|
|
2358
2358
|
};
|
2359
2359
|
let be = ye;
|
2360
2360
|
be.ResolveWebComponentName = (s) => `ace-${s}`;
|
2361
|
-
var
|
2361
|
+
var P = /* @__PURE__ */ ((s) => (s.Necessary = "necessary", s.Functional = "functional", s.Analytics = "analytics", s))(P || {});
|
2362
2362
|
class Oi {
|
2363
|
-
constructor(t, e, i) {
|
2364
|
-
this.disallowedKeys = [], this.widgetId = t, this.storage = e === "localStorage" ? window.localStorage : window.sessionStorage, this.policy = i;
|
2363
|
+
constructor(t, e, i, r) {
|
2364
|
+
this.disallowedKeys = [], this.widgetId = t, this.storage = e === "localStorage" ? window.localStorage : window.sessionStorage, this.policy = i, this.storageEntries = r;
|
2365
2365
|
}
|
2366
|
-
set(t, e
|
2367
|
-
if (
|
2368
|
-
|
2369
|
-
|
2370
|
-
|
2371
|
-
}
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2366
|
+
set(t, e) {
|
2367
|
+
if (this.disallowedKeys.includes(t))
|
2368
|
+
return;
|
2369
|
+
const i = this.storageEntries[t];
|
2370
|
+
if (!i) {
|
2371
|
+
console.warn(`Storage key '${t}' is not defined.`);
|
2372
|
+
return;
|
2373
|
+
}
|
2374
|
+
const r = i.category;
|
2375
|
+
if (this.policy[r]) {
|
2376
|
+
const n = { value: e, category: r };
|
2377
|
+
this.storage.setItem(this._prefixKey(t), JSON.stringify(n));
|
2378
|
+
} else
|
2379
|
+
console.warn(
|
2380
|
+
`Storage policy does not allow storing items in category: ${r}`
|
2381
|
+
);
|
2375
2382
|
}
|
2376
2383
|
get(t) {
|
2377
2384
|
const e = this.storage.getItem(this._prefixKey(t));
|
@@ -2437,24 +2444,29 @@ class Ii {
|
|
2437
2444
|
}
|
2438
2445
|
class Ri {
|
2439
2446
|
constructor(t, e, i, r, n) {
|
2440
|
-
this.id = t, this.name = e, this.container = i, this.settings = r, this.options = n, this.platform = new Pi(), this.texts = new Ti(), this.renderStrategy =
|
2447
|
+
this.id = t, this.name = e, this.container = i, this.settings = r, this.options = n, this.platform = new Pi(), this.texts = new Ti(), this.renderStrategy = b.Inline, this.anchor = "BottomRight", this.autoActivate = !1, this.plugins = [], this.componentResolver = new be(), this.components = [], this.trigger = null, this.api = new Ii(this), this.onMessageReceived = async (a) => {
|
2441
2448
|
var h;
|
2442
2449
|
switch (a.data.type) {
|
2443
2450
|
case "deactivate-widget": {
|
2444
2451
|
const l = this.storage.get("open");
|
2445
|
-
this.hide(), (h = this.trigger) == null || h.hideTrigger(), l && this.storage.set("open", !0
|
2452
|
+
this.hide(), (h = this.trigger) == null || h.hideTrigger(), l && this.storage.set("open", !0);
|
2446
2453
|
return;
|
2447
2454
|
}
|
2448
2455
|
default:
|
2449
2456
|
return;
|
2450
2457
|
}
|
2451
|
-
}, this.renderStrategy = this.options.renderStrategy ||
|
2458
|
+
}, this.renderStrategy = this.options.renderStrategy || b.Inline, this.triggerIcon = this.options.triggerIcon;
|
2452
2459
|
const o = {
|
2453
|
-
[
|
2454
|
-
[
|
2455
|
-
[
|
2460
|
+
[P.Necessary]: !0,
|
2461
|
+
[P.Functional]: !0,
|
2462
|
+
[P.Analytics]: !0
|
2456
2463
|
};
|
2457
|
-
this.storage = new Oi(
|
2464
|
+
this.storage = new Oi(
|
2465
|
+
this.id,
|
2466
|
+
"sessionStorage",
|
2467
|
+
o,
|
2468
|
+
this.settings.storage
|
2469
|
+
), typeof n.autoActivate == "boolean" && (this.autoActivate = n.autoActivate), n.anchor && (this.anchor = n.anchor), this.container.register("$settings", r), this.texts.loadTexts(r.texts || {}), window.addEventListener("message", this.onMessageReceived);
|
2458
2470
|
}
|
2459
2471
|
async activate() {
|
2460
2472
|
if (await this.loadPlugins(), await this.componentResolver.loadComponents(), this.root = this.platform.createComponentModel(this.settings, this), this.container.setState(ne.Ready), this.autoActivate) {
|
@@ -2476,23 +2488,19 @@ class Ri {
|
|
2476
2488
|
return this.plugins.push(t), this;
|
2477
2489
|
}
|
2478
2490
|
appendToDOM() {
|
2479
|
-
this.root && (this.root.classList.add("expanded"), this.root.classList.remove("hidden"), document.body.appendChild(this.root)), this.storage.set("open", !0
|
2491
|
+
this.root && (this.root.classList.add("expanded"), this.root.classList.remove("hidden"), document.body.appendChild(this.root)), this.storage.set("open", !0);
|
2480
2492
|
}
|
2481
2493
|
hide() {
|
2482
|
-
this.root && (this.root.classList.add("hidden"), this.root.classList.remove("expanded")), this.storage.set("open", !1
|
2494
|
+
this.root && (this.root.classList.add("hidden"), this.root.classList.remove("expanded")), this.storage.set("open", !1);
|
2483
2495
|
}
|
2484
2496
|
setZIndex(t) {
|
2485
2497
|
this.root && (this.root.style.zIndex = t.toString());
|
2486
2498
|
}
|
2487
2499
|
mute() {
|
2488
|
-
this.storage.set("muteAudioNotifications", !0
|
2500
|
+
this.storage.set("muteAudioNotifications", !0);
|
2489
2501
|
}
|
2490
2502
|
unmute() {
|
2491
|
-
this.storage.set(
|
2492
|
-
"muteAudioNotifications",
|
2493
|
-
!1,
|
2494
|
-
m.Necessary
|
2495
|
-
);
|
2503
|
+
this.storage.set("muteAudioNotifications", !1);
|
2496
2504
|
}
|
2497
2505
|
registerComponent(t, e) {
|
2498
2506
|
this.componentResolver.registerComponent(t, e);
|
@@ -2509,7 +2517,7 @@ class Ri {
|
|
2509
2517
|
}
|
2510
2518
|
_getTargetElement() {
|
2511
2519
|
let t = "bottom-right";
|
2512
|
-
if (this.anchor === "BottomRight" ? t = "bottom-right" : this.anchor === "BottomLeft" && (t = "bottom-left"), this.renderStrategy ===
|
2520
|
+
if (this.anchor === "BottomRight" ? t = "bottom-right" : this.anchor === "BottomLeft" && (t = "bottom-left"), this.renderStrategy === b.Trigger) {
|
2513
2521
|
let e = document.querySelector(
|
2514
2522
|
`ace-trigger-slot.${t}`
|
2515
2523
|
);
|
@@ -2523,8 +2531,8 @@ class Ri {
|
|
2523
2531
|
render() {
|
2524
2532
|
if (this._isEmbeddedInIFrame())
|
2525
2533
|
return this.root;
|
2526
|
-
if (this.renderStrategy ===
|
2527
|
-
const t = new
|
2534
|
+
if (this.renderStrategy === b.Trigger) {
|
2535
|
+
const t = new _();
|
2528
2536
|
return t.application = this, this.trigger = t, this.storage.get("open") && this.trigger.toggleActive(), t;
|
2529
2537
|
}
|
2530
2538
|
return this.root;
|
@@ -2542,8 +2550,8 @@ const Fi = (s) => new et(s), we = class {
|
|
2542
2550
|
id: e.id,
|
2543
2551
|
triggers: e.triggers || [],
|
2544
2552
|
apps: e.widgets.map((i) => {
|
2545
|
-
let r =
|
2546
|
-
return i.renderStrategy === "Trigger" && (r =
|
2553
|
+
let r = b.Inline;
|
2554
|
+
return i.renderStrategy === "Trigger" && (r = b.Trigger), {
|
2547
2555
|
id: i.id,
|
2548
2556
|
widgetId: i.widgetId,
|
2549
2557
|
renderStrategy: r,
|
@@ -2576,9 +2584,9 @@ class ki {
|
|
2576
2584
|
(((i = this.site.environment) == null ? void 0 : i.applications) || []).forEach((r) => {
|
2577
2585
|
if (r.storage) {
|
2578
2586
|
const n = {
|
2579
|
-
[
|
2580
|
-
[
|
2581
|
-
[
|
2587
|
+
[P.Analytics]: t.includes("analytics"),
|
2588
|
+
[P.Necessary]: t.includes("necessary"),
|
2589
|
+
[P.Functional]: t.includes("functional")
|
2582
2590
|
};
|
2583
2591
|
r.storage.updatePolicy(n);
|
2584
2592
|
}
|
@@ -2591,7 +2599,7 @@ class ki {
|
|
2591
2599
|
});
|
2592
2600
|
}
|
2593
2601
|
}
|
2594
|
-
class
|
2602
|
+
class Ui {
|
2595
2603
|
constructor() {
|
2596
2604
|
this.applications = [], this.container = new kt("environment", this), this.bootstrapped = !1, this.site = null, this.widgetAPIHandlers = /* @__PURE__ */ new Map(), this.siteConfigurationHandlers = [], setTimeout(() => {
|
2597
2605
|
this.notifyWidgetsOfCreation();
|
@@ -2679,7 +2687,7 @@ class Ni {
|
|
2679
2687
|
}), this;
|
2680
2688
|
}
|
2681
2689
|
}
|
2682
|
-
class
|
2690
|
+
class Ni {
|
2683
2691
|
constructor(t) {
|
2684
2692
|
this.configurations = [], this.httpClient = new et(), this.api = new ki(this), this.triggers = [], this.httpClient = new et(), typeof t == "string" ? this.url = t : (t.httpClient && (this.httpClient = t.httpClient), this.loadFromConfig(t));
|
2685
2693
|
}
|
@@ -2709,7 +2717,7 @@ class Ui {
|
|
2709
2717
|
}
|
2710
2718
|
async bootstrap(t) {
|
2711
2719
|
var e;
|
2712
|
-
this.url && await this.load(this.url), this.environment = new
|
2720
|
+
this.url && await this.load(this.url), this.environment = new Ui(), this.addGlobal(this.environment);
|
2713
2721
|
for await (const i of this.configurations) {
|
2714
2722
|
const r = await this.httpClient.getWidget(i.widgetId);
|
2715
2723
|
r && ((e = this.environment) == null || e.registerApp(
|
@@ -2740,7 +2748,7 @@ var Mi = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Et = (s, t
|
|
2740
2748
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
2741
2749
|
return i && r && Mi(t, e, r), r;
|
2742
2750
|
};
|
2743
|
-
class Y extends
|
2751
|
+
class Y extends $ {
|
2744
2752
|
constructor() {
|
2745
2753
|
super(), this.status = "deactivated", this.addEventListener("environment-created", this.onEnvironmentCreated);
|
2746
2754
|
}
|
@@ -2765,48 +2773,48 @@ class Y extends _ {
|
|
2765
2773
|
render() {
|
2766
2774
|
if (!this.widget || this.status !== "activated")
|
2767
2775
|
return u;
|
2768
|
-
if (this.widget.renderStrategy ===
|
2769
|
-
const t = new
|
2776
|
+
if (this.widget.renderStrategy === b.Trigger) {
|
2777
|
+
const t = new _();
|
2770
2778
|
return t.application = this.widget, t;
|
2771
2779
|
}
|
2772
2780
|
return this.widget.render();
|
2773
2781
|
}
|
2774
2782
|
}
|
2775
2783
|
Y.styles = [
|
2776
|
-
|
2784
|
+
U`
|
2777
2785
|
:host {
|
2778
2786
|
display: block;
|
2779
2787
|
}
|
2780
2788
|
`
|
2781
2789
|
];
|
2782
2790
|
Et([
|
2783
|
-
|
2791
|
+
m({ attribute: !0 })
|
2784
2792
|
], Y.prototype, "name", 2);
|
2785
2793
|
Et([
|
2786
|
-
|
2794
|
+
N()
|
2787
2795
|
], Y.prototype, "widget", 2);
|
2788
2796
|
Et([
|
2789
|
-
|
2797
|
+
N()
|
2790
2798
|
], Y.prototype, "status", 2);
|
2791
2799
|
customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", rt);
|
2792
|
-
customElements.get("ace-trigger") || customElements.define("ace-trigger",
|
2800
|
+
customElements.get("ace-trigger") || customElements.define("ace-trigger", _);
|
2793
2801
|
customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", St);
|
2794
2802
|
customElements.get("ace-wrapper") || customElements.define("ace-wrapper", nt);
|
2795
2803
|
customElements.get("ace-widget") || customElements.define("ace-widget", Y);
|
2796
2804
|
const Vi = async (s, t, e = {}) => {
|
2797
|
-
const i = new
|
2805
|
+
const i = new Ni(s);
|
2798
2806
|
e.httpClient && i.setHttpClient(e.httpClient), await i.bootstrap(t);
|
2799
2807
|
};
|
2800
2808
|
export {
|
2801
2809
|
Y as AceWidget,
|
2802
2810
|
Ri as Application,
|
2803
2811
|
kt as Container,
|
2804
|
-
|
2812
|
+
Ui as Environment,
|
2805
2813
|
et as HttpClient,
|
2806
|
-
|
2807
|
-
|
2814
|
+
Ni as Site,
|
2815
|
+
P as StorageCategory,
|
2808
2816
|
Oi as StorageService,
|
2809
|
-
|
2817
|
+
_ as Trigger,
|
2810
2818
|
yi as WidgetComponent,
|
2811
2819
|
Ei as applicationContext,
|
2812
2820
|
Vi as bootstrap,
|
package/package.json
CHANGED
@@ -7,9 +7,10 @@ export declare class StorageService {
|
|
7
7
|
private storage;
|
8
8
|
private policy;
|
9
9
|
private widgetId;
|
10
|
+
private storageEntries;
|
10
11
|
private disallowedKeys;
|
11
|
-
constructor(widgetId: string, storageType: 'localStorage' | 'sessionStorage', policy: Record<StorageCategory, boolean>);
|
12
|
-
set<T>(key: string, value: T
|
12
|
+
constructor(widgetId: string, storageType: 'localStorage' | 'sessionStorage', policy: Record<StorageCategory, boolean>, storageEntries: Record<string, any>);
|
13
|
+
set<T>(key: string, value: T): void;
|
13
14
|
get<T>(key: string): T | null;
|
14
15
|
removeItem(key: string): void;
|
15
16
|
enforcePolicy(): void;
|
package/types.d.ts
CHANGED
@@ -12,6 +12,7 @@ export type WidgetConfig = {
|
|
12
12
|
entry: string;
|
13
13
|
texts?: Record<string, string>;
|
14
14
|
components: Record<string, ComponentDefinition>;
|
15
|
+
storage: Record<string, any>;
|
15
16
|
branding: Record<string, any>;
|
16
17
|
styles?: Record<string, any>;
|
17
18
|
survey?: Record<string, any>;
|