@telia-ace/widget-core-flamingo 1.1.151-rc.2 → 1.1.151-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/action-button-styles.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +57 -18
- package/index.mjs +115 -75
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const actionButtonStyles: import('lit').CSSResult;
|
package/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { HttpClient, createHttpClient } from './services/http-client.service';
|
|
|
10
10
|
export { StorageService, StorageCategory } from './services/storage.service';
|
|
11
11
|
export { TextsService } from './services/texts.service';
|
|
12
12
|
export { applicationContext } from './components/wrapper.component';
|
|
13
|
+
export { actionButtonStyles } from './components/action-button-styles';
|
|
13
14
|
export type { IHttpClient } from './services/http-client.service';
|
|
14
15
|
export type { WidgetComponentType } from './components/widget.component';
|
|
15
16
|
export type { SiteConfig, WidgetConfig, Auth, LiveAgent, AuthenticationInfo, } from './types';
|
package/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var mt=function(r,t){return mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])},mt(r,t)};function K(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mt(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function vt(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function yt(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var i=e.call(r),s,o=[],n;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(a){n={error:a}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(n)throw n.error}}return o}function bt(r,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,o;i<s;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return r.concat(o||Array.prototype.slice.call(t))}function _(r){return typeof r=="function"}function le(r){var t=function(i){Error.call(i),i.stack=new Error().stack},e=r(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ct=le(function(r){return function(e){r(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
2
2
|
`+e.map(function(i,s){return s+1+") "+i.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function wt(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var nt=(function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,i,s,o;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var a=vt(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.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 n.remove(this);var h=this.initialTeardown;if(_(h))try{h()}catch(v){o=v instanceof ct?v.errors:[v]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var u=vt(d),f=u.next();!f.done;f=u.next()){var g=f.value;try{Ht(g)}catch(v){o=o??[],v instanceof ct?o=bt(bt([],yt(o)),yt(v.errors)):o.push(v)}}}catch(v){i={error:v}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(i)throw i.error}}}if(o)throw new ct(o)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ht(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&wt(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&wt(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=(function(){var t=new r;return t.closed=!0,t})(),r})(),de=nt.EMPTY;function ue(r){return r instanceof nt||r&&"closed"in r&&_(r.remove)&&_(r.add)&&_(r.unsubscribe)}function Ht(r){_(r)?r():r.unsubscribe()}var Me={Promise:void 0},Ne={setTimeout:function(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return setTimeout.apply(void 0,bt([r,t],yt(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Le(r){Ne.setTimeout(function(){throw r})}function
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function wt(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var nt=(function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,i,s,o;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var a=vt(n),c=a.next();!c.done;c=a.next()){var l=c.value;l.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 n.remove(this);var h=this.initialTeardown;if(_(h))try{h()}catch(v){o=v instanceof ct?v.errors:[v]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var u=vt(d),f=u.next();!f.done;f=u.next()){var g=f.value;try{Ht(g)}catch(v){o=o??[],v instanceof ct?o=bt(bt([],yt(o)),yt(v.errors)):o.push(v)}}}catch(v){i={error:v}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(i)throw i.error}}}if(o)throw new ct(o)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ht(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&wt(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&wt(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=(function(){var t=new r;return t.closed=!0,t})(),r})(),de=nt.EMPTY;function ue(r){return r instanceof nt||r&&"closed"in r&&_(r.remove)&&_(r.add)&&_(r.unsubscribe)}function Ht(r){_(r)?r():r.unsubscribe()}var Me={Promise:void 0},Ne={setTimeout:function(r,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];return setTimeout.apply(void 0,bt([r,t],yt(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Le(r){Ne.setTimeout(function(){throw r})}function Bt(){}function X(r){r()}var pe=(function(r){K(t,r);function t(e){var i=r.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ue(e)&&e.add(i)):i.destination=He,i}return t.create=function(e,i,s){return new $t(e,i,s)},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,r.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})(nt),Ue=(function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){J(i)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){J(i)}else J(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){J(e)}},r})(),$t=(function(r){K(t,r);function t(e,i,s){var o=r.call(this)||this,n;return _(e)||!e?n={next:e??void 0,error:i??void 0,complete:s??void 0}:n=e,o.destination=new Ue(n),o}return t})(pe);function J(r){Le(r)}function je(r){throw r}var He={closed:!0,next:Bt,error:je,complete:Bt},Be=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ze(r){return r}function De(r){return r.length===0?ze:r.length===1?r[0]:function(e){return r.reduce(function(i,s){return s(i)},e)}}var zt=(function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,i){var s=this,o=Ve(t)?t:new $t(t,e,i);return X(function(){var n=s,a=n.operator,c=n.source;o.add(a?a.call(o,c):c?s._subscribe(o):s._trySubscribe(o))}),o},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var i=this;return e=Dt(e),new e(function(s,o){var n=new $t({next:function(a){try{t(a)}catch(c){o(c),n.unsubscribe()}},error:o,complete:s});i.subscribe(n)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[Be]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return De(t)(this)},r.prototype.toPromise=function(t){var e=this;return t=Dt(t),new t(function(i,s){var o;e.subscribe(function(n){return o=n},function(n){return s(n)},function(){return i(o)})})},r.create=function(t){return new r(t)},r})();function Dt(r){var t;return(t=r??Me.Promise)!==null&&t!==void 0?t:Promise}function Fe(r){return r&&_(r.next)&&_(r.error)&&_(r.complete)}function Ve(r){return r&&r instanceof pe||Fe(r)&&ue(r)}var We=le(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),At=(function(r){K(t,r);function t(){var e=r.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 Ft(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new We},t.prototype.next=function(e){var i=this;X(function(){var s,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var n=vt(i.currentObservers),a=n.next();!a.done;a=n.next()){var c=a.value;c.next(e)}}catch(l){s={error:l}}finally{try{a&&!a.done&&(o=n.return)&&o.call(n)}finally{if(s)throw s.error}}}})},t.prototype.error=function(e){var i=this;X(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var s=i.observers;s.length;)s.shift().error(e)}})},t.prototype.complete=function(){var e=this;X(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(),r.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,s=this,o=s.hasError,n=s.isStopped,a=s.observers;return o||n?de:(this.currentObservers=null,a.push(e),new nt(function(){i.currentObservers=null,wt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,s=i.hasError,o=i.thrownError,n=i.isStopped;s?e.error(o):n&&e.complete()},t.prototype.asObservable=function(){var e=new zt;return e.source=this,e},t.create=function(e,i){return new Ft(e,i)},t})(zt),Ft=(function(r){K(t,r);function t(e,i){var s=r.call(this)||this;return s.destination=e,s.source=i,s}return t.prototype.next=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,e)},t.prototype.error=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.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,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&s!==void 0?s:de},t})(At),Ct=(function(r){K(t,r);function t(e){var i=r.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=r.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,s=e.thrownError,o=e._value;if(i)throw s;return this._throwIfClosed(),o},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t})(At),fe=(r=>(r.Loading="loading",r.Ready="ready",r))(fe||{});class _t{constructor(t,e){this.state=new Ct("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 Q=globalThis,St=Q.ShadowRoot&&(Q.ShadyCSS===void 0||Q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Et=Symbol(),Vt=new WeakMap;let ge=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Et)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(St&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Vt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Vt.set(e,t))}return t}toString(){return this.cssText}};const qe=r=>new ge(typeof r=="string"?r:r+"",void 0,Et),
|
|
7
|
+
*/const Q=globalThis,St=Q.ShadowRoot&&(Q.ShadyCSS===void 0||Q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Et=Symbol(),Vt=new WeakMap;let ge=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Et)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(St&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Vt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Vt.set(e,t))}return t}toString(){return this.cssText}};const qe=r=>new ge(typeof r=="string"?r:r+"",void 0,Et),M=(r,...t)=>{const e=r.length===1?r[0]:t.reduce((i,s,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[o+1],r[0]);return new ge(e,r,Et)},Ge=(r,t)=>{if(St)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=Q.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,r.appendChild(i)}},Wt=St?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return qe(e)})(r):r;/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const{is:Ke,defineProperty:Ze,getOwnPropertyDescriptor:Ye,getOwnPropertyNames:Je,getOwnPropertySymbols:Xe,getPrototypeOf:Qe}=Object,C=globalThis,qt=C.trustedTypes,ti=qt?qt.emptyScript:"",ht=C.reactiveElementPolyfillSupport,
|
|
11
|
+
*/const{is:Ke,defineProperty:Ze,getOwnPropertyDescriptor:Ye,getOwnPropertyNames:Je,getOwnPropertySymbols:Xe,getPrototypeOf:Qe}=Object,C=globalThis,qt=C.trustedTypes,ti=qt?qt.emptyScript:"",ht=C.reactiveElementPolyfillSupport,z=(r,t)=>r,tt={toAttribute(r,t){switch(t){case Boolean:r=r?ti:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Pt=(r,t)=>!Ke(r,t),Gt={attribute:!0,type:String,converter:tt,reflect:!1,useDefault:!1,hasChanged:Pt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),C.litPropertyMetadata??(C.litPropertyMetadata=new WeakMap);let N=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=Gt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Ze(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=Ye(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:s,set(n){const a=s==null?void 0:s.call(this);o==null||o.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Gt}static _$Ei(){if(this.hasOwnProperty(z("elementProperties")))return;const t=Qe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(z("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(z("properties"))){const e=this.properties,i=[...Je(e),...Xe(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(Wt(s))}else t!==void 0&&e.push(Wt(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 Ge(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)}_$ET(t,e){var o;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const n=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:tt).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var o,n;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:tt;this._$Em=s;const l=c.fromAttribute(e,a.type);this[s]=l??((n=this._$Ej)==null?void 0:n.get(s))??l,this._$Em=null}}requestUpdate(t,e,i,s=!1,o){var n;if(t!==void 0){const a=this.constructor;if(s===!1&&(o=this[t]),i??(i=a.getPropertyOptions(t)),!((i.hasChanged??Pt)(o,e)||i.useDefault&&i.reflect&&o===((n=this._$Ej)==null?void 0:n.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},n){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){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[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,n]of s){const{wrapped:a}=n,c=this[o];a!==!0||this._$AL.has(o)||c===void 0||this.C(o,void 0,n,c)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[z("elementProperties")]=new Map,N[z("finalized")]=new Map,ht==null||ht({ReactiveElement:N}),(C.reactiveElementVersions??(C.reactiveElementVersions=[])).push("2.1.2");/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2017 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
15
|
*/const D=globalThis,Kt=r=>r,et=D.trustedTypes,Zt=et?et.createPolicy("lit-html",{createHTML:r=>r}):void 0,me="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,ve="?"+A,ei=`<${ve}>`,k=document,V=()=>k.createComment(""),W=r=>r===null||typeof r!="object"&&typeof r!="function",Ot=Array.isArray,ii=r=>Ot(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",lt=`[
|
|
16
|
-
\f\r]`,
|
|
17
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xt=/'/g,Qt=/"/g,ye=/^(?:script|style|textarea|title)$/i,si=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),
|
|
16
|
+
\f\r]`,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yt=/-->/g,Jt=/>/g,S=RegExp(`>|${lt}(?:([^\\s"'>=/]+)(${lt}*=${lt}*(?:[^
|
|
17
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xt=/'/g,Qt=/"/g,ye=/^(?:script|style|textarea|title)$/i,si=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),L=si(1),T=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),te=new WeakMap,P=k.createTreeWalker(k,129);function be(r,t){if(!Ot(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Zt!==void 0?Zt.createHTML(t):t}const ri=(r,t)=>{const e=r.length-1,i=[];let s,o=t===2?"<svg>":t===3?"<math>":"",n=B;for(let a=0;a<e;a++){const c=r[a];let l,h,d=-1,u=0;for(;u<c.length&&(n.lastIndex=u,h=n.exec(c),h!==null);)u=n.lastIndex,n===B?h[1]==="!--"?n=Yt:h[1]!==void 0?n=Jt:h[2]!==void 0?(ye.test(h[2])&&(s=RegExp("</"+h[2],"g")),n=S):h[3]!==void 0&&(n=S):n===S?h[0]===">"?(n=s??B,d=-1):h[1]===void 0?d=-2:(d=n.lastIndex-h[2].length,l=h[1],n=h[3]===void 0?S:h[3]==='"'?Qt:Xt):n===Qt||n===Xt?n=S:n===Yt||n===Jt?n=B:(n=S,s=void 0);const f=n===S&&r[a+1].startsWith("/>")?" ":"";o+=n===B?c+ei:d>=0?(i.push(l),c.slice(0,d)+me+c.slice(d)+A+f):c+A+(d===-2?a:f)}return[be(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class q{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const a=t.length-1,c=this.parts,[l,h]=ri(t,e);if(this.el=q.createElement(l,i),P.currentNode=this.el.content,e===2||e===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=P.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const d of s.getAttributeNames())if(d.endsWith(me)){const u=h[n++],f=s.getAttribute(d).split(A),g=/([.?@])?(.*)/.exec(u);c.push({type:1,index:o,name:g[2],strings:f,ctor:g[1]==="."?ni:g[1]==="?"?ai:g[1]==="@"?ci:at}),s.removeAttribute(d)}else d.startsWith(A)&&(c.push({type:6,index:o}),s.removeAttribute(d));if(ye.test(s.tagName)){const d=s.textContent.split(A),u=d.length-1;if(u>0){s.textContent=et?et.emptyScript:"";for(let f=0;f<u;f++)s.append(d[f],V()),P.nextNode(),c.push({type:2,index:++o});s.append(d[u],V())}}}else if(s.nodeType===8)if(s.data===ve)c.push({type:2,index:o});else{let d=-1;for(;(d=s.data.indexOf(A,d+1))!==-1;)c.push({type:7,index:o}),d+=A.length-1}o++}}static createElement(t,e){const i=k.createElement("template");return i.innerHTML=t,i}}function U(r,t,e=r,i){var n,a;if(t===T)return t;let s=i!==void 0?(n=e._$Co)==null?void 0:n[i]:e._$Cl;const o=W(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),o===void 0?s=void 0:(s=new o(r),s._$AT(r,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=U(r,s._$AS(r,t.values),s,i)),t}class oi{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??k).importNode(e,!0);P.currentNode=s;let o=P.nextNode(),n=0,a=0,c=i[0];for(;c!==void 0;){if(n===c.index){let l;c.type===2?l=new Z(o,o.nextSibling,this,t):c.type===1?l=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(l=new hi(o,this,t)),this._$AV.push(l),c=i[++a]}n!==(c==null?void 0:c.index)&&(o=P.nextNode(),n++)}return P.currentNode=k,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Z{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),W(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==T&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ii(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==p&&W(this._$AH)?this._$AA.nextSibling.data=t:this.T(k.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=q.createElement(be(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{const n=new oi(s,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=te.get(t.strings);return e===void 0&&te.set(t.strings,e=new q(t)),e}k(t){Ot(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new Z(this.O(V()),this.O(V()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const s=Kt(t).nextSibling;Kt(t).remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class at{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=p,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(o===void 0)t=U(this,t,e,0),n=!W(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else{const a=t;let c,l;for(t=o[0],c=0;c<o.length-1;c++)l=U(this,a[i+c],e,c),l===T&&(l=this._$AH[c]),n||(n=!W(l)||l!==this._$AH[c]),l===p?t=p:t!==p&&(t+=(l??"")+o[c+1]),this._$AH[c]=l}n&&!s&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ni extends at{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class ai extends at{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class ci extends at{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??p)===T)return;const i=this._$AH,s=t===p&&i!==p||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==p&&(i===p||s);s&&this.element.removeEventListener(this.name,this,i),o&&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 hi{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const dt=D.litHtmlPolyfillSupport;dt==null||dt(q,Z),(D.litHtmlVersions??(D.litHtmlVersions=[])).push("3.3.3");const li=(r,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new Z(t.insertBefore(V(),o),o,void 0,e??{})}return s._$AI(r),s};/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/const O=globalThis;let x=class extends
|
|
21
|
+
*/const O=globalThis;let x=class extends N{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=li(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 he;x._$litElement$=!0,x.finalized=!0,(he=O.litElementHydrateSupport)==null||he.call(O,{LitElement:x});const ut=O.litElementPolyfillSupport;ut==null||ut({LitElement:x});(O.litElementVersions??(O.litElementVersions=[])).push("4.2.2");/**
|
|
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 H(r){return m({...r,state:!0,attribute:!1})}var pi=Object.defineProperty,fi=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&pi(t,e,s),s};const Mt=class Mt extends x{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"),p}};Mt.styles=[
|
|
29
|
+
*/function H(r){return m({...r,state:!0,attribute:!1})}var pi=Object.defineProperty,fi=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&pi(t,e,s),s};const Mt=class Mt extends x{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"),p}};Mt.styles=[M`
|
|
30
30
|
:host {
|
|
31
31
|
position: fixed;
|
|
32
32
|
display: flex;
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright 2020 Google LLC
|
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
|
-
*/const Ae=()=>new Si;class Si{}const gt=new WeakMap,Ce=Tt(class extends _e{render(r){return p}update(r,[t]){var i;const e=t!==this.G;return e&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(i=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),p}rt(r){if(this.G!==void 0)if(this.isConnected||(r=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=gt.get(t);e===void 0&&(e=new WeakMap,gt.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){var r,t;return typeof this.G=="function"?(r=gt.get(this.ht??globalThis))==null?void 0:r.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Ei=Object.defineProperty,Y=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Ei(t,e,s),s};const Nt=class Nt extends x{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=Ae(),this.widgetActive$=new Ct(!1),this.componentIsDestroyed$=new At}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&&xe(this.application.settings.branding,this)}async _renderSymbol(){var a,c,l;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
|
|
65
|
+
*/const Ae=()=>new Si;class Si{}const gt=new WeakMap,Ce=Tt(class extends _e{render(r){return p}update(r,[t]){var i;const e=t!==this.G;return e&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(i=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),p}rt(r){if(this.G!==void 0)if(this.isConnected||(r=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=gt.get(t);e===void 0&&(e=new WeakMap,gt.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){var r,t;return typeof this.G=="function"?(r=gt.get(this.ht??globalThis))==null?void 0:r.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Ei=Object.defineProperty,Y=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Ei(t,e,s),s};const Nt=class Nt extends x{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=Ae(),this.widgetActive$=new Ct(!1),this.componentIsDestroyed$=new At}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&&xe(this.application.settings.branding,this)}async _renderSymbol(){var a,c,l;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 L` <img src=${e} class="trigger-icon" alt="" /> `;const i=(l=this.application)==null?void 0:l.triggerIcon;if(!i)return p;const s=async h=>Ci,{type:o,content:n}=i;switch(o){case"Telia":{const h=await s();return h?L`<telia-icon
|
|
66
66
|
class="trigger-icon"
|
|
67
67
|
svg=${h.svg}
|
|
68
68
|
size="lg"
|
|
69
|
-
></telia-icon>`:p}default:return p}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var t,e,i,s,o,n,a;return
|
|
69
|
+
></telia-icon>`:p}default:return p}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var t,e,i,s,o,n,a;return L`<div
|
|
70
70
|
class=${ae({"trigger-container":!0,"ace-hidden":!this.triggerVisible})}
|
|
71
71
|
${Ce(this.containerRef)}
|
|
72
72
|
>
|
|
73
|
-
${!this.active&&((s=(i=(e=(t=this.application)==null?void 0:t.settings)==null?void 0:e.branding)==null?void 0:i.other)!=null&&s.showButtonLabel)?
|
|
73
|
+
${!this.active&&((s=(i=(e=(t=this.application)==null?void 0:t.settings)==null?void 0:e.branding)==null?void 0:i.other)!=null&&s.showButtonLabel)?L`
|
|
74
74
|
<button
|
|
75
75
|
type="button"
|
|
76
76
|
aria-label="${this.application.settings.branding.other.buttonLabelText??"Widget trigger"}"
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
</svg>
|
|
118
118
|
</span>
|
|
119
119
|
</button>
|
|
120
|
-
</div>`}};Nt.styles=[
|
|
120
|
+
</div>`}};Nt.styles=[M`
|
|
121
121
|
:host {
|
|
122
122
|
--voca-rem-multiplier: 0.625;
|
|
123
123
|
--trigger-label-bg: #f5e0ff;
|
|
@@ -251,9 +251,9 @@
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
.trigger-label:hover {
|
|
254
|
-
|
|
254
|
+
box-shadow: inset 0 0 0 2px currentColor;
|
|
255
255
|
}
|
|
256
|
-
`];let b=Nt;Y([m({attribute:!1})],b.prototype,"application");Y([H()],b.prototype,"active");Y([H()],b.prototype,"triggerVisible");Y([H()],b.prototype,"loaded");Y([H()],b.prototype,"icon");var Pi=Object.defineProperty,E=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Pi(t,e,s),s};const Se=r=>{const e=class e extends r{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(s){this.properties=s}writeLayout(s){this.layout=s}writeContext(s){this.context=s}addChild(s){s.parent=this,this.nodes.push(s)}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)}};e.styles=[
|
|
256
|
+
`];let b=Nt;Y([m({attribute:!1})],b.prototype,"application");Y([H()],b.prototype,"active");Y([H()],b.prototype,"triggerVisible");Y([H()],b.prototype,"loaded");Y([H()],b.prototype,"icon");var Pi=Object.defineProperty,E=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Pi(t,e,s),s};const Se=r=>{const e=class e extends r{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(s){this.properties=s}writeLayout(s){this.layout=s}writeContext(s){this.context=s}addChild(s){s.parent=this,this.nodes.push(s)}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)}};e.styles=[M`
|
|
257
257
|
:host {
|
|
258
258
|
font-family: var(--font-family);
|
|
259
259
|
grid-column: span var(--width);
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
* {
|
|
266
266
|
box-sizing: border-box;
|
|
267
267
|
}
|
|
268
|
-
`];let t=e;return E([m()],t.prototype,"properties"),E([m()],t.prototype,"context"),E([m()],t.prototype,"layout"),E([m()],t.prototype,"name"),E([m()],t.prototype,"type"),E([m({attribute:!1})],t.prototype,"application"),E([m({attribute:!1})],t.prototype,"parent"),t},Lt=class Lt extends Se(x){render(){return
|
|
268
|
+
`];let t=e;return E([m()],t.prototype,"properties"),E([m()],t.prototype,"context"),E([m()],t.prototype,"layout"),E([m()],t.prototype,"name"),E([m()],t.prototype,"type"),E([m({attribute:!1})],t.prototype,"application"),E([m({attribute:!1})],t.prototype,"parent"),t},Lt=class Lt extends Se(x){render(){return L`Non resolved component`}};Lt.styles=[M`
|
|
269
269
|
:host {
|
|
270
270
|
display: block;
|
|
271
271
|
}
|
|
@@ -293,9 +293,9 @@
|
|
|
293
293
|
* @license
|
|
294
294
|
* Copyright 2017 Google LLC
|
|
295
295
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
296
|
-
*/function Ri({context:r}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(s){return i.get(this).setValue(s),t.set.call(this,s)},init(s){return i.set(this,new ce(this,{context:r,initialValue:s})),s}};{t.constructor.addInitializer((n=>{i.set(n,new ce(n,{context:r}))}));const s=Object.getOwnPropertyDescriptor(t,e);let o;if(s===void 0){const n=new WeakMap;o={get(){return n.get(this)},set(a){i.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{const n=s.set;o={...s,set(a){i.get(this).setValue(a),n==null||n.call(this,a)}}}return void Object.defineProperty(t,e,o)}}}var Mi=Object.defineProperty,It=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Mi(t,e,s),s};const Pe="application",Ut=class Ut extends x{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=Ae(),this.fullscreen=!1,this.maximized=!1,this.isReady=new Ct(!1)}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&xe(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,s])=>{e.style.setProperty(`--${i}`,s)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var e,i,s;return((s=(i=(e=this.application.settings)==null?void 0:e.agentConfig)==null?void 0:i.live)==null?void 0:s.isThirdPartyWidget)??!1?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.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")),this.application.fullscreen&&this.renderRoot.host.classList.add("fullscreen"),this.renderRoot.host.classList.toggle("maximized",this.maximized),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),
|
|
296
|
+
*/function Ri({context:r}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return{get(){return t.get.call(this)},set(s){return i.get(this).setValue(s),t.set.call(this,s)},init(s){return i.set(this,new ce(this,{context:r,initialValue:s})),s}};{t.constructor.addInitializer((n=>{i.set(n,new ce(n,{context:r}))}));const s=Object.getOwnPropertyDescriptor(t,e);let o;if(s===void 0){const n=new WeakMap;o={get(){return n.get(this)},set(a){i.get(this).setValue(a),n.set(this,a)},configurable:!0,enumerable:!0}}else{const n=s.set;o={...s,set(a){i.get(this).setValue(a),n==null||n.call(this,a)}}}return void Object.defineProperty(t,e,o)}}}var Mi=Object.defineProperty,It=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Mi(t,e,s),s};const Pe="application",Ut=class Ut extends x{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=Ae(),this.fullscreen=!1,this.maximized=!1,this.isReady=new Ct(!1)}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&xe(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,s])=>{e.style.setProperty(`--${i}`,s)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var e,i,s;return((s=(i=(e=this.application.settings)==null?void 0:e.agentConfig)==null?void 0:i.live)==null?void 0:s.isThirdPartyWidget)??!1?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.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")),this.application.fullscreen&&this.renderRoot.host.classList.add("fullscreen"),this.renderRoot.host.classList.toggle("maximized",this.maximized),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),L`<div class="widget-container" ${Ce(this.wrapperRef)}>
|
|
297
297
|
${Oi(this.nodes,o=>o)}
|
|
298
|
-
</div>`}};Ut.styles=
|
|
298
|
+
</div>`}};Ut.styles=M`
|
|
299
299
|
:host {
|
|
300
300
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
|
301
301
|
--spacing-xs: 0.2rem;
|
|
@@ -424,8 +424,14 @@
|
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
.widget-container {
|
|
427
|
+
--border-color-weak: color-mix(
|
|
428
|
+
in srgb,
|
|
429
|
+
var(--text-on-primary-background) 25%,
|
|
430
|
+
transparent
|
|
431
|
+
);
|
|
427
432
|
height: 100%;
|
|
428
433
|
background-color: var(--primary-background);
|
|
434
|
+
color: var(--text-on-primary-background);
|
|
429
435
|
padding: var(--spacing-sm);
|
|
430
436
|
border: var(--widget-border, none);
|
|
431
437
|
}
|
|
@@ -467,8 +473,41 @@
|
|
|
467
473
|
:host(.ace-expanded.embedded) {
|
|
468
474
|
animation: none;
|
|
469
475
|
}
|
|
470
|
-
`;let I=Ut;It([m({attribute:!0})],I.prototype,"fullscreen");It([m({type:Boolean})],I.prototype,"maximized");It([m({attribute:!1}),Ri({context:Pe})],I.prototype,"application");class Ni{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...l]=a;return{definitionId:c,overrides:l}}return{definitionId:a,overrides:[]}},s=(a,c,l,h)=>{l.forEach(d=>{const u=i(d),f=h[u.definitionId];if(!f){console.error(`No definition found for component type '${u.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=u.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&&s(a,g,f.children,h))})},{entry:o,components:n}=t;return s(this,this.root,[o],n),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",I)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new st;const s=document.createElement(`ace-${e}`);return s.type=e,s.name=t,s}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const rt=class rt{constructor(){this.components=new Map}getComponent(t){const e=this.components.get(t);return e||console.warn(`Unable to resolve component: ${t}. You most likely forgot to register the required plugin.`),e}registerComponent(t,e){this.components.set(t,e)}async loadComponents(){const t=[...this.components.entries()].map(([e,i])=>i.then(s=>{this.defineAsWebComponent(e,s.default)}));await Promise.all(t)}defineAsWebComponent(t,e){const i=rt.ResolveWebComponentName(t);customElements.get(i)||customElements.define(i,e)}};rt.ResolveWebComponentName=t=>`ace-${t}`;let xt=rt;var y=(r=>(r.Necessary="necessary",r.Functional="functional",r.Analytics="analytics",r))(y||{});class Oe{constructor(t,e,i,s){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=s}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 s=i.category;if(this.policy[s]){const o={value:e,category:s};this.storage.setItem(this._prefixKey(t),JSON.stringify(o))}else console.warn(`Storage policy does not allow storing items in category: ${s}`)}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 s=(t=JSON.parse(i))==null?void 0:t.category;this.policy[s]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}stringify(){return JSON.stringify(this.storage)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class ke{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}}const Li="1.1.151-rc.2";class Ui{constructor(t){this.widget=t,this.name=t.name}open(t={}){this.widget.appendToDOM(t)}close(){this.widget.hide()}setFullscreenMode(t){this.widget.setFullscreenMode(t)}setZIndex(t){this.widget.setZIndex(t)}version(){return{version:Li}}}class Te{constructor(t,e,i,s,o){this.id=t,this.name=e,this.container=i,this.settings=s,this.options=o,this.platform=new Ni,this.texts=new ke,this.renderStrategy=$.Inline,this.fullscreen=!1,this.maximized=!1,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new xt,this.components=[],this.trigger=null,this.api=new Ui(this),this.onMessageReceived=async a=>{var l;if(window.self!==window.top&&!this._isAllowedOrigin(a.origin))return;const c=a.data;switch(c.type){case"set-storage-policies":{const{policies:h}=c.data||[],d={[y.Analytics]:h.includes("analytics"),[y.Necessary]:h.includes("necessary"),[y.Functional]:h.includes("functional")};this.storage.updatePolicy(d);return}case"disallow-storage-key":{const{storageKey:h}=c.data||null;h&&this.storage.disallowKey(h);return}case"set-fullscreen-mode":{const{value:h}=c.data;typeof h=="boolean"&&this.setFullscreenMode(h);return}case"set-maximized-mode":{const{value:h}=c.data;typeof h=="boolean"&&this.setMaximized(h);return}case"open":{this.appendToDOM();return}case"close":{this.hide();return}case"set-z-index":{const{zIndex:h}=c.data||null;h&&this.setZIndex(h);return}case"deactivate-widget":{const h=this.storage.get("open");this.hide(),(l=this.trigger)==null||l.hideTrigger(),h&&this.storage.set("open",!0);return}case"set-open":{typeof c.data.value=="boolean"&&(this.storage.set("open",c.data.value),this.root&&c.data.value===!0&&!this.root.isReady.getValue()&&this.root.isReady.next(!0));return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const n={[y.Necessary]:!0,[y.Functional]:!0,[y.Analytics]:!0};this.storage=new Oe(this.id,"sessionStorage",n,this.settings.storage),typeof o.autoActivate=="boolean"&&(this.autoActivate=o.autoActivate),o.anchor&&(this.anchor=o.anchor),this.container.register("$settings",s),this.texts.loadTexts(s.texts||{}),this.allowedOrigins=o.allowedOrigins,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(fe.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}if(window!=null&&window.parent){const{version:t}=this.api.version();window.parent.postMessage({type:"widget-activated",data:{widgetId:this.id,version:t,storage:this.storage.stringify()}},"*")}}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(t={}){this.root&&(this.root.classList.add("ace-expanded"),this.root.classList.remove("ace-hidden"),this.root.removeAttribute("inert"),document.body.appendChild(this.root)),t.ignoreStorage||this.storage.set("open",!0)}hide(){this.root&&(this.root.contains(document.activeElement)&&(this.trigger&&typeof this.trigger.focus=="function"?this.trigger.focus():(document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),document.body.focus())),this.root.classList.add("ace-hidden"),this.root.classList.remove("ace-expanded"),this.root.setAttribute("inert","")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("mute-audio-notifications",!0)}unmute(){this.storage.set("mute-audio-notifications",!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===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new G,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top&&window.__RENDER_WIDGET_FULLSCREEN__}_isAllowedOrigin(t){return t===window.location.origin?!0:!this.allowedOrigins||this.allowedOrigins.length===0?!1:this.allowedOrigins.some(e=>t===`https://${e}`)}setFullscreenMode(t){this.fullscreen=t,this.root&&(this.root.fullscreen=!0)}setMaximized(t){this.maximized=t,this.root&&(this.root.maximized=t)}render(){if(this._isEmbeddedInIFrame())return this.root;if(!this._isEmbeddedInIFrame()&&this.root&&(this.root.isReady.getValue()||this.root.isReady.next(!0)),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 ji=r=>new U(r),ot=class ot{constructor(t=ot.endpoint){this._endpoint=t}async getSite(t){const i=await(await fetch(t)).json();return i?{id:i.id,triggers:i.triggers||[],apps:(i.widgets||[]).map(s=>{let o=$.Trigger;s.renderStrategy.toLowerCase()==="inline"&&(o=$.Inline);const n=s.widgetId?s.widgetId:s.id,a=typeof s.autoActivate=="boolean"?s.autoActivate:!1,c=typeof s.anchor=="string"?s.anchor:"BottomRight",l=typeof s.triggerIcon=="string"?s.triggerIcon:"question";return{id:n,widgetId:n,renderStrategy:o,autoActivate:a,anchor:c,triggerIcon:{type:"Telia",content:l}}})}:null}async getWidget(t){const i=await(await fetch(`${this._endpoint}/widget/${t}`)).json();return i?{name:i.name,config:JSON.parse(i.configuration),allowedOrigins:i.allowedOrigins}:null}};ot.endpoint="https://widgets.ace.teliacompany.net/api";let U=ot;class Hi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(s=>{if(s.storage){const o={[y.Analytics]:t.includes("analytics"),[y.Necessary]:t.includes("necessary"),[y.Functional]:t.includes("functional")};s.storage.updatePolicy(o)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ie{constructor(){this.applications=[],this.container=new _t("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 s=window.location.pathname,o=i.condition.outputs||[];i.condition.type==="url"&&o.forEach(n=>{const a=n.action.type==="render_widget";if((n.value===s||n.value==="*")&&a){let l={widgetId:""};try{l=JSON.parse(n.action.data)}catch{l={widgetId:""}}const h=t.findIndex(u=>u.id===l.widgetId)>-1,d=this.applications.find(u=>u.id===l.widgetId);d&&!h&&(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(s=>s.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(s=>s.name===t||s.id===t);if(!i){const s=this.widgetAPIHandlers.get(t)||[];s.push(()=>{const o=this.applications.find(n=>n.name===t||n.id===t);e(o==null?void 0:o.api)}),this.widgetAPIHandlers.set(t,s);return}e(i==null?void 0:i.api)}registerApp(t,e,i,s){const o=new _t(e,this),n=new Te(t,e,o,i,s);this.applications.push(n)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Re{constructor(t){this.configurations=[],this.httpClient=new U,this.api=new Hi(this),this.triggers=[],this.httpClient=new U,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 Ie,this.addGlobal(this.environment);for await(const i of this.configurations){const s=await this.httpClient.getWidget(i.widgetId);s&&((e=this.environment)==null||e.registerApp(i.widgetId,s.name,s.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor,allowedOrigins:s.allowedOrigins}))}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,s])=>{t.widget(i,s)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var zi=Object.defineProperty,Rt=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&zi(t,e,s),s};const jt=class jt extends x{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 p;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}};jt.styles=[j`
|
|
476
|
+
`;let I=Ut;It([m({attribute:!0})],I.prototype,"fullscreen");It([m({type:Boolean})],I.prototype,"maximized");It([m({attribute:!1}),Ri({context:Pe})],I.prototype,"application");class Ni{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...l]=a;return{definitionId:c,overrides:l}}return{definitionId:a,overrides:[]}},s=(a,c,l,h)=>{l.forEach(d=>{const u=i(d),f=h[u.definitionId];if(!f){console.error(`No definition found for component type '${u.definitionId}'.`);return}const g=a.createNode(f.type,f.type);g&&(g.name=u.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&&s(a,g,f.children,h))})},{entry:o,components:n}=t;return s(this,this.root,[o],n),this.root}createRoot(){return typeof window<"u"&&(window.customElements.get("ace-wrapper")||window.customElements.define("ace-wrapper",I)),document.createElement("ace-wrapper")}createNode(t,e){if(!this.resolveComponent(e))return console.warn(`Unable to resolve component: ${e}`),new st;const s=document.createElement(`ace-${e}`);return s.type=e,s.name=t,s}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const rt=class rt{constructor(){this.components=new Map}getComponent(t){const e=this.components.get(t);return e||console.warn(`Unable to resolve component: ${t}. You most likely forgot to register the required plugin.`),e}registerComponent(t,e){this.components.set(t,e)}async loadComponents(){const t=[...this.components.entries()].map(([e,i])=>i.then(s=>{this.defineAsWebComponent(e,s.default)}));await Promise.all(t)}defineAsWebComponent(t,e){const i=rt.ResolveWebComponentName(t);customElements.get(i)||customElements.define(i,e)}};rt.ResolveWebComponentName=t=>`ace-${t}`;let xt=rt;var y=(r=>(r.Necessary="necessary",r.Functional="functional",r.Analytics="analytics",r))(y||{});class Oe{constructor(t,e,i,s){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i,this.storageEntries=s}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 s=i.category;if(this.policy[s]){const o={value:e,category:s};this.storage.setItem(this._prefixKey(t),JSON.stringify(o))}else console.warn(`Storage policy does not allow storing items in category: ${s}`)}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 s=(t=JSON.parse(i))==null?void 0:t.category;this.policy[s]||this.storage.removeItem(e)}}updatePolicy(t){this.policy=t,this.enforcePolicy()}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}stringify(){return JSON.stringify(this.storage)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class ke{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}}const Li="1.1.151-rc.4";class Ui{constructor(t){this.widget=t,this.name=t.name}open(t={}){this.widget.appendToDOM(t)}close(){this.widget.hide()}setFullscreenMode(t){this.widget.setFullscreenMode(t)}setZIndex(t){this.widget.setZIndex(t)}version(){return{version:Li}}}class Te{constructor(t,e,i,s,o){this.id=t,this.name=e,this.container=i,this.settings=s,this.options=o,this.platform=new Ni,this.texts=new ke,this.renderStrategy=$.Inline,this.fullscreen=!1,this.maximized=!1,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new xt,this.components=[],this.trigger=null,this.api=new Ui(this),this.onMessageReceived=async a=>{var l;if(window.self!==window.top&&!this._isAllowedOrigin(a.origin))return;const c=a.data;switch(c.type){case"set-storage-policies":{const{policies:h}=c.data||[],d={[y.Analytics]:h.includes("analytics"),[y.Necessary]:h.includes("necessary"),[y.Functional]:h.includes("functional")};this.storage.updatePolicy(d);return}case"disallow-storage-key":{const{storageKey:h}=c.data||null;h&&this.storage.disallowKey(h);return}case"set-fullscreen-mode":{const{value:h}=c.data;typeof h=="boolean"&&this.setFullscreenMode(h);return}case"set-maximized-mode":{const{value:h}=c.data;typeof h=="boolean"&&this.setMaximized(h);return}case"open":{this.appendToDOM();return}case"close":{this.hide();return}case"set-z-index":{const{zIndex:h}=c.data||null;h&&this.setZIndex(h);return}case"deactivate-widget":{const h=this.storage.get("open");this.hide(),(l=this.trigger)==null||l.hideTrigger(),h&&this.storage.set("open",!0);return}case"set-open":{typeof c.data.value=="boolean"&&(this.storage.set("open",c.data.value),this.root&&c.data.value===!0&&!this.root.isReady.getValue()&&this.root.isReady.next(!0));return}default:return}},this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const n={[y.Necessary]:!0,[y.Functional]:!0,[y.Analytics]:!0};this.storage=new Oe(this.id,"sessionStorage",n,this.settings.storage),typeof o.autoActivate=="boolean"&&(this.autoActivate=o.autoActivate),o.anchor&&(this.anchor=o.anchor),this.container.register("$settings",s),this.texts.loadTexts(s.texts||{}),this.allowedOrigins=o.allowedOrigins,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(fe.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}if(window!=null&&window.parent){const{version:t}=this.api.version();window.parent.postMessage({type:"widget-activated",data:{widgetId:this.id,version:t,storage:this.storage.stringify()}},"*")}}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(t={}){this.root&&(this.root.classList.add("ace-expanded"),this.root.classList.remove("ace-hidden"),this.root.removeAttribute("inert"),document.body.appendChild(this.root)),t.ignoreStorage||this.storage.set("open",!0)}hide(){this.root&&(this.root.contains(document.activeElement)&&(this.trigger&&typeof this.trigger.focus=="function"?this.trigger.focus():(document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),document.body.focus())),this.root.classList.add("ace-hidden"),this.root.classList.remove("ace-expanded"),this.root.setAttribute("inert","")),this.storage.set("open",!1)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("mute-audio-notifications",!0)}unmute(){this.storage.set("mute-audio-notifications",!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===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new G,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}_isEmbeddedInIFrame(){return window.self!==window.top&&window.__RENDER_WIDGET_FULLSCREEN__}_isAllowedOrigin(t){return t===window.location.origin?!0:!this.allowedOrigins||this.allowedOrigins.length===0?!1:this.allowedOrigins.some(e=>t===`https://${e}`)}setFullscreenMode(t){this.fullscreen=t,this.root&&(this.root.fullscreen=!0)}setMaximized(t){this.maximized=t,this.root&&(this.root.maximized=t)}render(){if(this._isEmbeddedInIFrame())return this.root;if(!this._isEmbeddedInIFrame()&&this.root&&(this.root.isReady.getValue()||this.root.isReady.next(!0)),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 ji=r=>new j(r),ot=class ot{constructor(t=ot.endpoint){this._endpoint=t}async getSite(t){const i=await(await fetch(t)).json();return i?{id:i.id,triggers:i.triggers||[],apps:(i.widgets||[]).map(s=>{let o=$.Trigger;s.renderStrategy.toLowerCase()==="inline"&&(o=$.Inline);const n=s.widgetId?s.widgetId:s.id,a=typeof s.autoActivate=="boolean"?s.autoActivate:!1,c=typeof s.anchor=="string"?s.anchor:"BottomRight",l=typeof s.triggerIcon=="string"?s.triggerIcon:"question";return{id:n,widgetId:n,renderStrategy:o,autoActivate:a,anchor:c,triggerIcon:{type:"Telia",content:l}}})}:null}async getWidget(t){const i=await(await fetch(`${this._endpoint}/widget/${t}`)).json();return i?{name:i.name,config:JSON.parse(i.configuration),allowedOrigins:i.allowedOrigins}:null}};ot.endpoint="https://widgets.ace.teliacompany.net/api";let j=ot;class Hi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(s=>{if(s.storage){const o={[y.Analytics]:t.includes("analytics"),[y.Necessary]:t.includes("necessary"),[y.Functional]:t.includes("functional")};s.storage.updatePolicy(o)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ie{constructor(){this.applications=[],this.container=new _t("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 s=window.location.pathname,o=i.condition.outputs||[];i.condition.type==="url"&&o.forEach(n=>{const a=n.action.type==="render_widget";if((n.value===s||n.value==="*")&&a){let l={widgetId:""};try{l=JSON.parse(n.action.data)}catch{l={widgetId:""}}const h=t.findIndex(u=>u.id===l.widgetId)>-1,d=this.applications.find(u=>u.id===l.widgetId);d&&!h&&(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(s=>s.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(s=>s.name===t||s.id===t);if(!i){const s=this.widgetAPIHandlers.get(t)||[];s.push(()=>{const o=this.applications.find(n=>n.name===t||n.id===t);e(o==null?void 0:o.api)}),this.widgetAPIHandlers.set(t,s);return}e(i==null?void 0:i.api)}registerApp(t,e,i,s){const o=new _t(e,this),n=new Te(t,e,o,i,s);this.applications.push(n)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Re{constructor(t){this.configurations=[],this.httpClient=new j,this.api=new Hi(this),this.triggers=[],this.httpClient=new j,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 Ie,this.addGlobal(this.environment);for await(const i of this.configurations){const s=await this.httpClient.getWidget(i.widgetId);s&&((e=this.environment)==null||e.registerApp(i.widgetId,s.name,s.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor,allowedOrigins:s.allowedOrigins}))}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,s])=>{t.widget(i,s)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var Bi=Object.defineProperty,Rt=(r,t,e,i)=>{for(var s=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(s=n(t,e,s)||s);return s&&Bi(t,e,s),s};const jt=class jt extends x{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 p;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}};jt.styles=[M`
|
|
471
477
|
:host {
|
|
472
478
|
display: block;
|
|
473
479
|
}
|
|
474
|
-
`];let R=jt;Rt([m({attribute:!0})],R.prototype,"name");Rt([H()],R.prototype,"widget");Rt([H()],R.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",G);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",st);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",I);customElements.get("ace-widget")||customElements.define("ace-widget",R);const
|
|
480
|
+
`];let R=jt;Rt([m({attribute:!0})],R.prototype,"name");Rt([H()],R.prototype,"widget");Rt([H()],R.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",G);customElements.get("ace-trigger")||customElements.define("ace-trigger",b);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",st);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",I);customElements.get("ace-widget")||customElements.define("ace-widget",R);const zi=async(r,t,e={})=>{const i=new Re(r);e.httpClient&&i.setHttpClient(e.httpClient),await i.bootstrap(t)},Di=M`
|
|
481
|
+
.action-button {
|
|
482
|
+
box-shadow: inset 0 0 0 1px currentColor;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.action-button:not(:disabled):hover {
|
|
486
|
+
box-shadow: inset 0 0 0 2px currentColor;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.action-button:not(:disabled):active {
|
|
490
|
+
box-shadow: inset 0 0 0 3px currentColor;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.action-button:focus-visible {
|
|
494
|
+
outline: 2px solid var(--focus-color);
|
|
495
|
+
outline-offset: 2px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.action-button:disabled {
|
|
499
|
+
cursor: not-allowed;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
@media (forced-colors: active) {
|
|
503
|
+
.action-button {
|
|
504
|
+
outline: 1px solid ButtonText;
|
|
505
|
+
outline-offset: -1px;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.action-button:focus-visible {
|
|
509
|
+
outline: 2px solid Highlight;
|
|
510
|
+
outline-offset: 2px;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
`;exports.AceWidget=R;exports.Application=Te;exports.AuthState=Ee;exports.Container=_t;exports.Environment=Ie;exports.HttpClient=j;exports.Site=Re;exports.StorageCategory=y;exports.StorageService=Oe;exports.TextsService=ke;exports.Trigger=b;exports.WidgetComponent=Se;exports.actionButtonStyles=Di;exports.applicationContext=Pe;exports.bootstrap=zi;exports.createHttpClient=ji;
|
package/index.mjs
CHANGED
|
@@ -192,7 +192,7 @@ var pe = (function(r) {
|
|
|
192
192
|
K(t, r);
|
|
193
193
|
function t(e) {
|
|
194
194
|
var i = r.call(this) || this;
|
|
195
|
-
return i.isStopped = !1, e ? (i.destination = e, ue(e) && e.add(i)) : i.destination =
|
|
195
|
+
return i.isStopped = !1, e ? (i.destination = e, ue(e) && e.add(i)) : i.destination = Te, i;
|
|
196
196
|
}
|
|
197
197
|
return t.create = function(e, i, s) {
|
|
198
198
|
return new $t(e, i, s);
|
|
@@ -268,12 +268,12 @@ function J(r) {
|
|
|
268
268
|
function ke(r) {
|
|
269
269
|
throw r;
|
|
270
270
|
}
|
|
271
|
-
var
|
|
271
|
+
var Te = {
|
|
272
272
|
closed: !0,
|
|
273
273
|
next: Ht,
|
|
274
274
|
error: ke,
|
|
275
275
|
complete: Ht
|
|
276
|
-
},
|
|
276
|
+
}, Ie = (function() {
|
|
277
277
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
278
278
|
})();
|
|
279
279
|
function Re(r) {
|
|
@@ -286,7 +286,7 @@ function Me(r) {
|
|
|
286
286
|
}, e);
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
var
|
|
289
|
+
var Bt = (function() {
|
|
290
290
|
function r(t) {
|
|
291
291
|
t && (this._subscribe = t);
|
|
292
292
|
}
|
|
@@ -307,7 +307,7 @@ var zt = (function() {
|
|
|
307
307
|
}
|
|
308
308
|
}, r.prototype.forEach = function(t, e) {
|
|
309
309
|
var i = this;
|
|
310
|
-
return e =
|
|
310
|
+
return e = zt(e), new e(function(s, o) {
|
|
311
311
|
var n = new $t({
|
|
312
312
|
next: function(a) {
|
|
313
313
|
try {
|
|
@@ -324,7 +324,7 @@ var zt = (function() {
|
|
|
324
324
|
}, r.prototype._subscribe = function(t) {
|
|
325
325
|
var e;
|
|
326
326
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
327
|
-
}, r.prototype[
|
|
327
|
+
}, r.prototype[Ie] = function() {
|
|
328
328
|
return this;
|
|
329
329
|
}, r.prototype.pipe = function() {
|
|
330
330
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
@@ -332,7 +332,7 @@ var zt = (function() {
|
|
|
332
332
|
return Me(t)(this);
|
|
333
333
|
}, r.prototype.toPromise = function(t) {
|
|
334
334
|
var e = this;
|
|
335
|
-
return t =
|
|
335
|
+
return t = zt(t), new t(function(i, s) {
|
|
336
336
|
var o;
|
|
337
337
|
e.subscribe(function(n) {
|
|
338
338
|
return o = n;
|
|
@@ -346,7 +346,7 @@ var zt = (function() {
|
|
|
346
346
|
return new r(t);
|
|
347
347
|
}, r;
|
|
348
348
|
})();
|
|
349
|
-
function
|
|
349
|
+
function zt(r) {
|
|
350
350
|
var t;
|
|
351
351
|
return (t = r ?? Ee.Promise) !== null && t !== void 0 ? t : Promise;
|
|
352
352
|
}
|
|
@@ -434,12 +434,12 @@ var Ue = le(function(r) {
|
|
|
434
434
|
var i = this, s = i.hasError, o = i.thrownError, n = i.isStopped;
|
|
435
435
|
s ? e.error(o) : n && e.complete();
|
|
436
436
|
}, t.prototype.asObservable = function() {
|
|
437
|
-
var e = new
|
|
437
|
+
var e = new Bt();
|
|
438
438
|
return e.source = this, e;
|
|
439
439
|
}, t.create = function(e, i) {
|
|
440
440
|
return new Dt(e, i);
|
|
441
441
|
}, t;
|
|
442
|
-
})(
|
|
442
|
+
})(Bt), Dt = (function(r) {
|
|
443
443
|
K(t, r);
|
|
444
444
|
function t(e, i) {
|
|
445
445
|
var s = r.call(this) || this;
|
|
@@ -526,7 +526,7 @@ let ge = class {
|
|
|
526
526
|
return this.cssText;
|
|
527
527
|
}
|
|
528
528
|
};
|
|
529
|
-
const je = (r) => new ge(typeof r == "string" ? r : r + "", void 0, Et),
|
|
529
|
+
const je = (r) => new ge(typeof r == "string" ? r : r + "", void 0, Et), R = (r, ...t) => {
|
|
530
530
|
const e = r.length === 1 ? r[0] : t.reduce((i, s, o) => i + ((n) => {
|
|
531
531
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
532
532
|
if (typeof n == "number") return n;
|
|
@@ -549,7 +549,7 @@ const je = (r) => new ge(typeof r == "string" ? r : r + "", void 0, Et), U = (r,
|
|
|
549
549
|
* Copyright 2017 Google LLC
|
|
550
550
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
551
551
|
*/
|
|
552
|
-
const { is:
|
|
552
|
+
const { is: Be, defineProperty: ze, getOwnPropertyDescriptor: De, getOwnPropertyNames: Fe, getOwnPropertySymbols: Ve, getPrototypeOf: We } = Object, C = globalThis, qt = C.trustedTypes, qe = qt ? qt.emptyScript : "", ht = C.reactiveElementPolyfillSupport, B = (r, t) => r, tt = { toAttribute(r, t) {
|
|
553
553
|
switch (t) {
|
|
554
554
|
case Boolean:
|
|
555
555
|
r = r ? qe : null;
|
|
@@ -577,9 +577,9 @@ const { is: ze, defineProperty: Be, getOwnPropertyDescriptor: De, getOwnProperty
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
return e;
|
|
580
|
-
} }, St = (r, t) => !
|
|
580
|
+
} }, St = (r, t) => !Be(r, t), Gt = { attribute: !0, type: String, converter: tt, reflect: !1, useDefault: !1, hasChanged: St };
|
|
581
581
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), C.litPropertyMetadata ?? (C.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
582
|
-
let
|
|
582
|
+
let M = class extends HTMLElement {
|
|
583
583
|
static addInitializer(t) {
|
|
584
584
|
this._$Ei(), (this.l ?? (this.l = [])).push(t);
|
|
585
585
|
}
|
|
@@ -589,7 +589,7 @@ let R = class extends HTMLElement {
|
|
|
589
589
|
static createProperty(t, e = Gt) {
|
|
590
590
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
591
591
|
const i = Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
|
592
|
-
s !== void 0 &&
|
|
592
|
+
s !== void 0 && ze(this.prototype, t, s);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
static getPropertyDescriptor(t, e, i) {
|
|
@@ -607,13 +607,13 @@ let R = class extends HTMLElement {
|
|
|
607
607
|
return this.elementProperties.get(t) ?? Gt;
|
|
608
608
|
}
|
|
609
609
|
static _$Ei() {
|
|
610
|
-
if (this.hasOwnProperty(
|
|
610
|
+
if (this.hasOwnProperty(B("elementProperties"))) return;
|
|
611
611
|
const t = We(this);
|
|
612
612
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
613
613
|
}
|
|
614
614
|
static finalize() {
|
|
615
|
-
if (this.hasOwnProperty(
|
|
616
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
615
|
+
if (this.hasOwnProperty(B("finalized"))) return;
|
|
616
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(B("properties"))) {
|
|
617
617
|
const e = this.properties, i = [...Fe(e), ...Ve(e)];
|
|
618
618
|
for (const s of i) this.createProperty(s, e[s]);
|
|
619
619
|
}
|
|
@@ -782,15 +782,15 @@ let R = class extends HTMLElement {
|
|
|
782
782
|
firstUpdated(t) {
|
|
783
783
|
}
|
|
784
784
|
};
|
|
785
|
-
|
|
785
|
+
M.elementStyles = [], M.shadowRootOptions = { mode: "open" }, M[B("elementProperties")] = /* @__PURE__ */ new Map(), M[B("finalized")] = /* @__PURE__ */ new Map(), ht == null || ht({ ReactiveElement: M }), (C.reactiveElementVersions ?? (C.reactiveElementVersions = [])).push("2.1.2");
|
|
786
786
|
/**
|
|
787
787
|
* @license
|
|
788
788
|
* Copyright 2017 Google LLC
|
|
789
789
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
790
790
|
*/
|
|
791
|
-
const
|
|
791
|
+
const z = globalThis, Kt = (r) => r, et = z.trustedTypes, Zt = et ? et.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, me = "$lit$", A = `lit$${Math.random().toFixed(9).slice(2)}$`, ve = "?" + A, Ge = `<${ve}>`, k = document, F = () => k.createComment(""), V = (r) => r === null || typeof r != "object" && typeof r != "function", Pt = Array.isArray, Ke = (r) => Pt(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", lt = `[
|
|
792
792
|
\f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Yt = /-->/g, Jt = />/g, E = RegExp(`>|${lt}(?:([^\\s"'>=/]+)(${lt}*=${lt}*(?:[^
|
|
793
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Xt = /'/g, Qt = /"/g, ye = /^(?:script|style|textarea|title)$/i, Ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }),
|
|
793
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Xt = /'/g, Qt = /"/g, ye = /^(?:script|style|textarea|title)$/i, Ze = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), N = Ze(1), T = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), te = /* @__PURE__ */ new WeakMap(), P = k.createTreeWalker(k, 129);
|
|
794
794
|
function be(r, t) {
|
|
795
795
|
if (!Pt(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
796
796
|
return Zt !== void 0 ? Zt.createHTML(t) : t;
|
|
@@ -844,12 +844,12 @@ class W {
|
|
|
844
844
|
return i.innerHTML = t, i;
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function L(r, t, e = r, i) {
|
|
848
848
|
var n, a;
|
|
849
|
-
if (t ===
|
|
849
|
+
if (t === T) return t;
|
|
850
850
|
let s = i !== void 0 ? (n = e._$Co) == null ? void 0 : n[i] : e._$Cl;
|
|
851
851
|
const o = V(t) ? void 0 : t._$litDirective$;
|
|
852
|
-
return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t =
|
|
852
|
+
return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = s : e._$Cl = s), s !== void 0 && (t = L(r, s._$AS(r, t.values), s, i)), t;
|
|
853
853
|
}
|
|
854
854
|
class Je {
|
|
855
855
|
constructor(t, e) {
|
|
@@ -899,7 +899,7 @@ class Z {
|
|
|
899
899
|
return this._$AB;
|
|
900
900
|
}
|
|
901
901
|
_$AI(t, e = this) {
|
|
902
|
-
t =
|
|
902
|
+
t = L(this, t, e), V(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : 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);
|
|
903
903
|
}
|
|
904
904
|
O(t) {
|
|
905
905
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -955,11 +955,11 @@ class at {
|
|
|
955
955
|
_$AI(t, e = this, i, s) {
|
|
956
956
|
const o = this.strings;
|
|
957
957
|
let n = !1;
|
|
958
|
-
if (o === void 0) t =
|
|
958
|
+
if (o === void 0) t = L(this, t, e, 0), n = !V(t) || t !== this._$AH && t !== T, n && (this._$AH = t);
|
|
959
959
|
else {
|
|
960
960
|
const a = t;
|
|
961
961
|
let c, l;
|
|
962
|
-
for (t = o[0], c = 0; c < o.length - 1; c++) l =
|
|
962
|
+
for (t = o[0], c = 0; c < o.length - 1; c++) l = L(this, a[i + c], e, c), l === T && (l = this._$AH[c]), n || (n = !V(l) || l !== this._$AH[c]), l === p ? t = p : t !== p && (t += (l ?? "") + o[c + 1]), this._$AH[c] = l;
|
|
963
963
|
}
|
|
964
964
|
n && !s && this.j(t);
|
|
965
965
|
}
|
|
@@ -988,7 +988,7 @@ class ti extends at {
|
|
|
988
988
|
super(t, e, i, s, o), this.type = 5;
|
|
989
989
|
}
|
|
990
990
|
_$AI(t, e = this) {
|
|
991
|
-
if ((t =
|
|
991
|
+
if ((t = L(this, t, e, 0) ?? p) === T) return;
|
|
992
992
|
const i = this._$AH, s = t === p && i !== p || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== p && (i === p || s);
|
|
993
993
|
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
994
994
|
}
|
|
@@ -1005,11 +1005,11 @@ class ei {
|
|
|
1005
1005
|
return this._$AM._$AU;
|
|
1006
1006
|
}
|
|
1007
1007
|
_$AI(t) {
|
|
1008
|
-
|
|
1008
|
+
L(this, t);
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
|
-
const dt =
|
|
1012
|
-
dt == null || dt(W, Z), (
|
|
1011
|
+
const dt = z.litHtmlPolyfillSupport;
|
|
1012
|
+
dt == null || dt(W, Z), (z.litHtmlVersions ?? (z.litHtmlVersions = [])).push("3.3.3");
|
|
1013
1013
|
const ii = (r, t, e) => {
|
|
1014
1014
|
const i = (e == null ? void 0 : e.renderBefore) ?? t;
|
|
1015
1015
|
let s = i._$litPart$;
|
|
@@ -1025,7 +1025,7 @@ const ii = (r, t, e) => {
|
|
|
1025
1025
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1026
1026
|
*/
|
|
1027
1027
|
const O = globalThis;
|
|
1028
|
-
let x = class extends
|
|
1028
|
+
let x = class extends M {
|
|
1029
1029
|
constructor() {
|
|
1030
1030
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1031
1031
|
}
|
|
@@ -1047,7 +1047,7 @@ let x = class extends R {
|
|
|
1047
1047
|
super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
|
|
1048
1048
|
}
|
|
1049
1049
|
render() {
|
|
1050
|
-
return
|
|
1050
|
+
return T;
|
|
1051
1051
|
}
|
|
1052
1052
|
};
|
|
1053
1053
|
var he;
|
|
@@ -1113,7 +1113,7 @@ const Rt = class Rt extends x {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
};
|
|
1115
1115
|
Rt.styles = [
|
|
1116
|
-
|
|
1116
|
+
R`
|
|
1117
1117
|
:host {
|
|
1118
1118
|
position: fixed;
|
|
1119
1119
|
display: flex;
|
|
@@ -1446,7 +1446,7 @@ const ae = kt(class extends we {
|
|
|
1446
1446
|
const n = !!t[o];
|
|
1447
1447
|
n === this.st.has(o) || (s = this.nt) != null && s.has(o) || (n ? (e.add(o), this.st.add(o)) : (e.remove(o), this.st.delete(o)));
|
|
1448
1448
|
}
|
|
1449
|
-
return
|
|
1449
|
+
return T;
|
|
1450
1450
|
}
|
|
1451
1451
|
}), w = (r, t, e) => {
|
|
1452
1452
|
r && e.style.setProperty(t, r);
|
|
@@ -1565,7 +1565,7 @@ const Mt = class Mt extends x {
|
|
|
1565
1565
|
var a, c, l;
|
|
1566
1566
|
const t = (a = this.application) == null ? void 0 : a.branding(), e = (c = t == null ? void 0 : t.graphics) == null ? void 0 : c.trigger;
|
|
1567
1567
|
if (e)
|
|
1568
|
-
return
|
|
1568
|
+
return N` <img src=${e} class="trigger-icon" alt="" /> `;
|
|
1569
1569
|
const i = (l = this.application) == null ? void 0 : l.triggerIcon;
|
|
1570
1570
|
if (!i)
|
|
1571
1571
|
return p;
|
|
@@ -1573,7 +1573,7 @@ const Mt = class Mt extends x {
|
|
|
1573
1573
|
switch (o) {
|
|
1574
1574
|
case "Telia": {
|
|
1575
1575
|
const h = await s();
|
|
1576
|
-
return h ?
|
|
1576
|
+
return h ? N`<telia-icon
|
|
1577
1577
|
class="trigger-icon"
|
|
1578
1578
|
svg=${h.svg}
|
|
1579
1579
|
size="lg"
|
|
@@ -1598,14 +1598,14 @@ const Mt = class Mt extends x {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
render() {
|
|
1600
1600
|
var t, e, i, s, o, n, a;
|
|
1601
|
-
return
|
|
1601
|
+
return N`<div
|
|
1602
1602
|
class=${ae({
|
|
1603
1603
|
"trigger-container": !0,
|
|
1604
1604
|
"ace-hidden": !this.triggerVisible
|
|
1605
1605
|
})}
|
|
1606
1606
|
${Ce(this.containerRef)}
|
|
1607
1607
|
>
|
|
1608
|
-
${!this.active && ((s = (i = (e = (t = this.application) == null ? void 0 : t.settings) == null ? void 0 : e.branding) == null ? void 0 : i.other) != null && s.showButtonLabel) ?
|
|
1608
|
+
${!this.active && ((s = (i = (e = (t = this.application) == null ? void 0 : t.settings) == null ? void 0 : e.branding) == null ? void 0 : i.other) != null && s.showButtonLabel) ? N`
|
|
1609
1609
|
<button
|
|
1610
1610
|
type="button"
|
|
1611
1611
|
aria-label="${this.application.settings.branding.other.buttonLabelText ?? "Widget trigger"}"
|
|
@@ -1665,7 +1665,7 @@ const Mt = class Mt extends x {
|
|
|
1665
1665
|
}
|
|
1666
1666
|
};
|
|
1667
1667
|
Mt.styles = [
|
|
1668
|
-
|
|
1668
|
+
R`
|
|
1669
1669
|
:host {
|
|
1670
1670
|
--voca-rem-multiplier: 0.625;
|
|
1671
1671
|
--trigger-label-bg: #f5e0ff;
|
|
@@ -1799,7 +1799,7 @@ Mt.styles = [
|
|
|
1799
1799
|
}
|
|
1800
1800
|
|
|
1801
1801
|
.trigger-label:hover {
|
|
1802
|
-
|
|
1802
|
+
box-shadow: inset 0 0 0 2px currentColor;
|
|
1803
1803
|
}
|
|
1804
1804
|
`
|
|
1805
1805
|
];
|
|
@@ -1850,7 +1850,7 @@ const $i = (r) => {
|
|
|
1850
1850
|
};
|
|
1851
1851
|
e.styles = [
|
|
1852
1852
|
// (superClass as unknown as typeof LitElement).styles ?? [],
|
|
1853
|
-
|
|
1853
|
+
R`
|
|
1854
1854
|
:host {
|
|
1855
1855
|
font-family: var(--font-family);
|
|
1856
1856
|
grid-column: span var(--width);
|
|
@@ -1882,11 +1882,11 @@ const $i = (r) => {
|
|
|
1882
1882
|
], t.prototype, "parent"), t;
|
|
1883
1883
|
}, Nt = class Nt extends $i(x) {
|
|
1884
1884
|
render() {
|
|
1885
|
-
return
|
|
1885
|
+
return N`Non resolved component`;
|
|
1886
1886
|
}
|
|
1887
1887
|
};
|
|
1888
1888
|
Nt.styles = [
|
|
1889
|
-
|
|
1889
|
+
R`
|
|
1890
1890
|
:host {
|
|
1891
1891
|
display: block;
|
|
1892
1892
|
}
|
|
@@ -2022,7 +2022,7 @@ function Si({ context: r }) {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
};
|
|
2024
2024
|
}
|
|
2025
|
-
var Pi = Object.defineProperty,
|
|
2025
|
+
var Pi = Object.defineProperty, Tt = (r, t, e, i) => {
|
|
2026
2026
|
for (var s = void 0, o = r.length - 1, n; o >= 0; o--)
|
|
2027
2027
|
(n = r[o]) && (s = n(t, e, s) || s);
|
|
2028
2028
|
return s && Pi(t, e, s), s;
|
|
@@ -2053,12 +2053,12 @@ const Oi = "application", Lt = class Lt extends x {
|
|
|
2053
2053
|
}
|
|
2054
2054
|
render() {
|
|
2055
2055
|
var e, i, s;
|
|
2056
|
-
return ((s = (i = (e = this.application.settings) == null ? void 0 : e.agentConfig) == null ? void 0 : i.live) == null ? void 0 : s.isThirdPartyWidget) ?? !1 ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy === $.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")), this.application.fullscreen && this.renderRoot.host.classList.add("fullscreen"), this.renderRoot.host.classList.toggle("maximized", this.maximized), window.self !== window.top && this.renderRoot.host.classList.add("embedded"),
|
|
2056
|
+
return ((s = (i = (e = this.application.settings) == null ? void 0 : e.agentConfig) == null ? void 0 : i.live) == null ? void 0 : s.isThirdPartyWidget) ?? !1 ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy === $.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")), this.application.fullscreen && this.renderRoot.host.classList.add("fullscreen"), this.renderRoot.host.classList.toggle("maximized", this.maximized), window.self !== window.top && this.renderRoot.host.classList.add("embedded"), N`<div class="widget-container" ${Ce(this.wrapperRef)}>
|
|
2057
2057
|
${_i(this.nodes, (o) => o)}
|
|
2058
2058
|
</div>`;
|
|
2059
2059
|
}
|
|
2060
2060
|
};
|
|
2061
|
-
Lt.styles =
|
|
2061
|
+
Lt.styles = R`
|
|
2062
2062
|
:host {
|
|
2063
2063
|
--font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
|
|
2064
2064
|
--spacing-xs: 0.2rem;
|
|
@@ -2187,8 +2187,14 @@ Lt.styles = U`
|
|
|
2187
2187
|
}
|
|
2188
2188
|
|
|
2189
2189
|
.widget-container {
|
|
2190
|
+
--border-color-weak: color-mix(
|
|
2191
|
+
in srgb,
|
|
2192
|
+
var(--text-on-primary-background) 25%,
|
|
2193
|
+
transparent
|
|
2194
|
+
);
|
|
2190
2195
|
height: 100%;
|
|
2191
2196
|
background-color: var(--primary-background);
|
|
2197
|
+
color: var(--text-on-primary-background);
|
|
2192
2198
|
padding: var(--spacing-sm);
|
|
2193
2199
|
border: var(--widget-border, none);
|
|
2194
2200
|
}
|
|
@@ -2231,17 +2237,17 @@ Lt.styles = U`
|
|
|
2231
2237
|
animation: none;
|
|
2232
2238
|
}
|
|
2233
2239
|
`;
|
|
2234
|
-
let
|
|
2235
|
-
|
|
2240
|
+
let I = Lt;
|
|
2241
|
+
Tt([
|
|
2236
2242
|
m({ attribute: !0 })
|
|
2237
|
-
],
|
|
2238
|
-
|
|
2243
|
+
], I.prototype, "fullscreen");
|
|
2244
|
+
Tt([
|
|
2239
2245
|
m({ type: Boolean })
|
|
2240
|
-
],
|
|
2241
|
-
|
|
2246
|
+
], I.prototype, "maximized");
|
|
2247
|
+
Tt([
|
|
2242
2248
|
m({ attribute: !1 }),
|
|
2243
2249
|
Si({ context: Oi })
|
|
2244
|
-
],
|
|
2250
|
+
], I.prototype, "application");
|
|
2245
2251
|
class ki {
|
|
2246
2252
|
constructor() {
|
|
2247
2253
|
this.root = this.createRoot();
|
|
@@ -2282,7 +2288,7 @@ class ki {
|
|
|
2282
2288
|
return s(this, this.root, [o], n), this.root;
|
|
2283
2289
|
}
|
|
2284
2290
|
createRoot() {
|
|
2285
|
-
return typeof window < "u" && (window.customElements.get("ace-wrapper") || window.customElements.define("ace-wrapper",
|
|
2291
|
+
return typeof window < "u" && (window.customElements.get("ace-wrapper") || window.customElements.define("ace-wrapper", I)), document.createElement("ace-wrapper");
|
|
2286
2292
|
}
|
|
2287
2293
|
createNode(t, e) {
|
|
2288
2294
|
if (!this.resolveComponent(e))
|
|
@@ -2326,7 +2332,7 @@ const rt = class rt {
|
|
|
2326
2332
|
rt.ResolveWebComponentName = (t) => `ace-${t}`;
|
|
2327
2333
|
let _t = rt;
|
|
2328
2334
|
var y = /* @__PURE__ */ ((r) => (r.Necessary = "necessary", r.Functional = "functional", r.Analytics = "analytics", r))(y || {});
|
|
2329
|
-
class
|
|
2335
|
+
class Ti {
|
|
2330
2336
|
constructor(t, e, i, s) {
|
|
2331
2337
|
this.disallowedKeys = [], this.widgetId = t, this.storage = e === "localStorage" ? window.localStorage : window.sessionStorage, this.policy = i, this.storageEntries = s;
|
|
2332
2338
|
}
|
|
@@ -2383,7 +2389,7 @@ class Ii {
|
|
|
2383
2389
|
return `ace_${this.widgetId.substring(0, 7)}-${t}`;
|
|
2384
2390
|
}
|
|
2385
2391
|
}
|
|
2386
|
-
class
|
|
2392
|
+
class Ii {
|
|
2387
2393
|
constructor() {
|
|
2388
2394
|
this.texts = /* @__PURE__ */ new Map();
|
|
2389
2395
|
}
|
|
@@ -2398,7 +2404,7 @@ class Ti {
|
|
|
2398
2404
|
return this.texts.get(t) || e;
|
|
2399
2405
|
}
|
|
2400
2406
|
}
|
|
2401
|
-
const Ri = "1.1.151-rc.
|
|
2407
|
+
const Ri = "1.1.151-rc.4";
|
|
2402
2408
|
class Mi {
|
|
2403
2409
|
constructor(t) {
|
|
2404
2410
|
this.widget = t, this.name = t.name;
|
|
@@ -2423,7 +2429,7 @@ class Mi {
|
|
|
2423
2429
|
}
|
|
2424
2430
|
class Ni {
|
|
2425
2431
|
constructor(t, e, i, s, o) {
|
|
2426
|
-
this.id = t, this.name = e, this.container = i, this.settings = s, this.options = o, this.platform = new ki(), this.texts = new
|
|
2432
|
+
this.id = t, this.name = e, this.container = i, this.settings = s, this.options = o, this.platform = new ki(), this.texts = new Ii(), this.renderStrategy = $.Inline, this.fullscreen = !1, this.maximized = !1, this.anchor = "BottomRight", this.autoActivate = !1, this.plugins = [], this.componentResolver = new _t(), this.components = [], this.trigger = null, this.api = new Mi(this), this.onMessageReceived = async (a) => {
|
|
2427
2433
|
var l;
|
|
2428
2434
|
if (window.self !== window.top && !this._isAllowedOrigin(a.origin))
|
|
2429
2435
|
return;
|
|
@@ -2484,7 +2490,7 @@ class Ni {
|
|
|
2484
2490
|
[y.Functional]: !0,
|
|
2485
2491
|
[y.Analytics]: !0
|
|
2486
2492
|
};
|
|
2487
|
-
this.storage = new
|
|
2493
|
+
this.storage = new Ti(
|
|
2488
2494
|
this.id,
|
|
2489
2495
|
"sessionStorage",
|
|
2490
2496
|
n,
|
|
@@ -2795,7 +2801,7 @@ class ji {
|
|
|
2795
2801
|
}), globalThis.ace = t;
|
|
2796
2802
|
}
|
|
2797
2803
|
}
|
|
2798
|
-
var Hi = Object.defineProperty,
|
|
2804
|
+
var Hi = Object.defineProperty, It = (r, t, e, i) => {
|
|
2799
2805
|
for (var s = void 0, o = r.length - 1, n; o >= 0; o--)
|
|
2800
2806
|
(n = r[o]) && (s = n(t, e, s) || s);
|
|
2801
2807
|
return s && Hi(t, e, s), s;
|
|
@@ -2833,33 +2839,66 @@ const Ut = class Ut extends x {
|
|
|
2833
2839
|
}
|
|
2834
2840
|
};
|
|
2835
2841
|
Ut.styles = [
|
|
2836
|
-
|
|
2842
|
+
R`
|
|
2837
2843
|
:host {
|
|
2838
2844
|
display: block;
|
|
2839
2845
|
}
|
|
2840
2846
|
`
|
|
2841
2847
|
];
|
|
2842
|
-
let
|
|
2843
|
-
|
|
2848
|
+
let U = Ut;
|
|
2849
|
+
It([
|
|
2844
2850
|
m({ attribute: !0 })
|
|
2845
|
-
],
|
|
2846
|
-
|
|
2851
|
+
], U.prototype, "name");
|
|
2852
|
+
It([
|
|
2847
2853
|
j()
|
|
2848
|
-
],
|
|
2849
|
-
|
|
2854
|
+
], U.prototype, "widget");
|
|
2855
|
+
It([
|
|
2850
2856
|
j()
|
|
2851
|
-
],
|
|
2857
|
+
], U.prototype, "status");
|
|
2852
2858
|
customElements.get("ace-trigger-slot") || customElements.define("ace-trigger-slot", q);
|
|
2853
2859
|
customElements.get("ace-trigger") || customElements.define("ace-trigger", b);
|
|
2854
2860
|
customElements.get("ace-unresolved-component") || customElements.define("ace-unresolved-component", st);
|
|
2855
|
-
customElements.get("ace-wrapper") || customElements.define("ace-wrapper",
|
|
2856
|
-
customElements.get("ace-widget") || customElements.define("ace-widget",
|
|
2861
|
+
customElements.get("ace-wrapper") || customElements.define("ace-wrapper", I);
|
|
2862
|
+
customElements.get("ace-widget") || customElements.define("ace-widget", U);
|
|
2857
2863
|
const Gi = async (r, t, e = {}) => {
|
|
2858
2864
|
const i = new ji(r);
|
|
2859
2865
|
e.httpClient && i.setHttpClient(e.httpClient), await i.bootstrap(t);
|
|
2860
|
-
}
|
|
2866
|
+
}, Ki = R`
|
|
2867
|
+
.action-button {
|
|
2868
|
+
box-shadow: inset 0 0 0 1px currentColor;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
.action-button:not(:disabled):hover {
|
|
2872
|
+
box-shadow: inset 0 0 0 2px currentColor;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
.action-button:not(:disabled):active {
|
|
2876
|
+
box-shadow: inset 0 0 0 3px currentColor;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
.action-button:focus-visible {
|
|
2880
|
+
outline: 2px solid var(--focus-color);
|
|
2881
|
+
outline-offset: 2px;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
.action-button:disabled {
|
|
2885
|
+
cursor: not-allowed;
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
@media (forced-colors: active) {
|
|
2889
|
+
.action-button {
|
|
2890
|
+
outline: 1px solid ButtonText;
|
|
2891
|
+
outline-offset: -1px;
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
.action-button:focus-visible {
|
|
2895
|
+
outline: 2px solid Highlight;
|
|
2896
|
+
outline-offset: 2px;
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
`;
|
|
2861
2900
|
export {
|
|
2862
|
-
|
|
2901
|
+
U as AceWidget,
|
|
2863
2902
|
Ni as Application,
|
|
2864
2903
|
xi as AuthState,
|
|
2865
2904
|
Ft as Container,
|
|
@@ -2867,10 +2906,11 @@ export {
|
|
|
2867
2906
|
G as HttpClient,
|
|
2868
2907
|
ji as Site,
|
|
2869
2908
|
y as StorageCategory,
|
|
2870
|
-
|
|
2871
|
-
|
|
2909
|
+
Ti as StorageService,
|
|
2910
|
+
Ii as TextsService,
|
|
2872
2911
|
b as Trigger,
|
|
2873
2912
|
$i as WidgetComponent,
|
|
2913
|
+
Ki as actionButtonStyles,
|
|
2874
2914
|
Oi as applicationContext,
|
|
2875
2915
|
Gi as bootstrap,
|
|
2876
2916
|
qi as createHttpClient
|