@telia-ace/ace-chat-flamingo 1.1.75 → 1.1.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,56 +1,56 @@
1
- "use strict";var fr=Object.defineProperty;var gr=(n,e,t)=>e in n?fr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var x=(n,e,t)=>(gr(n,typeof e!="symbol"?e+"":e,t),t),mr=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var Vt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)};var it=(n,e,t)=>(mr(n,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class vs{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new vs,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var ss=function(n,e){return ss=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])},ss(n,e)};function J(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ss(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function vr(n,e,t,s){function i(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?r(h.value):i(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})}function Fn(n,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,i,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(h){return l([c,h])}}function l(c){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(s=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){t.label=c[1];break}if(c[0]===6&&t.label<r[1]){t.label=r[1],r=c;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(c);break}r[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(h){c=[6,h],i=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Se(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],s=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var s=t.call(n),i,r=[],o;try{for(;(e===void 0||e-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=s.return)&&t.call(s)}finally{if(o)throw o.error}}return r}function G(n,e,t){if(t||arguments.length===2)for(var s=0,i=e.length,r;s<i;s++)(r||!(s in e))&&(r||(r=Array.prototype.slice.call(e,0,s)),r[s]=e[s]);return n.concat(r||Array.prototype.slice.call(e))}function ke(n){return this instanceof ke?(this.v=n,this):new ke(n)}function br(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=t.apply(n,e||[]),i,r=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){s[d]&&(i[d]=function(p){return new Promise(function(b,m){r.push([d,p,b,m])>1||a(d,p)})})}function a(d,p){try{l(s[d](p))}catch(b){u(r[0][3],b)}}function l(d){d.value instanceof ke?Promise.resolve(d.value.v).then(c,h):u(r[0][2],d)}function c(d){a("next",d)}function h(d){a("throw",d)}function u(d,p){d(p),r.shift(),r.length&&a(r[0][0],r[0][1])}}function yr(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Se=="function"?Se(n):n[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(r){t[r]=n[r]&&function(o){return new Promise(function(a,l){o=n[r](o),i(a,l,o.done,o.value)})}}function i(r,o,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},o)}}function y(n){return typeof n=="function"}function Zn(n){var e=function(s){Error.call(s),s.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ft=Zn(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
1
+ "use strict";var ur=Object.defineProperty;var dr=(n,e,t)=>e in n?ur(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var x=(n,e,t)=>(dr(n,typeof e!="symbol"?e+"":e,t),t),pr=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var Nt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)};var it=(n,e,t)=>(pr(n,e,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class ms{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new ms,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var Xt=function(n,e){return Xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])},Xt(n,e)};function X(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Xt(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function fr(n,e,t,s){function i(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?r(h.value):i(h.value).then(a,l)}c((s=s.apply(n,e||[])).next())})}function Fn(n,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,i,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(h){return l([c,h])}}function l(c){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(s=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){t.label=c[1];break}if(c[0]===6&&t.label<r[1]){t.label=r[1],r=c;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(c);break}r[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(h){c=[6,h],i=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Se(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],s=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var s=t.call(n),i,r=[],o;try{for(;(e===void 0||e-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=s.return)&&t.call(s)}finally{if(o)throw o.error}}return r}function K(n,e,t){if(t||arguments.length===2)for(var s=0,i=e.length,r;s<i;s++)(r||!(s in e))&&(r||(r=Array.prototype.slice.call(e,0,s)),r[s]=e[s]);return n.concat(r||Array.prototype.slice.call(e))}function ke(n){return this instanceof ke?(this.v=n,this):new ke(n)}function gr(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=t.apply(n,e||[]),i,r=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){s[d]&&(i[d]=function(p){return new Promise(function(b,m){r.push([d,p,b,m])>1||a(d,p)})})}function a(d,p){try{l(s[d](p))}catch(b){u(r[0][3],b)}}function l(d){d.value instanceof ke?Promise.resolve(d.value.v).then(c,h):u(r[0][2],d)}function c(d){a("next",d)}function h(d){a("throw",d)}function u(d,p){d(p),r.shift(),r.length&&a(r[0][0],r[0][1])}}function mr(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Se=="function"?Se(n):n[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(r){t[r]=n[r]&&function(o){return new Promise(function(a,l){o=n[r](o),i(a,l,o.done,o.value)})}}function i(r,o,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},o)}}function y(n){return typeof n=="function"}function Vn(n){var e=function(s){Error.call(s),s.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Bt=Vn(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
2
2
  `+t.map(function(s,i){return i+1+") "+s.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function dt(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var Qe=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,s,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Se(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var h=this.initialTeardown;if(y(h))try{h()}catch(m){r=m instanceof Ft?m.errors:[m]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Se(u),p=d.next();!p.done;p=d.next()){var b=p.value;try{Gs(b)}catch(m){r=r??[],m instanceof Ft?r=G(G([],Z(r)),Z(m.errors)):r.push(m)}}}catch(m){s={error:m}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}}if(r)throw new Ft(r)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Gs(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&dt(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&dt(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),Wn=Qe.EMPTY;function Qn(n){return n instanceof Qe||n&&"closed"in n&&y(n.remove)&&y(n.add)&&y(n.unsubscribe)}function Gs(n){y(n)?n():n.unsubscribe()}var Yn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ns={setTimeout:function(n,e){for(var t=[],s=2;s<arguments.length;s++)t[s-2]=arguments[s];var i=ns.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,G([n,e],Z(t))):setTimeout.apply(void 0,G([n,e],Z(t)))},clearTimeout:function(n){var e=ns.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(n)},delegate:void 0};function Gn(n){ns.setTimeout(function(){throw n})}function pt(){}function ht(n){n()}var bs=function(n){J(e,n);function e(t){var s=n.call(this)||this;return s.isStopped=!1,t?(s.destination=t,Qn(t)&&t.add(s)):s.destination=kr,s}return e.create=function(t,s,i){return new is(t,s,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Qe),$r=Function.prototype.bind;function Zt(n,e){return $r.call(n,e)}var xr=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(s){rt(s)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(s){rt(s)}else rt(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){rt(t)}},n}(),is=function(n){J(e,n);function e(t,s,i){var r=n.call(this)||this,o;if(y(t)||!t)o={next:t??void 0,error:s??void 0,complete:i??void 0};else{var a;r&&Yn.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return r.unsubscribe()},o={next:t.next&&Zt(t.next,a),error:t.error&&Zt(t.error,a),complete:t.complete&&Zt(t.complete,a)}):o=t}return r.destination=new xr(o),r}return e}(bs);function rt(n){Gn(n)}function wr(n){throw n}var kr={closed:!0,next:pt,error:wr,complete:pt},ys=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Oe(n){return n}function Cr(n){return n.length===0?Oe:n.length===1?n[0]:function(t){return n.reduce(function(s,i){return i(s)},t)}}var E=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,s){var i=this,r=Sr(e)?e:new is(e,t,s);return ht(function(){var o=i,a=o.operator,l=o.source;r.add(a?a.call(r,l):l?i._subscribe(r):i._trySubscribe(r))}),r},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var s=this;return t=Ks(t),new t(function(i,r){var o=new is({next:function(a){try{e(a)}catch(l){r(l),o.unsubscribe()}},error:r,complete:i});s.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[ys]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Cr(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=Ks(e),new e(function(s,i){var r;t.subscribe(function(o){return r=o},function(o){return i(o)},function(){return s(r)})})},n.create=function(e){return new n(e)},n}();function Ks(n){var e;return(e=n??Yn.Promise)!==null&&e!==void 0?e:Promise}function _r(n){return n&&y(n.next)&&y(n.error)&&y(n.complete)}function Sr(n){return n&&n instanceof bs||_r(n)&&Qn(n)}function Er(n){return y(n==null?void 0:n.lift)}function M(n){return function(e){if(Er(e))return e.lift(function(t){try{return n(t,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function T(n,e,t,s,i){return new Ar(n,e,t,s,i)}var Ar=function(n){J(e,n);function e(t,s,i,r,o,a){var l=n.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=s?function(c){try{s(c)}catch(h){t.error(h)}}:n.prototype._next,l._error=r?function(c){try{r(c)}catch(h){t.error(h)}finally{this.unsubscribe()}}:n.prototype._error,l._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(bs),Tr=Zn(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),S=function(n){J(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var s=new Js(this,this);return s.operator=t,s},e.prototype._throwIfClosed=function(){if(this.closed)throw new Tr},e.prototype.next=function(t){var s=this;ht(function(){var i,r;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var o=Se(s.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(t)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var s=this;ht(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=t;for(var i=s.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;ht(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var s=t.observers;s.length;)s.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var s=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Wn:(this.currentObservers=null,a.push(t),new Qe(function(){s.currentObservers=null,dt(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var s=this,i=s.hasError,r=s.thrownError,o=s.isStopped;i?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new E;return t.source=this,t},e.create=function(t,s){return new Js(t,s)},e}(E),Js=function(n){J(e,n);function e(t,s){var i=n.call(this)||this;return i.destination=t,i.source=s,i}return e.prototype.next=function(t){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.next)===null||i===void 0||i.call(s,t)},e.prototype.error=function(t){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.error)===null||i===void 0||i.call(s,t)},e.prototype.complete=function(){var t,s;(s=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||s===void 0||s.call(t)},e.prototype._subscribe=function(t){var s,i;return(i=(s=this.source)===null||s===void 0?void 0:s.subscribe(t))!==null&&i!==void 0?i:Wn},e}(S),N=function(n){J(e,n);function e(t){var s=n.call(this)||this;return s._value=t,s}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var s=n.prototype._subscribe.call(this,t);return!s.closed&&t.next(this._value),s},e.prototype.getValue=function(){var t=this,s=t.hasError,i=t.thrownError,r=t._value;if(s)throw i;return this._throwIfClosed(),r},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(S),Kn={now:function(){return(Kn.delegate||Date).now()},delegate:void 0},Or=function(n){J(e,n);function e(t,s){return n.call(this)||this}return e.prototype.schedule=function(t,s){return this},e}(Qe),ft={setInterval:function(n,e){for(var t=[],s=2;s<arguments.length;s++)t[s-2]=arguments[s];var i=ft.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,G([n,e],Z(t))):setInterval.apply(void 0,G([n,e],Z(t)))},clearInterval:function(n){var e=ft.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(n)},delegate:void 0},Pr=function(n){J(e,n);function e(t,s){var i=n.call(this,t,s)||this;return i.scheduler=t,i.work=s,i.pending=!1,i}return e.prototype.schedule=function(t,s){var i;if(s===void 0&&(s=0),this.closed)return this;this.state=t;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,s)),this.pending=!0,this.delay=s,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,s),this},e.prototype.requestAsyncId=function(t,s,i){return i===void 0&&(i=0),ft.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,s,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return s;s!=null&&ft.clearInterval(s)},e.prototype.execute=function(t,s){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,s);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,s){var i=!1,r;try{this.work(t)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,s=t.id,i=t.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,dt(r,this),s!=null&&(this.id=this.recycleAsyncId(i,s,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e}(Or),Xs=function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,s){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(s,t)},n.now=Kn.now,n}(),Lr=function(n){J(e,n);function e(t,s){s===void 0&&(s=Xs.now);var i=n.call(this,t,s)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(t){var s=this.actions;if(this._active){s.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=s.shift());if(this._active=!1,i){for(;t=s.shift();)t.unsubscribe();throw i}},e}(Xs),Ir=new Lr(Pr),Rr=Ir,Pe=new E(function(n){return n.complete()});function Jn(n){return n&&y(n.schedule)}function $s(n){return n[n.length-1]}function Xn(n){return y($s(n))?n.pop():void 0}function xs(n){return Jn($s(n))?n.pop():void 0}function jr(n,e){return typeof $s(n)=="number"?n.pop():e}var ws=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function ei(n){return y(n==null?void 0:n.then)}function ti(n){return y(n[ys])}function si(n){return Symbol.asyncIterator&&y(n==null?void 0:n[Symbol.asyncIterator])}function ni(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Mr(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ii=Mr();function ri(n){return y(n==null?void 0:n[ii])}function oi(n){return br(this,arguments,function(){var t,s,i,r;return Fn(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,ke(t.read())];case 3:return s=o.sent(),i=s.value,r=s.done,r?[4,ke(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,ke(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ai(n){return y(n==null?void 0:n.getReader)}function R(n){if(n instanceof E)return n;if(n!=null){if(ti(n))return Ur(n);if(ws(n))return zr(n);if(ei(n))return Dr(n);if(si(n))return li(n);if(ri(n))return Hr(n);if(ai(n))return Br(n)}throw ni(n)}function Ur(n){return new E(function(e){var t=n[ys]();if(y(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function zr(n){return new E(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function Dr(n){return new E(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Gn)})}function Hr(n){return new E(function(e){var t,s;try{for(var i=Se(n),r=i.next();!r.done;r=i.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{r&&!r.done&&(s=i.return)&&s.call(i)}finally{if(t)throw t.error}}e.complete()})}function li(n){return new E(function(e){Nr(n,e).catch(function(t){return e.error(t)})})}function Br(n){return li(oi(n))}function Nr(n,e){var t,s,i,r;return vr(this,void 0,void 0,function(){var o,a;return Fn(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=yr(n),l.label=1;case 1:return[4,t.next()];case 2:if(s=l.sent(),!!s.done)return[3,4];if(o=s.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),s&&!s.done&&(r=t.return)?[4,r.call(t)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Y(n,e,t,s,i){s===void 0&&(s=0),i===void 0&&(i=!1);var r=e.schedule(function(){t(),i?n.add(this.schedule(null,s)):this.unsubscribe()},s);if(n.add(r),!i)return r}function ci(n,e){return e===void 0&&(e=0),M(function(t,s){t.subscribe(T(s,function(i){return Y(s,n,function(){return s.next(i)},e)},function(){return Y(s,n,function(){return s.complete()},e)},function(i){return Y(s,n,function(){return s.error(i)},e)}))})}function hi(n,e){return e===void 0&&(e=0),M(function(t,s){s.add(n.schedule(function(){return t.subscribe(s)},e))})}function qr(n,e){return R(n).pipe(hi(e),ci(e))}function Vr(n,e){return R(n).pipe(hi(e),ci(e))}function Fr(n,e){return new E(function(t){var s=0;return e.schedule(function(){s===n.length?t.complete():(t.next(n[s++]),t.closed||this.schedule())})})}function Zr(n,e){return new E(function(t){var s;return Y(t,e,function(){s=n[ii](),Y(t,e,function(){var i,r,o;try{i=s.next(),r=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return y(s==null?void 0:s.return)&&s.return()}})}function ui(n,e){if(!n)throw new Error("Iterable cannot be null");return new E(function(t){Y(t,e,function(){var s=n[Symbol.asyncIterator]();Y(t,e,function(){s.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function Wr(n,e){return ui(oi(n),e)}function Qr(n,e){if(n!=null){if(ti(n))return qr(n,e);if(ws(n))return Fr(n,e);if(ei(n))return Vr(n,e);if(si(n))return ui(n,e);if(ri(n))return Zr(n,e);if(ai(n))return Wr(n,e)}throw ni(n)}function de(n,e){return e?Qr(n,e):R(n)}function rs(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=xs(n);return de(n,t)}function Yr(n){return n instanceof Date&&!isNaN(n)}function gt(n,e){return M(function(t,s){var i=0;t.subscribe(T(s,function(r){s.next(n.call(e,r,i++))}))})}var Gr=Array.isArray;function Kr(n,e){return Gr(e)?n.apply(void 0,G([],Z(e))):n(e)}function di(n){return gt(function(e){return Kr(n,e)})}var Jr=Array.isArray,Xr=Object.getPrototypeOf,eo=Object.prototype,to=Object.keys;function so(n){if(n.length===1){var e=n[0];if(Jr(e))return{args:e,keys:null};if(no(e)){var t=to(e);return{args:t.map(function(s){return e[s]}),keys:t}}}return{args:n,keys:null}}function no(n){return n&&typeof n=="object"&&Xr(n)===eo}function io(n,e){return n.reduce(function(t,s,i){return t[s]=e[i],t},{})}function ro(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=xs(n),s=Xn(n),i=so(n),r=i.args,o=i.keys;if(r.length===0)return de([],t);var a=new E(oo(r,t,o?function(l){return io(o,l)}:Oe));return s?a.pipe(di(s)):a}function oo(n,e,t){return t===void 0&&(t=Oe),function(s){en(e,function(){for(var i=n.length,r=new Array(i),o=i,a=i,l=function(h){en(e,function(){var u=de(n[h],e),d=!1;u.subscribe(T(s,function(p){r[h]=p,d||(d=!0,a--),a||s.next(t(r.slice()))},function(){--o||s.complete()}))},s)},c=0;c<i;c++)l(c)},s)}}function en(n,e,t){n?Y(t,n,e):e()}function ao(n,e,t,s,i,r,o,a){var l=[],c=0,h=0,u=!1,d=function(){u&&!l.length&&!c&&e.complete()},p=function(m){return c<s?b(m):l.push(m)},b=function(m){r&&e.next(m),c++;var D=!1;R(t(m,h++)).subscribe(T(e,function(W){i==null||i(W),r?p(W):e.next(W)},function(){D=!0},void 0,function(){if(D)try{c--;for(var W=function(){var ae=l.shift();o?Y(e,o,function(){return b(ae)}):b(ae)};l.length&&c<s;)W();d()}catch(ae){e.error(ae)}}))};return n.subscribe(T(e,p,function(){u=!0,d()})),function(){a==null||a()}}function He(n,e,t){return t===void 0&&(t=1/0),y(e)?He(function(s,i){return gt(function(r,o){return e(s,r,i,o)})(R(n(s,i)))},t):(typeof e=="number"&&(t=e),M(function(s,i){return ao(s,i,n,t)}))}function lo(n){return n===void 0&&(n=1/0),He(Oe,n)}function co(n){return new E(function(e){R(n()).subscribe(e)})}var ho=["addListener","removeListener"],uo=["addEventListener","removeEventListener"],po=["on","off"];function mt(n,e,t,s){if(y(t)&&(s=t,t=void 0),s)return mt(n,e,t).pipe(di(s));var i=Z(mo(n)?uo.map(function(a){return function(l){return n[a](e,l,t)}}):fo(n)?ho.map(tn(n,e)):go(n)?po.map(tn(n,e)):[],2),r=i[0],o=i[1];if(!r&&ws(n))return He(function(a){return mt(a,e,t)})(R(n));if(!r)throw new TypeError("Invalid event target");return new E(function(a){var l=function(){for(var c=[],h=0;h<arguments.length;h++)c[h]=arguments[h];return a.next(1<c.length?c:c[0])};return r(l),function(){return o(l)}})}function tn(n,e){return function(t){return function(s){return n[t](e,s)}}}function fo(n){return y(n.addListener)&&y(n.removeListener)}function go(n){return y(n.on)&&y(n.off)}function mo(n){return y(n.addEventListener)&&y(n.removeEventListener)}function vo(n,e,t){n===void 0&&(n=0),t===void 0&&(t=Rr);var s=-1;return e!=null&&(Jn(e)?t=e:s=e),new E(function(i){var r=Yr(n)?+n-t.now():n;r<0&&(r=0);var o=0;return t.schedule(function(){i.closed||(i.next(o++),0<=s?this.schedule(void 0,s):i.complete())},r)})}function bo(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=xs(n),s=jr(n,1/0),i=n;return i.length?i.length===1?R(i[0]):lo(s)(de(i,t)):Pe}function j(n,e){return M(function(t,s){var i=0;t.subscribe(T(s,function(r){return n.call(e,r,i++)&&s.next(r)}))})}function os(n){return M(function(e,t){var s=null,i=!1,r;s=e.subscribe(T(t,void 0,void 0,function(o){r=R(n(o,os(n)(e))),s?(s.unsubscribe(),s=null,r.subscribe(t)):i=!0})),i&&(s.unsubscribe(),s=null,r.subscribe(t))})}function Wt(n,e){return y(e)?He(n,e,1):He(n,1)}function he(n){return n<=0?function(){return Pe}:M(function(e,t){var s=0;e.subscribe(T(t,function(i){++s<=n&&(t.next(i),n<=s&&t.complete())}))})}function Qt(n){var e,t=1/0,s;return n!=null&&(typeof n=="object"?(e=n.count,t=e===void 0?1/0:e,s=n.delay):t=n),t<=0?function(){return Pe}:M(function(i,r){var o=0,a,l=function(){if(a==null||a.unsubscribe(),a=null,s!=null){var h=typeof s=="number"?vo(s):R(s(o)),u=T(r,function(){u.unsubscribe(),c()});h.subscribe(u)}else c()},c=function(){var h=!1;a=i.subscribe(T(r,void 0,function(){++o<t?a?l():h=!0:r.complete()})),h&&l()};c()})}function se(n,e){return M(function(t,s){var i=null,r=0,o=!1,a=function(){return o&&!i&&s.complete()};t.subscribe(T(s,function(l){i==null||i.unsubscribe();var c=0,h=r++;R(n(l,h)).subscribe(i=T(s,function(u){return s.next(e?e(l,u,h,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function A(n){return M(function(e,t){R(n).subscribe(T(t,function(){return t.complete()},pt)),!t.closed&&e.subscribe(t)})}function yo(n,e,t){var s=y(n)||e||t?{next:n,error:e,complete:t}:n;return s?M(function(i,r){var o;(o=s.subscribe)===null||o===void 0||o.call(s);var a=!0;i.subscribe(T(r,function(l){var c;(c=s.next)===null||c===void 0||c.call(s,l),r.next(l)},function(){var l;a=!1,(l=s.complete)===null||l===void 0||l.call(s),r.complete()},function(l){var c;a=!1,(c=s.error)===null||c===void 0||c.call(s,l),r.error(l)},function(){var l,c;a&&((l=s.unsubscribe)===null||l===void 0||l.call(s)),(c=s.finalize)===null||c===void 0||c.call(s)}))}):Oe}function as(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Xn(n);return M(function(s,i){for(var r=n.length,o=new Array(r),a=n.map(function(){return!1}),l=!1,c=function(u){R(n[u]).subscribe(T(i,function(d){o[u]=d,!l&&!a[u]&&(a[u]=!0,(l=a.every(Oe))&&(a=null))},pt))},h=0;h<r;h++)c(h);s.subscribe(T(i,function(u){if(l){var d=G([u],Z(o));i.next(t?t.apply(void 0,G([],Z(d))):d)}}))})}var O=(n=>(n.User="user",n.Agent="agent",n.System="system",n))(O||{});const pi=()=>crypto.randomUUID();function sn(n){let e=n;const t=/https?:\/\/[^\s<]+/gi,s=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,i=n.match(t)||[],r=[];let o;for(;(o=s.exec(n))!==null;)r.push(o[1]);return i.filter(l=>!r.includes(l)).forEach(l=>{const c=l.endsWith(".")?l.slice(0,-1):l,h=new RegExp(`(?<!<a[^>]*>)${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![^<]*</a>)`,"gi");e=e.replace(h,`<a title='${c}' target='_blank' href='${c}'>${c}</a>`)}),e}function ls(n){if(n.includes("aceChatGuideTitle"))return $o(n);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return n.replace(e,t=>{const s=fi(t);if(!s)return t;const i=50;if(s.length>i){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=s.match(r);if(!o)return t;const a=o[1],c=(o[2]||"/").split("?")[0],h=c.split("/").pop(),u=i-a.length;let d=c;h&&h.length<u&&c.length>u?d=c.substring(0,u-h.length-4)+".../"+h:d=c.substring(0,u-3)+"...";const p=`${a}${d}`;return cs(t,p)}return cs(t,s)})}function fi(n){const e=n.match(/href=["']([^'"]*)["']/);if(e&&e.length>1){let t=e[1];return t.endsWith(".")&&(t=t.slice(0,-1)),t}return null}function cs(n,e){return n.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function $o(n){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return n.replace(e,t=>{const s=fi(t);if(!s)return t;const i=s.split("?").pop(),o=new URLSearchParams(i).get("aceChatGuideTitle");return o?cs(t,o):t})}class U{constructor(e,t,s){this.type=e,this.sender=t,this.messages=s,this.status="delivered",this.didUpdate=new S,this.actions$=new S,this.remove$=new S,this.timestamp=Date.now(),this.id=pi()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class xo{constructor(e){this.name=e,this.print$=new S}print(e,t="html",s=this.name){const i=new U(O.Agent,{name:s},[{items:[[t,{content:e}]]}]);return this.print$.next(i),i}subscribe(){return this.print$.asObservable()}}class wo{constructor(e){this.name=e,this.print$=new S}print(e){const t=new U(O.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class ko{constructor(){this.print$=new S,this.name="system"}print(e){const t=new U(O.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class Co{constructor(e,t){this.name=e,this.component=t,this.print$=new S,this.typingState$=new N(!1),this.complete$=new S,this.system=this.createSystem(),this.rehydrate$=new S,this.saveToCurrentSession$=new S,this.showChatOverlay$=new N(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(he(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(O.User,e.text)}print(e,t){const s=new U(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(s)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new xo(e);return t.subscribe().subscribe(s=>{this.playNotification(),this.printEntry(s)}),t}createUser(e){const t=new wo(e);return t.subscribe().subscribe(s=>{this.printEntry(s)}),t}createSystem(){const e=new ko;return e.subscribe().subscribe(t=>{this.printEntry(t)}),e}setTypingState(e){this.typingState$.next(e)}setToastMessage(e){this.component.setToastMessage(e)}isTyping(){return this.typingState$.asObservable()}actions(){return this.print$.asObservable()}playNotification(){const e="https://publicpoc.blob.core.windows.net/widget-assets/notification.mp3";this.component.application.storage.get("muteAudioNotifications")||new Audio(e).play().catch(s=>{})}complete(){this.complete$.next()}save(e){this.saveToCurrentSession$.next(e)}async rehydrate(e){}}/**
3
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function ut(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var We=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,s,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Se(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var h=this.initialTeardown;if(y(h))try{h()}catch(m){r=m instanceof Bt?m.errors:[m]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Se(u),p=d.next();!p.done;p=d.next()){var b=p.value;try{Ys(b)}catch(m){r=r??[],m instanceof Bt?r=K(K([],Z(r)),Z(m.errors)):r.push(m)}}}catch(m){s={error:m}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(s)throw s.error}}}if(r)throw new Bt(r)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Ys(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&ut(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&ut(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),Zn=We.EMPTY;function Wn(n){return n instanceof We||n&&"closed"in n&&y(n.remove)&&y(n.add)&&y(n.unsubscribe)}function Ys(n){y(n)?n():n.unsubscribe()}var Qn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},es={setTimeout:function(n,e){for(var t=[],s=2;s<arguments.length;s++)t[s-2]=arguments[s];var i=es.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,K([n,e],Z(t))):setTimeout.apply(void 0,K([n,e],Z(t)))},clearTimeout:function(n){var e=es.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(n)},delegate:void 0};function Yn(n){es.setTimeout(function(){throw n})}function dt(){}function ct(n){n()}var vs=function(n){X(e,n);function e(t){var s=n.call(this)||this;return s.isStopped=!1,t?(s.destination=t,Wn(t)&&t.add(s)):s.destination=$r,s}return e.create=function(t,s,i){return new ts(t,s,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(We),vr=Function.prototype.bind;function qt(n,e){return vr.call(n,e)}var br=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(s){rt(s)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(s){rt(s)}else rt(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){rt(t)}},n}(),ts=function(n){X(e,n);function e(t,s,i){var r=n.call(this)||this,o;if(y(t)||!t)o={next:t??void 0,error:s??void 0,complete:i??void 0};else{var a;r&&Qn.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return r.unsubscribe()},o={next:t.next&&qt(t.next,a),error:t.error&&qt(t.error,a),complete:t.complete&&qt(t.complete,a)}):o=t}return r.destination=new br(o),r}return e}(vs);function rt(n){Yn(n)}function yr(n){throw n}var $r={closed:!0,next:dt,error:yr,complete:dt},bs=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Oe(n){return n}function xr(n){return n.length===0?Oe:n.length===1?n[0]:function(t){return n.reduce(function(s,i){return i(s)},t)}}var E=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,s){var i=this,r=kr(e)?e:new ts(e,t,s);return ct(function(){var o=i,a=o.operator,l=o.source;r.add(a?a.call(r,l):l?i._subscribe(r):i._trySubscribe(r))}),r},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var s=this;return t=Gs(t),new t(function(i,r){var o=new ts({next:function(a){try{e(a)}catch(l){r(l),o.unsubscribe()}},error:r,complete:i});s.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[bs]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xr(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=Gs(e),new e(function(s,i){var r;t.subscribe(function(o){return r=o},function(o){return i(o)},function(){return s(r)})})},n.create=function(e){return new n(e)},n}();function Gs(n){var e;return(e=n??Qn.Promise)!==null&&e!==void 0?e:Promise}function wr(n){return n&&y(n.next)&&y(n.error)&&y(n.complete)}function kr(n){return n&&n instanceof vs||wr(n)&&Wn(n)}function Cr(n){return y(n==null?void 0:n.lift)}function j(n){return function(e){if(Cr(e))return e.lift(function(t){try{return n(t,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function T(n,e,t,s,i){return new _r(n,e,t,s,i)}var _r=function(n){X(e,n);function e(t,s,i,r,o,a){var l=n.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=s?function(c){try{s(c)}catch(h){t.error(h)}}:n.prototype._next,l._error=r?function(c){try{r(c)}catch(h){t.error(h)}finally{this.unsubscribe()}}:n.prototype._error,l._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(vs),Sr=Vn(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),S=function(n){X(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var s=new Ks(this,this);return s.operator=t,s},e.prototype._throwIfClosed=function(){if(this.closed)throw new Sr},e.prototype.next=function(t){var s=this;ct(function(){var i,r;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var o=Se(s.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(t)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var s=this;ct(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=t;for(var i=s.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;ct(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var s=t.observers;s.length;)s.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var s=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Zn:(this.currentObservers=null,a.push(t),new We(function(){s.currentObservers=null,ut(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var s=this,i=s.hasError,r=s.thrownError,o=s.isStopped;i?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new E;return t.source=this,t},e.create=function(t,s){return new Ks(t,s)},e}(E),Ks=function(n){X(e,n);function e(t,s){var i=n.call(this)||this;return i.destination=t,i.source=s,i}return e.prototype.next=function(t){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.next)===null||i===void 0||i.call(s,t)},e.prototype.error=function(t){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.error)===null||i===void 0||i.call(s,t)},e.prototype.complete=function(){var t,s;(s=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||s===void 0||s.call(t)},e.prototype._subscribe=function(t){var s,i;return(i=(s=this.source)===null||s===void 0?void 0:s.subscribe(t))!==null&&i!==void 0?i:Zn},e}(S),B=function(n){X(e,n);function e(t){var s=n.call(this)||this;return s._value=t,s}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var s=n.prototype._subscribe.call(this,t);return!s.closed&&t.next(this._value),s},e.prototype.getValue=function(){var t=this,s=t.hasError,i=t.thrownError,r=t._value;if(s)throw i;return this._throwIfClosed(),r},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(S),Gn={now:function(){return(Gn.delegate||Date).now()},delegate:void 0},Er=function(n){X(e,n);function e(t,s){return n.call(this)||this}return e.prototype.schedule=function(t,s){return this},e}(We),pt={setInterval:function(n,e){for(var t=[],s=2;s<arguments.length;s++)t[s-2]=arguments[s];var i=pt.delegate;return i!=null&&i.setInterval?i.setInterval.apply(i,K([n,e],Z(t))):setInterval.apply(void 0,K([n,e],Z(t)))},clearInterval:function(n){var e=pt.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(n)},delegate:void 0},Ar=function(n){X(e,n);function e(t,s){var i=n.call(this,t,s)||this;return i.scheduler=t,i.work=s,i.pending=!1,i}return e.prototype.schedule=function(t,s){var i;if(s===void 0&&(s=0),this.closed)return this;this.state=t;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,s)),this.pending=!0,this.delay=s,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,s),this},e.prototype.requestAsyncId=function(t,s,i){return i===void 0&&(i=0),pt.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,s,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return s;s!=null&&pt.clearInterval(s)},e.prototype.execute=function(t,s){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,s);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,s){var i=!1,r;try{this.work(t)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,s=t.id,i=t.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ut(r,this),s!=null&&(this.id=this.recycleAsyncId(i,s,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e}(Er),Js=function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,s){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(s,t)},n.now=Gn.now,n}(),Tr=function(n){X(e,n);function e(t,s){s===void 0&&(s=Js.now);var i=n.call(this,t,s)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(t){var s=this.actions;if(this._active){s.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=s.shift());if(this._active=!1,i){for(;t=s.shift();)t.unsubscribe();throw i}},e}(Js),Or=new Tr(Ar),Pr=Or,Pe=new E(function(n){return n.complete()});function Kn(n){return n&&y(n.schedule)}function ys(n){return n[n.length-1]}function Jn(n){return y(ys(n))?n.pop():void 0}function $s(n){return Kn(ys(n))?n.pop():void 0}function Lr(n,e){return typeof ys(n)=="number"?n.pop():e}var xs=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function Xn(n){return y(n==null?void 0:n.then)}function ei(n){return y(n[bs])}function ti(n){return Symbol.asyncIterator&&y(n==null?void 0:n[Symbol.asyncIterator])}function si(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ir(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ni=Ir();function ii(n){return y(n==null?void 0:n[ni])}function ri(n){return gr(this,arguments,function(){var t,s,i,r;return Fn(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,ke(t.read())];case 3:return s=o.sent(),i=s.value,r=s.done,r?[4,ke(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,ke(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function oi(n){return y(n==null?void 0:n.getReader)}function R(n){if(n instanceof E)return n;if(n!=null){if(ei(n))return Rr(n);if(xs(n))return Mr(n);if(Xn(n))return jr(n);if(ti(n))return ai(n);if(ii(n))return Ur(n);if(oi(n))return zr(n)}throw si(n)}function Rr(n){return new E(function(e){var t=n[bs]();if(y(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Mr(n){return new E(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function jr(n){return new E(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Yn)})}function Ur(n){return new E(function(e){var t,s;try{for(var i=Se(n),r=i.next();!r.done;r=i.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{r&&!r.done&&(s=i.return)&&s.call(i)}finally{if(t)throw t.error}}e.complete()})}function ai(n){return new E(function(e){Dr(n,e).catch(function(t){return e.error(t)})})}function zr(n){return ai(ri(n))}function Dr(n,e){var t,s,i,r;return fr(this,void 0,void 0,function(){var o,a;return Fn(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=mr(n),l.label=1;case 1:return[4,t.next()];case 2:if(s=l.sent(),!!s.done)return[3,4];if(o=s.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),s&&!s.done&&(r=t.return)?[4,r.call(t)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function G(n,e,t,s,i){s===void 0&&(s=0),i===void 0&&(i=!1);var r=e.schedule(function(){t(),i?n.add(this.schedule(null,s)):this.unsubscribe()},s);if(n.add(r),!i)return r}function li(n,e){return e===void 0&&(e=0),j(function(t,s){t.subscribe(T(s,function(i){return G(s,n,function(){return s.next(i)},e)},function(){return G(s,n,function(){return s.complete()},e)},function(i){return G(s,n,function(){return s.error(i)},e)}))})}function ci(n,e){return e===void 0&&(e=0),j(function(t,s){s.add(n.schedule(function(){return t.subscribe(s)},e))})}function Hr(n,e){return R(n).pipe(ci(e),li(e))}function Nr(n,e){return R(n).pipe(ci(e),li(e))}function Br(n,e){return new E(function(t){var s=0;return e.schedule(function(){s===n.length?t.complete():(t.next(n[s++]),t.closed||this.schedule())})})}function qr(n,e){return new E(function(t){var s;return G(t,e,function(){s=n[ni](),G(t,e,function(){var i,r,o;try{i=s.next(),r=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return y(s==null?void 0:s.return)&&s.return()}})}function hi(n,e){if(!n)throw new Error("Iterable cannot be null");return new E(function(t){G(t,e,function(){var s=n[Symbol.asyncIterator]();G(t,e,function(){s.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function Fr(n,e){return hi(ri(n),e)}function Vr(n,e){if(n!=null){if(ei(n))return Hr(n,e);if(xs(n))return Br(n,e);if(Xn(n))return Nr(n,e);if(ti(n))return hi(n,e);if(ii(n))return qr(n,e);if(oi(n))return Fr(n,e)}throw si(n)}function pe(n,e){return e?Vr(n,e):R(n)}function ss(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=$s(n);return pe(n,t)}function Zr(n){return n instanceof Date&&!isNaN(n)}function ft(n,e){return j(function(t,s){var i=0;t.subscribe(T(s,function(r){s.next(n.call(e,r,i++))}))})}var Wr=Array.isArray;function Qr(n,e){return Wr(e)?n.apply(void 0,K([],Z(e))):n(e)}function ui(n){return ft(function(e){return Qr(n,e)})}var Yr=Array.isArray,Gr=Object.getPrototypeOf,Kr=Object.prototype,Jr=Object.keys;function Xr(n){if(n.length===1){var e=n[0];if(Yr(e))return{args:e,keys:null};if(eo(e)){var t=Jr(e);return{args:t.map(function(s){return e[s]}),keys:t}}}return{args:n,keys:null}}function eo(n){return n&&typeof n=="object"&&Gr(n)===Kr}function to(n,e){return n.reduce(function(t,s,i){return t[s]=e[i],t},{})}function so(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=$s(n),s=Jn(n),i=Xr(n),r=i.args,o=i.keys;if(r.length===0)return pe([],t);var a=new E(no(r,t,o?function(l){return to(o,l)}:Oe));return s?a.pipe(ui(s)):a}function no(n,e,t){return t===void 0&&(t=Oe),function(s){Xs(e,function(){for(var i=n.length,r=new Array(i),o=i,a=i,l=function(h){Xs(e,function(){var u=pe(n[h],e),d=!1;u.subscribe(T(s,function(p){r[h]=p,d||(d=!0,a--),a||s.next(t(r.slice()))},function(){--o||s.complete()}))},s)},c=0;c<i;c++)l(c)},s)}}function Xs(n,e,t){n?G(t,n,e):e()}function io(n,e,t,s,i,r,o,a){var l=[],c=0,h=0,u=!1,d=function(){u&&!l.length&&!c&&e.complete()},p=function(m){return c<s?b(m):l.push(m)},b=function(m){r&&e.next(m),c++;var D=!1;R(t(m,h++)).subscribe(T(e,function(W){i==null||i(W),r?p(W):e.next(W)},function(){D=!0},void 0,function(){if(D)try{c--;for(var W=function(){var le=l.shift();o?G(e,o,function(){return b(le)}):b(le)};l.length&&c<s;)W();d()}catch(le){e.error(le)}}))};return n.subscribe(T(e,p,function(){u=!0,d()})),function(){a==null||a()}}function De(n,e,t){return t===void 0&&(t=1/0),y(e)?De(function(s,i){return ft(function(r,o){return e(s,r,i,o)})(R(n(s,i)))},t):(typeof e=="number"&&(t=e),j(function(s,i){return io(s,i,n,t)}))}function ro(n){return n===void 0&&(n=1/0),De(Oe,n)}function oo(n){return new E(function(e){R(n()).subscribe(e)})}var ao=["addListener","removeListener"],lo=["addEventListener","removeEventListener"],co=["on","off"];function gt(n,e,t,s){if(y(t)&&(s=t,t=void 0),s)return gt(n,e,t).pipe(ui(s));var i=Z(po(n)?lo.map(function(a){return function(l){return n[a](e,l,t)}}):ho(n)?ao.map(en(n,e)):uo(n)?co.map(en(n,e)):[],2),r=i[0],o=i[1];if(!r&&xs(n))return De(function(a){return gt(a,e,t)})(R(n));if(!r)throw new TypeError("Invalid event target");return new E(function(a){var l=function(){for(var c=[],h=0;h<arguments.length;h++)c[h]=arguments[h];return a.next(1<c.length?c:c[0])};return r(l),function(){return o(l)}})}function en(n,e){return function(t){return function(s){return n[t](e,s)}}}function ho(n){return y(n.addListener)&&y(n.removeListener)}function uo(n){return y(n.on)&&y(n.off)}function po(n){return y(n.addEventListener)&&y(n.removeEventListener)}function fo(n,e,t){n===void 0&&(n=0),t===void 0&&(t=Pr);var s=-1;return e!=null&&(Kn(e)?t=e:s=e),new E(function(i){var r=Zr(n)?+n-t.now():n;r<0&&(r=0);var o=0;return t.schedule(function(){i.closed||(i.next(o++),0<=s?this.schedule(void 0,s):i.complete())},r)})}function go(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=$s(n),s=Lr(n,1/0),i=n;return i.length?i.length===1?R(i[0]):ro(s)(pe(i,t)):Pe}function M(n,e){return j(function(t,s){var i=0;t.subscribe(T(s,function(r){return n.call(e,r,i++)&&s.next(r)}))})}function ns(n){return j(function(e,t){var s=null,i=!1,r;s=e.subscribe(T(t,void 0,void 0,function(o){r=R(n(o,ns(n)(e))),s?(s.unsubscribe(),s=null,r.subscribe(t)):i=!0})),i&&(s.unsubscribe(),s=null,r.subscribe(t))})}function Ft(n,e){return y(e)?De(n,e,1):De(n,1)}function ue(n){return n<=0?function(){return Pe}:j(function(e,t){var s=0;e.subscribe(T(t,function(i){++s<=n&&(t.next(i),n<=s&&t.complete())}))})}function Vt(n){var e,t=1/0,s;return n!=null&&(typeof n=="object"?(e=n.count,t=e===void 0?1/0:e,s=n.delay):t=n),t<=0?function(){return Pe}:j(function(i,r){var o=0,a,l=function(){if(a==null||a.unsubscribe(),a=null,s!=null){var h=typeof s=="number"?fo(s):R(s(o)),u=T(r,function(){u.unsubscribe(),c()});h.subscribe(u)}else c()},c=function(){var h=!1;a=i.subscribe(T(r,void 0,function(){++o<t?a?l():h=!0:r.complete()})),h&&l()};c()})}function ne(n,e){return j(function(t,s){var i=null,r=0,o=!1,a=function(){return o&&!i&&s.complete()};t.subscribe(T(s,function(l){i==null||i.unsubscribe();var c=0,h=r++;R(n(l,h)).subscribe(i=T(s,function(u){return s.next(e?e(l,u,h,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function A(n){return j(function(e,t){R(n).subscribe(T(t,function(){return t.complete()},dt)),!t.closed&&e.subscribe(t)})}function mo(n,e,t){var s=y(n)||e||t?{next:n,error:e,complete:t}:n;return s?j(function(i,r){var o;(o=s.subscribe)===null||o===void 0||o.call(s);var a=!0;i.subscribe(T(r,function(l){var c;(c=s.next)===null||c===void 0||c.call(s,l),r.next(l)},function(){var l;a=!1,(l=s.complete)===null||l===void 0||l.call(s),r.complete()},function(l){var c;a=!1,(c=s.error)===null||c===void 0||c.call(s,l),r.error(l)},function(){var l,c;a&&((l=s.unsubscribe)===null||l===void 0||l.call(s)),(c=s.finalize)===null||c===void 0||c.call(s)}))}):Oe}function is(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Jn(n);return j(function(s,i){for(var r=n.length,o=new Array(r),a=n.map(function(){return!1}),l=!1,c=function(u){R(n[u]).subscribe(T(i,function(d){o[u]=d,!l&&!a[u]&&(a[u]=!0,(l=a.every(Oe))&&(a=null))},dt))},h=0;h<r;h++)c(h);s.subscribe(T(i,function(u){if(l){var d=K([u],Z(o));i.next(t?t.apply(void 0,K([],Z(d))):d)}}))})}var O=(n=>(n.User="user",n.Agent="agent",n.System="system",n))(O||{});const di=()=>crypto.randomUUID();function tn(n){let e=n;const t=/https?:\/\/[^\s<]+/gi,s=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,i=n.match(t)||[],r=[];let o;for(;(o=s.exec(n))!==null;)r.push(o[1]);return i.filter(l=>!r.includes(l)).forEach(l=>{const c=l.endsWith(".")?l.slice(0,-1):l,h=new RegExp(`(?<!<a[^>]*>)${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![^<]*</a>)`,"gi");e=e.replace(h,`<a title='${c}' target='_blank' href='${c}'>${c}</a>`)}),e}function rs(n){if(n.includes("aceChatGuideTitle"))return vo(n);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return n.replace(e,t=>{const s=pi(t);if(!s)return t;const i=50;if(s.length>i){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=s.match(r);if(!o)return t;const a=o[1],c=(o[2]||"/").split("?")[0],h=c.split("/").pop(),u=i-a.length;let d=c;h&&h.length<u&&c.length>u?d=c.substring(0,u-h.length-4)+".../"+h:d=c.substring(0,u-3)+"...";const p=`${a}${d}`;return os(t,p)}return os(t,s)})}function pi(n){const e=n.match(/href=["']([^'"]*)["']/);if(e&&e.length>1){let t=e[1];return t.endsWith(".")&&(t=t.slice(0,-1)),t}return null}function os(n,e){return n.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function vo(n){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return n.replace(e,t=>{const s=pi(t);if(!s)return t;const i=s.split("?").pop(),o=new URLSearchParams(i).get("aceChatGuideTitle");return o?os(t,o):t})}class U{constructor(e,t,s){this.type=e,this.sender=t,this.messages=s,this.status="delivered",this.didUpdate=new S,this.actions$=new S,this.remove$=new S,this.timestamp=Date.now(),this.id=di()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class bo{constructor(e){this.name=e,this.print$=new S}print(e,t="html",s=this.name){const i=new U(O.Agent,{name:s},[{items:[[t,{content:e}]]}]);return this.print$.next(i),i}subscribe(){return this.print$.asObservable()}}class yo{constructor(e){this.name=e,this.print$=new S}print(e){const t=new U(O.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class $o{constructor(){this.print$=new S,this.name="system"}print(e){const t=new U(O.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class xo{constructor(e,t){this.name=e,this.component=t,this.print$=new S,this.typingState$=new B(!1),this.complete$=new S,this.system=this.createSystem(),this.rehydrate$=new S,this.saveToCurrentSession$=new S,this.showChatOverlay$=new B(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(ue(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(O.User,e.text)}print(e,t){const s=new U(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(s)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new bo(e);return t.subscribe().subscribe(s=>{this.playNotification(),this.printEntry(s)}),t}createUser(e){const t=new yo(e);return t.subscribe().subscribe(s=>{this.printEntry(s)}),t}createSystem(){const e=new $o;return e.subscribe().subscribe(t=>{this.printEntry(t)}),e}setTypingState(e){this.typingState$.next(e)}setToastMessage(e){this.component.setToastMessage(e)}isTyping(){return this.typingState$.asObservable()}actions(){return this.print$.asObservable()}playNotification(){const e="https://publicpoc.blob.core.windows.net/widget-assets/notification.mp3";this.component.application.storage.get("muteAudioNotifications")||new Audio(e).play().catch(s=>{})}complete(){this.complete$.next()}save(e){this.saveToCurrentSession$.next(e)}async rehydrate(e){}}/**
4
4
  * @license
5
5
  * Copyright 2019 Google LLC
6
6
  * SPDX-License-Identifier: BSD-3-Clause
7
- */const ut=globalThis,ks=ut.ShadowRoot&&(ut.ShadyCSS===void 0||ut.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Cs=Symbol(),nn=new WeakMap;let gi=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==Cs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ks&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=nn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&nn.set(t,e))}return e}toString(){return this.cssText}};const _o=n=>new gi(typeof n=="string"?n:n+"",void 0,Cs),_=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((s,i,r)=>s+(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.")})(i)+n[r+1],n[0]);return new gi(t,n,Cs)},So=(n,e)=>{if(ks)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=ut.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,n.appendChild(s)}},rn=ks?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return _o(t)})(n):n;/**
7
+ */const ht=globalThis,ws=ht.ShadowRoot&&(ht.ShadyCSS===void 0||ht.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ks=Symbol(),sn=new WeakMap;let fi=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==ks)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ws&&e===void 0){const s=t!==void 0&&t.length===1;s&&(e=sn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&sn.set(t,e))}return e}toString(){return this.cssText}};const wo=n=>new fi(typeof n=="string"?n:n+"",void 0,ks),_=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((s,i,r)=>s+(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.")})(i)+n[r+1],n[0]);return new fi(t,n,ks)},ko=(n,e)=>{if(ws)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const s=document.createElement("style"),i=ht.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=t.cssText,n.appendChild(s)}},nn=ws?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return wo(t)})(n):n;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */const{is:Eo,defineProperty:Ao,getOwnPropertyDescriptor:To,getOwnPropertyNames:Oo,getOwnPropertySymbols:Po,getPrototypeOf:Lo}=Object,ne=globalThis,on=ne.trustedTypes,Io=on?on.emptyScript:"",Yt=ne.reactiveElementPolyfillSupport,je=(n,e)=>n,vt={toAttribute(n,e){switch(e){case Boolean:n=n?Io:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},_s=(n,e)=>!Eo(n,e),an={attribute:!0,type:String,converter:vt,reflect:!1,hasChanged:_s};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ne.litPropertyMetadata??(ne.litPropertyMetadata=new WeakMap);let ye=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=an){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&Ao(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:r}=To(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const a=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??an}static _$Ei(){if(this.hasOwnProperty(je("elementProperties")))return;const e=Lo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(je("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(je("properties"))){const t=this.properties,s=[...Oo(t),...Po(t)];for(const i of s)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)t.unshift(rn(i))}else e!==void 0&&t.push(rn(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return So(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostConnected)==null?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostDisconnected)==null?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$EC(e,t){var r;const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:vt).toAttribute(t,s.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var r;const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:vt;this._$Em=i,this[i]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??_s)(this[e],t))return;this.P(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,s){this._$AL.has(e)||this._$AL.set(e,t),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};ye.elementStyles=[],ye.shadowRootOptions={mode:"open"},ye[je("elementProperties")]=new Map,ye[je("finalized")]=new Map,Yt==null||Yt({ReactiveElement:ye}),(ne.reactiveElementVersions??(ne.reactiveElementVersions=[])).push("2.0.4");/**
11
+ */const{is:Co,defineProperty:_o,getOwnPropertyDescriptor:So,getOwnPropertyNames:Eo,getOwnPropertySymbols:Ao,getPrototypeOf:To}=Object,ie=globalThis,rn=ie.trustedTypes,Oo=rn?rn.emptyScript:"",Zt=ie.reactiveElementPolyfillSupport,Re=(n,e)=>n,mt={toAttribute(n,e){switch(e){case Boolean:n=n?Oo:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Cs=(n,e)=>!Co(n,e),on={attribute:!0,type:String,converter:mt,reflect:!1,hasChanged:Cs};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ie.litPropertyMetadata??(ie.litPropertyMetadata=new WeakMap);let ye=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=on){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);i!==void 0&&_o(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:r}=So(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const a=i==null?void 0:i.call(this);r.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??on}static _$Ei(){if(this.hasOwnProperty(Re("elementProperties")))return;const e=To(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Re("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Re("properties"))){const t=this.properties,s=[...Eo(t),...Ao(t)];for(const i of s)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[s,i]of t)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)t.unshift(nn(i))}else e!==void 0&&t.push(nn(e));return t}static _$Eu(e,t){const s=t.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ko(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostConnected)==null?void 0:s.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var s;return(s=t.hostDisconnected)==null?void 0:s.call(t)})}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$EC(e,t){var r;const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const o=(((r=s.converter)==null?void 0:r.toAttribute)!==void 0?s.converter:mt).toAttribute(t,s.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,t){var r;const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=s.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:mt;this._$Em=i,this[i]=a.fromAttribute(t,o.type),this._$Em=null}}requestUpdate(e,t,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??Cs)(this[e],t))return;this.P(e,t,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,s){this._$AL.has(e)||this._$AL.set(e,t),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,o]of i)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(s=this._$EO)==null||s.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}};ye.elementStyles=[],ye.shadowRootOptions={mode:"open"},ye[Re("elementProperties")]=new Map,ye[Re("finalized")]=new Map,Zt==null||Zt({ReactiveElement:ye}),(ie.reactiveElementVersions??(ie.reactiveElementVersions=[])).push("2.0.4");/**
12
12
  * @license
13
13
  * Copyright 2017 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
- */const Me=globalThis,bt=Me.trustedTypes,ln=bt?bt.createPolicy("lit-html",{createHTML:n=>n}):void 0,mi="$lit$",ee=`lit$${(Math.random()+"").slice(9)}$`,vi="?"+ee,Ro=`<${vi}>`,pe=document,Be=()=>pe.createComment(""),Ne=n=>n===null||typeof n!="object"&&typeof n!="function",bi=Array.isArray,jo=n=>bi(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Gt=`[
16
- \f\r]`,Ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,cn=/-->/g,hn=/>/g,le=RegExp(`>|${Gt}(?:([^\\s"'>=/]+)(${Gt}*=${Gt}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),un=/'/g,dn=/"/g,yi=/^(?:script|style|textarea|title)$/i,Mo=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),f=Mo(1),K=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),pn=new WeakMap,ue=pe.createTreeWalker(pe,129);function $i(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return ln!==void 0?ln.createHTML(e):e}const Uo=(n,e)=>{const t=n.length-1,s=[];let i,r=e===2?"<svg>":"",o=Ie;for(let a=0;a<t;a++){const l=n[a];let c,h,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,h=o.exec(l),h!==null);)d=o.lastIndex,o===Ie?h[1]==="!--"?o=cn:h[1]!==void 0?o=hn:h[2]!==void 0?(yi.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=le):h[3]!==void 0&&(o=le):o===le?h[0]===">"?(o=i??Ie,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?le:h[3]==='"'?dn:un):o===dn||o===un?o=le:o===cn||o===hn?o=Ie:(o=le,i=void 0);const p=o===le&&n[a+1].startsWith("/>")?" ":"";r+=o===Ie?l+Ro:u>=0?(s.push(c),l.slice(0,u)+mi+l.slice(u)+ee+p):l+ee+(u===-2?a:p)}return[$i(n,r+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};class qe{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,h]=Uo(e,t);if(this.el=qe.createElement(c,s),ue.currentNode=this.el.content,t===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=ue.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(mi)){const d=h[o++],p=i.getAttribute(u).split(ee),b=/([.?@])?(.*)/.exec(d);l.push({type:1,index:r,name:b[2],strings:p,ctor:b[1]==="."?Do:b[1]==="?"?Ho:b[1]==="@"?Bo:It}),i.removeAttribute(u)}else u.startsWith(ee)&&(l.push({type:6,index:r}),i.removeAttribute(u));if(yi.test(i.tagName)){const u=i.textContent.split(ee),d=u.length-1;if(d>0){i.textContent=bt?bt.emptyScript:"";for(let p=0;p<d;p++)i.append(u[p],Be()),ue.nextNode(),l.push({type:2,index:++r});i.append(u[d],Be())}}}else if(i.nodeType===8)if(i.data===vi)l.push({type:2,index:r});else{let u=-1;for(;(u=i.data.indexOf(ee,u+1))!==-1;)l.push({type:7,index:r}),u+=ee.length-1}r++}}static createElement(e,t){const s=pe.createElement("template");return s.innerHTML=e,s}}function Ee(n,e,t=n,s){var o,a;if(e===K)return e;let i=s!==void 0?(o=t._$Co)==null?void 0:o[s]:t._$Cl;const r=Ne(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=i:t._$Cl=i),i!==void 0&&(e=Ee(n,i._$AS(n,e.values),i,s)),e}class zo{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=((e==null?void 0:e.creationScope)??pe).importNode(t,!0);ue.currentNode=i;let r=ue.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ye(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new No(r,this,e)),this._$AV.push(c),l=s[++a]}o!==(l==null?void 0:l.index)&&(r=ue.nextNode(),o++)}return ue.currentNode=pe,i}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class Ye{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ee(this,e,t),Ne(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==K&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):jo(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==g&&Ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(pe.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=qe.createElement($i(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(t);else{const o=new zo(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=pn.get(e.strings);return t===void 0&&pn.set(e.strings,t=new qe(e)),t}k(e){bi(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const r of e)i===t.length?t.push(s=new Ye(this.S(Be()),this.S(Be()),this,this.options)):s=t[i],s._$AI(r),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class It{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(e,t=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=Ee(this,e,t,0),o=!Ne(e)||e!==this._$AH&&e!==K,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=Ee(this,a[s+l],t,l),c===K&&(c=this._$AH[l]),o||(o=!Ne(c)||c!==this._$AH[l]),c===g?e=g:e!==g&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Do extends It{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}}let Ho=class extends It{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}};class Bo extends It{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=Ee(this,e,t,0)??g)===K)return;const s=this._$AH,i=e===g&&s!==g||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==g&&(s===g||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class No{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Ee(this,e)}}const Kt=Me.litHtmlPolyfillSupport;Kt==null||Kt(qe,Ye),(Me.litHtmlVersions??(Me.litHtmlVersions=[])).push("3.1.2");const qo=(n,e,t)=>{const s=(t==null?void 0:t.renderBefore)??e;let i=s._$litPart$;if(i===void 0){const r=(t==null?void 0:t.renderBefore)??null;s._$litPart$=i=new Ye(e.insertBefore(Be(),r),r,void 0,t??{})}return i._$AI(n),i};/**
15
+ */const Me=globalThis,vt=Me.trustedTypes,an=vt?vt.createPolicy("lit-html",{createHTML:n=>n}):void 0,gi="$lit$",te=`lit$${(Math.random()+"").slice(9)}$`,mi="?"+te,Po=`<${mi}>`,fe=document,He=()=>fe.createComment(""),Ne=n=>n===null||typeof n!="object"&&typeof n!="function",vi=Array.isArray,Lo=n=>vi(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Wt=`[
16
+ \f\r]`,Le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ln=/-->/g,cn=/>/g,ce=RegExp(`>|${Wt}(?:([^\\s"'>=/]+)(${Wt}*=${Wt}*(?:[^
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),hn=/'/g,un=/"/g,bi=/^(?:script|style|textarea|title)$/i,Io=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),f=Io(1),J=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),dn=new WeakMap,de=fe.createTreeWalker(fe,129);function yi(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return an!==void 0?an.createHTML(e):e}const Ro=(n,e)=>{const t=n.length-1,s=[];let i,r=e===2?"<svg>":"",o=Le;for(let a=0;a<t;a++){const l=n[a];let c,h,u=-1,d=0;for(;d<l.length&&(o.lastIndex=d,h=o.exec(l),h!==null);)d=o.lastIndex,o===Le?h[1]==="!--"?o=ln:h[1]!==void 0?o=cn:h[2]!==void 0?(bi.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=ce):h[3]!==void 0&&(o=ce):o===ce?h[0]===">"?(o=i??Le,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,c=h[1],o=h[3]===void 0?ce:h[3]==='"'?un:hn):o===un||o===hn?o=ce:o===ln||o===cn?o=Le:(o=ce,i=void 0);const p=o===ce&&n[a+1].startsWith("/>")?" ":"";r+=o===Le?l+Po:u>=0?(s.push(c),l.slice(0,u)+gi+l.slice(u)+te+p):l+te+(u===-2?a:p)}return[yi(n,r+(n[t]||"<?>")+(e===2?"</svg>":"")),s]};class Be{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,h]=Ro(e,t);if(this.el=Be.createElement(c,s),de.currentNode=this.el.content,t===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=de.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(gi)){const d=h[o++],p=i.getAttribute(u).split(te),b=/([.?@])?(.*)/.exec(d);l.push({type:1,index:r,name:b[2],strings:p,ctor:b[1]==="."?jo:b[1]==="?"?Uo:b[1]==="@"?zo:Ot}),i.removeAttribute(u)}else u.startsWith(te)&&(l.push({type:6,index:r}),i.removeAttribute(u));if(bi.test(i.tagName)){const u=i.textContent.split(te),d=u.length-1;if(d>0){i.textContent=vt?vt.emptyScript:"";for(let p=0;p<d;p++)i.append(u[p],He()),de.nextNode(),l.push({type:2,index:++r});i.append(u[d],He())}}}else if(i.nodeType===8)if(i.data===mi)l.push({type:2,index:r});else{let u=-1;for(;(u=i.data.indexOf(te,u+1))!==-1;)l.push({type:7,index:r}),u+=te.length-1}r++}}static createElement(e,t){const s=fe.createElement("template");return s.innerHTML=e,s}}function Ee(n,e,t=n,s){var o,a;if(e===J)return e;let i=s!==void 0?(o=t._$Co)==null?void 0:o[s]:t._$Cl;const r=Ne(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),r===void 0?i=void 0:(i=new r(n),i._$AT(n,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=i:t._$Cl=i),i!==void 0&&(e=Ee(n,i._$AS(n,e.values),i,s)),e}class Mo{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=((e==null?void 0:e.creationScope)??fe).importNode(t,!0);de.currentNode=i;let r=de.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Qe(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new Do(r,this,e)),this._$AV.push(c),l=s[++a]}o!==(l==null?void 0:l.index)&&(r=de.nextNode(),o++)}return de.currentNode=fe,i}p(e){let t=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class Qe{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ee(this,e,t),Ne(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==J&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Lo(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==g&&Ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(fe.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=Be.createElement(yi(s.h,s.h[0]),this.options)),s);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(t);else{const o=new Mo(i,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=dn.get(e.strings);return t===void 0&&dn.set(e.strings,t=new Be(e)),t}k(e){vi(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const r of e)i===t.length?t.push(s=new Qe(this.S(He()),this.S(He()),this,this.options)):s=t[i],s._$AI(r),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Ot{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,r){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(e,t=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=Ee(this,e,t,0),o=!Ne(e)||e!==this._$AH&&e!==J,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=Ee(this,a[s+l],t,l),c===J&&(c=this._$AH[l]),o||(o=!Ne(c)||c!==this._$AH[l]),c===g?e=g:e!==g&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class jo extends Ot{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}}let Uo=class extends Ot{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}};class zo extends Ot{constructor(e,t,s,i,r){super(e,t,s,i,r),this.type=5}_$AI(e,t=this){if((e=Ee(this,e,t,0)??g)===J)return;const s=this._$AH,i=e===g&&s!==g||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==g&&(s===g||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class Do{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Ee(this,e)}}const Qt=Me.litHtmlPolyfillSupport;Qt==null||Qt(Be,Qe),(Me.litHtmlVersions??(Me.litHtmlVersions=[])).push("3.1.2");const Ho=(n,e,t)=>{const s=(t==null?void 0:t.renderBefore)??e;let i=s._$litPart$;if(i===void 0){const r=(t==null?void 0:t.renderBefore)??null;s._$litPart$=i=new Qe(e.insertBefore(He(),r),r,void 0,t??{})}return i._$AI(n),i};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */let k=class extends ye{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qo(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return K}};var Vn;k._$litElement$=!0,k.finalized=!0,(Vn=globalThis.litElementHydrateSupport)==null||Vn.call(globalThis,{LitElement:k});const Jt=globalThis.litElementPolyfillSupport;Jt==null||Jt({LitElement:k});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");const Vo={name:"alert",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 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4.01731 47.4568 16.5432 59.9827 32 60ZM32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6923 45.0849 45.0849 55.6923 32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.32247 18.9212 18.9212 8.32247 32 8.30769Z"/><path d="M29.3491 38.6031V20.6807C29.348 19.8662 29.4903 19.0598 29.7675 18.3096C29.9945 17.6371 30.3484 17.0302 30.804 16.5322C31.1251 16.1524 31.5593 15.9246 32.0204 15.894C32.6852 15.894 33.3496 16.471 34.0134 17.625C34.3738 18.1337 34.5955 18.7525 34.6509 19.4042V37.3267C34.6509 37.9947 34.2454 38.6329 33.4345 39.2414C32.6632 39.835 31.7547 40.1521 30.825 40.1523C29.8423 40.1524 29.3503 39.636 29.3491 38.6031Z"/><path d="M33.66 44.6959C33.9649 45.0866 34.161 45.551 34.2284 46.0419C34.2284 46.5397 33.8893 47.0083 33.2109 47.4476C32.5638 47.8771 31.8043 48.1062 31.0275 48.1061C30.1902 48.1061 29.7716 47.7271 29.7716 46.9693C29.7703 46.3788 29.8874 45.7941 30.116 45.2496C30.3064 44.7579 30.6022 44.3138 30.9826 43.9487C31.2626 43.6591 31.6427 43.4875 32.045 43.4692C32.5635 43.4692 33.1019 43.8781 33.66 44.6959Z"/></svg>'},Fo={name:"check-circle-filled",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.9829 16.5431 47.4569 4.01712 32 4ZM44.5613 24.5793L31.6382 43.9639C31.2806 44.5011 30.7008 44.8493 30.0586 44.9126C29.988 44.9197 29.9171 44.9232 29.8462 44.9231C29.275 44.9229 28.7272 44.696 28.3233 44.2921L19.7079 35.6767C19.1639 35.1326 18.9514 34.3396 19.1505 33.5964C19.3497 32.8533 19.9302 32.2728 20.6734 32.0736C21.4166 31.8745 22.2095 32.087 22.7536 32.631L29.5117 39.3881L40.9772 22.1899C41.4016 21.5439 42.1396 21.1749 42.9111 21.2229C43.6825 21.2709 44.3691 21.7286 44.7101 22.4223C45.0511 23.1159 44.9944 23.9391 44.5613 24.5793Z"/></svg>'},Zo={name:"check-circle",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9998 4C16.5358 4 3.99976 16.536 3.99976 32C3.99976 47.464 16.5358 60 31.9998 60C47.4637 60 59.9998 47.464 59.9998 32C59.9826 16.5431 47.4566 4.01712 31.9998 4ZM31.9998 55.6923C18.9149 55.6923 8.30745 45.0849 8.30745 32C8.30745 18.9151 18.9149 8.30769 31.9998 8.30769C45.0847 8.30769 55.6921 18.9151 55.6921 32C55.6773 45.0788 45.0785 55.6775 31.9998 55.6923ZM44.5611 24.5793L31.638 43.9639C31.2804 44.5011 30.7005 44.8493 30.0584 44.9126C29.9878 44.9197 29.9169 44.9232 29.8459 44.9231C29.2747 44.9229 28.727 44.696 28.3231 44.2921L19.7077 35.6767C19.1636 35.1326 18.9512 34.3396 19.1503 33.5964C19.3494 32.8533 19.9299 32.2728 20.6731 32.0736C21.4163 31.8745 22.2093 32.087 22.7534 32.631L29.5115 39.3881L40.9769 22.1899C41.4013 21.5439 42.1394 21.1749 42.9108 21.2229C43.6823 21.2709 44.3688 21.7286 44.7099 22.4223C45.0509 23.1159 44.9941 23.9391 44.5611 24.5793Z"/></svg>'},Wo={name:"checkmark",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M57.5438 13.4967L28.717 50.5596C27.9537 51.5407 26.8061 52.147 25.5654 52.2248C25.4755 52.2301 25.3856 52.2332 25.2967 52.2332C24.1476 52.233 23.0455 51.7763 22.233 50.9637L6.63458 35.3654C6.08729 34.8181 5.87354 34.0204 6.07387 33.2728C6.27419 32.5252 6.85815 31.9412 7.60577 31.7409C8.35339 31.5406 9.15109 31.7543 9.69838 32.3016L25.2967 47.8999L54.1225 10.837C54.5976 10.2258 55.3626 9.91453 56.1295 10.0204C56.8963 10.1263 57.5484 10.6332 57.8402 11.3502C58.1319 12.0673 58.0189 12.8855 57.5438 13.4967Z"/></svg>'},Qo={name:"chevron-down",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.0318 24.8653L33.5318 44.3653C33.1256 44.7717 32.5745 45.0001 31.9999 45.0001C31.4253 45.0001 30.8742 44.7717 30.468 44.3653L10.968 24.8653C10.122 24.0193 10.122 22.6476 10.968 21.8015C11.8141 20.9555 13.1858 20.9555 14.0318 21.8015L31.9999 39.7696L49.968 21.8015C50.8141 20.9555 52.1858 20.9555 53.0318 21.8015C53.8779 22.6476 53.8779 24.0193 53.0318 24.8653Z"/></svg>'},Yo={name:"close-circle",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 56C45.2548 56 56 45.2548 56 32C56 18.7452 45.2548 8 32 8C18.7452 8 8 18.7452 8 32C8 45.2548 18.7452 56 32 56ZM32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60Z"/><path d="M25.2772 22.695C24.5164 21.8942 23.2505 21.8617 22.4497 22.6225C21.6488 23.3833 21.6164 24.6492 22.3772 25.45L29.2411 32.6752L22.4773 39.795C21.7166 40.5958 21.749 41.8617 22.5498 42.6225C23.3507 43.3833 24.6166 43.3508 25.3773 42.55L31.9998 35.5791L38.6222 42.55C39.3829 43.3508 40.6488 43.3833 41.4497 42.6225C42.2505 41.8617 42.2829 40.5958 41.5222 39.795L34.7584 32.6752L41.6223 25.45C42.3831 24.6492 42.3507 23.3833 41.5498 22.6225C40.749 21.8617 39.4831 21.8942 38.7224 22.695L31.9998 29.7714L25.2772 22.695Z"/></svg>'},Ss={name:"close",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.365 48.3012C51.9123 48.8485 52.1261 49.6462 51.9258 50.3939C51.7254 51.1415 51.1415 51.7254 50.3939 51.9258C49.6462 52.1261 48.8485 51.9123 48.3012 51.365L32.4998 35.5636L16.6984 51.365C16.1511 51.9123 15.3534 52.1261 14.6058 51.9258C13.8581 51.7254 13.2742 51.1415 13.0739 50.3939C12.8735 49.6462 13.0873 48.8485 13.6346 48.3012L29.436 32.4998L13.6346 16.6984C13.0873 16.1511 12.8735 15.3534 13.0739 14.6058C13.2742 13.8581 13.8581 13.2742 14.6058 13.0739C15.3534 12.8735 16.1511 13.0873 16.6984 13.6346L32.4998 29.436L48.3012 13.6346C49.1473 12.7885 50.519 12.7885 51.365 13.6346C52.2111 14.4806 52.2111 15.8523 51.365 16.6984L35.5636 32.4998L51.365 48.3012Z"/></svg>'},Go={name:"external",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M59.9139 23.8477V7.90923C59.902 5.75094 58.1522 4.00588 55.9939 4H40.0554C38.8659 4 37.9016 4.96431 37.9016 6.15385C37.9016 7.34338 38.8659 8.30769 40.0554 8.30769H52.4616L29.8462 30.9231C29.4417 31.3271 29.2145 31.8753 29.2145 32.4469C29.2145 33.0186 29.4417 33.5668 29.8462 33.9708C30.2394 34.3609 30.7677 34.5846 31.3216 34.5954C31.8941 34.5987 32.4443 34.3739 32.8508 33.9708L55.6062 11.2046V23.8477C55.6062 25.0372 56.5705 26.0015 57.76 26.0015C58.9495 26.0015 59.9139 25.0372 59.9139 23.8477Z"/><path d="M12.217 60H47.4001C51.9189 59.9942 55.5874 56.3449 55.617 51.8262V38.4615C55.617 37.272 54.6527 36.3077 53.4631 36.3077C52.2736 36.3077 51.3093 37.272 51.3093 38.4615V51.7831C51.3034 53.9396 49.5566 55.6864 47.4001 55.6923H12.217C10.0771 55.6866 8.33714 53.9659 8.30776 51.8262V16.5569C8.29914 15.5145 8.7072 14.5119 9.44126 13.7718C10.1753 13.0316 11.1746 12.6153 12.217 12.6154H25.5385C26.7281 12.6154 27.6924 11.6511 27.6924 10.4615C27.6924 9.272 26.7281 8.30769 25.5385 8.30769H12.217C10.0321 8.30767 7.9372 9.17782 6.39529 10.7258C4.85339 12.2738 3.99147 14.3721 4.00006 16.5569V51.8262C4.02963 56.3449 7.6981 59.9942 12.217 60Z"/></svg>'},fn={name:"mute",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.4283 11.6761L53.1768 9.53891C53.9347 8.61282 53.7982 7.24774 52.8722 6.48993C51.9461 5.73211 50.581 5.86852 49.8232 6.79461L36.3333 23.2822V13.3972C36.3332 11.6447 35.2774 10.0648 33.6583 9.39418C32.0391 8.72356 30.1755 9.09425 28.9362 10.3334L18.1029 21.1668H14.6667C9.88247 21.1722 6.00547 25.0492 6 29.8334V34.1668C6.00547 38.951 9.88247 42.828 14.6667 42.8334H18.1029L19.3315 44.0621L10.8232 54.4613C10.0653 55.3874 10.2018 56.7525 11.1279 57.5103C12.0539 58.2681 13.419 58.1317 14.1768 57.2056L22.411 47.1416L28.9362 53.6668C30.1755 54.9059 32.0391 55.2766 33.6583 54.606C35.2774 53.9354 36.3332 52.3555 36.3333 50.603V30.1254L42.6092 22.4549C44.2201 25.3756 45.044 28.6649 45 32.0001C45.1184 36.1899 43.7698 40.2896 41.1872 43.5909C40.409 44.5001 40.5152 45.8679 41.4243 46.6461C42.3334 47.4243 43.7012 47.3183 44.4795 46.4093C47.7313 42.3208 49.4486 37.2227 49.3333 32.0001C49.403 27.3538 48.067 22.7949 45.5005 18.9211L48.6119 15.1182C52.019 20.0793 53.7867 25.9829 53.6667 32.0001C53.6667 39.0587 51.4873 45.6518 47.6872 50.0909C46.909 51.0001 47.0152 52.3679 47.9243 53.1461C48.8334 53.9243 50.2012 53.8183 50.9795 52.9093C55.4408 47.6968 58 40.0764 58 32.0001C58 24.21 55.6006 16.8662 51.4283 11.6761ZM19.8971 38.5H14.6667C12.2744 38.4977 10.3357 36.559 10.3333 34.1667V29.8334C10.3357 27.4411 12.2744 25.5024 14.6667 25.5H19.8971L32 13.3972V28.5784L22.089 40.6919L19.8971 38.5ZM31.9997 50.603L25.1682 43.7715L31.9997 35.4218V50.603Z"/></svg>'},Ko={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>'},xi={name:"send",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.41642 6.29292C5.99705 5.18016 3.38612 7.41823 4.12858 9.96847L10.5427 32L4.12858 54.0315C3.38612 56.5818 5.99704 58.8198 8.41642 57.7071L58.1942 34.8125C60.6019 33.7051 60.6019 30.2949 58.1942 29.1875L8.41642 6.29292ZM14.2569 29.9351L8.74174 10.9913L49.9295 29.9351H14.2569ZM14.2568 34.0651L8.74174 53.0087L49.9291 34.0651H14.2568Z"/></svg>'},gn={name:"volume",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M33.6578 9.3322C32.0391 8.65799 30.1735 9.02919 28.9362 10.2717L18.1029 21.105H14.6667C9.88247 21.1105 6.00547 24.9875 6 29.7717V34.105C6.00547 38.8892 9.88247 42.7662 14.6667 42.7717H18.1029L28.9362 53.605C30.1755 54.8442 32.0391 55.2149 33.6583 54.5442C35.2774 53.8736 36.3332 52.2937 36.3333 50.5412V13.3355C36.3365 11.5817 35.2794 10.0001 33.6578 9.3322ZM32 50.5411L19.8971 38.4382H14.6667C12.2744 38.4358 10.3357 36.4971 10.3333 34.1049V29.7716C10.3357 27.3793 12.2744 25.4406 14.6667 25.4382H19.8971L32 13.3353V50.5411ZM49.3334 31.9383C49.4487 37.161 47.7314 42.2591 44.4796 46.3475C43.7013 47.2565 42.3335 47.3625 41.4244 46.5843C40.5153 45.8061 40.4092 44.4383 41.1873 43.5291C43.7699 40.2278 45.1185 36.1282 45.0001 31.9383C45.1185 27.7485 43.7699 23.6488 41.1873 20.3475C40.4092 19.4383 40.5153 18.0705 41.4244 17.2923C42.3335 16.5141 43.7013 16.6201 44.4796 17.5291C47.7314 21.6176 49.4487 26.7157 49.3334 31.9383ZM58.0001 31.9383C58.0001 40.0147 55.441 47.635 50.9796 52.8475C50.2013 53.7565 48.8335 53.8625 47.9244 53.0843C47.0153 52.3061 46.9092 50.9383 47.6873 50.0291C51.4874 45.59 53.6668 38.9969 53.6668 31.9383C53.6668 24.8797 51.4874 18.2866 47.6873 13.8475C46.9092 12.9383 47.0153 11.5705 47.9244 10.7923C48.8335 10.0141 50.2013 10.1201 50.9796 11.0291C55.441 16.2416 58.0001 23.862 58.0001 31.9383Z"/></svg>'},$e={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,safari10:!1,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,cssVarShim:!1,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,dynamicImportShim:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0};let xe,wi,Rt,ki=!1,yt=!1,Es=!1,L=!1,mn=null,hs=!1;const jt=typeof window<"u"?window:{},F=jt.document||{head:{}},Ci=jt.HTMLElement||class{},P={$flags$:0,$resourcesUrl$:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,e,t,s)=>n.addEventListener(e,t,s),rel:(n,e,t,s)=>n.removeEventListener(e,t,s),ce:(n,e)=>new CustomEvent(n,e)},Jo=(()=>{let n=!1;try{F.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch{}return n})(),Xo=n=>Promise.resolve(n),ea=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),_i=(n,e,t,s)=>{t&&t.map(([i,r,o])=>{const a=sa(n,i),l=ta(e,o),c=na(i);P.ael(a,r,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>P.rel(a,r,l,c))})},ta=(n,e)=>t=>{try{$e.lazyLoad||n.$hostElement$[e](t)}catch(s){Ge(s)}},sa=(n,e)=>e&4?F:e&8?jt:e&16?F.body:n,na=n=>Jo?{passive:(n&1)!==0,capture:(n&2)!==0}:(n&2)!==0,vn="http://www.w3.org/1999/xlink",fe=(n,e="")=>()=>{},bn=new WeakMap,ia=(n,e,t)=>{let s=wt.get(n);ea&&t?(s=s||new CSSStyleSheet,s.replace(e)):s=e,wt.set(n,s)},ra=(n,e,t,s)=>{let i=Si(e,t),r=wt.get(i);if(n=n.nodeType===11?n:F,r)if(typeof r=="string"){n=n.head||n;let o=bn.get(n),a;o||bn.set(n,o=new Set),o.has(i)||(a=F.createElement("style"),a.innerHTML=r,n.insertBefore(a,n.querySelector("link")),o&&o.add(i))}else n.adoptedStyleSheets.includes(r)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,r]);return i},oa=n=>{const e=n.$cmpMeta$,t=n.$hostElement$,s=e.$flags$,i=fe("attachStyles",e.$tagName$),r=ra(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,n.$modeName$);s&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),s&2&&t.classList.add(r+"-s")),i()},Si=(n,e)=>"sc-"+(e&&n.$flags$&32?n.$tagName$+"-"+e:n.$tagName$),aa=n=>ja.map(e=>e(n)).find(e=>!!e),yn={},la="http://www.w3.org/2000/svg",ca="http://www.w3.org/1999/xhtml",ha=n=>n!=null,As=n=>(n=typeof n,n==="object"||n==="function"),Ce=(n,e,...t)=>{let s=null,i=null,r=null,o=!1,a=!1,l=[];const c=u=>{for(let d=0;d<u.length;d++)s=u[d],Array.isArray(s)?c(s):s!=null&&typeof s!="boolean"&&((o=typeof n!="function"&&!As(s))&&(s=String(s)),o&&a?l[l.length-1].$text$+=s:l.push(o?$t(null,s):s),a=o)};if(c(t),e){e.key&&(i=e.key),e.name&&(r=e.name);{const u=e.className||e.class;u&&(e.class=typeof u!="object"?u:Object.keys(u).filter(d=>u[d]).join(" "))}}if(typeof n=="function")return n(e===null?{}:e,l,da);const h=$t(n,null);return h.$attrs$=e,l.length>0&&(h.$children$=l),h.$key$=i,h.$name$=r,h},$t=(n,e)=>{const t={$flags$:0,$tag$:n,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},Ts={},ua=n=>n&&n.$tag$===Ts,da={forEach:(n,e)=>n.map($n).forEach(e),map:(n,e)=>n.map($n).map(e).map(pa)},$n=n=>({vattrs:n.$attrs$,vchildren:n.$children$,vkey:n.$key$,vname:n.$name$,vtag:n.$tag$,vtext:n.$text$}),pa=n=>{if(typeof n.vtag=="function"){const t=Object.assign({},n.vattrs);return n.vkey&&(t.key=n.vkey),n.vname&&(t.name=n.vname),Ce(n.vtag,t,...n.vchildren||[])}const e=$t(n.vtag,n.vtext);return e.$attrs$=n.vattrs,e.$children$=n.vchildren,e.$key$=n.vkey,e.$name$=n.vname,e},xn=(n,e,t,s,i,r)=>{if(t!==s){let o=_n(n,e),a=e.toLowerCase();if(e==="class"){const l=n.classList,c=wn(t),h=wn(s);l.remove(...c.filter(u=>u&&!h.includes(u))),l.add(...h.filter(u=>u&&!c.includes(u)))}else if(e==="style"){for(const l in t)(!s||s[l]==null)&&(l.includes("-")?n.style.removeProperty(l):n.style[l]="");for(const l in s)(!t||s[l]!==t[l])&&(l.includes("-")?n.style.setProperty(l,s[l]):n.style[l]=s[l])}else if(e!=="key")if(e==="ref")s&&s(n);else if(!n.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):_n(jt,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&P.rel(n,e,t,!1),s&&P.ael(n,e,s,!1);else{const l=As(s);if((o||l&&s!==null)&&!i)try{if(n.tagName.includes("-"))n[e]=s;else{let h=s??"";e==="list"?o=!1:(t==null||n[e]!=h)&&(n[e]=h)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),s==null||s===!1?(s!==!1||n.getAttribute(e)==="")&&(c?n.removeAttributeNS(vn,e):n.removeAttribute(e)):(!o||r&4||i)&&!l&&(s=s===!0?"":s,c?n.setAttributeNS(vn,e,s):n.setAttribute(e,s))}}},fa=/\s/,wn=n=>n?n.split(fa):[],Ei=(n,e,t,s)=>{const i=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=n&&n.$attrs$||yn,o=e.$attrs$||yn;for(s in r)s in o||xn(i,s,r[s],void 0,t,e.$flags$);for(s in o)xn(i,s,r[s],o[s],t,e.$flags$)},xt=(n,e,t,s)=>{let i=e.$children$[t],r=0,o,a,l;if(ki||(Es=!0,i.$tag$==="slot"&&(xe&&s.classList.add(xe+"-s"),i.$flags$|=i.$children$?2:1)),i.$text$!==null)o=i.$elm$=F.createTextNode(i.$text$);else if(i.$flags$&1)o=i.$elm$=F.createTextNode("");else{if(L||(L=i.$tag$==="svg"),o=i.$elm$=F.createElementNS(L?la:ca,i.$flags$&2?"slot-fb":i.$tag$),L&&i.$tag$==="foreignObject"&&(L=!1),Ei(null,i,L),ha(xe)&&o["s-si"]!==xe&&o.classList.add(o["s-si"]=xe),i.$children$)for(r=0;r<i.$children$.length;++r)a=xt(n,i,r,o),a&&o.appendChild(a);i.$tag$==="svg"?L=!1:o.tagName==="foreignObject"&&(L=!0)}return o["s-hn"]=Rt,i.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=wi,o["s-sn"]=i.$name$||"",l=n&&n.$children$&&n.$children$[t],l&&l.$tag$===i.$tag$&&n.$elm$&&Ve(n.$elm$,!1)),o},Ve=(n,e)=>{P.$flags$|=1;const t=n.childNodes;for(let s=t.length-1;s>=0;s--){const i=t[s];i["s-hn"]!==Rt&&i["s-ol"]&&(Oi(i).insertBefore(i,Os(i)),i["s-ol"].remove(),i["s-ol"]=void 0,Es=!0),e&&Ve(i,e)}P.$flags$&=-2},Ai=(n,e,t,s,i,r)=>{let o=n["s-cr"]&&n["s-cr"].parentNode||n,a;for(o.shadowRoot&&o.tagName===Rt&&(o=o.shadowRoot);i<=r;++i)s[i]&&(a=xt(null,t,i,n),a&&(s[i].$elm$=a,o.insertBefore(a,Os(e))))},Ti=(n,e,t,s,i)=>{for(;e<=t;++e)(s=n[e])&&(i=s.$elm$,Ii(s),yt=!0,i["s-ol"]?i["s-ol"].remove():Ve(i,!0),i.remove())},ga=(n,e,t,s)=>{let i=0,r=0,o=0,a=0,l=e.length-1,c=e[0],h=e[l],u=s.length-1,d=s[0],p=s[u],b,m;for(;i<=l&&r<=u;)if(c==null)c=e[++i];else if(h==null)h=e[--l];else if(d==null)d=s[++r];else if(p==null)p=s[--u];else if(ot(c,d))we(c,d),c=e[++i],d=s[++r];else if(ot(h,p))we(h,p),h=e[--l],p=s[--u];else if(ot(c,p))(c.$tag$==="slot"||p.$tag$==="slot")&&Ve(c.$elm$.parentNode,!1),we(c,p),n.insertBefore(c.$elm$,h.$elm$.nextSibling),c=e[++i],p=s[--u];else if(ot(h,d))(c.$tag$==="slot"||p.$tag$==="slot")&&Ve(h.$elm$.parentNode,!1),we(h,d),n.insertBefore(h.$elm$,c.$elm$),h=e[--l],d=s[++r];else{for(o=-1,a=i;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===d.$key$){o=a;break}o>=0?(m=e[o],m.$tag$!==d.$tag$?b=xt(e&&e[r],t,o,n):(we(m,d),e[o]=void 0,b=m.$elm$),d=s[++r]):(b=xt(e&&e[r],t,r,n),d=s[++r]),b&&Oi(c.$elm$).insertBefore(b,Os(c.$elm$))}i>l?Ai(n,s[u+1]==null?null:s[u+1].$elm$,t,s,r,u):r>u&&Ti(e,i,l)},ot=(n,e)=>n.$tag$===e.$tag$?n.$tag$==="slot"?n.$name$===e.$name$:n.$key$===e.$key$:!1,Os=n=>n&&n["s-ol"]||n,Oi=n=>(n["s-ol"]?n["s-ol"]:n).parentNode,we=(n,e)=>{const t=e.$elm$=n.$elm$,s=n.$children$,i=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(L=r==="svg"?!0:r==="foreignObject"?!1:L,r==="slot"||Ei(n,e,L),s!==null&&i!==null?ga(t,s,e,i):i!==null?(n.$text$!==null&&(t.textContent=""),Ai(t,null,e,i,0,i.length-1)):s!==null&&Ti(s,0,s.length-1),L&&r==="svg"&&(L=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:n.$text$!==o&&(t.data=o)},Pi=n=>{let e=n.childNodes,t,s,i,r,o,a;for(s=0,i=e.length;s<i;s++)if(t=e[s],t.nodeType===1){if(t["s-sr"]){for(o=t["s-sn"],t.hidden=!1,r=0;r<i;r++)if(a=e[r].nodeType,e[r]["s-hn"]!==t["s-hn"]||o!==""){if(a===1&&o===e[r].getAttribute("slot")){t.hidden=!0;break}}else if(a===1||a===3&&e[r].textContent.trim()!==""){t.hidden=!0;break}}Pi(t)}},z=[],Li=n=>{let e,t,s,i,r,o,a=0,l=n.childNodes,c=l.length;for(;a<c;a++){if(e=l[a],e["s-sr"]&&(t=e["s-cr"])&&t.parentNode)for(s=t.parentNode.childNodes,i=e["s-sn"],o=s.length-1;o>=0;o--)t=s[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&(kn(t,i)?(r=z.find(h=>h.$nodeToRelocate$===t),yt=!0,t["s-sn"]=t["s-sn"]||i,r?r.$slotRefNode$=e:z.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&z.map(h=>{kn(h.$nodeToRelocate$,t["s-sn"])&&(r=z.find(u=>u.$nodeToRelocate$===t),r&&!h.$slotRefNode$&&(h.$slotRefNode$=r.$slotRefNode$))})):z.some(h=>h.$nodeToRelocate$===t)||z.push({$nodeToRelocate$:t}));e.nodeType===1&&Li(e)}},kn=(n,e)=>n.nodeType===1?n.getAttribute("slot")===null&&e===""||n.getAttribute("slot")===e:n["s-sn"]===e?!0:e==="",Ii=n=>{n.$attrs$&&n.$attrs$.ref&&n.$attrs$.ref(null),n.$children$&&n.$children$.map(Ii)},ma=(n,e)=>{const t=n.$hostElement$,s=n.$cmpMeta$,i=n.$vnode$||$t(null,null),r=ua(e)?e:Ce(null,null,e);Rt=t.tagName,s.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},s.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,n.$vnode$=r,r.$elm$=i.$elm$=t.shadowRoot||t,xe=t["s-sc"],wi=t["s-cr"],ki=(s.$flags$&1)!==0,yt=!1,we(i,r);{if(P.$flags$|=1,Es){Li(r.$elm$);let o,a,l,c,h,u,d=0;for(;d<z.length;d++)o=z[d],a=o.$nodeToRelocate$,a["s-ol"]||(l=F.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(d=0;d<z.length;d++)if(o=z[d],a=o.$nodeToRelocate$,o.$slotRefNode$){for(c=o.$slotRefNode$.parentNode,h=o.$slotRefNode$.nextSibling,l=a["s-ol"];l=l.previousSibling;)if(u=l["s-nr"],u&&u["s-sn"]===a["s-sn"]&&c===u.parentNode&&(u=u.nextSibling,!u||!u["s-nr"])){h=u;break}(!h&&c!==a.parentNode||a.nextSibling!==h)&&a!==h&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),c.insertBefore(a,h))}else a.nodeType===1&&(a.hidden=!0)}yt&&Pi(r.$elm$),P.$flags$&=-2,z.length=0}},va=n=>n,ba=(n,e,t)=>{const s=va(n);return{emit:i=>ya(s,e,{bubbles:!!(t&4),composed:!!(t&2),cancelable:!!(t&1),detail:i})}},ya=(n,e,t)=>{const s=P.ce(e,t);return n.dispatchEvent(s),s},$a=(n,e)=>{},Ri=(n,e)=>(n.$flags$|=16,$a(n,n.$ancestorComponent$),za(()=>xa(n,e))),xa=(n,e)=>{const t=n.$hostElement$,s=fe("scheduleUpdate",n.$cmpMeta$.$tagName$),i=t;let r;return e?r=_e(i,"componentWillLoad"):r=_e(i,"componentWillUpdate"),r=Cn(r,()=>_e(i,"componentWillRender")),s(),Cn(r,()=>wa(n,i,e))},wa=async(n,e,t)=>{const s=n.$hostElement$,i=fe("update",n.$cmpMeta$.$tagName$);s["s-rc"],t&&oa(n);const r=fe("render",n.$cmpMeta$.$tagName$);ka(n,e,s),r(),i(),Ca(n)},ka=(n,e,t)=>{try{mn=e,e=e.render&&e.render(),n.$flags$&=-17,n.$flags$|=2,($e.hasRenderFn||$e.reflect)&&($e.vdomRender||$e.reflect)&&($e.hydrateServerSide||ma(n,e))}catch(a){Ge(a,n.$hostElement$)}return mn=null,null},Ca=n=>{const e=n.$cmpMeta$.$tagName$,t=n.$hostElement$,s=fe("postUpdate",e),i=t;n.$ancestorComponent$,_e(i,"componentDidRender"),n.$flags$&64?(_e(i,"componentDidUpdate"),s()):(n.$flags$|=64,_e(i,"componentDidLoad"),s())},_e=(n,e,t)=>{if(n&&n[e])try{return n[e](t)}catch(s){Ge(s)}},Cn=(n,e)=>n&&n.then?n.then(e):e(),_a=(n,e)=>n!=null&&!As(n)?e&4?n==="false"?!1:n===""||!!n:e&2?parseFloat(n):e&1?String(n):n:n,Sa=(n,e)=>Mt(n).$instanceValues$.get(e),Ea=(n,e,t,s)=>{const i=Mt(n),r=n,o=i.$instanceValues$.get(e),a=i.$flags$,l=r;t=_a(t,s.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!c){i.$instanceValues$.set(e,t);{if(s.$watchers$&&a&128){const u=s.$watchers$[e];u&&u.map(d=>{try{l[d](t,o,e)}catch(p){Ge(p,r)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;Ri(i,!1)}}}},Aa=(n,e,t)=>{if(e.$members$){n.watchers&&(e.$watchers$=n.watchers);const s=Object.entries(e.$members$),i=n.prototype;s.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(i,r,{get(){return Sa(this,r)},set(a){Ea(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;i.attributeChangedCallback=function(o,a,l){P.jmp(()=>{const c=r.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(i.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},n.observedAttributes=s.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return r.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return n},Ta=async(n,e,t,s,i)=>{if(!(e.$flags$&32)&&(i=n.constructor,e.$flags$|=32,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),i.style)){let o=i.style;typeof o!="string"&&(o=o[e.$modeName$=aa(n)]);const a=Si(t,e.$modeName$);if(!wt.has(a)){const l=fe("registerStyles",t.$tagName$);ia(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,(()=>Ri(e,!0))()},Oa=n=>{},Pa=n=>{if(!(P.$flags$&1)){const e=Mt(n),t=e.$cmpMeta$,s=fe("connectedCallback",t.$tagName$);e.$flags$&1?(_i(n,e,t.$listeners$),Oa(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&La(n),t.$members$&&Object.entries(t.$members$).map(([i,[r]])=>{if(r&31&&n.hasOwnProperty(i)){const o=n[i];delete n[i],n[i]=o}}),Ta(n,e,t)),s()}},La=n=>{const e=n["s-cr"]=F.createComment("");e["s-cn"]=!0,n.insertBefore(e,n.firstChild)},Ia=n=>{if(!(P.$flags$&1)){const e=Mt(n);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},ji=(n,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=n.$watchers$,t.$attrsToReflect$=[];const s=n.prototype.connectedCallback,i=n.prototype.disconnectedCallback;return Object.assign(n.prototype,{__registerHost(){Ra(this,t)},connectedCallback(){Pa(this),s&&s.call(this)},disconnectedCallback(){Ia(this),i&&i.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),n.is=t.$tagName$,Aa(n,t)},Mi=new WeakMap,Mt=n=>Mi.get(n),Ra=(n,e)=>{const t={$flags$:0,$hostElement$:n,$cmpMeta$:e,$instanceValues$:new Map};return _i(n,t,e.$listeners$),Mi.set(n,t)},_n=(n,e)=>e in n,Ge=(n,e)=>(0,console.error)(n,e),wt=new Map,ja=[],Sn=[],Ui=[],Ma=(n,e)=>t=>{n.push(t),hs||(hs=!0,e&&P.$flags$&4?Ua(us):P.raf(us))},En=n=>{for(let e=0;e<n.length;e++)try{n[e](performance.now())}catch(t){Ge(t)}n.length=0},us=()=>{En(Sn),En(Ui),(hs=Sn.length>0)&&P.raf(us)},Ua=n=>Xo().then(n),za=Ma(Ui,!0),Da=(n={})=>{const{content:e="",title:t,attributes:s=[]}=n;let i="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...s];return t&&(i=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${i}${e}</svg>`},Ha=n=>n.replace(/<(\/?)svg([^>]*)>/g,"").trim();function Ba(n){return`${n.getFullYear()}.${n.getMonth()+1}`}class Na{constructor(e){this.voca_component=e,this.voca_added=Ba(new Date)}}const qa="telia-vst{display:none}",Va=ji(class extends Ci{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=ba(this,"vocaInternalUStats",7)}connectedCallback(){this.vocaInternalUStats.emit(new Na(this.dataTrackingId))}render(){return Ce(Ts,null)}static get style(){return qa}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function zi(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,Va);break}})}zi();function ds(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function Fa(){if(typeof ds().vocadsIcons!==void 0)return ds().vocadsIcons}function Za(){return ds().vocadsIconsRegistered}const Wa=".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}",Qa=ji(class extends Ci{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(Za()&&this.name){const n=Fa();return n[this.name]?n[this.name].svg:""}return this.name&&console.warn(this.name,"Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"),""}render(){let n=this.getSvgString(),e=[{name:"viewBox",value:"0 0 64 64"}];this.allyTitle?e=[...e,{name:"role",value:"img"}]:e=[...e,{name:"aria-hidden",value:"true"}];const t=Da({content:Ha(n),attributes:e,title:this.allyTitle});return Ce(Ts,{class:`telia-icon telia-icon--${this.size}`},Ce("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),Ce("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return Wa}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Ya(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,Qa);break;case"telia-vst":customElements.get(e)||zi();break}})}Ya();/**
21
+ */let w=class extends ye{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ho(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return J}};var qn;w._$litElement$=!0,w.finalized=!0,(qn=globalThis.litElementHydrateSupport)==null||qn.call(globalThis,{LitElement:w});const Yt=globalThis.litElementPolyfillSupport;Yt==null||Yt({LitElement:w});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");const No={name:"alert",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 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4.01731 47.4568 16.5432 59.9827 32 60ZM32 8.30769C45.0849 8.30769 55.6923 18.9151 55.6923 32C55.6923 45.0849 45.0849 55.6923 32 55.6923C18.9151 55.6923 8.30769 45.0849 8.30769 32C8.32247 18.9212 18.9212 8.32247 32 8.30769Z"/><path d="M29.3491 38.6031V20.6807C29.348 19.8662 29.4903 19.0598 29.7675 18.3096C29.9945 17.6371 30.3484 17.0302 30.804 16.5322C31.1251 16.1524 31.5593 15.9246 32.0204 15.894C32.6852 15.894 33.3496 16.471 34.0134 17.625C34.3738 18.1337 34.5955 18.7525 34.6509 19.4042V37.3267C34.6509 37.9947 34.2454 38.6329 33.4345 39.2414C32.6632 39.835 31.7547 40.1521 30.825 40.1523C29.8423 40.1524 29.3503 39.636 29.3491 38.6031Z"/><path d="M33.66 44.6959C33.9649 45.0866 34.161 45.551 34.2284 46.0419C34.2284 46.5397 33.8893 47.0083 33.2109 47.4476C32.5638 47.8771 31.8043 48.1062 31.0275 48.1061C30.1902 48.1061 29.7716 47.7271 29.7716 46.9693C29.7703 46.3788 29.8874 45.7941 30.116 45.2496C30.3064 44.7579 30.6022 44.3138 30.9826 43.9487C31.2626 43.6591 31.6427 43.4875 32.045 43.4692C32.5635 43.4692 33.1019 43.8781 33.66 44.6959Z"/></svg>'},Bo={name:"check-circle-filled",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.9829 16.5431 47.4569 4.01712 32 4ZM44.5613 24.5793L31.6382 43.9639C31.2806 44.5011 30.7008 44.8493 30.0586 44.9126C29.988 44.9197 29.9171 44.9232 29.8462 44.9231C29.275 44.9229 28.7272 44.696 28.3233 44.2921L19.7079 35.6767C19.1639 35.1326 18.9514 34.3396 19.1505 33.5964C19.3497 32.8533 19.9302 32.2728 20.6734 32.0736C21.4166 31.8745 22.2095 32.087 22.7536 32.631L29.5117 39.3881L40.9772 22.1899C41.4016 21.5439 42.1396 21.1749 42.9111 21.2229C43.6825 21.2709 44.3691 21.7286 44.7101 22.4223C45.0511 23.1159 44.9944 23.9391 44.5613 24.5793Z"/></svg>'},qo={name:"check-circle",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M31.9998 4C16.5358 4 3.99976 16.536 3.99976 32C3.99976 47.464 16.5358 60 31.9998 60C47.4637 60 59.9998 47.464 59.9998 32C59.9826 16.5431 47.4566 4.01712 31.9998 4ZM31.9998 55.6923C18.9149 55.6923 8.30745 45.0849 8.30745 32C8.30745 18.9151 18.9149 8.30769 31.9998 8.30769C45.0847 8.30769 55.6921 18.9151 55.6921 32C55.6773 45.0788 45.0785 55.6775 31.9998 55.6923ZM44.5611 24.5793L31.638 43.9639C31.2804 44.5011 30.7005 44.8493 30.0584 44.9126C29.9878 44.9197 29.9169 44.9232 29.8459 44.9231C29.2747 44.9229 28.727 44.696 28.3231 44.2921L19.7077 35.6767C19.1636 35.1326 18.9512 34.3396 19.1503 33.5964C19.3494 32.8533 19.9299 32.2728 20.6731 32.0736C21.4163 31.8745 22.2093 32.087 22.7534 32.631L29.5115 39.3881L40.9769 22.1899C41.4013 21.5439 42.1394 21.1749 42.9108 21.2229C43.6823 21.2709 44.3688 21.7286 44.7099 22.4223C45.0509 23.1159 44.9941 23.9391 44.5611 24.5793Z"/></svg>'},Fo={name:"checkmark",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M57.5438 13.4967L28.717 50.5596C27.9537 51.5407 26.8061 52.147 25.5654 52.2248C25.4755 52.2301 25.3856 52.2332 25.2967 52.2332C24.1476 52.233 23.0455 51.7763 22.233 50.9637L6.63458 35.3654C6.08729 34.8181 5.87354 34.0204 6.07387 33.2728C6.27419 32.5252 6.85815 31.9412 7.60577 31.7409C8.35339 31.5406 9.15109 31.7543 9.69838 32.3016L25.2967 47.8999L54.1225 10.837C54.5976 10.2258 55.3626 9.91453 56.1295 10.0204C56.8963 10.1263 57.5484 10.6332 57.8402 11.3502C58.1319 12.0673 58.0189 12.8855 57.5438 13.4967Z"/></svg>'},Vo={name:"chevron-down",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M53.0318 24.8653L33.5318 44.3653C33.1256 44.7717 32.5745 45.0001 31.9999 45.0001C31.4253 45.0001 30.8742 44.7717 30.468 44.3653L10.968 24.8653C10.122 24.0193 10.122 22.6476 10.968 21.8015C11.8141 20.9555 13.1858 20.9555 14.0318 21.8015L31.9999 39.7696L49.968 21.8015C50.8141 20.9555 52.1858 20.9555 53.0318 21.8015C53.8779 22.6476 53.8779 24.0193 53.0318 24.8653Z"/></svg>'},Zo={name:"close-circle",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 56C45.2548 56 56 45.2548 56 32C56 18.7452 45.2548 8 32 8C18.7452 8 8 18.7452 8 32C8 45.2548 18.7452 56 32 56ZM32 60C47.464 60 60 47.464 60 32C60 16.536 47.464 4 32 4C16.536 4 4 16.536 4 32C4 47.464 16.536 60 32 60Z"/><path d="M25.2772 22.695C24.5164 21.8942 23.2505 21.8617 22.4497 22.6225C21.6488 23.3833 21.6164 24.6492 22.3772 25.45L29.2411 32.6752L22.4773 39.795C21.7166 40.5958 21.749 41.8617 22.5498 42.6225C23.3507 43.3833 24.6166 43.3508 25.3773 42.55L31.9998 35.5791L38.6222 42.55C39.3829 43.3508 40.6488 43.3833 41.4497 42.6225C42.2505 41.8617 42.2829 40.5958 41.5222 39.795L34.7584 32.6752L41.6223 25.45C42.3831 24.6492 42.3507 23.3833 41.5498 22.6225C40.749 21.8617 39.4831 21.8942 38.7224 22.695L31.9998 29.7714L25.2772 22.695Z"/></svg>'},_s={name:"close",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.365 48.3012C51.9123 48.8485 52.1261 49.6462 51.9258 50.3939C51.7254 51.1415 51.1415 51.7254 50.3939 51.9258C49.6462 52.1261 48.8485 51.9123 48.3012 51.365L32.4998 35.5636L16.6984 51.365C16.1511 51.9123 15.3534 52.1261 14.6058 51.9258C13.8581 51.7254 13.2742 51.1415 13.0739 50.3939C12.8735 49.6462 13.0873 48.8485 13.6346 48.3012L29.436 32.4998L13.6346 16.6984C13.0873 16.1511 12.8735 15.3534 13.0739 14.6058C13.2742 13.8581 13.8581 13.2742 14.6058 13.0739C15.3534 12.8735 16.1511 13.0873 16.6984 13.6346L32.4998 29.436L48.3012 13.6346C49.1473 12.7885 50.519 12.7885 51.365 13.6346C52.2111 14.4806 52.2111 15.8523 51.365 16.6984L35.5636 32.4998L51.365 48.3012Z"/></svg>'},Wo={name:"external",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M59.9139 23.8477V7.90923C59.902 5.75094 58.1522 4.00588 55.9939 4H40.0554C38.8659 4 37.9016 4.96431 37.9016 6.15385C37.9016 7.34338 38.8659 8.30769 40.0554 8.30769H52.4616L29.8462 30.9231C29.4417 31.3271 29.2145 31.8753 29.2145 32.4469C29.2145 33.0186 29.4417 33.5668 29.8462 33.9708C30.2394 34.3609 30.7677 34.5846 31.3216 34.5954C31.8941 34.5987 32.4443 34.3739 32.8508 33.9708L55.6062 11.2046V23.8477C55.6062 25.0372 56.5705 26.0015 57.76 26.0015C58.9495 26.0015 59.9139 25.0372 59.9139 23.8477Z"/><path d="M12.217 60H47.4001C51.9189 59.9942 55.5874 56.3449 55.617 51.8262V38.4615C55.617 37.272 54.6527 36.3077 53.4631 36.3077C52.2736 36.3077 51.3093 37.272 51.3093 38.4615V51.7831C51.3034 53.9396 49.5566 55.6864 47.4001 55.6923H12.217C10.0771 55.6866 8.33714 53.9659 8.30776 51.8262V16.5569C8.29914 15.5145 8.7072 14.5119 9.44126 13.7718C10.1753 13.0316 11.1746 12.6153 12.217 12.6154H25.5385C26.7281 12.6154 27.6924 11.6511 27.6924 10.4615C27.6924 9.272 26.7281 8.30769 25.5385 8.30769H12.217C10.0321 8.30767 7.9372 9.17782 6.39529 10.7258C4.85339 12.2738 3.99147 14.3721 4.00006 16.5569V51.8262C4.02963 56.3449 7.6981 59.9942 12.217 60Z"/></svg>'},pn={name:"mute",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M51.4283 11.6761L53.1768 9.53891C53.9347 8.61282 53.7982 7.24774 52.8722 6.48993C51.9461 5.73211 50.581 5.86852 49.8232 6.79461L36.3333 23.2822V13.3972C36.3332 11.6447 35.2774 10.0648 33.6583 9.39418C32.0391 8.72356 30.1755 9.09425 28.9362 10.3334L18.1029 21.1668H14.6667C9.88247 21.1722 6.00547 25.0492 6 29.8334V34.1668C6.00547 38.951 9.88247 42.828 14.6667 42.8334H18.1029L19.3315 44.0621L10.8232 54.4613C10.0653 55.3874 10.2018 56.7525 11.1279 57.5103C12.0539 58.2681 13.419 58.1317 14.1768 57.2056L22.411 47.1416L28.9362 53.6668C30.1755 54.9059 32.0391 55.2766 33.6583 54.606C35.2774 53.9354 36.3332 52.3555 36.3333 50.603V30.1254L42.6092 22.4549C44.2201 25.3756 45.044 28.6649 45 32.0001C45.1184 36.1899 43.7698 40.2896 41.1872 43.5909C40.409 44.5001 40.5152 45.8679 41.4243 46.6461C42.3334 47.4243 43.7012 47.3183 44.4795 46.4093C47.7313 42.3208 49.4486 37.2227 49.3333 32.0001C49.403 27.3538 48.067 22.7949 45.5005 18.9211L48.6119 15.1182C52.019 20.0793 53.7867 25.9829 53.6667 32.0001C53.6667 39.0587 51.4873 45.6518 47.6872 50.0909C46.909 51.0001 47.0152 52.3679 47.9243 53.1461C48.8334 53.9243 50.2012 53.8183 50.9795 52.9093C55.4408 47.6968 58 40.0764 58 32.0001C58 24.21 55.6006 16.8662 51.4283 11.6761ZM19.8971 38.5H14.6667C12.2744 38.4977 10.3357 36.559 10.3333 34.1667V29.8334C10.3357 27.4411 12.2744 25.5024 14.6667 25.5H19.8971L32 13.3972V28.5784L22.089 40.6919L19.8971 38.5ZM31.9997 50.603L25.1682 43.7715L31.9997 35.4218V50.603Z"/></svg>'},Qo={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>'},$i={name:"send",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.41642 6.29292C5.99705 5.18016 3.38612 7.41823 4.12858 9.96847L10.5427 32L4.12858 54.0315C3.38612 56.5818 5.99704 58.8198 8.41642 57.7071L58.1942 34.8125C60.6019 33.7051 60.6019 30.2949 58.1942 29.1875L8.41642 6.29292ZM14.2569 29.9351L8.74174 10.9913L49.9295 29.9351H14.2569ZM14.2568 34.0651L8.74174 53.0087L49.9291 34.0651H14.2568Z"/></svg>'},fn={name:"volume",svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M33.6578 9.3322C32.0391 8.65799 30.1735 9.02919 28.9362 10.2717L18.1029 21.105H14.6667C9.88247 21.1105 6.00547 24.9875 6 29.7717V34.105C6.00547 38.8892 9.88247 42.7662 14.6667 42.7717H18.1029L28.9362 53.605C30.1755 54.8442 32.0391 55.2149 33.6583 54.5442C35.2774 53.8736 36.3332 52.2937 36.3333 50.5412V13.3355C36.3365 11.5817 35.2794 10.0001 33.6578 9.3322ZM32 50.5411L19.8971 38.4382H14.6667C12.2744 38.4358 10.3357 36.4971 10.3333 34.1049V29.7716C10.3357 27.3793 12.2744 25.4406 14.6667 25.4382H19.8971L32 13.3353V50.5411ZM49.3334 31.9383C49.4487 37.161 47.7314 42.2591 44.4796 46.3475C43.7013 47.2565 42.3335 47.3625 41.4244 46.5843C40.5153 45.8061 40.4092 44.4383 41.1873 43.5291C43.7699 40.2278 45.1185 36.1282 45.0001 31.9383C45.1185 27.7485 43.7699 23.6488 41.1873 20.3475C40.4092 19.4383 40.5153 18.0705 41.4244 17.2923C42.3335 16.5141 43.7013 16.6201 44.4796 17.5291C47.7314 21.6176 49.4487 26.7157 49.3334 31.9383ZM58.0001 31.9383C58.0001 40.0147 55.441 47.635 50.9796 52.8475C50.2013 53.7565 48.8335 53.8625 47.9244 53.0843C47.0153 52.3061 46.9092 50.9383 47.6873 50.0291C51.4874 45.59 53.6668 38.9969 53.6668 31.9383C53.6668 24.8797 51.4874 18.2866 47.6873 13.8475C46.9092 12.9383 47.0153 11.5705 47.9244 10.7923C48.8335 10.0141 50.2013 10.1201 50.9796 11.0291C55.441 16.2416 58.0001 23.862 58.0001 31.9383Z"/></svg>'},$e={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,safari10:!1,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,cssVarShim:!1,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,dynamicImportShim:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0};let xe,xi,Pt,wi=!1,bt=!1,Ss=!1,L=!1,gn=null,as=!1;const Lt=typeof window<"u"?window:{},V=Lt.document||{head:{}},ki=Lt.HTMLElement||class{},P={$flags$:0,$resourcesUrl$:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,e,t,s)=>n.addEventListener(e,t,s),rel:(n,e,t,s)=>n.removeEventListener(e,t,s),ce:(n,e)=>new CustomEvent(n,e)},Yo=(()=>{let n=!1;try{V.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch{}return n})(),Go=n=>Promise.resolve(n),Ko=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),Ci=(n,e,t,s)=>{t&&t.map(([i,r,o])=>{const a=Xo(n,i),l=Jo(e,o),c=ea(i);P.ael(a,r,l,c),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>P.rel(a,r,l,c))})},Jo=(n,e)=>t=>{try{$e.lazyLoad||n.$hostElement$[e](t)}catch(s){Ye(s)}},Xo=(n,e)=>e&4?V:e&8?Lt:e&16?V.body:n,ea=n=>Yo?{passive:(n&1)!==0,capture:(n&2)!==0}:(n&2)!==0,mn="http://www.w3.org/1999/xlink",ge=(n,e="")=>()=>{},vn=new WeakMap,ta=(n,e,t)=>{let s=xt.get(n);Ko&&t?(s=s||new CSSStyleSheet,s.replace(e)):s=e,xt.set(n,s)},sa=(n,e,t,s)=>{let i=_i(e,t),r=xt.get(i);if(n=n.nodeType===11?n:V,r)if(typeof r=="string"){n=n.head||n;let o=vn.get(n),a;o||vn.set(n,o=new Set),o.has(i)||(a=V.createElement("style"),a.innerHTML=r,n.insertBefore(a,n.querySelector("link")),o&&o.add(i))}else n.adoptedStyleSheets.includes(r)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,r]);return i},na=n=>{const e=n.$cmpMeta$,t=n.$hostElement$,s=e.$flags$,i=ge("attachStyles",e.$tagName$),r=sa(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,n.$modeName$);s&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),s&2&&t.classList.add(r+"-s")),i()},_i=(n,e)=>"sc-"+(e&&n.$flags$&32?n.$tagName$+"-"+e:n.$tagName$),ia=n=>La.map(e=>e(n)).find(e=>!!e),bn={},ra="http://www.w3.org/2000/svg",oa="http://www.w3.org/1999/xhtml",aa=n=>n!=null,Es=n=>(n=typeof n,n==="object"||n==="function"),Ce=(n,e,...t)=>{let s=null,i=null,r=null,o=!1,a=!1,l=[];const c=u=>{for(let d=0;d<u.length;d++)s=u[d],Array.isArray(s)?c(s):s!=null&&typeof s!="boolean"&&((o=typeof n!="function"&&!Es(s))&&(s=String(s)),o&&a?l[l.length-1].$text$+=s:l.push(o?yt(null,s):s),a=o)};if(c(t),e){e.key&&(i=e.key),e.name&&(r=e.name);{const u=e.className||e.class;u&&(e.class=typeof u!="object"?u:Object.keys(u).filter(d=>u[d]).join(" "))}}if(typeof n=="function")return n(e===null?{}:e,l,ca);const h=yt(n,null);return h.$attrs$=e,l.length>0&&(h.$children$=l),h.$key$=i,h.$name$=r,h},yt=(n,e)=>{const t={$flags$:0,$tag$:n,$text$:e,$elm$:null,$children$:null};return t.$attrs$=null,t.$key$=null,t.$name$=null,t},As={},la=n=>n&&n.$tag$===As,ca={forEach:(n,e)=>n.map(yn).forEach(e),map:(n,e)=>n.map(yn).map(e).map(ha)},yn=n=>({vattrs:n.$attrs$,vchildren:n.$children$,vkey:n.$key$,vname:n.$name$,vtag:n.$tag$,vtext:n.$text$}),ha=n=>{if(typeof n.vtag=="function"){const t=Object.assign({},n.vattrs);return n.vkey&&(t.key=n.vkey),n.vname&&(t.name=n.vname),Ce(n.vtag,t,...n.vchildren||[])}const e=yt(n.vtag,n.vtext);return e.$attrs$=n.vattrs,e.$children$=n.vchildren,e.$key$=n.vkey,e.$name$=n.vname,e},$n=(n,e,t,s,i,r)=>{if(t!==s){let o=Cn(n,e),a=e.toLowerCase();if(e==="class"){const l=n.classList,c=xn(t),h=xn(s);l.remove(...c.filter(u=>u&&!h.includes(u))),l.add(...h.filter(u=>u&&!c.includes(u)))}else if(e==="style"){for(const l in t)(!s||s[l]==null)&&(l.includes("-")?n.style.removeProperty(l):n.style[l]="");for(const l in s)(!t||s[l]!==t[l])&&(l.includes("-")?n.style.setProperty(l,s[l]):n.style[l]=s[l])}else if(e!=="key")if(e==="ref")s&&s(n);else if(!n.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):Cn(Lt,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&P.rel(n,e,t,!1),s&&P.ael(n,e,s,!1);else{const l=Es(s);if((o||l&&s!==null)&&!i)try{if(n.tagName.includes("-"))n[e]=s;else{let h=s??"";e==="list"?o=!1:(t==null||n[e]!=h)&&(n[e]=h)}}catch{}let c=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,c=!0),s==null||s===!1?(s!==!1||n.getAttribute(e)==="")&&(c?n.removeAttributeNS(mn,e):n.removeAttribute(e)):(!o||r&4||i)&&!l&&(s=s===!0?"":s,c?n.setAttributeNS(mn,e,s):n.setAttribute(e,s))}}},ua=/\s/,xn=n=>n?n.split(ua):[],Si=(n,e,t,s)=>{const i=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=n&&n.$attrs$||bn,o=e.$attrs$||bn;for(s in r)s in o||$n(i,s,r[s],void 0,t,e.$flags$);for(s in o)$n(i,s,r[s],o[s],t,e.$flags$)},$t=(n,e,t,s)=>{let i=e.$children$[t],r=0,o,a,l;if(wi||(Ss=!0,i.$tag$==="slot"&&(xe&&s.classList.add(xe+"-s"),i.$flags$|=i.$children$?2:1)),i.$text$!==null)o=i.$elm$=V.createTextNode(i.$text$);else if(i.$flags$&1)o=i.$elm$=V.createTextNode("");else{if(L||(L=i.$tag$==="svg"),o=i.$elm$=V.createElementNS(L?ra:oa,i.$flags$&2?"slot-fb":i.$tag$),L&&i.$tag$==="foreignObject"&&(L=!1),Si(null,i,L),aa(xe)&&o["s-si"]!==xe&&o.classList.add(o["s-si"]=xe),i.$children$)for(r=0;r<i.$children$.length;++r)a=$t(n,i,r,o),a&&o.appendChild(a);i.$tag$==="svg"?L=!1:o.tagName==="foreignObject"&&(L=!0)}return o["s-hn"]=Pt,i.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=xi,o["s-sn"]=i.$name$||"",l=n&&n.$children$&&n.$children$[t],l&&l.$tag$===i.$tag$&&n.$elm$&&qe(n.$elm$,!1)),o},qe=(n,e)=>{P.$flags$|=1;const t=n.childNodes;for(let s=t.length-1;s>=0;s--){const i=t[s];i["s-hn"]!==Pt&&i["s-ol"]&&(Ti(i).insertBefore(i,Ts(i)),i["s-ol"].remove(),i["s-ol"]=void 0,Ss=!0),e&&qe(i,e)}P.$flags$&=-2},Ei=(n,e,t,s,i,r)=>{let o=n["s-cr"]&&n["s-cr"].parentNode||n,a;for(o.shadowRoot&&o.tagName===Pt&&(o=o.shadowRoot);i<=r;++i)s[i]&&(a=$t(null,t,i,n),a&&(s[i].$elm$=a,o.insertBefore(a,Ts(e))))},Ai=(n,e,t,s,i)=>{for(;e<=t;++e)(s=n[e])&&(i=s.$elm$,Li(s),bt=!0,i["s-ol"]?i["s-ol"].remove():qe(i,!0),i.remove())},da=(n,e,t,s)=>{let i=0,r=0,o=0,a=0,l=e.length-1,c=e[0],h=e[l],u=s.length-1,d=s[0],p=s[u],b,m;for(;i<=l&&r<=u;)if(c==null)c=e[++i];else if(h==null)h=e[--l];else if(d==null)d=s[++r];else if(p==null)p=s[--u];else if(ot(c,d))we(c,d),c=e[++i],d=s[++r];else if(ot(h,p))we(h,p),h=e[--l],p=s[--u];else if(ot(c,p))(c.$tag$==="slot"||p.$tag$==="slot")&&qe(c.$elm$.parentNode,!1),we(c,p),n.insertBefore(c.$elm$,h.$elm$.nextSibling),c=e[++i],p=s[--u];else if(ot(h,d))(c.$tag$==="slot"||p.$tag$==="slot")&&qe(h.$elm$.parentNode,!1),we(h,d),n.insertBefore(h.$elm$,c.$elm$),h=e[--l],d=s[++r];else{for(o=-1,a=i;a<=l;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===d.$key$){o=a;break}o>=0?(m=e[o],m.$tag$!==d.$tag$?b=$t(e&&e[r],t,o,n):(we(m,d),e[o]=void 0,b=m.$elm$),d=s[++r]):(b=$t(e&&e[r],t,r,n),d=s[++r]),b&&Ti(c.$elm$).insertBefore(b,Ts(c.$elm$))}i>l?Ei(n,s[u+1]==null?null:s[u+1].$elm$,t,s,r,u):r>u&&Ai(e,i,l)},ot=(n,e)=>n.$tag$===e.$tag$?n.$tag$==="slot"?n.$name$===e.$name$:n.$key$===e.$key$:!1,Ts=n=>n&&n["s-ol"]||n,Ti=n=>(n["s-ol"]?n["s-ol"]:n).parentNode,we=(n,e)=>{const t=e.$elm$=n.$elm$,s=n.$children$,i=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(L=r==="svg"?!0:r==="foreignObject"?!1:L,r==="slot"||Si(n,e,L),s!==null&&i!==null?da(t,s,e,i):i!==null?(n.$text$!==null&&(t.textContent=""),Ei(t,null,e,i,0,i.length-1)):s!==null&&Ai(s,0,s.length-1),L&&r==="svg"&&(L=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:n.$text$!==o&&(t.data=o)},Oi=n=>{let e=n.childNodes,t,s,i,r,o,a;for(s=0,i=e.length;s<i;s++)if(t=e[s],t.nodeType===1){if(t["s-sr"]){for(o=t["s-sn"],t.hidden=!1,r=0;r<i;r++)if(a=e[r].nodeType,e[r]["s-hn"]!==t["s-hn"]||o!==""){if(a===1&&o===e[r].getAttribute("slot")){t.hidden=!0;break}}else if(a===1||a===3&&e[r].textContent.trim()!==""){t.hidden=!0;break}}Oi(t)}},z=[],Pi=n=>{let e,t,s,i,r,o,a=0,l=n.childNodes,c=l.length;for(;a<c;a++){if(e=l[a],e["s-sr"]&&(t=e["s-cr"])&&t.parentNode)for(s=t.parentNode.childNodes,i=e["s-sn"],o=s.length-1;o>=0;o--)t=s[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&(wn(t,i)?(r=z.find(h=>h.$nodeToRelocate$===t),bt=!0,t["s-sn"]=t["s-sn"]||i,r?r.$slotRefNode$=e:z.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&z.map(h=>{wn(h.$nodeToRelocate$,t["s-sn"])&&(r=z.find(u=>u.$nodeToRelocate$===t),r&&!h.$slotRefNode$&&(h.$slotRefNode$=r.$slotRefNode$))})):z.some(h=>h.$nodeToRelocate$===t)||z.push({$nodeToRelocate$:t}));e.nodeType===1&&Pi(e)}},wn=(n,e)=>n.nodeType===1?n.getAttribute("slot")===null&&e===""||n.getAttribute("slot")===e:n["s-sn"]===e?!0:e==="",Li=n=>{n.$attrs$&&n.$attrs$.ref&&n.$attrs$.ref(null),n.$children$&&n.$children$.map(Li)},pa=(n,e)=>{const t=n.$hostElement$,s=n.$cmpMeta$,i=n.$vnode$||yt(null,null),r=la(e)?e:Ce(null,null,e);Pt=t.tagName,s.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},s.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,n.$vnode$=r,r.$elm$=i.$elm$=t.shadowRoot||t,xe=t["s-sc"],xi=t["s-cr"],wi=(s.$flags$&1)!==0,bt=!1,we(i,r);{if(P.$flags$|=1,Ss){Pi(r.$elm$);let o,a,l,c,h,u,d=0;for(;d<z.length;d++)o=z[d],a=o.$nodeToRelocate$,a["s-ol"]||(l=V.createTextNode(""),l["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=l,a));for(d=0;d<z.length;d++)if(o=z[d],a=o.$nodeToRelocate$,o.$slotRefNode$){for(c=o.$slotRefNode$.parentNode,h=o.$slotRefNode$.nextSibling,l=a["s-ol"];l=l.previousSibling;)if(u=l["s-nr"],u&&u["s-sn"]===a["s-sn"]&&c===u.parentNode&&(u=u.nextSibling,!u||!u["s-nr"])){h=u;break}(!h&&c!==a.parentNode||a.nextSibling!==h)&&a!==h&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),c.insertBefore(a,h))}else a.nodeType===1&&(a.hidden=!0)}bt&&Oi(r.$elm$),P.$flags$&=-2,z.length=0}},fa=n=>n,ga=(n,e,t)=>{const s=fa(n);return{emit:i=>ma(s,e,{bubbles:!!(t&4),composed:!!(t&2),cancelable:!!(t&1),detail:i})}},ma=(n,e,t)=>{const s=P.ce(e,t);return n.dispatchEvent(s),s},va=(n,e)=>{},Ii=(n,e)=>(n.$flags$|=16,va(n,n.$ancestorComponent$),Ma(()=>ba(n,e))),ba=(n,e)=>{const t=n.$hostElement$,s=ge("scheduleUpdate",n.$cmpMeta$.$tagName$),i=t;let r;return e?r=_e(i,"componentWillLoad"):r=_e(i,"componentWillUpdate"),r=kn(r,()=>_e(i,"componentWillRender")),s(),kn(r,()=>ya(n,i,e))},ya=async(n,e,t)=>{const s=n.$hostElement$,i=ge("update",n.$cmpMeta$.$tagName$);s["s-rc"],t&&na(n);const r=ge("render",n.$cmpMeta$.$tagName$);$a(n,e,s),r(),i(),xa(n)},$a=(n,e,t)=>{try{gn=e,e=e.render&&e.render(),n.$flags$&=-17,n.$flags$|=2,($e.hasRenderFn||$e.reflect)&&($e.vdomRender||$e.reflect)&&($e.hydrateServerSide||pa(n,e))}catch(a){Ye(a,n.$hostElement$)}return gn=null,null},xa=n=>{const e=n.$cmpMeta$.$tagName$,t=n.$hostElement$,s=ge("postUpdate",e),i=t;n.$ancestorComponent$,_e(i,"componentDidRender"),n.$flags$&64?(_e(i,"componentDidUpdate"),s()):(n.$flags$|=64,_e(i,"componentDidLoad"),s())},_e=(n,e,t)=>{if(n&&n[e])try{return n[e](t)}catch(s){Ye(s)}},kn=(n,e)=>n&&n.then?n.then(e):e(),wa=(n,e)=>n!=null&&!Es(n)?e&4?n==="false"?!1:n===""||!!n:e&2?parseFloat(n):e&1?String(n):n:n,ka=(n,e)=>It(n).$instanceValues$.get(e),Ca=(n,e,t,s)=>{const i=It(n),r=n,o=i.$instanceValues$.get(e),a=i.$flags$,l=r;t=wa(t,s.$members$[e][0]);const c=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!c){i.$instanceValues$.set(e,t);{if(s.$watchers$&&a&128){const u=s.$watchers$[e];u&&u.map(d=>{try{l[d](t,o,e)}catch(p){Ye(p,r)}})}if((a&18)===2){if(l.componentShouldUpdate&&l.componentShouldUpdate(t,o,e)===!1)return;Ii(i,!1)}}}},_a=(n,e,t)=>{if(e.$members$){n.watchers&&(e.$watchers$=n.watchers);const s=Object.entries(e.$members$),i=n.prototype;s.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(i,r,{get(){return ka(this,r)},set(a){Ca(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;i.attributeChangedCallback=function(o,a,l){P.jmp(()=>{const c=r.get(o);if(this.hasOwnProperty(c))l=this[c],delete this[c];else if(i.hasOwnProperty(c)&&typeof this[c]=="number"&&this[c]==l)return;this[c]=l===null&&typeof this[c]=="boolean"?!1:l})},n.observedAttributes=s.filter(([o,a])=>a[0]&15).map(([o,a])=>{const l=a[1]||o;return r.set(l,o),a[0]&512&&e.$attrsToReflect$.push([o,l]),l})}}return n},Sa=async(n,e,t,s,i)=>{if(!(e.$flags$&32)&&(i=n.constructor,e.$flags$|=32,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),i.style)){let o=i.style;typeof o!="string"&&(o=o[e.$modeName$=ia(n)]);const a=_i(t,e.$modeName$);if(!xt.has(a)){const l=ge("registerStyles",t.$tagName$);ta(a,o,!!(t.$flags$&1)),l()}}e.$ancestorComponent$,(()=>Ii(e,!0))()},Ea=n=>{},Aa=n=>{if(!(P.$flags$&1)){const e=It(n),t=e.$cmpMeta$,s=ge("connectedCallback",t.$tagName$);e.$flags$&1?(Ci(n,e,t.$listeners$),Ea(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&Ta(n),t.$members$&&Object.entries(t.$members$).map(([i,[r]])=>{if(r&31&&n.hasOwnProperty(i)){const o=n[i];delete n[i],n[i]=o}}),Sa(n,e,t)),s()}},Ta=n=>{const e=n["s-cr"]=V.createComment("");e["s-cn"]=!0,n.insertBefore(e,n.firstChild)},Oa=n=>{if(!(P.$flags$&1)){const e=It(n);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},Ri=(n,e)=>{const t={$flags$:e[0],$tagName$:e[1]};t.$members$=e[2],t.$listeners$=e[3],t.$watchers$=n.$watchers$,t.$attrsToReflect$=[];const s=n.prototype.connectedCallback,i=n.prototype.disconnectedCallback;return Object.assign(n.prototype,{__registerHost(){Pa(this,t)},connectedCallback(){Aa(this),s&&s.call(this)},disconnectedCallback(){Oa(this),i&&i.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),n.is=t.$tagName$,_a(n,t)},Mi=new WeakMap,It=n=>Mi.get(n),Pa=(n,e)=>{const t={$flags$:0,$hostElement$:n,$cmpMeta$:e,$instanceValues$:new Map};return Ci(n,t,e.$listeners$),Mi.set(n,t)},Cn=(n,e)=>e in n,Ye=(n,e)=>(0,console.error)(n,e),xt=new Map,La=[],_n=[],ji=[],Ia=(n,e)=>t=>{n.push(t),as||(as=!0,e&&P.$flags$&4?Ra(ls):P.raf(ls))},Sn=n=>{for(let e=0;e<n.length;e++)try{n[e](performance.now())}catch(t){Ye(t)}n.length=0},ls=()=>{Sn(_n),Sn(ji),(as=_n.length>0)&&P.raf(ls)},Ra=n=>Go().then(n),Ma=Ia(ji,!0),ja=(n={})=>{const{content:e="",title:t,attributes:s=[]}=n;let i="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...s];return t&&(i=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${i}${e}</svg>`},Ua=n=>n.replace(/<(\/?)svg([^>]*)>/g,"").trim();function za(n){return`${n.getFullYear()}.${n.getMonth()+1}`}class Da{constructor(e){this.voca_component=e,this.voca_added=za(new Date)}}const Ha="telia-vst{display:none}",Na=Ri(class extends ki{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=ga(this,"vocaInternalUStats",7)}connectedCallback(){this.vocaInternalUStats.emit(new Da(this.dataTrackingId))}render(){return Ce(As,null)}static get style(){return Ha}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function Ui(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,Na);break}})}Ui();function cs(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function Ba(){if(typeof cs().vocadsIcons!==void 0)return cs().vocadsIcons}function qa(){return cs().vocadsIconsRegistered}const Fa=".telia-icon{display:inline-block}.telia-icon__container{display:block;height:inherit}.telia-icon svg{display:block}.telia-icon--sm{height:calc(1.6rem * var(--voca-rem-multiplier));min-width:calc(1.6rem * var(--voca-rem-multiplier));width:calc(1.6rem * var(--voca-rem-multiplier))}.telia-icon--md{height:calc(2.4rem * var(--voca-rem-multiplier));min-width:calc(2.4rem * var(--voca-rem-multiplier));width:calc(2.4rem * var(--voca-rem-multiplier))}.telia-icon--lg{height:calc(3.2rem * var(--voca-rem-multiplier));min-width:calc(3.2rem * var(--voca-rem-multiplier));width:calc(3.2rem * var(--voca-rem-multiplier))}",Va=Ri(class extends ki{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(qa()&&this.name){const n=Ba();return n[this.name]?n[this.name].svg:""}return this.name&&console.warn(this.name,"Icons bundle is not registered and will not be rendered. Check if you have registered icons bundle or use svg property"),""}render(){let n=this.getSvgString(),e=[{name:"viewBox",value:"0 0 64 64"}];this.allyTitle?e=[...e,{name:"role",value:"img"}]:e=[...e,{name:"aria-hidden",value:"true"}];const t=ja({content:Ua(n),attributes:e,title:this.allyTitle});return Ce(As,{class:`telia-icon telia-icon--${this.size}`},Ce("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),Ce("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return Fa}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Za(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,Va);break;case"telia-vst":customElements.get(e)||Ui();break}})}Za();/**
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
25
- */const ie=n=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};/**
25
+ */const re=n=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};/**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
28
28
  * SPDX-License-Identifier: BSD-3-Clause
29
- */const Ga={attribute:!0,type:String,converter:vt,reflect:!1,hasChanged:_s},Ka=(n=Ga,e,t)=>{const{kind:s,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(t.name,n),s==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,n)},init(a){return a!==void 0&&this.P(o,void 0,n),a}}}if(s==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,n)}}throw Error("Unsupported decorator location: "+s)};function w(n){return(e,t)=>typeof t=="object"?Ka(n,e,t):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,e,t)}/**
29
+ */const Wa={attribute:!0,type:String,converter:mt,reflect:!1,hasChanged:Cs},Qa=(n=Wa,e,t)=>{const{kind:s,metadata:i}=t;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),r.set(t.name,n),s==="accessor"){const{name:o}=t;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(o,l,n)},init(a){return a!==void 0&&this.P(o,void 0,n),a}}}if(s==="setter"){const{name:o}=t;return function(a){const l=this[o];e.call(this,a),this.requestUpdate(o,l,n)}}throw Error("Unsupported decorator location: "+s)};function k(n){return(e,t)=>typeof t=="object"?Qa(n,e,t):((s,i,r)=>{const o=i.hasOwnProperty(r);return i.constructor.createProperty(r,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(i,r):void 0})(n,e,t)}/**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */function C(n){return w({...n,state:!0,attribute:!1})}/**
33
+ */function C(n){return k({...n,state:!0,attribute:!1})}/**
34
34
  * @license
35
35
  * Copyright 2020 Google LLC
36
36
  * SPDX-License-Identifier: BSD-3-Clause
37
- */const Ja=n=>n.strings===void 0;/**
37
+ */const Ya=n=>n.strings===void 0;/**
38
38
  * @license
39
39
  * Copyright 2017 Google LLC
40
40
  * SPDX-License-Identifier: BSD-3-Clause
41
- */const Ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Je=n=>(...e)=>({_$litDirective$:n,values:e});let Ut=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
41
+ */const Ge={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ke=n=>(...e)=>({_$litDirective$:n,values:e});let Rt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,s){this._$Ct=e,this._$AM=t,this._$Ci=s}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/**
42
42
  * @license
43
43
  * Copyright 2017 Google LLC
44
44
  * SPDX-License-Identifier: BSD-3-Clause
45
- */const Ue=(n,e)=>{var s;const t=n._$AN;if(t===void 0)return!1;for(const i of t)(s=i._$AO)==null||s.call(i,e,!1),Ue(i,e);return!0},kt=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},Di=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),tl(e)}};function Xa(n){this._$AN!==void 0?(kt(this),this._$AM=n,Di(this)):this._$AM=n}function el(n,e=!1,t=0){const s=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(s))for(let r=t;r<s.length;r++)Ue(s[r],!1),kt(s[r]);else s!=null&&(Ue(s,!1),kt(s));else Ue(this,n)}const tl=n=>{n.type==Ke.CHILD&&(n._$AP??(n._$AP=el),n._$AQ??(n._$AQ=Xa))};let Hi=class extends Ut{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,s){super._$AT(e,t,s),Di(this),this.isConnected=e._$AU}_$AO(e,t=!0){var s,i;e!==this.isConnected&&(this.isConnected=e,e?(s=this.reconnected)==null||s.call(this):(i=this.disconnected)==null||i.call(this)),t&&(Ue(this,e),kt(this))}setValue(e){if(Ja(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/**
45
+ */const je=(n,e)=>{var s;const t=n._$AN;if(t===void 0)return!1;for(const i of t)(s=i._$AO)==null||s.call(i,e,!1),je(i,e);return!0},wt=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},zi=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),Ja(e)}};function Ga(n){this._$AN!==void 0?(wt(this),this._$AM=n,zi(this)):this._$AM=n}function Ka(n,e=!1,t=0){const s=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(s))for(let r=t;r<s.length;r++)je(s[r],!1),wt(s[r]);else s!=null&&(je(s,!1),wt(s));else je(this,n)}const Ja=n=>{n.type==Ge.CHILD&&(n._$AP??(n._$AP=Ka),n._$AQ??(n._$AQ=Ga))};let Di=class extends Rt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,s){super._$AT(e,t,s),zi(this),this.isConnected=e._$AU}_$AO(e,t=!0){var s,i;e!==this.isConnected&&(this.isConnected=e,e?(s=this.reconnected)==null||s.call(this):(i=this.disconnected)==null||i.call(this)),t&&(je(this,e),wt(this))}setValue(e){if(Ya(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};/**
46
46
  * @license
47
47
  * Copyright 2020 Google LLC
48
48
  * SPDX-License-Identifier: BSD-3-Clause
49
- */const H=()=>new sl;class sl{}const Xt=new WeakMap,B=Je(class extends Hi{render(n){return g}update(n,[e]){var s;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(s=n.options)==null?void 0:s.host,this.rt(this.ct=n.element)),g}rt(n){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=Xt.get(e);t===void 0&&(t=new WeakMap,Xt.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,e;return typeof this.Y=="function"?(n=Xt.get(this.ht??globalThis))==null?void 0:n.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
49
+ */const H=()=>new Xa;class Xa{}const Gt=new WeakMap,N=Ke(class extends Di{render(n){return g}update(n,[e]){var s;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(s=n.options)==null?void 0:s.host,this.rt(this.ct=n.element)),g}rt(n){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=Gt.get(e);t===void 0&&(t=new WeakMap,Gt.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,e;return typeof this.Y=="function"?(n=Gt.get(this.ht??globalThis))==null?void 0:n.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
50
50
  * @license
51
51
  * Copyright 2018 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
53
- */const Ae=Je(class extends Ut{constructor(n){var e;if(super(n),n.type!==Ke.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var s,i;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(e)}const t=n.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const o=!!e[r];o===this.st.has(r)||(i=this.nt)!=null&&i.has(r)||(o?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return K}});var nl=Object.defineProperty,il=Object.getOwnPropertyDescriptor,rl=(n,e,t,s)=>{for(var i=s>1?void 0:s?il(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&nl(e,t,i),i};class Ps extends k{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(e){var t;return(t=this.shadowRoot)==null||t.appendChild(e),e}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),g}}Ps.styles=[_`
53
+ */const Ae=Ke(class extends Rt{constructor(n){var e;if(super(n),n.type!==Ge.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var s,i;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(r=>r!=="")));for(const r in e)e[r]&&!((s=this.nt)!=null&&s.has(r))&&this.st.add(r);return this.render(e)}const t=n.element.classList;for(const r of this.st)r in e||(t.remove(r),this.st.delete(r));for(const r in e){const o=!!e[r];o===this.st.has(r)||(i=this.nt)!=null&&i.has(r)||(o?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return J}});var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,sl=(n,e,t,s)=>{for(var i=s>1?void 0:s?tl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&el(e,t,i),i};class Os extends w{constructor(){super(...arguments),this.anchor="BottomRight"}appendChild(e){var t;return(t=this.shadowRoot)==null||t.appendChild(e),e}render(){return this.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right"),g}}Os.styles=[_`
54
54
  :host {
55
55
  position: fixed;
56
56
  display: flex;
@@ -66,20 +66,20 @@
66
66
  bottom: 20px;
67
67
  left: 20px;
68
68
  }
69
- `];rl([w({attribute:!0})],Ps.prototype,"anchor",2);const ol=new WeakMap;let An=0;const es=new Map,Tn=new WeakSet,On=()=>new Promise(n=>requestAnimationFrame(n)),al=[{transform:"translateX(100%) scale(0)",opacity:0}],ll=[{opacity:0}],Pn=[{opacity:0},{opacity:1}],Ln=(n,e)=>{const t=n-e;return t===0?void 0:t},In=(n,e)=>{const t=n/e;return t===1?void 0:t},ts={left:(n,e)=>{const t=Ln(n,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateX(${t}px)`}},top:(n,e)=>{const t=Ln(n,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateY(${t}px)`}},width:(n,e)=>{let t;e===0&&(e=1,t={width:"1px"});const s=In(n,e);return{value:s,overrideFrom:t,transform:s==null||isNaN(s)?void 0:`scaleX(${s})`}},height:(n,e)=>{let t;e===0&&(e=1,t={height:"1px"});const s=In(n,e);return{value:s,overrideFrom:t,transform:s==null||isNaN(s)?void 0:`scaleY(${s})`}}},cl={duration:333,easing:"ease-in-out"},hl=["left","top","width","height","opacity","color","background"],Rn=new WeakMap;class ul extends Hi{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===Ke.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var e;(e=this.resolveFinished)==null||e.call(this),this.finished=new Promise(t=>{this.l=t})}async resolveFinished(){var e;(e=this.l)==null||e.call(this),this.l=void 0}render(e){return g}getController(){return ol.get(this.u)}isDisabled(){var e;return this.options.disabled||((e=this.getController())==null?void 0:e.disabled)}update(e,[t]){var i;const s=this.u===void 0;return s&&(this.u=(i=e.options)==null?void 0:i.host,this.u.addController(this),this.u.updateComplete.then(r=>this.t=!0),this.element=e.element,Rn.set(this.element,this)),this.optionsOrCallback=t,(s||typeof t!="function")&&this.p(t),this.render(t)}p(e){e=e??{};const t=this.getController();t!==void 0&&((e={...t.defaultOptions,...e}).keyframeOptions={...t.defaultOptions.keyframeOptions,...e.keyframeOptions}),e.properties??(e.properties=hl),this.options=e}m(){const e={},t=this.element.getBoundingClientRect(),s=getComputedStyle(this.element);return this.options.properties.forEach(i=>{const r=t[i]??(ts[i]?void 0:s[i]),o=Number(r);e[i]=isNaN(o)?r+"":o}),e}v(){let e,t=!0;return this.options.guard&&(e=this.options.guard(),t=((s,i)=>{if(Array.isArray(s)){if(Array.isArray(i)&&i.length===s.length&&s.every((r,o)=>r===i[o]))return!1}else if(i===s)return!1;return!0})(e,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&t&&this.element.isConnected,this.h&&(this._=Array.isArray(e)?Array.from(e):e),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 e;this.prepare(),await On;const t=this.O(),s=this.j(this.options.keyframeOptions,t),i=this.m();if(this.A!==void 0){const{from:r,to:o}=this.N(this.A,i,t);this.log("measured",[this.A,i,r,o]),e=this.calculateKeyframes(r,o)}else{const r=es.get(this.options.inId);if(r){es.delete(this.options.inId);const{from:o,to:a}=this.N(r,i,t);e=this.calculateKeyframes(o,a),e=this.options.in?[{...this.options.in[0],...e[0]},...this.options.in.slice(1),e[1]]:e,An++,e.forEach(l=>l.zIndex=An)}else this.options.in&&(e=[...this.options.in,{}])}this.animate(e,s)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var e,t;this.P=this.element.getAttribute("style"),(e=this.webAnimation)==null||e.commitStyles(),(t=this.webAnimation)==null||t.cancel()}reconnected(){}async disconnected(){var t;if(!this.h||(this.options.id!==void 0&&es.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await On(),(t=this.i)==null?void 0:t.isConnected){const s=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,s),this.options.stabilizeOut){const i=this.m();this.log("stabilizing out");const r=this.A.left-i.left,o=this.A.top-i.top;getComputedStyle(this.element).position!=="static"||r===0&&o===0||(this.element.style.position="relative"),r!==0&&(this.element.style.left=r+"px"),o!==0&&(this.element.style.top=o+"px")}}const e=this.j(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var e,t;(t=(e=this.options).onStart)==null||t.call(e,this)}didFinish(e){var t,s;e&&((s=(t=this.options).onComplete)==null||s.call(t,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const e=[];for(let t=this.element.parentNode;t;t=t==null?void 0:t.parentNode){const s=Rn.get(t);s&&!s.isDisabled()&&s&&e.push(s)}return e}get isHostRendered(){const e=Tn.has(this.u);return e||this.u.updateComplete.then(()=>{Tn.add(this.u)}),e}j(e,t=this.O()){const s={...cl};return t.forEach(i=>Object.assign(s,i.options.keyframeOptions)),Object.assign(s,e),s}N(e,t,s){e={...e},t={...t};const i=s.map(a=>a.animatingProperties).filter(a=>a!==void 0);let r=1,o=1;return i.length>0&&(i.forEach(a=>{a.width&&(r/=a.width),a.height&&(o/=a.height)}),e.left!==void 0&&t.left!==void 0&&(e.left=r*e.left,t.left=r*t.left),e.top!==void 0&&t.top!==void 0&&(e.top=o*e.top,t.top=o*t.top)),{from:e,to:t}}calculateKeyframes(e,t,s=!1){const i={},r={};let o=!1;const a={};for(const l in t){const c=e[l],h=t[l];if(l in ts){const u=ts[l];if(c===void 0||h===void 0)continue;const d=u(c,h);d.transform!==void 0&&(a[l]=d.value,o=!0,i.transform=`${i.transform??""} ${d.transform}`,d.overrideFrom!==void 0&&Object.assign(i,d.overrideFrom))}else c!==h&&c!==void 0&&h!==void 0&&(o=!0,i[l]=c,r[l]=h)}return i.transformOrigin=r.transformOrigin=s?"center center":"top left",this.animatingProperties=a,o?[i,r]:void 0}async animate(e,t=this.options.keyframeOptions){this.start(),this.frames=e;let s=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=e=this.options.onFrames(this),this.log("modified frames",e)),e!==void 0)){this.log("animate",[e,t]),s=!0,this.webAnimation=this.element.animate(e,t);const i=this.getController();i==null||i.add(this);try{await this.webAnimation.finished}catch{}i==null||i.remove(this)}return this.didFinish(s),s}isAnimating(){var e,t;return((e=this.webAnimation)==null?void 0:e.playState)==="running"||((t=this.webAnimation)==null?void 0:t.pending)}log(e,t){this.shouldLog&&!this.isDisabled()&&console.log(e,this.options.id,t)}}const ps=Je(ul),at=(n,e,t)=>{n&&t.style.setProperty(e,n)},Bi=(n,e)=>{var t,s,i,r;at((t=n.colors)==null?void 0:t.primaryBackground,"--primary-background",e),at((s=n.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",e),at((i=n.colors)==null?void 0:i.secondaryBackground,"--secondary-background",e),at((r=n.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",e)};var dl=Object.defineProperty,pl=Object.getOwnPropertyDescriptor,Xe=(n,e,t,s)=>{for(var i=s>1?void 0:s?pl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&dl(e,t,i),i};class re extends k{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=H(),this.widgetActive$=new N(!1),this.componentIsDestroyed$=new S}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var e;if(!((e=this.application)!=null&&e.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.widgetActive$.next(!0)):(this.application.hide(),this.widgetActive$.next(!1))}_applyBranding(){var e;(e=this.application)!=null&&e.settings&&Bi(this.application.settings.branding,this)}async _renderSymbol(){var a,l,c;const e=(a=this.application)==null?void 0:a.branding(),t=(l=e==null?void 0:e.graphics)==null?void 0:l.trigger;if(t)return f` <img src=${t} class="trigger-icon" alt="" /> `;const s=(c=this.application)==null?void 0:c.triggerIcon;if(!s)return g;const i=async h=>Ko,{type:r,content:o}=s;switch(r){case"Telia":{const h=await i();return h?f`<telia-icon
69
+ `];sl([k({attribute:!0})],Os.prototype,"anchor",2);const nl=new WeakMap;let En=0;const Kt=new Map,An=new WeakSet,Tn=()=>new Promise(n=>requestAnimationFrame(n)),il=[{transform:"translateX(100%) scale(0)",opacity:0}],rl=[{opacity:0}],On=[{opacity:0},{opacity:1}],Pn=(n,e)=>{const t=n-e;return t===0?void 0:t},Ln=(n,e)=>{const t=n/e;return t===1?void 0:t},Jt={left:(n,e)=>{const t=Pn(n,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateX(${t}px)`}},top:(n,e)=>{const t=Pn(n,e);return{value:t,transform:t==null||isNaN(t)?void 0:`translateY(${t}px)`}},width:(n,e)=>{let t;e===0&&(e=1,t={width:"1px"});const s=Ln(n,e);return{value:s,overrideFrom:t,transform:s==null||isNaN(s)?void 0:`scaleX(${s})`}},height:(n,e)=>{let t;e===0&&(e=1,t={height:"1px"});const s=Ln(n,e);return{value:s,overrideFrom:t,transform:s==null||isNaN(s)?void 0:`scaleY(${s})`}}},ol={duration:333,easing:"ease-in-out"},al=["left","top","width","height","opacity","color","background"],In=new WeakMap;class ll extends Di{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===Ge.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var e;(e=this.resolveFinished)==null||e.call(this),this.finished=new Promise(t=>{this.l=t})}async resolveFinished(){var e;(e=this.l)==null||e.call(this),this.l=void 0}render(e){return g}getController(){return nl.get(this.u)}isDisabled(){var e;return this.options.disabled||((e=this.getController())==null?void 0:e.disabled)}update(e,[t]){var i;const s=this.u===void 0;return s&&(this.u=(i=e.options)==null?void 0:i.host,this.u.addController(this),this.u.updateComplete.then(r=>this.t=!0),this.element=e.element,In.set(this.element,this)),this.optionsOrCallback=t,(s||typeof t!="function")&&this.p(t),this.render(t)}p(e){e=e??{};const t=this.getController();t!==void 0&&((e={...t.defaultOptions,...e}).keyframeOptions={...t.defaultOptions.keyframeOptions,...e.keyframeOptions}),e.properties??(e.properties=al),this.options=e}m(){const e={},t=this.element.getBoundingClientRect(),s=getComputedStyle(this.element);return this.options.properties.forEach(i=>{const r=t[i]??(Jt[i]?void 0:s[i]),o=Number(r);e[i]=isNaN(o)?r+"":o}),e}v(){let e,t=!0;return this.options.guard&&(e=this.options.guard(),t=((s,i)=>{if(Array.isArray(s)){if(Array.isArray(i)&&i.length===s.length&&s.every((r,o)=>r===i[o]))return!1}else if(i===s)return!1;return!0})(e,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&t&&this.element.isConnected,this.h&&(this._=Array.isArray(e)?Array.from(e):e),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 e;this.prepare(),await Tn;const t=this.O(),s=this.j(this.options.keyframeOptions,t),i=this.m();if(this.A!==void 0){const{from:r,to:o}=this.N(this.A,i,t);this.log("measured",[this.A,i,r,o]),e=this.calculateKeyframes(r,o)}else{const r=Kt.get(this.options.inId);if(r){Kt.delete(this.options.inId);const{from:o,to:a}=this.N(r,i,t);e=this.calculateKeyframes(o,a),e=this.options.in?[{...this.options.in[0],...e[0]},...this.options.in.slice(1),e[1]]:e,En++,e.forEach(l=>l.zIndex=En)}else this.options.in&&(e=[...this.options.in,{}])}this.animate(e,s)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){var e,t;this.P=this.element.getAttribute("style"),(e=this.webAnimation)==null||e.commitStyles(),(t=this.webAnimation)==null||t.cancel()}reconnected(){}async disconnected(){var t;if(!this.h||(this.options.id!==void 0&&Kt.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Tn(),(t=this.i)==null?void 0:t.isConnected){const s=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,s),this.options.stabilizeOut){const i=this.m();this.log("stabilizing out");const r=this.A.left-i.left,o=this.A.top-i.top;getComputedStyle(this.element).position!=="static"||r===0&&o===0||(this.element.style.position="relative"),r!==0&&(this.element.style.left=r+"px"),o!==0&&(this.element.style.top=o+"px")}}const e=this.j(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var e,t;(t=(e=this.options).onStart)==null||t.call(e,this)}didFinish(e){var t,s;e&&((s=(t=this.options).onComplete)==null||s.call(t,this)),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const e=[];for(let t=this.element.parentNode;t;t=t==null?void 0:t.parentNode){const s=In.get(t);s&&!s.isDisabled()&&s&&e.push(s)}return e}get isHostRendered(){const e=An.has(this.u);return e||this.u.updateComplete.then(()=>{An.add(this.u)}),e}j(e,t=this.O()){const s={...ol};return t.forEach(i=>Object.assign(s,i.options.keyframeOptions)),Object.assign(s,e),s}N(e,t,s){e={...e},t={...t};const i=s.map(a=>a.animatingProperties).filter(a=>a!==void 0);let r=1,o=1;return i.length>0&&(i.forEach(a=>{a.width&&(r/=a.width),a.height&&(o/=a.height)}),e.left!==void 0&&t.left!==void 0&&(e.left=r*e.left,t.left=r*t.left),e.top!==void 0&&t.top!==void 0&&(e.top=o*e.top,t.top=o*t.top)),{from:e,to:t}}calculateKeyframes(e,t,s=!1){const i={},r={};let o=!1;const a={};for(const l in t){const c=e[l],h=t[l];if(l in Jt){const u=Jt[l];if(c===void 0||h===void 0)continue;const d=u(c,h);d.transform!==void 0&&(a[l]=d.value,o=!0,i.transform=`${i.transform??""} ${d.transform}`,d.overrideFrom!==void 0&&Object.assign(i,d.overrideFrom))}else c!==h&&c!==void 0&&h!==void 0&&(o=!0,i[l]=c,r[l]=h)}return i.transformOrigin=r.transformOrigin=s?"center center":"top left",this.animatingProperties=a,o?[i,r]:void 0}async animate(e,t=this.options.keyframeOptions){this.start(),this.frames=e;let s=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=e=this.options.onFrames(this),this.log("modified frames",e)),e!==void 0)){this.log("animate",[e,t]),s=!0,this.webAnimation=this.element.animate(e,t);const i=this.getController();i==null||i.add(this);try{await this.webAnimation.finished}catch{}i==null||i.remove(this)}return this.didFinish(s),s}isAnimating(){var e,t;return((e=this.webAnimation)==null?void 0:e.playState)==="running"||((t=this.webAnimation)==null?void 0:t.pending)}log(e,t){this.shouldLog&&!this.isDisabled()&&console.log(e,this.options.id,t)}}const hs=Ke(ll),Q=(n,e,t)=>{n&&t.style.setProperty(e,n)},Hi=(n,e)=>{var t,s,i,r,o,a,l,c,h;Q((t=n.colors)==null?void 0:t.primaryBackground,"--primary-background",e),Q((s=n.colors)==null?void 0:s.textOnPrimaryBackground,"--text-on-primary-background",e),Q((i=n.colors)==null?void 0:i.secondaryBackground,"--secondary-background",e),Q((r=n.colors)==null?void 0:r.textOnSecondaryBackground,"--text-on-secondary-background",e),Q((o=n.colors)==null?void 0:o.interactiveDestructiveBackground,"--destructive-color",e),Q((a=n.colors)==null?void 0:a.interactiveTextOnDestructiveBackground,"--text-on-destructive-color",e),Q((l=n.colors)==null?void 0:l.interactivePrimaryBackground,"--interactive-primary-background",e),Q((c=n.colors)==null?void 0:c.interactiveTextOnPrimaryBackground,"--interactive-text-on-primary-background",e),Q((h=n.colors)==null?void 0:h.focusColor,"--focus-color",e)};var cl=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,Je=(n,e,t,s)=>{for(var i=s>1?void 0:s?hl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&cl(e,t,i),i};class oe extends w{constructor(){super(...arguments),this.active=!1,this.triggerVisible=!0,this.loaded=!1,this.containerRef=H(),this.widgetActive$=new B(!1),this.componentIsDestroyed$=new S}async connectedCallback(){super.connectedCallback(),this.icon=await this._renderSymbol(),this.loaded=!0,this._applyBranding()}disconnectedCallback(){super.disconnectedCallback(),this.componentIsDestroyed$.next(),this.componentIsDestroyed$.complete()}toggleActive(){var e;if(!((e=this.application)!=null&&e.root)){console.warn("Could not activate widget. No root element assigned to widget.");return}this.active=!this.active,this.active?(this.application.appendToDOM(),this.widgetActive$.next(!0),this.hideTrigger()):(this.application.hide(),this.widgetActive$.next(!1),this.showTrigger())}_applyBranding(){var e;(e=this.application)!=null&&e.settings&&Hi(this.application.settings.branding,this)}async _renderSymbol(){var a,l,c;const e=(a=this.application)==null?void 0:a.branding(),t=(l=e==null?void 0:e.graphics)==null?void 0:l.trigger;if(t)return f` <img src=${t} class="trigger-icon" alt="" /> `;const s=(c=this.application)==null?void 0:c.triggerIcon;if(!s)return g;const i=async h=>Qo,{type:r,content:o}=s;switch(r){case"Telia":{const h=await i();return h?f`<telia-icon
70
70
  class="trigger-icon"
71
71
  svg=${h.svg}
72
72
  size="lg"
73
73
  ></telia-icon>`:g}default:return g}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var e,t,s,i;return f`<div
74
74
  class=${Ae({"trigger-container":!0,hidden:!this.triggerVisible})}
75
- ${B(this.containerRef)}
75
+ ${N(this.containerRef)}
76
76
  >
77
77
  ${!this.active&&((i=(s=(t=(e=this.application)==null?void 0:e.settings)==null?void 0:t.branding)==null?void 0:s.other)!=null&&i.showButtonLabel)?f`
78
78
  <button
79
79
  label="${this.application.settings.branding.other.buttonLabelText??"Widget trigger"}"
80
80
  class="trigger-label"
81
81
  @click=${this.toggleActive}
82
- ${ps({keyframeOptions:{},in:al,stabilizeOut:!0,skipInitial:!1})}
82
+ ${hs({keyframeOptions:{},in:il,stabilizeOut:!0,skipInitial:!1})}
83
83
  >
84
84
  ${this.application.settings.branding.other.buttonLabelText}
85
85
  </button>
@@ -119,22 +119,26 @@
119
119
  </svg>
120
120
  </span>
121
121
  </button>
122
- </div>`}}re.styles=[_`
122
+ </div>`}}oe.styles=[_`
123
123
  :host {
124
124
  --voca-rem-multiplier: 0.625;
125
125
  --trigger-label-bg: #f5e0ff;
126
126
  --trigger-label-text-color: rgba(0, 0, 0, 0.8);
127
127
  display: block;
128
128
  box-sizing: border-box;
129
- /* font-family: var(--font-family); */
130
129
  font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
131
130
  }
132
131
 
132
+ :focus {
133
+ outline-color: var(--focus-color);
134
+ }
135
+
133
136
  .trigger-container {
134
137
  display: flex;
135
138
  align-items: center;
136
139
  gap: 1rem;
137
140
  }
141
+
138
142
  .trigger-container.hidden {
139
143
  display: none;
140
144
  }
@@ -152,26 +156,34 @@
152
156
  width: 55px;
153
157
  border-radius: 55px;
154
158
  cursor: pointer;
155
- background-color: var(--trigger-bg, var(--primary-background));
159
+ background-color: var(
160
+ --interactive-primary-background,
161
+ var(--primary-background)
162
+ );
156
163
  font-family: Lato;
157
164
  text-decoration: none;
158
165
  border: 3px dashed transparent;
159
166
  box-sizing: border-box;
160
167
  transition: transform 200ms ease-out;
161
168
  }
169
+
162
170
  .trigger:active {
163
171
  transform: scale(0.8) !important;
164
172
  }
173
+
165
174
  .trigger:hover:not(:active) {
166
175
  transform: scale(1.1) !important;
167
176
  }
177
+
168
178
  .trigger.rendered {
169
179
  transform: scale(1);
170
180
  }
181
+
171
182
  .trigger.active .trigger-icon {
172
183
  opacity: 0;
173
184
  transform: rotate(-180deg) scale(0);
174
185
  }
186
+
175
187
  .trigger.active .trigger-close {
176
188
  opacity: 1;
177
189
  transform: rotate(0deg) scale(1);
@@ -184,8 +196,12 @@
184
196
  opacity: 1;
185
197
  transform: rotate(0deg) scale(1);
186
198
  transition: opacity 200ms ease-out, transform 200ms ease-out;
187
- color: var(--trigger-text-color, var(--text-on-primary-background));
199
+ color: var(
200
+ --interactive-text-on-primary-background,
201
+ var(--text-on-primary-background)
202
+ );
188
203
  }
204
+
189
205
  .trigger-close {
190
206
  opacity: 0;
191
207
  transition: transform 200ms ease-out;
@@ -199,8 +215,12 @@
199
215
  justify-content: center;
200
216
  align-items: center;
201
217
  }
218
+
202
219
  .trigger-close svg path {
203
- fill: var(--trigger-text-color, var(--text-on-primary-background));
220
+ fill: var(
221
+ --interactive-text-on-primary-background,
222
+ var(--text-on-primary-background)
223
+ );
204
224
  }
205
225
 
206
226
  img {
@@ -209,8 +229,8 @@
209
229
 
210
230
  .trigger-label {
211
231
  box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);
212
- background-color: var(--trigger-label-bg);
213
- color: var(--trigger-label-text-color);
232
+ background-color: var(--secondary-background);
233
+ color: var(--text-on-secondary-background);
214
234
  white-space: nowrap;
215
235
  padding: 0.7rem 1rem;
216
236
  border-radius: 0.3rem;
@@ -228,7 +248,7 @@
228
248
  .trigger-label:hover {
229
249
  opacity: 0.8;
230
250
  }
231
- `];Xe([w({attribute:!1})],re.prototype,"application",2);Xe([C()],re.prototype,"active",2);Xe([C()],re.prototype,"triggerVisible",2);Xe([C()],re.prototype,"loaded",2);Xe([C()],re.prototype,"icon",2);var fl=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,ce=(n,e,t,s)=>{for(var i=s>1?void 0:s?gl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&fl(e,t,i),i};const Ni=n=>{class e extends n{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(s){this.properties=s}writeLayout(s){this.layout=s}writeContext(s){this.context=s}addChild(s){s.parent=this,this.nodes.push(s)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return e.styles=[_`
251
+ `];Je([k({attribute:!1})],oe.prototype,"application",2);Je([C()],oe.prototype,"active",2);Je([C()],oe.prototype,"triggerVisible",2);Je([C()],oe.prototype,"loaded",2);Je([C()],oe.prototype,"icon",2);var ul=Object.defineProperty,dl=Object.getOwnPropertyDescriptor,he=(n,e,t,s)=>{for(var i=s>1?void 0:s?dl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&ul(e,t,i),i};const Ni=n=>{class e extends n{constructor(){super(...arguments),this.properties={},this.context={},this.layout={},this.nodes=[]}writeProperties(s){this.properties=s}writeLayout(s){this.layout=s}writeContext(s){this.context=s}addChild(s){s.parent=this,this.nodes.push(s)}connectedCallback(){super.connectedCallback(),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),this.application.mountComponent(this)}}return e.styles=[_`
232
252
  :host {
233
253
  font-family: var(--font-family);
234
254
  grid-column: span var(--width);
@@ -240,7 +260,7 @@
240
260
  * {
241
261
  box-sizing: border-box;
242
262
  }
243
- `],ce([w()],e.prototype,"properties",2),ce([w()],e.prototype,"context",2),ce([w()],e.prototype,"layout",2),ce([w()],e.prototype,"name",2),ce([w()],e.prototype,"type",2),ce([w({attribute:!1})],e.prototype,"application",2),ce([w({attribute:!1})],e.prototype,"parent",2),e};class qi extends Ni(k){render(){return f`Non resolved component`}}qi.styles=[_`
263
+ `],he([k()],e.prototype,"properties",2),he([k()],e.prototype,"context",2),he([k()],e.prototype,"layout",2),he([k()],e.prototype,"name",2),he([k()],e.prototype,"type",2),he([k({attribute:!1})],e.prototype,"application",2),he([k({attribute:!1})],e.prototype,"parent",2),e};class Bi extends Ni(w){render(){return f`Non resolved component`}}Bi.styles=[_`
244
264
  :host {
245
265
  display: block;
246
266
  }
@@ -248,11 +268,11 @@
248
268
  * @license
249
269
  * Copyright 2021 Google LLC
250
270
  * SPDX-License-Identifier: BSD-3-Clause
251
- */function*ml(n,e){if(n!==void 0){let t=0;for(const s of n)yield e(s,t++)}}var Ls=(n=>(n.Inline="inline",n.Trigger="trigger",n))(Ls||{});/**
271
+ */function*pl(n,e){if(n!==void 0){let t=0;for(const s of n)yield e(s,t++)}}var Ps=(n=>(n.Inline="inline",n.Trigger="trigger",n))(Ps||{});/**
252
272
  * @license
253
273
  * Copyright 2021 Google LLC
254
274
  * SPDX-License-Identifier: BSD-3-Clause
255
- */let Vi=class extends Event{constructor(e,t,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.callback=t,this.subscribe=s??!1}};/**
275
+ */let qi=class extends Event{constructor(e,t,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.callback=t,this.subscribe=s??!1}};/**
256
276
  * @license
257
277
  * Copyright 2021 Google LLC
258
278
  * SPDX-License-Identifier: BSD-3-Clause
@@ -260,25 +280,25 @@
260
280
  * @license
261
281
  * Copyright 2021 Google LLC
262
282
  * SPDX-License-Identifier: BSD-3-Clause
263
- */let jn=class{constructor(e,t,s,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=s,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Vi(this.context,this.t,this.subscribe))}};/**
283
+ */let Rn=class{constructor(e,t,s,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(r,o)=>{this.unsubscribe&&(this.unsubscribe!==o&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=r,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(r,o)),this.unsubscribe=o},this.host=e,t.context!==void 0){const r=t;this.context=r.context,this.callback=r.callback,this.subscribe=r.subscribe??!1}else this.context=t,this.callback=s,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new qi(this.context,this.t,this.subscribe))}};/**
264
284
  * @license
265
285
  * Copyright 2021 Google LLC
266
286
  * SPDX-License-Identifier: BSD-3-Clause
267
- */class vl{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const s=t||!Object.is(e,this.o);this.o=e,s&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:s}]of this.subscriptions)t(this.o,s)},e!==void 0&&(this.value=e)}addCallback(e,t,s){if(!s)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
287
+ */class fl{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){const s=t||!Object.is(e,this.o);this.o=e,s&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:s}]of this.subscriptions)t(this.o,s)},e!==void 0&&(this.value=e)}addCallback(e,t,s){if(!s)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});const{disposer:i}=this.subscriptions.get(e);e(this.value,i)}clearCallbacks(){this.subscriptions.clear()}}/**
268
288
  * @license
269
289
  * Copyright 2021 Google LLC
270
290
  * SPDX-License-Identifier: BSD-3-Clause
271
- */let bl=class extends Event{constructor(e){super("context-provider",{bubbles:!0,composed:!0}),this.context=e}},Mn=class extends vl{constructor(e,t,s){var i,r;super(t.context!==void 0?t.initialValue:s),this.onContextRequest=o=>{const a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{const a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;const l=new Set;for(const[c,{consumerHost:h}]of this.subscriptions)l.has(c)||(l.add(c),h.dispatchEvent(new Vi(this.context,c,!0)));o.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(i=this.host).addController)==null||r.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new bl(this.context))}};/**
291
+ */let gl=class extends Event{constructor(e){super("context-provider",{bubbles:!0,composed:!0}),this.context=e}},Mn=class extends fl{constructor(e,t,s){var i,r;super(t.context!==void 0?t.initialValue:s),this.onContextRequest=o=>{const a=o.composedPath()[0];o.context===this.context&&a!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,a,o.subscribe))},this.onProviderRequest=o=>{const a=o.composedPath()[0];if(o.context!==this.context||a===this.host)return;const l=new Set;for(const[c,{consumerHost:h}]of this.subscriptions)l.has(c)||(l.add(c),h.dispatchEvent(new qi(this.context,c,!0)));o.stopPropagation()},this.host=e,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),(r=(i=this.host).addController)==null||r.call(i,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new gl(this.context))}};/**
272
292
  * @license
273
293
  * Copyright 2017 Google LLC
274
294
  * SPDX-License-Identifier: BSD-3-Clause
275
- */function yl({context:n}){return(e,t)=>{const s=new WeakMap;if(typeof t=="object")return t.addInitializer(function(){s.set(this,new Mn(this,{context:n}))}),{get(){return e.get.call(this)},set(i){var r;return(r=s.get(this))==null||r.setValue(i),e.set.call(this,i)},init(i){var r;return(r=s.get(this))==null||r.setValue(i),i}};{e.constructor.addInitializer(o=>{s.set(o,new Mn(o,{context:n}))});const i=Object.getOwnPropertyDescriptor(e,t);let r;if(i===void 0){const o=new WeakMap;r={get:function(){return o.get(this)},set:function(a){s.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=i.set;r={...i,set:function(a){s.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(e,t,r)}}}/**
295
+ */function ml({context:n}){return(e,t)=>{const s=new WeakMap;if(typeof t=="object")return t.addInitializer(function(){s.set(this,new Mn(this,{context:n}))}),{get(){return e.get.call(this)},set(i){var r;return(r=s.get(this))==null||r.setValue(i),e.set.call(this,i)},init(i){var r;return(r=s.get(this))==null||r.setValue(i),i}};{e.constructor.addInitializer(o=>{s.set(o,new Mn(o,{context:n}))});const i=Object.getOwnPropertyDescriptor(e,t);let r;if(i===void 0){const o=new WeakMap;r={get:function(){return o.get(this)},set:function(a){s.get(this).setValue(a),o.set(this,a)},configurable:!0,enumerable:!0}}else{const o=i.set;r={...i,set:function(a){s.get(this).setValue(a),o==null||o.call(this,a)}}}return void Object.defineProperty(e,t,r)}}}/**
276
296
  * @license
277
297
  * Copyright 2022 Google LLC
278
298
  * SPDX-License-Identifier: BSD-3-Clause
279
- */function Le({context:n,subscribe:e}){return(t,s)=>{typeof s=="object"?s.addInitializer(function(){new jn(this,{context:n,callback:i=>{this[s.name]=i},subscribe:e})}):t.constructor.addInitializer(i=>{new jn(i,{context:n,callback:r=>{i[s]=r},subscribe:e})})}}var $l=Object.defineProperty,xl=Object.getOwnPropertyDescriptor,wl=(n,e,t,s)=>{for(var i=s>1?void 0:s?xl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&$l(e,t,i),i};const ve="application";class Is extends k{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=H()}addChild(e){e.parent=this,this.nodes.push(e)}applyBranding(){if(!this.wrapperRef.value)return;const e=this.application.settings;e!=null&&e.branding&&Bi(e.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const e=this.application.styles(),t=this.wrapperRef.value;Object.entries(e).forEach(([s,i])=>{t.style.setProperty(`--${s}`,i)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var s,i;const e=this.application.settings.components.conversation;return((i=(s=e==null?void 0:e.properties)==null?void 0:s.chat)==null?void 0:i.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===Ls.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")),f`<div class="widget-container" ${B(this.wrapperRef)}>
280
- ${ml(this.nodes,r=>r)}
281
- </div>`}}Is.styles=_`
299
+ */function Mt({context:n,subscribe:e}){return(t,s)=>{typeof s=="object"?s.addInitializer(function(){new Rn(this,{context:n,callback:i=>{this[s.name]=i},subscribe:e})}):t.constructor.addInitializer(i=>{new Rn(i,{context:n,callback:r=>{i[s]=r},subscribe:e})})}}var vl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,yl=(n,e,t,s)=>{for(var i=s>1?void 0:s?bl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&vl(e,t,i),i};const Xe="application";class Ls extends w{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=H()}addChild(e){e.parent=this,this.nodes.push(e)}applyBranding(){if(!this.wrapperRef.value)return;const e=this.application.settings;e!=null&&e.branding&&Hi(e.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const e=this.application.styles(),t=this.wrapperRef.value;Object.entries(e).forEach(([s,i])=>{t.style.setProperty(`--${s}`,i)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var s,i;const e=this.application.settings.components.conversation;return((i=(s=e==null?void 0:e.properties)==null?void 0:s.chat)==null?void 0:i.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===Ps.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")),f`<div class="widget-container" ${N(this.wrapperRef)}>
300
+ ${pl(this.nodes,r=>r)}
301
+ </div>`}}Ls.styles=_`
282
302
  :host {
283
303
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
284
304
  --spacing-xs: 0.2rem;
@@ -294,6 +314,7 @@
294
314
  --gray-color: #f3f3f8;
295
315
  --white-color: #fff;
296
316
  --gray-dark-color: #a6a6a6;
317
+ --black-border-color: #00000054;
297
318
 
298
319
  --box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
299
320
  --border-radius: var(--spacing-sm);
@@ -304,6 +325,7 @@
304
325
 
305
326
  --header-height: 69px;
306
327
  }
328
+
307
329
  :host {
308
330
  --voca-rem-multiplier: 0.625;
309
331
  box-sizing: border-box;
@@ -320,23 +342,27 @@
320
342
  z-index: 6;
321
343
  position: fixed;
322
344
  }
345
+
323
346
  @media screen and (max-width: 800px) {
324
347
  :host(.floating) {
325
- inset: 0 0 95px 0;
348
+ inset: 0;
326
349
  height: 100%;
327
350
  }
351
+
328
352
  :host(.third-party) {
329
- inset: 0 0 95px 0;
353
+ inset: 0;
330
354
  height: 100vh;
331
355
  }
332
356
  }
357
+
333
358
  @media screen and (min-width: 801px) {
334
359
  :host(.floating) {
335
- inset: auto 20px 95px auto;
360
+ inset: auto 20px 20px auto;
336
361
  max-height: calc(100vh - 120px);
337
362
  width: 400px;
338
- height: 700px;
363
+ height: 775px;
339
364
  }
365
+
340
366
  :host(.third-party) {
341
367
  max-width: 1000px;
342
368
  height: 100vh;
@@ -345,11 +371,13 @@
345
371
  transform: translateX(-50%);
346
372
  margin: -10px 0;
347
373
  }
374
+
348
375
  :host(.floating.bottom-right) {
349
- inset: auto 20px 95px auto;
376
+ inset: auto 20px 20px auto;
350
377
  }
378
+
351
379
  :host(.floating.bottom-left) {
352
- inset: auto auto 95px 20px;
380
+ inset: auto auto 20px 20px;
353
381
  }
354
382
  }
355
383
 
@@ -365,14 +393,14 @@
365
393
  * {
366
394
  box-sizing: border-box;
367
395
  }
396
+
368
397
  .widget-container {
369
398
  height: 100%;
370
399
  background-color: var(--primary-background);
371
400
  padding: var(--spacing-sm);
372
401
  border: var(--widget-border, none);
373
- border-left: 1px solid #00000054;
374
- border-right: 1px solid #00000054;
375
402
  }
403
+
376
404
  @keyframes slideDown {
377
405
  from {
378
406
  transform: translateY(0);
@@ -383,6 +411,7 @@
383
411
  opacity: 0;
384
412
  }
385
413
  }
414
+
386
415
  @keyframes slideUp {
387
416
  from {
388
417
  transform: translateY(100%);
@@ -393,27 +422,29 @@
393
422
  opacity: 1;
394
423
  }
395
424
  }
425
+
396
426
  :host(.expanded) {
397
427
  opacity: 1;
398
428
  animation: slideUp 0.3s linear;
399
429
  }
430
+
400
431
  :host(.hidden) {
401
432
  opacity: 0;
402
433
  animation: slideDown 0.3s linear;
403
434
  pointer-events: none;
404
435
  }
405
- `;wl([w({attribute:!1}),yl({context:ve})],Is.prototype,"application",2);var Fi=(n=>(n.Necessary="necessary",n.Functional="functional",n.Analytics="analytics",n))(Fi||{}),kl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Rs=(n,e,t,s)=>{for(var i=s>1?void 0:s?Cl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&kl(e,t,i),i};class et extends k{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(e){this.widget=e.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const e=globalThis.widgets;e&&(this.widget=e.applications.find(t=>t.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return g;if(this.widget.renderStrategy===Ls.Trigger){const e=new re;return e.application=this.widget,e}return this.widget.render()}}et.styles=[_`
436
+ `;yl([k({attribute:!1}),ml({context:Xe})],Ls.prototype,"application",2);var Fi=(n=>(n.Necessary="necessary",n.Functional="functional",n.Analytics="analytics",n))(Fi||{}),$l=Object.defineProperty,xl=Object.getOwnPropertyDescriptor,Is=(n,e,t,s)=>{for(var i=s>1?void 0:s?xl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&$l(e,t,i),i};class et extends w{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(e){this.widget=e.detail.widget,await this.activate(),this.requestUpdate()}async activate(){this.widget&&(await this.widget.activate(),this.status="activated")}async getGlobalEnvironment(){const e=globalThis.widgets;e&&(this.widget=e.applications.find(t=>t.name===this.name),await this.activate())}render(){if(!this.widget||this.status!=="activated")return g;if(this.widget.renderStrategy===Ps.Trigger){const e=new oe;return e.application=this.widget,e}return this.widget.render()}}et.styles=[_`
406
437
  :host {
407
438
  display: block;
408
439
  }
409
- `];Rs([w({attribute:!0})],et.prototype,"name",2);Rs([C()],et.prototype,"widget",2);Rs([C()],et.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",Ps);customElements.get("ace-trigger")||customElements.define("ace-trigger",re);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",qi);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",Is);customElements.get("ace-widget")||customElements.define("ace-widget",et);class _l{constructor(e){this._message=null,this._host=e,e.addController(this)}hostConnected(){}set message(e){this._message=e,this._host.requestUpdate()}get message(){return this._message}hasMessage(){return!!this.message}}class Un{constructor(e,t,s,i,r){this.id=e,this.providerKey=t,this.providerOptions=s,this.component=r,this.provider$=new N(null),this.entries$=new N([]),this.removeEntryAction$=new S,this.kill$=new S,this.isTyping$=new N(!1),this.data$=new N({}),this.complete$=this.provider$.pipe(se(l=>l?l.onComplete():Pe));const o=this._getProviderFactory(t);if(!o)throw new Error(`No provider with key "${t}" was found.`);this.data$.next(i);const a=o(this.component);this.provider$.next(a),a.actions().pipe(A(this.kill$)).subscribe(l=>{this.write(l)}),a.isTyping().pipe(A(this.kill$)).subscribe(l=>{this.isTyping$.next(l)})}start(){const e=this.provider$.value;if(!e)throw new Error("No provider bound to session.");e.saveToCurrentSession$.subscribe(t=>{this.data$.next(t)}),e.connect(this.providerOptions)}entries(){return this.entries$.asObservable()}rehydrate(){var e;(e=this.provider$.value)==null||e.rehydrate(this.data$.value)}toStore(){return{id:this.id,providerKey:this.providerKey,providerOptions:this.providerOptions,data:this.data$.value}}write(e){this._addEntryRemoveHandler(e),this.entries$.pipe(he(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(se(()=>this.entries$),he(1)).subscribe(t=>{this.removeEntryAction$.next(e),this.entries$.next(t.filter(s=>s!==e))})}_getProviderFactory(e){return this.component.platform.registeredProviders.get(e)}}class Sl{constructor(e){this.component=e,this.currentSession$=new N(null),this.sessions=[],this.storage=null,mt(e,"handover").subscribe(t=>{const s=this._createNewSession(t.detail.providerKey,t.detail.providerOptions);this._setSession(s),t.detail.complete=s.complete$,s.start()})}loadFromStorage(){const e=this._getStoredSessions();this.sessions=e.sessions,this.sessions.forEach(t=>{this._setSession(t),t.rehydrate()}),this.save(e)}startSession(){const e=this._getStoredSessions();let t=null;if(e.sessions.length)t=e.sessions[e.sessions.length-1];else{const s=this._getInitialProviderKey(),i={};t=this._createNewSession(s,i)}this._setSession(t),t.start()}setStorageService(e){this.storage=e}currentSession(){return this.currentSession$.asObservable()}_getStoredSessions(){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");if(this.sessions.length)return{sessions:this.sessions};const e=this.storage.get("conversation");return e?{sessions:e.sessions.map(t=>new Un(t.id,t.providerKey,t.providerOptions,t.data,this.component))}:{sessions:[]}}_setSession(e){this.currentSession$.next(e),e.data$.subscribe(()=>{this._saveSession(e)})}_saveSession(e){let t=this._getStoredSessions();const s=t.sessions.findIndex(i=>i.id===e.id);s>-1?t={sessions:[...t.sessions.slice(0,s),e,...t.sessions.slice(s+1)]}:t.sessions.push(e),this.save(t)}save(e){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");const t={sessions:e.sessions.map(s=>s.toStore())};this.storage.set("conversation",t,Fi.Necessary)}_createNewSession(e,t={}){const s=this._getStoredSessions(),i=new Un(pi(),e,t,{},this.component);return s.sessions.push(i),this.save(s),i}_getInitialProviderKey(){var e;if(!((e=this.component.properties.providers)!=null&&e.length))throw new Error("No providers registered on conversation component.");return this.component.properties.providers[0]}}class El{constructor(e,t){this.state$=e,this.component=t,this.entries$=new N([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new Sl(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(se(s=>s?s.provider$.pipe(se(i=>i?i.isTyping():rs(!1))):rs(!1))),e.subscribe(s=>{switch(s){case"init":this.initialize();break;case"rehydrating":this.rehydrate();break;case"connected":this.connected();break}})}setStorage(e){var t;(t=this.sessionService)==null||t.setStorageService(e)}initialize(){this.state$.next("rehydrating")}rehydrate(){this.session$.pipe(se(e=>{if(!e)return Pe;const t=e.removeEntryAction$.pipe(as(this.entries$)).pipe(gt(([i,r])=>r.filter(o=>o.id!==i.id))),s=e.entries().pipe(gt(i=>{const r=this.entries$.value,o=i.filter(a=>r.findIndex(l=>l.id===a.id)===-1);return[...r,...o]}));return bo(t,s)})).subscribe(e=>{this.entries$.next(e)}),this.sessionService.loadFromStorage(),this.state$.next("connected")}connected(){var e;(e=this.sessionService)==null||e.startSession()}}var Al=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Ol=(n,e,t,s)=>{for(var i=s>1?void 0:s?Tl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Al(e,t,i),i};class js extends k{connectedCallback(){var e;super.connectedCallback(),(e=this.entry.didUpdate)==null||e.subscribe(()=>{this.requestUpdate()})}_getTimestamp(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hourCycle:"h23"})}_renderTimestamp(e,t){if(!e&&!t)return g;let s="";return e?t?s=`${e}: ${this._getTimestamp(t)}`:s=e:t&&(s=this._getTimestamp(t)),f`<p class="conversation-timestamp">${s}</p>`}_renderDeliveryStatus(e){return e==="delivered"?f`<telia-icon
410
- svg=${Fo.svg}
440
+ `];Is([k({attribute:!0})],et.prototype,"name",2);Is([C()],et.prototype,"widget",2);Is([C()],et.prototype,"status",2);customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",Os);customElements.get("ace-trigger")||customElements.define("ace-trigger",oe);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",Bi);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",Ls);customElements.get("ace-widget")||customElements.define("ace-widget",et);class wl{constructor(e){this._message=null,this._host=e,e.addController(this)}hostConnected(){}set message(e){this._message=e,this._host.requestUpdate()}get message(){return this._message}hasMessage(){return!!this.message}}class jn{constructor(e,t,s,i,r){this.id=e,this.providerKey=t,this.providerOptions=s,this.component=r,this.provider$=new B(null),this.entries$=new B([]),this.removeEntryAction$=new S,this.kill$=new S,this.isTyping$=new B(!1),this.data$=new B({}),this.complete$=this.provider$.pipe(ne(l=>l?l.onComplete():Pe));const o=this._getProviderFactory(t);if(!o)throw new Error(`No provider with key "${t}" was found.`);this.data$.next(i);const a=o(this.component);this.provider$.next(a),a.actions().pipe(A(this.kill$)).subscribe(l=>{this.write(l)}),a.isTyping().pipe(A(this.kill$)).subscribe(l=>{this.isTyping$.next(l)})}start(){const e=this.provider$.value;if(!e)throw new Error("No provider bound to session.");e.saveToCurrentSession$.subscribe(t=>{this.data$.next(t)}),e.connect(this.providerOptions)}entries(){return this.entries$.asObservable()}rehydrate(){var e;(e=this.provider$.value)==null||e.rehydrate(this.data$.value)}toStore(){return{id:this.id,providerKey:this.providerKey,providerOptions:this.providerOptions,data:this.data$.value}}write(e){this._addEntryRemoveHandler(e),this.entries$.pipe(ue(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(ne(()=>this.entries$),ue(1)).subscribe(t=>{this.removeEntryAction$.next(e),this.entries$.next(t.filter(s=>s!==e))})}_getProviderFactory(e){return this.component.platform.registeredProviders.get(e)}}class kl{constructor(e){this.component=e,this.currentSession$=new B(null),this.sessions=[],this.storage=null,gt(e,"handover").subscribe(t=>{const s=this._createNewSession(t.detail.providerKey,t.detail.providerOptions);this._setSession(s),t.detail.complete=s.complete$,s.start()})}loadFromStorage(){const e=this._getStoredSessions();this.sessions=e.sessions,this.sessions.forEach(t=>{this._setSession(t),t.rehydrate()}),this.save(e)}startSession(){const e=this._getStoredSessions();let t=null;if(e.sessions.length)t=e.sessions[e.sessions.length-1];else{const s=this._getInitialProviderKey(),i={};t=this._createNewSession(s,i)}this._setSession(t),t.start()}setStorageService(e){this.storage=e}currentSession(){return this.currentSession$.asObservable()}_getStoredSessions(){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");if(this.sessions.length)return{sessions:this.sessions};const e=this.storage.get("conversation");return e?{sessions:e.sessions.map(t=>new jn(t.id,t.providerKey,t.providerOptions,t.data,this.component))}:{sessions:[]}}_setSession(e){this.currentSession$.next(e),e.data$.subscribe(()=>{this._saveSession(e)})}_saveSession(e){let t=this._getStoredSessions();const s=t.sessions.findIndex(i=>i.id===e.id);s>-1?t={sessions:[...t.sessions.slice(0,s),e,...t.sessions.slice(s+1)]}:t.sessions.push(e),this.save(t)}save(e){if(!this.storage)throw new Error("Could not locate StorageService in SessionService.");const t={sessions:e.sessions.map(s=>s.toStore())};this.storage.set("conversation",t,Fi.Necessary)}_createNewSession(e,t={}){const s=this._getStoredSessions(),i=new jn(di(),e,t,{},this.component);return s.sessions.push(i),this.save(s),i}_getInitialProviderKey(){var e;if(!((e=this.component.properties.providers)!=null&&e.length))throw new Error("No providers registered on conversation component.");return this.component.properties.providers[0]}}class Cl{constructor(e,t){this.state$=e,this.component=t,this.entries$=new B([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new kl(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(ne(s=>s?s.provider$.pipe(ne(i=>i?i.isTyping():ss(!1))):ss(!1))),e.subscribe(s=>{switch(s){case"init":this.initialize();break;case"rehydrating":this.rehydrate();break;case"connected":this.connected();break}})}setStorage(e){var t;(t=this.sessionService)==null||t.setStorageService(e)}initialize(){this.state$.next("rehydrating")}rehydrate(){this.session$.pipe(ne(e=>{if(!e)return Pe;const t=e.removeEntryAction$.pipe(is(this.entries$)).pipe(ft(([i,r])=>r.filter(o=>o.id!==i.id))),s=e.entries().pipe(ft(i=>{const r=this.entries$.value,o=i.filter(a=>r.findIndex(l=>l.id===a.id)===-1);return[...r,...o]}));return go(t,s)})).subscribe(e=>{this.entries$.next(e)}),this.sessionService.loadFromStorage(),this.state$.next("connected")}connected(){var e;(e=this.sessionService)==null||e.startSession()}}var _l=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,El=(n,e,t,s)=>{for(var i=s>1?void 0:s?Sl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&_l(e,t,i),i};class Rs extends w{connectedCallback(){var e;super.connectedCallback(),(e=this.entry.didUpdate)==null||e.subscribe(()=>{this.requestUpdate()})}_getTimestamp(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hourCycle:"h23"})}_renderTimestamp(e,t){if(!e&&!t)return g;let s="";return e?t?s=`${e}: ${this._getTimestamp(t)}`:s=e:t&&(s=this._getTimestamp(t)),f`<p class="conversation-timestamp">${s}</p>`}_renderDeliveryStatus(e){return e==="delivered"?f`<telia-icon
441
+ svg=${Bo.svg}
411
442
  size="sm"
412
443
  ></telia-icon>`:e==="failed"?f`<telia-icon
413
- svg=${Vo.svg}
444
+ svg=${No.svg}
414
445
  size="sm"
415
446
  title="Message could not be delivered"
416
- ></telia-icon>`:f`<telia-icon svg=${Zo.svg} size="sm"></telia-icon>`}_dispatchEntryAction(e){this.entry.actions$.next(e.detail)}render(){var e,t;switch(this.entry.type){case O.System:return f`
447
+ ></telia-icon>`:f`<telia-icon svg=${qo.svg} size="sm"></telia-icon>`}_dispatchEntryAction(e){this.entry.actions$.next(e.detail)}render(){var e,t;switch(this.entry.type){case O.System:return f`
417
448
  <div class="conversation-system-message">
418
449
  ${this.entry.messages.map(s=>f`
419
450
  <div class="message-container">
@@ -462,7 +493,7 @@
462
493
  ${this._renderTimestamp(this.entry.sender.name||"",this.entry.timestamp)}
463
494
  ${this._renderDeliveryStatus(this.entry.status)}
464
495
  </div>
465
- </div>`;default:return g}}}js.styles=[_`
496
+ </div>`;default:return g}}}Rs.styles=[_`
466
497
  :host {
467
498
  box-sizing: border-box;
468
499
  display: block;
@@ -577,21 +608,22 @@
577
608
  .entry-content {
578
609
  grid-area: content;
579
610
  }
580
- `];Ol([w({attribute:!1})],js.prototype,"entry",2);var Pl=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Zi=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ll(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Pl(e,t,i),i};class zt extends k{constructor(){super(...arguments),this.entries=[],this.loading=!0}updated(e){const t=new CustomEvent("updated",{});this.dispatchEvent(t)}render(){return f`<div class="conversation-feed">
611
+ `];El([k({attribute:!1})],Rs.prototype,"entry",2);var Al=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,Vi=(n,e,t,s)=>{for(var i=s>1?void 0:s?Tl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Al(e,t,i),i};class jt extends w{constructor(){super(...arguments),this.entries=[],this.loading=!0}updated(e){const t=new CustomEvent("updated",{});this.dispatchEvent(t)}render(){return f`<div class="conversation-feed">
581
612
  ${this.entries.map(e=>f`<div class="conversation-entry" tabindex="-1">
582
613
  <conversation-entry
583
614
  .entry=${e}
584
- ${ps({keyframeOptions:{},in:Pn,stabilizeOut:!0,skipInitial:!1})}
615
+ ${hs({keyframeOptions:{},in:On,stabilizeOut:!0,skipInitial:!1})}
585
616
  >
586
617
  </conversation-entry>
587
618
  </div>`)}
588
619
  ${this.loading?f`<ace-typing-state
589
- ${ps({keyframeOptions:{},in:Pn,out:ll,stabilizeOut:!0,skipInitial:!1})}
620
+ ${hs({keyframeOptions:{},in:On,out:rl,stabilizeOut:!0,skipInitial:!1})}
590
621
  ></ace-typing-state>`:g}
591
- </div>`}}zt.styles=[_`
622
+ </div>`}}jt.styles=[_`
592
623
  :host {
593
624
  display: block;
594
625
  }
626
+
595
627
  .conversation-feed {
596
628
  display: flex;
597
629
  flex-direction: column;
@@ -599,14 +631,18 @@
599
631
  min-height: 100%;
600
632
  padding: var(--spacing-md);
601
633
  }
602
- `];Zi([w({attribute:!1})],zt.prototype,"entries",2);Zi([w({type:Boolean})],zt.prototype,"loading",2);/**
634
+
635
+ .conversation-entry:focus {
636
+ outline-color: var(--focus-color);
637
+ }
638
+ `];Vi([k({attribute:!1})],jt.prototype,"entries",2);Vi([k({type:Boolean})],jt.prototype,"loading",2);/**
603
639
  * @license
604
640
  * Copyright 2021 Google LLC
605
641
  * SPDX-License-Identifier: BSD-3-Clause
606
- */const Il=(n,e,t)=>{for(const s of e)if(s[0]===n)return(0,s[1])();return t==null?void 0:t()};var Rl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ml=(n,e,t,s)=>{for(var i=s>1?void 0:s?jl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Rl(e,t,i),i};class Ms extends k{render(){return f`
642
+ */const Ol=(n,e,t)=>{for(const s of e)if(s[0]===n)return(0,s[1])();return t==null?void 0:t()};var Pl=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,Il=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ll(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Pl(e,t,i),i};class Ms extends w{render(){return f`
607
643
  <div class="message-group">
608
644
  ${this.group.items.map(([e,t,s])=>f`
609
- ${Il(e,[["html",()=>f`<message-type-html .message=${t} />`],["markdown",()=>f`<message-type-markdown .message=${t} />`]],()=>{const i=customElements.get(e);if(!i)return g;const r=new i(s||null);return f`${r}`})}
645
+ ${Ol(e,[["html",()=>f`<message-type-html .message=${t} />`],["markdown",()=>f`<message-type-markdown .message=${t} />`]],()=>{const i=customElements.get(e);if(!i)return g;const r=new i(s||null);return f`${r}`})}
610
646
  `)}
611
647
  </div>
612
648
  `}}Ms.styles=[_`
@@ -622,11 +658,11 @@
622
658
  flex-direction: column;
623
659
  gap: var(--spacing-md);
624
660
  }
625
- `];Ml([w({attribute:!1})],Ms.prototype,"group",2);class Wi extends k{render(){return f`<div class="container">
661
+ `];Il([k({attribute:!1})],Ms.prototype,"group",2);class Zi extends w{render(){return f`<div class="container">
626
662
  <div class="dot"></div>
627
663
  <div class="dot"></div>
628
664
  <div class="dot"></div>
629
- </div>`}}Wi.styles=[_`
665
+ </div>`}}Zi.styles=[_`
630
666
  :host {
631
667
  display: block;
632
668
  }
@@ -664,45 +700,58 @@
664
700
  * @license
665
701
  * Copyright 2017 Google LLC
666
702
  * SPDX-License-Identifier: BSD-3-Clause
667
- */class fs extends Ut{constructor(e){if(super(e),this.it=g,e.type!==Ke.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===K)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}fs.directiveName="unsafeHTML",fs.resultType=1;const Ul=Je(fs);var zl=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,Hl=(n,e,t,s)=>{for(var i=s>1?void 0:s?Dl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&zl(e,t,i),i};class Us extends k{render(){return f`<div class="message-type-html">
668
- ${Ul(this.message.content)}
669
- </div>`}}Us.styles=[_`
703
+ */class us extends Rt{constructor(e){if(super(e),this.it=g,e.type!==Ge.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===J)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}us.directiveName="unsafeHTML",us.resultType=1;const Rl=Ke(us);var Ml=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ul=(n,e,t,s)=>{for(var i=s>1?void 0:s?jl(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Ml(e,t,i),i};class js extends w{render(){return f`<div class="message-type-html">
704
+ ${Rl(this.message.content)}
705
+ </div>`}}js.styles=[_`
670
706
  :host {
671
707
  box-sizing: border-box;
672
708
  }
709
+
710
+ :focus {
711
+ outline-color: var(--focus-color);
712
+ }
713
+
673
714
  * {
674
715
  box-sizing: border-box;
675
716
  }
717
+
676
718
  p {
677
719
  margin: 0;
678
720
  padding: 0;
679
721
  word-break: break-word;
680
722
  }
723
+
681
724
  a {
682
725
  word-break: break-all;
726
+ color: var(--interactive-primary-background);
727
+ }
728
+
729
+ a:hover {
730
+ filter: brightness(150%);
683
731
  }
732
+
684
733
  img {
685
734
  cursor: pointer;
686
735
  width: 100%;
687
736
  height: auto;
688
737
  object-fit: contain;
689
738
  }
690
- `];Hl([w({attribute:!1})],Us.prototype,"message",2);function zs(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let be=zs();function Qi(n){be=n}const Yi=/[&<>"']/,Bl=new RegExp(Yi.source,"g"),Gi=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Nl=new RegExp(Gi.source,"g"),ql={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},zn=n=>ql[n];function I(n,e){if(e){if(Yi.test(n))return n.replace(Bl,zn)}else if(Gi.test(n))return n.replace(Nl,zn);return n}const Vl=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Fl(n){return n.replace(Vl,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Zl=/(^|[^\[])\^/g;function $(n,e){let t=typeof n=="string"?n:n.source;e=e||"";const s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(Zl,"$1"),t=t.replace(i,o),s},getRegex:()=>new RegExp(t,e)};return s}function Dn(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const ze={exec:()=>null};function Hn(n,e){const t=n.replace(/\|/g,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=t.split(/ \|/);let i=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(/\\\|/g,"|");return s}function lt(n,e,t){const s=n.length;if(s===0)return"";let i=0;for(;i<s;){const r=n.charAt(s-i-1);if(r===e&&!t)i++;else if(r!==e&&t)i++;else break}return n.slice(0,s-i)}function Wl(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return-1}function Bn(n,e,t,s){const i=e.href,r=e.title?I(e.title):null,o=n[1].replace(/\\([\[\]])/g,"$1");if(n[0].charAt(0)!=="!"){s.state.inLink=!0;const a={type:"link",raw:t,href:i,title:r,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:r,text:I(o)}}function Ql(n,e){const t=n.match(/^(\s+)(?:```)/);if(t===null)return e;const s=t[1];return e.split(`
739
+ `];Ul([k({attribute:!1})],js.prototype,"message",2);function Us(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let be=Us();function Wi(n){be=n}const Qi=/[&<>"']/,zl=new RegExp(Qi.source,"g"),Yi=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Dl=new RegExp(Yi.source,"g"),Hl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Un=n=>Hl[n];function I(n,e){if(e){if(Qi.test(n))return n.replace(zl,Un)}else if(Yi.test(n))return n.replace(Dl,Un);return n}const Nl=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Bl(n){return n.replace(Nl,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const ql=/(^|[^\[])\^/g;function $(n,e){let t=typeof n=="string"?n:n.source;e=e||"";const s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(ql,"$1"),t=t.replace(i,o),s},getRegex:()=>new RegExp(t,e)};return s}function zn(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ue={exec:()=>null};function Dn(n,e){const t=n.replace(/\|/g,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=t.split(/ \|/);let i=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(/\\\|/g,"|");return s}function at(n,e,t){const s=n.length;if(s===0)return"";let i=0;for(;i<s;){const r=n.charAt(s-i-1);if(r===e&&!t)i++;else if(r!==e&&t)i++;else break}return n.slice(0,s-i)}function Fl(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return-1}function Hn(n,e,t,s){const i=e.href,r=e.title?I(e.title):null,o=n[1].replace(/\\([\[\]])/g,"$1");if(n[0].charAt(0)!=="!"){s.state.inLink=!0;const a={type:"link",raw:t,href:i,title:r,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:r,text:I(o)}}function Vl(n,e){const t=n.match(/^(\s+)(?:```)/);if(t===null)return e;const s=t[1];return e.split(`
691
740
  `).map(i=>{const r=i.match(/^\s+/);if(r===null)return i;const[o]=r;return o.length>=s.length?i.slice(s.length):i}).join(`
692
- `)}class Ct{constructor(e){x(this,"options");x(this,"rules");x(this,"lexer");this.options=e||be}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:lt(s,`
693
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],i=Ql(s,t[3]||"");return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(/#$/.test(s)){const i=lt(s,"#");(this.options.pedantic||!i||/ $/.test(i))&&(s=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
694
- $1`);s=lt(s.replace(/^ *>[ \t]?/gm,""),`
741
+ `)}class kt{constructor(e){x(this,"options");x(this,"rules");x(this,"lexer");this.options=e||be}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:at(s,`
742
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],i=Vl(s,t[3]||"");return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(/#$/.test(s)){const i=at(s,"#");(this.options.pedantic||!i||/ $/.test(i))&&(s=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let s=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
743
+ $1`);s=at(s.replace(/^ *>[ \t]?/gm,""),`
695
744
  `);const i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(s);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:r,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let s=t[1].trim();const i=s.length>1,r={type:"list",raw:"",ordered:i,start:i?+s.slice(0,-1):"",loose:!1,items:[]};s=i?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=i?s:"[*+-]");const o=new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",l="",c=!1;for(;e;){let h=!1;if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let u=t[2].split(`
696
745
  `,1)[0].replace(/^\t+/,W=>" ".repeat(3*W.length)),d=e.split(`
697
746
  `,1)[0],p=0;this.options.pedantic?(p=2,l=u.trimStart()):(p=t[2].search(/[^ ]/),p=p>4?1:p,l=u.slice(p),p+=t[1].length);let b=!1;if(!u&&/^ *$/.test(d)&&(a+=d+`
698
- `,e=e.substring(d.length+1),h=!0),!h){const W=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),ae=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),Qs=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),Ys=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){const qt=e.split(`
699
- `,1)[0];if(d=qt,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),Qs.test(d)||Ys.test(d)||W.test(d)||ae.test(e))break;if(d.search(/[^ ]/)>=p||!d.trim())l+=`
700
- `+d.slice(p);else{if(b||u.search(/[^ ]/)>=4||Qs.test(u)||Ys.test(u)||ae.test(u))break;l+=`
701
- `+d}!b&&!d.trim()&&(b=!0),a+=qt+`
702
- `,e=e.substring(qt.length+1),u=d.slice(p)}}r.loose||(c?r.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let m=null,D;this.options.gfm&&(m=/^\[[ xX]\] /.exec(l),m&&(D=m[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:a,task:!!m,checked:D,loose:!1,text:l,tokens:[]}),r.raw+=a}r.items[r.items.length-1].raw=a.trimEnd(),r.items[r.items.length-1].text=l.trimEnd(),r.raw=r.raw.trimEnd();for(let h=0;h<r.items.length;h++)if(this.lexer.state.top=!1,r.items[h].tokens=this.lexer.blockTokens(r.items[h].text,[]),!r.loose){const u=r.items[h].tokens.filter(p=>p.type==="space"),d=u.length>0&&u.some(p=>/\n.*\n/.test(p.raw));r.loose=d}if(r.loose)for(let h=0;h<r.items.length;h++)r.items[h].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:i,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const s=Hn(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
703
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===i.length){for(const a of i)/^ *-+: *$/.test(a)?o.align.push("right"):/^ *:-+: *$/.test(a)?o.align.push("center"):/^ *:-+ *$/.test(a)?o.align.push("left"):o.align.push(null);for(const a of s)o.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of r)o.rows.push(Hn(a,o.header.length).map(l=>({text:l,tokens:this.lexer.inline(l)})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===`
704
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/>$/.test(s))return;const o=lt(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{const o=Wl(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);o&&(i=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(s)?i=i.slice(1):i=i.slice(1,-1)),Bn(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const i=(s[2]||s[1]).replace(/\s+/g," "),r=t[i.toLowerCase()];if(!r){const o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return Bn(s,r,s[0],this.lexer)}}emStrong(e,t,s=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&s.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const o=[...i[0]].length-1;let a,l,c=o,h=0;const u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(i=u.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(l=[...a].length,i[3]||i[4]){c+=l;continue}else if((i[5]||i[6])&&o%3&&!((o+l)%3)){h+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+h);const d=[...i[0]][0].length,p=e.slice(0,o+i.index+d+l);if(Math.min(o,l)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const b=p.slice(2,-2);return{type:"strong",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(/\n/g," ");const i=/[^ ]/.test(s),r=/^ /.test(s)&&/ $/.test(s);return i&&r&&(s=s.substring(1,s.length-1)),s=I(s,!0),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,i;return t[2]==="@"?(s=I(t[1]),i="mailto:"+s):(s=I(t[1]),i=s),{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let i,r;if(t[2]==="@")i=I(t[0]),r="mailto:"+i;else{let o;do o=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(o!==t[0]);i=I(t[0]),t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let s;return this.lexer.state.inRawBlock?s=t[0]:s=I(t[0]),{type:"text",raw:t[0],text:s}}}}const Yl=/^(?: *(?:\n|$))+/,Gl=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Kl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,tt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ki=/(?:[*+-]|\d{1,9}[.)])/,Ji=$(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ki).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Ds=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xl=/^[^\n]+/,Hs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ec=$(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Hs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tc=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ki).getRegex(),Dt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Bs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,sc=$("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Bs).replace("tag",Dt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xi=$(Ds).replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Dt).getRegex(),nc=$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xi).getRegex(),Ns={blockquote:nc,code:Gl,def:ec,fences:Kl,heading:Jl,hr:tt,html:sc,lheading:Ji,list:tc,newline:Yl,paragraph:Xi,table:ze,text:Xl},Nn=$("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Dt).getRegex(),ic={...Ns,table:Nn,paragraph:$(Ds).replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Nn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Dt).getRegex()},rc={...Ns,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ze,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(Ds).replace("hr",tt).replace("heading",` *#{1,6} *[^
705
- ]`).replace("lheading",Ji).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},er=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tr=/^( {2,}|\\)\n(?!\s*$)/,ac=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,st="\\p{P}\\p{S}",lc=$(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,st).getRegex(),cc=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,hc=$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,st).getRegex(),uc=$("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,st).getRegex(),dc=$("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,st).getRegex(),pc=$(/\\([punct])/,"gu").replace(/punct/g,st).getRegex(),fc=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),gc=$(Bs).replace("(?:-->|$)","-->").getRegex(),mc=$("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",gc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_t=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,vc=$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_t).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sr=$(/^!?\[(label)\]\[(ref)\]/).replace("label",_t).replace("ref",Hs).getRegex(),nr=$(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hs).getRegex(),bc=$("reflink|nolink(?!\\()","g").replace("reflink",sr).replace("nolink",nr).getRegex(),qs={_backpedal:ze,anyPunctuation:pc,autolink:fc,blockSkip:cc,br:tr,code:oc,del:ze,emStrongLDelim:hc,emStrongRDelimAst:uc,emStrongRDelimUnd:dc,escape:er,link:vc,nolink:nr,punctuation:lc,reflink:sr,reflinkSearch:bc,tag:mc,text:ac,url:ze},yc={...qs,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",_t).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_t).getRegex()},gs={...qs,escape:$(er).replace("])","~|])").getRegex(),url:$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},$c={...gs,br:$(tr).replace("{2,}","*").getRegex(),text:$(gs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ct={normal:Ns,gfm:ic,pedantic:rc},Re={normal:qs,gfm:gs,breaks:$c,pedantic:yc};class q{constructor(e){x(this,"tokens");x(this,"options");x(this,"state");x(this,"tokenizer");x(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||be,this.options.tokenizer=this.options.tokenizer||new Ct,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:ct.normal,inline:Re.normal};this.options.pedantic?(t.block=ct.pedantic,t.inline=Re.pedantic):this.options.gfm&&(t.block=ct.gfm,this.options.breaks?t.inline=Re.breaks:t.inline=Re.gfm),this.tokenizer.rules=t}static get rules(){return{block:ct,inline:Re}}static lex(e,t){return new q(t).lex(e)}static lexInline(e,t){return new q(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
747
+ `,e=e.substring(d.length+1),h=!0),!h){const W=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),le=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),Ws=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),Qs=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){const Ht=e.split(`
748
+ `,1)[0];if(d=Ht,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),Ws.test(d)||Qs.test(d)||W.test(d)||le.test(e))break;if(d.search(/[^ ]/)>=p||!d.trim())l+=`
749
+ `+d.slice(p);else{if(b||u.search(/[^ ]/)>=4||Ws.test(u)||Qs.test(u)||le.test(u))break;l+=`
750
+ `+d}!b&&!d.trim()&&(b=!0),a+=Ht+`
751
+ `,e=e.substring(Ht.length+1),u=d.slice(p)}}r.loose||(c?r.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let m=null,D;this.options.gfm&&(m=/^\[[ xX]\] /.exec(l),m&&(D=m[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:a,task:!!m,checked:D,loose:!1,text:l,tokens:[]}),r.raw+=a}r.items[r.items.length-1].raw=a.trimEnd(),r.items[r.items.length-1].text=l.trimEnd(),r.raw=r.raw.trimEnd();for(let h=0;h<r.items.length;h++)if(this.lexer.state.top=!1,r.items[h].tokens=this.lexer.blockTokens(r.items[h].text,[]),!r.loose){const u=r.items[h].tokens.filter(p=>p.type==="space"),d=u.length>0&&u.some(p=>/\n.*\n/.test(p.raw));r.loose=d}if(r.loose)for(let h=0;h<r.items.length;h++)r.items[h].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:i,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const s=Dn(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
752
+ `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===i.length){for(const a of i)/^ *-+: *$/.test(a)?o.align.push("right"):/^ *:-+: *$/.test(a)?o.align.push("center"):/^ *:-+ *$/.test(a)?o.align.push("left"):o.align.push(null);for(const a of s)o.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of r)o.rows.push(Dn(a,o.header.length).map(l=>({text:l,tokens:this.lexer.inline(l)})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===`
753
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/>$/.test(s))return;const o=at(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{const o=Fl(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);o&&(i=o[1],r=o[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(s)?i=i.slice(1):i=i.slice(1,-1)),Hn(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const i=(s[2]||s[1]).replace(/\s+/g," "),r=t[i.toLowerCase()];if(!r){const o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return Hn(s,r,s[0],this.lexer)}}emStrong(e,t,s=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&s.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const o=[...i[0]].length-1;let a,l,c=o,h=0;const u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(i=u.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(l=[...a].length,i[3]||i[4]){c+=l;continue}else if((i[5]||i[6])&&o%3&&!((o+l)%3)){h+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+h);const d=[...i[0]][0].length,p=e.slice(0,o+i.index+d+l);if(Math.min(o,l)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const b=p.slice(2,-2);return{type:"strong",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(/\n/g," ");const i=/[^ ]/.test(s),r=/^ /.test(s)&&/ $/.test(s);return i&&r&&(s=s.substring(1,s.length-1)),s=I(s,!0),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let s,i;return t[2]==="@"?(s=I(t[1]),i="mailto:"+s):(s=I(t[1]),i=s),{type:"link",raw:t[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let i,r;if(t[2]==="@")i=I(t[0]),r="mailto:"+i;else{let o;do o=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(o!==t[0]);i=I(t[0]),t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let s;return this.lexer.state.inRawBlock?s=t[0]:s=I(t[0]),{type:"text",raw:t[0],text:s}}}}const Zl=/^(?: *(?:\n|$))+/,Wl=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Ql=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,tt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gi=/(?:[*+-]|\d{1,9}[.)])/,Ki=$(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Gi).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),zs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Gl=/^[^\n]+/,Ds=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Kl=$(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ds).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Jl=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gi).getRegex(),Ut="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Hs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xl=$("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Hs).replace("tag",Ut).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ji=$(zs).replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ut).getRegex(),ec=$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ji).getRegex(),Ns={blockquote:ec,code:Wl,def:Kl,fences:Ql,heading:Yl,hr:tt,html:Xl,lheading:Ki,list:Jl,newline:Zl,paragraph:Ji,table:Ue,text:Gl},Nn=$("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ut).getRegex(),tc={...Ns,table:Nn,paragraph:$(zs).replace("hr",tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Nn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ut).getRegex()},sc={...Ns,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ue,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(zs).replace("hr",tt).replace("heading",` *#{1,6} *[^
754
+ ]`).replace("lheading",Ki).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,er=/^( {2,}|\\)\n(?!\s*$)/,ic=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,st="\\p{P}\\p{S}",rc=$(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,st).getRegex(),oc=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,ac=$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,st).getRegex(),lc=$("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,st).getRegex(),cc=$("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,st).getRegex(),hc=$(/\\([punct])/,"gu").replace(/punct/g,st).getRegex(),uc=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dc=$(Hs).replace("(?:-->|$)","-->").getRegex(),pc=$("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",dc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ct=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fc=$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ct).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tr=$(/^!?\[(label)\]\[(ref)\]/).replace("label",Ct).replace("ref",Ds).getRegex(),sr=$(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ds).getRegex(),gc=$("reflink|nolink(?!\\()","g").replace("reflink",tr).replace("nolink",sr).getRegex(),Bs={_backpedal:Ue,anyPunctuation:hc,autolink:uc,blockSkip:oc,br:er,code:nc,del:Ue,emStrongLDelim:ac,emStrongRDelimAst:lc,emStrongRDelimUnd:cc,escape:Xi,link:fc,nolink:sr,punctuation:rc,reflink:tr,reflinkSearch:gc,tag:pc,text:ic,url:Ue},mc={...Bs,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",Ct).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ct).getRegex()},ds={...Bs,escape:$(Xi).replace("])","~|])").getRegex(),url:$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},vc={...ds,br:$(er).replace("{2,}","*").getRegex(),text:$(ds.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},lt={normal:Ns,gfm:tc,pedantic:sc},Ie={normal:Bs,gfm:ds,breaks:vc,pedantic:mc};class q{constructor(e){x(this,"tokens");x(this,"options");x(this,"state");x(this,"tokenizer");x(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||be,this.options.tokenizer=this.options.tokenizer||new kt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:lt.normal,inline:Ie.normal};this.options.pedantic?(t.block=lt.pedantic,t.inline=Ie.pedantic):this.options.gfm&&(t.block=lt.gfm,this.options.breaks?t.inline=Ie.breaks:t.inline=Ie.gfm),this.tokenizer.rules=t}static get rules(){return{block:lt,inline:Ie}}static lex(e,t){return new q(t).lex(e)}static lexInline(e,t){return new q(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
706
755
  `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let s,i,r,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length),s.raw.length===1&&t.length>0?t[t.length-1].raw+=`
707
756
  `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
708
757
  `+s.raw,i.text+=`
@@ -712,7 +761,7 @@
712
761
  `+s.raw,i.text+=`
713
762
  `+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(s),o=r.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
714
763
  `+s.raw,i.text+=`
715
- `+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(s);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s,i,r,o=e,a,l,c;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)h.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(s=h.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&s.type==="text"&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),i=t[t.length-1],i&&s.type==="text"&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,o,c)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}if(r=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const u=e.slice(1);let d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(r=e.substring(0,h+1))}if(s=this.tokenizer.inlineText(r)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(c=s.raw.slice(-1)),l=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class St{constructor(e){x(this,"options");this.options=e||be}code(e,t,s){var r;const i=(r=(t||"").match(/^\S*/))==null?void 0:r[0];return e=e.replace(/\n$/,"")+`
764
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(s);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s,i,r,o=e,a,l,c;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)h.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(s=h.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),i=t[t.length-1],i&&s.type==="text"&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),i=t[t.length-1],i&&s.type==="text"&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(s=this.tokenizer.emStrong(e,o,c)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),t.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}if(r=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const u=e.slice(1);let d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},u),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(r=e.substring(0,h+1))}if(s=this.tokenizer.inlineText(r)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(c=s.raw.slice(-1)),l=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=s.raw,i.text+=s.text):t.push(s);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class _t{constructor(e){x(this,"options");this.options=e||be}code(e,t,s){var r;const i=(r=(t||"").match(/^\S*/))==null?void 0:r[0];return e=e.replace(/\n$/,"")+`
716
765
  `,i?'<pre><code class="language-'+I(i)+'">'+(s?e:I(e,!0))+`</code></pre>
717
766
  `:"<pre><code>"+(s?e:I(e,!0))+`</code></pre>
718
767
  `}blockquote(e){return`<blockquote>
@@ -730,51 +779,69 @@ ${e}</blockquote>
730
779
  `}tablerow(e){return`<tr>
731
780
  ${e}</tr>
732
781
  `}tablecell(e,t){const s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
733
- `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,s){const i=Dn(e);if(i===null)return s;e=i;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+s+"</a>",r}image(e,t,s){const i=Dn(e);if(i===null)return s;e=i;let r=`<img src="${e}" alt="${s}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class Vs{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,s){return""+s}image(e,t,s){return""+s}br(){return""}}class V{constructor(e){x(this,"options");x(this,"renderer");x(this,"textRenderer");this.options=e||be,this.options.renderer=this.options.renderer||new St,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Vs}static parse(e,t){return new V(t).parse(e)}static parseInline(e,t){return new V(t).parseInline(e)}parse(e,t=!0){let s="";for(let i=0;i<e.length;i++){const r=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const o=r,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){s+=a||"";continue}}switch(r.type){case"space":continue;case"hr":{s+=this.renderer.hr();continue}case"heading":{const o=r;s+=this.renderer.heading(this.parseInline(o.tokens),o.depth,Fl(this.parseInline(o.tokens,this.textRenderer)));continue}case"code":{const o=r;s+=this.renderer.code(o.text,o.lang,!!o.escaped);continue}case"table":{const o=r;let a="",l="";for(let h=0;h<o.header.length;h++)l+=this.renderer.tablecell(this.parseInline(o.header[h].tokens),{header:!0,align:o.align[h]});a+=this.renderer.tablerow(l);let c="";for(let h=0;h<o.rows.length;h++){const u=o.rows[h];l="";for(let d=0;d<u.length;d++)l+=this.renderer.tablecell(this.parseInline(u[d].tokens),{header:!1,align:o.align[d]});c+=this.renderer.tablerow(l)}s+=this.renderer.table(a,c);continue}case"blockquote":{const o=r,a=this.parse(o.tokens);s+=this.renderer.blockquote(a);continue}case"list":{const o=r,a=o.ordered,l=o.start,c=o.loose;let h="";for(let u=0;u<o.items.length;u++){const d=o.items[u],p=d.checked,b=d.task;let m="";if(d.task){const D=this.renderer.checkbox(!!p);c?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=D+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=D+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:D+" "}):m+=D+" "}m+=this.parse(d.tokens,c),h+=this.renderer.listitem(m,b,!!p)}s+=this.renderer.list(h,a,l);continue}case"html":{const o=r;s+=this.renderer.html(o.text,o.block);continue}case"paragraph":{const o=r;s+=this.renderer.paragraph(this.parseInline(o.tokens));continue}case"text":{let o=r,a=o.tokens?this.parseInline(o.tokens):o.text;for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],a+=`
734
- `+(o.tokens?this.parseInline(o.tokens):o.text);s+=t?this.renderer.paragraph(a):a;continue}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(e,t){t=t||this.renderer;let s="";for(let i=0;i<e.length;i++){const r=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){s+=o||"";continue}}switch(r.type){case"escape":{const o=r;s+=t.text(o.text);break}case"html":{const o=r;s+=t.html(o.text);break}case"link":{const o=r;s+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break}case"image":{const o=r;s+=t.image(o.href,o.title,o.text);break}case"strong":{const o=r;s+=t.strong(this.parseInline(o.tokens,t));break}case"em":{const o=r;s+=t.em(this.parseInline(o.tokens,t));break}case"codespan":{const o=r;s+=t.codespan(o.text);break}case"br":{s+=t.br();break}case"del":{const o=r;s+=t.del(this.parseInline(o.tokens,t));break}case"text":{const o=r;s+=t.text(o.text);break}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}}class De{constructor(e){x(this,"options");this.options=e||be}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}x(De,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var We,ms,Lt,ir;class xc{constructor(...e){Vt(this,We);Vt(this,Lt);x(this,"defaults",zs());x(this,"options",this.setOptions);x(this,"parse",it(this,We,ms).call(this,q.lex,V.parse));x(this,"parseInline",it(this,We,ms).call(this,q.lexInline,V.parseInline));x(this,"Parser",V);x(this,"Renderer",St);x(this,"TextRenderer",Vs);x(this,"Lexer",q);x(this,"Tokenizer",Ct);x(this,"Hooks",De);this.use(...e)}walkTokens(e,t){var i,r;let s=[];for(const o of e)switch(s=s.concat(t.call(this,o)),o.type){case"table":{const a=o;for(const l of a.header)s=s.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)s=s.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=o;s=s.concat(this.walkTokens(a.items,t));break}default:{const a=o;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);s=s.concat(this.walkTokens(c,t))}):a.tokens&&(s=s.concat(this.walkTokens(a.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),s.renderer){const r=this.defaults.renderer||new St(this.defaults);for(const o in s.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(o==="options")continue;const a=o,l=s.renderer[a],c=r[a];r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u||""}}i.renderer=r}if(s.tokenizer){const r=this.defaults.tokenizer||new Ct(this.defaults);for(const o in s.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,l=s.tokenizer[a],c=r[a];r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u}}i.tokenizer=r}if(s.hooks){const r=this.defaults.hooks||new De;for(const o in s.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;const a=o,l=s.hooks[a],c=r[a];De.passThroughHooks.has(o)?r[a]=h=>{if(this.defaults.async)return Promise.resolve(l.call(r,h)).then(d=>c.call(r,d));const u=l.call(r,h);return c.call(r,u)}:r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u}}i.hooks=r}if(s.walkTokens){const r=this.defaults.walkTokens,o=s.walkTokens;i.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q.lex(e,t??this.defaults)}parser(e,t){return V.parse(e,t??this.defaults)}}We=new WeakSet,ms=function(e,t){return(s,i)=>{const r={...i},o={...this.defaults,...r};this.defaults.async===!0&&r.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const a=it(this,Lt,ir).call(this,!!o.silent,!!o.async);if(typeof s>"u"||s===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(s):s).then(l=>e(l,o)).then(l=>o.hooks?o.hooks.processAllTokens(l):l).then(l=>o.walkTokens?Promise.all(this.walkTokens(l,o.walkTokens)).then(()=>l):l).then(l=>t(l,o)).then(l=>o.hooks?o.hooks.postprocess(l):l).catch(a);try{o.hooks&&(s=o.hooks.preprocess(s));let l=e(s,o);o.hooks&&(l=o.hooks.processAllTokens(l)),o.walkTokens&&this.walkTokens(l,o.walkTokens);let c=t(l,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(l){return a(l)}}},Lt=new WeakSet,ir=function(e,t){return s=>{if(s.message+=`
735
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+I(s.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(s);throw s}};const ge=new xc;function v(n,e){return ge.parse(n,e)}v.options=v.setOptions=function(n){return ge.setOptions(n),v.defaults=ge.defaults,Qi(v.defaults),v};v.getDefaults=zs;v.defaults=be;v.use=function(...n){return ge.use(...n),v.defaults=ge.defaults,Qi(v.defaults),v};v.walkTokens=function(n,e){return ge.walkTokens(n,e)};v.parseInline=ge.parseInline;v.Parser=V;v.parser=V.parse;v.Renderer=St;v.TextRenderer=Vs;v.Lexer=q;v.lexer=q.lex;v.Tokenizer=Ct;v.Hooks=De;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;V.parse;q.lex;var wc=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,rr=(n,e,t,s)=>{for(var i=s>1?void 0:s?kc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&wc(e,t,i),i};v.use({renderer:{link(n,e,t){return e||(e=t),`<a target="_blank" href="${n}" title="${e}">${t}</a>`}}});class Ht extends k{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=H(),this.contentRef=H(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm),this.includesImage=e=>this.imageRegexp.test(e)}handleAutoscroll(){this.addEventListener("wheel",()=>{this.autoScroll=!1}),this.addEventListener("click",()=>{this.autoScroll=!1})}handleLightboxClose(){this.addEventListener("action",e=>{e.detail.key==="close-lightbox"&&(this.showLightbox=!1)})}handleLightboxOpen(){this.contentRef.value.addEventListener("click",e=>{e.target.tagName==="IMG"&&(this.showLightbox=!0,this.imageUrl=e.target.src,this.altText=e.target.alt)})}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}async firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var i,r;const e=this.getLastChunk();if(!e)return;this.buffer+=e;const t=v.parse(this.buffer),s=(i=this.contentRef.value)==null?void 0:i.querySelector("div:last-of-type");if(this.includesImage(this.buffer))(r=this.contentRef.value)==null||r.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;s.innerHTML=ls(t),this.autoScroll&&this.scrollRef.value.scrollIntoView()}render(){return f`
736
- <div class="message-type-markdown" ${B(this.contentRef)}>
782
+ `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,s){const i=zn(e);if(i===null)return s;e=i;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+s+"</a>",r}image(e,t,s){const i=zn(e);if(i===null)return s;e=i;let r=`<img src="${e}" alt="${s}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class qs{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,s){return""+s}image(e,t,s){return""+s}br(){return""}}class F{constructor(e){x(this,"options");x(this,"renderer");x(this,"textRenderer");this.options=e||be,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qs}static parse(e,t){return new F(t).parse(e)}static parseInline(e,t){return new F(t).parseInline(e)}parse(e,t=!0){let s="";for(let i=0;i<e.length;i++){const r=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const o=r,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){s+=a||"";continue}}switch(r.type){case"space":continue;case"hr":{s+=this.renderer.hr();continue}case"heading":{const o=r;s+=this.renderer.heading(this.parseInline(o.tokens),o.depth,Bl(this.parseInline(o.tokens,this.textRenderer)));continue}case"code":{const o=r;s+=this.renderer.code(o.text,o.lang,!!o.escaped);continue}case"table":{const o=r;let a="",l="";for(let h=0;h<o.header.length;h++)l+=this.renderer.tablecell(this.parseInline(o.header[h].tokens),{header:!0,align:o.align[h]});a+=this.renderer.tablerow(l);let c="";for(let h=0;h<o.rows.length;h++){const u=o.rows[h];l="";for(let d=0;d<u.length;d++)l+=this.renderer.tablecell(this.parseInline(u[d].tokens),{header:!1,align:o.align[d]});c+=this.renderer.tablerow(l)}s+=this.renderer.table(a,c);continue}case"blockquote":{const o=r,a=this.parse(o.tokens);s+=this.renderer.blockquote(a);continue}case"list":{const o=r,a=o.ordered,l=o.start,c=o.loose;let h="";for(let u=0;u<o.items.length;u++){const d=o.items[u],p=d.checked,b=d.task;let m="";if(d.task){const D=this.renderer.checkbox(!!p);c?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=D+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=D+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:D+" "}):m+=D+" "}m+=this.parse(d.tokens,c),h+=this.renderer.listitem(m,b,!!p)}s+=this.renderer.list(h,a,l);continue}case"html":{const o=r;s+=this.renderer.html(o.text,o.block);continue}case"paragraph":{const o=r;s+=this.renderer.paragraph(this.parseInline(o.tokens));continue}case"text":{let o=r,a=o.tokens?this.parseInline(o.tokens):o.text;for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],a+=`
783
+ `+(o.tokens?this.parseInline(o.tokens):o.text);s+=t?this.renderer.paragraph(a):a;continue}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(e,t){t=t||this.renderer;let s="";for(let i=0;i<e.length;i++){const r=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){s+=o||"";continue}}switch(r.type){case"escape":{const o=r;s+=t.text(o.text);break}case"html":{const o=r;s+=t.html(o.text);break}case"link":{const o=r;s+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break}case"image":{const o=r;s+=t.image(o.href,o.title,o.text);break}case"strong":{const o=r;s+=t.strong(this.parseInline(o.tokens,t));break}case"em":{const o=r;s+=t.em(this.parseInline(o.tokens,t));break}case"codespan":{const o=r;s+=t.codespan(o.text);break}case"br":{s+=t.br();break}case"del":{const o=r;s+=t.del(this.parseInline(o.tokens,t));break}case"text":{const o=r;s+=t.text(o.text);break}default:{const o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}}class ze{constructor(e){x(this,"options");this.options=e||be}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}x(ze,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ze,ps,Tt,nr;class bc{constructor(...e){Nt(this,Ze);Nt(this,Tt);x(this,"defaults",Us());x(this,"options",this.setOptions);x(this,"parse",it(this,Ze,ps).call(this,q.lex,F.parse));x(this,"parseInline",it(this,Ze,ps).call(this,q.lexInline,F.parseInline));x(this,"Parser",F);x(this,"Renderer",_t);x(this,"TextRenderer",qs);x(this,"Lexer",q);x(this,"Tokenizer",kt);x(this,"Hooks",ze);this.use(...e)}walkTokens(e,t){var i,r;let s=[];for(const o of e)switch(s=s.concat(t.call(this,o)),o.type){case"table":{const a=o;for(const l of a.header)s=s.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)s=s.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=o;s=s.concat(this.walkTokens(a.items,t));break}default:{const a=o;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);s=s.concat(this.walkTokens(c,t))}):a.tokens&&(s=s.concat(this.walkTokens(a.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const i={...s};if(i.async=this.defaults.async||i.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[r.level];o?o.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),s.renderer){const r=this.defaults.renderer||new _t(this.defaults);for(const o in s.renderer){if(!(o in r))throw new Error(`renderer '${o}' does not exist`);if(o==="options")continue;const a=o,l=s.renderer[a],c=r[a];r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u||""}}i.renderer=r}if(s.tokenizer){const r=this.defaults.tokenizer||new kt(this.defaults);for(const o in s.tokenizer){if(!(o in r))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,l=s.tokenizer[a],c=r[a];r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u}}i.tokenizer=r}if(s.hooks){const r=this.defaults.hooks||new ze;for(const o in s.hooks){if(!(o in r))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;const a=o,l=s.hooks[a],c=r[a];ze.passThroughHooks.has(o)?r[a]=h=>{if(this.defaults.async)return Promise.resolve(l.call(r,h)).then(d=>c.call(r,d));const u=l.call(r,h);return c.call(r,u)}:r[a]=(...h)=>{let u=l.apply(r,h);return u===!1&&(u=c.apply(r,h)),u}}i.hooks=r}if(s.walkTokens){const r=this.defaults.walkTokens,o=s.walkTokens;i.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q.lex(e,t??this.defaults)}parser(e,t){return F.parse(e,t??this.defaults)}}Ze=new WeakSet,ps=function(e,t){return(s,i)=>{const r={...i},o={...this.defaults,...r};this.defaults.async===!0&&r.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const a=it(this,Tt,nr).call(this,!!o.silent,!!o.async);if(typeof s>"u"||s===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(s):s).then(l=>e(l,o)).then(l=>o.hooks?o.hooks.processAllTokens(l):l).then(l=>o.walkTokens?Promise.all(this.walkTokens(l,o.walkTokens)).then(()=>l):l).then(l=>t(l,o)).then(l=>o.hooks?o.hooks.postprocess(l):l).catch(a);try{o.hooks&&(s=o.hooks.preprocess(s));let l=e(s,o);o.hooks&&(l=o.hooks.processAllTokens(l)),o.walkTokens&&this.walkTokens(l,o.walkTokens);let c=t(l,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(l){return a(l)}}},Tt=new WeakSet,nr=function(e,t){return s=>{if(s.message+=`
784
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+I(s.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(s);throw s}};const me=new bc;function v(n,e){return me.parse(n,e)}v.options=v.setOptions=function(n){return me.setOptions(n),v.defaults=me.defaults,Wi(v.defaults),v};v.getDefaults=Us;v.defaults=be;v.use=function(...n){return me.use(...n),v.defaults=me.defaults,Wi(v.defaults),v};v.walkTokens=function(n,e){return me.walkTokens(n,e)};v.parseInline=me.parseInline;v.Parser=F;v.parser=F.parse;v.Renderer=_t;v.TextRenderer=qs;v.Lexer=q;v.lexer=q.lex;v.Tokenizer=kt;v.Hooks=ze;v.parse=v;v.options;v.setOptions;v.use;v.walkTokens;v.parseInline;F.parse;q.lex;var yc=Object.defineProperty,$c=Object.getOwnPropertyDescriptor,ir=(n,e,t,s)=>{for(var i=s>1?void 0:s?$c(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&yc(e,t,i),i};v.use({renderer:{link(n,e,t){return e||(e=t),`<a target="_blank" href="${n}" title="${e}">${t}</a>`}}});class zt extends w{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=H(),this.contentRef=H(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm),this.includesImage=e=>this.imageRegexp.test(e)}handleAutoscroll(){this.addEventListener("wheel",()=>{this.autoScroll=!1},{passive:!0}),this.addEventListener("click",()=>{this.autoScroll=!1})}handleLightboxClose(){this.addEventListener("action",e=>{e.detail.key==="close-lightbox"&&(this.showLightbox=!1)})}handleLightboxOpen(){this.contentRef.value.addEventListener("click",e=>{e.target.tagName==="IMG"&&(this.showLightbox=!0,this.imageUrl=e.target.src,this.altText=e.target.alt)})}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}async firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var i,r;const e=this.getLastChunk();if(!e)return;this.buffer+=e;const t=v.parse(this.buffer),s=(i=this.contentRef.value)==null?void 0:i.querySelector("div:last-of-type");if(this.includesImage(this.buffer))(r=this.contentRef.value)==null||r.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;s.innerHTML=rs(t),this.applyCodeStyles(s),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(s=>{s.style.whiteSpace="pre-wrap"})}render(){return f`
785
+ <div class="message-type-markdown" ${N(this.contentRef)}>
737
786
  <div></div>
738
787
  </div>
739
- <div class="scroll" ${B(this.scrollRef)}></div>
788
+ <div class="scroll" ${N(this.scrollRef)}></div>
740
789
  ${this.showLightbox?f`<ace-lightbox
741
790
  imageUrl="${this.imageUrl}"
742
791
  altText="${this.altText}"
743
792
  />`:null}
744
- `}}Ht.styles=[_`
793
+ `}}zt.styles=[_`
745
794
  :host {
746
795
  box-sizing: border-box;
747
796
  }
797
+
798
+ :focus {
799
+ outline-color: var(--focus-color);
800
+ }
801
+
748
802
  * {
749
803
  box-sizing: border-box;
750
804
  }
805
+
751
806
  p {
752
807
  margin: 0;
753
808
  padding: 0;
754
809
  word-break: break-word;
755
810
  }
811
+
756
812
  p:not(:first-of-type) {
757
813
  margin-top: var(--spacing-sm);
758
814
  }
815
+
759
816
  a {
760
817
  word-break: break-all;
818
+ color: var(--interactive-primary-background);
761
819
  }
820
+
821
+ a:hover {
822
+ filter: brightness(150%);
823
+ }
824
+
762
825
  img {
763
826
  cursor: pointer;
764
827
  width: 100%;
765
828
  height: auto;
766
829
  object-fit: contain;
767
830
  }
768
- `];rr([w({attribute:!1})],Ht.prototype,"message",2);rr([C()],Ht.prototype,"showLightbox",2);var Cc=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,Sc=(n,e,t,s)=>{for(var i=s>1?void 0:s?_c(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Cc(e,t,i),i};class Fs extends k{constructor(){super(...arguments),this.escapeListener=e=>{e.key==="Escape"&&this.closeLightbox()}}firstUpdated(){document.addEventListener("keydown",this.escapeListener)}disconnectedCallback(){document.removeEventListener("keydown",this.escapeListener)}closeLightbox(){const e=new CustomEvent("action",{composed:!0,detail:{key:"close-lightbox"}});this.dispatchEvent(e)}handleKeyDown(e){if(e.key==="Tab"){const t=this.shadowRoot.querySelectorAll("button");if(t.length){const s=t[0],i=t[t.length-1];e.shiftKey?e.target===s&&(i.focus(),e.preventDefault()):e.target===i&&(s.focus(),e.preventDefault())}}}render(){return f`<div
831
+ `];ir([k({attribute:!1})],zt.prototype,"message",2);ir([C()],zt.prototype,"showLightbox",2);var xc=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,kc=(n,e,t,s)=>{for(var i=s>1?void 0:s?wc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&xc(e,t,i),i};class Fs extends w{constructor(){super(...arguments),this.escapeListener=e=>{e.key==="Escape"&&this.closeLightbox()}}firstUpdated(){document.addEventListener("keydown",this.escapeListener)}disconnectedCallback(){document.removeEventListener("keydown",this.escapeListener)}closeLightbox(){const e=new CustomEvent("action",{composed:!0,detail:{key:"close-lightbox"}});this.dispatchEvent(e)}handleKeyDown(e){if(e.key==="Tab"){const t=this.shadowRoot.querySelectorAll("button");if(t.length){const s=t[0],i=t[t.length-1];e.shiftKey?e.target===s&&(i.focus(),e.preventDefault()):e.target===i&&(s.focus(),e.preventDefault())}}}render(){return f`<div
769
832
  class="lightbox"
770
833
  tabindex="-1"
771
834
  @keydown=${this.handleKeyDown}
772
835
  >
773
836
  <button class="close" @click=${this.closeLightbox}>
774
- <telia-icon svg=${Yo.svg} size="lg"></telia-icon>
837
+ <telia-icon svg=${Zo.svg} size="lg"></telia-icon>
775
838
  </button>
776
839
  <img src="${this.imageUrl}" alt="${this.altText??""}" />
777
840
  </div> `}}Fs.styles=[_`
841
+ :focus {
842
+ outline-color: var(--focus-color);
843
+ }
844
+
778
845
  .lightbox {
779
846
  position: fixed;
780
847
  z-index: 9999;
@@ -808,7 +875,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
808
875
  width: 80%;
809
876
  max-width: 700px;
810
877
  }
811
- `];Sc([w({attribute:!0})],Fs.prototype,"imageUrl",2);var Ec=Object.defineProperty,Ac=Object.getOwnPropertyDescriptor,oe=(n,e,t,s)=>{for(var i=s>1?void 0:s?Ac(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Ec(e,t,i),i};customElements.get("conversation-entry")||customElements.define("conversation-entry",js);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",zt);customElements.get("conversation-group")||customElements.define("conversation-group",Ms);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",Wi);customElements.get("message-type-html")||customElements.define("message-type-html",Us);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",Ht);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",Fs);const or=Ni(k);class X extends or{constructor(){super(...arguments),this.message="",this.disabledInput=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.conversationContentRef=H(),this.conversationFeedRef=H(),this.formRef=H(),this.inputRef=H(),this.scrollRef=H(),this.counterRef=H(),this.chatScrollHeight=0,this.chatCurrentScrollPosition=0,this.toast=new _l(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.platform=null,this.entries=[],this.typing=!1,this.conversationState$=new N("waiting"),this.stateMachine=new El(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(se(e=>e?e==null?void 0:e.provider$:rs(null))),this.userTyping$=new S}async connectedCallback(){super.connectedCallback(),this.messageMaxLength=this.properties.messageMaxLength??this.messageMaxLength,this.messageMaxLengthLabel=this.properties.messageMaxLengthLabel??this.messageMaxLengthLabel,this.skipToLatestMessageLabel=this.properties.skipToLatestMessageLabel??this.skipToLatestMessageLabel;const e=await this.application.container.get("conversation");this.platform=e||null;const t=this.application.trigger;t&&t.widgetActive$.pipe(A(t.componentIsDestroyed$)).subscribe(s=>{const i=this.conversationContentRef.value;i&&(s?i.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=i.scrollTop)}),this.stateSubscription=ro([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([s,i])=>{this.entries=s,this.typing=i}),this.userSubmitSubscription=mt(this,"user-submit").pipe(as(this.provider$)).subscribe(([s,i])=>{i&&i.onUserSubmit(s.detail)}),this._addHeaderOptions(),this.provider$.pipe(as(this.provider$)).subscribe(([s,i])=>{i&&i.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.userSubmitSubscription)==null||e.unsubscribe(),(t=this.stateSubscription)==null||t.unsubscribe()}_actionHandler(e){}isTypingState(){var t,s;const e=(s=(t=this.conversationFeedRef.value)==null?void 0:t.shadowRoot)==null?void 0:s.querySelector(".conversation-feed");if(e){const i=e.lastElementChild;if(i&&i.tagName.toLowerCase()==="ace-typing-state")return!0}return!1}isAtBottom(){const e=this.conversationContentRef.value;return e?e.scrollHeight-e.scrollTop-e.clientHeight<1:!1}scrollToBottom(){var e,t;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var s;return(s=this.scrollRef.value)==null?void 0:s.scrollIntoView({behavior:"smooth"})},300),this.chatScrollHeight=(e=this.scrollRef.value)==null?void 0:e.scrollHeight,this.chatCurrentScrollPosition=(t=this.scrollRef.value)==null?void 0:t.scrollTop)}onSessionUpdated(){this.scrollToBottom()}disableInput(){this.disabledInput=!0}enableInput(){this.disabledInput=!1}disableSubmit(){this.disabledSubmit=!0}enableSubmit(){this.disabledSubmit=!1}clearMessages(){var i,r;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("ace-conversation-feed"),t=(r=e==null?void 0:e.shadowRoot)==null?void 0:r.querySelector(".conversation-feed"),s=t==null?void 0:t.querySelectorAll(".conversation-entry");s==null||s.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}async _onSendMessage(e){var s,i;if(e.preventDefault(),this.message.length<=0||this.message.length>this.messageMaxLength){(s=this.formRef.value)==null||s.classList.add("shake"),setTimeout(()=>{var r;(r=this.formRef.value)==null||r.classList.remove("shake")},500);return}this.message=this.message.slice(0,this.messageMaxLength);const t=new CustomEvent("user-submit",{detail:{text:this.message}});this.dispatchEvent(t),this.message="",this.textAreaLength=0,(i=this.counterRef.value)==null||i.classList.remove("max-char-count-reached"),this.inputRef.value.style.height=this.style.getPropertyValue("--textarea-default-height")}_addHeaderOptions(){const e=this.application.getComponent("widget-header");if(!e)return;const t=this.application.texts,s=t.getOrFallback("conversation.mute","Mute"),i=t.getOrFallback("conversation.unmute","Unmute"),r=!!this.application.storage.get("muteAudioNotifications"),o=e.addOption({label:r?i:s,icon:r?fn.svg:gn.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{!!this.application.storage.get("muteAudioNotifications")?(this.application.unmute(),o.updateLabel(s),o.updateIcon(gn.svg)):(this.application.mute(),o.updateLabel(i),o.updateIcon(fn.svg))}})}_inputHandler(e){var t,s;this.message=e.target.value,e.target.style.height=this.style.getPropertyValue("--textarea-default-height"),e.target.style.height=e.target.scrollHeight+"px",this.textAreaLength=e.target.value.length,e.target.value.length>this.messageMaxLength?(t=this.counterRef.value)==null||t.classList.add("max-char-count-reached"):(s=this.counterRef.value)==null||s.classList.remove("max-char-count-reached")}_keyDownHandler(e){this.userTyping$.next(e.key),e.key==="Enter"&&!e.shiftKey&&!this.disabledSubmit&&(this._onSendMessage(e),e.preventDefault())}skipToLatestMessage(){var s,i;const e=(s=this.conversationFeedRef)==null?void 0:s.value,t=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}handover(e,t){this.enableInput(),this.setToastMessage(null);const s=new CustomEvent("handover",{detail:{providerKey:e,providerOptions:t}});return this.dispatchEvent(s),s.detail.complete||Pe}render(){var i,r,o;const e=this.application.texts;this.conversationState$.value==="waiting"&&((i=this.application)!=null&&i.storage)&&this.platform&&(this.stateMachine.setStorage(this.application.storage),this.conversationState$.next("init"));const t=this.application.settings.components.conversation;return((o=(r=t==null?void 0:t.properties)==null?void 0:r.chat)==null?void 0:o.isThirdPartyWidget)&&(this.renderRoot.host.style.width="100%"),f` <div
878
+ `];kc([k({attribute:!0})],Fs.prototype,"imageUrl",2);var Cc=Object.defineProperty,_c=Object.getOwnPropertyDescriptor,ae=(n,e,t,s)=>{for(var i=s>1?void 0:s?_c(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Cc(e,t,i),i};customElements.get("conversation-entry")||customElements.define("conversation-entry",Rs);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",jt);customElements.get("conversation-group")||customElements.define("conversation-group",Ms);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",Zi);customElements.get("message-type-html")||customElements.define("message-type-html",js);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",zt);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",Fs);const rr=Ni(w);class ee extends rr{constructor(){super(...arguments),this.message="",this.disabledInput=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.conversationContentRef=H(),this.conversationFeedRef=H(),this.formRef=H(),this.inputRef=H(),this.scrollRef=H(),this.counterRef=H(),this.chatScrollHeight=0,this.chatCurrentScrollPosition=0,this.toast=new wl(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.platform=null,this.entries=[],this.typing=!1,this.conversationState$=new B("waiting"),this.stateMachine=new Cl(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(ne(e=>e?e==null?void 0:e.provider$:ss(null))),this.userTyping$=new S}async connectedCallback(){super.connectedCallback(),this.messageMaxLength=this.properties.messageMaxLength??this.messageMaxLength,this.messageMaxLengthLabel=this.properties.messageMaxLengthLabel??this.messageMaxLengthLabel,this.skipToLatestMessageLabel=this.properties.skipToLatestMessageLabel??this.skipToLatestMessageLabel;const e=await this.application.container.get("conversation");this.platform=e||null;const t=this.application.trigger;t&&t.widgetActive$.pipe(A(t.componentIsDestroyed$)).subscribe(s=>{const i=this.conversationContentRef.value;i&&(s?i.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=i.scrollTop)}),this.stateSubscription=so([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([s,i])=>{this.entries=s,this.typing=i}),this.userSubmitSubscription=gt(this,"user-submit").pipe(is(this.provider$)).subscribe(([s,i])=>{i&&i.onUserSubmit(s.detail)}),this._addHeaderOptions(),this.provider$.pipe(is(this.provider$)).subscribe(([s,i])=>{i&&i.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.userSubmitSubscription)==null||e.unsubscribe(),(t=this.stateSubscription)==null||t.unsubscribe()}_actionHandler(e){}isTypingState(){var t,s;const e=(s=(t=this.conversationFeedRef.value)==null?void 0:t.shadowRoot)==null?void 0:s.querySelector(".conversation-feed");if(e){const i=e.lastElementChild;if(i&&i.tagName.toLowerCase()==="ace-typing-state")return!0}return!1}isAtBottom(){const e=this.conversationContentRef.value;return e?e.scrollHeight-e.scrollTop-e.clientHeight<1:!1}scrollToBottom(){var e,t;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var s;return(s=this.scrollRef.value)==null?void 0:s.scrollIntoView({behavior:"smooth"})},300),this.chatScrollHeight=(e=this.scrollRef.value)==null?void 0:e.scrollHeight,this.chatCurrentScrollPosition=(t=this.scrollRef.value)==null?void 0:t.scrollTop)}onSessionUpdated(){this.scrollToBottom()}disableInput(){this.disabledInput=!0}enableInput(){this.disabledInput=!1}disableSubmit(){this.disabledSubmit=!0}enableSubmit(){this.disabledSubmit=!1}clearMessages(){var i,r;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("ace-conversation-feed"),t=(r=e==null?void 0:e.shadowRoot)==null?void 0:r.querySelector(".conversation-feed"),s=t==null?void 0:t.querySelectorAll(".conversation-entry");s==null||s.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}async _onSendMessage(e){var s,i;if(e.preventDefault(),this.message.length<=0||this.message.length>this.messageMaxLength){(s=this.formRef.value)==null||s.classList.add("shake"),setTimeout(()=>{var r;(r=this.formRef.value)==null||r.classList.remove("shake")},500);return}this.message=this.message.slice(0,this.messageMaxLength);const t=new CustomEvent("user-submit",{detail:{text:this.message}});this.dispatchEvent(t),this.message="",this.textAreaLength=0,(i=this.counterRef.value)==null||i.classList.remove("max-char-count-reached"),this.inputRef.value.style.height=this.style.getPropertyValue("--textarea-default-height")}_addHeaderOptions(){const e=this.application.getComponent("widget-header");if(!e)return;const t=this.application.texts,s=t.getOrFallback("conversation.mute","Mute"),i=t.getOrFallback("conversation.unmute","Unmute"),r=!!this.application.storage.get("muteAudioNotifications"),o=e.addOption({label:r?i:s,icon:r?pn.svg:fn.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{!!this.application.storage.get("muteAudioNotifications")?(this.application.unmute(),o.updateLabel(s),o.updateIcon(fn.svg)):(this.application.mute(),o.updateLabel(i),o.updateIcon(pn.svg))}})}_inputHandler(e){var t,s;this.message=e.target.value,e.target.style.height=this.style.getPropertyValue("--textarea-default-height"),e.target.style.height=e.target.scrollHeight+"px",this.textAreaLength=e.target.value.length,e.target.value.length>this.messageMaxLength?(t=this.counterRef.value)==null||t.classList.add("max-char-count-reached"):(s=this.counterRef.value)==null||s.classList.remove("max-char-count-reached")}_keyDownHandler(e){this.userTyping$.next(e.key),e.key==="Enter"&&!e.shiftKey&&!this.disabledSubmit&&(this._onSendMessage(e),e.preventDefault())}skipToLatestMessage(){var s,i;const e=(s=this.conversationFeedRef)==null?void 0:s.value,t=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}handover(e,t){this.enableInput(),this.setToastMessage(null);const s=new CustomEvent("handover",{detail:{providerKey:e,providerOptions:t}});return this.dispatchEvent(s),s.detail.complete||Pe}render(){var i,r,o;const e=this.application.texts;this.conversationState$.value==="waiting"&&((i=this.application)!=null&&i.storage)&&this.platform&&(this.stateMachine.setStorage(this.application.storage),this.conversationState$.next("init"));const t=this.application.settings.components.conversation;return((o=(r=t==null?void 0:t.properties)==null?void 0:r.chat)==null?void 0:o.isThirdPartyWidget)&&(this.renderRoot.host.style.width="100%"),f` <div
812
879
  @action=${this._actionHandler}
813
880
  class=${Ae({conversation:!0,disabled:this.disabledInput,"conversation--has-toast":this.toast.hasMessage(),"conversation--input-has-valid-text":this.message.length>0&&this.message.length<=this.messageMaxLength&&!this.disabledSubmit,"overlay-mode":this.chatOverlayActive})}
814
881
  >
@@ -817,28 +884,28 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
817
884
  class="overlay-button"
818
885
  @click=${()=>this.chatOverlayActive=!1}
819
886
  >
820
- <telia-icon svg=${Qo.svg}></telia-icon>
887
+ <telia-icon svg=${Vo.svg}></telia-icon>
821
888
  </button>
822
889
  </div>`:g}
823
890
  <div
824
891
  class=${Ae({"conversation-content":!0,"conversation-overlay-mode":this.chatOverlayActive})}
825
892
  part="scroll-container"
826
893
  aria-live="polite"
827
- ${B(this.conversationContentRef)}
894
+ ${N(this.conversationContentRef)}
828
895
  >
829
896
  ${this.toast.hasMessage()?f`<div class="conversation__toast">${this.toast.message}</div>`:g}
830
897
  <ace-conversation-feed
831
898
  .entries=${this.entries}
832
899
  .loading=${this.typing}
833
- ${B(this.conversationFeedRef)}
900
+ ${N(this.conversationFeedRef)}
834
901
  @updated=${this.onSessionUpdated}
835
902
  ></ace-conversation-feed>
836
- <div class="scroll" ${B(this.scrollRef)}></div>
903
+ <div class="scroll" ${N(this.scrollRef)}></div>
837
904
  </div>
838
905
  <form
839
906
  class="conversation-bottom"
840
907
  @submit=${this._onSendMessage}
841
- ${B(this.formRef)}
908
+ ${N(this.formRef)}
842
909
  >
843
910
  <label for="chat-message-input" class="visually-hidden">
844
911
  Chat message
@@ -852,7 +919,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
852
919
  ?disabled=${this.disabledInput}
853
920
  @input=${this._inputHandler}
854
921
  @keydown=${this._keyDownHandler}
855
- ${B(this.inputRef)}
922
+ ${N(this.inputRef)}
856
923
  aria-valuenow=${this.textAreaLength}
857
924
  aria-valuemax=${this.messageMaxLength}
858
925
  aria-valuemin="0"
@@ -867,9 +934,9 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
867
934
  title=${e.getOrFallback("conversation.send-alt","Send")}
868
935
  ?disabled=${this.disabledSubmit}
869
936
  >
870
- <telia-icon svg=${xi.svg}></telia-icon>
937
+ <telia-icon svg=${$i.svg}></telia-icon>
871
938
  </button>
872
- <span class="counter" ${B(this.counterRef)}>
939
+ <span class="counter" ${N(this.counterRef)}>
873
940
  ${this.textAreaLength} / ${this.messageMaxLength}</span
874
941
  >
875
942
  </div>
@@ -883,7 +950,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
883
950
  >
884
951
  ${this.skipToLatestMessageLabel}
885
952
  </button>
886
- </div>`}}X.styles=[or.styles||[],_`
953
+ </div>`}}ee.styles=[rr.styles||[],_`
887
954
  :host {
888
955
  font-family: var(--font-family);
889
956
  /* --send-icon-color: var(--gray-dark-color, #a6a6a6); */
@@ -929,14 +996,21 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
929
996
  scrollbar-width: thin; /* Firefox */
930
997
  scrollbar-color: #7f7f7f transparent; /* Firefox */
931
998
  }
999
+
1000
+ :focus {
1001
+ outline-color: var(--focus-color);
1002
+ }
1003
+
932
1004
  ::-webkit-scrollbar {
933
1005
  width: 3px !important;
934
1006
  background-color: transparent;
935
1007
  border-left: none;
936
1008
  }
1009
+
937
1010
  ::-webkit-scrollbar-thumb {
938
1011
  background-color: #7f7f7f;
939
1012
  }
1013
+
940
1014
  ::-webkit-scrollbar-track {
941
1015
  -webkit-box-shadow: none !important;
942
1016
  box-shadow: none !important;
@@ -981,7 +1055,6 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
981
1055
  padding: var(--spacing-sm);
982
1056
  border-radius: var(--spacing-sm);
983
1057
  left: -10000000px;
984
- outline: none;
985
1058
  }
986
1059
  .skip-to-latest-message-button:focus-visible {
987
1060
  left: 50%;
@@ -1159,7 +1232,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1159
1232
  clip: rect(0, 0, 0, 0);
1160
1233
  border: 0;
1161
1234
  }
1162
- `];oe([C()],X.prototype,"message",2);oe([C()],X.prototype,"disabledInput",2);oe([C()],X.prototype,"disabledSubmit",2);oe([C()],X.prototype,"chatOverlayActive",2);oe([C()],X.prototype,"textAreaLength",2);oe([C()],X.prototype,"platform",2);oe([C()],X.prototype,"entries",2);oe([C()],X.prototype,"typing",2);const Q=n=>n.objectType==="info",Tc=n=>n.objectType==="chatEntry",Oc=n=>n.objectType==="pen",Pc=n=>n.objectType==="chatButtonClicked",Lc=n=>n.objectType==="endVideoButtonClicked",Ic=n=>n.type==="queue-status",Rc=n=>n.type==="established",jc=n=>n.type==="pen-status",Mc=n=>n.type==="prepareVideo",Uc=n=>n.type==="videoPrepared",zc=n=>n.type==="chatButtonClicked",Dc=n=>n.type==="endVideoButtonClicked",Hc=n=>n.type==="chat-ended";class Et extends Error{constructor(e){super(e),this.name="EngineException"}}class Zs{constructor(e,t){this.endpoint=e,this.timeout=t,this.protocolVersion="A",this.penStatusJustSent=!1}async chatJoin(e){var s,i,r;const t=await this.sendRequest("chatJoin",{invitationUid:e.invitationUid,uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion,videoChatMode:e.videoChatMode,customerName:e.customerName});if(!t.dataObjects||!((s=t==null?void 0:t.dataObjects)!=null&&s.length)||((i=t==null?void 0:t.dataObjects[0])==null?void 0:i.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(r=t==null?void 0:t.dataObjects[0])==null?void 0:r.text}`):new Error("chatRequest - unknown error")}async chatRequest(e){var s,i,r,o,a;const t=await this.sendRequest("chatRequest",{uid:e.uid,instance:e.instance,queueMessageInterval:e.queueMessageInterval.toString(),protocolVersion:this.protocolVersion,entrance:e.entrance,errand:e.errand,videoChatMode:e.videoChatMode,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,visitorUserAgent:((s=window==null?void 0:window.navigator)==null?void 0:s.userAgent)||"",sourceUrl:((i=window==null?void 0:window.location)==null?void 0:i.href)||""});if(!t.dataObjects||!((r=t==null?void 0:t.dataObjects)!=null&&r.length)||((o=t==null?void 0:t.dataObjects[0])==null?void 0:o.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(a=t==null?void 0:t.dataObjects[0])==null?void 0:a.text}`):new Error("chatRequest - unknown error")}async videoPrepared(e){await this.sendRequest("videoPrepared",{uid:e.uid,instance:e.instance,result:e.result,protocolVersion:this.protocolVersion})}chatRead(e){return this.sendRequest("chatRead",{uid:e.uid,instance:e.instance,entrance:e.entrance,maxObjectId:`${e.maxObjectId}`,protocolVersion:this.protocolVersion})}sendPenStatusOn(e){if(this.penStatusTimer&&clearTimeout(this.penStatusTimer),e.key==="Enter"){this.penStatusJustSent=!1;return}this.penStatusJustSent||(this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"on",protocolVersion:this.protocolVersion}),this.penStatusJustSent=!0,setTimeout(()=>{this.penStatusJustSent=!1},5e3)),this.penStatusTimer=setTimeout(()=>this.sendPenStatusOff(e),5e3)}sendPenStatusOff(e){this.penStatusJustSent&&clearTimeout(this.penStatusTimer),this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"off",protocolVersion:this.protocolVersion})}chatWrite(e){return this.sendPenStatusOff(e),this.sendRequest("chatWrite",{uid:e.uid,instance:e.instance,clockstamp:e.clockstamp,message:e.message,protocolVersion:this.protocolVersion})}async chatQuit(e){this.sendPenStatusOff(e),await this.sendRequest("chatQuit",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion})}async chatCheckSession(e){var s;const t=await this.sendRequest("chatCheckSession",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion});return(s=t.dataObjects)==null||s.sort((i,r)=>i.objectId-r.objectId),t}async chatEmailSession(e){return this.sendRequest("chatEmailSession",{uid:e.uid,instance:e.instance,emailAddress:e.emailAddress,protocolVersion:this.protocolVersion})}async sendRequest(e,t){const s=this.endpoint.includes("engine-simulator")?"include":void 0,i=`${Zs.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(i,{body:new URLSearchParams(t),method:"POST",credentials:s,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*"},signal:this.timeout?AbortSignal.timeout(this.timeout):void 0});return Number(r.headers.get("content-length"))>0?r.json():{}}static removeTrailingSlashes(e){return e.replace(/\/+$/,"")}}const ar=()=>crypto.randomUUID();function qn(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)}class Bc{constructor(e,t){this.config=e,this.messageSubject$=new S,this.actionsSubject$=new S,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t||ar(),this.client=new Zs(this.config.engineUrl,this.config.engineTimeout)}chatJoin(e){return de(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(os(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage||"An error occured",source:"system"}),new E)),se(()=>this.poll().pipe(Wt(()=>this.poll()),Qt())))}chatRequest(e){return de(this.client.chatRequest({uid:this.sessionId,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,instance:this.config.instance,queueMessageInterval:this.config.queueMessageInterval,entrance:this.config.entrance,errand:this.config.errand,videoChatMode:this.config.videoChatMode})).pipe(os(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage||"An error occured",source:"system"}),new E)),se(()=>this.poll().pipe(Wt(()=>this.poll()),Qt())))}reconnect(){return this.poll().pipe(Wt(()=>this.poll()),Qt())}poll(){return co(()=>de(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(yo(e=>{this.processMessages(e)})))}async chatWrite(e){const t=await this.client.chatWrite({uid:this.sessionId,instance:this.config.instance,clockstamp:Date.now().toString(),message:e}),s=((t==null?void 0:t.dataObjects)||[]).find(i=>Q(i)&&i.infoType==="error");if(s)throw new Et(s.text||"Unable to send message")}sendPenStatusOn(e){this.client.sendPenStatusOn({uid:this.sessionId,instance:this.config.instance,key:e})}async videoPrepared(e){await this.client.videoPrepared({uid:this.sessionId,instance:this.config.instance,result:e})}async chatQuit(){await this.client.chatQuit({uid:this.sessionId,instance:this.config.instance})}async chatEmailSession(e){const t=await this.client.chatEmailSession({uid:this.sessionId,instance:this.config.instance,emailAddress:e});if(((t==null?void 0:t.dataObjects)||[]).find(i=>Q(i)&&i.infoType==="error"))throw new Et("Unable to send email with conversation")}processMessages(e){e.dataObjects.forEach(t=>{Tc(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias}),Oc(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),Q(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),Q(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"established",videoEnded:t.videoEnded}),Q(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),Q(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),Pc(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Lc(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),Q(t)&&["afterChat","finished"].includes(t.infoType)&&this.actionsSubject$.next({text:t.text,type:"chat-ended",showForm:t.infoType==="afterChat"})}),this.lastObjectId=e.maxObjectId}async getChatStatus(){const t=(await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance})).dataObjects;for(const s of t)if(Q(s))switch(s.infoType){case"finished":case"afterChat":return"finished";case"noSession":return"noSession"}return"active"}async rehydrate(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});return e.dataObjects.find(t=>Q(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}class te{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return te.instance?te.instance.updateHost(e):te.instance=new te(e),te.instance}updateHost(e){this._host=e,e.addController(this)}hostConnected(){}set email(e){this._email=e,this._host.requestUpdate()}get email(){return this._email}clearData(){this._email="",this._host.requestUpdate()}}var Nc=Object.defineProperty,qc=Object.getOwnPropertyDescriptor,nt=(n,e,t,s)=>{for(var i=s>1?void 0:s?qc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Nc(e,t,i),i};let me=class extends k{constructor(){super(),this.submitted=!1,this.name="",this.email="",this.question="",this.emailController=te.getInstance(this),this.emailController.clearData()}_onStartChat(e){e.preventDefault(),this.submitted=!0,this.emailController.email=this.email;const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:this.name,email:this.email,question:this.question}}});this.dispatchEvent(t)}_nameInputHandler(e){this.name=e.target.value}_emailInputHandler(e){this.email=e.target.value}_questionInputHandler(e){this.question=e.target.value}render(){return this.submitted?g:f`<div class="container">
1235
+ `];ae([C()],ee.prototype,"message",2);ae([C()],ee.prototype,"disabledInput",2);ae([C()],ee.prototype,"disabledSubmit",2);ae([C()],ee.prototype,"chatOverlayActive",2);ae([C()],ee.prototype,"textAreaLength",2);ae([C()],ee.prototype,"platform",2);ae([C()],ee.prototype,"entries",2);ae([C()],ee.prototype,"typing",2);const Y=n=>n.objectType==="info",Sc=n=>n.objectType==="chatEntry",Ec=n=>n.objectType==="pen",Ac=n=>n.objectType==="chatButtonClicked",Tc=n=>n.objectType==="endVideoButtonClicked",Oc=n=>n.type==="queue-status",Pc=n=>n.type==="established",Lc=n=>n.type==="pen-status",Ic=n=>n.type==="prepareVideo",Rc=n=>n.type==="videoPrepared",Mc=n=>n.type==="chatButtonClicked",jc=n=>n.type==="endVideoButtonClicked",Uc=n=>n.type==="chat-ended";class St extends Error{constructor(e){super(e),this.name="EngineException"}}class Vs{constructor(e,t){this.endpoint=e,this.timeout=t,this.protocolVersion="A",this.penStatusJustSent=!1}async chatJoin(e){var s,i,r;const t=await this.sendRequest("chatJoin",{invitationUid:e.invitationUid,uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion,videoChatMode:e.videoChatMode,customerName:e.customerName});if(!t.dataObjects||!((s=t==null?void 0:t.dataObjects)!=null&&s.length)||((i=t==null?void 0:t.dataObjects[0])==null?void 0:i.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(r=t==null?void 0:t.dataObjects[0])==null?void 0:r.text}`):new Error("chatRequest - unknown error")}async chatRequest(e){var s,i,r,o,a;const t=await this.sendRequest("chatRequest",{uid:e.uid,instance:e.instance,queueMessageInterval:e.queueMessageInterval.toString(),protocolVersion:this.protocolVersion,entrance:e.entrance,errand:e.errand.length?e.errand:"997",videoChatMode:e.videoChatMode,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,visitorUserAgent:((s=window==null?void 0:window.navigator)==null?void 0:s.userAgent)||"",sourceUrl:((i=window==null?void 0:window.location)==null?void 0:i.href)||""});if(!t.dataObjects||!((r=t==null?void 0:t.dataObjects)!=null&&r.length)||((o=t==null?void 0:t.dataObjects[0])==null?void 0:o.infoType)==="error")throw t.dataObjects?new Error(`chatRequest - ${(a=t==null?void 0:t.dataObjects[0])==null?void 0:a.text}`):new Error("chatRequest - unknown error")}async videoPrepared(e){await this.sendRequest("videoPrepared",{uid:e.uid,instance:e.instance,result:e.result,protocolVersion:this.protocolVersion})}chatRead(e){return this.sendRequest("chatRead",{uid:e.uid,instance:e.instance,entrance:e.entrance,maxObjectId:`${e.maxObjectId}`,protocolVersion:this.protocolVersion})}sendPenStatusOn(e){if(this.penStatusTimer&&clearTimeout(this.penStatusTimer),e.key==="Enter"){this.penStatusJustSent=!1;return}this.penStatusJustSent||(this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"on",protocolVersion:this.protocolVersion}),this.penStatusJustSent=!0,setTimeout(()=>{this.penStatusJustSent=!1},5e3)),this.penStatusTimer=setTimeout(()=>this.sendPenStatusOff(e),5e3)}sendPenStatusOff(e){this.penStatusJustSent&&clearTimeout(this.penStatusTimer),this.sendRequest("chatPenStatus",{uid:e.uid,instance:e.instance,penStatus:"off",protocolVersion:this.protocolVersion})}chatWrite(e){return this.sendPenStatusOff(e),this.sendRequest("chatWrite",{uid:e.uid,instance:e.instance,clockstamp:e.clockstamp,message:e.message,protocolVersion:this.protocolVersion})}async chatQuit(e){this.sendPenStatusOff(e),await this.sendRequest("chatQuit",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion})}async chatCheckSession(e){var s;const t=await this.sendRequest("chatCheckSession",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion});return(s=t.dataObjects)==null||s.sort((i,r)=>i.objectId-r.objectId),t}async chatEmailSession(e){return this.sendRequest("chatEmailSession",{uid:e.uid,instance:e.instance,emailAddress:e.emailAddress,protocolVersion:this.protocolVersion})}async sendRequest(e,t){const s=this.endpoint.includes("engine-simulator")?"include":void 0,i=`${Vs.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(i,{body:new URLSearchParams(t),method:"POST",credentials:s,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"*/*"},signal:this.timeout?AbortSignal.timeout(this.timeout):void 0});return Number(r.headers.get("content-length"))>0?r.json():{}}static removeTrailingSlashes(e){return e.replace(/\/+$/,"")}}const or=()=>crypto.randomUUID();function Bn(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)}class zc{constructor(e,t){this.config=e,this.messageSubject$=new S,this.actionsSubject$=new S,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t||or(),this.client=new Vs(this.config.engineUrl,this.config.engineTimeout)}chatJoin(e){return pe(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(ns(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage||"An error occured",source:"system"}),new E)),ne(()=>this.poll().pipe(Ft(()=>this.poll()),Vt())))}chatRequest(e){return pe(this.client.chatRequest({uid:this.sessionId,customerName:e.customerName,customerEmailAddress:e.customerEmailAddress,visitorQuestion:e.visitorQuestion,instance:this.config.instance,queueMessageInterval:this.config.queueMessageInterval,entrance:this.config.entrance,errand:this.config.errand,videoChatMode:this.config.videoChatMode})).pipe(ns(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage||"An error occured",source:"system"}),new E)),ne(()=>this.poll().pipe(Ft(()=>this.poll()),Vt())))}reconnect(){return this.poll().pipe(Ft(()=>this.poll()),Vt())}poll(){return oo(()=>pe(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(mo(e=>{this.processMessages(e)})))}async chatWrite(e){const t=await this.client.chatWrite({uid:this.sessionId,instance:this.config.instance,clockstamp:Date.now().toString(),message:e}),s=((t==null?void 0:t.dataObjects)||[]).find(i=>Y(i)&&i.infoType==="error");if(s)throw new St(s.text||"Unable to send message")}sendPenStatusOn(e){this.client.sendPenStatusOn({uid:this.sessionId,instance:this.config.instance,key:e})}async videoPrepared(e){await this.client.videoPrepared({uid:this.sessionId,instance:this.config.instance,result:e})}async chatQuit(){await this.client.chatQuit({uid:this.sessionId,instance:this.config.instance})}async chatEmailSession(e){const t=await this.client.chatEmailSession({uid:this.sessionId,instance:this.config.instance,emailAddress:e});if(((t==null?void 0:t.dataObjects)||[]).find(i=>Y(i)&&i.infoType==="error"))throw new St("Unable to send email with conversation")}processMessages(e){e.dataObjects.forEach(t=>{Sc(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias}),Ec(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),Y(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),Y(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"established",videoEnded:t.videoEnded}),Y(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),Y(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),Ac(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Tc(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),Y(t)&&["afterChat","finished"].includes(t.infoType)&&this.actionsSubject$.next({text:t.text,type:"chat-ended",showForm:t.infoType==="afterChat"})}),this.lastObjectId=e.maxObjectId}async getChatStatus(){const t=(await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance})).dataObjects;for(const s of t)if(Y(s))switch(s.infoType){case"finished":case"afterChat":return"finished";case"noSession":return"noSession"}return"active"}async rehydrate(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});return e.dataObjects.find(t=>Y(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}class se{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return se.instance?se.instance.updateHost(e):se.instance=new se(e),se.instance}updateHost(e){this._host=e,e.addController(this)}hostConnected(){}set email(e){this._email=e,this._host.requestUpdate()}get email(){return this._email}clearData(){this._email="",this._host.requestUpdate()}}var Dc=Object.defineProperty,Hc=Object.getOwnPropertyDescriptor,nt=(n,e,t,s)=>{for(var i=s>1?void 0:s?Hc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Dc(e,t,i),i};let ve=class extends w{constructor(){super(),this.submitted=!1,this.name="",this.email="",this.question="",this.emailController=se.getInstance(this),this.emailController.clearData()}_onStartChat(e){e.preventDefault(),this.submitted=!0,this.emailController.email=this.email;const t=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:this.name,email:this.email,question:this.question}}});this.dispatchEvent(t)}_nameInputHandler(e){this.name=e.target.value}_emailInputHandler(e){this.email=e.target.value}_questionInputHandler(e){this.question=e.target.value}render(){return this.submitted?g:f`<div class="container">
1163
1236
  <p>
1164
1237
  Please fill out the form below to start chatting with the next available
1165
1238
  agent.
@@ -1198,13 +1271,18 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1198
1271
  autocomplete="off"
1199
1272
  />
1200
1273
  <button type="submit" data-testid="start-chat-button">
1201
- Start Chat
1274
+ Start chat
1202
1275
  </button>
1203
1276
  </form>
1204
- </div>`}};me.styles=[_`
1277
+ </div>`}};ve.styles=[_`
1205
1278
  :host {
1206
1279
  display: block;
1207
1280
  }
1281
+
1282
+ :focus {
1283
+ outline-color: var(--focus-color);
1284
+ }
1285
+
1208
1286
  .visually-hidden {
1209
1287
  border: 0;
1210
1288
  clip: rect(0 0 0 0);
@@ -1215,6 +1293,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1215
1293
  position: absolute;
1216
1294
  width: 1px;
1217
1295
  }
1296
+
1218
1297
  .container,
1219
1298
  form {
1220
1299
  display: flex;
@@ -1225,7 +1304,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1225
1304
  }
1226
1305
 
1227
1306
  form {
1228
- background-color: #fff;
1307
+ background-color: var(--white-color);
1229
1308
  padding: var(--spacing-md);
1230
1309
  border-radius: var(--border-radius);
1231
1310
  box-shadow: rgba(0, 0, 0, 0.16) 0px 5px 9px;
@@ -1244,10 +1323,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1244
1323
  }
1245
1324
 
1246
1325
  button {
1247
- background-color: var(--primary-background);
1248
- border: 0 solid var(--primary-background);
1249
- color: var(--text-on-primary-background);
1250
- border-radius: var(--border-radius);
1326
+ background-color: var(--interactive-primary-background);
1327
+ border: none;
1328
+ color: var(--interactive-text-on-primary-background);
1329
+ border-radius: var(--border-radius-xl);
1251
1330
  display: inline-flex;
1252
1331
  cursor: pointer;
1253
1332
  align-items: center;
@@ -1255,14 +1334,16 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1255
1334
  text-align: center;
1256
1335
  justify-content: center;
1257
1336
  font-weight: 500;
1258
- padding: var(--spacing-md);
1337
+ padding: var(--spacing-sm) var(--spacing-lg);
1259
1338
  font-size: inherit;
1339
+ width: fit-content;
1340
+ margin: 0 auto;
1260
1341
  }
1261
1342
 
1262
1343
  button:hover {
1263
- opacity: 0.8;
1344
+ filter: brightness(150%);
1264
1345
  }
1265
- `];nt([C()],me.prototype,"submitted",2);nt([C()],me.prototype,"name",2);nt([C()],me.prototype,"email",2);nt([C()],me.prototype,"question",2);me=nt([ie("ace-welcome-form")],me);var Vc=Object.defineProperty,Fc=Object.getOwnPropertyDescriptor,Bt=(n,e,t,s)=>{for(var i=s>1?void 0:s?Fc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Vc(e,t,i),i};let Te=class extends k{constructor(){super(...arguments),this.submitted=!1,this.name=""}_onStartChat(n){n.preventDefault(),this.submitted=!0;const e=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:this.name}}});this.dispatchEvent(e)}_nameInputHandler(n){this.name=n.target.value}render(){var i;const e=(i=this.application.branding().graphics)==null?void 0:i.logotype;this.application.root.style.getPropertyValue("visibility")===""&&(this.application.root.style.visibility="hidden");const s=new URLSearchParams(document.location.search).get("invitationUid");return this.submitted?g:s?f`<div class="container">
1346
+ `];nt([C()],ve.prototype,"submitted",2);nt([C()],ve.prototype,"name",2);nt([C()],ve.prototype,"email",2);nt([C()],ve.prototype,"question",2);ve=nt([re("ace-welcome-form")],ve);var Nc=Object.defineProperty,Bc=Object.getOwnPropertyDescriptor,Dt=(n,e,t,s)=>{for(var i=s>1?void 0:s?Bc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Nc(e,t,i),i};let Te=class extends w{constructor(){super(...arguments),this.submitted=!1,this.name=""}_onStartChat(n){n.preventDefault(),this.submitted=!0;const e=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:this.name}}});this.dispatchEvent(e)}_nameInputHandler(n){this.name=n.target.value}render(){var i;const e=(i=this.application.branding().graphics)==null?void 0:i.logotype;this.application.root.style.getPropertyValue("visibility")===""&&(this.application.root.style.visibility="hidden");const s=new URLSearchParams(document.location.search).get("invitationUid");return this.submitted?g:s?f`<div class="container">
1266
1347
  <img class="logotype" src="${e}" />
1267
1348
  <p>
1268
1349
  You’ve been invited to an ongoing chat. Please fill in your name or
@@ -1291,6 +1372,11 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1291
1372
  border: 1px solid #00000029;
1292
1373
  border-radius: var(--border-radius-sm);
1293
1374
  }
1375
+
1376
+ :focus {
1377
+ outline-color: var(--focus-color);
1378
+ }
1379
+
1294
1380
  .container,
1295
1381
  form {
1296
1382
  display: flex;
@@ -1299,6 +1385,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1299
1385
  margin-bottom: var(--spacing-sm);
1300
1386
  width: 100%;
1301
1387
  }
1388
+
1302
1389
  .container {
1303
1390
  padding: var(--spacing-xl);
1304
1391
  max-width: 300px;
@@ -1308,6 +1395,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1308
1395
  width: 32px;
1309
1396
  }
1310
1397
  }
1398
+
1311
1399
  form {
1312
1400
  gap: var(--spacing-sm);
1313
1401
 
@@ -1329,14 +1417,15 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1329
1417
  border-radius: var(--border-radius);
1330
1418
  margin-bottom: var(--spacing-xl);
1331
1419
  }
1420
+
1332
1421
  p {
1333
1422
  line-height: 24px;
1334
1423
  }
1335
- button {
1336
- background-color: var(--primary-background);
1337
1424
 
1338
- border: 0 solid var(--primary-background);
1339
- color: var(--text-on-primary-background);
1425
+ button {
1426
+ background-color: var(--interactive-primary-background);
1427
+ color: var(--interactive-text-on-primary-background);
1428
+ border: none;
1340
1429
  border-radius: var(--border-radius-xl);
1341
1430
  display: inline-flex;
1342
1431
  cursor: pointer;
@@ -1351,9 +1440,9 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1351
1440
  }
1352
1441
 
1353
1442
  button:hover {
1354
- opacity: 0.8;
1443
+ filter: brightness(150%);
1355
1444
  }
1356
- `];Bt([C()],Te.prototype,"submitted",2);Bt([C()],Te.prototype,"name",2);Bt([Le({context:ve}),w({attribute:!1})],Te.prototype,"application",2);Te=Bt([ie("ace-welcome-form-third-party")],Te);var Zc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,Ws=(n,e,t,s)=>{for(var i=s>1?void 0:s?Wc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Zc(e,t,i),i};let Fe=class extends k{constructor(){super(...arguments),this.email="",this.isEmailValid=!1,this.emailController=te.getInstance(this)}_onSendChatLog(n){n.preventDefault();const e=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{email:this.email}}});this.dispatchEvent(e)}_emailInputHandler(n){this.email=n.target.value}connectedCallback(){super.connectedCallback(),this.email=this.emailController.email,this.isEmailValid=qn(this.email)}render(){return f`<div class="container">
1445
+ `];Dt([C()],Te.prototype,"submitted",2);Dt([C()],Te.prototype,"name",2);Dt([Mt({context:Xe}),k({attribute:!1})],Te.prototype,"application",2);Te=Dt([re("ace-welcome-form-third-party")],Te);var qc=Object.defineProperty,Fc=Object.getOwnPropertyDescriptor,Zs=(n,e,t,s)=>{for(var i=s>1?void 0:s?Fc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&qc(e,t,i),i};let Fe=class extends w{constructor(){super(...arguments),this.email="",this.isEmailValid=!1,this.emailController=se.getInstance(this)}_onSendChatLog(n){n.preventDefault();const e=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{email:this.email}}});this.dispatchEvent(e)}_emailInputHandler(n){this.email=n.target.value}connectedCallback(){super.connectedCallback(),this.email=this.emailController.email,this.isEmailValid=Bn(this.email)}render(){return f`<div class="container">
1357
1446
  <form class="form" @submit=${this._onSendChatLog}>
1358
1447
  <h3>Chat sent to email</h3>
1359
1448
 
@@ -1363,7 +1452,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1363
1452
  id="email"
1364
1453
  placeholder="Email Address"
1365
1454
  .value=${this.email}
1366
- @input=${n=>{this._emailInputHandler(n),this.isEmailValid=qn(this.email)}}
1455
+ @input=${n=>{this._emailInputHandler(n),this.isEmailValid=Bn(this.email)}}
1367
1456
  autocomplete="email"
1368
1457
  />
1369
1458
 
@@ -1381,6 +1470,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1381
1470
  display: block;
1382
1471
  }
1383
1472
 
1473
+ :focus {
1474
+ outline-color: var(--focus-color);
1475
+ }
1476
+
1384
1477
  .container,
1385
1478
  form {
1386
1479
  display: flex;
@@ -1396,8 +1489,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1396
1489
  }
1397
1490
 
1398
1491
  form,
1399
- input,
1400
- button {
1492
+ input {
1401
1493
  font-family: inherit;
1402
1494
  padding: var(--spacing-md);
1403
1495
  border-radius: var(--border-radius);
@@ -1425,49 +1517,49 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1425
1517
  }
1426
1518
 
1427
1519
  button {
1428
- background-color: var(--primary-background);
1429
- border: 0 solid var(--primary-background);
1430
- color: var(--text-on-primary-background);
1520
+ background-color: var(--interactive-primary-background);
1521
+ color: var(--interactive-text-on-primary-background);
1522
+ border: none;
1523
+ border-radius: var(--border-radius-xl);
1431
1524
  display: inline-flex;
1432
1525
  cursor: pointer;
1433
1526
  align-items: center;
1434
1527
  transition: all 150ms ease;
1435
1528
  text-align: center;
1436
1529
  justify-content: center;
1530
+ font-family: inherit;
1437
1531
  font-weight: 500;
1438
1532
  font-size: inherit;
1533
+ width: fit-content;
1534
+ padding: var(--spacing-sm) var(--spacing-lg);
1535
+ margin: 0 auto;
1439
1536
  }
1440
1537
 
1441
1538
  button:hover {
1442
1539
  opacity: 0.8;
1443
1540
  }
1444
- `];Ws([C()],Fe.prototype,"email",2);Ws([C()],Fe.prototype,"isEmailValid",2);Fe=Ws([ie("ace-conversation-ended-form")],Fe);/**
1445
- * @license
1446
- * Copyright 2018 Google LLC
1447
- * SPDX-License-Identifier: BSD-3-Clause
1448
- */const lr="important",Qc=" !"+lr,Nt=Je(class extends Ut{constructor(n){var e;if(super(n),n.type!==Ke.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const s=n[t];return s==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?t.removeProperty(s):t[s]=null);for(const s in e){const i=e[s];if(i!=null){this.ft.add(s);const r=typeof i=="string"&&i.endsWith(Qc);s.includes("-")||r?t.setProperty(s,r?i.slice(0,-11):i,r?lr:""):t[s]=i}}return K}});var Yc=Object.defineProperty,Gc=Object.getOwnPropertyDescriptor,cr=(n,e,t,s)=>{for(var i=s>1?void 0:s?Gc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Yc(e,t,i),i};let At=class extends k{_onStartVideo(n){n.preventDefault(),this.dispatchResult("ok","Video call was accepted")}_onCancel(){this.dispatchResult("declined","Video call was declined")}dispatchResult(n,e){const t=new CustomEvent("action",{composed:!0,detail:{key:"video-confirm",data:{result:n,text:e}}});this.dispatchEvent(t)}render(){var e,t,s,i;const n={backgroundColor:(t=(e=this.application.settings)==null?void 0:e.branding.colors)==null?void 0:t.destructiveColor,color:(i=(s=this.application.settings)==null?void 0:s.branding.colors)==null?void 0:i.textOnDestructiveColor};return f`<div class="container">
1541
+ `];Zs([C()],Fe.prototype,"email",2);Zs([C()],Fe.prototype,"isEmailValid",2);Fe=Zs([re("ace-conversation-ended-form")],Fe);var Vc=Object.defineProperty,Zc=Object.getOwnPropertyDescriptor,Wc=(n,e,t,s)=>{for(var i=s>1?void 0:s?Zc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Vc(e,t,i),i};let fs=class extends w{_onStartVideo(n){n.preventDefault(),this.dispatchResult("ok","Video call was accepted")}_onCancel(){this.dispatchResult("declined","Video call was declined")}dispatchResult(n,e){const t=new CustomEvent("action",{composed:!0,detail:{key:"video-confirm",data:{result:n,text:e}}});this.dispatchEvent(t)}render(){return f`<div class="container">
1449
1542
  <h3>Start video call with agent</h3>
1450
- <p>The agent has invited you to a video call. Please accept.</p>
1543
+ <p>The agent has invited you to join a video call.</p>
1451
1544
  <div class="button-container">
1452
1545
  <button class="primary" type="submit" @click=${this._onStartVideo}>
1453
- <telia-icon svg=${Wo.svg}></telia-icon>
1546
+ <telia-icon svg=${Fo.svg}></telia-icon>
1454
1547
  Accept
1455
1548
  </button>
1456
- <button
1457
- class="secondary"
1458
- type="button"
1459
- @click=${this._onCancel}
1460
- style=${Nt(n)}
1461
- >
1462
- <telia-icon svg=${Ss.svg}></telia-icon>
1549
+ <button class="secondary" type="button" @click=${this._onCancel}>
1550
+ <telia-icon svg=${_s.svg}></telia-icon>
1463
1551
  Decline
1464
1552
  </button>
1465
1553
  </div>
1466
- </div>`}};At.styles=[_`
1554
+ </div>`}};fs.styles=[_`
1467
1555
  :host {
1468
1556
  display: block;
1469
1557
  }
1470
1558
 
1559
+ :focus {
1560
+ outline-color: var(--focus-color);
1561
+ }
1562
+
1471
1563
  .container {
1472
1564
  padding: var(--spacing-md);
1473
1565
  border-radius: var(--border-radius);
@@ -1490,8 +1582,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1490
1582
  }
1491
1583
 
1492
1584
  button {
1493
- border: 0 solid var(--secondary-background);
1494
- color: var(--text-on-primary-background);
1585
+ border: none;
1495
1586
  border-radius: var(--border-radius-xl);
1496
1587
  display: inline-flex;
1497
1588
  cursor: pointer;
@@ -1507,27 +1598,33 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1507
1598
  }
1508
1599
 
1509
1600
  button.primary {
1510
- background-color: var(--primary-background);
1601
+ background-color: var(--interactive-primary-background);
1602
+ color: var(--interactive-text-on-primary-background);
1511
1603
  margin-right: var(--spacing-md);
1512
1604
  }
1513
1605
 
1514
1606
  button.secondary {
1515
- color: var(--white-color);
1607
+ background-color: var(--destructive-color);
1608
+ color: var(--text-on-destructive-color);
1516
1609
  }
1517
1610
 
1518
1611
  button:hover {
1519
1612
  filter: brightness(150%);
1520
1613
  }
1521
- `];cr([Le({context:ve}),w({attribute:!1})],At.prototype,"application",2);At=cr([ie("ace-video-confirm-dialog")],At);var Kc=Object.defineProperty,Jc=Object.getOwnPropertyDescriptor,hr=(n,e,t,s)=>{for(var i=s>1?void 0:s?Jc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Kc(e,t,i),i};let Tt=class extends k{constructor(n){super(),this.surveyUrl="",this.surveyLinkText="",this.surveyText="",this.surveyTitle="",this.searchParams={},n&&(this.searchParams=n)}connectedCallback(){super.connectedCallback();const n=this.application.settings.survey,e=n.surveyBaseUrl;this.surveyLinkText=n.surveyLinkText,this.surveyText=n.surveyText,this.surveyTitle=n.surveyTitle;const t=new URL(e);Object.keys(this.searchParams).forEach(s=>{t.searchParams.set(s,this.searchParams[s])}),this.surveyUrl=t.href}render(){return f`<div class="container">
1614
+ `];fs=Wc([re("ace-video-confirm-dialog")],fs);var Qc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,ar=(n,e,t,s)=>{for(var i=s>1?void 0:s?Yc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Qc(e,t,i),i};let Et=class extends w{constructor(n){super(),this.surveyUrl="",this.surveyLinkText="",this.surveyText="",this.surveyTitle="",this.searchParams={},n&&(this.searchParams=n)}connectedCallback(){super.connectedCallback();const n=this.application.settings.survey,e=n.surveyBaseUrl;this.surveyLinkText=n.surveyLinkText,this.surveyText=n.surveyText,this.surveyTitle=n.surveyTitle;const t=new URL(e);Object.keys(this.searchParams).forEach(s=>{t.searchParams.set(s,this.searchParams[s])}),this.surveyUrl=t.href}render(){return f`<div class="container">
1522
1615
  <h3>${this.surveyTitle}</h3>
1523
1616
  <p>${this.surveyText}</p>
1524
1617
  <div class="link-container">
1525
1618
  <a class="primary" target="_blank" href="${this.surveyUrl}">
1526
1619
  ${this.surveyLinkText}
1527
- <telia-icon svg=${Go.svg}></telia-icon>
1620
+ <telia-icon svg=${Wo.svg}></telia-icon>
1528
1621
  </a>
1529
1622
  </div>
1530
- </div>`}};Tt.styles=[_`
1623
+ </div>`}};Et.styles=[_`
1624
+ :focus {
1625
+ outline-color: var(--focus-color);
1626
+ }
1627
+
1531
1628
  .container {
1532
1629
  padding: var(--spacing-md);
1533
1630
  border-radius: var(--border-radius);
@@ -1537,10 +1634,12 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1537
1634
  flex-direction: column;
1538
1635
  gap: var(--spacing-md);
1539
1636
  }
1637
+
1540
1638
  h3,
1541
1639
  p {
1542
1640
  margin: 0;
1543
1641
  }
1642
+
1544
1643
  a {
1545
1644
  border: 0 solid var(--secondary-background);
1546
1645
  color: var(--text-on-primary-background);
@@ -1566,27 +1665,27 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1566
1665
  justify-content: center;
1567
1666
  align-items: center;
1568
1667
  }
1569
- `];hr([Le({context:ve}),w({attribute:!1})],Tt.prototype,"application",2);Tt=hr([ie("ace-survey")],Tt);var Xc=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,ur=(n,e,t,s)=>{for(var i=s>1?void 0:s?eh(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Xc(e,t,i),i};let Ot=class extends k{_onClose(){this.application.trigger&&this.application.trigger.toggleActive()}render(){var e,t;const n={backgroundColor:(t=(e=this.application.settings)==null?void 0:e.branding.colors)==null?void 0:t.destructiveColor};return f`<div class="container">
1668
+ `];ar([Mt({context:Xe}),k({attribute:!1})],Et.prototype,"application",2);Et=ar([re("ace-survey")],Et);var Gc=Object.defineProperty,Kc=Object.getOwnPropertyDescriptor,lr=(n,e,t,s)=>{for(var i=s>1?void 0:s?Kc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Gc(e,t,i),i};let At=class extends w{_onClose(){this.application.trigger&&this.application.trigger.toggleActive()}render(){return f`<div class="container">
1570
1669
  <h3>We're currently closed</h3>
1571
1670
  <p>
1572
1671
  Our team is currently away, but we'll be back during our regular opening
1573
1672
  hours.
1574
1673
  </p>
1575
1674
  <div class="button-container">
1576
- <button
1577
- type="button"
1578
- @click=${this._onClose}
1579
- style=${Nt(n)}
1580
- >
1581
- <telia-icon svg=${Ss.svg}></telia-icon>
1675
+ <button type="button" @click=${this._onClose}>
1676
+ <telia-icon svg=${_s.svg}></telia-icon>
1582
1677
  Close chat
1583
1678
  </button>
1584
1679
  </div>
1585
- </div>`}};Ot.styles=[_`
1680
+ </div>`}};At.styles=[_`
1586
1681
  :host {
1587
1682
  display: block;
1588
1683
  }
1589
1684
 
1685
+ :focus {
1686
+ outline-color: var(--focus-color);
1687
+ }
1688
+
1590
1689
  .container {
1591
1690
  padding: var(--spacing-md);
1592
1691
  border-radius: var(--border-radius);
@@ -1608,7 +1707,9 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1608
1707
  }
1609
1708
 
1610
1709
  button {
1611
- border: 0 solid var(--secondary-background);
1710
+ background-color: var(--destructive-color);
1711
+ color: var(--text-on-destructive-color);
1712
+ border: none;
1612
1713
  border-radius: var(--border-radius-xl);
1613
1714
  display: flex;
1614
1715
  align-items: center;
@@ -1625,24 +1726,22 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1625
1726
  button:hover {
1626
1727
  filter: brightness(150%);
1627
1728
  }
1628
- `];ur([Le({context:ve}),w({attribute:!1})],Ot.prototype,"application",2);Ot=ur([ie("ace-entrance-closed-dialog")],Ot);var th=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,dr=(n,e,t,s)=>{for(var i=s>1?void 0:s?sh(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&th(e,t,i),i};let Pt=class extends k{_onQuit(){this.dispatchResult("quit")}_onCancel(){this.dispatchResult("cancel")}dispatchResult(n){const e=new CustomEvent("action",{composed:!0,detail:{key:"quit-chat",data:{result:n}}});this.dispatchEvent(e)}render(){var e,t,s,i;const n={backgroundColor:(t=(e=this.application.settings)==null?void 0:e.branding.colors)==null?void 0:t.destructiveColor,color:(i=(s=this.application.settings)==null?void 0:s.branding.colors)==null?void 0:i.textOnDestructiveColor};return f`<div class="container">
1729
+ `];lr([Mt({context:Xe}),k({attribute:!1})],At.prototype,"application",2);At=lr([re("ace-entrance-closed-dialog")],At);var Jc=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,eh=(n,e,t,s)=>{for(var i=s>1?void 0:s?Xc(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&Jc(e,t,i),i};let gs=class extends w{_onQuit(){this.dispatchResult("quit")}_onCancel(){this.dispatchResult("cancel")}dispatchResult(n){const e=new CustomEvent("action",{composed:!0,detail:{key:"quit-chat",data:{result:n}}});this.dispatchEvent(e)}render(){return f`<div class="container">
1629
1730
  <h3>Do you want to end the chat?</h3>
1630
1731
  <p>Please reach out to us again if you need help with anything else.</p>
1631
1732
  <div class="button-container">
1632
1733
  <button class="cancel" @click=${this._onCancel}>Cancel</button>
1633
- <button
1634
- class="quit"
1635
- @click=${this._onQuit}
1636
- style=${Nt(n)}
1637
- >
1638
- End chat
1639
- </button>
1734
+ <button class="quit" @click=${this._onQuit}>End chat</button>
1640
1735
  </div>
1641
- </div>`}};Pt.styles=[_`
1736
+ </div>`}};gs.styles=[_`
1642
1737
  :host {
1643
1738
  display: block;
1644
1739
  }
1645
1740
 
1741
+ :focus {
1742
+ outline-color: var(--focus-color);
1743
+ }
1744
+
1646
1745
  .container {
1647
1746
  padding: var(--spacing-md);
1648
1747
  border-radius: var(--border-radius);
@@ -1665,6 +1764,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1665
1764
  }
1666
1765
 
1667
1766
  button {
1767
+ border: none;
1668
1768
  border-radius: var(--border-radius-xl);
1669
1769
  display: inline-flex;
1670
1770
  cursor: pointer;
@@ -1681,26 +1781,29 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1681
1781
 
1682
1782
  button.cancel {
1683
1783
  margin-right: var(--spacing-md);
1684
- color: var(--text-on-secondary-background);
1685
- background-color: var(--secondary-background);
1686
- border: 1px solid var(--text-on-secondary-background);
1784
+ color: var(--interactive-primary-background);
1785
+ background-color: transparent;
1687
1786
  }
1688
1787
 
1689
1788
  button.quit {
1690
- color: var(--text-on-primary-background);
1691
- border: none;
1789
+ color: var(--text-on-destructive-color);
1790
+ background-color: var(--destructive-color);
1692
1791
  }
1693
1792
 
1694
1793
  button:hover {
1695
1794
  filter: brightness(150%);
1696
1795
  }
1697
- `];dr([Le({context:ve}),w({attribute:!1})],Pt.prototype,"application",2);Pt=dr([ie("ace-quit-confirm-dialog")],Pt);var nh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,pr=(n,e,t,s)=>{for(var i=s>1?void 0:s?ih(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&nh(e,t,i),i};let Ze=class extends k{constructor(n,e){super(),this.primaryBackgroundColor="",this.secondaryBackgroundColor="",this.destructiveColor="",this.headerHeight=0,this.copyrightHeight=0,this.userUrl=new URL(n),this.userUrl.searchParams.set("lang","en"),this.userUrl.searchParams.set("guestId",e)}connectedCallback(){var s;super.connectedCallback();const n=this.application.getComponent("widget-header");n&&(this.headerHeight=n.getBoundingClientRect().height);const e=this.application.getComponent("copyright");e&&(this.copyrightHeight=e.getBoundingClientRect().height);const t=(s=this.application.settings)==null?void 0:s.branding.colors;this.primaryBackgroundColor=t.primaryBackground,this.secondaryBackgroundColor=t.textOnPrimaryBackground,this.destructiveColor=t.destructiveColor,this.primaryBackgroundColor&&this.userUrl.searchParams.set("primaryColor",this.primaryBackgroundColor),this.secondaryBackgroundColor&&this.userUrl.searchParams.set("secondaryColor",this.secondaryBackgroundColor),this.destructiveColor&&this.userUrl.searchParams.set("tertiaryColor",this.destructiveColor)}render(){const n={borderColor:this.primaryBackgroundColor,top:this.headerHeight+"px",bottom:this.copyrightHeight+"px"};return f` <div class="container" style=${Nt(n)}>
1796
+ `];gs=eh([re("ace-quit-confirm-dialog")],gs);/**
1797
+ * @license
1798
+ * Copyright 2018 Google LLC
1799
+ * SPDX-License-Identifier: BSD-3-Clause
1800
+ */const cr="important",th=" !"+cr,sh=Ke(class extends Rt{constructor(n){var e;if(super(n),n.type!==Ge.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const s=n[t];return s==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?t.removeProperty(s):t[s]=null);for(const s in e){const i=e[s];if(i!=null){this.ft.add(s);const r=typeof i=="string"&&i.endsWith(th);s.includes("-")||r?t.setProperty(s,r?i.slice(0,-11):i,r?cr:""):t[s]=i}}return J}});var nh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,hr=(n,e,t,s)=>{for(var i=s>1?void 0:s?ih(e,t):e,r=n.length-1,o;r>=0;r--)(o=n[r])&&(i=(s?o(e,t,i):o(i))||i);return s&&i&&nh(e,t,i),i};let Ve=class extends w{constructor(n,e){super(),this.primaryColor="",this.secondaryColor="",this.tertiaryColor="",this.headerHeight=0,this.copyrightHeight=0,this.userUrl=new URL(n),this.userUrl.searchParams.set("lang","en"),this.userUrl.searchParams.set("guestId",e)}connectedCallback(){var s;super.connectedCallback();const n=this.application.getComponent("widget-header");n&&(this.headerHeight=n.getBoundingClientRect().height);const e=this.application.getComponent("copyright");e&&(this.copyrightHeight=e.getBoundingClientRect().height);const t=(s=this.application.settings)==null?void 0:s.branding.colors;this.primaryColor=t.interactivePrimaryBackground,this.secondaryColor=t.interactiveTextOnPrimaryBackground,this.tertiaryColor=t.interactiveDestructiveBackground,this.primaryColor&&this.userUrl.searchParams.set("primaryColor",this.primaryColor),this.secondaryColor&&this.userUrl.searchParams.set("secondaryColor",this.secondaryColor),this.tertiaryColor&&this.userUrl.searchParams.set("tertiaryColor",this.tertiaryColor)}getSpacingMd(){const e=getComputedStyle(this).getPropertyValue("--spacing-md").trim();if(e.endsWith("rem")){const s=parseFloat(getComputedStyle(this).fontSize);return parseFloat(e)*s}const t=parseFloat(e);return isNaN(t)?0:t}render(){const n=this.getSpacingMd(),e={top:this.headerHeight+n+"px",bottom:this.copyrightHeight+n+"px"};return f` <div class="container" style=${sh(e)}>
1698
1801
  <iframe
1699
1802
  class="video-iframe"
1700
1803
  src=${this.userUrl.href}
1701
1804
  allow="camera; microphone; display-capture;"
1702
1805
  ></iframe>
1703
- </div>`}};Ze.styles=[_`
1806
+ </div>`}};Ve.styles=[_`
1704
1807
  :host {
1705
1808
  display: block;
1706
1809
  }
@@ -1710,9 +1813,6 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1710
1813
  position: absolute;
1711
1814
  z-index: 1;
1712
1815
  background-color: var(--white-color);
1713
- flex-direction: column-reverse;
1714
- border-top: var(--spacing-md) solid;
1715
- border-bottom: var(--spacing-md) solid;
1716
1816
  }
1717
1817
 
1718
1818
  .video-iframe {
@@ -1721,5 +1821,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
1721
1821
  border: none;
1722
1822
  height: 100%;
1723
1823
  width: 100%;
1824
+ border: 1px solid var(--black-border-color);
1825
+ box-sizing: border-box;
1724
1826
  }
1725
- `];pr([Le({context:ve}),w({attribute:!1})],Ze.prototype,"application",2);Ze=pr([ie("ace-video-iframe")],Ze);class rh extends Co{constructor(e,t){super(e,t),this.agent=this.createAgent(""),this.user=this.createUser(""),this.pendingMessages=[],this.conversationOption=null,this.disconnected$=new S,this._conversationOptions={},this.sessionId=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this._onQueueStatusReceived=s=>{this._setQueueStatus(s.text||null)},this._onEstablished=s=>{this._setQueueStatus(null),this.agent.name=s.agent,s.videoEnded&&this.removeVideo()},this._onPrepareVideo=()=>{this.prepareVideo()},this._onVideoPrepared=s=>{this.showVideo(s.userUrl)},this._onChatButtonClicked=s=>{this.showChatOverVideo(s.guestId)},this._onEndVideoButtonClicked=s=>{this.handleEndVideoConference(s.guestId)},this._onPenStatusChange=s=>{s.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this._onChatEnded=async s=>{this.setToastMessage(null),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),s.showForm&&this.showConversationEndedForm();const i=this.component.application.settings;i.survey&&i.survey.surveyBaseUrl&&this.showSurvey(),this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption(),this.complete()},this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.properties=t.properties}async connect(e={}){super.connect(),this._conversationOptions=e;const t={...this.properties.chat||{},...e},s=!!this.sessionId;if(!s){const r=ar();this._setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new Bc(t,this.sessionId),this.engine.messages().subscribe(r=>{switch(r.source){case"agent":this.printAgent(r.text);break;case"customer":this._clearPendingMessages(),this.isThirdPartyParticipant?r.source==="customer"&&r.invitationNo==="0"?this.printAgent(r.text,r.alias):this.printUser(r.text):r.source==="customer"&&Number(r.invitationNo)>0?this.printAgent(r.text,r.alias):this.printUser(r.text);break;case"system":this.printSystem(r.text);break}}),this.engine.actions().pipe(A(this.disconnected$),j(Ic)).subscribe(this._onQueueStatusReceived),this.engine.actions().pipe(A(this.disconnected$),j(Rc)).subscribe(this._onEstablished),this.engine.actions().pipe(A(this.disconnected$),j(Mc)).subscribe(this._onPrepareVideo),this.engine.actions().pipe(A(this.disconnected$),j(Uc)).subscribe(this._onVideoPrepared),this.engine.actions().pipe(A(this.disconnected$),j(zc)).subscribe(this._onChatButtonClicked),this.engine.actions().pipe(A(this.disconnected$),j(Dc)).subscribe(this._onEndVideoButtonClicked),this.engine.actions().pipe(A(this.disconnected$),j(jc)).subscribe(this._onPenStatusChange),this.engine.actions().pipe(A(this.disconnected$),j(Hc)).subscribe(this._onChatEnded),this.setHeaderOption();const i=this.component.application.trigger;i&&i.widgetActive$.pipe(A(i.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(A(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),s?this.engine.rehydrate().then(async r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(A(this.disconnected$)).subscribe():await this.initializeChat(t)}):await this.initializeChat(t)}async setHeaderOption(){switch(await this.engine.getChatStatus()){case"finished":this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption();break;case"active":this._setEndConversationOption();break;case"noSession":this.conversationOption=null}}disconnected(){super.disconnected(),this.disconnected$.next()}_removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}_addHeaderOptions(e,t,s,i,r=!0){const o=this.component.application.getComponent("widget-header");if(o)return this.conversationOption?(this.conversationOption.label=e,this.conversationOption.key=t,this.conversationOption.icon=s,this.conversationOption.onClick=i,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:s,closeOnClick:!0,key:t,onClick:i,enabled:r})}_startChat(e){this.engine&&(this.isThirdPartyParticipant?(this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName||e.customerName}).pipe(A(this.disconnected$)).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress||"",visitorQuestion:e.visitorQuestion||""}).pipe(A(this.disconnected$)).subscribe(),e.customerEmailAddress,this.component.enableInput(),this._setEndConversationOption())}_restartNewChat(){this.engine&&(this._setSessionId(null),this.component.clearMessages(),this._removeHeaderOptions(),this.connect(this._conversationOptions))}showSurvey(){const e=new U(O.System,{name:""},[{items:[["ace-survey",{content:""},{agentName:this.agent.name,entrance:this.engine.config.entrance,errand:this.engine.config.errand}]]}]);this.printEntry(e)}async initializeChat(e){await this.isEntranceOpen(e.webApiUrl,e.entrance)?this.customerName?this._startChat({customerName:this.customerName}):this.showWelcomeForm():this.showEntranceClosedDialog()}showWelcomeForm(){this.component.disableInput();let e;this.isThirdPartyParticipant?e=new U(O.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):e=new U(O.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(e),e.actions$.pipe(j(t=>t.key==="submitted"),he(1)).subscribe(t=>{e.remove(),this._startChat({customerName:t.data.name,customerEmailAddress:t.data.email,visitorQuestion:t.data.question})})}showEntranceClosedDialog(){this.component.disableInput();const e=new U(O.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}_setQueueStatus(e){this.setToastMessage(e)}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new U(O.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(j(t=>t.key==="quit-chat"),he(1)).subscribe(t=>{var s;this.quitConfirmDialogEntry&&this.quitConfirmDialogEntry.remove(),((s=t.data)==null?void 0:s.result)==="quit"&&this.endConversation()})}showConversationEndedForm(){const e=new U(O.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(j(t=>t.key==="submitted"),he(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}prepareVideo(){this.videoConfirmDialogEntry=new U(O.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(j(e=>e.key==="video-confirm"),he(1)).subscribe(e=>{var t;this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),e.data.result==="declined"&&(this.guestId=null),(t=this.engine)==null||t.videoPrepared(e.data.result),this.printSystem(e.data.text)})}showVideo(e){var s;this.guestId=crypto.randomUUID(),this.videoIFrameElement=new Ze(e,this.guestId);const t=this.component.application.root;(s=t==null?void 0:t.shadowRoot)==null||s.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}handleEndVideoConference(e){this.guestId&&e===this.guestId&&this.removeVideo()}printAgent(e,t=""){const s=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),s}printUser(e){const t=ls(sn(e));return this.user.print(t)}printSystem(e){const t=ls(sn(e));return this.system.print(t)}_setEndConversationOption(){this.conversationOption=this._addHeaderOptions("End conversation","end-conversation-button",Ss.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}_setStartNewChatOption(){this.conversationOption=this._addHeaderOptions("Start new chat","start-new-chat-button",xi.svg,()=>{this._restartNewChat()})}removeVideo(){var e;(e=this.videoIFrameElement)==null||e.remove(),this.guestId=null,this.chatOverlayActive&&(this.chatOverlayActive=!1,this.showChatOverlay$.next(this.chatOverlayActive)),this.inVideoCall=!1,this.setHeaderOption()}async endConversation(){var e;await((e=this.engine)==null?void 0:e.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem("An email with the conversation was sent.")}catch(s){this.printSystem("Unable to send email with the conversation."),s instanceof Et||console.warn("Unhandled error:",s)}}_clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}_setSessionId(e){this.sessionId=e}async onUserSubmit(e){var s;const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t);try{await((s=this.engine)==null?void 0:s.chatWrite(e.text))}catch(i){i instanceof Et?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",i))}}async rehydrate(e){e.chatSessionId&&this._setSessionId(e.chatSessionId)}save(e){this.saveToCurrentSession$.next(e)}async isEntranceOpen(e,t){var i;let s=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?s=(i=o==null?void 0:o.resultData)==null?void 0:i.isOpen:console.log(`Problem when fetching open status for entrance ${t}:`,o==null?void 0:o.resultMessage)}catch(r){console.log(`Failed to fetch open status for ${t}:`,r)}return s}}const oh=async n=>{(await vs.getInstance(n.container)).registerProvider("ace-chat",t=>new rh("ace-chat",t))};exports.ChatProviderPlugin=oh;
1827
+ `];hr([Mt({context:Xe}),k({attribute:!1})],Ve.prototype,"application",2);Ve=hr([re("ace-video-iframe")],Ve);class rh extends xo{constructor(e,t){super(e,t),this.agent=this.createAgent(""),this.user=this.createUser(""),this.pendingMessages=[],this.conversationOption=null,this.disconnected$=new S,this._conversationOptions={},this.sessionId=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this._onQueueStatusReceived=s=>{this._setQueueStatus(s.text||null)},this._onEstablished=s=>{this._setQueueStatus(null),this.agent.name=s.agent,s.videoEnded&&this.removeVideo()},this._onPrepareVideo=()=>{this.prepareVideo()},this._onVideoPrepared=s=>{this.showVideo(s.userUrl)},this._onChatButtonClicked=s=>{this.showChatOverVideo(s.guestId)},this._onEndVideoButtonClicked=s=>{this.handleEndVideoConference(s.guestId)},this._onPenStatusChange=s=>{s.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this._onChatEnded=async s=>{this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),s.showForm&&this.showConversationEndedForm();const i=this.component.application.settings;i.survey&&i.survey.surveyBaseUrl&&this.showSurvey(),this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption(),this.complete()},this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.properties=t.properties}async connect(e={}){super.connect(),this._conversationOptions=e;const t={...this.properties.chat||{},...e},s=!!this.sessionId;if(!s){const r=or();this._setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new zc(t,this.sessionId),this.engine.messages().subscribe(r=>{switch(r.source){case"agent":this.printAgent(r.text);break;case"customer":this._clearPendingMessages(),this.isThirdPartyParticipant?r.source==="customer"&&r.invitationNo==="0"?this.printAgent(r.text,r.alias):this.printUser(r.text):r.source==="customer"&&Number(r.invitationNo)>0?this.printAgent(r.text,r.alias):this.printUser(r.text);break;case"system":this.printSystem(r.text);break}}),this.engine.actions().pipe(A(this.disconnected$),M(Oc)).subscribe(this._onQueueStatusReceived),this.engine.actions().pipe(A(this.disconnected$),M(Pc)).subscribe(this._onEstablished),this.engine.actions().pipe(A(this.disconnected$),M(Ic)).subscribe(this._onPrepareVideo),this.engine.actions().pipe(A(this.disconnected$),M(Rc)).subscribe(this._onVideoPrepared),this.engine.actions().pipe(A(this.disconnected$),M(Mc)).subscribe(this._onChatButtonClicked),this.engine.actions().pipe(A(this.disconnected$),M(jc)).subscribe(this._onEndVideoButtonClicked),this.engine.actions().pipe(A(this.disconnected$),M(Lc)).subscribe(this._onPenStatusChange),this.engine.actions().pipe(A(this.disconnected$),M(Uc)).subscribe(this._onChatEnded),this.setHeaderOption();const i=this.component.application.trigger;i&&i.widgetActive$.pipe(A(i.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(A(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),s?this.engine.rehydrate().then(async r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(A(this.disconnected$)).subscribe():await this.initializeChat(t)}):await this.initializeChat(t)}async setHeaderOption(){switch(await this.engine.getChatStatus()){case"finished":this.isThirdPartyParticipant?this._removeHeaderOptions():this._setStartNewChatOption();break;case"active":this._setEndConversationOption();break;case"noSession":this.conversationOption=null}}disconnected(){super.disconnected(),this.disconnected$.next()}_removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}_addHeaderOptions(e,t,s,i,r=!0){const o=this.component.application.getComponent("widget-header");if(o)return this.conversationOption?(this.conversationOption.label=e,this.conversationOption.key=t,this.conversationOption.icon=s,this.conversationOption.onClick=i,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:s,closeOnClick:!0,key:t,onClick:i,enabled:r})}_startChat(e){this.engine&&(this.isThirdPartyParticipant?(this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName||e.customerName}).pipe(A(this.disconnected$)).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress||"",visitorQuestion:e.visitorQuestion||""}).pipe(A(this.disconnected$)).subscribe(),e.customerEmailAddress,this.component.enableInput(),this._setEndConversationOption())}_restartNewChat(){this.engine&&(this._setSessionId(null),this.component.clearMessages(),this._removeHeaderOptions(),this.connect(this._conversationOptions))}showSurvey(){const e=new U(O.System,{name:""},[{items:[["ace-survey",{content:""},{agentName:this.agent.name,entrance:this.engine.config.entrance,errand:this.engine.config.errand}]]}]);this.printEntry(e)}async initializeChat(e){let t=!0;e.webApiUrl&&(t=await this.isEntranceOpen(e.webApiUrl,e.entrance)),t?this.customerName?this._startChat({customerName:this.customerName}):this.showWelcomeForm():this.showEntranceClosedDialog()}showWelcomeForm(){this.component.disableInput();let e;this.isThirdPartyParticipant?e=new U(O.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):e=new U(O.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(e),e.actions$.pipe(M(t=>t.key==="submitted"),ue(1)).subscribe(t=>{e.remove(),this._startChat({customerName:t.data.name,customerEmailAddress:t.data.email,visitorQuestion:t.data.question})})}showEntranceClosedDialog(){this.component.disableInput();const e=new U(O.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}_setQueueStatus(e){this.setToastMessage(e)}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new U(O.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(M(t=>t.key==="quit-chat"),ue(1)).subscribe(t=>{var s;this.quitConfirmDialogEntry&&this.quitConfirmDialogEntry.remove(),((s=t.data)==null?void 0:s.result)==="quit"&&this.endConversation()})}showConversationEndedForm(){const e=new U(O.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(M(t=>t.key==="submitted"),ue(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}prepareVideo(){this.videoConfirmDialogEntry=new U(O.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(M(e=>e.key==="video-confirm"),ue(1)).subscribe(e=>{var t;this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),e.data.result==="declined"&&(this.guestId=null),(t=this.engine)==null||t.videoPrepared(e.data.result),this.printSystem(e.data.text)})}showVideo(e){var s;this.guestId=crypto.randomUUID(),this.videoIFrameElement=new Ve(e,this.guestId);const t=this.component.application.root;(s=t==null?void 0:t.shadowRoot)==null||s.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}handleEndVideoConference(e){this.guestId&&e===this.guestId&&this.removeVideo()}printAgent(e,t=""){const s=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),s}printUser(e){const t=rs(tn(e));return this.user.print(t)}printSystem(e){const t=rs(tn(e));return this.system.print(t)}_setEndConversationOption(){this.conversationOption=this._addHeaderOptions("End conversation","end-conversation-button",_s.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}_setStartNewChatOption(){this.conversationOption=this._addHeaderOptions("Start new chat","start-new-chat-button",$i.svg,()=>{this._restartNewChat()})}removeVideo(){var e;(e=this.videoIFrameElement)==null||e.remove(),this.guestId=null,this.chatOverlayActive&&(this.chatOverlayActive=!1,this.showChatOverlay$.next(this.chatOverlayActive)),this.inVideoCall=!1,this.setHeaderOption()}async endConversation(){var e;await((e=this.engine)==null?void 0:e.chatQuit())}async sendConversationEmail(e){var t;try{await((t=this.engine)==null?void 0:t.chatEmailSession(e)),this.printSystem("An email with the conversation was sent.")}catch(s){this.printSystem("Unable to send email with the conversation."),s instanceof St||console.warn("Unhandled error:",s)}}_clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}_setSessionId(e){this.sessionId=e}async onUserSubmit(e){var s;const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t);try{await((s=this.engine)==null?void 0:s.chatWrite(e.text))}catch(i){i instanceof St?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",i))}}async rehydrate(e){e.chatSessionId&&this._setSessionId(e.chatSessionId)}save(e){this.saveToCurrentSession$.next(e)}async isEntranceOpen(e,t){var i;let s=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?s=(i=o==null?void 0:o.resultData)==null?void 0:i.isOpen:console.log(`Problem when fetching open status for entrance ${t}:`,o==null?void 0:o.resultMessage)}catch(r){console.log(`Failed to fetch open status for ${t}:`,r)}return s}}const oh=async n=>{(await ms.getInstance(n.container)).registerProvider("ace-chat",t=>new rh("ace-chat",t))};exports.ChatProviderPlugin=oh;