/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@attendi/speech-service@0.15.0/cdn/speech-service.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const On=globalThis,Yi=On.ShadowRoot&&(void 0===On.ShadyCSS||On.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Xi=Symbol(),Lr=new WeakMap;let Mo=class{constructor(t,e,n){if(this._$cssResult$=!0,n!==Xi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Yi&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=Lr.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&Lr.set(e,t))}return t}toString(){return this.cssText}};const za=t=>new Mo("string"==typeof t?t:t+"",void 0,Xi),E=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[i+1]),t[0]);return new Mo(n,t,Xi)},Wa=(t,e)=>{if(Yi)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const n of e){const e=document.createElement("style"),i=On.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=n.cssText,t.appendChild(e)}},Dr=Yi?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return za(e)})(t):t
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */,{is:Ga,defineProperty:qa,getOwnPropertyDescriptor:Ka,getOwnPropertyNames:Za,getOwnPropertySymbols:Ya,getPrototypeOf:Xa}=Object,Bt=globalThis,Nr=Bt.trustedTypes,Ja=Nr?Nr.emptyScript:"",gi=Bt.reactiveElementPolyfillSupport,Ne=(t,e)=>t,$n={toAttribute(t,e){switch(e){case Boolean:t=t?Ja:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Ji=(t,e)=>!Ga(t,e),Ur={attribute:!0,type:String,converter:$n,reflect:!1,hasChanged:Ji};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Bt.litPropertyMetadata??(Bt.litPropertyMetadata=new WeakMap);let ge=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Ur){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(t,n,e);void 0!==i&&qa(this.prototype,t,i)}}static getPropertyDescriptor(t,e,n){const{get:i,set:r}=Ka(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==i?void 0:i.call(this)},set(e){const o=null==i?void 0:i.call(this);r.call(this,e),this.requestUpdate(t,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ur}static _$Ei(){if(this.hasOwnProperty(Ne("elementProperties")))return;const t=Xa(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Ne("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ne("properties"))){const t=this.properties,e=[...Za(t),...Ya(t)];for(const n of e)this.createProperty(n,t[n])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,n]of e)this.elementProperties.set(t,n)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const n=this._$Eu(t,e);void 0!==n&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(Dr(t))}else void 0!==t&&e.push(Dr(t));return e}static _$Eu(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const n of e.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Wa(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EC(t,e){var n;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null==(n=i.converter)?void 0:n.toAttribute)?i.converter:$n).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(n=t.converter)?void 0:n.fromAttribute)?t.converter:$n;this._$Em=r,this[r]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,n){if(void 0!==t){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??Ji)(this[t],e))return;this.P(t,e,n)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,n){this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,n]of t)!0!==n.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],n)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(n)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EC(t,this[t])))),this._$EU()}updated(t){}firstUpdated(t){}};ge.elementStyles=[],ge.shadowRootOptions={mode:"open"},ge[Ne("elementProperties")]=new Map,ge[Ne("finalized")]=new Map,null==gi||gi({ReactiveElement:ge}),(Bt.reactiveElementVersions??(Bt.reactiveElementVersions=[])).push("2.0.4");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Ue=globalThis,Tn=Ue.trustedTypes,jr=Tn?Tn.createPolicy("lit-html",{createHTML:t=>t}):void 0,Qi="$lit$",xt=`lit$${Math.random().toFixed(9).slice(2)}$`,tr="?"+xt,Qa=`<${tr}>`,Qt=document,ze=()=>Qt.createComment(""),We=t=>null===t||"object"!=typeof t&&"function"!=typeof t,er=Array.isArray,Io=t=>er(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),vi="[ \t\n\f\r]",Le=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Fr=/-->/g,Vr=/>/g,zt=RegExp(`>|${vi}(?:([^\\s"'>=/]+)(${vi}*=${vi}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Hr=/'/g,zr=/"/g,Bo=/^(?:script|style|textarea|title)$/i,Lo=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),v=Lo(1),J=Lo(2),yt=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),Wr=new WeakMap,Kt=Qt.createTreeWalker(Qt,129);function Do(t,e){if(!er(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==jr?jr.createHTML(e):e}const No=(t,e)=>{const n=t.length-1,i=[];let r,o=2===e?"<svg>":3===e?"<math>":"",s=Le;for(let e=0;e<n;e++){const n=t[e];let a,l,d=-1,c=0;for(;c<n.length&&(s.lastIndex=c,l=s.exec(n),null!==l);)c=s.lastIndex,s===Le?"!--"===l[1]?s=Fr:void 0!==l[1]?s=Vr:void 0!==l[2]?(Bo.test(l[2])&&(r=RegExp("</"+l[2],"g")),s=zt):void 0!==l[3]&&(s=zt):s===zt?">"===l[0]?(s=r??Le,d=-1):void 0===l[1]?d=-2:(d=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?zt:'"'===l[3]?zr:Hr):s===zr||s===Hr?s=zt:s===Fr||s===Vr?s=Le:(s=zt,r=void 0);const u=s===zt&&t[e+1].startsWith("/>")?" ":"";o+=s===Le?n+Qa:d>=0?(i.push(a),n.slice(0,d)+Qi+n.slice(d)+xt+u):n+xt+(-2===d?e:u)}return[Do(t,o+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};let Ei=class t{constructor({strings:e,_$litType$:n},i){let r;this.parts=[];let o=0,s=0;const a=e.length-1,l=this.parts,[d,c]=No(e,n);if(this.el=t.createElement(d,i),Kt.currentNode=this.el.content,2===n||3===n){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=Kt.nextNode())&&l.length<a;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(Qi)){const e=c[s++],n=r.getAttribute(t).split(xt),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:i[2],strings:n,ctor:"."===i[1]?Vo:"?"===i[1]?Ho:"@"===i[1]?zo:sn}),r.removeAttribute(t)}else t.startsWith(xt)&&(l.push({type:6,index:o}),r.removeAttribute(t));if(Bo.test(r.tagName)){const t=r.textContent.split(xt),e=t.length-1;if(e>0){r.textContent=Tn?Tn.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],ze()),Kt.nextNode(),l.push({type:2,index:++o});r.append(t[e],ze())}}}else if(8===r.nodeType)if(r.data===tr)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(xt,t+1));)l.push({type:7,index:o}),t+=xt.length-1}o++}}static createElement(t,e){const n=Qt.createElement("template");return n.innerHTML=t,n}};function te(t,e,n=t,i){var r,o;if(e===yt)return e;let s=void 0!==i?null==(r=n.o)?void 0:r[i]:n.l;const a=We(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==a&&(null==(o=null==s?void 0:s._$AO)||o.call(s,!1),void 0===a?s=void 0:(s=new a(t),s._$AT(t,n,i)),void 0!==i?(n.o??(n.o=[]))[i]=s:n.l=s),void 0!==s&&(e=te(t,s._$AS(t,e.values),s,i)),e}let jo=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,i=((null==t?void 0:t.creationScope)??Qt).importNode(e,!0);Kt.currentNode=i;let r=Kt.nextNode(),o=0,s=0,a=n[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new Kn(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new Wo(r,this,t)),this._$AV.push(e),a=n[++s]}o!==(null==a?void 0:a.index)&&(r=Kt.nextNode(),o++)}return Kt.currentNode=Qt,i}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}},Kn=class t{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this.v}constructor(t,e,n,i){this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=i,this.v=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=te(this,t,e),We(t)?t===I||null==t||""===t?(this._$AH!==I&&this._$AR(),this._$AH=I):t!==this._$AH&&t!==yt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):Io(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==I&&We(this._$AH)?this._$AA.nextSibling.data=t:this.T(Qt.createTextNode(t)),this._$AH=t}$(t){var e;const{values:n,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Ei.createElement(Do(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(n);else{const t=new jo(r,this),e=t.u(this.options);t.p(n),this.T(e),this._$AH=t}}_$AC(t){let e=Wr.get(t.strings);return void 0===e&&Wr.set(t.strings,e=new Ei(t)),e}k(e){er(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let i,r=0;for(const o of e)r===n.length?n.push(i=new t(this.O(ze()),this.O(ze()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,e){var n;for(null==(n=this._$AP)||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this.v=t,null==(e=this._$AP)||e.call(this,t))}},sn=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,i,r){this.type=1,this._$AH=I,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=I}_$AI(t,e=this,n,i){const r=this.strings;let o=!1;if(void 0===r)t=te(this,t,e,0),o=!We(t)||t!==this._$AH&&t!==yt,o&&(this._$AH=t);else{const i=t;let s,a;for(t=r[0],s=0;s<r.length-1;s++)a=te(this,i[n+s],e,s),a===yt&&(a=this._$AH[s]),o||(o=!We(a)||a!==this._$AH[s]),a===I?t=I:t!==I&&(t+=(a??"")+r[s+1]),this._$AH[s]=a}o&&!i&&this.j(t)}j(t){t===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Vo=class extends sn{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===I?void 0:t}},Ho=class extends sn{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==I)}},zo=class extends sn{constructor(t,e,n,i,r){super(t,e,n,i,r),this.type=5}_$AI(t,e=this){if((t=te(this,t,e,0)??I)===yt)return;const n=this._$AH,i=t===I&&n!==I||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==I&&(n===I||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}};class Wo{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){te(this,t)}}const tc={M:Qi,P:xt,A:tr,C:1,L:No,R:jo,D:Io,V:te,I:Kn,H:sn,N:Ho,U:zo,B:Vo,F:Wo},mi=Ue.litHtmlPolyfillSupport;null==mi||mi(Ei,Kn),(Ue.litHtmlVersions??(Ue.litHtmlVersions=[])).push("3.2.0");const ec=(t,e,n)=>{const i=(null==n?void 0:n.renderBefore)??e;let r=i._$litPart$;if(void 0===r){const t=(null==n?void 0:n.renderBefore)??null;i._$litPart$=r=new Kn(e.insertBefore(ze(),t),t,void 0,n??{})}return r._$AI(t),r};
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */class B extends ge{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.o=ec(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this.o)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.o)||t.setConnected(!1)}render(){return yt}}var ko;B._$litElement$=!0,B.finalized=!0,null==(ko=globalThis.litElementHydrateSupport)||ko.call(globalThis,{LitElement:B});const bi=globalThis.litElementPolyfillSupport;null==bi||bi({LitElement:B}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const Ct=t=>(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */,nc={attribute:!0,type:String,converter:$n,reflect:!1,hasChanged:Ji},ic=(t=nc,e,n)=>{const{kind:i,metadata:r}=n;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(n.name,t),"accessor"===i){const{name:i}=n;return{set(n){const r=e.get.call(this);e.set.call(this,n),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=n;return function(n){const r=this[i];e.call(this,n),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function A(t){return(e,n)=>"object"==typeof n?ic(t,e,n):((t,e,n)=>{const i=e.hasOwnProperty(n);return e.constructor.createProperty(n,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,n):void 0})(t,e,n)}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function L(t){return A({...t,state:!0,attribute:!1})}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const nr=(t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n)
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */;function M(t,e){return(e,n,i)=>nr(e,n,{get(){return(null==(e=this.renderRoot)?void 0:e.querySelector(t))??null;var e}})}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function rc(t){return(e,n)=>{const{slot:i,selector:r}=t??{},o="slot"+(i?`[name=${i}]`:":not([name])");return nr(e,n,{get(){var e;const n=null==(e=this.renderRoot)?void 0:e.querySelector(o),i=(null==n?void 0:n.assignedElements(t))??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function oc(t){return(e,n)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return nr(e,n,{get(){var e;const n=null==(e=this.renderRoot)?void 0:e.querySelector(r);return(null==n?void 0:n.assignedNodes(t))??[]}})}}const pe=Symbol("LitMobxRenderReaction"),Gr=Symbol("LitMobxRequestUpdate");function sc(t,e){var n,i;return i=class extends t{constructor(){super(...arguments),this[n]=()=>{this.requestUpdate()}}connectedCallback(){super.connectedCallback();const t=this.constructor.name||this.nodeName;this[pe]=new e(`${t}.update()`,this[Gr]),this.hasUpdated&&this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),this[pe]&&(this[pe].dispose(),this[pe]=void 0)}update(t){this[pe]?this[pe].track(super.update.bind(this,t)):super.update(t)}},n=Gr,i}function R(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error("number"==typeof t?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var ac={};function Go(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:ac}var cc=Object.assign,kn=Object.getOwnPropertyDescriptor,Ot=Object.defineProperty,Zn=Object.prototype,Pi=[];Object.freeze(Pi);var qo={};Object.freeze(qo);var dc=typeof Proxy<"u",lc=Object.toString();function Ko(){dc||R("Proxy not available")}function Zo(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ve=function(){};function lt(t){return"function"==typeof t}function ee(t){switch(typeof t){case"string":case"symbol":case"number":return!0}return!1}function Yn(t){return null!==t&&"object"==typeof t}function Et(t){if(!Yn(t))return!1;var e=Object.getPrototypeOf(t);if(null==e)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n.toString()===lc}function Yo(t){var e=null==t?void 0:t.constructor;return!!e&&("GeneratorFunction"===e.name||"GeneratorFunction"===e.displayName)}function Xn(t,e,n){Ot(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Xo(t,e,n){Ot(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function se(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return Yn(t)&&!0===t[n]}}function Pe(t){return t instanceof Map}function an(t){return t instanceof Set}var Jo=typeof Object.getOwnPropertySymbols<"u";function uc(t){var e=Object.keys(t);if(!Jo)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter((function(e){return Zn.propertyIsEnumerable.call(t,e)}))):e}var Ge=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Jo?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Qo(t){return null===t?null:"object"==typeof t?""+t:t}function Lt(t,e){return Zn.hasOwnProperty.call(t,e)}var hc=Object.getOwnPropertyDescriptors||function(t){var e={};return Ge(t).forEach((function(n){e[n]=kn(t,n)})),e};function pc(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ir(t,e,n){return e&&pc(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qe(){return qe=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},qe.apply(this,arguments)}function ts(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ri(t,e)}function Ri(t,e){return(Ri=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fc(t,e){if(t){if("string"==typeof t)return Kr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kr(t,e)}}function Kr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function me(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=fc(t))||e){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var be=Symbol("mobx-stored-annotations");function mt(t){return Object.assign((function(e,n){cn(e,n,t)}),t)}function cn(t,e,n){Lt(t,be)||Xn(t,be,qe({},t[be])),Cc(n)||(t[be][e]=n)}var x=Symbol("mobx administration"),dn=function(){function t(t){void 0===t&&(t="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=P.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=t}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach((function(t){return t()}))},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(t){return t()}))},e.reportObserved=function(){return _s(this)},e.reportChanged=function(){Z(),ws(this),Y()},e.toString=function(){return this.name_},t}(),rr=se("Atom",dn);function es(t,e,n){void 0===e&&(e=ve),void 0===n&&(n=ve);var i=new dn(t);return e!==ve&&yd(i,e),n!==ve&&Rs(i,n),i}function gc(t,e){return t===e}function vc(t,e){return ur(t,e)}function mc(t,e){return ur(t,e,1)}function bc(t,e){return Object.is?Object.is(t,e):t===e?0!==t||1/t==1/e:t!=t&&e!=e}var Mn={identity:gc,structural:vc,default:bc,shallow:mc};function Ce(t,e,n){return Ms(t)?t:Array.isArray(t)?j.array(t,{name:n}):Et(t)?j.object(t,void 0,{name:n}):Pe(t)?j.map(t,{name:n}):an(t)?j.set(t,{name:n}):"function"!=typeof t||ar(t)||Nn(t)?t:Yo(t)?Ye(t):Ze(n,t)}function yc(t,e,n){return null==t||ri(t)||ni(t)||ae(t)||$e(t)?t:Array.isArray(t)?j.array(t,{name:n,deep:!1}):Et(t)?j.object(t,void 0,{name:n,deep:!1}):Pe(t)?j.map(t,{name:n,deep:!1}):an(t)?j.set(t,{name:n,deep:!1}):void 0}function Jn(t){return t}function _c(t,e){return ur(t,e)?e:t}var wc="override";function Cc(t){return t.annotationType_===wc}function ln(t,e){return{annotationType_:t,options_:e,make_:Sc,extend_:xc}}function Sc(t,e,n,i){var r;if(null!=(r=this.options_)&&r.bound)return null===this.extend_(t,e,n,!1)?0:1;if(i===t.target_)return null===this.extend_(t,e,n,!1)?0:2;if(ar(n.value))return 1;var o=ns(t,this,e,n,!1);return Ot(i,e,o),2}function xc(t,e,n,i){var r=ns(t,this,e,n);return t.defineProperty_(e,r,i)}function Ac(t,e,n,i){e.annotationType_,i.value}function ns(t,e,n,i,r){var o,s,a,l,d,c,u;void 0===r&&(r=b.safeDescriptors),Ac(t,e,n,i);var h,p=i.value;null!=(o=e.options_)&&o.bound&&(p=p.bind(null!=(h=t.proxy_)?h:t.target_));return{value:Se(null!=(s=null==(a=e.options_)?void 0:a.name)?s:n.toString(),p,null!=(l=null==(d=e.options_)?void 0:d.autoAction)&&l,null!=(c=e.options_)&&c.bound?null!=(u=t.proxy_)?u:t.target_:void 0),configurable:!r||t.isPlainObject_,enumerable:!1,writable:!r}}function is(t,e){return{annotationType_:t,options_:e,make_:Oc,extend_:Ec}}function Oc(t,e,n,i){var r;if(i===t.target_)return null===this.extend_(t,e,n,!1)?0:2;if(null!=(r=this.options_)&&r.bound&&(!Lt(t.target_,e)||!Nn(t.target_[e]))&&null===this.extend_(t,e,n,!1))return 0;if(Nn(n.value))return 1;var o=rs(t,this,e,n,!1,!1);return Ot(i,e,o),2}function Ec(t,e,n,i){var r,o=rs(t,this,e,n,null==(r=this.options_)?void 0:r.bound);return t.defineProperty_(e,o,i)}function Pc(t,e,n,i){e.annotationType_,i.value}function rs(t,e,n,i,r,o){void 0===o&&(o=b.safeDescriptors),Pc(t,e,n,i);var s,a=i.value;(Nn(a)||(a=Ye(a)),r)&&((a=a.bind(null!=(s=t.proxy_)?s:t.target_)).isMobXFlow=!0);return{value:a,configurable:!o||t.isPlainObject_,enumerable:!1,writable:!o}}function or(t,e){return{annotationType_:t,options_:e,make_:Rc,extend_:$c}}function Rc(t,e,n){return null===this.extend_(t,e,n,!1)?0:1}function $c(t,e,n,i){return Tc(t,this,e,n),t.defineComputedProperty_(e,qe({},this.options_,{get:n.get,set:n.set}),i)}function Tc(t,e,n,i){e.annotationType_,i.get}function Qn(t,e){return{annotationType_:t,options_:e,make_:kc,extend_:Mc}}function kc(t,e,n){return null===this.extend_(t,e,n,!1)?0:1}function Mc(t,e,n,i){var r,o;return Ic(t,this),t.defineObservableProperty_(e,n.value,null!=(r=null==(o=this.options_)?void 0:o.enhancer)?r:Ce,i)}function Ic(t,e,n,i){e.annotationType_}var Bc="true",Lc=os();function os(t){return{annotationType_:Bc,options_:t,make_:Dc,extend_:Nc}}function Dc(t,e,n,i){var r,o,s,a;if(n.get)return ti.make_(t,e,n,i);if(n.set){var l=Se(e.toString(),n.set);return i===t.target_?null===t.defineProperty_(e,{configurable:!b.safeDescriptors||t.isPlainObject_,set:l})?0:2:(Ot(i,e,{configurable:!0,set:l}),2)}if(i!==t.target_&&"function"==typeof n.value)return Yo(n.value)?(null!=(a=this.options_)&&a.autoBind?Ye.bound:Ye).make_(t,e,n,i):(null!=(s=this.options_)&&s.autoBind?Ze.bound:Ze).make_(t,e,n,i);var d,c=!1===(null==(r=this.options_)?void 0:r.deep)?j.ref:j;"function"==typeof n.value&&null!=(o=this.options_)&&o.autoBind&&(n.value=n.value.bind(null!=(d=t.proxy_)?d:t.target_));return c.make_(t,e,n,i)}function Nc(t,e,n,i){var r,o,s;if(n.get)return ti.extend_(t,e,n,i);if(n.set)return t.defineProperty_(e,{configurable:!b.safeDescriptors||t.isPlainObject_,set:Se(e.toString(),n.set)},i);"function"==typeof n.value&&null!=(r=this.options_)&&r.autoBind&&(n.value=n.value.bind(null!=(s=t.proxy_)?s:t.target_));return(!1===(null==(o=this.options_)?void 0:o.deep)?j.ref:j).extend_(t,e,n,i)}var Uc="observable",jc="observable.ref",Fc="observable.shallow",Vc="observable.struct",ss={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function _n(t){return t||ss}Object.freeze(ss);var as=Qn(Uc),Hc=Qn(jc,{enhancer:Jn}),zc=Qn(Fc,{enhancer:yc}),Wc=Qn(Vc,{enhancer:_c}),cs=mt(as);function wn(t){return!0===t.deep?Ce:!1===t.deep?Jn:qc(t.defaultDecorator)}function Gc(t){var e;return t?null!=(e=t.defaultDecorator)?e:os(t):void 0}function qc(t){var e,n;return t&&null!=(e=null==(n=t.options_)?void 0:n.enhancer)?e:Ce}function ds(t,e,n){if(!ee(e))return Ms(t)?t:Et(t)?j.object(t,e,n):Array.isArray(t)?j.array(t,e):Pe(t)?j.map(t,e):an(t)?j.set(t,e):"object"==typeof t&&null!==t?t:j.box(t,e);cn(t,e,as)}Object.assign(ds,cs);var Kc={box:function(t,e){var n=_n(e);return new _e(t,wn(n),n.name,!0,n.equals)},array:function(t,e){var n=_n(e);return(!1===b.useProxies||!1===n.proxy?Nd:Rd)(t,wn(n),n.name)},map:function(t,e){var n=_n(e);return new Ds(t,wn(n),n.name)},set:function(t,e){var n=_n(e);return new js(t,wn(n),n.name)},object:function(t,e,n){return Ts(!1===b.useProxies||!1===(null==n?void 0:n.proxy)?ii({},n):Od({},n),t,e)},ref:mt(Hc),shallow:mt(zc),deep:cs,struct:mt(Wc)},j=cc(ds,Kc),ls="computed",Zc="computed.struct",us=or(ls),Yc=or(Zc,{equals:Mn.structural}),ti=function(t,e){if(ee(e))return cn(t,e,us);if(Et(t))return mt(or(ls,t));var n=Et(e)?e:{};return n.get=t,n.name||(n.name=t.name||""),new Ke(n)};Object.assign(ti,us),ti.struct=mt(Yc);var Zr,Yr,ps,In=0,Xc=1,Jc=null!=(Zr=null==(Yr=kn((function(){}),"name"))?void 0:Yr.configurable)&&Zr,Xr={value:"action",configurable:!0,writable:!1,enumerable:!1};function Se(t,e,n,i){function r(){return hs(t,n,e,i||this,arguments)}return void 0===n&&(n=!1),r.isMobxAction=!0,Jc&&(Xr.value=t,Object.defineProperty(r,"name",Xr)),r}function hs(t,e,n,i,r){var o=Qc(t,e);try{return n.apply(i,r)}catch(t){throw o.error_=t,t}finally{td(o)}}function Qc(t,e,n,i){var r=b.trackingDerivation,o=!e||!r;Z();var s=b.allowStateChanges;o&&(Re(),s=un(!0));var a={runAsAction_:o,prevDerivation_:r,prevAllowStateChanges_:s,prevAllowStateReads_:sr(!0),notifySpy_:!1,startTime_:0,actionId_:Xc++,parentActionId_:In};return In=a.actionId_,a}function td(t){In!==t.actionId_&&R(30),In=t.parentActionId_,void 0!==t.error_&&(b.suppressReactionErrors=!0),hn(t.prevAllowStateChanges_),je(t.prevAllowStateReads_),Y(),t.runAsAction_&&Dt(t.prevDerivation_),b.suppressReactionErrors=!1}function ed(t,e){var n=un(t);try{return e()}finally{hn(n)}}function un(t){var e=b.allowStateChanges;return b.allowStateChanges=t,e}function hn(t){b.allowStateChanges=t}ps=Symbol.toPrimitive;var fs,_e=function(t){function e(e,n,i,r,o){var s;return void 0===i&&(i="ObservableValue"),void 0===o&&(o=Mn.default),(s=t.call(this,i)||this).enhancer=void 0,s.name_=void 0,s.equals=void 0,s.hasUnreportedChange_=!1,s.interceptors_=void 0,s.changeListeners_=void 0,s.value_=void 0,s.dehancer=void 0,s.enhancer=n,s.name_=i,s.equals=o,s.value_=n(e,void 0,i),s}ts(e,t);var n=e.prototype;return n.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},n.set=function(t){this.value_,(t=this.prepareNewValue_(t))!==b.UNCHANGED&&this.setNewValue_(t)},n.prepareNewValue_=function(t){if(tt(this)){var e=et(this,{object:this,type:bt,newValue:t});if(!e)return b.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value_,this.name_),this.equals(this.value_,t)?b.UNCHANGED:t},n.setNewValue_=function(t){var e=this.value_;this.value_=t,this.reportChanged(),ct(this)&&dt(this,{type:bt,object:this,newValue:t,oldValue:e})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(t){return pn(this,t)},n.observe_=function(t,e){return e&&t({observableKind:"value",debugObjectName:this.name_,object:this,type:bt,newValue:this.value_,oldValue:void 0}),fn(this,t)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Qo(this.get())},n[ps]=function(){return this.valueOf()},e}(dn);fs=Symbol.toPrimitive;var P,Jt,Ke=function(){function t(t){this.dependenciesState_=P.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=P.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Bn(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Jt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,t.get||R(31),this.derivation=t.get,this.name_=t.name||"ComputedValue",t.set&&(this.setter_=Se("ComputedValue-setter",t.set)),this.equals_=t.equals||(t.compareStructural||t.struct?Mn.structural:Mn.default),this.scope_=t.context,this.requiresReaction_=t.requiresReaction,this.keepAlive_=!!t.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){od(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach((function(t){return t()}))},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(t){return t()}))},e.get=function(){if(this.isComputing_&&R(32,this.name_,this.derivation),0!==b.inBatch||0!==this.observers_.size||this.keepAlive_){if(_s(this),$i(this)){var t=b.trackingContext;this.keepAlive_&&!t&&(b.trackingContext=this),this.trackAndCompute()&&rd(this),b.trackingContext=t}}else $i(this)&&(this.warnAboutUntrackedRead_(),Z(),this.value_=this.computeValue_(!1),Y());var e=this.value_;if(En(e))throw e.cause;return e},e.set=function(t){if(this.setter_){this.isRunningSetter_&&R(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,t)}finally{this.isRunningSetter_=!1}}else R(34,this.name_)},e.trackAndCompute=function(){var t=this.value_,e=this.dependenciesState_===P.NOT_TRACKING_,n=this.computeValue_(!0),i=e||En(t)||En(n)||!this.equals_(t,n);return i&&(this.value_=n),i},e.computeValue_=function(t){this.isComputing_=!0;var e,n=un(!1);if(t)e=gs(this,this.derivation,this.scope_);else if(!0===b.disableErrorBoundaries)e=this.derivation.call(this.scope_);else try{e=this.derivation.call(this.scope_)}catch(t){e=new Bn(t)}return hn(n),this.isComputing_=!1,e},e.suspend_=function(){this.keepAlive_||(Ti(this),this.value_=void 0)},e.observe_=function(t,e){var n=this,i=!0,r=void 0;return fd((function(){var o=n.get();if(!i||e){var s=Re();t({observableKind:"computed",debugObjectName:n.name_,type:bt,object:n,newValue:o,oldValue:r}),Dt(s)}i=!1,r=o}))},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Qo(this.get())},e[fs]=function(){return this.valueOf()},t}(),ei=se("ComputedValue",Ke);!function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"}(P||(P={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(Jt||(Jt={}));var Bn=function(t){this.cause=void 0,this.cause=t};function En(t){return t instanceof Bn}function $i(t){switch(t.dependenciesState_){case P.UP_TO_DATE_:return!1;case P.NOT_TRACKING_:case P.STALE_:return!0;case P.POSSIBLY_STALE_:for(var e=sr(!0),n=Re(),i=t.observing_,r=i.length,o=0;o<r;o++){var s=i[o];if(ei(s)){if(b.disableErrorBoundaries)s.get();else try{s.get()}catch{return Dt(n),je(e),!0}if(t.dependenciesState_===P.STALE_)return Dt(n),je(e),!0}}return ms(t),Dt(n),je(e),!1}}function gs(t,e,n){var i=sr(!0);ms(t),t.newObserving_=new Array(t.observing_.length+100),t.unboundDepsCount_=0,t.runId_=++b.runId;var r,o=b.trackingDerivation;if(b.trackingDerivation=t,b.inBatch++,!0===b.disableErrorBoundaries)r=e.call(n);else try{r=e.call(n)}catch(t){r=new Bn(t)}return b.inBatch--,b.trackingDerivation=o,nd(t),je(i),r}function nd(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,i=P.UP_TO_DATE_,r=0,o=t.unboundDepsCount_,s=0;s<o;s++){var a=n[s];0===a.diffValue_&&(a.diffValue_=1,r!==s&&(n[r]=a),r++),a.dependenciesState_>i&&(i=a.dependenciesState_)}for(n.length=r,t.newObserving_=null,o=e.length;o--;){var l=e[o];0===l.diffValue_&&bs(l,t),l.diffValue_=0}for(;r--;){var d=n[r];1===d.diffValue_&&(d.diffValue_=0,id(d,t))}i!==P.UP_TO_DATE_&&(t.dependenciesState_=i,t.onBecomeStale_())}function Ti(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)bs(e[n],t);t.dependenciesState_=P.NOT_TRACKING_}function vs(t){var e=Re();try{return t()}finally{Dt(e)}}function Re(){var t=b.trackingDerivation;return b.trackingDerivation=null,t}function Dt(t){b.trackingDerivation=t}function sr(t){var e=b.allowStateReads;return b.allowStateReads=t,e}function je(t){b.allowStateReads=t}function ms(t){if(t.dependenciesState_!==P.UP_TO_DATE_){t.dependenciesState_=P.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=P.UP_TO_DATE_}}var yi=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},_i=!0,b=function(){var t=Go();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(_i=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new yi).version&&(_i=!1),_i?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new yi):(setTimeout((function(){R(35)}),1),new yi)}();function id(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function bs(t,e){t.observers_.delete(e),0===t.observers_.size&&ys(t)}function ys(t){!1===t.isPendingUnobservation_&&(t.isPendingUnobservation_=!0,b.pendingUnobservations.push(t))}function Z(){b.inBatch++}function Y(){if(0==--b.inBatch){Cs();for(var t=b.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation_=!1,0===n.observers_.size&&(n.isBeingObserved_&&(n.isBeingObserved_=!1,n.onBUO()),n instanceof Ke&&n.suspend_())}b.pendingUnobservations=[]}}function _s(t){var e=b.trackingDerivation;return null!==e?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved_&&b.trackingContext&&(t.isBeingObserved_=!0,t.onBO())),!0):(0===t.observers_.size&&b.inBatch>0&&ys(t),!1)}function ws(t){t.lowestObserverState_!==P.STALE_&&(t.lowestObserverState_=P.STALE_,t.observers_.forEach((function(t){t.dependenciesState_===P.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=P.STALE_})))}function rd(t){t.lowestObserverState_!==P.STALE_&&(t.lowestObserverState_=P.STALE_,t.observers_.forEach((function(e){e.dependenciesState_===P.POSSIBLY_STALE_?e.dependenciesState_=P.STALE_:e.dependenciesState_===P.UP_TO_DATE_&&(t.lowestObserverState_=P.UP_TO_DATE_)})))}function od(t){t.lowestObserverState_===P.UP_TO_DATE_&&(t.lowestObserverState_=P.POSSIBLY_STALE_,t.observers_.forEach((function(t){t.dependenciesState_===P.UP_TO_DATE_&&(t.dependenciesState_=P.POSSIBLY_STALE_,t.onBecomeStale_())})))}var Ln=function(){function t(t,e,n,i){void 0===t&&(t="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=P.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=Jt.NONE,this.name_=t,this.onInvalidate_=e,this.errorHandler_=n,this.requiresObservable_=i}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,b.pendingReactions.push(this),Cs())},e.isScheduled=function(){return this.isScheduled_},e.runReaction_=function(){if(!this.isDisposed_){Z(),this.isScheduled_=!1;var t=b.trackingContext;if(b.trackingContext=this,$i(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(t){this.reportExceptionInDerivation_(t)}}b.trackingContext=t,Y()}},e.track=function(t){if(!this.isDisposed_){Z(),this.isRunning_=!0;var e=b.trackingContext;b.trackingContext=this;var n=gs(this,t,void 0);b.trackingContext=e,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&Ti(this),En(n)&&this.reportExceptionInDerivation_(n.cause),Y()}},e.reportExceptionInDerivation_=function(t){var e=this;if(this.errorHandler_)this.errorHandler_(t,this);else{if(b.disableErrorBoundaries)throw t;var n="[mobx] uncaught error in '"+this+"'";b.suppressReactionErrors||console.error(n,t),b.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},e.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(Z(),Ti(this),Y()))},e.getDisposer_=function(){var t=this.dispose.bind(this);return t[x]=this,t},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(t){void 0===t&&(t=!1),Sd(this,t)},t}(),sd=100,ad=function(t){return t()};function Cs(){b.inBatch>0||b.isRunningReactions||ad(cd)}function cd(){b.isRunningReactions=!0;for(var t=b.pendingReactions,e=0;t.length>0;){++e===sd&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction_()}b.isRunningReactions=!1}var Dn=se("Reaction",Ln);function Fe(){return!1}function dd(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Ss="action",ld="action.bound",xs="autoAction",ud="autoAction.bound",As="<unnamed action>",Os=ln(Ss),hd=ln(ld,{bound:!0}),Es=ln(xs,{autoAction:!0}),pd=ln(ud,{autoAction:!0,bound:!0});function Ps(t){return function(e,n){return lt(e)?Se(e.name||As,e,t):lt(n)?Se(e,n,t):ee(n)?cn(e,n,t?Es:Os):ee(e)?mt(ln(t?xs:Ss,{name:e,autoAction:t})):void 0}}var ye=Ps(!1);Object.assign(ye,Os);var Ze=Ps(!0);function ki(t){return hs(t.name||As,!1,t,this,void 0)}function ar(t){return lt(t)&&!0===t.isMobxAction}function fd(t,e){var n,i;void 0===e&&(e=qo);var r,o=null!=(n=null==(i=e)?void 0:i.name)?n:"Autorun";if(!e.scheduler&&!e.delay)r=new Ln(o,(function(){this.track(l)}),e.onError,e.requiresObservable);else{var s=vd(e),a=!1;r=new Ln(o,(function(){a||(a=!0,s((function(){a=!1,r.isDisposed_||r.track(l)})))}),e.onError,e.requiresObservable)}function l(){t(r)}return r.schedule_(),r.getDisposer_()}Object.assign(Ze,Es),ye.bound=mt(hd),Ze.bound=mt(pd);var gd=function(t){return t()};function vd(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:gd}var md="onBO",bd="onBUO";function yd(t,e,n){return $s(md,t,e,n)}function Rs(t,e,n){return $s(bd,t,e,n)}function $s(t,e,n,i){var r=Xe(e),o=lt(i)?i:n,s=t+"L";return r[s]?r[s].add(o):r[s]=new Set([o]),function(){var t=r[s];t&&(t.delete(o),0===t.size&&delete r[s])}}function Ts(t,e,n,i){var r=hc(e),o=ii(t,i)[x];Z();try{Ge(r).forEach((function(t){o.extend_(t,r[t],!n||!(t in n)||n[t])}))}finally{Y()}return t}var _d=0;function ks(){this.message="FLOW_CANCELLED"}ks.prototype=Object.create(Error.prototype);var Jr=is("flow"),wd=is("flow.bound",{bound:!0}),Ye=Object.assign((function(t,e){if(ee(e))return cn(t,e,Jr);var n=t,i=n.name||"<unnamed flow>",r=function(){var t,e=arguments,r=++_d,o=ye(i+" - runid: "+r+" - init",n).apply(this,e),s=void 0,a=new Promise((function(e,n){var a=0;function l(t){var e;s=void 0;try{e=ye(i+" - runid: "+r+" - yield "+a++,o.next).call(o,t)}catch(t){return n(t)}c(e)}function d(t){var e;s=void 0;try{e=ye(i+" - runid: "+r+" - yield "+a++,o.throw).call(o,t)}catch(t){return n(t)}c(e)}function c(t){if(!lt(null==t?void 0:t.then))return t.done?e(t.value):(s=Promise.resolve(t.value)).then(l,d);t.then(c,n)}t=n,l(void 0)}));return a.cancel=ye(i+" - runid: "+r+" - cancel",(function(){try{s&&Qr(s);var e=o.return(void 0),n=Promise.resolve(e.value);n.then(ve,ve),Qr(n),t(new ks)}catch(e){t(e)}})),a};return r.isMobXFlow=!0,r}),Jr);function Qr(t){lt(t.cancel)&&t.cancel()}function Nn(t){return!0===(null==t?void 0:t.isMobXFlow)}function Cd(t,e){return!!t&&(ri(t)||!!t[x]||rr(t)||Dn(t)||ei(t))}function Ms(t){return Cd(t)}function Sd(){R("trace() is not available in production builds");for(var t=!1,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];"boolean"==typeof n[n.length-1]&&(t=n.pop());var r=xd(n);if(!r)return R("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing_===Jt.NONE&&console.log("[mobx.trace] '"+r.name_+"' tracing enabled"),r.isTracing_=t?Jt.BREAK:Jt.LOG}function xd(t){switch(t.length){case 0:return b.trackingDerivation;case 1:return Xe(t[0]);case 2:return Xe(t[0],t[1])}}function At(t,e){void 0===e&&(e=void 0),Z();try{return t.apply(e)}finally{Y()}}function fe(t){return t[x]}Ye.bound=mt(wd);var Ad={has:function(t,e){return fe(t).has_(e)},get:function(t,e){return fe(t).get_(e)},set:function(t,e,n){var i;return!!ee(e)&&(null==(i=fe(t).set_(e,n,!0))||i)},deleteProperty:function(t,e){var n;return!!ee(e)&&(null==(n=fe(t).delete_(e,!0))||n)},defineProperty:function(t,e,n){var i;return null==(i=fe(t).defineProperty_(e,n))||i},ownKeys:function(t){return fe(t).ownKeys_()},preventExtensions:function(t){R(13)}};function Od(t,e){var n,i;return Ko(),null!=(i=(n=(t=ii(t,e))[x]).proxy_)?i:n.proxy_=new Proxy(t,Ad)}function tt(t){return void 0!==t.interceptors_&&t.interceptors_.length>0}function pn(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Zo((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function et(t,e){var n=Re();try{for(var i=[].concat(t.interceptors_||[]),r=0,o=i.length;r<o&&((e=i[r](e))&&!e.type&&R(14),e);r++);return e}finally{Dt(n)}}function ct(t){return void 0!==t.changeListeners_&&t.changeListeners_.length>0}function fn(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Zo((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function dt(t,e){var n=Re(),i=t.changeListeners_;if(i){for(var r=0,o=(i=i.slice()).length;r<o;r++)i[r](e);Dt(n)}}var wi=Symbol("mobx-keys");function cr(t,e,n){if(Et(t))return Ts(t,t,e,n);var i=ii(t,n)[x];if(!t[wi]){var r=Object.getPrototypeOf(t),o=new Set([].concat(Ge(t),Ge(r)));o.delete("constructor"),o.delete(x),Xn(r,wi,o)}Z();try{t[wi].forEach((function(t){return i.make_(t,!e||!(t in e)||e[t])}))}finally{Y()}return t}var to="splice",bt="update",Ed=1e4,Pd={get:function(t,e){var n=t[x];return e===x?n:"length"===e?n.getArrayLength_():"string"!=typeof e||isNaN(e)?Lt(Un,e)?Un[e]:t[e]:n.get_(parseInt(e))},set:function(t,e,n){var i=t[x];return"length"===e&&i.setArrayLength_(n),"symbol"==typeof e||isNaN(e)?t[e]=n:i.set_(parseInt(e),n),!0},preventExtensions:function(){R(15)}},dr=function(){function t(t,e,n,i){void 0===t&&(t="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=n,this.legacyMode_=i,this.atom_=new dn(t),this.enhancer_=function(t,n){return e(t,n,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.dehanceValues_=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},e.intercept_=function(t){return pn(this,t)},e.observe_=function(t,e){return void 0===e&&(e=!1),e&&t({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),fn(this,t)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(t){("number"!=typeof t||isNaN(t)||t<0)&&R("Out of range: "+t);var e=this.values_.length;if(t!==e)if(t>e){for(var n=new Array(t-e),i=0;i<t-e;i++)n[i]=void 0;this.spliceWithArray_(e,0,n)}else this.spliceWithArray_(t,e-t)},e.updateArrayLength_=function(t,e){t!==this.lastKnownLength_&&R(16),this.lastKnownLength_+=e,this.legacyMode_&&e>0&&Hs(t+e+1)},e.spliceWithArray_=function(t,e,n){var i=this;this.atom_;var r=this.values_.length;if(void 0===t?t=0:t>r?t=r:t<0&&(t=Math.max(0,r+t)),e=1===arguments.length?r-t:null==e?0:Math.max(0,Math.min(e,r-t)),void 0===n&&(n=Pi),tt(this)){var o=et(this,{object:this.proxy_,type:to,index:t,removedCount:e,added:n});if(!o)return Pi;e=o.removedCount,n=o.added}if(n=0===n.length?n:n.map((function(t){return i.enhancer_(t,void 0)})),this.legacyMode_){var s=n.length-e;this.updateArrayLength_(r,s)}var a=this.spliceItemsIntoValues_(t,e,n);return(0!==e||0!==n.length)&&this.notifyArraySplice_(t,n,a),this.dehanceValues_(a)},e.spliceItemsIntoValues_=function(t,e,n){var i;if(n.length<Ed)return(i=this.values_).splice.apply(i,[t,e].concat(n));var r=this.values_.slice(t,t+e),o=this.values_.slice(t+e);this.values_.length+=n.length-e;for(var s=0;s<n.length;s++)this.values_[t+s]=n[s];for(var a=0;a<o.length;a++)this.values_[t+n.length+a]=o[a];return r},e.notifyArrayChildUpdate_=function(t,e,n){var i=!this.owned_&&Fe(),r=ct(this),o=r||i?{observableKind:"array",object:this.proxy_,type:bt,debugObjectName:this.atom_.name_,index:t,newValue:e,oldValue:n}:null;this.atom_.reportChanged(),r&&dt(this,o)},e.notifyArraySplice_=function(t,e,n){var i=!this.owned_&&Fe(),r=ct(this),o=r||i?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:to,index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom_.reportChanged(),r&&dt(this,o)},e.get_=function(t){if(t<this.values_.length)return this.atom_.reportObserved(),this.dehanceValue_(this.values_[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX")},e.set_=function(t,e){var n=this.values_;if(t<n.length){this.atom_;var i=n[t];if(tt(this)){var r=et(this,{type:bt,object:this.proxy_,index:t,newValue:e});if(!r)return;e=r.newValue}(e=this.enhancer_(e,i))!==i&&(n[t]=e,this.notifyArrayChildUpdate_(t,e,i))}else t===n.length?this.spliceWithArray_(t,0,[e]):R(17,t,n.length)},t}();function Rd(t,e,n,i){void 0===n&&(n="ObservableArray"),void 0===i&&(i=!1),Ko();var r=new dr(n,e,i,!1);Xo(r.values_,x,r);var o=new Proxy(r.values_,Pd);if(r.proxy_=o,t&&t.length){var s=un(!0);r.spliceWithArray_(0,0,t),hn(s)}return o}var Un={clear:function(){return this.splice(0)},replace:function(t){var e=this[x];return e.spliceWithArray_(0,e.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var o=this[x];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,e)}return o.spliceWithArray_(t,e,i)},spliceWithArray:function(t,e,n){return this[x].spliceWithArray_(t,e,n)},push:function(){for(var t=this[x],e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[x].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[x],e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return b.trackingDerivation&&R(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){b.trackingDerivation&&R(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var e=this[x],n=e.dehanceValues_(e.values_).indexOf(t);return n>-1&&(this.splice(n,1),!0)}};function N(t,e){"function"==typeof Array.prototype[t]&&(Un[t]=e(t))}function $t(t){return function(){var e=this[x];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function Vt(t){return function(e,n){var i=this,r=this[x];return r.atom_.reportObserved(),r.dehanceValues_(r.values_)[t]((function(t,r){return e.call(n,t,r,i)}))}}function Is(t){return function(){var e=this,n=this[x];n.atom_.reportObserved();var i=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(t,n,i){return r(t,n,i,e)},i[t].apply(i,arguments)}}N("concat",$t),N("flat",$t),N("includes",$t),N("indexOf",$t),N("join",$t),N("lastIndexOf",$t),N("slice",$t),N("toString",$t),N("toLocaleString",$t),N("every",Vt),N("filter",Vt),N("find",Vt),N("findIndex",Vt),N("flatMap",Vt),N("forEach",Vt),N("map",Vt),N("some",Vt),N("reduce",Is),N("reduceRight",Is);var $d=se("ObservableArrayAdministration",dr);function ni(t){return Yn(t)&&$d(t[x])}var Bs,Ls,Td={},It="add",jn="delete";Bs=Symbol.iterator,Ls=Symbol.toStringTag;var Ds=function(){function t(t,e,n){var i=this;void 0===e&&(e=Ce),void 0===n&&(n="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[x]=Td,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=e,this.name_=n,lt(Map)||R(18),this.keysAtom_=es("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,ed(!0,(function(){i.merge(t)}))}var e=t.prototype;return e.has_=function(t){return this.data_.has(t)},e.has=function(t){var e=this;if(!b.trackingDerivation)return this.has_(t);var n=this.hasMap_.get(t);if(!n){var i=n=new _e(this.has_(t),Jn,"ObservableMap.key?",!1);this.hasMap_.set(t,i),Rs(i,(function(){return e.hasMap_.delete(t)}))}return n.get()},e.set=function(t,e){var n=this.has_(t);if(tt(this)){var i=et(this,{type:n?bt:It,object:this,newValue:e,name:t});if(!i)return this;e=i.newValue}return n?this.updateValue_(t,e):this.addValue_(t,e),this},e.delete=function(t){var e=this;if((this.keysAtom_,tt(this))&&!et(this,{type:jn,object:this,name:t}))return!1;if(this.has_(t)){var n=Fe(),i=ct(this),r=i||n?{observableKind:"map",debugObjectName:this.name_,type:jn,object:this,oldValue:this.data_.get(t).value_,name:t}:null;return At((function(){var n;e.keysAtom_.reportChanged(),null==(n=e.hasMap_.get(t))||n.setNewValue_(!1),e.data_.get(t).setNewValue_(void 0),e.data_.delete(t)})),i&&dt(this,r),!0}return!1},e.updateValue_=function(t,e){var n=this.data_.get(t);if((e=n.prepareNewValue_(e))!==b.UNCHANGED){var i=Fe(),r=ct(this),o=r||i?{observableKind:"map",debugObjectName:this.name_,type:bt,object:this,oldValue:n.value_,name:t,newValue:e}:null;n.setNewValue_(e),r&&dt(this,o)}},e.addValue_=function(t,e){var n=this;this.keysAtom_,At((function(){var i,r=new _e(e,n.enhancer_,"ObservableMap.key",!1);n.data_.set(t,r),e=r.value_,null==(i=n.hasMap_.get(t))||i.setNewValue_(!0),n.keysAtom_.reportChanged()}));var i=Fe(),r=ct(this),o=r||i?{observableKind:"map",debugObjectName:this.name_,type:It,object:this,name:t,newValue:e}:null;r&&dt(this,o)},e.get=function(t){return this.has(t)?this.dehanceValue_(this.data_.get(t).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var t=this,e=this.keys();return Je({next:function(){var n=e.next(),i=n.done,r=n.value;return{done:i,value:i?void 0:t.get(r)}}})},e.entries=function(){var t=this,e=this.keys();return Je({next:function(){var n=e.next(),i=n.done,r=n.value;return{done:i,value:i?void 0:[r,t.get(r)]}}})},e[Bs]=function(){return this.entries()},e.forEach=function(t,e){for(var n,i=me(this);!(n=i()).done;){var r=n.value,o=r[0],s=r[1];t.call(e,s,o,this)}},e.merge=function(t){var e=this;return ae(t)&&(t=new Map(t)),At((function(){Et(t)?uc(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=t[0],i=t[1];return e.set(n,i)})):Pe(t)?(t.constructor!==Map&&R(19,t),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&R(20,t)})),this},e.clear=function(){var t=this;At((function(){vs((function(){for(var e,n=me(t.keys());!(e=n()).done;){var i=e.value;t.delete(i)}}))}))},e.replace=function(t){var e=this;return At((function(){for(var n,i=kd(t),r=new Map,o=!1,s=me(e.data_.keys());!(n=s()).done;){var a=n.value;if(!i.has(a))if(e.delete(a))o=!0;else{var l=e.data_.get(a);r.set(a,l)}}for(var d,c=me(i.entries());!(d=c()).done;){var u=d.value,h=u[0],p=u[1],f=e.data_.has(h);if(e.set(h,p),e.data_.has(h)){var v=e.data_.get(h);r.set(h,v),f||(o=!0)}}if(!o)if(e.data_.size!==r.size)e.keysAtom_.reportChanged();else for(var g=e.data_.keys(),m=r.keys(),b=g.next(),y=m.next();!b.done;){if(b.value!==y.value){e.keysAtom_.reportChanged();break}b=g.next(),y=m.next()}e.data_=r})),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(t,e){return fn(this,t)},e.intercept_=function(t){return pn(this,t)},ir(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Ls,get:function(){return"Map"}}]),t}(),ae=se("ObservableMap",Ds);function kd(t){if(Pe(t)||ae(t))return t;if(Array.isArray(t))return new Map(t);if(Et(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return R(21,t)}var Ns,Us,Md={};Ns=Symbol.iterator,Us=Symbol.toStringTag;var js=function(){function t(t,e,n){void 0===e&&(e=Ce),void 0===n&&(n="ObservableSet"),this.name_=void 0,this[x]=Md,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=n,lt(Set)||R(22),this.atom_=es(this.name_),this.enhancer_=function(t,i){return e(t,i,n)},t&&this.replace(t)}var e=t.prototype;return e.dehanceValue_=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.clear=function(){var t=this;At((function(){vs((function(){for(var e,n=me(t.data_.values());!(e=n()).done;){var i=e.value;t.delete(i)}}))}))},e.forEach=function(t,e){for(var n,i=me(this);!(n=i()).done;){var r=n.value;t.call(e,r,r,this)}},e.add=function(t){var e=this;if((this.atom_,tt(this))&&!et(this,{type:It,object:this,newValue:t}))return this;if(!this.has(t)){At((function(){e.data_.add(e.enhancer_(t,void 0)),e.atom_.reportChanged()}));var n=ct(this),i=n?{observableKind:"set",debugObjectName:this.name_,type:It,object:this,newValue:t}:null;n&&dt(this,i)}return this},e.delete=function(t){var e=this;if(tt(this)&&!et(this,{type:jn,object:this,oldValue:t}))return!1;if(this.has(t)){var n=ct(this),i=n?{observableKind:"set",debugObjectName:this.name_,type:jn,object:this,oldValue:t}:null;return At((function(){e.atom_.reportChanged(),e.data_.delete(t)})),n&&dt(this,i),!0}return!1},e.has=function(t){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(t))},e.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return Je({next:function(){var i=t;return t+=1,i<n.length?{value:[e[i],n[i]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var t=this,e=0,n=Array.from(this.data_.values());return Je({next:function(){return e<n.length?{value:t.dehanceValue_(n[e++]),done:!1}:{done:!0}}})},e.replace=function(t){var e=this;return $e(t)&&(t=new Set(t)),At((function(){Array.isArray(t)||an(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&R("Cannot initialize set from "+t)})),this},e.observe_=function(t,e){return fn(this,t)},e.intercept_=function(t){return pn(this,t)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Ns]=function(){return this.values()},ir(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Us,get:function(){return"Set"}}]),t}(),$e=se("ObservableSet",js),eo=Object.create(null),no="remove",Fs=function(){function t(t,e,n,i){void 0===e&&(e=new Map),void 0===i&&(i=Lc),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=t,this.values_=e,this.name_=n,this.defaultAnnotation_=i,this.keysAtom_=new dn("ObservableObject.keys"),this.isPlainObject_=Et(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(t){return this.values_.get(t).get()},e.setObservablePropValue_=function(t,e){var n=this.values_.get(t);if(n instanceof Ke)return n.set(e),!0;if(tt(this)){var i=et(this,{type:bt,object:this.proxy_||this.target_,name:t,newValue:e});if(!i)return null;e=i.newValue}if((e=n.prepareNewValue_(e))!==b.UNCHANGED){var r=ct(this),o=r?{type:bt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:n.value_,name:t,newValue:e}:null;n.setNewValue_(e),r&&dt(this,o)}return!0},e.get_=function(t){return b.trackingDerivation&&!Lt(this.target_,t)&&this.has_(t),this.target_[t]},e.set_=function(t,e,n){return void 0===n&&(n=!1),Lt(this.target_,t)?this.values_.has(t)?this.setObservablePropValue_(t,e):n?Reflect.set(this.target_,t,e):(this.target_[t]=e,!0):this.extend_(t,{value:e,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,n)},e.has_=function(t){if(!b.trackingDerivation)return t in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var e=this.pendingKeys_.get(t);return e||(e=new _e(t in this.target_,Jn,"ObservableObject.key?",!1),this.pendingKeys_.set(t,e)),e.get()},e.make_=function(t,e){if(!0===e&&(e=this.defaultAnnotation_),!1!==e){if(!(t in this.target_)){var n;if(null!=(n=this.target_[be])&&n[t])return;R(1,e.annotationType_,this.name_+"."+t.toString())}for(var i=this.target_;i&&i!==Zn;){var r=kn(i,t);if(r){var o=e.make_(this,t,r,i);if(0===o)return;if(1===o)break}i=Object.getPrototypeOf(i)}ro(this,e,t)}},e.extend_=function(t,e,n,i){if(void 0===i&&(i=!1),!0===n&&(n=this.defaultAnnotation_),!1===n)return this.defineProperty_(t,e,i);var r=n.extend_(this,t,e,i);return r&&ro(this,n,t),r},e.defineProperty_=function(t,e,n){void 0===n&&(n=!1);try{Z();var i=this.delete_(t);if(!i)return i;if(tt(this)){var r=et(this,{object:this.proxy_||this.target_,name:t,type:It,newValue:e.value});if(!r)return null;var o=r.newValue;e.value!==o&&(e=qe({},e,{value:o}))}if(n){if(!Reflect.defineProperty(this.target_,t,e))return!1}else Ot(this.target_,t,e);this.notifyPropertyAddition_(t,e.value)}finally{Y()}return!0},e.defineObservableProperty_=function(t,e,n,i){void 0===i&&(i=!1);try{Z();var r=this.delete_(t);if(!r)return r;if(tt(this)){var o=et(this,{object:this.proxy_||this.target_,name:t,type:It,newValue:e});if(!o)return null;e=o.newValue}var s=io(t),a={configurable:!b.safeDescriptors||this.isPlainObject_,enumerable:!0,get:s.get,set:s.set};if(i){if(!Reflect.defineProperty(this.target_,t,a))return!1}else Ot(this.target_,t,a);var l=new _e(e,n,"ObservableObject.key",!1);this.values_.set(t,l),this.notifyPropertyAddition_(t,l.value_)}finally{Y()}return!0},e.defineComputedProperty_=function(t,e,n){void 0===n&&(n=!1);try{Z();var i=this.delete_(t);if(!i)return i;if(tt(this))if(!et(this,{object:this.proxy_||this.target_,name:t,type:It,newValue:void 0}))return null;e.name||(e.name="ObservableObject.key"),e.context=this.proxy_||this.target_;var r=io(t),o={configurable:!b.safeDescriptors||this.isPlainObject_,enumerable:!1,get:r.get,set:r.set};if(n){if(!Reflect.defineProperty(this.target_,t,o))return!1}else Ot(this.target_,t,o);this.values_.set(t,new Ke(e)),this.notifyPropertyAddition_(t,void 0)}finally{Y()}return!0},e.delete_=function(t,e){if(void 0===e&&(e=!1),!Lt(this.target_,t))return!0;if(tt(this)&&!et(this,{object:this.proxy_||this.target_,name:t,type:no}))return null;try{var n,i;Z();var r,o=ct(this),s=this.values_.get(t),a=void 0;if(!s&&o)a=null==(r=kn(this.target_,t))?void 0:r.value;if(e){if(!Reflect.deleteProperty(this.target_,t))return!1}else delete this.target_[t];if(s&&(this.values_.delete(t),s instanceof _e&&(a=s.value_),ws(s)),this.keysAtom_.reportChanged(),null==(n=this.pendingKeys_)||null==(i=n.get(t))||i.set(t in this.target_),o){var l={type:no,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:a,name:t};o&&dt(this,l)}}finally{Y()}return!0},e.observe_=function(t,e){return fn(this,t)},e.intercept_=function(t){return pn(this,t)},e.notifyPropertyAddition_=function(t,e){var n,i,r=ct(this);if(r){var o=r?{type:It,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:t,newValue:e}:null;r&&dt(this,o)}null==(n=this.pendingKeys_)||null==(i=n.get(t))||i.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),Ge(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function ii(t,e){var n;if(Lt(t,x))return t;var i=null!=(n=null==e?void 0:e.name)?n:"ObservableObject",r=new Fs(t,new Map,String(i),Gc(e));return Xn(t,x,r),t}var Id=se("ObservableObjectAdministration",Fs);function io(t){return eo[t]||(eo[t]={get:function(){return this[x].getObservablePropValue_(t)},set:function(e){return this[x].setObservablePropValue_(t,e)}})}function ri(t){return!!Yn(t)&&Id(t[x])}function ro(t,e,n){var i;null==(i=t.target_[be])||delete i[n]}var Ci=0,Vs=function(){};function Bd(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):void 0!==t.prototype.__proto__?t.prototype.__proto__=e:t.prototype=e}Bd(Vs,Array.prototype);var lr=function(t,e,n){function i(e,n,i,r){var o;void 0===i&&(i="ObservableArray"),void 0===r&&(r=!1),o=t.call(this)||this;var s=new dr(i,n,r,!0);if(s.proxy_=qr(o),Xo(qr(o),x,s),e&&e.length){var a=un(!0);o.spliceWithArray(0,0,e),hn(a)}return o}ts(i,t);var r=i.prototype;return r.concat=function(){this[x].atom_.reportObserved();for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Array.prototype.concat.apply(this.slice(),e.map((function(t){return ni(t)?t.slice():t})))},r[n]=function(){var t=this,e=0;return Je({next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0,value:void 0}}})},ir(i,[{key:"length",get:function(){return this[x].getArrayLength_()},set:function(t){this[x].setArrayLength_(t)}},{key:e,get:function(){return"Array"}}]),i}(Vs,Symbol.toStringTag,Symbol.iterator);function Ld(t){return{enumerable:!1,configurable:!0,get:function(){return this[x].get_(t)},set:function(e){this[x].set_(t,e)}}}function Dd(t){Ot(lr.prototype,""+t,Ld(t))}function Hs(t){if(t>Ci){for(var e=Ci;e<t+100;e++)Dd(e);Ci=t}}function Nd(t,e,n){return new lr(t,e,n)}function Xe(t,e){if("object"==typeof t&&null!==t){if(ni(t))return void 0!==e&&R(23),t[x].atom_;if($e(t))return t[x];if(ae(t)){if(void 0===e)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||R(25,e,Mi(t)),n}if(ri(t)){if(!e)return R(26);var i=t[x].values_.get(e);return i||R(27,e,Mi(t)),i}if(rr(t)||ei(t)||Dn(t))return t}else if(lt(t)&&Dn(t[x]))return t[x];R(28)}function Ud(t,e){return t||R(29),rr(t)||ei(t)||Dn(t)||ae(t)||$e(t)?t:t[x]?t[x]:void R(24,t)}function Mi(t,e){var n;if(void 0!==e)n=Xe(t,e);else{if(ar(t))return t.name;n=ri(t)||ae(t)||$e(t)?Ud(t):Xe(t)}return n.name_}Object.entries(Un).forEach((function(t){var e=t[0],n=t[1];"concat"!==e&&Xn(lr.prototype,e,n)})),Hs(1e3);var oo=Zn.toString;function ur(t,e,n){return void 0===n&&(n=-1),Ii(t,e,n)}function Ii(t,e,n,i,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;if("function"!==o&&"object"!==o&&"object"!=typeof e)return!1;var s=oo.call(t);if(s!==oo.call(e))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=so(t),e=so(e);var a="[object Array]"===s;if(!a){if("object"!=typeof t||"object"!=typeof e)return!1;var l=t.constructor,d=e.constructor;if(l!==d&&!(lt(l)&&l instanceof l&&lt(d)&&d instanceof d)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),r=r||[];for(var c=(i=i||[]).length;c--;)if(i[c]===t)return r[c]===e;if(i.push(t),r.push(e),a){if((c=t.length)!==e.length)return!1;for(;c--;)if(!Ii(t[c],e[c],n-1,i,r))return!1}else{var u,h=Object.keys(t);if(c=h.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!Lt(e,u=h[c])||!Ii(t[u],e[u],n-1,i,r))return!1}return i.pop(),r.pop(),!0}function so(t){return ni(t)?t.slice():Pe(t)||ae(t)||an(t)||$e(t)?Array.from(t.entries()):t}function Je(t){return t[Symbol.iterator]=jd,t}function jd(){return this}function Fd(t){return sc(t,Ln)}["Symbol","Map","Set"].forEach((function(t){typeof Go()[t]>"u"&&R("MobX requires global '"+t+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:dd,extras:{getDebugName:Mi},$mobx:x});class ce extends(Fd(B)){}var Qe=(t=>(t.attendiSpeechServiceDone="attendi-speech-service-done",t.attendiSpeechServiceCancel="attendi-speech-service-cancel",t.attendiSpeechServiceError="attendi-speech-service-error",t.attendiSpeechSegment="attendi-speech-segment",t))(Qe||{});function Vd(t){return new CustomEvent("attendi-speech-service-done",{detail:t})}function Bi(t){return new CustomEvent("attendi-speech-segment",{detail:t})}function Hd(){return new CustomEvent("attendi-speech-service-cancel",{bubbles:!0,composed:!0})}function zd(t){return new CustomEvent("attendi-speech-service-error",{detail:{error:Wd(t),fullError:t},bubbles:!0,composed:!0})}function Wd(t){return Object.getPrototypeOf(t).constructor.name}E`#ff7449`;const Gd=E`#fe6163`,qd=E`#ef7930`,zs=E`#48c0de`,nt={small:576,medium:768,verticalSmall:400},hr=560,Kd=600,Ws=200,Zd=480,Yd=400,Xd=480,Jd=400,pr=16e3,oi={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},si=t=>(...e)=>({_$litDirective$:t,values:e});
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */class ai{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this.t=t,this._$AM=e,this.i=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */class Li extends ai{constructor(t){if(super(t),this.it=I,t.type!==oi.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===I||null==t)return this._t=void 0,this.it=t;if(t===yt)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Li.directiveName="unsafeHTML",Li.resultType=1;const Qd=si(Li),tl={name:"/"};class el{constructor(){this.history=[],cr(this)}push(t){this.history.push(t)}async pop(){var t,e;return void 0===(null==(t=this.currentRoute.settings)?void 0:t.onWillPop)||await(null==(e=this.currentRoute.settings)?void 0:e.onWillPop())?ki((()=>this.history.pop())):void 0}popUntil(t){for(let e=this.history.length-1;e>=0;e--){const n=this.history[e];if(void 0!==t&&n.name===t)return;this.pop()}}popAll(){this.popUntil()}get currentRoute(){return 0===this.history.length?tl:this.history[this.history.length-1]}}const Nt=new el,de=E`
  .typography {
    font-family: var(
      --attendi-speech-service-font-family,
      "Open Sans",
      "PT Sans",
      Calibri,
      Tahoma,
      sans-serif
    );
  }

  .icon-button {
    border-radius: 50%;
    color: white;
    border-width: 0;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* no (blue) highlight color when tapping on button on mobile phone */
    -webkit-tap-highlight-color: transparent;
  }
`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */,it=si(class extends ai{constructor(t){var e;if(super(t),t.type!==oi.ATTRIBUTE||"class"!==t.name||(null==(e=t.strings)?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(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var n,i;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&(null==(n=this.nt)||!n.has(t))&&this.st.add(t);return this.render(e)}const r=t.element.classList;for(const t of this.st)t in e||(r.remove(t),this.st.delete(t));for(const t in e){const n=!!e[t];n===this.st.has(t)||null!=(i=this.nt)&&i.has(t)||(n?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return yt}}),ci=t=>t??I,nl=J`
  <svg
    viewBox="0 0 56 56"
    fill="currentColor"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      d="M22.5766 34.2601C22.1848 34.6585 21.5425 34.6585 21.1506 34.2601L15.1789 28.1877C14.7871 27.7893 14.1448 27.7893 13.7529 28.1877L12.6896 29.269C12.3069 29.6581 12.3069 30.2822 12.6896 30.6713L21.1506 39.275C21.5425 39.6734 22.1848 39.6734 22.5766 39.275L42.3104 19.2086C42.6931 18.8195 42.6931 18.1954 42.3104 17.8063L41.2471 16.725C40.8552 16.3266 40.2129 16.3266 39.8211 16.725L22.5766 34.2601Z"
    />
  </svg>
`,il=J`
  <svg
    viewBox="0 0 26 32"
    fill="currentColor"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      d="M12.6936 6.24917V0L4.76011 7.81146L12.6936 15.6229V9.37375C17.9456 9.37375 22.2138 13.5763 22.2138 18.7475C22.2138 23.9187 17.9456 28.1213 12.6936 28.1213C7.78411 28.1213 3.73424 24.4489 3.22694 19.7459C3.16771 19.1968 2.72569 18.7475 2.17341 18.7475H0.999999C0.447715 18.7475 -0.00422657 19.1968 0.0399776 19.7473C0.556878 26.1847 6.02221 31.2458 12.6936 31.2458C19.7069 31.2458 25.3872 25.6528 25.3872 18.7475C25.3872 11.8422 19.7069 6.24917 12.6936 6.24917Z"
    />
  </svg>
`,ao=J`
  <svg
    viewBox="0 0 28 28"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M16.7832 7.89312V13.3938C16.7832 14.9281 15.5394 16.1719 14.0051 16.1719C12.4707 16.1719 11.2269 14.9281 11.2269 13.3938V7.89312C11.2269 6.3588 12.4707 5.115 14.0051 5.115C15.5394 5.115 16.7832 6.3588 16.7832 7.89312ZM9.56006 7.89312C9.56006 5.43821 11.5502 3.44812 14.0051 3.44812C16.46 3.44812 18.4501 5.43821 18.4501 7.89312V13.3938C18.4501 15.8487 16.46 17.8388 14.0051 17.8388C11.5502 17.8388 9.56006 15.8487 9.56006 13.3938V7.89312ZM7.61683 17.4684C7.99199 17.1382 8.56376 17.1747 8.89392 17.5498C9.53274 18.2757 10.3191 18.857 11.2004 19.2547C12.081 19.6522 13.0361 19.8573 14.0022 19.8565L14.0058 19.8565L14.0095 19.8565C14.9755 19.8573 15.9307 19.6522 16.8113 19.2547C17.6926 18.857 18.4789 18.2757 19.1178 17.5498C19.4479 17.1747 20.0197 17.1382 20.3948 17.4684C20.77 17.7985 20.8065 18.3703 20.4763 18.7454C19.6674 19.6646 18.6717 20.4006 17.5558 20.9043C16.7161 21.2832 15.823 21.5241 14.9107 21.6196V22.7521H15.9363C16.436 22.7521 16.8411 23.1573 16.8411 23.657C16.8411 24.1567 16.436 24.5619 15.9363 24.5619L14.0058 24.5619L12.0755 24.5619C11.5757 24.5619 11.1706 24.1567 11.1706 23.657C11.1706 23.1573 11.5757 22.7521 12.0755 22.7521H13.1009V21.6195C12.1887 21.5241 11.2955 21.2832 10.4559 20.9043C9.33994 20.4006 8.34425 19.6646 7.53536 18.7454C7.2052 18.3703 7.24168 17.7985 7.61683 17.4684Z"
      fill="currentColor"
    />
  </svg>`,rl=J`
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
    <circle cx="11.7423" cy="11.7423" r="11.7423" />
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M5.7746 17.425C6.16513 17.8155 6.79829 17.8155 7.18882 17.425L11.5706 13.0432L15.9552 17.4221C16.346 17.8124 16.9792 17.812 17.3694 17.4212L17.4313 17.3593C17.8215 16.9685 17.8211 16.3353 17.4303 15.9451L13.0467 11.5671L17.4275 7.18635C17.818 6.79582 17.818 6.16266 17.4275 5.77213L17.3656 5.71025C16.9751 5.31973 16.3419 5.31973 15.9514 5.71025L11.5696 10.092L7.18499 5.71314C6.79421 5.32287 6.16104 5.32328 5.77077 5.71406L5.70893 5.77599C5.31867 6.16677 5.31908 6.79993 5.70986 7.1902L10.0935 11.5681L5.71272 15.9489C5.3222 16.3394 5.3222 16.9726 5.71272 17.3631L5.7746 17.425Z"
      fill="currentColor"
    />
  </svg>
`,co=J`
<svg viewBox="0 0 45 45" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path
        d="M20.126 20.0034L27.6551 43.5318C27.8444 44.1236 27.5182 44.7568 26.9265 44.9462C26.8156 44.9816 26.7 44.9997 26.5836 44.9997H19.1248C17.8822 44.9997 16.8749 43.9924 16.8749 42.7497V30.3748C16.8749 29.1322 15.8675 28.1248 14.6249 28.1248H1.12499C0.503675 28.1248 0 27.6212 0 26.9999V19.1249C0 17.8823 1.00735 16.8749 2.24998 16.8749H15.8401C17.797 16.8749 19.5295 18.1396 20.126 20.0034Z"
        fill="currentColor" />
    <path
        d="M28.1241 2.24998V14.6249C28.1241 15.8675 29.1314 16.8749 30.374 16.8749H43.8739C44.4952 16.8749 44.9989 17.3785 44.9989 17.9998V25.8748C44.9989 27.1174 43.9916 28.1248 42.7489 28.1248H29.1588C27.2019 28.1248 25.4694 26.8601 24.873 24.9963L17.3439 1.46786C17.1545 0.876105 17.4807 0.242884 18.0725 0.0535224C18.1833 0.0180556 18.299 0 18.4153 0H25.8741C27.1167 0 28.1241 1.00735 28.1241 2.24998Z"
        fill="currentColor" />
</svg>`,fr=J`
  <svg viewBox="0 0 54 54" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M27 1.93922e-05C30.5463 -0.00423698 34.0585 0.692214 37.3349 2.04937C40.6112 3.40651 43.5871 5.39759 46.0916 7.90823C48.6022 10.4128 50.5933 13.3888 51.9505 16.6651C53.3076 19.9415 54.0041 23.4537 53.9999 27C54.0042 30.5463 53.3078 34.0585 51.9506 37.3349C50.5934 40.6112 48.6023 43.5871 46.0917 46.0917C43.5871 48.6023 40.6112 50.5934 37.3349 51.9506C34.0585 53.3078 30.5463 54.0042 26.9999 53.9999C23.4537 54.0041 19.9415 53.3076 16.6651 51.9505C13.3888 50.5933 10.4129 48.6023 7.90831 46.0917C5.39764 43.5871 3.40653 40.6112 2.04937 37.3349C0.692218 34.0585 -0.00423343 30.5463 1.93598e-05 27C-0.00416667 23.4537 0.692316 19.9415 2.04947 16.6651C3.40662 13.3888 5.39768 10.4129 7.90829 7.90829C10.4129 5.39768 13.3888 3.40662 16.6651 2.04947C19.9415 0.692319 23.4537 -0.00416283 27 1.93922e-05ZM27 52.0003L27.0026 49.9999C30.0227 50.0039 33.0139 49.4109 35.8041 48.2551C38.5943 47.0993 41.1286 45.4035 43.2614 43.2651L43.2651 43.2614C45.4035 41.1286 47.0993 38.5943 48.2551 35.8041C49.4109 33.0139 50.0039 30.0227 49.9999 27.0026V26.9974C50.0038 23.9773 49.4108 20.9862 48.255 18.1959C47.0992 15.4057 45.4034 12.8713 43.2651 10.7386L43.2614 10.7349C41.1286 8.59648 38.5943 6.90066 35.8041 5.74487C33.0139 4.58908 30.0227 3.99611 27.0026 4.00002H26.9974C23.9773 3.99617 20.9862 4.58918 18.1959 5.74497C15.4057 6.90076 12.8713 8.59655 10.7386 10.7349L10.7349 10.7386C8.59655 12.8713 6.90076 15.4057 5.74497 18.1959C4.58918 20.9862 3.99617 23.9773 4.00002 26.9974V27.0026C3.99611 30.0227 4.58908 33.0139 5.74487 35.8041C6.90066 38.5943 8.59648 41.1286 10.7349 43.2614L10.7386 43.2651C12.8713 45.4034 15.4057 47.0992 18.1959 48.255C20.9862 49.4108 23.9773 50.0038 26.9974 49.9999L27 52.0003ZM27 43.25C27.8288 43.25 28.6236 42.9208 29.2097 42.3347C29.7958 41.7487 30.125 40.9538 30.125 40.125C30.125 39.2962 29.7958 38.5013 29.2097 37.9153C28.6236 37.3292 27.8288 37 27 37C26.1712 37 25.3763 37.3292 24.7903 37.9153C24.2042 38.5013 23.875 39.2962 23.875 40.125C23.875 40.9538 24.2042 41.7487 24.7903 42.3347C25.3763 42.9208 26.1712 43.25 27 43.25ZM29 12C29 10.8954 28.1046 10 27 10C25.8954 10 25 10.8954 25 12V32C25 33.1045 25.8954 34 27 34C28.1046 34 29 33.1045 29 32V12Z"
      fill="currentColor"
      fill-opacity="0.5"
    />
  </svg>
`,ol=J`
  <svg
    viewBox="0 0 29 22"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <circle cx="2.74324" cy="10.7432" r="2.74324" fill="#48C0DE" />
    <circle cx="2.74324" cy="2.74324" r="2.74324" fill="#48C0DE" />
    <circle cx="2.74324" cy="18.7432" r="2.74324" fill="#48C0DE" />
    <circle cx="2.74324" cy="10.7432" r="2.74324" fill="#48C0DE" />
    <circle cx="2.74324" cy="2.74324" r="2.74324" fill="#48C0DE" />
    <circle cx="2.74324" cy="18.7432" r="2.74324" fill="#48C0DE" />
    <rect x="8" y="17" width="21" height="3.5" rx="1.75" fill="#48C0DE" />
    <rect x="8" y="9" width="21" height="3.5" rx="1.75" fill="#48C0DE" />
    <rect x="8" y="1" width="21" height="3.5" rx="1.75" fill="#48C0DE" />
  </svg>
`,sl=J`
  <svg
    viewBox="0 0 15 25"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      d="M14.3338 24.3423C14.545 24.1351 14.7125 23.8891 14.8268 23.6182C14.9412 23.3474 15 23.057 15 22.7638C15 22.4706 14.9412 22.1802 14.8268 21.9093C14.7125 21.6385 14.545 21.3924 14.3338 21.1853L5.49541 12.4981L14.3338 3.81079C14.7598 3.39215 14.999 2.82436 14.999 2.23231C14.999 1.64027 14.7598 1.07247 14.3338 0.653826C13.9079 0.235186 13.3302 1.45976e-07 12.7279 1.98635e-07C12.1255 2.51294e-07 11.5479 0.235186 11.1219 0.653826L0.666169 10.9308C0.454996 11.1379 0.287458 11.3839 0.173148 11.6548C0.0588377 11.9257 -1.63938e-07 12.216 -1.38302e-07 12.5092C-1.12667e-07 12.8025 0.0588378 13.0928 0.173148 13.3637C0.287458 13.6346 0.454996 13.8806 0.666169 14.0877L11.1219 24.3647C11.9875 25.2155 13.4454 25.2155 14.3338 24.3423Z"
      fill="currentColor"
    />
  </svg>
`,al=J`
  <svg
    viewBox="0 0 28 28"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M14 28C11.2311 28 8.52431 27.1789 6.22202 25.6406C3.91973 24.1022 2.12532 21.9157 1.06569 19.3576C0.00606597 16.7994 -0.271181 13.9845 0.269012 11.2687C0.809205 8.55301 2.14258 6.05845 4.10051 4.10051C6.05845 2.14258 8.55301 0.809205 11.2687 0.269012C13.9845 -0.271181 16.7994 0.00606597 19.3576 1.06569C21.9157 2.12532 24.1022 3.91973 25.6406 6.22202C27.1789 8.52431 28 11.2311 28 14C28 17.713 26.525 21.274 23.8995 23.8995C21.274 26.525 17.713 28 14 28ZM14 2.00001C11.6266 2.00001 9.30655 2.70379 7.33316 4.02237C5.35977 5.34095 3.8217 7.21509 2.91345 9.40781C2.0052 11.6005 1.76756 14.0133 2.23058 16.3411C2.69361 18.6689 3.83649 20.8071 5.51472 22.4853C7.19295 24.1635 9.33115 25.3064 11.6589 25.7694C13.9867 26.2325 16.3995 25.9948 18.5922 25.0866C20.7849 24.1783 22.6591 22.6402 23.9776 20.6668C25.2962 18.6935 26 16.3734 26 14C26 10.8174 24.7357 7.76516 22.4853 5.51472C20.2348 3.26429 17.1826 2.00001 14 2.00001ZM12 23V12H16V23H12ZM14 9C15.1046 9 16 8.10457 16 7C16 5.89543 15.1046 5 14 5C12.8954 5 12 5.89543 12 7C12 8.10457 12.8954 9 14 9Z"
      fill="currentColor"
    />
  </svg>
`,cl=J`<svg
  viewBox="0 0 24 24"
  fill="none"
  xmlns="http://www.w3.org/2000/svg"
>
  <defs>
    <linearGradient id="microphoneFillGradient" x1="0%" y1="100%" x2="0%" y2="0%">
      <!-- The offset percentage controls what percentage the microphone cone is filled. 100% Means the microphone is fully filled in. -->
      <stop id="microphoneFill" offset="0%" stop-color="currentColor" />
      <stop id="transparentStop" offset="0%" stop-opacity="0" />
    </linearGradient>
  </defs>

  <path
    id="cone"
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M12 2.5 C9.79086 2.5 8 4.29086 8 6.5 V11.45 C8 13.6591 9.79086 15.45 12 15.45 C14.2091 15.45 16 13.6591 16 11.45 V6.5 C16 4.29086 14.2091 2.5 12 2.5 Z"
    stroke="currentColor"
    stroke-width="2"
    fill="url(#microphoneFillGradient)"
  />

  <path
    id="base"
    fill-rule="evenodd"
    clip-rule="evenodd"
    d="M6.24631 15.1166 C6.58391 14.8195 7.09844 14.8524 7.39555 15.19 C7.97041 15.8432 8.67802 16.3662 9.47113 16.7242 C10.2635 17.0818 11.1231 17.2664 11.9924 17.2657 L11.9957 17.2657 L11.999 17.2657 C12.8683 17.2664 13.7279 17.0818 14.5203 16.7242 C15.3134 16.3662 16.021 15.8432 16.5958 15.19 C16.893 14.8524 17.4075 14.8195 17.7451 15.1166 C18.0827 15.4137 18.1155 15.9283 17.8184 16.2659 C17.0905 17.093 16.1945 17.7553 15.1902 18.2086 C14.4347 18.5496 13.6309 18.7663 12.81 18.8522 V19.8714 H13.7329 C14.1826 19.8714 14.5471 20.236 14.5471 20.6857 C14.5471 21.1354 14.1826 21.5 13.7329 21.5 L11.9957 21.5 L10.2586 21.5 C9.80885 21.5 9.44428 21.1354 9.44428 20.6857 C9.44428 20.236 9.80885 19.8714 10.2586 19.8714 H11.1814 V18.8522 C10.3604 18.7663 9.55671 18.5496 8.80117 18.2086 C7.79691 17.7553 6.9009 17.093 6.17299 16.2659 C5.87588 15.9283 5.90871 15.4137 6.24631 15.1166 Z"
    fill="currentColor"
  />
</svg>`
/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */,Gs="important",dl=" !"+Gs,qs=si(class extends ai{constructor(t){var e;if(super(t),t.type!==oi.ATTRIBUTE||"style"!==t.name||(null==(e=t.strings)?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(t){return Object.keys(t).reduce(((e,n)=>{const i=t[n];return null==i?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(dl);t.includes("-")||e?n.setProperty(t,e?i.slice(0,-11):i,e?Gs:""):n[t]=i}}return yt}}),Ks=class extends B{render(){return v`
      <div class="menu-container">
        <slot></slot>
      </div>
    `}};Ks.styles=E`
    .menu-container {
      width: var(--attendi-action-menu-width);
      display: flex;
      flex-direction: column;
      gap: 4px;
      background-color: white;
      border-radius: 8px;
      box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
      padding-top: 8px;
      padding-bottom: 4px;
    }
  `;let ll=Ks;customElements.get("attendi-action-menu")||customElements.define("attendi-action-menu",ll);var ul=Object.defineProperty,Zs=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&ul(e,n,o),o};const Ys=class extends B{constructor(){super(...arguments),this.strength="standard",this.height="1px"}render(){const t=it({[this.strength]:!0});return v`<hr
      class="divider ${t}"
      style=${qs({"border-width":this.height})}
    />`}};Ys.styles=E`
    :host {
      --color-weak: #d7d5d5;
      --color-standard: #bebbbb;
      --color-strong: #8d8787;

      --default-height: 1px;

      width: 100%;
    }

    .divider {
      margin: 0;
    }

    .weak {
      border: var(--default-height) solid var(--color-weak);
    }

    .standard {
      border: var(--default-height) solid var(--color-standard);
    }

    .strong {
      border: var(--default-height) solid var(--color-strong);
    }
  `;let gr=Ys;Zs([A({type:String})],gr.prototype,"strength"),Zs([A({type:String})],gr.prototype,"height"),customElements.get("attendi-divider")||customElements.define("attendi-divider",gr);var hl=Object.defineProperty,Xs=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&hl(e,n,o),o};const Js=class extends B{constructor(){super(...arguments),this.icon=!1,this.divider=""}render(){return v`
      <div class="menu-flex">
        ${"top"===this.divider?v`<attendi-divider
              class="divider--top"
              strength="weak"
            ></attendi-divider>`:void 0}

        <div class="inline-flex">
          <slot name="icon"></slot>

          <slot></slot>
        </div>

        ${"bottom"===this.divider?v`<attendi-divider
              class="divider--bottom"
              strength="weak"
            ></attendi-divider>`:void 0}
      </div>
    `}};Js.styles=E`
    :host {
      --color: #3d3d3d;
      --sizes-small: 16px;
      --icon-size: var(--sizes-small);

      color: var(--color);
    }

    .menu-flex {
      display: flex;
      flex-direction: column;
    }

    .inline-flex {
      display: flex;
      align-items: center;
      padding: 0px 16px;
      padding-bottom: 8px;
    }

    ::slotted([slot="icon"]) {
      width: var(--icon-size);
      height: var(--icon-size);
      padding-right: 8px;
    }

    .divider--top {
      margin-bottom: 8px;
    }
  `;let vr=Js;Xs([A({type:Boolean})],vr.prototype,"icon"),Xs([A({type:String})],vr.prototype,"divider"),customElements.get("attendi-action-menu-header")||customElements.define("attendi-action-menu-header",vr);const Qs=class extends B{render(){return v`
      <div class="rows-container">
        <slot></slot>
      </div>
    `}};Qs.styles=E`
    .rows-container {
      display: flex;
      flex-direction: column;
      padding: 0px 8px;
    }
  `;let pl=Qs;customElements.get("attendi-action-menu-rows")||customElements.define("attendi-action-menu-rows",pl);const ta=J`
  <svg viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
    <path
      d="M14 17.2778C13.8518 17.2778 13.713 17.2544 13.5833 17.2078C13.4537 17.1618 13.3333 17.0833 13.2222 16.9722L8.08333 11.8333C7.87962 11.6296 7.78259 11.3748 7.79222 11.0689C7.80111 10.7637 7.9074 10.5092 8.11111 10.3055C8.31481 10.1018 8.57407 9.99999 8.88888 9.99999C9.2037 9.99999 9.46296 10.1018 9.66666 10.3055L14 14.6389L18.3611 10.2778C18.5648 10.0741 18.8196 9.97665 19.1256 9.98554C19.4307 9.99517 19.6852 10.1018 19.8889 10.3055C20.0926 10.5092 20.1944 10.7685 20.1944 11.0833C20.1944 11.3981 20.0926 11.6574 19.8889 11.8611L14.7778 16.9722C14.6667 17.0833 14.5463 17.1618 14.4167 17.2078C14.287 17.2544 14.1481 17.2778 14 17.2778Z"
      fill="currentColor"
    />
  </svg>
`,fl=J`<svg
  class="icon"
  viewBox="0 0 16 16"
  fill="none"
  xmlns="http://www.w3.org/2000/svg"
>
  <path
    d="M3 9C2.72222 9 2.48622 8.90267 2.292 8.708C2.09733 8.51378 2 8.27778 2 8C2 7.72222 2.09733 7.48622 2.292 7.292C2.48622 7.09733 2.72222 7 3 7C3.27778 7 3.51378 7.09733 3.708 7.292C3.90267 7.48622 4 7.72222 4 8C4 8.27778 3.90267 8.51378 3.708 8.708C3.51378 8.90267 3.27778 9 3 9ZM3 5C2.72222 5 2.48622 4.90267 2.292 4.708C2.09733 4.51378 2 4.27778 2 4C2 3.72222 2.09733 3.48622 2.292 3.292C2.48622 3.09733 2.72222 3 3 3C3.27778 3 3.51378 3.09733 3.708 3.292C3.90267 3.48622 4 3.72222 4 4C4 4.27778 3.90267 4.51378 3.708 4.708C3.51378 4.90267 3.27778 5 3 5ZM3 13C2.72222 13 2.48622 12.9027 2.292 12.708C2.09733 12.5138 2 12.2778 2 12C2 11.7222 2.09733 11.4862 2.292 11.292C2.48622 11.0973 2.72222 11 3 11C3.27778 11 3.51378 11.0973 3.708 11.292C3.90267 11.4862 4 11.7222 4 12C4 12.2778 3.90267 12.5138 3.708 12.708C3.51378 12.9027 3.27778 13 3 13ZM6 12.6667C5.81111 12.6667 5.65289 12.6027 5.52533 12.4747C5.39733 12.3471 5.33333 12.1889 5.33333 12C5.33333 11.8111 5.39733 11.6529 5.52533 11.5253C5.65289 11.3973 5.81111 11.3333 6 11.3333H13.3333C13.5222 11.3333 13.6804 11.3973 13.808 11.5253C13.936 11.6529 14 11.8111 14 12C14 12.1889 13.936 12.3471 13.808 12.4747C13.6804 12.6027 13.5222 12.6667 13.3333 12.6667H6ZM6 8.66667C5.81111 8.66667 5.65289 8.60267 5.52533 8.47467C5.39733 8.34711 5.33333 8.18889 5.33333 8C5.33333 7.81111 5.39733 7.65267 5.52533 7.52467C5.65289 7.39711 5.81111 7.33333 6 7.33333H13.3333C13.5222 7.33333 13.6804 7.39711 13.808 7.52467C13.936 7.65267 14 7.81111 14 8C14 8.18889 13.936 8.34711 13.808 8.47467C13.6804 8.60267 13.5222 8.66667 13.3333 8.66667H6ZM6 4.66667C5.81111 4.66667 5.65289 4.60289 5.52533 4.47533C5.39733 4.34733 5.33333 4.18889 5.33333 4C5.33333 3.81111 5.39733 3.65267 5.52533 3.52467C5.65289 3.39711 5.81111 3.33333 6 3.33333H13.3333C13.5222 3.33333 13.6804 3.39711 13.808 3.52467C13.936 3.65267 14 3.81111 14 4C14 4.18889 13.936 4.34733 13.808 4.47533C13.6804 4.60289 13.5222 4.66667 13.3333 4.66667H6Z"
    fill="#6B6B6B"
  />
</svg>`;var gl=Object.defineProperty,mr=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&gl(e,n,o),o};const ea=class extends B{constructor(){super(...arguments),this.chevron=!1,this.subtitle="",this.isIconSet=!1}render(){const t=it({"has-chevron":this.chevron}),e=it({"has-icon":this.isIconSet});return v`<div class="row ${t}">
      <slot name="icon" @slotchange=${this.handleIconSet}></slot>

      <div class="title-and-subtitle ${e}">
        <div class="title">
          <slot></slot>
        </div>

        ${""!==this.subtitle?v`<div class="subtitle">${this.subtitle}</div>`:null}
      </div>

      ${this.chevron?v`<div class="chevron">${ta}</div>`:null}
    </div>`}handleIconSet(t){0===t.target.assignedNodes().length?this.isIconSet=!1:this.isIconSet=!0}};ea.styles=E`
    .row {
      padding: 10px 8px;
      display: flex;
      justify-content: start;
      align-items: center;
      border-radius: 8px;
      cursor: pointer;
    }

    .row.has-chevron {
      justify-content: space-between;
    }

    .row:hover {
      background-color: #f5f5f5;
    }

    .row:active {
      background-color: #d7d7d7;
    }

    .row:focus {
      border: 1px solid black;
    }

    .chevron {
      display: contents;
    }

    .chevron svg {
      width: 24px;
      transform: rotate(-90deg);
    }

    .title-and-subtitle {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
      gap: 4px;
    }

    .title {
      font-size: 14px;
      text-align: left;
    }

    .title-and-subtitle.has-icon {
      /* Margin is only necessary when there is an icon */
      margin-left: 8px;
    }

    .subtitle {
      color: rgba(107, 107, 107, 1);
      font-size: 12px;
      text-align: left;
    }
  `;let di=ea;mr([A({attribute:"chevron",type:Boolean})],di.prototype,"chevron"),mr([A({type:String})],di.prototype,"subtitle"),mr([L()],di.prototype,"isIconSet"),customElements.get("attendi-action-menu-row")||customElements.define("attendi-action-menu-row",di);var vl=Object.defineProperty,na=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&vl(e,n,o),o};const ia=class extends B{constructor(){super(...arguments),this._value=""}get value(){return this._value}set value(t){this._value=t,this.dispatchValueChangedEvents(t)}render(){return v`
      <div class="container">
        <div class="editor-container">
          <textarea
            class="editor"
            spellcheck="false"
            @input=${t=>{const e=t.target.value;this.value=e}}
            @change=${t=>{const e=t.target.value;this.value=e}}
            .value=${this.value}
          ></textarea>
        </div>
        <div class="buttons">
          <slot></slot>
        </div>
      </div>
    `}dispatchValueChangedEvents(t){const e=ml(t),n=bl(t);this.dispatchEvent(e),this.dispatchEvent(n)}addText(t){if(void 0!==this.editor){const e=""===this.editor.value?t:this.value+"\n\n"+t;this.value=e}}};ia.styles=E`
    :host {
      width: 100%;
      height: 100%;
    }

    .container {
      display: flex;
      flex-direction: column;
      border-radius: 8px;
      box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
      height: 100%;
    }

    .editor {
      height: 100%;
      background: transparent;
      border: none;
      color: black;
      flex: 1;
      font-family: inherit;
      /* overflow: auto hidden; */
      padding: 0px;
      resize: none;
      white-space: pre-wrap;
      width: 100%;
      caret-color: black;
      /* font-size: 18px; */
      line-height: 24px;
    }

    .editor:focus-visible {
      outline: none;
    }

    .editor-container {
      height: 100%;
      padding: 20px 58px 20px 24px;
    }

    .buttons {
      display: flex;
      align-items: center;
      margin-top: auto;
      padding-bottom: 8px;
      padding-left: 11px;
    }
  `;let br=ia;function ml(t){return new CustomEvent("attendieditorvaluechanged",{detail:t,bubbles:!0,composed:!0})}function bl(t){return new CustomEvent("change",{detail:t,bubbles:!1,composed:!0})}na([A()],br.prototype,"_value"),na([M(".editor")],br.prototype,"editor"),customElements.get("attendi-buttoned-textarea")||customElements.define("attendi-buttoned-textarea",br);var yl=Object.defineProperty,gn=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&yl(e,n,o),o};const ra=class extends B{constructor(){super(...arguments),this.hasOptionsMenu=!1,this.name="Button",this.backgroundColor=void 0,this.isOptionsOpen=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick.bind(this))}onDocumentClick(t){this.clickedOutsideOfOptionsMenu(t)&&this.hide()}clickedOutsideOfOptionsMenu(t){return!t.composedPath().includes(this)}hide(){this.isOptionsOpen=!1}render(){const t=it({open:this.isOptionsOpen});return v`
      <div class="split-button" tabindex="0">
        <button
          tabindex="0"
          class="main-action-button"
          @click=${()=>this.dispatchEvent(new CustomEvent("main-button-clicked"))}
        >
          <slot name="main-action"></slot>
        </button>

        <button
          data-test="attendi-split-button__options-button"
          tabindex="0"
          class="options-button ${t}"
          @click=${()=>{this.isOptionsOpen?this.isOptionsOpen=!1:this.isOptionsOpen=!0,this.dispatchEvent(new CustomEvent("options-button-clicked"))}}
        >
          <slot name="options-action">${ta}</slot>

          <div class="options-slot-container ${t}">
            <slot name="options"></slot>
          </div>
        </button>
      </div>
    `}};ra.styles=E`
    :host {
      --attendi-color-background: #f4f4f4;
      --attendi-color-background-hover: #c9c9c9;
      --attendi-color-background-active: rgb(151, 151, 151);
      --theme-text: black;
      --attendi-color-border: #bebbbb;
      --attendi-color-icon: #333333;
      --attendi-color-icon-hover: #333333;
      --attendi-split-button-border-radius: var(--attendi-border-radius, 30px);
      --attendi-split-button-border-width: 1px;
      --popupbg: hsl(220 0% 100%);

      --border: var(--attendi-split-button-border-width) solid
        var(--attendi-color-border);
      --outer-radius: 50px;
      --radius: 6px;
      --in-speed: 500ms;
      --out-speed: 100ms;

      display: inline-block;
      /* show options menu */
      overflow: visible;
    }

    /* Reset default button styles */
    button,
    input[type="submit"],
    input[type="reset"] {
      background: none;
      color: inherit;
      border: none;
      padding: 0;
      margin: 0;
      font: inherit;
      cursor: pointer;
      outline: inherit;
    }

    .split-button {
      display: grid;
      grid-template-columns: 3fr 2fr;
      width: 100%;
      height: 100%;
    }

    .split-button:focus-visible {
      outline: none;
    }

    .main-action-button {
      background-color: var(--attendi-color-background);
      /* Assumes that the main action button will just contain an icon */
      color: var(--attendi-color-icon);
      position: relative;
      border: var(--border);
      border-right: none;
      border-top-left-radius: var(
        --attendi-split-button-border-top-left-radius,
        var(--attendi-split-button-border-radius)
      );
      border-bottom-left-radius: var(
        --attendi-split-button-border-bottom-left-radius,
        var(--attendi-split-button-border-radius)
      );

      transition-property: background-color, color;
      transition-duration: 0.2s;
      transition-timing-function: ease-in-out;
      -webkit-tap-highlight-color: transparent;
    }

    .main-action-button:hover {
      color: var(--attendi-color-icon-hover);
    }

    /* Divider / border that is smaller than the full height of the element. */
    .main-action-button:after {
      content: "";
      height: 50%;
      width: 1px;
      position: absolute;
      right: 0;
      top: 25%;
      background-color: var(--attendi-color-border);
    }

    .main-action-button:hover {
      background-color: var(--attendi-color-background-hover);
    }

    .main-action-button:active {
      background-color: var(--attendi-color-background-active);
    }

    .options-button {
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: var(
        --attendi-split-button-option-action-color-background,
        var(--attendi-color-background)
      );
      border: var(--border);
      border-left: none;
      border-top-right-radius: var(
        --attendi-split-button-border-top-right-radius,
        var(--attendi-split-button-border-radius)
      );
      border-bottom-right-radius: var(
        --attendi-split-button-border-bottom-right-radius,
        var(--attendi-split-button-border-radius)
      );
      transition: background-color 0.2s ease-in-out;
      position: relative;
      -webkit-tap-highlight-color: transparent;
    }

    .options-button:hover {
      background-color: var(
        --attendi-split-button-option-action-color-background,
        var(--attendi-color-background-hover)
      );
    }

    .options-button:active {
      background-color: var(
        --attendi-split-button-option-action-color-background,
        var(--attendi-color-background-active)
      );
    }

    .options-button svg {
      width: calc(26.67 / 40 * 100%);
      color: var(--attendi-color-icon);
      transition-duration: var(--in-speed);
      transform: rotateZ(0turn);
    }

    .options-button:hover svg {
      color: var(--attendi-color-icon-hover);
    }

    .options-button.open svg {
      transition-duration: var(--in-speed);
      transform: rotateZ(-0.5turn);
    }

    ::slotted([slot="options-action"]) {
      width: 50%;
      height: 50%;
      color: var(--attendi-color-icon);
    }

    ::slotted([slot="main-action"]) {
      /* If not present, might encounter issues where the inserted div makes the 
      child content too large for the split button, thereby increasing the height of
      the whole button. */
      height: 78%;
    }

    .options-slot-container {
      opacity: 0;
      pointer-events: none;
      position: absolute;
      inset-block-end: 80%;
      inset-inline-start: -1.5ch;
      padding-inline: 0;
      padding-block: 0.5ch;
      transition: opacity var(--out-speed) ease;
    }

    /* We don't want the whole container to have cursor: pointer, which happens now
      since the options container is within a button element
      (for which we have set cursor: pointer by default) */
    .options-slot-container ::slotted(*) {
      cursor: default;
    }

    .options-slot-container.open {
      opacity: 1;
      pointer-events: auto;
    }
  `;let Te=ra;gn([oc({slot:"options",flatten:!0})],Te.prototype,"optionsMenuNodes"),gn([L()],Te.prototype,"hasOptionsMenu"),gn([A()],Te.prototype,"name"),gn([A()],Te.prototype,"backgroundColor"),gn([L()],Te.prototype,"isOptionsOpen"),customElements.get("attendi-split-button")||customElements.define("attendi-split-button",Te);var _l=Object.defineProperty,wl=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&_l(e,n,o),o};const oa=class extends B{constructor(){super(...arguments),this.disabled=!1}render(){return v`
      <button ?disabled=${this.disabled}>
        <slot></slot>
      </button>
    `}};oa.styles=E`
    :host {
      --attendi-color-background: white;
      --attendi-color-background-hover: #c9c9c9;
      --attendi-color-background-active: rgb(151, 151, 151);
      --attendi-color-background-disabled: #f2f2f2;
      --attendi-color-border: #bebbbb;
      --attendi-button-color: #333333;
      --attendi-button-color-hover: #333333;
      --attendi-button-border-radius: var(--attendi-border-radius, 30px);
      --theme-text: black;
      --theme-border: #bebbbb;
      --theme-border-width: var(--attendi-button-border-width, 1px);
      --ontheme: #333333;
      --popupbg: hsl(220 0% 100%);

      --border: 1px solid var(--attendi-color-border);
      --outer-radius: 50px;
      --radius: 6px;
      --in-speed: 500ms;
      --out-speed: 100ms;

      display: block;
      height: 100%;
      width: 100%;
    }

    /* Reset default button styles */
    button {
      background: none;
      color: inherit;
      border: none;
      padding: 0;
      font: inherit;
      cursor: pointer;
      outline: inherit;
    }

    button {
      background-color: var(--attendi-color-background);
      color: var(--attendi-button-color);
      border: var(--border);
      border-width: var(--theme-border-width);
      border-radius: var(--attendi-button-border-radius);
      border-top-left-radius: var(
        --attendi-button-border-top-left-radius,
        var(--attendi-button-border-radius)
      );
      border-top-right-radius: var(
        --attendi-button-border-top-right-radius,
        var(--attendi-button-border-radius)
      );
      border-bottom-left-radius: var(
        --attendi-button-border-bottom-left-radius,
        var(--attendi-button-border-radius)
      );
      border-bottom-right-radius: var(
        --attendi-button-border-bottom-right-radius,
        var(--attendi-button-border-radius)
      );
      width: 100%;
      height: 100%;
      -webkit-tap-highlight-color: transparent;
      transition-property: background-color, color;
      transition-duration: 0.2s;
      transition-timing-function: ease-in-out;
    }

    button:hover {
      background-color: var(--attendi-color-background-hover);
      color: var(--attendi-button-color-hover);
    }

    button:active {
      background-color: var(--attendi-color-background-active);
    }

    button:disabled {
      background-color: var(--attendi-color-background-disabled);
    }
  `;let sa=oa;wl([A({attribute:"disabled",type:Boolean})],sa.prototype,"disabled"),customElements.get("attendi-button")||customElements.define("attendi-button",sa);var Cl=Object.defineProperty,aa=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&Cl(e,n,o),o};E``;const ca=class extends B{constructor(){super(...arguments),this.open=!1}showModal(){var t;this.open=!0,null==(t=this.dialog)||t.showModal()}close(){var t;this.open=!1,null==(t=this.dialog)||t.close()}firstUpdated(){var t;null==(t=this.dialog)||t.addEventListener("close",(()=>{this.open=!1,this.dispatchCloseEvent()}))}render(){return v`
      <dialog>
        ${this.exitButton()}
        <slot></slot>
      </dialog>
    `}exitButton(){return v`<div @click=${()=>{var t;return null==(t=this.dialog)?void 0:t.close()}}>
      <div
        class="exit-button"
        data-test="attendi-speech-service-dialog__exit-button"
      >
        ${xl}
      </div>
    </div>`}dispatchCloseEvent(){this.dispatchEvent(new CustomEvent(Sl.close))}};ca.styles=E`
    :host {
      /* By default, width of modal will be 90% on small screens, and is capped */
      --attendi-dialog-width: min(90%, 560px);
    }

    dialog {
      border: 1px solid #888;
      border-radius: 10px;
      box-shadow: 0 0 #0000, 0 0 #0000, 0 25px 50px -12px rgba(0, 0, 0, 0.25);
      padding: 10px; /* Padding between modal edge and inner content */
      width: var(--attendi-dialog-width);
      position: fixed;
      background-color: white;
      top: auto;
      bottom: 1%;
      overflow: hidden;
    }

    dialog::backdrop {
      background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
    }

    .exit-button {
      width: 28px;
      height: 28px;
      margin-left: auto;
      cursor: pointer;
      position: absolute;
      right: 4%;
    }

    /*
      This is used to create a larger clickable area for the exit button
      for UX purposes.
      */
    .exit-button:after {
      content: "";
      position: absolute;
      left: -10px;
      top: -10px;
      width: 40px;
      height: 40px;
    }

    .exit-button svg {
      color: white;
      fill: #c4c4c4;
      transition: 0.3s fill;
    }

    .exit-button svg:hover {
      fill: #a2a2a2;
    }

    @media screen and (min-width: 576px) {
      /* Put the modal more at the top / middle when on larger screens. */
      dialog {
        top: 15%;
        bottom: auto;
        padding: 15px;
      }
    }
  `;let yr=ca;aa([A({type:Boolean,reflect:!0})],yr.prototype,"open"),aa([M("dialog")],yr.prototype,"dialog");const da=class{};da.close="attendi-dialog-close";let Sl=da;const xl=J`
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
    <circle cx="11.7423" cy="11.7423" r="11.7423" />
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M5.7746 17.425C6.16513 17.8155 6.79829 17.8155 7.18882 17.425L11.5706 13.0432L15.9552 17.4221C16.346 17.8124 16.9792 17.812 17.3694 17.4212L17.4313 17.3593C17.8215 16.9685 17.8211 16.3353 17.4303 15.9451L13.0467 11.5671L17.4275 7.18635C17.818 6.79582 17.818 6.16266 17.4275 5.77213L17.3656 5.71025C16.9751 5.31973 16.3419 5.31973 15.9514 5.71025L11.5696 10.092L7.18499 5.71314C6.79421 5.32287 6.16104 5.32328 5.77077 5.71406L5.70893 5.77599C5.31867 6.16677 5.31908 6.79993 5.70986 7.1902L10.0935 11.5681L5.71272 15.9489C5.3222 16.3394 5.3222 16.9726 5.71272 17.3631L5.7746 17.425Z"
      fill="currentColor"
    />
  </svg>
`;customElements.get("attendi-dialog")||customElements.define("attendi-dialog",yr);class Al extends Error{constructor(t){super(t),this.name="AttendiRecordingError"}}class Ol extends Al{constructor(t){super(t),this.name="AttendiRecordingPermissionDeniedError"}}const la="attendierror";function Cn(t){return new CustomEvent(la,{bubbles:!0,composed:!0,detail:t})}const D=class{static get noMicrophonePermissionErrorDialogContent(){return v`
      Door een instelling van uw browser mag deze pagina de microfoon niet
      gebruiken. Op ${El()} staan
      instructies om dit probleem te verhelpen. Probeer na het volgen van deze
      instructies opnieuw in te spreken.
    `}static get emptyRecordingErrorDialogContent(){return v`
      Er is op uw apparaat iets misgegaan bij het opnemen van geluid. Ververs
      alstublieft de pagina en probeer daarna opnieuw in te spreken. Als dit
      niet werkt, neem dan contact op met uw ECD-leverancier.
    `}};D.recorderStart="Start",D.recorderPause="Pauzeer",D.recorderRedo="Opnieuw",D.done="Klaar",D.linearReportingMethod_previousStep="Vorige",D.linearReportingMethod_nextStep="Volgende",D.selectReportingMethodScreen_header="Methodes",D.selectReportingMethodScreen_report="verslag",D.ok="OK",D.confirmRecordRedoModal_header="Opnieuw beginnen",D.confirmRecordRedoModal_caption="Als u opnieuw begint, wordt de huidige rapportage verwijderd",D.cancel="Annuleer",D.noMicrophonePermissionErrorDialogTitle="Wij hebben geen toegang tot uw microfoon",D.genericStartRecordingErrorDialogTitle="Het is niet mogelijk om geluid op te nemen",D.genericStartRecordingErrorDialogContent="Ververs de pagina en probeer opnieuw op te nemen. Als dit niet werkt,neem dan contact op met uw ECD-leverancier",D.emptyRecordingErrorDialogTitle="Kon geen geluid opnemen",D.genericErrorDialogTitle="Er is iets misgegaan",D.genericErrorDialogContent="Ververs de pagina en probeer opnieuw op te nemen. Als dit niet werkt, neem dan contact op met uw ECD-leverancier";let k=D;function El(){return v`
    <a
      href="javascript:void(0);"
      onclick="window.open('https://attenditechnology.notion.site/Microfoon-toestaan-953087d19ba44192a2e79bcf74774a2d', '_blank').focus()"
    >
      deze pagina</a>
  `}const Pl=12,ua=24,Pn=36,Rl=8,Tr=class{};Tr.PCM=1;let Sn,Di=Tr;class $l{encode(t,e=16e3){return new Tl(t,e).encode()}decode(t){const e=t.byteLength,n=new DataView(t),i=e-8;if(n.getUint32(4,!0)!==i)throw new Error(`Invalid RIFF chunk size: ${i}. Expected ${e-8}`);const r=Ml(n),o=Il(n);return{header:r,format:o,data:Bl(n,36,o)}}}class Tl{constructor(t,e=16e3){if(this.formatCode=Di.PCM,this.bitsPerSample=16,this.bytesPerSample=Math.ceil(this.bitsPerSample/8),this.dataView=void 0,this.channelData=t,this.numberOfChannels=this.channelData.length,this.numberOfChannels<1)throw new Error("No audio channels.");this.numberOfFrames=this.channelData[0].length,this.sampleRate=e}encode(){if(void 0===this.channelData)throw new Error("No channel data.");const t=this.numberOfChannels*this.numberOfFrames*this.bytesPerSample,e=new ArrayBuffer(44+t);return this.dataView=new DataView(e),this.writeHeader(44,t),this.writeSampleData(44),new Uint8Array(e)}writeHeader(t,e){if(void 0===this.dataView)throw new Error("No data view.");const n=t+e,i=this.numberOfChannels*this.bytesPerSample;this.setHeader(n),this.setFormatChunk(i),this.setDataChunk(e)}setHeader(t){this.setString(0,"RIFF"),this.setFileSize(t),this.setString(8,"WAVE")}setFileSize(t){this.dataView.setUint32(4,t-8,!0)}setFormatChunk(t){this.setFmtChunkId(),this.setFmtChunkSize(),this.setFormatCode(),this.setNumberOfChannels(),this.setSampleRate(),this.setByteRate(),this.setBlockAlign(t),this.setBitsPerSample()}setFmtChunkId(){this.setString(12,"fmt ")}setFmtChunkSize(){this.dataView.setUint32(16,16,!0)}setFormatCode(){this.dataView.setUint16(20,this.formatCode,!0)}setNumberOfChannels(){this.dataView.setUint16(22,this.numberOfChannels,!0)}setSampleRate(){this.dataView.setUint32(24,this.sampleRate,!0)}setByteRate(){const t=this.sampleRate*this.numberOfChannels*this.bytesPerSample;this.dataView.setUint32(28,t,!0)}setBlockAlign(t){this.dataView.setUint16(32,t,!0)}setBitsPerSample(){this.dataView.setUint16(34,this.bitsPerSample,!0)}setDataChunk(t){this.setString(36,"data"),this.dataView.setUint32(40,t,!0)}setString(t,e){if(void 0===this.dataView)throw new Error("No data view.");for(let n=0;n<e.length;n++)this.dataView.setUint8(t+n,e.charCodeAt(n))}writeSampleData(t){if(void 0===this.dataView)throw new Error("No data view.");let e=t;for(let t=0;t<this.numberOfFrames;t++)for(let n=0;n<this.numberOfChannels;n++){const i=kl(this.channelData[n][t]);this.dataView.setInt16(e,i,!0),e+=this.bytesPerSample}}}function kl(t){return Math.max(-32768,Math.min(32767,Math.round(32768*t)))}function Ml(t){return{magic:String.fromCharCode(t.getUint8(0),t.getUint8(1),t.getUint8(2),t.getUint8(3)),size:t.getUint32(4,!0),format:String.fromCharCode(t.getUint8(8),t.getUint8(9),t.getUint8(10),t.getUint8(11))}}function Il(t){return{id:String.fromCharCode(t.getUint8(12),t.getUint8(13),t.getUint8(14),t.getUint8(15)),size:t.getUint32(16,!0),audioFormat:t.getUint16(20,!0),numChannels:t.getUint16(22,!0),sampleRate:t.getUint32(24,!0),byteRate:t.getUint32(28,!0),blockAlign:t.getUint16(32,!0),bitsPerSample:t.getUint16(34,!0)}}function Bl(t,e,n){const i=String.fromCharCode(t.getUint8(e),t.getUint8(e+1),t.getUint8(e+2),t.getUint8(e+3)),r=t.getUint32(e+4,!0),o=Array.from({length:n.numChannels},(()=>[])),s=r/(n.numChannels*(n.bitsPerSample/8));let a;if(8===n.bitsPerSample)a=t.getInt8;else if(16===n.bitsPerSample)a=e=>t.getInt16(e,!0);else{if(32!==n.bitsPerSample)throw new Error(`Unsupported bits per sample: ${n.bitsPerSample}`);a=e=>t.getInt32(e,!0)}for(let t=0;t<s;t++)for(let i=0;i<n.numChannels;i++){const r=a(e+8+(t*n.numChannels+i)*(n.bitsPerSample/8));o[i].push(r)}return{id:i,size:r,channelData:o}}const Ll=new Uint8Array(16);function Dl(){if(!Sn&&(Sn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sn(Ll)}const U=[];for(let t=0;t<256;++t)U.push((t+256).toString(16).slice(1));function Nl(t,e=0){return(U[t[e+0]]+U[t[e+1]]+U[t[e+2]]+U[t[e+3]]+"-"+U[t[e+4]]+U[t[e+5]]+"-"+U[t[e+6]]+U[t[e+7]]+"-"+U[t[e+8]]+U[t[e+9]]+"-"+U[t[e+10]]+U[t[e+11]]+U[t[e+12]]+U[t[e+13]]+U[t[e+14]]+U[t[e+15]]).toLowerCase()}const Ul=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lo={randomUUID:Ul};function Ve(t,e,n){if(lo.randomUUID&&!e&&!t)return lo.randomUUID();const i=(t=t||{}).random||(t.rng||Dl)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,Nl(i)}function Ni(){if(null===document.body||void 0===document.body)return;const t=document.body.style.top;document.body.style.position="",document.body.style.top="",document.body.style.width="",window.scrollTo(0,-1*parseInt(t||"0"))}function Ui(){document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed",document.body.style.width="100vw"}function ha(t){return new Promise((e=>setTimeout(e,t)))}function jl(t){return new Promise(((e,n)=>{const i=new FileReader;i.onload=()=>{Fl(i,e,n)},i.onerror=n,i.readAsDataURL(t)}))}function Fl(t,e,n){var i;const r=null==(i=t.result)?void 0:i.toString();r?e(r.slice(r.indexOf(",")+1)):n("Audio is empty")}function tn(){return Ve()}function xe(){return Ve()}async function pa(t){const e=(new $l).encode([t]),n=new Blob([e],{type:"audio/wav"});return await jl(n)}function Vl(t,e){return new CustomEvent("recordersegmenttranscribed",{detail:{transcript:t,eventMetadata:e},bubbles:!0,composed:!0})}function Hl(){return new CustomEvent("recorderredo",{bubbles:!0,composed:!0})}function zl(){return new CustomEvent("recorderdone",{bubbles:!0,composed:!0})}const Gt="#000000",ft="#ffffff";function st(t,e,n){const i=1-(n=_r(n,0,1)),[r,o,s]=uo(t),[a,l,d]=uo(e);return Kl(Math.round(r*n+a*i),Math.round(o*n+l*i),Math.round(s*n+d*i))}function _r(t,e,n){return Math.min(Math.max(e,t),n)}const Wl=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;function uo(t){t=ql(t);const e=Wl.exec(t);if(null===e)throw new Error(`Invalid hex color: ${t}`);return[Si(e[1]),Si(e[2]),Si(e[3])]}function Si(t){return parseInt(t,16)}const Gl=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;function ql(t){return t=t.replace(Gl,((t,e,n,i)=>e+e+n+n+i+i))}function Kl(t,e,n){return"#"+Rn(t)+Rn(e)+Rn(n)}const fa=255;function Rn(t){return(t=_r(t,0,fa)).toString(16).toLowerCase().padStart(2,"0")}function at(t,e){return t+Rn(e=Math.round(_r(e,0,1)*fa))}function Zl(t){return{fill:{default:{enabled:ft,hover:st(ft,Gt,.93),active:st(ft,Gt,.86),disabled:st(ft,Gt,.95)},active:{enabled:t,hover:st(Gt,t,.08),active:st(Gt,t,.16),disabled:st(ft,t,.8)}},outline:{default:{enabled:"#bebbbb",hover:"#bebbbb",active:"#bebbbb",disabled:"#d7d5d5"},active:{enabled:at(t,.16),hover:at(t,.32),active:at(t,.64),disabled:at(t,.08)}},icon:{default:{enabled:"#000000",hover:"#000000"},active:{enabled:"#ffffff",hover:"#ffffff"}},volumeFeedback:at(t,.4)}}function Yl(t){return{fill:{default:{enabled:ft,hover:st(ft,t,.9),active:st(ft,t,.8),disabled:ft},active:{enabled:t,hover:st(Gt,t,.08),active:st(Gt,t,.16),disabled:st(ft,t,.8)}},outline:{default:{enabled:t,hover:t,active:t,disabled:"#d7d5d5"},active:{enabled:at(t,.16),hover:at(t,.32),active:at(t,.64),disabled:at(t,.08)}},icon:{default:{enabled:t,hover:t},active:{enabled:"#ffffff",hover:"#ffffff"}},volumeFeedback:at(t,.4)}}function Xl(t,e){t.style.setProperty("--color-icon-enabled",e.icon.default.enabled),t.style.setProperty("--color-icon-active-enabled",e.icon.active.enabled),t.style.setProperty("--color-icon-hover",e.icon.default.hover),t.style.setProperty("--color-icon-active-hover",e.icon.active.hover),t.style.setProperty("--color-fill-enabled",e.fill.default.enabled),t.style.setProperty("--color-fill-hover",e.fill.default.hover),t.style.setProperty("--color-fill-active",e.fill.default.active),t.style.setProperty("--color-fill-disabled",e.fill.default.disabled),t.style.setProperty("--color-fill-active-enabled",e.fill.active.enabled),t.style.setProperty("--color-fill-active-hover",e.fill.active.hover),t.style.setProperty("--color-fill-active-active",e.fill.active.active),t.style.setProperty("--color-fill-active-disabled",e.fill.active.disabled),t.style.setProperty("--color-outline-enabled",e.outline.default.enabled),t.style.setProperty("--color-outline-hover",e.outline.default.hover),t.style.setProperty("--color-outline-active",e.outline.default.active),t.style.setProperty("--color-outline-disabled",e.outline.default.disabled),t.style.setProperty("--color-outline-active-enabled",e.outline.active.enabled),t.style.setProperty("--color-outline-active-hover",e.outline.active.hover),t.style.setProperty("--color-outline-active-active",e.outline.active.active),t.style.setProperty("--color-outline-active-disabled",e.outline.active.disabled),t.style.setProperty("--color-volume-feedback",e.volumeFeedback)}const Jl=E`
  .loader {
    width: clamp(2px, 4%, 5px);
    transform: scaleY(0.2);
    background-color: #fff;
    animation: processing 0.85s ease-in-out infinite alternate;
  }

  .l1 {
    animation-delay: 0.1s;
  }

  .l2 {
    animation-delay: 0.2s;
  }

  .l3 {
    animation-delay: 0.3s;
  }

  .l4 {
    animation-delay: 0.4s;
  }

  .l5 {
    animation-delay: 0.5s;
  }

  @keyframes processing {
    100% {
      transform: scaleY(1);
    }
  }
`,Ql=E`
  .w-100 {
    width: 100%;
  }
`,gt=Math.min,q=Math.max,Fn=Math.round,xn=Math.floor,Ut=t=>({x:t,y:t}),tu={left:"right",right:"left",bottom:"top",top:"bottom"},eu={start:"end",end:"start"};function ji(t,e,n){return q(t,gt(e,n))}function ke(t,e){return"function"==typeof t?t(e):t}function jt(t){return t.split("-")[0]}function Me(t){return t.split("-")[1]}function ga(t){return"x"===t?"y":"x"}function wr(t){return"y"===t?"height":"width"}function ne(t){return["top","bottom"].includes(jt(t))?"y":"x"}function Cr(t){return ga(ne(t))}function nu(t,e,n){void 0===n&&(n=!1);const i=Me(t),r=Cr(t),o=wr(r);let s="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Vn(s)),[s,Vn(s)]}function iu(t){const e=Vn(t);return[Fi(t),e,Fi(e)]}function Fi(t){return t.replace(/start|end/g,(t=>eu[t]))}function ru(t,e,n){const i=["left","right"],r=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:i:e?i:r;case"left":case"right":return e?o:s;default:return[]}}function ou(t,e,n,i){const r=Me(t);let o=ru(jt(t),"start"===n,i);return r&&(o=o.map((t=>t+"-"+r)),e&&(o=o.concat(o.map(Fi)))),o}function Vn(t){return t.replace(/left|right|bottom|top/g,(t=>tu[t]))}function su(t){return{top:0,right:0,bottom:0,left:0,...t}}function va(t){return"number"!=typeof t?su(t):{top:t,right:t,bottom:t,left:t}}function Hn(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function ho(t,e,n){let{reference:i,floating:r}=t;const o=ne(e),s=Cr(e),a=wr(s),l=jt(e),d="y"===o,c=i.x+i.width/2-r.width/2,u=i.y+i.height/2-r.height/2,h=i[a]/2-r[a]/2;let p;switch(l){case"top":p={x:c,y:i.y-r.height};break;case"bottom":p={x:c,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-r.width,y:u};break;default:p={x:i.x,y:i.y}}switch(Me(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1)}return p}const au=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:u}=ho(d,i,l),h=i,p={},f=0;for(let n=0;n<a.length;n++){const{name:o,fn:v}=a[n],{x:g,y:m,data:b,reset:y}=await v({x:c,y:u,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});c=g??c,u=m??u,p={...p,[o]:{...p[o],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(h=y.placement),y.rects&&(d=!0===y.rects?await s.getElementRects({reference:t,floating:e,strategy:r}):y.rects),({x:c,y:u}=ho(d,h,l))),n=-1)}return{x:c,y:u,placement:h,strategy:r,middlewareData:p}};async function Sr(t,e){var n;void 0===e&&(e={});const{x:i,y:r,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=ke(e,t),f=va(p),v=a[h?"floating"===u?"reference":"floating":u],g=Hn(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),m="floating"===u?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),y=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},w=Hn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:b,strategy:l}):m);return{top:(g.top-w.top+f.top)/y.y,bottom:(w.bottom-g.bottom+f.bottom)/y.y,left:(g.left-w.left+f.left)/y.x,right:(w.right-g.right+f.right)/y.x}}const cu=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:d,padding:c=0}=ke(t,e)||{};if(null==d)return{};const u=va(c),h={x:n,y:i},p=Cr(r),f=wr(p),v=await s.getDimensions(d),g="y"===p,m=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=o.reference[f]+o.reference[p]-h[p]-o.floating[f],_=h[p]-o.reference[p],C=await(null==s.getOffsetParent?void 0:s.getOffsetParent(d));let x=C?C[y]:0;(!x||!await(null==s.isElement?void 0:s.isElement(C)))&&(x=a.floating[y]||o.floating[f]);const S=w/2-_/2,A=x/2-v[f]/2-1,k=gt(u[m],A),O=gt(u[b],A),E=k,P=x-v[f]-O,R=x/2-v[f]/2+S,T=ji(E,R,P),$=!l.arrow&&null!=Me(r)&&R!==T&&o.reference[f]/2-(R<E?k:O)-v[f]/2<0,I=$?R<E?R-E:R-P:0;return{[p]:h[p]+I,data:{[p]:T,centerOffset:R-T-I,...$&&{alignmentOffset:I}},reset:$}}}),du=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:v=!0,...g}=ke(t,e);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const m=jt(r),b=ne(a),y=jt(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(d.floating)),_=h||(y||!v?[Vn(a)]:iu(a)),C="none"!==f;!h&&C&&_.push(...ou(a,v,f,w));const x=[a,..._],S=await Sr(e,g),A=[];let k=(null==(i=o.flip)?void 0:i.overflows)||[];if(c&&A.push(S[m]),u){const t=nu(r,s,w);A.push(S[t[0]],S[t[1]])}if(k=[...k,{placement:r,overflows:A}],!A.every((t=>t<=0))){var O,E;const t=((null==(O=o.flip)?void 0:O.index)||0)+1,e=x[t];if(e)return{data:{index:t,overflows:k},reset:{placement:e}};let n=null==(E=k.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:E.placement;if(!n)switch(p){case"bestFit":{var P;const t=null==(P=k.filter((t=>{if(C){const e=ne(t.placement);return e===b||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:P[0];t&&(n=t);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};async function lu(t,e){const{placement:n,platform:i,elements:r}=t,o=await(null==i.isRTL?void 0:i.isRTL(r.floating)),s=jt(n),a=Me(n),l="y"===ne(n),d=["left","top"].includes(s)?-1:1,c=o&&l?-1:1,u=ke(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*c,y:h*d}:{x:h*d,y:p*c}}const uu=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:o,placement:s,middlewareData:a}=e,l=await lu(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:s}}}}},hu=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=ke(t,e),d={x:n,y:i},c=await Sr(e,l),u=ne(jt(r)),h=ga(u);let p=d[h],f=d[u];if(o){const t="y"===h?"bottom":"right";p=ji(p+c["y"===h?"top":"left"],p,p-c[t])}if(s){const t="y"===u?"bottom":"right";f=ji(f+c["y"===u?"top":"left"],f,f-c[t])}const v=a.fn({...e,[h]:p,[u]:f});return{...v,data:{x:v.x-n,y:v.y-i}}}}},pu=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:i,platform:r,elements:o}=e,{apply:s=()=>{},...a}=ke(t,e),l=await Sr(e,a),d=jt(n),c=Me(n),u="y"===ne(n),{width:h,height:p}=i.floating;let f,v;"top"===d||"bottom"===d?(f=d,v=c===(await(null==r.isRTL?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(v=d,f="end"===c?"top":"bottom");const g=p-l.top-l.bottom,m=h-l.left-l.right,b=gt(p-l[f],g),y=gt(h-l[v],m),w=!e.middlewareData.shift;let _=b,C=y;if(u?C=c||w?gt(y,m):m:_=c||w?gt(b,g):g,w&&!c){const t=q(l.left,0),e=q(l.right,0),n=q(l.top,0),i=q(l.bottom,0);u?C=h-2*(0!==t||0!==e?t+e:q(l.left,l.right)):_=p-2*(0!==n||0!==i?n+i:q(l.top,l.bottom))}await s({...e,availableWidth:C,availableHeight:_});const x=await r.getDimensions(o.floating);return h!==x.width||p!==x.height?{reset:{rects:!0}}:{}}}};function Ie(t){return ma(t)?(t.nodeName||"").toLowerCase():"#document"}function X(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Tt(t){var e;return null==(e=(ma(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ma(t){return t instanceof Node||t instanceof X(t).Node}function ut(t){return t instanceof Element||t instanceof X(t).Element}function _t(t){return t instanceof HTMLElement||t instanceof X(t).HTMLElement}function po(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof X(t).ShadowRoot)}function vn(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=ht(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(r)}function fu(t){return["table","td","th"].includes(Ie(t))}function li(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch{return!1}}))}function xr(t){const e=Ar(),n=ut(t)?ht(t):t;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function gu(t){let e=Ft(t);for(;_t(e)&&!Ae(e);){if(xr(e))return e;if(li(e))return null;e=Ft(e)}return null}function Ar(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ae(t){return["html","body","#document"].includes(Ie(t))}function ht(t){return X(t).getComputedStyle(t)}function ui(t){return ut(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ft(t){if("html"===Ie(t))return t;const e=t.assignedSlot||t.parentNode||po(t)&&t.host||Tt(t);return po(e)?e.host:e}function ba(t){const e=Ft(t);return Ae(e)?t.ownerDocument?t.ownerDocument.body:t.body:_t(e)&&vn(e)?e:ba(e)}function en(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const r=ba(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),s=X(r);if(o){const t=Vi(s);return e.concat(s,s.visualViewport||[],vn(r)?r:[],t&&n?en(t):[])}return e.concat(r,en(r,[],n))}function Vi(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ya(t){const e=ht(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=_t(t),o=r?t.offsetWidth:n,s=r?t.offsetHeight:i,a=Fn(n)!==o||Fn(i)!==s;return a&&(n=o,i=s),{width:n,height:i,$:a}}function Or(t){return ut(t)?t:t.contextElement}function we(t){const e=Or(t);if(!_t(e))return Ut(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=ya(e);let s=(o?Fn(n.width):n.width)/i,a=(o?Fn(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const vu=Ut(0);function _a(t){const e=X(t);return Ar()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:vu}function mu(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==X(t))&&e}function ie(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),o=Or(t);let s=Ut(1);e&&(i?ut(i)&&(s=we(i)):s=we(t));const a=mu(o,n,i)?_a(o):Ut(0);let l=(r.left+a.x)/s.x,d=(r.top+a.y)/s.y,c=r.width/s.x,u=r.height/s.y;if(o){const t=X(o),e=i&&ut(i)?X(i):i;let n=t,r=Vi(n);for(;r&&i&&e!==n;){const t=we(r),e=r.getBoundingClientRect(),i=ht(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,u*=t.y,l+=o,d+=s,n=X(r),r=Vi(n)}}return Hn({width:c,height:u,x:l,y:d})}function bu(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const o="fixed"===r,s=Tt(i),a=!!e&&li(e.floating);if(i===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},d=Ut(1);const c=Ut(0),u=_t(i);if((u||!u&&!o)&&(("body"!==Ie(i)||vn(s))&&(l=ui(i)),_t(i))){const t=ie(i);d=we(i),c.x=t.x+i.clientLeft,c.y=t.y+i.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+c.x,y:n.y*d.y-l.scrollTop*d.y+c.y}}function yu(t){return Array.from(t.getClientRects())}function wa(t){return ie(Tt(t)).left+ui(t).scrollLeft}function _u(t){const e=Tt(t),n=ui(t),i=t.ownerDocument.body,r=q(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=q(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+wa(t);const a=-n.scrollTop;return"rtl"===ht(i).direction&&(s+=q(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:s,y:a}}function wu(t,e){const n=X(t),i=Tt(t),r=n.visualViewport;let o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;const t=Ar();(!t||t&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a,y:l}}function Cu(t,e){const n=ie(t,!0,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=_t(t)?we(t):Ut(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:r*o.x,y:i*o.y}}function fo(t,e,n){let i;if("viewport"===e)i=wu(t,n);else if("document"===e)i=_u(Tt(t));else if(ut(e))i=Cu(e,n);else{const n=_a(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return Hn(i)}function Ca(t,e){const n=Ft(t);return!(n===e||!ut(n)||Ae(n))&&("fixed"===ht(n).position||Ca(n,e))}function Su(t,e){const n=e.get(t);if(n)return n;let i=en(t,[],!1).filter((t=>ut(t)&&"body"!==Ie(t))),r=null;const o="fixed"===ht(t).position;let s=o?Ft(t):t;for(;ut(s)&&!Ae(s);){const e=ht(s),n=xr(s);!n&&"fixed"===e.position&&(r=null),(o?!n&&!r:!n&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||vn(s)&&!n&&Ca(t,s))?i=i.filter((t=>t!==s)):r=e,s=Ft(s)}return e.set(t,i),i}function xu(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[..."clippingAncestors"===n?li(e)?[]:Su(e,this._c):[].concat(n),i],s=o[0],a=o.reduce(((t,n)=>{const i=fo(e,n,r);return t.top=q(i.top,t.top),t.right=gt(i.right,t.right),t.bottom=gt(i.bottom,t.bottom),t.left=q(i.left,t.left),t}),fo(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Au(t){const{width:e,height:n}=ya(t);return{width:e,height:n}}function Ou(t,e,n){const i=_t(e),r=Tt(e),o="fixed"===n,s=ie(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Ut(0);if(i||!i&&!o)if(("body"!==Ie(e)||vn(r))&&(a=ui(e)),i){const t=ie(e,!0,o,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=wa(r));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function xi(t){return"static"===ht(t).position}function go(t,e){return _t(t)&&"fixed"!==ht(t).position?e?e(t):t.offsetParent:null}function Sa(t,e){const n=X(t);if(li(t))return n;if(!_t(t)){let e=Ft(t);for(;e&&!Ae(e);){if(ut(e)&&!xi(e))return e;e=Ft(e)}return n}let i=go(t,e);for(;i&&fu(i)&&xi(i);)i=go(i,e);return i&&Ae(i)&&xi(i)&&!xr(i)?n:i||gu(t)||n}const Eu=async function(t){const e=this.getOffsetParent||Sa,n=this.getDimensions,i=await n(t.floating);return{reference:Ou(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Pu(t){return"rtl"===ht(t).direction}const Ru={convertOffsetParentRelativeRectToViewportRelativeRect:bu,getDocumentElement:Tt,getClippingRect:xu,getOffsetParent:Sa,getElementRects:Eu,getClientRects:yu,getDimensions:Au,getScale:we,isElement:ut,isRTL:Pu};function $u(t,e){let n,i=null;const r=Tt(t);function o(){var t;clearTimeout(n),null==(t=i)||t.disconnect(),i=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const{left:d,top:c,width:u,height:h}=t.getBoundingClientRect();if(a||e(),!u||!h)return;const p={rootMargin:-xn(c)+"px "+-xn(r.clientWidth-(d+u))+"px "+-xn(r.clientHeight-(c+h))+"px "+-xn(d)+"px",threshold:q(0,gt(1,l))||1};let f=!0;function v(t){const e=t[0].intersectionRatio;if(e!==l){if(!f)return s();e?s(!1,e):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}f=!1}try{i=new IntersectionObserver(v,{...p,root:r.ownerDocument})}catch{i=new IntersectionObserver(v,p)}i.observe(t)}(!0),o}function Tu(t,e,n,i){void 0===i&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,d=Or(t),c=r||o?[...d?en(d):[],...en(e)]:[];c.forEach((t=>{r&&t.addEventListener("scroll",n,{passive:!0}),o&&t.addEventListener("resize",n)}));const u=d&&a?$u(d,n):null;let h=-1,p=null;s&&(p=new ResizeObserver((t=>{let[i]=t;i&&i.target===d&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var t;null==(t=p)||t.observe(e)}))),n()})),d&&!l&&p.observe(d),p.observe(e));let f,v=l?ie(t):null;return l&&function e(){const i=ie(t);v&&(i.x!==v.x||i.y!==v.y||i.width!==v.width||i.height!==v.height)&&n(),v=i,f=requestAnimationFrame(e)}(),n(),()=>{var t;c.forEach((t=>{r&&t.removeEventListener("scroll",n),o&&t.removeEventListener("resize",n)})),null==u||u(),null==(t=p)||t.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const ku=uu,Mu=hu,Iu=du,Bu=pu,Lu=cu,Du=(t,e,n)=>{const i=new Map,r={platform:Ru,...n},o={...r.platform,_c:i};return au(t,e,{...r,platform:o})};function Nu(t,e,n,i){Du(t,e,{placement:null==i?void 0:i.placement,middleware:[ku(null==i?void 0:i.offsetOptions),Iu(),Mu({padding:5}),Lu({element:n}),Bu()]}).then((({x:t,y:i,placement:r,middlewareData:o})=>{Object.assign(e.style,{left:`${t}px`,top:`${i}px`});const{x:s,y:a}=o.arrow,l={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];Object.assign(n.style,{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[l]:"-4px"})}))}async function Hi(t,e){const n=await(await fetch(t)).arrayBuffer();return await e.decodeAudioData(n)}function xa(t,e,n){return new Promise((i=>{const r=Uu(t,e,n);r.onended=()=>i(),r.start(0)}))}function Uu(t,e,n){const i=e.createBufferSource();return i.buffer=t,i.connect(n),i}const qn=class{};qn.playStart="attendi.core.notification-audio.play-start",qn.playStop="attendi.core.notification-audio.play-stop";let Zt=qn;const ju={startNotificationAudioURL:"https://stbinarydata.blob.core.windows.net/binarydata/start_notification.mp3",stopNotificationAudioURL:"https://stbinarydata.blob.core.windows.net/binarydata/stop_notification.mp3"};class zi{constructor(t){this.notificationSoundsLoaded=!1,this.notificationSoundContext=void 0,this.notificationSoundGain=void 0,this.startNotificationAudio=void 0,this.stopNotificationAudio=void 0,this.pluginCleanupCallbacks=[];const e={...ju,...t};this.startNotificationAudioURL=e.startNotificationAudioURL,this.stopNotificationAudioURL=e.stopNotificationAudioURL}activate(t){this.pluginCleanupCallbacks.push(t.hooks.onBeforeStartRecording((async()=>{this.notificationSoundsLoaded||await this.loadNotificationSounds()})),t.addCommand(Zt.playStart,(async()=>{await this.playAudio(this.startNotificationAudio)})),t.addCommand(Zt.playStop,(()=>{this.playAudio(this.stopNotificationAudio)})),t.hooks.onBeforeStartRecording((async()=>{const e=Date.now();await t.executeAsyncCommand(Zt.playStart);const n=Date.now()-e;t.shortenShowRecordingDelayByMilliseconds+=n})),t.hooks.onStopRecording((()=>t.executeCommand(Zt.playStop))))}async loadNotificationSounds(){this.notificationSoundsLoaded||(this.notificationSoundContext=new AudioContext,this.notificationSoundGain=this.notificationSoundContext.createGain(),this.notificationSoundGain.gain.value=.25,this.notificationSoundGain.connect(this.notificationSoundContext.destination),this.startNotificationAudio=await Hi(this.startNotificationAudioURL,this.notificationSoundContext),this.stopNotificationAudio=await Hi(this.stopNotificationAudioURL,this.notificationSoundContext),this.notificationSoundsLoaded=!0)}async playAudio(t){void 0!==t&&void 0!==this.notificationSoundContext&&void 0!==this.notificationSoundGain&&await xa(t,this.notificationSoundContext,this.notificationSoundGain)}deactivate(){this.notificationSoundsLoaded=!1,this.notificationSoundContext=void 0,this.notificationSoundGain=void 0,this.startNotificationAudio=void 0,this.stopNotificationAudio=void 0;for(const t of this.pluginCleanupCallbacks)t();this.pluginCleanupCallbacks=[]}}var He=(t=>(t.SOEP="SOEP",t.SOAP="SOAP",t.TIME="TIME",t))(He||{});const Er={reportingMethodType:"SOEP",name:"SOEP",displayName:"SOEP",steps:[{name:"Subjectief",symbol:"S",prompt:"Informatie afkomstig van de cliënt zelf"},{name:"Objectief",symbol:"O",prompt:"Wat zijn jouw observaties van de situatie?"},{name:"Evaluatie",symbol:"E",prompt:"Wat concludeer je uit de informatie die je hebt?"},{name:"Plan",symbol:"P",prompt:"Wat zijn de vervolgstappen die je gaat nemen?"}],description:"Gebruik deze methode om meer structuur aan te brengen in een rapportage. Dit is vooral nuttig bij een veranderende zorgsituatie."},Fu={reportingMethodType:"SOAP",name:"SOAP",displayName:"SOAP",steps:[{name:"Subjectief",symbol:"S",prompt:"Informatie afkomstig van de cliënt zelf"},{name:"Objectief",symbol:"O",prompt:"Wat zijn jouw observaties van de situatie?"},{name:"Analyse",symbol:"A",prompt:"Wat concludeer je uit de informatie die je hebt?"},{name:"Plan",symbol:"P",prompt:"Wat zijn de vervolgstappen die je gaat nemen?"}],description:"Gebruik deze methode om meer structuur aan te brengen in een rapportage. Dit is vooral nuttig bij een veranderende zorgsituatie."},Vu={reportingMethodType:"TIME",name:"TIME",displayName:"TIME",steps:[{name:"Tissue (weefsel)",symbol:"T",prompt:"Is er vitaal of dood weefsel?"},{name:"Infection (infectie)",symbol:"I",prompt:"Is er een infectie of ontsteking?"},{name:"Moisture (vochtbalans)",symbol:"M",prompt:"Is de wond te vochtig of te droog?"},{name:"Edge (wondrand)",symbol:"E",prompt:"Is er een niet-sluitende of ondermijnende wondrand?"}],description:"Gebruik deze methode bij het beoordelen en bepalen van het wondbeleid voor moeilijke en complexe wonden, met focus op gezonde wondgenezing."},nn=new Map([["SOEP",Er],["SOAP",Fu],["TIME",Vu]]),vo="#1C69E8";class Aa{constructor(t){this.baseColor=vo,this.pluginCleanupCallbacks=[],this.transcribeConfig={metadata:{userAgent:navigator.userAgent,...t.metadata},...t}}activate(t){var e,n;if(void 0===this.transcribeConfig.customerKey)throw new Error("Customer key is required for the linear reporting method plugin");const i={apiURL:this.transcribeConfig.apiURL,customerKey:this.transcribeConfig.customerKey,unitId:this.transcribeConfig.unitId??"unknown",userId:this.transcribeConfig.userId,modelType:null==(e=this.transcribeConfig.config)?void 0:e.model,userAgent:(null==(n=this.transcribeConfig.metadata)?void 0:n.userAgent)??void 0};this.pluginCleanupCallbacks.push(t.addMenuGroup({id:"reporting-methods",title:"Rapportagemethodes",priority:1,icon:fl}),t.addMenuItem({groupId:"reporting-methods",title:"SOEP",command:"open-reporting-method-soep"}),t.addMenuItem({groupId:"reporting-methods",title:"SOAP",command:"open-reporting-method-soap"}),t.addMenuItem({groupId:"reporting-methods",title:"TIME",command:"open-reporting-method-time"}),t.addDialog({id:"linear-reporting-method-soep",dialog:this.getLinearReportingMethodDialog(He.SOEP,t,i)}),t.addDialog({id:"linear-reporting-method-soap",dialog:this.getLinearReportingMethodDialog(He.SOAP,t,i)}),t.addDialog({id:"linear-reporting-method-time",dialog:this.getLinearReportingMethodDialog(He.TIME,t,i)}),t.addCommand("open-reporting-method-soep",(()=>{t.showDialog("linear-reporting-method-soep"),t.dispatchEvent(new CustomEvent("attendi-reporting-method-soep-open",{bubbles:!0,composed:!0}))})),t.addCommand("open-reporting-method-soap",(()=>{t.showDialog("linear-reporting-method-soap"),t.dispatchEvent(new CustomEvent("attendi-reporting-method-soap-open",{bubbles:!0,composed:!0}))})),t.addCommand("open-reporting-method-time",(()=>{t.showDialog("linear-reporting-method-time"),t.dispatchEvent(new CustomEvent("attendi-reporting-method-time-open",{bubbles:!0,composed:!0}))})),t.hooks.onAttributeChanged(((e,n,i)=>{e===t.attributeNames.baseColor&&(this.baseColor=i)})))}getLinearReportingMethodDialog(t,e,n){return v`
      <attendi-dialog
        class="reporting-method-dialog"
        @attendi-dialog-close=${()=>{e.closeDialog(),e.dispatchEvent(new CustomEvent("attendi-reporting-method-close",{bubbles:!0,composed:!0}))}}
      >
        <div style="padding-top: 30px">
          <attendi-linear-reporting-method-screen
            @attendi-linear-reporting-method-done=${t=>{e.dispatchEvent(Bi({transcript:t.detail,text:t.detail})),e.dispatchEvent(Vd({transcript:t.detail,text:t.detail})),e.closeDialog()}}
            base-color=${ci(this.baseColor)}
            .transcribeAPIConfig=${n}
            reporting-method-type=${t}
          ></attendi-linear-reporting-method-screen>
        </div>
      </attendi-dialog>
    `}deactivate(){this.baseColor=vo;for(const t of this.pluginCleanupCallbacks)t();this.pluginCleanupCallbacks=[]}}const Hu=/\{[^{}]+\}/g,hi=({allowReserved:t,name:e,value:n})=>{if(null==n)return"";if("object"==typeof n)throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${t?n:encodeURIComponent(n)}`},zu=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Wu=t=>{switch(t){case"form":default:return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20"}},Gu=t=>{switch(t){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Oa=({allowReserved:t,explode:e,name:n,style:i,value:r})=>{if(!e){const e=(t?r:r.map((t=>encodeURIComponent(t)))).join(Wu(i));switch(i){case"label":return`.${e}`;case"matrix":return`;${n}=${e}`;case"simple":return e;default:return`${n}=${e}`}}const o=zu(i),s=r.map((e=>"label"===i||"simple"===i?t?e:encodeURIComponent(e):hi({allowReserved:t,name:n,value:e}))).join(o);return"label"===i||"matrix"===i?o+s:s},Ea=({allowReserved:t,explode:e,name:n,style:i,value:r})=>{if(r instanceof Date)return`${n}=${r.toISOString()}`;if("deepObject"!==i&&!e){let e=[];Object.entries(r).forEach((([n,i])=>{e=[...e,n,t?i:encodeURIComponent(i)]}));const o=e.join(",");switch(i){case"form":return`${n}=${o}`;case"label":return`.${o}`;case"matrix":return`;${n}=${o}`;default:return o}}const o=Gu(i),s=Object.entries(r).map((([e,r])=>hi({allowReserved:t,name:"deepObject"===i?`${n}[${e}]`:e,value:r}))).join(o);return"label"===i||"matrix"===i?o+s:s},qu=({path:t,url:e})=>{let n=e;const i=e.match(Hu);if(i)for(const e of i){let i=!1,r=e.substring(1,e.length-1),o="simple";r.endsWith("*")&&(i=!0,r=r.substring(0,r.length-1)),r.startsWith(".")?(r=r.substring(1),o="label"):r.startsWith(";")&&(r=r.substring(1),o="matrix");const s=t[r];if(null!=s){if(Array.isArray(s)){n=n.replace(e,Oa({explode:i,name:r,style:o,value:s}));continue}if("object"==typeof s){n=n.replace(e,Ea({explode:i,name:r,style:o,value:s}));continue}if("matrix"===o){n=n.replace(e,`;${hi({name:r,value:s})}`);continue}n=n.replace(e,"label"===o?`.${s}`:s)}}return n},Pa=({allowReserved:t,array:e,object:n}={})=>i=>{let r=[];if(i&&"object"==typeof i)for(const o in i){const s=i[o];if(null!=s){if(Array.isArray(s)){r=[...r,Oa({allowReserved:t,explode:!0,name:o,style:"form",value:s,...e})];continue}if("object"==typeof s){r=[...r,Ea({allowReserved:t,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}r=[...r,hi({allowReserved:t,name:o,value:s})]}}return r.join("&")},Ku=t=>{if(t){if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if("multipart/form-data"===t)return"formData";if(["application/","audio/","image/","video/"].some((e=>t.startsWith(e))))return"blob";if(t.startsWith("text/"))return"text"}},Zu=({baseUrl:t,path:e,query:n,querySerializer:i,url:r})=>{let o=t+(r.startsWith("/")?r:`/${r}`);e&&(o=qu({path:e,url:o}));let s=n?i(n):"";return s.startsWith("?")&&(s=s.substring(1)),s&&(o+=`?${s}`),o},mo=(t,e)=>{var n;const i={...t,...e};return null!=(n=i.baseUrl)&&n.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=Ra(t.headers,e.headers),i},Ra=(...t)=>{const e=new Headers;for(const n of t){if(!n||"object"!=typeof n)continue;const t=n instanceof Headers?n.entries():Object.entries(n);for(const[n,i]of t)if(null===i)e.delete(n);else if(Array.isArray(i))for(const t of i)e.append(n,t);else void 0!==i&&e.set(n,"object"==typeof i?JSON.stringify(i):i)}return e};class bo{constructor(){this._fns=[]}eject(t){const e=this._fns.indexOf(t);-1!==e&&(this._fns=[...this._fns.slice(0,e),...this._fns.slice(e+1)])}use(t){this._fns=[...this._fns,t]}}const Yu=()=>({request:new bo,response:new bo}),Xu={bodySerializer:t=>JSON.stringify(t)},Ju=Pa({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Qu={"Content-Type":"application/json"},$a=(t={})=>({...Xu,baseUrl:"",fetch:globalThis.fetch,headers:Qu,parseAs:"auto",querySerializer:Ju,...t}),th=(t={})=>{let e=mo($a(),t);const n=()=>({...e}),i=Yu(),r=async t=>{const n={...e,...t,headers:Ra(e.headers,t.headers)};n.body&&n.bodySerializer&&(n.body=n.bodySerializer(n.body)),n.body||n.headers.delete("Content-Type");const r=Zu({baseUrl:n.baseUrl??"",path:n.path,query:n.query,querySerializer:"function"==typeof n.querySerializer?n.querySerializer:Pa(n.querySerializer),url:n.url}),o={redirect:"follow",...n};let s=new Request(r,o);for(const t of i.request._fns)s=await t(s,n);const a=n.fetch;let l=await a(s);for(const t of i.response._fns)l=await t(l,s,n);const d={request:s,response:l};if(l.ok){if(204===l.status||"0"===l.headers.get("Content-Length"))return{data:{},...d};if("stream"===n.parseAs)return{data:l.body,...d};const t=("auto"===n.parseAs?Ku(l.headers.get("Content-Type")):n.parseAs)??"json";let e=await l[t]();return"json"===t&&n.responseTransformer&&(e=await n.responseTransformer(e)),{data:e,...d}}let c=await l.text();if(n.throwOnError)throw new Error(c);try{c=JSON.parse(c)}catch{}return{error:c||{},...d}};return{connect:t=>r({...t,method:"CONNECT"}),delete:t=>r({...t,method:"DELETE"}),get:t=>r({...t,method:"GET"}),getConfig:n,head:t=>r({...t,method:"HEAD"}),interceptors:i,options:t=>r({...t,method:"OPTIONS"}),patch:t=>r({...t,method:"PATCH"}),post:t=>r({...t,method:"POST"}),put:t=>r({...t,method:"PUT"}),request:r,setConfig:t=>(e=mo(e,t),n()),trace:t=>r({...t,method:"TRACE"})}},Pr=th($a()),Ta=t=>((null==t?void 0:t.client)??Pr).post({...t,url:"/v1/speech/transcribe"}),ka=t=>((null==t?void 0:t.client)??Pr).put({...t,url:"/v1/reports/{id}"}),eh=t=>((null==t?void 0:t.client)??Pr).post({...t,url:"/v1/identity/authenticate"});class pi{constructor(t,e){this.sessionId=xe(),this.reportId=tn(),this.clearOnStopRecordingListener=void 0,this.transcribeConfig={metadata:{userAgent:navigator.userAgent,...t.metadata},...t},this.onTranscript=e}activate(t){var e;null==(e=this.clearOnStopRecordingListener)||e.call(this),this.clearOnStopRecordingListener=t.hooks.onStopRecording((async(e,n)=>{if(!n.shouldProcessRecording)return;const i=await pa(e);let r={};this.transcribeConfig.customerKey&&(r["x-api-key"]=this.transcribeConfig.customerKey),r={...r,...this.transcribeConfig.headers};const o=(await Ta({baseUrl:this.transcribeConfig.apiURL??"https://api.attendi.nl",body:{audio:i,userId:this.transcribeConfig.userId,unitId:this.transcribeConfig.unitId,config:this.transcribeConfig.config,metadata:{reportId:this.reportId,sessionId:this.sessionId,userAgent:navigator.userAgent,...this.transcribeConfig.metadata}},headers:r})).data;if(void 0===(null==o?void 0:o.transcript)||null===(null==o?void 0:o.transcript))throw new Error("No response from transcribe service");await this.onTranscript(o.transcript,t)}))}deactivate(){var t;null==(t=this.clearOnStopRecordingListener)||t.call(this),this.clearOnStopRecordingListener=void 0}setSessionId(t){this.sessionId=t}resetSessionId(){this.sessionId=xe()}setReportId(t){this.reportId=t}resetReportId(){this.reportId=tn()}setConfig(t){this.transcribeConfig=t}}const nh=(t,e,n)=>{const{startCharacterIndex:i,endCharacterIndex:r,text:o}=n;return{id:t,index:e,type:"replace_text",apply:t=>{const e=t.text.substring(i,r),n=t.text.substring(0,i)+o+t.text.substring(r);return{updatedState:{...t,text:n},undo:t=>({text:t.text.substring(0,i)+e+t.text.substring(i+o.length),annotations:t.annotations})}}}};function ih(t,e,n){return e<0||n>t.length}const rh=(t,e,n)=>({id:t,index:e,type:"add_annotation",apply:t=>{const{startCharacterIndex:e,endCharacterIndex:i}=n;if(ih(t.text,e,i))throw new Error("Annotation indices are out of bounds");if(i<e)throw new Error("Annotation `startCharacterIndex` must be less than or equal to `endCharacterIndex`");return{updatedState:{...t,annotations:[...t.annotations,n]},undo:t=>({...t,annotations:t.annotations.filter((t=>t.id!==n.id))})}}}),oh=(t,e,n)=>({id:t,index:e,type:"update_annotation",apply:t=>{const e=t.annotations.map((t=>{if(t.id!==n.id)return t;if("transcription_tentative"===t.type){if("transcription_tentative"!==n.type)throw new Error(`The updated annotation for annotation with id ${n.id} should have type "transcription_tentative".`);return{...t,...n}}return t}));return{updatedState:{...t,annotations:e},undo:e=>({...e,annotations:t.annotations.map((e=>{if(e.id!==n.id)return e;if("transcription_tentative"===e.type){const i=t.annotations.find((t=>t.id===n.id));if(void 0===i)throw new Error(`Annotation with id ${n.id} not found`);if("transcription_tentative"!==i.type)throw new Error(`Annotation with id ${n.id} is not a transcription_tentative annotation`);return e}return e}))})}}}),sh=(t,e,n)=>({id:t,index:e,type:"remove_annotation",apply:t=>{const e=t.annotations.findIndex((t=>t.id===n.id));if(-1===e)throw new Error(`Annotation with id ${n.id} not found`);const i={...t,annotations:t.annotations.filter(((t,n)=>n!==e))},r=t.annotations[e];return{updatedState:i,undo:t=>({...t,annotations:[...t.annotations,r]})}}}),ah={initialState:{text:"",annotations:[]},initialOperationHistory:[],undoneOperations:[],expectedIndex:0,outOfOrderOperationBuffer:new Map,outOfOrderOperationTimeoutDurationMilliseconds:2e4,bufferedOutOfOrderOperationTimeouts:new Map},qt=t=>{const e={...ah,...t},{initialState:n,initialOperationHistory:i,undoneOperations:r,expectedIndex:o,outOfOrderOperationBuffer:s,outOfOrderOperationTimeoutDurationMilliseconds:a,bufferedOutOfOrderOperationTimeouts:l}=e;return{state:n,receiveActions:t=>{let e=n,d=[...i],c=[...r],u=o;const h=new Map(s),p=new Map(l);return t.forEach((t=>{const n=ch(t);if(n.index<u)console.warn(`Received duplicate or outdated action with index ${n.index}`);else if(n.index===u){const{updatedState:t,undo:i}=n.apply(e);for(e=t,d=[...d,{operation:n,undo:i}],c=[],u++;h.has(u);){const t=h.get(u),{updatedState:n,undo:i}=t.apply(e);e=n,d=[...d,{operation:t,undo:i}],h.delete(u);const r=p.get(u);void 0!==r&&(clearTimeout(r),p.delete(u)),u++}}else if(!h.has(n.index)){h.set(n.index,n);const t=setTimeout((()=>{if(h.has(n.index))throw new Error(`Timeout waiting for action with index ${u}`)}),a);p.set(n.index,t)}})),qt({initialState:e,initialOperationHistory:d,undoneOperations:c,expectedIndex:u,outOfOrderOperationBuffer:h,outOfOrderOperationTimeoutDurationMilliseconds:a,bufferedOutOfOrderOperationTimeouts:p})},undoOperations:t=>{if(t<0)throw new Error("Cannot undo a negative number of actions");if(t>i.length)return console.warn("Attempting to undo more actions than available"),qt({initialState:n,initialOperationHistory:i,undoneOperations:r,expectedIndex:o,outOfOrderOperationBuffer:s,outOfOrderOperationTimeoutDurationMilliseconds:a});let e=n,l=i.slice(0,-t),d=[...i.slice(-t),...r];for(let n=i.length-1;n>=i.length-t;n--)e=i[n].undo(e);return qt({initialState:e,initialOperationHistory:l,undoneOperations:d,expectedIndex:o-t,outOfOrderOperationBuffer:s,outOfOrderOperationTimeoutDurationMilliseconds:a})},redoOperations:t=>{if(t<0)throw new Error("Cannot redo a negative number of operations");if(t>r.length)return console.warn("Attempting to redo more operations than available"),qt({initialState:n,initialOperationHistory:i,undoneOperations:r,expectedIndex:o,outOfOrderOperationBuffer:s,outOfOrderOperationTimeoutDurationMilliseconds:a});let e=n,l=[...i],d=r.slice(t);for(let n=0;n<t;n++){const{operation:t,undo:i}=r[n],{updatedState:o}=t.apply(e);e=o,l=[...l,{operation:t,undo:i}]}return qt({initialState:e,initialOperationHistory:l,undoneOperations:d,expectedIndex:o+t,outOfOrderOperationBuffer:s,outOfOrderOperationTimeoutDurationMilliseconds:a})},operationHistory:i}};function ch(t){if("replace_text"===t.type)return nh(t.id,t.index,t.parameters);if("add_annotation"===t.type)return rh(t.id,t.index,t.parameters);if("update_annotation"===t.type){if("entity"===t.parameters.type)throw new Error("Entity annotations are not supported yet.");return oh(t.id,t.index,t.parameters)}if("remove_annotation"===t.type)return sh(t.id,t.index,t.parameters);throw new Error(`Unsupported action type for action: ${t}`)}const dh=1e4,yo=1e4,Ai=4096,_o=15,Ma=1e3;class lh{constructor({url:t,onMessage:e,onError:n,onClose:i,onOpen:r}){this.streamingBuffer=new Float32Array(0),this.url=t,this.onMessageCallback=e,this.onErrorCallback=n,this.onCloseCallback=i,this.onOpenCallback=r}addToStreamingBuffer(t){const e=new Float32Array(this.streamingBuffer.length+t.length);e.set(this.streamingBuffer),e.set(t,this.streamingBuffer.length),this.streamingBuffer=e}sendAudioFrames(t){const e=t??Ai;if(this.streamingBuffer.length<e)return;const n=this.streamingBuffer.slice(0,Ai);this.streamingBuffer=this.streamingBuffer.slice(Ai);const i=fh(n);this.sendMessage(i)}clearStreamingBuffer(){this.streamingBuffer=new Float32Array(0)}async connect(t){this.socket=new WebSocket(this.url,null==t?void 0:t.protocols),this.socket.onmessage=t=>{var e;if(!t.data)return;const n=JSON.parse(t.data);null==(e=this.onMessageCallback)||e.call(this,n)},await new Promise(((e,n)=>{const i=setTimeout((()=>{n(new Error("WebSocket connection timed out"))}),(null==t?void 0:t.openConnectionTimeoutMilliseconds)??dh);if(void 0===this.socket)return clearTimeout(i),n(new Error("Socket is undefined"));this.socket.onerror=t=>{var e;clearTimeout(i),null==(e=this.onErrorCallback)||e.call(this,t),this.socket=void 0,n(new Error("WebSocket encountered an error"))},this.socket.onclose=t=>{var r;clearTimeout(i),null==(r=this.onCloseCallback)||r.call(this,t),this.socket=void 0,t.code>Ma?n(new Error(`WebSocket connection closed abnormally: ${t.reason}`)):e()},this.socket.onopen=()=>{var t;clearTimeout(i),null==(t=this.onOpenCallback)||t.call(this),e()}}))}sendMessage(t){if(this.socket&&this.socket.readyState===WebSocket.OPEN){if(t instanceof DataView)return void this.socket.send(t.buffer);this.socket.send(JSON.stringify(t))}}disconnect(){this.socket&&(this.socket.close(),this.socket=void 0)}onMessage(t){this.onMessageCallback=t}onError(t){this.onErrorCallback=t}onClose(t){this.onCloseCallback=t}onOpen(t){this.onOpenCallback=t}}class uh{constructor({transcribeConfig:t,onStreamUpdated:e,onStreamCompleted:n,onAbnormalClosure:i,getAuthenticationToken:r}){var o;this.authenticationToken=void 0,this.numConnectionTriesAfterSuccess=0,this.sessionId=xe(),this.reportId=tn(),this.pluginCleanupCallbacks=[],this.transcribeConfig={metadata:{userAgent:navigator.userAgent,...t.metadata},features:{voiceEditing:{isEnabled:!1,useAttendiEntityRecognitionModel:!1,...null==(o=t.features)?void 0:o.voiceEditing}},...t},this.stream=qt(),this.onStreamUpdated=e||(()=>{}),this.onStreamCompleted=n||(()=>{}),this.onAbnormalClosure=i||(()=>{}),this.getAuthenticationToken=r||(async t=>hh(t))}activate(t){const e=new lh({url:(this.transcribeConfig.apiURL??"https://api.attendi.nl").replace("http","ws")+"/v1/speech/transcribe/stream",onMessage:t=>this.handleIncomingTranscriptionMessage(t),onOpen:()=>{var t;if(void 0===this.adapter)throw new Error("WebSocket adapter is undefined");const e={type:"configuration",reportId:this.reportId,sessionId:this.sessionId};void 0!==(null==(t=this.transcribeConfig.config)?void 0:t.model)&&(e.model=this.transcribeConfig.config.model),void 0!==this.transcribeConfig.features&&(e.features=this.transcribeConfig.features),this.adapter.sendMessage(e)},onError:e=>{if(console.error("WebSocket connection error"),console.error(e),0!==this.numConnectionTriesAfterSuccess)throw this.onAbnormalClosure(this.stream),this.reset(),t.reset(),t.handleError({detail:{title:k.genericErrorDialogTitle,content:k.genericErrorDialogContent}}),new Error("WebSocket connection error")},onClose:e=>{if(console.debug("WebSocket connection closed"),console.debug(e),0!==this.numConnectionTriesAfterSuccess){if(e.code>Ma)throw this.onAbnormalClosure(this.stream),this.reset(),t.reset(),t.handleError({detail:{title:k.genericErrorDialogTitle,content:k.genericErrorDialogContent}}),new Error(`WebSocket connection closed abnormally: ${e.reason}`);this.reset()}}});this.pluginCleanupCallbacks.push(t.hooks.onBeforeStartRecording((async()=>{void 0===this.authenticationToken&&(this.authenticationToken=await wo(this.getAuthenticationToken(this.transcribeConfig),yo)),await new Ia({maximumRetries:1}).runWithDelayedRetry((async()=>{try{await e.connect({protocols:this.authenticationToken}),this.numConnectionTriesAfterSuccess+=1}catch{throw this.authenticationToken=await wo(this.getAuthenticationToken(this.transcribeConfig),yo),new Error("Could not connect to the server")}}))})),t.hooks.onAudioFrames((n=>{t.clearBuffer(),e.addToStreamingBuffer(n),e.sendAudioFrames()})),t.hooks.onStopRecording((async(t,n)=>{const{shouldProcessRecording:i}=n;if(!i)return e.disconnect(),void this.reset();e.sendAudioFrames(0),e.clearStreamingBuffer();e.sendMessage({type:"endOfAudioStream"}),await new Promise(((t,n)=>{setTimeout((()=>{n("Timeout: after sending the 'endOfAudioStream' message, the connection wasn't closed by the server after 15 seconds.")}),15e3),e.onClose((()=>{this.onStreamCompleted(this.stream),this.reset(),t()}))}))}))),this.adapter=e}handleIncomingTranscriptionMessage(t){this.stream=this.stream.receiveActions(t.actions),this.onStreamUpdated(this.stream)}reset(){var t;null==(t=this.adapter)||t.clearStreamingBuffer(),this.stream=qt(),this.numConnectionTriesAfterSuccess=0}deactivate(){this.pluginCleanupCallbacks.forEach((t=>t()))}setSessionId(t){this.sessionId=t}resetSessionId(){this.sessionId=xe()}setReportId(t){this.reportId=t}resetReportId(){this.reportId=tn()}}async function hh(t){const e=(await(new Ia).runWithDelayedRetry((async()=>{var e;return await eh({baseUrl:t.apiURL??"https://api.attendi.nl",body:{userId:t.userId,unitId:t.unitId,userAgent:(null==(e=t.metadata)?void 0:e.userAgent)??navigator.userAgent},headers:{"x-api-key":t.customerKey}})}))).data;if(void 0===(null==e?void 0:e.token)||null===e.token)throw new Error("No authentication token received from API");return e.token}const ph={maximumRetries:1,baseDelayMilliseconds:200,maximumDelayMilliseconds:2e3};class Ia{constructor(t){this.retryCount=0,this.options={...ph,...t}}reset(){this.retryCount=0}async runWithDelayedRetry(t){const e=this.retryCount;if(e-1>=this.options.maximumRetries)return Promise.reject();this.retryCount=e+1;try{return await t()}catch{return await this.timeoutWithJitter(e),this.runWithDelayedRetry(t)}}async timeoutWithJitter(t){let e=2**t*this.options.baseDelayMilliseconds;e=Math.min(this.options.maximumDelayMilliseconds,e);const n=this.jitter(e);await ha(n)}jitter(t){return this.getRandomInteger(0,t)}getRandomInteger(t,e){return Math.floor(Math.random()*(e-t+1))+t}}function fh(t){const e=new Int16Array(t.length);for(let n=0;n<t.length;n++)e[n]=32767*Math.min(1,t[n]);return new DataView(e.buffer)}async function wo(t,e){let n;const i=new Promise(((t,i)=>{n=setTimeout((()=>{i(new Error("Async call timeout limit reached"))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(n),t)))}const z=8;var Ba=(t=>(t.none="none",t.outer="outer",t.inner="inner",t))(Ba||{}),La=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.all="all",t))(La||{});class Da{constructor(){this.volume=0,this.pluginCleanupCallbacks=[]}activate(t){this.handleVolumeUpdateBound=e=>{var n;const i=null==(n=e.detail)?void 0:n.volume;void 0!==i&&this.updateVolume(i,t)},t.addEventListener("attendi-microphone-volume-updated",this.handleVolumeUpdateBound),this.addVariableWrapperClasses(t),this.addDynamicStyle(t),this.pluginCleanupCallbacks.push(t.ui.transformViewOnState(((e,n)=>{if(null==e)return e;if("Recording"===n&&"outer"===t.volumeFeedbackType){const n=this.getOuterVolumeFeedbackAnimationStyle(t);return v`
            <div class="inner-button-height w-100" style="position: relative;">
              <div
                class="volume-feedback inner-button-height w-100"
                style=${n}
              ></div>

              ${e}
            </div>
          `}return e})))}addDynamicStyle(t){this.pluginCleanupCallbacks.push(t.addDynamicStyle("volume-feedback",E`
          .variable-wrapper.outer-volume-feedback-type.no-volume-feedback {
            --attendi-microphone-padding: 0px;
          }

          .variable-wrapper.outer-volume-feedback-type.outer-volume-feedback-type-left {
            --attendi-microphone-padding-left: ${8}px;
          }

          .variable-wrapper.outer-volume-feedback-type.outer-volume-feedback-type-right {
            --attendi-microphone-padding-right: ${8}px;
          }

          .variable-wrapper.outer-volume-feedback-type.outer-volume-feedback-type-top {
            --attendi-microphone-padding-top: ${8}px;
          }

          .variable-wrapper.outer-volume-feedback-type.outer-volume-feedback-type-bottom {
            --attendi-microphone-padding-bottom: ${8}px;
          }

          .variable-wrapper.outer-volume-feedback-type.outer-volume-feedback-type-all {
            --attendi-microphone-padding-top: ${8}px;
            --attendi-microphone-padding-right: ${8}px;
            --attendi-microphone-padding-bottom: ${8}px;
            --attendi-microphone-padding-left: ${8}px;
          }

          /* The div that represents the volume feedback, placed behind the microphone button */
          .volume-feedback {
            position: absolute;
            border-radius: var(--attendi-microphone-border-radius);
            background-color: var(--color-volume-feedback);
          }
        `),t.ui.transformViewOnState(((e,n)=>{if(null==e)return e;if("Recording"===n&&"outer"===t.volumeFeedbackType){const n=this.getOuterVolumeFeedbackAnimationStyle(t);return v`
            <div class="inner-button-height w-100" style="position: relative;">
              <div
                class="volume-feedback inner-button-height w-100"
                style=${n}
              ></div>

              ${e}
            </div>
          `}return e})),t.hooks.onBeforeStopRecording((()=>{t.animatableElements.setAnimatedMicrophoneFill(0)})))}addVariableWrapperClasses(t){this.pluginCleanupCallbacks.push(t.addVariableWrapperClass("outer-volume-feedback-type",(()=>"outer"===t.volumeFeedbackType)),t.addVariableWrapperClass("inner-volume-feedback-type",(()=>"inner"===t.volumeFeedbackType)),t.addVariableWrapperClass("outer-volume-feedback-type-all",(()=>"all"===t.outerVolumeFeedbackType)),t.addVariableWrapperClass("outer-volume-feedback-type-left",(()=>"left"===t.outerVolumeFeedbackType)),t.addVariableWrapperClass("outer-volume-feedback-type-right",(()=>"right"===t.outerVolumeFeedbackType)),t.addVariableWrapperClass("outer-volume-feedback-type-top",(()=>"top"===t.outerVolumeFeedbackType)),t.addVariableWrapperClass("outer-volume-feedback-type-bottom",(()=>"bottom"===t.outerVolumeFeedbackType)))}updateVolume(t,e){const n=.825*this.volume+.175*t;this.setVolume(n,e)}setVolume(t,e){const n=this.volume;this.volume=t,!(Math.abs(n-t)<5e-5)&&(void 0!==e.animatedMicrophoneFill&&"inner"===e.volumeFeedbackType&&this.updateInnerVolumeFeedback(e),e.requestUpdate())}updateInnerVolumeFeedback(t){const e=100*(.2+.8*this.volume),n=t.animatableElements.getAnimatedMicrophoneFill();Math.abs(n-e)>.05&&t.animatableElements.setAnimatedMicrophoneFill(e)}getOuterVolumeFeedbackAnimationStyle(t){var e;const n=null==(e=t.recordingButton)?void 0:e.getBoundingClientRect(),i=t.outerVolumeFeedbackType;return qs(gh(this.volume,n,i))}deactivate(t){void 0!==this.handleVolumeUpdateBound&&t.removeEventListener("attendi-microphone-volume-updated",this.handleVolumeUpdateBound);for(const t of this.pluginCleanupCallbacks)t();this.pluginCleanupCallbacks=[]}}function gh(t,e,n){const i=.3,r=1+(i+.7*t)*(2*(8/((null==e?void 0:e.width)??0))),o=1+(i+.7*t)*(2*(8/((null==e?void 0:e.height)??0)));return"left"===n?{transform:`scaleX(${s(r)})`,"transform-origin":"100% 50%"}:"right"===n?{transform:`scaleX(${s(r)})`,"transform-origin":"0% 50%"}:"top"===n?{transform:`scaleY(${s(o)})`,"transform-origin":"50% 100%"}:"bottom"===n?{transform:`scaleY(${s(o)})`,"transform-origin":"50% 0%"}:{transform:`scaleX(${r}) scaleY(${o})`};function s(t){return 1+(t-1)/2}}const vh={errorNotificationAudioURL:"https://stbinarydata.blob.core.windows.net/binarydata/error_notification.mp3",silent:!1};class Wi{constructor(t){this.errorSoundLoaded=!1,this.notificationSoundContext=void 0,this.notificationSoundGain=void 0,this.errorNotificationAudio=void 0,this.pluginCleanupCallbacks=[];const e={...vh,...t};this.errorNotificationAudioURL=e.errorNotificationAudioURL,this.silent=e.silent}activate(t){this.pluginCleanupCallbacks.push(t.hooks.onFirstClick((async()=>{this.silent||await this.loadNotificationSounds()})),t.hooks.onError((e=>{var n;console.log("there was an error: ",(null==(n=e.detail)?void 0:n.title)??""),t.showErrorDialog(e),!this.silent&&this.playAudio(this.errorNotificationAudio)})))}async playAudio(t){void 0!==t&&void 0!==this.notificationSoundContext&&void 0!==this.notificationSoundGain&&await xa(t,this.notificationSoundContext,this.notificationSoundGain)}async loadNotificationSounds(){if(!this.errorSoundLoaded){try{this.notificationSoundContext=new AudioContext}catch{return void console.error("Failed to create AudioContext. Error sound will not be played.")}this.notificationSoundGain=this.notificationSoundContext.createGain(),this.notificationSoundGain.gain.value=.25,this.notificationSoundGain.connect(this.notificationSoundContext.destination),this.errorNotificationAudio=await Hi(this.errorNotificationAudioURL,this.notificationSoundContext),this.errorSoundLoaded=!0}}deactivate(){this.errorSoundLoaded=!1,this.notificationSoundContext=void 0,this.notificationSoundGain=void 0,this.errorNotificationAudio=void 0;for(const t of this.pluginCleanupCallbacks)t();this.pluginCleanupCallbacks=[]}}const mh={"attendi.assistant.write-my-report":void 0,"attendi.reporting-methods.soep":void 0,"attendi.reporting-methods.soap":void 0,"attendi.reporting-methods.time":void 0},bh="https://api.attendi.nl";class yh{activate(t){void 0!==t.transcribeAPIConfig&&this.setFeatureOverrides(t,t.transcribeAPIConfig),t.hooks.onTranscribeAPIConfig((e=>this.setFeatureOverrides(t,e)))}setFeatureOverrides(t,e){if(void 0===e)return;const n=wh(t.getAttribute("unit-ids"));_h(e.customerKey,n,e.apiURL??bh).then((e=>{t.featureOverrides=e})).catch((t=>{console.log("Fetching feature flags failed: ",t)}))}}async function _h(t,e,n){const i=Sh(e),r=await fetch(`${n}/v1/configuration/feature_flags?${i}`,{method:"GET",headers:{"x-API-key":t,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return Ch(await r.json())}function wh(t){return null===t?[]:t.split(",").map((t=>t.trim())).filter((t=>""!==t))}function Ch(t){const e=Object.keys(mh),n=Object.entries(t).map((([t,e])=>[t.toLowerCase(),e])).filter((([t])=>e.includes(t)));return Object.fromEntries(n)}function Sh(t){return t.map((t=>`unitIds=${t}`)).join("&")}const xh=new Error("Current device does not support microphone API");class Na extends Error{constructor(t){super(t),this.name="NoAudioConsentError"}}async function Co(t){Ah();const e={video:!1};let n=!1;try{n=!0===window.navigator.mediaDevices.getSupportedConstraints().sampleRate}catch{}e.audio=n?{sampleRate:pr,channelCount:1,...t}:void 0===t||t;try{const n=await window.navigator.mediaDevices.getUserMedia(e),i=n.getAudioTracks()[0].getSettings(),r=Object.keys(t??{}).filter((e=>i[e]!==(null==t?void 0:t[e])));return r.length>0&&console.warn(`Some requested constraints were not respected: ${r.join(", ")}`),n}catch(t){throw new Na(t.message)}}function Ah(){var t;if(void 0===(null==(t=window.navigator)?void 0:t.mediaDevices))throw xh}function So(t){t.getTracks().forEach((t=>t.stop()))}const Oh=new Error("Current device does not support microphone API"),Eh=256,Ph=163840,Rh=2;class $h{constructor(){this.areAudioNodesConnected=!1,this.bufferPosition=0,this.signalEnergyCallbacks={},this.audioFrameCallbacks={},this.bufferCallbacks={},this._buffer=new Float32Array(Ph)}get buffer(){return this._buffer.subarray(0,this.bufferPosition)}set buffer(t){this._buffer=t,this.bufferPosition=t.length,Object.values(this.bufferCallbacks).forEach((e=>e(t)))}async initialize(t){var e;xo(t),void 0!==this.audioContext&&(await(null==(e=this.audioContext)?void 0:e.close()),this.audioContext=void 0),void 0!==this.scriptProcessorNode&&(this.scriptProcessorNode.disconnect(),this.scriptProcessorNode.onaudioprocess=()=>{},this.scriptProcessorNode=void 0),void 0!==this.mediaStreamSourceNode&&(this.mediaStreamSourceNode.disconnect(),this.mediaStreamSourceNode=void 0);const n=await Ih(),i=n.createMediaStreamSource(t),r=n.sampleRate,o=r/pr,s=1!==o;if(s&&o<1)throw new Error(`We will try to resample as we expect to record at a sample rate of ${pr} Hz, but the current sample rate is ${r} Hz. However, The original sample rate (${r} Hz) is lower than the target sample rate (${pr} Hz). Resampling to a higher rate is not supported.`);const a=await Dh(n,(({inputBuffer:t})=>{const e=t.getChannelData(0);let n=e;s&&(n=kh(e,o)),this.addToBuffer(n);const i=Th(n);Object.values(this.signalEnergyCallbacks).forEach((t=>t(i)))}));this.audioContext=n,this.scriptProcessorNode=a,this.mediaStreamSourceNode=i}addToBuffer(t){if(Object.values(this.audioFrameCallbacks).forEach((e=>e(t))),this.bufferPosition+t.length>this._buffer.length){const e=Math.max(2*this._buffer.length,this.bufferPosition+t.length),n=new Float32Array(e);n.set(this._buffer.subarray(0,this.bufferPosition)),this._buffer=n}this._buffer.set(t,this.bufferPosition),this.bufferPosition+=t.length;const e=this._buffer.subarray(0,this.bufferPosition);Object.values(this.bufferCallbacks).forEach((t=>t(e)))}clearBuffer(){this.bufferPosition=0}async start(){if(void 0===this.mediaStreamSourceNode)throw new Error("MediaStreamSourceNode is undefined. The `initialize` method must be called before calling this method.");if(xo(this.mediaStreamSourceNode.mediaStream),!this.areAudioNodesConnected){if(void 0===this.scriptProcessorNode||void 0===this.audioContext)throw new Error("ScriptProcessorNode or AudioContext is undefined. The `initialize` method must be called before calling this method.");this.scriptProcessorNode.connect(this.audioContext.destination),this.mediaStreamSourceNode.connect(this.scriptProcessorNode),this.areAudioNodesConnected=!0}}async stop(){if(this.areAudioNodesConnected){if(void 0===this.mediaStreamSourceNode||void 0===this.scriptProcessorNode)throw new Error("MediaStreamSourceNode or ScriptProcessorNode undefined. The `initialize` method must be called before calling this method.");this.mediaStreamSourceNode.disconnect(),this.scriptProcessorNode.disconnect(),this.areAudioNodesConnected=!1}}onSignalEnergy(t){const e=Ve();return this.signalEnergyCallbacks[e]=t,()=>{delete this.signalEnergyCallbacks[e]}}onAudioFrames(t){const e=Ve();return this.audioFrameCallbacks[e]=t,()=>{delete this.audioFrameCallbacks[e]}}onBuffer(t){const e=Ve();return this.bufferCallbacks[e]=t,()=>{delete this.bufferCallbacks[e]}}}function xo(t){if(!t.active)throw new Error("MediaStream is not active. Please provide an active MediaStream.")}function Th(t){const e=t.length,n=t.reduce(((t,e)=>t+e))/e,i=t.map((t=>Math.pow(t-n,2)));return Math.sqrt(i.reduce(((t,e)=>t+e))/e)}function kh(t,e){const n=Math.floor(t.length/e),i=new Float32Array(n);for(let r=0,o=0;r<n;r++,o+=e)i[r]=t[Math.floor(o)];return i}async function Mh(t){"running"===t.state&&await t.resume()}async function Ih(){try{return await Bh()}catch{throw Oh}}async function Bh(){const t={};let e;return void 0!==window.navigator.mediaDevices.getSupportedConstraints().sampleRate&&(t.sampleRate=pr),e=void 0!==window.webkitAudioContext?await Lh(t):new AudioContext(t),await Mh(e),e}async function Lh(t){let e;try{e=new window.webkitAudioContext(t)}catch{e=new window.webkitAudioContext}return await e.resume(),e}async function Dh(t,e){const n=t.createScriptProcessor(Eh,1,1);return n.onaudioprocess=e,n}class Nh extends Error{constructor(t){super(t)}}var Uh=(t=>(t.DistrictCare="DistrictCare",t.ResidentialCare="ResidentialCare",t.DemoVoiceFormCare="DemoVoiceFormCare",t.MentalHealthCare="MentalHealthCare",t))(Uh||{}),jh=Object.defineProperty,$=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&jh(e,n,o),o},vt=(t=>(t.NotStartedRecording="NotStartedRecording",t.LoadingBeforeRecording="LoadingBeforeRecording",t.Recording="Recording",t.ProcessingRecording="ProcessingRecording",t))(vt||{});const Fh={stopDelayMilliseconds:Ws,shouldProcessRecording:!0,shouldClearBuffer:!0},Vh="#1C69E8",Hh={"attendi.assistant.write-my-report":{isEnabled:!1},"attendi.reporting-methods.soep":{isEnabled:!0},"attendi.reporting-methods.soap":{isEnabled:!0},"attendi.reporting-methods.time":{isEnabled:!0}},F=Object.freeze({transcribeAPIConfig:"transcribe-api-config",baseColor:"base-color",volumeFeedbackType:"volume-feedback-type",outerVolumeFeedbackType:"outer-volume-feedback-type",noVolumeFeedback:"no-volume-feedback",showOptions:"show-options",silent:"silent",showRecordingDelayMilliseconds:"show-recording-delay-milliseconds",stayLarge:"stay-large",featureOverrides:"feature-overrides",defaultPlugins:"default-plugins",mediaTrackConstraints:"media-track-constraints"}),kr=class extends B{constructor(){super(...arguments),this._transcribeAPIConfig=void 0,this.mediaTrackConstraints=void 0,this.noVolumeFeedback=!1,this.showOptions=!1,this.stayLarge=!1,this.silent=!1,this.showRecordingDelayMilliseconds=Kd,this.shortenShowRecordingDelayByMilliseconds=0,this.volumeFeedbackType=Ba.inner,this.outerVolumeFeedbackType=La.all,this.featureOverrides={},this._defaultPlugins=["notification-audio","volume-feedback","attendi-transcribe","linear-reporting-method","error"],this.removeDispatchVolumeEventCallback=void 0,this.recorder=new $h,this._microphoneUIState="NotStartedRecording",this.errorModalContent=void 0,this.stopRecordingDelayMilliseconds=Ws,this.firstClickHappened=!1,this.checkEmptyRecording=!0,this._colorTheme=void 0,this.plugins={registeredPlugins:{},activatedPlugins:new Set,add(t,e){this.registeredPlugins[t]=e},remove:t=>{var e,n;this.plugins.hasPlugin(t)&&(this.plugins.isPluginActivated(t)&&(null==(n=(e=this.plugins.registeredPlugins[t]).deactivate)||n.call(e,this)),delete this.plugins.registeredPlugins[t],this.plugins.activatedPlugins.delete(t))},removeAll:()=>{for(const t of Object.keys(this.plugins.registeredPlugins))this.plugins.remove(t)},get:t=>this.plugins.registeredPlugins[t],activate:()=>{for(const[t,e]of Object.entries(this.plugins.registeredPlugins))this.plugins.isPluginActivated(t)||(e.activate(this),this.plugins.activatedPlugins.add(t))},deactivate:()=>{var t;for(const[e,n]of Object.entries(this.plugins.registeredPlugins))this.plugins.isPluginActivated(e)&&(null==(t=n.deactivate)||t.call(n,this),this.plugins.activatedPlugins.delete(e))},hasPlugin(t){return t in this.registeredPlugins},isPluginActivated(t){return this.hasPlugin(t)&&this.activatedPlugins.has(t)}},this.addPluginCleanups=[],this.variableWrapperClassFunctions=[],this.dynamicStyles={},this.commands={},this.menuGroups=[],this.menuItems={},this.tooltips={},this.tooltipContent=void 0,this.isTooltipOpen=!1,this.dialogs={},this.dialogContent=void 0,this.stateRenderers=new G,this.viewTransformers=new G,this.menuOptionsIcon=void 0,this.ui={renderOnState:t=>{this.stateRenderers.push(t)},transformViewOnState:t=>(this.viewTransformers.addEventListener(t),()=>{this.viewTransformers.removeEventListener(t)}),menu:{hidden:!1,hide:()=>this.ui.menu.hidden=!0,unhide:()=>this.ui.menu.hidden=!1,setIcon:t=>{this.menuOptionsIcon=t},resetIcon:()=>{this.menuOptionsIcon=void 0}}},this.microphoneCallbacks={firstClickCbs:new G,beforeStartRecordingCbs:new G,startRecordingCbs:new G,beforeStopRecordingCbs:new G,stopRecordingCbs:new G,errorCbs:new G,UIStateCbs:new G,audioFrameCbs:new G,transcribeAPIConfigCallbacks:new G,attributeChangedCbs:new G,propertiesChangedCbs:new G},this.hooks={onFirstClick:t=>(this.microphoneCallbacks.firstClickCbs.addEventListener(t),()=>this.microphoneCallbacks.firstClickCbs.removeEventListener(t)),onUIState:t=>(this.microphoneCallbacks.UIStateCbs.addEventListener(t),()=>this.microphoneCallbacks.UIStateCbs.removeEventListener(t)),onAudioFrames:t=>this.recorder.onAudioFrames(t),onBeforeStartRecording:t=>(this.microphoneCallbacks.beforeStartRecordingCbs.addEventListener(t),()=>this.microphoneCallbacks.beforeStartRecordingCbs.removeEventListener(t)),onStartRecording:t=>(this.microphoneCallbacks.startRecordingCbs.addEventListener(t),()=>this.microphoneCallbacks.startRecordingCbs.removeEventListener(t)),onBeforeStopRecording:t=>(this.microphoneCallbacks.beforeStopRecordingCbs.addEventListener(t),()=>this.microphoneCallbacks.beforeStopRecordingCbs.removeEventListener(t)),onStopRecording:t=>(this.microphoneCallbacks.stopRecordingCbs.addEventListener(t),()=>this.microphoneCallbacks.stopRecordingCbs.removeEventListener(t)),onError:t=>(this.microphoneCallbacks.errorCbs.addEventListener(t),()=>this.microphoneCallbacks.errorCbs.removeEventListener(t)),onTranscribeAPIConfig:t=>(this.microphoneCallbacks.transcribeAPIConfigCallbacks.addEventListener(t),()=>this.microphoneCallbacks.transcribeAPIConfigCallbacks.removeEventListener(t)),onAttributeChanged:t=>(this.microphoneCallbacks.attributeChangedCbs.addEventListener(t),()=>this.microphoneCallbacks.attributeChangedCbs.removeEventListener(t)),onPropertiesChanged:t=>(this.microphoneCallbacks.propertiesChangedCbs.addEventListener(t),()=>this.microphoneCallbacks.propertiesChangedCbs.removeEventListener(t))},this.animatableElements=Object.freeze({setAnimatedMicrophoneFill:t=>{var e;return null==(e=this.animatedMicrophoneFill)?void 0:e.setAttribute("offset",`${t}%`)},getAnimatedMicrophoneFill:()=>{var t;const e=null==(t=this.animatedMicrophoneFill)?void 0:t.getAttribute("offset");return Number.parseFloat((null==e?void 0:e.slice(0,-1))??"0")}})}get transcribeAPIConfig(){return this._transcribeAPIConfig}set transcribeAPIConfig(t){if(null!==t&&t!==this._transcribeAPIConfig){this._transcribeAPIConfig=t,this.reset();for(const e of this.microphoneCallbacks.transcribeAPIConfigCallbacks)e(t)}}get defaultPlugins(){return this._defaultPlugins}set defaultPlugins(t){this.updateDefaultPlugins(this.defaultPlugins,t),this._defaultPlugins=t}get audioBuffer(){var t;const e=null==(t=this.recorder)?void 0:t.buffer;if(void 0!==e)return new Float32Array(e)}clearBuffer(){var t;null==(t=this.recorder)||t.clearBuffer()}get microphoneUIState(){return this._microphoneUIState}set microphoneUIState(t){this._microphoneUIState=t;for(const e of this.microphoneCallbacks.UIStateCbs)e(t);this.dispatchEvent(new CustomEvent("microphoneuistateupdated",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("attendi-microphone-ui-state-updated",{detail:t,bubbles:!0,composed:!0}))}get animatedMicrophoneFill(){const t="#microphoneFill";return this.slottedMicrophoneIconElements.length>0?this.slottedMicrophoneIconElements[0].querySelector(t):this.renderRoot.querySelector(t)}connectedCallback(){super.connectedCallback(),this.addEventListener(la,this.handleError),this.defaultPlugins.length>0&&this.updateDefaultPlugins([],this.defaultPlugins),this.setColors()}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.tooltipCleanup)||t.call(this),this.plugins.deactivate()}updated(t){for(const e of this.microphoneCallbacks.propertiesChangedCbs)e(t)}attributeChangedCallback(t,e,n){if(super.attributeChangedCallback(t,e,n),t===F.transcribeAPIConfig&&(this.transcribeAPIConfig=JSON.parse(n)),t===F.defaultPlugins){const t=null===e?[]:JSON.parse(e),i=null===n?[]:JSON.parse(n);this.updateDefaultPlugins(t,i)}for(const i of this.microphoneCallbacks.attributeChangedCbs)i(t,e,n)}render(){const t={"show-options":this.showOptions,"stay-large":this.stayLarge};for(const{className:e,predicate:n}of this.variableWrapperClassFunctions)n()&&(t[e]=!0);const e=it(t),n=it({"not-started-recording":"NotStartedRecording"===this.microphoneUIState,"loading-before-recording":"LoadingBeforeRecording"===this.microphoneUIState,recording:"Recording"===this.microphoneUIState,"processing-recording":"ProcessingRecording"===this.microphoneUIState}),i=it({open:this.isTooltipOpen});return v`
      <!-- Allow styles to be inserted at runtime. Sometimes the CSS rules will have
          to add '!important' as they have lower priority than the CSS defined in this
          class itself.  -->
      ${Object.values(this.dynamicStyles).map((t=>v`<style>
            ${t}
          </style>`))}

      <!-- The variable wrapper div only exists to set some CSS variables depending on the
           values of the microphone component variables. It's set to 'display: contents;', so it
           doesn't influence any of the styling itself. -->
      <div class="variable-wrapper ${e}">
        <div
          class="view-wrapper ${n}"
          data-test="attendi-microphone__view-wrapper"
        >
          ${this.getTransformedView()}
        </div>
      </div>

      <div class="dialog-container">${this.dialogContent}</div>

      <!-- TODO: can use the existing dialog (?) -->
      ${this.getErrorModal()}

      <div class="tooltip ${i}" role="tooltip">
        ${this.tooltipContent}
        <div class="tooltip__arrow"></div>
      </div>
    `}getTransformedView(){let t=this.getView();for(const e of this.viewTransformers)t=e(t,this.microphoneUIState);return t}getView(){for(const t of this.stateRenderers){const e=t(this.microphoneUIState);if(void 0!==e)return e}switch(this.microphoneUIState){case"NotStartedRecording":return this.getNotStartedRecordingView();case"LoadingBeforeRecording":return this.getLoadingBeforeRecordingView();case"Recording":return this.getRecordingView();case"ProcessingRecording":return this.getProcessingRecordingView();default:return null}}getNotStartedRecordingView(){return this.showOptions?v`<attendi-split-button
        class="not-started-recording-button inner-button-height w-100"
        @main-button-clicked=${this.handleClicked}
      >
        <div slot="main-action" class="recording-inner-button">
          <div class="split-button-microphone-icon">
            <slot name="microphone-icon">${ao}</slot>
          </div>
        </div>

        ${void 0!==this.menuOptionsIcon?v`<div slot="options-action">${this.menuOptionsIcon}</div>`:null}
        ${this.menuOptions}
      </attendi-split-button>`:v`
        <attendi-button
          class="not-started-recording-button inner-button-height w-100"
          @click=${this.handleClicked}
        >
          <div class="button-microphone-icon">
            <slot name="microphone-icon">${ao}</slot>
          </div>
        </attendi-button>
      `}getLoadingBeforeRecordingView(){return this.showOptions?v`
        <attendi-split-button
          class="loading-before-recording-button inner-button-height w-100"
          @main-button-clicked=${this.handleClicked}
        >
          <div slot="main-action" class="recording-inner-button">
            <div class="loading-before-recording-icon show-options">
              ${co}
            </div>
          </div>

          ${this.renderMenuOptionsIcon()} ${this.menuOptions}
        </attendi-split-button>
      `:v`
        <attendi-button
          class="loading-before-recording-button inner-button-height w-100"
          @click=${this.handleClicked}
        >
          <div class="loading-before-recording-icon">${co}</div>
        </attendi-button>
      `}getRecordingView(){return v`
      <div class="position-relative inner-button-height w-100">
        <attendi-button
          class="recording-button inner-button-height no-border"
          @click=${this.handleClicked}
        >
          <div class="recording-inner-button">
            <div class="split-button-microphone-icon">
              <slot name="microphone-icon"
                >${cl}</slot
              >
            </div>
          </div>
        </attendi-button>
      </div>
    `}getProcessingRecordingView(){return v`
      <attendi-button
        class="processing-recording inner-button-height w-100 no-border "
      >
        ${this.processingAnimation}
      </attendi-button>
    `}get processingAnimation(){return v`
      <div style="display: flex; justify-content: center; height: 100%;">
        <div class="loading-wrapper">
          <div class="loader l1"></div>
          <div class="loader l2"></div>
          <div class="loader l3"></div>
          <div class="loader l4"></div>
          <div class="loader l5"></div>
        </div>
      </div>
    `}get menuOptions(){return this.ui.menu.hidden?null:v`<attendi-action-menu slot="options" class="options-menu">
      ${this.menuGroups.map(((t,e)=>this.renderMenuGroup(e,t)))}
    </attendi-action-menu>`}renderMenuGroup(t,e){const n=0===t?"bottom":"top";return v`
      ${this.renderMenuGroupHeader(n,e)}
      ${this.renderMenuRows(e)}
    `}renderMenuGroupHeader(t,e){return v`
      <attendi-action-menu-header divider=${t}>
        ${void 0!==e.icon?v`<div slot="icon" class="attendi-action-menu-header-icon">
              ${e.icon}
            </div>`:null}
        ${e.title}
      </attendi-action-menu-header>
    `}renderMenuRows(t){return v`
      <attendi-action-menu-rows>
        ${this.menuItems[t.id].map((t=>this.renderMenuItem(t)))}
      </attendi-action-menu-rows>
    `}renderMenuItem(t){return v`
      <attendi-action-menu-row
        @click=${()=>this.executeCommand(t.command)}
        subtitle=${ci(t.subtitle)}
      >
        ${void 0!==t.icon?v`<div slot="icon">${t.icon}</div>`:null}
        ${t.title}
      </attendi-action-menu-row>
    `}handleClicked(){try{this._handleClicked()}catch(t){this.catchRecordingOrTranscribeErrorAndDispatchErrorEvent(t)}}async _handleClicked(){if(!this.firstClickHappened){for(const t of this.microphoneCallbacks.firstClickCbs)await t();this.firstClickHappened=!0}"NotStartedRecording"===this.microphoneUIState?await this.start():"Recording"===this.microphoneUIState&&await this.stop({stopDelayMilliseconds:this.stopRecordingDelayMilliseconds})}async start(){this.microphoneUIState="LoadingBeforeRecording";const t=(new Date).getTime();void 0!==this.mediaStream&&So(this.mediaStream);try{this.mediaStream=await Co(this.mediaTrackConstraints);const e=(new Date).getTime()-t;this.shortenShowRecordingDelayByMilliseconds+=e;for(const t of this.microphoneCallbacks.beforeStartRecordingCbs)await t();await this.startRecording()}catch(t){this.reset(),t instanceof Na?this.dispatchMicrophonePermissionErrorEvent():this.dispatchGeneralStartRecordingErrorEvent()}}async startRecording(){var t;const e=(new Date).getTime();(void 0===this.mediaStream||!1===this.mediaStream.active)&&(this.mediaStream=await Co(this.mediaTrackConstraints)),null==(t=this.removeDispatchVolumeEventCallback)||t.call(this),this.removeDispatchVolumeEventCallback=this.recorder.onSignalEnergy((t=>{this.dispatchEvent(new CustomEvent("attendi-microphone-volume-updated",{detail:{volumeRaw:t,volume:zh(t)}}))})),await this.recorder.initialize(this.mediaStream),await this.recorder.start(),this.shortenShowRecordingDelayByMilliseconds+=(new Date).getTime()-e;for(const t of this.microphoneCallbacks.startRecordingCbs)await t();this.setUIToRecordingAfterDelay(this.shortenShowRecordingDelayByMilliseconds),this.shortenShowRecordingDelayByMilliseconds=0}setUIToRecordingAfterDelay(t){const e=Math.max(this.showRecordingDelayMilliseconds-t,0);this.setUIStartedRecordingTimeout=setTimeout((()=>{this.microphoneUIState="Recording"}),e)}async stop(t){const e={...Fh,...t};try{if(void 0===this.recorder)throw new Nh("Recorder is undefined");for(const t of this.microphoneCallbacks.beforeStopRecordingCbs)await t(this.recorder.buffer,e);e.shouldProcessRecording&&(this.microphoneUIState="ProcessingRecording"),await this.stopRecording(e.stopDelayMilliseconds);for(const t of this.microphoneCallbacks.stopRecordingCbs)await t(this.recorder.buffer,e);void 0!==this.audioBuffer&&0===this.audioBuffer.length&&this.checkEmptyRecording&&this.dispatchEmptyRecordingErrorEvent(),e.shouldClearBuffer&&this.clearBuffer(),this.microphoneUIState="NotStartedRecording"}catch(t){console.error(t),this.reset(),t instanceof Ol?this.dispatchMicrophonePermissionErrorEvent():this.dispatchGeneralStartRecordingErrorEvent()}}async stopRecording(t=0){var e;await ha(t),null==(e=this.recorder)||e.stop(),void 0!==this.mediaStream&&So(this.mediaStream),this.mediaStream=void 0}dispatchMicrophonePermissionErrorEvent(){this.dispatchEvent(Cn({title:k.noMicrophonePermissionErrorDialogTitle,content:k.noMicrophonePermissionErrorDialogContent}))}dispatchGeneralStartRecordingErrorEvent(){this.dispatchEvent(Cn({title:k.genericStartRecordingErrorDialogTitle,content:k.genericStartRecordingErrorDialogContent}))}getErrorModal(){if(void 0!==this.errorModalContent)return v`<attendi-dialog
        class="error-dialog"
        data-test="attendi-microphone-error-dialog"
      >
        ${this.errorModalContent}
      </attendi-dialog>`}dispatchEmptyRecordingErrorEvent(){this.dispatchEvent(Cn({title:k.emptyRecordingErrorDialogTitle,content:k.emptyRecordingErrorDialogContent}))}dispatchGeneralTranscribeErrorEvent(){this.dispatchEvent(Cn({title:k.genericErrorDialogTitle,content:k.genericErrorDialogContent}))}dispatchSegmentTranscribedEvent(t,e){const n=Vl(t,e);this.dispatchEvent(n)}catchRecordingOrTranscribeErrorAndDispatchErrorEvent(t){const e=zd(t);this.dispatchEvent(e),this.reset()}reset(){this.stopRecording(),this.clearBuffer(),void 0!==this.setUIStartedRecordingTimeout&&(clearTimeout(this.setUIStartedRecordingTimeout),this.setUIStartedRecordingTimeout=void 0),this.microphoneUIState="NotStartedRecording",this.shortenShowRecordingDelayByMilliseconds=0}async handleError(t){for(const e of this.microphoneCallbacks.errorCbs)await e(t)}async showErrorDialog(t){var e;if(void 0===t.detail)return;const n=t.detail;this.errorModalContent=this.getTitledInnerModalContent(n.title,n.content),await this.updateComplete,null==(e=this.errorDialog)||e.showModal()}getTitledInnerModalContent(t,e){const n={icon:fr,header:t??"",content:e??"",buttons:v`
        <div
          class="titled-inner-modal-content__buttons__confirm"
          @click=${()=>this.closeErrorModal()}
          data-test="root-inner-modal__close"
        >
          ${k.ok}
        </div>
      `};return v` <div class="titled-inner-modal-content-wrapper">
      <attendi-titled-inner-modal
        .data=${n}
      ></attendi-titled-inner-modal>
    </div>`}closeErrorModal(){this.errorDialog.close(),this.errorModalContent=void 0}setColors(t){const e=void 0!==this.baseColor||void 0!==t?Yl:Zl,n=t??this.baseColor??Vh;this.colorTheme=e(n)}get colorTheme(){return this._colorTheme}set colorTheme(t){var e;this._colorTheme=t;const n=null==(e=this.shadowRoot)?void 0:e.host;void 0===n||void 0===t||Xl(n,t)}updateDefaultPlugins(t,e){const n=t.filter((t=>!e.includes(t)));let i=e.filter((e=>!t.includes(e)));this.silent&&(i=i.filter((t=>"notification-audio"!==t))),this.noVolumeFeedback&&(i=i.filter((t=>"volume-feedback"!==t)));for(const t of n)this.plugins.remove(t);for(const t of this.addPluginCleanups)t();this.addPluginCleanups=[];for(const t of i)this.addDefaultPlugin(t);i.length>0&&this.plugins.activate()}addDefaultPlugin(t){switch(t){case"notification-audio":this.plugins.add(t,new zi),this.addPluginCleanups.push(this.hooks.onAttributeChanged(((e,n,i)=>{this.defaultPlugins.includes(t)&&e===F.silent&&(null===n&&null!==i?this.plugins.remove(t):null!==n&&null===i&&(this.plugins.remove(t),this.plugins.add(t,new zi)))})));break;case"volume-feedback":this.plugins.add(t,new Da);break;case"attendi-transcribe":void 0!==this.transcribeAPIConfig&&this.addDefaultAttendiTranscribePlugin(this.transcribeAPIConfig),this.addPluginCleanups.push(this.hooks.onTranscribeAPIConfig((e=>{void 0!==e?(this.addDefaultAttendiTranscribePlugin(e),this.plugins.activate()):this.plugins.remove(t)})));break;case"linear-reporting-method":this.addPluginCleanups.push(this.hooks.onTranscribeAPIConfig((e=>{if(this.plugins.remove(t),void 0===e)return;const n={apiURL:e.apiURL,customerKey:e.customerKey,userId:e.userId,config:{model:e.modelType},unitId:e.unitId};this.plugins.add(t,new Aa(n)),this.plugins.activate()})));break;case"error":this.plugins.add(t,new Wi({silent:this.silent})),this.addPluginCleanups.push(this.hooks.onAttributeChanged(((e,n,i)=>{if(this.defaultPlugins.includes(t)&&"silent"===e){const e=null!==i;this.plugins.remove(t),this.plugins.add(t,new Wi({silent:e}))}})));break;default:throw new Error(`Plugin ${t} not found.`)}}addDefaultAttendiTranscribePlugin(t){if(!this.defaultPlugins.includes("attendi-transcribe")||(this.plugins.remove("attendi-transcribe"),void 0===t))return;const e={apiURL:t.apiURL,customerKey:t.customerKey,userId:t.userId,config:{model:t.modelType},unitId:t.unitId};this.plugins.add("attendi-transcribe",new pi(e,(t=>{this.dispatchEvent(new CustomEvent("attendi-microphone-transcript",{detail:{transcript:t}})),this.dispatchEvent(new CustomEvent("recordersegmenttranscribed",{detail:{transcript:t,text:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("attendi-speech-segment",{detail:{transcript:t,text:t}})),this.dispatchEvent(new CustomEvent("attendi-speech-service-done",{detail:{transcript:t,text:t}}))})))}addVariableWrapperClass(t,e){return this.variableWrapperClassFunctions.push({className:t,predicate:e}),()=>{this.variableWrapperClassFunctions=this.variableWrapperClassFunctions.filter((e=>e.className!==t))}}addDynamicStyle(t,e){return this.dynamicStyles[t]=e,()=>{delete this.dynamicStyles[t]}}addCommand(t,e){return this.commands[t]=e,()=>{delete this.commands[t]}}executeCommand(t,...e){const n=this.commands[t];void 0!==n?n(...e):console.warn(`Command ${t} not found`)}async executeAsyncCommand(t,...e){const n=this.commands[t];void 0!==n?await n(...e):console.warn(`Command ${t} not found`)}addMenuGroup({id:t,title:e,icon:n,priority:i=1}){return this.menuGroups=[...this.menuGroups,{id:t,title:e,priority:i,icon:n}],this.menuGroups.sort(((t,e)=>t.priority-e.priority)),()=>{this.menuGroups=this.menuGroups.filter((e=>e.id!==t))}}addMenuItem({groupId:t,title:e,subtitle:n,icon:i,command:r}){return this.menuItems[t]=[...this.menuItems[t]??[],{title:e,command:r,icon:i,subtitle:n}],()=>{this.menuItems[t]=this.menuItems[t].filter((t=>t.title!==e))}}async showTooltipWithContent(t){this.tooltipContent=t,await this.updateComplete,this.showTooltip()}showTooltip(){void 0===this.tooltipContent&&console.warn("Tooltip content is undefined"),this.updateTooltipPosition(),this.isTooltipOpen=!0,void 0!==this.splitButtonMainAction&&(this.tooltipCleanup=Tu(this.splitButtonMainAction,this.tooltip,this.updateTooltipPosition.bind(this)))}closeTooltip(){this.isTooltipOpen=!1}updateTooltipPosition(){void 0!==this.splitButtonMainAction&&Nu(this.splitButtonMainAction,this.tooltip,this.tooltipArrow,{offsetOptions:16,placement:"top-start"})}addDialog({id:t,dialog:e}){return this.dialogs[t]=e,()=>{delete this.dialogs[t]}}async showDialog(t){const e=this.dialogs[t];this.dialogContent=e,await this.updateComplete,Ui(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),void 0!==this.dialogChild&&this.dialogChild.showModal()}closeDialog(){this.dialogContent=void 0,Ni()}renderMenuOptionsIcon(){return void 0!==this.menuOptionsIcon?v`<div slot="options-action">${this.menuOptionsIcon}</div>`:null}get attributeNames(){return F}get featureSettings(){const t=this.featureOverrides;return{...Hh,...t}}};kr.styles=[Jl,[Ql,E`
        :host {
          display: block;

          --attendi-microphone-padding: var(
              --attendi-microphone-padding-top,
              ${8}px
            )
            var(
              --attendi-microphone-padding-right,
              ${8}px
            )
            var(
              --attendi-microphone-padding-bottom,
              ${8}px
            )
            var(--attendi-microphone-padding-left, ${8}px);

          --attendi-microphone-border-radius: var(
            --attendi-border-radius,
            30px
          );

          /* Style the attendi-button border radii

          To set the border radii for individual corners, use the following variables:
          --attendi-microphone-border-top-left-radius
          --attendi-microphone-border-top-right-radius
          --attendi-microphone-border-bottom-left-radius
          --attendi-microphone-border-bottom-right-radius

          This will set the border radii for the attendi-button
          and attendi-split-button components.
          */
          /* attendi-button */
          --attendi-button-border-top-left-radius: var(
            --attendi-microphone-border-top-left-radius
          );
          --attendi-button-border-top-right-radius: var(
            --attendi-microphone-border-top-right-radius
          );
          --attendi-button-border-bottom-left-radius: var(
            --attendi-microphone-border-bottom-left-radius
          );
          --attendi-button-border-bottom-right-radius: var(
            --attendi-microphone-border-bottom-right-radius
          );

          /* attendi-split-button */
          --attendi-split-button-border-top-left-radius: var(
            --attendi-microphone-border-top-left-radius
          );
          --attendi-split-button-border-top-right-radius: var(
            --attendi-microphone-border-top-right-radius
          );
          --attendi-split-button-border-bottom-left-radius: var(
            --attendi-microphone-border-bottom-left-radius
          );
          --attendi-split-button-border-bottom-right-radius: var(
            --attendi-microphone-border-bottom-right-radius
          );

          /*
        The width of the component depends on a couple of factors:
        - The state of the microphone (recording, processing, etc.)
        - Whether or not the component has options
        resulting in two different widths.

        The below defined variables define the ratios between the different
        widths (small / large).

        **States and widths:**

        State | show-options | Width | Max width (with current show-options settings)
        ------------ | ------------ | ------------ | ------------
        NotStarted + Loading | 0 | s | s
        Recording + Processing | 0 | s | s
        NotStarted + Loading | 1 | l | l
        Recording + Processing | 1 | s | l
        */
          --attendi-microphone-large-max-width: 96;
          --attendi-microphone-small-max-width: 40;

          --attendi-microphone-small-to-large-width-ratio: calc(
            var(--attendi-microphone-small-max-width) /
              var(--attendi-microphone-large-max-width)
          );
        }

        /* The variable-wrapper is a utility class used to set CSS variables
        based on the component's attributes and state. It is for example used to set
        the width of the component and the padding. This is necessary, as the classes
        can change at runtime. (Or at least, I haven't yet found a better way to do it.)
        */
        .variable-wrapper {
          display: contents;

          /* No options, so max. width is 'small', aka square / circle */
          --max-width: var(
            --attendi-microphone-max-width,
            calc(var(--attendi-microphone-small-max-width) * 1px)
          );
          --not-started-or-loading-before-recording-width: var(--max-width);
          --recording-or-processing-width: var(--max-width);
          --attendi-button-border-width: var(
            --attendi-microphone-border-width,
            0px
          );

          --attendi-microphone-padding-top: 0px;
          --attendi-microphone-padding-right: 0px;
          --attendi-microphone-padding-bottom: 0px;
          --attendi-microphone-padding-left: 0px;
        }

        /* Only options present, so max. width is 'large' */
        .variable-wrapper.show-options {
          --max-width: var(
            --attendi-microphone-max-width,
            calc(var(--attendi-microphone-large-max-width) * 1px)
          );
          --not-started-or-loading-before-recording-width: var(--max-width);
          --recording-or-processing-width: calc(
            var(--max-width) *
              var(--attendi-microphone-small-to-large-width-ratio)
          );
        }

        /* Only options present, so max. width is 'large' */
        .variable-wrapper.show-options.stay-large {
          --recording-or-processing-width: var(--max-width);
        }

        /* Sizes of the icons need to be adjusted depending on the size of
        their parent. E.g. if the parent button is wider, the width percentage
        needs to be lower. */
        .variable-wrapper.stay-large .recording-button .stop-wrapper svg {
          width: 18%;
        }
        .variable-wrapper.stay-large
          .recording-button
          .split-button-microphone-icon
          svg,
        .variable-wrapper.stay-large
          .recording-button
          .split-button-microphone-icon
          ::slotted([slot="microphone-icon"]) {
          width: 30%;
        }

        .variable-wrapper {
          --attendi-microphone-padding: var(--attendi-microphone-padding-top)
            var(--attendi-microphone-padding-right)
            var(--attendi-microphone-padding-bottom)
            var(--attendi-microphone-padding-left);
        }

        .not-started-recording,
        .loading-before-recording {
          width: var(--not-started-or-loading-before-recording-width);
        }

        .recording,
        .processing-recording {
          width: var(--recording-or-processing-width);
        }

        .inner-button-height {
          height: var(--attendi-microphone-height, 40px);
        }

        .not-started-recording-button,
        .loading-before-recording-button {
          --attendi-color-background: var(--color-fill-enabled);
          --attendi-color-border: var(--color-outline-enabled);
          /* TODO: separate into --attendi-split-button-color and
          --attendi-button-color */
          --attendi-color-icon: var(--color-icon-enabled);
          --attendi-color-icon-hover: var(--color-icon-hover);
          --attendi-button-color: var(--color-icon-enabled);
          --attendi-button-color-hover: var(--color-icon-hover);

          --attendi-color-background-hover: var(--color-fill-hover);
          --attendi-color-background-active: var(--color-fill-active);
        }

        .no-border {
          --border: none;
        }

        .recording-button {
          position: absolute;
          --attendi-color-background: var(--color-fill-active-enabled);
          --attendi-color-background-hover: var(--color-fill-active-hover);
          --attendi-color-background-active: var(--color-fill-active-active);
          --attendi-color-background-disabled: var(
            --color-fill-active-disabled
          );
        }

        .recording-button svg,
        .recording-button ::slotted([slot="microphone-icon"]) {
          color: var(--color-icon-active-enabled, white);
        }

        .recording-button [slot="options-action"] svg,
        .processing-recording [slot="options-action"] svg {
          color: var(--color-icon-enabled, white);
        }

        attendi-split-button.recording-button,
        attendi-split-button.processing-recording {
          --attendi-split-button-option-action-color-background: white;
        }

        .loading-before-recording-button {
          --attendi-color-background: #ffffff;
        }

        .loading-before-recording-button svg,
        .loading-before-recording-button ::slotted([slot="microphone-icon"]) {
          color: var(--color-icon-enabled);
        }

        .processing-recording {
          --attendi-color-background: var(--color-fill-active-enabled);
          --attendi-color-background-hover: var(--color-fill-active-enabled);
          --attendi-color-background-active: var(--color-fill-active-enabled);
          --attendi-color-background-disabled: var(
            --color-fill-active-disabled
          );
          cursor: default;
        }

        .recording-inner-button {
          margin: auto;
          display: flex;
          place-items: center;
          justify-content: center;
        }

        .stop-wrapper {
          display: flex;
          padding: 0px;
          justify-content: center;
        }

        .stop-wrapper svg {
          width: 36%;
        }

        .loading-wrapper {
          display: flex;
          gap: 4.5%;
          width: 100%;
          height: 100%;
          justify-content: center;
          transform: scaleY(0.5);
        }

        .view-wrapper {
          display: flex;
          padding: var(
            --attendi-microphone-padding
          ); /* to account for volume feedback around button, which needs its own space */
        }

        .mic-icon {
          display: flex;
          justify-content: center;
          align-items: center;
        }

        .titled-inner-modal-content-wrapper {
          width: 300px;
        }

        .error-dialog {
          --attendi-dialog-width: fit-content;
        }

        .loading-before-recording-icon {
          display: flex;
          justify-content: center;
          align-items: center;
        }

        .loading-before-recording-icon svg {
          width: 35%;
          color: var(--color-icon-enabled);
          animation: processing-rotation 2s infinite linear;
        }

        .loading-before-recording-icon.show-options svg {
          width: 23%;
          color: var(--color-icon-enabled);
          animation: processing-rotation 2s infinite linear;
        }

        @keyframes processing-rotation {
          from {
            transform: rotate(0deg);
            animation-timing-function: cubic-bezier(0.715, 0.15, 0.175, 0.84);
          }
          to {
            transform: rotate(359deg);
          }
        }

        .split-button-microphone-icon {
          display: contents;
        }

        .not-started-recording-button .split-button-microphone-icon svg,
        .not-started-recording-button
          .split-button-microphone-icon
          ::slotted([slot="microphone-icon"]) {
          width: calc(26.67 / 56 * 100%);
        }

        .recording-button .split-button-microphone-icon svg,
        .recording-button
          .split-button-microphone-icon
          ::slotted([slot="microphone-icon"]) {
          width: calc(32 / 56 * 100%);
        }

        .button-microphone-icon {
          display: flex;
          justify-content: center;
          align-items: center;
          height: 100%;
        }

        .button-microphone-icon svg,
        .button-microphone-icon ::slotted([slot="microphone-icon"]) {
          width: calc(21.33 / 32 * 100%);
          height: 100%;
        }

        attendi-action-menu-header [slot="icon"] > svg {
          width: 100%;
          height: 100%;
        }

        @media (min-width: ${nt.medium}px) {
          attendi-action-menu-row {
            width: 300px;
          }
        }

        .tooltip {
          /* General tooltip positioning, always applicable with floating-ui tooltips */
          display: none;
          width: max-content;
          position: absolute;
          top: 0;
          left: 0;

          /* Appearance */
          background: white;
          color: black;
          border-radius: 8px;
          font-size: 90%;
          padding: 4px 8px;
          box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 4px 1px;

          /* Layout inside tooltip */
          flex-direction: column;
          align-items: center;
          gap: 16px;
        }

        .tooltip.open {
          display: flex;
        }

        .tooltip__arrow {
          position: absolute;
          background: white;
          width: 8px;
          height: 8px;
          transform: rotate(45deg);
        }

        .dialog-container {
          display: contents;
        }

        .position-relative {
          position: relative;
        }
      `]];let O=kr;$([A({attribute:F.transcribeAPIConfig,type:Object,reflect:!1})],O.prototype,"_transcribeAPIConfig"),$([A({attribute:F.mediaTrackConstraints,type:Object,reflect:!1})],O.prototype,"mediaTrackConstraints"),$([A({attribute:F.noVolumeFeedback,type:Boolean})],O.prototype,"noVolumeFeedback"),$([A({attribute:F.showOptions,type:Boolean})],O.prototype,"showOptions"),$([A({attribute:F.stayLarge,type:Boolean})],O.prototype,"stayLarge"),$([A({attribute:F.silent,type:Boolean,reflect:!0})],O.prototype,"silent"),$([A({attribute:F.showRecordingDelayMilliseconds,type:Number,reflect:!1})],O.prototype,"showRecordingDelayMilliseconds"),$([A({attribute:F.baseColor,type:String})],O.prototype,"baseColor"),$([A({attribute:F.volumeFeedbackType,type:String})],O.prototype,"volumeFeedbackType"),$([A({attribute:F.outerVolumeFeedbackType,type:String})],O.prototype,"outerVolumeFeedbackType"),$([A({attribute:F.featureOverrides,type:Object})],O.prototype,"featureOverrides"),$([A({type:Array,attribute:F.defaultPlugins})],O.prototype,"_defaultPlugins"),$([L()],O.prototype,"_microphoneUIState"),$([L()],O.prototype,"errorModalContent"),$([M(".error-dialog")],O.prototype,"errorDialog"),$([M(".recording-button")],O.prototype,"recordingButton"),$([M(":host")],O.prototype,"host"),$([M(".options-menu")],O.prototype,"optionsMenu"),$([rc({slot:"microphone-icon"})],O.prototype,"slottedMicrophoneIconElements"),$([L()],O.prototype,"dynamicStyles"),$([L()],O.prototype,"menuGroups"),$([L()],O.prototype,"menuItems"),$([L()],O.prototype,"tooltips"),$([L()],O.prototype,"tooltipContent"),$([L()],O.prototype,"isTooltipOpen"),$([M(".tooltip")],O.prototype,"tooltip"),$([M(".tooltip__arrow")],O.prototype,"tooltipArrow"),$([M("[slot='main-action']")],O.prototype,"splitButtonMainAction"),$([L()],O.prototype,"dialogs"),$([L()],O.prototype,"dialogContent"),$([M(".dialog-container")],O.prototype,"dialogContainer"),$([M(".dialog-container > *")],O.prototype,"dialogChild");class G extends Array{addEventListener(t){this.push(t)}removeEventListener(t){const e=this.findIndex((e=>e===t));e>=0&&this.splice(e,1)}}function zh(t){const e=Wh(10*t,-.44,15);return Math.pow(e,.5)}function Wh(t,e=.12,n=3){const i=t-e,r=1/(1+(i/(1-i))**-n);return Math.min(Math.max(r,0),1)}var Gh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Rr=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?qh(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&Gh(e,n,o),o};let rn=class extends B{constructor(){super(...arguments),this._value="",this.mostRecentCursorPosition=0}get value(){return this._value}set value(t){this._value=t,this.resetCursorPositionIfItExceedsTextLength(),this.dispatchValueChangedEvents(t)}resetCursorPositionIfItExceedsTextLength(){this.value.length<(this.cursorPosition??0)&&(this.cursorPosition=this.value.length)}get cursorPosition(){return this.selectionStart()}set cursorPosition(t){void 0!==t&&void 0!==this.editor&&(this.editor.selectionEnd=t,this.editor.selectionStart=t,this.mostRecentCursorPosition=t)}render(){return v`
      <textarea
        class="editor typography"
        rows="2"
        spellcheck="false"
        @input=${t=>{const e=t.target.value;this.value=e,this.updateMostRecentCursorPosition()}}
        @change=${t=>{const e=t.target.value;this.value=e,this.updateMostRecentCursorPosition()}}
        .value=${this.value}
      >
      </textarea>
    `}dispatchValueChangedEvents(t){const e=Kh(t),n=Zh(t);try{this.dispatchEvent(e),this.dispatchEvent(n)}catch{}}firstUpdated(){this.updateMostRecentCursorPositionWhenBlurred(),this.restoreToMostRecentCursorPositionWhenFocused()}updateMostRecentCursorPositionWhenBlurred(){var t;null==(t=this.editor)||t.addEventListener("blur",(()=>{this.updateMostRecentCursorPosition()}))}restoreToMostRecentCursorPositionWhenFocused(){var t;null==(t=this.editor)||t.addEventListener("focus",(()=>{this.cursorPosition=this.mostRecentCursorPosition}))}async addText(t){if(K(t))return;this.updateCursorPositionIfItWasReset();const e=this.getUpdatedTextAndCursorPositionAfterAddingTextAtCursor(t);void 0!==e&&this.updateTextAndCursorValue(e)}updateCursorPositionIfItWasReset(){this.cursorPositionWasReset()&&(this.cursorPosition=this.mostRecentCursorPosition)}cursorPositionWasReset(){return 0===this.cursorPosition&&0!==this.mostRecentCursorPosition}async updateTextAndCursorValue(t){const{updatedTextValue:e,cursorPositionAfterAddedText:n}=t;this.value=e,this.dispatchValueChangedEvents(this.value),await this.updateComplete,this.cursorPosition=n,this.scrollToEndIfAddedTextAtEnd(n)}scrollToEndIfAddedTextAtEnd(t){void 0!==this.editor&&t===this.value.length&&this.scrollToEnd()}scrollToEnd(){var t;void 0!==this.editor&&(this.editor.scrollTop=null==(t=this.editor)?void 0:t.scrollHeight)}getUpdatedTextAndCursorPositionAfterAddingTextAtCursor(t){if(K(t))return;const e=this.cursorPosition;if(void 0===e)return;const{firstPartOfString:n,paddingBeforeAddedText:i,paddingAfterAddedText:r,lastPartOfString:o}=Yh(this.value,e),s=function(t,i){let r=t;return function(){const t=!K(n)&&!Eo(n);return s()&&t}()&&(r=pp(t)),function(){const t=!Ao(n)&&Oo(o),e=Eo(n)&&mp(o),i=t||e;return s()&&!i}()&&(r=fp(r)),r;function s(){const t=hp(n);return function(){const t=yp(n.split("\n"),""),e=_p(o.split("\n"),""),i=Po(t)||K(t),r=Po(e)||K(e);return!(i||r)}()||!(Ao(n)&&Oo(o)||0===e||e===i)&&!t}}(t,this.value.length);return{updatedTextValue:n+i+s+r+o,cursorPositionAfterAddedText:(n+i+s).length}}selectionStart(){var t;return null==(t=this.editor)?void 0:t.selectionStart}selectionEnd(){var t;return null==(t=this.editor)?void 0:t.selectionEnd}updateMostRecentCursorPosition(){this.mostRecentCursorPosition=this.cursorPosition??0}};function Kh(t){return new CustomEvent("attendieditorvaluechanged",{detail:t,bubbles:!0,composed:!0})}function Zh(t){return new CustomEvent("change",{detail:t,bubbles:!1,composed:!0})}function Yh(t,e){const{firstPartOfString:n,lastPartOfString:i}=ip(t,e);return{firstPartOfString:n,paddingBeforeAddedText:Xh(n,i),paddingAfterAddedText:ep(n,i),lastPartOfString:i}}function Xh(t,e){if(K(t))return"";let n="";return K(e)?n=Jh(t):lp(t)&&(n=" "),n}function Jh(t){const e=Ua(rp(t));return"\n".repeat(e)}rn.styles=[de,E`
      .editor {
        height: 100%;
        width: 100%;
        padding: min(1%, 1rem) 2%;
        box-sizing: border-box;
        border-radius: 4px;
        font-size: clamp(0.9rem, 4.4vw, 1.1rem);
        letter-spacing: 0.015rem;
        line-height: clamp(1.3rem, 7vw, 1.75rem);
        resize: none;
        border-color: #8d8787;
        overflow-y: auto;
      }
    `],Rr([A()],rn.prototype,"_value",2),Rr([M(".editor")],rn.prototype,"editor",2),rn=Rr([Ct("attendi-speech-service-editor")],rn);const Qh=0,tp=2;function Ua(t){return Math.max(Qh,tp-t)}function ep(t,e){if(K(e))return"";let n="";return K(t)?n=np(e):cp(e)&&(n=" "),n}function np(t){const e=Ua(op(t));return"\n".repeat(e)}function ip(t,e){return{firstPartOfString:t.substring(0,e),lastPartOfString:t.substring(e,t.length)}}function rp(t){let e=0;for(let n=t.length-1;n>=0&&"\n"===t.charAt(n);n--)e+=1;return e}function op(t){let e=0;for(let n=0;n<t.length&&"\n"===t.charAt(n);n++)e+=1;return e}function Ao(t){return!K(t)&&"\n"==t.charAt(t.length-1)}function Oo(t){return!K(t)&&"\n"==t.charAt(0)}const sp=/^\s+.*/,ap=/^\.+.*/;function cp(t){return!sp.test(t)&&!ap.test(t)}const dp=/.*\s+$/;function lp(t){return!dp.test(t)}const up=/\.+([^\S\r\n]+)?/;function hp(t){return up.test(t)}function pp(t){return K(t)?t:t[0].toLowerCase()+t.slice(1)}function fp(t){return K(t)?t:t.replace(/\.$/,"")}function K(t){return""===t}const gp=/\.(\s+)?$/;function Eo(t){return gp.test(t)}const vp=/^(\s+)?[A-Z]/;function mp(t){return vp.test(t)}const bp=/^\s+$/;function Po(t){return bp.test(t)}function yp(t,e){return 0===t.length?e:t[t.length-1]}function _p(t,e){return 0===t.length?e:t[0]}const wp=E`
  .recorder-view-container {
    display: grid;
    justify-content: center;
    grid-template-columns:
      clamp(42px, min(20%, 12vh), 60px) clamp(
        calc(33 / 18 * 42px),
        min(35%, 33/18 * 12vh),
        calc(33 / 18 * 60px)
      )
      clamp(42px, min(20%, 12vh), 60px);
    gap: 7%;
    justify-items: center;
    align-items: center;
    height: 100%;
  }

  .redo-button svg {
    width: 50%;
  }

  .done-button svg {
    width: 100%;
  }

  .recorder-button-text {
    margin: 0;
    padding: 0;
    font-weight: bold;
    letter-spacing: 0.025rem;
  }

  .recording-text {
    display: none;
  }

  .recording-text.processing {
    opacity: 0.2;
  }

  .icon-button--recording-side-button--inactive {
    opacity: 0.4;
    cursor: default;
  }

  .icon-button--recording-side-button {
    background-color: var(
      --attendi-speech-service-button-color-secondary,
      ${zs}
    );
  }

  .icon-button--recording-side-button.base-color {
    background-color: transparent;
    color: var(--attendi-speech-service-recorder-base-color);
  }

  .icon-button--recording-side-button.base-color:hover {
    background-color: var(--color-fill-hover);
    transition: background-color 0.2s ease-in-out;
  }

  .icon-button--recording-side-button--inactive.base-color:hover {
    background-color: transparent;
  }

  @media only screen and (min-width: ${nt.small}px) and (min-height: ${nt.verticalSmall}px) {
    .icon-button--recording-side-button {
      width: 75%;
    }

    .recorder-view-container {
      grid-template-columns:
        clamp(30px, 15%, 25vh) clamp(calc(18 / 15 * 30px), 18%, 18/15 * 25vh)
        clamp(30px, 15%, 25vh);

      column-gap: 4%;
      row-gap: 0px;

      font-size: clamp(0.25rem, 7vh, 1.25rem);
    }

    .recording-text {
      display: inline;
      align-self: start;
    }

    .recording-text--recording-side-button {
      margin: -5px;
    }

    .recording-text--recording-side-button--inactive {
      opacity: 0.2;
    }

    .recording-text--recording-button {
      align-self: center;
    }
  }
`;var Cp=Object.defineProperty,Sp=Object.getOwnPropertyDescriptor,ja=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?Sp(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&Cp(e,n,o),o};let zn=class extends B{render(){if(void 0!==this.data)return v`
      <div class="titled-inner-modal-content typography">
        ${this.getIcon()} ${this.getHeader()} ${this.getContent()}

        <div
          class="titled-inner-modal-content__buttons inner-modal-text-header"
        >
          ${this.data.buttons}
        </div>
      </div>
    `}getIcon(){return v`
      <div class="titled-inner-modal-content__icon">${this.data.icon}</div>
    `}getHeader(){return v`
      <div class="inner-modal-text-header">${this.data.header}</div>
    `}getContent(){return v`
      <div class="titled-inner-modal-content__caption">
        ${this.data.content}
      </div>
    `}};zn.styles=[E`
      :host {
        display: contents;
      }

      .inner-modal-text-header {
        font-weight: 800;
        font-size: clamp(0.9rem, 8vmin, 1.3rem);
        letter-spacing: 0.01rem;
      }

      .titled-inner-modal-content {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        text-align: center;
        gap: min(30px, 3vh);
        padding: 20px 10px;
        padding-bottom: 0px;
      }

      .titled-inner-modal-content__icon {
        width: max(20%, 40px);
        color: var(--attendi-titled-inner-modal-icon-color, #48c0de);
      }

      .titled-inner-modal-content__caption {
        font-size: clamp(0.75rem, 5vmin, 0.9rem);
        line-height: clamp(0.9rem, 5vh, 1.3rem);
        color: rgb(98, 98, 98);
        margin-top: -10px;
      }

      .titled-inner-modal-content__buttons {
        display: flex;
        justify-content: space-evenly;
        width: 100%;
      }

      .titled-inner-modal-content__buttons > * {
        cursor: pointer;
        padding: 15px;
      }
    `,de],ja([A({type:Object})],zn.prototype,"data",2),zn=ja([Ct("attendi-titled-inner-modal")],zn);var xp=Object.defineProperty,Ap=Object.getOwnPropertyDescriptor,mn=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?Ap(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&xp(e,n,o),o};let re=class extends ce{constructor(){super(...arguments),this.microphoneUIState=vt.NotStartedRecording,this.redoButtonIsActive=()=>!0,this.doneButtonIsActive=()=>!0}connectedCallback(){var t;if(super.connectedCallback(),void 0===this.baseColor)return;const e=null==(t=this.shadowRoot)?void 0:t.host;void 0!==e&&e.style.setProperty("--attendi-speech-service-recorder-base-color",this.baseColor)}firstUpdated(t){super.firstUpdated(t),this.dispatchEvent(new CustomEvent("attendi-speech-service-recorder-first-updated"))}render(){return v`
        <div class="recorder-view-container">
          ${this.getRedoButton()}

          <!-- The microphone component can be accessed by parent components
           using 'recorder.microphone'. So we don't need to worry about passing
           transcribe configs here.
            -->
          <attendi-microphone
            base-color=${ci(this.baseColor)}
            @microphoneuistateupdated=${this.handleMicrophoneUIStateUpdated}
            data-test="recorder__microphone"
          ></attendi-microphone>

          ${this.getDoneButton()}
        </div>
      </div>

      <attendi-speech-service-inner-modal class="confirm-record-redo-modal" data-test="confirm-record-redo-modal">
      ${this.getConfirmRecordRedoModalContent()}
      </attendi-speech-service-inner-modal>
    `}handleMicrophoneUIStateUpdated(t){const e=t.detail;void 0!==e&&(this.microphoneUIState=e)}getRedoButton(){const t={"icon-button--recording-side-button--inactive":!this.redoButtonIsActive(this.microphoneUIState),processing:this.isProcessing(),"loading-before-recording":this.isLoadingBeforeRecording(),"base-color":void 0!==this.baseColor};return v`
      <button
        @click=${this.handleClickRedoButton}
        class="icon-button icon-button--recording-side-button redo-button ${it(t)}"
        data-test="recorder__redo-button"
      >
        ${il}
      </button>
    `}handleClickRedoButton(){this.redoButtonIsActive(this.microphoneUIState)&&this.openConfirmRedoModal()}getDoneButton(){const t={"icon-button--recording-side-button--inactive":!this.doneButtonIsActive(this.microphoneUIState),processing:this.isProcessing(),"loading-before-recording":this.isLoadingBeforeRecording(),"base-color":void 0!==this.baseColor};return v`
      <button
        class="icon-button icon-button--recording-side-button done-button ${it(t)}"
        @click=${this.handleClickDoneButton}
        data-test="recorder__done-button"
      >
        ${nl}
      </button>
    `}isRecording(){return this.microphoneUIState===vt.Recording}isProcessing(){return this.microphoneUIState===vt.ProcessingRecording}isLoadingBeforeRecording(){return this.microphoneUIState===vt.LoadingBeforeRecording}handleClickDoneButton(){this.doneButtonIsActive(this.microphoneUIState)&&this.dispatchEvent(zl())}reset(){this.microphone.reset(),this.requestUpdate()}openConfirmRedoModal(){this.confirmRecordRedoModal.open()}getConfirmRecordRedoModalContent(){return v`
      <attendi-titled-inner-modal
        style="--attendi-titled-inner-modal-icon-color: var(--attendi-speech-service-recorder-base-color, #48c0de);"
        .data=${{icon:fr,header:k.confirmRecordRedoModal_header,content:k.confirmRecordRedoModal_caption,buttons:v`
            <div
              @click=${this.closeConfirmRedoModal.bind(this)}
              data-test="confirm-record-redo-modal__cancel"
            >
              ${k.cancel}
            </div>
            <div
              @click=${this.confirmRecordRedo.bind(this)}
              data-test="confirm-record-redo-modal__confirm"
            >
              ${k.ok}
            </div>
          `}}
      ></attendi-titled-inner-modal>
    `}confirmRecordRedo(){this.dispatchEvent(Hl()),this.reset(),this.closeConfirmRedoModal()}closeConfirmRedoModal(){this.confirmRecordRedoModal.close()}};re.styles=[de,wp,E`
      attendi-microphone {
        --attendi-microphone-height: 70px;
        --attendi-microphone-max-width: 70px;
        --attendi-border-radius: 50%;
      }
    `],mn([A({attribute:"base-color",type:String})],re.prototype,"baseColor",2),mn([M(".confirm-record-redo-modal")],re.prototype,"confirmRecordRedoModal",2),mn([M("attendi-microphone")],re.prototype,"microphone",2),mn([L()],re.prototype,"microphoneUIState",2),re=mn([Ct("attendi-speech-service-recorder")],re);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const{I:Op}=tc,Ro=()=>document.createComment(""),De=(t,e,n)=>{var i;const r=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===n){const e=r.insertBefore(Ro(),o),i=r.insertBefore(Ro(),o);n=new Op(e,i,t,t.options)}else{const e=n._$AB.nextSibling,s=n._$AM,a=s!==t;if(a){let e;null==(i=n._$AQ)||i.call(n,t),n._$AM=t,void 0!==n._$AP&&(e=t._$AU)!==s._$AU&&n._$AP(e)}if(e!==o||a){let t=n._$AA;for(;t!==e;){const e=t.nextSibling;r.insertBefore(t,o),t=e}}}return n},Wt=(t,e,n=t)=>(t._$AI(e,n),t),Ep={},Pp=(t,e=Ep)=>t._$AH=e,Rp=t=>t._$AH,Oi=t=>{var e;null==(e=t._$AP)||e.call(t,!1,!0);let n=t._$AA;const i=t._$AB.nextSibling;for(;n!==i;){const t=n.nextSibling;n.remove(),n=t}},$o=(t,e,n)=>{const i=new Map;for(let r=e;r<=n;r++)i.set(t[r],r);return i},$p=si(class extends ai{constructor(t){if(super(t),t.type!==oi.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let i;void 0===n?n=e:void 0!==e&&(i=e);const r=[],o=[];let s=0;for(const e of t)r[s]=i?i(e,s):s,o[s]=n(e,s),s++;return{values:o,keys:r}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,i]){const r=Rp(t),{values:o,keys:s}=this.dt(e,n,i);if(!Array.isArray(r))return this.ut=s,o;const a=this.ut??(this.ut=[]),l=[];let d,c,u=0,h=r.length-1,p=0,f=o.length-1;for(;u<=h&&p<=f;)if(null===r[u])u++;else if(null===r[h])h--;else if(a[u]===s[p])l[p]=Wt(r[u],o[p]),u++,p++;else if(a[h]===s[f])l[f]=Wt(r[h],o[f]),h--,f--;else if(a[u]===s[f])l[f]=Wt(r[u],o[f]),De(t,l[f+1],r[u]),u++,f--;else if(a[h]===s[p])l[p]=Wt(r[h],o[p]),De(t,r[u],r[h]),h--,p++;else if(void 0===d&&(d=$o(s,p,f),c=$o(a,u,h)),d.has(a[u]))if(d.has(a[h])){const e=c.get(s[p]),n=void 0!==e?r[e]:null;if(null===n){const e=De(t,r[u]);Wt(e,o[p]),l[p]=e}else l[p]=Wt(n,o[p]),De(t,r[u],n),r[e]=null;p++}else Oi(r[h]),h--;else Oi(r[u]),u++;for(;p<=f;){const e=De(t,l[f+1]);Wt(e,o[p]),l[p++]=e}for(;u<=h;){const t=r[u++];null!==t&&Oi(t)}return this.ut=s,Pp(t,l),yt}});
/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var Tp=Object.defineProperty,le=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&Tp(e,n,o),o};const kp=3/282,Mp=.5,Mr=class extends B{constructor(){super(),this.running=!1,this.updatePeriodMilliseconds=75,this.volumeBarThicknessMultiplier=1,this.nBars=0,this.volumeBins=[],this.barWidth=0,this.barGap=0,this.volumeBuffer=[],this.updateBinsTimerId=void 0,this.resizeObserver=new ResizeObserver((()=>this.handleResize()))}connectedCallback(){super.connectedCallback(),this.resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this)}handleResize(){this.barWidth=this.clientWidth*kp*this.volumeBarThicknessMultiplier,this.barGap=this.barWidth*Mp;const t=Math.floor(this.clientWidth/(this.barWidth+this.barGap));t!==this.nBars&&(this.nBars=t,this.volumeBins=Array.from({length:this.nBars},((t,e)=>({id:e,volume:e<this.volumeBins.length?this.volumeBins[e].volume:0}))))}willUpdate(t){if(t.has("running")&&(this.running?this.start():this.stop()),t.has("volumeBarThicknessMultiplier")&&this.handleResize(),t.has("updatePeriodMilliseconds")){if(!this.running)return;void 0!==this.updateBinsTimerId&&clearInterval(this.updateBinsTimerId),this.updateBinsTimerId=setInterval((()=>this.updateBins()),this.updatePeriodMilliseconds)}super.willUpdate(t)}render(){return v`
      <div class="container" data-test="attendi-volume-over-time__container">
        ${$p(this.volumeBins,(t=>t.id),(t=>v`
            <div
              class="volume-bar"
              data-test="attendi-volume-over-time__volume-bar"
              style="
                width: ${this.barWidth}px;
                margin: 0 ${this.barGap/2}px;
                height: ${this.getBarHeight(t.volume)}%;
              "
            ></div>
          `))}
      </div>
    `}getBarHeight(t){return 5+95*t}start(){this.running||(this.running=!0,void 0!==this.updateBinsTimerId&&clearInterval(this.updateBinsTimerId),this.volumeBuffer=[],this.updateBinsTimerId=setInterval((()=>this.updateBins()),this.updatePeriodMilliseconds))}updateBins(){if(0===this.volumeBuffer.length)return;const t=this.volumeBuffer.reduce(((t,e)=>t+e),0)/this.volumeBuffer.length;this.volumeBins.shift(),this.volumeBins.push({id:this.nBars-1,volume:t}),this.volumeBins=this.volumeBins.map(((t,e)=>({...t,id:e}))),this.volumeBuffer=[],this.dispatchEvent(new CustomEvent("attendi-volume-over-time-updated",{detail:this.volumeBins.map((t=>t.volume))}))}stop(){this.running&&(this.updateBinsTimerId&&clearInterval(this.updateBinsTimerId),this.running=!1)}reset(){this.volumeBins=this.volumeBins.map((t=>({...t,volume:0}))),this.volumeBuffer=[]}addVolume(t){if(this.running){if(t<0||t>1)throw new Error(`Volume value must be in the range [0, 1]. Received: ${t}`);this.volumeBuffer.push(t)}}};Mr.styles=E`
    :host {
      display: block;
    }

    .container {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: var(
        --attendi-volume-over-time-background-color,
        transparent
      );
      border-radius: var(--attendi-volume-over-time-border-radius, 0px);
      overflow: hidden;
    }

    .volume-bar {
      border-radius: var(
        --attendi-volume-over-time-volume-bar-border-radius,
        2px
      );
      background-color: var(
        --attendi-volume-over-time-volume-bar-color,
        #1c69e8
      );
    }
  `;let wt=Mr;le([A({type:Boolean,reflect:!0})],wt.prototype,"running"),le([A({type:Number,attribute:"update-period-milliseconds",reflect:!0})],wt.prototype,"updatePeriodMilliseconds"),le([A({type:Number,attribute:"volume-bar-thickness-multiplier"})],wt.prototype,"volumeBarThicknessMultiplier"),le([L()],wt.prototype,"nBars"),le([L()],wt.prototype,"volumeBins"),le([L()],wt.prototype,"barWidth"),le([L()],wt.prototype,"barGap");class Ip{constructor(){this.callback=(t,e)=>{}}handleRequestEvent(t){const e=t,n=e.detail,i=this.callback(n.key,n.options);i&&(e.detail.provider=()=>i,e.preventDefault(),e.stopPropagation())}setResolveCallback(t){this.callback=t}connect(t){t.addEventListener(Gi,this.handleRequestEvent.bind(this))}disconnect(t){t.removeEventListener(Gi,this.handleRequestEvent.bind(this))}}class Bp{constructor(t){this.element=t}requestInstance(t,e){const n=new CustomEvent(Gi,{detail:{key:t,options:e},bubbles:!0,cancelable:!0,composed:!0});if(this.element.dispatchEvent(n),n.defaultPrevented&&n.detail.provider)return n.detail.provider();throw new Error(`no provider found for ${t}`)}}const Gi="request-dependency";function Lp(t){return class extends t{constructor(){super(...arguments),this.dependencyResolver=new Ip}resolveDependency(t,e){}connectedCallback(){void 0!==super.connectedCallback&&super.connectedCallback(),this.dependencyResolver.connect(this),this.dependencyResolver.setResolveCallback(this.resolveDependency.bind(this))}disconnectedCallback(){this.dependencyResolver.disconnect(this),void 0!==super.disconnectedCallback&&super.disconnectedCallback()}}}function Fa(t){return class extends t{constructor(){super(...arguments),this.dependencyRequester=new Bp(this)}requestInstance(t,e){return this.dependencyRequester.requestInstance(t,e)}}}const Dp={empty:!1};function Wn(t={}){const e={...Dp};for(const[n,i]of Object.entries(t))void 0!==i&&(e[n]=i);return{setFeature(t,n){e[t]=n},isEnabled:t=>e[t]}}const qi=Wn();var Np=Object.defineProperty,Up=Object.getOwnPropertyDescriptor,bn=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?Up(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&Np(e,n,o),o};const An="attendi-transcribe";let oe=class extends(Fa(ce)){constructor(){super(...arguments),this.dataTest="recording-screen",this.editorTextValue="",this.clearAttendiMicrophoneOnStopRecordingListener=void 0}connectedCallback(){super.connectedCallback(),this.featureFlagRouter=this.requestInstance("featureFlagRouter")??qi}render(){return v`
      <div class="recording-view-container typography">
        <attendi-speech-service-editor
          @change=${t=>{var e;this.editorTextValue=t.target.value,null==(e=this.recorder)||e.requestUpdate()}}
          .value=${this.editorTextValue}
          data-test="editor"
        ></attendi-speech-service-editor>

        <attendi-speech-service-recorder
          class="recorder"
          @recorderredo=${this.reset}
          @recorderdone=${this.handleRecorderDoneEvent}
          @attendi-speech-service-recorder-first-updated=${()=>{try{const t=this.requestInstance("transcribeAPIConfig")??void 0;if(void 0===t)return;this.initializeAttendiMicrophoneTranscribe(t)}catch{}}}
          .redoButtonIsActive=${t=>{const e=this.editorTextValue.length>0,n=t===vt.Recording;return e||n}}
          .doneButtonIsActive=${t=>t!==vt.Recording&&t!==vt.ProcessingRecording}
          base-color="#48c0de"
          data-test="recorder"
        >
        </attendi-speech-service-recorder>
      </div>
    `}initializeAttendiMicrophoneTranscribe(t){if(void 0===t)throw new Error("Transcribe API config not set");const e=this.recorder.microphone;if(null==e)return;e.plugins.remove(An);const n={apiURL:t.apiURL,customerKey:t.customerKey,userId:t.userId,config:{model:t.modelType},unitId:t.unitId};e.plugins.add(An,new pi(n,(t=>{this.editor.addText(t)}))),e.plugins.activate()}firstUpdated(t){super.firstUpdated(t),Xt.onTranscribeAPIConfig((t=>{null!==t&&this.initializeAttendiMicrophoneTranscribe(t)}))}reset(){this.editorTextValue="",this.resetRecorder();const t=this.recorder.microphone;if(null==t)return;const e=t.plugins.get(An);void 0!==e&&(e.resetSessionId(),e.resetReportId())}handleRecorderDoneEvent(){this.resetRecorder(),this.sendUpdatedReportingMethodToBackend(),this.dispatchEvent(new CustomEvent(Qe.attendiSpeechServiceDone,{detail:{transcript:this.editorTextValue,text:this.editorTextValue},bubbles:!0,composed:!0}))}resetRecorder(){this.recorder.reset()}sendUpdatedReportingMethodToBackend(){var t;const e=this.recorder.microphone;if(null===Xt.transcribeAPIConfig||null==e)return;const n=e.plugins.get(An);ka({baseUrl:(null==(t=Xt.transcribeAPIConfig)?void 0:t.apiURL)??"https://api.attendi.nl",path:{id:n.reportId},body:{sessions:[{id:n.sessionId,transcript:this.editorTextValue}]},headers:{"x-api-key":Xt.transcribeAPIConfig.customerKey},parseAs:"stream"})}};oe.styles=[de,E`
      .recording-view-container {
        display: grid;
        grid-template-rows: 2.75fr 1fr;
        height: min(${Zd}px, 75vh);
        justify-items: center;
        row-gap: 1%;
      }

      attendi-speech-service-editor {
        width: 97%;
        height: 100%;
      }

      .recorder {
        /*
        for some browsers (Firefox and Safari), the width of the recorder does not 
        automatically adapt properly, which is why we add 100% width.
        */
        width: 100%;
      }

      @media only screen and (min-width: ${nt.small}px) and (min-height: ${nt.verticalSmall}px) {
        .recording-view-container {
          display: grid;
          height: min(${Yd}px, 70vh);
          justify-items: center;
          row-gap: 0%;
        }
      }
    `],bn([A({reflect:!0,attribute:"data-test"})],oe.prototype,"dataTest",2),bn([L()],oe.prototype,"editorTextValue",2),bn([M("attendi-speech-service-recorder")],oe.prototype,"recorder",2),bn([M("attendi-speech-service-editor")],oe.prototype,"editor",2),oe=bn([Ct("attendi-speech-service-recording-screen")],oe);var jp=Object.defineProperty,Fp=Object.getOwnPropertyDescriptor,Va=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?Fp(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&jp(e,n,o),o};const Vp=300;let Oe=class extends B{constructor(){super(...arguments),this.isOpen=!1}render(){const t={open:this.isOpen};return v`
      <div class="modal ${it(t)}">
        <div class="modal-content">
          <slot></slot>
        </div>
      </div>
    `}close(){this.isOpen=!1}open(){this.isOpen=!0}_slottedChildren(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("slot");return null==e?void 0:e.assignedElements({flatten:!0})}};Oe.styles=E`
    .modal {
      display: none; /* Hidden by default */
      position: fixed; /* Stay in place */
      left: 0;
      top: 0;
      width: 100%; /* Full width */
      height: 100%; /* Full height */
      overflow: auto; /* Enable scroll if needed */
      background-color: rgb(0, 0, 0); /* Fallback color */
      background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
      z-index: inherit;
    }

    .open {
      display: block;
    }

    /* Modal content box */
    .modal-content {
      position: relative;
      left: 50%; /* Center the modal horizontally */
      top: 50%; /* Center the modal vertically */
      transform: translate(
        -50%,
        -50%
      ); /* Center the modal horizontally and vertically */
      width: min(83%, ${Vp}px);
      padding: 10px; /* Padding between modal edge and inner content */
      background-color: white;
      border-radius: 10px;
      border: 1px solid #888;
    }

    .exit-button {
      width: clamp(22px, 6%, 28px);
      aspect-ratio: 1;
      margin-left: auto;
      cursor: pointer;
      position: absolute;
      right: 4%;
    }

    .exit-button svg {
      color: white;
      fill: #c4c4c4;
      transition: 0.3s fill;
    }

    .exit-button svg:hover {
      fill: #a2a2a2;
    }
  `,Va([A({attribute:"open",type:Boolean,reflect:!0})],Oe.prototype,"isOpen",2),Oe=Va([Ct("attendi-speech-service-inner-modal")],Oe);var Hp=Object.defineProperty,zp=Object.getOwnPropertyDescriptor,fi=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?zp(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&Hp(e,n,o),o};let Ee=class extends ce{constructor(){super(...arguments),this.modalMethodInformationText=""}render(){return v`
      <div class="reporting-method-screen-container typography">
        <div class="header">
          ${k.selectReportingMethodScreen_header}
        </div>
        <div class="methods">${this._getReportingMethodLinks()}</div>

        ${this._getMethodInformationModal()}
      </div>
    `}_getReportingMethodLinks(){return Array.from(nn.keys()).map(this._getReportingMethodLinkAndInformationButton.bind(this))}_getReportingMethodLinkAndInformationButton(t){if(void 0===this.transcribeAPIConfig)throw new Error("No config");return v`<div class="methods__method">
      <div class="methods__method__details">
        ${Wp(t,this.transcribeAPIConfig)}
        ${this._getReportingMethodInformationIcon(t)}
      </div>
    </div>`}_getReportingMethodInformationIcon(t){return v`
      <div
        class="methods__method__details__description-icon"
        @click=${()=>this.openMethodInformationModal(t)}
      >
        ${al}
      </div>
    `}_getMethodInformationModal(){return v`
      <attendi-speech-service-inner-modal class="method-information-modal">
        <div class="method-information-modal-content">
          <div class="method-information-modal-content__text">
            ${this.modalMethodInformationText}
          </div>

          <div
            class="method-information-modal-content__ok-button"
            @click=${this.closeMethodInformationModal}
          >
            ${k.ok}
          </div>
        </div>
      </attendi-speech-service-inner-modal>
    `}openMethodInformationModal(t){var e;void 0!==this._innerModal&&this._innerModal instanceof Oe&&(this.modalMethodInformationText=(null==(e=nn.get(t))?void 0:e.description)??"Geen extra informatie voor deze methode.",this._innerModal.open())}closeMethodInformationModal(){void 0!==this._innerModal&&this._innerModal instanceof Oe&&this._innerModal.close()}};function Wp(t,e){var n;return v`
    <div
      class="methods__method__details__display-name"
      @click=${()=>Gp(t,e)}
      data-test="reporting-method-link"
    >
      ${(null==(n=nn.get(t))?void 0:n.displayName)??""}
      ${k.selectReportingMethodScreen_report}
    </div>
  `}function Gp(t,e){const n={properties:{reportingMethodType:t,transcribeAPIConfig:e,baseColor:"#48c0de"}};Nt.push({name:Yt.reportingMethod,settings:n})}
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function*qp(t,e){if(void 0!==t){let n=0;for(const i of t)yield e(i,n++)}}Ee.styles=[de,E`
      :host {
        display: block;
        padding-left: 10px;
        padding-right: 10px;
      }

      .header {
        color: #1b94b1;
        font-size: 1.5rem;
        font-weight: bold;
        letter-spacing: 0.015rem;
        margin-bottom: 10px;
        padding-top: 5px;
      }

      .methods {
        display: flex;
        flex-direction: column;
        gap: 15px;
      }

      .methods__method__details {
        display: flex;
        gap: 10px;
        align-items: center;
      }

      .methods__method__details__display-name {
        color: #48c0de;
        font-size: 1.2rem;
        cursor: pointer;
      }

      .methods__method__details__description-icon {
        color: #48c0de;
        width: 20px;
        height: 20px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
      }

      .method-information-modal-content {
        padding: 10px;
        display: flex;
        flex-direction: column;
      }

      .method-information-modal-content__ok-button {
        align-self: end;
        display: inline;
        justify-self: end;
        padding: 20px 15px 0px 15px;
        color: #30809c;
        cursor: pointer;
      }

      .reporting-method-screen-container {
        min-height: 200px;
      }
    `],fi([M("attendi-speech-service-inner-modal")],Ee.prototype,"_innerModal",2),fi([L()],Ee.prototype,"modalMethodInformationText",2),fi([A({type:Object})],Ee.prototype,"transcribeAPIConfig",2),Ee=fi([Ct("attendi-select-reporting-method-screen")],Ee);class To{constructor(t){this.currentStep=0,this.reportingMethod=nn.get(t)??Er,this.stepTexts=this.reportingMethod.steps.map((()=>"")),this.sessionIds=this.reportingMethod.steps.map((()=>xe())),this.stepStartedEditingOrTranscribing=this.reportingMethod.steps.map((()=>!1)),cr(this)}setStepText(t,e){this.checkStepIndexInRange(t),ki((()=>{this.stepTexts[t]=e}))}setCurrentStepText(t){this.setStepText(this.currentStep,t)}resetCurrentStepText(){this.setCurrentStepText("")}stepSessionId(t,e){this.checkStepIndexInRange(t),this.sessionIds[t]=e}getStepSessionId(t){return this.checkStepIndexInRange(t),this.sessionIds[t]}resetCurrentStepSessionId(){const t=xe();this.setCurrentStepSessionId(t)}setCurrentStepSessionId(t){this.stepSessionId(this.currentStep,t)}setCurrentStep(t){this.currentStep=this.clampStep(t)}clampStep(t){return Yp(t,0,this.nSteps-1)}addParagraphToStep(t,e){const n=Kp(this.getStepText(t),e);this.setStepText(t,n)}addParagraphToCurrentStep(t){this.addParagraphToStep(this.currentStep,t)}getStepName(t){if(t<0||t>=this.nSteps)throw new RangeError(`step index should be in interval [0, ${this.nSteps-1}]`);return this.reportingMethod.steps[t].name}getStepText(t){return this.checkStepIndexInRange(t),this.stepTexts[t]}get currentStepText(){return this.getStepText(this.currentStep)}stepHasText(t){return this.getStepText(t).length>0}get currentStepSessionId(){return this.getSessionId(this.currentStep)}getSessionId(t){return this.checkStepIndexInRange(t),this.sessionIds[t]}get currentStepHasText(){return this.getStepText(this.currentStep).length>0}get currentMethodStepName(){return this.reportingMethod.steps[this.currentStep].name}get currentMethodStepPrompt(){return this.reportingMethod.steps[this.currentStep].prompt}get nSteps(){return this.stepTexts.length}get currentStepIsFinalStep(){return this.currentStep===this.nSteps-1}resetCurrentStep(){this.resetCurrentStepSessionId(),this.resetCurrentStepText()}get currentStepStartedEditingOrTranscribing(){return this.startedEditingOrTranscribing(this.currentStep)}startedEditingOrTranscribing(t){return this.checkStepIndexInRange(t),this.stepStartedEditingOrTranscribing[t]}setCurrentStepStartedEditingOrTranscribing(t){this.setStartedEditingOrTranscribing(this.currentStep,t)}setStartedEditingOrTranscribing(t,e){this.checkStepIndexInRange(t),this.stepStartedEditingOrTranscribing[t]=e}resetCurrentStepStartedEditingOrTranscribing(){this.resetStartedEditingOrTranscribing(this.currentStep)}resetStartedEditingOrTranscribing(t){this.setStartedEditingOrTranscribing(t,!1)}checkStepIndexInRange(t){if(t<0||t>=this.nSteps)throw new RangeError(`step index should be in interval [0, ${this.nSteps-1}]`)}}function Kp(t,e){return t+Zp(t,e)+e}function Zp(t,e){const n=0===t.length,i=0===e.length;return n||i?"":"\n\n"}const Yp=(t,e,n)=>Math.min(Math.max(t,e),n);class Xp{constructor(t){this.reportHeaderFormatter=()=>"",this.stepHeaderFormatter=t=>`${t}:\n`,void 0!==t&&(void 0!==t.reportHeaderFormatter&&(this.reportHeaderFormatter=t.reportHeaderFormatter),void 0!==t.stepHeaderFormatter&&(this.stepHeaderFormatter=t.stepHeaderFormatter))}format(t){let e=this.reportHeaderFormatter(t.reportingMethod.name);this.reportHeaderFormatter.length>0&&i();for(let r=0;r<t.nSteps;r++){const o=this._getStepHeaderAndText(t,r);void 0!==o&&(e+=o,n(r)&&i())}return e;function n(e){return!function(e){return function(e){return e===t.nSteps-1}(e)||function(e){return e===function(){for(let e=t.nSteps-1;e>=0;e--)if(t.getStepText(e).length>0)return e;return 0}()}(e)}(e)}function i(){e+="\n\n"}}_getStepHeaderAndText(t,e){if(void 0===t)return;let n="";const i=t.getStepName(e),r=t.getStepText(e);return 0!==r.length?(n+=this._getReportingMethodStepHeader(i),n+=r,n):void 0}_getReportingMethodStepHeader(t){return void 0===t?"":this.stepHeaderFormatter(t)}}const Jp=new Xp;var Qp=Object.defineProperty,tf=Object.getOwnPropertyDescriptor,ue=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?tf(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&Qp(e,n,o),o};const ef="attendi-transcribe";let Pt=class extends(Fa(ce)){constructor(){super(...arguments),this.reportingMethodType=He.SOEP,this.sessionGroupId=tn(),this.state=new To(this.reportingMethodType),this.clearAttendiMicrophoneOnStopRecordingListener=void 0}get reportingMethod(){return nn.get(this.reportingMethodType)??Er}firstUpdated(){this.initializeReportingMethodState()}initializeReportingMethodState(){this.state=new To(this.reportingMethodType),setTimeout((()=>this.requestUpdate()),0)}updated(t){this.updateStateOnReportingMethodTypeChanged(t)}updateStateOnReportingMethodTypeChanged(t){t.has("reportingMethodType")&&void 0!==t.get("reportingMethodType")&&this.initializeReportingMethodState()}connectedCallback(){var t;super.connectedCallback();try{this.featureFlagRouter=this.requestInstance("featureFlagRouter")??qi}catch{this.featureFlagRouter=qi}if(void 0===this.baseColor)return;const e=null==(t=this.shadowRoot)?void 0:t.host;void 0!==e&&(e.style.setProperty("--attendi-linear-reporting-method-screen-base-color",this.baseColor),e.style.setProperty("--attendi-linear-reporting-method-screen-navigator-fill-color",at(this.baseColor,.22)))}render(){return v`<div class="linear-reporting-method-container">
      <div class="linear-reporting-method-navigator">
        ${qp(this.reportingMethod.steps,((t,e)=>this.mapStepToNavigator(t,e)))}
      </div>

      <div class="recording-view-container typography">
        <div class="step-header">${this.state.currentMethodStepName??""}</div>

        <div class="step-prompt">
          ${this.state.currentMethodStepPrompt??""}
        </div>

        <attendi-speech-service-editor
          @change=${t=>{var e;const n=t.detail;void 0!==n&&(this.state.setCurrentStepText(n),this.setCurrentStepStartedEditingOrTranscribingOnEditorChange(n),null==(e=this.recorder)||e.requestUpdate())}}
          .value=${this.state.currentStepText??""}
          data-test="editor"
        ></attendi-speech-service-editor>

        <attendi-speech-service-recorder
          class="recorder"
          .redoButtonIsActive=${t=>t===vt.Recording||(this.state.currentStepHasText??!1)}
          .doneButtonIsActive=${t=>t===vt.NotStartedRecording}
          @recorderredo=${this.resetCurrentStep}
          @recorderdone=${this.handleDoneButtonClicked}
          @attendi-speech-service-recorder-first-updated=${this.initializeAttendiMicrophoneTranscribe}
          base-color=${ci(this.baseColor)}
        >
        </attendi-speech-service-recorder>
      </div>
    </div>`}mapStepToNavigator(t,e){const n=this.reportingMethod.steps.map(((t,e)=>this._getStepClassesFromIndex(e)));return v`
      <div
        class="linear-reporting-method-navigator__button ${it(n[e])}"
        @click=${()=>this.onClickNavigatorButton(e)}
        data-test=${`linear-reporting-method-navigation-indicator-${e}`}
      >
        ${t.symbol??0}
      </div>
    `}onClickNavigatorButton(t){this.state.currentStep!==t&&this.changeStep(t)}_getStepClassesFromIndex(t){return{"linear-reporting-method-navigator__button--active":this.state.currentStep===t,"linear-reporting-method-navigator__button--filled":this.state.stepHasText(t)}}reset(){this.initializeReportingMethodState(),this.recorder.reset()}initializeAttendiMicrophoneTranscribe(){const t=this.recorder.microphone;if(null==t)throw new Error("Cannot initialize transcribe functionality without initialized attendi-microphone.");if(void 0===this.transcribeAPIConfig)throw new Error("Transcribe API config not set.");const e={apiURL:this.transcribeAPIConfig.apiURL,customerKey:this.transcribeAPIConfig.customerKey,userId:this.transcribeAPIConfig.userId,config:{model:this.transcribeAPIConfig.modelType},unitId:this.transcribeAPIConfig.unitId};this.transcribePlugin=new pi(e,(t=>{this.addTranscriptFromAPIResponse(this.state.currentStep,t),this.state.setStartedEditingOrTranscribing(this.state.currentStep,!0)})),this.transcribePlugin.setReportId(this.sessionGroupId),this.transcribePlugin.setSessionId(this.state.currentStepSessionId),t.plugins.add(ef,this.transcribePlugin),t.plugins.activate()}setCurrentStepStartedEditingOrTranscribingOnEditorChange(t){const e=0!==t.length,n=!this.state.currentStepStartedEditingOrTranscribing;e&&n&&this.state.setCurrentStepStartedEditingOrTranscribing(!0)}resetCurrentStep(){this.state.resetCurrentStep(),this.state.resetCurrentStepStartedEditingOrTranscribing(),void 0!==this.transcribePlugin&&this.transcribePlugin.setSessionId(this.state.currentStepSessionId)}addTranscriptFromAPIResponse(t,e){var n;t===this.state.currentStep?null==(n=this.editor)||n.addText(e):this.state.addParagraphToStep(t,e)}handleDoneButtonClicked(){try{this.sendUpdatedReportingMethodToBackend()}catch(t){console.error(t)}this.dispatchDoneEvent(),Nt.popAll()}sendUpdatedReportingMethodToBackend(){var t;const e=this.getReportingMethodSessionData();0!==e.length&&ka({baseUrl:(null==(t=this.transcribeAPIConfig)?void 0:t.apiURL)??"https://api.attendi.nl",path:{id:this.sessionGroupId},body:{reportingMethod:this.state.reportingMethod.name,sessions:e},headers:{"x-api-key":this.transcribeAPIConfig.customerKey},parseAs:"stream"})}getReportingMethodSessionData(){return[...Array(this.state.nSteps).keys()].filter((t=>this.state.startedEditingOrTranscribing(t)&&this.state.getStepText(t).trim().length>0)).map((t=>({id:this.state.getStepSessionId(t),reportingMethodStep:this.state.reportingMethod.steps[t].name,transcript:this.state.getStepText(t)})))}dispatchDoneEvent(){const t=nf(Jp.format(this.state));this.dispatchEvent(t)}async changeStep(t){this.recorder.isRecording()&&(this.transcribeCurrentStep(),this.state.stepHasText(t)&&(this.recorder.microphone.reset(),this.recorder.microphone.executeCommand(Zt.playStop))),this.state.setCurrentStep(t),void 0!==this.transcribePlugin&&this.transcribePlugin.setSessionId(this.state.currentStepSessionId)}async transcribeCurrentStep(){const t=this.state.currentStep,e=this.state.currentStepSessionId.toString(),n=this.recorder.microphone.audioBuffer;if(void 0===n)return;const i=new Float32Array(n);this.recorder.microphone.clearBuffer();const r=await pa(i);if(void 0===this.transcribeAPIConfig)return;const o=(await Ta({baseUrl:this.transcribeAPIConfig.apiURL??"https://api.attendi.nl",body:{audio:r,userId:this.transcribeAPIConfig.userId,unitId:this.transcribeAPIConfig.unitId,config:{model:this.transcribeAPIConfig.modelType},metadata:{reportId:this.sessionGroupId,sessionId:e,userAgent:navigator.userAgent}},headers:{"x-api-key":this.transcribeAPIConfig.customerKey}})).data;if(void 0===(null==o?void 0:o.transcript)||null===(null==o?void 0:o.transcript))throw new Error("No response from transcription service");this.addTranscriptFromAPIResponse(t,o.transcript),this.state.setStartedEditingOrTranscribing(t,!0)}};function nf(t){return new CustomEvent("attendi-linear-reporting-method-done",{detail:t,composed:!0})}Pt.styles=[de,E`
      .linear-reporting-method-container {
        display: grid;
        place-items: center;
        grid-template-rows: auto 1fr;
        height: min(${Xd}px, 75vh);
      }

      .recording-view {
        height: 100%;
        width: 100%;
      }

      .linear-reporting-method-navigator {
        display: flex;
        justify-content: space-evenly;
        width: clamp(230px, 80%, 300px);
        margin-top: -15px;
      }

      .linear-reporting-method-navigator__button {
        width: 13%;
        aspect-ratio: 1;
        border-radius: 50%;
        border-width: 2px;
        border-color: #cecece;
        border-style: solid;
        display: flex;
        place-items: center;
        justify-content: center;
        color: #515151;
        font-size: clamp(1.3rem, 5vw, 1.6rem);
        font-family: sans-serif;
        padding: 1.4%;
        background-clip: content-box;
        cursor: pointer;
        /* no (blue) highlight color when tapping on button on mobile phone */
        -webkit-tap-highlight-color: transparent;
      }

      .linear-reporting-method-navigator__button--active {
        border-color: var(
          --attendi-linear-reporting-method-screen-base-color,
          #48c0de
        );
      }

      .linear-reporting-method-navigator__button--filled {
        background-color: var(
          --attendi-linear-reporting-method-screen-navigator-fill-color,
          #b6e6f2
        );
      }

      @media only screen and (min-width: ${nt.small}px) and (min-height: ${nt.verticalSmall}px) {
        .linear-reporting-method-container {
          height: min(${Jd}px, 70vh);
        }

        .linear-reporting-method-navigator {
          margin-top: -25px;
          padding-bottom: 10px;
        }
      }

      @media only screen and (max-height: 314px) {
        .linear-reporting-method-navigator {
          display: none;
        }

        .linear-reporting-method-container {
          display: block;
          margin-top: -30px;
        }
      }

      /* New CSS */
      .recording-view-container {
        display: grid;
        grid-template-rows: auto auto 1.75fr 1fr;
        justify-items: center;
        align-items: center;
        height: 100%;
      }

      .step-header {
        font-weight: bold;
        align-self: end;
        padding-top: clamp(5px, 3vh, 10px);
        font-size: clamp(0.9rem, 7vh, 1.1rem);
        letter-spacing: 0.015rem;
      }

      .step-prompt {
        padding: 5px 5% 10px;
        color: #585858;
        text-align: center;
        font-size: clamp(0.7rem, 5vh, 1rem);
      }

      .recorder {
        /*
        for some devices, the width of the recorder does not 
        automatically adapt properly, which is why we add 100% width.
        */
        width: 100%;
        height: 100%;
      }

      attendi-speech-service-editor {
        width: 97%;
        height: 100%;
      }

      @media only screen and (min-width: ${nt.small}px) {
        .step-header,
        .step-prompt {
          text-align: start;
          justify-self: center;
          width: 97%;
          font-size: large;
          letter-spacing: 0.015rem;
        }
      }

      @media only screen and (min-width: ${nt.small}px) and (min-height: ${nt.verticalSmall}px) {
        .recording-view-container {
          grid-template-rows: 30px 30px 1.75fr 1fr;
        }
      }

      @media only screen and (max-height: 314px) {
        .recording-view-container {
          grid-template-rows: 30px 30px 1fr 1fr;
        }
      }
    `],ue([A({attribute:"reporting-method-type",type:String,reflect:!1})],Pt.prototype,"reportingMethodType",2),ue([A({type:Object})],Pt.prototype,"transcribeAPIConfig",2),ue([A({attribute:"base-color",type:String})],Pt.prototype,"baseColor",2),ue([A()],Pt.prototype,"sessionGroupId",2),ue([M("attendi-speech-service-editor")],Pt.prototype,"editor",2),ue([M("attendi-speech-service-recorder")],Pt.prototype,"recorder",2),Pt=ue([Ct("attendi-linear-reporting-method-screen")],Pt);var rf=Object.defineProperty,of=Object.getOwnPropertyDescriptor,$r=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?of(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&rf(e,n,o),o};const Yt={homeRoute:"/",recordingScreen:"/recordingScreen",selectReportingMethodScreen:"/selectReportingMethodScreen",reportingMethod:"/reportingMethod"},sf={[Yt.homeRoute]:"attendi-speech-service-recording-screen",[Yt.recordingScreen]:"attendi-speech-service-recording-screen",[Yt.selectReportingMethodScreen]:"attendi-select-reporting-method-screen",[Yt.reportingMethod]:"attendi-linear-reporting-method-screen"};let on=class extends ce{constructor(){super(...arguments),this.navigator=Nt}updated(){this.setCurrentRouteProperties()}setCurrentRouteProperties(){var t;const e=this.navigator.currentRoute.settings;void 0!==e&&(null==(t=Object.entries(e.properties))||t.forEach((([t,e])=>{this.currentChild[t]=e})))}render(){return v`<div class="navigator-child">
      ${this.getCurrentComponent()}
    </div>`}getCurrentComponent(){const t=this.constructHTMLTagForCurrentRoute();return v`${Qd(t)}`}constructHTMLTagForCurrentRoute(){return af(this.getCurrentTagName())}getCurrentTagName(){return sf[this.navigator.currentRoute.name]}reset(){var t;"function"==typeof(null==(t=this.currentChild)?void 0:t.reset)&&this.currentChild.reset(),this.navigator.popAll()}};function af(t){return`<${t}></${t}>`}on.styles=E`
    .navigator-child {
      padding-top: clamp(28px, 8vh, 40px);
    }
  `,$r([A({type:Object})],on.prototype,"navigator",2),$r([M(".navigator-child > *")],on.prototype,"currentChild",2),on=$r([Ct("attendi-navigator")],on);class cf{constructor(){this.transcribeAPIConfig=null,this.transcribeAPIConfigCallbacks=new Set,cr(this)}setTranscribeAPIConfig(t){this.transcribeAPIConfig=t;for(const e of this.transcribeAPIConfigCallbacks)e(t)}onTranscribeAPIConfig(t){return this.transcribeAPIConfigCallbacks.add(t),()=>{this.transcribeAPIConfigCallbacks.delete(t)}}}var df=Object.defineProperty,lf=Object.getOwnPropertyDescriptor,uf=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?lf(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&df(e,n,o),o};let Ki=class extends ce{constructor(){super(...arguments),this.navigator=Nt}render(){return v` <div @click=${this.handleMenuButtonClicked}>
      <div
        class="menu-button"
        data-test="attendi-speech-service__navigator-button"
      >
        ${this._getMenuIcon()}
      </div>
    </div>`}_getMenuIcon(){return Nt.history.length>0?v` <div class="menu-button__back-icon">
        ${sl}
      </div>`:v` <div class="menu-button__menu-icon">${ol}</div>`}handleMenuButtonClicked(){this.dispatchEvent(new CustomEvent("menu-button-clicked"))}};Ki.styles=E`
    .menu-button {
      max-width: 28px;
      height: 28px;
      cursor: pointer;
      position: absolute;
      left: 4%;
      -webkit-tap-highlight-color: transparent;
    }

    /*
    This is used to create a larger clickable area for the menu button
    for UX purposes.
    */
    .menu-button:after {
      content: "";
      position: absolute;
      left: -12px;
      top: -16px;
      width: 48px;
      height: 48px;
    }

    .menu-button__menu-icon {
      height: inherit;
      width: 28px;
    }

    .menu-button__back-icon {
      height: 100%;
    }

    .menu-button * svg {
      color: ${zs};
      height: 100%;
      width: 100%;
      transition: 0.3s color;
    }
  `,Ki=uf([Ct("attendi-speech-service-menu-button")],Ki);const hf={checkEmptyRecordings:!0};var pf=Object.defineProperty,ff=Object.getOwnPropertyDescriptor,gf=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?ff(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&pf(e,n,o),o};let Zi=class extends(Lp(B)){constructor(){super(...arguments),this.featureFlagRouter=Wn(),this.appConfig={...hf}}resolveDependency(t,e){switch(t){case"featureFlagRouter":return this.featureFlagRouter;case"appConfig":return this.appConfig;case"transcribeAPIConfig":return this.transcribeAPIConfig}return super.resolveDependency(t,e)}getFeatureFlagRouter(){return Wn()}render(){return v`<slot></slot>`}};Zi.styles=E`
    :host {
      display: contents;
    }
  `,Zi=gf([Ct("attendi-dependency-provider")],Zi);const vf=E`
  dialog {
    border: 1px solid #888;
    border-radius: 10px;
    box-shadow:
      0 0 #0000,
      0 0 #0000,
      0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 10px; /* Padding between modal edge and inner content */
    width: min(
      90%,
      ${hr}px
    ); /* Width of modal will be 90% on small screens, and is capped at 500px */
    position: fixed;
    background-color: white;
    top: auto;
    bottom: 1%;
    overflow: hidden;
  }

  dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
  }

  .exit-button {
    width: 28px;
    height: 28px;
    margin-left: auto;
    cursor: pointer;
    position: absolute;
    right: 4%;
  }

  /*
      This is used to create a larger clickable area for the exit button
      for UX purposes.
      */
  .exit-button:after {
    content: "";
    position: absolute;
    left: -10px;
    top: -10px;
    width: 40px;
    height: 40px;
  }

  .exit-button svg {
    color: white;
    fill: #c4c4c4;
    transition: 0.3s fill;
  }

  .exit-button svg:hover {
    fill: #a2a2a2;
  }

  .open-speech-service-dialog-button {
    width: 100%;
    height: 100%;

    background: linear-gradient(
      var(
        --attendi-speech-service-button-color-primary,
        var(
          --attendi-speech-button-color-primary-gradient-upper,
          ${Gd}
        )
      ),
      var(
        --attendi-speech-service-button-color-primary,
        var(
          --attendi-speech-button-color-primary-gradient-lower,
          ${qd}
        )
      )
    );
  }

  .open-speech-service-dialog-button svg {
    width: 85%;
  }

  @media screen and (min-width: ${nt.small}px) {
    /* Put the modal more at the top / middle when on larger screens. */
    dialog {
      top: 15%;
      bottom: auto;
      padding: 15px;
    }
  }
`;var mf=Object.defineProperty,bf=Object.getOwnPropertyDescriptor,yn=(t,e,n,i)=>{for(var r,o=i>1?void 0:i?bf(e,n):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(i?r(e,n,o):r(o))||o);return i&&o&&mf(e,n,o),o};const Xt=new cf,Ir=class extends ce{constructor(){super(...arguments),this.innerModalContent=void 0,this.featureFlagRouter=Wn()}set transcribeAPIConfig(t){void 0!==t&&Xt.setTranscribeAPIConfig(t)}get transcribeAPIConfig(){if(null!==Xt.transcribeAPIConfig)return Xt.transcribeAPIConfig}connectedCallback(){super.connectedCallback(),this.addEventListener(Qe.attendiSpeechServiceDone,this.handleAttendiSpeechServiceDone),this.addEventListener("attendi-linear-reporting-method-done",(t=>{const e=t.detail;this.dispatchEvent(Bi({transcript:e,text:e})),this.dispatchEvent(new CustomEvent(Qe.attendiSpeechServiceDone,{detail:{transcript:e,text:e},composed:!0,bubbles:!0})),this.reset()}))}dispatchAttendiSpeechSegmentEvent(t){const e=Bi({transcript:t});this.dispatchEvent(e)}handleAttendiSpeechServiceDone(t){var e,n;void 0!==(null==(e=t.detail)?void 0:e.transcript)&&this.dispatchAttendiSpeechSegmentEvent(null==(n=t.detail)?void 0:n.transcript),this.reset()}render(){return v`
      <link
        rel="preconnect"
        href="//fonts.googleapis.com/css2?family=Open+Sans:wght@300..800&display=swap"
      />

      <attendi-dependency-provider
        data-test="dependency-provider"
        .featureFlagRouter=${this.featureFlagRouter}
        .transcribeAPIConfig=${this.transcribeAPIConfig}
      >
        ${this.speechServiceContent}
      </attendi-dependency-provider>
    `}get speechServiceContent(){return v`<div class="speech-service-container">
        <div class="view-container">
          <attendi-speech-service-menu-button
            @click=${this.handleMenuButtonClicked}
          ></attendi-speech-service-menu-button>
          <attendi-navigator data-test="attendi-navigator"></attendi-navigator>
        </div>
      </div>

      ${this.errorModal}`}handleMenuButtonClicked(){Nt.currentRoute.name===Yt.homeRoute?this.goToSelectReportingMethodScreen():Nt.popAll()}goToSelectReportingMethodScreen(){Nt.push({name:Yt.selectReportingMethodScreen,settings:{properties:{transcribeAPIConfig:this.transcribeAPIConfig}}})}get errorModal(){if(void 0!==this.innerModalContent)return v`<attendi-speech-service-inner-modal data-test="inner-modal">
        ${this.innerModalContent}
      </attendi-speech-service-inner-modal>`}cancel(){this.dispatchCancelEvent(),this.reset()}reset(){var t;null==(t=this.attendiNavigator)||t.reset()}dispatchCancelEvent(){const t=Hd();this.dispatchEvent(t)}async showErrorDialog(t){var e;if(console.log("there was an error: ",(null==(e=t.detail)?void 0:e.title)??""),void 0===t.detail)return;const n=t.detail;this.innerModalContent=this.getTitledInnerModalContent(n.title,n.content),await this.updateComplete,this.innerModal.open()}getTitledInnerModalContent(t,e){return v`<attendi-titled-inner-modal
      .data=${{icon:fr,header:t??"",content:e??"",buttons:v`
          <div
            class="titled-inner-modal-content__buttons__confirm"
            @click=${()=>this.closeInnerModal()}
            data-test="root-inner-modal__close"
          >
            ${k.ok}
          </div>
        `}}
    ></attendi-titled-inner-modal>`}closeInnerModal(){this.innerModal.close(),this.innerModalContent=void 0}};Ir.styles=[de,vf,E`
      :host {
        display: block;

        /* 
        This is very hacky, as it hardcodes the color. We use it so that the
        attendi-speech-service-recorder's buttons backgrounds have a color on hover.
        I will allow it for now since the 'AttendiSpeechService' will soon be out
        of use.
        */
        --color-fill-hover: #edf9fc;
      }

      .view-container {
        height: 100%;
      }

      .speech-service-container {
        margin: auto;
        width: min(100%, ${hr}px);
      }

      .button-container {
        position: relative;
        height: 100%;
        width: 100%;
      }

      button {
        position: absolute;
        top: 0px;
        left: 0px;
      }
    `];let Rt=Ir;yn([A({attribute:"transcribe-api-config",type:Object,reflect:!1})],Rt.prototype,"transcribeAPIConfig",1),yn([M("attendi-navigator")],Rt.prototype,"attendiNavigator",2),yn([M("attendi-dependency-provider")],Rt.prototype,"attendiDependencyProvider",2),yn([M("attendi-speech-service-inner-modal")],Rt.prototype,"innerModal",2),yn([L()],Rt.prototype,"innerModalContent",2);var yf=Object.defineProperty,_f=(t,e,n,i)=>{for(var r,o=void 0,s=t.length-1;s>=0;s--)(r=t[s])&&(o=r(e,n,o)||o);return o&&yf(e,n,o),o};const wf=1300,Br=class extends B{constructor(){super(...arguments),this.isOpen=!1}render(){const t={open:this.isOpen};return v`
      <div class="modal ${it(t)}">
        <div
          class="attendi-speech-service-modal-content"
          data-test="attendi-speech-service-modal-content"
        >
          <!-- We use an extra div for the larger clickable area (see CSS comment above) -->
          <div @click=${this.cancel}>
            <div
              class="exit-button"
              data-test="attendi-speech-service-modal__exit-button"
            >
              ${rl}
            </div>
          </div>
          <slot></slot>
        </div>
      </div>
    `}updated(t){t.has("isOpen")&&(this.isOpen?Ui():Ni())}connectedCallback(){super.connectedCallback(),this.isOpen&&Ui(),this.addEventListener(Qe.attendiSpeechServiceDone,(()=>{this.close()})),window.addEventListener("keyup",(t=>{"Escape"===t.key&&this.cancel()}))}disconnectedCallback(){Ni(),window.removeEventListener("keyup",(t=>{"Escape"===t.key&&this.cancel()})),super.disconnectedCallback()}cancel(){var t;null==(t=this.getAttendiSpeechServiceElement())||t.dispatchCancelEvent(),this.close()}close(){var t;null==(t=this.getAttendiSpeechServiceElement())||t.reset(),this.isOpen=!1}getAttendiSpeechServiceElement(){const t=this._slottedChildren();if(void 0!==t){const e=t[0];if(e instanceof Rt)return e}}open(){this.isOpen=!0}_slottedChildren(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("slot");return null==e?void 0:e.assignedElements({flatten:!0})}};Br.styles=E`
    :host {
      z-index: ${wf};
    }

    .modal {
      display: none; /* Hidden by default */
      position: fixed;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      overflow: auto; /* Enable scroll if needed */
      background-color: rgb(0, 0, 0); /* Fallback color */
      background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
      z-index: inherit;
    }

    .open {
      display: block;
    }

    /* Modal content box */
    .attendi-speech-service-modal-content {
      position: fixed;
      left: 50%; /* Center the modal horizontally */
      transform: translateX(-50%); /* Center the modal horizontally */
      bottom: 1%; /* Place the modal (almost) at the bottom (on small screens) */
      width: min(
        90%,
        ${hr}px
      ); /* Width of modal will be 90% on small screens, and is capped at 500px */
      padding: 10px; /* Padding between modal edge and inner content */
      background-color: white;
      border-radius: 10px;
      border: 1px solid #888;
    }

    .exit-button {
      width: 28px;
      height: 28px;
      margin-left: auto;
      cursor: pointer;
      position: absolute;
      right: 4%;
    }

    /*
    This is used to create a larger clickable area for the exit button
    for UX purposes.
    */
    .exit-button:after {
      content: "";
      position: absolute;
      left: -10px;
      top: -10px;
      width: 40px;
      height: 40px;
    }

    .exit-button svg {
      color: white;
      fill: #c4c4c4;
      transition: 0.3s fill;
    }

    .exit-button svg:hover {
      fill: #a2a2a2;
    }

    @media screen and (min-width: ${nt.small}px) {
      /* Put the modal more at the top / middle when on larger screens. */
      .attendi-speech-service-modal-content {
        top: 15%;
        bottom: auto;
        padding: 15px;
      }
    }
  `;let Gn=Br;_f([A({attribute:"open",type:Boolean,reflect:!0})],Gn.prototype,"isOpen");const jf={AttendiTranscribePlugin:pi,AttendiStreamingTranscribePlugin:uh,NotificationAudioPlugin:zi,VolumeFeedbackPlugin:Da,LinearReportingMethodPlugin:Aa,UnitIdFeatureOverridesPlugin:yh,AttendiErrorPlugin:Wi};customElements.get("attendi-speech-service")||customElements.define("attendi-speech-service",Rt),customElements.get("attendi-speech-service-modal")||customElements.define("attendi-speech-service-modal",Gn),customElements.get("attendi-microphone")||customElements.define("attendi-microphone",O),customElements.get("attendi-volume-over-time")||customElements.define("attendi-volume-over-time",wt);export{O as AttendiMicrophone,Rt as AttendiSpeechService,Gn as AttendiSpeechServiceModal,wt as AttendiVolumeOverTime,vt as MicrophoneUIState,Uh as ModelType,lh as WebSocketAudioStreamingAdapter,jf as attendiMicrophonePlugins,qt as createStream};
//# sourceMappingURL=/sm/cc31bbc9fcebbc36cea8f12501711cca5350dc9fcf669d8b72b40e568931a507.map