@telia-ace/widget-core-flamingo 1.1.72-rc.3 → 1.1.72-rc.5

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gt=function(s,t){return gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])},gt(s,t)};function F(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gt(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function mt(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],i=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function J(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var i=e.call(s),r,n=[],o;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return n}function X(s,t,e){if(e||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++)(n||!(i in t))&&(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return s.concat(n||Array.prototype.slice.call(t))}function w(s){return typeof s=="function"}function Qt(s){var t=function(i){Error.call(i),i.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var ot=Qt(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
2
2
  `+e.map(function(i,r){return r+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(w(l))try{l()}catch(y){n=y instanceof ot?y.errors:[y]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var f=mt(p),u=f.next();!u.done;u=f.next()){var g=u.value;try{Ot(g)}catch(y){n=n??[],y instanceof ot?n=X(X([],J(n)),J(y.errors)):n.push(y)}}}catch(y){i={error:y}}finally{try{u&&!u.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&vt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),te=it.EMPTY;function ee(s){return s instanceof it||s&&"closed"in s&&w(s.remove)&&w(s.add)&&w(s.unsubscribe)}function Ot(s){w(s)?s():s.unsubscribe()}var ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=yt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,X([s,t],J(e))):setTimeout.apply(void 0,X([s,t],J(e)))},clearTimeout:function(s){var t=yt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Ee(s){yt.setTimeout(function(){throw s})}function Tt(){}function G(s){s()}var se=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ee(e)&&e.add(i)):i.destination=Ie,i}return t.create=function(e,i,r){return new bt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(it),Pe=Function.prototype.bind;function at(s,t){return Pe.call(s,t)}var Oe=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){q(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){q(i)}else q(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){q(e)}},s}(),bt=function(s){F(t,s);function t(e,i,r){var n=s.call(this)||this,o;if(w(e)||!e)o={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;n&&ie.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return n.unsubscribe()},o={next:e.next&&at(e.next,a),error:e.error&&at(e.error,a),complete:e.complete&&at(e.complete,a)}):o=e}return n.destination=new Oe(o),n}return t}(se);function q(s){Ee(s)}function Te(s){throw s}var Ie={closed:!0,next:Tt,error:Te,complete:Tt},Re=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ne(s){return s}function Ue(s){return s.length===0?Ne:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var It=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,n=Me(t)?t:new bt(t,e,i);return G(function(){var o=r,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?r._subscribe(n):r._trySubscribe(n))}),n},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=Rt(e),new e(function(r,n){var o=new bt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:r});i.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Re]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ue(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Rt(t),new t(function(i,r){var n;e.subscribe(function(o){return n=o},function(o){return r(o)},function(){return i(n)})})},s.create=function(t){return new s(t)},s}();function Rt(s){var t;return(t=s??ie.Promise)!==null&&t!==void 0?t:Promise}function ke(s){return s&&w(s.next)&&w(s.error)&&w(s.complete)}function Me(s){return s&&s instanceof se||ke(s)&&ee(s)}var je=Qt(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),wt=function(s){F(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new Nt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new je},t.prototype.next=function(e){var i=this;G(function(){var r,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=mt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;G(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;G(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,n=r.hasError,o=r.isStopped,a=r.observers;return n||o?te:(this.currentObservers=null,a.push(e),new it(function(){i.currentObservers=null,vt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,n=i.thrownError,o=i.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new It;return e.source=this,e},t.create=function(e,i){return new Nt(e,i)},t}(It),Nt=function(s){F(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:te},t}(wt),re=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,n=e._value;if(i)throw r;return this._throwIfClosed(),n},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(wt),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class $t{constructor(t,e){this.state=new re("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
3
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function vt(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var it=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,i,r,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=mt(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(w(l))try{l()}catch(y){n=y instanceof ot?y.errors:[y]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var f=mt(p),u=f.next();!u.done;u=f.next()){var g=u.value;try{Ot(g)}catch(y){n=n??[],y instanceof ot?n=X(X([],J(n)),J(y.errors)):n.push(y)}}}catch(y){i={error:y}}finally{try{u&&!u.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}}if(n)throw new ot(n)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ot(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&vt(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&vt(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),te=it.EMPTY;function ee(s){return s instanceof it||s&&"closed"in s&&w(s.remove)&&w(s.add)&&w(s.unsubscribe)}function Ot(s){w(s)?s():s.unsubscribe()}var ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yt={setTimeout:function(s,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var r=yt.delegate;return r!=null&&r.setTimeout?r.setTimeout.apply(r,X([s,t],J(e))):setTimeout.apply(void 0,X([s,t],J(e)))},clearTimeout:function(s){var t=yt.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(s)},delegate:void 0};function Ee(s){yt.setTimeout(function(){throw s})}function Tt(){}function Z(s){s()}var se=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i.isStopped=!1,e?(i.destination=e,ee(e)&&e.add(i)):i.destination=Ie,i}return t.create=function(e,i,r){return new bt(e,i,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(it),Pe=Function.prototype.bind;function at(s,t){return Pe.call(s,t)}var Oe=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){q(i)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){q(i)}else q(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){q(e)}},s}(),bt=function(s){F(t,s);function t(e,i,r){var n=s.call(this)||this,o;if(w(e)||!e)o={next:e??void 0,error:i??void 0,complete:r??void 0};else{var a;n&&ie.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return n.unsubscribe()},o={next:e.next&&at(e.next,a),error:e.error&&at(e.error,a),complete:e.complete&&at(e.complete,a)}):o=e}return n.destination=new Oe(o),n}return t}(se);function q(s){Ee(s)}function Te(s){throw s}var Ie={closed:!0,next:Tt,error:Te,complete:Tt},Re=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ne(s){return s}function Ue(s){return s.length===0?Ne:s.length===1?s[0]:function(e){return s.reduce(function(i,r){return r(i)},e)}}var It=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,i){var r=this,n=Me(t)?t:new bt(t,e,i);return Z(function(){var o=r,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?r._subscribe(n):r._trySubscribe(n))}),n},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var i=this;return e=Rt(e),new e(function(r,n){var o=new bt({next:function(a){try{t(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:r});i.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Re]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ue(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Rt(t),new t(function(i,r){var n;e.subscribe(function(o){return n=o},function(o){return r(o)},function(){return i(n)})})},s.create=function(t){return new s(t)},s}();function Rt(s){var t;return(t=s??ie.Promise)!==null&&t!==void 0?t:Promise}function ke(s){return s&&w(s.next)&&w(s.error)&&w(s.complete)}function Me(s){return s&&s instanceof se||ke(s)&&ee(s)}var je=Qt(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),wt=function(s){F(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new Nt(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new je},t.prototype.next=function(e){var i=this;Z(function(){var r,n;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=mt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){r={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var i=this;Z(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var r=i.observers;r.length;)r.shift().error(e)}})},t.prototype.complete=function(){var e=this;Z(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,r=this,n=r.hasError,o=r.isStopped,a=r.observers;return n||o?te:(this.currentObservers=null,a.push(e),new it(function(){i.currentObservers=null,vt(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,r=i.hasError,n=i.thrownError,o=i.isStopped;r?e.error(n):o&&e.complete()},t.prototype.asObservable=function(){var e=new It;return e.source=this,e},t.create=function(e,i){return new Nt(e,i)},t}(It),Nt=function(s){F(t,s);function t(e,i){var r=s.call(this)||this;return r.destination=e,r.source=i,r}return t.prototype.next=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,e)},t.prototype.error=function(e){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&r!==void 0?r:te},t}(wt),re=function(s){F(t,s);function t(e){var i=s.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=s.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,r=e.thrownError,n=e._value;if(i)throw r;return this._throwIfClosed(),n},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(wt),ne=(s=>(s.Loading="loading",s.Ready="ready",s))(ne||{});class $t{constructor(t,e){this.state=new re("loading"),this.resolvers=new Map,this.name=t,this.environment=e,this.state.next("ready")}setState(t){this.state.next(t)}async register(t,e){this.resolvers.set(t,e)}async get(t){return this.resolvers.get(t)}}/**
4
4
  * @license
5
5
  * Copyright 2019 Google LLC
6
6
  * SPDX-License-Identifier: BSD-3-Clause
7
- */const Z=globalThis,_t=Z.ShadowRoot&&(Z.ShadyCSS===void 0||Z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ut=new WeakMap;let oe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(_t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ut.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const He=s=>new oe(typeof s=="string"?s:s+"",void 0,At),N=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new oe(e,s,At)},Le=(s,t)=>{if(_t)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=Z.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},kt=_t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return He(e)})(s):s;/**
7
+ */const G=globalThis,_t=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ut=new WeakMap;let oe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(_t&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Ut.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ut.set(e,t))}return t}toString(){return this.cssText}};const He=s=>new oe(typeof s=="string"?s:s+"",void 0,At),N=(s,...t)=>{const e=s.length===1?s[0]:t.reduce((i,r,n)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[n+1],s[0]);return new oe(e,s,At)},Le=(s,t)=>{if(_t)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),r=G.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},kt=_t?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return He(e)})(s):s;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
@@ -14,7 +14,7 @@
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
15
  */const H=globalThis,tt=H.trustedTypes,Ht=tt?tt.createPolicy("lit-html",{createHTML:s=>s}):void 0,ae="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+A,qe=`<${ce}>`,P=document,D=()=>P.createComment(""),B=s=>s===null||typeof s!="object"&&typeof s!="function",he=Array.isArray,Ke=s=>he(s)||typeof(s==null?void 0:s[Symbol.iterator])=="function",ht=`[
16
16
  \f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lt=/-->/g,Dt=/>/g,C=RegExp(`>|${ht}(?:([^\\s"'>=/]+)(${ht}*=${ht}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ge=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),I=Ge(1),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Wt=new WeakMap,E=P.createTreeWalker(P,129);function pe(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Ze=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=M;for(let a=0;a<e;a++){const c=s[a];let h,l,p=-1,f=0;for(;f<c.length&&(o.lastIndex=f,l=o.exec(c),l!==null);)f=o.lastIndex,o===M?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=C):l[3]!==void 0&&(o=C):o===C?l[0]===">"?(o=r??M,p=-1):l[1]===void 0?p=-2:(p=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?C:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=C:o===Lt||o===Dt?o=M:(o=C,r=void 0);const u=o===C&&s[a+1].startsWith("/>")?" ":"";n+=o===M?c+qe:p>=0?(i.push(h),c.slice(0,p)+ae+c.slice(p)+A+u):c+A+(p===-2?a:u)}return[pe(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class z{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Ze(t,e);if(this.el=z.createElement(h,i),E.currentNode=this.el.content,e===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=E.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(ae)){const f=l[o++],u=r.getAttribute(p).split(A),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:n,name:g[2],strings:u,ctor:g[1]==="."?Xe:g[1]==="?"?Qe:g[1]==="@"?ti:st}),r.removeAttribute(p)}else p.startsWith(A)&&(c.push({type:6,index:n}),r.removeAttribute(p));if(le.test(r.tagName)){const p=r.textContent.split(A),f=p.length-1;if(f>0){r.textContent=tt?tt.emptyScript:"";for(let u=0;u<f;u++)r.append(p[u],D()),E.nextNode(),c.push({type:2,index:++n});r.append(p[f],D())}}}else if(r.nodeType===8)if(r.data===ce)c.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(A,p+1))!==-1;)c.push({type:7,index:n}),p+=A.length-1}n++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function R(s,t,e=s,i){var o,a;if(t===O)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=B(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=R(s,r._$AS(s,t.values),r,i)),t}class Je{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??P).importNode(e,!0);E.currentNode=r;let n=E.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new V(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new ei(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=E.nextNode(),o++)}return E.currentNode=P,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class V{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),B(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ke(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==d&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=z.createElement(pe(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Je(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new z(t)),e}k(t){he(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new V(this.S(D()),this.S(D()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=R(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==O,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=R(this,a[i+c],e,c),h===O&&(h=this._$AH[c]),o||(o=!B(h)||h!==this._$AH[c]),h===d?t=d:t!==d&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xe extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Qe extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class ti extends st{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??d)===O)return;const i=this._$AH,r=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==d&&(i===d||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ei{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}}const lt=H.litHtmlPolyfillSupport;lt==null||lt(z,V),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.1.2");const ii=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new V(t.insertBefore(D(),n),n,void 0,e??{})}return r._$AI(s),r};/**
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,zt=/"/g,le=/^(?:script|style|textarea|title)$/i,Ze=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),I=Ze(1),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Wt=new WeakMap,E=P.createTreeWalker(P,129);function pe(s,t){if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ht!==void 0?Ht.createHTML(t):t}const Ge=(s,t)=>{const e=s.length-1,i=[];let r,n=t===2?"<svg>":"",o=M;for(let a=0;a<e;a++){const c=s[a];let h,l,p=-1,f=0;for(;f<c.length&&(o.lastIndex=f,l=o.exec(c),l!==null);)f=o.lastIndex,o===M?l[1]==="!--"?o=Lt:l[1]!==void 0?o=Dt:l[2]!==void 0?(le.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=C):l[3]!==void 0&&(o=C):o===C?l[0]===">"?(o=r??M,p=-1):l[1]===void 0?p=-2:(p=o.lastIndex-l[2].length,h=l[1],o=l[3]===void 0?C:l[3]==='"'?zt:Bt):o===zt||o===Bt?o=C:o===Lt||o===Dt?o=M:(o=C,r=void 0);const u=o===C&&s[a+1].startsWith("/>")?" ":"";n+=o===M?c+qe:p>=0?(i.push(h),c.slice(0,p)+ae+c.slice(p)+A+u):c+A+(p===-2?a:u)}return[pe(s,n+(s[e]||"<?>")+(t===2?"</svg>":"")),i]};class z{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,c=this.parts,[h,l]=Ge(t,e);if(this.el=z.createElement(h,i),E.currentNode=this.el.content,e===2){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=E.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(ae)){const f=l[o++],u=r.getAttribute(p).split(A),g=/([.?@])?(.*)/.exec(f);c.push({type:1,index:n,name:g[2],strings:u,ctor:g[1]==="."?Xe:g[1]==="?"?Qe:g[1]==="@"?ti:st}),r.removeAttribute(p)}else p.startsWith(A)&&(c.push({type:6,index:n}),r.removeAttribute(p));if(le.test(r.tagName)){const p=r.textContent.split(A),f=p.length-1;if(f>0){r.textContent=tt?tt.emptyScript:"";for(let u=0;u<f;u++)r.append(p[u],D()),E.nextNode(),c.push({type:2,index:++n});r.append(p[f],D())}}}else if(r.nodeType===8)if(r.data===ce)c.push({type:2,index:n});else{let p=-1;for(;(p=r.data.indexOf(A,p+1))!==-1;)c.push({type:7,index:n}),p+=A.length-1}n++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function R(s,t,e=s,i){var o,a;if(t===O)return t;let r=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const n=B(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((a=r==null?void 0:r._$AO)==null||a.call(r,!1),n===void 0?r=void 0:(r=new n(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=r:e._$Cl=r),r!==void 0&&(t=R(s,r._$AS(s,t.values),r,i)),t}class Je{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=((t==null?void 0:t.creationScope)??P).importNode(e,!0);E.currentNode=r;let n=E.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new V(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new ei(n,this,t)),this._$AV.push(h),c=i[++a]}o!==(c==null?void 0:c.index)&&(n=E.nextNode(),o++)}return E.currentNode=P,r}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class V{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),B(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ke(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==d&&B(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=z.createElement(pe(i.h,i.h[0]),this.options)),i);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new Je(r,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Wt.get(t.strings);return e===void 0&&Wt.set(t.strings,e=new z(t)),e}k(t){he(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new V(this.S(D()),this.S(D()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=d}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(n===void 0)t=R(this,t,e,0),o=!B(t)||t!==this._$AH&&t!==O,o&&(this._$AH=t);else{const a=t;let c,h;for(t=n[0],c=0;c<n.length-1;c++)h=R(this,a[i+c],e,c),h===O&&(h=this._$AH[c]),o||(o=!B(h)||h!==this._$AH[c]),h===d?t=d:t!==d&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}o&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Xe extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Qe extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class ti extends st{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??d)===O)return;const i=this._$AH,r=t===d&&i!==d||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==d&&(i===d||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class ei{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}}const lt=H.litHtmlPolyfillSupport;lt==null||lt(z,V),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.1.2");const ii=(s,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let r=i._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;i._$litPart$=r=new V(t.insertBefore(D(),n),n,void 0,e??{})}return r._$AI(s),r};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
@@ -54,11 +54,11 @@
54
54
  * @license
55
55
  * Copyright 2017 Google LLC
56
56
  * SPDX-License-Identifier: BSD-3-Clause
57
- */const L=(s,t)=>{var i;const e=s._$AN;if(e===void 0)return!1;for(const r of e)(i=r._$AO)==null||i.call(r,t,!1),L(r,t);return!0},et=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},ue=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),pi(t)}};function hi(s){this._$AN!==void 0?(et(this),this._$AM=s,ue(this)):this._$AM=s}function li(s,t=!1,e=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)L(i[n],!1),et(i[n]);else i!=null&&(L(i,!1),et(i));else L(this,s)}const pi=s=>{s.type==Ct.CHILD&&(s._$AP??(s._$AP=li),s._$AQ??(s._$AQ=hi))};class fe extends de{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ue(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),e&&(L(this,t),et(this))}setValue(t){if(ci(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const di=new WeakMap;let Ft=0;const dt=new Map,Vt=new WeakSet,Yt=()=>new Promise(s=>requestAnimationFrame(s)),ui=[{transform:"translateX(100%) scale(0)",opacity:0}],qt=(s,t)=>{const e=s-t;return e===0?void 0:e},Kt=(s,t)=>{const e=s/t;return e===1?void 0:e},ut={left:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(s,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(s,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},fi={duration:333,easing:"ease-in-out"},gi=["left","top","width","height","opacity","color","background"],Gt=new WeakMap;class mi extends fe{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Ct.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;(t=this.resolveFinished)==null||t.call(this),this.finished=new Promise(e=>{this.l=e})}async resolveFinished(){var t;(t=this.l)==null||t.call(this),this.l=void 0}render(t){return d}getController(){return di.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var r;const i=this.u===void 0;return i&&(this.u=(r=t.options)==null?void 0:r.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,Gt.set(this.element,this)),this.optionsOrCallback=e,(i||typeof e!="function")&&this.p(e),this.render(e)}p(t){t=t??{};const e=this.getController();e!==void 0&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=gi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(r=>{const n=e[r]??(ut[r]?void 0:i[r]),o=Number(n);t[r]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,r)=>{if(Array.isArray(i)){if(Array.isArray(r)&&r.length===i.length&&i.every((n,o)=>n===r[o]))return!1}else if(r===i)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await Yt;const e=this.O(),i=this.j(this.options.keyframeOptions,e),r=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,r,e);this.log("measured",[this.A,r,n,o]),t=this.calculateKeyframes(n,o)}else{const n=dt.get(this.options.inId);if(n){dt.delete(this.options.inId);const{from:o,to:a}=this.N(n,r,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Ft++,t.forEach(c=>c.zIndex=Ft)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var t,e;this.P=this.element.getAttribute("style"),(t=this.webAnimation)==null||t.commitStyles(),(e=this.webAnimation)==null||e.cancel()}reconnected(){}async disconnected(){var e;if(!this.h||(this.options.id!==void 0&&dt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Yt(),(e=this.i)==null?void 0:e.isConnected){const i=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,i),this.options.stabilizeOut){const r=this.m();this.log("stabilizing out");const n=this.A.left-r.left,o=this.A.top-r.top;getComputedStyle(this.element).position!=="static"||n===0&&o===0||(this.element.style.position="relative"),n!==0&&(this.element.style.left=n+"px"),o!==0&&(this.element.style.top=o+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;(e=(t=this.options).onStart)==null||e.call(t,this)}didFinish(t){var e,i;t&&((i=(e=this.options).onComplete)==null||i.call(e,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let e=this.element.parentNode;e;e=e==null?void 0:e.parentNode){const i=Gt.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Vt.has(this.u);return t||this.u.updateComplete.then(()=>{Vt.add(this.u)}),t}j(t,e=this.O()){const i={...fi};return e.forEach(r=>Object.assign(i,r.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const r=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return r.length>0&&(r.forEach(a=>{a.width&&(n/=a.width),a.height&&(o/=a.height)}),t.left!==void 0&&e.left!==void 0&&(t.left=n*t.left,e.left=n*e.left),t.top!==void 0&&e.top!==void 0&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const r={},n={};let o=!1;const a={};for(const c in e){const h=t[c],l=e[c];if(c in ut){const p=ut[c];if(h===void 0||l===void 0)continue;const f=p(h,l);f.transform!==void 0&&(a[c]=f.value,o=!0,r.transform=`${r.transform??""} ${f.transform}`,f.overrideFrom!==void 0&&Object.assign(r,f.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,r[c]=h,n[c]=l)}return r.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[r,n]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,e]),i=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();r==null||r.add(this);try{await this.webAnimation.finished}catch{}r==null||r.remove(this)}return this.didFinish(i),i}isAnimating(){var t,e;return((t=this.webAnimation)==null?void 0:t.playState)==="running"||((e=this.webAnimation)==null?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}const vi=St(mi),yi={name:"question",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9827 16.5432 47.4568 4.01731 32 4ZM32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.30769 18.9151 18.9151 8.30769 32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6775 45.0788 45.0788 55.6775 32 55.6923Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9423 37.5723L36.311 32.9068L36.7354 32.4448C39.7555 29.1161 40.7645 27.0647 40.7645 24.5087C40.7645 23.1091 40.4251 21.7942 39.7041 20.6491C38.3044 18.3587 35.6323 16.9166 32.2816 16.9166C28.7565 16.9166 25.3125 18.7414 23.2581 21.6772L23.1201 21.8791C22.8232 22.3032 22.696 22.6849 22.696 22.9818C22.696 23.7029 23.926 25.9932 25.2833 25.9932C25.5378 25.9932 25.7922 25.9084 26.0467 25.7388C26.2588 25.5691 26.5981 25.2298 27.0647 24.7208C28.8885 22.6849 30.1185 21.9215 31.7726 21.9215C33.6813 21.9215 35.081 23.1939 35.081 24.8905C35.081 26.375 34.2751 27.7746 32.3664 29.8529L28.2523 34.2216C27.9554 34.6033 27.7857 34.9426 27.7857 35.282C27.7857 35.6213 27.9978 36.1726 28.4219 36.8937C29.0581 37.8692 29.7368 38.3782 30.4578 38.3782C30.9244 38.3782 31.3909 38.1237 31.9423 37.5723ZM30.882 47.4972C29.2278 47.4972 27.6585 44.7403 27.6585 43.6799C27.6585 42.1954 30.0761 40.6261 32.4089 40.6261C33.6389 40.6261 34.2751 41.1775 34.2751 42.3227C34.2751 44.0616 33.4692 45.843 32.4513 46.7761C31.9423 47.2427 31.4334 47.4972 30.882 47.4972Z"/></svg>'};/**
57
+ */const L=(s,t)=>{var i;const e=s._$AN;if(e===void 0)return!1;for(const r of e)(i=r._$AO)==null||i.call(r,t,!1),L(r,t);return!0},et=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while((e==null?void 0:e.size)===0)},ue=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),pi(t)}};function hi(s){this._$AN!==void 0?(et(this),this._$AM=s,ue(this)):this._$AM=s}function li(s,t=!1,e=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let n=e;n<i.length;n++)L(i[n],!1),et(i[n]);else i!=null&&(L(i,!1),et(i));else L(this,s)}const pi=s=>{s.type==Ct.CHILD&&(s._$AP??(s._$AP=li),s._$AQ??(s._$AQ=hi))};class fe extends de{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ue(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,r;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),e&&(L(this,t),et(this))}setValue(t){if(ci(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const di=new WeakMap;let Ft=0;const dt=new Map,Vt=new WeakSet,Yt=()=>new Promise(s=>requestAnimationFrame(s)),ui=[{transform:"translateX(100%) scale(0)",opacity:0}],qt=(s,t)=>{const e=s-t;return e===0?void 0:e},Kt=(s,t)=>{const e=s/t;return e===1?void 0:e},ut={left:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateX(${e}px)`}},top:(s,t)=>{const e=qt(s,t);return{value:e,transform:e==null||isNaN(e)?void 0:`translateY(${e}px)`}},width:(s,t)=>{let e;t===0&&(t=1,e={width:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(s,t)=>{let e;t===0&&(t=1,e={height:"1px"});const i=Kt(s,t);return{value:i,overrideFrom:e,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},fi={duration:333,easing:"ease-in-out"},gi=["left","top","width","height","opacity","color","background"],Zt=new WeakMap;class mi extends fe{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Ct.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;(t=this.resolveFinished)==null||t.call(this),this.finished=new Promise(e=>{this.l=e})}async resolveFinished(){var t;(t=this.l)==null||t.call(this),this.l=void 0}render(t){return d}getController(){return di.get(this.u)}isDisabled(){var t;return this.options.disabled||((t=this.getController())==null?void 0:t.disabled)}update(t,[e]){var r;const i=this.u===void 0;return i&&(this.u=(r=t.options)==null?void 0:r.host,this.u.addController(this),this.u.updateComplete.then(n=>this.t=!0),this.element=t.element,Zt.set(this.element,this)),this.optionsOrCallback=e,(i||typeof e!="function")&&this.p(e),this.render(e)}p(t){t=t??{};const e=this.getController();e!==void 0&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=gi),this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach(r=>{const n=e[r]??(ut[r]?void 0:i[r]),o=Number(n);t[r]=isNaN(o)?n+"":o}),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((i,r)=>{if(Array.isArray(i)){if(Array.isArray(r)&&r.length===i.length&&i.every((n,o)=>n===r[o]))return!1}else if(r===i)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await Yt;const e=this.O(),i=this.j(this.options.keyframeOptions,e),r=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,r,e);this.log("measured",[this.A,r,n,o]),t=this.calculateKeyframes(n,o)}else{const n=dt.get(this.options.inId);if(n){dt.delete(this.options.inId);const{from:o,to:a}=this.N(n,r,e);t=this.calculateKeyframes(o,a),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Ft++,t.forEach(c=>c.zIndex=Ft)}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var t,e;this.P=this.element.getAttribute("style"),(t=this.webAnimation)==null||t.commitStyles(),(e=this.webAnimation)==null||e.cancel()}reconnected(){}async disconnected(){var e;if(!this.h||(this.options.id!==void 0&&dt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Yt(),(e=this.i)==null?void 0:e.isConnected){const i=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,i),this.options.stabilizeOut){const r=this.m();this.log("stabilizing out");const n=this.A.left-r.left,o=this.A.top-r.top;getComputedStyle(this.element).position!=="static"||n===0&&o===0||(this.element.style.position="relative"),n!==0&&(this.element.style.left=n+"px"),o!==0&&(this.element.style.top=o+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;(e=(t=this.options).onStart)==null||e.call(t,this)}didFinish(t){var e,i;t&&((i=(e=this.options).onComplete)==null||i.call(e,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let e=this.element.parentNode;e;e=e==null?void 0:e.parentNode){const i=Zt.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=Vt.has(this.u);return t||this.u.updateComplete.then(()=>{Vt.add(this.u)}),t}j(t,e=this.O()){const i={...fi};return e.forEach(r=>Object.assign(i,r.options.keyframeOptions)),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const r=i.map(a=>a.animatingProperties).filter(a=>a!==void 0);let n=1,o=1;return r.length>0&&(r.forEach(a=>{a.width&&(n/=a.width),a.height&&(o/=a.height)}),t.left!==void 0&&e.left!==void 0&&(t.left=n*t.left,e.left=n*e.left),t.top!==void 0&&e.top!==void 0&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const r={},n={};let o=!1;const a={};for(const c in e){const h=t[c],l=e[c];if(c in ut){const p=ut[c];if(h===void 0||l===void 0)continue;const f=p(h,l);f.transform!==void 0&&(a[c]=f.value,o=!0,r.transform=`${r.transform??""} ${f.transform}`,f.overrideFrom!==void 0&&Object.assign(r,f.overrideFrom))}else h!==l&&h!==void 0&&l!==void 0&&(o=!0,r[c]=h,n[c]=l)}return r.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[r,n]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,e]),i=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();r==null||r.add(this);try{await this.webAnimation.finished}catch{}r==null||r.remove(this)}return this.didFinish(i),i}isAnimating(){var t,e;return((t=this.webAnimation)==null?void 0:t.playState)==="running"||((e=this.webAnimation)==null?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}const vi=St(mi),yi={name:"question",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60C47.464 60 60 47.464 60 32C59.9827 16.5432 47.4568 4.01731 32 4ZM32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.30769 18.9151 18.9151 8.30769 32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6775 45.0788 45.0788 55.6775 32 55.6923Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9423 37.5723L36.311 32.9068L36.7354 32.4448C39.7555 29.1161 40.7645 27.0647 40.7645 24.5087C40.7645 23.1091 40.4251 21.7942 39.7041 20.6491C38.3044 18.3587 35.6323 16.9166 32.2816 16.9166C28.7565 16.9166 25.3125 18.7414 23.2581 21.6772L23.1201 21.8791C22.8232 22.3032 22.696 22.6849 22.696 22.9818C22.696 23.7029 23.926 25.9932 25.2833 25.9932C25.5378 25.9932 25.7922 25.9084 26.0467 25.7388C26.2588 25.5691 26.5981 25.2298 27.0647 24.7208C28.8885 22.6849 30.1185 21.9215 31.7726 21.9215C33.6813 21.9215 35.081 23.1939 35.081 24.8905C35.081 26.375 34.2751 27.7746 32.3664 29.8529L28.2523 34.2216C27.9554 34.6033 27.7857 34.9426 27.7857 35.282C27.7857 35.6213 27.9978 36.1726 28.4219 36.8937C29.0581 37.8692 29.7368 38.3782 30.4578 38.3782C30.9244 38.3782 31.3909 38.1237 31.9423 37.5723ZM30.882 47.4972C29.2278 47.4972 27.6585 44.7403 27.6585 43.6799C27.6585 42.1954 30.0761 40.6261 32.4089 40.6261C33.6389 40.6261 34.2751 41.1775 34.2751 42.3227C34.2751 44.0616 33.4692 45.843 32.4513 46.7761C31.9423 47.2427 31.4334 47.4972 30.882 47.4972Z"/></svg>'};/**
58
58
  * @license
59
59
  * Copyright 2018 Google LLC
60
60
  * SPDX-License-Identifier: BSD-3-Clause
61
- */const Zt=St(class extends de{constructor(s){var t;if(super(s),s.type!==Ct.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var i,r;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((i=this.nt)!=null&&i.has(n))&&this.st.add(n);return this.render(t)}const e=s.element.classList;for(const n of this.st)n in t||(e.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||(r=this.nt)!=null&&r.has(n)||(o?(e.add(n),this.st.add(n)):(e.remove(n),this.st.delete(n)))}return O}}),K=(s,t,e)=>{s&&e.style.setProperty(t,s)},ge=(s,t)=>{var e,i,r,n;K((e=s.colors)==null?void 0:e.primaryBackground,"--primary-background",t),K((i=s.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),K((r=s.colors)==null?void 0:r.secondaryBackground,"--secondary-background",t),K((n=s.colors)==null?void 0:n.textOnSecondaryBackground,"--text-on-secondary-background",t)};/**
61
+ */const Gt=St(class extends de{constructor(s){var t;if(super(s),s.type!==Ct.ATTRIBUTE||s.name!=="class"||((t=s.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var i,r;if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!((i=this.nt)!=null&&i.has(n))&&this.st.add(n);return this.render(t)}const e=s.element.classList;for(const n of this.st)n in t||(e.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||(r=this.nt)!=null&&r.has(n)||(o?(e.add(n),this.st.add(n)):(e.remove(n),this.st.delete(n)))}return O}}),K=(s,t,e)=>{s&&e.style.setProperty(t,s)},ge=(s,t)=>{var e,i,r,n;K((e=s.colors)==null?void 0:e.primaryBackground,"--primary-background",t),K((i=s.colors)==null?void 0:i.textOnPrimaryBackground,"--text-on-primary-background",t),K((r=s.colors)==null?void 0:r.secondaryBackground,"--secondary-background",t),K((n=s.colors)==null?void 0:n.textOnSecondaryBackground,"--text-on-secondary-background",t)};/**
62
62
  * @license
63
63
  * Copyright 2020 Google LLC
64
64
  * SPDX-License-Identifier: BSD-3-Clause
@@ -67,7 +67,7 @@
67
67
  svg=${l.svg}
68
68
  size="lg"
69
69
  ></telia-icon>`:d}default:return d}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var t,e,i,r;return I`<div
70
- class=${Zt({"trigger-container":!0,hidden:!this.triggerVisible})}
70
+ class=${Gt({"trigger-container":!0,hidden:!this.triggerVisible})}
71
71
  ${ve(this.containerRef)}
72
72
  >
73
73
  ${!this.active&&((r=(i=(e=(t=this.application)==null?void 0:t.settings)==null?void 0:e.branding)==null?void 0:i.other)!=null&&r.showButtonLabel)?I`
@@ -83,7 +83,7 @@
83
83
 
84
84
  <button
85
85
  label="Widget trigger"
86
- class=${Zt({trigger:!0,active:this.active,rendered:this.loaded})}
86
+ class=${Gt({trigger:!0,active:this.active,rendered:this.loaded})}
87
87
  @click=${this.toggleActive}
88
88
  >
89
89
  ${this.icon}
@@ -264,8 +264,8 @@
264
264
  * @license
265
265
  * Copyright 2017 Google LLC
266
266
  * SPDX-License-Identifier: BSD-3-Clause
267
- */function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Jt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Jt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends _{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){return 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")),I`<div class="widget-container" ${ve(this.wrapperRef)}>
268
- ${xi(this.nodes,t=>t)}
267
+ */function Pi({context:s}){return(t,e)=>{const i=new WeakMap;if(typeof e=="object")return e.addInitializer(function(){i.set(this,new Jt(this,{context:s}))}),{get(){return t.get.call(this)},set(r){var n;return(n=i.get(this))==null||n.setValue(r),t.set.call(this,r)},init(r){var n;return(n=i.get(this))==null||n.setValue(r),r}};{t.constructor.addInitializer(o=>{i.set(o,new Jt(o,{context:s}))});const r=Object.getOwnPropertyDescriptor(t,e);let n;if(r===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(a){i.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=r.set;n={...r,set:function(a){i.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(t,e,n)}}}var Oi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,Ii=(s,t,e,i)=>{for(var r=i>1?void 0:i?Ti(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&Oi(t,e,r),r};const be="application";class nt extends _{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=me()}addChild(t){t.parent=this,this.nodes.push(t)}applyBranding(){if(!this.wrapperRef.value)return;const t=this.application.settings;t!=null&&t.branding&&ge(t.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const t=this.application.styles(),e=this.wrapperRef.value;Object.entries(t).forEach(([i,r])=>{e.style.setProperty(`--${i}`,r)})}firstUpdated(t){this.applyBranding(),this.applyStyles()}render(){var i,r;const t=this.application.settings.components.conversation;return((r=(i=t==null?void 0:t.properties)==null?void 0:i.chat)==null?void 0:r.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===$.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")),I`<div class="widget-container" ${ve(this.wrapperRef)}>
268
+ ${xi(this.nodes,n=>n)}
269
269
  </div>`}}nt.styles=N`
270
270
  :host {
271
271
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
@@ -313,6 +313,10 @@
313
313
  inset: 0 0 95px 0;
314
314
  height: 100%;
315
315
  }
316
+ :host(.third-party) {
317
+ inset: 0 0 95px 0;
318
+ height: 100vh;
319
+ }
316
320
  }
317
321
  @media screen and (min-width: 801px) {
318
322
  :host(.floating) {
@@ -321,6 +325,14 @@
321
325
  width: 400px;
322
326
  height: 700px;
323
327
  }
328
+ :host(.third-party) {
329
+ max-width: 1000px;
330
+ height: 100vh;
331
+ position: relative;
332
+ left: 50%;
333
+ transform: translateX(-50%);
334
+ margin: -10px 0;
335
+ }
324
336
  :host(.floating.bottom-right) {
325
337
  inset: auto 20px 95px auto;
326
338
  }
@@ -346,6 +358,8 @@
346
358
  background-color: var(--primary-background);
347
359
  padding: var(--spacing-sm);
348
360
  border: var(--widget-border, none);
361
+ border-left: 1px solid #00000054;
362
+ border-right: 1px solid #00000054;
349
363
  }
350
364
  @keyframes slideDown {
351
365
  from {
@@ -376,7 +390,7 @@
376
390
  animation: slideDown 0.3s linear;
377
391
  pointer-events: none;
378
392
  }
379
- `;Ii([m({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(p=>{const f=i(p),u=l[f.definitionId];if(!u){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(u.type,u.type);g&&(g.name=f.definitionId,g.application=e,u.properties&&g.writeProperties(u.properties),u.context&&g.writeContext(u.context),u.layout&&g.writeLayout(u.layout),c.addChild(g),u.children&&r(a,g,u.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return new nt}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Et;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const $e=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=$e.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let we=$e;we.ResolveWebComponentName=s=>`ace-${s}`;var v=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(v||{});class _e{constructor(t,e,i){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i}set(t,e,i){if(!this.disallowedKeys.includes(t))if(this.policy[i]){const r={value:e,category:i};this.storage.setItem(this._prefixKey(t),JSON.stringify(r))}else console.warn(`Storage policy does not allow storing items in category: ${i}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}updatePolicy(t){this.policy=t}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class Ni{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ui{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new Ni,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new we,this.components=[],this.trigger=null,this.api=new Ui(this),this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[v.Necessary]:!0,[v.Functional]:!0,[v.Analytics]:!0};this.storage=new _e(this.id,"sessionStorage",o),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open",!0,v.Necessary)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1,v.Necessary)}mute(){this.storage.set("muteAudioNotifications",!0,v.Necessary)}unmute(){this.storage.set("muteAudioNotifications",!1,v.Necessary)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new rt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const ki=s=>new W(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let W=xe;W.endpoint="https://widgets.ace.teliacompany.net/api";class Mi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[v.Analytics]:t.includes("analytics"),[v.Necessary]:t.includes("necessary"),[v.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ce{constructor(){this.applications=[],this.container=new $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(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new $t(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new W,this.api=new Mi(this),this.httpClient=new W,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}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"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.widgets;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.widgets=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class k extends _{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return d;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}k.styles=[N`
393
+ `;Ii([m({attribute:!1}),Pi({context:be})],nt.prototype,"application",2);class Ri{constructor(){this.root=this.createRoot()}createComponentModel(t,e){this.root.application=e;const i=a=>{if(Array.isArray(a)){const[c,...h]=a;return{definitionId:c,overrides:h}}return{definitionId:a,overrides:[]}},r=(a,c,h,l)=>{h.forEach(p=>{const f=i(p),u=l[f.definitionId];if(!u){console.error(`No definition found for component type '${f.definitionId}'.`);return}const g=a.createNode(u.type,u.type);g&&(g.name=f.definitionId,g.application=e,u.properties&&g.writeProperties(u.properties),u.context&&g.writeContext(u.context),u.layout&&g.writeLayout(u.layout),c.addChild(g),u.children&&r(a,g,u.children,l))})},{entry:n,components:o}=t;return r(this,this.root,[n],o),this.root}createRoot(){return new nt}createNode(t,e){const i=this.resolveComponent(e);if(!i)return console.warn(`Unable to resolve component: ${e}`),new Et;const r=new i;return r.type=e,r.name=t,r}resolveComponent(t){return customElements.get(`ace-${t}`)}getRoot(){return this.root}}const $e=class{constructor(){this.components=new Map}getComponent(s){const t=this.components.get(s);return t||console.warn(`Unable to resolve component: ${s}. You most likely forgot to register the required plugin.`),t}registerComponent(s,t){this.components.set(s,t)}async loadComponents(){const s=[...this.components.entries()].map(([t,e])=>e.then(i=>{this.defineAsWebComponent(t,i.default)}));await Promise.all(s)}defineAsWebComponent(s,t){const e=$e.ResolveWebComponentName(s);customElements.get(e)||customElements.define(e,t)}};let we=$e;we.ResolveWebComponentName=s=>`ace-${s}`;var v=(s=>(s.Necessary="necessary",s.Functional="functional",s.Analytics="analytics",s))(v||{});class _e{constructor(t,e,i){this.disallowedKeys=[],this.widgetId=t,this.storage=e==="localStorage"?window.localStorage:window.sessionStorage,this.policy=i}set(t,e,i){if(!this.disallowedKeys.includes(t))if(this.policy[i]){const r={value:e,category:i};this.storage.setItem(this._prefixKey(t),JSON.stringify(r))}else console.warn(`Storage policy does not allow storing items in category: ${i}`)}get(t){const e=this.storage.getItem(this._prefixKey(t));if(!e)return null;try{const i=JSON.parse(e);return this.policy[i.category]?i.value:(console.warn(`Storage policy does not allow retrieving items from category: ${i.category}`),null)}catch{return null}}removeItem(t){this.storage.removeItem(this._prefixKey(t))}updatePolicy(t){this.policy=t}disallowKey(t){this.disallowedKeys.includes(t)||this.disallowedKeys.push(t),this.removeItem(t)}_prefixKey(t){return`ace_${this.widgetId.substring(0,7)}-${t}`}}class Ni{constructor(){this.texts=new Map}loadTexts(t){this.texts=new Map(Object.entries(t))}get(t,e){const i=this.texts.get(t);return i||e||null}getOrFallback(t,e){return this.texts.get(t)||e}}class Ui{constructor(t){this.widget=t,this.name=t.name}open(){this.widget.appendToDOM()}close(){this.widget.hide()}setZIndex(t){this.widget.setZIndex(t)}}class Ae{constructor(t,e,i,r,n){this.id=t,this.name=e,this.container=i,this.settings=r,this.options=n,this.platform=new Ri,this.texts=new Ni,this.renderStrategy=$.Inline,this.anchor="BottomRight",this.autoActivate=!1,this.plugins=[],this.componentResolver=new we,this.components=[],this.trigger=null,this.api=new Ui(this),this.renderStrategy=this.options.renderStrategy||$.Inline,this.triggerIcon=this.options.triggerIcon;const o={[v.Necessary]:!0,[v.Functional]:!0,[v.Analytics]:!0};this.storage=new _e(this.id,"sessionStorage",o),typeof n.autoActivate=="boolean"&&(this.autoActivate=n.autoActivate),n.anchor&&(this.anchor=n.anchor),this.container.register("$settings",r),this.texts.loadTexts(r.texts||{})}async activate(){if(await this.loadPlugins(),await this.componentResolver.loadComponents(),this.root=this.platform.createComponentModel(this.settings,this),this.container.setState(ne.Ready),this.autoActivate){const t=this.render();t&&this._getTargetElement().appendChild(t)}}async loadPlugins(){for await(const t of this.plugins)await t(this)}styles(){return this.settings.styles||{}}branding(){return this.settings.branding||{}}plugin(t){return this.plugins.push(t),this}appendToDOM(){this.root&&(this.root.classList.add("expanded"),this.root.classList.remove("hidden"),document.body.appendChild(this.root)),this.storage.set("open",!0,v.Necessary)}hide(){this.root&&(this.root.classList.add("hidden"),this.root.classList.remove("expanded")),this.storage.set("open",!1,v.Necessary)}setZIndex(t){this.root&&(this.root.style.zIndex=t.toString())}mute(){this.storage.set("muteAudioNotifications",!0,v.Necessary)}unmute(){this.storage.set("muteAudioNotifications",!1,v.Necessary)}registerComponent(t,e){this.componentResolver.registerComponent(t,e)}resolveComponent(t){return this.componentResolver.getComponent(t)}mountComponent(t){this.components.push(t)}getComponent(t){const e=this.components.find(i=>i.type===t);return e||null}_getTargetElement(){let t="bottom-right";if(this.anchor==="BottomRight"?t="bottom-right":this.anchor==="BottomLeft"&&(t="bottom-left"),this.renderStrategy===$.Trigger){let e=document.querySelector(`ace-trigger-slot.${t}`);return e||(e=new rt,e.anchor=this.anchor,document.body.appendChild(e)),e}return document.body}render(){if(this.renderStrategy===$.Trigger){const t=new b;return t.application=this,this.trigger=t,this.storage.get("open")&&this.trigger.toggleActive(),t}return this.root}}const ki=s=>new W(s),xe=class{constructor(s=xe.endpoint){this._endpoint=s}async getSite(s){const e=await(await fetch(s)).json();return e?{id:e.id,apps:e.widgets.map(i=>{let r=$.Inline;return i.renderStrategy==="Trigger"&&(r=$.Trigger),{id:i.id,widgetId:i.widgetId,renderStrategy:r,autoActivate:i.autoActivate,anchor:i.anchor,triggerIcon:{type:"Telia",content:i.triggerIcon}}})}:null}async getWidget(s){const e=await(await fetch(`${this._endpoint}/widget/${s}`)).json();return e?{name:e.name,config:JSON.parse(e.configuration)}:null}};let W=xe;W.endpoint="https://widgets.ace.teliacompany.net/api";class Mi{constructor(t){this.site=t}storagePolicy(t){var i;(((i=this.site.environment)==null?void 0:i.applications)||[]).forEach(r=>{if(r.storage){const n={[v.Analytics]:t.includes("analytics"),[v.Necessary]:t.includes("necessary"),[v.Functional]:t.includes("functional")};r.storage.updatePolicy(n)}})}disallowStorageKey(t){var e;(((e=this.site.environment)==null?void 0:e.applications)||[]).forEach(i=>{i.storage&&i.storage.disallowKey(t)})}}class Ce{constructor(){this.applications=[],this.container=new $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(){const t=this.applications.filter(e=>e.autoActivate);for await(const e of t)await e.activate()}notifyWidgetsOfCreation(){document.querySelectorAll("ace-widget").forEach(e=>{const i=this.applications.find(r=>r.name===e.name);i&&e.dispatchEvent(new CustomEvent("environment-created",{detail:{widget:i}}))})}configure(t){if(!this.site||!this.bootstrapped){this.siteConfigurationHandlers.push(t);return}t(this.site.api)}widget(t,e){const i=this.applications.find(r=>r.name===t);if(!i){const r=this.widgetAPIHandlers.get(t)||[];r.push(()=>{const n=this.applications.find(o=>o.name===t);e(n==null?void 0:n.api)}),this.widgetAPIHandlers.set(t,r);return}e(i==null?void 0:i.api)}registerApp(t,e,i,r){const n=new $t(e,this),o=new Ae(t,e,n,i,r);this.applications.push(o)}registerSite(t){this.site=t}plugin(t){return this.applications.forEach(e=>{e.plugin(t)}),this}}class Se{constructor(t){this.configurations=[],this.httpClient=new W,this.api=new Mi(this),this.httpClient=new W,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}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"}}))}async bootstrap(t){var e;this.url&&await this.load(this.url),this.environment=new Ce,this.addGlobal(this.environment);for await(const i of this.configurations){const r=await this.httpClient.getWidget(i.widgetId);r&&((e=this.environment)==null||e.registerApp(i.widgetId,r.name,r.config,{renderStrategy:i.renderStrategy,triggerIcon:i.triggerIcon,autoActivate:i.autoActivate,anchor:i.anchor}))}t(this.environment),this.environment.registerSite(this),await this.environment.bootstrap()}addGlobal(t){const e=globalThis.ace;((e==null?void 0:e._w)||[]).forEach(([i,r])=>{t.widget(i,r)}),((e==null?void 0:e._c)||[]).forEach(i=>{t.configure(i)}),globalThis.ace=t}}var ji=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Pt=(s,t,e,i)=>{for(var r=i>1?void 0:i?Hi(t,e):t,n=s.length-1,o;n>=0;n--)(o=s[n])&&(r=(i?o(t,e,r):o(r))||r);return i&&r&&ji(t,e,r),r};class k extends _{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(t){this.widget=t.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const t=globalThis.widgets;t&&(this.widget=t.applications.find(e=>e.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return d;if(this.widget.renderStrategy===$.Trigger){const t=new b;return t.application=this.widget,t}return this.widget.render()}}k.styles=[N`
380
394
  :host {
381
395
  display: block;
382
396
  }
package/index.mjs CHANGED
@@ -27,7 +27,7 @@ function mt(s) {
27
27
  };
28
28
  throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
29
29
  }
30
- function Z(s, t) {
30
+ function G(s, t) {
31
31
  var e = typeof Symbol == "function" && s[Symbol.iterator];
32
32
  if (!e)
33
33
  return s;
@@ -121,7 +121,7 @@ var it = function() {
121
121
  try {
122
122
  Pt(g);
123
123
  } catch (v) {
124
- n = n ?? [], v instanceof ot ? n = J(J([], Z(n)), Z(v.errors)) : n.push(v);
124
+ n = n ?? [], v instanceof ot ? n = J(J([], G(n)), G(v.errors)) : n.push(v);
125
125
  }
126
126
  }
127
127
  } catch (v) {
@@ -185,7 +185,7 @@ var ie = {
185
185
  for (var e = [], i = 2; i < arguments.length; i++)
186
186
  e[i - 2] = arguments[i];
187
187
  var r = yt.delegate;
188
- return r != null && r.setTimeout ? r.setTimeout.apply(r, J([s, t], Z(e))) : setTimeout.apply(void 0, J([s, t], Z(e)));
188
+ return r != null && r.setTimeout ? r.setTimeout.apply(r, J([s, t], G(e))) : setTimeout.apply(void 0, J([s, t], G(e)));
189
189
  },
190
190
  clearTimeout: function(s) {
191
191
  var t = yt.delegate;
@@ -539,7 +539,7 @@ class Nt {
539
539
  * Copyright 2019 Google LLC
540
540
  * SPDX-License-Identifier: BSD-3-Clause
541
541
  */
542
- const G = globalThis, wt = G.ShadowRoot && (G.ShadyCSS === void 0 || G.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), Ut = /* @__PURE__ */ new WeakMap();
542
+ const Z = globalThis, wt = Z.ShadowRoot && (Z.ShadyCSS === void 0 || Z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, _t = Symbol(), Ut = /* @__PURE__ */ new WeakMap();
543
543
  let oe = class {
544
544
  constructor(t, e, i) {
545
545
  if (this._$cssResult$ = !0, i !== _t)
@@ -573,7 +573,7 @@ const Re = (s) => new oe(typeof s == "string" ? s : s + "", void 0, _t), N = (s,
573
573
  s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
574
574
  else
575
575
  for (const e of t) {
576
- const i = document.createElement("style"), r = G.litNonce;
576
+ const i = document.createElement("style"), r = Z.litNonce;
577
577
  r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
578
578
  }
579
579
  }, kt = wt ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
@@ -924,7 +924,7 @@ class Ve {
924
924
  for (; c !== void 0; ) {
925
925
  if (o === c.index) {
926
926
  let h;
927
- c.type === 2 ? h = new W(n, n.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(n, c.name, c.strings, this, t) : c.type === 6 && (h = new Ge(n, this, t)), this._$AV.push(h), c = i[++a];
927
+ c.type === 2 ? h = new W(n, n.nextSibling, this, t) : c.type === 1 ? h = new c.ctor(n, c.name, c.strings, this, t) : c.type === 6 && (h = new Ze(n, this, t)), this._$AV.push(h), c = i[++a];
928
928
  }
929
929
  o !== (c == null ? void 0 : c.index) && (n = E.nextNode(), o++);
930
930
  }
@@ -1059,7 +1059,7 @@ class Ke extends st {
1059
1059
  typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
1060
1060
  }
1061
1061
  }
1062
- class Ge {
1062
+ class Ze {
1063
1063
  constructor(t, e, i) {
1064
1064
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
1065
1065
  }
@@ -1072,7 +1072,7 @@ class Ge {
1072
1072
  }
1073
1073
  const lt = j.litHtmlPolyfillSupport;
1074
1074
  lt == null || lt(B, W), (j.litHtmlVersions ?? (j.litHtmlVersions = [])).push("3.1.2");
1075
- const Ze = (s, t, e) => {
1075
+ const Ge = (s, t, e) => {
1076
1076
  const i = (e == null ? void 0 : e.renderBefore) ?? t;
1077
1077
  let r = i._$litPart$;
1078
1078
  if (r === void 0) {
@@ -1097,7 +1097,7 @@ let w = class extends T {
1097
1097
  }
1098
1098
  update(t) {
1099
1099
  const e = this.render();
1100
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ze(e, this.renderRoot, this.renderOptions);
1100
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Ge(e, this.renderRoot, this.renderOptions);
1101
1101
  }
1102
1102
  connectedCallback() {
1103
1103
  var t;
@@ -1319,7 +1319,7 @@ const dt = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new WeakSet(), Yt = (
1319
1319
  t === 0 && (t = 1, e = { height: "1px" });
1320
1320
  const i = Kt(s, t);
1321
1321
  return { value: i, overrideFrom: e, transform: i == null || isNaN(i) ? void 0 : `scaleY(${i})` };
1322
- } }, ci = { duration: 333, easing: "ease-in-out" }, hi = ["left", "top", "width", "height", "opacity", "color", "background"], Gt = /* @__PURE__ */ new WeakMap();
1322
+ } }, ci = { duration: 333, easing: "ease-in-out" }, hi = ["left", "top", "width", "height", "opacity", "color", "background"], Zt = /* @__PURE__ */ new WeakMap();
1323
1323
  class li extends fe {
1324
1324
  constructor(t) {
1325
1325
  if (super(t), this.t = !1, this.i = null, this.o = null, this.h = !0, this.shouldLog = !1, t.type === xt.CHILD)
@@ -1349,7 +1349,7 @@ class li extends fe {
1349
1349
  update(t, [e]) {
1350
1350
  var r;
1351
1351
  const i = this.u === void 0;
1352
- return i && (this.u = (r = t.options) == null ? void 0 : r.host, this.u.addController(this), this.u.updateComplete.then((n) => this.t = !0), this.element = t.element, Gt.set(this.element, this)), this.optionsOrCallback = e, (i || typeof e != "function") && this.p(e), this.render(e);
1352
+ return i && (this.u = (r = t.options) == null ? void 0 : r.host, this.u.addController(this), this.u.updateComplete.then((n) => this.t = !0), this.element = t.element, Zt.set(this.element, this)), this.optionsOrCallback = e, (i || typeof e != "function") && this.p(e), this.render(e);
1353
1353
  }
1354
1354
  p(t) {
1355
1355
  t = t ?? {};
@@ -1436,7 +1436,7 @@ class li extends fe {
1436
1436
  O() {
1437
1437
  const t = [];
1438
1438
  for (let e = this.element.parentNode; e; e = e == null ? void 0 : e.parentNode) {
1439
- const i = Gt.get(e);
1439
+ const i = Zt.get(e);
1440
1440
  i && !i.isDisabled() && i && t.push(i);
1441
1441
  }
1442
1442
  return t;
@@ -1505,7 +1505,7 @@ const pi = Ct(li), di = { name: "question", svg: '<svg viewBox="0 0 64 64" xmlns
1505
1505
  * Copyright 2018 Google LLC
1506
1506
  * SPDX-License-Identifier: BSD-3-Clause
1507
1507
  */
1508
- const Zt = Ct(class extends de {
1508
+ const Gt = Ct(class extends de {
1509
1509
  constructor(s) {
1510
1510
  var t;
1511
1511
  if (super(s), s.type !== xt.ATTRIBUTE || s.name !== "class" || ((t = s.strings) == null ? void 0 : t.length) > 2)
@@ -1645,7 +1645,7 @@ class _ extends w {
1645
1645
  render() {
1646
1646
  var t, e, i, r;
1647
1647
  return I`<div
1648
- class=${Zt({
1648
+ class=${Gt({
1649
1649
  "trigger-container": !0,
1650
1650
  hidden: !this.triggerVisible
1651
1651
  })}
@@ -1669,7 +1669,7 @@ class _ extends w {
1669
1669
 
1670
1670
  <button
1671
1671
  label="Widget trigger"
1672
- class=${Zt({
1672
+ class=${Gt({
1673
1673
  trigger: !0,
1674
1674
  active: this.active,
1675
1675
  rendered: this.loaded
@@ -2077,8 +2077,10 @@ class nt extends w {
2077
2077
  this.applyBranding(), this.applyStyles();
2078
2078
  }
2079
2079
  render() {
2080
- return this.application.renderStrategy === b.Trigger && (this.renderRoot.host.classList.add("floating"), this.application.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.application.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right")), I`<div class="widget-container" ${ve(this.wrapperRef)}>
2081
- ${bi(this.nodes, (t) => t)}
2080
+ var i, r;
2081
+ const t = this.application.settings.components.conversation;
2082
+ return ((r = (i = t == null ? void 0 : t.properties) == null ? void 0 : i.chat) == null ? void 0 : r.isThirdPartyWidget) ? this.renderRoot.host.classList.add("third-party") : this.application.renderStrategy === b.Trigger && (this.renderRoot.host.classList.add("floating"), this.application.anchor === "BottomLeft" ? this.renderRoot.host.classList.add("bottom-left") : this.application.anchor === "BottomRight" && this.renderRoot.host.classList.add("bottom-right")), I`<div class="widget-container" ${ve(this.wrapperRef)}>
2083
+ ${bi(this.nodes, (n) => n)}
2082
2084
  </div>`;
2083
2085
  }
2084
2086
  }
@@ -2129,6 +2131,10 @@ nt.styles = N`
2129
2131
  inset: 0 0 95px 0;
2130
2132
  height: 100%;
2131
2133
  }
2134
+ :host(.third-party) {
2135
+ inset: 0 0 95px 0;
2136
+ height: 100vh;
2137
+ }
2132
2138
  }
2133
2139
  @media screen and (min-width: 801px) {
2134
2140
  :host(.floating) {
@@ -2137,6 +2143,14 @@ nt.styles = N`
2137
2143
  width: 400px;
2138
2144
  height: 700px;
2139
2145
  }
2146
+ :host(.third-party) {
2147
+ max-width: 1000px;
2148
+ height: 100vh;
2149
+ position: relative;
2150
+ left: 50%;
2151
+ transform: translateX(-50%);
2152
+ margin: -10px 0;
2153
+ }
2140
2154
  :host(.floating.bottom-right) {
2141
2155
  inset: auto 20px 95px auto;
2142
2156
  }
@@ -2162,6 +2176,8 @@ nt.styles = N`
2162
2176
  background-color: var(--primary-background);
2163
2177
  padding: var(--spacing-sm);
2164
2178
  border: var(--widget-border, none);
2179
+ border-left: 1px solid #00000054;
2180
+ border-right: 1px solid #00000054;
2165
2181
  }
2166
2182
  @keyframes slideDown {
2167
2183
  from {
@@ -2345,6 +2361,9 @@ class Ii {
2345
2361
  close() {
2346
2362
  this.widget.hide();
2347
2363
  }
2364
+ setZIndex(t) {
2365
+ this.widget.setZIndex(t);
2366
+ }
2348
2367
  }
2349
2368
  class Ri {
2350
2369
  constructor(t, e, i, r, n) {
@@ -2381,6 +2400,9 @@ class Ri {
2381
2400
  hide() {
2382
2401
  this.root && (this.root.classList.add("hidden"), this.root.classList.remove("expanded")), this.storage.set("open", !1, y.Necessary);
2383
2402
  }
2403
+ setZIndex(t) {
2404
+ this.root && (this.root.style.zIndex = t.toString());
2405
+ }
2384
2406
  mute() {
2385
2407
  this.storage.set("muteAudioNotifications", !0, y.Necessary);
2386
2408
  }
@@ -2592,12 +2614,12 @@ class ki {
2592
2614
  t(this.environment), this.environment.registerSite(this), await this.environment.bootstrap();
2593
2615
  }
2594
2616
  addGlobal(t) {
2595
- const e = globalThis.widgets;
2617
+ const e = globalThis.ace;
2596
2618
  ((e == null ? void 0 : e._w) || []).forEach(([i, r]) => {
2597
2619
  t.widget(i, r);
2598
2620
  }), ((e == null ? void 0 : e._c) || []).forEach((i) => {
2599
2621
  t.configure(i);
2600
- }), globalThis.widgets = t;
2622
+ }), globalThis.ace = t;
2601
2623
  }
2602
2624
  }
2603
2625
  var Mi = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Et = (s, t, e, i) => {
@@ -34,6 +34,7 @@ export declare class Application {
34
34
  plugin(plugin: PluginType): this;
35
35
  appendToDOM(): void;
36
36
  hide(): void;
37
+ setZIndex(zIndex: number): void;
37
38
  mute(): void;
38
39
  unmute(): void;
39
40
  registerComponent(type: string, component: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-core-flamingo",
3
- "version": "1.1.72-rc.3",
3
+ "version": "1.1.72-rc.5",
4
4
  "dependencies": {
5
5
  "lit": "^3.0.2",
6
6
  "@teliads/icons": "^8.4.0",
@@ -5,4 +5,5 @@ export declare class WidgetAPI {
5
5
  constructor(widget: Application);
6
6
  open(): void;
7
7
  close(): void;
8
+ setZIndex(zIndex: number): void;
8
9
  }