@telia-ace/widget-core-flamingo 1.1.76-rc.4 → 1.1.76-rc.41
Sign up to get free protection for your applications and to get access to all the features.
- package/components/trigger.component.d.ts +1 -0
- package/index.js +18 -18
- package/index.mjs +176 -137
- package/models/application.d.ts +2 -0
- 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
@@ -15,6 +15,7 @@ export declare class Trigger extends LitElement {
|
|
15
15
|
connectedCallback(): Promise<void>;
|
16
16
|
disconnectedCallback(): void;
|
17
17
|
toggleActive(): void;
|
18
|
+
notify(type: string, data?: Record<string, any>): void;
|
18
19
|
_applyBranding(): void;
|
19
20
|
_renderSymbol(): Promise<typeof nothing | import("lit-html").TemplateResult<1>>;
|
20
21
|
hideTrigger(): void;
|
package/index.js
CHANGED
@@ -1,24 +1,24 @@
|
|
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
|
@@ -26,7 +26,7 @@
|
|
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;
|
@@ -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([m({attribute:!1})],
|
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([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(
|
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([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 v=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(v||{});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.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[v.Necessary]:!0,[v.Functional]:!0,[v.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||{})}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,v.Necessary)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1,v.Necessary)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0,v.Necessary)}unmute(){this.storage.set("muteAudioNotifications",!1,v.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}render(){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={[v.Analytics]:t.includes("analytics"),[v.Necessary]:t.includes("necessary"),[v.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([m({attribute:!0})],
|
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) {
|
@@ -106,7 +106,7 @@ 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
112
|
} catch (v) {
|
@@ -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) {
|
@@ -649,14 +649,14 @@ let I = class extends HTMLElement {
|
|
649
649
|
static _$Ei() {
|
650
650
|
if (this.hasOwnProperty(j("elementProperties")))
|
651
651
|
return;
|
652
|
-
const t =
|
652
|
+
const t = He(this);
|
653
653
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
654
654
|
}
|
655
655
|
static finalize() {
|
656
656
|
if (this.hasOwnProperty(j("finalized")))
|
657
657
|
return;
|
658
658
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(j("properties"))) {
|
659
|
-
const e = this.properties, i = [...je(e), ...
|
659
|
+
const e = this.properties, i = [...je(e), ...Le(e)];
|
660
660
|
for (const r of i)
|
661
661
|
this.createProperty(r, e[r]);
|
662
662
|
}
|
@@ -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,19 +828,19 @@ 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
|
838
|
-
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/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");
|
843
|
-
return
|
843
|
+
return Lt !== void 0 ? Lt.createHTML(t) : t;
|
844
844
|
}
|
845
845
|
const Fe = (s, t) => {
|
846
846
|
const e = s.length - 1, i = [];
|
@@ -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 =
|
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;
|
@@ -1070,8 +1070,8 @@ class Ze {
|
|
1070
1070
|
k(this, t);
|
1071
1071
|
}
|
1072
1072
|
}
|
1073
|
-
const lt =
|
1074
|
-
lt == null || lt(z, F), (
|
1073
|
+
const lt = L.litHtmlPolyfillSupport;
|
1074
|
+
lt == null || lt(z, F), (L.litHtmlVersions ?? (L.litHtmlVersions = [])).push("3.1.2");
|
1075
1075
|
const Je = (s, t, e) => {
|
1076
1076
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
1077
1077
|
let r = i._$litPart$;
|
@@ -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
|
@@ -1153,7 +1153,7 @@ function m(s) {
|
|
1153
1153
|
* Copyright 2017 Google LLC
|
1154
1154
|
* SPDX-License-Identifier: BSD-3-Clause
|
1155
1155
|
*/
|
1156
|
-
function
|
1156
|
+
function N(s) {
|
1157
1157
|
return m({ ...s, state: !0, attribute: !1 });
|
1158
1158
|
}
|
1159
1159
|
var Qe = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ei = (s, t, e, i) => {
|
@@ -1161,7 +1161,7 @@ var Qe = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, ei = (s, t
|
|
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;
|
@@ -1228,13 +1228,13 @@ const ii = (s) => s.strings === void 0;
|
|
1228
1228
|
* Copyright 2017 Google LLC
|
1229
1229
|
* SPDX-License-Identifier: BSD-3-Clause
|
1230
1230
|
*/
|
1231
|
-
const
|
1231
|
+
const H = (s, t) => {
|
1232
1232
|
var i;
|
1233
1233
|
const e = s._$AN;
|
1234
1234
|
if (e === void 0)
|
1235
1235
|
return !1;
|
1236
1236
|
for (const r of e)
|
1237
|
-
(i = r._$AO) == null || i.call(r, t, !1),
|
1237
|
+
(i = r._$AO) == null || i.call(r, t, !1), H(r, t);
|
1238
1238
|
return !0;
|
1239
1239
|
}, tt = (s) => {
|
1240
1240
|
let t, e;
|
@@ -1262,11 +1262,11 @@ function ri(s, t = !1, e = 0) {
|
|
1262
1262
|
if (t)
|
1263
1263
|
if (Array.isArray(i))
|
1264
1264
|
for (let n = e; n < i.length; n++)
|
1265
|
-
|
1265
|
+
H(i[n], !1), tt(i[n]);
|
1266
1266
|
else
|
1267
|
-
i != null && (
|
1267
|
+
i != null && (H(i, !1), tt(i));
|
1268
1268
|
else
|
1269
|
-
|
1269
|
+
H(this, s);
|
1270
1270
|
}
|
1271
1271
|
const ni = (s) => {
|
1272
1272
|
s.type == xt.CHILD && (s._$AP ?? (s._$AP = ri), s._$AQ ?? (s._$AQ = si));
|
@@ -1280,7 +1280,7 @@ class fe extends pe {
|
|
1280
1280
|
}
|
1281
1281
|
_$AO(t, e = !0) {
|
1282
1282
|
var i, r;
|
1283
|
-
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (
|
1283
|
+
t !== this.isConnected && (this.isConnected = t, t ? (i = this.reconnected) == null || i.call(this) : (r = this.disconnected) == null || r.call(this)), e && (H(this, t), tt(this));
|
1284
1284
|
}
|
1285
1285
|
setValue(t) {
|
1286
1286
|
if (ii(this._$Ct))
|
@@ -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
|
}
|
@@ -1624,7 +1624,22 @@ class A extends _ {
|
|
1624
1624
|
);
|
1625
1625
|
return;
|
1626
1626
|
}
|
1627
|
-
this.active = !this.active, this.active ? (this.application.appendToDOM(), this.
|
1627
|
+
this.active = !this.active, this.active ? (this.application.appendToDOM(), this.notify("widget-set-active", {
|
1628
|
+
widgetId: this.application.id,
|
1629
|
+
active: !0
|
1630
|
+
}), this.widgetActive$.next(!0), this.hideTrigger()) : (this.application.hide(), this.notify("widget-set-active", {
|
1631
|
+
widgetId: this.application.id,
|
1632
|
+
active: !1
|
1633
|
+
}), this.widgetActive$.next(!1), this.showTrigger());
|
1634
|
+
}
|
1635
|
+
notify(t, e = {}) {
|
1636
|
+
window != null && window.parent && window.parent.postMessage(
|
1637
|
+
{
|
1638
|
+
type: t,
|
1639
|
+
data: e
|
1640
|
+
},
|
1641
|
+
"*"
|
1642
|
+
);
|
1628
1643
|
}
|
1629
1644
|
_applyBranding() {
|
1630
1645
|
var t;
|
@@ -1724,8 +1739,8 @@ class A extends _ {
|
|
1724
1739
|
</div>`;
|
1725
1740
|
}
|
1726
1741
|
}
|
1727
|
-
|
1728
|
-
|
1742
|
+
_.styles = [
|
1743
|
+
U`
|
1729
1744
|
:host {
|
1730
1745
|
--voca-rem-multiplier: 0.625;
|
1731
1746
|
--trigger-label-bg: #f5e0ff;
|
@@ -1858,20 +1873,20 @@ A.styles = [
|
|
1858
1873
|
];
|
1859
1874
|
V([
|
1860
1875
|
m({ attribute: !1 })
|
1861
|
-
],
|
1876
|
+
], _.prototype, "application", 2);
|
1862
1877
|
V([
|
1863
|
-
|
1864
|
-
],
|
1878
|
+
N()
|
1879
|
+
], _.prototype, "active", 2);
|
1865
1880
|
V([
|
1866
|
-
|
1867
|
-
],
|
1881
|
+
N()
|
1882
|
+
], _.prototype, "triggerVisible", 2);
|
1868
1883
|
V([
|
1869
|
-
|
1870
|
-
],
|
1884
|
+
N()
|
1885
|
+
], _.prototype, "loaded", 2);
|
1871
1886
|
V([
|
1872
|
-
|
1873
|
-
],
|
1874
|
-
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) => {
|
1875
1890
|
for (var r = i > 1 ? void 0 : i ? vi(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
1876
1891
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
1877
1892
|
return i && r && mi(t, e, r), r;
|
@@ -1902,7 +1917,7 @@ const yi = (s) => {
|
|
1902
1917
|
}
|
1903
1918
|
return t.styles = [
|
1904
1919
|
// (superClass as unknown as typeof LitElement).styles ?? [],
|
1905
|
-
|
1920
|
+
U`
|
1906
1921
|
:host {
|
1907
1922
|
font-family: var(--font-family);
|
1908
1923
|
grid-column: span var(--width);
|
@@ -1915,29 +1930,29 @@ const yi = (s) => {
|
|
1915
1930
|
box-sizing: border-box;
|
1916
1931
|
}
|
1917
1932
|
`
|
1918
|
-
],
|
1933
|
+
], S([
|
1919
1934
|
m()
|
1920
|
-
], t.prototype, "properties", 2),
|
1935
|
+
], t.prototype, "properties", 2), S([
|
1921
1936
|
m()
|
1922
|
-
], t.prototype, "context", 2),
|
1937
|
+
], t.prototype, "context", 2), S([
|
1923
1938
|
m()
|
1924
|
-
], t.prototype, "layout", 2),
|
1939
|
+
], t.prototype, "layout", 2), S([
|
1925
1940
|
m()
|
1926
|
-
], t.prototype, "name", 2),
|
1941
|
+
], t.prototype, "name", 2), S([
|
1927
1942
|
m()
|
1928
|
-
], t.prototype, "type", 2),
|
1943
|
+
], t.prototype, "type", 2), S([
|
1929
1944
|
m({ attribute: !1 })
|
1930
|
-
], t.prototype, "application", 2),
|
1945
|
+
], t.prototype, "application", 2), S([
|
1931
1946
|
m({ attribute: !1 })
|
1932
1947
|
], t.prototype, "parent", 2), t;
|
1933
1948
|
};
|
1934
|
-
class St extends yi(
|
1949
|
+
class St extends yi($) {
|
1935
1950
|
render() {
|
1936
1951
|
return R`Non resolved component`;
|
1937
1952
|
}
|
1938
1953
|
}
|
1939
1954
|
St.styles = [
|
1940
|
-
|
1955
|
+
U`
|
1941
1956
|
:host {
|
1942
1957
|
display: block;
|
1943
1958
|
}
|
@@ -1955,7 +1970,7 @@ function* bi(s, t) {
|
|
1955
1970
|
yield t(i, e++);
|
1956
1971
|
}
|
1957
1972
|
}
|
1958
|
-
var
|
1973
|
+
var b = /* @__PURE__ */ ((s) => (s.Inline = "inline", s.Trigger = "trigger", s))(b || {});
|
1959
1974
|
/**
|
1960
1975
|
* @license
|
1961
1976
|
* Copyright 2021 Google LLC
|
@@ -2088,7 +2103,7 @@ var xi = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Si = (s, t
|
|
2088
2103
|
return i && r && xi(t, e, r), r;
|
2089
2104
|
};
|
2090
2105
|
const Ei = "application";
|
2091
|
-
class nt extends
|
2106
|
+
class nt extends $ {
|
2092
2107
|
constructor() {
|
2093
2108
|
super(...arguments), this.nodes = [], this.wrapperRef = me();
|
2094
2109
|
}
|
@@ -2115,12 +2130,12 @@ class nt extends _ {
|
|
2115
2130
|
render() {
|
2116
2131
|
var i, r;
|
2117
2132
|
const t = this.application.settings.components.conversation;
|
2118
|
-
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)}>
|
2119
2134
|
${bi(this.nodes, (n) => n)}
|
2120
2135
|
</div>`;
|
2121
2136
|
}
|
2122
2137
|
}
|
2123
|
-
nt.styles =
|
2138
|
+
nt.styles = U`
|
2124
2139
|
:host {
|
2125
2140
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
2126
2141
|
--spacing-xs: 0.2rem;
|
@@ -2343,20 +2358,27 @@ const ye = class {
|
|
2343
2358
|
};
|
2344
2359
|
let be = ye;
|
2345
2360
|
be.ResolveWebComponentName = (s) => `ace-${s}`;
|
2346
|
-
var
|
2361
|
+
var P = /* @__PURE__ */ ((s) => (s.Necessary = "necessary", s.Functional = "functional", s.Analytics = "analytics", s))(P || {});
|
2347
2362
|
class Oi {
|
2348
|
-
constructor(t, e, i) {
|
2349
|
-
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;
|
2350
2365
|
}
|
2351
|
-
set(t, e
|
2352
|
-
if (
|
2353
|
-
|
2354
|
-
|
2355
|
-
|
2356
|
-
}
|
2357
|
-
|
2358
|
-
|
2359
|
-
|
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
|
+
);
|
2360
2382
|
}
|
2361
2383
|
get(t) {
|
2362
2384
|
const e = this.storage.getItem(this._prefixKey(t));
|
@@ -2422,13 +2444,29 @@ class Ii {
|
|
2422
2444
|
}
|
2423
2445
|
class Ri {
|
2424
2446
|
constructor(t, e, i, r, n) {
|
2425
|
-
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) => {
|
2448
|
+
var h;
|
2449
|
+
switch (a.data.type) {
|
2450
|
+
case "deactivate-widget": {
|
2451
|
+
const l = this.storage.get("open");
|
2452
|
+
this.hide(), (h = this.trigger) == null || h.hideTrigger(), l && this.storage.set("open", !0);
|
2453
|
+
return;
|
2454
|
+
}
|
2455
|
+
default:
|
2456
|
+
return;
|
2457
|
+
}
|
2458
|
+
}, this.renderStrategy = this.options.renderStrategy || b.Inline, this.triggerIcon = this.options.triggerIcon;
|
2426
2459
|
const o = {
|
2427
|
-
[
|
2428
|
-
[
|
2429
|
-
[
|
2460
|
+
[P.Necessary]: !0,
|
2461
|
+
[P.Functional]: !0,
|
2462
|
+
[P.Analytics]: !0
|
2430
2463
|
};
|
2431
|
-
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);
|
2432
2470
|
}
|
2433
2471
|
async activate() {
|
2434
2472
|
if (await this.loadPlugins(), await this.componentResolver.loadComponents(), this.root = this.platform.createComponentModel(this.settings, this), this.container.setState(ne.Ready), this.autoActivate) {
|
@@ -2450,23 +2488,19 @@ class Ri {
|
|
2450
2488
|
return this.plugins.push(t), this;
|
2451
2489
|
}
|
2452
2490
|
appendToDOM() {
|
2453
|
-
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);
|
2454
2492
|
}
|
2455
2493
|
hide() {
|
2456
|
-
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);
|
2457
2495
|
}
|
2458
2496
|
setZIndex(t) {
|
2459
2497
|
this.root && (this.root.style.zIndex = t.toString());
|
2460
2498
|
}
|
2461
2499
|
mute() {
|
2462
|
-
this.storage.set("muteAudioNotifications", !0
|
2500
|
+
this.storage.set("muteAudioNotifications", !0);
|
2463
2501
|
}
|
2464
2502
|
unmute() {
|
2465
|
-
this.storage.set(
|
2466
|
-
"muteAudioNotifications",
|
2467
|
-
!1,
|
2468
|
-
y.Necessary
|
2469
|
-
);
|
2503
|
+
this.storage.set("muteAudioNotifications", !1);
|
2470
2504
|
}
|
2471
2505
|
registerComponent(t, e) {
|
2472
2506
|
this.componentResolver.registerComponent(t, e);
|
@@ -2483,7 +2517,7 @@ class Ri {
|
|
2483
2517
|
}
|
2484
2518
|
_getTargetElement() {
|
2485
2519
|
let t = "bottom-right";
|
2486
|
-
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) {
|
2487
2521
|
let e = document.querySelector(
|
2488
2522
|
`ace-trigger-slot.${t}`
|
2489
2523
|
);
|
@@ -2491,9 +2525,14 @@ class Ri {
|
|
2491
2525
|
}
|
2492
2526
|
return document.body;
|
2493
2527
|
}
|
2528
|
+
_isEmbeddedInIFrame() {
|
2529
|
+
return window.self !== window.top;
|
2530
|
+
}
|
2494
2531
|
render() {
|
2495
|
-
if (this.
|
2496
|
-
|
2532
|
+
if (this._isEmbeddedInIFrame())
|
2533
|
+
return this.root;
|
2534
|
+
if (this.renderStrategy === b.Trigger) {
|
2535
|
+
const t = new _();
|
2497
2536
|
return t.application = this, this.trigger = t, this.storage.get("open") && this.trigger.toggleActive(), t;
|
2498
2537
|
}
|
2499
2538
|
return this.root;
|
@@ -2511,8 +2550,8 @@ const Fi = (s) => new et(s), we = class {
|
|
2511
2550
|
id: e.id,
|
2512
2551
|
triggers: e.triggers || [],
|
2513
2552
|
apps: e.widgets.map((i) => {
|
2514
|
-
let r =
|
2515
|
-
return i.renderStrategy === "Trigger" && (r =
|
2553
|
+
let r = b.Inline;
|
2554
|
+
return i.renderStrategy === "Trigger" && (r = b.Trigger), {
|
2516
2555
|
id: i.id,
|
2517
2556
|
widgetId: i.widgetId,
|
2518
2557
|
renderStrategy: r,
|
@@ -2545,9 +2584,9 @@ class ki {
|
|
2545
2584
|
(((i = this.site.environment) == null ? void 0 : i.applications) || []).forEach((r) => {
|
2546
2585
|
if (r.storage) {
|
2547
2586
|
const n = {
|
2548
|
-
[
|
2549
|
-
[
|
2550
|
-
[
|
2587
|
+
[P.Analytics]: t.includes("analytics"),
|
2588
|
+
[P.Necessary]: t.includes("necessary"),
|
2589
|
+
[P.Functional]: t.includes("functional")
|
2551
2590
|
};
|
2552
2591
|
r.storage.updatePolicy(n);
|
2553
2592
|
}
|
@@ -2560,7 +2599,7 @@ class ki {
|
|
2560
2599
|
});
|
2561
2600
|
}
|
2562
2601
|
}
|
2563
|
-
class
|
2602
|
+
class Ui {
|
2564
2603
|
constructor() {
|
2565
2604
|
this.applications = [], this.container = new kt("environment", this), this.bootstrapped = !1, this.site = null, this.widgetAPIHandlers = /* @__PURE__ */ new Map(), this.siteConfigurationHandlers = [], setTimeout(() => {
|
2566
2605
|
this.notifyWidgetsOfCreation();
|
@@ -2648,7 +2687,7 @@ class Ni {
|
|
2648
2687
|
}), this;
|
2649
2688
|
}
|
2650
2689
|
}
|
2651
|
-
class
|
2690
|
+
class Ni {
|
2652
2691
|
constructor(t) {
|
2653
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));
|
2654
2693
|
}
|
@@ -2678,7 +2717,7 @@ class Ui {
|
|
2678
2717
|
}
|
2679
2718
|
async bootstrap(t) {
|
2680
2719
|
var e;
|
2681
|
-
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);
|
2682
2721
|
for await (const i of this.configurations) {
|
2683
2722
|
const r = await this.httpClient.getWidget(i.widgetId);
|
2684
2723
|
r && ((e = this.environment) == null || e.registerApp(
|
@@ -2709,7 +2748,7 @@ var Mi = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Et = (s, t
|
|
2709
2748
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
2710
2749
|
return i && r && Mi(t, e, r), r;
|
2711
2750
|
};
|
2712
|
-
class Y extends
|
2751
|
+
class Y extends $ {
|
2713
2752
|
constructor() {
|
2714
2753
|
super(), this.status = "deactivated", this.addEventListener("environment-created", this.onEnvironmentCreated);
|
2715
2754
|
}
|
@@ -2734,15 +2773,15 @@ class Y extends _ {
|
|
2734
2773
|
render() {
|
2735
2774
|
if (!this.widget || this.status !== "activated")
|
2736
2775
|
return u;
|
2737
|
-
if (this.widget.renderStrategy ===
|
2738
|
-
const t = new
|
2776
|
+
if (this.widget.renderStrategy === b.Trigger) {
|
2777
|
+
const t = new _();
|
2739
2778
|
return t.application = this.widget, t;
|
2740
2779
|
}
|
2741
2780
|
return this.widget.render();
|
2742
2781
|
}
|
2743
2782
|
}
|
2744
2783
|
Y.styles = [
|
2745
|
-
|
2784
|
+
U`
|
2746
2785
|
:host {
|
2747
2786
|
display: block;
|
2748
2787
|
}
|
@@ -2752,30 +2791,30 @@ Et([
|
|
2752
2791
|
m({ attribute: !0 })
|
2753
2792
|
], Y.prototype, "name", 2);
|
2754
2793
|
Et([
|
2755
|
-
|
2794
|
+
N()
|
2756
2795
|
], Y.prototype, "widget", 2);
|
2757
2796
|
Et([
|
2758
|
-
|
2797
|
+
N()
|
2759
2798
|
], Y.prototype, "status", 2);
|
2760
2799
|
customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", rt);
|
2761
|
-
customElements.get("ace-trigger") || customElements.define("ace-trigger",
|
2800
|
+
customElements.get("ace-trigger") || customElements.define("ace-trigger", _);
|
2762
2801
|
customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", St);
|
2763
2802
|
customElements.get("ace-wrapper") || customElements.define("ace-wrapper", nt);
|
2764
2803
|
customElements.get("ace-widget") || customElements.define("ace-widget", Y);
|
2765
2804
|
const Vi = async (s, t, e = {}) => {
|
2766
|
-
const i = new
|
2805
|
+
const i = new Ni(s);
|
2767
2806
|
e.httpClient && i.setHttpClient(e.httpClient), await i.bootstrap(t);
|
2768
2807
|
};
|
2769
2808
|
export {
|
2770
2809
|
Y as AceWidget,
|
2771
2810
|
Ri as Application,
|
2772
2811
|
kt as Container,
|
2773
|
-
|
2812
|
+
Ui as Environment,
|
2774
2813
|
et as HttpClient,
|
2775
|
-
|
2776
|
-
|
2814
|
+
Ni as Site,
|
2815
|
+
P as StorageCategory,
|
2777
2816
|
Oi as StorageService,
|
2778
|
-
|
2817
|
+
_ as Trigger,
|
2779
2818
|
yi as WidgetComponent,
|
2780
2819
|
Ei as applicationContext,
|
2781
2820
|
Vi as bootstrap,
|
package/models/application.d.ts
CHANGED
@@ -29,6 +29,7 @@ export declare class Application {
|
|
29
29
|
constructor(id: string, name: string, container: Container, settings: WidgetConfig, options: ApplicationOptions);
|
30
30
|
activate(): Promise<void>;
|
31
31
|
private loadPlugins;
|
32
|
+
onMessageReceived: (event: any) => Promise<void>;
|
32
33
|
styles(): Record<string, any>;
|
33
34
|
branding(): Record<string, any>;
|
34
35
|
plugin(plugin: PluginType): this;
|
@@ -42,5 +43,6 @@ export declare class Application {
|
|
42
43
|
mountComponent(component: WidgetComponentType): void;
|
43
44
|
getComponent<T extends WidgetComponentType>(type: string): T | null;
|
44
45
|
private _getTargetElement;
|
46
|
+
private _isEmbeddedInIFrame;
|
45
47
|
render(): Trigger | Wrapper | undefined;
|
46
48
|
}
|
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>;
|