@telia-ace/ace-chat-flamingo 1.1.123-rc.24 → 1.1.123-rc.26

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.
Files changed (3) hide show
  1. package/index.js +76 -61
  2. package/index.mjs +243 -219
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -1,24 +1,24 @@
1
- "use strict";var pl=Object.defineProperty;var fl=(n,e,t)=>e in n?pl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>fl(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Li=function(n,e){return Li=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Li(n,e)};function Ie(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Li(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function gl(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(u){try{l(i.next(u))}catch(p){o(p)}}function c(u){try{l(i.throw(u))}catch(p){o(p)}}function l(u){u.done?r(u.value):s(u.value).then(a,c)}l((i=i.apply(n,e||[])).next())})}function _o(n,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(i=1,s&&(r=l[0]&2?s.return:l[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,l[1])).done)return r;switch(s=0,r&&(l=[l[0]&2,r.value]),l[0]){case 0:case 1:r=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1],r=l;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(l);break}r[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(u){l=[6,u],s=0}finally{i=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function yt(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ze(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),s,r=[],o;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)r.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return r}function Xe(n,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,r;i<s;i++)(r||!(i in e))&&(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return n.concat(r||Array.prototype.slice.call(e))}function gt(n){return this instanceof gt?(this.v=n,this):new gt(n)}function ml(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),s,r=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(m){return Promise.resolve(m).then(g,p)}}function a(g,m){i[g]&&(s[g]=function($){return new Promise(function($e,le){r.push([g,$,$e,le])>1||c(g,$)})},m&&(s[g]=m(s[g])))}function c(g,m){try{l(i[g](m))}catch($){d(r[0][3],$)}}function l(g){g.value instanceof gt?Promise.resolve(g.value.v).then(u,p):d(r[0][2],g)}function u(g){c("next",g)}function p(g){c("throw",g)}function d(g,m){g(m),r.shift(),r.length&&c(r[0][0],r[0][1])}}function vl(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 yt=="function"?yt(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=n[r]&&function(o){return new Promise(function(a,c){o=n[r](o),s(a,c,o.done,o.value)})}}function s(r,o,a,c){Promise.resolve(c).then(function(l){r({value:l,done:a})},o)}}function E(n){return typeof n=="function"}function Ao(n){var e=function(i){Error.call(i),i.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var gi=Ao(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
1
+ "use strict";var pl=Object.defineProperty;var fl=(n,e,t)=>e in n?pl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>fl(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ri=function(n,e){return Ri=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Ri(n,e)};function Ie(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ri(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function gl(n,e,t,i){function s(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(u){try{l(i.next(u))}catch(p){o(p)}}function c(u){try{l(i.throw(u))}catch(p){o(p)}}function l(u){u.done?r(u.value):s(u.value).then(a,c)}l((i=i.apply(n,e||[])).next())})}function _o(n,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(i=1,s&&(r=l[0]&2?s.return:l[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,l[1])).done)return r;switch(s=0,r&&(l=[l[0]&2,r.value]),l[0]){case 0:case 1:r=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1],r=l;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(l);break}r[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(u){l=[6,u],s=0}finally{i=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function yt(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function He(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),s,r=[],o;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)r.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return r}function Xe(n,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,r;i<s;i++)(r||!(i in e))&&(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return n.concat(r||Array.prototype.slice.call(e))}function gt(n){return this instanceof gt?(this.v=n,this):new gt(n)}function ml(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),s,r=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(m){return Promise.resolve(m).then(g,p)}}function a(g,m){i[g]&&(s[g]=function($){return new Promise(function($e,le){r.push([g,$,$e,le])>1||c(g,$)})},m&&(s[g]=m(s[g])))}function c(g,m){try{l(i[g](m))}catch($){d(r[0][3],$)}}function l(g){g.value instanceof gt?Promise.resolve(g.value.v).then(u,p):d(r[0][2],g)}function u(g){c("next",g)}function p(g){c("throw",g)}function d(g,m){g(m),r.shift(),r.length&&c(r[0][0],r[0][1])}}function vl(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 yt=="function"?yt(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=n[r]&&function(o){return new Promise(function(a,c){o=n[r](o),s(a,c,o.done,o.value)})}}function s(r,o,a,c){Promise.resolve(c).then(function(l){r({value:l,done:a})},o)}}function E(n){return typeof n=="function"}function Ao(n){var e=function(i){Error.call(i),i.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var gi=Ao(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
2
2
  `+t.map(function(i,s){return s+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Cn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var tn=(function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,i,s,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=yt(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch($){e={error:$}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(E(u))try{u()}catch($){r=$ instanceof gi?$.errors:[$]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=yt(p),g=d.next();!g.done;g=d.next()){var m=g.value;try{xr(m)}catch($){r=r??[],$ instanceof gi?r=Xe(Xe([],ze(r)),ze($.errors)):r.push($)}}}catch($){i={error:$}}finally{try{g&&!g.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}}if(r)throw new gi(r)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)xr(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)&&Cn(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&Cn(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=(function(){var e=new n;return e.closed=!0,e})(),n})(),To=tn.EMPTY;function Oo(n){return n instanceof tn||n&&"closed"in n&&E(n.remove)&&E(n.add)&&E(n.unsubscribe)}function xr(n){E(n)?n():n.unsubscribe()}var bl={Promise:void 0},yl={setTimeout:function(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Xe([n,e],ze(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Lo(n){yl.setTimeout(function(){throw n})}function En(){}function wn(n){n()}var es=(function(n){Ie(e,n);function e(t){var i=n.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Oo(t)&&t.add(i)):i.destination=xl,i}return e.create=function(t,i,s){return new Ri(t,i,s)},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})(tn),$l=(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(i){mn(i)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){mn(i)}else mn(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){mn(t)}},n})(),Ri=(function(n){Ie(e,n);function e(t,i,s){var r=n.call(this)||this,o;return E(t)||!t?o={next:t??void 0,error:i??void 0,complete:s??void 0}:o=t,r.destination=new $l(o),r}return e})(es);function mn(n){Lo(n)}function wl(n){throw n}var xl={closed:!0,next:En,error:wl,complete:En},ts=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ct(n){return n}function kl(n){return n.length===0?Ct:n.length===1?n[0]:function(t){return n.reduce(function(i,s){return s(i)},t)}}var j=(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,i){var s=this,r=Cl(e)?e:new Ri(e,t,i);return wn(function(){var o=s,a=o.operator,c=o.source;r.add(a?a.call(r,c):c?s._subscribe(r):s._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 i=this;return t=kr(t),new t(function(s,r){var o=new Ri({next:function(a){try{e(a)}catch(c){r(c),o.unsubscribe()}},error:r,complete:s});i.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[ts]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return kl(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=kr(e),new e(function(i,s){var r;t.subscribe(function(o){return r=o},function(o){return s(o)},function(){return i(r)})})},n.create=function(e){return new n(e)},n})();function kr(n){var e;return(e=n??bl.Promise)!==null&&e!==void 0?e:Promise}function Sl(n){return n&&E(n.next)&&E(n.error)&&E(n.complete)}function Cl(n){return n&&n instanceof es||Sl(n)&&Oo(n)}function El(n){return E(n==null?void 0:n.lift)}function re(n){return function(e){if(El(e))return e.lift(function(t){try{return n(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function Q(n,e,t,i,s){return new _l(n,e,t,i,s)}var _l=(function(n){Ie(e,n);function e(t,i,s,r,o,a){var c=n.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=i?function(l){try{i(l)}catch(u){t.error(u)}}:n.prototype._next,c._error=r?function(l){try{r(l)}catch(u){t.error(u)}finally{this.unsubscribe()}}:n.prototype._error,c._complete=s?function(){try{s()}catch(l){t.error(l)}finally{this.unsubscribe()}}:n.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;n.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(es),Al=Ao(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=(function(n){Ie(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 i=new Sr(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new Al},e.prototype.next=function(t){var i=this;wn(function(){var s,r;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=yt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(l){s={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var i=this;wn(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var s=i.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;wn(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.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 i=this,s=this,r=s.hasError,o=s.isStopped,a=s.observers;return r||o?To:(this.currentObservers=null,a.push(t),new tn(function(){i.currentObservers=null,Cn(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,s=i.hasError,r=i.thrownError,o=i.isStopped;s?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new j;return t.source=this,t},e.create=function(t,i){return new Sr(t,i)},e})(j),Sr=(function(n){Ie(e,n);function e(t,i){var s=n.call(this)||this;return s.destination=t,s.source=i,s}return e.prototype.next=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,t)},e.prototype.error=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&s!==void 0?s:To},e})(P),he=(function(n){Ie(e,n);function e(t){var i=n.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=n.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,s=t.thrownError,r=t._value;if(i)throw s;return this._throwIfClosed(),r},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e})(P),Tl={now:function(){return Date.now()}},Ol=(function(n){Ie(e,n);function e(t,i){return n.call(this)||this}return e.prototype.schedule=function(t,i){return this},e})(tn),Cr={setInterval:function(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setInterval.apply(void 0,Xe([n,e],ze(t)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},Ll=(function(n){Ie(e,n);function e(t,i){var s=n.call(this,t,i)||this;return s.scheduler=t,s.work=i,s.pending=!1,s}return e.prototype.schedule=function(t,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,i),this},e.prototype.requestAsyncId=function(t,i,s){return s===void 0&&(s=0),Cr.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&Cr.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var s=!1,r;try{this.work(t)}catch(o){s=!0,r=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,s=t.scheduler,r=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Cn(r,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e})(Ol),Er=(function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},n.now=Tl.now,n})(),Rl=(function(n){Ie(e,n);function e(t,i){i===void 0&&(i=Er.now);var s=n.call(this,t,i)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,s){for(;t=i.shift();)t.unsubscribe();throw s}},e})(Er),fp=new Rl(Ll);var tt=new j(function(n){return n.complete()});function Il(n){return n&&E(n.schedule)}function ns(n){return n[n.length-1]}function Ro(n){return E(ns(n))?n.pop():void 0}function is(n){return Il(ns(n))?n.pop():void 0}function Pl(n,e){return typeof ns(n)=="number"?n.pop():e}var ss=(function(n){return n&&typeof n.length=="number"&&typeof n!="function"});function Io(n){return E(n==null?void 0:n.then)}function Po(n){return E(n[ts])}function Mo(n){return Symbol.asyncIterator&&E(n==null?void 0:n[Symbol.asyncIterator])}function No(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 Ml(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Uo=Ml();function Do(n){return E(n==null?void 0:n[Uo])}function zo(n){return ml(this,arguments,function(){var t,i,s,r;return _o(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,gt(t.read())];case 3:return i=o.sent(),s=i.value,r=i.done,r?[4,gt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,gt(s)];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 Ho(n){return E(n==null?void 0:n.getReader)}function oe(n){if(n instanceof j)return n;if(n!=null){if(Po(n))return Nl(n);if(ss(n))return Ul(n);if(Io(n))return Dl(n);if(Mo(n))return jo(n);if(Do(n))return zl(n);if(Ho(n))return Hl(n)}throw No(n)}function Nl(n){return new j(function(e){var t=n[ts]();if(E(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ul(n){return new j(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function Dl(n){return new j(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Lo)})}function zl(n){return new j(function(e){var t,i;try{for(var s=yt(n),r=s.next();!r.done;r=s.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}e.complete()})}function jo(n){return new j(function(e){jl(n,e).catch(function(t){return e.error(t)})})}function Hl(n){return jo(zo(n))}function jl(n,e){var t,i,s,r;return gl(this,void 0,void 0,function(){var o,a;return _o(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=vl(n),c.label=1;case 1:return[4,t.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(o=i.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),s={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(r=t.return)?[4,r.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Ue(n,e,t,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var r=e.schedule(function(){t(),s?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(r),!s)return r}function Fo(n,e){return e===void 0&&(e=0),re(function(t,i){t.subscribe(Q(i,function(s){return Ue(i,n,function(){return i.next(s)},e)},function(){return Ue(i,n,function(){return i.complete()},e)},function(s){return Ue(i,n,function(){return i.error(s)},e)}))})}function Bo(n,e){return e===void 0&&(e=0),re(function(t,i){i.add(n.schedule(function(){return t.subscribe(i)},e))})}function Fl(n,e){return oe(n).pipe(Bo(e),Fo(e))}function Bl(n,e){return oe(n).pipe(Bo(e),Fo(e))}function ql(n,e){return new j(function(t){var i=0;return e.schedule(function(){i===n.length?t.complete():(t.next(n[i++]),t.closed||this.schedule())})})}function Vl(n,e){return new j(function(t){var i;return Ue(t,e,function(){i=n[Uo](),Ue(t,e,function(){var s,r,o;try{s=i.next(),r=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return E(i==null?void 0:i.return)&&i.return()}})}function qo(n,e){if(!n)throw new Error("Iterable cannot be null");return new j(function(t){Ue(t,e,function(){var i=n[Symbol.asyncIterator]();Ue(t,e,function(){i.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Wl(n,e){return qo(zo(n),e)}function Gl(n,e){if(n!=null){if(Po(n))return Fl(n,e);if(ss(n))return ql(n,e);if(Io(n))return Bl(n,e);if(Mo(n))return qo(n,e);if(Do(n))return Vl(n,e);if(Ho(n))return Wl(n,e)}throw No(n)}function Ye(n,e){return e?Gl(n,e):oe(n)}function Ii(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=is(n);return Ye(n,t)}function _n(n,e){return re(function(t,i){var s=0;t.subscribe(Q(i,function(r){i.next(n.call(e,r,s++))}))})}var Zl=Array.isArray;function Yl(n,e){return Zl(e)?n.apply(void 0,Xe([],ze(e))):n(e)}function Vo(n){return _n(function(e){return Yl(n,e)})}var Ql=Array.isArray,Xl=Object.getPrototypeOf,Kl=Object.prototype,Jl=Object.keys;function ec(n){if(n.length===1){var e=n[0];if(Ql(e))return{args:e,keys:null};if(tc(e)){var t=Jl(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:n,keys:null}}function tc(n){return n&&typeof n=="object"&&Xl(n)===Kl}function nc(n,e){return n.reduce(function(t,i,s){return t[i]=e[s],t},{})}function ic(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=is(n),i=Ro(n),s=ec(n),r=s.args,o=s.keys;if(r.length===0)return Ye([],t);var a=new j(sc(r,t,o?function(c){return nc(o,c)}:Ct));return i?a.pipe(Vo(i)):a}function sc(n,e,t){return t===void 0&&(t=Ct),function(i){_r(e,function(){for(var s=n.length,r=new Array(s),o=s,a=s,c=function(u){_r(e,function(){var p=Ye(n[u],e),d=!1;p.subscribe(Q(i,function(g){r[u]=g,d||(d=!0,a--),a||i.next(t(r.slice()))},function(){--o||i.complete()}))},i)},l=0;l<s;l++)c(l)},i)}}function _r(n,e,t){n?Ue(t,n,e):e()}function rc(n,e,t,i,s,r,o,a){var c=[],l=0,u=0,p=!1,d=function(){p&&!c.length&&!l&&e.complete()},g=function($){return l<i?m($):c.push($)},m=function($){l++;var $e=!1;oe(t($,u++)).subscribe(Q(e,function(le){e.next(le)},function(){$e=!0},void 0,function(){if($e)try{l--;for(var le=function(){var Pe=c.shift();o||m(Pe)};c.length&&l<i;)le();d()}catch(Pe){e.error(Pe)}}))};return n.subscribe(Q(e,g,function(){p=!0,d()})),function(){}}function qt(n,e,t){return t===void 0&&(t=1/0),E(e)?qt(function(i,s){return _n(function(r,o){return e(i,r,s,o)})(oe(n(i,s)))},t):(typeof e=="number"&&(t=e),re(function(i,s){return rc(i,s,n,t)}))}function oc(n){return n===void 0&&(n=1/0),qt(Ct,n)}function ac(n){return new j(function(e){oe(n()).subscribe(e)})}var lc=["addListener","removeListener"],cc=["addEventListener","removeEventListener"],uc=["on","off"];function An(n,e,t,i){if(E(t)&&(i=t,t=void 0),i)return An(n,e,t).pipe(Vo(i));var s=ze(pc(n)?cc.map(function(a){return function(c){return n[a](e,c,t)}}):hc(n)?lc.map(Ar(n,e)):dc(n)?uc.map(Ar(n,e)):[],2),r=s[0],o=s[1];if(!r&&ss(n))return qt(function(a){return An(a,e,t)})(oe(n));if(!r)throw new TypeError("Invalid event target");return new j(function(a){var c=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return a.next(1<l.length?l:l[0])};return r(c),function(){return o(c)}})}function Ar(n,e){return function(t){return function(i){return n[t](e,i)}}}function hc(n){return E(n.addListener)&&E(n.removeListener)}function dc(n){return E(n.on)&&E(n.off)}function pc(n){return E(n.addEventListener)&&E(n.removeEventListener)}function fc(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=is(n),i=Pl(n,1/0),s=n;return s.length?s.length===1?oe(s[0]):oc(i)(Ye(s,t)):tt}function W(n,e){return re(function(t,i){var s=0;t.subscribe(Q(i,function(r){return n.call(e,r,s++)&&i.next(r)}))})}function Pi(n){return re(function(e,t){var i=null,s=!1,r;i=e.subscribe(Q(t,void 0,void 0,function(o){r=oe(n(o,Pi(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):s=!0})),s&&(i.unsubscribe(),i=null,r.subscribe(t))})}function mi(n,e){return E(e)?qt(n,e,1):qt(n,1)}function me(n){return n<=0?function(){return tt}:re(function(e,t){var i=0;e.subscribe(Q(t,function(s){++i<=n&&(t.next(s),n<=i&&t.complete())}))})}function vi(n){var e=1/0,t;return e<=0?function(){return tt}:re(function(i,s){var r=0,o,a=function(){o==null||o.unsubscribe(),o=null;var l,u;t!=null||c()},c=function(){var l=!1;o=i.subscribe(Q(s,void 0,function(){++r<e?o?a():l=!0:s.complete()})),l&&a()};c()})}function Oe(n,e){return re(function(t,i){var s=null,r=0,o=!1,a=function(){return o&&!s&&i.complete()};t.subscribe(Q(i,function(c){s==null||s.unsubscribe();var l=0,u=r++;oe(n(c,u)).subscribe(s=Q(i,function(p){return i.next(e?e(c,p,u,l++):p)},function(){s=null,a()}))},function(){o=!0,a()}))})}function z(n){return re(function(e,t){oe(n).subscribe(Q(t,function(){return t.complete()},En)),!t.closed&&e.subscribe(t)})}function gc(n,e,t){var i=E(n)||e||t?{next:n,error:e,complete:t}:n;return i?re(function(s,r){var o;(o=i.subscribe)===null||o===void 0||o.call(i);var a=!0;s.subscribe(Q(r,function(c){var l;(l=i.next)===null||l===void 0||l.call(i,c),r.next(c)},function(){var c;a=!1,(c=i.complete)===null||c===void 0||c.call(i),r.complete()},function(c){var l;a=!1,(l=i.error)===null||l===void 0||l.call(i,c),r.error(c)},function(){var c,l;a&&((c=i.unsubscribe)===null||c===void 0||c.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):Ct}function Mi(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Ro(n);return re(function(i,s){for(var r=n.length,o=new Array(r),a=n.map(function(){return!1}),c=!1,l=function(p){oe(n[p]).subscribe(Q(s,function(d){o[p]=d,!c&&!a[p]&&(a[p]=!0,(c=a.every(Ct))&&(a=null))},En))},u=0;u<r;u++)l(u);i.subscribe(Q(s,function(p){if(c){var d=Xe([p],ze(o));s.next(t?t.apply(void 0,Xe([],ze(d))):d)}}))})}class rs{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new rs,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var q=(n=>(n.User="user",n.Agent="agent",n.System="system",n))(q||{});const mc=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),Wo=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():mc();function Tr(n){let e=n;const t=/https?:\/\/[^\s<]+/gi,i=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,s=n.match(t)||[],r=[];let o;for(;(o=i.exec(n))!==null;)r.push(o[1]);return s.filter(c=>!r.includes(c)).forEach(c=>{const l=c.endsWith(".")?c.slice(0,-1):c,u=new RegExp(`(?<!<a[^>]*>)${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![^<]*</a>)`,"gi");e=e.replace(u,`<a title='${l}' target='_blank' href='${l}'>${l}</a>`)}),e}function Ni(n){if(n.includes("aceChatGuideTitle"))return vc(n);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return n.replace(e,t=>{const i=Go(t);if(!i)return t;const s=50;if(i.length>s){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=i.match(r);if(!o)return t;const a=o[1],l=(o[2]||"/").split("?")[0],u=l.split("/").pop(),p=s-a.length;let d=l;u&&u.length<p&&l.length>p?d=l.substring(0,p-u.length-4)+".../"+u:d=l.substring(0,p-3)+"...";const g=`${a}${d}`;return Ui(t,g)}return Ui(t,i)})}function Go(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 Ui(n,e){return n.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function vc(n){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return n.replace(e,t=>{const i=Go(t);if(!i)return t;const s=i.split("?").pop(),o=new URLSearchParams(s).get("aceChatGuideTitle");return o?Ui(t,o):t})}class ie{constructor(e,t,i){this.type=e,this.sender=t,this.messages=i,this.status="delivered",this.didUpdate=new P,this.actions$=new P,this.remove$=new P,this.timestamp=Date.now(),this.id=Wo()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class bc{constructor(e){this.name=e,this.print$=new P}print(e,t="html",i=this.name){const s=new ie(q.Agent,{name:i},[{items:[[t,{content:e}]]}]);return this.print$.next(s),s}subscribe(){return this.print$.asObservable()}}class yc{constructor(e){this.name=e,this.print$=new P}print(e){const t=new ie(q.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class $c{constructor(){this.print$=new P,this.name="system"}print(e){const t=new ie(q.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class wc{constructor(e,t){this.name=e,this.component=t,this.print$=new P,this.typingState$=new he(!1),this.complete$=new P,this.system=this.createSystem(),this.rehydrate$=new P,this.saveToCurrentSession$=new P,this.showChatOverlay$=new he(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(me(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(q.User,e.text)}print(e,t){const i=new ie(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(i)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new bc(e);return t.subscribe().subscribe(i=>{this.playNotification(),this.printEntry(i)}),t}createUser(e){const t=new yc(e);return t.subscribe().subscribe(i=>{this.printEntry(i)}),t}createSystem(){const e=new $c;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=!document.hidden&&this.component.application.storage.get("open"),t="https://publicpoc.blob.core.windows.net/widget-assets/notification.mp3";!this.component.application.storage.get("muteAudioNotifications")&&!e&&new Audio(t).play().catch(s=>{})}complete(){this.complete$.next()}save(e){this.saveToCurrentSession$.next(e)}async rehydrate(e){}}/**
3
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Cn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var tn=(function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,i,s,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=yt(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch($){e={error:$}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(E(u))try{u()}catch($){r=$ instanceof gi?$.errors:[$]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=yt(p),g=d.next();!g.done;g=d.next()){var m=g.value;try{xr(m)}catch($){r=r??[],$ instanceof gi?r=Xe(Xe([],He(r)),He($.errors)):r.push($)}}}catch($){i={error:$}}finally{try{g&&!g.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}}if(r)throw new gi(r)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)xr(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)&&Cn(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&Cn(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=(function(){var e=new n;return e.closed=!0,e})(),n})(),To=tn.EMPTY;function Oo(n){return n instanceof tn||n&&"closed"in n&&E(n.remove)&&E(n.add)&&E(n.unsubscribe)}function xr(n){E(n)?n():n.unsubscribe()}var bl={Promise:void 0},yl={setTimeout:function(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Xe([n,e],He(t)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Ro(n){yl.setTimeout(function(){throw n})}function En(){}function wn(n){n()}var es=(function(n){Ie(e,n);function e(t){var i=n.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Oo(t)&&t.add(i)):i.destination=xl,i}return e.create=function(t,i,s){return new Li(t,i,s)},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})(tn),$l=(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(i){mn(i)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){mn(i)}else mn(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){mn(t)}},n})(),Li=(function(n){Ie(e,n);function e(t,i,s){var r=n.call(this)||this,o;return E(t)||!t?o={next:t??void 0,error:i??void 0,complete:s??void 0}:o=t,r.destination=new $l(o),r}return e})(es);function mn(n){Ro(n)}function wl(n){throw n}var xl={closed:!0,next:En,error:wl,complete:En},ts=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ct(n){return n}function kl(n){return n.length===0?Ct:n.length===1?n[0]:function(t){return n.reduce(function(i,s){return s(i)},t)}}var j=(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,i){var s=this,r=Cl(e)?e:new Li(e,t,i);return wn(function(){var o=s,a=o.operator,c=o.source;r.add(a?a.call(r,c):c?s._subscribe(r):s._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 i=this;return t=kr(t),new t(function(s,r){var o=new Li({next:function(a){try{e(a)}catch(c){r(c),o.unsubscribe()}},error:r,complete:s});i.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[ts]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return kl(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=kr(e),new e(function(i,s){var r;t.subscribe(function(o){return r=o},function(o){return s(o)},function(){return i(r)})})},n.create=function(e){return new n(e)},n})();function kr(n){var e;return(e=n??bl.Promise)!==null&&e!==void 0?e:Promise}function Sl(n){return n&&E(n.next)&&E(n.error)&&E(n.complete)}function Cl(n){return n&&n instanceof es||Sl(n)&&Oo(n)}function El(n){return E(n==null?void 0:n.lift)}function re(n){return function(e){if(El(e))return e.lift(function(t){try{return n(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function Q(n,e,t,i,s){return new _l(n,e,t,i,s)}var _l=(function(n){Ie(e,n);function e(t,i,s,r,o,a){var c=n.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=i?function(l){try{i(l)}catch(u){t.error(u)}}:n.prototype._next,c._error=r?function(l){try{r(l)}catch(u){t.error(u)}finally{this.unsubscribe()}}:n.prototype._error,c._complete=s?function(){try{s()}catch(l){t.error(l)}finally{this.unsubscribe()}}:n.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;n.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(es),Al=Ao(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=(function(n){Ie(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 i=new Sr(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new Al},e.prototype.next=function(t){var i=this;wn(function(){var s,r;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=yt(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(l){s={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var i=this;wn(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var s=i.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;wn(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.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 i=this,s=this,r=s.hasError,o=s.isStopped,a=s.observers;return r||o?To:(this.currentObservers=null,a.push(t),new tn(function(){i.currentObservers=null,Cn(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,s=i.hasError,r=i.thrownError,o=i.isStopped;s?t.error(r):o&&t.complete()},e.prototype.asObservable=function(){var t=new j;return t.source=this,t},e.create=function(t,i){return new Sr(t,i)},e})(j),Sr=(function(n){Ie(e,n);function e(t,i){var s=n.call(this)||this;return s.destination=t,s.source=i,s}return e.prototype.next=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,t)},e.prototype.error=function(t){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&s!==void 0?s:To},e})(P),he=(function(n){Ie(e,n);function e(t){var i=n.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=n.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,s=t.thrownError,r=t._value;if(i)throw s;return this._throwIfClosed(),r},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e})(P),Tl={now:function(){return Date.now()}},Ol=(function(n){Ie(e,n);function e(t,i){return n.call(this)||this}return e.prototype.schedule=function(t,i){return this},e})(tn),Cr={setInterval:function(n,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setInterval.apply(void 0,Xe([n,e],He(t)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},Rl=(function(n){Ie(e,n);function e(t,i){var s=n.call(this,t,i)||this;return s.scheduler=t,s.work=i,s.pending=!1,s}return e.prototype.schedule=function(t,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,i),this},e.prototype.requestAsyncId=function(t,i,s){return s===void 0&&(s=0),Cr.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&Cr.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var s=!1,r;try{this.work(t)}catch(o){s=!0,r=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),r},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,s=t.scheduler,r=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Cn(r,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e})(Ol),Er=(function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},n.now=Tl.now,n})(),Ll=(function(n){Ie(e,n);function e(t,i){i===void 0&&(i=Er.now);var s=n.call(this,t,i)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,s){for(;t=i.shift();)t.unsubscribe();throw s}},e})(Er),fp=new Ll(Rl);var tt=new j(function(n){return n.complete()});function Il(n){return n&&E(n.schedule)}function ns(n){return n[n.length-1]}function Lo(n){return E(ns(n))?n.pop():void 0}function is(n){return Il(ns(n))?n.pop():void 0}function Pl(n,e){return typeof ns(n)=="number"?n.pop():e}var ss=(function(n){return n&&typeof n.length=="number"&&typeof n!="function"});function Io(n){return E(n==null?void 0:n.then)}function Po(n){return E(n[ts])}function Mo(n){return Symbol.asyncIterator&&E(n==null?void 0:n[Symbol.asyncIterator])}function No(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 Ml(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Uo=Ml();function Do(n){return E(n==null?void 0:n[Uo])}function Ho(n){return ml(this,arguments,function(){var t,i,s,r;return _o(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,gt(t.read())];case 3:return i=o.sent(),s=i.value,r=i.done,r?[4,gt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,gt(s)];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 zo(n){return E(n==null?void 0:n.getReader)}function oe(n){if(n instanceof j)return n;if(n!=null){if(Po(n))return Nl(n);if(ss(n))return Ul(n);if(Io(n))return Dl(n);if(Mo(n))return jo(n);if(Do(n))return Hl(n);if(zo(n))return zl(n)}throw No(n)}function Nl(n){return new j(function(e){var t=n[ts]();if(E(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ul(n){return new j(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function Dl(n){return new j(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Ro)})}function Hl(n){return new j(function(e){var t,i;try{for(var s=yt(n),r=s.next();!r.done;r=s.next()){var o=r.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}e.complete()})}function jo(n){return new j(function(e){jl(n,e).catch(function(t){return e.error(t)})})}function zl(n){return jo(Ho(n))}function jl(n,e){var t,i,s,r;return gl(this,void 0,void 0,function(){var o,a;return _o(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=vl(n),c.label=1;case 1:return[4,t.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(o=i.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),s={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(r=t.return)?[4,r.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Ue(n,e,t,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var r=e.schedule(function(){t(),s?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(r),!s)return r}function Fo(n,e){return e===void 0&&(e=0),re(function(t,i){t.subscribe(Q(i,function(s){return Ue(i,n,function(){return i.next(s)},e)},function(){return Ue(i,n,function(){return i.complete()},e)},function(s){return Ue(i,n,function(){return i.error(s)},e)}))})}function Bo(n,e){return e===void 0&&(e=0),re(function(t,i){i.add(n.schedule(function(){return t.subscribe(i)},e))})}function Fl(n,e){return oe(n).pipe(Bo(e),Fo(e))}function Bl(n,e){return oe(n).pipe(Bo(e),Fo(e))}function ql(n,e){return new j(function(t){var i=0;return e.schedule(function(){i===n.length?t.complete():(t.next(n[i++]),t.closed||this.schedule())})})}function Vl(n,e){return new j(function(t){var i;return Ue(t,e,function(){i=n[Uo](),Ue(t,e,function(){var s,r,o;try{s=i.next(),r=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(r)},0,!0)}),function(){return E(i==null?void 0:i.return)&&i.return()}})}function qo(n,e){if(!n)throw new Error("Iterable cannot be null");return new j(function(t){Ue(t,e,function(){var i=n[Symbol.asyncIterator]();Ue(t,e,function(){i.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Wl(n,e){return qo(Ho(n),e)}function Gl(n,e){if(n!=null){if(Po(n))return Fl(n,e);if(ss(n))return ql(n,e);if(Io(n))return Bl(n,e);if(Mo(n))return qo(n,e);if(Do(n))return Vl(n,e);if(zo(n))return Wl(n,e)}throw No(n)}function Ye(n,e){return e?Gl(n,e):oe(n)}function Ii(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=is(n);return Ye(n,t)}function _n(n,e){return re(function(t,i){var s=0;t.subscribe(Q(i,function(r){i.next(n.call(e,r,s++))}))})}var Zl=Array.isArray;function Yl(n,e){return Zl(e)?n.apply(void 0,Xe([],He(e))):n(e)}function Vo(n){return _n(function(e){return Yl(n,e)})}var Ql=Array.isArray,Xl=Object.getPrototypeOf,Kl=Object.prototype,Jl=Object.keys;function ec(n){if(n.length===1){var e=n[0];if(Ql(e))return{args:e,keys:null};if(tc(e)){var t=Jl(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:n,keys:null}}function tc(n){return n&&typeof n=="object"&&Xl(n)===Kl}function nc(n,e){return n.reduce(function(t,i,s){return t[i]=e[s],t},{})}function ic(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=is(n),i=Lo(n),s=ec(n),r=s.args,o=s.keys;if(r.length===0)return Ye([],t);var a=new j(sc(r,t,o?function(c){return nc(o,c)}:Ct));return i?a.pipe(Vo(i)):a}function sc(n,e,t){return t===void 0&&(t=Ct),function(i){_r(e,function(){for(var s=n.length,r=new Array(s),o=s,a=s,c=function(u){_r(e,function(){var p=Ye(n[u],e),d=!1;p.subscribe(Q(i,function(g){r[u]=g,d||(d=!0,a--),a||i.next(t(r.slice()))},function(){--o||i.complete()}))},i)},l=0;l<s;l++)c(l)},i)}}function _r(n,e,t){n?Ue(t,n,e):e()}function rc(n,e,t,i,s,r,o,a){var c=[],l=0,u=0,p=!1,d=function(){p&&!c.length&&!l&&e.complete()},g=function($){return l<i?m($):c.push($)},m=function($){l++;var $e=!1;oe(t($,u++)).subscribe(Q(e,function(le){e.next(le)},function(){$e=!0},void 0,function(){if($e)try{l--;for(var le=function(){var Pe=c.shift();o||m(Pe)};c.length&&l<i;)le();d()}catch(Pe){e.error(Pe)}}))};return n.subscribe(Q(e,g,function(){p=!0,d()})),function(){}}function qt(n,e,t){return t===void 0&&(t=1/0),E(e)?qt(function(i,s){return _n(function(r,o){return e(i,r,s,o)})(oe(n(i,s)))},t):(typeof e=="number"&&(t=e),re(function(i,s){return rc(i,s,n,t)}))}function oc(n){return n===void 0&&(n=1/0),qt(Ct,n)}function ac(n){return new j(function(e){oe(n()).subscribe(e)})}var lc=["addListener","removeListener"],cc=["addEventListener","removeEventListener"],uc=["on","off"];function An(n,e,t,i){if(E(t)&&(i=t,t=void 0),i)return An(n,e,t).pipe(Vo(i));var s=He(pc(n)?cc.map(function(a){return function(c){return n[a](e,c,t)}}):hc(n)?lc.map(Ar(n,e)):dc(n)?uc.map(Ar(n,e)):[],2),r=s[0],o=s[1];if(!r&&ss(n))return qt(function(a){return An(a,e,t)})(oe(n));if(!r)throw new TypeError("Invalid event target");return new j(function(a){var c=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return a.next(1<l.length?l:l[0])};return r(c),function(){return o(c)}})}function Ar(n,e){return function(t){return function(i){return n[t](e,i)}}}function hc(n){return E(n.addListener)&&E(n.removeListener)}function dc(n){return E(n.on)&&E(n.off)}function pc(n){return E(n.addEventListener)&&E(n.removeEventListener)}function fc(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=is(n),i=Pl(n,1/0),s=n;return s.length?s.length===1?oe(s[0]):oc(i)(Ye(s,t)):tt}function W(n,e){return re(function(t,i){var s=0;t.subscribe(Q(i,function(r){return n.call(e,r,s++)&&i.next(r)}))})}function Pi(n){return re(function(e,t){var i=null,s=!1,r;i=e.subscribe(Q(t,void 0,void 0,function(o){r=oe(n(o,Pi(n)(e))),i?(i.unsubscribe(),i=null,r.subscribe(t)):s=!0})),s&&(i.unsubscribe(),i=null,r.subscribe(t))})}function mi(n,e){return E(e)?qt(n,e,1):qt(n,1)}function me(n){return n<=0?function(){return tt}:re(function(e,t){var i=0;e.subscribe(Q(t,function(s){++i<=n&&(t.next(s),n<=i&&t.complete())}))})}function vi(n){var e=1/0,t;return e<=0?function(){return tt}:re(function(i,s){var r=0,o,a=function(){o==null||o.unsubscribe(),o=null;var l,u;t!=null||c()},c=function(){var l=!1;o=i.subscribe(Q(s,void 0,function(){++r<e?o?a():l=!0:s.complete()})),l&&a()};c()})}function Oe(n,e){return re(function(t,i){var s=null,r=0,o=!1,a=function(){return o&&!s&&i.complete()};t.subscribe(Q(i,function(c){s==null||s.unsubscribe();var l=0,u=r++;oe(n(c,u)).subscribe(s=Q(i,function(p){return i.next(e?e(c,p,u,l++):p)},function(){s=null,a()}))},function(){o=!0,a()}))})}function H(n){return re(function(e,t){oe(n).subscribe(Q(t,function(){return t.complete()},En)),!t.closed&&e.subscribe(t)})}function gc(n,e,t){var i=E(n)||e||t?{next:n,error:e,complete:t}:n;return i?re(function(s,r){var o;(o=i.subscribe)===null||o===void 0||o.call(i);var a=!0;s.subscribe(Q(r,function(c){var l;(l=i.next)===null||l===void 0||l.call(i,c),r.next(c)},function(){var c;a=!1,(c=i.complete)===null||c===void 0||c.call(i),r.complete()},function(c){var l;a=!1,(l=i.error)===null||l===void 0||l.call(i,c),r.error(c)},function(){var c,l;a&&((c=i.unsubscribe)===null||c===void 0||c.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):Ct}function Mi(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Lo(n);return re(function(i,s){for(var r=n.length,o=new Array(r),a=n.map(function(){return!1}),c=!1,l=function(p){oe(n[p]).subscribe(Q(s,function(d){o[p]=d,!c&&!a[p]&&(a[p]=!0,(c=a.every(Ct))&&(a=null))},En))},u=0;u<r;u++)l(u);i.subscribe(Q(s,function(p){if(c){var d=Xe([p],He(o));s.next(t?t.apply(void 0,Xe([],He(d))):d)}}))})}class rs{constructor(){this.registeredProviders=new Map}static async getInstance(e){let t=await e.get("conversation");return t||(t=new rs,await e.register("conversation",t),t)}registerProvider(e,t){this.registeredProviders.set(e,t)}}var q=(n=>(n.User="user",n.Agent="agent",n.System="system",n))(q||{});const mc=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),Wo=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():mc();function Tr(n){let e=n;const t=/https?:\/\/[^\s<]+/gi,i=/<a [^>]*href="([^"]*)"[^>]*>[^<]*<\/a>/g,s=n.match(t)||[],r=[];let o;for(;(o=i.exec(n))!==null;)r.push(o[1]);return s.filter(c=>!r.includes(c)).forEach(c=>{const l=c.endsWith(".")?c.slice(0,-1):c,u=new RegExp(`(?<!<a[^>]*>)${l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![^<]*</a>)`,"gi");e=e.replace(u,`<a title='${l}' target='_blank' href='${l}'>${l}</a>`)}),e}function Ni(n){if(n.includes("aceChatGuideTitle"))return vc(n);const e=/<a [^>]*>https?:\/\/[^<]*<\/a>/gim;return n.replace(e,t=>{const i=Go(t);if(!i)return t;const s=50;if(i.length>s){const r=/^(https?:\/\/[^/]+)(\/.*)?$/i,o=i.match(r);if(!o)return t;const a=o[1],l=(o[2]||"/").split("?")[0],u=l.split("/").pop(),p=s-a.length;let d=l;u&&u.length<p&&l.length>p?d=l.substring(0,p-u.length-4)+".../"+u:d=l.substring(0,p-3)+"...";const g=`${a}${d}`;return Ui(t,g)}return Ui(t,i)})}function Go(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 Ui(n,e){return n.replace(/>[^<]*<\/a>/,`>${e}</a>`)}function vc(n){const e=/<a [^>]*aceChatGuideTitle[^>]*>[^<]*<\/a>/gm;return n.replace(e,t=>{const i=Go(t);if(!i)return t;const s=i.split("?").pop(),o=new URLSearchParams(s).get("aceChatGuideTitle");return o?Ui(t,o):t})}class ie{constructor(e,t,i){this.type=e,this.sender=t,this.messages=i,this.status="delivered",this.didUpdate=new P,this.actions$=new P,this.remove$=new P,this.timestamp=Date.now(),this.id=Wo()}update(e){this.messages=[{items:e}],this.didUpdate.next(this)}setStatus(e){this.status=e,this.didUpdate.next(this)}remove(){this.remove$.next()}}class bc{constructor(e){this.name=e,this.print$=new P}print(e,t="html",i=this.name){const s=new ie(q.Agent,{name:i},[{items:[[t,{content:e}]]}]);return this.print$.next(s),s}subscribe(){return this.print$.asObservable()}}class yc{constructor(e){this.name=e,this.print$=new P}print(e){const t=new ie(q.User,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class $c{constructor(){this.print$=new P,this.name="system"}print(e){const t=new ie(q.System,{name:this.name},[{items:[["html",{content:e}]]}]);return this.print$.next(t),t}subscribe(){return this.print$.asObservable()}}class wc{constructor(e,t){this.name=e,this.component=t,this.print$=new P,this.typingState$=new he(!1),this.complete$=new P,this.system=this.createSystem(),this.rehydrate$=new P,this.saveToCurrentSession$=new P,this.showChatOverlay$=new he(!1),this.onComplete=()=>this.complete$.asObservable()}connect(e={}){this.complete$.pipe(me(1)).subscribe(()=>{this.disconnected()})}disconnected(){}onUserSubmit(e){this.print(q.User,e.text)}print(e,t){const i=new ie(e,{name:""},[{items:[["html",{content:t}]]}]);return this.printEntry(i)}printEntry(e){return this.print$.next(e),e}createAgent(e){const t=new bc(e);return t.subscribe().subscribe(i=>{this.playNotification(),this.printEntry(i)}),t}createUser(e){const t=new yc(e);return t.subscribe().subscribe(i=>{this.printEntry(i)}),t}createSystem(){const e=new $c;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=!document.hidden&&this.component.application.storage.get("open"),t="https://publicpoc.blob.core.windows.net/widget-assets/notification.mp3";!this.component.application.storage.get("muteAudioNotifications")&&!e&&new Audio(t).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 xn=globalThis,os=xn.ShadowRoot&&(xn.ShadyCSS===void 0||xn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,as=Symbol(),Or=new WeakMap;let Zo=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==as)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(os&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Or.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Or.set(t,e))}return e}toString(){return this.cssText}};const xc=n=>new Zo(typeof n=="string"?n:n+"",void 0,as),L=(n,...e)=>{const t=n.length===1?n[0]:e.reduce(((i,s,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[r+1]),n[0]);return new Zo(t,n,as)},kc=(n,e)=>{if(os)n.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),s=xn.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},Lr=os?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return xc(t)})(n):n;/**
7
+ */const xn=globalThis,os=xn.ShadowRoot&&(xn.ShadyCSS===void 0||xn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,as=Symbol(),Or=new WeakMap;let Zo=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==as)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(os&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Or.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Or.set(t,e))}return e}toString(){return this.cssText}};const xc=n=>new Zo(typeof n=="string"?n:n+"",void 0,as),R=(n,...e)=>{const t=n.length===1?n[0]:e.reduce(((i,s,r)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[r+1]),n[0]);return new Zo(t,n,as)},kc=(n,e)=>{if(os)n.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const i=document.createElement("style"),s=xn.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},Rr=os?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return xc(t)})(n):n;/**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */const{is:Sc,defineProperty:Cc,getOwnPropertyDescriptor:Ec,getOwnPropertyNames:_c,getOwnPropertySymbols:Ac,getPrototypeOf:Tc}=Object,De=globalThis,Rr=De.trustedTypes,Oc=Rr?Rr.emptyScript:"",bi=De.reactiveElementPolyfillSupport,zt=(n,e)=>n,Tn={toAttribute(n,e){switch(e){case Boolean:n=n?Oc: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}},ls=(n,e)=>!Sc(n,e),Ir={attribute:!0,type:String,converter:Tn,reflect:!1,useDefault:!1,hasChanged:ls};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),De.litPropertyMetadata??(De.litPropertyMetadata=new WeakMap);let ht=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=Ir){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Cc(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:r}=Ec(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const a=s==null?void 0:s.call(this);r==null||r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ir}static _$Ei(){if(this.hasOwnProperty(zt("elementProperties")))return;const e=Tc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(zt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zt("properties"))){const t=this.properties,i=[..._c(t),...Ac(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Lr(s))}else e!==void 0&&t.push(Lr(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return kc(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 i;return(i=t.hostConnected)==null?void 0:i.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var r;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:Tn).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:Tn;this._$Em=s;const l=c.fromAttribute(t,a.type);this[s]=l??((o=this._$Ej)==null?void 0:o.get(s))??l,this._$Em=null}}requestUpdate(e,t,i){var s;if(e!==void 0){const r=this.constructor,o=this[e];if(i??(i=r.getPropertyOptions(e)),!((i.hasChanged??ls)(o,t)||i.useDefault&&i.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){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 i;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 s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s){const{wrapped:a}=o,c=this[r];a!==!0||this._$AL.has(r)||c===void 0||this.C(r,void 0,o,c)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach((s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)})),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};ht.elementStyles=[],ht.shadowRootOptions={mode:"open"},ht[zt("elementProperties")]=new Map,ht[zt("finalized")]=new Map,bi==null||bi({ReactiveElement:ht}),(De.reactiveElementVersions??(De.reactiveElementVersions=[])).push("2.1.1");/**
11
+ */const{is:Sc,defineProperty:Cc,getOwnPropertyDescriptor:Ec,getOwnPropertyNames:_c,getOwnPropertySymbols:Ac,getPrototypeOf:Tc}=Object,De=globalThis,Lr=De.trustedTypes,Oc=Lr?Lr.emptyScript:"",bi=De.reactiveElementPolyfillSupport,Ht=(n,e)=>n,Tn={toAttribute(n,e){switch(e){case Boolean:n=n?Oc: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}},ls=(n,e)=>!Sc(n,e),Ir={attribute:!0,type:String,converter:Tn,reflect:!1,useDefault:!1,hasChanged:ls};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),De.litPropertyMetadata??(De.litPropertyMetadata=new WeakMap);let ht=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=Ir){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&Cc(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:r}=Ec(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get:s,set(o){const a=s==null?void 0:s.call(this);r==null||r.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ir}static _$Ei(){if(this.hasOwnProperty(Ht("elementProperties")))return;const e=Tc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ht("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ht("properties"))){const t=this.properties,i=[..._c(t),...Ac(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Rr(s))}else e!==void 0&&t.push(Rr(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i: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 i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return kc(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 i;return(i=t.hostConnected)==null?void 0:i.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)}))}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var r;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:Tn).toAttribute(t,i.type);this._$Em=e,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(e,t){var r,o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((r=a.converter)==null?void 0:r.fromAttribute)!==void 0?a.converter:Tn;this._$Em=s;const l=c.fromAttribute(t,a.type);this[s]=l??((o=this._$Ej)==null?void 0:o.get(s))??l,this._$Em=null}}requestUpdate(e,t,i){var s;if(e!==void 0){const r=this.constructor,o=this[e];if(i??(i=r.getPropertyOptions(e)),!((i.hasChanged??ls)(o,t)||i.useDefault&&i.reflect&&o===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(r._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:r},o){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??t??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){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 i;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 s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s){const{wrapped:a}=o,c=this[r];a!==!0||this._$AL.has(r)||c===void 0||this.C(r,void 0,o,c)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach((s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)})),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(e){}firstUpdated(e){}};ht.elementStyles=[],ht.shadowRootOptions={mode:"open"},ht[Ht("elementProperties")]=new Map,ht[Ht("finalized")]=new Map,bi==null||bi({ReactiveElement:ht}),(De.reactiveElementVersions??(De.reactiveElementVersions=[])).push("2.1.1");/**
12
12
  * @license
13
13
  * Copyright 2017 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
- */const Ht=globalThis,On=Ht.trustedTypes,Pr=On?On.createPolicy("lit-html",{createHTML:n=>n}):void 0,Yo="$lit$",Me=`lit$${Math.random().toFixed(9).slice(2)}$`,Qo="?"+Me,Lc=`<${Qo}>`,Ke=document,Vt=()=>Ke.createComment(""),Wt=n=>n===null||typeof n!="object"&&typeof n!="function",cs=Array.isArray,Rc=n=>cs(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",yi=`[
16
- \f\r]`,Lt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mr=/-->/g,Nr=/>/g,Ve=RegExp(`>|${yi}(?:([^\\s"'>=/]+)(${yi}*=${yi}*(?:[^
17
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ur=/'/g,Dr=/"/g,Xo=/^(?:script|style|textarea|title)$/i,Ic=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),y=Ic(1),Le=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),zr=new WeakMap,Ge=Ke.createTreeWalker(Ke,129);function Ko(n,e){if(!cs(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Pr!==void 0?Pr.createHTML(e):e}const Pc=(n,e)=>{const t=n.length-1,i=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=Lt;for(let a=0;a<t;a++){const c=n[a];let l,u,p=-1,d=0;for(;d<c.length&&(o.lastIndex=d,u=o.exec(c),u!==null);)d=o.lastIndex,o===Lt?u[1]==="!--"?o=Mr:u[1]!==void 0?o=Nr:u[2]!==void 0?(Xo.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=Ve):u[3]!==void 0&&(o=Ve):o===Ve?u[0]===">"?(o=s??Lt,p=-1):u[1]===void 0?p=-2:(p=o.lastIndex-u[2].length,l=u[1],o=u[3]===void 0?Ve:u[3]==='"'?Dr:Ur):o===Dr||o===Ur?o=Ve:o===Mr||o===Nr?o=Lt:(o=Ve,s=void 0);const g=o===Ve&&n[a+1].startsWith("/>")?" ":"";r+=o===Lt?c+Lc:p>=0?(i.push(l),c.slice(0,p)+Yo+c.slice(p)+Me+g):c+Me+(p===-2?a:g)}return[Ko(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let Di=class Jo{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0;const a=e.length-1,c=this.parts,[l,u]=Pc(e,t);if(this.el=Jo.createElement(l,i),Ge.currentNode=this.el.content,t===2||t===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=Ge.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(Yo)){const d=u[o++],g=s.getAttribute(p).split(Me),m=/([.?@])?(.*)/.exec(d);c.push({type:1,index:r,name:m[2],strings:g,ctor:m[1]==="."?Nc:m[1]==="?"?Uc:m[1]==="@"?Dc:Zn}),s.removeAttribute(p)}else p.startsWith(Me)&&(c.push({type:6,index:r}),s.removeAttribute(p));if(Xo.test(s.tagName)){const p=s.textContent.split(Me),d=p.length-1;if(d>0){s.textContent=On?On.emptyScript:"";for(let g=0;g<d;g++)s.append(p[g],Vt()),Ge.nextNode(),c.push({type:2,index:++r});s.append(p[d],Vt())}}}else if(s.nodeType===8)if(s.data===Qo)c.push({type:2,index:r});else{let p=-1;for(;(p=s.data.indexOf(Me,p+1))!==-1;)c.push({type:7,index:r}),p+=Me.length-1}r++}}static createElement(e,t){const i=Ke.createElement("template");return i.innerHTML=e,i}};function $t(n,e,t=n,i){var o,a;if(e===Le)return e;let s=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const r=Wt(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=s:t._$Cl=s),s!==void 0&&(e=$t(n,s._$AS(n,e.values),s,i)),e}class Mc{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:i}=this._$AD,s=((e==null?void 0:e.creationScope)??Ke).importNode(t,!0);Ge.currentNode=s;let r=Ge.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new nn(r,r.nextSibling,this,e):c.type===1?l=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(l=new zc(r,this,e)),this._$AV.push(l),c=i[++a]}o!==(c==null?void 0:c.index)&&(r=Ge.nextNode(),o++)}return Ge.currentNode=Ke,s}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class nn{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.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=$t(this,e,t),Wt(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==Le&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Rc(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Wt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ke.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Di.createElement(Ko(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(t);else{const o=new Mc(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=zr.get(e.strings);return t===void 0&&zr.set(e.strings,t=new Di(e)),t}k(e){cs(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const r of e)s===t.length?t.push(i=new nn(this.O(Vt()),this.O(Vt()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Zn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}_$AI(e,t=this,i,s){const r=this.strings;let o=!1;if(r===void 0)e=$t(this,e,t,0),o=!Wt(e)||e!==this._$AH&&e!==Le,o&&(this._$AH=e);else{const a=e;let c,l;for(e=r[0],c=0;c<r.length-1;c++)l=$t(this,a[i+c],t,c),l===Le&&(l=this._$AH[c]),o||(o=!Wt(l)||l!==this._$AH[c]),l===w?e=w:e!==w&&(e+=(l??"")+r[c+1]),this._$AH[c]=l}o&&!s&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Nc=class extends Zn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}};class Uc extends Zn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}}class Dc extends Zn{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=$t(this,e,t,0)??w)===Le)return;const i=this._$AH,s=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==w&&(i===w||s);s&&this.element.removeEventListener(this.name,this,i),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 zc{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){$t(this,e)}}const $i=Ht.litHtmlPolyfillSupport;$i==null||$i(Di,nn),(Ht.litHtmlVersions??(Ht.litHtmlVersions=[])).push("3.3.1");const Hc=(n,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new nn(e.insertBefore(Vt(),r),r,void 0,t??{})}return s._$AI(n),s};/**
15
+ */const zt=globalThis,On=zt.trustedTypes,Pr=On?On.createPolicy("lit-html",{createHTML:n=>n}):void 0,Yo="$lit$",Me=`lit$${Math.random().toFixed(9).slice(2)}$`,Qo="?"+Me,Rc=`<${Qo}>`,Ke=document,Vt=()=>Ke.createComment(""),Wt=n=>n===null||typeof n!="object"&&typeof n!="function",cs=Array.isArray,Lc=n=>cs(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",yi=`[
16
+ \f\r]`,Rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mr=/-->/g,Nr=/>/g,Ve=RegExp(`>|${yi}(?:([^\\s"'>=/]+)(${yi}*=${yi}*(?:[^
17
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ur=/'/g,Dr=/"/g,Xo=/^(?:script|style|textarea|title)$/i,Ic=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),y=Ic(1),Re=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Hr=new WeakMap,Ge=Ke.createTreeWalker(Ke,129);function Ko(n,e){if(!cs(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Pr!==void 0?Pr.createHTML(e):e}const Pc=(n,e)=>{const t=n.length-1,i=[];let s,r=e===2?"<svg>":e===3?"<math>":"",o=Rt;for(let a=0;a<t;a++){const c=n[a];let l,u,p=-1,d=0;for(;d<c.length&&(o.lastIndex=d,u=o.exec(c),u!==null);)d=o.lastIndex,o===Rt?u[1]==="!--"?o=Mr:u[1]!==void 0?o=Nr:u[2]!==void 0?(Xo.test(u[2])&&(s=RegExp("</"+u[2],"g")),o=Ve):u[3]!==void 0&&(o=Ve):o===Ve?u[0]===">"?(o=s??Rt,p=-1):u[1]===void 0?p=-2:(p=o.lastIndex-u[2].length,l=u[1],o=u[3]===void 0?Ve:u[3]==='"'?Dr:Ur):o===Dr||o===Ur?o=Ve:o===Mr||o===Nr?o=Rt:(o=Ve,s=void 0);const g=o===Ve&&n[a+1].startsWith("/>")?" ":"";r+=o===Rt?c+Rc:p>=0?(i.push(l),c.slice(0,p)+Yo+c.slice(p)+Me+g):c+Me+(p===-2?a:g)}return[Ko(n,r+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let Di=class Jo{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let r=0,o=0;const a=e.length-1,c=this.parts,[l,u]=Pc(e,t);if(this.el=Jo.createElement(l,i),Ge.currentNode=this.el.content,t===2||t===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(s=Ge.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const p of s.getAttributeNames())if(p.endsWith(Yo)){const d=u[o++],g=s.getAttribute(p).split(Me),m=/([.?@])?(.*)/.exec(d);c.push({type:1,index:r,name:m[2],strings:g,ctor:m[1]==="."?Nc:m[1]==="?"?Uc:m[1]==="@"?Dc:Zn}),s.removeAttribute(p)}else p.startsWith(Me)&&(c.push({type:6,index:r}),s.removeAttribute(p));if(Xo.test(s.tagName)){const p=s.textContent.split(Me),d=p.length-1;if(d>0){s.textContent=On?On.emptyScript:"";for(let g=0;g<d;g++)s.append(p[g],Vt()),Ge.nextNode(),c.push({type:2,index:++r});s.append(p[d],Vt())}}}else if(s.nodeType===8)if(s.data===Qo)c.push({type:2,index:r});else{let p=-1;for(;(p=s.data.indexOf(Me,p+1))!==-1;)c.push({type:7,index:r}),p+=Me.length-1}r++}}static createElement(e,t){const i=Ke.createElement("template");return i.innerHTML=e,i}};function $t(n,e,t=n,i){var o,a;if(e===Re)return e;let s=i!==void 0?(o=t._$Co)==null?void 0:o[i]:t._$Cl;const r=Wt(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=s:t._$Cl=s),s!==void 0&&(e=$t(n,s._$AS(n,e.values),s,i)),e}class Mc{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:i}=this._$AD,s=((e==null?void 0:e.creationScope)??Ke).importNode(t,!0);Ge.currentNode=s;let r=Ge.nextNode(),o=0,a=0,c=i[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new nn(r,r.nextSibling,this,e):c.type===1?l=new c.ctor(r,c.name,c.strings,this,e):c.type===6&&(l=new Hc(r,this,e)),this._$AV.push(l),c=i[++a]}o!==(c==null?void 0:c.index)&&(r=Ge.nextNode(),o++)}return Ge.currentNode=Ke,s}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class nn{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.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=$t(this,e,t),Wt(e)?e===w||e==null||e===""?(this._$AH!==w&&this._$AR(),this._$AH=w):e!==this._$AH&&e!==Re&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Lc(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==w&&Wt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ke.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Di.createElement(Ko(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(t);else{const o=new Mc(s,this),a=o.u(this.options);o.p(t),this.T(a),this._$AH=o}}_$AC(e){let t=Hr.get(e.strings);return t===void 0&&Hr.set(e.strings,t=new Di(e)),t}k(e){cs(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const r of e)s===t.length?t.push(i=new nn(this.O(Vt()),this.O(Vt()),this,this.options)):i=t[s],i._$AI(r),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class Zn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,r){this.type=1,this._$AH=w,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=w}_$AI(e,t=this,i,s){const r=this.strings;let o=!1;if(r===void 0)e=$t(this,e,t,0),o=!Wt(e)||e!==this._$AH&&e!==Re,o&&(this._$AH=e);else{const a=e;let c,l;for(e=r[0],c=0;c<r.length-1;c++)l=$t(this,a[i+c],t,c),l===Re&&(l=this._$AH[c]),o||(o=!Wt(l)||l!==this._$AH[c]),l===w?e=w:e!==w&&(e+=(l??"")+r[c+1]),this._$AH[c]=l}o&&!s&&this.j(e)}j(e){e===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Nc=class extends Zn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===w?void 0:e}};class Uc extends Zn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==w)}}class Dc extends Zn{constructor(e,t,i,s,r){super(e,t,i,s,r),this.type=5}_$AI(e,t=this){if((e=$t(this,e,t,0)??w)===Re)return;const i=this._$AH,s=e===w&&i!==w||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==w&&(i===w||s);s&&this.element.removeEventListener(this.name,this,i),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 Hc{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){$t(this,e)}}const $i=zt.litHtmlPolyfillSupport;$i==null||$i(Di,nn),(zt.litHtmlVersions??(zt.litHtmlVersions=[])).push("3.3.1");const zc=(n,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new nn(e.insertBefore(Vt(),r),r,void 0,t??{})}return s._$AI(n),s};/**
18
18
  * @license
19
19
  * Copyright 2017 Google LLC
20
20
  * SPDX-License-Identifier: BSD-3-Clause
21
- */const Qe=globalThis;let A=class extends ht{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=Hc(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 Le}};var Eo;A._$litElement$=!0,A.finalized=!0,(Eo=Qe.litElementHydrateSupport)==null||Eo.call(Qe,{LitElement:A});const wi=Qe.litElementPolyfillSupport;wi==null||wi({LitElement:A});(Qe.litElementVersions??(Qe.litElementVersions=[])).push("4.2.1");const jc={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>'},ea={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M52 7H24C19.5838 7.00505 16.0051 10.5838 16 15V23H12C7.58382 23.0051 4.00505 26.5838 4 31V43C4.00505 47.4162 7.58382 50.9949 12 51H19.1699L24.8789 56.7075C25.737 57.5654 27.0273 57.8219 28.1482 57.3575C29.2692 56.8931 30 55.7993 30 54.5859V51H39.999C44.4152 50.995 47.994 47.4162 47.999 43V35H52C56.4162 34.9949 59.9949 31.4162 60 27V15C59.9949 10.5838 56.4162 7.00505 52 7ZM43.999 43C43.9967 45.2082 42.2072 46.9977 39.999 47H26V52.1724L20.8262 47H12C9.79184 46.9976 8.00235 45.2082 8 43V31C8.00235 28.7918 9.79184 27.0024 12 27H16C16.0051 31.4162 19.5838 34.9949 24 35H30V38.5859C29.999 39.7998 30.7298 40.8945 31.8512 41.359C32.9726 41.8236 34.2634 41.5664 35.1211 40.7075L40.8291 35H43.999V43ZM56 27C55.9977 29.2082 54.2082 30.9976 52 31H39.1729L34 36.1719V31H24C21.7918 30.9976 20.0024 29.2082 20 27V15C20.0024 12.7918 21.7918 11.0024 24 11H52C54.2082 11.0024 55.9977 12.7918 56 15V27Z"/></svg>'},Fc={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>'},ta={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>'},Bc={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>'},na={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>'},qc={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>'},ia={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>'},Vc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.2618 43.8838L38.8585 11.5469C37.4136 9.13651 34.8097 7.66134 31.9994 7.66113C29.1891 7.66093 26.585 9.13572 25.1397 11.5459L5.73642 43.8838C4.25367 46.3552 4.21482 49.4331 5.6347 51.9411C7.05459 54.4492 9.71372 55.9997 12.5958 56H51.4024C54.2845 55.9997 56.9436 54.4492 58.3635 51.9411C59.7834 49.4331 59.7446 46.3552 58.2618 43.8838ZM29.9991 36.9772V25.1569C29.9983 24.6198 30.1056 24.0879 30.3148 23.5932C30.486 23.1496 30.753 22.7494 31.0968 22.4209C31.339 22.1704 31.6666 22.0202 32.0145 22C32.5161 22 33.0173 22.3805 33.5182 23.1416C33.7901 23.4771 33.9573 23.8852 33.9991 24.3151V36.1354C33.9991 36.5759 33.6932 36.9969 33.0814 37.3982C32.4994 37.7897 31.814 37.9988 31.1126 37.999C30.3712 37.999 30 37.6584 29.9991 36.9772ZM34.2408 43.9236C34.173 43.4297 33.9757 42.9626 33.669 42.5696C33.1076 41.7469 32.566 41.3355 32.0444 41.3355C31.6396 41.354 31.2573 41.5266 30.9757 41.8179C30.593 42.1852 30.2954 42.6319 30.1039 43.1266C29.874 43.6743 29.7562 44.2625 29.7574 44.8565C29.7574 45.6189 30.1786 46 31.0208 46C31.8022 46.0001 32.5662 45.7697 33.2173 45.3377C33.8996 44.8957 34.2408 44.4243 34.2408 43.9236Z"/></svg>'},zi={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>'},Hr={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>'},Wc={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>'},sa={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>'},jr={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>'},Gc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M27.2561 39.1924C27.3201 40.5364 28.0241 41.1764 29.3681 41.1764C32.1201 41.1764 34.8081 39.3844 34.8721 37.5924L35.8961 12.3764C35.8961 10.6484 35.0001 9.81641 33.1441 9.81641C29.6241 9.81641 25.9761 12.1844 25.9761 14.4244L27.2561 39.1924ZM30.9041 55.3847C28.4081 55.3847 26.0401 51.2247 26.0401 49.6247C26.0401 47.3847 29.6881 45.0167 33.2081 45.0167C35.0641 45.0167 36.0241 45.8487 36.0241 47.5767C36.0241 50.2007 34.8081 52.8887 33.2721 54.2967C32.5041 55.0007 31.7361 55.3847 30.9041 55.3847Z"/></svg>'},dt={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 pt,ra,Yn,oa=!1,Ln=!1,us=!1,te=!1,Fr=null,Hi=!1;const Qn=typeof window<"u"?window:{},ye=Qn.document||{head:{}},aa=Qn.HTMLElement||class{},X={$flags$:0,$resourcesUrl$:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,e,t,i)=>n.addEventListener(e,t,i),rel:(n,e,t,i)=>n.removeEventListener(e,t,i),ce:(n,e)=>new CustomEvent(n,e)},Zc=(()=>{let n=!1;try{ye.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch{}return n})(),Yc=n=>Promise.resolve(n),Qc=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),la=(n,e,t,i)=>{t&&t.map(([s,r,o])=>{const a=Kc(n,s),c=Xc(e,o),l=Jc(s);X.ael(a,r,c,l),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>X.rel(a,r,c,l))})},Xc=(n,e)=>t=>{try{dt.lazyLoad||n.$hostElement$[e](t)}catch(i){sn(i)}},Kc=(n,e)=>e&4?ye:e&8?Qn:e&16?ye.body:n,Jc=n=>Zc?{passive:(n&1)!==0,capture:(n&2)!==0}:(n&2)!==0,Br="http://www.w3.org/1999/xlink",Je=(n,e="")=>()=>{},qr=new WeakMap,eu=(n,e,t)=>{let i=Pn.get(n);Qc&&t?(i=i||new CSSStyleSheet,i.replace(e)):i=e,Pn.set(n,i)},tu=(n,e,t,i)=>{let s=ca(e,t),r=Pn.get(s);if(n=n.nodeType===11?n:ye,r)if(typeof r=="string"){n=n.head||n;let o=qr.get(n),a;o||qr.set(n,o=new Set),o.has(s)||(a=ye.createElement("style"),a.innerHTML=r,n.insertBefore(a,n.querySelector("link")),o&&o.add(s))}else n.adoptedStyleSheets.includes(r)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,r]);return s},nu=n=>{const e=n.$cmpMeta$,t=n.$hostElement$,i=e.$flags$,s=Je("attachStyles",e.$tagName$),r=tu(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,n.$modeName$);i&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),i&2&&t.classList.add(r+"-s")),s()},ca=(n,e)=>"sc-"+(e&&n.$flags$&32?n.$tagName$+"-"+e:n.$tagName$),iu=n=>Lu.map(e=>e(n)).find(e=>!!e),Vr={},su="http://www.w3.org/2000/svg",ru="http://www.w3.org/1999/xhtml",ou=n=>n!=null,hs=n=>(n=typeof n,n==="object"||n==="function"),mt=(n,e,...t)=>{let i=null,s=null,r=null,o=!1,a=!1,c=[];const l=p=>{for(let d=0;d<p.length;d++)i=p[d],Array.isArray(i)?l(i):i!=null&&typeof i!="boolean"&&((o=typeof n!="function"&&!hs(i))&&(i=String(i)),o&&a?c[c.length-1].$text$+=i:c.push(o?Rn(null,i):i),a=o)};if(l(t),e){e.key&&(s=e.key),e.name&&(r=e.name);{const p=e.className||e.class;p&&(e.class=typeof p!="object"?p:Object.keys(p).filter(d=>p[d]).join(" "))}}if(typeof n=="function")return n(e===null?{}:e,c,lu);const u=Rn(n,null);return u.$attrs$=e,c.length>0&&(u.$children$=c),u.$key$=s,u.$name$=r,u},Rn=(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},ds={},au=n=>n&&n.$tag$===ds,lu={forEach:(n,e)=>n.map(Wr).forEach(e),map:(n,e)=>n.map(Wr).map(e).map(cu)},Wr=n=>({vattrs:n.$attrs$,vchildren:n.$children$,vkey:n.$key$,vname:n.$name$,vtag:n.$tag$,vtext:n.$text$}),cu=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),mt(n.vtag,t,...n.vchildren||[])}const e=Rn(n.vtag,n.vtext);return e.$attrs$=n.vattrs,e.$children$=n.vchildren,e.$key$=n.vkey,e.$name$=n.vname,e},Gr=(n,e,t,i,s,r)=>{if(t!==i){let o=Xr(n,e),a=e.toLowerCase();if(e==="class"){const c=n.classList,l=Zr(t),u=Zr(i);c.remove(...l.filter(p=>p&&!u.includes(p))),c.add(...u.filter(p=>p&&!l.includes(p)))}else if(e==="style"){for(const c in t)(!i||i[c]==null)&&(c.includes("-")?n.style.removeProperty(c):n.style[c]="");for(const c in i)(!t||i[c]!==t[c])&&(c.includes("-")?n.style.setProperty(c,i[c]):n.style[c]=i[c])}else if(e!=="key")if(e==="ref")i&&i(n);else if(!n.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):Xr(Qn,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&X.rel(n,e,t,!1),i&&X.ael(n,e,i,!1);else{const c=hs(i);if((o||c&&i!==null)&&!s)try{if(n.tagName.includes("-"))n[e]=i;else{let u=i??"";e==="list"?o=!1:(t==null||n[e]!=u)&&(n[e]=u)}}catch{}let l=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,l=!0),i==null||i===!1?(i!==!1||n.getAttribute(e)==="")&&(l?n.removeAttributeNS(Br,e):n.removeAttribute(e)):(!o||r&4||s)&&!c&&(i=i===!0?"":i,l?n.setAttributeNS(Br,e,i):n.setAttribute(e,i))}}},uu=/\s/,Zr=n=>n?n.split(uu):[],ua=(n,e,t,i)=>{const s=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=n&&n.$attrs$||Vr,o=e.$attrs$||Vr;for(i in r)i in o||Gr(s,i,r[i],void 0,t,e.$flags$);for(i in o)Gr(s,i,r[i],o[i],t,e.$flags$)},In=(n,e,t,i)=>{let s=e.$children$[t],r=0,o,a,c;if(oa||(us=!0,s.$tag$==="slot"&&(pt&&i.classList.add(pt+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)o=s.$elm$=ye.createTextNode(s.$text$);else if(s.$flags$&1)o=s.$elm$=ye.createTextNode("");else{if(te||(te=s.$tag$==="svg"),o=s.$elm$=ye.createElementNS(te?su:ru,s.$flags$&2?"slot-fb":s.$tag$),te&&s.$tag$==="foreignObject"&&(te=!1),ua(null,s,te),ou(pt)&&o["s-si"]!==pt&&o.classList.add(o["s-si"]=pt),s.$children$)for(r=0;r<s.$children$.length;++r)a=In(n,s,r,o),a&&o.appendChild(a);s.$tag$==="svg"?te=!1:o.tagName==="foreignObject"&&(te=!0)}return o["s-hn"]=Yn,s.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=ra,o["s-sn"]=s.$name$||"",c=n&&n.$children$&&n.$children$[t],c&&c.$tag$===s.$tag$&&n.$elm$&&Gt(n.$elm$,!1)),o},Gt=(n,e)=>{X.$flags$|=1;const t=n.childNodes;for(let i=t.length-1;i>=0;i--){const s=t[i];s["s-hn"]!==Yn&&s["s-ol"]&&(pa(s).insertBefore(s,ps(s)),s["s-ol"].remove(),s["s-ol"]=void 0,us=!0),e&&Gt(s,e)}X.$flags$&=-2},ha=(n,e,t,i,s,r)=>{let o=n["s-cr"]&&n["s-cr"].parentNode||n,a;for(o.shadowRoot&&o.tagName===Yn&&(o=o.shadowRoot);s<=r;++s)i[s]&&(a=In(null,t,s,n),a&&(i[s].$elm$=a,o.insertBefore(a,ps(e))))},da=(n,e,t,i,s)=>{for(;e<=t;++e)(i=n[e])&&(s=i.$elm$,ma(i),Ln=!0,s["s-ol"]?s["s-ol"].remove():Gt(s,!0),s.remove())},hu=(n,e,t,i)=>{let s=0,r=0,o=0,a=0,c=e.length-1,l=e[0],u=e[c],p=i.length-1,d=i[0],g=i[p],m,$;for(;s<=c&&r<=p;)if(l==null)l=e[++s];else if(u==null)u=e[--c];else if(d==null)d=i[++r];else if(g==null)g=i[--p];else if(vn(l,d))ft(l,d),l=e[++s],d=i[++r];else if(vn(u,g))ft(u,g),u=e[--c],g=i[--p];else if(vn(l,g))(l.$tag$==="slot"||g.$tag$==="slot")&&Gt(l.$elm$.parentNode,!1),ft(l,g),n.insertBefore(l.$elm$,u.$elm$.nextSibling),l=e[++s],g=i[--p];else if(vn(u,d))(l.$tag$==="slot"||g.$tag$==="slot")&&Gt(u.$elm$.parentNode,!1),ft(u,d),n.insertBefore(u.$elm$,l.$elm$),u=e[--c],d=i[++r];else{for(o=-1,a=s;a<=c;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===d.$key$){o=a;break}o>=0?($=e[o],$.$tag$!==d.$tag$?m=In(e&&e[r],t,o,n):(ft($,d),e[o]=void 0,m=$.$elm$),d=i[++r]):(m=In(e&&e[r],t,r,n),d=i[++r]),m&&pa(l.$elm$).insertBefore(m,ps(l.$elm$))}s>c?ha(n,i[p+1]==null?null:i[p+1].$elm$,t,i,r,p):r>p&&da(e,s,c)},vn=(n,e)=>n.$tag$===e.$tag$?n.$tag$==="slot"?n.$name$===e.$name$:n.$key$===e.$key$:!1,ps=n=>n&&n["s-ol"]||n,pa=n=>(n["s-ol"]?n["s-ol"]:n).parentNode,ft=(n,e)=>{const t=e.$elm$=n.$elm$,i=n.$children$,s=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(te=r==="svg"?!0:r==="foreignObject"?!1:te,r==="slot"||ua(n,e,te),i!==null&&s!==null?hu(t,i,e,s):s!==null?(n.$text$!==null&&(t.textContent=""),ha(t,null,e,s,0,s.length-1)):i!==null&&da(i,0,i.length-1),te&&r==="svg"&&(te=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:n.$text$!==o&&(t.data=o)},fa=n=>{let e=n.childNodes,t,i,s,r,o,a;for(i=0,s=e.length;i<s;i++)if(t=e[i],t.nodeType===1){if(t["s-sr"]){for(o=t["s-sn"],t.hidden=!1,r=0;r<s;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}}fa(t)}},ue=[],ga=n=>{let e,t,i,s,r,o,a=0,c=n.childNodes,l=c.length;for(;a<l;a++){if(e=c[a],e["s-sr"]&&(t=e["s-cr"])&&t.parentNode)for(i=t.parentNode.childNodes,s=e["s-sn"],o=i.length-1;o>=0;o--)t=i[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&(Yr(t,s)?(r=ue.find(u=>u.$nodeToRelocate$===t),Ln=!0,t["s-sn"]=t["s-sn"]||s,r?r.$slotRefNode$=e:ue.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&ue.map(u=>{Yr(u.$nodeToRelocate$,t["s-sn"])&&(r=ue.find(p=>p.$nodeToRelocate$===t),r&&!u.$slotRefNode$&&(u.$slotRefNode$=r.$slotRefNode$))})):ue.some(u=>u.$nodeToRelocate$===t)||ue.push({$nodeToRelocate$:t}));e.nodeType===1&&ga(e)}},Yr=(n,e)=>n.nodeType===1?n.getAttribute("slot")===null&&e===""||n.getAttribute("slot")===e:n["s-sn"]===e?!0:e==="",ma=n=>{n.$attrs$&&n.$attrs$.ref&&n.$attrs$.ref(null),n.$children$&&n.$children$.map(ma)},du=(n,e)=>{const t=n.$hostElement$,i=n.$cmpMeta$,s=n.$vnode$||Rn(null,null),r=au(e)?e:mt(null,null,e);Yn=t.tagName,i.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},i.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,n.$vnode$=r,r.$elm$=s.$elm$=t.shadowRoot||t,pt=t["s-sc"],ra=t["s-cr"],oa=(i.$flags$&1)!==0,Ln=!1,ft(s,r);{if(X.$flags$|=1,us){ga(r.$elm$);let o,a,c,l,u,p,d=0;for(;d<ue.length;d++)o=ue[d],a=o.$nodeToRelocate$,a["s-ol"]||(c=ye.createTextNode(""),c["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=c,a));for(d=0;d<ue.length;d++)if(o=ue[d],a=o.$nodeToRelocate$,o.$slotRefNode$){for(l=o.$slotRefNode$.parentNode,u=o.$slotRefNode$.nextSibling,c=a["s-ol"];c=c.previousSibling;)if(p=c["s-nr"],p&&p["s-sn"]===a["s-sn"]&&l===p.parentNode&&(p=p.nextSibling,!p||!p["s-nr"])){u=p;break}(!u&&l!==a.parentNode||a.nextSibling!==u)&&a!==u&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),l.insertBefore(a,u))}else a.nodeType===1&&(a.hidden=!0)}Ln&&fa(r.$elm$),X.$flags$&=-2,ue.length=0}},pu=n=>n,fu=(n,e,t)=>{const i=pu(n);return{emit:s=>gu(i,e,{bubbles:!0,composed:!0,cancelable:!0,detail:s})}},gu=(n,e,t)=>{const i=X.ce(e,t);return n.dispatchEvent(i),i},mu=(n,e)=>{},va=(n,e)=>(n.$flags$|=16,mu(n,n.$ancestorComponent$),Pu(()=>vu(n,e))),vu=(n,e)=>{const t=n.$hostElement$,i=Je("scheduleUpdate",n.$cmpMeta$.$tagName$),s=t;let r;return e?r=vt(s,"componentWillLoad"):r=vt(s,"componentWillUpdate"),r=Qr(r,()=>vt(s,"componentWillRender")),i(),Qr(r,()=>bu(n,s,e))},bu=async(n,e,t)=>{const i=n.$hostElement$,s=Je("update",n.$cmpMeta$.$tagName$);i["s-rc"],t&&nu(n);const r=Je("render",n.$cmpMeta$.$tagName$);yu(n,e,i),r(),s(),$u(n)},yu=(n,e,t)=>{try{Fr=e,e=e.render&&e.render(),n.$flags$&=-17,n.$flags$|=2,(dt.hasRenderFn||dt.reflect)&&(dt.vdomRender||dt.reflect)&&(dt.hydrateServerSide||du(n,e))}catch(a){sn(a,n.$hostElement$)}return Fr=null,null},$u=n=>{const e=n.$cmpMeta$.$tagName$,t=n.$hostElement$,i=Je("postUpdate",e),s=t;n.$ancestorComponent$,vt(s,"componentDidRender"),n.$flags$&64?(vt(s,"componentDidUpdate"),i()):(n.$flags$|=64,vt(s,"componentDidLoad"),i())},vt=(n,e,t)=>{if(n&&n[e])try{return n[e](t)}catch(i){sn(i)}},Qr=(n,e)=>n&&n.then?n.then(e):e(),wu=(n,e)=>n!=null&&!hs(n)?e&4?n==="false"?!1:n===""||!!n:e&2?parseFloat(n):e&1?String(n):n:n,xu=(n,e)=>Xn(n).$instanceValues$.get(e),ku=(n,e,t,i)=>{const s=Xn(n),r=n,o=s.$instanceValues$.get(e),a=s.$flags$,c=r;t=wu(t,i.$members$[e][0]);const l=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!l){s.$instanceValues$.set(e,t);{if(i.$watchers$&&a&128){const p=i.$watchers$[e];p&&p.map(d=>{try{c[d](t,o,e)}catch(g){sn(g,r)}})}if((a&18)===2){if(c.componentShouldUpdate&&c.componentShouldUpdate(t,o,e)===!1)return;va(s,!1)}}}},Su=(n,e,t)=>{if(e.$members$){n.watchers&&(e.$watchers$=n.watchers);const i=Object.entries(e.$members$),s=n.prototype;i.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(s,r,{get(){return xu(this,r)},set(a){ku(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;s.attributeChangedCallback=function(o,a,c){X.jmp(()=>{const l=r.get(o);if(this.hasOwnProperty(l))c=this[l],delete this[l];else if(s.hasOwnProperty(l)&&typeof this[l]=="number"&&this[l]==c)return;this[l]=c===null&&typeof this[l]=="boolean"?!1:c})},n.observedAttributes=i.filter(([o,a])=>a[0]&15).map(([o,a])=>{const c=a[1]||o;return r.set(c,o),a[0]&512&&e.$attrsToReflect$.push([o,c]),c})}}return n},Cu=async(n,e,t,i,s)=>{if((e.$flags$&32)===0&&(s=n.constructor,e.$flags$|=32,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),s.style)){let o=s.style;typeof o!="string"&&(o=o[e.$modeName$=iu(n)]);const a=ca(t,e.$modeName$);if(!Pn.has(a)){const c=Je("registerStyles",t.$tagName$);eu(a,o,!!(t.$flags$&1)),c()}}e.$ancestorComponent$,va(e,!0)},Eu=n=>{},_u=n=>{if((X.$flags$&1)===0){const e=Xn(n),t=e.$cmpMeta$,i=Je("connectedCallback",t.$tagName$);e.$flags$&1?(la(n,e,t.$listeners$),Eu(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&Au(n),t.$members$&&Object.entries(t.$members$).map(([s,[r]])=>{if(r&31&&n.hasOwnProperty(s)){const o=n[s];delete n[s],n[s]=o}}),Cu(n,e,t)),i()}},Au=n=>{const e=n["s-cr"]=ye.createComment("");e["s-cn"]=!0,n.insertBefore(e,n.firstChild)},Tu=n=>{if((X.$flags$&1)===0){const e=Xn(n);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},ba=(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 i=n.prototype.connectedCallback,s=n.prototype.disconnectedCallback;return Object.assign(n.prototype,{__registerHost(){Ou(this,t)},connectedCallback(){_u(this),i&&i.call(this)},disconnectedCallback(){Tu(this),s&&s.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),n.is=t.$tagName$,Su(n,t)},ya=new WeakMap,Xn=n=>ya.get(n),Ou=(n,e)=>{const t={$flags$:0,$hostElement$:n,$cmpMeta$:e,$instanceValues$:new Map};return la(n,t,e.$listeners$),ya.set(n,t)},Xr=(n,e)=>e in n,sn=(n,e)=>(0,console.error)(n,e),Pn=new Map,Lu=[],Kr=[],$a=[],Ru=(n,e)=>t=>{n.push(t),Hi||(Hi=!0,e&&X.$flags$&4?Iu(ji):X.raf(ji))},Jr=n=>{for(let e=0;e<n.length;e++)try{n[e](performance.now())}catch(t){sn(t)}n.length=0},ji=()=>{Jr(Kr),Jr($a),(Hi=Kr.length>0)&&X.raf(ji)},Iu=n=>Yc().then(n),Pu=Ru($a,!0),Mu=(n={})=>{const{content:e="",title:t,attributes:i=[]}=n;let s="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...i];return t&&(s=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${s}${e}</svg>`},Nu=n=>n.replace(/<(\/?)svg([^>]*)>/g,"").trim();function Uu(n){return`${n.getFullYear()}.${n.getMonth()+1}`}class Du{constructor(e){this.voca_component=e,this.voca_added=Uu(new Date)}}const zu="telia-vst{display:none}",Hu=ba(class extends aa{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=fu(this,"vocaInternalUStats")}connectedCallback(){this.vocaInternalUStats.emit(new Du(this.dataTrackingId))}render(){return mt(ds,null)}static get style(){return zu}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function wa(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,Hu);break}})}wa();function Fi(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function ju(){if(typeof Fi().vocadsIcons!==void 0)return Fi().vocadsIcons}function Fu(){return Fi().vocadsIconsRegistered}const Bu=".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))}",qu=ba(class extends aa{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(Fu()&&this.name){const n=ju();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=Mu({content:Nu(n),attributes:e,title:this.allyTitle});return mt(ds,{class:`telia-icon telia-icon--${this.size}`},mt("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),mt("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return Bu}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Vu(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,qu);break;case"telia-vst":customElements.get(e)||wa();break}})}Vu();/**
21
+ */const Qe=globalThis;let A=class extends ht{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=zc(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 Re}};var Eo;A._$litElement$=!0,A.finalized=!0,(Eo=Qe.litElementHydrateSupport)==null||Eo.call(Qe,{LitElement:A});const wi=Qe.litElementPolyfillSupport;wi==null||wi({LitElement:A});(Qe.litElementVersions??(Qe.litElementVersions=[])).push("4.2.1");const jc={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>'},ea={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M52 7H24C19.5838 7.00505 16.0051 10.5838 16 15V23H12C7.58382 23.0051 4.00505 26.5838 4 31V43C4.00505 47.4162 7.58382 50.9949 12 51H19.1699L24.8789 56.7075C25.737 57.5654 27.0273 57.8219 28.1482 57.3575C29.2692 56.8931 30 55.7993 30 54.5859V51H39.999C44.4152 50.995 47.994 47.4162 47.999 43V35H52C56.4162 34.9949 59.9949 31.4162 60 27V15C59.9949 10.5838 56.4162 7.00505 52 7ZM43.999 43C43.9967 45.2082 42.2072 46.9977 39.999 47H26V52.1724L20.8262 47H12C9.79184 46.9976 8.00235 45.2082 8 43V31C8.00235 28.7918 9.79184 27.0024 12 27H16C16.0051 31.4162 19.5838 34.9949 24 35H30V38.5859C29.999 39.7998 30.7298 40.8945 31.8512 41.359C32.9726 41.8236 34.2634 41.5664 35.1211 40.7075L40.8291 35H43.999V43ZM56 27C55.9977 29.2082 54.2082 30.9976 52 31H39.1729L34 36.1719V31H24C21.7918 30.9976 20.0024 29.2082 20 27V15C20.0024 12.7918 21.7918 11.0024 24 11H52C54.2082 11.0024 55.9977 12.7918 56 15V27Z"/></svg>'},Fc={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>'},ta={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>'},Bc={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>'},na={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>'},qc={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>'},ia={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>'},Vc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.2618 43.8838L38.8585 11.5469C37.4136 9.13651 34.8097 7.66134 31.9994 7.66113C29.1891 7.66093 26.585 9.13572 25.1397 11.5459L5.73642 43.8838C4.25367 46.3552 4.21482 49.4331 5.6347 51.9411C7.05459 54.4492 9.71372 55.9997 12.5958 56H51.4024C54.2845 55.9997 56.9436 54.4492 58.3635 51.9411C59.7834 49.4331 59.7446 46.3552 58.2618 43.8838ZM29.9991 36.9772V25.1569C29.9983 24.6198 30.1056 24.0879 30.3148 23.5932C30.486 23.1496 30.753 22.7494 31.0968 22.4209C31.339 22.1704 31.6666 22.0202 32.0145 22C32.5161 22 33.0173 22.3805 33.5182 23.1416C33.7901 23.4771 33.9573 23.8852 33.9991 24.3151V36.1354C33.9991 36.5759 33.6932 36.9969 33.0814 37.3982C32.4994 37.7897 31.814 37.9988 31.1126 37.999C30.3712 37.999 30 37.6584 29.9991 36.9772ZM34.2408 43.9236C34.173 43.4297 33.9757 42.9626 33.669 42.5696C33.1076 41.7469 32.566 41.3355 32.0444 41.3355C31.6396 41.354 31.2573 41.5266 30.9757 41.8179C30.593 42.1852 30.2954 42.6319 30.1039 43.1266C29.874 43.6743 29.7562 44.2625 29.7574 44.8565C29.7574 45.6189 30.1786 46 31.0208 46C31.8022 46.0001 32.5662 45.7697 33.2173 45.3377C33.8996 44.8957 34.2408 44.4243 34.2408 43.9236Z"/></svg>'},Hi={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>'},zr={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>'},Wc={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>'},sa={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>'},jr={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>'},Gc={svg:'<svg viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M27.2561 39.1924C27.3201 40.5364 28.0241 41.1764 29.3681 41.1764C32.1201 41.1764 34.8081 39.3844 34.8721 37.5924L35.8961 12.3764C35.8961 10.6484 35.0001 9.81641 33.1441 9.81641C29.6241 9.81641 25.9761 12.1844 25.9761 14.4244L27.2561 39.1924ZM30.9041 55.3847C28.4081 55.3847 26.0401 51.2247 26.0401 49.6247C26.0401 47.3847 29.6881 45.0167 33.2081 45.0167C35.0641 45.0167 36.0241 45.8487 36.0241 47.5767C36.0241 50.2007 34.8081 52.8887 33.2721 54.2967C32.5041 55.0007 31.7361 55.3847 30.9041 55.3847Z"/></svg>'},dt={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 pt,ra,Yn,oa=!1,Rn=!1,us=!1,te=!1,Fr=null,zi=!1;const Qn=typeof window<"u"?window:{},ye=Qn.document||{head:{}},aa=Qn.HTMLElement||class{},X={$flags$:0,$resourcesUrl$:"",jmp:n=>n(),raf:n=>requestAnimationFrame(n),ael:(n,e,t,i)=>n.addEventListener(e,t,i),rel:(n,e,t,i)=>n.removeEventListener(e,t,i),ce:(n,e)=>new CustomEvent(n,e)},Zc=(()=>{let n=!1;try{ye.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch{}return n})(),Yc=n=>Promise.resolve(n),Qc=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replace=="function"}catch{}return!1})(),la=(n,e,t,i)=>{t&&t.map(([s,r,o])=>{const a=Kc(n,s),c=Xc(e,o),l=Jc(s);X.ael(a,r,c,l),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>X.rel(a,r,c,l))})},Xc=(n,e)=>t=>{try{dt.lazyLoad||n.$hostElement$[e](t)}catch(i){sn(i)}},Kc=(n,e)=>e&4?ye:e&8?Qn:e&16?ye.body:n,Jc=n=>Zc?{passive:(n&1)!==0,capture:(n&2)!==0}:(n&2)!==0,Br="http://www.w3.org/1999/xlink",Je=(n,e="")=>()=>{},qr=new WeakMap,eu=(n,e,t)=>{let i=Pn.get(n);Qc&&t?(i=i||new CSSStyleSheet,i.replace(e)):i=e,Pn.set(n,i)},tu=(n,e,t,i)=>{let s=ca(e,t),r=Pn.get(s);if(n=n.nodeType===11?n:ye,r)if(typeof r=="string"){n=n.head||n;let o=qr.get(n),a;o||qr.set(n,o=new Set),o.has(s)||(a=ye.createElement("style"),a.innerHTML=r,n.insertBefore(a,n.querySelector("link")),o&&o.add(s))}else n.adoptedStyleSheets.includes(r)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,r]);return s},nu=n=>{const e=n.$cmpMeta$,t=n.$hostElement$,i=e.$flags$,s=Je("attachStyles",e.$tagName$),r=tu(t.shadowRoot?t.shadowRoot:t.getRootNode(),e,n.$modeName$);i&10&&(t["s-sc"]=r,t.classList.add(r+"-h"),i&2&&t.classList.add(r+"-s")),s()},ca=(n,e)=>"sc-"+(e&&n.$flags$&32?n.$tagName$+"-"+e:n.$tagName$),iu=n=>Ru.map(e=>e(n)).find(e=>!!e),Vr={},su="http://www.w3.org/2000/svg",ru="http://www.w3.org/1999/xhtml",ou=n=>n!=null,hs=n=>(n=typeof n,n==="object"||n==="function"),mt=(n,e,...t)=>{let i=null,s=null,r=null,o=!1,a=!1,c=[];const l=p=>{for(let d=0;d<p.length;d++)i=p[d],Array.isArray(i)?l(i):i!=null&&typeof i!="boolean"&&((o=typeof n!="function"&&!hs(i))&&(i=String(i)),o&&a?c[c.length-1].$text$+=i:c.push(o?Ln(null,i):i),a=o)};if(l(t),e){e.key&&(s=e.key),e.name&&(r=e.name);{const p=e.className||e.class;p&&(e.class=typeof p!="object"?p:Object.keys(p).filter(d=>p[d]).join(" "))}}if(typeof n=="function")return n(e===null?{}:e,c,lu);const u=Ln(n,null);return u.$attrs$=e,c.length>0&&(u.$children$=c),u.$key$=s,u.$name$=r,u},Ln=(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},ds={},au=n=>n&&n.$tag$===ds,lu={forEach:(n,e)=>n.map(Wr).forEach(e),map:(n,e)=>n.map(Wr).map(e).map(cu)},Wr=n=>({vattrs:n.$attrs$,vchildren:n.$children$,vkey:n.$key$,vname:n.$name$,vtag:n.$tag$,vtext:n.$text$}),cu=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),mt(n.vtag,t,...n.vchildren||[])}const e=Ln(n.vtag,n.vtext);return e.$attrs$=n.vattrs,e.$children$=n.vchildren,e.$key$=n.vkey,e.$name$=n.vname,e},Gr=(n,e,t,i,s,r)=>{if(t!==i){let o=Xr(n,e),a=e.toLowerCase();if(e==="class"){const c=n.classList,l=Zr(t),u=Zr(i);c.remove(...l.filter(p=>p&&!u.includes(p))),c.add(...u.filter(p=>p&&!l.includes(p)))}else if(e==="style"){for(const c in t)(!i||i[c]==null)&&(c.includes("-")?n.style.removeProperty(c):n.style[c]="");for(const c in i)(!t||i[c]!==t[c])&&(c.includes("-")?n.style.setProperty(c,i[c]):n.style[c]=i[c])}else if(e!=="key")if(e==="ref")i&&i(n);else if(!n.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):Xr(Qn,a)?e=a.slice(2):e=a[2]+e.slice(3),t&&X.rel(n,e,t,!1),i&&X.ael(n,e,i,!1);else{const c=hs(i);if((o||c&&i!==null)&&!s)try{if(n.tagName.includes("-"))n[e]=i;else{let u=i??"";e==="list"?o=!1:(t==null||n[e]!=u)&&(n[e]=u)}}catch{}let l=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(e=a,l=!0),i==null||i===!1?(i!==!1||n.getAttribute(e)==="")&&(l?n.removeAttributeNS(Br,e):n.removeAttribute(e)):(!o||r&4||s)&&!c&&(i=i===!0?"":i,l?n.setAttributeNS(Br,e,i):n.setAttribute(e,i))}}},uu=/\s/,Zr=n=>n?n.split(uu):[],ua=(n,e,t,i)=>{const s=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,r=n&&n.$attrs$||Vr,o=e.$attrs$||Vr;for(i in r)i in o||Gr(s,i,r[i],void 0,t,e.$flags$);for(i in o)Gr(s,i,r[i],o[i],t,e.$flags$)},In=(n,e,t,i)=>{let s=e.$children$[t],r=0,o,a,c;if(oa||(us=!0,s.$tag$==="slot"&&(pt&&i.classList.add(pt+"-s"),s.$flags$|=s.$children$?2:1)),s.$text$!==null)o=s.$elm$=ye.createTextNode(s.$text$);else if(s.$flags$&1)o=s.$elm$=ye.createTextNode("");else{if(te||(te=s.$tag$==="svg"),o=s.$elm$=ye.createElementNS(te?su:ru,s.$flags$&2?"slot-fb":s.$tag$),te&&s.$tag$==="foreignObject"&&(te=!1),ua(null,s,te),ou(pt)&&o["s-si"]!==pt&&o.classList.add(o["s-si"]=pt),s.$children$)for(r=0;r<s.$children$.length;++r)a=In(n,s,r,o),a&&o.appendChild(a);s.$tag$==="svg"?te=!1:o.tagName==="foreignObject"&&(te=!0)}return o["s-hn"]=Yn,s.$flags$&3&&(o["s-sr"]=!0,o["s-cr"]=ra,o["s-sn"]=s.$name$||"",c=n&&n.$children$&&n.$children$[t],c&&c.$tag$===s.$tag$&&n.$elm$&&Gt(n.$elm$,!1)),o},Gt=(n,e)=>{X.$flags$|=1;const t=n.childNodes;for(let i=t.length-1;i>=0;i--){const s=t[i];s["s-hn"]!==Yn&&s["s-ol"]&&(pa(s).insertBefore(s,ps(s)),s["s-ol"].remove(),s["s-ol"]=void 0,us=!0),e&&Gt(s,e)}X.$flags$&=-2},ha=(n,e,t,i,s,r)=>{let o=n["s-cr"]&&n["s-cr"].parentNode||n,a;for(o.shadowRoot&&o.tagName===Yn&&(o=o.shadowRoot);s<=r;++s)i[s]&&(a=In(null,t,s,n),a&&(i[s].$elm$=a,o.insertBefore(a,ps(e))))},da=(n,e,t,i,s)=>{for(;e<=t;++e)(i=n[e])&&(s=i.$elm$,ma(i),Rn=!0,s["s-ol"]?s["s-ol"].remove():Gt(s,!0),s.remove())},hu=(n,e,t,i)=>{let s=0,r=0,o=0,a=0,c=e.length-1,l=e[0],u=e[c],p=i.length-1,d=i[0],g=i[p],m,$;for(;s<=c&&r<=p;)if(l==null)l=e[++s];else if(u==null)u=e[--c];else if(d==null)d=i[++r];else if(g==null)g=i[--p];else if(vn(l,d))ft(l,d),l=e[++s],d=i[++r];else if(vn(u,g))ft(u,g),u=e[--c],g=i[--p];else if(vn(l,g))(l.$tag$==="slot"||g.$tag$==="slot")&&Gt(l.$elm$.parentNode,!1),ft(l,g),n.insertBefore(l.$elm$,u.$elm$.nextSibling),l=e[++s],g=i[--p];else if(vn(u,d))(l.$tag$==="slot"||g.$tag$==="slot")&&Gt(u.$elm$.parentNode,!1),ft(u,d),n.insertBefore(u.$elm$,l.$elm$),u=e[--c],d=i[++r];else{for(o=-1,a=s;a<=c;++a)if(e[a]&&e[a].$key$!==null&&e[a].$key$===d.$key$){o=a;break}o>=0?($=e[o],$.$tag$!==d.$tag$?m=In(e&&e[r],t,o,n):(ft($,d),e[o]=void 0,m=$.$elm$),d=i[++r]):(m=In(e&&e[r],t,r,n),d=i[++r]),m&&pa(l.$elm$).insertBefore(m,ps(l.$elm$))}s>c?ha(n,i[p+1]==null?null:i[p+1].$elm$,t,i,r,p):r>p&&da(e,s,c)},vn=(n,e)=>n.$tag$===e.$tag$?n.$tag$==="slot"?n.$name$===e.$name$:n.$key$===e.$key$:!1,ps=n=>n&&n["s-ol"]||n,pa=n=>(n["s-ol"]?n["s-ol"]:n).parentNode,ft=(n,e)=>{const t=e.$elm$=n.$elm$,i=n.$children$,s=e.$children$,r=e.$tag$,o=e.$text$;let a;o===null?(te=r==="svg"?!0:r==="foreignObject"?!1:te,r==="slot"||ua(n,e,te),i!==null&&s!==null?hu(t,i,e,s):s!==null?(n.$text$!==null&&(t.textContent=""),ha(t,null,e,s,0,s.length-1)):i!==null&&da(i,0,i.length-1),te&&r==="svg"&&(te=!1)):(a=t["s-cr"])?a.parentNode.textContent=o:n.$text$!==o&&(t.data=o)},fa=n=>{let e=n.childNodes,t,i,s,r,o,a;for(i=0,s=e.length;i<s;i++)if(t=e[i],t.nodeType===1){if(t["s-sr"]){for(o=t["s-sn"],t.hidden=!1,r=0;r<s;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}}fa(t)}},ue=[],ga=n=>{let e,t,i,s,r,o,a=0,c=n.childNodes,l=c.length;for(;a<l;a++){if(e=c[a],e["s-sr"]&&(t=e["s-cr"])&&t.parentNode)for(i=t.parentNode.childNodes,s=e["s-sn"],o=i.length-1;o>=0;o--)t=i[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==e["s-hn"]&&(Yr(t,s)?(r=ue.find(u=>u.$nodeToRelocate$===t),Rn=!0,t["s-sn"]=t["s-sn"]||s,r?r.$slotRefNode$=e:ue.push({$slotRefNode$:e,$nodeToRelocate$:t}),t["s-sr"]&&ue.map(u=>{Yr(u.$nodeToRelocate$,t["s-sn"])&&(r=ue.find(p=>p.$nodeToRelocate$===t),r&&!u.$slotRefNode$&&(u.$slotRefNode$=r.$slotRefNode$))})):ue.some(u=>u.$nodeToRelocate$===t)||ue.push({$nodeToRelocate$:t}));e.nodeType===1&&ga(e)}},Yr=(n,e)=>n.nodeType===1?n.getAttribute("slot")===null&&e===""||n.getAttribute("slot")===e:n["s-sn"]===e?!0:e==="",ma=n=>{n.$attrs$&&n.$attrs$.ref&&n.$attrs$.ref(null),n.$children$&&n.$children$.map(ma)},du=(n,e)=>{const t=n.$hostElement$,i=n.$cmpMeta$,s=n.$vnode$||Ln(null,null),r=au(e)?e:mt(null,null,e);Yn=t.tagName,i.$attrsToReflect$&&(r.$attrs$=r.$attrs$||{},i.$attrsToReflect$.map(([o,a])=>r.$attrs$[a]=t[o])),r.$tag$=null,r.$flags$|=4,n.$vnode$=r,r.$elm$=s.$elm$=t.shadowRoot||t,pt=t["s-sc"],ra=t["s-cr"],oa=(i.$flags$&1)!==0,Rn=!1,ft(s,r);{if(X.$flags$|=1,us){ga(r.$elm$);let o,a,c,l,u,p,d=0;for(;d<ue.length;d++)o=ue[d],a=o.$nodeToRelocate$,a["s-ol"]||(c=ye.createTextNode(""),c["s-nr"]=a,a.parentNode.insertBefore(a["s-ol"]=c,a));for(d=0;d<ue.length;d++)if(o=ue[d],a=o.$nodeToRelocate$,o.$slotRefNode$){for(l=o.$slotRefNode$.parentNode,u=o.$slotRefNode$.nextSibling,c=a["s-ol"];c=c.previousSibling;)if(p=c["s-nr"],p&&p["s-sn"]===a["s-sn"]&&l===p.parentNode&&(p=p.nextSibling,!p||!p["s-nr"])){u=p;break}(!u&&l!==a.parentNode||a.nextSibling!==u)&&a!==u&&(!a["s-hn"]&&a["s-ol"]&&(a["s-hn"]=a["s-ol"].parentNode.nodeName),l.insertBefore(a,u))}else a.nodeType===1&&(a.hidden=!0)}Rn&&fa(r.$elm$),X.$flags$&=-2,ue.length=0}},pu=n=>n,fu=(n,e,t)=>{const i=pu(n);return{emit:s=>gu(i,e,{bubbles:!0,composed:!0,cancelable:!0,detail:s})}},gu=(n,e,t)=>{const i=X.ce(e,t);return n.dispatchEvent(i),i},mu=(n,e)=>{},va=(n,e)=>(n.$flags$|=16,mu(n,n.$ancestorComponent$),Pu(()=>vu(n,e))),vu=(n,e)=>{const t=n.$hostElement$,i=Je("scheduleUpdate",n.$cmpMeta$.$tagName$),s=t;let r;return e?r=vt(s,"componentWillLoad"):r=vt(s,"componentWillUpdate"),r=Qr(r,()=>vt(s,"componentWillRender")),i(),Qr(r,()=>bu(n,s,e))},bu=async(n,e,t)=>{const i=n.$hostElement$,s=Je("update",n.$cmpMeta$.$tagName$);i["s-rc"],t&&nu(n);const r=Je("render",n.$cmpMeta$.$tagName$);yu(n,e,i),r(),s(),$u(n)},yu=(n,e,t)=>{try{Fr=e,e=e.render&&e.render(),n.$flags$&=-17,n.$flags$|=2,(dt.hasRenderFn||dt.reflect)&&(dt.vdomRender||dt.reflect)&&(dt.hydrateServerSide||du(n,e))}catch(a){sn(a,n.$hostElement$)}return Fr=null,null},$u=n=>{const e=n.$cmpMeta$.$tagName$,t=n.$hostElement$,i=Je("postUpdate",e),s=t;n.$ancestorComponent$,vt(s,"componentDidRender"),n.$flags$&64?(vt(s,"componentDidUpdate"),i()):(n.$flags$|=64,vt(s,"componentDidLoad"),i())},vt=(n,e,t)=>{if(n&&n[e])try{return n[e](t)}catch(i){sn(i)}},Qr=(n,e)=>n&&n.then?n.then(e):e(),wu=(n,e)=>n!=null&&!hs(n)?e&4?n==="false"?!1:n===""||!!n:e&2?parseFloat(n):e&1?String(n):n:n,xu=(n,e)=>Xn(n).$instanceValues$.get(e),ku=(n,e,t,i)=>{const s=Xn(n),r=n,o=s.$instanceValues$.get(e),a=s.$flags$,c=r;t=wu(t,i.$members$[e][0]);const l=Number.isNaN(o)&&Number.isNaN(t);if(t!==o&&!l){s.$instanceValues$.set(e,t);{if(i.$watchers$&&a&128){const p=i.$watchers$[e];p&&p.map(d=>{try{c[d](t,o,e)}catch(g){sn(g,r)}})}if((a&18)===2){if(c.componentShouldUpdate&&c.componentShouldUpdate(t,o,e)===!1)return;va(s,!1)}}}},Su=(n,e,t)=>{if(e.$members$){n.watchers&&(e.$watchers$=n.watchers);const i=Object.entries(e.$members$),s=n.prototype;i.map(([r,[o]])=>{(o&31||o&32)&&Object.defineProperty(s,r,{get(){return xu(this,r)},set(a){ku(this,r,a,e)},configurable:!0,enumerable:!0})});{const r=new Map;s.attributeChangedCallback=function(o,a,c){X.jmp(()=>{const l=r.get(o);if(this.hasOwnProperty(l))c=this[l],delete this[l];else if(s.hasOwnProperty(l)&&typeof this[l]=="number"&&this[l]==c)return;this[l]=c===null&&typeof this[l]=="boolean"?!1:c})},n.observedAttributes=i.filter(([o,a])=>a[0]&15).map(([o,a])=>{const c=a[1]||o;return r.set(c,o),a[0]&512&&e.$attrsToReflect$.push([o,c]),c})}}return n},Cu=async(n,e,t,i,s)=>{if((e.$flags$&32)===0&&(s=n.constructor,e.$flags$|=32,customElements.whenDefined(t.$tagName$).then(()=>e.$flags$|=128),s.style)){let o=s.style;typeof o!="string"&&(o=o[e.$modeName$=iu(n)]);const a=ca(t,e.$modeName$);if(!Pn.has(a)){const c=Je("registerStyles",t.$tagName$);eu(a,o,!!(t.$flags$&1)),c()}}e.$ancestorComponent$,va(e,!0)},Eu=n=>{},_u=n=>{if((X.$flags$&1)===0){const e=Xn(n),t=e.$cmpMeta$,i=Je("connectedCallback",t.$tagName$);e.$flags$&1?(la(n,e,t.$listeners$),Eu(e.$lazyInstance$)):(e.$flags$|=1,t.$flags$&12&&Au(n),t.$members$&&Object.entries(t.$members$).map(([s,[r]])=>{if(r&31&&n.hasOwnProperty(s)){const o=n[s];delete n[s],n[s]=o}}),Cu(n,e,t)),i()}},Au=n=>{const e=n["s-cr"]=ye.createComment("");e["s-cn"]=!0,n.insertBefore(e,n.firstChild)},Tu=n=>{if((X.$flags$&1)===0){const e=Xn(n);e.$rmListeners$&&(e.$rmListeners$.map(t=>t()),e.$rmListeners$=void 0)}},ba=(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 i=n.prototype.connectedCallback,s=n.prototype.disconnectedCallback;return Object.assign(n.prototype,{__registerHost(){Ou(this,t)},connectedCallback(){_u(this),i&&i.call(this)},disconnectedCallback(){Tu(this),s&&s.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(t.$flags$&16)})}}),n.is=t.$tagName$,Su(n,t)},ya=new WeakMap,Xn=n=>ya.get(n),Ou=(n,e)=>{const t={$flags$:0,$hostElement$:n,$cmpMeta$:e,$instanceValues$:new Map};return la(n,t,e.$listeners$),ya.set(n,t)},Xr=(n,e)=>e in n,sn=(n,e)=>(0,console.error)(n,e),Pn=new Map,Ru=[],Kr=[],$a=[],Lu=(n,e)=>t=>{n.push(t),zi||(zi=!0,e&&X.$flags$&4?Iu(ji):X.raf(ji))},Jr=n=>{for(let e=0;e<n.length;e++)try{n[e](performance.now())}catch(t){sn(t)}n.length=0},ji=()=>{Jr(Kr),Jr($a),(zi=Kr.length>0)&&X.raf(ji)},Iu=n=>Yc().then(n),Pu=Lu($a,!0),Mu=(n={})=>{const{content:e="",title:t,attributes:i=[]}=n;let s="",r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},...i];return t&&(s=`<title>${t}</title>`),`<svg ${r.map(a=>`${a.name}="${a.value}"`).join(" ")}>${s}${e}</svg>`},Nu=n=>n.replace(/<(\/?)svg([^>]*)>/g,"").trim();function Uu(n){return`${n.getFullYear()}.${n.getMonth()+1}`}class Du{constructor(e){this.voca_component=e,this.voca_added=Uu(new Date)}}const Hu="telia-vst{display:none}",zu=ba(class extends aa{constructor(){super(),this.__registerHost(),this.vocaInternalUStats=fu(this,"vocaInternalUStats")}connectedCallback(){this.vocaInternalUStats.emit(new Du(this.dataTrackingId))}render(){return mt(ds,null)}static get style(){return Hu}},[0,"telia-vst",{dataTrackingId:[1,"data-tracking-id"]}]);function wa(){if(typeof customElements>"u")return;["telia-vst"].forEach(e=>{switch(e){case"telia-vst":customElements.get(e)||customElements.define(e,zu);break}})}wa();function Fi(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{vocadsIcons:void 0,vocadsIconsRegistered:!1}}function ju(){if(typeof Fi().vocadsIcons!==void 0)return Fi().vocadsIcons}function Fu(){return Fi().vocadsIconsRegistered}const Bu=".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))}",qu=ba(class extends aa{constructor(){super(),this.__registerHost(),this.size="md",this.allyTitle=null,this.dataTrackingId="telia-icon"}getSvgString(){if(this.svg)return this.svg;if(Fu()&&this.name){const n=ju();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=Mu({content:Nu(n),attributes:e,title:this.allyTitle});return mt(ds,{class:`telia-icon telia-icon--${this.size}`},mt("span",{"aria-label":this.allyTitle,class:"telia-icon__container",innerHTML:t}),mt("telia-vst",{dataTrackingId:this.dataTrackingId}))}static get style(){return Bu}},[0,"telia-icon",{name:[1],svg:[1],size:[1],allyTitle:[1,"ally-title"],dataTestid:[1,"data-testid"]}]);function Vu(){if(typeof customElements>"u")return;["telia-icon","telia-vst"].forEach(e=>{switch(e){case"telia-icon":customElements.get(e)||customElements.define(e,qu);break;case"telia-vst":customElements.get(e)||wa();break}})}Vu();/**
22
22
  * @license
23
23
  * Copyright 2017 Google LLC
24
24
  * SPDX-License-Identifier: BSD-3-Clause
@@ -46,7 +46,7 @@
46
46
  * @license
47
47
  * Copyright 2018 Google LLC
48
48
  * SPDX-License-Identifier: BSD-3-Clause
49
- */const wt=on(class extends Kn{constructor(n){var e;if(super(n),n.type!==rn.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 i,s;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]&&!((i=this.nt)!=null&&i.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)||(s=this.nt)!=null&&s.has(r)||(o?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return Le}});var Ju=Object.defineProperty,eh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Ju(e,t,s),s};const Ts=class Ts extends A{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"),w}};Ts.styles=[L`
49
+ */const wt=on(class extends Kn{constructor(n){var e;if(super(n),n.type!==rn.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 i,s;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]&&!((i=this.nt)!=null&&i.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)||(s=this.nt)!=null&&s.has(r)||(o?(t.add(r),this.st.add(r)):(t.remove(r),this.st.delete(r)))}return Re}});var Ju=Object.defineProperty,eh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Ju(e,t,s),s};const Ts=class Ts extends A{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"),w}};Ts.styles=[R`
50
50
  :host {
51
51
  position: fixed;
52
52
  display: flex;
@@ -67,7 +67,7 @@
67
67
  svg=${u.svg}
68
68
  size="lg"
69
69
  ></telia-icon>`:w}default:return w}}hideTrigger(){this.triggerVisible=!1}showTrigger(){this.triggerVisible=!0}render(){var e,t,i,s,r,o,a;return y`<div
70
- class=${wt({"trigger-container":!0,hidden:!this.triggerVisible})}
70
+ class=${wt({"trigger-container":!0,"ace-hidden":!this.triggerVisible})}
71
71
  ${be(this.containerRef)}
72
72
  >
73
73
  ${!this.active&&((s=(i=(t=(e=this.application)==null?void 0:e.settings)==null?void 0:t.branding)==null?void 0:i.other)!=null&&s.showButtonLabel)?y`
@@ -117,7 +117,7 @@
117
117
  </svg>
118
118
  </span>
119
119
  </button>
120
- </div>`}};Os.styles=[L`
120
+ </div>`}};Os.styles=[R`
121
121
  :host {
122
122
  --voca-rem-multiplier: 0.625;
123
123
  --trigger-label-bg: #f5e0ff;
@@ -137,7 +137,7 @@
137
137
  gap: 1rem;
138
138
  }
139
139
 
140
- .trigger-container.hidden {
140
+ .trigger-container.ace-hidden {
141
141
  display: none;
142
142
  }
143
143
 
@@ -246,7 +246,7 @@
246
246
  .trigger-label:hover {
247
247
  opacity: 0.8;
248
248
  }
249
- `];let Re=Os;an([k({attribute:!1})],Re.prototype,"application");an([T()],Re.prototype,"active");an([T()],Re.prototype,"triggerVisible");an([T()],Re.prototype,"loaded");an([T()],Re.prototype,"icon");var lh=Object.defineProperty,We=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&lh(e,t,s),s};const Ca=n=>{const t=class t 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)}};t.styles=[L`
249
+ `];let Le=Os;an([k({attribute:!1})],Le.prototype,"application");an([T()],Le.prototype,"active");an([T()],Le.prototype,"triggerVisible");an([T()],Le.prototype,"loaded");an([T()],Le.prototype,"icon");var lh=Object.defineProperty,We=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&lh(e,t,s),s};const Ca=n=>{const t=class t 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)}};t.styles=[R`
250
250
  :host {
251
251
  font-family: var(--font-family);
252
252
  grid-column: span var(--width);
@@ -258,11 +258,11 @@
258
258
  * {
259
259
  box-sizing: border-box;
260
260
  }
261
- `];let e=t;return We([k()],e.prototype,"properties"),We([k()],e.prototype,"context"),We([k()],e.prototype,"layout"),We([k()],e.prototype,"name"),We([k()],e.prototype,"type"),We([k({attribute:!1})],e.prototype,"application"),We([k({attribute:!1})],e.prototype,"parent"),e},Ls=class Ls extends Ca(A){render(){return y`Non resolved component`}};Ls.styles=[L`
261
+ `];let e=t;return We([k()],e.prototype,"properties"),We([k()],e.prototype,"context"),We([k()],e.prototype,"layout"),We([k()],e.prototype,"name"),We([k()],e.prototype,"type"),We([k({attribute:!1})],e.prototype,"application"),We([k({attribute:!1})],e.prototype,"parent"),e},Rs=class Rs extends Ca(A){render(){return y`Non resolved component`}};Rs.styles=[R`
262
262
  :host {
263
263
  display: block;
264
264
  }
265
- `];let qi=Ls;/**
265
+ `];let qi=Rs;/**
266
266
  * @license
267
267
  * Copyright 2021 Google LLC
268
268
  * SPDX-License-Identifier: BSD-3-Clause
@@ -294,9 +294,9 @@
294
294
  * @license
295
295
  * Copyright 2022 Google LLC
296
296
  * SPDX-License-Identifier: BSD-3-Clause
297
- */function de({context:n,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer((function(){new ao(this,{context:n,callback:s=>{t.set.call(this,s)},subscribe:e})})):t.constructor.addInitializer((s=>{new ao(s,{context:n,callback:r=>{s[i]=r},subscribe:e})}))}}var ph=Object.defineProperty,_a=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&ph(e,t,s),s};const ae="application",Rs=class Rs extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=ve(),this.fullscreen=!1,this.isReady=new he(!1)}addChild(e){e.parent=this,this.nodes.push(e)}applyBranding(){if(!this.wrapperRef.value)return;const e=this.application.settings;e!=null&&e.branding&&Sa(e.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const e=this.application.styles(),t=this.wrapperRef.value;Object.entries(e).forEach(([i,s])=>{t.style.setProperty(`--${i}`,s)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var i,s;const e=this.application.settings.components.conversation;return((s=(i=e==null?void 0:e.properties)==null?void 0:i.chat)==null?void 0:s.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===fs.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),this.application.fullscreen&&this.renderRoot.host.classList.add("fullscreen"),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),y`<div class="widget-container" ${be(this.wrapperRef)}>
297
+ */function de({context:n,subscribe:e}){return(t,i)=>{typeof i=="object"?i.addInitializer((function(){new ao(this,{context:n,callback:s=>{t.set.call(this,s)},subscribe:e})})):t.constructor.addInitializer((s=>{new ao(s,{context:n,callback:r=>{s[i]=r},subscribe:e})}))}}var ph=Object.defineProperty,_a=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&ph(e,t,s),s};const ae="application",Ls=class Ls extends A{constructor(){super(...arguments),this.nodes=[],this.wrapperRef=ve(),this.fullscreen=!1,this.isReady=new he(!1)}addChild(e){e.parent=this,this.nodes.push(e)}applyBranding(){if(!this.wrapperRef.value)return;const e=this.application.settings;e!=null&&e.branding&&Sa(e.branding,this.wrapperRef.value)}applyStyles(){if(!this.wrapperRef.value)return;const e=this.application.styles(),t=this.wrapperRef.value;Object.entries(e).forEach(([i,s])=>{t.style.setProperty(`--${i}`,s)})}firstUpdated(e){this.applyBranding(),this.applyStyles()}render(){var i,s;const e=this.application.settings.components.conversation;return((s=(i=e==null?void 0:e.properties)==null?void 0:i.chat)==null?void 0:s.isThirdPartyWidget)?this.renderRoot.host.classList.add("third-party"):this.application.renderStrategy===fs.Trigger&&(this.renderRoot.host.classList.add("floating"),this.application.anchor==="BottomLeft"?this.renderRoot.host.classList.add("bottom-left"):this.application.anchor==="BottomRight"&&this.renderRoot.host.classList.add("bottom-right")),this.application.fullscreen&&this.renderRoot.host.classList.add("fullscreen"),window.self!==window.top&&this.renderRoot.host.classList.add("embedded"),y`<div class="widget-container" ${be(this.wrapperRef)}>
298
298
  ${ch(this.nodes,r=>r)}
299
- </div>`}};Rs.styles=L`
299
+ </div>`}};Ls.styles=R`
300
300
  :host {
301
301
  --font-family: TeliaSans, Helvetica, Arial, Lucida Grande, sans-serif;
302
302
  --spacing-xs: 0.2rem;
@@ -446,26 +446,26 @@
446
446
  }
447
447
  }
448
448
 
449
- :host(.expanded) {
449
+ :host(.ace-expanded) {
450
450
  opacity: 1;
451
451
  animation: slideUp 0.3s linear;
452
452
  }
453
453
 
454
- :host(.hidden) {
454
+ :host(.ace-hidden) {
455
455
  opacity: 0;
456
456
  animation: slideDown 0.3s linear;
457
457
  pointer-events: none;
458
458
  }
459
459
 
460
- :host(.hidden.embedded),
461
- :host(.expanded.embedded) {
460
+ :host(.ace-hidden.embedded),
461
+ :host(.ace-expanded.embedded) {
462
462
  animation: none;
463
463
  }
464
- `;let Zt=Rs;_a([k({attribute:!0})],Zt.prototype,"fullscreen");_a([k({attribute:!1}),dh({context:ae})],Zt.prototype,"application");var fh=Object.defineProperty,gs=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&fh(e,t,s),s};const Is=class Is extends A{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(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 w;if(this.widget.renderStrategy===fs.Trigger){const e=new Re;return e.application=this.widget,e}return this.widget.render()}};Is.styles=[L`
464
+ `;let Zt=Ls;_a([k({attribute:!0})],Zt.prototype,"fullscreen");_a([k({attribute:!1}),dh({context:ae})],Zt.prototype,"application");var fh=Object.defineProperty,gs=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&fh(e,t,s),s};const Is=class Is extends A{constructor(){super(),this.status="deactivated",this.addEventListener("environment-created",this.onEnvironmentCreated)}async connectedCallback(){super.connectedCallback(),await this.getGlobalEnvironment()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("environment-created",this.onEnvironmentCreated)}async onEnvironmentCreated(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 w;if(this.widget.renderStrategy===fs.Trigger){const e=new Le;return e.application=this.widget,e}return this.widget.render()}};Is.styles=[R`
465
465
  :host {
466
466
  display: block;
467
467
  }
468
- `];let xt=Is;gs([k({attribute:!0})],xt.prototype,"name");gs([T()],xt.prototype,"widget");gs([T()],xt.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",Nn);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",Zt);customElements.get("ace-widget")||customElements.define("ace-widget",xt);class gh{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 co{constructor(e,t,i,s,r){this.id=e,this.providerKey=t,this.providerOptions=i,this.component=r,this.provider$=new he(null),this.entries$=new he([]),this.removeEntryAction$=new P,this.kill$=new P,this.isTyping$=new he(!1),this.data$=new he({}),this.complete$=this.provider$.pipe(Oe(c=>c?c.onComplete():tt));const o=this._getProviderFactory(t);if(!o)throw new Error(`No provider with key "${t}" was found.`);this.data$.next(s);const a=o(this.component);this.provider$.next(a),a.actions().pipe(z(this.kill$)).subscribe(c=>{this.write(c)}),a.isTyping().pipe(z(this.kill$)).subscribe(c=>{this.isTyping$.next(c)})}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(me(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(Oe(()=>this.entries$),me(1)).subscribe(t=>{this.removeEntryAction$.next(e),this.entries$.next(t.filter(i=>i!==e))})}_getProviderFactory(e){return this.component.platform.registeredProviders.get(e)}}class mh{constructor(e){this.component=e,this.currentSession$=new he(null),this.sessions=[],this.storage=null,An(e,"handover").subscribe(t=>{const i=this._createNewSession(t.detail.providerKey,t.detail.providerOptions);this._setSession(i),t.detail.complete=i.complete$,i.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 i=this._getInitialProviderKey(),s={};t=this._createNewSession(i,s)}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 co(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 i=t.sessions.findIndex(s=>s.id===e.id);i>-1?t={sessions:[...t.sessions.slice(0,i),e,...t.sessions.slice(i+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(i=>i.toStore())};this.storage.set("conversation",t)}_createNewSession(e,t={}){const i=this._getStoredSessions(),s=new co(Wo(),e,t,{},this.component);return i.sessions.push(s),this.save(i),s}_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 vh{constructor(e,t){this.state$=e,this.component=t,this.entries$=new he([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new mh(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(Oe(i=>i?i.provider$.pipe(Oe(s=>s?s.isTyping():Ii(!1))):Ii(!1))),e.subscribe(i=>{switch(i){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(Oe(e=>{if(!e)return tt;const t=e.removeEntryAction$.pipe(Mi(this.entries$)).pipe(_n(([s,r])=>r.filter(o=>o.id!==s.id))),i=e.entries().pipe(_n(s=>{const r=this.entries$.value,o=s.filter(a=>r.findIndex(c=>c.id===a.id)===-1);return[...r,...o]}));return fc(t,i)})).subscribe(e=>{this.entries$.next(e)}),this.sessionService.loadFromStorage(),this.state$.next("connected")}connected(){var e;(e=this.sessionService)==null||e.startSession()}}var bh=Object.defineProperty,Aa=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&bh(e,t,s),s};const Ps=class Ps extends A{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 w;let i="";e?t?i=`${e}: ${this._getTimestamp(t)}`:i=e:t&&(i=this._getTimestamp(t));const s=this.application.texts.getOrFallback("conversation.sr-only.message-from-label","Message from");return y`
468
+ `];let xt=Is;gs([k({attribute:!0})],xt.prototype,"name");gs([T()],xt.prototype,"widget");gs([T()],xt.prototype,"status");customElements.get("ace-trigger-slot")||customElements.define("ace-trigger-slot",Nn);customElements.get("ace-trigger")||customElements.define("ace-trigger",Le);customElements.get("ace-unresolved-component")||customElements.define("ace-unresolved-component",qi);customElements.get("ace-wrapper")||customElements.define("ace-wrapper",Zt);customElements.get("ace-widget")||customElements.define("ace-widget",xt);class gh{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 co{constructor(e,t,i,s,r){this.id=e,this.providerKey=t,this.providerOptions=i,this.component=r,this.provider$=new he(null),this.entries$=new he([]),this.removeEntryAction$=new P,this.kill$=new P,this.isTyping$=new he(!1),this.data$=new he({}),this.complete$=this.provider$.pipe(Oe(c=>c?c.onComplete():tt));const o=this._getProviderFactory(t);if(!o)throw new Error(`No provider with key "${t}" was found.`);this.data$.next(s);const a=o(this.component);this.provider$.next(a),a.actions().pipe(H(this.kill$)).subscribe(c=>{this.write(c)}),a.isTyping().pipe(H(this.kill$)).subscribe(c=>{this.isTyping$.next(c)})}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(me(1)).subscribe(t=>{this.entries$.next([...t,e])})}_addEntryRemoveHandler(e){e.remove$.pipe(Oe(()=>this.entries$),me(1)).subscribe(t=>{this.removeEntryAction$.next(e),this.entries$.next(t.filter(i=>i!==e))})}_getProviderFactory(e){return this.component.platform.registeredProviders.get(e)}}class mh{constructor(e){this.component=e,this.currentSession$=new he(null),this.sessions=[],this.storage=null,An(e,"handover").subscribe(t=>{const i=this._createNewSession(t.detail.providerKey,t.detail.providerOptions);this._setSession(i),t.detail.complete=i.complete$,i.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 i=this._getInitialProviderKey(),s={};t=this._createNewSession(i,s)}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 co(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 i=t.sessions.findIndex(s=>s.id===e.id);i>-1?t={sessions:[...t.sessions.slice(0,i),e,...t.sessions.slice(i+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(i=>i.toStore())};this.storage.set("conversation",t)}_createNewSession(e,t={}){const i=this._getStoredSessions(),s=new co(Wo(),e,t,{},this.component);return i.sessions.push(s),this.save(i),s}_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 vh{constructor(e,t){this.state$=e,this.component=t,this.entries$=new he([]),this.session=()=>this.session$,this.isTyping=()=>this.isTyping$,this.entries=()=>this.entries$.asObservable(),this.sessionService=new mh(this.component),this.session$=this.sessionService.currentSession(),this.isTyping$=this.session$.pipe(Oe(i=>i?i.provider$.pipe(Oe(s=>s?s.isTyping():Ii(!1))):Ii(!1))),e.subscribe(i=>{switch(i){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(Oe(e=>{if(!e)return tt;const t=e.removeEntryAction$.pipe(Mi(this.entries$)).pipe(_n(([s,r])=>r.filter(o=>o.id!==s.id))),i=e.entries().pipe(_n(s=>{const r=this.entries$.value,o=s.filter(a=>r.findIndex(c=>c.id===a.id)===-1);return[...r,...o]}));return fc(t,i)})).subscribe(e=>{this.entries$.next(e)}),this.sessionService.loadFromStorage(),this.state$.next("connected")}connected(){var e;(e=this.sessionService)==null||e.startSession()}}var bh=Object.defineProperty,Aa=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&bh(e,t,s),s};const Ps=class Ps extends A{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 w;let i="";e?t?i=`${e}: ${this._getTimestamp(t)}`:i=e:t&&(i=this._getTimestamp(t));const s=this.application.texts.getOrFallback("conversation.sr-only.message-from-label","Message from");return y`
469
469
  <p class="conversation-timestamp">
470
470
  <span class="sr-only">${s}</span>
471
471
  ${i}
@@ -526,7 +526,7 @@
526
526
  ${this._renderTimestamp(this.entry.sender.name||"",this.entry.timestamp)}
527
527
  ${this._renderDeliveryStatus(this.entry.status)}
528
528
  </div>
529
- </div>`;default:return w}}};Ps.styles=[L`
529
+ </div>`;default:return w}}};Ps.styles=[R`
530
530
  :host {
531
531
  box-sizing: border-box;
532
532
  display: inline;
@@ -669,7 +669,7 @@
669
669
  ${this.loading?y`<ace-typing-state
670
670
  ${Bi({keyframeOptions:{},in:io,out:ih,stabilizeOut:!0,skipInitial:!1})}
671
671
  ></ace-typing-state>`:w}
672
- </div>`}};Ms.styles=[L`
672
+ </div>`}};Ms.styles=[R`
673
673
  :host {
674
674
  display: block;
675
675
  }
@@ -695,7 +695,7 @@
695
695
  ${$h(e,[["html",()=>y`<message-type-html .message=${t} />`],["markdown",()=>y`<message-type-markdown .message=${t} />`]],()=>{const s=customElements.get(e);if(!s)return w;const r=new s(i||null);return y`${r}`})}
696
696
  `)}
697
697
  </div>
698
- `}};Ns.styles=[L`
698
+ `}};Ns.styles=[R`
699
699
  :host {
700
700
  box-sizing: border-box;
701
701
  display: block;
@@ -712,7 +712,7 @@
712
712
  <div class="dot"></div>
713
713
  <div class="dot"></div>
714
714
  <div class="dot"></div>
715
- </div>`}};Us.styles=[L`
715
+ </div>`}};Us.styles=[R`
716
716
  :host {
717
717
  display: block;
718
718
  }
@@ -750,10 +750,10 @@
750
750
  * @license
751
751
  * Copyright 2017 Google LLC
752
752
  * SPDX-License-Identifier: BSD-3-Clause
753
- */class Wi extends Kn{constructor(e){if(super(e),this.it=w,e.type!==rn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===Le)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:[]}}}Wi.directiveName="unsafeHTML",Wi.resultType=1;const kh=on(Wi);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Oa,setPrototypeOf:uo,isFrozen:Sh,getPrototypeOf:Ch,getOwnPropertyDescriptor:Eh}=Object;let{freeze:K,seal:se,create:La}=Object,{apply:Gi,construct:Zi}=typeof Reflect<"u"&&Reflect;K||(K=function(e){return e});se||(se=function(e){return e});Gi||(Gi=function(e,t,i){return e.apply(t,i)});Zi||(Zi=function(e,t){return new e(...t)});const bn=J(Array.prototype.forEach),_h=J(Array.prototype.lastIndexOf),ho=J(Array.prototype.pop),Rt=J(Array.prototype.push),Ah=J(Array.prototype.splice),kn=J(String.prototype.toLowerCase),Ci=J(String.prototype.toString),po=J(String.prototype.match),It=J(String.prototype.replace),Th=J(String.prototype.indexOf),Oh=J(String.prototype.trim),ce=J(Object.prototype.hasOwnProperty),G=J(RegExp.prototype.test),Pt=Lh(TypeError);function J(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Gi(n,e,i)}}function Lh(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Zi(n,t)}}function x(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kn;uo&&uo(n,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const r=t(s);r!==s&&(Sh(e)||(e[i]=r),s=r)}n[s]=!0}return n}function Rh(n){for(let e=0;e<n.length;e++)ce(n,e)||(n[e]=null);return n}function Ee(n){const e=La(null);for(const[t,i]of Oa(n))ce(n,t)&&(Array.isArray(i)?e[t]=Rh(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=Ee(i):e[t]=i);return e}function Mt(n,e){for(;n!==null;){const i=Eh(n,e);if(i){if(i.get)return J(i.get);if(typeof i.value=="function")return J(i.value)}n=Ch(n)}function t(){return null}return t}const fo=K(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ei=K(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_i=K(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ih=K(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ai=K(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ph=K(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),go=K(["#text"]),mo=K(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ti=K(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vo=K(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yn=K(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Mh=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nh=se(/<%[\w\W]*|[\w\W]*%>/gm),Uh=se(/\$\{[\w\W]*/gm),Dh=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),zh=se(/^aria-[\-\w]+$/),Ra=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hh=se(/^(?:\w+script|data):/i),jh=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ia=se(/^html$/i),Fh=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var bo=Object.freeze({__proto__:null,ARIA_ATTR:zh,ATTR_WHITESPACE:jh,CUSTOM_ELEMENT:Fh,DATA_ATTR:Dh,DOCTYPE_NAME:Ia,ERB_EXPR:Nh,IS_ALLOWED_URI:Ra,IS_SCRIPT_OR_DATA:Hh,MUSTACHE_EXPR:Mh,TMPLIT_EXPR:Uh});const Nt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Bh=function(){return typeof window>"u"?null:window},qh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},yo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Pa(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bh();const e=b=>Pa(b);if(e.version="3.2.6",e.removed=[],!n||!n.document||n.document.nodeType!==Nt.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,s=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:c,NodeFilter:l,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:g}=n,m=c.prototype,$=Mt(m,"cloneNode"),$e=Mt(m,"remove"),le=Mt(m,"nextSibling"),Pe=Mt(m,"childNodes"),He=Mt(m,"parentNode");if(typeof o=="function"){const b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let M,je="";const{implementation:Fe,createNodeIterator:Be,createDocumentFragment:Ka,getElementsByTagName:Ja}=t,{importNode:el}=i;let V=yo();e.isSupported=typeof Oa=="function"&&typeof He=="function"&&Fe&&Fe.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ti,ERB_EXPR:ni,TMPLIT_EXPR:ii,DATA_ATTR:tl,ARIA_ATTR:nl,IS_SCRIPT_OR_DATA:il,ATTR_WHITESPACE:Xs,CUSTOM_ELEMENT:sl}=bo;let{IS_ALLOWED_URI:Ks}=bo,N=null;const Js=x({},[...fo,...Ei,..._i,...Ai,...go]);let D=null;const er=x({},[...mo,...Ti,...vo,...yn]);let R=Object.seal(La(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_t=null,si=null,tr=!0,ri=!0,nr=!1,ir=!0,st=!1,cn=!0,qe=!1,oi=!1,ai=!1,rt=!1,un=!1,hn=!1,sr=!0,rr=!1;const rl="user-content-";let li=!0,At=!1,ot={},at=null;const or=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ar=null;const lr=x({},["audio","video","img","source","image","track"]);let ci=null;const cr=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),dn="http://www.w3.org/1998/Math/MathML",pn="http://www.w3.org/2000/svg",we="http://www.w3.org/1999/xhtml";let lt=we,ui=!1,hi=null;const ol=x({},[dn,pn,we],Ci);let fn=x({},["mi","mo","mn","ms","mtext"]),gn=x({},["annotation-xml"]);const al=x({},["title","style","font","a","script"]);let Tt=null;const ll=["application/xhtml+xml","text/html"],cl="text/html";let U=null,ct=null;const ul=t.createElement("form"),ur=function(h){return h instanceof RegExp||h instanceof Function},di=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ct&&ct===h)){if((!h||typeof h!="object")&&(h={}),h=Ee(h),Tt=ll.indexOf(h.PARSER_MEDIA_TYPE)===-1?cl:h.PARSER_MEDIA_TYPE,U=Tt==="application/xhtml+xml"?Ci:kn,N=ce(h,"ALLOWED_TAGS")?x({},h.ALLOWED_TAGS,U):Js,D=ce(h,"ALLOWED_ATTR")?x({},h.ALLOWED_ATTR,U):er,hi=ce(h,"ALLOWED_NAMESPACES")?x({},h.ALLOWED_NAMESPACES,Ci):ol,ci=ce(h,"ADD_URI_SAFE_ATTR")?x(Ee(cr),h.ADD_URI_SAFE_ATTR,U):cr,ar=ce(h,"ADD_DATA_URI_TAGS")?x(Ee(lr),h.ADD_DATA_URI_TAGS,U):lr,at=ce(h,"FORBID_CONTENTS")?x({},h.FORBID_CONTENTS,U):or,_t=ce(h,"FORBID_TAGS")?x({},h.FORBID_TAGS,U):Ee({}),si=ce(h,"FORBID_ATTR")?x({},h.FORBID_ATTR,U):Ee({}),ot=ce(h,"USE_PROFILES")?h.USE_PROFILES:!1,tr=h.ALLOW_ARIA_ATTR!==!1,ri=h.ALLOW_DATA_ATTR!==!1,nr=h.ALLOW_UNKNOWN_PROTOCOLS||!1,ir=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,st=h.SAFE_FOR_TEMPLATES||!1,cn=h.SAFE_FOR_XML!==!1,qe=h.WHOLE_DOCUMENT||!1,rt=h.RETURN_DOM||!1,un=h.RETURN_DOM_FRAGMENT||!1,hn=h.RETURN_TRUSTED_TYPE||!1,ai=h.FORCE_BODY||!1,sr=h.SANITIZE_DOM!==!1,rr=h.SANITIZE_NAMED_PROPS||!1,li=h.KEEP_CONTENT!==!1,At=h.IN_PLACE||!1,Ks=h.ALLOWED_URI_REGEXP||Ra,lt=h.NAMESPACE||we,fn=h.MATHML_TEXT_INTEGRATION_POINTS||fn,gn=h.HTML_INTEGRATION_POINTS||gn,R=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&ur(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(R.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&ur(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(R.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(R.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),st&&(ri=!1),un&&(rt=!0),ot&&(N=x({},go),D=[],ot.html===!0&&(x(N,fo),x(D,mo)),ot.svg===!0&&(x(N,Ei),x(D,Ti),x(D,yn)),ot.svgFilters===!0&&(x(N,_i),x(D,Ti),x(D,yn)),ot.mathMl===!0&&(x(N,Ai),x(D,vo),x(D,yn))),h.ADD_TAGS&&(N===Js&&(N=Ee(N)),x(N,h.ADD_TAGS,U)),h.ADD_ATTR&&(D===er&&(D=Ee(D)),x(D,h.ADD_ATTR,U)),h.ADD_URI_SAFE_ATTR&&x(ci,h.ADD_URI_SAFE_ATTR,U),h.FORBID_CONTENTS&&(at===or&&(at=Ee(at)),x(at,h.FORBID_CONTENTS,U)),li&&(N["#text"]=!0),qe&&x(N,["html","head","body"]),N.table&&(x(N,["tbody"]),delete _t.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=h.TRUSTED_TYPES_POLICY,je=M.createHTML("")}else M===void 0&&(M=qh(g,s)),M!==null&&typeof je=="string"&&(je=M.createHTML(""));K&&K(h),ct=h}},hr=x({},[...Ei,..._i,...Ih]),dr=x({},[...Ai,...Ph]),hl=function(h){let f=He(h);(!f||!f.tagName)&&(f={namespaceURI:lt,tagName:"template"});const v=kn(h.tagName),O=kn(f.tagName);return hi[h.namespaceURI]?h.namespaceURI===pn?f.namespaceURI===we?v==="svg":f.namespaceURI===dn?v==="svg"&&(O==="annotation-xml"||fn[O]):!!hr[v]:h.namespaceURI===dn?f.namespaceURI===we?v==="math":f.namespaceURI===pn?v==="math"&&gn[O]:!!dr[v]:h.namespaceURI===we?f.namespaceURI===pn&&!gn[O]||f.namespaceURI===dn&&!fn[O]?!1:!dr[v]&&(al[v]||!hr[v]):!!(Tt==="application/xhtml+xml"&&hi[h.namespaceURI]):!1},fe=function(h){Rt(e.removed,{element:h});try{He(h).removeChild(h)}catch{$e(h)}},ut=function(h,f){try{Rt(e.removed,{attribute:f.getAttributeNode(h),from:f})}catch{Rt(e.removed,{attribute:null,from:f})}if(f.removeAttribute(h),h==="is")if(rt||un)try{fe(f)}catch{}else try{f.setAttribute(h,"")}catch{}},pr=function(h){let f=null,v=null;if(ai)h="<remove></remove>"+h;else{const I=po(h,/^[\r\n\t ]+/);v=I&&I[0]}Tt==="application/xhtml+xml"&&lt===we&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const O=M?M.createHTML(h):h;if(lt===we)try{f=new d().parseFromString(O,Tt)}catch{}if(!f||!f.documentElement){f=Fe.createDocument(lt,"template",null);try{f.documentElement.innerHTML=ui?je:O}catch{}}const F=f.body||f.documentElement;return h&&v&&F.insertBefore(t.createTextNode(v),F.childNodes[0]||null),lt===we?Ja.call(f,qe?"html":"body")[0]:qe?f.documentElement:F},fr=function(h){return Be.call(h.ownerDocument||h,h,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},pi=function(h){return h instanceof p&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof u)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},gr=function(h){return typeof a=="function"&&h instanceof a};function xe(b,h,f){bn(b,v=>{v.call(e,h,f,ct)})}const mr=function(h){let f=null;if(xe(V.beforeSanitizeElements,h,null),pi(h))return fe(h),!0;const v=U(h.nodeName);if(xe(V.uponSanitizeElement,h,{tagName:v,allowedTags:N}),cn&&h.hasChildNodes()&&!gr(h.firstElementChild)&&G(/<[/\w!]/g,h.innerHTML)&&G(/<[/\w!]/g,h.textContent)||h.nodeType===Nt.progressingInstruction||cn&&h.nodeType===Nt.comment&&G(/<[/\w]/g,h.data))return fe(h),!0;if(!N[v]||_t[v]){if(!_t[v]&&br(v)&&(R.tagNameCheck instanceof RegExp&&G(R.tagNameCheck,v)||R.tagNameCheck instanceof Function&&R.tagNameCheck(v)))return!1;if(li&&!at[v]){const O=He(h)||h.parentNode,F=Pe(h)||h.childNodes;if(F&&O){const I=F.length;for(let ee=I-1;ee>=0;--ee){const ke=$(F[ee],!0);ke.__removalCount=(h.__removalCount||0)+1,O.insertBefore(ke,le(h))}}}return fe(h),!0}return h instanceof c&&!hl(h)||(v==="noscript"||v==="noembed"||v==="noframes")&&G(/<\/no(script|embed|frames)/i,h.innerHTML)?(fe(h),!0):(st&&h.nodeType===Nt.text&&(f=h.textContent,bn([ti,ni,ii],O=>{f=It(f,O," ")}),h.textContent!==f&&(Rt(e.removed,{element:h.cloneNode()}),h.textContent=f)),xe(V.afterSanitizeElements,h,null),!1)},vr=function(h,f,v){if(sr&&(f==="id"||f==="name")&&(v in t||v in ul))return!1;if(!(ri&&!si[f]&&G(tl,f))){if(!(tr&&G(nl,f))){if(!D[f]||si[f]){if(!(br(h)&&(R.tagNameCheck instanceof RegExp&&G(R.tagNameCheck,h)||R.tagNameCheck instanceof Function&&R.tagNameCheck(h))&&(R.attributeNameCheck instanceof RegExp&&G(R.attributeNameCheck,f)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(f))||f==="is"&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&G(R.tagNameCheck,v)||R.tagNameCheck instanceof Function&&R.tagNameCheck(v))))return!1}else if(!ci[f]){if(!G(Ks,It(v,Xs,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&h!=="script"&&Th(v,"data:")===0&&ar[h])){if(!(nr&&!G(il,It(v,Xs,"")))){if(v)return!1}}}}}}return!0},br=function(h){return h!=="annotation-xml"&&po(h,sl)},yr=function(h){xe(V.beforeSanitizeAttributes,h,null);const{attributes:f}=h;if(!f||pi(h))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let O=f.length;for(;O--;){const F=f[O],{name:I,namespaceURI:ee,value:ke}=F,Ot=U(I),fi=ke;let B=I==="value"?fi:Oh(fi);if(v.attrName=Ot,v.attrValue=B,v.keepAttr=!0,v.forceKeepAttr=void 0,xe(V.uponSanitizeAttribute,h,v),B=v.attrValue,rr&&(Ot==="id"||Ot==="name")&&(ut(I,h),B=rl+B),cn&&G(/((--!?|])>)|<\/(style|title)/i,B)){ut(I,h);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){ut(I,h);continue}if(!ir&&G(/\/>/i,B)){ut(I,h);continue}st&&bn([ti,ni,ii],wr=>{B=It(B,wr," ")});const $r=U(h.nodeName);if(!vr($r,Ot,B)){ut(I,h);continue}if(M&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ee)switch(g.getAttributeType($r,Ot)){case"TrustedHTML":{B=M.createHTML(B);break}case"TrustedScriptURL":{B=M.createScriptURL(B);break}}if(B!==fi)try{ee?h.setAttributeNS(ee,I,B):h.setAttribute(I,B),pi(h)?fe(h):ho(e.removed)}catch{ut(I,h)}}xe(V.afterSanitizeAttributes,h,null)},dl=function b(h){let f=null;const v=fr(h);for(xe(V.beforeSanitizeShadowDOM,h,null);f=v.nextNode();)xe(V.uponSanitizeShadowNode,f,null),mr(f),yr(f),f.content instanceof r&&b(f.content);xe(V.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(b){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,v=null,O=null,F=null;if(ui=!b,ui&&(b="<!-->"),typeof b!="string"&&!gr(b))if(typeof b.toString=="function"){if(b=b.toString(),typeof b!="string")throw Pt("dirty is not a string, aborting")}else throw Pt("toString is not a function");if(!e.isSupported)return b;if(oi||di(h),e.removed=[],typeof b=="string"&&(At=!1),At){if(b.nodeName){const ke=U(b.nodeName);if(!N[ke]||_t[ke])throw Pt("root node is forbidden and cannot be sanitized in-place")}}else if(b instanceof a)f=pr("<!---->"),v=f.ownerDocument.importNode(b,!0),v.nodeType===Nt.element&&v.nodeName==="BODY"||v.nodeName==="HTML"?f=v:f.appendChild(v);else{if(!rt&&!st&&!qe&&b.indexOf("<")===-1)return M&&hn?M.createHTML(b):b;if(f=pr(b),!f)return rt?null:hn?je:""}f&&ai&&fe(f.firstChild);const I=fr(At?b:f);for(;O=I.nextNode();)mr(O),yr(O),O.content instanceof r&&dl(O.content);if(At)return b;if(rt){if(un)for(F=Ka.call(f.ownerDocument);f.firstChild;)F.appendChild(f.firstChild);else F=f;return(D.shadowroot||D.shadowrootmode)&&(F=el.call(i,F,!0)),F}let ee=qe?f.outerHTML:f.innerHTML;return qe&&N["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&G(Ia,f.ownerDocument.doctype.name)&&(ee="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
754
- `+ee),st&&bn([ti,ni,ii],ke=>{ee=It(ee,ke," ")}),M&&hn?M.createHTML(ee):ee},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};di(b),oi=!0},e.clearConfig=function(){ct=null,oi=!1},e.isValidAttribute=function(b,h,f){ct||di({});const v=U(b),O=U(h);return vr(v,O,f)},e.addHook=function(b,h){typeof h=="function"&&Rt(V[b],h)},e.removeHook=function(b,h){if(h!==void 0){const f=_h(V[b],h);return f===-1?void 0:Ah(V[b],f,1)[0]}return ho(V[b])},e.removeHooks=function(b){V[b]=[]},e.removeAllHooks=function(){V=yo()},e}var Ma=Pa(),Vh=Object.defineProperty,Wh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Vh(e,t,s),s};const Ds=class Ds extends A{render(){return y`<div class="message-type-html">
753
+ */class Wi extends Kn{constructor(e){if(super(e),this.it=w,e.type!==rn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===w||e==null)return this._t=void 0,this.it=e;if(e===Re)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:[]}}}Wi.directiveName="unsafeHTML",Wi.resultType=1;const kh=on(Wi);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Oa,setPrototypeOf:uo,isFrozen:Sh,getPrototypeOf:Ch,getOwnPropertyDescriptor:Eh}=Object;let{freeze:K,seal:se,create:Ra}=Object,{apply:Gi,construct:Zi}=typeof Reflect<"u"&&Reflect;K||(K=function(e){return e});se||(se=function(e){return e});Gi||(Gi=function(e,t,i){return e.apply(t,i)});Zi||(Zi=function(e,t){return new e(...t)});const bn=J(Array.prototype.forEach),_h=J(Array.prototype.lastIndexOf),ho=J(Array.prototype.pop),Lt=J(Array.prototype.push),Ah=J(Array.prototype.splice),kn=J(String.prototype.toLowerCase),Ci=J(String.prototype.toString),po=J(String.prototype.match),It=J(String.prototype.replace),Th=J(String.prototype.indexOf),Oh=J(String.prototype.trim),ce=J(Object.prototype.hasOwnProperty),G=J(RegExp.prototype.test),Pt=Rh(TypeError);function J(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Gi(n,e,i)}}function Rh(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Zi(n,t)}}function x(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kn;uo&&uo(n,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const r=t(s);r!==s&&(Sh(e)||(e[i]=r),s=r)}n[s]=!0}return n}function Lh(n){for(let e=0;e<n.length;e++)ce(n,e)||(n[e]=null);return n}function Ee(n){const e=Ra(null);for(const[t,i]of Oa(n))ce(n,t)&&(Array.isArray(i)?e[t]=Lh(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=Ee(i):e[t]=i);return e}function Mt(n,e){for(;n!==null;){const i=Eh(n,e);if(i){if(i.get)return J(i.get);if(typeof i.value=="function")return J(i.value)}n=Ch(n)}function t(){return null}return t}const fo=K(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ei=K(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),_i=K(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ih=K(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ai=K(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ph=K(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),go=K(["#text"]),mo=K(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ti=K(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vo=K(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yn=K(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Mh=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nh=se(/<%[\w\W]*|[\w\W]*%>/gm),Uh=se(/\$\{[\w\W]*/gm),Dh=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hh=se(/^aria-[\-\w]+$/),La=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zh=se(/^(?:\w+script|data):/i),jh=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ia=se(/^html$/i),Fh=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var bo=Object.freeze({__proto__:null,ARIA_ATTR:Hh,ATTR_WHITESPACE:jh,CUSTOM_ELEMENT:Fh,DATA_ATTR:Dh,DOCTYPE_NAME:Ia,ERB_EXPR:Nh,IS_ALLOWED_URI:La,IS_SCRIPT_OR_DATA:zh,MUSTACHE_EXPR:Mh,TMPLIT_EXPR:Uh});const Nt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Bh=function(){return typeof window>"u"?null:window},qh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},yo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Pa(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bh();const e=b=>Pa(b);if(e.version="3.2.6",e.removed=[],!n||!n.document||n.document.nodeType!==Nt.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,s=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:c,NodeFilter:l,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:g}=n,m=c.prototype,$=Mt(m,"cloneNode"),$e=Mt(m,"remove"),le=Mt(m,"nextSibling"),Pe=Mt(m,"childNodes"),ze=Mt(m,"parentNode");if(typeof o=="function"){const b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let M,je="";const{implementation:Fe,createNodeIterator:Be,createDocumentFragment:Ka,getElementsByTagName:Ja}=t,{importNode:el}=i;let V=yo();e.isSupported=typeof Oa=="function"&&typeof ze=="function"&&Fe&&Fe.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ti,ERB_EXPR:ni,TMPLIT_EXPR:ii,DATA_ATTR:tl,ARIA_ATTR:nl,IS_SCRIPT_OR_DATA:il,ATTR_WHITESPACE:Xs,CUSTOM_ELEMENT:sl}=bo;let{IS_ALLOWED_URI:Ks}=bo,N=null;const Js=x({},[...fo,...Ei,..._i,...Ai,...go]);let D=null;const er=x({},[...mo,...Ti,...vo,...yn]);let L=Object.seal(Ra(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_t=null,si=null,tr=!0,ri=!0,nr=!1,ir=!0,st=!1,cn=!0,qe=!1,oi=!1,ai=!1,rt=!1,un=!1,hn=!1,sr=!0,rr=!1;const rl="user-content-";let li=!0,At=!1,ot={},at=null;const or=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ar=null;const lr=x({},["audio","video","img","source","image","track"]);let ci=null;const cr=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),dn="http://www.w3.org/1998/Math/MathML",pn="http://www.w3.org/2000/svg",we="http://www.w3.org/1999/xhtml";let lt=we,ui=!1,hi=null;const ol=x({},[dn,pn,we],Ci);let fn=x({},["mi","mo","mn","ms","mtext"]),gn=x({},["annotation-xml"]);const al=x({},["title","style","font","a","script"]);let Tt=null;const ll=["application/xhtml+xml","text/html"],cl="text/html";let U=null,ct=null;const ul=t.createElement("form"),ur=function(h){return h instanceof RegExp||h instanceof Function},di=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ct&&ct===h)){if((!h||typeof h!="object")&&(h={}),h=Ee(h),Tt=ll.indexOf(h.PARSER_MEDIA_TYPE)===-1?cl:h.PARSER_MEDIA_TYPE,U=Tt==="application/xhtml+xml"?Ci:kn,N=ce(h,"ALLOWED_TAGS")?x({},h.ALLOWED_TAGS,U):Js,D=ce(h,"ALLOWED_ATTR")?x({},h.ALLOWED_ATTR,U):er,hi=ce(h,"ALLOWED_NAMESPACES")?x({},h.ALLOWED_NAMESPACES,Ci):ol,ci=ce(h,"ADD_URI_SAFE_ATTR")?x(Ee(cr),h.ADD_URI_SAFE_ATTR,U):cr,ar=ce(h,"ADD_DATA_URI_TAGS")?x(Ee(lr),h.ADD_DATA_URI_TAGS,U):lr,at=ce(h,"FORBID_CONTENTS")?x({},h.FORBID_CONTENTS,U):or,_t=ce(h,"FORBID_TAGS")?x({},h.FORBID_TAGS,U):Ee({}),si=ce(h,"FORBID_ATTR")?x({},h.FORBID_ATTR,U):Ee({}),ot=ce(h,"USE_PROFILES")?h.USE_PROFILES:!1,tr=h.ALLOW_ARIA_ATTR!==!1,ri=h.ALLOW_DATA_ATTR!==!1,nr=h.ALLOW_UNKNOWN_PROTOCOLS||!1,ir=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,st=h.SAFE_FOR_TEMPLATES||!1,cn=h.SAFE_FOR_XML!==!1,qe=h.WHOLE_DOCUMENT||!1,rt=h.RETURN_DOM||!1,un=h.RETURN_DOM_FRAGMENT||!1,hn=h.RETURN_TRUSTED_TYPE||!1,ai=h.FORCE_BODY||!1,sr=h.SANITIZE_DOM!==!1,rr=h.SANITIZE_NAMED_PROPS||!1,li=h.KEEP_CONTENT!==!1,At=h.IN_PLACE||!1,Ks=h.ALLOWED_URI_REGEXP||La,lt=h.NAMESPACE||we,fn=h.MATHML_TEXT_INTEGRATION_POINTS||fn,gn=h.HTML_INTEGRATION_POINTS||gn,L=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&ur(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&ur(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),st&&(ri=!1),un&&(rt=!0),ot&&(N=x({},go),D=[],ot.html===!0&&(x(N,fo),x(D,mo)),ot.svg===!0&&(x(N,Ei),x(D,Ti),x(D,yn)),ot.svgFilters===!0&&(x(N,_i),x(D,Ti),x(D,yn)),ot.mathMl===!0&&(x(N,Ai),x(D,vo),x(D,yn))),h.ADD_TAGS&&(N===Js&&(N=Ee(N)),x(N,h.ADD_TAGS,U)),h.ADD_ATTR&&(D===er&&(D=Ee(D)),x(D,h.ADD_ATTR,U)),h.ADD_URI_SAFE_ATTR&&x(ci,h.ADD_URI_SAFE_ATTR,U),h.FORBID_CONTENTS&&(at===or&&(at=Ee(at)),x(at,h.FORBID_CONTENTS,U)),li&&(N["#text"]=!0),qe&&x(N,["html","head","body"]),N.table&&(x(N,["tbody"]),delete _t.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=h.TRUSTED_TYPES_POLICY,je=M.createHTML("")}else M===void 0&&(M=qh(g,s)),M!==null&&typeof je=="string"&&(je=M.createHTML(""));K&&K(h),ct=h}},hr=x({},[...Ei,..._i,...Ih]),dr=x({},[...Ai,...Ph]),hl=function(h){let f=ze(h);(!f||!f.tagName)&&(f={namespaceURI:lt,tagName:"template"});const v=kn(h.tagName),O=kn(f.tagName);return hi[h.namespaceURI]?h.namespaceURI===pn?f.namespaceURI===we?v==="svg":f.namespaceURI===dn?v==="svg"&&(O==="annotation-xml"||fn[O]):!!hr[v]:h.namespaceURI===dn?f.namespaceURI===we?v==="math":f.namespaceURI===pn?v==="math"&&gn[O]:!!dr[v]:h.namespaceURI===we?f.namespaceURI===pn&&!gn[O]||f.namespaceURI===dn&&!fn[O]?!1:!dr[v]&&(al[v]||!hr[v]):!!(Tt==="application/xhtml+xml"&&hi[h.namespaceURI]):!1},fe=function(h){Lt(e.removed,{element:h});try{ze(h).removeChild(h)}catch{$e(h)}},ut=function(h,f){try{Lt(e.removed,{attribute:f.getAttributeNode(h),from:f})}catch{Lt(e.removed,{attribute:null,from:f})}if(f.removeAttribute(h),h==="is")if(rt||un)try{fe(f)}catch{}else try{f.setAttribute(h,"")}catch{}},pr=function(h){let f=null,v=null;if(ai)h="<remove></remove>"+h;else{const I=po(h,/^[\r\n\t ]+/);v=I&&I[0]}Tt==="application/xhtml+xml"&&lt===we&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const O=M?M.createHTML(h):h;if(lt===we)try{f=new d().parseFromString(O,Tt)}catch{}if(!f||!f.documentElement){f=Fe.createDocument(lt,"template",null);try{f.documentElement.innerHTML=ui?je:O}catch{}}const F=f.body||f.documentElement;return h&&v&&F.insertBefore(t.createTextNode(v),F.childNodes[0]||null),lt===we?Ja.call(f,qe?"html":"body")[0]:qe?f.documentElement:F},fr=function(h){return Be.call(h.ownerDocument||h,h,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},pi=function(h){return h instanceof p&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof u)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},gr=function(h){return typeof a=="function"&&h instanceof a};function xe(b,h,f){bn(b,v=>{v.call(e,h,f,ct)})}const mr=function(h){let f=null;if(xe(V.beforeSanitizeElements,h,null),pi(h))return fe(h),!0;const v=U(h.nodeName);if(xe(V.uponSanitizeElement,h,{tagName:v,allowedTags:N}),cn&&h.hasChildNodes()&&!gr(h.firstElementChild)&&G(/<[/\w!]/g,h.innerHTML)&&G(/<[/\w!]/g,h.textContent)||h.nodeType===Nt.progressingInstruction||cn&&h.nodeType===Nt.comment&&G(/<[/\w]/g,h.data))return fe(h),!0;if(!N[v]||_t[v]){if(!_t[v]&&br(v)&&(L.tagNameCheck instanceof RegExp&&G(L.tagNameCheck,v)||L.tagNameCheck instanceof Function&&L.tagNameCheck(v)))return!1;if(li&&!at[v]){const O=ze(h)||h.parentNode,F=Pe(h)||h.childNodes;if(F&&O){const I=F.length;for(let ee=I-1;ee>=0;--ee){const ke=$(F[ee],!0);ke.__removalCount=(h.__removalCount||0)+1,O.insertBefore(ke,le(h))}}}return fe(h),!0}return h instanceof c&&!hl(h)||(v==="noscript"||v==="noembed"||v==="noframes")&&G(/<\/no(script|embed|frames)/i,h.innerHTML)?(fe(h),!0):(st&&h.nodeType===Nt.text&&(f=h.textContent,bn([ti,ni,ii],O=>{f=It(f,O," ")}),h.textContent!==f&&(Lt(e.removed,{element:h.cloneNode()}),h.textContent=f)),xe(V.afterSanitizeElements,h,null),!1)},vr=function(h,f,v){if(sr&&(f==="id"||f==="name")&&(v in t||v in ul))return!1;if(!(ri&&!si[f]&&G(tl,f))){if(!(tr&&G(nl,f))){if(!D[f]||si[f]){if(!(br(h)&&(L.tagNameCheck instanceof RegExp&&G(L.tagNameCheck,h)||L.tagNameCheck instanceof Function&&L.tagNameCheck(h))&&(L.attributeNameCheck instanceof RegExp&&G(L.attributeNameCheck,f)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(f))||f==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&G(L.tagNameCheck,v)||L.tagNameCheck instanceof Function&&L.tagNameCheck(v))))return!1}else if(!ci[f]){if(!G(Ks,It(v,Xs,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&h!=="script"&&Th(v,"data:")===0&&ar[h])){if(!(nr&&!G(il,It(v,Xs,"")))){if(v)return!1}}}}}}return!0},br=function(h){return h!=="annotation-xml"&&po(h,sl)},yr=function(h){xe(V.beforeSanitizeAttributes,h,null);const{attributes:f}=h;if(!f||pi(h))return;const v={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let O=f.length;for(;O--;){const F=f[O],{name:I,namespaceURI:ee,value:ke}=F,Ot=U(I),fi=ke;let B=I==="value"?fi:Oh(fi);if(v.attrName=Ot,v.attrValue=B,v.keepAttr=!0,v.forceKeepAttr=void 0,xe(V.uponSanitizeAttribute,h,v),B=v.attrValue,rr&&(Ot==="id"||Ot==="name")&&(ut(I,h),B=rl+B),cn&&G(/((--!?|])>)|<\/(style|title)/i,B)){ut(I,h);continue}if(v.forceKeepAttr)continue;if(!v.keepAttr){ut(I,h);continue}if(!ir&&G(/\/>/i,B)){ut(I,h);continue}st&&bn([ti,ni,ii],wr=>{B=It(B,wr," ")});const $r=U(h.nodeName);if(!vr($r,Ot,B)){ut(I,h);continue}if(M&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ee)switch(g.getAttributeType($r,Ot)){case"TrustedHTML":{B=M.createHTML(B);break}case"TrustedScriptURL":{B=M.createScriptURL(B);break}}if(B!==fi)try{ee?h.setAttributeNS(ee,I,B):h.setAttribute(I,B),pi(h)?fe(h):ho(e.removed)}catch{ut(I,h)}}xe(V.afterSanitizeAttributes,h,null)},dl=function b(h){let f=null;const v=fr(h);for(xe(V.beforeSanitizeShadowDOM,h,null);f=v.nextNode();)xe(V.uponSanitizeShadowNode,f,null),mr(f),yr(f),f.content instanceof r&&b(f.content);xe(V.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(b){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,v=null,O=null,F=null;if(ui=!b,ui&&(b="<!-->"),typeof b!="string"&&!gr(b))if(typeof b.toString=="function"){if(b=b.toString(),typeof b!="string")throw Pt("dirty is not a string, aborting")}else throw Pt("toString is not a function");if(!e.isSupported)return b;if(oi||di(h),e.removed=[],typeof b=="string"&&(At=!1),At){if(b.nodeName){const ke=U(b.nodeName);if(!N[ke]||_t[ke])throw Pt("root node is forbidden and cannot be sanitized in-place")}}else if(b instanceof a)f=pr("<!---->"),v=f.ownerDocument.importNode(b,!0),v.nodeType===Nt.element&&v.nodeName==="BODY"||v.nodeName==="HTML"?f=v:f.appendChild(v);else{if(!rt&&!st&&!qe&&b.indexOf("<")===-1)return M&&hn?M.createHTML(b):b;if(f=pr(b),!f)return rt?null:hn?je:""}f&&ai&&fe(f.firstChild);const I=fr(At?b:f);for(;O=I.nextNode();)mr(O),yr(O),O.content instanceof r&&dl(O.content);if(At)return b;if(rt){if(un)for(F=Ka.call(f.ownerDocument);f.firstChild;)F.appendChild(f.firstChild);else F=f;return(D.shadowroot||D.shadowrootmode)&&(F=el.call(i,F,!0)),F}let ee=qe?f.outerHTML:f.innerHTML;return qe&&N["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&G(Ia,f.ownerDocument.doctype.name)&&(ee="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
754
+ `+ee),st&&bn([ti,ni,ii],ke=>{ee=It(ee,ke," ")}),M&&hn?M.createHTML(ee):ee},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};di(b),oi=!0},e.clearConfig=function(){ct=null,oi=!1},e.isValidAttribute=function(b,h,f){ct||di({});const v=U(b),O=U(h);return vr(v,O,f)},e.addHook=function(b,h){typeof h=="function"&&Lt(V[b],h)},e.removeHook=function(b,h){if(h!==void 0){const f=_h(V[b],h);return f===-1?void 0:Ah(V[b],f,1)[0]}return ho(V[b])},e.removeHooks=function(b){V[b]=[]},e.removeAllHooks=function(){V=yo()},e}var Ma=Pa(),Vh=Object.defineProperty,Wh=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Vh(e,t,s),s};const Ds=class Ds extends A{render(){return y`<div class="message-type-html">
755
755
  ${kh(Ma.sanitize(this.message.content))}
756
- </div>`}};Ds.styles=[L`
756
+ </div>`}};Ds.styles=[R`
757
757
  :host {
758
758
  box-sizing: border-box;
759
759
  }
@@ -787,10 +787,10 @@
787
787
  height: auto;
788
788
  object-fit: contain;
789
789
  }
790
- `];let Dn=Ds;Wh([k({attribute:!1})],Dn.prototype,"message");function ms(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var nt=ms();function Na(n){nt=n}var Ft={exec:()=>null};function C(n,e=""){let t=typeof n=="string"?n:n.source;const i={replace:(s,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(Y.caret,"$1"),t=t.replace(s,o),i},getRegex:()=>new RegExp(t,e)};return i}var Y={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Gh=/^(?:[ \t]*(?:\n|$))+/,Zh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ln=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vs=/(?:[*+-]|\d{1,9}[.)])/,Ua=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Da=C(Ua).replace(/bull/g,vs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).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/).replace(/\|table/g,"").getRegex(),Xh=C(Ua).replace(/bull/g,vs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),bs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kh=/^[^\n]+/,ys=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jh=C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ys).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ed=C(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,vs).getRegex(),Jn="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",$s=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,td=C("^ {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",$s).replace("tag",Jn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),za=C(bs).replace("hr",ln).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",Jn).getRegex(),nd=C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",za).getRegex(),ws={blockquote:nd,code:Zh,def:Jh,fences:Yh,heading:Qh,hr:ln,html:td,lheading:Da,list:ed,newline:Gh,paragraph:za,table:Ft,text:Kh},$o=C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ln).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",Jn).getRegex(),id={...ws,lheading:Xh,table:$o,paragraph:C(bs).replace("hr",ln).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$o).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",Jn).getRegex()},sd={...ws,html:C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$s).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:Ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:C(bs).replace("hr",ln).replace("heading",` *#{1,6} *[^
791
- ]`).replace("lheading",Da).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,od=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ha=/^( {2,}|\\)\n(?!\s*$)/,ad=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ei=/[\p{P}\p{S}]/u,xs=/[\s\p{P}\p{S}]/u,ja=/[^\s\p{P}\p{S}]/u,ld=C(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xs).getRegex(),Fa=/(?!~)[\p{P}\p{S}]/u,cd=/(?!~)[\s\p{P}\p{S}]/u,ud=/(?:[^\s\p{P}\p{S}]|~)/u,hd=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ba=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dd=C(Ba,"u").replace(/punct/g,ei).getRegex(),pd=C(Ba,"u").replace(/punct/g,Fa).getRegex(),qa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fd=C(qa,"gu").replace(/notPunctSpace/g,ja).replace(/punctSpace/g,xs).replace(/punct/g,ei).getRegex(),gd=C(qa,"gu").replace(/notPunctSpace/g,ud).replace(/punctSpace/g,cd).replace(/punct/g,Fa).getRegex(),md=C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ja).replace(/punctSpace/g,xs).replace(/punct/g,ei).getRegex(),vd=C(/\\(punct)/,"gu").replace(/punct/g,ei).getRegex(),bd=C(/^<(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(),yd=C($s).replace("(?:-->|$)","-->").getRegex(),$d=C("^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",yd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wd=C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Va=C(/^!?\[(label)\]\[(ref)\]/).replace("label",zn).replace("ref",ys).getRegex(),Wa=C(/^!?\[(ref)\](?:\[\])?/).replace("ref",ys).getRegex(),xd=C("reflink|nolink(?!\\()","g").replace("reflink",Va).replace("nolink",Wa).getRegex(),ks={_backpedal:Ft,anyPunctuation:vd,autolink:bd,blockSkip:hd,br:Ha,code:od,del:Ft,emStrongLDelim:dd,emStrongRDelimAst:fd,emStrongRDelimUnd:md,escape:rd,link:wd,nolink:Wa,punctuation:ld,reflink:Va,reflinkSearch:xd,tag:$d,text:ad,url:Ft},kd={...ks,link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",zn).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zn).getRegex()},Yi={...ks,emStrongRDelimAst:gd,emStrongLDelim:pd,url:C(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Sd={...Yi,br:C(Ha).replace("{2,}","*").getRegex(),text:C(Yi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$n={normal:ws,gfm:id,pedantic:sd},Ut={normal:ks,gfm:Yi,breaks:Sd,pedantic:kd},Cd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wo=n=>Cd[n];function ge(n,e){if(e){if(Y.escapeTest.test(n))return n.replace(Y.escapeReplace,wo)}else if(Y.escapeTestNoEncode.test(n))return n.replace(Y.escapeReplaceNoEncode,wo);return n}function xo(n){try{n=encodeURI(n).replace(Y.percentDecode,"%")}catch{return null}return n}function ko(n,e){var r;const t=n.replace(Y.findPipe,(o,a,c)=>{let l=!1,u=a;for(;--u>=0&&c[u]==="\\";)l=!l;return l?"|":" |"}),i=t.split(Y.splitPipe);let s=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(Y.slashPipe,"|");return i}function Dt(n,e,t){const i=n.length;if(i===0)return"";let s=0;for(;s<i&&n.charAt(i-s-1)===e;)s++;return n.slice(0,i-s)}function Ed(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function So(n,e,t,i,s){const r=e.href,o=e.title||null,a=n[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;const c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,c}function _d(n,e,t){const i=n.match(t.other.indentCodeCompensation);if(i===null)return e;const s=i[1];return e.split(`
790
+ `];let Dn=Ds;Wh([k({attribute:!1})],Dn.prototype,"message");function ms(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var nt=ms();function Na(n){nt=n}var Ft={exec:()=>null};function C(n,e=""){let t=typeof n=="string"?n:n.source;const i={replace:(s,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(Y.caret,"$1"),t=t.replace(s,o),i},getRegex:()=>new RegExp(t,e)};return i}var Y={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Gh=/^(?:[ \t]*(?:\n|$))+/,Zh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ln=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vs=/(?:[*+-]|\d{1,9}[.)])/,Ua=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Da=C(Ua).replace(/bull/g,vs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).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/).replace(/\|table/g,"").getRegex(),Xh=C(Ua).replace(/bull/g,vs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),bs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Kh=/^[^\n]+/,ys=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Jh=C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ys).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ed=C(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,vs).getRegex(),Jn="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",$s=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,td=C("^ {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",$s).replace("tag",Jn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ha=C(bs).replace("hr",ln).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",Jn).getRegex(),nd=C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ha).getRegex(),ws={blockquote:nd,code:Zh,def:Jh,fences:Yh,heading:Qh,hr:ln,html:td,lheading:Da,list:ed,newline:Gh,paragraph:Ha,table:Ft,text:Kh},$o=C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ln).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",Jn).getRegex(),id={...ws,lheading:Xh,table:$o,paragraph:C(bs).replace("hr",ln).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$o).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",Jn).getRegex()},sd={...ws,html:C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$s).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:Ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:C(bs).replace("hr",ln).replace("heading",` *#{1,6} *[^
791
+ ]`).replace("lheading",Da).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,od=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,za=/^( {2,}|\\)\n(?!\s*$)/,ad=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ei=/[\p{P}\p{S}]/u,xs=/[\s\p{P}\p{S}]/u,ja=/[^\s\p{P}\p{S}]/u,ld=C(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xs).getRegex(),Fa=/(?!~)[\p{P}\p{S}]/u,cd=/(?!~)[\s\p{P}\p{S}]/u,ud=/(?:[^\s\p{P}\p{S}]|~)/u,hd=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ba=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dd=C(Ba,"u").replace(/punct/g,ei).getRegex(),pd=C(Ba,"u").replace(/punct/g,Fa).getRegex(),qa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fd=C(qa,"gu").replace(/notPunctSpace/g,ja).replace(/punctSpace/g,xs).replace(/punct/g,ei).getRegex(),gd=C(qa,"gu").replace(/notPunctSpace/g,ud).replace(/punctSpace/g,cd).replace(/punct/g,Fa).getRegex(),md=C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ja).replace(/punctSpace/g,xs).replace(/punct/g,ei).getRegex(),vd=C(/\\(punct)/,"gu").replace(/punct/g,ei).getRegex(),bd=C(/^<(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(),yd=C($s).replace("(?:-->|$)","-->").getRegex(),$d=C("^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",yd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,wd=C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Hn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Va=C(/^!?\[(label)\]\[(ref)\]/).replace("label",Hn).replace("ref",ys).getRegex(),Wa=C(/^!?\[(ref)\](?:\[\])?/).replace("ref",ys).getRegex(),xd=C("reflink|nolink(?!\\()","g").replace("reflink",Va).replace("nolink",Wa).getRegex(),ks={_backpedal:Ft,anyPunctuation:vd,autolink:bd,blockSkip:hd,br:za,code:od,del:Ft,emStrongLDelim:dd,emStrongRDelimAst:fd,emStrongRDelimUnd:md,escape:rd,link:wd,nolink:Wa,punctuation:ld,reflink:Va,reflinkSearch:xd,tag:$d,text:ad,url:Ft},kd={...ks,link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",Hn).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hn).getRegex()},Yi={...ks,emStrongRDelimAst:gd,emStrongLDelim:pd,url:C(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Sd={...Yi,br:C(za).replace("{2,}","*").getRegex(),text:C(Yi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$n={normal:ws,gfm:id,pedantic:sd},Ut={normal:ks,gfm:Yi,breaks:Sd,pedantic:kd},Cd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wo=n=>Cd[n];function ge(n,e){if(e){if(Y.escapeTest.test(n))return n.replace(Y.escapeReplace,wo)}else if(Y.escapeTestNoEncode.test(n))return n.replace(Y.escapeReplaceNoEncode,wo);return n}function xo(n){try{n=encodeURI(n).replace(Y.percentDecode,"%")}catch{return null}return n}function ko(n,e){var r;const t=n.replace(Y.findPipe,(o,a,c)=>{let l=!1,u=a;for(;--u>=0&&c[u]==="\\";)l=!l;return l?"|":" |"}),i=t.split(Y.splitPipe);let s=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(Y.slashPipe,"|");return i}function Dt(n,e,t){const i=n.length;if(i===0)return"";let s=0;for(;s<i&&n.charAt(i-s-1)===e;)s++;return n.slice(0,i-s)}function Ed(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function So(n,e,t,i,s){const r=e.href,o=e.title||null,a=n[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;const c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,c}function _d(n,e,t){const i=n.match(t.other.indentCodeCompensation);if(i===null)return e;const s=i[1];return e.split(`
792
792
  `).map(r=>{const o=r.match(t.other.beginningSpace);if(o===null)return r;const[a]=o;return a.length>=s.length?r.slice(s.length):r}).join(`
793
- `)}var Hn=class{constructor(n){_(this,"options");_(this,"rules");_(this,"lexer");this.options=n||nt}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Dt(t,`
793
+ `)}var zn=class{constructor(n){_(this,"options");_(this,"rules");_(this,"lexer");this.options=n||nt}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Dt(t,`
794
794
  `)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],i=_d(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const i=Dt(t,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Dt(e[0],`
795
795
  `)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=Dt(e[0],`
796
796
  `).split(`
@@ -806,13 +806,13 @@ ${u}`:u;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
806
806
  `);continue}}return{type:"blockquote",raw:i,tokens:r,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const i=t.length>1,s={type:"list",raw:"",ordered:i,start:i?+t.slice(0,-1):"",loose:!1,items:[]};t=i?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=i?t:"[*+-]");const r=this.rules.other.listItemRegex(t);let o=!1;for(;n;){let c=!1,l="",u="";if(!(e=r.exec(n))||this.rules.block.hr.test(n))break;l=e[0],n=n.substring(l.length);let p=e[2].split(`
807
807
  `,1)[0].replace(this.rules.other.listReplaceTabs,le=>" ".repeat(3*le.length)),d=n.split(`
808
808
  `,1)[0],g=!p.trim(),m=0;if(this.options.pedantic?(m=2,u=p.trimStart()):g?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=p.slice(m),m+=e[1].length),g&&this.rules.other.blankLine.test(d)&&(l+=d+`
809
- `,n=n.substring(d.length+1),c=!0),!c){const le=this.rules.other.nextBulletRegex(m),Pe=this.rules.other.hrRegex(m),He=this.rules.other.fencesBeginRegex(m),M=this.rules.other.headingBeginRegex(m),je=this.rules.other.htmlBeginRegex(m);for(;n;){const Fe=n.split(`
810
- `,1)[0];let Be;if(d=Fe,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),Be=d):Be=d.replace(this.rules.other.tabCharGlobal," "),He.test(d)||M.test(d)||je.test(d)||le.test(d)||Pe.test(d))break;if(Be.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=`
811
- `+Be.slice(m);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||He.test(p)||M.test(p)||Pe.test(p))break;u+=`
809
+ `,n=n.substring(d.length+1),c=!0),!c){const le=this.rules.other.nextBulletRegex(m),Pe=this.rules.other.hrRegex(m),ze=this.rules.other.fencesBeginRegex(m),M=this.rules.other.headingBeginRegex(m),je=this.rules.other.htmlBeginRegex(m);for(;n;){const Fe=n.split(`
810
+ `,1)[0];let Be;if(d=Fe,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),Be=d):Be=d.replace(this.rules.other.tabCharGlobal," "),ze.test(d)||M.test(d)||je.test(d)||le.test(d)||Pe.test(d))break;if(Be.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=`
811
+ `+Be.slice(m);else{if(g||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ze.test(p)||M.test(p)||Pe.test(p))break;u+=`
812
812
  `+d}!g&&!d.trim()&&(g=!0),l+=Fe+`
813
813
  `,n=n.substring(Fe.length+1),p=Be.slice(m)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(o=!0));let $=null,$e;this.options.gfm&&($=this.rules.other.listIsTask.exec(u),$&&($e=$[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:l,task:!!$,checked:$e,loose:!1,text:u,tokens:[]}),s.raw+=l}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const l=s.items[c].tokens.filter(p=>p.type==="space"),u=l.length>0&&l.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=u}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:s}}}table(n){var o;const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=ko(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
814
814
  `):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(const a of i)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<t.length;a++)r.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:r.align[a]});for(const a of s)r.rows.push(ko(a,r.header.length).map((c,l)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:r.align[l]})));return r}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
815
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const r=Dt(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{const r=Ed(e[2],"()");if(r===-2)return;if(r>-1){const a=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],s="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],s=r[3])}else s=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i=i.slice(1):i=i.slice(1,-1)),So(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[i.toLowerCase()];if(!s){const r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return So(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const r=[...i[0]].length-1;let o,a,c=r,l=0;const u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+r);(i=u.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=[...o].length,i[3]||i[4]){c+=a;continue}else if((i[5]||i[6])&&r%3&&!((r+a)%3)){l+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+l);const p=[...i[0]][0].length,d=n.slice(0,r+i.index+p+a);if(Math.min(r,a)%2){const m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}const g=d.slice(2,-2);return{type:"strong",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let i,s;if(e[2]==="@")i=e[0],s="mailto:"+i;else{let r;do r=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(r!==e[0]);i=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},_e=class Qi{constructor(e){_(this,"tokens");_(this,"options");_(this,"state");_(this,"tokenizer");_(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||nt,this.options.tokenizer=this.options.tokenizer||new Hn,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={other:Y,block:$n.normal,inline:Ut.normal};this.options.pedantic?(t.block=$n.pedantic,t.inline=Ut.pedantic):this.options.gfm&&(t.block=$n.gfm,this.options.breaks?t.inline=Ut.breaks:t.inline=Ut.gfm),this.tokenizer.rules=t}static get rules(){return{block:$n,inline:Ut}}static lex(e,t){return new Qi(t).lex(e)}static lexInline(e,t){return new Qi(t).inlineTokens(e)}lex(e){e=e.replace(Y.carriageReturn,`
815
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const r=Dt(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{const r=Ed(e[2],"()");if(r===-2)return;if(r>-1){const a=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],s="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],s=r[3])}else s=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i=i.slice(1):i=i.slice(1,-1)),So(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[i.toLowerCase()];if(!s){const r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return So(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const r=[...i[0]].length-1;let o,a,c=r,l=0;const u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*n.length+r);(i=u.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=[...o].length,i[3]||i[4]){c+=a;continue}else if((i[5]||i[6])&&r%3&&!((r+a)%3)){l+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+l);const p=[...i[0]][0].length,d=n.slice(0,r+i.index+p+a);if(Math.min(r,a)%2){const m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}const g=d.slice(2,-2);return{type:"strong",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let i,s;if(e[2]==="@")i=e[0],s="mailto:"+i;else{let r;do r=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(r!==e[0]);i=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},_e=class Qi{constructor(e){_(this,"tokens");_(this,"options");_(this,"state");_(this,"tokenizer");_(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||nt,this.options.tokenizer=this.options.tokenizer||new zn,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={other:Y,block:$n.normal,inline:Ut.normal};this.options.pedantic?(t.block=$n.pedantic,t.inline=Ut.pedantic):this.options.gfm&&(t.block=$n.gfm,this.options.breaks?t.inline=Ut.breaks:t.inline=Ut.gfm),this.tokenizer.rules=t}static get rules(){return{block:$n,inline:Ut}}static lex(e,t){return new Qi(t).lex(e)}static lexInline(e,t){return new Qi(t).inlineTokens(e)}lex(e){e=e.replace(Y.carriageReturn,`
816
816
  `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){var s,r,o;for(this.options.pedantic&&(e=e.replace(Y.tabCharGlobal," ").replace(Y.spaceLine,""));e;){let a;if((r=(s=this.options.extensions)==null?void 0:s.block)!=null&&r.some(l=>(a=l.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const l=t.at(-1);a.raw.length===1&&l!==void 0?l.raw+=`
817
817
  `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const l=t.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
818
818
  `+a.raw,l.text+=`
@@ -841,8 +841,8 @@ ${this.parser.parse(n)}</blockquote>
841
841
  ${n}</tr>
842
842
  `}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
843
843
  `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ge(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const i=this.parser.parseInline(t),s=xo(n);if(s===null)return i;n=s;let r='<a href="'+n+'"';return e&&(r+=' title="'+ge(e)+'"'),r+=">"+i+"</a>",r}image({href:n,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));const s=xo(n);if(s===null)return ge(t);n=s;let r=`<img src="${n}" alt="${t}"`;return e&&(r+=` title="${ge(e)}"`),r+=">",r}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ge(n.text)}},Ss=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Ae=class Xi{constructor(e){_(this,"options");_(this,"renderer");_(this,"textRenderer");this.options=e||nt,this.options.renderer=this.options.renderer||new Xt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ss}static parse(e,t){return new Xi(t).parse(e)}static parseInline(e,t){return new Xi(t).parseInline(e)}parse(e,t=!0){var s,r;let i="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[a.type]){const l=a,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){i+=u||"";continue}}const c=a;switch(c.type){case"space":{i+=this.renderer.space(c);continue}case"hr":{i+=this.renderer.hr(c);continue}case"heading":{i+=this.renderer.heading(c);continue}case"code":{i+=this.renderer.code(c);continue}case"table":{i+=this.renderer.table(c);continue}case"blockquote":{i+=this.renderer.blockquote(c);continue}case"list":{i+=this.renderer.list(c);continue}case"html":{i+=this.renderer.html(c);continue}case"paragraph":{i+=this.renderer.paragraph(c);continue}case"text":{let l=c,u=this.renderer.text(l);for(;o+1<e.length&&e[o+1].type==="text";)l=e[++o],u+=`
844
- `+this.renderer.text(l);t?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{const l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,t=this.renderer){var s,r;let i="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[a.type]){const l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=l||"";continue}}const c=a;switch(c.type){case"escape":{i+=t.text(c);break}case"html":{i+=t.html(c);break}case"link":{i+=t.link(c);break}case"image":{i+=t.image(c);break}case"strong":{i+=t.strong(c);break}case"em":{i+=t.em(c);break}case"codespan":{i+=t.codespan(c);break}case"br":{i+=t.br(c);break}case"del":{i+=t.del(c);break}case"text":{i+=t.text(c);break}default:{const l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},Oi,Sn=(Oi=class{constructor(n){_(this,"options");_(this,"block");this.options=n||nt}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?_e.lex:_e.lexInline}provideParser(){return this.block?Ae.parse:Ae.parseInline}},_(Oi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Oi),Ad=class{constructor(...n){_(this,"defaults",ms());_(this,"options",this.setOptions);_(this,"parse",this.parseMarkdown(!0));_(this,"parseInline",this.parseMarkdown(!1));_(this,"Parser",Ae);_(this,"Renderer",Xt);_(this,"TextRenderer",Ss);_(this,"Lexer",_e);_(this,"Tokenizer",Hn);_(this,"Hooks",Sn);this.use(...n)}walkTokens(n,e){var i,s;let t=[];for(const r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{const o=r;for(const a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(const a of o.rows)for(const c of a)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{const o=r;t=t.concat(this.walkTokens(o.items,e));break}default:{const o=r;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const c=o[a].flat(1/0);t=t.concat(this.walkTokens(c,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=e.renderers[s.name];r?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=e[s.level];r?r.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),i.extensions=e),t.renderer){const s=this.defaults.renderer||new Xt(this.defaults);for(const r in t.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const o=r,a=t.renderer[o],c=s[o];s[o]=(...l)=>{let u=a.apply(s,l);return u===!1&&(u=c.apply(s,l)),u||""}}i.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new Hn(this.defaults);for(const r in t.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const o=r,a=t.tokenizer[o],c=s[o];s[o]=(...l)=>{let u=a.apply(s,l);return u===!1&&(u=c.apply(s,l)),u}}i.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new Sn;for(const r in t.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const o=r,a=t.hooks[o],c=s[o];Sn.passThroughHooks.has(r)?s[o]=l=>{if(this.defaults.async)return Promise.resolve(a.call(s,l)).then(p=>c.call(s,p));const u=a.call(s,l);return c.call(s,u)}:s[o]=(...l)=>{let u=a.apply(s,l);return u===!1&&(u=c.apply(s,l)),u}}i.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,r=t.walkTokens;i.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return _e.lex(n,e??this.defaults)}parser(n,e){return Ae.parse(n,e??this.defaults)}parseMarkdown(n){return(t,i)=>{const s={...i},r={...this.defaults,...s},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=n);const a=r.hooks?r.hooks.provideLexer():n?_e.lex:_e.lexInline,c=r.hooks?r.hooks.provideParser():n?Ae.parse:Ae.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(l=>a(l,r)).then(l=>r.hooks?r.hooks.processAllTokens(l):l).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>c(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let l=a(t,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let u=c(l,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(l){return o(l)}}}onError(n,e){return t=>{if(t.message+=`
845
- Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An error occurred:</p><pre>"+ge(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},et=new Ad;function S(n,e){return et.parse(n,e)}S.options=S.setOptions=function(n){return et.setOptions(n),S.defaults=et.defaults,Na(S.defaults),S};S.getDefaults=ms;S.defaults=nt;S.use=function(...n){return et.use(...n),S.defaults=et.defaults,Na(S.defaults),S};S.walkTokens=function(n,e){return et.walkTokens(n,e)};S.parseInline=et.parseInline;S.Parser=Ae;S.parser=Ae.parse;S.Renderer=Xt;S.TextRenderer=Ss;S.Lexer=_e;S.lexer=_e.lex;S.Tokenizer=Hn;S.Hooks=Sn;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;Ae.parse;_e.lex;var Td=Object.defineProperty,Ga=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Td(e,t,s),s};const Za=new Xt;Za.link=function({href:n,title:e,text:t}){return e??(e=t),`<a target="_blank" href="${n}" title="${e}">${t}</a>`};S.use({renderer:Za});const zs=class zs extends A{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=ve(),this.contentRef=ve(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm)}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)})}includesImage(e){return this.imageRegexp.test(e)}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var o,a;const e=this.getLastChunk();if(!e)return;if(this.buffer+=e,this.includesImage(this.buffer))(o=this.contentRef.value)==null||o.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;const t=S.parse(this.buffer),i=Ni(t),s=Ma.sanitize(i,{ADD_ATTR:["target"]}),r=(a=this.contentRef.value)==null?void 0:a.querySelector("div:last-of-type");r&&(r.innerHTML=s,this.applyCodeStyles(r)),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(i=>{i.style.whiteSpace="pre-wrap"})}render(){return y`
844
+ `+this.renderer.text(l);t?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{const l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,t=this.renderer){var s,r;let i="";for(let o=0;o<e.length;o++){const a=e[o];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[a.type]){const l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=l||"";continue}}const c=a;switch(c.type){case"escape":{i+=t.text(c);break}case"html":{i+=t.html(c);break}case"link":{i+=t.link(c);break}case"image":{i+=t.image(c);break}case"strong":{i+=t.strong(c);break}case"em":{i+=t.em(c);break}case"codespan":{i+=t.codespan(c);break}case"br":{i+=t.br(c);break}case"del":{i+=t.del(c);break}case"text":{i+=t.text(c);break}default:{const l='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},Oi,Sn=(Oi=class{constructor(n){_(this,"options");_(this,"block");this.options=n||nt}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?_e.lex:_e.lexInline}provideParser(){return this.block?Ae.parse:Ae.parseInline}},_(Oi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Oi),Ad=class{constructor(...n){_(this,"defaults",ms());_(this,"options",this.setOptions);_(this,"parse",this.parseMarkdown(!0));_(this,"parseInline",this.parseMarkdown(!1));_(this,"Parser",Ae);_(this,"Renderer",Xt);_(this,"TextRenderer",Ss);_(this,"Lexer",_e);_(this,"Tokenizer",zn);_(this,"Hooks",Sn);this.use(...n)}walkTokens(n,e){var i,s;let t=[];for(const r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{const o=r;for(const a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(const a of o.rows)for(const c of a)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{const o=r;t=t.concat(this.walkTokens(o.items,e));break}default:{const o=r;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const c=o[a].flat(1/0);t=t.concat(this.walkTokens(c,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=e.renderers[s.name];r?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=e[s.level];r?r.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),i.extensions=e),t.renderer){const s=this.defaults.renderer||new Xt(this.defaults);for(const r in t.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const o=r,a=t.renderer[o],c=s[o];s[o]=(...l)=>{let u=a.apply(s,l);return u===!1&&(u=c.apply(s,l)),u||""}}i.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new zn(this.defaults);for(const r in t.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const o=r,a=t.tokenizer[o],c=s[o];s[o]=(...l)=>{let u=a.apply(s,l);return u===!1&&(u=c.apply(s,l)),u}}i.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new Sn;for(const r in t.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const o=r,a=t.hooks[o],c=s[o];Sn.passThroughHooks.has(r)?s[o]=l=>{if(this.defaults.async)return Promise.resolve(a.call(s,l)).then(p=>c.call(s,p));const u=a.call(s,l);return c.call(s,u)}:s[o]=(...l)=>{let u=a.apply(s,l);return u===!1&&(u=c.apply(s,l)),u}}i.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,r=t.walkTokens;i.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return _e.lex(n,e??this.defaults)}parser(n,e){return Ae.parse(n,e??this.defaults)}parseMarkdown(n){return(t,i)=>{const s={...i},r={...this.defaults,...s},o=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=n);const a=r.hooks?r.hooks.provideLexer():n?_e.lex:_e.lexInline,c=r.hooks?r.hooks.provideParser():n?Ae.parse:Ae.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(t):t).then(l=>a(l,r)).then(l=>r.hooks?r.hooks.processAllTokens(l):l).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>c(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(o);try{r.hooks&&(t=r.hooks.preprocess(t));let l=a(t,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let u=c(l,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(l){return o(l)}}}onError(n,e){return t=>{if(t.message+=`
845
+ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An error occurred:</p><pre>"+ge(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},et=new Ad;function S(n,e){return et.parse(n,e)}S.options=S.setOptions=function(n){return et.setOptions(n),S.defaults=et.defaults,Na(S.defaults),S};S.getDefaults=ms;S.defaults=nt;S.use=function(...n){return et.use(...n),S.defaults=et.defaults,Na(S.defaults),S};S.walkTokens=function(n,e){return et.walkTokens(n,e)};S.parseInline=et.parseInline;S.Parser=Ae;S.parser=Ae.parse;S.Renderer=Xt;S.TextRenderer=Ss;S.Lexer=_e;S.lexer=_e.lex;S.Tokenizer=zn;S.Hooks=Sn;S.parse=S;S.options;S.setOptions;S.use;S.walkTokens;S.parseInline;Ae.parse;_e.lex;var Td=Object.defineProperty,Ga=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Td(e,t,s),s};const Za=new Xt;Za.link=function({href:n,title:e,text:t}){return e??(e=t),`<a target="_blank" href="${n}" title="${e}">${t}</a>`};S.use({renderer:Za});const Hs=class Hs extends A{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=ve(),this.contentRef=ve(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm)}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)})}includesImage(e){return this.imageRegexp.test(e)}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var o,a;const e=this.getLastChunk();if(!e)return;if(this.buffer+=e,this.includesImage(this.buffer))(o=this.contentRef.value)==null||o.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;const t=S.parse(this.buffer),i=Ni(t),s=Ma.sanitize(i,{ADD_ATTR:["target"]}),r=(a=this.contentRef.value)==null?void 0:a.querySelector("div:last-of-type");r&&(r.innerHTML=s,this.applyCodeStyles(r)),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(i=>{i.style.whiteSpace="pre-wrap"})}render(){return y`
846
846
  <div class="message-type-markdown" ${be(this.contentRef)}>
847
847
  <div></div>
848
848
  </div>
@@ -851,7 +851,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
851
851
  imageUrl="${this.imageUrl}"
852
852
  altText="${this.altText}"
853
853
  />`:null}
854
- `}};zs.styles=[L`
854
+ `}};Hs.styles=[R`
855
855
  :host {
856
856
  box-sizing: border-box;
857
857
  }
@@ -889,7 +889,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
889
889
  height: auto;
890
890
  object-fit: contain;
891
891
  }
892
- `];let Kt=zs;Ga([k({attribute:!1})],Kt.prototype,"message");Ga([T()],Kt.prototype,"showLightbox");var Od=Object.defineProperty,Ld=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Od(e,t,s),s};const Hs=class Hs extends A{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 i=t[0],s=t[t.length-1];e.shiftKey?e.target===i&&(s.focus(),e.preventDefault()):e.target===s&&(i.focus(),e.preventDefault())}}}render(){return y`<div
892
+ `];let Kt=Hs;Ga([k({attribute:!1})],Kt.prototype,"message");Ga([T()],Kt.prototype,"showLightbox");var Od=Object.defineProperty,Rd=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Od(e,t,s),s};const zs=class zs extends A{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 i=t[0],s=t[t.length-1];e.shiftKey?e.target===i&&(s.focus(),e.preventDefault()):e.target===s&&(i.focus(),e.preventDefault())}}}render(){return y`<div
893
893
  class="lightbox"
894
894
  tabindex="-1"
895
895
  @keydown=${this.handleKeyDown}
@@ -898,7 +898,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
898
898
  <telia-icon svg=${qc.svg} size="lg"></telia-icon>
899
899
  </button>
900
900
  <img src="${this.imageUrl}" alt="${this.altText??""}" />
901
- </div> `}};Hs.styles=[L`
901
+ </div> `}};zs.styles=[R`
902
902
  :focus {
903
903
  outline-color: var(--focus-color);
904
904
  }
@@ -936,7 +936,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
936
936
  width: 80%;
937
937
  max-width: 700px;
938
938
  }
939
- `];let jn=Hs;Ld([k({attribute:!0})],jn.prototype,"imageUrl");var Rd=Object.defineProperty,pe=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Rd(e,t,s),s};customElements.get("conversation-entry")||customElements.define("conversation-entry",Yt);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",Qt);customElements.get("conversation-group")||customElements.define("conversation-group",Un);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",Vi);customElements.get("message-type-html")||customElements.define("message-type-html",Dn);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",Kt);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",jn);const Co=Ca(A),js=class js extends Co{constructor(){super(...arguments),this.platform=null,this.entries=[],this.typing=!1,this.message="",this.disabledInput=!1,this.disabledSkipToLatest=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.showAuthBanner=!1,this.authenticated=!1,this.isMuted=!1,this.conversationContentRef=ve(),this.conversationFeedRef=ve(),this.formRef=ve(),this.inputRef=ve(),this.scrollRef=ve(),this.counterRef=ve(),this.chatCurrentScrollPosition=0,this.toast=new gh(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.conversationState$=new he("waiting"),this.stateMachine=new vh(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(Oe(e=>e?e==null?void 0:e.provider$:Ii(null))),this.userTyping$=new P}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(z(t.componentIsDestroyed$)).subscribe(i=>{const s=this.conversationContentRef.value;s&&(i?s.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=s.scrollTop)}),this.stateSubscription=ic([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([i,s])=>{this.entries=i,this.typing=s}),this.userSubmitSubscription=An(this,"user-submit").pipe(Mi(this.provider$)).subscribe(([i,s])=>{s&&s.onUserSubmit(i.detail)}),this.addHeaderOptions(),this.provider$.pipe(Mi(this.provider$)).subscribe(([i,s])=>{s&&s.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}firstUpdated(){this.isMuted=this.application.storage.get("muteAudioNotifications")??!1}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.userSubmitSubscription)==null||e.unsubscribe(),(t=this.stateSubscription)==null||t.unsubscribe()}actionHandler(e){}isTypingState(){var t,i;const e=(i=(t=this.conversationFeedRef.value)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector(".conversation-feed");if(e){const s=e.lastElementChild;if(s&&s.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;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var t;return(t=this.scrollRef.value)==null?void 0:t.scrollIntoView({behavior:"smooth"})},300),this.chatCurrentScrollPosition=(e=this.scrollRef.value)==null?void 0:e.scrollTop)}onSessionUpdated(){this.scrollToBottom()}async onSendMessage(e){var i,s;if(e.preventDefault(),this.message.length<=0||this.message.length>this.messageMaxLength){(i=this.formRef.value)==null||i.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,(s=this.counterRef.value)==null||s.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,i=t.getOrFallback("conversation.mute","Mute"),s=t.getOrFallback("conversation.unmute","Unmute"),r=e.addOption({label:this.isMuted?s:i,icon:this.isMuted?Hr.svg:jr.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{this.isMuted?(this.isMuted=!1,this.application.unmute(),r.updateLabel(i),r.updateIcon(jr.svg)):(this.isMuted=!0,this.application.mute(),r.updateLabel(s),r.updateIcon(Hr.svg))}})}inputHandler(e){var t,i;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"):(i=this.counterRef.value)==null||i.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())}getAuthBannerMessage(){const e=this.application.texts;return this.authenticated?e.getOrFallback("conversation.auth-banner.authenticated","Authenticated"):e.getOrFallback("conversation.auth-banner.unauthenticated","Not authenticated")}disableInput(){this.disabledInput=!0,this.message=""}enableInput(){this.disabledInput=!1}enableSkipToLatestMessage(){this.disabledSkipToLatest=!1}disableSkipToLatestMessage(){this.disabledSkipToLatest=!0}disableSubmit(){this.disabledSubmit=!0}enableSubmit(){this.disabledSubmit=!1}clearMessages(){var s,r;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("ace-conversation-feed"),t=(r=e==null?void 0:e.shadowRoot)==null?void 0:r.querySelector(".conversation-feed"),i=t==null?void 0:t.querySelectorAll(".conversation-entry");i==null||i.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}skipToLatestMessage(){var i,s;const e=(i=this.conversationFeedRef)==null?void 0:i.value,t=(s=e==null?void 0:e.shadowRoot)==null?void 0:s.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}setAuthenticationBannerStatus(e){this.showAuthBanner=e!==null,this.authenticated=e===Z.Authenticated}handover(e,t){this.enableInput(),this.setToastMessage(null);const i=new CustomEvent("handover",{detail:{providerKey:e,providerOptions:t}});return this.dispatchEvent(i),i.detail.complete||tt}render(){var s,r,o;const e=this.application.texts;this.conversationState$.value==="waiting"&&((s=this.application)!=null&&s.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%"),y` <div class="conversation-container">
939
+ `];let jn=zs;Rd([k({attribute:!0})],jn.prototype,"imageUrl");var Ld=Object.defineProperty,pe=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Ld(e,t,s),s};customElements.get("conversation-entry")||customElements.define("conversation-entry",Yt);customElements.get("ace-conversation-feed")||customElements.define("ace-conversation-feed",Qt);customElements.get("conversation-group")||customElements.define("conversation-group",Un);customElements.get("ace-typing-state")||customElements.define("ace-typing-state",Vi);customElements.get("message-type-html")||customElements.define("message-type-html",Dn);customElements.get("message-type-markdown")||customElements.define("message-type-markdown",Kt);customElements.get("ace-lightbox")||customElements.define("ace-lightbox",jn);const Co=Ca(A),js=class js extends Co{constructor(){super(...arguments),this.platform=null,this.entries=[],this.typing=!1,this.message="",this.disabledInput=!1,this.disabledSkipToLatest=!1,this.disabledSubmit=!1,this.chatOverlayActive=!1,this.textAreaLength=0,this.showAuthBanner=!1,this.authenticated=!1,this.isMuted=!1,this.isKeyboardNavigation=!1,this.conversationContentRef=ve(),this.conversationFeedRef=ve(),this.formRef=ve(),this.inputRef=ve(),this.scrollRef=ve(),this.counterRef=ve(),this.chatCurrentScrollPosition=0,this.toast=new gh(this),this.messageMaxLength=1e3,this.messageMaxLengthLabel="Maximum character limit reached",this.skipToLatestMessageLabel="Skip to latest message",this.conversationState$=new he("waiting"),this.stateMachine=new vh(this.conversationState$,this),this.provider$=this.stateMachine.session().pipe(Oe(e=>e?e==null?void 0:e.provider$:Ii(null))),this.userTyping$=new P}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(H(t.componentIsDestroyed$)).subscribe(i=>{const s=this.conversationContentRef.value;s&&(i?s.scrollTop=this.chatCurrentScrollPosition:this.chatCurrentScrollPosition=s.scrollTop)}),this.stateSubscription=ic([this.stateMachine.entries(),this.stateMachine.isTyping()]).subscribe(([i,s])=>{this.entries=i,this.typing=s}),this.userSubmitSubscription=An(this,"user-submit").pipe(Mi(this.provider$)).subscribe(([i,s])=>{s&&s.onUserSubmit(i.detail)}),this.addHeaderOptions(),this.provider$.pipe(Mi(this.provider$)).subscribe(([i,s])=>{s&&s.showChatOverlay$.pipe().subscribe(r=>{this.chatOverlayActive=r})})}firstUpdated(){this.isMuted=this.application.storage.get("muteAudioNotifications")??!1}disconnectedCallback(){var e,t;super.disconnectedCallback(),(e=this.userSubmitSubscription)==null||e.unsubscribe(),(t=this.stateSubscription)==null||t.unsubscribe()}actionHandler(e){}isTypingState(){var t,i;const e=(i=(t=this.conversationFeedRef.value)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector(".conversation-feed");if(e){const s=e.lastElementChild;if(s&&s.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;(!this.isTypingState()||this.isAtBottom())&&(setTimeout(()=>{var t;return(t=this.scrollRef.value)==null?void 0:t.scrollIntoView({behavior:"smooth"})},300),this.chatCurrentScrollPosition=(e=this.scrollRef.value)==null?void 0:e.scrollTop)}onSessionUpdated(){this.scrollToBottom()}async onSendMessage(e){var i,s;if(e.preventDefault(),this.message.length<=0||this.message.length>this.messageMaxLength){(i=this.formRef.value)==null||i.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,(s=this.counterRef.value)==null||s.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,i=t.getOrFallback("conversation.mute","Mute"),s=t.getOrFallback("conversation.unmute","Unmute"),r=e.addOption({label:this.isMuted?s:i,icon:this.isMuted?zr.svg:jr.svg,closeOnClick:!1,datatestid:"options-mute-button",onClick:()=>{this.isMuted?(this.isMuted=!1,this.application.unmute(),r.updateLabel(i),r.updateIcon(jr.svg)):(this.isMuted=!0,this.application.mute(),r.updateLabel(s),r.updateIcon(zr.svg))}})}inputHandler(e){var t,i;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"):(i=this.counterRef.value)==null||i.classList.remove("max-char-count-reached")}keyDownHandler(e){this.userTyping$.next(e.key),e.key==="Tab"&&(this.isKeyboardNavigation=!0),e.key==="Enter"&&!e.shiftKey&&!this.disabledSubmit&&(this.onSendMessage(e),e.preventDefault())}mouseDownHandler(e){e.target===this.inputRef.value&&(this.isKeyboardNavigation=!1)}focusHandler(){this.isKeyboardNavigation&&this.inputRef.value&&this.inputRef.value.classList.add("keyboard-focused")}blurHandler(){this.inputRef.value&&this.inputRef.value.classList.remove("keyboard-focused")}getAuthBannerMessage(){const e=this.application.texts;return this.authenticated?e.getOrFallback("conversation.auth-banner.authenticated","Authenticated"):e.getOrFallback("conversation.auth-banner.unauthenticated","Not authenticated")}disableInput(){this.disabledInput=!0,this.message=""}enableInput(){this.disabledInput=!1}enableSkipToLatestMessage(){this.disabledSkipToLatest=!1}disableSkipToLatestMessage(){this.disabledSkipToLatest=!0}disableSubmit(){this.disabledSubmit=!0}enableSubmit(){this.disabledSubmit=!1}clearMessages(){var s,r;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("ace-conversation-feed"),t=(r=e==null?void 0:e.shadowRoot)==null?void 0:r.querySelector(".conversation-feed"),i=t==null?void 0:t.querySelectorAll(".conversation-entry");i==null||i.forEach(o=>o.remove())}setToastMessage(e){this.toast.message=e}skipToLatestMessage(){var i,s;const e=(i=this.conversationFeedRef)==null?void 0:i.value,t=(s=e==null?void 0:e.shadowRoot)==null?void 0:s.querySelectorAll(".conversation-entry");t.length&&Array.from(t).pop().focus()}setAuthenticationBannerStatus(e){this.showAuthBanner=e!==null,this.authenticated=e===Z.Authenticated}handover(e,t){this.enableInput(),this.setToastMessage(null);const i=new CustomEvent("handover",{detail:{providerKey:e,providerOptions:t}});return this.dispatchEvent(i),i.detail.complete||tt}render(){var s,r,o;const e=this.application.texts;this.conversationState$.value==="waiting"&&((s=this.application)!=null&&s.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%"),y` <div class="conversation-container">
940
940
  ${this.showAuthBanner?y`<div
941
941
  class="auth-banner ${this.authenticated?"auth-banner--authenticated":"auth-banner--unauthenticated"}"
942
942
  role="status"
@@ -994,6 +994,9 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
994
994
  .value=${this.message}
995
995
  @input=${this.inputHandler}
996
996
  @keydown=${this.keyDownHandler}
997
+ @mousedown=${this.mouseDownHandler}
998
+ @focus=${this.focusHandler}
999
+ @blur=${this.blurHandler}
997
1000
  ${be(this.inputRef)}
998
1001
  aria-valuenow=${this.textAreaLength}
999
1002
  aria-valuemax=${this.messageMaxLength}
@@ -1025,7 +1028,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1025
1028
  ${this.skipToLatestMessageLabel}
1026
1029
  </button>`}
1027
1030
  </div>
1028
- </div>`}};js.styles=[Co.styles||[],L`
1031
+ </div>`}};js.styles=[Co.styles||[],R`
1029
1032
  /* ===== HOST & GLOBAL STYLES ===== */
1030
1033
  :host {
1031
1034
  font-family: var(--font-family);
@@ -1262,14 +1265,26 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1262
1265
  font-size: inherit;
1263
1266
  flex: 1;
1264
1267
  height: var(--textarea-default-height);
1265
- outline: none;
1266
1268
  resize: none;
1267
1269
  background-color: transparent;
1268
1270
  max-height: 150px;
1269
1271
  overflow-y: auto;
1272
+ outline-offset: 2px;
1270
1273
  color: var(--input-text-color);
1271
1274
  }
1272
1275
 
1276
+ /* Remove all focus outlines by default */
1277
+ textarea:focus {
1278
+ outline: none;
1279
+ }
1280
+
1281
+ /* Only show focus outline when keyboard-focused class is present */
1282
+ textarea.keyboard-focused {
1283
+ outline: 2px solid var(--focus-color);
1284
+ border-radius: 2px;
1285
+ transition: outline-color 300ms ease;
1286
+ }
1287
+
1273
1288
  /* ===== SCROLLBAR STYLES ===== */
1274
1289
  [part='scroll-container'] {
1275
1290
  scrollbar-width: thin;
@@ -1352,7 +1367,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1352
1367
  width: 100%;
1353
1368
  }
1354
1369
  }
1355
- `];let ne=js;pe([T()],ne.prototype,"platform");pe([T()],ne.prototype,"entries");pe([T()],ne.prototype,"typing");pe([T()],ne.prototype,"message");pe([T()],ne.prototype,"disabledInput");pe([T()],ne.prototype,"disabledSkipToLatest");pe([T()],ne.prototype,"disabledSubmit");pe([T()],ne.prototype,"chatOverlayActive");pe([T()],ne.prototype,"textAreaLength");pe([T()],ne.prototype,"showAuthBanner");pe([T()],ne.prototype,"authenticated");var Te=(n=>(n.Tunnistus="tunnistus",n.BankId="bankid",n.Freja="freja",n))(Te||{}),H=(n=>(n.Pending="pending",n.Authenticated="authenticated",n.Error="error",n))(H||{});class Bt{constructor(e){this.orderRef="",e={...e,idHubEidType:typeof(e==null?void 0:e.idHubEidType)=="string"?e.idHubEidType.toLowerCase():e.idHubEidType},this.config=e,this.url=`${e==null?void 0:e.idHubUrl}/${e==null?void 0:e.idHubCustomerKey}/${e==null?void 0:e.idHubOrgKey}/${e==null?void 0:e.idHubEidType}`,this.maxRetries=e.idHubMaxRetries??300}async auth(){try{const e=await fetch(`${this.url}/auth`,{headers:Bt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",register:{clientType:"ACEWIDGET",agentId:"ACEWIDGET",userName:"ACEWIDGET"}}),method:"POST"});if(!e.ok)return{status:H.Error,errorMessage:`Auth failed with response: ${e.status} ${e.statusText}`};const t=await e.json();switch(this.orderRef=t.orderRef,this.config.idHubEidType){case Te.Tunnistus:return{tunnistusURL:t.tunnistusURL,status:H.Pending};case Te.BankId:return{autoStartToken:t.autoStartToken,status:H.Pending};case Te.Freja:throw new Error(`${Te.Freja} is not implemented`);default:throw new Error(`The service ${this.config.idHubEidType} is not implemented`)}}catch(e){return{status:H.Error,errorMessage:`Auth failed. Error: ${e}`}}}async collect(){for(let e=0;e<this.maxRetries;e++){await new Promise(i=>setTimeout(i,1e3));const t=await this.collectOnce();if(t&&t.status!==H.Pending)return t}return{status:H.Error}}async cancel(){try{return this.orderRef?(await fetch(`${this.url}/cancel`,{headers:Bt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"}),{}):{status:H.Error,errorMessage:"Missing order reference."}}catch(e){return{status:H.Error,errorMessage:`Cancel failed. Error: ${e}`}}}static getHeaders(){return{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"}}async collectOnce(){try{if(!this.orderRef)return{status:H.Error,errorMessage:"Missing order reference."};const e=await fetch(`${this.url}/collect`,{headers:Bt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"});if(!e.ok)return{status:H.Error,errorMessage:`Collect failed with response: ${e.status} ${e.statusText}`};const t=await e.json();return t.status===H.Error?{status:H.Error,subStatus:t.subStatus??void 0}:t}catch(e){return{status:H.Error,errorMessage:`Collect failed. Error: ${e}`}}}}const Ce=n=>n.objectType==="info",Id=n=>n.objectType==="chatEntry",Pd=n=>n.objectType==="pen",Md=n=>n.objectType==="chatButtonClicked",Nd=n=>n.objectType==="endVideoButtonClicked",Ud=n=>n.type==="queue-status",Dd=n=>n.type==="established",zd=n=>n.type==="pen-status",Hd=n=>n.type==="prepareVideo",jd=n=>n.type==="videoPrepared",Fd=n=>n.type==="chatButtonClicked",Bd=n=>n.type==="endVideoButtonClicked",qd=n=>n.type==="chat-ended";var Ze=(n=>(n.Initial="initial",n.Error="error",n.Retry="retry",n))(Ze||{});class Fn extends Error{constructor(e){super(e),this.name="EngineException"}}class Cs{constructor(e,t){this.endpoint=e,this.timeout=t,this.protocolVersion="A",this.penStatusJustSent=!1}async chatJoin(e){var i,s,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(!((i=t==null?void 0:t.dataObjects)!=null&&i.length)||((s=t==null?void 0:t.dataObjects[0])==null?void 0:s.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 i,s,r,o,a;const t=await this.sendRequest("chatRequest",{...e.customData,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:((i=window==null?void 0:window.navigator)==null?void 0:i.userAgent)||"",sourceUrl:((s=window==null?void 0:window.location)==null?void 0:s.href)||"",...e.authToken&&{authToken:e.authToken}});if(!((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 i;const t=await this.sendRequest("chatCheckSession",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion});return Object.keys(t).length===0?null:((i=t.dataObjects)==null||i.sort((s,r)=>s.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 i=this.endpoint.includes("engine-simulator")?"include":void 0,s=`${Cs.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(s,{body:new URLSearchParams(t),method:"POST",credentials:i,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 Vd=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),Ki=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Vd();function Ji(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)}function Ya(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Wd(n){return decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}class Gd{constructor(e,t){this.config=e,this.messageSubject$=new P,this.actionsSubject$=new P,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t??Ki(),this.client=new Cs(this.config.engineUrl,this.config.engineTimeout)}chatJoin(e){return Ye(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(Pi(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new j)),Oe(()=>this.poll().pipe(mi(()=>this.poll()),vi())))}chatRequest(e){return Ye(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:e.errand,videoChatMode:this.config.videoChatMode,customData:e.customData,...e.authToken&&{authToken:e.authToken}})).pipe(Pi(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new j)),Oe(()=>this.poll().pipe(mi(()=>this.poll()),vi())))}reconnect(){return this.poll().pipe(mi(()=>this.poll()),vi())}poll(){return ac(()=>Ye(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(gc(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}),i=((t==null?void 0:t.dataObjects)||[]).find(s=>Ce(s)&&s.infoType==="error");if(i)throw new Fn(i.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(s=>Ce(s)&&s.infoType==="error"))throw new Fn("Unable to send email with conversation")}processMessages(e){e.dataObjects.forEach(t=>{Id(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias||t.agentAlias}),Pd(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),Ce(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),Ce(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agentAlias:t.agentAlias,type:"established",videoEnded:t.videoEnded,contactId:t.contactId,agentUsername:t.agentUsername,entrance:t.entrance,errand:t.errand}),Ce(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),Ce(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),Md(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Nd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),Ce(t)&&["afterChat","finished"].includes(t.infoType)&&this.actionsSubject$.next({text:t.text,type:"chat-ended",showForm:t.infoType==="afterChat",contactId:t.contactId})}),this.lastObjectId=e.maxObjectId}async getChatStatus(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});if(!e)return"noSession";const t=e.dataObjects;for(const i of t)if(Ce(i))switch(i.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||(e.dataObjects||[]).find(t=>Ce(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}class Ne{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return Ne.instance?Ne.instance.updateHost(e):Ne.instance=new Ne(e),Ne.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 Zd=Object.defineProperty,Et=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Zd(e,t,s),s},bt;let it=(bt=class extends A{constructor(){super(),this.submitted=!1,this.customData=[],this.customerName="",this.validationErrors=[],this.showValidationWarning=!1,this.emailController=Ne.getInstance(this),this.emailController.clearData()}connectedCallback(){var i,s;super.connectedCallback();const e=this.application.settings.components.conversation,t=((s=(i=e==null?void 0:e.properties)==null?void 0:i.chat)==null?void 0:s.customData)??[];this.customData=t.map(r=>{let o;switch(r.entryType){case"text":case"dropdown":o="";break;case"number":o=0;break;case"boolean":o=!1;break}return{...r,value:o}})}_onStartChat(e){if(e.preventDefault(),this.showValidationWarning=!1,this.customData.forEach(l=>{this.validateCustomDataEntry(l)}),this.validationErrors.length>0){this.showValidationWarning=!0;return}this.submitted=!0;const t=this.customData.find(l=>l.name==="customerEmailAddress");t&&(this.emailController.email=t.value);const i=this.customData.reduce((l,u)=>(l[u.name]=u.value,l),{}),{customerName:s,customerEmailAddress:r,visitorQuestion:o,...a}=i,c=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:s,email:r,question:o,customData:a}}});this.dispatchEvent(c)}_customDataValueChanged(e,t){this.customData=this.customData.map(i=>(i.name===t.name&&(i.value=e),i))}validateCustomDataEntry(e){let t=!1;e.name==="customerEmailAddress"&&e.value&&(Ji(e.value)||(t=!0)),e.required&&!e.value&&(t=!0),t?this.validationErrors.includes(e.name)||this.validationErrors.push(e.name):this.validationErrors=this.validationErrors.filter(i=>i!==e.name)}render(){if(this.submitted)return w;const e=this.application.texts;return y`<div class="container">
1370
+ `];let ne=js;pe([T()],ne.prototype,"platform");pe([T()],ne.prototype,"entries");pe([T()],ne.prototype,"typing");pe([T()],ne.prototype,"message");pe([T()],ne.prototype,"disabledInput");pe([T()],ne.prototype,"disabledSkipToLatest");pe([T()],ne.prototype,"disabledSubmit");pe([T()],ne.prototype,"chatOverlayActive");pe([T()],ne.prototype,"textAreaLength");pe([T()],ne.prototype,"showAuthBanner");pe([T()],ne.prototype,"authenticated");var Te=(n=>(n.Tunnistus="tunnistus",n.BankId="bankid",n.Freja="freja",n))(Te||{}),z=(n=>(n.Pending="pending",n.Authenticated="authenticated",n.Error="error",n))(z||{});class Bt{constructor(e){this.orderRef="",e={...e,idHubEidType:typeof(e==null?void 0:e.idHubEidType)=="string"?e.idHubEidType.toLowerCase():e.idHubEidType},this.config=e,this.url=`${e==null?void 0:e.idHubUrl}/${e==null?void 0:e.idHubCustomerKey}/${e==null?void 0:e.idHubOrgKey}/${e==null?void 0:e.idHubEidType}`,this.maxRetries=e.idHubMaxRetries??300}async auth(){try{const e=await fetch(`${this.url}/auth`,{headers:Bt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",register:{clientType:"ACEWIDGET",agentId:"ACEWIDGET",userName:"ACEWIDGET"}}),method:"POST"});if(!e.ok)return{status:z.Error,errorMessage:`Auth failed with response: ${e.status} ${e.statusText}`};const t=await e.json();switch(this.orderRef=t.orderRef,this.config.idHubEidType){case Te.Tunnistus:return{tunnistusURL:t.tunnistusURL,status:z.Pending};case Te.BankId:return{autoStartToken:t.autoStartToken,status:z.Pending};case Te.Freja:throw new Error(`${Te.Freja} is not implemented`);default:throw new Error(`The service ${this.config.idHubEidType} is not implemented`)}}catch(e){return{status:z.Error,errorMessage:`Auth failed. Error: ${e}`}}}async collect(){for(let e=0;e<this.maxRetries;e++){await new Promise(i=>setTimeout(i,1e3));const t=await this.collectOnce();if(t&&t.status!==z.Pending)return t}return{status:z.Error}}async cancel(){try{return this.orderRef?(await fetch(`${this.url}/cancel`,{headers:Bt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"}),{}):{status:z.Error,errorMessage:"Missing order reference."}}catch(e){return{status:z.Error,errorMessage:`Cancel failed. Error: ${e}`}}}static getHeaders(){return{accept:"application/json","accept-language":"sv-SE,sv;q=0.9,en-US;q=0.8,en;q=0.7","content-type":"application/json"}}async collectOnce(){try{if(!this.orderRef)return{status:z.Error,errorMessage:"Missing order reference."};const e=await fetch(`${this.url}/collect`,{headers:Bt.getHeaders(),body:JSON.stringify({clientName:"idhub-web-1.0.0",orderRef:this.orderRef,method:"auth"}),method:"POST"});if(!e.ok)return{status:z.Error,errorMessage:`Collect failed with response: ${e.status} ${e.statusText}`};const t=await e.json();return t.status===z.Error?{status:z.Error,subStatus:t.subStatus??void 0}:t}catch(e){return{status:z.Error,errorMessage:`Collect failed. Error: ${e}`}}}}const Ce=n=>n.objectType==="info",Id=n=>n.objectType==="chatEntry",Pd=n=>n.objectType==="pen",Md=n=>n.objectType==="chatButtonClicked",Nd=n=>n.objectType==="endVideoButtonClicked",Ud=n=>n.type==="queue-status",Dd=n=>n.type==="established",Hd=n=>n.type==="pen-status",zd=n=>n.type==="prepareVideo",jd=n=>n.type==="videoPrepared",Fd=n=>n.type==="chatButtonClicked",Bd=n=>n.type==="endVideoButtonClicked",qd=n=>n.type==="chat-ended";var Ze=(n=>(n.Initial="initial",n.Error="error",n.Retry="retry",n))(Ze||{});class Fn extends Error{constructor(e){super(e),this.name="EngineException"}}class Cs{constructor(e,t){this.endpoint=e,this.timeout=t,this.protocolVersion="A",this.penStatusJustSent=!1}async chatJoin(e){var i,s,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(!((i=t==null?void 0:t.dataObjects)!=null&&i.length)||((s=t==null?void 0:t.dataObjects[0])==null?void 0:s.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 i,s,r,o,a;const t=await this.sendRequest("chatRequest",{...e.customData,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:((i=window==null?void 0:window.navigator)==null?void 0:i.userAgent)||"",sourceUrl:((s=window==null?void 0:window.location)==null?void 0:s.href)||"",...e.authToken&&{authToken:e.authToken}});if(!((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 i;const t=await this.sendRequest("chatCheckSession",{uid:e.uid,instance:e.instance,protocolVersion:this.protocolVersion});return Object.keys(t).length===0?null:((i=t.dataObjects)==null||i.sort((s,r)=>s.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 i=this.endpoint.includes("engine-simulator")?"include":void 0,s=`${Cs.removeTrailingSlashes(this.endpoint)}/${e}`,r=await fetch(s,{body:new URLSearchParams(t),method:"POST",credentials:i,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 Vd=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+n/4).toString(16)),Ki=()=>typeof crypto.randomUUID=="function"?crypto.randomUUID():Vd();function Ji(n){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)}function Ya(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Wd(n){return decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""))}class Gd{constructor(e,t){this.config=e,this.messageSubject$=new P,this.actionsSubject$=new P,this.messages=()=>this.messageSubject$.asObservable(),this.actions=()=>this.actionsSubject$.asObservable(),this.sessionId="",this.lastObjectId=0,this.sessionId=t??Ki(),this.client=new Cs(this.config.engineUrl,this.config.engineTimeout)}chatJoin(e){return Ye(this.client.chatJoin({invitationUid:e.invitationUid,uid:this.sessionId,customerName:e.customerName,instance:this.config.instance,videoChatMode:this.config.videoChatMode})).pipe(Pi(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new j)),Oe(()=>this.poll().pipe(mi(()=>this.poll()),vi())))}chatRequest(e){return Ye(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:e.errand,videoChatMode:this.config.videoChatMode,customData:e.customData,...e.authToken&&{authToken:e.authToken}})).pipe(Pi(t=>(console.error(t),this.messageSubject$.next({text:this.config.errorMessage??"An error occured",source:"system"}),new j)),Oe(()=>this.poll().pipe(mi(()=>this.poll()),vi())))}reconnect(){return this.poll().pipe(mi(()=>this.poll()),vi())}poll(){return ac(()=>Ye(this.client.chatRead({uid:this.sessionId,instance:this.config.instance,entrance:this.config.entrance,maxObjectId:this.lastObjectId})).pipe(gc(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}),i=((t==null?void 0:t.dataObjects)||[]).find(s=>Ce(s)&&s.infoType==="error");if(i)throw new Fn(i.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(s=>Ce(s)&&s.infoType==="error"))throw new Fn("Unable to send email with conversation")}processMessages(e){e.dataObjects.forEach(t=>{Id(t)&&t.source&&t.objectId>=this.lastObjectId&&this.messageSubject$.next({text:t.message,source:t.source,invitationNo:t.invitationNo.toString(),alias:t.alias||t.agentAlias}),Pd(t)&&this.actionsSubject$.next({penStatus:t.penStatus,type:"pen-status"}),Ce(t)&&t.infoType==="queue"&&this.actionsSubject$.next({text:t.text,type:"queue-status"}),Ce(t)&&t.infoType==="established"&&this.actionsSubject$.next({text:t.text,agentAlias:t.agentAlias,type:"established",videoEnded:t.videoEnded,contactId:t.contactId,agentUsername:t.agentUsername,entrance:t.entrance,errand:t.errand}),Ce(t)&&t.infoType==="prepareVideo"&&this.actionsSubject$.next({type:"prepareVideo"}),Ce(t)&&t.infoType==="videoPrepared"&&this.actionsSubject$.next({text:t.text,agent:t.agent,type:"videoPrepared",userUrl:t.userUrl}),Md(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"chatButtonClicked"}),Nd(t)&&this.actionsSubject$.next({guestId:t.guestId,type:"endVideoButtonClicked"}),Ce(t)&&["afterChat","finished"].includes(t.infoType)&&this.actionsSubject$.next({text:t.text,type:"chat-ended",showForm:t.infoType==="afterChat",contactId:t.contactId})}),this.lastObjectId=e.maxObjectId}async getChatStatus(){const e=await this.client.chatCheckSession({uid:this.sessionId,instance:this.config.instance});if(!e)return"noSession";const t=e.dataObjects;for(const i of t)if(Ce(i))switch(i.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||(e.dataObjects||[]).find(t=>Ce(t)&&t.infoType==="noSession")?null:(this.processMessages(e),e)}}class Ne{constructor(e){this._email="",this._host=e,e.addController(this)}static getInstance(e){return Ne.instance?Ne.instance.updateHost(e):Ne.instance=new Ne(e),Ne.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 Zd=Object.defineProperty,Et=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&Zd(e,t,s),s},bt;let it=(bt=class extends A{constructor(){super(),this.submitted=!1,this.customData=[],this.customerName="",this.validationErrors=[],this.showValidationWarning=!1,this.emailController=Ne.getInstance(this),this.emailController.clearData()}connectedCallback(){var i,s;super.connectedCallback();const e=this.application.settings.components.conversation,t=((s=(i=e==null?void 0:e.properties)==null?void 0:i.chat)==null?void 0:s.customData)??[];this.customData=t.map(r=>{let o;switch(r.entryType){case"text":case"dropdown":o="";break;case"number":o=0;break;case"boolean":o=!1;break}return{...r,value:o}})}_onStartChat(e){if(e.preventDefault(),this.showValidationWarning=!1,this.customData.forEach(l=>{this.validateCustomDataEntry(l)}),this.validationErrors.length>0){this.showValidationWarning=!0;return}this.submitted=!0;const t=this.customData.find(l=>l.name==="customerEmailAddress");t&&(this.emailController.email=t.value);const i=this.customData.reduce((l,u)=>(l[u.name]=u.value,l),{}),{customerName:s,customerEmailAddress:r,visitorQuestion:o,...a}=i,c=new CustomEvent("action",{bubbles:!0,composed:!0,detail:{key:"submitted",data:{name:s,email:r,question:o,customData:a}}});this.dispatchEvent(c)}_customDataValueChanged(e,t){this.customData=this.customData.map(i=>(i.name===t.name&&(i.value=e),i))}validateCustomDataEntry(e){let t=!1;e.name==="customerEmailAddress"&&e.value&&(Ji(e.value)||(t=!0)),e.required&&!e.value&&(t=!0),t?this.validationErrors.includes(e.name)||this.validationErrors.push(e.name):this.validationErrors=this.validationErrors.filter(i=>i!==e.name)}render(){if(this.submitted)return w;const e=this.application.texts;return y`<div class="container">
1356
1371
  <form class="form" @submit=${this._onStartChat}>
1357
1372
  <div class="header-row">
1358
1373
  <telia-icon class="header-icon" svg=${ea.svg}></telia-icon>
@@ -1387,7 +1402,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1387
1402
  ${e.getOrFallback("welcome-form.submit-button","Start chat")}
1388
1403
  </button>
1389
1404
  </form>
1390
- </div>`}},bt.styles=[L`
1405
+ </div>`}},bt.styles=[R`
1391
1406
  :host {
1392
1407
  display: block;
1393
1408
  }
@@ -1492,7 +1507,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1492
1507
  </form>
1493
1508
  </div>`:y`<div>
1494
1509
  ${i.getOrFallback("third-pary-chat.error-message","Please check your invitation URL")}
1495
- </div>`}};Fs.styles=[L`
1510
+ </div>`}};Fs.styles=[R`
1496
1511
  :host {
1497
1512
  display: block;
1498
1513
  visibility: visible;
@@ -1599,7 +1614,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1599
1614
  ${e.getOrFallback("email-form.send-button","Send Conversation")}
1600
1615
  </button>
1601
1616
  </form>
1602
- </div>`}};Bs.styles=[L`
1617
+ </div>`}};Bs.styles=[R`
1603
1618
  :host {
1604
1619
  display: block;
1605
1620
  }
@@ -1690,7 +1705,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1690
1705
  ${e.getOrFallback("video-confirm.decline-button","Decline")}
1691
1706
  </button>
1692
1707
  </div>
1693
- </div>`}};qs.styles=[L`
1708
+ </div>`}};qs.styles=[R`
1694
1709
  :host {
1695
1710
  display: block;
1696
1711
  }
@@ -1758,10 +1773,10 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1758
1773
  <div class="link-container">
1759
1774
  <a class="primary" target="_blank" href="${this.surveyUrl}">
1760
1775
  ${this.surveyLinkText}
1761
- <telia-icon svg=${zi.svg} size="sm"></telia-icon>
1776
+ <telia-icon svg=${Hi.svg} size="sm"></telia-icon>
1762
1777
  </a>
1763
1778
  </div>
1764
- </div>`}};Vs.styles=[L`
1779
+ </div>`}};Vs.styles=[R`
1765
1780
  :focus {
1766
1781
  outline-color: var(--focus-color);
1767
1782
  }
@@ -1814,7 +1829,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1814
1829
  <p data-testid="entrance-closed-ingress">
1815
1830
  ${e.getOrFallback("entrance-closed.ingress","Our team is currently away, but we'll be back during our regular opening hours.")}
1816
1831
  </p>
1817
- </div>`}};Ws.styles=[L`
1832
+ </div>`}};Ws.styles=[R`
1818
1833
  :host {
1819
1834
  display: block;
1820
1835
  }
@@ -1910,7 +1925,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
1910
1925
  <telia-icon .svg=${na.svg}></telia-icon>
1911
1926
  </div>
1912
1927
  </div>
1913
- </div>`:y`<div>Unknown entry type</div>`}};Gs.styles=[L`
1928
+ </div>`:y`<div>Unknown entry type</div>`}};Gs.styles=[R`
1914
1929
  :focus {
1915
1930
  outline-color: var(--focus-color);
1916
1931
  }
@@ -2021,7 +2036,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
2021
2036
  ${e.getOrFallback("quit-confirm.end-chat-button","End chat")}
2022
2037
  </button>
2023
2038
  </div>
2024
- </div>`}};Zs.styles=[L`
2039
+ </div>`}};Zs.styles=[R`
2025
2040
  :host {
2026
2041
  display: block;
2027
2042
  }
@@ -2102,7 +2117,7 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
2102
2117
  data-testId="auth-error-link"
2103
2118
  >
2104
2119
  ${e.getOrFallback("tunnistus-auth.error.link-button","Try again")}
2105
- <telia-icon svg=${zi.svg} size="sm"></telia-icon>
2120
+ <telia-icon svg=${Hi.svg} size="sm"></telia-icon>
2106
2121
  </a>
2107
2122
  </div>
2108
2123
  </div>`;case Ze.Initial:default:return y`<div class="container">
@@ -2124,10 +2139,10 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
2124
2139
  data-testId="auth-initial-link"
2125
2140
  >
2126
2141
  ${e.getOrFallback("tunnistus-auth.initial.link-button","Authenticate with Tunnistus")}
2127
- <telia-icon svg=${zi.svg} size="sm"></telia-icon>
2142
+ <telia-icon svg=${Hi.svg} size="sm"></telia-icon>
2128
2143
  </a>
2129
2144
  </div>
2130
- </div>`}}};Ys.styles=[L`
2145
+ </div>`}}};Ys.styles=[R`
2131
2146
  :focus {
2132
2147
  outline-color: var(--focus-color);
2133
2148
  }
@@ -2202,13 +2217,13 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
2202
2217
  * @license
2203
2218
  * Copyright 2018 Google LLC
2204
2219
  * SPDX-License-Identifier: BSD-3-Clause
2205
- */const Xa="important",lp=" !"+Xa,cp=on(class extends Kn{constructor(n){var e;if(super(n),n.type!==rn.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 i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}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 i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const r=typeof s=="string"&&s.endsWith(lp);i.includes("-")||r?t.setProperty(i,r?s.slice(0,-11):s,r?Xa:""):t[i]=s}}return Le}});var up=Object.defineProperty,hp=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&up(e,t,s),s};const Qs=class Qs extends A{constructor(e,t){super(),this.primaryColor="",this.secondaryColor="",this.tertiaryColor="",this.headerHeight=0,this.copyrightHeight=0,this.userUrl=new URL(e),this.userUrl.searchParams.set("lang","en"),this.userUrl.searchParams.set("guestId",t)}connectedCallback(){var s;super.connectedCallback();const e=this.application.getComponent("widget-header");e&&(this.headerHeight=e.getBoundingClientRect().height);const t=this.application.getComponent("copyright");t&&(this.copyrightHeight=t.getBoundingClientRect().height);const i=(s=this.application.settings)==null?void 0:s.branding.colors;this.primaryColor=i.interactivePrimaryBackground,this.secondaryColor=i.interactiveTextOnPrimaryBackground,this.tertiaryColor=i.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 t=getComputedStyle(this).getPropertyValue("--spacing-md").trim();if(t.endsWith("rem")){const s=parseFloat(getComputedStyle(this).fontSize);return parseFloat(t)*s}const i=parseFloat(t);return isNaN(i)?0:i}render(){const e=this.getSpacingMd(),t={top:this.headerHeight+e+"px",bottom:this.copyrightHeight+e+"px"};return y` <div class="container" style=${cp(t)}>
2220
+ */const Xa="important",lp=" !"+Xa,cp=on(class extends Kn{constructor(n){var e;if(super(n),n.type!==rn.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 i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}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 i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const r=typeof s=="string"&&s.endsWith(lp);i.includes("-")||r?t.setProperty(i,r?s.slice(0,-11):s,r?Xa:""):t[i]=s}}return Re}});var up=Object.defineProperty,hp=(n,e,t,i)=>{for(var s=void 0,r=n.length-1,o;r>=0;r--)(o=n[r])&&(s=o(e,t,s)||s);return s&&up(e,t,s),s};const Qs=class Qs extends A{constructor(e,t){super(),this.primaryColor="",this.secondaryColor="",this.tertiaryColor="",this.headerHeight=0,this.copyrightHeight=0,this.userUrl=new URL(e),this.userUrl.searchParams.set("lang","en"),this.userUrl.searchParams.set("guestId",t)}connectedCallback(){var s;super.connectedCallback();const e=this.application.getComponent("widget-header");e&&(this.headerHeight=e.getBoundingClientRect().height);const t=this.application.getComponent("copyright");t&&(this.copyrightHeight=t.getBoundingClientRect().height);const i=(s=this.application.settings)==null?void 0:s.branding.colors;this.primaryColor=i.interactivePrimaryBackground,this.secondaryColor=i.interactiveTextOnPrimaryBackground,this.tertiaryColor=i.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 t=getComputedStyle(this).getPropertyValue("--spacing-md").trim();if(t.endsWith("rem")){const s=parseFloat(getComputedStyle(this).fontSize);return parseFloat(t)*s}const i=parseFloat(t);return isNaN(i)?0:i}render(){const e=this.getSpacingMd(),t={top:this.headerHeight+e+"px",bottom:this.copyrightHeight+e+"px"};return y` <div class="container" style=${cp(t)}>
2206
2221
  <iframe
2207
2222
  class="video-iframe"
2208
2223
  src=${this.userUrl.href}
2209
2224
  allow="camera; microphone; display-capture;"
2210
2225
  ></iframe>
2211
- </div>`}};Qs.styles=[L`
2226
+ </div>`}};Qs.styles=[R`
2212
2227
  :host {
2213
2228
  display: block;
2214
2229
  }
@@ -2229,4 +2244,4 @@ Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An err
2229
2244
  border: 1px solid var(--border-color-medium);
2230
2245
  box-sizing: border-box;
2231
2246
  }
2232
- `];let en=Qs;hp([de({context:ae}),k({attribute:!1})],en.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",en);class As extends wc{constructor(e,t){var i,s,r,o,a,c;super(e,t),this.pendingMessages=[],this.texts=this.component.application.texts,this.headerComponent=this.component.application.getComponent("widget-header"),this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this.agent=this.createAgent(((i=this.component.application.storage.get("agentInfo"))==null?void 0:i.name)||""),this.user=this.createUser(((s=this.component.application.storage.get("userInfo"))==null?void 0:s.name)||""),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.idHubUrl="https://idhub.dev-se.telia-ck8s.com/idhub-gateway/public",this.disconnected$=new P,this.agentUsername=null,this.conversationOption=null,this._conversationOptions={},this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this.onQueueStatusReceived=l=>{this.setQueueStatus(l.text||null)},this.onEstablished=l=>{this.contactId=l.contactId,this.errand=l.errand,this.entrance=l.entrance,this.agentUsername=l.agentUsername;const u={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:u}),this.setQueueStatus(null),this.agent.name=l.agentAlias,this.component.application.storage.set("agentInfo",{name:this.agent.name}),l.videoEnded&&this.removeVideo()},this.onPrepareVideo=()=>{this.showVideoConfirmDialog()},this.onVideoPrepared=l=>{this.showVideoIFrame(l.userUrl)},this.onChatButtonClicked=l=>{this.showChatOverVideo(l.guestId)},this.onEndVideoButtonClicked=l=>{this.guestId&&(l==null?void 0:l.guestId)===this.guestId&&this.removeVideo()},this.onPenStatusChange=l=>{l.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this.onChatEnded=async l=>{var p,d;this.shouldUseAuth&&this.endAuthenticatedSession(),this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),l.showForm&&this.showConversationEndedForm();const u=this.component.application.settings;(p=u==null?void 0:u.survey)!=null&&p.shouldUseSurvey&&((d=u==null?void 0:u.survey)!=null&&d.surveyBaseUrl)&&this.showSurvey(),this.isThirdPartyParticipant?this.removeHeaderOptions():this.setStartNewChatOption(),this.complete()},this.properties=t.properties,this.shouldUseAuth=(o=(r=this.component.application.settings)==null?void 0:r.auth)==null?void 0:o.shouldUseAuth,this.idHubEidType=(c=(a=this.component.application.settings)==null?void 0:a.auth)==null?void 0:c.idHubEidType.toLowerCase()}connect(e={}){super.connect(),this.setupAuthenticationListeners(),this._conversationOptions=e;const t={...this.properties.chat??{},...e},i=!!this.sessionId;if(!i){const r=Ki();this.setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new Gd(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(z(this.disconnected$),W(Ud)).subscribe(this.onQueueStatusReceived),this.engine.actions().pipe(z(this.disconnected$),W(Dd)).subscribe(this.onEstablished),this.engine.actions().pipe(z(this.disconnected$),W(Hd)).subscribe(this.onPrepareVideo),this.engine.actions().pipe(z(this.disconnected$),W(jd)).subscribe(this.onVideoPrepared),this.engine.actions().pipe(z(this.disconnected$),W(Fd)).subscribe(this.onChatButtonClicked),this.engine.actions().pipe(z(this.disconnected$),W(Bd)).subscribe(this.onEndVideoButtonClicked),this.engine.actions().pipe(z(this.disconnected$),W(zd)).subscribe(this.onPenStatusChange),this.engine.actions().pipe(z(this.disconnected$),W(qd)).subscribe(this.onChatEnded),this.setHeaderOption();const s=this.component.application.trigger;s&&s.widgetActive$.pipe(z(s.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(z(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),i?this.engine.rehydrate().then(r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(z(this.disconnected$)).subscribe({error:a=>{console.error("Failed to reconnect to the engine:",a)}}):this.initializeChat(t).catch(a=>{console.error("Failed to initialize chat during rehydration:",a)})}):this.initializeChat(t).catch(r=>{console.error("Failed to initialize chat:",r)})}disconnected(){super.disconnected(),this.disconnected$.next()}onUserSubmit(e){const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t),(async()=>{var i;try{await((i=this.engine)==null?void 0:i.chatWrite(e.text))}catch(s){s instanceof Fn?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}save(e){this.component.stateMachine.session().pipe(Oe(t=>(t==null?void 0:t.data$)||tt),me(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async rehydrate(e){if(e.chatSessionId&&this.setSessionId(e.chatSessionId),e.survey&&(this.contactId=e.survey.contactId,this.errand=e.survey.errand,this.entrance=e.survey.entrance,this.agentUsername=e.survey.agentUsername),this.shouldUseAuth){const t=this.component.application.storage.get("auth");t!=null&&t.authenticated?this.component.setAuthenticationBannerStatus(Z.Authenticated):this.component.setAuthenticationBannerStatus(Z.NonAuthenticated)}}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new As(e,t)),t.providerInstance}async initializeChat(e){this.shouldUseAuth&&this.idHubEidType?(this.component.setAuthenticationBannerStatus(Z.NonAuthenticated),this.setupIDHubAuth(),this.idHubClient&&await this.startAuthenticationFlow()):this.handleWelcomeForm(e)}setupAuthenticationListeners(){var e;this.shouldUseAuth&&this.headerComponent&&this.headerComponent.actions$&&((e=this.headerComponent)==null||e.actions$.pipe(W(t=>t.key==="start-auth"),z(this.disconnected$)).subscribe(t=>{t.key==="start-auth"&&this.handleAuthentication()}))}setupIDHubAuth(){var e;this.idHubClient=new Bt({...(e=this.component.application.settings)==null?void 0:e.auth,idHubUrl:this.idHubUrl})}async startAuthenticationFlow(e=!1){if(this.component.disableInput(),e||(this.resetAuthState(Z.NonAuthenticated),this.authResult=await this.getAuthResult()),!!this.authResult)switch(this.idHubEidType){case Te.Tunnistus:if(!this.authResult.tunnistusURL){this.printSystem(this.texts.getOrFallback("auth.setup.tunnistus.url-error-message","Unable to retrieve the Tunnistus authentication URL.")),this.headerComponent.showAuthOptions=!1;return}this.headerComponent.authUrl=this.authResult.tunnistusURL,this.headerComponent.authState=Z.NonAuthenticated,e?this.handleAuthentication():(this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Initial,this.authResult.tunnistusURL),this.authenticationCardEntry.actions$.pipe(W(t=>t.key==="start-auth"),me(1)).subscribe(()=>{this.handleAuthentication()}));break;case Te.BankId:break}}async getAuthResult(){const e=await this.idHubClient.auth();if(e.status===H.Error){this.printSystem(this.texts.getOrFallback("auth.setup.error-message","An error occurred while setting up authentication.")),this.headerComponent.showAuthOptions=!1;return}return e}async handleWelcomeForm(e,t){let i=!0;if(e.webApiUrl)try{i=await this.isEntranceOpen(e.webApiUrl,e.entrance)}catch(s){console.error("Error checking entrance status:",s),i=!1}i?this.customerName?(this.user.name=this.customerName,this.startChat({customerName:this.customerName,customData:{}},t)):this.showWelcomeForm(t):this.showEntranceClosedDialog()}startChat(e,t){if(!this.engine)return;const i=e.customData.errand??this.engine.config.defaultErrand;if(!i)throw new Error("Errand is required but was not configured");this.isThirdPartyParticipant?(this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(z(this.disconnected$)).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:i,...t&&{authToken:t}}).pipe(z(this.disconnected$)).subscribe(),this.component.enableInput(),this.component.enableSkipToLatestMessage(),this.setEndConversationOption()}restartNewChat(){this.engine&&(this.setSessionId(null),this.component.clearMessages(),this.removeHeaderOptions(),this.connect(this._conversationOptions))}setQueueStatus(e){this.setToastMessage(e)}async endConversation(){var e;this.shouldUseAuth&&this.resetAuthState(Z.ChatEnded),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(this.texts.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(i){this.printSystem(this.texts.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),i instanceof Fn||console.warn("Unhandled error:",i)}}clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}setSessionId(e){this.sessionId=e}async isEntranceOpen(e,t){var s;let i=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?i=(s=o==null?void 0:o.resultData)==null?void 0:s.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 i}resetAuthState(e){this.headerComponent.authState=e,this.headerComponent.userName="",this.headerComponent.authUrl="",e===Z.ChatEnded&&(this.authResult=void 0),this.component.application.storage.removeItem("auth")}unescapeHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}async handleAuthentication(){var t,i,s,r;this.headerComponent.userName=this.texts.getOrFallback("widget-header.authenticating","Authenticating..."),this.headerComponent.authState=Z.Authenticating;const e=await this.idHubClient.collect();switch(this.authenticationCardEntry&&this.authenticationCardEntry.remove(),this.idHubEidType){case Te.Tunnistus:if(e.status===H.Error){if(this.authResult=await this.getAuthResult(),!this.authResult)return;this.headerComponent.userName=this.texts.getOrFallback("widget-header.not-authenticated","Not authenticated"),this.headerComponent.authState=Z.NonAuthenticated,this.headerComponent.authUrl=this.authResult.tunnistusURL,this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Error,this.authResult.tunnistusURL),this.authenticationCardEntry.actions$.pipe(W(o=>o.key==="start-auth"),me(1)).subscribe(async()=>{this.startAuthenticationFlow(!0)});return}else if(e.status===H.Authenticated){const o=Wd(((t=e==null?void 0:e.idhubEIDToken)==null?void 0:t.split(".")[1])??""),a=JSON.parse(o),c=((s=(i=a==null?void 0:a.completionData)==null?void 0:i.user)==null?void 0:s.name)??"";this.headerComponent.userName=c,this.headerComponent.authState=Z.Authenticated,this.component.application.storage.set("auth",{name:c,authenticated:!0}),this.component.setAuthenticationBannerStatus(Z.Authenticated),(r=this.authenticationCardEntry)==null||r.remove(),this.handleWelcomeForm(this.engine.config,e.idhubEIDToken)}break;case Te.BankId:break}}printAgent(e,t=""){const i=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),i}printUser(e){const t=this.unescapeHtml(e),i=Ni(Tr(t));return this.user.print(i)}printSystem(e){const t=Ni(Tr(e));return this.system.print(t)}showSurvey(){const e=new ie(q.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:this.agentUsername??"",entrance:this.entrance??this.engine.config.entrance,errand:this.errand??this.engine.config.defaultErrand,contactId:this.contactId??""}]]}]);this.printEntry(e)}showTunnistusAuthCard(e,t,i){const s=new ie(q.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{state:e,tunnistusURL:t??"",errorMessage:i??""}]]}]);return this.printEntry(s),s}showWelcomeForm(e){this.component.disableInput(),this.component.disableSkipToLatestMessage();let t;this.isThirdPartyParticipant?t=new ie(q.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):t=new ie(q.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(t),t.actions$.pipe(W(i=>i.key==="submitted"),me(1)).subscribe(i=>{t.remove(),this.user.name=i.data.name,this.component.application.storage.set("userInfo",{name:this.user.name}),this.startChat({customerName:i.data.name,customerEmailAddress:i.data.email,visitorQuestion:i.data.question,customData:i.data.customData},e)})}showEntranceClosedDialog(){this.component.disableInput();const e=new ie(q.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(W(t=>t.key==="quit-chat"),me(1)).subscribe(t=>{var i,s,r,o;((i=t.data)==null?void 0:i.result)==="quit"?(this.endConversation(),(s=this.quitConfirmDialogEntry)==null||s.remove()):((r=t.data)==null?void 0:r.result)==="cancel"&&((o=this.quitConfirmDialogEntry)==null||o.remove())})}showConversationEndedForm(){const e=new ie(q.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(W(t=>t.key==="submitted"),me(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}showVideoConfirmDialog(){this.videoConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(W(e=>e.key==="video-confirm"),me(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)})}showVideoIFrame(e){var i;this.guestId=Ki(),this.videoIFrameElement=new en(e,this.guestId);const t=this.component.application.root;(i=t==null?void 0:t.shadowRoot)==null||i.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}async endAuthenticatedSession(){this.component.setAuthenticationBannerStatus(Z.NonAuthenticated),await this.engine.getChatStatus()==="noSession"?(this.resetAuthState(Z.NonAuthenticated),this.setSessionId(null),this.component.clearMessages(),this.shouldUseAuth&&this.startAuthenticationFlow()):this.endConversation()}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()}addHeaderOptions(e,t,i,s,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=i,this.conversationOption.onClick=s,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:i,closeOnClick:!0,key:t,onClick:s,enabled:r})}removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}setStartNewChatOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",sa.svg,()=>{this.restartNewChat()})}setEndConversationOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",ia.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}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}}}const dp=async n=>{(await rs.getInstance(n.container)).registerProvider("ace-chat",t=>As.getInstance("ace-chat",t))};exports.ChatProviderPlugin=dp;
2247
+ `];let en=Qs;hp([de({context:ae}),k({attribute:!1})],en.prototype,"application");window.customElements.get("ace-video-iframe")||window.customElements.define("ace-video-iframe",en);class As extends wc{constructor(e,t){var i,s,r,o,a,c;super(e,t),this.pendingMessages=[],this.texts=this.component.application.texts,this.headerComponent=this.component.application.getComponent("widget-header"),this.isThirdPartyParticipant=this.component.properties.chat.isThirdPartyWidget,this.agent=this.createAgent(((i=this.component.application.storage.get("agentInfo"))==null?void 0:i.name)||""),this.user=this.createUser(((s=this.component.application.storage.get("userInfo"))==null?void 0:s.name)||""),this.params=new URLSearchParams(document.location.search),this.invitationUid=this.params.get("invitationUid"),this.customerName=this.params.get("customerName")||void 0,this.idHubUrl="https://idhub.dev-se.telia-ck8s.com/idhub-gateway/public",this.disconnected$=new P,this.agentUsername=null,this.conversationOption=null,this._conversationOptions={},this.sessionId=null,this.contactId=null,this.errand=null,this.entrance=null,this.guestId=null,this.chatOverlayActive=!1,this.inVideoCall=!1,this.onQueueStatusReceived=l=>{this.setQueueStatus(l.text||null)},this.onEstablished=l=>{this.contactId=l.contactId,this.errand=l.errand,this.entrance=l.entrance,this.agentUsername=l.agentUsername;const u={contactId:this.contactId,errand:this.errand,entrance:this.entrance,agentUsername:this.agentUsername};this.save({survey:u}),this.setQueueStatus(null),this.agent.name=l.agentAlias,this.component.application.storage.set("agentInfo",{name:this.agent.name}),l.videoEnded&&this.removeVideo()},this.onPrepareVideo=()=>{this.showVideoConfirmDialog()},this.onVideoPrepared=l=>{this.showVideoIFrame(l.userUrl)},this.onChatButtonClicked=l=>{this.showChatOverVideo(l.guestId)},this.onEndVideoButtonClicked=l=>{this.guestId&&(l==null?void 0:l.guestId)===this.guestId&&this.removeVideo()},this.onPenStatusChange=l=>{l.penStatus==="on"?this.setTypingState(!0):this.setTypingState(!1)},this.onChatEnded=async l=>{var p,d;this.shouldUseAuth&&this.endAuthenticatedSession(),this.setToastMessage(null),this.setTypingState(!1),this.videoConfirmDialogEntry&&this.videoConfirmDialogEntry.remove(),this.component.disableInput(),l.showForm&&this.showConversationEndedForm();const u=this.component.application.settings;(p=u==null?void 0:u.survey)!=null&&p.shouldUseSurvey&&((d=u==null?void 0:u.survey)!=null&&d.surveyBaseUrl)&&this.showSurvey(),this.isThirdPartyParticipant?this.removeHeaderOptions():this.setStartNewChatOption(),this.complete()},this.properties=t.properties,this.shouldUseAuth=(o=(r=this.component.application.settings)==null?void 0:r.auth)==null?void 0:o.shouldUseAuth,this.idHubEidType=(c=(a=this.component.application.settings)==null?void 0:a.auth)==null?void 0:c.idHubEidType.toLowerCase()}connect(e={}){super.connect(),this.setupAuthenticationListeners(),this._conversationOptions=e;const t={...this.properties.chat??{},...e},i=!!this.sessionId;if(!i){const r=Ki();this.setSessionId(r)}this.save({chatSessionId:this.sessionId}),this.engine=new Gd(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(H(this.disconnected$),W(Ud)).subscribe(this.onQueueStatusReceived),this.engine.actions().pipe(H(this.disconnected$),W(Dd)).subscribe(this.onEstablished),this.engine.actions().pipe(H(this.disconnected$),W(zd)).subscribe(this.onPrepareVideo),this.engine.actions().pipe(H(this.disconnected$),W(jd)).subscribe(this.onVideoPrepared),this.engine.actions().pipe(H(this.disconnected$),W(Fd)).subscribe(this.onChatButtonClicked),this.engine.actions().pipe(H(this.disconnected$),W(Bd)).subscribe(this.onEndVideoButtonClicked),this.engine.actions().pipe(H(this.disconnected$),W(Hd)).subscribe(this.onPenStatusChange),this.engine.actions().pipe(H(this.disconnected$),W(qd)).subscribe(this.onChatEnded),this.setHeaderOption();const s=this.component.application.trigger;s&&s.widgetActive$.pipe(H(s.componentIsDestroyed$)).subscribe(r=>{r&&(this.conversationOption=null,this.setHeaderOption())}),this.component.userTyping$.pipe(H(this.disconnected$)).subscribe(r=>{var o;(o=this.engine)==null||o.sendPenStatusOn(r)}),i?this.engine.rehydrate().then(r=>{var o;r?(o=this.engine)==null||o.reconnect().pipe(H(this.disconnected$)).subscribe({error:a=>{console.error("Failed to reconnect to the engine:",a)}}):this.initializeChat(t).catch(a=>{console.error("Failed to initialize chat during rehydration:",a)})}):this.initializeChat(t).catch(r=>{console.error("Failed to initialize chat:",r)})}disconnected(){super.disconnected(),this.disconnected$.next()}onUserSubmit(e){const t=this.printUser(e.text);t.setStatus("pending"),this.pendingMessages.push(t),(async()=>{var i;try{await((i=this.engine)==null?void 0:i.chatWrite(e.text))}catch(s){s instanceof Fn?t.setStatus("failed"):(t.setStatus("failed"),console.warn("Unhandled error:",s))}})()}save(e){this.component.stateMachine.session().pipe(Oe(t=>(t==null?void 0:t.data$)||tt),me(1)).subscribe(t=>{this.saveToCurrentSession$.next({...t,...e})})}async rehydrate(e){if(e.chatSessionId&&this.setSessionId(e.chatSessionId),e.survey&&(this.contactId=e.survey.contactId,this.errand=e.survey.errand,this.entrance=e.survey.entrance,this.agentUsername=e.survey.agentUsername),this.shouldUseAuth){const t=this.component.application.storage.get("auth");t!=null&&t.authenticated?this.component.setAuthenticationBannerStatus(Z.Authenticated):this.component.setAuthenticationBannerStatus(Z.NonAuthenticated)}}static getInstance(e,t){return t.providerInstance??(t.providerInstance=new As(e,t)),t.providerInstance}async initializeChat(e){this.shouldUseAuth&&this.idHubEidType?(this.component.setAuthenticationBannerStatus(Z.NonAuthenticated),this.setupIDHubAuth(),this.idHubClient&&await this.startAuthenticationFlow()):this.handleWelcomeForm(e)}setupAuthenticationListeners(){var e;this.shouldUseAuth&&this.headerComponent&&this.headerComponent.actions$&&((e=this.headerComponent)==null||e.actions$.pipe(W(t=>t.key==="start-auth"),H(this.disconnected$)).subscribe(t=>{t.key==="start-auth"&&this.handleAuthentication()}))}setupIDHubAuth(){var e;this.idHubClient=new Bt({...(e=this.component.application.settings)==null?void 0:e.auth,idHubUrl:this.idHubUrl})}async startAuthenticationFlow(e=!1){if(this.component.disableInput(),e||(this.resetAuthState(Z.NonAuthenticated),this.authResult=await this.getAuthResult()),!!this.authResult)switch(this.idHubEidType){case Te.Tunnistus:if(!this.authResult.tunnistusURL){this.printSystem(this.texts.getOrFallback("auth.setup.tunnistus.url-error-message","Unable to retrieve the Tunnistus authentication URL.")),this.headerComponent.showAuthOptions=!1;return}this.headerComponent.authUrl=this.authResult.tunnistusURL,this.headerComponent.authState=Z.NonAuthenticated,e?this.handleAuthentication():(this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Initial,this.authResult.tunnistusURL),this.authenticationCardEntry.actions$.pipe(W(t=>t.key==="start-auth"),me(1)).subscribe(()=>{this.handleAuthentication()}));break;case Te.BankId:break}}async getAuthResult(){const e=await this.idHubClient.auth();if(e.status===z.Error){this.printSystem(this.texts.getOrFallback("auth.setup.error-message","An error occurred while setting up authentication.")),this.headerComponent.showAuthOptions=!1;return}return e}async handleWelcomeForm(e,t){let i=!0;if(e.webApiUrl)try{i=await this.isEntranceOpen(e.webApiUrl,e.entrance)}catch(s){console.error("Error checking entrance status:",s),i=!1}i?this.customerName?(this.user.name=this.customerName,this.startChat({customerName:this.customerName,customData:{}},t)):this.showWelcomeForm(t):this.showEntranceClosedDialog()}startChat(e,t){if(!this.engine)return;const i=e.customData.errand??this.engine.config.defaultErrand;if(!i)throw new Error("Errand is required but was not configured");this.isThirdPartyParticipant?(this.component.application.root.style.visibility="visible",this.engine.chatJoin({invitationUid:this.invitationUid,customerName:this.customerName??e.customerName}).pipe(H(this.disconnected$)).subscribe()):this.engine.chatRequest({customerName:e.customerName,customerEmailAddress:e.customerEmailAddress??"",visitorQuestion:e.visitorQuestion??"",customData:e.customData,errand:i,...t&&{authToken:t}}).pipe(H(this.disconnected$)).subscribe(),this.component.enableInput(),this.component.enableSkipToLatestMessage(),this.setEndConversationOption()}restartNewChat(){this.engine&&(this.setSessionId(null),this.component.clearMessages(),this.removeHeaderOptions(),this.connect(this._conversationOptions))}setQueueStatus(e){this.setToastMessage(e)}async endConversation(){var e;this.shouldUseAuth&&this.resetAuthState(Z.ChatEnded),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(this.texts.getOrFallback("email-form.email-sent-label","An email with the conversation was sent."))}catch(i){this.printSystem(this.texts.getOrFallback("email-form.error-message","Unable to send email with the conversation.")),i instanceof Fn||console.warn("Unhandled error:",i)}}clearPendingMessages(){this.pendingMessages.forEach(e=>{e.remove()})}setSessionId(e){this.sessionId=e}async isEntranceOpen(e,t){var s;let i=!1;try{const r=await fetch(`${e}/1/entrances/${t}/is-open`),o=await r.json();r.ok?i=(s=o==null?void 0:o.resultData)==null?void 0:s.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 i}resetAuthState(e){this.headerComponent.authState=e,this.headerComponent.userName="",this.headerComponent.authUrl="",e===Z.ChatEnded&&(this.authResult=void 0),this.component.application.storage.removeItem("auth")}unescapeHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}async handleAuthentication(){var t,i,s,r;this.headerComponent.userName=this.texts.getOrFallback("widget-header.authenticating","Authenticating..."),this.headerComponent.authState=Z.Authenticating;const e=await this.idHubClient.collect();switch(this.authenticationCardEntry&&this.authenticationCardEntry.remove(),this.idHubEidType){case Te.Tunnistus:if(e.status===z.Error){if(this.authResult=await this.getAuthResult(),!this.authResult)return;this.headerComponent.userName=this.texts.getOrFallback("widget-header.not-authenticated","Not authenticated"),this.headerComponent.authState=Z.NonAuthenticated,this.headerComponent.authUrl=this.authResult.tunnistusURL,this.authenticationCardEntry=this.showTunnistusAuthCard(Ze.Error,this.authResult.tunnistusURL),this.authenticationCardEntry.actions$.pipe(W(o=>o.key==="start-auth"),me(1)).subscribe(async()=>{this.startAuthenticationFlow(!0)});return}else if(e.status===z.Authenticated){const o=Wd(((t=e==null?void 0:e.idhubEIDToken)==null?void 0:t.split(".")[1])??""),a=JSON.parse(o),c=((s=(i=a==null?void 0:a.completionData)==null?void 0:i.user)==null?void 0:s.name)??"";this.headerComponent.userName=c,this.headerComponent.authState=Z.Authenticated,this.component.application.storage.set("auth",{name:c,authenticated:!0}),this.component.setAuthenticationBannerStatus(Z.Authenticated),(r=this.authenticationCardEntry)==null||r.remove(),this.handleWelcomeForm(this.engine.config,e.idhubEIDToken)}break;case Te.BankId:break}}printAgent(e,t=""){const i=t.length>0?this.agent.print(e,"markdown",t):this.agent.print(e,"markdown");return this.setTypingState(!1),i}printUser(e){const t=this.unescapeHtml(e),i=Ni(Tr(t));return this.user.print(i)}printSystem(e){const t=Ni(Tr(e));return this.system.print(t)}showSurvey(){const e=new ie(q.System,{name:""},[{items:[["ace-survey",{content:""},{agentUsername:this.agentUsername??"",entrance:this.entrance??this.engine.config.entrance,errand:this.errand??this.engine.config.defaultErrand,contactId:this.contactId??""}]]}]);this.printEntry(e)}showTunnistusAuthCard(e,t,i){const s=new ie(q.System,{name:""},[{items:[["ace-tunnistus-auth-card",{content:""},{state:e,tunnistusURL:t??"",errorMessage:i??""}]]}]);return this.printEntry(s),s}showWelcomeForm(e){this.component.disableInput(),this.component.disableSkipToLatestMessage();let t;this.isThirdPartyParticipant?t=new ie(q.System,{name:""},[{items:[["ace-welcome-form-third-party",{content:""}]]}]):t=new ie(q.System,{name:""},[{items:[["ace-welcome-form",{content:""}]]}]),this.printEntry(t),t.actions$.pipe(W(i=>i.key==="submitted"),me(1)).subscribe(i=>{t.remove(),this.user.name=i.data.name,this.component.application.storage.set("userInfo",{name:this.user.name}),this.startChat({customerName:i.data.name,customerEmailAddress:i.data.email,visitorQuestion:i.data.question,customData:i.data.customData},e)})}showEntranceClosedDialog(){this.component.disableInput();const e=new ie(q.System,{name:""},[{items:[["ace-entrance-closed-dialog",{content:""}]]}]);this.printEntry(e)}showQuitConfirmDialog(){var e;(e=this.quitConfirmDialogEntry)==null||e.remove(),this.quitConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-quit-confirm-dialog",{content:""}]]}]),this.printEntry(this.quitConfirmDialogEntry),this.quitConfirmDialogEntry.actions$.pipe(W(t=>t.key==="quit-chat"),me(1)).subscribe(t=>{var i,s,r,o;((i=t.data)==null?void 0:i.result)==="quit"?(this.endConversation(),(s=this.quitConfirmDialogEntry)==null||s.remove()):((r=t.data)==null?void 0:r.result)==="cancel"&&((o=this.quitConfirmDialogEntry)==null||o.remove())})}showConversationEndedForm(){const e=new ie(q.System,{name:""},[{items:[["ace-conversation-ended-form",{content:""}]]}]);this.printEntry(e),e.actions$.pipe(W(t=>t.key==="submitted"),me(1)).subscribe(t=>{e.remove(),t.data.email&&this.sendConversationEmail(t.data.email)})}showVideoConfirmDialog(){this.videoConfirmDialogEntry=new ie(q.System,{name:""},[{items:[["ace-video-confirm-dialog",{content:""}]]}]),this.printEntry(this.videoConfirmDialogEntry),this.videoConfirmDialogEntry.actions$.pipe(W(e=>e.key==="video-confirm"),me(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)})}showVideoIFrame(e){var i;this.guestId=Ki(),this.videoIFrameElement=new en(e,this.guestId);const t=this.component.application.root;(i=t==null?void 0:t.shadowRoot)==null||i.prepend(this.videoIFrameElement),this.inVideoCall=!0,this.setHeaderOption()}showChatOverVideo(e){this.guestId&&e===this.guestId&&(this.chatOverlayActive=!0,this.showChatOverlay$.next(this.chatOverlayActive))}async endAuthenticatedSession(){this.component.setAuthenticationBannerStatus(Z.NonAuthenticated),await this.engine.getChatStatus()==="noSession"?(this.resetAuthState(Z.NonAuthenticated),this.setSessionId(null),this.component.clearMessages(),this.shouldUseAuth&&this.startAuthenticationFlow()):this.endConversation()}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()}addHeaderOptions(e,t,i,s,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=i,this.conversationOption.onClick=s,this.conversationOption.enabled=r,o.requestUpdate(),this.conversationOption):o.addOption({label:e,icon:i,closeOnClick:!0,key:t,onClick:s,enabled:r})}removeHeaderOptions(){const e=this.component.application.getComponent("widget-header");e&&e.removeOption(this.conversationOption)}setStartNewChatOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.start-new-chat","Start new chat"),"start-new-chat-button",sa.svg,()=>{this.restartNewChat()})}setEndConversationOption(){this.conversationOption=this.addHeaderOptions(this.texts.getOrFallback("widget-header.end-conversation","End conversation"),"end-conversation-button",ia.svg,()=>{this.showQuitConfirmDialog()},!this.inVideoCall)}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}}}const dp=async n=>{(await rs.getInstance(n.container)).registerProvider("ace-chat",t=>As.getInstance("ace-chat",t))};exports.ChatProviderPlugin=dp;