@genpact/genome.mfe.mgtwin-app 1.1.358-alpha → 1.1.359-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/{AssessmentAMA-ecd41ee4.mjs → AssessmentAMA-f4ee1092.mjs} +4 -4
  2. package/dist/{AssessmentSimulation-cc46928b.mjs → AssessmentSimulation-475bee26.mjs} +7 -7
  3. package/dist/{EditSkillAdminData-83ebdf14.mjs → EditSkillAdminData-fb293779.mjs} +2 -2
  4. package/dist/{EditSkillData-d08e1a8e.mjs → EditSkillData-02a11dce.mjs} +2 -2
  5. package/dist/{HomeView-7ea931c0.mjs → HomeView-ff9146bd.mjs} +5 -5
  6. package/dist/{Loading-8955b971.mjs → Loading-8b5bc980.mjs} +1 -1
  7. package/dist/{LoadingSimulation-82c1acb4.mjs → LoadingSimulation-c6134e66.mjs} +1 -1
  8. package/dist/{Modal-909d7ad3.mjs → Modal-4c062a21.mjs} +1 -1
  9. package/dist/{PaperAirplaneIcon-153f05dd.mjs → PaperAirplaneIcon-5628e238.mjs} +1 -1
  10. package/dist/{PromptTesting-f1097a19.mjs → PromptTesting-dcf9ed27.mjs} +3 -3
  11. package/dist/{SkillAutomation-b1c7adcc.mjs → SkillAutomation-eba53010.mjs} +3 -3
  12. package/dist/{SkillData-a0c04a9b.mjs → SkillData-c9ed69aa.mjs} +3 -3
  13. package/dist/{Testcase-120a7322.mjs → Testcase-11afbbd3.mjs} +3 -3
  14. package/dist/{UnderMaintenance-a34f4a46.mjs → UnderMaintenance-992d4832.mjs} +1 -1
  15. package/dist/{VoiceTestcase-e870121e.mjs → VoiceTestcase-4a4d52c4.mjs} +3 -3
  16. package/dist/{XMarkIcon-db545e94.mjs → XMarkIcon-3debd257.mjs} +1 -1
  17. package/dist/{api-e71ccb0d.mjs → api-dc566510.mjs} +1 -1
  18. package/dist/{index.es-862d965c.mjs → index.es-d1868bdf.mjs} +7 -7
  19. package/dist/{main-64c232c8.mjs → main-8ab9bb25.mjs} +214 -214
  20. package/dist/mgtwin.es.min.js +1 -1
  21. package/dist/mgtwin.umd.min.js +7 -7
  22. package/dist/style.css +1 -1
  23. package/dist/{voiceServices-6452f8ea.mjs → voiceServices-07b39220.mjs} +3 -3
  24. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- (function(kA){typeof define=="function"&&define.amd?define(kA):kA()})(function(){var Dn,tc,Ho,Ru,Du,ew,_i;"use strict";var e1e=Object.defineProperty;var t1e=(kA,Ft,ZA)=>Ft in kA?e1e(kA,Ft,{enumerable:!0,configurable:!0,writable:!0,value:ZA}):kA[Ft]=ZA;var Ht=(kA,Ft,ZA)=>(t1e(kA,typeof Ft!="symbol"?Ft+"":Ft,ZA),ZA),qG=(kA,Ft,ZA)=>{if(!Ft.has(kA))throw TypeError("Cannot "+ZA)};var eA=(kA,Ft,ZA)=>(qG(kA,Ft,"read from private field"),ZA?ZA.call(kA):Ft.get(kA)),Ic=(kA,Ft,ZA)=>{if(Ft.has(kA))throw TypeError("Cannot add the same private member more than once");Ft instanceof WeakSet?Ft.add(kA):Ft.set(kA,ZA)},oE=(kA,Ft,ZA,An)=>(qG(kA,Ft,"write to private field"),An?An.call(kA,ZA):Ft.set(kA,ZA),ZA);function kA(t,e){const A=Object.create(null),r=t.split(",");for(let i=0;i<r.length;i++)A[r[i]]=!0;return e?i=>!!A[i.toLowerCase()]:i=>!!A[i]}const Ft={},ZA=[],An=()=>{},dj=()=>!1,pj=/^on[^a-z]/,cE=t=>pj.test(t),Lw=t=>t.startsWith("onUpdate:"),Mr=Object.assign,Fw=(t,e)=>{const A=t.indexOf(e);A>-1&&t.splice(A,1)},fj=Object.prototype.hasOwnProperty,EA=(t,e)=>fj.call(t,e),vt=Array.isArray,_u=t=>Gh(t)==="[object Map]",$u=t=>Gh(t)==="[object Set]",pR=t=>Gh(t)==="[object Date]",Wt=t=>typeof t=="function",yr=t=>typeof t=="string",Ph=t=>typeof t=="symbol",OA=t=>t!==null&&typeof t=="object",fR=t=>OA(t)&&Wt(t.then)&&Wt(t.catch),ER=Object.prototype.toString,Gh=t=>ER.call(t),Ej=t=>Gh(t).slice(8,-1),CR=t=>Gh(t)==="[object Object]",Ow=t=>yr(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,uE=kA(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),lE=t=>{const e=Object.create(null);return A=>e[A]||(e[A]=t(A))},Cj=/-(\w)/g,el=lE(t=>t.replace(Cj,(e,A)=>A?A.toUpperCase():"")),Ij=/\B([A-Z])/g,Bc=lE(t=>t.replace(Ij,"-$1").toLowerCase()),IR=lE(t=>t.charAt(0).toUpperCase()+t.slice(1)),bw=lE(t=>t?`on${IR(t)}`:""),jh=(t,e)=>!Object.is(t,e),hE=(t,e)=>{for(let A=0;A<t.length;A++)t[A](e)},gE=(t,e,A)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:A})},dE=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Bj=t=>{const e=yr(t)?Number(t):NaN;return isNaN(e)?t:e};let BR;const xw=()=>BR||(BR=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Nw(t){if(vt(t)){const e={};for(let A=0;A<t.length;A++){const r=t[A],i=yr(r)?mj(r):Nw(r);if(i)for(const n in i)e[n]=i[n]}return e}else{if(yr(t))return t;if(OA(t))return t}}const vj=/;(?![^(]*\))/g,wj=/:([^]+)/,Sj=/\/\*[^]*?\*\//g;function mj(t){const e={};return t.replace(Sj,"").split(vj).forEach(A=>{if(A){const r=A.split(wj);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function mt(t){let e="";if(yr(t))e=t;else if(vt(t))for(let A=0;A<t.length;A++){const r=mt(t[A]);r&&(e+=r+" ")}else if(OA(t))for(const A in t)t[A]&&(e+=A+" ");return e.trim()}const Mj=kA("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function vR(t){return!!t||t===""}function yj(t,e){if(t.length!==e.length)return!1;let A=!0;for(let r=0;A&&r<t.length;r++)A=Yh(t[r],e[r]);return A}function Yh(t,e){if(t===e)return!0;let A=pR(t),r=pR(e);if(A||r)return A&&r?t.getTime()===e.getTime():!1;if(A=Ph(t),r=Ph(e),A||r)return t===e;if(A=vt(t),r=vt(e),A||r)return A&&r?yj(t,e):!1;if(A=OA(t),r=OA(e),A||r){if(!A||!r)return!1;const i=Object.keys(t).length,n=Object.keys(e).length;if(i!==n)return!1;for(const o in t){const s=t.hasOwnProperty(o),a=e.hasOwnProperty(o);if(s&&!a||!s&&a||!Yh(t[o],e[o]))return!1}}return String(t)===String(e)}function Kw(t,e){return t.findIndex(A=>Yh(A,e))}const bt=t=>yr(t)?t:t==null?"":vt(t)||OA(t)&&(t.toString===ER||!Wt(t.toString))?JSON.stringify(t,wR,2):String(t),wR=(t,e)=>e&&e.__v_isRef?wR(t,e.value):_u(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((A,[r,i])=>(A[`${r} =>`]=i,A),{})}:$u(e)?{[`Set(${e.size})`]:[...e.values()]}:OA(e)&&!vt(e)&&!CR(e)?String(e):e;let In;class SR{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=In,!e&&In&&(this.index=(In.scopes||(In.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const A=In;try{return In=this,e()}finally{In=A}}}on(){In=this}off(){In=this.parent}stop(e){if(this._active){let A,r;for(A=0,r=this.effects.length;A<r;A++)this.effects[A].stop();for(A=0,r=this.cleanups.length;A<r;A++)this.cleanups[A]();if(this.scopes)for(A=0,r=this.scopes.length;A<r;A++)this.scopes[A].stop(!0);if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function mR(t){return new SR(t)}function Qj(t,e=In){e&&e.active&&e.effects.push(t)}function MR(){return In}function Rj(t){In&&In.cleanups.push(t)}const kw=t=>{const e=new Set(t);return e.w=0,e.n=0,e},yR=t=>(t.w&Aa)>0,QR=t=>(t.n&Aa)>0,Dj=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=Aa},Tj=t=>{const{deps:e}=t;if(e.length){let A=0;for(let r=0;r<e.length;r++){const i=e[r];yR(i)&&!QR(i)?i.delete(t):e[A++]=i,i.w&=~Aa,i.n&=~Aa}e.length=A}},pE=new WeakMap;let Hh=0,Aa=1;const Pw=30;let os;const vc=Symbol(""),Gw=Symbol("");class jw{constructor(e,A=null,r){this.fn=e,this.scheduler=A,this.active=!0,this.deps=[],this.parent=void 0,Qj(this,r)}run(){if(!this.active)return this.fn();let e=os,A=ra;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=os,os=this,ra=!0,Aa=1<<++Hh,Hh<=Pw?Dj(this):RR(this),this.fn()}finally{Hh<=Pw&&Tj(this),Aa=1<<--Hh,os=this.parent,ra=A,this.parent=void 0,this.deferStop&&this.stop()}}stop(){os===this?this.deferStop=!0:this.active&&(RR(this),this.onStop&&this.onStop(),this.active=!1)}}function RR(t){const{deps:e}=t;if(e.length){for(let A=0;A<e.length;A++)e[A].delete(t);e.length=0}}let ra=!0;const DR=[];function tl(){DR.push(ra),ra=!1}function Al(){const t=DR.pop();ra=t===void 0?!0:t}function rn(t,e,A){if(ra&&os){let r=pE.get(t);r||pE.set(t,r=new Map);let i=r.get(A);i||r.set(A,i=kw()),TR(i)}}function TR(t,e){let A=!1;Hh<=Pw?QR(t)||(t.n|=Aa,A=!yR(t)):A=!t.has(os),A&&(t.add(os),os.deps.push(t))}function no(t,e,A,r,i,n){const o=pE.get(t);if(!o)return;let s=[];if(e==="clear")s=[...o.values()];else if(A==="length"&&vt(t)){const a=Number(r);o.forEach((c,u)=>{(u==="length"||u>=a)&&s.push(c)})}else switch(A!==void 0&&s.push(o.get(A)),e){case"add":vt(t)?Ow(A)&&s.push(o.get("length")):(s.push(o.get(vc)),_u(t)&&s.push(o.get(Gw)));break;case"delete":vt(t)||(s.push(o.get(vc)),_u(t)&&s.push(o.get(Gw)));break;case"set":_u(t)&&s.push(o.get(vc));break}if(s.length===1)s[0]&&Yw(s[0]);else{const a=[];for(const c of s)c&&a.push(...c);Yw(kw(a))}}function Yw(t,e){const A=vt(t)?t:[...t];for(const r of A)r.computed&&UR(r);for(const r of A)r.computed||UR(r)}function UR(t,e){(t!==os||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function Uj(t,e){var A;return(A=pE.get(t))==null?void 0:A.get(e)}const Lj=kA("__proto__,__v_isRef,__isVue"),LR=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ph)),Fj=Hw(),Oj=Hw(!1,!0),bj=Hw(!0),FR=xj();function xj(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...A){const r=gA(this);for(let n=0,o=this.length;n<o;n++)rn(r,"get",n+"");const i=r[e](...A);return i===-1||i===!1?r[e](...A.map(gA)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...A){tl();const r=gA(this)[e].apply(this,A);return Al(),r}}),t}function Nj(t){const e=gA(this);return rn(e,"has",t),e.hasOwnProperty(t)}function Hw(t=!1,e=!1){return function(r,i,n){if(i==="__v_isReactive")return!t;if(i==="__v_isReadonly")return t;if(i==="__v_isShallow")return e;if(i==="__v_raw"&&n===(t?e?$j:jR:e?GR:PR).get(r))return r;const o=vt(r);if(!t){if(o&&EA(FR,i))return Reflect.get(FR,i,n);if(i==="hasOwnProperty")return Nj}const s=Reflect.get(r,i,n);return(Ph(i)?LR.has(i):Lj(i))||(t||rn(r,"get",i),e)?s:hr(s)?o&&Ow(i)?s:s.value:OA(s)?t?YR(s):rl(s):s}}const Kj=OR(),kj=OR(!0);function OR(t=!1){return function(A,r,i,n){let o=A[r];if(il(o)&&hr(o)&&!hr(i))return!1;if(!t&&(!wE(i)&&!il(i)&&(o=gA(o),i=gA(i)),!vt(A)&&hr(o)&&!hr(i)))return o.value=i,!0;const s=vt(A)&&Ow(r)?Number(r)<A.length:EA(A,r),a=Reflect.set(A,r,i,n);return A===gA(n)&&(s?jh(i,o)&&no(A,"set",r,i):no(A,"add",r,i)),a}}function Pj(t,e){const A=EA(t,e);t[e];const r=Reflect.deleteProperty(t,e);return r&&A&&no(t,"delete",e,void 0),r}function Gj(t,e){const A=Reflect.has(t,e);return(!Ph(e)||!LR.has(e))&&rn(t,"has",e),A}function jj(t){return rn(t,"iterate",vt(t)?"length":vc),Reflect.ownKeys(t)}const bR={get:Fj,set:Kj,deleteProperty:Pj,has:Gj,ownKeys:jj},Yj={get:bj,set(t,e){return!0},deleteProperty(t,e){return!0}},Hj=Mr({},bR,{get:Oj,set:kj}),zw=t=>t,fE=t=>Reflect.getPrototypeOf(t);function EE(t,e,A=!1,r=!1){t=t.__v_raw;const i=gA(t),n=gA(e);A||(e!==n&&rn(i,"get",e),rn(i,"get",n));const{has:o}=fE(i),s=r?zw:A?Vw:zh;if(o.call(i,e))return s(t.get(e));if(o.call(i,n))return s(t.get(n));t!==i&&t.get(e)}function CE(t,e=!1){const A=this.__v_raw,r=gA(A),i=gA(t);return e||(t!==i&&rn(r,"has",t),rn(r,"has",i)),t===i?A.has(t):A.has(t)||A.has(i)}function IE(t,e=!1){return t=t.__v_raw,!e&&rn(gA(t),"iterate",vc),Reflect.get(t,"size",t)}function xR(t){t=gA(t);const e=gA(this);return fE(e).has.call(e,t)||(e.add(t),no(e,"add",t,t)),this}function NR(t,e){e=gA(e);const A=gA(this),{has:r,get:i}=fE(A);let n=r.call(A,t);n||(t=gA(t),n=r.call(A,t));const o=i.call(A,t);return A.set(t,e),n?jh(e,o)&&no(A,"set",t,e):no(A,"add",t,e),this}function KR(t){const e=gA(this),{has:A,get:r}=fE(e);let i=A.call(e,t);i||(t=gA(t),i=A.call(e,t)),r&&r.call(e,t);const n=e.delete(t);return i&&no(e,"delete",t,void 0),n}function kR(){const t=gA(this),e=t.size!==0,A=t.clear();return e&&no(t,"clear",void 0,void 0),A}function BE(t,e){return function(r,i){const n=this,o=n.__v_raw,s=gA(o),a=e?zw:t?Vw:zh;return!t&&rn(s,"iterate",vc),o.forEach((c,u)=>r.call(i,a(c),a(u),n))}}function vE(t,e,A){return function(...r){const i=this.__v_raw,n=gA(i),o=_u(n),s=t==="entries"||t===Symbol.iterator&&o,a=t==="keys"&&o,c=i[t](...r),u=A?zw:e?Vw:zh;return!e&&rn(n,"iterate",a?Gw:vc),{next(){const{value:l,done:g}=c.next();return g?{value:l,done:g}:{value:s?[u(l[0]),u(l[1])]:u(l),done:g}},[Symbol.iterator](){return this}}}}function ia(t){return function(...e){return t==="delete"?!1:this}}function zj(){const t={get(n){return EE(this,n)},get size(){return IE(this)},has:CE,add:xR,set:NR,delete:KR,clear:kR,forEach:BE(!1,!1)},e={get(n){return EE(this,n,!1,!0)},get size(){return IE(this)},has:CE,add:xR,set:NR,delete:KR,clear:kR,forEach:BE(!1,!0)},A={get(n){return EE(this,n,!0)},get size(){return IE(this,!0)},has(n){return CE.call(this,n,!0)},add:ia("add"),set:ia("set"),delete:ia("delete"),clear:ia("clear"),forEach:BE(!0,!1)},r={get(n){return EE(this,n,!0,!0)},get size(){return IE(this,!0)},has(n){return CE.call(this,n,!0)},add:ia("add"),set:ia("set"),delete:ia("delete"),clear:ia("clear"),forEach:BE(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=vE(n,!1,!1),A[n]=vE(n,!0,!1),e[n]=vE(n,!1,!0),r[n]=vE(n,!0,!0)}),[t,A,e,r]}const[Jj,qj,Vj,Wj]=zj();function Jw(t,e){const A=e?t?Wj:Vj:t?qj:Jj;return(r,i,n)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(EA(A,i)&&i in r?A:r,i,n)}const Zj={get:Jw(!1,!1)},Xj={get:Jw(!1,!0)},_j={get:Jw(!0,!1)},PR=new WeakMap,GR=new WeakMap,jR=new WeakMap,$j=new WeakMap;function e8(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function t8(t){return t.__v_skip||!Object.isExtensible(t)?0:e8(Ej(t))}function rl(t){return il(t)?t:qw(t,!1,bR,Zj,PR)}function A8(t){return qw(t,!1,Hj,Xj,GR)}function YR(t){return qw(t,!0,Yj,_j,jR)}function qw(t,e,A,r,i){if(!OA(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const n=i.get(t);if(n)return n;const o=t8(t);if(o===0)return t;const s=new Proxy(t,o===2?r:A);return i.set(t,s),s}function na(t){return il(t)?na(t.__v_raw):!!(t&&t.__v_isReactive)}function il(t){return!!(t&&t.__v_isReadonly)}function wE(t){return!!(t&&t.__v_isShallow)}function HR(t){return na(t)||il(t)}function gA(t){const e=t&&t.__v_raw;return e?gA(e):t}function SE(t){return gE(t,"__v_skip",!0),t}const zh=t=>OA(t)?rl(t):t,Vw=t=>OA(t)?YR(t):t;function zR(t){ra&&os&&(t=gA(t),TR(t.dep||(t.dep=kw())))}function JR(t,e){t=gA(t);const A=t.dep;A&&Yw(A)}function hr(t){return!!(t&&t.__v_isRef===!0)}function ne(t){return qR(t,!1)}function r8(t){return qR(t,!0)}function qR(t,e){return hr(t)?t:new i8(t,e)}class i8{constructor(e,A){this.__v_isShallow=A,this.dep=void 0,this.__v_isRef=!0,this._rawValue=A?e:gA(e),this._value=A?e:zh(e)}get value(){return zR(this),this._value}set value(e){const A=this.__v_isShallow||wE(e)||il(e);e=A?e:gA(e),jh(e,this._rawValue)&&(this._rawValue=e,this._value=A?e:zh(e),JR(this))}}function fe(t){return hr(t)?t.value:t}const n8={get:(t,e,A)=>fe(Reflect.get(t,e,A)),set:(t,e,A,r)=>{const i=t[e];return hr(i)&&!hr(A)?(i.value=A,!0):Reflect.set(t,e,A,r)}};function VR(t){return na(t)?t:new Proxy(t,n8)}function s8(t){const e=vt(t)?new Array(t.length):{};for(const A in t)e[A]=a8(t,A);return e}class o8{constructor(e,A,r){this._object=e,this._key=A,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Uj(gA(this._object),this._key)}}function a8(t,e,A){const r=t[e];return hr(r)?r:new o8(t,e,A)}class c8{constructor(e,A,r,i){this._setter=A,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new jw(e,()=>{this._dirty||(this._dirty=!0,JR(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=gA(this);return zR(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function u8(t,e,A=!1){let r,i;const n=Wt(t);return n?(r=t,i=An):(r=t.get,i=t.set),new c8(r,i,n||!i,A)}function r1e(t,...e){}function sa(t,e,A,r){let i;try{i=r?t(...r):t()}catch(n){mE(n,e,A)}return i}function Kn(t,e,A,r){if(Wt(t)){const n=sa(t,e,A,r);return n&&fR(n)&&n.catch(o=>{mE(o,e,A)}),n}const i=[];for(let n=0;n<t.length;n++)i.push(Kn(t[n],e,A,r));return i}function mE(t,e,A,r=!0){const i=e?e.vnode:null;if(e){let n=e.parent;const o=e.proxy,s=A;for(;n;){const c=n.ec;if(c){for(let u=0;u<c.length;u++)if(c[u](t,o,s)===!1)return}n=n.parent}const a=e.appContext.config.errorHandler;if(a){sa(a,null,10,[t,o,s]);return}}l8(t,A,i,r)}function l8(t,e,A,r=!0){console.error(t)}let Jh=!1,Ww=!1;const wi=[];let Fs=0;const nl=[];let so=null,wc=0;const WR=Promise.resolve();let Zw=null;function Xw(t){const e=Zw||WR;return t?e.then(this?t.bind(this):t):e}function h8(t){let e=Fs+1,A=wi.length;for(;e<A;){const r=e+A>>>1;qh(wi[r])<t?e=r+1:A=r}return e}function _w(t){(!wi.length||!wi.includes(t,Jh&&t.allowRecurse?Fs+1:Fs))&&(t.id==null?wi.push(t):wi.splice(h8(t.id),0,t),ZR())}function ZR(){!Jh&&!Ww&&(Ww=!0,Zw=WR.then($R))}function g8(t){const e=wi.indexOf(t);e>Fs&&wi.splice(e,1)}function d8(t){vt(t)?nl.push(...t):(!so||!so.includes(t,t.allowRecurse?wc+1:wc))&&nl.push(t),ZR()}function XR(t,e=Jh?Fs+1:0){for(;e<wi.length;e++){const A=wi[e];A&&A.pre&&(wi.splice(e,1),e--,A())}}function _R(t){if(nl.length){const e=[...new Set(nl)];if(nl.length=0,so){so.push(...e);return}for(so=e,so.sort((A,r)=>qh(A)-qh(r)),wc=0;wc<so.length;wc++)so[wc]();so=null,wc=0}}const qh=t=>t.id==null?1/0:t.id,p8=(t,e)=>{const A=qh(t)-qh(e);if(A===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return A};function $R(t){Ww=!1,Jh=!0,wi.sort(p8);const e=An;try{for(Fs=0;Fs<wi.length;Fs++){const A=wi[Fs];A&&A.active!==!1&&sa(A,null,14)}}finally{Fs=0,wi.length=0,_R(),Jh=!1,Zw=null,(wi.length||nl.length)&&$R()}}function f8(t,e,...A){if(t.isUnmounted)return;const r=t.vnode.props||Ft;let i=A;const n=e.startsWith("update:"),o=n&&e.slice(7);if(o&&o in r){const u=`${o==="modelValue"?"model":o}Modifiers`,{number:l,trim:g}=r[u]||Ft;g&&(i=A.map(h=>yr(h)?h.trim():h)),l&&(i=A.map(dE))}let s,a=r[s=bw(e)]||r[s=bw(el(e))];!a&&n&&(a=r[s=bw(Bc(e))]),a&&Kn(a,t,6,i);const c=r[s+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[s])return;t.emitted[s]=!0,Kn(c,t,6,i)}}function eD(t,e,A=!1){const r=e.emitsCache,i=r.get(t);if(i!==void 0)return i;const n=t.emits;let o={},s=!1;if(!Wt(t)){const a=c=>{const u=eD(c,e,!0);u&&(s=!0,Mr(o,u))};!A&&e.mixins.length&&e.mixins.forEach(a),t.extends&&a(t.extends),t.mixins&&t.mixins.forEach(a)}return!n&&!s?(OA(t)&&r.set(t,null),null):(vt(n)?n.forEach(a=>o[a]=null):Mr(o,n),OA(t)&&r.set(t,o),o)}function ME(t,e){return!t||!cE(e)?!1:(e=e.slice(2).replace(/Once$/,""),EA(t,e[0].toLowerCase()+e.slice(1))||EA(t,Bc(e))||EA(t,e))}let ni=null,yE=null;function QE(t){const e=ni;return ni=t,yE=t&&t.type.__scopeId||null,e}function xr(t){yE=t}function Nr(){yE=null}function nn(t,e=ni,A){if(!e||t._n)return t;const r=(...i)=>{r._d&&DD(-1);const n=QE(e);let o;try{o=t(...i)}finally{QE(n),r._d&&DD(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function i1e(){}function $w(t){const{type:e,vnode:A,proxy:r,withProxy:i,props:n,propsOptions:[o],slots:s,attrs:a,emit:c,render:u,renderCache:l,data:g,setupState:h,ctx:p,inheritAttrs:C}=t;let I,E;const v=QE(t);try{if(A.shapeFlag&4){const M=i||r;I=Os(u.call(M,M,l,n,h,g,p)),E=a}else{const M=e;I=Os(M.length>1?M(n,{attrs:a,slots:s,emit:c}):M(n,null)),E=e.props?a:E8(a)}}catch(M){$h.length=0,mE(M,t,1),I=ot(Pn)}let m=I;if(E&&C!==!1){const M=Object.keys(E),{shapeFlag:O}=m;M.length&&O&7&&(o&&M.some(Lw)&&(E=C8(E,o)),m=oa(m,E))}return A.dirs&&(m=oa(m),m.dirs=m.dirs?m.dirs.concat(A.dirs):A.dirs),A.transition&&(m.transition=A.transition),I=m,QE(v),I}const E8=t=>{let e;for(const A in t)(A==="class"||A==="style"||cE(A))&&((e||(e={}))[A]=t[A]);return e},C8=(t,e)=>{const A={};for(const r in t)(!Lw(r)||!(r.slice(9)in e))&&(A[r]=t[r]);return A};function I8(t,e,A){const{props:r,children:i,component:n}=t,{props:o,children:s,patchFlag:a}=e,c=n.emitsOptions;if(e.dirs||e.transition)return!0;if(A&&a>=0){if(a&1024)return!0;if(a&16)return r?tD(r,o,c):!!o;if(a&8){const u=e.dynamicProps;for(let l=0;l<u.length;l++){const g=u[l];if(o[g]!==r[g]&&!ME(c,g))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?tD(r,o,c):!0:!!o;return!1}function tD(t,e,A){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let i=0;i<r.length;i++){const n=r[i];if(e[n]!==t[n]&&!ME(A,n))return!0}return!1}function B8({vnode:t,parent:e},A){for(;e&&e.subTree===t;)(t=e.vnode).el=A,e=e.parent}const v8=t=>t.__isSuspense;function w8(t,e){e&&e.pendingBranch?vt(t)?e.effects.push(...t):e.effects.push(t):d8(t)}const RE={};function oo(t,e,A){return AD(t,e,A)}function AD(t,e,{immediate:A,deep:r,flush:i,onTrack:n,onTrigger:o}=Ft){var s;const a=MR()===((s=qr)==null?void 0:s.scope)?qr:null;let c,u=!1,l=!1;if(hr(t)?(c=()=>t.value,u=wE(t)):na(t)?(c=()=>t,r=!0):vt(t)?(l=!0,u=t.some(M=>na(M)||wE(M)),c=()=>t.map(M=>{if(hr(M))return M.value;if(na(M))return Sc(M);if(Wt(M))return sa(M,a,2)})):Wt(t)?e?c=()=>sa(t,a,2):c=()=>{if(!(a&&a.isUnmounted))return g&&g(),Kn(t,a,3,[h])}:c=An,e&&r){const M=c;c=()=>Sc(M())}let g,h=M=>{g=v.onStop=()=>{sa(M,a,4)}},p;if(tg)if(h=An,e?A&&Kn(e,a,3,[c(),l?[]:void 0,h]):c(),i==="sync"){const M=gY();p=M.__watcherHandles||(M.__watcherHandles=[])}else return An;let C=l?new Array(t.length).fill(RE):RE;const I=()=>{if(v.active)if(e){const M=v.run();(r||u||(l?M.some((O,x)=>jh(O,C[x])):jh(M,C)))&&(g&&g(),Kn(e,a,3,[M,C===RE?void 0:l&&C[0]===RE?[]:C,h]),C=M)}else v.run()};I.allowRecurse=!!e;let E;i==="sync"?E=I:i==="post"?E=()=>on(I,a&&a.suspense):(I.pre=!0,a&&(I.id=a.uid),E=()=>_w(I));const v=new jw(c,E);e?A?I():C=v.run():i==="post"?on(v.run.bind(v),a&&a.suspense):v.run();const m=()=>{v.stop(),a&&a.scope&&Fw(a.scope.effects,v)};return p&&p.push(m),m}function S8(t,e,A){const r=this.proxy,i=yr(t)?t.includes(".")?rD(r,t):()=>r[t]:t.bind(r,r);let n;Wt(e)?n=e:(n=e.handler,A=e);const o=qr;al(this);const s=AD(i,n.bind(r),A);return o?al(o):Qc(),s}function rD(t,e){const A=e.split(".");return()=>{let r=t;for(let i=0;i<A.length&&r;i++)r=r[A[i]];return r}}function Sc(t,e){if(!OA(t)||t.__v_skip||(e=e||new Set,e.has(t)))return t;if(e.add(t),hr(t))Sc(t.value,e);else if(vt(t))for(let A=0;A<t.length;A++)Sc(t[A],e);else if($u(t)||_u(t))t.forEach(A=>{Sc(A,e)});else if(CR(t))for(const A in t)Sc(t[A],e);return t}function tA(t,e){const A=ni;if(A===null)return t;const r=kE(A)||A.proxy,i=t.dirs||(t.dirs=[]);for(let n=0;n<e.length;n++){let[o,s,a,c=Ft]=e[n];o&&(Wt(o)&&(o={mounted:o,updated:o}),o.deep&&Sc(s),i.push({dir:o,instance:r,value:s,oldValue:void 0,arg:a,modifiers:c}))}return t}function mc(t,e,A,r){const i=t.dirs,n=e&&e.dirs;for(let o=0;o<i.length;o++){const s=i[o];n&&(s.oldValue=n[o].value);let a=s.dir[r];a&&(tl(),Kn(a,A,8,[t.el,s,t,e]),Al())}}function m8(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sn(()=>{t.isMounted=!0}),Wh(()=>{t.isUnmounting=!0}),t}const kn=[Function,Array],iD={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:kn,onEnter:kn,onAfterEnter:kn,onEnterCancelled:kn,onBeforeLeave:kn,onLeave:kn,onAfterLeave:kn,onLeaveCancelled:kn,onBeforeAppear:kn,onAppear:kn,onAfterAppear:kn,onAppearCancelled:kn},M8={name:"BaseTransition",props:iD,setup(t,{slots:e}){const A=sY(),r=m8();let i;return()=>{const n=e.default&&oD(e.default(),!0);if(!n||!n.length)return;let o=n[0];if(n.length>1){for(const C of n)if(C.type!==Pn){o=C;break}}const s=gA(t),{mode:a}=s;if(r.isLeaving)return tS(o);const c=sD(o);if(!c)return tS(o);const u=eS(c,s,r,A);AS(c,u);const l=A.subTree,g=l&&sD(l);let h=!1;const{getTransitionKey:p}=c.type;if(p){const C=p();i===void 0?i=C:C!==i&&(i=C,h=!0)}if(g&&g.type!==Pn&&(!yc(c,g)||h)){const C=eS(g,s,r,A);if(AS(g,C),a==="out-in")return r.isLeaving=!0,C.afterLeave=()=>{r.isLeaving=!1,A.update.active!==!1&&A.update()},tS(o);a==="in-out"&&c.type!==Pn&&(C.delayLeave=(I,E,v)=>{const m=nD(r,g);m[String(g.key)]=g,I._leaveCb=()=>{E(),I._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=v})}return o}}};function nD(t,e){const{leavingVNodes:A}=t;let r=A.get(e.type);return r||(r=Object.create(null),A.set(e.type,r)),r}function eS(t,e,A,r){const{appear:i,mode:n,persisted:o=!1,onBeforeEnter:s,onEnter:a,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:l,onLeave:g,onAfterLeave:h,onLeaveCancelled:p,onBeforeAppear:C,onAppear:I,onAfterAppear:E,onAppearCancelled:v}=e,m=String(t.key),M=nD(A,t),O=(D,T)=>{D&&Kn(D,r,9,T)},x=(D,T)=>{const q=T[1];O(D,T),vt(D)?D.every(Q=>Q.length<=1)&&q():D.length<=1&&q()},P={mode:n,persisted:o,beforeEnter(D){let T=s;if(!A.isMounted)if(i)T=C||s;else return;D._leaveCb&&D._leaveCb(!0);const q=M[m];q&&yc(t,q)&&q.el._leaveCb&&q.el._leaveCb(),O(T,[D])},enter(D){let T=a,q=c,Q=u;if(!A.isMounted)if(i)T=I||a,q=E||c,Q=v||u;else return;let R=!1;const G=D._enterCb=k=>{R||(R=!0,k?O(Q,[D]):O(q,[D]),P.delayedLeave&&P.delayedLeave(),D._enterCb=void 0)};T?x(T,[D,G]):G()},leave(D,T){const q=String(t.key);if(D._enterCb&&D._enterCb(!0),A.isUnmounting)return T();O(l,[D]);let Q=!1;const R=D._leaveCb=G=>{Q||(Q=!0,T(),G?O(p,[D]):O(h,[D]),D._leaveCb=void 0,M[q]===t&&delete M[q])};M[q]=t,g?x(g,[D,R]):R()},clone(D){return eS(D,e,A,r)}};return P}function tS(t){if(DE(t))return t=oa(t),t.children=null,t}function sD(t){return DE(t)?t.children?t.children[0]:void 0:t}function AS(t,e){t.shapeFlag&6&&t.component?AS(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function oD(t,e=!1,A){let r=[],i=0;for(let n=0;n<t.length;n++){let o=t[n];const s=A==null?o.key:String(A)+String(o.key!=null?o.key:n);o.type===aA?(o.patchFlag&128&&i++,r=r.concat(oD(o.children,e,s))):(e||o.type!==Pn)&&r.push(s!=null?oa(o,{key:s}):o)}if(i>1)for(let n=0;n<r.length;n++)r[n].patchFlag=-2;return r}function Zt(t,e){return Wt(t)?(()=>Mr({name:t.name},e,{setup:t}))():t}const Vh=t=>!!t.type.__asyncLoader,DE=t=>t.type.__isKeepAlive;function y8(t,e){aD(t,"a",e)}function Q8(t,e){aD(t,"da",e)}function aD(t,e,A=qr){const r=t.__wdc||(t.__wdc=()=>{let i=A;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(TE(e,r,A),A){let i=A.parent;for(;i&&i.parent;)DE(i.parent.vnode)&&R8(r,e,A,i),i=i.parent}}function R8(t,e,A,r){const i=TE(e,t,r,!0);uD(()=>{Fw(r[e],i)},A)}function TE(t,e,A=qr,r=!1){if(A){const i=A[t]||(A[t]=[]),n=e.__weh||(e.__weh=(...o)=>{if(A.isUnmounted)return;tl(),al(A);const s=Kn(e,A,t,o);return Qc(),Al(),s});return r?i.unshift(n):i.push(n),n}}const ao=t=>(e,A=qr)=>(!tg||t==="sp")&&TE(t,(...r)=>e(...r),A),cD=ao("bm"),sn=ao("m"),D8=ao("bu"),UE=ao("u"),Wh=ao("bum"),uD=ao("um"),T8=ao("sp"),U8=ao("rtg"),L8=ao("rtc");function F8(t,e=qr){TE("ec",t,e)}const O8=Symbol.for("v-ndc");function Si(t,e,A,r){let i;const n=A&&A[r];if(vt(t)||yr(t)){i=new Array(t.length);for(let o=0,s=t.length;o<s;o++)i[o]=e(t[o],o,void 0,n&&n[o])}else if(typeof t=="number"){i=new Array(t);for(let o=0;o<t;o++)i[o]=e(o+1,o,void 0,n&&n[o])}else if(OA(t))if(t[Symbol.iterator])i=Array.from(t,(o,s)=>e(o,s,void 0,n&&n[s]));else{const o=Object.keys(t);i=new Array(o.length);for(let s=0,a=o.length;s<a;s++){const c=o[s];i[s]=e(t[c],c,s,n&&n[s])}}else i=[];return A&&(A[r]=i),i}function lD(t,e,A={},r,i){if(ni.isCE||ni.parent&&Vh(ni.parent)&&ni.parent.isCE)return e!=="default"&&(A.name=e),ot("slot",A,r&&r());let n=t[e];n&&n._c&&(n._d=!1),ue();const o=n&&hD(n(A)),s=co(aA,{key:A.key||o&&o.key||`_${e}`},o||(r?r():[]),o&&t._===1?64:-2);return!i&&s.scopeId&&(s.slotScopeIds=[s.scopeId+"-s"]),n&&n._c&&(n._d=!0),s}function hD(t){return t.some(e=>xE(e)?!(e.type===Pn||e.type===aA&&!hD(e.children)):!0)?t:null}const rS=t=>t?FD(t)?kE(t)||t.proxy:rS(t.parent):null,Zh=Mr(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>rS(t.parent),$root:t=>rS(t.root),$emit:t=>t.emit,$options:t=>sS(t),$forceUpdate:t=>t.f||(t.f=()=>_w(t.update)),$nextTick:t=>t.n||(t.n=Xw.bind(t.proxy)),$watch:t=>S8.bind(t)}),iS=(t,e)=>t!==Ft&&!t.__isScriptSetup&&EA(t,e),b8={get({_:t},e){const{ctx:A,setupState:r,data:i,props:n,accessCache:o,type:s,appContext:a}=t;let c;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return r[e];case 2:return i[e];case 4:return A[e];case 3:return n[e]}else{if(iS(r,e))return o[e]=1,r[e];if(i!==Ft&&EA(i,e))return o[e]=2,i[e];if((c=t.propsOptions[0])&&EA(c,e))return o[e]=3,n[e];if(A!==Ft&&EA(A,e))return o[e]=4,A[e];nS&&(o[e]=0)}}const u=Zh[e];let l,g;if(u)return e==="$attrs"&&rn(t,"get",e),u(t);if((l=s.__cssModules)&&(l=l[e]))return l;if(A!==Ft&&EA(A,e))return o[e]=4,A[e];if(g=a.config.globalProperties,EA(g,e))return g[e]},set({_:t},e,A){const{data:r,setupState:i,ctx:n}=t;return iS(i,e)?(i[e]=A,!0):r!==Ft&&EA(r,e)?(r[e]=A,!0):EA(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(n[e]=A,!0)},has({_:{data:t,setupState:e,accessCache:A,ctx:r,appContext:i,propsOptions:n}},o){let s;return!!A[o]||t!==Ft&&EA(t,o)||iS(e,o)||(s=n[0])&&EA(s,o)||EA(r,o)||EA(Zh,o)||EA(i.config.globalProperties,o)},defineProperty(t,e,A){return A.get!=null?t._.accessCache[e]=0:EA(A,"value")&&this.set(t,e,A.value,null),Reflect.defineProperty(t,e,A)}};function gD(t){return vt(t)?t.reduce((e,A)=>(e[A]=null,e),{}):t}let nS=!0;function x8(t){const e=sS(t),A=t.proxy,r=t.ctx;nS=!1,e.beforeCreate&&dD(e.beforeCreate,t,"bc");const{data:i,computed:n,methods:o,watch:s,provide:a,inject:c,created:u,beforeMount:l,mounted:g,beforeUpdate:h,updated:p,activated:C,deactivated:I,beforeDestroy:E,beforeUnmount:v,destroyed:m,unmounted:M,render:O,renderTracked:x,renderTriggered:P,errorCaptured:D,serverPrefetch:T,expose:q,inheritAttrs:Q,components:R,directives:G,filters:k}=e;if(c&&N8(c,r,null),o)for(const ie in o){const W=o[ie];Wt(W)&&(r[ie]=W.bind(A))}if(i){const ie=i.call(A,A);OA(ie)&&(t.data=rl(ie))}if(nS=!0,n)for(const ie in n){const W=n[ie],se=Wt(W)?W.bind(A,A):Wt(W.get)?W.get.bind(A,A):An,Be=!Wt(W)&&Wt(W.set)?W.set.bind(A):An,Ee=er({get:se,set:Be});Object.defineProperty(r,ie,{enumerable:!0,configurable:!0,get:()=>Ee.value,set:U=>Ee.value=U})}if(s)for(const ie in s)pD(s[ie],r,A,ie);if(a){const ie=Wt(a)?a.call(A):a;Reflect.ownKeys(ie).forEach(W=>{FE(W,ie[W])})}u&&dD(u,t,"c");function X(ie,W){vt(W)?W.forEach(se=>ie(se.bind(A))):W&&ie(W.bind(A))}if(X(cD,l),X(sn,g),X(D8,h),X(UE,p),X(y8,C),X(Q8,I),X(F8,D),X(L8,x),X(U8,P),X(Wh,v),X(uD,M),X(T8,T),vt(q))if(q.length){const ie=t.exposed||(t.exposed={});q.forEach(W=>{Object.defineProperty(ie,W,{get:()=>A[W],set:se=>A[W]=se})})}else t.exposed||(t.exposed={});O&&t.render===An&&(t.render=O),Q!=null&&(t.inheritAttrs=Q),R&&(t.components=R),G&&(t.directives=G)}function N8(t,e,A=An){vt(t)&&(t=oS(t));for(const r in t){const i=t[r];let n;OA(i)?"default"in i?n=as(i.from||r,i.default,!0):n=as(i.from||r):n=as(i),hr(n)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>n.value,set:o=>n.value=o}):e[r]=n}}function dD(t,e,A){Kn(vt(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,A)}function pD(t,e,A,r){const i=r.includes(".")?rD(A,r):()=>A[r];if(yr(t)){const n=e[t];Wt(n)&&oo(i,n)}else if(Wt(t))oo(i,t.bind(A));else if(OA(t))if(vt(t))t.forEach(n=>pD(n,e,A,r));else{const n=Wt(t.handler)?t.handler.bind(A):e[t.handler];Wt(n)&&oo(i,n,t)}}function sS(t){const e=t.type,{mixins:A,extends:r}=e,{mixins:i,optionsCache:n,config:{optionMergeStrategies:o}}=t.appContext,s=n.get(e);let a;return s?a=s:!i.length&&!A&&!r?a=e:(a={},i.length&&i.forEach(c=>LE(a,c,o,!0)),LE(a,e,o)),OA(e)&&n.set(e,a),a}function LE(t,e,A,r=!1){const{mixins:i,extends:n}=e;n&&LE(t,n,A,!0),i&&i.forEach(o=>LE(t,o,A,!0));for(const o in e)if(!(r&&o==="expose")){const s=K8[o]||A&&A[o];t[o]=s?s(t[o],e[o]):e[o]}return t}const K8={data:fD,props:ED,emits:ED,methods:Xh,computed:Xh,beforeCreate:ji,created:ji,beforeMount:ji,mounted:ji,beforeUpdate:ji,updated:ji,beforeDestroy:ji,beforeUnmount:ji,destroyed:ji,unmounted:ji,activated:ji,deactivated:ji,errorCaptured:ji,serverPrefetch:ji,components:Xh,directives:Xh,watch:P8,provide:fD,inject:k8};function fD(t,e){return e?t?function(){return Mr(Wt(t)?t.call(this,this):t,Wt(e)?e.call(this,this):e)}:e:t}function k8(t,e){return Xh(oS(t),oS(e))}function oS(t){if(vt(t)){const e={};for(let A=0;A<t.length;A++)e[t[A]]=t[A];return e}return t}function ji(t,e){return t?[...new Set([].concat(t,e))]:e}function Xh(t,e){return t?Mr(Object.create(null),t,e):e}function ED(t,e){return t?vt(t)&&vt(e)?[...new Set([...t,...e])]:Mr(Object.create(null),gD(t),gD(e??{})):e}function P8(t,e){if(!t)return e;if(!e)return t;const A=Mr(Object.create(null),t);for(const r in e)A[r]=ji(t[r],e[r]);return A}function CD(){return{app:null,config:{isNativeTag:dj,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let G8=0;function j8(t,e){return function(r,i=null){Wt(r)||(r=Mr({},r)),i!=null&&!OA(i)&&(i=null);const n=CD(),o=new Set;let s=!1;const a=n.app={_uid:G8++,_component:r,_props:i,_container:null,_context:n,_instance:null,version:dY,get config(){return n.config},set config(c){},use(c,...u){return o.has(c)||(c&&Wt(c.install)?(o.add(c),c.install(a,...u)):Wt(c)&&(o.add(c),c(a,...u))),a},mixin(c){return n.mixins.includes(c)||n.mixins.push(c),a},component(c,u){return u?(n.components[c]=u,a):n.components[c]},directive(c,u){return u?(n.directives[c]=u,a):n.directives[c]},mount(c,u,l){if(!s){const g=ot(r,i);return g.appContext=n,u&&e?e(g,c):t(g,c,l),s=!0,a._container=c,c.__vue_app__=a,kE(g.component)||g.component.proxy}},unmount(){s&&(t(null,a._container),delete a._container.__vue_app__)},provide(c,u){return n.provides[c]=u,a},runWithContext(c){_h=a;try{return c()}finally{_h=null}}};return a}}let _h=null;function FE(t,e){if(qr){let A=qr.provides;const r=qr.parent&&qr.parent.provides;r===A&&(A=qr.provides=Object.create(r)),A[t]=e}}function as(t,e,A=!1){const r=qr||ni;if(r||_h){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:_h._context.provides;if(i&&t in i)return i[t];if(arguments.length>1)return A&&Wt(e)?e.call(r&&r.proxy):e}}function Y8(){return!!(qr||ni||_h)}function H8(t,e,A,r=!1){const i={},n={};gE(n,NE,1),t.propsDefaults=Object.create(null),ID(t,e,i,n);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);A?t.props=r?i:A8(i):t.type.props?t.props=i:t.props=n,t.attrs=n}function z8(t,e,A,r){const{props:i,attrs:n,vnode:{patchFlag:o}}=t,s=gA(i),[a]=t.propsOptions;let c=!1;if((r||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let l=0;l<u.length;l++){let g=u[l];if(ME(t.emitsOptions,g))continue;const h=e[g];if(a)if(EA(n,g))h!==n[g]&&(n[g]=h,c=!0);else{const p=el(g);i[p]=aS(a,s,p,h,t,!1)}else h!==n[g]&&(n[g]=h,c=!0)}}}else{ID(t,e,i,n)&&(c=!0);let u;for(const l in s)(!e||!EA(e,l)&&((u=Bc(l))===l||!EA(e,u)))&&(a?A&&(A[l]!==void 0||A[u]!==void 0)&&(i[l]=aS(a,s,l,void 0,t,!0)):delete i[l]);if(n!==s)for(const l in n)(!e||!EA(e,l))&&(delete n[l],c=!0)}c&&no(t,"set","$attrs")}function ID(t,e,A,r){const[i,n]=t.propsOptions;let o=!1,s;if(e)for(let a in e){if(uE(a))continue;const c=e[a];let u;i&&EA(i,u=el(a))?!n||!n.includes(u)?A[u]=c:(s||(s={}))[u]=c:ME(t.emitsOptions,a)||(!(a in r)||c!==r[a])&&(r[a]=c,o=!0)}if(n){const a=gA(A),c=s||Ft;for(let u=0;u<n.length;u++){const l=n[u];A[l]=aS(i,a,l,c[l],t,!EA(c,l))}}return o}function aS(t,e,A,r,i,n){const o=t[A];if(o!=null){const s=EA(o,"default");if(s&&r===void 0){const a=o.default;if(o.type!==Function&&!o.skipFactory&&Wt(a)){const{propsDefaults:c}=i;A in c?r=c[A]:(al(i),r=c[A]=a.call(null,e),Qc())}else r=a}o[0]&&(n&&!s?r=!1:o[1]&&(r===""||r===Bc(A))&&(r=!0))}return r}function BD(t,e,A=!1){const r=e.propsCache,i=r.get(t);if(i)return i;const n=t.props,o={},s=[];let a=!1;if(!Wt(t)){const u=l=>{a=!0;const[g,h]=BD(l,e,!0);Mr(o,g),h&&s.push(...h)};!A&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!n&&!a)return OA(t)&&r.set(t,ZA),ZA;if(vt(n))for(let u=0;u<n.length;u++){const l=el(n[u]);vD(l)&&(o[l]=Ft)}else if(n)for(const u in n){const l=el(u);if(vD(l)){const g=n[u],h=o[l]=vt(g)||Wt(g)?{type:g}:Mr({},g);if(h){const p=mD(Boolean,h.type),C=mD(String,h.type);h[0]=p>-1,h[1]=C<0||p<C,(p>-1||EA(h,"default"))&&s.push(l)}}}const c=[o,s];return OA(t)&&r.set(t,c),c}function vD(t){return t[0]!=="$"}function wD(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function SD(t,e){return wD(t)===wD(e)}function mD(t,e){return vt(e)?e.findIndex(A=>SD(A,t)):Wt(e)&&SD(e,t)?0:-1}const MD=t=>t[0]==="_"||t==="$stable",cS=t=>vt(t)?t.map(Os):[Os(t)],J8=(t,e,A)=>{if(e._n)return e;const r=nn((...i)=>cS(e(...i)),A);return r._c=!1,r},yD=(t,e,A)=>{const r=t._ctx;for(const i in t){if(MD(i))continue;const n=t[i];if(Wt(n))e[i]=J8(i,n,r);else if(n!=null){const o=cS(n);e[i]=()=>o}}},QD=(t,e)=>{const A=cS(e);t.slots.default=()=>A},q8=(t,e)=>{if(t.vnode.shapeFlag&32){const A=e._;A?(t.slots=gA(e),gE(e,"_",A)):yD(e,t.slots={})}else t.slots={},e&&QD(t,e);gE(t.slots,NE,1)},V8=(t,e,A)=>{const{vnode:r,slots:i}=t;let n=!0,o=Ft;if(r.shapeFlag&32){const s=e._;s?A&&s===1?n=!1:(Mr(i,e),!A&&s===1&&delete i._):(n=!e.$stable,yD(e,i)),o=e}else e&&(QD(t,e),o={default:1});if(n)for(const s in i)!MD(s)&&!(s in o)&&delete i[s]};function uS(t,e,A,r,i=!1){if(vt(t)){t.forEach((g,h)=>uS(g,e&&(vt(e)?e[h]:e),A,r,i));return}if(Vh(r)&&!i)return;const n=r.shapeFlag&4?kE(r.component)||r.component.proxy:r.el,o=i?null:n,{i:s,r:a}=t,c=e&&e.r,u=s.refs===Ft?s.refs={}:s.refs,l=s.setupState;if(c!=null&&c!==a&&(yr(c)?(u[c]=null,EA(l,c)&&(l[c]=null)):hr(c)&&(c.value=null)),Wt(a))sa(a,s,12,[o,u]);else{const g=yr(a),h=hr(a);if(g||h){const p=()=>{if(t.f){const C=g?EA(l,a)?l[a]:u[a]:a.value;i?vt(C)&&Fw(C,n):vt(C)?C.includes(n)||C.push(n):g?(u[a]=[n],EA(l,a)&&(l[a]=u[a])):(a.value=[n],t.k&&(u[t.k]=a.value))}else g?(u[a]=o,EA(l,a)&&(l[a]=o)):h&&(a.value=o,t.k&&(u[t.k]=o))};o?(p.id=-1,on(p,A)):p()}}}const on=w8;function W8(t){return Z8(t)}function Z8(t,e){const A=xw();A.__VUE__=!0;const{insert:r,remove:i,patchProp:n,createElement:o,createText:s,createComment:a,setText:c,setElementText:u,parentNode:l,nextSibling:g,setScopeId:h=An,insertStaticContent:p}=t,C=(j,J,z,b=null,Me=null,Qe=null,Te=!1,Ce=null,Re=!!J.dynamicChildren)=>{if(j===J)return;j&&!yc(j,J)&&(b=Z(j),U(j,Me,Qe,!0),j=null),J.patchFlag===-2&&(Re=!1,J.dynamicChildren=null);const{type:ve,ref:Ke,shapeFlag:Ue}=J;switch(ve){case OE:I(j,J,z,b);break;case Pn:E(j,J,z,b);break;case bE:j==null&&v(J,z,b,Te);break;case aA:R(j,J,z,b,Me,Qe,Te,Ce,Re);break;default:Ue&1?O(j,J,z,b,Me,Qe,Te,Ce,Re):Ue&6?G(j,J,z,b,Me,Qe,Te,Ce,Re):(Ue&64||Ue&128)&&ve.process(j,J,z,b,Me,Qe,Te,Ce,Re,oe)}Ke!=null&&Me&&uS(Ke,j&&j.ref,Qe,J||j,!J)},I=(j,J,z,b)=>{if(j==null)r(J.el=s(J.children),z,b);else{const Me=J.el=j.el;J.children!==j.children&&c(Me,J.children)}},E=(j,J,z,b)=>{j==null?r(J.el=a(J.children||""),z,b):J.el=j.el},v=(j,J,z,b)=>{[j.el,j.anchor]=p(j.children,J,z,b,j.el,j.anchor)},m=({el:j,anchor:J},z,b)=>{let Me;for(;j&&j!==J;)Me=g(j),r(j,z,b),j=Me;r(J,z,b)},M=({el:j,anchor:J})=>{let z;for(;j&&j!==J;)z=g(j),i(j),j=z;i(J)},O=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{Te=Te||J.type==="svg",j==null?x(J,z,b,Me,Qe,Te,Ce,Re):T(j,J,Me,Qe,Te,Ce,Re)},x=(j,J,z,b,Me,Qe,Te,Ce)=>{let Re,ve;const{type:Ke,props:Ue,shapeFlag:ke,transition:Ye,dirs:Je}=j;if(Re=j.el=o(j.type,Qe,Ue&&Ue.is,Ue),ke&8?u(Re,j.children):ke&16&&D(j.children,Re,null,b,Me,Qe&&Ke!=="foreignObject",Te,Ce),Je&&mc(j,null,b,"created"),P(Re,j,j.scopeId,Te,b),Ue){for(const Ze in Ue)Ze!=="value"&&!uE(Ze)&&n(Re,Ze,null,Ue[Ze],Qe,j.children,b,Me,ae);"value"in Ue&&n(Re,"value",null,Ue.value),(ve=Ue.onVnodeBeforeMount)&&bs(ve,b,j)}Je&&mc(j,null,b,"beforeMount");const rt=(!Me||Me&&!Me.pendingBranch)&&Ye&&!Ye.persisted;rt&&Ye.beforeEnter(Re),r(Re,J,z),((ve=Ue&&Ue.onVnodeMounted)||rt||Je)&&on(()=>{ve&&bs(ve,b,j),rt&&Ye.enter(Re),Je&&mc(j,null,b,"mounted")},Me)},P=(j,J,z,b,Me)=>{if(z&&h(j,z),b)for(let Qe=0;Qe<b.length;Qe++)h(j,b[Qe]);if(Me){let Qe=Me.subTree;if(J===Qe){const Te=Me.vnode;P(j,Te,Te.scopeId,Te.slotScopeIds,Me.parent)}}},D=(j,J,z,b,Me,Qe,Te,Ce,Re=0)=>{for(let ve=Re;ve<j.length;ve++){const Ke=j[ve]=Ce?aa(j[ve]):Os(j[ve]);C(null,Ke,J,z,b,Me,Qe,Te,Ce)}},T=(j,J,z,b,Me,Qe,Te)=>{const Ce=J.el=j.el;let{patchFlag:Re,dynamicChildren:ve,dirs:Ke}=J;Re|=j.patchFlag&16;const Ue=j.props||Ft,ke=J.props||Ft;let Ye;z&&Mc(z,!1),(Ye=ke.onVnodeBeforeUpdate)&&bs(Ye,z,J,j),Ke&&mc(J,j,z,"beforeUpdate"),z&&Mc(z,!0);const Je=Me&&J.type!=="foreignObject";if(ve?q(j.dynamicChildren,ve,Ce,z,b,Je,Qe):Te||W(j,J,Ce,null,z,b,Je,Qe,!1),Re>0){if(Re&16)Q(Ce,J,Ue,ke,z,b,Me);else if(Re&2&&Ue.class!==ke.class&&n(Ce,"class",null,ke.class,Me),Re&4&&n(Ce,"style",Ue.style,ke.style,Me),Re&8){const rt=J.dynamicProps;for(let Ze=0;Ze<rt.length;Ze++){const We=rt[Ze],At=Ue[We],_e=ke[We];(_e!==At||We==="value")&&n(Ce,We,At,_e,Me,j.children,z,b,ae)}}Re&1&&j.children!==J.children&&u(Ce,J.children)}else!Te&&ve==null&&Q(Ce,J,Ue,ke,z,b,Me);((Ye=ke.onVnodeUpdated)||Ke)&&on(()=>{Ye&&bs(Ye,z,J,j),Ke&&mc(J,j,z,"updated")},b)},q=(j,J,z,b,Me,Qe,Te)=>{for(let Ce=0;Ce<J.length;Ce++){const Re=j[Ce],ve=J[Ce],Ke=Re.el&&(Re.type===aA||!yc(Re,ve)||Re.shapeFlag&70)?l(Re.el):z;C(Re,ve,Ke,null,b,Me,Qe,Te,!0)}},Q=(j,J,z,b,Me,Qe,Te)=>{if(z!==b){if(z!==Ft)for(const Ce in z)!uE(Ce)&&!(Ce in b)&&n(j,Ce,z[Ce],null,Te,J.children,Me,Qe,ae);for(const Ce in b){if(uE(Ce))continue;const Re=b[Ce],ve=z[Ce];Re!==ve&&Ce!=="value"&&n(j,Ce,ve,Re,Te,J.children,Me,Qe,ae)}"value"in b&&n(j,"value",z.value,b.value)}},R=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{const ve=J.el=j?j.el:s(""),Ke=J.anchor=j?j.anchor:s("");let{patchFlag:Ue,dynamicChildren:ke,slotScopeIds:Ye}=J;Ye&&(Ce=Ce?Ce.concat(Ye):Ye),j==null?(r(ve,z,b),r(Ke,z,b),D(J.children,z,Ke,Me,Qe,Te,Ce,Re)):Ue>0&&Ue&64&&ke&&j.dynamicChildren?(q(j.dynamicChildren,ke,z,Me,Qe,Te,Ce),(J.key!=null||Me&&J===Me.subTree)&&RD(j,J,!0)):W(j,J,z,Ke,Me,Qe,Te,Ce,Re)},G=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{J.slotScopeIds=Ce,j==null?J.shapeFlag&512?Me.ctx.activate(J,z,b,Te,Re):k(J,z,b,Me,Qe,Te,Re):te(j,J,Re)},k=(j,J,z,b,Me,Qe,Te)=>{const Ce=j.component=nY(j,b,Me);if(DE(j)&&(Ce.ctx.renderer=oe),oY(Ce),Ce.asyncDep){if(Me&&Me.registerDep(Ce,X),!j.el){const Re=Ce.subTree=ot(Pn);E(null,Re,J,z)}return}X(Ce,j,J,z,Me,Qe,Te)},te=(j,J,z)=>{const b=J.component=j.component;if(I8(j,J,z))if(b.asyncDep&&!b.asyncResolved){ie(b,J,z);return}else b.next=J,g8(b.update),b.update();else J.el=j.el,b.vnode=J},X=(j,J,z,b,Me,Qe,Te)=>{const Ce=()=>{if(j.isMounted){let{next:Ke,bu:Ue,u:ke,parent:Ye,vnode:Je}=j,rt=Ke,Ze;Mc(j,!1),Ke?(Ke.el=Je.el,ie(j,Ke,Te)):Ke=Je,Ue&&hE(Ue),(Ze=Ke.props&&Ke.props.onVnodeBeforeUpdate)&&bs(Ze,Ye,Ke,Je),Mc(j,!0);const We=$w(j),At=j.subTree;j.subTree=We,C(At,We,l(At.el),Z(At),j,Me,Qe),Ke.el=We.el,rt===null&&B8(j,We.el),ke&&on(ke,Me),(Ze=Ke.props&&Ke.props.onVnodeUpdated)&&on(()=>bs(Ze,Ye,Ke,Je),Me)}else{let Ke;const{el:Ue,props:ke}=J,{bm:Ye,m:Je,parent:rt}=j,Ze=Vh(J);if(Mc(j,!1),Ye&&hE(Ye),!Ze&&(Ke=ke&&ke.onVnodeBeforeMount)&&bs(Ke,rt,J),Mc(j,!0),Ue&&De){const We=()=>{j.subTree=$w(j),De(Ue,j.subTree,j,Me,null)};Ze?J.type.__asyncLoader().then(()=>!j.isUnmounted&&We()):We()}else{const We=j.subTree=$w(j);C(null,We,z,b,j,Me,Qe),J.el=We.el}if(Je&&on(Je,Me),!Ze&&(Ke=ke&&ke.onVnodeMounted)){const We=J;on(()=>bs(Ke,rt,We),Me)}(J.shapeFlag&256||rt&&Vh(rt.vnode)&&rt.vnode.shapeFlag&256)&&j.a&&on(j.a,Me),j.isMounted=!0,J=z=b=null}},Re=j.effect=new jw(Ce,()=>_w(ve),j.scope),ve=j.update=()=>Re.run();ve.id=j.uid,Mc(j,!0),ve()},ie=(j,J,z)=>{J.component=j;const b=j.vnode.props;j.vnode=J,j.next=null,z8(j,J.props,b,z),V8(j,J.children,z),tl(),XR(),Al()},W=(j,J,z,b,Me,Qe,Te,Ce,Re=!1)=>{const ve=j&&j.children,Ke=j?j.shapeFlag:0,Ue=J.children,{patchFlag:ke,shapeFlag:Ye}=J;if(ke>0){if(ke&128){Be(ve,Ue,z,b,Me,Qe,Te,Ce,Re);return}else if(ke&256){se(ve,Ue,z,b,Me,Qe,Te,Ce,Re);return}}Ye&8?(Ke&16&&ae(ve,Me,Qe),Ue!==ve&&u(z,Ue)):Ke&16?Ye&16?Be(ve,Ue,z,b,Me,Qe,Te,Ce,Re):ae(ve,Me,Qe,!0):(Ke&8&&u(z,""),Ye&16&&D(Ue,z,b,Me,Qe,Te,Ce,Re))},se=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{j=j||ZA,J=J||ZA;const ve=j.length,Ke=J.length,Ue=Math.min(ve,Ke);let ke;for(ke=0;ke<Ue;ke++){const Ye=J[ke]=Re?aa(J[ke]):Os(J[ke]);C(j[ke],Ye,z,null,Me,Qe,Te,Ce,Re)}ve>Ke?ae(j,Me,Qe,!0,!1,Ue):D(J,z,b,Me,Qe,Te,Ce,Re,Ue)},Be=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{let ve=0;const Ke=J.length;let Ue=j.length-1,ke=Ke-1;for(;ve<=Ue&&ve<=ke;){const Ye=j[ve],Je=J[ve]=Re?aa(J[ve]):Os(J[ve]);if(yc(Ye,Je))C(Ye,Je,z,null,Me,Qe,Te,Ce,Re);else break;ve++}for(;ve<=Ue&&ve<=ke;){const Ye=j[Ue],Je=J[ke]=Re?aa(J[ke]):Os(J[ke]);if(yc(Ye,Je))C(Ye,Je,z,null,Me,Qe,Te,Ce,Re);else break;Ue--,ke--}if(ve>Ue){if(ve<=ke){const Ye=ke+1,Je=Ye<Ke?J[Ye].el:b;for(;ve<=ke;)C(null,J[ve]=Re?aa(J[ve]):Os(J[ve]),z,Je,Me,Qe,Te,Ce,Re),ve++}}else if(ve>ke)for(;ve<=Ue;)U(j[ve],Me,Qe,!0),ve++;else{const Ye=ve,Je=ve,rt=new Map;for(ve=Je;ve<=ke;ve++){const et=J[ve]=Re?aa(J[ve]):Os(J[ve]);et.key!=null&&rt.set(et.key,ve)}let Ze,We=0;const At=ke-Je+1;let _e=!1,It=0;const yt=new Array(At);for(ve=0;ve<At;ve++)yt[ve]=0;for(ve=Ye;ve<=Ue;ve++){const et=j[ve];if(We>=At){U(et,Me,Qe,!0);continue}let St;if(et.key!=null)St=rt.get(et.key);else for(Ze=Je;Ze<=ke;Ze++)if(yt[Ze-Je]===0&&yc(et,J[Ze])){St=Ze;break}St===void 0?U(et,Me,Qe,!0):(yt[St-Je]=ve+1,St>=It?It=St:_e=!0,C(et,J[St],z,null,Me,Qe,Te,Ce,Re),We++)}const tt=_e?X8(yt):ZA;for(Ze=tt.length-1,ve=At-1;ve>=0;ve--){const et=Je+ve,St=J[et],ct=et+1<Ke?J[et+1].el:b;yt[ve]===0?C(null,St,z,ct,Me,Qe,Te,Ce,Re):_e&&(Ze<0||ve!==tt[Ze]?Ee(St,z,ct,2):Ze--)}}},Ee=(j,J,z,b,Me=null)=>{const{el:Qe,type:Te,transition:Ce,children:Re,shapeFlag:ve}=j;if(ve&6){Ee(j.component.subTree,J,z,b);return}if(ve&128){j.suspense.move(J,z,b);return}if(ve&64){Te.move(j,J,z,oe);return}if(Te===aA){r(Qe,J,z);for(let Ue=0;Ue<Re.length;Ue++)Ee(Re[Ue],J,z,b);r(j.anchor,J,z);return}if(Te===bE){m(j,J,z);return}if(b!==2&&ve&1&&Ce)if(b===0)Ce.beforeEnter(Qe),r(Qe,J,z),on(()=>Ce.enter(Qe),Me);else{const{leave:Ue,delayLeave:ke,afterLeave:Ye}=Ce,Je=()=>r(Qe,J,z),rt=()=>{Ue(Qe,()=>{Je(),Ye&&Ye()})};ke?ke(Qe,Je,rt):rt()}else r(Qe,J,z)},U=(j,J,z,b=!1,Me=!1)=>{const{type:Qe,props:Te,ref:Ce,children:Re,dynamicChildren:ve,shapeFlag:Ke,patchFlag:Ue,dirs:ke}=j;if(Ce!=null&&uS(Ce,null,z,j,!0),Ke&256){J.ctx.deactivate(j);return}const Ye=Ke&1&&ke,Je=!Vh(j);let rt;if(Je&&(rt=Te&&Te.onVnodeBeforeUnmount)&&bs(rt,J,j),Ke&6)re(j.component,z,b);else{if(Ke&128){j.suspense.unmount(z,b);return}Ye&&mc(j,null,J,"beforeUnmount"),Ke&64?j.type.remove(j,J,z,Me,oe,b):ve&&(Qe!==aA||Ue>0&&Ue&64)?ae(ve,J,z,!1,!0):(Qe===aA&&Ue&384||!Me&&Ke&16)&&ae(Re,J,z),b&&Y(j)}(Je&&(rt=Te&&Te.onVnodeUnmounted)||Ye)&&on(()=>{rt&&bs(rt,J,j),Ye&&mc(j,null,J,"unmounted")},z)},Y=j=>{const{type:J,el:z,anchor:b,transition:Me}=j;if(J===aA){_(z,b);return}if(J===bE){M(j);return}const Qe=()=>{i(z),Me&&!Me.persisted&&Me.afterLeave&&Me.afterLeave()};if(j.shapeFlag&1&&Me&&!Me.persisted){const{leave:Te,delayLeave:Ce}=Me,Re=()=>Te(z,Qe);Ce?Ce(j.el,Qe,Re):Re()}else Qe()},_=(j,J)=>{let z;for(;j!==J;)z=g(j),i(j),j=z;i(J)},re=(j,J,z)=>{const{bum:b,scope:Me,update:Qe,subTree:Te,um:Ce}=j;b&&hE(b),Me.stop(),Qe&&(Qe.active=!1,U(Te,j,J,z)),Ce&&on(Ce,J),on(()=>{j.isUnmounted=!0},J),J&&J.pendingBranch&&!J.isUnmounted&&j.asyncDep&&!j.asyncResolved&&j.suspenseId===J.pendingId&&(J.deps--,J.deps===0&&J.resolve())},ae=(j,J,z,b=!1,Me=!1,Qe=0)=>{for(let Te=Qe;Te<j.length;Te++)U(j[Te],J,z,b,Me)},Z=j=>j.shapeFlag&6?Z(j.component.subTree):j.shapeFlag&128?j.suspense.next():g(j.anchor||j.el),ce=(j,J,z)=>{j==null?J._vnode&&U(J._vnode,null,null,!0):C(J._vnode||null,j,J,null,null,null,z),XR(),_R(),J._vnode=j},oe={p:C,um:U,m:Ee,r:Y,mt:k,mc:D,pc:W,pbc:q,n:Z,o:t};let de,De;return e&&([de,De]=e(oe)),{render:ce,hydrate:de,createApp:j8(ce,de)}}function Mc({effect:t,update:e},A){t.allowRecurse=e.allowRecurse=A}function RD(t,e,A=!1){const r=t.children,i=e.children;if(vt(r)&&vt(i))for(let n=0;n<r.length;n++){const o=r[n];let s=i[n];s.shapeFlag&1&&!s.dynamicChildren&&((s.patchFlag<=0||s.patchFlag===32)&&(s=i[n]=aa(i[n]),s.el=o.el),A||RD(o,s)),s.type===OE&&(s.el=o.el)}}function X8(t){const e=t.slice(),A=[0];let r,i,n,o,s;const a=t.length;for(r=0;r<a;r++){const c=t[r];if(c!==0){if(i=A[A.length-1],t[i]<c){e[r]=i,A.push(r);continue}for(n=0,o=A.length-1;n<o;)s=n+o>>1,t[A[s]]<c?n=s+1:o=s;c<t[A[n]]&&(n>0&&(e[r]=A[n-1]),A[n]=r)}}for(n=A.length,o=A[n-1];n-- >0;)A[n]=o,o=e[o];return A}const _8=t=>t.__isTeleport,aA=Symbol.for("v-fgt"),OE=Symbol.for("v-txt"),Pn=Symbol.for("v-cmt"),bE=Symbol.for("v-stc"),$h=[];let cs=null;function ue(t=!1){$h.push(cs=t?null:[])}function $8(){$h.pop(),cs=$h[$h.length-1]||null}let eg=1;function DD(t){eg+=t}function TD(t){return t.dynamicChildren=eg>0?cs||ZA:null,$8(),eg>0&&cs&&cs.push(t),t}function ge(t,e,A,r,i,n){return TD(S(t,e,A,r,i,n,!0))}function co(t,e,A,r,i){return TD(ot(t,e,A,r,i,!0))}function xE(t){return t?t.__v_isVNode===!0:!1}function yc(t,e){return t.type===e.type&&t.key===e.key}const NE="__vInternal",UD=({key:t})=>t??null,KE=({ref:t,ref_key:e,ref_for:A})=>(typeof t=="number"&&(t=""+t),t!=null?yr(t)||hr(t)||Wt(t)?{i:ni,r:t,k:e,f:!!A}:t:null);function S(t,e=null,A=null,r=0,i=null,n=t===aA?0:1,o=!1,s=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&UD(e),ref:e&&KE(e),scopeId:yE,slotScopeIds:null,children:A,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:n,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ni};return s?(lS(a,A),n&128&&t.normalize(a)):A&&(a.shapeFlag|=yr(A)?8:16),eg>0&&!o&&cs&&(a.patchFlag>0||n&6)&&a.patchFlag!==32&&cs.push(a),a}const ot=eY;function eY(t,e=null,A=null,r=0,i=null,n=!1){if((!t||t===O8)&&(t=Pn),xE(t)){const s=oa(t,e,!0);return A&&lS(s,A),eg>0&&!n&&cs&&(s.shapeFlag&6?cs[cs.indexOf(t)]=s:cs.push(s)),s.patchFlag|=-2,s}if(lY(t)&&(t=t.__vccOpts),e){e=tY(e);let{class:s,style:a}=e;s&&!yr(s)&&(e.class=mt(s)),OA(a)&&(HR(a)&&!vt(a)&&(a=Mr({},a)),e.style=Nw(a))}const o=yr(t)?1:v8(t)?128:_8(t)?64:OA(t)?4:Wt(t)?2:0;return S(t,e,A,r,i,o,n,!0)}function tY(t){return t?HR(t)||NE in t?Mr({},t):t:null}function oa(t,e,A=!1){const{props:r,ref:i,patchFlag:n,children:o}=t,s=e?AY(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:s,key:s&&UD(s),ref:e&&e.ref?A&&i?vt(i)?i.concat(KE(e)):[i,KE(e)]:KE(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==aA?n===-1?16:n|16:n,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&oa(t.ssContent),ssFallback:t.ssFallback&&oa(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Gt(t=" ",e=0){return ot(OE,null,t,e)}function sl(t,e){const A=ot(bE,null,t);return A.staticCount=e,A}function Dt(t="",e=!1){return e?(ue(),co(Pn,null,t)):ot(Pn,null,t)}function Os(t){return t==null||typeof t=="boolean"?ot(Pn):vt(t)?ot(aA,null,t.slice()):typeof t=="object"?aa(t):ot(OE,null,String(t))}function aa(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:oa(t)}function lS(t,e){let A=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(vt(e))A=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),lS(t,i()),i._c&&(i._d=!0));return}else{A=32;const i=e._;!i&&!(NE in e)?e._ctx=ni:i===3&&ni&&(ni.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Wt(e)?(e={default:e,_ctx:ni},A=32):(e=String(e),r&64?(A=16,e=[Gt(e)]):A=8);t.children=e,t.shapeFlag|=A}function AY(...t){const e={};for(let A=0;A<t.length;A++){const r=t[A];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=mt([e.class,r.class]));else if(i==="style")e.style=Nw([e.style,r.style]);else if(cE(i)){const n=e[i],o=r[i];o&&n!==o&&!(vt(n)&&n.includes(o))&&(e[i]=n?[].concat(n,o):o)}else i!==""&&(e[i]=r[i])}return e}function bs(t,e,A,r=null){Kn(t,e,7,[A,r])}const rY=CD();let iY=0;function nY(t,e,A){const r=t.type,i=(e?e.appContext:t.appContext)||rY,n={uid:iY++,vnode:t,type:r,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new SR(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:BD(r,i),emitsOptions:eD(r,i),emit:null,emitted:null,propsDefaults:Ft,inheritAttrs:r.inheritAttrs,ctx:Ft,data:Ft,props:Ft,attrs:Ft,slots:Ft,refs:Ft,setupState:Ft,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:A,suspenseId:A?A.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return n.ctx={_:n},n.root=e?e.root:n,n.emit=f8.bind(null,n),t.ce&&t.ce(n),n}let qr=null;const sY=()=>qr||ni;let hS,ol,LD="__VUE_INSTANCE_SETTERS__";(ol=xw()[LD])||(ol=xw()[LD]=[]),ol.push(t=>qr=t),hS=t=>{ol.length>1?ol.forEach(e=>e(t)):ol[0](t)};const al=t=>{hS(t),t.scope.on()},Qc=()=>{qr&&qr.scope.off(),hS(null)};function FD(t){return t.vnode.shapeFlag&4}let tg=!1;function oY(t,e=!1){tg=e;const{props:A,children:r}=t.vnode,i=FD(t);H8(t,A,i,e),q8(t,r);const n=i?aY(t,e):void 0;return tg=!1,n}function aY(t,e){const A=t.type;t.accessCache=Object.create(null),t.proxy=SE(new Proxy(t.ctx,b8));const{setup:r}=A;if(r){const i=t.setupContext=r.length>1?uY(t):null;al(t),tl();const n=sa(r,t,0,[t.props,i]);if(Al(),Qc(),fR(n)){if(n.then(Qc,Qc),e)return n.then(o=>{OD(t,o,e)}).catch(o=>{mE(o,t,0)});t.asyncDep=n}else OD(t,n,e)}else xD(t,e)}function OD(t,e,A){Wt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:OA(e)&&(t.setupState=VR(e)),xD(t,A)}let bD;function xD(t,e,A){const r=t.type;if(!t.render){if(!e&&bD&&!r.render){const i=r.template||sS(t).template;if(i){const{isCustomElement:n,compilerOptions:o}=t.appContext.config,{delimiters:s,compilerOptions:a}=r,c=Mr(Mr({isCustomElement:n,delimiters:s},o),a);r.render=bD(i,c)}}t.render=r.render||An}al(t),tl(),x8(t),Al(),Qc()}function cY(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,{get(e,A){return rn(t,"get","$attrs"),e[A]}}))}function uY(t){const e=A=>{t.exposed=A||{}};return{get attrs(){return cY(t)},slots:t.slots,emit:t.emit,expose:e}}function kE(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(VR(SE(t.exposed)),{get(e,A){if(A in e)return e[A];if(A in Zh)return Zh[A](t)},has(e,A){return A in e||A in Zh}}))}function lY(t){return Wt(t)&&"__vccOpts"in t}const er=(t,e)=>u8(t,e,tg);function gS(t,e,A){const r=arguments.length;return r===2?OA(e)&&!vt(e)?xE(e)?ot(t,null,[e]):ot(t,e):ot(t,null,e):(r>3?A=Array.prototype.slice.call(arguments,2):r===3&&xE(A)&&(A=[A]),ot(t,e,A))}const hY=Symbol.for("v-scx"),gY=()=>as(hY),dY="3.3.4",pY="http://www.w3.org/2000/svg",Rc=typeof document<"u"?document:null,ND=Rc&&Rc.createElement("template"),fY={insert:(t,e,A)=>{e.insertBefore(t,A||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,A,r)=>{const i=e?Rc.createElementNS(pY,t):Rc.createElement(t,A?{is:A}:void 0);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Rc.createTextNode(t),createComment:t=>Rc.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Rc.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,A,r,i,n){const o=A?A.previousSibling:e.lastChild;if(i&&(i===n||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),A),!(i===n||!(i=i.nextSibling)););else{ND.innerHTML=r?`<svg>${t}</svg>`:t;const s=ND.content;if(r){const a=s.firstChild;for(;a.firstChild;)s.appendChild(a.firstChild);s.removeChild(a)}e.insertBefore(s,A)}return[o?o.nextSibling:e.firstChild,A?A.previousSibling:e.lastChild]}};function EY(t,e,A){const r=t._vtc;r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):A?t.setAttribute("class",e):t.className=e}function CY(t,e,A){const r=t.style,i=yr(A);if(A&&!i){if(e&&!yr(e))for(const n in e)A[n]==null&&dS(r,n,"");for(const n in A)dS(r,n,A[n])}else{const n=r.display;i?e!==A&&(r.cssText=A):e&&t.removeAttribute("style"),"_vod"in t&&(r.display=n)}}const KD=/\s*!important$/;function dS(t,e,A){if(vt(A))A.forEach(r=>dS(t,e,r));else if(A==null&&(A=""),e.startsWith("--"))t.setProperty(e,A);else{const r=IY(t,e);KD.test(A)?t.setProperty(Bc(r),A.replace(KD,""),"important"):t[r]=A}}const kD=["Webkit","Moz","ms"],pS={};function IY(t,e){const A=pS[e];if(A)return A;let r=el(e);if(r!=="filter"&&r in t)return pS[e]=r;r=IR(r);for(let i=0;i<kD.length;i++){const n=kD[i]+r;if(n in t)return pS[e]=n}return e}const PD="http://www.w3.org/1999/xlink";function BY(t,e,A,r,i){if(r&&e.startsWith("xlink:"))A==null?t.removeAttributeNS(PD,e.slice(6,e.length)):t.setAttributeNS(PD,e,A);else{const n=Mj(e);A==null||n&&!vR(A)?t.removeAttribute(e):t.setAttribute(e,n?"":A)}}function vY(t,e,A,r,i,n,o){if(e==="innerHTML"||e==="textContent"){r&&o(r,i,n),t[e]=A??"";return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){t._value=A;const c=s==="OPTION"?t.getAttribute("value"):t.value,u=A??"";c!==u&&(t.value=u),A==null&&t.removeAttribute(e);return}let a=!1;if(A===""||A==null){const c=typeof t[e];c==="boolean"?A=vR(A):A==null&&c==="string"?(A="",a=!0):c==="number"&&(A=0,a=!0)}try{t[e]=A}catch{}a&&t.removeAttribute(e)}function ca(t,e,A,r){t.addEventListener(e,A,r)}function wY(t,e,A,r){t.removeEventListener(e,A,r)}function SY(t,e,A,r,i=null){const n=t._vei||(t._vei={}),o=n[e];if(r&&o)o.value=r;else{const[s,a]=mY(e);if(r){const c=n[e]=QY(r,i);ca(t,s,c,a)}else o&&(wY(t,s,o,a),n[e]=void 0)}}const GD=/(?:Once|Passive|Capture)$/;function mY(t){let e;if(GD.test(t)){e={};let r;for(;r=t.match(GD);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Bc(t.slice(2)),e]}let fS=0;const MY=Promise.resolve(),yY=()=>fS||(MY.then(()=>fS=0),fS=Date.now());function QY(t,e){const A=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=A.attached)return;Kn(RY(r,A.value),e,5,[r])};return A.value=t,A.attached=yY(),A}function RY(t,e){if(vt(e)){const A=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{A.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const jD=/^on[a-z]/,DY=(t,e,A,r,i=!1,n,o,s,a)=>{e==="class"?EY(t,r,i):e==="style"?CY(t,A,r):cE(e)?Lw(e)||SY(t,e,A,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):TY(t,e,r,i))?vY(t,e,r,n,o,s,a):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),BY(t,e,r,i))};function TY(t,e,A,r){return r?!!(e==="innerHTML"||e==="textContent"||e in t&&jD.test(e)&&Wt(A)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA"||jD.test(e)&&yr(A)?!1:e in t}const ua="transition",Ag="animation",PE=(t,{slots:e})=>gS(M8,UY(t),e);PE.displayName="Transition";const YD={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};PE.props=Mr({},iD,YD);const Dc=(t,e=[])=>{vt(t)?t.forEach(A=>A(...e)):t&&t(...e)},HD=t=>t?vt(t)?t.some(e=>e.length>1):t.length>1:!1;function UY(t){const e={};for(const R in t)R in YD||(e[R]=t[R]);if(t.css===!1)return e;const{name:A="v",type:r,duration:i,enterFromClass:n=`${A}-enter-from`,enterActiveClass:o=`${A}-enter-active`,enterToClass:s=`${A}-enter-to`,appearFromClass:a=n,appearActiveClass:c=o,appearToClass:u=s,leaveFromClass:l=`${A}-leave-from`,leaveActiveClass:g=`${A}-leave-active`,leaveToClass:h=`${A}-leave-to`}=t,p=LY(i),C=p&&p[0],I=p&&p[1],{onBeforeEnter:E,onEnter:v,onEnterCancelled:m,onLeave:M,onLeaveCancelled:O,onBeforeAppear:x=E,onAppear:P=v,onAppearCancelled:D=m}=e,T=(R,G,k)=>{Tc(R,G?u:s),Tc(R,G?c:o),k&&k()},q=(R,G)=>{R._isLeaving=!1,Tc(R,l),Tc(R,h),Tc(R,g),G&&G()},Q=R=>(G,k)=>{const te=R?P:v,X=()=>T(G,R,k);Dc(te,[G,X]),zD(()=>{Tc(G,R?a:n),la(G,R?u:s),HD(te)||JD(G,r,C,X)})};return Mr(e,{onBeforeEnter(R){Dc(E,[R]),la(R,n),la(R,o)},onBeforeAppear(R){Dc(x,[R]),la(R,a),la(R,c)},onEnter:Q(!1),onAppear:Q(!0),onLeave(R,G){R._isLeaving=!0;const k=()=>q(R,G);la(R,l),bY(),la(R,g),zD(()=>{R._isLeaving&&(Tc(R,l),la(R,h),HD(M)||JD(R,r,I,k))}),Dc(M,[R,k])},onEnterCancelled(R){T(R,!1),Dc(m,[R])},onAppearCancelled(R){T(R,!0),Dc(D,[R])},onLeaveCancelled(R){q(R),Dc(O,[R])}})}function LY(t){if(t==null)return null;if(OA(t))return[ES(t.enter),ES(t.leave)];{const e=ES(t);return[e,e]}}function ES(t){return Bj(t)}function la(t,e){e.split(/\s+/).forEach(A=>A&&t.classList.add(A)),(t._vtc||(t._vtc=new Set)).add(e)}function Tc(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const{_vtc:A}=t;A&&(A.delete(e),A.size||(t._vtc=void 0))}function zD(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let FY=0;function JD(t,e,A,r){const i=t._endId=++FY,n=()=>{i===t._endId&&r()};if(A)return setTimeout(n,A);const{type:o,timeout:s,propCount:a}=OY(t,e);if(!o)return r();const c=o+"end";let u=0;const l=()=>{t.removeEventListener(c,g),n()},g=h=>{h.target===t&&++u>=a&&l()};setTimeout(()=>{u<a&&l()},s+1),t.addEventListener(c,g)}function OY(t,e){const A=window.getComputedStyle(t),r=p=>(A[p]||"").split(", "),i=r(`${ua}Delay`),n=r(`${ua}Duration`),o=qD(i,n),s=r(`${Ag}Delay`),a=r(`${Ag}Duration`),c=qD(s,a);let u=null,l=0,g=0;e===ua?o>0&&(u=ua,l=o,g=n.length):e===Ag?c>0&&(u=Ag,l=c,g=a.length):(l=Math.max(o,c),u=l>0?o>c?ua:Ag:null,g=u?u===ua?n.length:a.length:0);const h=u===ua&&/\b(transform|all)(,|$)/.test(r(`${ua}Property`).toString());return{type:u,timeout:l,propCount:g,hasTransform:h}}function qD(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((A,r)=>VD(A)+VD(t[r])))}function VD(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function bY(){return document.body.offsetHeight}const cl=t=>{const e=t.props["onUpdate:modelValue"]||!1;return vt(e)?A=>hE(e,A):e};function xY(t){t.target.composing=!0}function WD(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const bA={created(t,{modifiers:{lazy:e,trim:A,number:r}},i){t._assign=cl(i);const n=r||i.props&&i.props.type==="number";ca(t,e?"change":"input",o=>{if(o.target.composing)return;let s=t.value;A&&(s=s.trim()),n&&(s=dE(s)),t._assign(s)}),A&&ca(t,"change",()=>{t.value=t.value.trim()}),e||(ca(t,"compositionstart",xY),ca(t,"compositionend",WD),ca(t,"change",WD))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:A,trim:r,number:i}},n){if(t._assign=cl(n),t.composing||document.activeElement===t&&t.type!=="range"&&(A||r&&t.value.trim()===e||(i||t.type==="number")&&dE(t.value)===e))return;const o=e??"";t.value!==o&&(t.value=o)}},ZD={deep:!0,created(t,e,A){t._assign=cl(A),ca(t,"change",()=>{const r=t._modelValue,i=rg(t),n=t.checked,o=t._assign;if(vt(r)){const s=Kw(r,i),a=s!==-1;if(n&&!a)o(r.concat(i));else if(!n&&a){const c=[...r];c.splice(s,1),o(c)}}else if($u(r)){const s=new Set(r);n?s.add(i):s.delete(i),o(s)}else o($D(t,n))})},mounted:XD,beforeUpdate(t,e,A){t._assign=cl(A),XD(t,e,A)}};function XD(t,{value:e,oldValue:A},r){t._modelValue=e,vt(e)?t.checked=Kw(e,r.props.value)>-1:$u(e)?t.checked=e.has(r.props.value):e!==A&&(t.checked=Yh(e,$D(t,!0)))}const CS={deep:!0,created(t,{value:e,modifiers:{number:A}},r){const i=$u(e);ca(t,"change",()=>{const n=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>A?dE(rg(o)):rg(o));t._assign(t.multiple?i?new Set(n):n:n[0])}),t._assign=cl(r)},mounted(t,{value:e}){_D(t,e)},beforeUpdate(t,e,A){t._assign=cl(A)},updated(t,{value:e}){_D(t,e)}};function _D(t,e){const A=t.multiple;if(!(A&&!vt(e)&&!$u(e))){for(let r=0,i=t.options.length;r<i;r++){const n=t.options[r],o=rg(n);if(A)vt(e)?n.selected=Kw(e,o)>-1:n.selected=e.has(o);else if(Yh(rg(n),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!A&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function rg(t){return"_value"in t?t._value:t.value}function $D(t,e){const A=e?"_trueValue":"_falseValue";return A in t?t[A]:e}const NY=["ctrl","shift","alt","meta"],KY={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>NY.some(A=>t[`${A}Key`]&&!e.includes(A))},IS=(t,e)=>(A,...r)=>{for(let i=0;i<e.length;i++){const n=KY[e[i]];if(n&&n(A,e))return}return t(A,...r)},kY={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},eT=(t,e)=>A=>{if(!("key"in A))return;const r=Bc(A.key);if(e.some(i=>i===r||kY[i]===r))return t(A)},ul={beforeMount(t,{value:e},{transition:A}){t._vod=t.style.display==="none"?"":t.style.display,A&&e?A.beforeEnter(t):ig(t,e)},mounted(t,{value:e},{transition:A}){A&&e&&A.enter(t)},updated(t,{value:e,oldValue:A},{transition:r}){!e!=!A&&(r?e?(r.beforeEnter(t),ig(t,!0),r.enter(t)):r.leave(t,()=>{ig(t,!1)}):ig(t,e))},beforeUnmount(t,{value:e}){ig(t,e)}};function ig(t,e){t.style.display=e?t._vod:"none"}const PY=Mr({patchProp:DY},fY);let tT;function GY(){return tT||(tT=W8(PY))}const jY=(...t)=>{const e=GY().createApp(...t),{mount:A}=e;return e.mount=r=>{const i=YY(r);if(!i)return;const n=e._component;!Wt(n)&&!n.render&&!n.template&&(n.template=i.innerHTML),i.innerHTML="";const o=A(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function YY(t){return yr(t)?document.querySelector(t):t}/*!
1
+ (function(kA){typeof define=="function"&&define.amd?define(kA):kA()})(function(){var Dn,tc,Ho,Ru,Du,ew,_i;"use strict";var e1e=Object.defineProperty;var t1e=(kA,Ft,ZA)=>Ft in kA?e1e(kA,Ft,{enumerable:!0,configurable:!0,writable:!0,value:ZA}):kA[Ft]=ZA;var Ht=(kA,Ft,ZA)=>(t1e(kA,typeof Ft!="symbol"?Ft+"":Ft,ZA),ZA),q3=(kA,Ft,ZA)=>{if(!Ft.has(kA))throw TypeError("Cannot "+ZA)};var eA=(kA,Ft,ZA)=>(q3(kA,Ft,"read from private field"),ZA?ZA.call(kA):Ft.get(kA)),Ic=(kA,Ft,ZA)=>{if(Ft.has(kA))throw TypeError("Cannot add the same private member more than once");Ft instanceof WeakSet?Ft.add(kA):Ft.set(kA,ZA)},oE=(kA,Ft,ZA,An)=>(q3(kA,Ft,"write to private field"),An?An.call(kA,ZA):Ft.set(kA,ZA),ZA);function kA(t,e){const A=Object.create(null),r=t.split(",");for(let i=0;i<r.length;i++)A[r[i]]=!0;return e?i=>!!A[i.toLowerCase()]:i=>!!A[i]}const Ft={},ZA=[],An=()=>{},dj=()=>!1,pj=/^on[^a-z]/,cE=t=>pj.test(t),Lw=t=>t.startsWith("onUpdate:"),Mr=Object.assign,Fw=(t,e)=>{const A=t.indexOf(e);A>-1&&t.splice(A,1)},fj=Object.prototype.hasOwnProperty,EA=(t,e)=>fj.call(t,e),vt=Array.isArray,_u=t=>Gh(t)==="[object Map]",$u=t=>Gh(t)==="[object Set]",pR=t=>Gh(t)==="[object Date]",Wt=t=>typeof t=="function",yr=t=>typeof t=="string",Ph=t=>typeof t=="symbol",OA=t=>t!==null&&typeof t=="object",fR=t=>OA(t)&&Wt(t.then)&&Wt(t.catch),ER=Object.prototype.toString,Gh=t=>ER.call(t),Ej=t=>Gh(t).slice(8,-1),CR=t=>Gh(t)==="[object Object]",Ow=t=>yr(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,uE=kA(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),lE=t=>{const e=Object.create(null);return A=>e[A]||(e[A]=t(A))},Cj=/-(\w)/g,el=lE(t=>t.replace(Cj,(e,A)=>A?A.toUpperCase():"")),Ij=/\B([A-Z])/g,Bc=lE(t=>t.replace(Ij,"-$1").toLowerCase()),IR=lE(t=>t.charAt(0).toUpperCase()+t.slice(1)),bw=lE(t=>t?`on${IR(t)}`:""),jh=(t,e)=>!Object.is(t,e),hE=(t,e)=>{for(let A=0;A<t.length;A++)t[A](e)},gE=(t,e,A)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:A})},dE=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Bj=t=>{const e=yr(t)?Number(t):NaN;return isNaN(e)?t:e};let BR;const xw=()=>BR||(BR=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Nw(t){if(vt(t)){const e={};for(let A=0;A<t.length;A++){const r=t[A],i=yr(r)?mj(r):Nw(r);if(i)for(const n in i)e[n]=i[n]}return e}else{if(yr(t))return t;if(OA(t))return t}}const vj=/;(?![^(]*\))/g,wj=/:([^]+)/,Sj=/\/\*[^]*?\*\//g;function mj(t){const e={};return t.replace(Sj,"").split(vj).forEach(A=>{if(A){const r=A.split(wj);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function mt(t){let e="";if(yr(t))e=t;else if(vt(t))for(let A=0;A<t.length;A++){const r=mt(t[A]);r&&(e+=r+" ")}else if(OA(t))for(const A in t)t[A]&&(e+=A+" ");return e.trim()}const Mj=kA("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function vR(t){return!!t||t===""}function yj(t,e){if(t.length!==e.length)return!1;let A=!0;for(let r=0;A&&r<t.length;r++)A=Yh(t[r],e[r]);return A}function Yh(t,e){if(t===e)return!0;let A=pR(t),r=pR(e);if(A||r)return A&&r?t.getTime()===e.getTime():!1;if(A=Ph(t),r=Ph(e),A||r)return t===e;if(A=vt(t),r=vt(e),A||r)return A&&r?yj(t,e):!1;if(A=OA(t),r=OA(e),A||r){if(!A||!r)return!1;const i=Object.keys(t).length,n=Object.keys(e).length;if(i!==n)return!1;for(const o in t){const s=t.hasOwnProperty(o),a=e.hasOwnProperty(o);if(s&&!a||!s&&a||!Yh(t[o],e[o]))return!1}}return String(t)===String(e)}function Kw(t,e){return t.findIndex(A=>Yh(A,e))}const bt=t=>yr(t)?t:t==null?"":vt(t)||OA(t)&&(t.toString===ER||!Wt(t.toString))?JSON.stringify(t,wR,2):String(t),wR=(t,e)=>e&&e.__v_isRef?wR(t,e.value):_u(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((A,[r,i])=>(A[`${r} =>`]=i,A),{})}:$u(e)?{[`Set(${e.size})`]:[...e.values()]}:OA(e)&&!vt(e)&&!CR(e)?String(e):e;let In;class SR{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=In,!e&&In&&(this.index=(In.scopes||(In.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const A=In;try{return In=this,e()}finally{In=A}}}on(){In=this}off(){In=this.parent}stop(e){if(this._active){let A,r;for(A=0,r=this.effects.length;A<r;A++)this.effects[A].stop();for(A=0,r=this.cleanups.length;A<r;A++)this.cleanups[A]();if(this.scopes)for(A=0,r=this.scopes.length;A<r;A++)this.scopes[A].stop(!0);if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function mR(t){return new SR(t)}function Qj(t,e=In){e&&e.active&&e.effects.push(t)}function MR(){return In}function Rj(t){In&&In.cleanups.push(t)}const kw=t=>{const e=new Set(t);return e.w=0,e.n=0,e},yR=t=>(t.w&Aa)>0,QR=t=>(t.n&Aa)>0,Dj=({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=Aa},Tj=t=>{const{deps:e}=t;if(e.length){let A=0;for(let r=0;r<e.length;r++){const i=e[r];yR(i)&&!QR(i)?i.delete(t):e[A++]=i,i.w&=~Aa,i.n&=~Aa}e.length=A}},pE=new WeakMap;let Hh=0,Aa=1;const Pw=30;let os;const vc=Symbol(""),Gw=Symbol("");class jw{constructor(e,A=null,r){this.fn=e,this.scheduler=A,this.active=!0,this.deps=[],this.parent=void 0,Qj(this,r)}run(){if(!this.active)return this.fn();let e=os,A=ra;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=os,os=this,ra=!0,Aa=1<<++Hh,Hh<=Pw?Dj(this):RR(this),this.fn()}finally{Hh<=Pw&&Tj(this),Aa=1<<--Hh,os=this.parent,ra=A,this.parent=void 0,this.deferStop&&this.stop()}}stop(){os===this?this.deferStop=!0:this.active&&(RR(this),this.onStop&&this.onStop(),this.active=!1)}}function RR(t){const{deps:e}=t;if(e.length){for(let A=0;A<e.length;A++)e[A].delete(t);e.length=0}}let ra=!0;const DR=[];function tl(){DR.push(ra),ra=!1}function Al(){const t=DR.pop();ra=t===void 0?!0:t}function rn(t,e,A){if(ra&&os){let r=pE.get(t);r||pE.set(t,r=new Map);let i=r.get(A);i||r.set(A,i=kw()),TR(i)}}function TR(t,e){let A=!1;Hh<=Pw?QR(t)||(t.n|=Aa,A=!yR(t)):A=!t.has(os),A&&(t.add(os),os.deps.push(t))}function no(t,e,A,r,i,n){const o=pE.get(t);if(!o)return;let s=[];if(e==="clear")s=[...o.values()];else if(A==="length"&&vt(t)){const a=Number(r);o.forEach((c,u)=>{(u==="length"||u>=a)&&s.push(c)})}else switch(A!==void 0&&s.push(o.get(A)),e){case"add":vt(t)?Ow(A)&&s.push(o.get("length")):(s.push(o.get(vc)),_u(t)&&s.push(o.get(Gw)));break;case"delete":vt(t)||(s.push(o.get(vc)),_u(t)&&s.push(o.get(Gw)));break;case"set":_u(t)&&s.push(o.get(vc));break}if(s.length===1)s[0]&&Yw(s[0]);else{const a=[];for(const c of s)c&&a.push(...c);Yw(kw(a))}}function Yw(t,e){const A=vt(t)?t:[...t];for(const r of A)r.computed&&UR(r);for(const r of A)r.computed||UR(r)}function UR(t,e){(t!==os||t.allowRecurse)&&(t.scheduler?t.scheduler():t.run())}function Uj(t,e){var A;return(A=pE.get(t))==null?void 0:A.get(e)}const Lj=kA("__proto__,__v_isRef,__isVue"),LR=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ph)),Fj=Hw(),Oj=Hw(!1,!0),bj=Hw(!0),FR=xj();function xj(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...A){const r=gA(this);for(let n=0,o=this.length;n<o;n++)rn(r,"get",n+"");const i=r[e](...A);return i===-1||i===!1?r[e](...A.map(gA)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...A){tl();const r=gA(this)[e].apply(this,A);return Al(),r}}),t}function Nj(t){const e=gA(this);return rn(e,"has",t),e.hasOwnProperty(t)}function Hw(t=!1,e=!1){return function(r,i,n){if(i==="__v_isReactive")return!t;if(i==="__v_isReadonly")return t;if(i==="__v_isShallow")return e;if(i==="__v_raw"&&n===(t?e?$j:jR:e?GR:PR).get(r))return r;const o=vt(r);if(!t){if(o&&EA(FR,i))return Reflect.get(FR,i,n);if(i==="hasOwnProperty")return Nj}const s=Reflect.get(r,i,n);return(Ph(i)?LR.has(i):Lj(i))||(t||rn(r,"get",i),e)?s:hr(s)?o&&Ow(i)?s:s.value:OA(s)?t?YR(s):rl(s):s}}const Kj=OR(),kj=OR(!0);function OR(t=!1){return function(A,r,i,n){let o=A[r];if(il(o)&&hr(o)&&!hr(i))return!1;if(!t&&(!wE(i)&&!il(i)&&(o=gA(o),i=gA(i)),!vt(A)&&hr(o)&&!hr(i)))return o.value=i,!0;const s=vt(A)&&Ow(r)?Number(r)<A.length:EA(A,r),a=Reflect.set(A,r,i,n);return A===gA(n)&&(s?jh(i,o)&&no(A,"set",r,i):no(A,"add",r,i)),a}}function Pj(t,e){const A=EA(t,e);t[e];const r=Reflect.deleteProperty(t,e);return r&&A&&no(t,"delete",e,void 0),r}function Gj(t,e){const A=Reflect.has(t,e);return(!Ph(e)||!LR.has(e))&&rn(t,"has",e),A}function jj(t){return rn(t,"iterate",vt(t)?"length":vc),Reflect.ownKeys(t)}const bR={get:Fj,set:Kj,deleteProperty:Pj,has:Gj,ownKeys:jj},Yj={get:bj,set(t,e){return!0},deleteProperty(t,e){return!0}},Hj=Mr({},bR,{get:Oj,set:kj}),zw=t=>t,fE=t=>Reflect.getPrototypeOf(t);function EE(t,e,A=!1,r=!1){t=t.__v_raw;const i=gA(t),n=gA(e);A||(e!==n&&rn(i,"get",e),rn(i,"get",n));const{has:o}=fE(i),s=r?zw:A?Vw:zh;if(o.call(i,e))return s(t.get(e));if(o.call(i,n))return s(t.get(n));t!==i&&t.get(e)}function CE(t,e=!1){const A=this.__v_raw,r=gA(A),i=gA(t);return e||(t!==i&&rn(r,"has",t),rn(r,"has",i)),t===i?A.has(t):A.has(t)||A.has(i)}function IE(t,e=!1){return t=t.__v_raw,!e&&rn(gA(t),"iterate",vc),Reflect.get(t,"size",t)}function xR(t){t=gA(t);const e=gA(this);return fE(e).has.call(e,t)||(e.add(t),no(e,"add",t,t)),this}function NR(t,e){e=gA(e);const A=gA(this),{has:r,get:i}=fE(A);let n=r.call(A,t);n||(t=gA(t),n=r.call(A,t));const o=i.call(A,t);return A.set(t,e),n?jh(e,o)&&no(A,"set",t,e):no(A,"add",t,e),this}function KR(t){const e=gA(this),{has:A,get:r}=fE(e);let i=A.call(e,t);i||(t=gA(t),i=A.call(e,t)),r&&r.call(e,t);const n=e.delete(t);return i&&no(e,"delete",t,void 0),n}function kR(){const t=gA(this),e=t.size!==0,A=t.clear();return e&&no(t,"clear",void 0,void 0),A}function BE(t,e){return function(r,i){const n=this,o=n.__v_raw,s=gA(o),a=e?zw:t?Vw:zh;return!t&&rn(s,"iterate",vc),o.forEach((c,u)=>r.call(i,a(c),a(u),n))}}function vE(t,e,A){return function(...r){const i=this.__v_raw,n=gA(i),o=_u(n),s=t==="entries"||t===Symbol.iterator&&o,a=t==="keys"&&o,c=i[t](...r),u=A?zw:e?Vw:zh;return!e&&rn(n,"iterate",a?Gw:vc),{next(){const{value:l,done:g}=c.next();return g?{value:l,done:g}:{value:s?[u(l[0]),u(l[1])]:u(l),done:g}},[Symbol.iterator](){return this}}}}function ia(t){return function(...e){return t==="delete"?!1:this}}function zj(){const t={get(n){return EE(this,n)},get size(){return IE(this)},has:CE,add:xR,set:NR,delete:KR,clear:kR,forEach:BE(!1,!1)},e={get(n){return EE(this,n,!1,!0)},get size(){return IE(this)},has:CE,add:xR,set:NR,delete:KR,clear:kR,forEach:BE(!1,!0)},A={get(n){return EE(this,n,!0)},get size(){return IE(this,!0)},has(n){return CE.call(this,n,!0)},add:ia("add"),set:ia("set"),delete:ia("delete"),clear:ia("clear"),forEach:BE(!0,!1)},r={get(n){return EE(this,n,!0,!0)},get size(){return IE(this,!0)},has(n){return CE.call(this,n,!0)},add:ia("add"),set:ia("set"),delete:ia("delete"),clear:ia("clear"),forEach:BE(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=vE(n,!1,!1),A[n]=vE(n,!0,!1),e[n]=vE(n,!1,!0),r[n]=vE(n,!0,!0)}),[t,A,e,r]}const[Jj,qj,Vj,Wj]=zj();function Jw(t,e){const A=e?t?Wj:Vj:t?qj:Jj;return(r,i,n)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(EA(A,i)&&i in r?A:r,i,n)}const Zj={get:Jw(!1,!1)},Xj={get:Jw(!1,!0)},_j={get:Jw(!0,!1)},PR=new WeakMap,GR=new WeakMap,jR=new WeakMap,$j=new WeakMap;function e8(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function t8(t){return t.__v_skip||!Object.isExtensible(t)?0:e8(Ej(t))}function rl(t){return il(t)?t:qw(t,!1,bR,Zj,PR)}function A8(t){return qw(t,!1,Hj,Xj,GR)}function YR(t){return qw(t,!0,Yj,_j,jR)}function qw(t,e,A,r,i){if(!OA(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const n=i.get(t);if(n)return n;const o=t8(t);if(o===0)return t;const s=new Proxy(t,o===2?r:A);return i.set(t,s),s}function na(t){return il(t)?na(t.__v_raw):!!(t&&t.__v_isReactive)}function il(t){return!!(t&&t.__v_isReadonly)}function wE(t){return!!(t&&t.__v_isShallow)}function HR(t){return na(t)||il(t)}function gA(t){const e=t&&t.__v_raw;return e?gA(e):t}function SE(t){return gE(t,"__v_skip",!0),t}const zh=t=>OA(t)?rl(t):t,Vw=t=>OA(t)?YR(t):t;function zR(t){ra&&os&&(t=gA(t),TR(t.dep||(t.dep=kw())))}function JR(t,e){t=gA(t);const A=t.dep;A&&Yw(A)}function hr(t){return!!(t&&t.__v_isRef===!0)}function ne(t){return qR(t,!1)}function r8(t){return qR(t,!0)}function qR(t,e){return hr(t)?t:new i8(t,e)}class i8{constructor(e,A){this.__v_isShallow=A,this.dep=void 0,this.__v_isRef=!0,this._rawValue=A?e:gA(e),this._value=A?e:zh(e)}get value(){return zR(this),this._value}set value(e){const A=this.__v_isShallow||wE(e)||il(e);e=A?e:gA(e),jh(e,this._rawValue)&&(this._rawValue=e,this._value=A?e:zh(e),JR(this))}}function fe(t){return hr(t)?t.value:t}const n8={get:(t,e,A)=>fe(Reflect.get(t,e,A)),set:(t,e,A,r)=>{const i=t[e];return hr(i)&&!hr(A)?(i.value=A,!0):Reflect.set(t,e,A,r)}};function VR(t){return na(t)?t:new Proxy(t,n8)}function s8(t){const e=vt(t)?new Array(t.length):{};for(const A in t)e[A]=a8(t,A);return e}class o8{constructor(e,A,r){this._object=e,this._key=A,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return Uj(gA(this._object),this._key)}}function a8(t,e,A){const r=t[e];return hr(r)?r:new o8(t,e,A)}class c8{constructor(e,A,r,i){this._setter=A,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new jw(e,()=>{this._dirty||(this._dirty=!0,JR(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=gA(this);return zR(e),(e._dirty||!e._cacheable)&&(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function u8(t,e,A=!1){let r,i;const n=Wt(t);return n?(r=t,i=An):(r=t.get,i=t.set),new c8(r,i,n||!i,A)}function r1e(t,...e){}function sa(t,e,A,r){let i;try{i=r?t(...r):t()}catch(n){mE(n,e,A)}return i}function Kn(t,e,A,r){if(Wt(t)){const n=sa(t,e,A,r);return n&&fR(n)&&n.catch(o=>{mE(o,e,A)}),n}const i=[];for(let n=0;n<t.length;n++)i.push(Kn(t[n],e,A,r));return i}function mE(t,e,A,r=!0){const i=e?e.vnode:null;if(e){let n=e.parent;const o=e.proxy,s=A;for(;n;){const c=n.ec;if(c){for(let u=0;u<c.length;u++)if(c[u](t,o,s)===!1)return}n=n.parent}const a=e.appContext.config.errorHandler;if(a){sa(a,null,10,[t,o,s]);return}}l8(t,A,i,r)}function l8(t,e,A,r=!0){console.error(t)}let Jh=!1,Ww=!1;const wi=[];let Fs=0;const nl=[];let so=null,wc=0;const WR=Promise.resolve();let Zw=null;function Xw(t){const e=Zw||WR;return t?e.then(this?t.bind(this):t):e}function h8(t){let e=Fs+1,A=wi.length;for(;e<A;){const r=e+A>>>1;qh(wi[r])<t?e=r+1:A=r}return e}function _w(t){(!wi.length||!wi.includes(t,Jh&&t.allowRecurse?Fs+1:Fs))&&(t.id==null?wi.push(t):wi.splice(h8(t.id),0,t),ZR())}function ZR(){!Jh&&!Ww&&(Ww=!0,Zw=WR.then($R))}function g8(t){const e=wi.indexOf(t);e>Fs&&wi.splice(e,1)}function d8(t){vt(t)?nl.push(...t):(!so||!so.includes(t,t.allowRecurse?wc+1:wc))&&nl.push(t),ZR()}function XR(t,e=Jh?Fs+1:0){for(;e<wi.length;e++){const A=wi[e];A&&A.pre&&(wi.splice(e,1),e--,A())}}function _R(t){if(nl.length){const e=[...new Set(nl)];if(nl.length=0,so){so.push(...e);return}for(so=e,so.sort((A,r)=>qh(A)-qh(r)),wc=0;wc<so.length;wc++)so[wc]();so=null,wc=0}}const qh=t=>t.id==null?1/0:t.id,p8=(t,e)=>{const A=qh(t)-qh(e);if(A===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return A};function $R(t){Ww=!1,Jh=!0,wi.sort(p8);const e=An;try{for(Fs=0;Fs<wi.length;Fs++){const A=wi[Fs];A&&A.active!==!1&&sa(A,null,14)}}finally{Fs=0,wi.length=0,_R(),Jh=!1,Zw=null,(wi.length||nl.length)&&$R()}}function f8(t,e,...A){if(t.isUnmounted)return;const r=t.vnode.props||Ft;let i=A;const n=e.startsWith("update:"),o=n&&e.slice(7);if(o&&o in r){const u=`${o==="modelValue"?"model":o}Modifiers`,{number:l,trim:g}=r[u]||Ft;g&&(i=A.map(h=>yr(h)?h.trim():h)),l&&(i=A.map(dE))}let s,a=r[s=bw(e)]||r[s=bw(el(e))];!a&&n&&(a=r[s=bw(Bc(e))]),a&&Kn(a,t,6,i);const c=r[s+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[s])return;t.emitted[s]=!0,Kn(c,t,6,i)}}function eD(t,e,A=!1){const r=e.emitsCache,i=r.get(t);if(i!==void 0)return i;const n=t.emits;let o={},s=!1;if(!Wt(t)){const a=c=>{const u=eD(c,e,!0);u&&(s=!0,Mr(o,u))};!A&&e.mixins.length&&e.mixins.forEach(a),t.extends&&a(t.extends),t.mixins&&t.mixins.forEach(a)}return!n&&!s?(OA(t)&&r.set(t,null),null):(vt(n)?n.forEach(a=>o[a]=null):Mr(o,n),OA(t)&&r.set(t,o),o)}function ME(t,e){return!t||!cE(e)?!1:(e=e.slice(2).replace(/Once$/,""),EA(t,e[0].toLowerCase()+e.slice(1))||EA(t,Bc(e))||EA(t,e))}let ni=null,yE=null;function QE(t){const e=ni;return ni=t,yE=t&&t.type.__scopeId||null,e}function xr(t){yE=t}function Nr(){yE=null}function nn(t,e=ni,A){if(!e||t._n)return t;const r=(...i)=>{r._d&&DD(-1);const n=QE(e);let o;try{o=t(...i)}finally{QE(n),r._d&&DD(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function i1e(){}function $w(t){const{type:e,vnode:A,proxy:r,withProxy:i,props:n,propsOptions:[o],slots:s,attrs:a,emit:c,render:u,renderCache:l,data:g,setupState:h,ctx:p,inheritAttrs:C}=t;let I,E;const v=QE(t);try{if(A.shapeFlag&4){const M=i||r;I=Os(u.call(M,M,l,n,h,g,p)),E=a}else{const M=e;I=Os(M.length>1?M(n,{attrs:a,slots:s,emit:c}):M(n,null)),E=e.props?a:E8(a)}}catch(M){$h.length=0,mE(M,t,1),I=ot(Pn)}let m=I;if(E&&C!==!1){const M=Object.keys(E),{shapeFlag:O}=m;M.length&&O&7&&(o&&M.some(Lw)&&(E=C8(E,o)),m=oa(m,E))}return A.dirs&&(m=oa(m),m.dirs=m.dirs?m.dirs.concat(A.dirs):A.dirs),A.transition&&(m.transition=A.transition),I=m,QE(v),I}const E8=t=>{let e;for(const A in t)(A==="class"||A==="style"||cE(A))&&((e||(e={}))[A]=t[A]);return e},C8=(t,e)=>{const A={};for(const r in t)(!Lw(r)||!(r.slice(9)in e))&&(A[r]=t[r]);return A};function I8(t,e,A){const{props:r,children:i,component:n}=t,{props:o,children:s,patchFlag:a}=e,c=n.emitsOptions;if(e.dirs||e.transition)return!0;if(A&&a>=0){if(a&1024)return!0;if(a&16)return r?tD(r,o,c):!!o;if(a&8){const u=e.dynamicProps;for(let l=0;l<u.length;l++){const g=u[l];if(o[g]!==r[g]&&!ME(c,g))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?tD(r,o,c):!0:!!o;return!1}function tD(t,e,A){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let i=0;i<r.length;i++){const n=r[i];if(e[n]!==t[n]&&!ME(A,n))return!0}return!1}function B8({vnode:t,parent:e},A){for(;e&&e.subTree===t;)(t=e.vnode).el=A,e=e.parent}const v8=t=>t.__isSuspense;function w8(t,e){e&&e.pendingBranch?vt(t)?e.effects.push(...t):e.effects.push(t):d8(t)}const RE={};function oo(t,e,A){return AD(t,e,A)}function AD(t,e,{immediate:A,deep:r,flush:i,onTrack:n,onTrigger:o}=Ft){var s;const a=MR()===((s=qr)==null?void 0:s.scope)?qr:null;let c,u=!1,l=!1;if(hr(t)?(c=()=>t.value,u=wE(t)):na(t)?(c=()=>t,r=!0):vt(t)?(l=!0,u=t.some(M=>na(M)||wE(M)),c=()=>t.map(M=>{if(hr(M))return M.value;if(na(M))return Sc(M);if(Wt(M))return sa(M,a,2)})):Wt(t)?e?c=()=>sa(t,a,2):c=()=>{if(!(a&&a.isUnmounted))return g&&g(),Kn(t,a,3,[h])}:c=An,e&&r){const M=c;c=()=>Sc(M())}let g,h=M=>{g=v.onStop=()=>{sa(M,a,4)}},p;if(tg)if(h=An,e?A&&Kn(e,a,3,[c(),l?[]:void 0,h]):c(),i==="sync"){const M=gY();p=M.__watcherHandles||(M.__watcherHandles=[])}else return An;let C=l?new Array(t.length).fill(RE):RE;const I=()=>{if(v.active)if(e){const M=v.run();(r||u||(l?M.some((O,x)=>jh(O,C[x])):jh(M,C)))&&(g&&g(),Kn(e,a,3,[M,C===RE?void 0:l&&C[0]===RE?[]:C,h]),C=M)}else v.run()};I.allowRecurse=!!e;let E;i==="sync"?E=I:i==="post"?E=()=>on(I,a&&a.suspense):(I.pre=!0,a&&(I.id=a.uid),E=()=>_w(I));const v=new jw(c,E);e?A?I():C=v.run():i==="post"?on(v.run.bind(v),a&&a.suspense):v.run();const m=()=>{v.stop(),a&&a.scope&&Fw(a.scope.effects,v)};return p&&p.push(m),m}function S8(t,e,A){const r=this.proxy,i=yr(t)?t.includes(".")?rD(r,t):()=>r[t]:t.bind(r,r);let n;Wt(e)?n=e:(n=e.handler,A=e);const o=qr;al(this);const s=AD(i,n.bind(r),A);return o?al(o):Qc(),s}function rD(t,e){const A=e.split(".");return()=>{let r=t;for(let i=0;i<A.length&&r;i++)r=r[A[i]];return r}}function Sc(t,e){if(!OA(t)||t.__v_skip||(e=e||new Set,e.has(t)))return t;if(e.add(t),hr(t))Sc(t.value,e);else if(vt(t))for(let A=0;A<t.length;A++)Sc(t[A],e);else if($u(t)||_u(t))t.forEach(A=>{Sc(A,e)});else if(CR(t))for(const A in t)Sc(t[A],e);return t}function tA(t,e){const A=ni;if(A===null)return t;const r=kE(A)||A.proxy,i=t.dirs||(t.dirs=[]);for(let n=0;n<e.length;n++){let[o,s,a,c=Ft]=e[n];o&&(Wt(o)&&(o={mounted:o,updated:o}),o.deep&&Sc(s),i.push({dir:o,instance:r,value:s,oldValue:void 0,arg:a,modifiers:c}))}return t}function mc(t,e,A,r){const i=t.dirs,n=e&&e.dirs;for(let o=0;o<i.length;o++){const s=i[o];n&&(s.oldValue=n[o].value);let a=s.dir[r];a&&(tl(),Kn(a,A,8,[t.el,s,t,e]),Al())}}function m8(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sn(()=>{t.isMounted=!0}),Wh(()=>{t.isUnmounting=!0}),t}const kn=[Function,Array],iD={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:kn,onEnter:kn,onAfterEnter:kn,onEnterCancelled:kn,onBeforeLeave:kn,onLeave:kn,onAfterLeave:kn,onLeaveCancelled:kn,onBeforeAppear:kn,onAppear:kn,onAfterAppear:kn,onAppearCancelled:kn},M8={name:"BaseTransition",props:iD,setup(t,{slots:e}){const A=sY(),r=m8();let i;return()=>{const n=e.default&&oD(e.default(),!0);if(!n||!n.length)return;let o=n[0];if(n.length>1){for(const C of n)if(C.type!==Pn){o=C;break}}const s=gA(t),{mode:a}=s;if(r.isLeaving)return tS(o);const c=sD(o);if(!c)return tS(o);const u=eS(c,s,r,A);AS(c,u);const l=A.subTree,g=l&&sD(l);let h=!1;const{getTransitionKey:p}=c.type;if(p){const C=p();i===void 0?i=C:C!==i&&(i=C,h=!0)}if(g&&g.type!==Pn&&(!yc(c,g)||h)){const C=eS(g,s,r,A);if(AS(g,C),a==="out-in")return r.isLeaving=!0,C.afterLeave=()=>{r.isLeaving=!1,A.update.active!==!1&&A.update()},tS(o);a==="in-out"&&c.type!==Pn&&(C.delayLeave=(I,E,v)=>{const m=nD(r,g);m[String(g.key)]=g,I._leaveCb=()=>{E(),I._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=v})}return o}}};function nD(t,e){const{leavingVNodes:A}=t;let r=A.get(e.type);return r||(r=Object.create(null),A.set(e.type,r)),r}function eS(t,e,A,r){const{appear:i,mode:n,persisted:o=!1,onBeforeEnter:s,onEnter:a,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:l,onLeave:g,onAfterLeave:h,onLeaveCancelled:p,onBeforeAppear:C,onAppear:I,onAfterAppear:E,onAppearCancelled:v}=e,m=String(t.key),M=nD(A,t),O=(D,T)=>{D&&Kn(D,r,9,T)},x=(D,T)=>{const q=T[1];O(D,T),vt(D)?D.every(Q=>Q.length<=1)&&q():D.length<=1&&q()},P={mode:n,persisted:o,beforeEnter(D){let T=s;if(!A.isMounted)if(i)T=C||s;else return;D._leaveCb&&D._leaveCb(!0);const q=M[m];q&&yc(t,q)&&q.el._leaveCb&&q.el._leaveCb(),O(T,[D])},enter(D){let T=a,q=c,Q=u;if(!A.isMounted)if(i)T=I||a,q=E||c,Q=v||u;else return;let R=!1;const G=D._enterCb=k=>{R||(R=!0,k?O(Q,[D]):O(q,[D]),P.delayedLeave&&P.delayedLeave(),D._enterCb=void 0)};T?x(T,[D,G]):G()},leave(D,T){const q=String(t.key);if(D._enterCb&&D._enterCb(!0),A.isUnmounting)return T();O(l,[D]);let Q=!1;const R=D._leaveCb=G=>{Q||(Q=!0,T(),G?O(p,[D]):O(h,[D]),D._leaveCb=void 0,M[q]===t&&delete M[q])};M[q]=t,g?x(g,[D,R]):R()},clone(D){return eS(D,e,A,r)}};return P}function tS(t){if(DE(t))return t=oa(t),t.children=null,t}function sD(t){return DE(t)?t.children?t.children[0]:void 0:t}function AS(t,e){t.shapeFlag&6&&t.component?AS(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function oD(t,e=!1,A){let r=[],i=0;for(let n=0;n<t.length;n++){let o=t[n];const s=A==null?o.key:String(A)+String(o.key!=null?o.key:n);o.type===aA?(o.patchFlag&128&&i++,r=r.concat(oD(o.children,e,s))):(e||o.type!==Pn)&&r.push(s!=null?oa(o,{key:s}):o)}if(i>1)for(let n=0;n<r.length;n++)r[n].patchFlag=-2;return r}function Zt(t,e){return Wt(t)?(()=>Mr({name:t.name},e,{setup:t}))():t}const Vh=t=>!!t.type.__asyncLoader,DE=t=>t.type.__isKeepAlive;function y8(t,e){aD(t,"a",e)}function Q8(t,e){aD(t,"da",e)}function aD(t,e,A=qr){const r=t.__wdc||(t.__wdc=()=>{let i=A;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(TE(e,r,A),A){let i=A.parent;for(;i&&i.parent;)DE(i.parent.vnode)&&R8(r,e,A,i),i=i.parent}}function R8(t,e,A,r){const i=TE(e,t,r,!0);uD(()=>{Fw(r[e],i)},A)}function TE(t,e,A=qr,r=!1){if(A){const i=A[t]||(A[t]=[]),n=e.__weh||(e.__weh=(...o)=>{if(A.isUnmounted)return;tl(),al(A);const s=Kn(e,A,t,o);return Qc(),Al(),s});return r?i.unshift(n):i.push(n),n}}const ao=t=>(e,A=qr)=>(!tg||t==="sp")&&TE(t,(...r)=>e(...r),A),cD=ao("bm"),sn=ao("m"),D8=ao("bu"),UE=ao("u"),Wh=ao("bum"),uD=ao("um"),T8=ao("sp"),U8=ao("rtg"),L8=ao("rtc");function F8(t,e=qr){TE("ec",t,e)}const O8=Symbol.for("v-ndc");function Si(t,e,A,r){let i;const n=A&&A[r];if(vt(t)||yr(t)){i=new Array(t.length);for(let o=0,s=t.length;o<s;o++)i[o]=e(t[o],o,void 0,n&&n[o])}else if(typeof t=="number"){i=new Array(t);for(let o=0;o<t;o++)i[o]=e(o+1,o,void 0,n&&n[o])}else if(OA(t))if(t[Symbol.iterator])i=Array.from(t,(o,s)=>e(o,s,void 0,n&&n[s]));else{const o=Object.keys(t);i=new Array(o.length);for(let s=0,a=o.length;s<a;s++){const c=o[s];i[s]=e(t[c],c,s,n&&n[s])}}else i=[];return A&&(A[r]=i),i}function lD(t,e,A={},r,i){if(ni.isCE||ni.parent&&Vh(ni.parent)&&ni.parent.isCE)return e!=="default"&&(A.name=e),ot("slot",A,r&&r());let n=t[e];n&&n._c&&(n._d=!1),ue();const o=n&&hD(n(A)),s=co(aA,{key:A.key||o&&o.key||`_${e}`},o||(r?r():[]),o&&t._===1?64:-2);return!i&&s.scopeId&&(s.slotScopeIds=[s.scopeId+"-s"]),n&&n._c&&(n._d=!0),s}function hD(t){return t.some(e=>xE(e)?!(e.type===Pn||e.type===aA&&!hD(e.children)):!0)?t:null}const rS=t=>t?FD(t)?kE(t)||t.proxy:rS(t.parent):null,Zh=Mr(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>rS(t.parent),$root:t=>rS(t.root),$emit:t=>t.emit,$options:t=>sS(t),$forceUpdate:t=>t.f||(t.f=()=>_w(t.update)),$nextTick:t=>t.n||(t.n=Xw.bind(t.proxy)),$watch:t=>S8.bind(t)}),iS=(t,e)=>t!==Ft&&!t.__isScriptSetup&&EA(t,e),b8={get({_:t},e){const{ctx:A,setupState:r,data:i,props:n,accessCache:o,type:s,appContext:a}=t;let c;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return r[e];case 2:return i[e];case 4:return A[e];case 3:return n[e]}else{if(iS(r,e))return o[e]=1,r[e];if(i!==Ft&&EA(i,e))return o[e]=2,i[e];if((c=t.propsOptions[0])&&EA(c,e))return o[e]=3,n[e];if(A!==Ft&&EA(A,e))return o[e]=4,A[e];nS&&(o[e]=0)}}const u=Zh[e];let l,g;if(u)return e==="$attrs"&&rn(t,"get",e),u(t);if((l=s.__cssModules)&&(l=l[e]))return l;if(A!==Ft&&EA(A,e))return o[e]=4,A[e];if(g=a.config.globalProperties,EA(g,e))return g[e]},set({_:t},e,A){const{data:r,setupState:i,ctx:n}=t;return iS(i,e)?(i[e]=A,!0):r!==Ft&&EA(r,e)?(r[e]=A,!0):EA(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(n[e]=A,!0)},has({_:{data:t,setupState:e,accessCache:A,ctx:r,appContext:i,propsOptions:n}},o){let s;return!!A[o]||t!==Ft&&EA(t,o)||iS(e,o)||(s=n[0])&&EA(s,o)||EA(r,o)||EA(Zh,o)||EA(i.config.globalProperties,o)},defineProperty(t,e,A){return A.get!=null?t._.accessCache[e]=0:EA(A,"value")&&this.set(t,e,A.value,null),Reflect.defineProperty(t,e,A)}};function gD(t){return vt(t)?t.reduce((e,A)=>(e[A]=null,e),{}):t}let nS=!0;function x8(t){const e=sS(t),A=t.proxy,r=t.ctx;nS=!1,e.beforeCreate&&dD(e.beforeCreate,t,"bc");const{data:i,computed:n,methods:o,watch:s,provide:a,inject:c,created:u,beforeMount:l,mounted:g,beforeUpdate:h,updated:p,activated:C,deactivated:I,beforeDestroy:E,beforeUnmount:v,destroyed:m,unmounted:M,render:O,renderTracked:x,renderTriggered:P,errorCaptured:D,serverPrefetch:T,expose:q,inheritAttrs:Q,components:R,directives:G,filters:k}=e;if(c&&N8(c,r,null),o)for(const ie in o){const W=o[ie];Wt(W)&&(r[ie]=W.bind(A))}if(i){const ie=i.call(A,A);OA(ie)&&(t.data=rl(ie))}if(nS=!0,n)for(const ie in n){const W=n[ie],se=Wt(W)?W.bind(A,A):Wt(W.get)?W.get.bind(A,A):An,Be=!Wt(W)&&Wt(W.set)?W.set.bind(A):An,Ee=er({get:se,set:Be});Object.defineProperty(r,ie,{enumerable:!0,configurable:!0,get:()=>Ee.value,set:U=>Ee.value=U})}if(s)for(const ie in s)pD(s[ie],r,A,ie);if(a){const ie=Wt(a)?a.call(A):a;Reflect.ownKeys(ie).forEach(W=>{FE(W,ie[W])})}u&&dD(u,t,"c");function X(ie,W){vt(W)?W.forEach(se=>ie(se.bind(A))):W&&ie(W.bind(A))}if(X(cD,l),X(sn,g),X(D8,h),X(UE,p),X(y8,C),X(Q8,I),X(F8,D),X(L8,x),X(U8,P),X(Wh,v),X(uD,M),X(T8,T),vt(q))if(q.length){const ie=t.exposed||(t.exposed={});q.forEach(W=>{Object.defineProperty(ie,W,{get:()=>A[W],set:se=>A[W]=se})})}else t.exposed||(t.exposed={});O&&t.render===An&&(t.render=O),Q!=null&&(t.inheritAttrs=Q),R&&(t.components=R),G&&(t.directives=G)}function N8(t,e,A=An){vt(t)&&(t=oS(t));for(const r in t){const i=t[r];let n;OA(i)?"default"in i?n=as(i.from||r,i.default,!0):n=as(i.from||r):n=as(i),hr(n)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>n.value,set:o=>n.value=o}):e[r]=n}}function dD(t,e,A){Kn(vt(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,A)}function pD(t,e,A,r){const i=r.includes(".")?rD(A,r):()=>A[r];if(yr(t)){const n=e[t];Wt(n)&&oo(i,n)}else if(Wt(t))oo(i,t.bind(A));else if(OA(t))if(vt(t))t.forEach(n=>pD(n,e,A,r));else{const n=Wt(t.handler)?t.handler.bind(A):e[t.handler];Wt(n)&&oo(i,n,t)}}function sS(t){const e=t.type,{mixins:A,extends:r}=e,{mixins:i,optionsCache:n,config:{optionMergeStrategies:o}}=t.appContext,s=n.get(e);let a;return s?a=s:!i.length&&!A&&!r?a=e:(a={},i.length&&i.forEach(c=>LE(a,c,o,!0)),LE(a,e,o)),OA(e)&&n.set(e,a),a}function LE(t,e,A,r=!1){const{mixins:i,extends:n}=e;n&&LE(t,n,A,!0),i&&i.forEach(o=>LE(t,o,A,!0));for(const o in e)if(!(r&&o==="expose")){const s=K8[o]||A&&A[o];t[o]=s?s(t[o],e[o]):e[o]}return t}const K8={data:fD,props:ED,emits:ED,methods:Xh,computed:Xh,beforeCreate:ji,created:ji,beforeMount:ji,mounted:ji,beforeUpdate:ji,updated:ji,beforeDestroy:ji,beforeUnmount:ji,destroyed:ji,unmounted:ji,activated:ji,deactivated:ji,errorCaptured:ji,serverPrefetch:ji,components:Xh,directives:Xh,watch:P8,provide:fD,inject:k8};function fD(t,e){return e?t?function(){return Mr(Wt(t)?t.call(this,this):t,Wt(e)?e.call(this,this):e)}:e:t}function k8(t,e){return Xh(oS(t),oS(e))}function oS(t){if(vt(t)){const e={};for(let A=0;A<t.length;A++)e[t[A]]=t[A];return e}return t}function ji(t,e){return t?[...new Set([].concat(t,e))]:e}function Xh(t,e){return t?Mr(Object.create(null),t,e):e}function ED(t,e){return t?vt(t)&&vt(e)?[...new Set([...t,...e])]:Mr(Object.create(null),gD(t),gD(e??{})):e}function P8(t,e){if(!t)return e;if(!e)return t;const A=Mr(Object.create(null),t);for(const r in e)A[r]=ji(t[r],e[r]);return A}function CD(){return{app:null,config:{isNativeTag:dj,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let G8=0;function j8(t,e){return function(r,i=null){Wt(r)||(r=Mr({},r)),i!=null&&!OA(i)&&(i=null);const n=CD(),o=new Set;let s=!1;const a=n.app={_uid:G8++,_component:r,_props:i,_container:null,_context:n,_instance:null,version:dY,get config(){return n.config},set config(c){},use(c,...u){return o.has(c)||(c&&Wt(c.install)?(o.add(c),c.install(a,...u)):Wt(c)&&(o.add(c),c(a,...u))),a},mixin(c){return n.mixins.includes(c)||n.mixins.push(c),a},component(c,u){return u?(n.components[c]=u,a):n.components[c]},directive(c,u){return u?(n.directives[c]=u,a):n.directives[c]},mount(c,u,l){if(!s){const g=ot(r,i);return g.appContext=n,u&&e?e(g,c):t(g,c,l),s=!0,a._container=c,c.__vue_app__=a,kE(g.component)||g.component.proxy}},unmount(){s&&(t(null,a._container),delete a._container.__vue_app__)},provide(c,u){return n.provides[c]=u,a},runWithContext(c){_h=a;try{return c()}finally{_h=null}}};return a}}let _h=null;function FE(t,e){if(qr){let A=qr.provides;const r=qr.parent&&qr.parent.provides;r===A&&(A=qr.provides=Object.create(r)),A[t]=e}}function as(t,e,A=!1){const r=qr||ni;if(r||_h){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:_h._context.provides;if(i&&t in i)return i[t];if(arguments.length>1)return A&&Wt(e)?e.call(r&&r.proxy):e}}function Y8(){return!!(qr||ni||_h)}function H8(t,e,A,r=!1){const i={},n={};gE(n,NE,1),t.propsDefaults=Object.create(null),ID(t,e,i,n);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);A?t.props=r?i:A8(i):t.type.props?t.props=i:t.props=n,t.attrs=n}function z8(t,e,A,r){const{props:i,attrs:n,vnode:{patchFlag:o}}=t,s=gA(i),[a]=t.propsOptions;let c=!1;if((r||o>0)&&!(o&16)){if(o&8){const u=t.vnode.dynamicProps;for(let l=0;l<u.length;l++){let g=u[l];if(ME(t.emitsOptions,g))continue;const h=e[g];if(a)if(EA(n,g))h!==n[g]&&(n[g]=h,c=!0);else{const p=el(g);i[p]=aS(a,s,p,h,t,!1)}else h!==n[g]&&(n[g]=h,c=!0)}}}else{ID(t,e,i,n)&&(c=!0);let u;for(const l in s)(!e||!EA(e,l)&&((u=Bc(l))===l||!EA(e,u)))&&(a?A&&(A[l]!==void 0||A[u]!==void 0)&&(i[l]=aS(a,s,l,void 0,t,!0)):delete i[l]);if(n!==s)for(const l in n)(!e||!EA(e,l))&&(delete n[l],c=!0)}c&&no(t,"set","$attrs")}function ID(t,e,A,r){const[i,n]=t.propsOptions;let o=!1,s;if(e)for(let a in e){if(uE(a))continue;const c=e[a];let u;i&&EA(i,u=el(a))?!n||!n.includes(u)?A[u]=c:(s||(s={}))[u]=c:ME(t.emitsOptions,a)||(!(a in r)||c!==r[a])&&(r[a]=c,o=!0)}if(n){const a=gA(A),c=s||Ft;for(let u=0;u<n.length;u++){const l=n[u];A[l]=aS(i,a,l,c[l],t,!EA(c,l))}}return o}function aS(t,e,A,r,i,n){const o=t[A];if(o!=null){const s=EA(o,"default");if(s&&r===void 0){const a=o.default;if(o.type!==Function&&!o.skipFactory&&Wt(a)){const{propsDefaults:c}=i;A in c?r=c[A]:(al(i),r=c[A]=a.call(null,e),Qc())}else r=a}o[0]&&(n&&!s?r=!1:o[1]&&(r===""||r===Bc(A))&&(r=!0))}return r}function BD(t,e,A=!1){const r=e.propsCache,i=r.get(t);if(i)return i;const n=t.props,o={},s=[];let a=!1;if(!Wt(t)){const u=l=>{a=!0;const[g,h]=BD(l,e,!0);Mr(o,g),h&&s.push(...h)};!A&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!n&&!a)return OA(t)&&r.set(t,ZA),ZA;if(vt(n))for(let u=0;u<n.length;u++){const l=el(n[u]);vD(l)&&(o[l]=Ft)}else if(n)for(const u in n){const l=el(u);if(vD(l)){const g=n[u],h=o[l]=vt(g)||Wt(g)?{type:g}:Mr({},g);if(h){const p=mD(Boolean,h.type),C=mD(String,h.type);h[0]=p>-1,h[1]=C<0||p<C,(p>-1||EA(h,"default"))&&s.push(l)}}}const c=[o,s];return OA(t)&&r.set(t,c),c}function vD(t){return t[0]!=="$"}function wD(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function SD(t,e){return wD(t)===wD(e)}function mD(t,e){return vt(e)?e.findIndex(A=>SD(A,t)):Wt(e)&&SD(e,t)?0:-1}const MD=t=>t[0]==="_"||t==="$stable",cS=t=>vt(t)?t.map(Os):[Os(t)],J8=(t,e,A)=>{if(e._n)return e;const r=nn((...i)=>cS(e(...i)),A);return r._c=!1,r},yD=(t,e,A)=>{const r=t._ctx;for(const i in t){if(MD(i))continue;const n=t[i];if(Wt(n))e[i]=J8(i,n,r);else if(n!=null){const o=cS(n);e[i]=()=>o}}},QD=(t,e)=>{const A=cS(e);t.slots.default=()=>A},q8=(t,e)=>{if(t.vnode.shapeFlag&32){const A=e._;A?(t.slots=gA(e),gE(e,"_",A)):yD(e,t.slots={})}else t.slots={},e&&QD(t,e);gE(t.slots,NE,1)},V8=(t,e,A)=>{const{vnode:r,slots:i}=t;let n=!0,o=Ft;if(r.shapeFlag&32){const s=e._;s?A&&s===1?n=!1:(Mr(i,e),!A&&s===1&&delete i._):(n=!e.$stable,yD(e,i)),o=e}else e&&(QD(t,e),o={default:1});if(n)for(const s in i)!MD(s)&&!(s in o)&&delete i[s]};function uS(t,e,A,r,i=!1){if(vt(t)){t.forEach((g,h)=>uS(g,e&&(vt(e)?e[h]:e),A,r,i));return}if(Vh(r)&&!i)return;const n=r.shapeFlag&4?kE(r.component)||r.component.proxy:r.el,o=i?null:n,{i:s,r:a}=t,c=e&&e.r,u=s.refs===Ft?s.refs={}:s.refs,l=s.setupState;if(c!=null&&c!==a&&(yr(c)?(u[c]=null,EA(l,c)&&(l[c]=null)):hr(c)&&(c.value=null)),Wt(a))sa(a,s,12,[o,u]);else{const g=yr(a),h=hr(a);if(g||h){const p=()=>{if(t.f){const C=g?EA(l,a)?l[a]:u[a]:a.value;i?vt(C)&&Fw(C,n):vt(C)?C.includes(n)||C.push(n):g?(u[a]=[n],EA(l,a)&&(l[a]=u[a])):(a.value=[n],t.k&&(u[t.k]=a.value))}else g?(u[a]=o,EA(l,a)&&(l[a]=o)):h&&(a.value=o,t.k&&(u[t.k]=o))};o?(p.id=-1,on(p,A)):p()}}}const on=w8;function W8(t){return Z8(t)}function Z8(t,e){const A=xw();A.__VUE__=!0;const{insert:r,remove:i,patchProp:n,createElement:o,createText:s,createComment:a,setText:c,setElementText:u,parentNode:l,nextSibling:g,setScopeId:h=An,insertStaticContent:p}=t,C=(j,J,z,b=null,Me=null,Qe=null,Te=!1,Ce=null,Re=!!J.dynamicChildren)=>{if(j===J)return;j&&!yc(j,J)&&(b=Z(j),U(j,Me,Qe,!0),j=null),J.patchFlag===-2&&(Re=!1,J.dynamicChildren=null);const{type:ve,ref:Ke,shapeFlag:Ue}=J;switch(ve){case OE:I(j,J,z,b);break;case Pn:E(j,J,z,b);break;case bE:j==null&&v(J,z,b,Te);break;case aA:R(j,J,z,b,Me,Qe,Te,Ce,Re);break;default:Ue&1?O(j,J,z,b,Me,Qe,Te,Ce,Re):Ue&6?G(j,J,z,b,Me,Qe,Te,Ce,Re):(Ue&64||Ue&128)&&ve.process(j,J,z,b,Me,Qe,Te,Ce,Re,oe)}Ke!=null&&Me&&uS(Ke,j&&j.ref,Qe,J||j,!J)},I=(j,J,z,b)=>{if(j==null)r(J.el=s(J.children),z,b);else{const Me=J.el=j.el;J.children!==j.children&&c(Me,J.children)}},E=(j,J,z,b)=>{j==null?r(J.el=a(J.children||""),z,b):J.el=j.el},v=(j,J,z,b)=>{[j.el,j.anchor]=p(j.children,J,z,b,j.el,j.anchor)},m=({el:j,anchor:J},z,b)=>{let Me;for(;j&&j!==J;)Me=g(j),r(j,z,b),j=Me;r(J,z,b)},M=({el:j,anchor:J})=>{let z;for(;j&&j!==J;)z=g(j),i(j),j=z;i(J)},O=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{Te=Te||J.type==="svg",j==null?x(J,z,b,Me,Qe,Te,Ce,Re):T(j,J,Me,Qe,Te,Ce,Re)},x=(j,J,z,b,Me,Qe,Te,Ce)=>{let Re,ve;const{type:Ke,props:Ue,shapeFlag:ke,transition:Ye,dirs:Je}=j;if(Re=j.el=o(j.type,Qe,Ue&&Ue.is,Ue),ke&8?u(Re,j.children):ke&16&&D(j.children,Re,null,b,Me,Qe&&Ke!=="foreignObject",Te,Ce),Je&&mc(j,null,b,"created"),P(Re,j,j.scopeId,Te,b),Ue){for(const Ze in Ue)Ze!=="value"&&!uE(Ze)&&n(Re,Ze,null,Ue[Ze],Qe,j.children,b,Me,ae);"value"in Ue&&n(Re,"value",null,Ue.value),(ve=Ue.onVnodeBeforeMount)&&bs(ve,b,j)}Je&&mc(j,null,b,"beforeMount");const rt=(!Me||Me&&!Me.pendingBranch)&&Ye&&!Ye.persisted;rt&&Ye.beforeEnter(Re),r(Re,J,z),((ve=Ue&&Ue.onVnodeMounted)||rt||Je)&&on(()=>{ve&&bs(ve,b,j),rt&&Ye.enter(Re),Je&&mc(j,null,b,"mounted")},Me)},P=(j,J,z,b,Me)=>{if(z&&h(j,z),b)for(let Qe=0;Qe<b.length;Qe++)h(j,b[Qe]);if(Me){let Qe=Me.subTree;if(J===Qe){const Te=Me.vnode;P(j,Te,Te.scopeId,Te.slotScopeIds,Me.parent)}}},D=(j,J,z,b,Me,Qe,Te,Ce,Re=0)=>{for(let ve=Re;ve<j.length;ve++){const Ke=j[ve]=Ce?aa(j[ve]):Os(j[ve]);C(null,Ke,J,z,b,Me,Qe,Te,Ce)}},T=(j,J,z,b,Me,Qe,Te)=>{const Ce=J.el=j.el;let{patchFlag:Re,dynamicChildren:ve,dirs:Ke}=J;Re|=j.patchFlag&16;const Ue=j.props||Ft,ke=J.props||Ft;let Ye;z&&Mc(z,!1),(Ye=ke.onVnodeBeforeUpdate)&&bs(Ye,z,J,j),Ke&&mc(J,j,z,"beforeUpdate"),z&&Mc(z,!0);const Je=Me&&J.type!=="foreignObject";if(ve?q(j.dynamicChildren,ve,Ce,z,b,Je,Qe):Te||W(j,J,Ce,null,z,b,Je,Qe,!1),Re>0){if(Re&16)Q(Ce,J,Ue,ke,z,b,Me);else if(Re&2&&Ue.class!==ke.class&&n(Ce,"class",null,ke.class,Me),Re&4&&n(Ce,"style",Ue.style,ke.style,Me),Re&8){const rt=J.dynamicProps;for(let Ze=0;Ze<rt.length;Ze++){const We=rt[Ze],At=Ue[We],_e=ke[We];(_e!==At||We==="value")&&n(Ce,We,At,_e,Me,j.children,z,b,ae)}}Re&1&&j.children!==J.children&&u(Ce,J.children)}else!Te&&ve==null&&Q(Ce,J,Ue,ke,z,b,Me);((Ye=ke.onVnodeUpdated)||Ke)&&on(()=>{Ye&&bs(Ye,z,J,j),Ke&&mc(J,j,z,"updated")},b)},q=(j,J,z,b,Me,Qe,Te)=>{for(let Ce=0;Ce<J.length;Ce++){const Re=j[Ce],ve=J[Ce],Ke=Re.el&&(Re.type===aA||!yc(Re,ve)||Re.shapeFlag&70)?l(Re.el):z;C(Re,ve,Ke,null,b,Me,Qe,Te,!0)}},Q=(j,J,z,b,Me,Qe,Te)=>{if(z!==b){if(z!==Ft)for(const Ce in z)!uE(Ce)&&!(Ce in b)&&n(j,Ce,z[Ce],null,Te,J.children,Me,Qe,ae);for(const Ce in b){if(uE(Ce))continue;const Re=b[Ce],ve=z[Ce];Re!==ve&&Ce!=="value"&&n(j,Ce,ve,Re,Te,J.children,Me,Qe,ae)}"value"in b&&n(j,"value",z.value,b.value)}},R=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{const ve=J.el=j?j.el:s(""),Ke=J.anchor=j?j.anchor:s("");let{patchFlag:Ue,dynamicChildren:ke,slotScopeIds:Ye}=J;Ye&&(Ce=Ce?Ce.concat(Ye):Ye),j==null?(r(ve,z,b),r(Ke,z,b),D(J.children,z,Ke,Me,Qe,Te,Ce,Re)):Ue>0&&Ue&64&&ke&&j.dynamicChildren?(q(j.dynamicChildren,ke,z,Me,Qe,Te,Ce),(J.key!=null||Me&&J===Me.subTree)&&RD(j,J,!0)):W(j,J,z,Ke,Me,Qe,Te,Ce,Re)},G=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{J.slotScopeIds=Ce,j==null?J.shapeFlag&512?Me.ctx.activate(J,z,b,Te,Re):k(J,z,b,Me,Qe,Te,Re):te(j,J,Re)},k=(j,J,z,b,Me,Qe,Te)=>{const Ce=j.component=nY(j,b,Me);if(DE(j)&&(Ce.ctx.renderer=oe),oY(Ce),Ce.asyncDep){if(Me&&Me.registerDep(Ce,X),!j.el){const Re=Ce.subTree=ot(Pn);E(null,Re,J,z)}return}X(Ce,j,J,z,Me,Qe,Te)},te=(j,J,z)=>{const b=J.component=j.component;if(I8(j,J,z))if(b.asyncDep&&!b.asyncResolved){ie(b,J,z);return}else b.next=J,g8(b.update),b.update();else J.el=j.el,b.vnode=J},X=(j,J,z,b,Me,Qe,Te)=>{const Ce=()=>{if(j.isMounted){let{next:Ke,bu:Ue,u:ke,parent:Ye,vnode:Je}=j,rt=Ke,Ze;Mc(j,!1),Ke?(Ke.el=Je.el,ie(j,Ke,Te)):Ke=Je,Ue&&hE(Ue),(Ze=Ke.props&&Ke.props.onVnodeBeforeUpdate)&&bs(Ze,Ye,Ke,Je),Mc(j,!0);const We=$w(j),At=j.subTree;j.subTree=We,C(At,We,l(At.el),Z(At),j,Me,Qe),Ke.el=We.el,rt===null&&B8(j,We.el),ke&&on(ke,Me),(Ze=Ke.props&&Ke.props.onVnodeUpdated)&&on(()=>bs(Ze,Ye,Ke,Je),Me)}else{let Ke;const{el:Ue,props:ke}=J,{bm:Ye,m:Je,parent:rt}=j,Ze=Vh(J);if(Mc(j,!1),Ye&&hE(Ye),!Ze&&(Ke=ke&&ke.onVnodeBeforeMount)&&bs(Ke,rt,J),Mc(j,!0),Ue&&De){const We=()=>{j.subTree=$w(j),De(Ue,j.subTree,j,Me,null)};Ze?J.type.__asyncLoader().then(()=>!j.isUnmounted&&We()):We()}else{const We=j.subTree=$w(j);C(null,We,z,b,j,Me,Qe),J.el=We.el}if(Je&&on(Je,Me),!Ze&&(Ke=ke&&ke.onVnodeMounted)){const We=J;on(()=>bs(Ke,rt,We),Me)}(J.shapeFlag&256||rt&&Vh(rt.vnode)&&rt.vnode.shapeFlag&256)&&j.a&&on(j.a,Me),j.isMounted=!0,J=z=b=null}},Re=j.effect=new jw(Ce,()=>_w(ve),j.scope),ve=j.update=()=>Re.run();ve.id=j.uid,Mc(j,!0),ve()},ie=(j,J,z)=>{J.component=j;const b=j.vnode.props;j.vnode=J,j.next=null,z8(j,J.props,b,z),V8(j,J.children,z),tl(),XR(),Al()},W=(j,J,z,b,Me,Qe,Te,Ce,Re=!1)=>{const ve=j&&j.children,Ke=j?j.shapeFlag:0,Ue=J.children,{patchFlag:ke,shapeFlag:Ye}=J;if(ke>0){if(ke&128){Be(ve,Ue,z,b,Me,Qe,Te,Ce,Re);return}else if(ke&256){se(ve,Ue,z,b,Me,Qe,Te,Ce,Re);return}}Ye&8?(Ke&16&&ae(ve,Me,Qe),Ue!==ve&&u(z,Ue)):Ke&16?Ye&16?Be(ve,Ue,z,b,Me,Qe,Te,Ce,Re):ae(ve,Me,Qe,!0):(Ke&8&&u(z,""),Ye&16&&D(Ue,z,b,Me,Qe,Te,Ce,Re))},se=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{j=j||ZA,J=J||ZA;const ve=j.length,Ke=J.length,Ue=Math.min(ve,Ke);let ke;for(ke=0;ke<Ue;ke++){const Ye=J[ke]=Re?aa(J[ke]):Os(J[ke]);C(j[ke],Ye,z,null,Me,Qe,Te,Ce,Re)}ve>Ke?ae(j,Me,Qe,!0,!1,Ue):D(J,z,b,Me,Qe,Te,Ce,Re,Ue)},Be=(j,J,z,b,Me,Qe,Te,Ce,Re)=>{let ve=0;const Ke=J.length;let Ue=j.length-1,ke=Ke-1;for(;ve<=Ue&&ve<=ke;){const Ye=j[ve],Je=J[ve]=Re?aa(J[ve]):Os(J[ve]);if(yc(Ye,Je))C(Ye,Je,z,null,Me,Qe,Te,Ce,Re);else break;ve++}for(;ve<=Ue&&ve<=ke;){const Ye=j[Ue],Je=J[ke]=Re?aa(J[ke]):Os(J[ke]);if(yc(Ye,Je))C(Ye,Je,z,null,Me,Qe,Te,Ce,Re);else break;Ue--,ke--}if(ve>Ue){if(ve<=ke){const Ye=ke+1,Je=Ye<Ke?J[Ye].el:b;for(;ve<=ke;)C(null,J[ve]=Re?aa(J[ve]):Os(J[ve]),z,Je,Me,Qe,Te,Ce,Re),ve++}}else if(ve>ke)for(;ve<=Ue;)U(j[ve],Me,Qe,!0),ve++;else{const Ye=ve,Je=ve,rt=new Map;for(ve=Je;ve<=ke;ve++){const et=J[ve]=Re?aa(J[ve]):Os(J[ve]);et.key!=null&&rt.set(et.key,ve)}let Ze,We=0;const At=ke-Je+1;let _e=!1,It=0;const yt=new Array(At);for(ve=0;ve<At;ve++)yt[ve]=0;for(ve=Ye;ve<=Ue;ve++){const et=j[ve];if(We>=At){U(et,Me,Qe,!0);continue}let St;if(et.key!=null)St=rt.get(et.key);else for(Ze=Je;Ze<=ke;Ze++)if(yt[Ze-Je]===0&&yc(et,J[Ze])){St=Ze;break}St===void 0?U(et,Me,Qe,!0):(yt[St-Je]=ve+1,St>=It?It=St:_e=!0,C(et,J[St],z,null,Me,Qe,Te,Ce,Re),We++)}const tt=_e?X8(yt):ZA;for(Ze=tt.length-1,ve=At-1;ve>=0;ve--){const et=Je+ve,St=J[et],ct=et+1<Ke?J[et+1].el:b;yt[ve]===0?C(null,St,z,ct,Me,Qe,Te,Ce,Re):_e&&(Ze<0||ve!==tt[Ze]?Ee(St,z,ct,2):Ze--)}}},Ee=(j,J,z,b,Me=null)=>{const{el:Qe,type:Te,transition:Ce,children:Re,shapeFlag:ve}=j;if(ve&6){Ee(j.component.subTree,J,z,b);return}if(ve&128){j.suspense.move(J,z,b);return}if(ve&64){Te.move(j,J,z,oe);return}if(Te===aA){r(Qe,J,z);for(let Ue=0;Ue<Re.length;Ue++)Ee(Re[Ue],J,z,b);r(j.anchor,J,z);return}if(Te===bE){m(j,J,z);return}if(b!==2&&ve&1&&Ce)if(b===0)Ce.beforeEnter(Qe),r(Qe,J,z),on(()=>Ce.enter(Qe),Me);else{const{leave:Ue,delayLeave:ke,afterLeave:Ye}=Ce,Je=()=>r(Qe,J,z),rt=()=>{Ue(Qe,()=>{Je(),Ye&&Ye()})};ke?ke(Qe,Je,rt):rt()}else r(Qe,J,z)},U=(j,J,z,b=!1,Me=!1)=>{const{type:Qe,props:Te,ref:Ce,children:Re,dynamicChildren:ve,shapeFlag:Ke,patchFlag:Ue,dirs:ke}=j;if(Ce!=null&&uS(Ce,null,z,j,!0),Ke&256){J.ctx.deactivate(j);return}const Ye=Ke&1&&ke,Je=!Vh(j);let rt;if(Je&&(rt=Te&&Te.onVnodeBeforeUnmount)&&bs(rt,J,j),Ke&6)re(j.component,z,b);else{if(Ke&128){j.suspense.unmount(z,b);return}Ye&&mc(j,null,J,"beforeUnmount"),Ke&64?j.type.remove(j,J,z,Me,oe,b):ve&&(Qe!==aA||Ue>0&&Ue&64)?ae(ve,J,z,!1,!0):(Qe===aA&&Ue&384||!Me&&Ke&16)&&ae(Re,J,z),b&&Y(j)}(Je&&(rt=Te&&Te.onVnodeUnmounted)||Ye)&&on(()=>{rt&&bs(rt,J,j),Ye&&mc(j,null,J,"unmounted")},z)},Y=j=>{const{type:J,el:z,anchor:b,transition:Me}=j;if(J===aA){_(z,b);return}if(J===bE){M(j);return}const Qe=()=>{i(z),Me&&!Me.persisted&&Me.afterLeave&&Me.afterLeave()};if(j.shapeFlag&1&&Me&&!Me.persisted){const{leave:Te,delayLeave:Ce}=Me,Re=()=>Te(z,Qe);Ce?Ce(j.el,Qe,Re):Re()}else Qe()},_=(j,J)=>{let z;for(;j!==J;)z=g(j),i(j),j=z;i(J)},re=(j,J,z)=>{const{bum:b,scope:Me,update:Qe,subTree:Te,um:Ce}=j;b&&hE(b),Me.stop(),Qe&&(Qe.active=!1,U(Te,j,J,z)),Ce&&on(Ce,J),on(()=>{j.isUnmounted=!0},J),J&&J.pendingBranch&&!J.isUnmounted&&j.asyncDep&&!j.asyncResolved&&j.suspenseId===J.pendingId&&(J.deps--,J.deps===0&&J.resolve())},ae=(j,J,z,b=!1,Me=!1,Qe=0)=>{for(let Te=Qe;Te<j.length;Te++)U(j[Te],J,z,b,Me)},Z=j=>j.shapeFlag&6?Z(j.component.subTree):j.shapeFlag&128?j.suspense.next():g(j.anchor||j.el),ce=(j,J,z)=>{j==null?J._vnode&&U(J._vnode,null,null,!0):C(J._vnode||null,j,J,null,null,null,z),XR(),_R(),J._vnode=j},oe={p:C,um:U,m:Ee,r:Y,mt:k,mc:D,pc:W,pbc:q,n:Z,o:t};let de,De;return e&&([de,De]=e(oe)),{render:ce,hydrate:de,createApp:j8(ce,de)}}function Mc({effect:t,update:e},A){t.allowRecurse=e.allowRecurse=A}function RD(t,e,A=!1){const r=t.children,i=e.children;if(vt(r)&&vt(i))for(let n=0;n<r.length;n++){const o=r[n];let s=i[n];s.shapeFlag&1&&!s.dynamicChildren&&((s.patchFlag<=0||s.patchFlag===32)&&(s=i[n]=aa(i[n]),s.el=o.el),A||RD(o,s)),s.type===OE&&(s.el=o.el)}}function X8(t){const e=t.slice(),A=[0];let r,i,n,o,s;const a=t.length;for(r=0;r<a;r++){const c=t[r];if(c!==0){if(i=A[A.length-1],t[i]<c){e[r]=i,A.push(r);continue}for(n=0,o=A.length-1;n<o;)s=n+o>>1,t[A[s]]<c?n=s+1:o=s;c<t[A[n]]&&(n>0&&(e[r]=A[n-1]),A[n]=r)}}for(n=A.length,o=A[n-1];n-- >0;)A[n]=o,o=e[o];return A}const _8=t=>t.__isTeleport,aA=Symbol.for("v-fgt"),OE=Symbol.for("v-txt"),Pn=Symbol.for("v-cmt"),bE=Symbol.for("v-stc"),$h=[];let cs=null;function ue(t=!1){$h.push(cs=t?null:[])}function $8(){$h.pop(),cs=$h[$h.length-1]||null}let eg=1;function DD(t){eg+=t}function TD(t){return t.dynamicChildren=eg>0?cs||ZA:null,$8(),eg>0&&cs&&cs.push(t),t}function ge(t,e,A,r,i,n){return TD(S(t,e,A,r,i,n,!0))}function co(t,e,A,r,i){return TD(ot(t,e,A,r,i,!0))}function xE(t){return t?t.__v_isVNode===!0:!1}function yc(t,e){return t.type===e.type&&t.key===e.key}const NE="__vInternal",UD=({key:t})=>t??null,KE=({ref:t,ref_key:e,ref_for:A})=>(typeof t=="number"&&(t=""+t),t!=null?yr(t)||hr(t)||Wt(t)?{i:ni,r:t,k:e,f:!!A}:t:null);function S(t,e=null,A=null,r=0,i=null,n=t===aA?0:1,o=!1,s=!1){const a={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&UD(e),ref:e&&KE(e),scopeId:yE,slotScopeIds:null,children:A,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:n,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ni};return s?(lS(a,A),n&128&&t.normalize(a)):A&&(a.shapeFlag|=yr(A)?8:16),eg>0&&!o&&cs&&(a.patchFlag>0||n&6)&&a.patchFlag!==32&&cs.push(a),a}const ot=eY;function eY(t,e=null,A=null,r=0,i=null,n=!1){if((!t||t===O8)&&(t=Pn),xE(t)){const s=oa(t,e,!0);return A&&lS(s,A),eg>0&&!n&&cs&&(s.shapeFlag&6?cs[cs.indexOf(t)]=s:cs.push(s)),s.patchFlag|=-2,s}if(lY(t)&&(t=t.__vccOpts),e){e=tY(e);let{class:s,style:a}=e;s&&!yr(s)&&(e.class=mt(s)),OA(a)&&(HR(a)&&!vt(a)&&(a=Mr({},a)),e.style=Nw(a))}const o=yr(t)?1:v8(t)?128:_8(t)?64:OA(t)?4:Wt(t)?2:0;return S(t,e,A,r,i,o,n,!0)}function tY(t){return t?HR(t)||NE in t?Mr({},t):t:null}function oa(t,e,A=!1){const{props:r,ref:i,patchFlag:n,children:o}=t,s=e?AY(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:s,key:s&&UD(s),ref:e&&e.ref?A&&i?vt(i)?i.concat(KE(e)):[i,KE(e)]:KE(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==aA?n===-1?16:n|16:n,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&oa(t.ssContent),ssFallback:t.ssFallback&&oa(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Gt(t=" ",e=0){return ot(OE,null,t,e)}function sl(t,e){const A=ot(bE,null,t);return A.staticCount=e,A}function Dt(t="",e=!1){return e?(ue(),co(Pn,null,t)):ot(Pn,null,t)}function Os(t){return t==null||typeof t=="boolean"?ot(Pn):vt(t)?ot(aA,null,t.slice()):typeof t=="object"?aa(t):ot(OE,null,String(t))}function aa(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:oa(t)}function lS(t,e){let A=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(vt(e))A=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),lS(t,i()),i._c&&(i._d=!0));return}else{A=32;const i=e._;!i&&!(NE in e)?e._ctx=ni:i===3&&ni&&(ni.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else Wt(e)?(e={default:e,_ctx:ni},A=32):(e=String(e),r&64?(A=16,e=[Gt(e)]):A=8);t.children=e,t.shapeFlag|=A}function AY(...t){const e={};for(let A=0;A<t.length;A++){const r=t[A];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=mt([e.class,r.class]));else if(i==="style")e.style=Nw([e.style,r.style]);else if(cE(i)){const n=e[i],o=r[i];o&&n!==o&&!(vt(n)&&n.includes(o))&&(e[i]=n?[].concat(n,o):o)}else i!==""&&(e[i]=r[i])}return e}function bs(t,e,A,r=null){Kn(t,e,7,[A,r])}const rY=CD();let iY=0;function nY(t,e,A){const r=t.type,i=(e?e.appContext:t.appContext)||rY,n={uid:iY++,vnode:t,type:r,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new SR(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:BD(r,i),emitsOptions:eD(r,i),emit:null,emitted:null,propsDefaults:Ft,inheritAttrs:r.inheritAttrs,ctx:Ft,data:Ft,props:Ft,attrs:Ft,slots:Ft,refs:Ft,setupState:Ft,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:A,suspenseId:A?A.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return n.ctx={_:n},n.root=e?e.root:n,n.emit=f8.bind(null,n),t.ce&&t.ce(n),n}let qr=null;const sY=()=>qr||ni;let hS,ol,LD="__VUE_INSTANCE_SETTERS__";(ol=xw()[LD])||(ol=xw()[LD]=[]),ol.push(t=>qr=t),hS=t=>{ol.length>1?ol.forEach(e=>e(t)):ol[0](t)};const al=t=>{hS(t),t.scope.on()},Qc=()=>{qr&&qr.scope.off(),hS(null)};function FD(t){return t.vnode.shapeFlag&4}let tg=!1;function oY(t,e=!1){tg=e;const{props:A,children:r}=t.vnode,i=FD(t);H8(t,A,i,e),q8(t,r);const n=i?aY(t,e):void 0;return tg=!1,n}function aY(t,e){const A=t.type;t.accessCache=Object.create(null),t.proxy=SE(new Proxy(t.ctx,b8));const{setup:r}=A;if(r){const i=t.setupContext=r.length>1?uY(t):null;al(t),tl();const n=sa(r,t,0,[t.props,i]);if(Al(),Qc(),fR(n)){if(n.then(Qc,Qc),e)return n.then(o=>{OD(t,o,e)}).catch(o=>{mE(o,t,0)});t.asyncDep=n}else OD(t,n,e)}else xD(t,e)}function OD(t,e,A){Wt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:OA(e)&&(t.setupState=VR(e)),xD(t,A)}let bD;function xD(t,e,A){const r=t.type;if(!t.render){if(!e&&bD&&!r.render){const i=r.template||sS(t).template;if(i){const{isCustomElement:n,compilerOptions:o}=t.appContext.config,{delimiters:s,compilerOptions:a}=r,c=Mr(Mr({isCustomElement:n,delimiters:s},o),a);r.render=bD(i,c)}}t.render=r.render||An}al(t),tl(),x8(t),Al(),Qc()}function cY(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,{get(e,A){return rn(t,"get","$attrs"),e[A]}}))}function uY(t){const e=A=>{t.exposed=A||{}};return{get attrs(){return cY(t)},slots:t.slots,emit:t.emit,expose:e}}function kE(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(VR(SE(t.exposed)),{get(e,A){if(A in e)return e[A];if(A in Zh)return Zh[A](t)},has(e,A){return A in e||A in Zh}}))}function lY(t){return Wt(t)&&"__vccOpts"in t}const er=(t,e)=>u8(t,e,tg);function gS(t,e,A){const r=arguments.length;return r===2?OA(e)&&!vt(e)?xE(e)?ot(t,null,[e]):ot(t,e):ot(t,null,e):(r>3?A=Array.prototype.slice.call(arguments,2):r===3&&xE(A)&&(A=[A]),ot(t,e,A))}const hY=Symbol.for("v-scx"),gY=()=>as(hY),dY="3.3.4",pY="http://www.w3.org/2000/svg",Rc=typeof document<"u"?document:null,ND=Rc&&Rc.createElement("template"),fY={insert:(t,e,A)=>{e.insertBefore(t,A||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,A,r)=>{const i=e?Rc.createElementNS(pY,t):Rc.createElement(t,A?{is:A}:void 0);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Rc.createTextNode(t),createComment:t=>Rc.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Rc.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,A,r,i,n){const o=A?A.previousSibling:e.lastChild;if(i&&(i===n||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),A),!(i===n||!(i=i.nextSibling)););else{ND.innerHTML=r?`<svg>${t}</svg>`:t;const s=ND.content;if(r){const a=s.firstChild;for(;a.firstChild;)s.appendChild(a.firstChild);s.removeChild(a)}e.insertBefore(s,A)}return[o?o.nextSibling:e.firstChild,A?A.previousSibling:e.lastChild]}};function EY(t,e,A){const r=t._vtc;r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):A?t.setAttribute("class",e):t.className=e}function CY(t,e,A){const r=t.style,i=yr(A);if(A&&!i){if(e&&!yr(e))for(const n in e)A[n]==null&&dS(r,n,"");for(const n in A)dS(r,n,A[n])}else{const n=r.display;i?e!==A&&(r.cssText=A):e&&t.removeAttribute("style"),"_vod"in t&&(r.display=n)}}const KD=/\s*!important$/;function dS(t,e,A){if(vt(A))A.forEach(r=>dS(t,e,r));else if(A==null&&(A=""),e.startsWith("--"))t.setProperty(e,A);else{const r=IY(t,e);KD.test(A)?t.setProperty(Bc(r),A.replace(KD,""),"important"):t[r]=A}}const kD=["Webkit","Moz","ms"],pS={};function IY(t,e){const A=pS[e];if(A)return A;let r=el(e);if(r!=="filter"&&r in t)return pS[e]=r;r=IR(r);for(let i=0;i<kD.length;i++){const n=kD[i]+r;if(n in t)return pS[e]=n}return e}const PD="http://www.w3.org/1999/xlink";function BY(t,e,A,r,i){if(r&&e.startsWith("xlink:"))A==null?t.removeAttributeNS(PD,e.slice(6,e.length)):t.setAttributeNS(PD,e,A);else{const n=Mj(e);A==null||n&&!vR(A)?t.removeAttribute(e):t.setAttribute(e,n?"":A)}}function vY(t,e,A,r,i,n,o){if(e==="innerHTML"||e==="textContent"){r&&o(r,i,n),t[e]=A??"";return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){t._value=A;const c=s==="OPTION"?t.getAttribute("value"):t.value,u=A??"";c!==u&&(t.value=u),A==null&&t.removeAttribute(e);return}let a=!1;if(A===""||A==null){const c=typeof t[e];c==="boolean"?A=vR(A):A==null&&c==="string"?(A="",a=!0):c==="number"&&(A=0,a=!0)}try{t[e]=A}catch{}a&&t.removeAttribute(e)}function ca(t,e,A,r){t.addEventListener(e,A,r)}function wY(t,e,A,r){t.removeEventListener(e,A,r)}function SY(t,e,A,r,i=null){const n=t._vei||(t._vei={}),o=n[e];if(r&&o)o.value=r;else{const[s,a]=mY(e);if(r){const c=n[e]=QY(r,i);ca(t,s,c,a)}else o&&(wY(t,s,o,a),n[e]=void 0)}}const GD=/(?:Once|Passive|Capture)$/;function mY(t){let e;if(GD.test(t)){e={};let r;for(;r=t.match(GD);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Bc(t.slice(2)),e]}let fS=0;const MY=Promise.resolve(),yY=()=>fS||(MY.then(()=>fS=0),fS=Date.now());function QY(t,e){const A=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=A.attached)return;Kn(RY(r,A.value),e,5,[r])};return A.value=t,A.attached=yY(),A}function RY(t,e){if(vt(e)){const A=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{A.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const jD=/^on[a-z]/,DY=(t,e,A,r,i=!1,n,o,s,a)=>{e==="class"?EY(t,r,i):e==="style"?CY(t,A,r):cE(e)?Lw(e)||SY(t,e,A,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):TY(t,e,r,i))?vY(t,e,r,n,o,s,a):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),BY(t,e,r,i))};function TY(t,e,A,r){return r?!!(e==="innerHTML"||e==="textContent"||e in t&&jD.test(e)&&Wt(A)):e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA"||jD.test(e)&&yr(A)?!1:e in t}const ua="transition",Ag="animation",PE=(t,{slots:e})=>gS(M8,UY(t),e);PE.displayName="Transition";const YD={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};PE.props=Mr({},iD,YD);const Dc=(t,e=[])=>{vt(t)?t.forEach(A=>A(...e)):t&&t(...e)},HD=t=>t?vt(t)?t.some(e=>e.length>1):t.length>1:!1;function UY(t){const e={};for(const R in t)R in YD||(e[R]=t[R]);if(t.css===!1)return e;const{name:A="v",type:r,duration:i,enterFromClass:n=`${A}-enter-from`,enterActiveClass:o=`${A}-enter-active`,enterToClass:s=`${A}-enter-to`,appearFromClass:a=n,appearActiveClass:c=o,appearToClass:u=s,leaveFromClass:l=`${A}-leave-from`,leaveActiveClass:g=`${A}-leave-active`,leaveToClass:h=`${A}-leave-to`}=t,p=LY(i),C=p&&p[0],I=p&&p[1],{onBeforeEnter:E,onEnter:v,onEnterCancelled:m,onLeave:M,onLeaveCancelled:O,onBeforeAppear:x=E,onAppear:P=v,onAppearCancelled:D=m}=e,T=(R,G,k)=>{Tc(R,G?u:s),Tc(R,G?c:o),k&&k()},q=(R,G)=>{R._isLeaving=!1,Tc(R,l),Tc(R,h),Tc(R,g),G&&G()},Q=R=>(G,k)=>{const te=R?P:v,X=()=>T(G,R,k);Dc(te,[G,X]),zD(()=>{Tc(G,R?a:n),la(G,R?u:s),HD(te)||JD(G,r,C,X)})};return Mr(e,{onBeforeEnter(R){Dc(E,[R]),la(R,n),la(R,o)},onBeforeAppear(R){Dc(x,[R]),la(R,a),la(R,c)},onEnter:Q(!1),onAppear:Q(!0),onLeave(R,G){R._isLeaving=!0;const k=()=>q(R,G);la(R,l),bY(),la(R,g),zD(()=>{R._isLeaving&&(Tc(R,l),la(R,h),HD(M)||JD(R,r,I,k))}),Dc(M,[R,k])},onEnterCancelled(R){T(R,!1),Dc(m,[R])},onAppearCancelled(R){T(R,!0),Dc(D,[R])},onLeaveCancelled(R){q(R),Dc(O,[R])}})}function LY(t){if(t==null)return null;if(OA(t))return[ES(t.enter),ES(t.leave)];{const e=ES(t);return[e,e]}}function ES(t){return Bj(t)}function la(t,e){e.split(/\s+/).forEach(A=>A&&t.classList.add(A)),(t._vtc||(t._vtc=new Set)).add(e)}function Tc(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const{_vtc:A}=t;A&&(A.delete(e),A.size||(t._vtc=void 0))}function zD(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let FY=0;function JD(t,e,A,r){const i=t._endId=++FY,n=()=>{i===t._endId&&r()};if(A)return setTimeout(n,A);const{type:o,timeout:s,propCount:a}=OY(t,e);if(!o)return r();const c=o+"end";let u=0;const l=()=>{t.removeEventListener(c,g),n()},g=h=>{h.target===t&&++u>=a&&l()};setTimeout(()=>{u<a&&l()},s+1),t.addEventListener(c,g)}function OY(t,e){const A=window.getComputedStyle(t),r=p=>(A[p]||"").split(", "),i=r(`${ua}Delay`),n=r(`${ua}Duration`),o=qD(i,n),s=r(`${Ag}Delay`),a=r(`${Ag}Duration`),c=qD(s,a);let u=null,l=0,g=0;e===ua?o>0&&(u=ua,l=o,g=n.length):e===Ag?c>0&&(u=Ag,l=c,g=a.length):(l=Math.max(o,c),u=l>0?o>c?ua:Ag:null,g=u?u===ua?n.length:a.length:0);const h=u===ua&&/\b(transform|all)(,|$)/.test(r(`${ua}Property`).toString());return{type:u,timeout:l,propCount:g,hasTransform:h}}function qD(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((A,r)=>VD(A)+VD(t[r])))}function VD(t){return Number(t.slice(0,-1).replace(",","."))*1e3}function bY(){return document.body.offsetHeight}const cl=t=>{const e=t.props["onUpdate:modelValue"]||!1;return vt(e)?A=>hE(e,A):e};function xY(t){t.target.composing=!0}function WD(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const bA={created(t,{modifiers:{lazy:e,trim:A,number:r}},i){t._assign=cl(i);const n=r||i.props&&i.props.type==="number";ca(t,e?"change":"input",o=>{if(o.target.composing)return;let s=t.value;A&&(s=s.trim()),n&&(s=dE(s)),t._assign(s)}),A&&ca(t,"change",()=>{t.value=t.value.trim()}),e||(ca(t,"compositionstart",xY),ca(t,"compositionend",WD),ca(t,"change",WD))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:A,trim:r,number:i}},n){if(t._assign=cl(n),t.composing||document.activeElement===t&&t.type!=="range"&&(A||r&&t.value.trim()===e||(i||t.type==="number")&&dE(t.value)===e))return;const o=e??"";t.value!==o&&(t.value=o)}},ZD={deep:!0,created(t,e,A){t._assign=cl(A),ca(t,"change",()=>{const r=t._modelValue,i=rg(t),n=t.checked,o=t._assign;if(vt(r)){const s=Kw(r,i),a=s!==-1;if(n&&!a)o(r.concat(i));else if(!n&&a){const c=[...r];c.splice(s,1),o(c)}}else if($u(r)){const s=new Set(r);n?s.add(i):s.delete(i),o(s)}else o($D(t,n))})},mounted:XD,beforeUpdate(t,e,A){t._assign=cl(A),XD(t,e,A)}};function XD(t,{value:e,oldValue:A},r){t._modelValue=e,vt(e)?t.checked=Kw(e,r.props.value)>-1:$u(e)?t.checked=e.has(r.props.value):e!==A&&(t.checked=Yh(e,$D(t,!0)))}const CS={deep:!0,created(t,{value:e,modifiers:{number:A}},r){const i=$u(e);ca(t,"change",()=>{const n=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>A?dE(rg(o)):rg(o));t._assign(t.multiple?i?new Set(n):n:n[0])}),t._assign=cl(r)},mounted(t,{value:e}){_D(t,e)},beforeUpdate(t,e,A){t._assign=cl(A)},updated(t,{value:e}){_D(t,e)}};function _D(t,e){const A=t.multiple;if(!(A&&!vt(e)&&!$u(e))){for(let r=0,i=t.options.length;r<i;r++){const n=t.options[r],o=rg(n);if(A)vt(e)?n.selected=Kw(e,o)>-1:n.selected=e.has(o);else if(Yh(rg(n),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!A&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function rg(t){return"_value"in t?t._value:t.value}function $D(t,e){const A=e?"_trueValue":"_falseValue";return A in t?t[A]:e}const NY=["ctrl","shift","alt","meta"],KY={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>NY.some(A=>t[`${A}Key`]&&!e.includes(A))},IS=(t,e)=>(A,...r)=>{for(let i=0;i<e.length;i++){const n=KY[e[i]];if(n&&n(A,e))return}return t(A,...r)},kY={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},eT=(t,e)=>A=>{if(!("key"in A))return;const r=Bc(A.key);if(e.some(i=>i===r||kY[i]===r))return t(A)},ul={beforeMount(t,{value:e},{transition:A}){t._vod=t.style.display==="none"?"":t.style.display,A&&e?A.beforeEnter(t):ig(t,e)},mounted(t,{value:e},{transition:A}){A&&e&&A.enter(t)},updated(t,{value:e,oldValue:A},{transition:r}){!e!=!A&&(r?e?(r.beforeEnter(t),ig(t,!0),r.enter(t)):r.leave(t,()=>{ig(t,!1)}):ig(t,e))},beforeUnmount(t,{value:e}){ig(t,e)}};function ig(t,e){t.style.display=e?t._vod:"none"}const PY=Mr({patchProp:DY},fY);let tT;function GY(){return tT||(tT=W8(PY))}const jY=(...t)=>{const e=GY().createApp(...t),{mount:A}=e;return e.mount=r=>{const i=YY(r);if(!i)return;const n=e._component;!Wt(n)&&!n.render&&!n.template&&(n.template=i.innerHTML),i.innerHTML="";const o=A(i,!1,i instanceof SVGElement);return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function YY(t){return yr(t)?document.querySelector(t):t}/*!
2
2
  * vue-router v4.2.1
3
3
  * (c) 2023 Eduardo San Martin Morote
4
4
  * @license MIT
@@ -27,12 +27,12 @@ File System access not available`),this.privLogPath=e}set enableConsoleOutput(e)
27
27
  }
28
28
  }
29
29
  registerProcessor('speech-processor', SP);`,u=new Blob([c],{type:"application/javascript; charset=utf-8"});this.privSpeechProcessorScript=URL.createObjectURL(u)}e.audioWorklet.addModule(this.privSpeechProcessorScript).then(()=>{const c=new AudioWorkletNode(e,"speech-processor");c.port.onmessage=u=>{const l=u.data;if(r&&!r.isClosed){const g=n.encode(l);g&&r.writeStreamChunk({buffer:g,isEnd:!1,timeReceived:Date.now()})}},o.connect(c),c.connect(e.destination),this.privMediaResources={scriptProcessorNode:c,source:o,stream:A}}).catch(()=>{s()})}else try{s()}catch(c){throw new Error(`Unable to start audio worklet node for PCMRecorder: ${c}`)}}releaseMediaResources(e){this.privMediaResources&&(this.privMediaResources.scriptProcessorNode&&(this.privMediaResources.scriptProcessorNode.disconnect(e.destination),this.privMediaResources.scriptProcessorNode=null),this.privMediaResources.source&&(this.privMediaResources.source.disconnect(),this.privStopInputOnRelease&&this.privMediaResources.stream.getTracks().forEach(A=>A.stop()),this.privMediaResources.source=null))}setWorkletUrl(e){this.privSpeechProcessorScript=e}}FC.PcmRecorder=MX;var OC={},Dg={},yX=xt&&xt.__createBinding||(Object.create?function(t,e,A,r){r===void 0&&(r=A),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[A]}})}:function(t,e,A,r){r===void 0&&(r=A),t[r]=e[A]}),QX=xt&&xt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d2=xt&&xt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var A in t)A!=="default"&&Object.prototype.hasOwnProperty.call(t,A)&&yX(e,t,A);return QX(e,t),e},p0=xt&&xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dg,"__esModule",{value:!0}),Dg.WebsocketMessageAdapter=void 0;const RX=d2(xc),DX=d2(xc),TX=p0(xc),UX=p0(xc),LX=p0(xc),FX=Wr,Nt=Mt();class Tg{constructor(e,A,r,i,n,o){if(!e)throw new Nt.ArgumentNullError("uri");if(!r)throw new Nt.ArgumentNullError("messageFormatter");this.proxyInfo=i,this.privConnectionEvents=new Nt.EventSource,this.privConnectionId=A,this.privMessageFormatter=r,this.privConnectionState=Nt.ConnectionState.None,this.privUri=e,this.privHeaders=n,this.privEnableCompression=o,this.privHeaders[FX.HeaderNames.ConnectionId]=this.privConnectionId,this.privHeaders.connectionId=this.privConnectionId,this.privLastErrorReceived=""}get state(){return this.privConnectionState}open(){if(this.privConnectionState===Nt.ConnectionState.Disconnected)return Promise.reject(`Cannot open a connection that is in ${this.privConnectionState} state`);if(this.privConnectionEstablishDeferral)return this.privConnectionEstablishDeferral.promise;this.privConnectionEstablishDeferral=new Nt.Deferred,this.privCertificateValidatedDeferral=new Nt.Deferred,this.privConnectionState=Nt.ConnectionState.Connecting;try{if(typeof WebSocket<"u"&&!Tg.forceNpmWebSocket)this.privCertificateValidatedDeferral.resolve(),this.privWebsocketClient=new WebSocket(this.privUri);else{let A=new URL(this.privUri).protocol;(A==null?void 0:A.toLocaleLowerCase())==="wss:"?A="https:":(A==null?void 0:A.toLocaleLowerCase())==="ws:"&&(A="http:");const r={headers:this.privHeaders,perMessageDeflate:this.privEnableCompression,followRedirects:A.toLocaleLowerCase()==="https:"};this.privCertificateValidatedDeferral.resolve(),r.agent=this.getAgent(),r.agent.protocol=A,this.privWebsocketClient=new LX.default(this.privUri,r),this.privWebsocketClient.on("redirect",i=>{const n=new Nt.ConnectionRedirectEvent(this.privConnectionId,i,this.privUri,`Getting redirect URL from endpoint ${this.privUri} with redirect URL '${i}'`);Nt.Events.instance.onEvent(n)})}this.privWebsocketClient.binaryType="arraybuffer",this.privReceivingMessageQueue=new Nt.Queue,this.privDisconnectDeferral=new Nt.Deferred,this.privSendMessageQueue=new Nt.Queue,this.processSendQueue().catch(e=>{Nt.Events.instance.onEvent(new Nt.BackgroundEvent(e))})}catch(e){return this.privConnectionEstablishDeferral.resolve(new Nt.ConnectionOpenResponse(500,e)),this.privConnectionEstablishDeferral.promise}return this.onEvent(new Nt.ConnectionStartEvent(this.privConnectionId,this.privUri)),this.privWebsocketClient.onopen=()=>{this.privCertificateValidatedDeferral.promise.then(()=>{this.privConnectionState=Nt.ConnectionState.Connected,this.onEvent(new Nt.ConnectionEstablishedEvent(this.privConnectionId)),this.privConnectionEstablishDeferral.resolve(new Nt.ConnectionOpenResponse(200,""))},e=>{this.privConnectionEstablishDeferral.reject(e)})},this.privWebsocketClient.onerror=e=>{this.onEvent(new Nt.ConnectionErrorEvent(this.privConnectionId,e.message,e.type)),this.privLastErrorReceived=e.message},this.privWebsocketClient.onclose=e=>{this.privConnectionState===Nt.ConnectionState.Connecting?(this.privConnectionState=Nt.ConnectionState.Disconnected,this.privConnectionEstablishDeferral.resolve(new Nt.ConnectionOpenResponse(e.code,e.reason+" "+this.privLastErrorReceived))):(this.privConnectionState=Nt.ConnectionState.Disconnected,this.privWebsocketClient=null,this.onEvent(new Nt.ConnectionClosedEvent(this.privConnectionId,e.code,e.reason))),this.onClose(e.code,e.reason).catch(A=>{Nt.Events.instance.onEvent(new Nt.BackgroundEvent(A))})},this.privWebsocketClient.onmessage=e=>{const A=new Date().toISOString();if(this.privConnectionState===Nt.ConnectionState.Connected){const r=new Nt.Deferred;if(this.privReceivingMessageQueue.enqueueFromPromise(r.promise),e.data instanceof ArrayBuffer){const i=new Nt.RawWebsocketMessage(Nt.MessageType.Binary,e.data);this.privMessageFormatter.toConnectionMessage(i).then(n=>{this.onEvent(new Nt.ConnectionMessageReceivedEvent(this.privConnectionId,A,n)),r.resolve(n)},n=>{r.reject(`Invalid binary message format. Error: ${n}`)})}else{const i=new Nt.RawWebsocketMessage(Nt.MessageType.Text,e.data);this.privMessageFormatter.toConnectionMessage(i).then(n=>{this.onEvent(new Nt.ConnectionMessageReceivedEvent(this.privConnectionId,A,n)),r.resolve(n)},n=>{r.reject(`Invalid text message format. Error: ${n}`)})}}},this.privConnectionEstablishDeferral.promise}send(e){if(this.privConnectionState!==Nt.ConnectionState.Connected)return Promise.reject(`Cannot send on connection that is in ${Nt.ConnectionState[this.privConnectionState]} state`);const A=new Nt.Deferred,r=new Nt.Deferred;return this.privSendMessageQueue.enqueueFromPromise(r.promise),this.privMessageFormatter.fromConnectionMessage(e).then(i=>{r.resolve({Message:e,RawWebsocketMessage:i,sendStatusDeferral:A})},i=>{r.reject(`Error formatting the message. ${i}`)}),A.promise}read(){return this.privConnectionState!==Nt.ConnectionState.Connected?Promise.reject(`Cannot read on connection that is in ${this.privConnectionState} state`):this.privReceivingMessageQueue.dequeue()}close(e){if(this.privWebsocketClient)this.privConnectionState!==Nt.ConnectionState.Disconnected&&this.privWebsocketClient.close(1e3,e||"Normal closure by client");else return Promise.resolve();return this.privDisconnectDeferral.promise}get events(){return this.privConnectionEvents}sendRawMessage(e){try{if(!e)return Promise.resolve();if(this.onEvent(new Nt.ConnectionMessageSentEvent(this.privConnectionId,new Date().toISOString(),e.Message)),this.isWebsocketOpen)this.privWebsocketClient.send(e.RawWebsocketMessage.payload);else return Promise.reject("websocket send error: Websocket not ready "+this.privConnectionId+" "+e.Message.id+" "+new Error().stack);return Promise.resolve()}catch(A){return Promise.reject(`websocket send error: ${A}`)}}async onClose(e,A){const r=`Connection closed. ${e}: ${A}`;this.privConnectionState=Nt.ConnectionState.Disconnected,this.privDisconnectDeferral.resolve(),await this.privReceivingMessageQueue.drainAndDispose(()=>{},r),await this.privSendMessageQueue.drainAndDispose(i=>{i.sendStatusDeferral.reject(r)},r)}async processSendQueue(){for(;;){const A=await this.privSendMessageQueue.dequeue();if(!A)return;try{await this.sendRawMessage(A),A.sendStatusDeferral.resolve()}catch(r){A.sendStatusDeferral.reject(r)}}}onEvent(e){this.privConnectionEvents.onEvent(e),Nt.Events.instance.onEvent(e)}getAgent(){const e=new TX.default.Agent(this.createConnection);return this.proxyInfo!==void 0&&this.proxyInfo.HostName!==void 0&&this.proxyInfo.Port>0&&(e.proxyInfo=this.proxyInfo),e}static GetProxyAgent(e){const A={host:e.HostName,port:e.Port};return e.UserName?A.headers={"Proxy-Authentication":"Basic "+new Buffer(`${e.UserName}:${e.Password===void 0?"":e.Password}`).toString("base64")}:A.headers={},A.headers.requestOCSP="true",new UX.default(A)}createConnection(e,A){let r;if(A={...A,requestOCSP:!0,servername:A.host},this.proxyInfo){const n=Tg.GetProxyAgent(this.proxyInfo);r=new Promise((o,s)=>{n.callback(e,A,(a,c)=>{a?s(a):o(c)})})}else A.secureEndpoint?r=Promise.resolve(DX.connect(A)):r=Promise.resolve(RX.connect(A));return r}get isWebsocketOpen(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN}}Dg.WebsocketMessageAdapter=Tg,Tg.forceNpmWebSocket=!1,Object.defineProperty(OC,"__esModule",{value:!0}),OC.WebsocketConnection=void 0;const f0=Mt(),OX=Dg;class bX{constructor(e,A,r,i,n,o=!1,s){if(this.privIsDisposed=!1,!e)throw new f0.ArgumentNullError("uri");if(!i)throw new f0.ArgumentNullError("messageFormatter");this.privMessageFormatter=i;let a="",c=0;if(A){for(const u in A)if(u){a+=c===0&&e.indexOf("?")===-1?"?":"&";const l=encodeURIComponent(u);a+=l;let g=A[u];g&&(g=encodeURIComponent(g),a+=`=${g}`),c++}}if(r){for(const u in r)if(u){a+=c===0&&e.indexOf("?")===-1?"?":"&";const l=encodeURIComponent(r[u]);a+=`${u}=${l}`,c++}}this.privUri=e+a,this.privId=s||(0,f0.createNoDashGuid)(),this.privConnectionMessageAdapter=new OX.WebsocketMessageAdapter(this.privUri,this.id,this.privMessageFormatter,n,r,o)}async dispose(){this.privIsDisposed=!0,this.privConnectionMessageAdapter&&await this.privConnectionMessageAdapter.close()}isDisposed(){return this.privIsDisposed}get id(){return this.privId}get uri(){return this.privUri}state(){return this.privConnectionMessageAdapter.state}open(){return this.privConnectionMessageAdapter.open()}send(e){return this.privConnectionMessageAdapter.send(e)}read(){return this.privConnectionMessageAdapter.read()}get events(){return this.privConnectionMessageAdapter.events}}OC.WebsocketConnection=bX;var bC={};Object.defineProperty(bC,"__esModule",{value:!0}),bC.ReplayableAudioNode=void 0;class xX{constructor(e,A){this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.privAudioNode=e,this.privBytesPerSecond=A}id(){return this.privAudioNode.id()}read(){if(this.privReplay&&this.privBuffers.length!==0){const e=this.privReplayOffset-this.privBufferStartOffset;let A=Math.round(e*this.privBytesPerSecond*1e-7);A%2!==0&&A++;let r=0;for(;r<this.privBuffers.length&&A>=this.privBuffers[r].chunk.buffer.byteLength;)A-=this.privBuffers[r++].chunk.buffer.byteLength;if(r<this.privBuffers.length){const i=this.privBuffers[r].chunk.buffer.slice(A);return this.privReplayOffset+=i.byteLength/this.privBytesPerSecond*1e7,r===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:i,isEnd:!1,timeReceived:this.privBuffers[r].chunk.timeReceived})}}return this.privAudioNode.read().then(e=>(e&&e.buffer&&(this.privBuffers.push(new NX(e,this.privBufferSerial++,this.privBufferedBytes)),this.privBufferedBytes+=e.buffer.byteLength),e))}detach(){return this.privBuffers=void 0,this.privAudioNode.detach()}replay(){this.privBuffers&&this.privBuffers.length!==0&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)}shrinkBuffers(e){if(this.privBuffers===void 0||this.privBuffers.length===0)return;this.privLastShrinkOffset=e;const A=e-this.privBufferStartOffset;let r=Math.round(A*this.privBytesPerSecond*1e-7),i=0;for(;i<this.privBuffers.length&&r>=this.privBuffers[i].chunk.buffer.byteLength;)r-=this.privBuffers[i++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-r/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(i)}findTimeAtOffset(e){if(e<this.privBufferStartOffset||this.privBuffers===void 0)return 0;for(const A of this.privBuffers){const r=A.byteOffset/this.privBytesPerSecond*1e7,i=r+A.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=r&&e<=i)return A.chunk.timeReceived}return 0}}bC.ReplayableAudioNode=xX;class NX{constructor(e,A,r){this.chunk=e,this.serial=A,this.byteOffset=r}}var Ug={},E0={},fo={},Lg={},KX=xt&&xt.__createBinding||(Object.create?function(t,e,A,r){r===void 0&&(r=A),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[A]}})}:function(t,e,A,r){r===void 0&&(r=A),t[r]=e[A]}),kX=xt&&xt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PX=xt&&xt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var A in t)A!=="default"&&Object.prototype.hasOwnProperty.call(t,A)&&KX(e,t,A);return kX(e,t),e};Object.defineProperty(Lg,"__esModule",{value:!0}),Lg.AudioFileWriter=void 0;const Fg=PX(xc),C0=Ut;class GX{constructor(e){C0.Contracts.throwIfNullOrUndefined(Fg.openSync,`
30
- File System access not available, please use Push or PullAudioOutputStream`),this.privFd=Fg.openSync(e,"w")}set format(e){C0.Contracts.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let A=0;this.privAudioFormat.hasHeader&&(A=this.privAudioFormat.header.byteLength),this.privFd!==void 0&&(this.privWriteStream=Fg.createWriteStream("",{fd:this.privFd,start:A,autoClose:!1}))}write(e){C0.Contracts.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),this.privWriteStream!==void 0&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){this.privFd!==void 0&&(this.privWriteStream.on("finish",()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),Fg.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),Fg.closeSync(this.privFd),this.privFd=void 0}),this.privWriteStream.end())}id(){return this.privId}}Lg.AudioFileWriter=GX;var Bn={},p2;function f2(){if(p2)return Bn;p2=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.PullAudioInputStreamImpl=Bn.PullAudioInputStream=Bn.PushAudioInputStreamImpl=Bn.PushAudioInputStream=Bn.AudioInputStream=void 0;const t=ut(),e=Mt(),A=Hn,r=Ve(),i=ya;let n=class{constructor(){}static createPushStream(l){return o.create(l)}static createPullStream(l,g){return a.create(l,g)}};Bn.AudioInputStream=n;class o extends n{static create(l){return new s(l)}}Bn.PushAudioInputStream=o;class s extends o{constructor(l){super(),l===void 0?this.privFormat=i.AudioStreamFormatImpl.getDefaultInputFormat():this.privFormat=l,this.privEvents=new e.EventSource,this.privId=(0,A.createNoDashGuid)(),this.privStream=new e.ChunkedArrayBufferStream(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(l){this.privStream.writeStreamChunk({buffer:l,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}turnOn(){this.onEvent(new e.AudioSourceInitializingEvent(this.privId)),this.onEvent(new e.AudioSourceReadyEvent(this.privId))}async attach(l){this.onEvent(new e.AudioStreamNodeAttachingEvent(this.privId,l)),await this.turnOn();const g=this.privStream;return this.onEvent(new e.AudioStreamNodeAttachedEvent(this.privId,l)),{detach:async()=>(this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l)),this.turnOff()),id:()=>l,read:()=>g.read()}}detach(l){this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:t.connectivity.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:t.type.Stream})}onEvent(l){this.privEvents.onEvent(l),e.Events.instance.onEvent(l)}toBuffer(l){const g=Buffer.alloc(l.byteLength),h=new Uint8Array(l);for(let p=0;p<g.length;++p)g[p]=h[p];return g}}Bn.PushAudioInputStreamImpl=s;class a extends n{constructor(){super()}static create(l,g){return new c(l,g)}}Bn.PullAudioInputStream=a;class c extends a{constructor(l,g){super(),g===void 0?this.privFormat=r.AudioStreamFormat.getDefaultInputFormat():this.privFormat=g,this.privEvents=new e.EventSource,this.privId=(0,A.createNoDashGuid)(),this.privCallback=l,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}turnOn(){this.onEvent(new e.AudioSourceInitializingEvent(this.privId)),this.onEvent(new e.AudioSourceReadyEvent(this.privId))}async attach(l){return this.onEvent(new e.AudioStreamNodeAttachingEvent(this.privId,l)),await this.turnOn(),this.onEvent(new e.AudioStreamNodeAttachedEvent(this.privId,l)),{detach:()=>(this.privCallback.close(),this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l)),this.turnOff()),id:()=>l,read:()=>{let g=0,h;for(;g<this.privBufferSize;){const p=new ArrayBuffer(this.privBufferSize-g),C=this.privCallback.read(p);if(h===void 0?h=p:new Int8Array(h).set(new Int8Array(p),g),C===0)break;g+=C}return Promise.resolve({buffer:h.slice(0,g),isEnd:this.privIsClosed||g===0,timeReceived:Date.now()})}}}detach(l){this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:t.connectivity.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:t.type.Stream})}onEvent(l){this.privEvents.onEvent(l),e.Events.instance.onEvent(l)}}return Bn.PullAudioInputStreamImpl=c,Bn}var li={},Qa={},I0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisOutputFormat=void 0,function(e){e[e.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",e[e.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",e[e.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",e[e.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",e[e.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",e[e.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",e[e.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",e[e.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",e[e.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",e[e.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",e[e.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",e[e.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",e[e.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",e[e.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",e[e.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",e[e.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",e[e.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",e[e.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",e[e.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",e[e.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",e[e.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",e[e.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",e[e.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",e[e.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",e[e.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",e[e.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",e[e.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",e[e.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",e[e.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",e[e.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",e[e.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",e[e.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",e[e.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",e[e.Raw22050Hz16BitMonoPcm=33]="Raw22050Hz16BitMonoPcm",e[e.Riff22050Hz16BitMonoPcm=34]="Riff22050Hz16BitMonoPcm",e[e.Raw44100Hz16BitMonoPcm=35]="Raw44100Hz16BitMonoPcm",e[e.Riff44100Hz16BitMonoPcm=36]="Riff44100Hz16BitMonoPcm",e[e.AmrWb16000Hz=37]="AmrWb16000Hz",e[e.G72216Khz64Kbps=38]="G72216Khz64Kbps"}(t.SpeechSynthesisOutputFormat||(t.SpeechSynthesisOutputFormat={}))})(I0),Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.AudioOutputFormatImpl=void 0;const _t=I0,zt=ya;class Tt extends zt.AudioStreamFormatImpl{constructor(e,A,r,i,n,o,s,a,c){super(r,o,A,e),this.formatTag=e,this.avgBytesPerSec=i,this.blockAlign=n,this.priAudioFormatString=s,this.priRequestAudioFormatString=a,this.priHasHeader=c}static fromSpeechSynthesisOutputFormat(e){return e===void 0?Tt.getDefaultOutputFormat():Tt.fromSpeechSynthesisOutputFormatString(Tt.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new Tt(zt.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new Tt(zt.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new Tt(zt.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,16e3,32<<7,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,16e3,128<<7,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,16e3,64<<7,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,24e3,48<<7,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,24e3,96<<7,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,24e3,160<<7,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new Tt(zt.AudioFormatTag.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new Tt(zt.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,48e3,96<<7,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,48e3,192<<7,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new Tt(zt.AudioFormatTag.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new Tt(zt.AudioFormatTag.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new Tt(zt.AudioFormatTag.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new Tt(zt.AudioFormatTag.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new Tt(zt.AudioFormatTag.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new Tt(zt.AudioFormatTag.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new Tt(zt.AudioFormatTag.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new Tt(zt.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new Tt(zt.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);case"raw-22050hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,22050,44100,2,16,e,e,!1);case"riff-22050hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,22050,44100,2,16,e,"raw-22050hz-16bit-mono-pcm",!0);case"raw-44100hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,44100,88200,2,16,e,e,!1);case"riff-44100hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,44100,88200,2,16,e,"raw-44100hz-16bit-mono-pcm",!0);case"amr-wb-16000h":return new Tt(zt.AudioFormatTag.AMR_WB,1,16e3,3052,2,16,e,e,!1);case"g722-16khz-64kbps":return new Tt(zt.AudioFormatTag.G722,1,16e3,8e3,2,16,e,e,!1);case"riff-16khz-16bit-mono-pcm":default:return new Tt(zt.AudioFormatTag.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return Tt.fromSpeechSynthesisOutputFormatString(typeof window<"u"?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){const A=new DataView(this.privHeader);A.setUint32(4,e+this.privHeader.byteLength-8,!0),A.setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}addHeader(e){if(!this.hasHeader)return e;this.updateHeader(e.byteLength);const A=new Uint8Array(e.byteLength+this.header.byteLength);return A.set(new Uint8Array(this.header),0),A.set(new Uint8Array(e),this.header.byteLength),A.buffer}}Qa.AudioOutputFormatImpl=Tt,Tt.SpeechSynthesisOutputFormatToString={[_t.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[_t.SpeechSynthesisOutputFormat.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[_t.SpeechSynthesisOutputFormat.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[_t.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[_t.SpeechSynthesisOutputFormat.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[_t.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[_t.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[_t.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[_t.SpeechSynthesisOutputFormat.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Raw22050Hz16BitMonoPcm]:"raw-22050hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff22050Hz16BitMonoPcm]:"riff-22050hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Raw44100Hz16BitMonoPcm]:"raw-44100hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff44100Hz16BitMonoPcm]:"riff-44100hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.AmrWb16000Hz]:"amr-wb-16000hz",[_t.SpeechSynthesisOutputFormat.G72216Khz64Kbps]:"g722-16khz-64kbps"},Object.defineProperty(li,"__esModule",{value:!0}),li.PushAudioOutputStreamImpl=li.PushAudioOutputStream=li.PullAudioOutputStreamImpl=li.PullAudioOutputStream=li.AudioOutputStream=void 0;const B0=Mt(),jX=Ut,YX=Qa;class v0{constructor(){}static createPullStream(){return w0.create()}}li.AudioOutputStream=v0;class w0 extends v0{static create(){return new E2}}li.PullAudioOutputStream=w0;class E2 extends w0{constructor(){super(),this.privId=(0,B0.createNoDashGuid)(),this.privStream=new B0.Stream}set format(e){e==null&&(this.privFormat=YX.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}async read(e){const A=new Int8Array(e);let r=0;if(this.privLastChunkView!==void 0){if(this.privLastChunkView.length>e.byteLength)return A.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);A.set(this.privLastChunkView),r=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;r<e.byteLength&&!this.privStream.isReadEnded;){const i=await this.privStream.read();if(i!==void 0&&!i.isEnd){let n;i.buffer.byteLength>e.byteLength-r?(n=i.buffer.slice(0,e.byteLength-r),this.privLastChunkView=new Int8Array(i.buffer.slice(e.byteLength-r))):n=i.buffer,A.set(new Int8Array(n),r),r+=n.byteLength}else this.privStream.readEnded()}return r}write(e){jX.Contracts.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}li.PullAudioOutputStreamImpl=E2;class C2 extends v0{constructor(){super()}static create(e){return new I2(e)}}li.PushAudioOutputStream=C2;class I2 extends C2{constructor(e){super(),this.privId=(0,B0.createNoDashGuid)(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}li.PushAudioOutputStreamImpl=I2;var B2;function v2(){if(B2)return fo;B2=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.AudioOutputConfigImpl=fo.AudioConfigImpl=fo.AudioConfig=void 0;const t=Zr(),e=Ut,A=Ve(),r=Lg,i=f2(),n=li;let o=class VG{static fromDefaultMicrophoneInput(){const u=new t.PcmRecorder(!0);return new s(new t.MicAudioSource(u))}static fromMicrophoneInput(u){const l=new t.PcmRecorder(!0);return new s(new t.MicAudioSource(l,u))}static fromWavFileInput(u,l="unnamedBuffer.wav"){return new s(new t.FileAudioSource(u,l))}static fromStreamInput(u){if(u instanceof A.PullAudioInputStreamCallback)return new s(new i.PullAudioInputStreamImpl(u));if(u instanceof A.AudioInputStream)return new s(u);if(typeof MediaStream<"u"&&u instanceof MediaStream){const l=new t.PcmRecorder(!1);return new s(new t.MicAudioSource(l,null,null,u))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new a(new A.SpeakerAudioDestination)}static fromSpeakerOutput(u){if(u===void 0)return VG.fromDefaultSpeakerOutput();if(u instanceof A.SpeakerAudioDestination)return new a(u);throw new Error("Not Supported Type")}static fromAudioFileOutput(u){return new a(new r.AudioFileWriter(u))}static fromStreamOutput(u){if(u instanceof A.PushAudioOutputStreamCallback)return new a(new n.PushAudioOutputStreamImpl(u));if(u instanceof A.PushAudioOutputStream)return new a(u);if(u instanceof A.PullAudioOutputStream)return new a(u);throw new Error("Not Supported Type")}};fo.AudioConfig=o;class s extends o{constructor(u){super(),this.privSource=u}get format(){return this.privSource.format}close(u,l){this.privSource.turnOff().then(()=>{u&&u()},g=>{l&&l(g)})}id(){return this.privSource.id()}turnOn(){return this.privSource.turnOn()}attach(u){return this.privSource.attach(u)}detach(u){return this.privSource.detach(u)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(u,l){if(e.Contracts.throwIfNull(l,"value"),this.privSource.setProperty!==void 0)this.privSource.setProperty(u,l);else throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(u,l){if(this.privSource.getProperty!==void 0)return this.privSource.getProperty(u,l);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}fo.AudioConfigImpl=s;class a extends o{constructor(u){super(),this.privDestination=u}set format(u){this.privDestination.format=u}write(u){this.privDestination.write(u)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(){throw new Error("This AudioConfig instance does not support getting properties.")}}return fo.AudioOutputConfigImpl=a,fo}var w2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationReason=void 0,function(e){e[e.Error=0]="Error",e[e.EndOfStream=1]="EndOfStream"}(t.CancellationReason||(t.CancellationReason={}))})(w2);var xC={};Object.defineProperty(xC,"__esModule",{value:!0}),xC.PullAudioInputStreamCallback=void 0;class HX{}xC.PullAudioInputStreamCallback=HX;var NC={};Object.defineProperty(NC,"__esModule",{value:!0}),NC.PushAudioOutputStreamCallback=void 0;class zX{}NC.PushAudioOutputStreamCallback=zX;var KC={};Object.defineProperty(KC,"__esModule",{value:!0}),KC.KeywordRecognitionModel=void 0;const S2=Ut;class JX{constructor(){this.privDisposed=!1}static fromFile(e){throw S2.Contracts.throwIfFileDoesNotExist(e,"fileName"),new Error("Not yet implemented.")}static fromStream(e){throw S2.Contracts.throwIfNull(e,"file"),new Error("Not yet implemented.")}close(){this.privDisposed||(this.privDisposed=!0)}}KC.KeywordRecognitionModel=JX;var kC={};Object.defineProperty(kC,"__esModule",{value:!0}),kC.SessionEventArgs=void 0;class qX{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}kC.SessionEventArgs=qX;var Og={},m2;function VX(){if(m2)return Og;m2=1,Object.defineProperty(Og,"__esModule",{value:!0}),Og.RecognitionEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i){super(i),this.privOffset=r}get offset(){return this.privOffset}};return Og.RecognitionEventArgs=e,Og}var M2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.OutputFormat=void 0,function(e){e[e.Simple=0]="Simple",e[e.Detailed=1]="Detailed"}(t.OutputFormat||(t.OutputFormat={}))})(M2);var bg={},y2;function WX(){if(y2)return bg;y2=1,Object.defineProperty(bg,"__esModule",{value:!0}),bg.IntentRecognitionEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n){super(i,n),this.privResult=r}get result(){return this.privResult}};return bg.IntentRecognitionEventArgs=e,bg}var PC={};Object.defineProperty(PC,"__esModule",{value:!0}),PC.RecognitionResult=void 0;class ZX{constructor(e,A,r,i,n,o,s,a,c,u){this.privResultId=e,this.privReason=A,this.privText=r,this.privDuration=i,this.privOffset=n,this.privLanguage=o,this.privLanguageDetectionConfidence=s,this.privErrorDetails=a,this.privJson=c,this.privProperties=u}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}PC.RecognitionResult=ZX;var xg={},Q2;function XX(){if(Q2)return xg;Q2=1,Object.defineProperty(xg,"__esModule",{value:!0}),xg.SpeechRecognitionResult=void 0;const t=Ve();let e=class extends t.RecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(r,i,n,o,s,a,c,l,g,h),this.privSpeakerId=u}get speakerId(){return this.privSpeakerId}};return xg.SpeechRecognitionResult=e,xg}var Ng={},R2;function _X(){if(R2)return Ng;R2=1,Object.defineProperty(Ng,"__esModule",{value:!0}),Ng.IntentRecognitionResult=void 0;const t=Ve();let e=class extends t.SpeechRecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(i,n,o,s,a,c,u,void 0,l,g,h),this.privIntentId=r}get intentId(){return this.privIntentId}};return Ng.IntentRecognitionResult=e,Ng}var yl={};Object.defineProperty(yl,"__esModule",{value:!0}),yl.LanguageUnderstandingModelImpl=yl.LanguageUnderstandingModel=void 0;const Ql=Ut;class D2{constructor(){}static fromEndpoint(e){Ql.Contracts.throwIfNull(e,"uri"),Ql.Contracts.throwIfNullOrWhitespace(e.hostname,"uri");const A=new GC,r=e.host.indexOf(".");if(r===-1)throw new Error("Could not determine region from endpoint");A.region=e.host.substr(0,r);const i=e.pathname.lastIndexOf("/")+1;if(i===-1)throw new Error("Could not determine appId from endpoint");if(A.appId=e.pathname.substr(i),A.subscriptionKey=e.searchParams.get("subscription-key"),A.subscriptionKey===void 0)throw new Error("Could not determine subscription key from endpoint");return A}static fromAppId(e){Ql.Contracts.throwIfNullOrWhitespace(e,"appId");const A=new GC;return A.appId=e,A}static fromSubscription(e,A,r){Ql.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),Ql.Contracts.throwIfNullOrWhitespace(A,"appId"),Ql.Contracts.throwIfNullOrWhitespace(r,"region");const i=new GC;return i.appId=A,i.region=r,i.subscriptionKey=e,i}}yl.LanguageUnderstandingModel=D2;class GC extends D2{}yl.LanguageUnderstandingModelImpl=GC;var Eo={},T2;function $X(){if(T2)return Eo;T2=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.MeetingTranscriptionEventArgs=Eo.ConversationTranscriptionEventArgs=Eo.SpeechRecognitionEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(n,o,s){super(o,s),this.privResult=n}get result(){return this.privResult}};Eo.SpeechRecognitionEventArgs=e;class A extends t.RecognitionEventArgs{constructor(n,o,s){super(o,s),this.privResult=n}get result(){return this.privResult}}Eo.ConversationTranscriptionEventArgs=A;class r extends e{}return Eo.MeetingTranscriptionEventArgs=r,Eo}var Kg={},kg={},U2;function Pg(){if(U2)return kg;U2=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.CancellationEventArgsBase=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n,o,s){super(o,s),this.privReason=r,this.privErrorDetails=i,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}};return kg.CancellationEventArgsBase=e,kg}var L2;function e_(){if(L2)return Kg;L2=1,Object.defineProperty(Kg,"__esModule",{value:!0}),Kg.SpeechRecognitionCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Kg.SpeechRecognitionCanceledEventArgs=e,Kg}var Gg={},F2;function t_(){if(F2)return Gg;F2=1,Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.TranslationRecognitionEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n){super(i,n),this.privResult=r}get result(){return this.privResult}};return Gg.TranslationRecognitionEventArgs=e,Gg}var jg={},O2;function A_(){if(O2)return jg;O2=1,Object.defineProperty(jg,"__esModule",{value:!0}),jg.TranslationSynthesisEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i){super(i),this.privResult=r}get result(){return this.privResult}};return jg.TranslationSynthesisEventArgs=e,jg}var Yg={},b2;function x2(){if(b2)return Yg;b2=1,Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.TranslationRecognitionResult=void 0;const t=Ve();let e=class WG extends t.SpeechRecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(i,n,o,s,a,c,u,void 0,l,g,h),this.privTranslations=r}static fromSpeechRecognitionResult(r){return new WG(void 0,r.resultId,r.reason,r.text,r.duration,r.offset,r.language,r.languageDetectionConfidence,r.errorDetails,r.json,r.properties)}get translations(){return this.privTranslations}};return Yg.TranslationRecognitionResult=e,Yg}var jC={};Object.defineProperty(jC,"__esModule",{value:!0}),jC.TranslationSynthesisResult=void 0;class r_{constructor(e,A){this.privReason=e,this.privAudio=A}get audio(){return this.privAudio}get reason(){return this.privReason}}jC.TranslationSynthesisResult=r_;var N2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ResultReason=void 0,function(e){e[e.NoMatch=0]="NoMatch",e[e.Canceled=1]="Canceled",e[e.RecognizingSpeech=2]="RecognizingSpeech",e[e.RecognizedSpeech=3]="RecognizedSpeech",e[e.RecognizedKeyword=4]="RecognizedKeyword",e[e.RecognizingIntent=5]="RecognizingIntent",e[e.RecognizedIntent=6]="RecognizedIntent",e[e.TranslatingSpeech=7]="TranslatingSpeech",e[e.TranslatedSpeech=8]="TranslatedSpeech",e[e.SynthesizingAudio=9]="SynthesizingAudio",e[e.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",e[e.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",e[e.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",e[e.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",e[e.RecognizedSpeakers=14]="RecognizedSpeakers",e[e.RecognizedSpeaker=15]="RecognizedSpeaker",e[e.ResetVoiceProfile=16]="ResetVoiceProfile",e[e.DeletedVoiceProfile=17]="DeletedVoiceProfile",e[e.VoicesListRetrieved=18]="VoicesListRetrieved",e[e.TranslatingParticipantSpeech=19]="TranslatingParticipantSpeech",e[e.TranslatedParticipantSpeech=20]="TranslatedParticipantSpeech",e[e.TranslatedInstantMessage=21]="TranslatedInstantMessage",e[e.TranslatedParticipantInstantMessage=22]="TranslatedParticipantInstantMessage"}(t.ResultReason||(t.ResultReason={}))})(N2);var Nc={},K2;function i_(){if(K2)return Nc;K2=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.SpeechConfigImpl=Nc.SpeechConfig=void 0;const t=ut(),e=Ut,A=Ve();let r=class{constructor(){}static fromSubscription(o,s){e.Contracts.throwIfNullOrWhitespace(o,"subscriptionKey"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a.setProperty(A.PropertyId.SpeechServiceConnection_IntentRegion,s),a.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),a}static fromEndpoint(o,s){e.Contracts.throwIfNull(o,"endpoint");const a=typeof s=="string"&&s.trim().length>0,c=typeof s=="object"&&s!==null&&typeof s.getToken=="function";if(s!==void 0&&!a&&!c)throw new Error("Invalid 'auth' parameter: must be a non-empty key string or a valid TokenCredential object.");const u=typeof s=="object"?new i(s):new i;return u.setProperty(A.PropertyId.SpeechServiceConnection_Endpoint,o.href),typeof s=="string"&&s.trim().length>0&&u.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),u}static fromHost(o,s){e.Contracts.throwIfNull(o,"hostName");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Host,o.protocol+"//"+o.hostname+(o.port===""?"":":"+o.port)),a.setProperty(A.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"1"),s!==void 0&&a.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),a}static fromAuthorizationToken(o,s){e.Contracts.throwIfNull(o,"authorizationToken"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a.setProperty(A.PropertyId.SpeechServiceConnection_IntentRegion,s),a.authorizationToken=o,a}close(){}};Nc.SpeechConfig=r;class i extends r{constructor(o){super(),this.privProperties=new A.PropertyCollection,this.speechRecognitionLanguage="en-US",this.outputFormat=A.OutputFormat.Simple,this.privTokenCredential=o}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o)}get speechRecognitionLanguage(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,o)}get autoDetectSourceLanguages(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,o)}get outputFormat(){return A.OutputFormat[this.privProperties.getProperty(t.OutputFormatPropertyName,void 0)]}set outputFormat(o){this.privProperties.setProperty(t.OutputFormatPropertyName,A.OutputFormat[o])}get endpointId(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_EndpointId)}set endpointId(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_EndpointId,o)}get tokenCredential(){return this.privTokenCredential}setProperty(o,s){e.Contracts.throwIfNull(s,"value"),this.privProperties.setProperty(o,s)}getProperty(o,s){return this.privProperties.getProperty(o,s)}setProxy(o,s,a,c){this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyHostName],o),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPort],s),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyUserName],a),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPassword],c)}setServiceProperty(o,s){const a=JSON.parse(this.privProperties.getProperty(t.ServicePropertiesPropertyName,"{}"));a[o]=s,this.privProperties.setProperty(t.ServicePropertiesPropertyName,JSON.stringify(a))}setProfanity(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceResponse_ProfanityOption,A.ProfanityOption[o])}enableAudioLogging(){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty(A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true"),this.privProperties.setProperty(t.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Detailed])}enableDictation(){this.privProperties.setProperty(t.ForceDictationPropertyName,"true")}clone(){const o=new i(this.tokenCredential);return o.privProperties=this.privProperties.clone(),o}get speechSynthesisLanguage(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage,o)}get speechSynthesisVoiceName(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthVoice,o)}get speechSynthesisOutputFormat(){return A.SpeechSynthesisOutputFormat[this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,A.SpeechSynthesisOutputFormat[o])}}return Nc.SpeechConfigImpl=i,Nc}var Kc={},k2;function n_(){if(k2)return Kc;k2=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.SpeechTranslationConfigImpl=Kc.SpeechTranslationConfig=void 0;const t=ut(),e=Ut,A=Ve();let r=class extends A.SpeechConfig{constructor(){super()}static fromSubscription(o,s){e.Contracts.throwIfNullOrWhitespace(o,"subscriptionKey"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.properties.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),a.properties.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}static fromAuthorizationToken(o,s){e.Contracts.throwIfNullOrWhitespace(o,"authorizationToken"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.properties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o),a.properties.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}static fromHost(o,s){e.Contracts.throwIfNull(o,"hostName");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Host,o.protocol+"//"+o.hostname+(o.port===""?"":":"+o.port)),s!==void 0&&a.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),a}static fromEndpoint(o,s){e.Contracts.throwIfNull(o,"endpoint");const a=typeof s=="string"&&s.trim().length>0,c=typeof s=="object"&&s!==null&&typeof s.getToken=="function";if(s!==void 0&&!a&&!c)throw new Error("Invalid 'auth' parameter: must be a non-empty key string or a valid TokenCredential object.");const u=typeof s=="object"?new i(s):new i;return u.setProperty(A.PropertyId.SpeechServiceConnection_Endpoint,o.href),typeof s=="string"&&s.trim().length>0&&u.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),u}};Kc.SpeechTranslationConfig=r;class i extends r{constructor(o){super(),this.privSpeechProperties=new A.PropertyCollection,this.outputFormat=A.OutputFormat.Simple,this.privTokenCredential=o}set authorizationToken(o){e.Contracts.throwIfNullOrWhitespace(o,"value"),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o)}set speechRecognitionLanguage(o){e.Contracts.throwIfNullOrWhitespace(o,"value"),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,o)}get speechRecognitionLanguage(){return this.privSpeechProperties.getProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_RecoLanguage])}get subscriptionKey(){return this.privSpeechProperties.getProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_Key])}get outputFormat(){return A.OutputFormat[this.privSpeechProperties.getProperty(t.OutputFormatPropertyName,void 0)]}set outputFormat(o){this.privSpeechProperties.setProperty(t.OutputFormatPropertyName,A.OutputFormat[o])}get endpointId(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_EndpointId)}set endpointId(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_EndpointId,o)}addTargetLanguage(o){e.Contracts.throwIfNullOrWhitespace(o,"value");const s=this.targetLanguages;s.includes(o)||(s.push(o),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,s.join(",")))}get targetLanguages(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0?this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","):[]}get voiceName(){return this.getProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_TranslationVoice])}set voiceName(o){e.Contracts.throwIfNullOrWhitespace(o,"value"),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,o)}get region(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_Region)}get tokenCredential(){return this.privTokenCredential}setProxy(o,s,a,c){this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyHostName],o),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPort],s),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyUserName],a),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPassword],c)}getProperty(o,s){return this.privSpeechProperties.getProperty(o,s)}setProperty(o,s){this.privSpeechProperties.setProperty(o,s)}get properties(){return this.privSpeechProperties}close(){}setServiceProperty(o,s){const a=JSON.parse(this.privSpeechProperties.getProperty(t.ServicePropertiesPropertyName,"{}"));a[o]=s,this.privSpeechProperties.setProperty(t.ServicePropertiesPropertyName,JSON.stringify(a))}setProfanity(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceResponse_ProfanityOption,A.ProfanityOption[o])}enableAudioLogging(){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privSpeechProperties.setProperty(t.ForceDictationPropertyName,"true")}get speechSynthesisLanguage(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage,o)}get speechSynthesisVoiceName(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthVoice,o)}get speechSynthesisOutputFormat(){return A.SpeechSynthesisOutputFormat[this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,A.SpeechSynthesisOutputFormat[o])}}return Kc.SpeechTranslationConfigImpl=i,Kc}var Hg={},P2;function G2(){if(P2)return Hg;P2=1,Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.PropertyCollection=void 0;const t=Ve();let e=class ZG{constructor(){this.privKeys=[],this.privValues=[]}getProperty(r,i){let n;typeof r=="string"?n=r:n=t.PropertyId[r];for(let o=0;o<this.privKeys.length;o++)if(this.privKeys[o]===n)return this.privValues[o];if(i!==void 0)return String(i)}setProperty(r,i){let n;typeof r=="string"?n=r:n=t.PropertyId[r];for(let o=0;o<this.privKeys.length;o++)if(this.privKeys[o]===n){this.privValues[o]=i;return}this.privKeys.push(n),this.privValues.push(i)}clone(){const r=new ZG;for(let i=0;i<this.privKeys.length;i++)r.privKeys.push(this.privKeys[i]),r.privValues.push(this.privValues[i]);return r}mergeTo(r){this.privKeys.forEach(i=>{if(r.getProperty(i,void 0)===void 0){const n=this.getProperty(i);r.setProperty(i,n)}})}get keys(){return this.privKeys}};return Hg.PropertyCollection=e,Hg}var YC={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyId=void 0,function(e){e[e.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",e[e.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",e[e.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",e[e.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",e[e.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",e[e.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",e[e.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",e[e.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",e[e.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",e[e.SpeechServiceConnection_TranslationCategoryId=9]="SpeechServiceConnection_TranslationCategoryId",e[e.SpeechServiceConnection_IntentRegion=10]="SpeechServiceConnection_IntentRegion",e[e.SpeechServiceConnection_ProxyHostName=11]="SpeechServiceConnection_ProxyHostName",e[e.SpeechServiceConnection_ProxyPort=12]="SpeechServiceConnection_ProxyPort",e[e.SpeechServiceConnection_ProxyUserName=13]="SpeechServiceConnection_ProxyUserName",e[e.SpeechServiceConnection_ProxyPassword=14]="SpeechServiceConnection_ProxyPassword",e[e.SpeechServiceConnection_RecoMode=15]="SpeechServiceConnection_RecoMode",e[e.SpeechServiceConnection_RecoLanguage=16]="SpeechServiceConnection_RecoLanguage",e[e.Speech_SessionId=17]="Speech_SessionId",e[e.SpeechServiceConnection_SynthLanguage=18]="SpeechServiceConnection_SynthLanguage",e[e.SpeechServiceConnection_SynthVoice=19]="SpeechServiceConnection_SynthVoice",e[e.SpeechServiceConnection_SynthOutputFormat=20]="SpeechServiceConnection_SynthOutputFormat",e[e.SpeechServiceConnection_AutoDetectSourceLanguages=21]="SpeechServiceConnection_AutoDetectSourceLanguages",e[e.SpeechServiceResponse_RequestDetailedResultTrueFalse=22]="SpeechServiceResponse_RequestDetailedResultTrueFalse",e[e.SpeechServiceResponse_RequestProfanityFilterTrueFalse=23]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",e[e.SpeechServiceResponse_JsonResult=24]="SpeechServiceResponse_JsonResult",e[e.SpeechServiceResponse_JsonErrorDetails=25]="SpeechServiceResponse_JsonErrorDetails",e[e.CancellationDetails_Reason=26]="CancellationDetails_Reason",e[e.CancellationDetails_ReasonText=27]="CancellationDetails_ReasonText",e[e.CancellationDetails_ReasonDetailedText=28]="CancellationDetails_ReasonDetailedText",e[e.LanguageUnderstandingServiceResponse_JsonResult=29]="LanguageUnderstandingServiceResponse_JsonResult",e[e.SpeechServiceConnection_Url=30]="SpeechServiceConnection_Url",e[e.SpeechServiceConnection_InitialSilenceTimeoutMs=31]="SpeechServiceConnection_InitialSilenceTimeoutMs",e[e.SpeechServiceConnection_EndSilenceTimeoutMs=32]="SpeechServiceConnection_EndSilenceTimeoutMs",e[e.Speech_SegmentationSilenceTimeoutMs=33]="Speech_SegmentationSilenceTimeoutMs",e[e.Speech_SegmentationMaximumTimeMs=34]="Speech_SegmentationMaximumTimeMs",e[e.Speech_SegmentationStrategy=35]="Speech_SegmentationStrategy",e[e.SpeechServiceConnection_EnableAudioLogging=36]="SpeechServiceConnection_EnableAudioLogging",e[e.SpeechServiceConnection_LanguageIdMode=37]="SpeechServiceConnection_LanguageIdMode",e[e.SpeechServiceConnection_RecognitionEndpointVersion=38]="SpeechServiceConnection_RecognitionEndpointVersion",e[e.SpeechServiceConnection_SpeakerIdMode=39]="SpeechServiceConnection_SpeakerIdMode",e[e.SpeechServiceResponse_ProfanityOption=40]="SpeechServiceResponse_ProfanityOption",e[e.SpeechServiceResponse_PostProcessingOption=41]="SpeechServiceResponse_PostProcessingOption",e[e.SpeechServiceResponse_RequestWordLevelTimestamps=42]="SpeechServiceResponse_RequestWordLevelTimestamps",e[e.SpeechServiceResponse_StablePartialResultThreshold=43]="SpeechServiceResponse_StablePartialResultThreshold",e[e.SpeechServiceResponse_OutputFormatOption=44]="SpeechServiceResponse_OutputFormatOption",e[e.SpeechServiceResponse_TranslationRequestStablePartialResult=45]="SpeechServiceResponse_TranslationRequestStablePartialResult",e[e.SpeechServiceResponse_RequestWordBoundary=46]="SpeechServiceResponse_RequestWordBoundary",e[e.SpeechServiceResponse_RequestPunctuationBoundary=47]="SpeechServiceResponse_RequestPunctuationBoundary",e[e.SpeechServiceResponse_RequestSentenceBoundary=48]="SpeechServiceResponse_RequestSentenceBoundary",e[e.SpeechServiceResponse_DiarizeIntermediateResults=49]="SpeechServiceResponse_DiarizeIntermediateResults",e[e.Conversation_ApplicationId=50]="Conversation_ApplicationId",e[e.Conversation_DialogType=51]="Conversation_DialogType",e[e.Conversation_Initial_Silence_Timeout=52]="Conversation_Initial_Silence_Timeout",e[e.Conversation_From_Id=53]="Conversation_From_Id",e[e.Conversation_Conversation_Id=54]="Conversation_Conversation_Id",e[e.Conversation_Custom_Voice_Deployment_Ids=55]="Conversation_Custom_Voice_Deployment_Ids",e[e.Conversation_Speech_Activity_Template=56]="Conversation_Speech_Activity_Template",e[e.Conversation_Request_Bot_Status_Messages=57]="Conversation_Request_Bot_Status_Messages",e[e.Conversation_Agent_Connection_Id=58]="Conversation_Agent_Connection_Id",e[e.SpeechServiceConnection_Host=59]="SpeechServiceConnection_Host",e[e.ConversationTranslator_Host=60]="ConversationTranslator_Host",e[e.ConversationTranslator_Name=61]="ConversationTranslator_Name",e[e.ConversationTranslator_CorrelationId=62]="ConversationTranslator_CorrelationId",e[e.ConversationTranslator_Token=63]="ConversationTranslator_Token",e[e.PronunciationAssessment_ReferenceText=64]="PronunciationAssessment_ReferenceText",e[e.PronunciationAssessment_GradingSystem=65]="PronunciationAssessment_GradingSystem",e[e.PronunciationAssessment_Granularity=66]="PronunciationAssessment_Granularity",e[e.PronunciationAssessment_EnableMiscue=67]="PronunciationAssessment_EnableMiscue",e[e.PronunciationAssessment_Json=68]="PronunciationAssessment_Json",e[e.PronunciationAssessment_Params=69]="PronunciationAssessment_Params",e[e.SpeakerRecognition_Api_Version=70]="SpeakerRecognition_Api_Version",e[e.WebWorkerLoadType=71]="WebWorkerLoadType",e[e.TalkingAvatarService_WebRTC_SDP=72]="TalkingAvatarService_WebRTC_SDP"}(t.PropertyId||(t.PropertyId={}))})(YC);var zg={},j2;function s_(){if(j2)return zg;j2=1,Object.defineProperty(zg,"__esModule",{value:!0}),zg.Recognizer=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class XG{constructor(o,s,a,c){this.audioConfig=o!==void 0?o:r.AudioConfig.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=s.clone(),this.privConnectionFactory=a,this.tokenCredential=c,this.implCommonRecognizerSetup()}close(o,s){A.Contracts.throwIfDisposed(this.privDisposed),(0,e.marshalPromiseToCallbacks)(this.dispose(!0),o,s)}get internalData(){return this.privReco}async dispose(o){this.privDisposed||(this.privDisposed=!0,o&&this.privReco&&(await this.privReco.audioSource.turnOff(),await this.privReco.dispose()))}static get telemetryEnabled(){return t.ServiceRecognizerBase.telemetryDataEnabled}static enableTelemetry(o){t.ServiceRecognizerBase.telemetryDataEnabled=o}implCommonRecognizerSetup(){let o=typeof window<"u"?"Browser":"Node",s="unknown",a="unknown";typeof navigator<"u"&&(o=o+"/"+navigator.platform,s=navigator.userAgent,a=navigator.appVersion);const c=this.createRecognizerConfig(new t.SpeechServiceConfig(new t.Context(new t.OS(o,s,a))));this.privReco=this.createServiceRecognizer(XG.getAuth(this.privProperties,this.tokenCredential),this.privConnectionFactory,this.audioConfig,c)}async recognizeOnceAsyncImpl(o){A.Contracts.throwIfDisposed(this.privDisposed);const s=new e.Deferred;await this.implRecognizerStop(),await this.privReco.recognize(o,s.resolve,s.reject);const a=await s.promise;return await this.implRecognizerStop(),a}async startContinuousRecognitionAsyncImpl(o){A.Contracts.throwIfDisposed(this.privDisposed),await this.implRecognizerStop(),await this.privReco.recognize(o,void 0,void 0)}async stopContinuousRecognitionAsyncImpl(){A.Contracts.throwIfDisposed(this.privDisposed),await this.implRecognizerStop()}async implRecognizerStop(){this.privReco&&await this.privReco.stopRecognizing()}static getAuth(o,s){const a=o.getProperty(r.PropertyId.SpeechServiceConnection_Key,void 0);return a&&a!==""?new t.CognitiveSubscriptionKeyAuthentication(a):s?new t.CognitiveTokenAuthentication(async()=>{try{const c=await s.getToken("https://cognitiveservices.azure.com/.default");return(c==null?void 0:c.token)??""}catch(c){throw c}},async()=>{try{const c=await s.getToken("https://cognitiveservices.azure.com/.default");return(c==null?void 0:c.token)??""}catch(c){throw c}}):new t.CognitiveTokenAuthentication(()=>{const c=o.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(c)},()=>{const c=o.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(c)})}};return zg.Recognizer=i,zg}var Jg={},vn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionMode=void 0,function(e){e.Interactive="Interactive",e.Dictation="Dictation",e.Conversation="Conversation",e.None="None"}(t.RecognitionMode||(t.RecognitionMode={}))})(vn);var Y2;function o_(){if(Y2)return Jg;Y2=1,Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.SpeechRecognizer=void 0;const t=ut(),e=vn,A=Mt(),r=Ut,i=Ve();let n=class _G extends i.Recognizer{constructor(s,a){const c=s;r.Contracts.throwIfNull(c,"speechConfig"),r.Contracts.throwIfNullOrWhitespace(c.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage]),super(a,c.properties,new t.SpeechConnectionFactory,s.tokenCredential),this.privDisposedRecognizer=!1}static FromConfig(s,a,c){const u=s;return a.properties.mergeTo(u.properties),new _G(s,c)}get endpointId(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){r.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,s)}get speechRecognitionLanguage(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(t.OutputFormatPropertyName,i.OutputFormat[i.OutputFormat.Simple])===i.OutputFormat[i.OutputFormat.Simple]?i.OutputFormat.Simple:i.OutputFormat.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(e.RecognitionMode.Interactive),s,a)}startContinuousRecognitionAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),s,a)}stopContinuousRecognitionAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}startKeywordRecognitionAsync(s,a,c){r.Contracts.throwIfNull(s,"model"),c&&c("Not yet implemented.")}stopKeywordRecognitionAsync(s){s&&s()}close(s,a){r.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}async dispose(s){this.privDisposedRecognizer||(s&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(s))}createRecognizerConfig(s){return new t.RecognizerConfig(s,this.privProperties)}createServiceRecognizer(s,a,c,u){const l=c;return new t.SpeechServiceRecognizer(s,a,l,u,this)}};return Jg.SpeechRecognizer=n,Jg}var qg={},H2;function a_(){if(H2)return qg;H2=1,Object.defineProperty(qg,"__esModule",{value:!0}),qg.IntentRecognizer=void 0;const t=ut(),e=vn,A=Mt(),r=Ut,i=Ve();let n=class extends i.Recognizer{constructor(s,a){r.Contracts.throwIfNullOrUndefined(s,"speechConfig");const c=s;r.Contracts.throwIfNullOrUndefined(c,"speechConfig"),super(a,c.properties,new t.IntentConnectionFactory),this.privAddedIntents=[],this.privAddedLmIntents={},this.privDisposedIntentRecognizer=!1,this.privProperties=c.properties,r.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage])}get speechRecognitionLanguage(){return r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,s)}get properties(){return this.privProperties}recognizeOnceAsync(s,a){if(r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),Object.keys(this.privAddedLmIntents).length!==0||this.privUmbrellaIntent!==void 0){const c=this.buildSpeechContext();this.privReco.speechContext.getContext().intent=c.Intent,this.privReco.dynamicGrammar.addReferenceGrammar(c.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}(0,A.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(e.RecognitionMode.Interactive),s,a)}startContinuousRecognitionAsync(s,a){if(Object.keys(this.privAddedLmIntents).length!==0||this.privUmbrellaIntent!==void 0){const c=this.buildSpeechContext();this.privReco.speechContext.getContext().intent=c.Intent,this.privReco.dynamicGrammar.addReferenceGrammar(c.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),s,a)}stopContinuousRecognitionAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}startKeywordRecognitionAsync(s,a,c){r.Contracts.throwIfNull(s,"model"),c&&c("Not yet implemented.")}stopKeywordRecognitionAsync(s,a){if(s)try{s()}catch(c){a&&a(c)}}addIntent(s,a){r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),r.Contracts.throwIfNullOrWhitespace(a,"intentId"),r.Contracts.throwIfNullOrWhitespace(s,"simplePhrase"),this.privAddedIntents.push([a,s])}addIntentWithLanguageModel(s,a,c){r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),r.Contracts.throwIfNullOrWhitespace(s,"intentId"),r.Contracts.throwIfNull(a,"model");const u=a;r.Contracts.throwIfNullOrWhitespace(u.appId,"model.appId"),this.privAddedLmIntents[s]=new t.AddedLmIntent(u,c)}addAllIntents(s,a){r.Contracts.throwIfNull(s,"model");const c=s;r.Contracts.throwIfNullOrWhitespace(c.appId,"model.appId"),this.privUmbrellaIntent=new t.AddedLmIntent(c,a)}close(s,a){r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}createRecognizerConfig(s){return new t.RecognizerConfig(s,this.privProperties)}createServiceRecognizer(s,a,c,u){const l=c;return new t.IntentServiceRecognizer(s,a,l,u,this)}async dispose(s){this.privDisposedIntentRecognizer||s&&(this.privDisposedIntentRecognizer=!0,await super.dispose(s))}buildSpeechContext(){let s,a,c;const u=[];this.privUmbrellaIntent!==void 0&&(s=this.privUmbrellaIntent.modelImpl.appId,a=this.privUmbrellaIntent.modelImpl.region,c=this.privUmbrellaIntent.modelImpl.subscriptionKey);for(const l of Object.keys(this.privAddedLmIntents)){const g=this.privAddedLmIntents[l];if(s===void 0)s=g.modelImpl.appId;else if(s!==g.modelImpl.appId)throw new Error("Intents must all be from the same LUIS model");if(a===void 0)a=g.modelImpl.region;else if(a!==g.modelImpl.region)throw new Error("Intents must all be from the same LUIS model in a single region");if(c===void 0)c=g.modelImpl.subscriptionKey;else if(c!==g.modelImpl.subscriptionKey)throw new Error("Intents must all use the same subscription key");const h="luis/"+s+"-PRODUCTION#"+l;u.push(h)}return{Intent:{id:s,key:c===void 0?this.privProperties.getProperty(i.PropertyId[i.PropertyId.SpeechServiceConnection_Key]):c,provider:"LUIS"},ReferenceGrammars:this.privUmbrellaIntent===void 0?u:["luis/"+s+"-PRODUCTION"]}}};return qg.IntentRecognizer=n,qg}var z2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileType=void 0,function(e){e[e.TextIndependentIdentification=0]="TextIndependentIdentification",e[e.TextDependentVerification=1]="TextDependentVerification",e[e.TextIndependentVerification=2]="TextIndependentVerification"}(t.VoiceProfileType||(t.VoiceProfileType={}))})(z2);var Vg={},Wg={},kc={},J2;function q2(){if(J2)return kc;J2=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.ConnectionMessageImpl=kc.ConnectionMessage=void 0;const t=Wr,e=Mt(),A=G2(),r=YC;let i=class{};kc.ConnectionMessage=i;class n{constructor(s){this.privConnectionMessage=s,this.privProperties=new A.PropertyCollection,this.privConnectionMessage.headers[t.HeaderNames.ConnectionId]&&this.privProperties.setProperty(r.PropertyId.Speech_SessionId,this.privConnectionMessage.headers[t.HeaderNames.ConnectionId]),Object.keys(this.privConnectionMessage.headers).forEach(a=>{this.privProperties.setProperty(a,this.privConnectionMessage.headers[a])})}get path(){return this.privConnectionMessage.headers[Object.keys(this.privConnectionMessage.headers).find(s=>s.toLowerCase()==="path".toLowerCase())]}get isTextMessage(){return this.privConnectionMessage.messageType===e.MessageType.Text}get isBinaryMessage(){return this.privConnectionMessage.messageType===e.MessageType.Binary}get TextMessage(){return this.privConnectionMessage.textBody}get binaryMessage(){return this.privConnectionMessage.binaryBody}get properties(){return this.privProperties}toString(){return""}}return kc.ConnectionMessageImpl=n,kc}var V2;function W2(){if(V2)return Wg;V2=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.Connection=void 0;const t=ut(),e=Mt(),A=q2(),r=Ut,i=Ve();let n=class uR{static fromRecognizer(s){const a=s.internalData,c=new uR;return c.privInternalData=a,c.setupEvents(),c}static fromSynthesizer(s){const a=s.internalData,c=new uR;return c.privInternalData=a,c.setupEvents(),c}openConnection(s,a){(0,e.marshalPromiseToCallbacks)(this.privInternalData.connect(),s,a)}closeConnection(s,a){if(this.privInternalData instanceof t.SynthesisAdapterBase)throw new Error("Disconnecting a synthesizer's connection is currently not supported");(0,e.marshalPromiseToCallbacks)(this.privInternalData.disconnect(),s,a)}setMessageProperty(s,a,c){if(r.Contracts.throwIfNullOrWhitespace(a,"propertyName"),this.privInternalData instanceof t.ServiceRecognizerBase){if(s.toLowerCase()!=="speech.context")throw new Error("Only speech.context message property sets are currently supported for recognizer");{const u=this.privInternalData.speechContext.getContext();u[a]=c}}else if(this.privInternalData instanceof t.SynthesisAdapterBase){if(s.toLowerCase()!=="synthesis.context")throw new Error("Only synthesis.context message property sets are currently supported for synthesizer");this.privInternalData.synthesisContext.setSection(a,c)}}sendMessageAsync(s,a,c,u){(0,e.marshalPromiseToCallbacks)(this.privInternalData.sendNetworkMessage(s,a),c,u)}close(){}setupEvents(){this.privEventListener=this.privInternalData.connectionEvents.attach(s=>{s.name==="ConnectionEstablishedEvent"?this.connected&&this.connected(new i.ConnectionEventArgs(s.connectionId)):s.name==="ConnectionClosedEvent"?this.disconnected&&this.disconnected(new i.ConnectionEventArgs(s.connectionId)):s.name==="ConnectionMessageSentEvent"?this.messageSent&&this.messageSent(new i.ConnectionMessageEventArgs(new A.ConnectionMessageImpl(s.message))):s.name==="ConnectionMessageReceivedEvent"&&this.messageReceived&&this.messageReceived(new i.ConnectionMessageEventArgs(new A.ConnectionMessageImpl(s.message)))}),this.privServiceEventListener=this.privInternalData.serviceEvents.attach(s=>{this.receivedServiceMessage&&this.receivedServiceMessage(new i.ServiceEventArgs(s.jsonString,s.name))})}};return Wg.Connection=n,Wg}var Z2;function c_(){if(Z2)return Vg;Z2=1,Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.TranslationRecognizer=void 0;const t=ut(),e=vn,A=Mt(),r=W2(),i=Ut,n=Ve();let o=class $G extends n.Recognizer{constructor(a,c,u){const l=a;i.Contracts.throwIfNull(l,"speechConfig"),super(c,l.properties,u||new t.TranslationConnectionFactory,a.tokenCredential),this.privDisposedTranslationRecognizer=!1,this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)!==void 0&&i.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationVoice),n.PropertyId[n.PropertyId.SpeechServiceConnection_TranslationVoice]),i.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages),n.PropertyId[n.PropertyId.SpeechServiceConnection_TranslationToLanguages]),i.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage),n.PropertyId[n.PropertyId.SpeechServiceConnection_RecoLanguage])}static FromConfig(a,c,u){const l=a;return c.properties.mergeTo(l.properties),c.properties.getProperty(n.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)===t.AutoDetectSourceLanguagesOpenRangeOptionName&&l.properties.setProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),new $G(a,u)}get speechRecognitionLanguage(){return i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage)}get targetLanguages(){return i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(",")}get voiceName(){return i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(n.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(a){this.properties.setProperty(n.PropertyId.SpeechServiceAuthorization_Token,a)}recognizeOnceAsync(a,c){i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),(0,A.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(e.RecognitionMode.Interactive),a,c)}startContinuousRecognitionAsync(a,c){(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),a,c)}stopContinuousRecognitionAsync(a,c){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),a,c)}removeTargetLanguage(a){if(i.Contracts.throwIfNullOrUndefined(a,"language to be removed"),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0){const c=this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","),u=c.indexOf(a);u>-1&&(c.splice(u,1),this.properties.setProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,c.join(",")),this.updateLanguages(c))}}addTargetLanguage(a){i.Contracts.throwIfNullOrUndefined(a,"language to be added");let c=[];this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0?(c=this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","),c.includes(a)||(c.push(a),this.properties.setProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,c.join(",")))):(this.properties.setProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,a),c=[a]),this.updateLanguages(c)}close(a,c){i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),a,c)}onConnection(){}async dispose(a){this.privDisposedTranslationRecognizer||(this.privDisposedTranslationRecognizer=!0,a&&(await this.implRecognizerStop(),await super.dispose(a)))}createRecognizerConfig(a){return new t.RecognizerConfig(a,this.privProperties)}createServiceRecognizer(a,c,u,l){const g=u;return new t.TranslationServiceRecognizer(a,c,g,l,this)}updateLanguages(a){const c=r.Connection.fromRecognizer(this);c&&(c.setMessageProperty("speech.context","translationcontext",{to:a}),c.sendMessageAsync("event",JSON.stringify({id:"translation",name:"updateLanguage",to:a})))}};return Vg.TranslationRecognizer=o,Vg}var Zg={},X2;function u_(){if(X2)return Zg;X2=1,Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.Translations=void 0;const t=Ve();let e=class{constructor(){this.privMap=new t.PropertyCollection}get languages(){return this.privMap.keys}get(r,i){return this.privMap.getProperty(r,i)}set(r,i){this.privMap.setProperty(r,i)}};return Zg.Translations=e,Zg}var _2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NoMatchReason=void 0,function(e){e[e.NotRecognized=0]="NotRecognized",e[e.InitialSilenceTimeout=1]="InitialSilenceTimeout",e[e.InitialBabbleTimeout=2]="InitialBabbleTimeout"}(t.NoMatchReason||(t.NoMatchReason={}))})(_2);var Xg={},$2;function l_(){if($2)return Xg;$2=1,Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.NoMatchDetails=void 0;const t=ut(),e=Ve();let A=class ej{constructor(i){this.privReason=i}static fromResult(i){const n=t.SimpleSpeechPhrase.fromJSON(i.json,0);let o=e.NoMatchReason.NotRecognized;switch(n.RecognitionStatus){case t.RecognitionStatus.BabbleTimeout:o=e.NoMatchReason.InitialBabbleTimeout;break;case t.RecognitionStatus.InitialSilenceTimeout:o=e.NoMatchReason.InitialSilenceTimeout;break;default:o=e.NoMatchReason.NotRecognized;break}return new ej(o)}get reason(){return this.privReason}};return Xg.NoMatchDetails=A,Xg}var HC={};Object.defineProperty(HC,"__esModule",{value:!0}),HC.TranslationRecognitionCanceledEventArgs=void 0;class h_{constructor(e,A,r,i,n){this.privCancelReason=A,this.privErrorDetails=r,this.privResult=n,this.privSessionId=e,this.privErrorCode=i}get result(){return this.privResult}get sessionId(){return this.privSessionId}get reason(){return this.privCancelReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}HC.TranslationRecognitionCanceledEventArgs=h_;var _g={},eU;function g_(){if(eU)return _g;eU=1,Object.defineProperty(_g,"__esModule",{value:!0}),_g.IntentRecognitionCanceledEventArgs=void 0;const t=Ve();let e=class extends t.IntentRecognitionEventArgs{constructor(r,i,n,o,s,a){super(o,s,a),this.privReason=r,this.privErrorDetails=i,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}};return _g.IntentRecognitionCanceledEventArgs=e,_g}var $g={};Object.defineProperty($g,"__esModule",{value:!0}),$g.CancellationDetailsBase=void 0;class d_{constructor(e,A,r){this.privReason=e,this.privErrorDetails=A,this.privErrorCode=r}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get ErrorCode(){return this.privErrorCode}}$g.CancellationDetailsBase=d_;var ed={},tU;function p_(){if(tU)return ed;tU=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.CancellationDetails=void 0;const t=ut(),e=$g,A=Ve();let r=class tj extends e.CancellationDetailsBase{constructor(n,o,s){super(n,o,s)}static fromResult(n){let o=A.CancellationReason.Error,s=A.CancellationErrorCode.NoError;if(n instanceof A.RecognitionResult&&n.json){const a=t.SimpleSpeechPhrase.fromJSON(n.json,0);o=t.EnumTranslation.implTranslateCancelResult(a.RecognitionStatus)}return n.properties&&(s=A.CancellationErrorCode[n.properties.getProperty(t.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.NoError])]),new tj(o,n.errorDetails||t.EnumTranslation.implTranslateErrorDetails(s),s)}};return ed.CancellationDetails=r,ed}var AU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationErrorCode=void 0,function(e){e[e.NoError=0]="NoError",e[e.AuthenticationFailure=1]="AuthenticationFailure",e[e.BadRequestParameters=2]="BadRequestParameters",e[e.TooManyRequests=3]="TooManyRequests",e[e.ConnectionFailure=4]="ConnectionFailure",e[e.ServiceTimeout=5]="ServiceTimeout",e[e.ServiceError=6]="ServiceError",e[e.RuntimeError=7]="RuntimeError",e[e.Forbidden=8]="Forbidden"}(t.CancellationErrorCode||(t.CancellationErrorCode={}))})(AU);var td={},rU;function f_(){if(rU)return td;rU=1,Object.defineProperty(td,"__esModule",{value:!0}),td.ConnectionEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{};return td.ConnectionEventArgs=e,td}var Ad={},iU;function E_(){if(iU)return Ad;iU=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.ServiceEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i,n){super(n),this.privJsonResult=r,this.privEventName=i}get jsonString(){return this.privJsonResult}get eventName(){return this.privEventName}};return Ad.ServiceEventArgs=e,Ad}var zC={};Object.defineProperty(zC,"__esModule",{value:!0}),zC.PhraseListGrammar=void 0;class S0{constructor(e){this.privGrammerBuilder=e.dynamicGrammar}static fromRecognizer(e){const A=e.internalData;return new S0(A)}addPhrase(e){this.privGrammerBuilder.addPhrase(e)}addPhrases(e){this.privGrammerBuilder.addPhrase(e)}clear(){this.privGrammerBuilder.clearPhrases()}}zC.PhraseListGrammar=S0;var Pc={},nU;function m0(){if(nU)return Pc;nU=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.DialogServiceConfigImpl=Pc.DialogServiceConfig=void 0;const t=Ut,e=Ve();let A=class{constructor(){}set applicationId(n){}static get DialogTypes(){return{BotFramework:"bot_framework",CustomCommands:"custom_commands"}}};Pc.DialogServiceConfig=A;class r extends A{constructor(){super(),this.privSpeechConfig=new e.SpeechConfigImpl}get properties(){return this.privSpeechConfig.properties}get speechRecognitionLanguage(){return this.privSpeechConfig.speechRecognitionLanguage}set speechRecognitionLanguage(n){t.Contracts.throwIfNullOrWhitespace(n,"value"),this.privSpeechConfig.speechRecognitionLanguage=n}get outputFormat(){return this.privSpeechConfig.outputFormat}set outputFormat(n){this.privSpeechConfig.outputFormat=n}setProperty(n,o){this.privSpeechConfig.setProperty(n,o)}getProperty(n,o){return this.privSpeechConfig.getProperty(n)}setProxy(n,o,s,a){this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyHostName,n),this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyPort,`${o}`),s&&this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyUserName,s),a&&this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyPassword,a)}setServiceProperty(n,o,s){this.privSpeechConfig.setServiceProperty(n,o)}close(){}}return Pc.DialogServiceConfigImpl=r,Pc}var rd={},sU;function C_(){if(sU)return rd;sU=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.BotFrameworkConfig=void 0;const t=Ut,e=m0(),A=Ve();let r=class extends e.DialogServiceConfigImpl{constructor(){super()}static fromSubscription(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"subscription"),t.Contracts.throwIfNullOrWhitespace(o,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),a.setProperty(A.PropertyId.SpeechServiceConnection_Key,n),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,o),s&&a.setProperty(A.PropertyId.Conversation_ApplicationId,s),a}static fromAuthorizationToken(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"authorizationToken"),t.Contracts.throwIfNullOrWhitespace(o,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),a.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,n),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,o),s&&a.setProperty(A.PropertyId.Conversation_ApplicationId,s),a}static fromHost(n,o,s){t.Contracts.throwIfNullOrUndefined(n,"host");const a=n instanceof URL?n:new URL(`wss://${n}.convai.speech.azure.us`);t.Contracts.throwIfNullOrUndefined(a,"resolvedHost");const c=new e.DialogServiceConfigImpl;return c.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),c.setProperty(A.PropertyId.SpeechServiceConnection_Host,a.toString()),o!==void 0&&c.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),c}static fromEndpoint(n,o){t.Contracts.throwIfNull(n,"endpoint");const s=new e.DialogServiceConfigImpl;return s.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),s.setProperty(A.PropertyId.SpeechServiceConnection_Endpoint,n.toString()),o!==void 0&&s.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),s}};return rd.BotFrameworkConfig=r,rd}var id={},oU;function I_(){if(oU)return id;oU=1,Object.defineProperty(id,"__esModule",{value:!0}),id.CustomCommandsConfig=void 0;const t=Ut,e=m0(),A=Ve();let r=class extends e.DialogServiceConfigImpl{constructor(){super()}static fromSubscription(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"applicationId"),t.Contracts.throwIfNullOrWhitespace(o,"subscription"),t.Contracts.throwIfNullOrWhitespace(s,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.CustomCommands),a.setProperty(A.PropertyId.Conversation_ApplicationId,n),a.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}static fromAuthorizationToken(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"applicationId"),t.Contracts.throwIfNullOrWhitespace(o,"authorizationToken"),t.Contracts.throwIfNullOrWhitespace(s,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.CustomCommands),a.setProperty(A.PropertyId.Conversation_ApplicationId,n),a.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}set applicationId(n){t.Contracts.throwIfNullOrWhitespace(n,"value"),this.setProperty(A.PropertyId.Conversation_ApplicationId,n)}get applicationId(){return this.getProperty(A.PropertyId.Conversation_ApplicationId)}};return id.CustomCommandsConfig=r,id}var nd={},sd={},od={},ds={};Object.defineProperty(ds,"__esModule",{value:!0}),ds.QueryParameterNames=void 0;class JA{}ds.QueryParameterNames=JA,JA.BotId="botid",JA.CustomSpeechDeploymentId="cid",JA.CustomVoiceDeploymentId="deploymentId",JA.EnableAudioLogging="storeAudio",JA.EnableLanguageId="lidEnabled",JA.EnableWordLevelTimestamps="wordLevelTimestamps",JA.EndSilenceTimeoutMs="endSilenceTimeoutMs",JA.SegmentationSilenceTimeoutMs="segmentationSilenceTimeoutMs",JA.SegmentationMaximumTimeMs="segmentationMaximumTimeMs",JA.SegmentationStrategy="segmentationStrategy",JA.Format="format",JA.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",JA.Language="language",JA.Profanity="profanity",JA.RequestBotStatusMessages="enableBotMessageStatus",JA.StableIntermediateThreshold="stableIntermediateThreshold",JA.StableTranslation="stableTranslation",JA.TestHooks="testhooks",JA.Postprocessing="postprocessing",JA.CtsMeetingId="meetingId",JA.CtsDeviceId="deviceId",JA.CtsIsParticipant="isParticipant",JA.EnableAvatar="enableTalkingAvatar";var aU;function ps(){if(aU)return od;aU=1,Object.defineProperty(od,"__esModule",{value:!0}),od.ConnectionFactoryBase=void 0;const t=ut(),e=Mt(),A=Ve(),r=ds;let i=class{static getHostSuffix(o){if(o){if(o.toLowerCase().startsWith("china"))return".azure.cn";if(o.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(o,s,a){new Map([[A.PropertyId.Speech_SegmentationSilenceTimeoutMs,r.QueryParameterNames.SegmentationSilenceTimeoutMs],[A.PropertyId.SpeechServiceConnection_EnableAudioLogging,r.QueryParameterNames.EnableAudioLogging],[A.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,r.QueryParameterNames.EndSilenceTimeoutMs],[A.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,r.QueryParameterNames.InitialSilenceTimeoutMs],[A.PropertyId.SpeechServiceResponse_PostProcessingOption,r.QueryParameterNames.Postprocessing],[A.PropertyId.SpeechServiceResponse_ProfanityOption,r.QueryParameterNames.Profanity],[A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,r.QueryParameterNames.EnableWordLevelTimestamps],[A.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,r.QueryParameterNames.StableIntermediateThreshold]]).forEach((l,g)=>{this.setUrlParameter(g,l,o,s,a)});const u=JSON.parse(o.parameters.getProperty(t.ServicePropertiesPropertyName,"{}"));Object.keys(u).forEach(l=>{s[l]=u[l]})}setUrlParameter(o,s,a,c,u){const l=a.parameters.getProperty(o,void 0);l&&(!u||u.search(s)===-1)&&(c[s]=l.toLocaleLowerCase())}static async getRedirectUrlFromEndpoint(o){let s;if(typeof window<"u"&&typeof window.fetch<"u"){const a=new URL(o);a.protocol="https:",a.port="443",a.searchParams.append("GenerateRedirectResponse","true");const u=a.toString();e.Events.instance.onEvent(new e.ConnectionRedirectEvent("",u,void 0,"ConnectionFactoryBase: redirectUrl request"));const l=await fetch(u);if(l.status!==200)return o;s=await l.text()}else s=o;e.Events.instance.onEvent(new e.ConnectionRedirectEvent("",s,o,"ConnectionFactoryBase: redirectUrlString"));try{return new URL(s.trim()).toString()}catch{return o}}};return od.ConnectionFactoryBase=i,od}var cU;function B_(){if(cU)return sd;cU=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.DialogConnectionFactory=void 0;const t=Zr(),e=ut(),A=Ve(),r=ps(),i=ut(),n=Wr,o=ds;class s extends r.ConnectionFactoryBase{create(c,u,l){const g=c.parameters.getProperty(A.PropertyId.Conversation_ApplicationId,""),h=c.parameters.getProperty(A.PropertyId.Conversation_DialogType),p=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Region),C=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),I=c.parameters.getProperty(A.PropertyId.Conversation_Request_Bot_Status_Messages,"true"),E={};E[n.HeaderNames.ConnectionId]=l,E[o.QueryParameterNames.Format]=c.parameters.getProperty(e.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Simple]).toLowerCase(),E[o.QueryParameterNames.Language]=C,E[o.QueryParameterNames.RequestBotStatusMessages]=I,g&&(E[o.QueryParameterNames.BotId]=g,h===A.DialogServiceConfig.DialogTypes.CustomCommands&&(E[n.HeaderNames.CustomCommandsAppId]=g));const v=h===A.DialogServiceConfig.DialogTypes.CustomCommands?"commands/":"",m=h===A.DialogServiceConfig.DialogTypes.CustomCommands?"v1":h===A.DialogServiceConfig.DialogTypes.BotFramework?"v3":"v0",M={};u.token!=null&&u.token!==""&&(M[u.headerName]=u.token);let O=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint,"");if(!O){const P=r.ConnectionFactoryBase.getHostSuffix(p),D=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Host,`wss://${p}.${s.BaseUrl}${P}`);O=`${D.endsWith("/")?D:D+"/"}${v}${s.ApiKey}/${m}`}this.setCommonUrlParams(c,E,O);const x=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(O,E,M,new i.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(c),x,l))}}return sd.DialogConnectionFactory=s,s.ApiKey="api",s.BaseUrl="convai.speech",sd}var uU;function v_(){if(uU)return nd;uU=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.DialogServiceConnector=void 0;const t=B_(),e=ut(),A=vn,r=Mt(),i=Ut,n=Ve(),o=YC;let s=class extends n.Recognizer{constructor(c,u){const l=c;i.Contracts.throwIfNull(c,"dialogConfig"),super(u,l.properties,new t.DialogConnectionFactory),this.isTurnComplete=!0,this.privIsDisposed=!1,this.privProperties=l.properties.clone();const g=this.buildAgentConfig();this.privReco.agentConfig.set(g)}connect(c,u){(0,r.marshalPromiseToCallbacks)(this.privReco.connect(),c,u)}disconnect(c,u){(0,r.marshalPromiseToCallbacks)(this.privReco.disconnect(),c,u)}get authorizationToken(){return this.properties.getProperty(o.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(c){i.Contracts.throwIfNullOrWhitespace(c,"token"),this.properties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,c)}get properties(){return this.privProperties}get speechActivityTemplate(){return this.properties.getProperty(o.PropertyId.Conversation_Speech_Activity_Template)}set speechActivityTemplate(c){this.properties.setProperty(o.PropertyId.Conversation_Speech_Activity_Template,c)}listenOnceAsync(c,u){if(this.isTurnComplete){i.Contracts.throwIfDisposed(this.privIsDisposed);const g=(async()=>{await this.privReco.connect(),await this.implRecognizerStop(),this.isTurnComplete=!1;const h=new r.Deferred;await this.privReco.recognize(A.RecognitionMode.Conversation,h.resolve,h.reject);const p=await h.promise;return await this.implRecognizerStop(),p})();g.catch(()=>{this.dispose(!0).catch(()=>{})}),(0,r.marshalPromiseToCallbacks)(g.finally(()=>{this.isTurnComplete=!0}),c,u)}}sendActivityAsync(c,u,l){(0,r.marshalPromiseToCallbacks)(this.privReco.sendMessage(c),u,l)}close(c,u){i.Contracts.throwIfDisposed(this.privIsDisposed),(0,r.marshalPromiseToCallbacks)(this.dispose(!0),c,u)}async dispose(c){this.privIsDisposed||c&&(this.privIsDisposed=!0,await this.implRecognizerStop(),await super.dispose(c))}createRecognizerConfig(c){return new e.RecognizerConfig(c,this.privProperties)}createServiceRecognizer(c,u,l,g){const h=l;return new e.DialogServiceAdapter(c,u,h,g,this)}buildAgentConfig(){return{botInfo:{commType:this.properties.getProperty("Conversation_Communication_Type","Default"),commandsCulture:void 0,connectionId:this.properties.getProperty(o.PropertyId.Conversation_Agent_Connection_Id),conversationId:this.properties.getProperty(o.PropertyId.Conversation_Conversation_Id,void 0),fromId:this.properties.getProperty(o.PropertyId.Conversation_From_Id,void 0),ttsAudioFormat:this.properties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)},version:.2}}};return nd.DialogServiceConnector=s,nd}var JC={};Object.defineProperty(JC,"__esModule",{value:!0}),JC.ActivityReceivedEventArgs=void 0;class w_{constructor(e,A){this.privActivity=e,this.privAudioStream=A}get activity(){return this.privActivity}get audioStream(){return this.privAudioStream}}JC.ActivityReceivedEventArgs=w_;var qC={},VC={};Object.defineProperty(VC,"__esModule",{value:!0}),VC.TurnStatusResponsePayload=void 0;class M0{constructor(e){this.privMessageStatusResponse=JSON.parse(e)}static fromJSON(e){return new M0(e)}get interactionId(){return this.privMessageStatusResponse.interactionId}get conversationId(){return this.privMessageStatusResponse.conversationId}get statusCode(){switch(this.privMessageStatusResponse.statusCode){case"Success":return 200;case"Failed":return 400;case"TimedOut":return 429;default:return this.privMessageStatusResponse.statusCode}}}VC.TurnStatusResponsePayload=M0,Object.defineProperty(qC,"__esModule",{value:!0}),qC.TurnStatusReceivedEventArgs=void 0;const S_=VC;class m_{constructor(e){this.privTurnStatus=S_.TurnStatusResponsePayload.fromJSON(e)}get interactionId(){return this.privTurnStatus.interactionId}get conversationId(){return this.privTurnStatus.conversationId}get statusCode(){return this.privTurnStatus.statusCode}}qC.TurnStatusReceivedEventArgs=m_;var lU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ServicePropertyChannel=void 0,function(e){e[e.UriQueryParameter=0]="UriQueryParameter"}(t.ServicePropertyChannel||(t.ServicePropertyChannel={}))})(lU);var hU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProfanityOption=void 0,function(e){e[e.Masked=0]="Masked",e[e.Removed=1]="Removed",e[e.Raw=2]="Raw"}(t.ProfanityOption||(t.ProfanityOption={}))})(hU);var ad={},gU;function M_(){if(gU)return ad;gU=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.BaseAudioPlayer=void 0;const t=ai,e=Ve(),A=ya;let r=class{constructor(n){this.audioContext=null,this.gainNode=null,this.autoUpdateBufferTimer=0,n===void 0&&(n=e.AudioStreamFormat.getDefaultInputFormat()),this.init(n)}playAudioSample(n,o,s){try{this.ensureInitializedContext();const a=this.formatAudioData(n),c=new Float32Array(this.samples.length+a.length);c.set(this.samples,0),c.set(a,this.samples.length),this.samples=c,o&&o()}catch(a){s&&s(a)}}stopAudio(n,o){this.audioContext!==null&&(this.samples=new Float32Array,clearInterval(this.autoUpdateBufferTimer),this.audioContext.close().then(()=>{n&&n()},s=>{o&&o(s)}),this.audioContext=null)}init(n){this.audioFormat=n,this.samples=new Float32Array}ensureInitializedContext(){if(this.audioContext===null){this.createAudioContext();const n=200;this.autoUpdateBufferTimer=setInterval(()=>{this.updateAudioBuffer()},n)}}createAudioContext(){this.audioContext=A.AudioStreamFormatImpl.getAudioContext(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),this.startTime=this.audioContext.currentTime}formatAudioData(n){switch(this.audioFormat.bitsPerSample){case 8:return this.formatArrayBuffer(new Int8Array(n),128);case 16:return this.formatArrayBuffer(new Int16Array(n),32768);case 32:return this.formatArrayBuffer(new Int32Array(n),2147483648);default:throw new t.InvalidOperationError("Only WAVE_FORMAT_PCM (8/16/32 bps) format supported at this time")}}formatArrayBuffer(n,o){const s=new Float32Array(n.length);for(let a=0;a<n.length;a++)s[a]=n[a]/o;return s}updateAudioBuffer(){if(this.samples.length===0)return;const n=this.audioFormat.channels,o=this.audioContext.createBufferSource(),s=this.samples.length/n,a=this.audioContext.createBuffer(n,s,this.audioFormat.samplesPerSec);for(let c=0;c<n;c++){let u=c;const l=a.getChannelData(c);for(let g=0;g<this.samples.length;g++,u+=n)l[g]=this.samples[u]}this.startTime<this.audioContext.currentTime&&(this.startTime=this.audioContext.currentTime),o.buffer=a,o.connect(this.gainNode),o.start(this.startTime),this.startTime+=a.duration,this.samples=new Float32Array}async playAudio(n){this.audioContext===null&&this.createAudioContext();const o=this.audioContext.createBufferSource(),s=this.audioContext.destination;await this.audioContext.decodeAudioData(n,a=>{o.buffer=a,o.connect(s),o.start(0)})}};return ad.BaseAudioPlayer=r,ad}var WC={};Object.defineProperty(WC,"__esModule",{value:!0}),WC.ConnectionMessageEventArgs=void 0;class y_{constructor(e){this.privConnectionMessage=e}get message(){return this.privConnectionMessage}toString(){return"Message: "+this.privConnectionMessage.toString()}}WC.ConnectionMessageEventArgs=y_;var ZC={};Object.defineProperty(ZC,"__esModule",{value:!0}),ZC.VoiceProfile=void 0;class Q_{constructor(e,A){this.privId=e,this.privProfileType=A}get profileId(){return this.privId}get profileType(){return this.privProfileType}}ZC.VoiceProfile=Q_;var Gc={},dU;function R_(){if(dU)return Gc;dU=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.VoiceProfileEnrollmentCancellationDetails=Gc.VoiceProfileEnrollmentResult=void 0;const t=ut(),e=Ve();let A=class lR{constructor(n,o,s){this.privReason=n,this.privProperties=new e.PropertyCollection,this.privReason!==e.ResultReason.Canceled?o&&(this.privDetails=JSON.parse(o),this.privDetails.enrollmentStatus.toLowerCase()==="enrolling"&&(this.privReason=e.ResultReason.EnrollingVoiceProfile)):(this.privErrorDetails=s,this.privProperties.setProperty(t.CancellationErrorCodePropertyName,e.CancellationErrorCode[e.CancellationErrorCode.ServiceError]))}get reason(){return this.privReason}get enrollmentsCount(){return this.privDetails.enrollmentsCount}get enrollmentsLength(){return this.privDetails.enrollmentsLength}get properties(){return this.privProperties}get enrollmentResultDetails(){return this.privDetails}get errorDetails(){return this.privErrorDetails}static FromIdentificationProfileList(n){const o=[];for(const s of n.value){const a=s.enrollmentStatus.toLowerCase()==="enrolling"?e.ResultReason.EnrollingVoiceProfile:s.enrollmentStatus.toLowerCase()==="enrolled"?e.ResultReason.EnrolledVoiceProfile:e.ResultReason.Canceled,c=new lR(a,null,null);c.privDetails=this.getIdentificationDetails(s),o.push(c)}return o}static FromVerificationProfileList(n){const o=[];for(const s of n.value){const a=s.enrollmentStatus.toLowerCase()==="enrolling"?e.ResultReason.EnrollingVoiceProfile:s.enrollmentStatus.toLowerCase()==="enrolled"?e.ResultReason.EnrolledVoiceProfile:e.ResultReason.Canceled,c=new lR(a,null,null);c.privDetails=this.getVerificationDetails(s),o.push(c)}return o}static getIdentificationDetails(n){return{audioLength:n.audioLength?parseFloat(n.audioLength):0,audioSpeechLength:n.audioSpeechLength?parseFloat(n.audioSpeechLength):0,enrollmentStatus:n.enrollmentStatus,enrollmentsCount:n.enrollmentsCount||0,enrollmentsLength:n.enrollmentsLength?parseFloat(n.enrollmentsLength):0,enrollmentsSpeechLength:n.enrollmentsSpeechLength?parseFloat(n.enrollmentsSpeechLength):0,profileId:n.profileId||n.identificationProfileId,remainingEnrollmentsSpeechLength:n.remainingEnrollmentsSpeechLength?parseFloat(n.remainingEnrollmentsSpeechLength):0}}static getVerificationDetails(n){return{audioLength:n.audioLength?parseFloat(n.audioLength):0,audioSpeechLength:n.audioSpeechLength?parseFloat(n.audioSpeechLength):0,enrollmentStatus:n.enrollmentStatus,enrollmentsCount:n.enrollmentsCount,enrollmentsLength:n.enrollmentsLength?parseFloat(n.enrollmentsLength):0,enrollmentsSpeechLength:n.enrollmentsSpeechLength?parseFloat(n.enrollmentsSpeechLength):0,profileId:n.profileId||n.verificationProfileId,remainingEnrollmentsCount:n.remainingEnrollments||n.remainingEnrollmentsCount,remainingEnrollmentsSpeechLength:n.remainingEnrollmentsSpeechLength?parseFloat(n.remainingEnrollmentsSpeechLength):0}}};Gc.VoiceProfileEnrollmentResult=A;class r extends e.CancellationDetailsBase{constructor(n,o,s){super(n,o,s)}static fromResult(n){const o=e.CancellationReason.Error;let s=e.CancellationErrorCode.NoError;return n.properties&&(s=e.CancellationErrorCode[n.properties.getProperty(t.CancellationErrorCodePropertyName,e.CancellationErrorCode[e.CancellationErrorCode.NoError])]),new r(o,n.errorDetails,s)}}return Gc.VoiceProfileEnrollmentCancellationDetails=r,Gc}var jc={},pU;function D_(){if(pU)return jc;pU=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.VoiceProfileCancellationDetails=jc.VoiceProfileResult=void 0;const t=ut(),e=Ut,A=Ve();let r=class{constructor(o,s){this.privReason=o,this.privProperties=new A.PropertyCollection,o===A.ResultReason.Canceled&&(e.Contracts.throwIfNullOrUndefined(s,"statusText"),this.privErrorDetails=s,this.privProperties.setProperty(t.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.ServiceError]))}get reason(){return this.privReason}get properties(){return this.privProperties}get errorDetails(){return this.privErrorDetails}};jc.VoiceProfileResult=r;class i extends A.CancellationDetailsBase{constructor(o,s,a){super(o,s,a)}static fromResult(o){const s=A.CancellationReason.Error;let a=A.CancellationErrorCode.NoError;return o.properties&&(a=A.CancellationErrorCode[o.properties.getProperty(t.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.NoError])]),new i(s,o.errorDetails,a)}}return jc.VoiceProfileCancellationDetails=i,jc}var cd={},fU;function T_(){if(fU)return cd;fU=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.VoiceProfilePhraseResult=void 0;const t=Ut,e=Ve();let A=class extends e.VoiceProfileResult{constructor(i,n,o,s){super(i,n),this.privPhrases=[],t.Contracts.throwIfNullOrUndefined(s,"phrase array"),this.privType=o,s&&s[0]&&(this.privPhrases=s)}get phrases(){return this.privPhrases}get type(){return this.privType}};return cd.VoiceProfilePhraseResult=A,cd}var ud={},EU;function U_(){if(EU)return ud;EU=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.VoiceProfileClient=void 0;const t=ut(),e=v2(),A=Ut,r=Ve();let i=class extends r.Recognizer{constructor(o){A.Contracts.throwIfNullOrUndefined(o,"speechConfig");const s=o;A.Contracts.throwIfNull(s,"speechConfig"),super(e.AudioConfig.fromStreamInput(r.AudioInputStream.createPushStream()),s.properties,new t.VoiceProfileConnectionFactory),this.privProperties=s.properties.clone(),this.privVoiceAdapter=this.privReco,this.privDisposedVoiceAdapter=!1}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(o){A.Contracts.throwIfNullOrWhitespace(o,"token"),this.properties.setProperty(r.PropertyId.SpeechServiceAuthorization_Token,o)}async createProfileAsync(o,s){const a=await this.privVoiceAdapter.createProfile(o,s);return new r.VoiceProfile(a[0],o)}async retrieveEnrollmentResultAsync(o){return this.privVoiceAdapter.retrieveEnrollmentResult(o)}async getAllProfilesAsync(o){return this.privVoiceAdapter.getAllProfiles(o)}async getActivationPhrasesAsync(o,s){return this.privVoiceAdapter.getActivationPhrases(o,s)}async enrollProfileAsync(o,s){const a=s;return A.Contracts.throwIfNullOrUndefined(a,"audioConfig"),this.audioConfig=s,this.privVoiceAdapter.SpeakerAudioSource=a,this.privVoiceAdapter.enrollProfile(o)}async deleteProfileAsync(o){return this.privVoiceAdapter.deleteProfile(o)}async resetProfileAsync(o){return this.privVoiceAdapter.resetProfile(o)}async close(){await this.dispose(!0)}createServiceRecognizer(o,s,a,c){const u=a;return new t.VoiceServiceRecognizer(o,s,u,c,this)}async dispose(o){this.privDisposedVoiceAdapter||(this.privDisposedVoiceAdapter=!0,o&&await super.dispose(o))}createRecognizerConfig(o){return new t.RecognizerConfig(o,this.properties)}getResult(o,s){return new r.VoiceProfileResult(o.ok?s:r.ResultReason.Canceled,o.statusText)}};return ud.VoiceProfileClient=i,ud}var ld={},CU;function L_(){if(CU)return ld;CU=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.SpeakerRecognizer=void 0;const t=ut(),e=Ut,A=Ve();let r=class extends A.Recognizer{constructor(n,o){e.Contracts.throwIfNullOrUndefined(n,"speechConfig");const s=n;e.Contracts.throwIfNullOrUndefined(s,"speechConfig"),super(o,s.properties,new t.SpeakerRecognitionConnectionFactory),this.privAudioConfigImpl=o,e.Contracts.throwIfNull(this.privAudioConfigImpl,"audioConfig"),this.privDisposedSpeakerRecognizer=!1,this.privProperties=s.properties}get authorizationToken(){return this.properties.getProperty(A.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(n){e.Contracts.throwIfNullOrWhitespace(n,"token"),this.properties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,n)}get properties(){return this.privProperties}async recognizeOnceAsync(n){return e.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),this.recognizeSpeakerOnceAsyncImpl(n)}async close(){e.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),await this.dispose(!0)}async recognizeSpeakerOnceAsyncImpl(n){e.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),await this.implRecognizerStop();const o=await this.privReco.recognizeSpeaker(n);return await this.implRecognizerStop(),o}async implRecognizerStop(){this.privReco&&await this.privReco.stopRecognizing()}createRecognizerConfig(n){return new t.RecognizerConfig(n,this.privProperties)}createServiceRecognizer(n,o,s,a){const c=s;return new t.SpeakerServiceRecognizer(n,o,c,a,this)}async dispose(n){this.privDisposedSpeakerRecognizer||n&&(this.privDisposedSpeakerRecognizer=!0,await super.dispose(n))}};return ld.SpeakerRecognizer=r,ld}var hd={},IU;function F_(){if(IU)return hd;IU=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.SpeakerIdentificationModel=void 0;const t=Ut,e=Ve();let A=class Aj{constructor(i){if(this.privVoiceProfiles=[],this.privProfileIds=[],t.Contracts.throwIfNullOrUndefined(i,"VoiceProfiles"),i.length===0)throw new Error("Empty Voice Profiles array");for(const n of i){if(n.profileType!==e.VoiceProfileType.TextIndependentIdentification)throw new Error("Identification model can only be created from Identification profile: "+n.profileId);this.privVoiceProfiles.push(n),this.privProfileIds.push(n.profileId)}}static fromProfiles(i){return new Aj(i)}get voiceProfileIds(){return this.privProfileIds.join(",")}get profileIds(){return this.privProfileIds}get scenario(){return"TextIndependentIdentification"}};return hd.SpeakerIdentificationModel=A,hd}var gd={},BU;function O_(){if(BU)return gd;BU=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.SpeakerVerificationModel=void 0;const t=Ut,e=Ve();let A=class rj{constructor(i){if(t.Contracts.throwIfNullOrUndefined(i,"VoiceProfile"),i.profileType===e.VoiceProfileType.TextIndependentIdentification)throw new Error("Verification model cannot be created from Identification profile");this.privVoiceProfile=i}static fromProfile(i){return new rj(i)}get voiceProfile(){return this.privVoiceProfile}get profileIds(){return[this.voiceProfile.profileId]}get scenario(){return this.voiceProfile.profileType===e.VoiceProfileType.TextDependentVerification?"TextDependentVerification":"TextIndependentVerification"}};return gd.SpeakerVerificationModel=A,gd}var dd={},y0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageIdMode=void 0,function(e){e[e.AtStart=0]="AtStart",e[e.Continuous=1]="Continuous"}(t.LanguageIdMode||(t.LanguageIdMode={}))})(y0);var vU;function b_(){if(vU)return dd;vU=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.AutoDetectSourceLanguageConfig=void 0;const t=ut(),e=Ut,A=Ve(),r=y0;let i=class Uw{constructor(){this.privProperties=new A.PropertyCollection,this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_LanguageIdMode,"AtStart"),this.privLanguageIdMode=r.LanguageIdMode.AtStart}static fromOpenRange(){const o=new Uw;return o.properties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,t.AutoDetectSourceLanguagesOpenRangeOptionName),o.properties.setProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),o}static fromLanguages(o){e.Contracts.throwIfArrayEmptyOrWhitespace(o,"languages");const s=new Uw;return s.properties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,o.join()),s}static fromSourceLanguageConfigs(o){if(o.length<1)throw new Error("Expected non-empty SourceLanguageConfig array.");const s=new Uw,a=[];return o.forEach(c=>{if(a.push(c.language),c.endpointId!==void 0&&c.endpointId!==""){const u=c.language+A.PropertyId.SpeechServiceConnection_EndpointId.toString();s.properties.setProperty(u,c.endpointId)}}),s.properties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,a.join()),s}get properties(){return this.privProperties}set mode(o){o===r.LanguageIdMode.Continuous?(this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2"),this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_LanguageIdMode,"Continuous")):(this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"1"),this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_LanguageIdMode,"AtStart")),this.privLanguageIdMode=o}};return dd.AutoDetectSourceLanguageConfig=i,dd}var XC={};Object.defineProperty(XC,"__esModule",{value:!0}),XC.AutoDetectSourceLanguageResult=void 0;const wU=Ut;class _C{constructor(e,A){wU.Contracts.throwIfNullOrUndefined(e,"language"),wU.Contracts.throwIfNullOrUndefined(A,"languageDetectionConfidence"),this.privLanguage=e,this.privLanguageDetectionConfidence=A}static fromResult(e){return new _C(e.language,e.languageDetectionConfidence)}static fromConversationTranscriptionResult(e){return new _C(e.language,e.languageDetectionConfidence)}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}}XC.AutoDetectSourceLanguageResult=_C;var $C={};Object.defineProperty($C,"__esModule",{value:!0}),$C.SourceLanguageConfig=void 0;const x_=Ut;class Q0{constructor(e,A){x_.Contracts.throwIfNullOrUndefined(e,"language"),this.privLanguage=e,this.privEndpointId=A}static fromLanguage(e,A){return new Q0(e,A)}get language(){return this.privLanguage}get endpointId(){return this.privEndpointId}}$C.SourceLanguageConfig=Q0;var R0={},SU;function N_(){return SU||(SU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResult=t.SpeakerRecognitionResultType=void 0;const e=ut(),A=Ve();var r;(function(o){o[o.Verify=0]="Verify",o[o.Identify=1]="Identify"})(r=t.SpeakerRecognitionResultType||(t.SpeakerRecognitionResultType={}));class i{constructor(s,a=A.ResultReason.RecognizedSpeaker,c=A.CancellationErrorCode.NoError,u=""){this.privProperties=new A.PropertyCollection;const l=s.scenario==="TextIndependentIdentification"?r.Identify:r.Verify;this.privReason=a,this.privReason!==A.ResultReason.Canceled?l===r.Identify?(this.privProfileId=s.identificationResult.identifiedProfile.profileId,this.privScore=s.identificationResult.identifiedProfile.score,this.privReason=A.ResultReason.RecognizedSpeakers):(this.privScore=s.verificationResult.score,s.verificationResult.recognitionResult.toLowerCase()!=="accept"&&(this.privReason=A.ResultReason.NoMatch),s.verificationResult.profileId!==void 0&&s.verificationResult.profileId!==""&&(this.privProfileId=s.verificationResult.profileId)):(this.privErrorDetails=u,this.privProperties.setProperty(e.CancellationErrorCodePropertyName,A.CancellationErrorCode[c])),this.privProperties.setProperty(A.PropertyId.SpeechServiceResponse_JsonResult,JSON.stringify(s))}get properties(){return this.privProperties}get reason(){return this.privReason}get profileId(){return this.privProfileId}get errorDetails(){return this.privErrorDetails}get score(){return this.privScore}}t.SpeakerRecognitionResult=i;class n extends A.CancellationDetailsBase{constructor(s,a,c){super(s,a,c)}static fromResult(s){const a=A.CancellationReason.Error;let c=A.CancellationErrorCode.NoError;return s.properties&&(c=A.CancellationErrorCode[s.properties.getProperty(e.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.NoError])]),new n(a,s.errorDetails,c)}}t.SpeakerRecognitionCancellationDetails=n}(R0)),R0}var D0={},Yc={},mU;function MU(){if(mU)return Yc;mU=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.ConversationImpl=Yc.Conversation=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class{constructor(){}static createConversationAsync(s,a,c,u){A.Contracts.throwIfNullOrUndefined(s,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),A.Contracts.throwIfNullOrUndefined(s.region,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),!s.subscriptionKey&&!s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceAuthorization_Token])&&A.Contracts.throwIfNullOrUndefined(s.subscriptionKey,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key"));let l,g,h;return typeof a=="string"?(l=new n(s,a),(0,e.marshalPromiseToCallbacks)((async()=>{})(),c,u)):(l=new n(s),g=a,h=c,l.createConversationAsync(()=>{g&&g()},p=>{h&&h(p)})),l}};Yc.Conversation=i;class n extends i{constructor(s,a){if(super(),this.privErrors=t.ConversationConnectionConfig.restErrors,this.onConnected=l=>{var g;this.privIsConnected=!0;try{(g=this.privConversationTranslator)!=null&&g.sessionStarted&&this.privConversationTranslator.sessionStarted(this.privConversationTranslator,l)}catch{}},this.onDisconnected=l=>{var g;try{(g=this.privConversationTranslator)!=null&&g.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,l)}catch{}finally{this.close(!1)}},this.onCanceled=(l,g)=>{var h;try{(h=this.privConversationTranslator)!=null&&h.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,g)}catch{}},this.onParticipantUpdateCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.id);if(h!==void 0){switch(g.key){case t.ConversationTranslatorCommandTypes.changeNickname:h.displayName=g.value;break;case t.ConversationTranslatorCommandTypes.setUseTTS:h.isUsingTts=g.value;break;case t.ConversationTranslatorCommandTypes.setProfanityFiltering:h.profanity=g.value;break;case t.ConversationTranslatorCommandTypes.setMute:h.isMuted=g.value;break;case t.ConversationTranslatorCommandTypes.setTranslateToLanguages:h.translateToLanguages=g.value;break}this.privParticipants.addOrUpdateParticipant(h),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,[this.toParticipant(h)],g.sessionId))}}catch{}},this.onLockRoomCommandReceived=()=>{},this.onMuteAllCommandReceived=(l,g)=>{try{this.privParticipants.participants.forEach(h=>h.isMuted=h.isHost?!1:g.isMuted),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,this.toParticipants(!1),g.sessionId))}catch{}},this.onParticipantJoinCommandReceived=(l,g)=>{try{const h=this.privParticipants.addOrUpdateParticipant(g.participant);h!==void 0&&this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,[this.toParticipant(h)],g.sessionId))}catch{}},this.onParticipantLeaveCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.participant.id);h!==void 0&&(this.privParticipants.deleteParticipant(g.participant.id),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.LeftConversation,[this.toParticipant(h)],g.sessionId)))}catch{}},this.onTranslationReceived=(l,g)=>{try{switch(g.command){case t.ConversationTranslatorMessageTypes.final:this.privConversationTranslator&&this.privConversationTranslator.transcribed(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.partial:this.privConversationTranslator&&this.privConversationTranslator.transcribing(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.instantMessage:this.privConversationTranslator&&this.privConversationTranslator.textMessageReceived(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break}}catch{}},this.onParticipantsListReceived=(l,g)=>{var h;try{if(g.sessionToken!==void 0&&g.sessionToken!==null&&(this.privRoom.token=g.sessionToken),this.privParticipants.participants=[...g.participants],this.privParticipants.me!==void 0&&(this.privIsReady=!0),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,this.toParticipants(!0),g.sessionId)),this.me.isHost){const p=(h=this.privConversationTranslator)==null?void 0:h.properties.getProperty(r.PropertyId.ConversationTranslator_Name);p!==void 0&&p.length>0&&p!==this.me.displayName&&this.changeNicknameAsync(p)}}catch{}},this.onConversationExpiration=(l,g)=>{try{this.privConversationTranslator&&this.privConversationTranslator.conversationExpiration(this.privConversationTranslator,g)}catch{}},this.privIsConnected=!1,this.privIsDisposed=!1,this.privConversationId="",this.privProperties=new r.PropertyCollection,this.privManager=new t.ConversationManager,s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage])||s.setProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage],t.ConversationConnectionConfig.defaultLanguageCode),this.privLanguage=s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage]),a)this.privConversationId=a;else{s.targetLanguages.length===0&&s.addTargetLanguage(this.privLanguage),s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceResponse_ProfanityOption])||s.setProfanity(r.ProfanityOption.Masked);let g=s.getProperty(r.PropertyId[r.PropertyId.ConversationTranslator_Name]);g==null&&(g="Host"),A.Contracts.throwIfNullOrTooLong(g,"nickname",50),A.Contracts.throwIfNullOrTooShort(g,"nickname",2),s.setProperty(r.PropertyId[r.PropertyId.ConversationTranslator_Name],g)}this.privConfig=s;const u=s;A.Contracts.throwIfNull(u,"speechConfig"),this.privProperties=u.properties.clone(),this.privIsConnected=!1,this.privParticipants=new t.InternalParticipants,this.privIsReady=!1,this.privTextMessageMaxLength=1e3}get room(){return this.privRoom}get connection(){return this.privConversationRecognizer}get config(){return this.privConfig}get conversationId(){return this.privRoom?this.privRoom.roomId:this.privConversationId}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privLanguage}get isMutedByHost(){var s,a;return(s=this.privParticipants.me)!=null&&s.isHost?!1:(a=this.privParticipants.me)==null?void 0:a.isMuted}get isConnected(){return this.privIsConnected&&this.privIsReady}get participants(){return this.toParticipants(!0)}get me(){return this.toParticipant(this.privParticipants.me)}get host(){return this.toParticipant(this.privParticipants.host)}get transcriberRecognizer(){return this.privTranscriberRecognizer}get conversationInfo(){const s=this.conversationId,a=this.participants.map(l=>({id:l.id,preferredLanguage:l.preferredLanguage,voice:l.voice})),c={};for(const l of t.ConversationConnectionConfig.transcriptionEventKeys){const g=this.properties.getProperty(l,"");g!==""&&(c[l]=g)}return{id:s,participants:a,conversationProperties:c}}get canSend(){var s;return this.privIsConnected&&!((s=this.privParticipants.me)!=null&&s.isMuted)}get canSendAsHost(){var s;return this.privIsConnected&&((s=this.privParticipants.me)==null?void 0:s.isHost)}get authorizationToken(){return this.privToken}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"authorizationToken"),this.privToken=s}set conversationTranslator(s){this.privConversationTranslator=s}onToken(s){this.privConversationTranslator.onToken(s)}createConversationAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),this.privManager.createOrJoin(this.privProperties,void 0,c=>{c||this.handleError(new Error(this.privErrors.permissionDeniedConnect),a),this.privRoom=c,this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}startConversationAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer=t.ConversationRecognizerFactory.fromConfig(this,this.privConfig),this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}addParticipantAsync(s,a,c){A.Contracts.throwIfNullOrUndefined(s,"Participant"),(0,e.marshalPromiseToCallbacks)(this.addParticipantImplAsync(s),a,c)}joinConversationAsync(s,a,c,u,l){try{A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","conversationId")),A.Contracts.throwIfNullOrWhitespace(a,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrWhitespace(c,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,s,g=>{A.Contracts.throwIfNullOrUndefined(g,this.privErrors.permissionDeniedConnect),this.privRoom=g,this.privConfig.authorizationToken=g.cognitiveSpeechAuthToken,u&&u(g.cognitiveSpeechAuthToken)},g=>{this.handleError(g,l)})}catch(g){this.handleError(g,l)}}deleteConversationAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.deleteConversationImplAsync(),s,a)}async deleteConversationImplAsync(){A.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),A.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),await this.privManager.leave(this.privProperties,this.privRoom.token),this.dispose()}endConversationAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.endConversationImplAsync(),s,a)}endConversationImplAsync(){return this.close(!0)}lockConversationAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!0),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}removeParticipantAsync(s,a,c){try{if(A.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&s.hasOwnProperty("id"))(0,e.marshalPromiseToCallbacks)(this.removeParticipantImplAsync(s),a,c);else{A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),c);let u="";typeof s=="string"?u=s:s.hasOwnProperty("id")?u=s.id:s.hasOwnProperty("userId")&&(u=s.userId),A.Contracts.throwIfNullOrWhitespace(u,this.privErrors.invalidArgs.replace("{arg}","userId")),this.participants.findIndex(g=>g.id===u)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getEjectCommand(u),()=>{this.handleCallback(a,c)},g=>{this.handleError(g,c)})}}catch(u){this.handleError(u,c)}}unlockConversationAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!1),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}sendTextMessageAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","message")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),s.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMessageCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}setTranslatedLanguagesAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfArrayEmptyOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","languages")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getSetTranslateToLanguagesCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}changeNicknameAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getChangeNicknameCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}isDisposed(){return this.privIsDisposed}dispose(){this.isDisposed||(this.privIsDisposed=!0,this.config&&this.config.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)}async connectTranscriberRecognizer(s){this.privTranscriberRecognizer&&await this.privTranscriberRecognizer.close(),await s.enforceAudioGating(),this.privTranscriberRecognizer=s,this.privTranscriberRecognizer.conversation=this}getKeepAlive(){const s=this.me?this.me.displayName:"default_nickname";return JSON.stringify({id:"0",nickname:s,participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.keepAlive})}addParticipantImplAsync(s){if(this.privParticipants.addOrUpdateParticipant(s)!==void 0&&this.privTranscriberRecognizer){const c=this.conversationInfo;return c.participants=[s],this.privTranscriberRecognizer.pushConversationEvent(c,"join")}}removeParticipantImplAsync(s){this.privParticipants.deleteParticipant(s.id);const a=this.conversationInfo;return a.participants=[s],this.privTranscriberRecognizer.pushConversationEvent(a,"leave")}async close(s){var a;try{this.privIsConnected=!1,await((a=this.privConversationRecognizer)==null?void 0:a.close()),this.privConversationRecognizer=void 0,this.privConversationTranslator&&this.privConversationTranslator.dispose()}catch(c){throw c}s&&this.dispose()}handleCallback(s,a){if(s){try{s()}catch(c){a&&a(c)}s=void 0}}handleError(s,a){if(a)if(s instanceof Error){const c=s;a(c.name+": "+c.message)}else a(s)}toParticipants(s){const a=this.privParticipants.participants.map(c=>this.toParticipant(c));return s?a:a.filter(c=>c.isHost===!1)}toParticipant(s){return new r.Participant(s.id,s.avatar,s.displayName,s.isHost,s.isMuted,s.isUsingTts,s.preferredLanguage,s.voice)}getMuteAllCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMuteCommand(s,a){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMute,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:a})}getLockCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getEjectCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.ejectParticipant,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand})}getSetTranslateToLanguagesCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setTranslateToLanguages,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getChangeNicknameCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"nickname"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.changeNickname,nickname:s,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMessageCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),A.Contracts.throwIfNullOrWhitespace(s,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:s,type:t.ConversationTranslatorMessageTypes.instantMessage})}}return Yc.ConversationImpl=n,Yc}var eI={};Object.defineProperty(eI,"__esModule",{value:!0}),eI.ConversationCommon=void 0;class K_{constructor(e){this.privAudioConfig=e}handleCallback(e,A){if(e){try{e()}catch(r){A&&A(r)}e=void 0}}handleError(e,A){if(A)if(e instanceof Error){const r=e;A(r.name+": "+r.message)}else A(e)}}eI.ConversationCommon=K_;var pd={},yU;function k_(){if(yU)return pd;yU=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.ConversationExpirationEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i){super(i),this.privExpirationTime=r}get expirationTime(){return this.privExpirationTime}};return pd.ConversationExpirationEventArgs=e,pd}var fd={},QU;function P_(){if(QU)return fd;QU=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.ConversationParticipantsChangedEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i,n){super(n),this.privReason=r,this.privParticipant=i}get reason(){return this.privReason}get participants(){return this.privParticipant}};return fd.ConversationParticipantsChangedEventArgs=e,fd}var Ed={},RU;function G_(){if(RU)return Ed;RU=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.ConversationTranslationCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Ed.ConversationTranslationCanceledEventArgs=e,Ed}var Cd={},DU;function j_(){if(DU)return Cd;DU=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.ConversationTranslationEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n){super(i,n),this.privResult=r}get result(){return this.privResult}};return Cd.ConversationTranslationEventArgs=e,Cd}var Id={},TU;function Y_(){if(TU)return Id;TU=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.ConversationTranslationResult=void 0;const t=x2();let e=class extends t.TranslationRecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(i,o,s,a,c,u,void 0,void 0,l,g,h),this.privId=r,this.privOrigLang=n}get participantId(){return this.privId}get originalLang(){return this.privOrigLang}};return Id.ConversationTranslationResult=e,Id}var T0={},Bd={},vd={};Object.defineProperty(vd,"__esModule",{value:!0}),vd.StringUtils=void 0;class H_{static formatString(e,A){if(!e)return"";if(!A)return e;let r="",i="";const n=a=>{r+=a},o=a=>{i+=a};let s=n;for(let a=0;a<e.length;a++){const c=e[a],u=a+1<e.length?e[a+1]:"";switch(c){case"{":u==="{"?(s("{"),a++):s=o;break;case"}":u==="}"?(s("}"),a++):(A.hasOwnProperty(i)&&(r+=A[i]),s=n,i="");break;default:s(c);break}}return r}}vd.StringUtils=H_;var UU;function z_(){if(UU)return Bd;UU=1,Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.ConversationTranslatorConnectionFactory=void 0;const t=Zr(),e=vd,A=Ut,r=Ve(),i=Wr,n=ds,o=ps(),s=ut();let a=class ij extends o.ConnectionFactoryBase{constructor(u){super(),A.Contracts.throwIfNullOrUndefined(u,"convGetter"),this.privConvGetter=u}create(u,l,g){const h=u.parameters.getProperty("ConversationTranslator_MultiChannelAudio","").toUpperCase()==="TRUE",p=this.privConvGetter().room,C=p.cognitiveSpeechRegion||u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_Region,""),I={hostSuffix:o.ConnectionFactoryBase.getHostSuffix(C),path:ij.CTS_VIRT_MIC_PATH,region:encodeURIComponent(C)};I[n.QueryParameterNames.Language]=encodeURIComponent(u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_RecoLanguage,"")),I[n.QueryParameterNames.CtsMeetingId]=encodeURIComponent(p.roomId),I[n.QueryParameterNames.CtsDeviceId]=encodeURIComponent(p.participantId),I[n.QueryParameterNames.CtsIsParticipant]=p.isHost?"":"&"+n.QueryParameterNames.CtsIsParticipant;let E="";const v={},m={};if(h){E=u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_Endpoint),E||(E="wss://"+u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_Host,"transcribe.{region}.cts.speech{hostSuffix}")+"{path}"),E=e.StringUtils.formatString(E,I);const O=new URL(E);O.searchParams.forEach((P,D)=>{v[D]=P}),new s.TranscriberConnectionFactory().setQueryParams(v,u,E),v[n.QueryParameterNames.CtsMeetingId]=I[n.QueryParameterNames.CtsMeetingId],v[n.QueryParameterNames.CtsDeviceId]=I[n.QueryParameterNames.CtsDeviceId],p.isHost||(v[n.QueryParameterNames.CtsIsParticipant]=""),n.QueryParameterNames.Format in v||(v[n.QueryParameterNames.Format]="simple"),O.searchParams.forEach((P,D)=>{O.searchParams.set(D,v[D]),delete v[D]}),E=O.toString()}else{const O=new s.TranslationConnectionFactory;E=O.getEndpointUrl(u,!0),E=e.StringUtils.formatString(E,I),O.setQueryParams(v,u,E)}m[i.HeaderNames.ConnectionId]=g,m[t.RestConfigBase.configParams.token]=p.token,l.token&&(m[l.headerName]=l.token);const M=u.parameters.getProperty("SPEECH-EnableWebsocketCompression","").toUpperCase()==="TRUE";return Promise.resolve(new t.WebsocketConnection(E,v,m,new s.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(u),M,g))}};return Bd.ConversationTranslatorConnectionFactory=a,a.CTS_VIRT_MIC_PATH="/speech/recognition/dynamicaudio",Bd}var LU;function J_(){return LU||(LU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslator=t.SpeechState=void 0;const e=ut(),A=z_(),r=Mt(),i=Ut,n=Ve(),o=MU(),s=U0();var a;(function(l){l[l.Inactive=0]="Inactive",l[l.Connecting=1]="Connecting",l[l.Connected=2]="Connected"})(a=t.SpeechState||(t.SpeechState={}));class c extends n.TranslationRecognizer{constructor(g,h,p,C){super(g,h,new A.ConversationTranslatorConnectionFactory(C)),this.privSpeechState=a.Inactive,p&&(this.privTranslator=p,this.sessionStarted=()=>{this.privSpeechState=a.Connected},this.sessionStopped=()=>{this.privSpeechState=a.Inactive},this.recognizing=(I,E)=>{this.privTranslator.recognizing&&this.privTranslator.recognizing(this.privTranslator,E)},this.recognized=async(I,E)=>{var v;(v=E.result)!=null&&v.errorDetails?(await this.cancelSpeech(),this.fireCancelEvent(E.result.errorDetails)):this.privTranslator.recognized&&this.privTranslator.recognized(this.privTranslator,E)},this.canceled=async()=>{if(this.privSpeechState!==a.Inactive)try{await this.cancelSpeech()}catch{this.privSpeechState=a.Inactive}})}get state(){return this.privSpeechState}set state(g){this.privSpeechState=g}set authentication(g){this.privReco.authentication=g}onConnection(){this.privSpeechState=a.Connected}async onCancelSpeech(){this.privSpeechState=a.Inactive,await this.cancelSpeech()}fireCancelEvent(g){try{if(this.privTranslator.canceled){const h=new s.ConversationTranslationCanceledEventArgs(n.CancellationReason.Error,g,n.CancellationErrorCode.RuntimeError);this.privTranslator.canceled(this.privTranslator,h)}}catch{}}async cancelSpeech(){var g;try{this.stopContinuousRecognitionAsync(),await((g=this.privReco)==null?void 0:g.disconnect()),this.privSpeechState=a.Inactive}catch{}}}class u extends s.ConversationCommon{constructor(g){super(g),this.privErrors=e.ConversationConnectionConfig.restErrors,this.privIsDisposed=!1,this.privIsSpeaking=!1,this.privPlaceholderKey="abcdefghijklmnopqrstuvwxyz012345",this.privPlaceholderRegion="westus",this.privProperties=new n.PropertyCollection}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privSpeechRecognitionLanguage}get participants(){var g;return(g=this.privConversation)==null?void 0:g.participants}get canSpeak(){return!(!this.privConversation.isConnected||!this.privCTRecognizer||this.privIsSpeaking||this.privCTRecognizer.state===a.Connected||this.privCTRecognizer.state===a.Connecting||this.privConversation.isMutedByHost)}onToken(g){this.privCTRecognizer.authentication=g}setServiceProperty(g,h){const p=JSON.parse(this.privProperties.getProperty(e.ServicePropertiesPropertyName,"{}"));p[g]=h,this.privProperties.setProperty(e.ServicePropertiesPropertyName,JSON.stringify(p))}joinConversationAsync(g,h,p,C,I){try{if(typeof g=="string"){i.Contracts.throwIfNullOrUndefined(g,this.privErrors.invalidArgs.replace("{arg}","conversation id")),i.Contracts.throwIfNullOrWhitespace(h,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privConversation&&this.handleError(new Error(this.privErrors.permissionDeniedStart),I);let E=p;(E==null||E==="")&&(E=e.ConversationConnectionConfig.defaultLanguageCode),this.privSpeechTranslationConfig=n.SpeechTranslationConfig.fromSubscription(this.privPlaceholderKey,this.privPlaceholderRegion),this.privSpeechTranslationConfig.setProfanity(n.ProfanityOption.Masked),this.privSpeechTranslationConfig.addTargetLanguage(E),this.privSpeechTranslationConfig.setProperty(n.PropertyId[n.PropertyId.SpeechServiceConnection_RecoLanguage],E),this.privSpeechTranslationConfig.setProperty(n.PropertyId[n.PropertyId.ConversationTranslator_Name],h);const v=[n.PropertyId.SpeechServiceConnection_Host,n.PropertyId.ConversationTranslator_Host,n.PropertyId.SpeechServiceConnection_Endpoint,n.PropertyId.SpeechServiceConnection_ProxyHostName,n.PropertyId.SpeechServiceConnection_ProxyPassword,n.PropertyId.SpeechServiceConnection_ProxyPort,n.PropertyId.SpeechServiceConnection_ProxyUserName,"ConversationTranslator_MultiChannelAudio","ConversationTranslator_Region"];for(const M of v){const O=this.privProperties.getProperty(M);if(O){const x=typeof M=="string"?M:n.PropertyId[M];this.privSpeechTranslationConfig.setProperty(x,O)}}const m=JSON.parse(this.privProperties.getProperty(e.ServicePropertiesPropertyName,"{}"));for(const M of Object.keys(m))this.privSpeechTranslationConfig.setServiceProperty(M,m[M],n.ServicePropertyChannel.UriQueryParameter);this.privConversation=new o.ConversationImpl(this.privSpeechTranslationConfig),this.privConversation.conversationTranslator=this,this.privConversation.joinConversationAsync(g,h,E,M=>{M||this.handleError(new Error(this.privErrors.permissionDeniedConnect),I),this.privSpeechTranslationConfig.authorizationToken=M,this.privConversation.room.isHost=!1,this.privConversation.startConversationAsync(()=>{this.handleCallback(C,I)},O=>{this.handleError(O,I)})},M=>{this.handleError(M,I)})}else typeof g=="object"?(i.Contracts.throwIfNullOrUndefined(g,this.privErrors.invalidArgs.replace("{arg}","conversation id")),i.Contracts.throwIfNullOrWhitespace(h,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privProperties.setProperty(n.PropertyId.ConversationTranslator_Name,h),this.privConversation=g,this.privConversation.conversationTranslator=this,this.privConversation.room.isHost=!0,i.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedConnect),i.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),this.privSpeechTranslationConfig=g.config,this.handleCallback(p,C)):this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","invalid conversation type")),C)}catch(E){this.handleError(E,typeof p=="string"?I:C)}}leaveConversationAsync(g,h){(0,r.marshalPromiseToCallbacks)((async()=>{await this.cancelSpeech(),await this.privConversation.endConversationImplAsync(),await this.privConversation.deleteConversationImplAsync(),this.dispose()})(),g,h)}sendTextMessageAsync(g,h,p){try{i.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),i.Contracts.throwIfNullOrWhitespace(g,this.privErrors.invalidArgs.replace("{arg}",g)),this.privConversation.sendTextMessageAsync(g,h,p)}catch(C){this.handleError(C,p)}}startTranscribingAsync(g,h){(0,r.marshalPromiseToCallbacks)((async()=>{try{i.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),i.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),this.privCTRecognizer===void 0&&await this.connectTranslatorRecognizer(),i.Contracts.throwIfNullOrUndefined(this.privCTRecognizer,this.privErrors.permissionDeniedSend),this.canSpeak||this.handleError(new Error(this.privErrors.permissionDeniedSend),h),await this.startContinuousRecognition(),this.privIsSpeaking=!0}catch(p){throw this.privIsSpeaking=!1,await this.cancelSpeech(),p}})(),g,h)}stopTranscribingAsync(g,h){(0,r.marshalPromiseToCallbacks)((async()=>{try{if(!this.privIsSpeaking){await this.cancelSpeech();return}this.privIsSpeaking=!1,await new Promise((p,C)=>{this.privCTRecognizer.stopContinuousRecognitionAsync(p,C)})}catch{await this.cancelSpeech()}})(),g,h)}isDisposed(){return this.privIsDisposed}dispose(g,h,p){(0,r.marshalPromiseToCallbacks)((async()=>{this.isDisposed&&!this.privIsSpeaking||(await this.cancelSpeech(),this.privIsDisposed=!0,this.privSpeechTranslationConfig.close(),this.privSpeechRecognitionLanguage=void 0,this.privProperties=void 0,this.privAudioConfig=void 0,this.privSpeechTranslationConfig=void 0,this.privConversation.dispose(),this.privConversation=void 0)})(),h,p)}async cancelSpeech(){var g;try{this.privIsSpeaking=!1,await((g=this.privCTRecognizer)==null?void 0:g.onCancelSpeech()),this.privCTRecognizer=void 0}catch{}}async connectTranslatorRecognizer(){try{this.privAudioConfig===void 0&&(this.privAudioConfig=n.AudioConfig.fromDefaultMicrophoneInput()),this.privSpeechTranslationConfig.getProperty(n.PropertyId[n.PropertyId.SpeechServiceConnection_Key])===this.privPlaceholderKey&&this.privSpeechTranslationConfig.setProperty(n.PropertyId[n.PropertyId.SpeechServiceConnection_Key],"");const g=()=>this.privConversation;this.privCTRecognizer=new c(this.privSpeechTranslationConfig,this.privAudioConfig,this,g)}catch(g){throw await this.cancelSpeech(),g}}startContinuousRecognition(){return new Promise((g,h)=>{this.privCTRecognizer.startContinuousRecognitionAsync(g,h)})}}t.ConversationTranslator=u}(T0)),T0}var wd={},FU;function q_(){if(FU)return wd;FU=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.ConversationTranscriber=void 0;const t=ut(),e=vn,A=Mt(),r=Ut,i=Ve();let n=class nj extends i.Recognizer{constructor(s,a){const c=s;r.Contracts.throwIfNull(c,"speechConfig"),r.Contracts.throwIfNullOrWhitespace(c.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage]),super(a,c.properties,new t.ConversationTranscriberConnectionFactory,s.tokenCredential),this.privProperties.setProperty(i.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2"),this.privDisposedRecognizer=!1}static FromConfig(s,a,c){const u=s;return a.properties.mergeTo(u.properties),new nj(s,c)}get endpointId(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){r.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,s)}get speechRecognitionLanguage(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(t.OutputFormatPropertyName,i.OutputFormat[i.OutputFormat.Simple])===i.OutputFormat[i.OutputFormat.Simple]?i.OutputFormat.Simple:i.OutputFormat.Detailed}get properties(){return this.privProperties}startTranscribingAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),s,a)}stopTranscribingAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}close(s,a){r.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}async dispose(s){this.privDisposedRecognizer||(s&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(s))}createRecognizerConfig(s){return new t.RecognizerConfig(s,this.privProperties)}createServiceRecognizer(s,a,c,u){const l=c;return u.isSpeakerDiarizationEnabled=!0,new t.ConversationTranscriptionServiceRecognizer(s,a,l,u,this)}};return wd.ConversationTranscriber=n,wd}var Hc={},OU;function V_(){if(OU)return Hc;OU=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.Participant=Hc.User=void 0;const t=Ve();class e{constructor(i){this.privUserId=i}get userId(){return this.privUserId}}Hc.User=e;class A{constructor(i,n,o,s,a,c,u,l){this.privId=i,this.privAvatar=n,this.privDisplayName=o,this.privIsHost=s,this.privIsMuted=a,this.privIsUsingTts=c,this.privPreferredLanguage=u,this.privVoice=l,this.privProperties=new t.PropertyCollection}get avatar(){return this.privAvatar}get displayName(){return this.privDisplayName}get id(){return this.privId}get preferredLanguage(){return this.privPreferredLanguage}get isHost(){return this.privIsHost}get isMuted(){return this.privIsMuted}get isUsingTts(){return this.privIsUsingTts}get voice(){return this.privVoice}get properties(){return this.privProperties}static From(i,n,o){return new A(i,"",i,!1,!1,!1,n,o)}}return Hc.Participant=A,Hc}var bU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantChangedReason=void 0,function(e){e[e.JoinedConversation=0]="JoinedConversation",e[e.LeftConversation=1]="LeftConversation",e[e.Updated=2]="Updated"}(t.ParticipantChangedReason||(t.ParticipantChangedReason={}))})(bU);var zc={},xU;function W_(){if(xU)return zc;xU=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.MeetingImpl=zc.Meeting=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class{constructor(){}static createMeetingAsync(s,a,c,u){if(A.Contracts.throwIfNullOrUndefined(s,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),A.Contracts.throwIfNullOrUndefined(s.region,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),A.Contracts.throwIfNull(a,"meetingId"),a.length===0)throw new Error("meetingId cannot be empty");!s.subscriptionKey&&!s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceAuthorization_Token])&&A.Contracts.throwIfNullOrUndefined(s.subscriptionKey,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key"));const l=new n(s,a);return(0,e.marshalPromiseToCallbacks)((async()=>{})(),c,u),l}};zc.Meeting=i;class n extends i{constructor(s,a){super(),this.privErrors=t.ConversationConnectionConfig.restErrors,this.onConnected=l=>{var g;this.privIsConnected=!0;try{(g=this.privConversationTranslator)!=null&&g.sessionStarted&&this.privConversationTranslator.sessionStarted(this.privConversationTranslator,l)}catch{}},this.onDisconnected=l=>{var g;try{(g=this.privConversationTranslator)!=null&&g.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,l)}catch{}finally{this.close(!1)}},this.onCanceled=(l,g)=>{var h;try{(h=this.privConversationTranslator)!=null&&h.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,g)}catch{}},this.onParticipantUpdateCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.id);if(h!==void 0){switch(g.key){case t.ConversationTranslatorCommandTypes.changeNickname:h.displayName=g.value;break;case t.ConversationTranslatorCommandTypes.setUseTTS:h.isUsingTts=g.value;break;case t.ConversationTranslatorCommandTypes.setProfanityFiltering:h.profanity=g.value;break;case t.ConversationTranslatorCommandTypes.setMute:h.isMuted=g.value;break;case t.ConversationTranslatorCommandTypes.setTranslateToLanguages:h.translateToLanguages=g.value;break}this.privParticipants.addOrUpdateParticipant(h),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,[this.toParticipant(h)],g.sessionId))}}catch{}},this.onLockRoomCommandReceived=()=>{},this.onMuteAllCommandReceived=(l,g)=>{try{this.privParticipants.participants.forEach(h=>h.isMuted=h.isHost?!1:g.isMuted),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,this.toParticipants(!1),g.sessionId))}catch{}},this.onParticipantJoinCommandReceived=(l,g)=>{try{const h=this.privParticipants.addOrUpdateParticipant(g.participant);h!==void 0&&this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,[this.toParticipant(h)],g.sessionId))}catch{}},this.onParticipantLeaveCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.participant.id);h!==void 0&&(this.privParticipants.deleteParticipant(g.participant.id),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.LeftConversation,[this.toParticipant(h)],g.sessionId)))}catch{}},this.onTranslationReceived=(l,g)=>{try{switch(g.command){case t.ConversationTranslatorMessageTypes.final:this.privConversationTranslator&&this.privConversationTranslator.transcribed(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.partial:this.privConversationTranslator&&this.privConversationTranslator.transcribing(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.instantMessage:this.privConversationTranslator&&this.privConversationTranslator.textMessageReceived(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break}}catch{}},this.onParticipantsListReceived=(l,g)=>{var h;try{if(g.sessionToken!==void 0&&g.sessionToken!==null&&(this.privRoom.token=g.sessionToken),this.privParticipants.participants=[...g.participants],this.privParticipants.me!==void 0&&(this.privIsReady=!0),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,this.toParticipants(!0),g.sessionId)),this.me.isHost){const p=(h=this.privConversationTranslator)==null?void 0:h.properties.getProperty(r.PropertyId.ConversationTranslator_Name);p!==void 0&&p.length>0&&p!==this.me.displayName&&this.changeNicknameAsync(p)}}catch{}},this.onConversationExpiration=(l,g)=>{try{this.privConversationTranslator&&this.privConversationTranslator.conversationExpiration(this.privConversationTranslator,g)}catch{}},this.privIsConnected=!1,this.privIsDisposed=!1,this.privConversationId="",this.privProperties=new r.PropertyCollection,this.privManager=new t.ConversationManager,s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage])||s.setProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage],t.ConversationConnectionConfig.defaultLanguageCode),this.privLanguage=s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage]),this.privConversationId=a,this.privConfig=s;const u=s;A.Contracts.throwIfNull(u,"speechConfig"),this.privProperties=u.properties.clone(),this.privIsConnected=!1,this.privParticipants=new t.InternalParticipants,this.privIsReady=!1,this.privTextMessageMaxLength=1e3}get room(){return this.privRoom}get connection(){return this.privConversationRecognizer}get config(){return this.privConfig}get meetingId(){return this.privRoom?this.privRoom.roomId:this.privConversationId}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privLanguage}get isMutedByHost(){var s,a;return(s=this.privParticipants.me)!=null&&s.isHost?!1:(a=this.privParticipants.me)==null?void 0:a.isMuted}get isConnected(){return this.privIsConnected&&this.privIsReady}get participants(){return this.toParticipants(!0)}get me(){return this.toParticipant(this.privParticipants.me)}get host(){return this.toParticipant(this.privParticipants.host)}get transcriberRecognizer(){return this.privTranscriberRecognizer}get meetingInfo(){const s=this.meetingId,a=this.participants.map(l=>({id:l.id,preferredLanguage:l.preferredLanguage,voice:l.voice})),c={};for(const l of t.ConversationConnectionConfig.transcriptionEventKeys){const g=this.properties.getProperty(l,"");g!==""&&(c[l]=g)}return{id:s,participants:a,meetingProperties:c}}get canSend(){var s;return this.privIsConnected&&!((s=this.privParticipants.me)!=null&&s.isMuted)}get canSendAsHost(){var s;return this.privIsConnected&&((s=this.privParticipants.me)==null?void 0:s.isHost)}get authorizationToken(){return this.privToken}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"authorizationToken"),this.privToken=s}createMeetingAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),this.privManager.createOrJoin(this.privProperties,void 0,c=>{c||this.handleError(new Error(this.privErrors.permissionDeniedConnect),a),this.privRoom=c,this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}startMeetingAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}addParticipantAsync(s,a,c){A.Contracts.throwIfNullOrUndefined(s,"Participant"),(0,e.marshalPromiseToCallbacks)(this.addParticipantImplAsync(s),a,c)}joinMeetingAsync(s,a,c,u,l){try{A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","conversationId")),A.Contracts.throwIfNullOrWhitespace(a,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrWhitespace(c,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,s,g=>{A.Contracts.throwIfNullOrUndefined(g,this.privErrors.permissionDeniedConnect),this.privRoom=g,this.privConfig.authorizationToken=g.cognitiveSpeechAuthToken,u&&u(g.cognitiveSpeechAuthToken)},g=>{this.handleError(g,l)})}catch(g){this.handleError(g,l)}}deleteMeetingAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.deleteMeetingImplAsync(),s,a)}async deleteMeetingImplAsync(){A.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),A.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),await this.privManager.leave(this.privProperties,this.privRoom.token),this.dispose()}endMeetingAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.endMeetingImplAsync(),s,a)}endMeetingImplAsync(){return this.close(!0)}lockMeetingAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!0),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}removeParticipantAsync(s,a,c){try{if(A.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&s.hasOwnProperty("id"))(0,e.marshalPromiseToCallbacks)(this.removeParticipantImplAsync(s),a,c);else{A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),c);let u="";typeof s=="string"?u=s:s.hasOwnProperty("id")?u=s.id:s.hasOwnProperty("userId")&&(u=s.userId),A.Contracts.throwIfNullOrWhitespace(u,this.privErrors.invalidArgs.replace("{arg}","userId")),this.participants.findIndex(g=>g.id===u)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getEjectCommand(u),()=>{this.handleCallback(a,c)},g=>{this.handleError(g,c)})}}catch(u){this.handleError(u,c)}}unlockMeetingAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!1),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}sendTextMessageAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","message")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),s.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMessageCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}setTranslatedLanguagesAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfArrayEmptyOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","languages")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getSetTranslateToLanguagesCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}changeNicknameAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getChangeNicknameCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}isDisposed(){return this.privIsDisposed}dispose(){this.isDisposed||(this.privIsDisposed=!0,this.config&&this.config.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)}async connectTranscriberRecognizer(s){this.privTranscriberRecognizer&&await this.privTranscriberRecognizer.close(),await s.enforceAudioGating(),this.privTranscriberRecognizer=s,this.privTranscriberRecognizer.meeting=this}getKeepAlive(){const s=this.me?this.me.displayName:"default_nickname";return JSON.stringify({id:"0",nickname:s,participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.keepAlive})}addParticipantImplAsync(s){if(this.privParticipants.addOrUpdateParticipant(s)!==void 0&&this.privTranscriberRecognizer){const c=this.meetingInfo;return c.participants=[s],this.privTranscriberRecognizer.pushMeetingEvent(c,"join")}}removeParticipantImplAsync(s){this.privParticipants.deleteParticipant(s.id);const a=this.meetingInfo;return a.participants=[s],this.privTranscriberRecognizer.pushMeetingEvent(a,"leave")}async close(s){var a;try{this.privIsConnected=!1,await((a=this.privConversationRecognizer)==null?void 0:a.close()),this.privConversationRecognizer=void 0,this.privConversationTranslator&&this.privConversationTranslator.dispose()}catch(c){throw c}s&&this.dispose()}handleCallback(s,a){if(s){try{s()}catch(c){a&&a(c)}s=void 0}}handleError(s,a){if(a)if(s instanceof Error){const c=s;a(c.name+": "+c.message)}else a(s)}toParticipants(s){const a=this.privParticipants.participants.map(c=>this.toParticipant(c));return s?a:a.filter(c=>c.isHost===!1)}toParticipant(s){return new r.Participant(s.id,s.avatar,s.displayName,s.isHost,s.isMuted,s.isUsingTts,s.preferredLanguage,s.voice)}getMuteAllCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingd"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMuteCommand(s,a){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMute,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:a})}getLockCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getEjectCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.ejectParticipant,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand})}getSetTranslateToLanguagesCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setTranslateToLanguages,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getChangeNicknameCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(s,"nickname"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.changeNickname,nickname:s,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMessageCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),A.Contracts.throwIfNullOrWhitespace(s,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:s,type:t.ConversationTranslatorMessageTypes.instantMessage})}}return zc.MeetingImpl=n,zc}var Sd={},NU;function Z_(){if(NU)return Sd;NU=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.MeetingTranscriptionCanceledEventArgs=void 0;const t=Pg();class e extends t.CancellationEventArgsBase{}return Sd.MeetingTranscriptionCanceledEventArgs=e,Sd}var md={},KU;function X_(){if(KU)return md;KU=1,Object.defineProperty(md,"__esModule",{value:!0}),md.MeetingTranscriber=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve(),i=U0();let n=class{constructor(s){this.privAudioConfig=s,this.privProperties=new r.PropertyCollection,this.privRecognizer=void 0,this.privDisposedRecognizer=!1}get speechRecognitionLanguage(){return A.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(r.PropertyId.SpeechServiceConnection_RecoLanguage)}get properties(){return this.privProperties}get internalData(){return this.privRecognizer.internalData}get connection(){return r.Connection.fromRecognizer(this.privRecognizer)}get authorizationToken(){return this.properties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(r.PropertyId.SpeechServiceAuthorization_Token,s)}joinMeetingAsync(s,a,c){const u=s;A.Contracts.throwIfNullOrUndefined(i.MeetingImpl,"Meeting"),this.privRecognizer=new t.TranscriberRecognizer(s.config,this.privAudioConfig),A.Contracts.throwIfNullOrUndefined(this.privRecognizer,"Recognizer"),this.privRecognizer.connectMeetingCallbacks(this),(0,e.marshalPromiseToCallbacks)(u.connectTranscriberRecognizer(this.privRecognizer),a,c)}startTranscribingAsync(s,a){this.privRecognizer.startContinuousRecognitionAsync(s,a)}stopTranscribingAsync(s,a){this.privRecognizer.stopContinuousRecognitionAsync(s,a)}leaveMeetingAsync(s,a){this.privRecognizer.disconnectCallbacks(),(0,e.marshalPromiseToCallbacks)((async()=>{})(),s,a)}close(s,a){A.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,e.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}async dispose(s){this.privDisposedRecognizer||(this.privRecognizer&&(await this.privRecognizer.close(),this.privRecognizer=void 0),s&&(this.privDisposedRecognizer=!0))}};return md.MeetingTranscriber=n,md}var Md={},kU;function __(){if(kU)return Md;kU=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.ConversationTranscriptionResult=void 0;const t=Ve();let e=class extends t.RecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(r,i,n,o,s,a,c,l,g,h),this.privSpeakerId=u}get speakerId(){return this.privSpeakerId}};return Md.ConversationTranscriptionResult=e,Md}var PU;function U0(){return PU||(PU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionResult=t.MeetingTranscriber=t.MeetingTranscriptionCanceledEventArgs=t.MeetingImpl=t.Meeting=t.ParticipantChangedReason=t.User=t.Participant=t.ConversationTranscriber=t.ConversationTranslator=t.ConversationTranslationResult=t.ConversationTranslationEventArgs=t.ConversationTranslationCanceledEventArgs=t.ConversationParticipantsChangedEventArgs=t.ConversationExpirationEventArgs=t.ConversationCommon=t.ConversationImpl=t.Conversation=void 0;var e=MU();Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return e.Conversation}}),Object.defineProperty(t,"ConversationImpl",{enumerable:!0,get:function(){return e.ConversationImpl}});var A=eI;Object.defineProperty(t,"ConversationCommon",{enumerable:!0,get:function(){return A.ConversationCommon}});var r=k_();Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return r.ConversationExpirationEventArgs}});var i=P_();Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return i.ConversationParticipantsChangedEventArgs}});var n=G_();Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return n.ConversationTranslationCanceledEventArgs}});var o=j_();Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return o.ConversationTranslationEventArgs}});var s=Y_();Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return s.ConversationTranslationResult}});var a=J_();Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return a.ConversationTranslator}});var c=q_();Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return c.ConversationTranscriber}});var u=V_();Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return u.Participant}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return u.User}});var l=bU;Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return l.ParticipantChangedReason}});var g=W_();Object.defineProperty(t,"Meeting",{enumerable:!0,get:function(){return g.Meeting}}),Object.defineProperty(t,"MeetingImpl",{enumerable:!0,get:function(){return g.MeetingImpl}});var h=Z_();Object.defineProperty(t,"MeetingTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return h.MeetingTranscriptionCanceledEventArgs}});var p=X_();Object.defineProperty(t,"MeetingTranscriber",{enumerable:!0,get:function(){return p.MeetingTranscriber}});var C=__();Object.defineProperty(t,"ConversationTranscriptionResult",{enumerable:!0,get:function(){return C.ConversationTranscriptionResult}})}(D0)),D0}var Jc={},GU;function L0(){if(GU)return Jc;GU=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.SynthesisRequest=Jc.Synthesizer=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class sj{constructor(s){const a=s;A.Contracts.throwIfNull(a,"speechConfig"),this.privProperties=a.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.synthesisRequestQueue=new e.Queue,this.tokenCredential=s.tokenCredential}get authorizationToken(){return this.properties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(r.PropertyId.SpeechServiceAuthorization_Token,s)}get properties(){return this.privProperties}get autoDetectSourceLanguage(){return this.properties.getProperty(r.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)===t.AutoDetectSourceLanguagesOpenRangeOptionName}buildSsml(s){const a={["af-ZA"]:"af-ZA-AdriNeural",["am-ET"]:"am-ET-AmehaNeural",["ar-AE"]:"ar-AE-FatimaNeural",["ar-BH"]:"ar-BH-AliNeural",["ar-DZ"]:"ar-DZ-AminaNeural",["ar-EG"]:"ar-EG-SalmaNeural",["ar-IQ"]:"ar-IQ-BasselNeural",["ar-JO"]:"ar-JO-SanaNeural",["ar-KW"]:"ar-KW-FahedNeural",["ar-LY"]:"ar-LY-ImanNeural",["ar-MA"]:"ar-MA-JamalNeural",["ar-QA"]:"ar-QA-AmalNeural",["ar-SA"]:"ar-SA-HamedNeural",["ar-SY"]:"ar-SY-AmanyNeural",["ar-TN"]:"ar-TN-HediNeural",["ar-YE"]:"ar-YE-MaryamNeural",["bg-BG"]:"bg-BG-BorislavNeural",["bn-BD"]:"bn-BD-NabanitaNeural",["bn-IN"]:"bn-IN-BashkarNeural",["ca-ES"]:"ca-ES-JoanaNeural",["cs-CZ"]:"cs-CZ-AntoninNeural",["cy-GB"]:"cy-GB-AledNeural",["da-DK"]:"da-DK-ChristelNeural",["de-AT"]:"de-AT-IngridNeural",["de-CH"]:"de-CH-JanNeural",["de-DE"]:"de-DE-KatjaNeural",["el-GR"]:"el-GR-AthinaNeural",["en-AU"]:"en-AU-NatashaNeural",["en-CA"]:"en-CA-ClaraNeural",["en-GB"]:"en-GB-LibbyNeural",["en-HK"]:"en-HK-SamNeural",["en-IE"]:"en-IE-ConnorNeural",["en-IN"]:"en-IN-NeerjaNeural",["en-KE"]:"en-KE-AsiliaNeural",["en-NG"]:"en-NG-AbeoNeural",["en-NZ"]:"en-NZ-MitchellNeural",["en-PH"]:"en-PH-JamesNeural",["en-SG"]:"en-SG-LunaNeural",["en-TZ"]:"en-TZ-ElimuNeural",["en-US"]:"en-US-AvaMultilingualNeural",["en-ZA"]:"en-ZA-LeahNeural",["es-AR"]:"es-AR-ElenaNeural",["es-BO"]:"es-BO-MarceloNeural",["es-CL"]:"es-CL-CatalinaNeural",["es-CO"]:"es-CO-GonzaloNeural",["es-CR"]:"es-CR-JuanNeural",["es-CU"]:"es-CU-BelkysNeural",["es-DO"]:"es-DO-EmilioNeural",["es-EC"]:"es-EC-AndreaNeural",["es-ES"]:"es-ES-AlvaroNeural",["es-GQ"]:"es-GQ-JavierNeural",["es-GT"]:"es-GT-AndresNeural",["es-HN"]:"es-HN-CarlosNeural",["es-MX"]:"es-MX-DaliaNeural",["es-NI"]:"es-NI-FedericoNeural",["es-PA"]:"es-PA-MargaritaNeural",["es-PE"]:"es-PE-AlexNeural",["es-PR"]:"es-PR-KarinaNeural",["es-PY"]:"es-PY-MarioNeural",["es-SV"]:"es-SV-LorenaNeural",["es-US"]:"es-US-AlonsoNeural",["es-UY"]:"es-UY-MateoNeural",["es-VE"]:"es-VE-PaolaNeural",["et-EE"]:"et-EE-AnuNeural",["fa-IR"]:"fa-IR-DilaraNeural",["fi-FI"]:"fi-FI-SelmaNeural",["fil-PH"]:"fil-PH-AngeloNeural",["fr-BE"]:"fr-BE-CharlineNeural",["fr-CA"]:"fr-CA-SylvieNeural",["fr-CH"]:"fr-CH-ArianeNeural",["fr-FR"]:"fr-FR-DeniseNeural",["ga-IE"]:"ga-IE-ColmNeural",["gl-ES"]:"gl-ES-RoiNeural",["gu-IN"]:"gu-IN-DhwaniNeural",["he-IL"]:"he-IL-AvriNeural",["hi-IN"]:"hi-IN-MadhurNeural",["hr-HR"]:"hr-HR-GabrijelaNeural",["hu-HU"]:"hu-HU-NoemiNeural",["id-ID"]:"id-ID-ArdiNeural",["is-IS"]:"is-IS-GudrunNeural",["it-IT"]:"it-IT-IsabellaNeural",["ja-JP"]:"ja-JP-NanamiNeural",["jv-ID"]:"jv-ID-DimasNeural",["kk-KZ"]:"kk-KZ-AigulNeural",["km-KH"]:"km-KH-PisethNeural",["kn-IN"]:"kn-IN-GaganNeural",["ko-KR"]:"ko-KR-SunHiNeural",["lo-LA"]:"lo-LA-ChanthavongNeural",["lt-LT"]:"lt-LT-LeonasNeural",["lv-LV"]:"lv-LV-EveritaNeural",["mk-MK"]:"mk-MK-AleksandarNeural",["ml-IN"]:"ml-IN-MidhunNeural",["mr-IN"]:"mr-IN-AarohiNeural",["ms-MY"]:"ms-MY-OsmanNeural",["mt-MT"]:"mt-MT-GraceNeural",["my-MM"]:"my-MM-NilarNeural",["nb-NO"]:"nb-NO-PernilleNeural",["nl-BE"]:"nl-BE-ArnaudNeural",["nl-NL"]:"nl-NL-ColetteNeural",["pl-PL"]:"pl-PL-AgnieszkaNeural",["ps-AF"]:"ps-AF-GulNawazNeural",["pt-BR"]:"pt-BR-FranciscaNeural",["pt-PT"]:"pt-PT-DuarteNeural",["ro-RO"]:"ro-RO-AlinaNeural",["ru-RU"]:"ru-RU-SvetlanaNeural",["si-LK"]:"si-LK-SameeraNeural",["sk-SK"]:"sk-SK-LukasNeural",["sl-SI"]:"sl-SI-PetraNeural",["so-SO"]:"so-SO-MuuseNeural",["sr-RS"]:"sr-RS-NicholasNeural",["su-ID"]:"su-ID-JajangNeural",["sv-SE"]:"sv-SE-SofieNeural",["sw-KE"]:"sw-KE-RafikiNeural",["sw-TZ"]:"sw-TZ-DaudiNeural",["ta-IN"]:"ta-IN-PallaviNeural",["ta-LK"]:"ta-LK-KumarNeural",["ta-SG"]:"ta-SG-AnbuNeural",["te-IN"]:"te-IN-MohanNeural",["th-TH"]:"th-TH-PremwadeeNeural",["tr-TR"]:"tr-TR-AhmetNeural",["uk-UA"]:"uk-UA-OstapNeural",["ur-IN"]:"ur-IN-GulNeural",["ur-PK"]:"ur-PK-AsadNeural",["uz-UZ"]:"uz-UZ-MadinaNeural",["vi-VN"]:"vi-VN-HoaiMyNeural",["zh-CN"]:"zh-CN-XiaoxiaoNeural",["zh-HK"]:"zh-HK-HiuMaanNeural",["zh-TW"]:"zh-TW-HsiaoChenNeural",["zu-ZA"]:"zu-ZA-ThandoNeural"};let c=this.properties.getProperty(r.PropertyId.SpeechServiceConnection_SynthLanguage,"en-US"),u=this.properties.getProperty(r.PropertyId.SpeechServiceConnection_SynthVoice,""),l=sj.XMLEncode(s);return this.autoDetectSourceLanguage?c="en-US":u=u||a[c],u&&(l=`<voice name='${u}'>${l}</voice>`),l=`<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='${c}'>${l}</speak>`,l}async dispose(s){this.privDisposed||(s&&this.privAdapter&&await this.privAdapter.dispose(),this.privDisposed=!0)}async adapterSpeak(){if(!this.privDisposed&&!this.privSynthesizing){this.privSynthesizing=!0;const s=await this.synthesisRequestQueue.dequeue();return this.privAdapter.Speak(s.text,s.isSSML,s.requestId,s.cb,s.err,s.dataStream)}}createSynthesizerConfig(s){return new t.SynthesizerConfig(s,this.privProperties)}implCommonSynthesizeSetup(){let s=typeof window<"u"?"Browser":"Node",a="unknown",c="unknown";typeof navigator<"u"&&(s=s+"/"+navigator.platform,a=navigator.userAgent,c=navigator.appVersion);const u=this.createSynthesizerConfig(new t.SpeechServiceConfig(new t.Context(new t.OS(s,a,c)))),l=this.privProperties.getProperty(r.PropertyId.SpeechServiceConnection_Key,void 0),g=l&&l!==""?new t.CognitiveSubscriptionKeyAuthentication(l):this.tokenCredential?new t.CognitiveTokenAuthentication(async()=>{try{const h=await this.tokenCredential.getToken("https://cognitiveservices.azure.com/.default");return(h==null?void 0:h.token)??""}catch(h){throw h}},async()=>{try{const h=await this.tokenCredential.getToken("https://cognitiveservices.azure.com/.default");return(h==null?void 0:h.token)??""}catch(h){throw h}}):new t.CognitiveTokenAuthentication(()=>{const h=this.privProperties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(h)},()=>{const h=this.privProperties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(h)});this.privAdapter=this.createSynthesisAdapter(g,this.privConnectionFactory,u),this.privRestAdapter=this.createRestSynthesisAdapter(g,u)}static XMLEncode(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}};Jc.Synthesizer=i;class n{constructor(s,a,c,u,l,g){this.requestId=s,this.text=a,this.isSSML=c,this.cb=u,this.err=l,this.dataStream=g}}return Jc.SynthesisRequest=n,Jc}var yd={},jU;function $_(){if(jU)return yd;jU=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.SpeechSynthesizer=void 0;const t=ut(),e=Mt(),A=Lg,r=Qa,i=li,n=Ut,o=Ve(),s=L0();let a=class oj extends o.Synthesizer{constructor(u,l){super(u),l!==null&&(l===void 0?this.audioConfig=typeof window>"u"?void 0:o.AudioConfig.fromDefaultSpeakerOutput():this.audioConfig=l),this.privConnectionFactory=new t.SpeechSynthesisConnectionFactory,this.implCommonSynthesizeSetup()}static FromConfig(u,l,g){const h=u;return l.properties.mergeTo(h.properties),new oj(u,g)}speakTextAsync(u,l,g,h){this.speakImpl(u,!1,l,g,h)}speakSsmlAsync(u,l,g,h){this.speakImpl(u,!0,l,g,h)}async getVoicesAsync(u=""){return this.getVoices(u)}close(u,l){n.Contracts.throwIfDisposed(this.privDisposed),(0,e.marshalPromiseToCallbacks)(this.dispose(!0),u,l)}get internalData(){return this.privAdapter}createSynthesisAdapter(u,l,g){return new t.SpeechSynthesisAdapter(u,l,g,this,this.audioConfig)}createRestSynthesisAdapter(u,l){return new t.SynthesisRestAdapter(l,u)}implCommonSynthesizeSetup(){super.implCommonSynthesizeSetup(),this.privAdapter.audioOutputFormat=r.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(o.SpeechSynthesisOutputFormat[this.properties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)])}speakImpl(u,l,g,h,p){try{n.Contracts.throwIfDisposed(this.privDisposed);const C=(0,e.createNoDashGuid)();let I;p instanceof o.PushAudioOutputStreamCallback?I=new i.PushAudioOutputStreamImpl(p):p instanceof o.PullAudioOutputStream?I=p:p!==void 0?I=new A.AudioFileWriter(p):I=void 0,this.synthesisRequestQueue.enqueue(new s.SynthesisRequest(C,u,l,E=>{if(this.privSynthesizing=!1,g)try{g(E)}catch(v){h&&h(v)}g=void 0,this.adapterSpeak().catch(()=>{})},E=>{h&&h(E)},I)),this.adapterSpeak().catch(()=>{})}catch(C){if(h)if(C instanceof Error){const I=C;h(I.name+": "+I.message)}else h(C);this.dispose(!0).catch(()=>{})}}async getVoices(u){const l=(0,e.createNoDashGuid)(),g=await this.privRestAdapter.getVoicesList(l);if(g.ok&&Array.isArray(g.json)){let h=g.json;return u&&u.length>0&&(h=h.filter(p=>!!p.Locale&&p.Locale.toLowerCase()===u.toLowerCase())),new o.SynthesisVoicesResult(l,h,void 0)}else return new o.SynthesisVoicesResult(l,void 0,`Error: ${g.status}: ${g.statusText}`)}};return yd.SpeechSynthesizer=a,yd}var tI={};Object.defineProperty(tI,"__esModule",{value:!0}),tI.SynthesisResult=void 0;class e${constructor(e,A,r,i){this.privResultId=e,this.privReason=A,this.privErrorDetails=r,this.privProperties=i}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}tI.SynthesisResult=e$;var Qd={},YU;function t$(){if(YU)return Qd;YU=1,Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.SpeechSynthesisResult=void 0;const t=Ve();let e=class extends t.SynthesisResult{constructor(r,i,n,o,s,a){super(r,i,o,s),this.privAudioData=n,this.privAudioDuration=a}get audioData(){return this.privAudioData}get audioDuration(){return this.privAudioDuration}};return Qd.SpeechSynthesisResult=e,Qd}var AI={};Object.defineProperty(AI,"__esModule",{value:!0}),AI.SpeechSynthesisEventArgs=void 0;class A${constructor(e){this.privResult=e}get result(){return this.privResult}}AI.SpeechSynthesisEventArgs=A$;var rI={};Object.defineProperty(rI,"__esModule",{value:!0}),rI.SpeechSynthesisWordBoundaryEventArgs=void 0;class r${constructor(e,A,r,i,n,o){this.privAudioOffset=e,this.privDuration=A,this.privText=r,this.privWordLength=i,this.privTextOffset=n,this.privBoundaryType=o}get audioOffset(){return this.privAudioOffset}get duration(){return this.privDuration}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}get boundaryType(){return this.privBoundaryType}}rI.SpeechSynthesisWordBoundaryEventArgs=r$;var iI={};Object.defineProperty(iI,"__esModule",{value:!0}),iI.SpeechSynthesisBookmarkEventArgs=void 0;class i${constructor(e,A){this.privAudioOffset=e,this.privText=A}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}iI.SpeechSynthesisBookmarkEventArgs=i$;var nI={};Object.defineProperty(nI,"__esModule",{value:!0}),nI.SpeechSynthesisVisemeEventArgs=void 0;class n${constructor(e,A,r){this.privAudioOffset=e,this.privVisemeId=A,this.privAnimation=r}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}nI.SpeechSynthesisVisemeEventArgs=n$;var HU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisBoundaryType=void 0,function(e){e.Word="WordBoundary",e.Punctuation="PunctuationBoundary",e.Sentence="SentenceBoundary"}(t.SpeechSynthesisBoundaryType||(t.SpeechSynthesisBoundaryType={}))})(HU);var Rd={},zU;function s$(){if(zU)return Rd;zU=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.SynthesisVoicesResult=void 0;const t=Ve();let e=class extends t.SynthesisResult{constructor(r,i,n){if(Array.isArray(i)){super(r,t.ResultReason.VoicesListRetrieved,void 0,new t.PropertyCollection),this.privVoices=[];for(const o of i)this.privVoices.push(new t.VoiceInfo(o))}else super(r,t.ResultReason.Canceled,n||"Error information unavailable",new t.PropertyCollection)}get voices(){return this.privVoices}};return Rd.SynthesisVoicesResult=e,Rd}var JU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInfo=t.SynthesisVoiceType=t.SynthesisVoiceGender=void 0;var e;(function(o){o[o.Unknown=0]="Unknown",o[o.Female=1]="Female",o[o.Male=2]="Male",o[o.Neutral=3]="Neutral"})(e=t.SynthesisVoiceGender||(t.SynthesisVoiceGender={}));var A;(function(o){o[o.Unknown=0]="Unknown",o[o.OnlineNeural=1]="OnlineNeural",o[o.OnlineStandard=2]="OnlineStandard",o[o.OfflineNeural=3]="OfflineNeural",o[o.OfflineStandard=4]="OfflineStandard",o[o.OnlineNeuralHD=5]="OnlineNeuralHD"})(A=t.SynthesisVoiceType||(t.SynthesisVoiceType={}));const r={[e[e.Neutral]]:e.Neutral,[e[e.Male]]:e.Male,[e[e.Female]]:e.Female},i={Neural:A.OnlineNeural,NeuralHD:A.OnlineNeuralHD};class n{constructor(s){if(this.privStyleList=[],s){if(this.privName=s.Name,this.privLocale=s.Locale,this.privShortName=s.ShortName,this.privLocaleName=s.LocaleName,this.privDisplayName=s.DisplayName,this.privLocalName=s.LocalName,this.privVoiceType=i[s.VoiceType]||A.Unknown,this.privGender=r[s.Gender]||e.Unknown,s.StyleList&&Array.isArray(s.StyleList))for(const a of s.StyleList)this.privStyleList.push(a);this.privSampleRateHertz=s.SampleRateHertz,this.privStatus=s.Status,s.ExtendedPropertyMap&&(this.privExtendedPropertyMap=s.ExtendedPropertyMap),this.privWordsPerMinute=s.WordsPerMinute,Array.isArray(s.SecondaryLocaleList)&&(this.privSecondaryLocaleList=[...s.SecondaryLocaleList]),Array.isArray(s.RolePlayList)&&(this.privRolePlayList=[...s.RolePlayList]),s.VoiceTag&&(this.privVoiceTag=s.VoiceTag)}}get name(){return this.privName}get locale(){return this.privLocale}get shortName(){return this.privShortName}get displayName(){return this.privDisplayName}get localName(){return this.privLocalName}get localeName(){return this.privLocaleName}get gender(){return this.privGender}get voiceType(){return this.privVoiceType}get styleList(){return this.privStyleList}get sampleRateHertz(){return this.privSampleRateHertz}get status(){return this.privStatus}get extendedPropertyMap(){return this.privExtendedPropertyMap}get wordsPerMinute(){return this.privWordsPerMinute}get secondaryLocaleList(){return this.privSecondaryLocaleList}get rolePlayList(){return this.privRolePlayList}get voiceTag(){return this.privVoiceTag}}t.VoiceInfo=n})(JU);var sI={};Object.defineProperty(sI,"__esModule",{value:!0}),sI.SpeakerAudioDestination=void 0;const qc=Mt(),o$=li,an=ya,a$=60*30,qU={[an.AudioFormatTag.PCM]:"audio/wav",[an.AudioFormatTag.MuLaw]:"audio/x-wav",[an.AudioFormatTag.MP3]:"audio/mpeg",[an.AudioFormatTag.OGG_OPUS]:"audio/ogg",[an.AudioFormatTag.WEBM_OPUS]:"audio/webm; codecs=opus",[an.AudioFormatTag.ALaw]:"audio/x-wav",[an.AudioFormatTag.FLAC]:"audio/flac",[an.AudioFormatTag.AMR_WB]:"audio/amr-wb",[an.AudioFormatTag.G722]:"audio/G722"};class c${constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||(0,qc.createNoDashGuid)(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,A,r){this.privAudioBuffer!==void 0?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then(()=>{A&&A()},i=>{r&&r(i)})):this.privAudioOutputStream!==void 0&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,A){if(this.privIsClosed=!0,this.privSourceBuffer!==void 0)this.handleSourceBufferUpdateEnd().then(()=>{e&&e()},r=>{A&&A(r)});else if(this.privAudioOutputStream!==void 0&&typeof window<"u")if((this.privFormat.formatTag===an.AudioFormatTag.PCM||this.privFormat.formatTag===an.AudioFormatTag.MuLaw||this.privFormat.formatTag===an.AudioFormatTag.ALaw)&&this.privFormat.hasHeader===!1)console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else{let r=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(r).then(()=>{r=this.privFormat.addHeader(r);const i=new Blob([r],{type:qU[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(i),this.notifyPlayback().then(()=>{e&&e()},n=>{A&&A(n)})},i=>{A&&A(i)})}else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if(typeof AudioContext<"u"||typeof window<"u"&&typeof window.webkitAudioContext<"u"){this.privFormat=e;const A=qU[this.privFormat.formatTag];A===void 0?console.warn(`Unknown mimeType for format ${an.AudioFormatTag[this.privFormat.formatTag]}; playback is not supported.`):typeof MediaSource<"u"&&MediaSource.isTypeSupported(A)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=()=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=a$,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(A),this.privSourceBuffer.onupdate=()=>{this.updateSourceBuffer().catch(r=>{qc.Events.instance.onEvent(new qc.BackgroundEvent(r))})},this.privSourceBuffer.onupdateend=()=>{this.handleSourceBufferUpdateEnd().catch(r=>{qc.Events.instance.onEvent(new qc.BackgroundEvent(r))})},this.privSourceBuffer.onupdatestart=()=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch(r=>{qc.Events.instance.onEvent(new qc.BackgroundEvent(r))})):(console.warn(`Format ${an.AudioFormatTag[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new o$.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){var e;return((e=this.privAudio)==null?void 0:e.volume)??-1}set volume(e){this.privAudio&&(this.privAudio.volume=e)}mute(){this.privAudio&&(this.privAudio.muted=!0)}unmute(){this.privAudio&&(this.privAudio.muted=!1)}get isClosed(){return this.privIsClosed}get currentTime(){return this.privAudio!==void 0?this.privAudio.currentTime:-1}pause(){!this.privIsPaused&&this.privAudio!==void 0&&(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,A){this.privIsPaused&&this.privAudio!==void 0&&(this.privAudio.play().then(()=>{e&&e()},r=>{A&&A(r)}),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}async updateSourceBuffer(){if(this.privAudioBuffer!==void 0&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch{this.privAudioBuffer.unshift(e),console.log("buffer filled, pausing addition of binaries until space is made");return}await this.notifyPlayback()}else this.canEndStream()&&await this.handleSourceBufferUpdateEnd()}async handleSourceBufferUpdateEnd(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),await this.notifyPlayback())}async notifyPlayback(){!this.privPlaybackStarted&&this.privAudio!==void 0&&(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||await this.privAudio.play())}canEndStream(){return this.isClosed&&this.privSourceBuffer!==void 0&&this.privAudioBuffer.length===0&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&this.privMediaSource.readyState==="open"}sourceBufferAvailable(){return this.privSourceBuffer!==void 0&&!this.privSourceBuffer.updating}}sI.SpeakerAudioDestination=c$;var Dd={},VU;function u$(){if(VU)return Dd;VU=1,Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.ConversationTranscriptionCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Dd.ConversationTranscriptionCanceledEventArgs=e,Dd}var Td={},WU;function l$(){if(WU)return Td;WU=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.MeetingTranscriptionCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Td.MeetingTranscriptionCanceledEventArgs=e,Td}var ZU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGradingSystem=void 0,function(e){e[e.FivePoint=1]="FivePoint",e[e.HundredMark=2]="HundredMark"}(t.PronunciationAssessmentGradingSystem||(t.PronunciationAssessmentGradingSystem={}))})(ZU);var XU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGranularity=void 0,function(e){e[e.Phoneme=1]="Phoneme",e[e.Word=2]="Word",e[e.FullText=3]="FullText"}(t.PronunciationAssessmentGranularity||(t.PronunciationAssessmentGranularity={}))})(XU);var Ud={},_U;function h$(){if(_U)return Ud;_U=1,Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.PronunciationAssessmentConfig=void 0;const t=Ut,e=Ve();let A=class aj{constructor(i,n=e.PronunciationAssessmentGradingSystem.FivePoint,o=e.PronunciationAssessmentGranularity.Phoneme,s=!1){t.Contracts.throwIfNullOrUndefined(i,"referenceText"),this.privProperties=new e.PropertyCollection,this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_ReferenceText,i),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_GradingSystem,e.PronunciationAssessmentGradingSystem[n]),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_Granularity,e.PronunciationAssessmentGranularity[o]),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_EnableMiscue,String(s))}static fromJSON(i){t.Contracts.throwIfNullOrUndefined(i,"json");const n=new aj("");return n.privProperties=new e.PropertyCollection,n.properties.setProperty(e.PropertyId.PronunciationAssessment_Json,i),n}toJSON(){return this.updateJson(),this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_Params)}applyTo(i){this.updateJson();const n=i.internalData;n.expectContentAssessmentResponse=!!this.privContentAssessmentTopic,n.speechContext.setPronunciationAssessmentParams(this.properties.getProperty(e.PropertyId.PronunciationAssessment_Params),this.privContentAssessmentTopic,n.isSpeakerDiarizationEnabled)}get referenceText(){return this.properties.getProperty(e.PropertyId.PronunciationAssessment_ReferenceText)}set referenceText(i){t.Contracts.throwIfNullOrWhitespace(i,"referenceText"),this.properties.setProperty(e.PropertyId.PronunciationAssessment_ReferenceText,i)}set phonemeAlphabet(i){t.Contracts.throwIfNullOrWhitespace(i,"phonemeAlphabet"),this.privPhonemeAlphabet=i}set enableMiscue(i){const n=i?"true":"false";this.properties.setProperty(e.PropertyId.PronunciationAssessment_EnableMiscue,n)}get enableMiscue(){return this.properties.getProperty(e.PropertyId.PronunciationAssessment_EnableMiscue,"false").toLowerCase()==="true"}set nbestPhonemeCount(i){this.privNBestPhonemeCount=i}set enableProsodyAssessment(i){this.privEnableProsodyAssessment=i}enableContentAssessmentWithTopic(i){this.privContentAssessmentTopic=i}get properties(){return this.privProperties}updateJson(){const i=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_Json,"{}"),n=JSON.parse(i),o=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_ReferenceText);o&&(n.referenceText=o);const s=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_GradingSystem);s&&(n.gradingSystem=s);const a=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_Granularity);a&&(n.granularity=a),this.privPhonemeAlphabet&&(n.phonemeAlphabet=this.privPhonemeAlphabet),this.privNBestPhonemeCount&&(n.nbestPhonemeCount=this.privNBestPhonemeCount),n.enableProsodyAssessment=this.privEnableProsodyAssessment,n.dimension="Comprehensive",this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_EnableMiscue)&&(n.enableMiscue=this.enableMiscue),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_Params,JSON.stringify(n))}};return Ud.PronunciationAssessmentConfig=A,Ud}var Vc={},$U;function g$(){if($U)return Vc;$U=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.PronunciationAssessmentResult=Vc.ContentAssessmentResult=void 0;const t=Ut,e=Ve();class A{constructor(n){this.privPronJson=n}get grammarScore(){return this.privPronJson.ContentAssessment.GrammarScore}get vocabularyScore(){return this.privPronJson.ContentAssessment.VocabularyScore}get topicScore(){return this.privPronJson.ContentAssessment.TopicScore}}Vc.ContentAssessmentResult=A;let r=class cj{constructor(n){const o=JSON.parse(n);t.Contracts.throwIfNullOrUndefined(o.NBest[0],"NBest"),this.privPronJson=o.NBest[0]}static fromResult(n){t.Contracts.throwIfNullOrUndefined(n,"result");const o=n.properties.getProperty(e.PropertyId.SpeechServiceResponse_JsonResult);return t.Contracts.throwIfNullOrUndefined(o,"json"),new cj(o)}get detailResult(){return this.privPronJson}get accuracyScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.AccuracyScore}get pronunciationScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.PronScore}get completenessScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.CompletenessScore}get fluencyScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.FluencyScore}get prosodyScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.ProsodyScore}get contentAssessmentResult(){if(this.detailResult.ContentAssessment!==void 0)return new A(this.detailResult)}};return Vc.PronunciationAssessmentResult=r,Vc}var Ld={},eL;function d$(){if(eL)return Ld;eL=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.AvatarConfig=void 0;const t=Ut,e=Ve();let A=class{constructor(i,n,o){this.privCustomized=!1,this.privUseBuiltInVoice=!1,t.Contracts.throwIfNullOrWhitespace(i,"character"),this.character=i,this.style=n,o===void 0&&(o=new e.AvatarVideoFormat),this.videoFormat=o}get customized(){return this.privCustomized}set customized(i){this.privCustomized=i}get useBuiltInVoice(){return this.privUseBuiltInVoice}set useBuiltInVoice(i){this.privUseBuiltInVoice=i}get backgroundColor(){return this.privBackgroundColor}set backgroundColor(i){this.privBackgroundColor=i}get backgroundImage(){return this.privBackgroundImage}set backgroundImage(i){this.privBackgroundImage=i}get remoteIceServers(){return this.privRemoteIceServers}set remoteIceServers(i){this.privRemoteIceServers=i}};return Ld.AvatarConfig=A,Ld}var tL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarEventArgs=t.AvatarEventTypes=void 0,function(A){A.SwitchedToSpeaking="SwitchedToSpeaking",A.SwitchedToIdle="SwitchedToIdle",A.SessionClosed="SessionClosed"}(t.AvatarEventTypes||(t.AvatarEventTypes={}));class e{constructor(r,i){this.privOffset=r,this.privDescription=i}get type(){return this.privType}get offset(){return this.privOffset}get description(){return this.privDescription}}t.AvatarEventArgs=e})(tL);var Fd={},Od={},AL;function rL(){if(AL)return Od;AL=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.SpeechSynthesisConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr,n=ds;let o=class{constructor(){this.synthesisUri="/tts/cognitiveservices/websocket/v1"}async create(a,c,u){let l=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint,void 0);const g=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region,void 0),h=A.ConnectionFactoryBase.getHostSuffix(g),p=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_EndpointId,void 0),C=p===void 0?"tts":"voice",I=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,"wss://"+g+"."+C+".speech"+h),E={},v={};if(c.token!==void 0&&c.token!==""&&(v[c.headerName]=c.token),v[i.HeaderNames.ConnectionId]=u,p!==void 0&&p!==""&&(!l||l.search(n.QueryParameterNames.CustomVoiceDeploymentId)===-1)&&(E[n.QueryParameterNames.CustomVoiceDeploymentId]=p),a.avatarEnabled&&(!l||l.search(n.QueryParameterNames.EnableAvatar)===-1)&&(E[n.QueryParameterNames.EnableAvatar]="true"),l){const M=new URL(l),O=M.pathname;(O===""||O==="/")&&(M.pathname=this.synthesisUri,l=await A.ConnectionFactoryBase.getRedirectUrlFromEndpoint(M.toString()))}l||(l=I+this.synthesisUri),a.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,l);const m=a.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return new t.WebsocketConnection(l,E,v,new r.WebsocketMessageFormatter,t.ProxyInfo.fromParameters(a.parameters),m,u)}};return Od.SpeechSynthesisConnectionFactory=o,Od}var iL;function p$(){if(iL)return Fd;iL=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.AvatarSynthesizer=void 0;const t=rL(),e=ut(),A=Mt(),r=Qa,i=Ve(),n=Ut,o=L0();let s=class extends i.Synthesizer{constructor(c,u){super(c),n.Contracts.throwIfNullOrUndefined(u,"avatarConfig"),this.privConnectionFactory=new t.SpeechSynthesisConnectionFactory,this.privAvatarConfig=u,this.implCommonSynthesizeSetup()}implCommonSynthesizeSetup(){super.implCommonSynthesizeSetup(),this.privAdapter.audioOutputFormat=r.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(i.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm)}async startAvatarAsync(c){n.Contracts.throwIfNullOrUndefined(c,"peerConnection"),this.privIceServers=c.getConfiguration().iceServers,n.Contracts.throwIfNullOrUndefined(this.privIceServers,"Ice servers must be set.");const u=new A.Deferred;c.onicegatheringstatechange=()=>{A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice gathering state: "+c.iceGatheringState,A.EventType.Debug)),c.iceGatheringState==="complete"&&(A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice gathering complete.",A.EventType.Info)),u.resolve())},c.onicecandidate=C=>{C.candidate?A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice candidate: "+C.candidate.candidate,A.EventType.Debug)):(A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice candidate: complete",A.EventType.Debug)),u.resolve())},setTimeout(()=>{c.iceGatheringState!=="complete"&&(A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice gathering timeout.",A.EventType.Warning)),u.resolve())},2e3);const l=await c.createOffer();await c.setLocalDescription(l),await u.promise,A.Events.instance.onEvent(new A.PlatformEvent("peer connection: got local SDP.",A.EventType.Info)),this.privProperties.setProperty(i.PropertyId.TalkingAvatarService_WebRTC_SDP,JSON.stringify(c.localDescription));const g=await this.speak("",!1);if(g.reason!==i.ResultReason.SynthesizingAudioCompleted)return new i.SynthesisResult(g.resultId,g.reason,g.errorDetails,g.properties);const h=atob(g.properties.getProperty(i.PropertyId.TalkingAvatarService_WebRTC_SDP)),p=new RTCSessionDescription(JSON.parse(h));return await c.setRemoteDescription(p),new i.SynthesisResult(g.resultId,g.reason,void 0,g.properties)}async speakTextAsync(c){const u=await this.speak(c,!1);return new i.SynthesisResult(u.resultId,u.reason,u.errorDetails,u.properties)}async speakSsmlAsync(c){const u=await this.speak(c,!0);return new i.SynthesisResult(u.resultId,u.reason,u.errorDetails,u.properties)}async stopSpeakingAsync(){for(;this.synthesisRequestQueue.length()>0;)(await this.synthesisRequestQueue.dequeue()).err("Synthesis is canceled by user.");return this.privAdapter.stopSpeaking()}async stopAvatarAsync(){return n.Contracts.throwIfDisposed(this.privDisposed),this.dispose(!0)}async close(){if(!this.privDisposed)return this.dispose(!0)}get iceServers(){return this.privIceServers}createSynthesisAdapter(c,u,l){return new e.AvatarSynthesisAdapter(c,u,l,this,this.privAvatarConfig)}createRestSynthesisAdapter(c,u){}createSynthesizerConfig(c){const u=super.createSynthesizerConfig(c);return u.avatarEnabled=!0,u}async speak(c,u){const l=(0,A.createNoDashGuid)(),g=new A.Deferred;return this.synthesisRequestQueue.enqueue(new o.SynthesisRequest(l,c,u,h=>{g.resolve(h),this.privSynthesizing=!1,this.adapterSpeak()},h=>{g.reject(h),this.privSynthesizing=!1})),this.adapterSpeak(),g.promise}};return Fd.AvatarSynthesizer=s,Fd}var Rl={};Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.AvatarVideoFormat=Rl.Coordinate=void 0;class f${constructor(e,A){this.x=e,this.y=A}}Rl.Coordinate=f$;class E${constructor(e="H264",A=2e6,r=1920,i=1080){this.codec=e,this.bitrate=A,this.width=r,this.height=i}setCropRange(e,A){this.cropRange={bottomRight:A,topLeft:e}}}Rl.AvatarVideoFormat=E$;var bd={},nL;function C$(){if(nL)return bd;nL=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.AvatarWebRTCConnectionResult=void 0;const t=Ve();let e=class extends t.SynthesisResult{constructor(r,i,n,o,s){super(i,n,o,s),this.privSDPAnswer=r}get SDPAnswer(){return this.privSDPAnswer}};return bd.AvatarWebRTCConnectionResult=e,bd}var xd={},sL;function I$(){if(sL)return xd;sL=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Diagnostics=void 0;const t=Zr(),e=Mt();let A=class{static SetLoggingLevel(i){this.privListener=new t.ConsoleLoggingListener(i),e.Events.instance.attachConsoleListener(this.privListener)}static StartConsoleOutput(){this.privListener&&(this.privListener.enableConsoleOutput=!0)}static StopConsoleOutput(){this.privListener&&(this.privListener.enableConsoleOutput=!1)}static SetLogOutputPath(i){if(typeof window>"u")this.privListener&&(this.privListener.logPath=i);else throw new Error("File system logging not available in browser.")}static set onLogOutput(i){this.privListener&&(this.privListener.logCallback=i)}};return xd.Diagnostics=A,A.privListener=void 0,xd}var oL;function Ve(){return oL||(oL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionEventArgs=t.CancellationErrorCode=t.CancellationDetails=t.CancellationDetailsBase=t.IntentRecognitionCanceledEventArgs=t.TranslationRecognitionCanceledEventArgs=t.NoMatchDetails=t.NoMatchReason=t.Translations=t.TranslationRecognizer=t.VoiceProfileType=t.IntentRecognizer=t.SpeechRecognizer=t.Recognizer=t.PropertyId=t.PropertyCollection=t.SpeechTranslationConfigImpl=t.SpeechTranslationConfig=t.SpeechConfigImpl=t.SpeechConfig=t.ResultReason=t.TranslationSynthesisResult=t.TranslationRecognitionResult=t.TranslationSynthesisEventArgs=t.TranslationRecognitionEventArgs=t.SpeechRecognitionCanceledEventArgs=t.MeetingTranscriptionEventArgs=t.ConversationTranscriptionEventArgs=t.SpeechRecognitionEventArgs=t.LanguageUnderstandingModel=t.IntentRecognitionResult=t.SpeechRecognitionResult=t.RecognitionResult=t.IntentRecognitionEventArgs=t.OutputFormat=t.RecognitionEventArgs=t.SessionEventArgs=t.KeywordRecognitionModel=t.PushAudioOutputStreamCallback=t.PullAudioInputStreamCallback=t.CancellationReason=t.PushAudioOutputStream=t.PullAudioOutputStream=t.AudioOutputStream=t.PushAudioInputStream=t.PullAudioInputStream=t.AudioInputStream=t.AudioFormatTag=t.AudioStreamFormat=t.AudioConfig=void 0,t.SpeechSynthesisEventArgs=t.SpeechSynthesisResult=t.SynthesisResult=t.SpeechSynthesizer=t.SpeechSynthesisOutputFormat=t.Synthesizer=t.User=t.ParticipantChangedReason=t.Participant=t.MeetingTranscriber=t.Meeting=t.ConversationTranscriptionResult=t.ConversationTranscriber=t.ConversationTranslator=t.ConversationTranslationResult=t.ConversationTranslationEventArgs=t.ConversationTranslationCanceledEventArgs=t.ConversationParticipantsChangedEventArgs=t.ConversationExpirationEventArgs=t.Conversation=t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResultType=t.SpeakerRecognitionResult=t.SourceLanguageConfig=t.AutoDetectSourceLanguageResult=t.AutoDetectSourceLanguageConfig=t.SpeakerVerificationModel=t.SpeakerIdentificationModel=t.SpeakerRecognizer=t.VoiceProfileClient=t.VoiceProfilePhraseResult=t.VoiceProfileCancellationDetails=t.VoiceProfileResult=t.VoiceProfileEnrollmentCancellationDetails=t.VoiceProfileEnrollmentResult=t.VoiceProfile=t.ConnectionMessage=t.ConnectionMessageEventArgs=t.BaseAudioPlayer=t.ProfanityOption=t.ServicePropertyChannel=t.TurnStatusReceivedEventArgs=t.ActivityReceivedEventArgs=t.DialogServiceConnector=t.CustomCommandsConfig=t.BotFrameworkConfig=t.DialogServiceConfig=t.PhraseListGrammar=t.Connection=t.ServiceEventArgs=void 0,t.LogLevel=t.Diagnostics=t.AvatarWebRTCConnectionResult=t.Coordinate=t.AvatarVideoFormat=t.AvatarSynthesizer=t.AvatarEventArgs=t.AvatarConfig=t.LanguageIdMode=t.PronunciationAssessmentResult=t.PronunciationAssessmentConfig=t.PronunciationAssessmentGranularity=t.PronunciationAssessmentGradingSystem=t.MeetingTranscriptionCanceledEventArgs=t.ConversationTranscriptionCanceledEventArgs=t.SpeakerAudioDestination=t.VoiceInfo=t.SynthesisVoiceType=t.SynthesisVoiceGender=t.SynthesisVoicesResult=t.SpeechSynthesisBoundaryType=t.SpeechSynthesisVisemeEventArgs=t.SpeechSynthesisBookmarkEventArgs=t.SpeechSynthesisWordBoundaryEventArgs=void 0;var e=v2();Object.defineProperty(t,"AudioConfig",{enumerable:!0,get:function(){return e.AudioConfig}});var A=ya;Object.defineProperty(t,"AudioStreamFormat",{enumerable:!0,get:function(){return A.AudioStreamFormat}}),Object.defineProperty(t,"AudioFormatTag",{enumerable:!0,get:function(){return A.AudioFormatTag}});var r=f2();Object.defineProperty(t,"AudioInputStream",{enumerable:!0,get:function(){return r.AudioInputStream}}),Object.defineProperty(t,"PullAudioInputStream",{enumerable:!0,get:function(){return r.PullAudioInputStream}}),Object.defineProperty(t,"PushAudioInputStream",{enumerable:!0,get:function(){return r.PushAudioInputStream}});var i=li;Object.defineProperty(t,"AudioOutputStream",{enumerable:!0,get:function(){return i.AudioOutputStream}}),Object.defineProperty(t,"PullAudioOutputStream",{enumerable:!0,get:function(){return i.PullAudioOutputStream}}),Object.defineProperty(t,"PushAudioOutputStream",{enumerable:!0,get:function(){return i.PushAudioOutputStream}});var n=w2;Object.defineProperty(t,"CancellationReason",{enumerable:!0,get:function(){return n.CancellationReason}});var o=xC;Object.defineProperty(t,"PullAudioInputStreamCallback",{enumerable:!0,get:function(){return o.PullAudioInputStreamCallback}});var s=NC;Object.defineProperty(t,"PushAudioOutputStreamCallback",{enumerable:!0,get:function(){return s.PushAudioOutputStreamCallback}});var a=KC;Object.defineProperty(t,"KeywordRecognitionModel",{enumerable:!0,get:function(){return a.KeywordRecognitionModel}});var c=kC;Object.defineProperty(t,"SessionEventArgs",{enumerable:!0,get:function(){return c.SessionEventArgs}});var u=VX();Object.defineProperty(t,"RecognitionEventArgs",{enumerable:!0,get:function(){return u.RecognitionEventArgs}});var l=M2;Object.defineProperty(t,"OutputFormat",{enumerable:!0,get:function(){return l.OutputFormat}});var g=WX();Object.defineProperty(t,"IntentRecognitionEventArgs",{enumerable:!0,get:function(){return g.IntentRecognitionEventArgs}});var h=PC;Object.defineProperty(t,"RecognitionResult",{enumerable:!0,get:function(){return h.RecognitionResult}});var p=XX();Object.defineProperty(t,"SpeechRecognitionResult",{enumerable:!0,get:function(){return p.SpeechRecognitionResult}});var C=_X();Object.defineProperty(t,"IntentRecognitionResult",{enumerable:!0,get:function(){return C.IntentRecognitionResult}});var I=yl;Object.defineProperty(t,"LanguageUnderstandingModel",{enumerable:!0,get:function(){return I.LanguageUnderstandingModel}});var E=$X();Object.defineProperty(t,"SpeechRecognitionEventArgs",{enumerable:!0,get:function(){return E.SpeechRecognitionEventArgs}}),Object.defineProperty(t,"ConversationTranscriptionEventArgs",{enumerable:!0,get:function(){return E.ConversationTranscriptionEventArgs}}),Object.defineProperty(t,"MeetingTranscriptionEventArgs",{enumerable:!0,get:function(){return E.MeetingTranscriptionEventArgs}});var v=e_();Object.defineProperty(t,"SpeechRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return v.SpeechRecognitionCanceledEventArgs}});var m=t_();Object.defineProperty(t,"TranslationRecognitionEventArgs",{enumerable:!0,get:function(){return m.TranslationRecognitionEventArgs}});var M=A_();Object.defineProperty(t,"TranslationSynthesisEventArgs",{enumerable:!0,get:function(){return M.TranslationSynthesisEventArgs}});var O=x2();Object.defineProperty(t,"TranslationRecognitionResult",{enumerable:!0,get:function(){return O.TranslationRecognitionResult}});var x=jC;Object.defineProperty(t,"TranslationSynthesisResult",{enumerable:!0,get:function(){return x.TranslationSynthesisResult}});var P=N2;Object.defineProperty(t,"ResultReason",{enumerable:!0,get:function(){return P.ResultReason}});var D=i_();Object.defineProperty(t,"SpeechConfig",{enumerable:!0,get:function(){return D.SpeechConfig}}),Object.defineProperty(t,"SpeechConfigImpl",{enumerable:!0,get:function(){return D.SpeechConfigImpl}});var T=n_();Object.defineProperty(t,"SpeechTranslationConfig",{enumerable:!0,get:function(){return T.SpeechTranslationConfig}}),Object.defineProperty(t,"SpeechTranslationConfigImpl",{enumerable:!0,get:function(){return T.SpeechTranslationConfigImpl}});var q=G2();Object.defineProperty(t,"PropertyCollection",{enumerable:!0,get:function(){return q.PropertyCollection}});var Q=YC;Object.defineProperty(t,"PropertyId",{enumerable:!0,get:function(){return Q.PropertyId}});var R=s_();Object.defineProperty(t,"Recognizer",{enumerable:!0,get:function(){return R.Recognizer}});var G=o_();Object.defineProperty(t,"SpeechRecognizer",{enumerable:!0,get:function(){return G.SpeechRecognizer}});var k=a_();Object.defineProperty(t,"IntentRecognizer",{enumerable:!0,get:function(){return k.IntentRecognizer}});var te=z2;Object.defineProperty(t,"VoiceProfileType",{enumerable:!0,get:function(){return te.VoiceProfileType}});var X=c_();Object.defineProperty(t,"TranslationRecognizer",{enumerable:!0,get:function(){return X.TranslationRecognizer}});var ie=u_();Object.defineProperty(t,"Translations",{enumerable:!0,get:function(){return ie.Translations}});var W=_2;Object.defineProperty(t,"NoMatchReason",{enumerable:!0,get:function(){return W.NoMatchReason}});var se=l_();Object.defineProperty(t,"NoMatchDetails",{enumerable:!0,get:function(){return se.NoMatchDetails}});var Be=HC;Object.defineProperty(t,"TranslationRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return Be.TranslationRecognitionCanceledEventArgs}});var Ee=g_();Object.defineProperty(t,"IntentRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return Ee.IntentRecognitionCanceledEventArgs}});var U=$g;Object.defineProperty(t,"CancellationDetailsBase",{enumerable:!0,get:function(){return U.CancellationDetailsBase}});var Y=p_();Object.defineProperty(t,"CancellationDetails",{enumerable:!0,get:function(){return Y.CancellationDetails}});var _=AU;Object.defineProperty(t,"CancellationErrorCode",{enumerable:!0,get:function(){return _.CancellationErrorCode}});var re=f_();Object.defineProperty(t,"ConnectionEventArgs",{enumerable:!0,get:function(){return re.ConnectionEventArgs}});var ae=E_();Object.defineProperty(t,"ServiceEventArgs",{enumerable:!0,get:function(){return ae.ServiceEventArgs}});var Z=W2();Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return Z.Connection}});var ce=zC;Object.defineProperty(t,"PhraseListGrammar",{enumerable:!0,get:function(){return ce.PhraseListGrammar}});var oe=m0();Object.defineProperty(t,"DialogServiceConfig",{enumerable:!0,get:function(){return oe.DialogServiceConfig}});var de=C_();Object.defineProperty(t,"BotFrameworkConfig",{enumerable:!0,get:function(){return de.BotFrameworkConfig}});var De=I_();Object.defineProperty(t,"CustomCommandsConfig",{enumerable:!0,get:function(){return De.CustomCommandsConfig}});var j=v_();Object.defineProperty(t,"DialogServiceConnector",{enumerable:!0,get:function(){return j.DialogServiceConnector}});var J=JC;Object.defineProperty(t,"ActivityReceivedEventArgs",{enumerable:!0,get:function(){return J.ActivityReceivedEventArgs}});var z=qC;Object.defineProperty(t,"TurnStatusReceivedEventArgs",{enumerable:!0,get:function(){return z.TurnStatusReceivedEventArgs}});var b=lU;Object.defineProperty(t,"ServicePropertyChannel",{enumerable:!0,get:function(){return b.ServicePropertyChannel}});var Me=hU;Object.defineProperty(t,"ProfanityOption",{enumerable:!0,get:function(){return Me.ProfanityOption}});var Qe=M_();Object.defineProperty(t,"BaseAudioPlayer",{enumerable:!0,get:function(){return Qe.BaseAudioPlayer}});var Te=WC;Object.defineProperty(t,"ConnectionMessageEventArgs",{enumerable:!0,get:function(){return Te.ConnectionMessageEventArgs}});var Ce=q2();Object.defineProperty(t,"ConnectionMessage",{enumerable:!0,get:function(){return Ce.ConnectionMessage}});var Re=ZC;Object.defineProperty(t,"VoiceProfile",{enumerable:!0,get:function(){return Re.VoiceProfile}});var ve=R_();Object.defineProperty(t,"VoiceProfileEnrollmentResult",{enumerable:!0,get:function(){return ve.VoiceProfileEnrollmentResult}}),Object.defineProperty(t,"VoiceProfileEnrollmentCancellationDetails",{enumerable:!0,get:function(){return ve.VoiceProfileEnrollmentCancellationDetails}});var Ke=D_();Object.defineProperty(t,"VoiceProfileResult",{enumerable:!0,get:function(){return Ke.VoiceProfileResult}}),Object.defineProperty(t,"VoiceProfileCancellationDetails",{enumerable:!0,get:function(){return Ke.VoiceProfileCancellationDetails}});var Ue=T_();Object.defineProperty(t,"VoiceProfilePhraseResult",{enumerable:!0,get:function(){return Ue.VoiceProfilePhraseResult}});var ke=U_();Object.defineProperty(t,"VoiceProfileClient",{enumerable:!0,get:function(){return ke.VoiceProfileClient}});var Ye=L_();Object.defineProperty(t,"SpeakerRecognizer",{enumerable:!0,get:function(){return Ye.SpeakerRecognizer}});var Je=F_();Object.defineProperty(t,"SpeakerIdentificationModel",{enumerable:!0,get:function(){return Je.SpeakerIdentificationModel}});var rt=O_();Object.defineProperty(t,"SpeakerVerificationModel",{enumerable:!0,get:function(){return rt.SpeakerVerificationModel}});var Ze=b_();Object.defineProperty(t,"AutoDetectSourceLanguageConfig",{enumerable:!0,get:function(){return Ze.AutoDetectSourceLanguageConfig}});var We=XC;Object.defineProperty(t,"AutoDetectSourceLanguageResult",{enumerable:!0,get:function(){return We.AutoDetectSourceLanguageResult}});var At=$C;Object.defineProperty(t,"SourceLanguageConfig",{enumerable:!0,get:function(){return At.SourceLanguageConfig}});var _e=N_();Object.defineProperty(t,"SpeakerRecognitionResult",{enumerable:!0,get:function(){return _e.SpeakerRecognitionResult}}),Object.defineProperty(t,"SpeakerRecognitionResultType",{enumerable:!0,get:function(){return _e.SpeakerRecognitionResultType}}),Object.defineProperty(t,"SpeakerRecognitionCancellationDetails",{enumerable:!0,get:function(){return _e.SpeakerRecognitionCancellationDetails}});var It=U0();Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return It.Conversation}}),Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return It.ConversationExpirationEventArgs}}),Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return It.ConversationParticipantsChangedEventArgs}}),Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return It.ConversationTranslationCanceledEventArgs}}),Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return It.ConversationTranslationEventArgs}}),Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return It.ConversationTranslationResult}}),Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return It.ConversationTranslator}}),Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return It.ConversationTranscriber}}),Object.defineProperty(t,"ConversationTranscriptionResult",{enumerable:!0,get:function(){return It.ConversationTranscriptionResult}}),Object.defineProperty(t,"Meeting",{enumerable:!0,get:function(){return It.Meeting}}),Object.defineProperty(t,"MeetingTranscriber",{enumerable:!0,get:function(){return It.MeetingTranscriber}}),Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return It.Participant}}),Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return It.ParticipantChangedReason}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return It.User}});var yt=L0();Object.defineProperty(t,"Synthesizer",{enumerable:!0,get:function(){return yt.Synthesizer}});var tt=I0;Object.defineProperty(t,"SpeechSynthesisOutputFormat",{enumerable:!0,get:function(){return tt.SpeechSynthesisOutputFormat}});var et=$_();Object.defineProperty(t,"SpeechSynthesizer",{enumerable:!0,get:function(){return et.SpeechSynthesizer}});var St=tI;Object.defineProperty(t,"SynthesisResult",{enumerable:!0,get:function(){return St.SynthesisResult}});var ct=t$();Object.defineProperty(t,"SpeechSynthesisResult",{enumerable:!0,get:function(){return ct.SpeechSynthesisResult}});var Rt=AI;Object.defineProperty(t,"SpeechSynthesisEventArgs",{enumerable:!0,get:function(){return Rt.SpeechSynthesisEventArgs}});var Ge=rI;Object.defineProperty(t,"SpeechSynthesisWordBoundaryEventArgs",{enumerable:!0,get:function(){return Ge.SpeechSynthesisWordBoundaryEventArgs}});var Jt=iI;Object.defineProperty(t,"SpeechSynthesisBookmarkEventArgs",{enumerable:!0,get:function(){return Jt.SpeechSynthesisBookmarkEventArgs}});var oA=nI;Object.defineProperty(t,"SpeechSynthesisVisemeEventArgs",{enumerable:!0,get:function(){return oA.SpeechSynthesisVisemeEventArgs}});var Qt=HU;Object.defineProperty(t,"SpeechSynthesisBoundaryType",{enumerable:!0,get:function(){return Qt.SpeechSynthesisBoundaryType}});var Xe=s$();Object.defineProperty(t,"SynthesisVoicesResult",{enumerable:!0,get:function(){return Xe.SynthesisVoicesResult}});var AA=JU;Object.defineProperty(t,"SynthesisVoiceGender",{enumerable:!0,get:function(){return AA.SynthesisVoiceGender}}),Object.defineProperty(t,"SynthesisVoiceType",{enumerable:!0,get:function(){return AA.SynthesisVoiceType}}),Object.defineProperty(t,"VoiceInfo",{enumerable:!0,get:function(){return AA.VoiceInfo}});var dn=sI;Object.defineProperty(t,"SpeakerAudioDestination",{enumerable:!0,get:function(){return dn.SpeakerAudioDestination}});var $t=u$();Object.defineProperty(t,"ConversationTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return $t.ConversationTranscriptionCanceledEventArgs}});var Tr=l$();Object.defineProperty(t,"MeetingTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return Tr.MeetingTranscriptionCanceledEventArgs}});var Ni=ZU;Object.defineProperty(t,"PronunciationAssessmentGradingSystem",{enumerable:!0,get:function(){return Ni.PronunciationAssessmentGradingSystem}});var Bt=XU;Object.defineProperty(t,"PronunciationAssessmentGranularity",{enumerable:!0,get:function(){return Bt.PronunciationAssessmentGranularity}});var Ur=h$();Object.defineProperty(t,"PronunciationAssessmentConfig",{enumerable:!0,get:function(){return Ur.PronunciationAssessmentConfig}});var Ei=g$();Object.defineProperty(t,"PronunciationAssessmentResult",{enumerable:!0,get:function(){return Ei.PronunciationAssessmentResult}});var ti=y0;Object.defineProperty(t,"LanguageIdMode",{enumerable:!0,get:function(){return ti.LanguageIdMode}});var Ai=d$();Object.defineProperty(t,"AvatarConfig",{enumerable:!0,get:function(){return Ai.AvatarConfig}});var iA=tL;Object.defineProperty(t,"AvatarEventArgs",{enumerable:!0,get:function(){return iA.AvatarEventArgs}});var yA=p$();Object.defineProperty(t,"AvatarSynthesizer",{enumerable:!0,get:function(){return yA.AvatarSynthesizer}});var HA=Rl;Object.defineProperty(t,"AvatarVideoFormat",{enumerable:!0,get:function(){return HA.AvatarVideoFormat}}),Object.defineProperty(t,"Coordinate",{enumerable:!0,get:function(){return HA.Coordinate}});var pn=C$();Object.defineProperty(t,"AvatarWebRTCConnectionResult",{enumerable:!0,get:function(){return pn.AvatarWebRTCConnectionResult}});var ri=I$();Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return ri.Diagnostics}});var ii=g0;Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return ii.LogLevel}})}(E0)),E0}var aL;function B$(){if(aL)return Ug;aL=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.ProxyInfo=void 0;const t=Ve();let e=class uj{constructor(r,i,n,o){this.privProxyHostName=r,this.privProxyPort=i,this.privProxyUserName=n,this.privProxyPassword=o}static fromParameters(r){return new uj(r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyHostName),parseInt(r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyPort),10),r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyUserName),r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(r){return this.fromParameters(r.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}};return Ug.ProxyInfo=e,Ug}var cL={};const v$=new Set(["json","buffer","string"]);var w$=t=>(...e)=>{const A=new Set;let r,i,n,o="";return e.forEach(s=>{if(typeof s=="string")if(s.toUpperCase()===s)if(r){const a=`Can't set method to ${s}, already set to ${r}.`;throw new Error(a)}else r=s;else if(s.startsWith("http:")||s.startsWith("https:"))o=s;else if(v$.has(s))i=s;else throw new Error(`Unknown encoding, ${s}`);else if(typeof s=="number")A.add(s);else if(typeof s=="object")if(Array.isArray(s)||s instanceof Set)s.forEach(a=>A.add(a));else{if(n)throw new Error("Cannot set headers twice.");n=s}else throw new Error(`Unknown type: ${typeof s}`)}),r||(r="GET"),A.size===0&&A.add(200),t(A,r,i,n,o)};const S$=w$;class F0 extends Error{constructor(e,...A){super(...A),Error.captureStackTrace&&Error.captureStackTrace(this,F0),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);let r;Object.defineProperty(this,"responseBody",{get:()=>(r||(r=this.arrayBuffer()),r)}),this.headers={};for(const[n,o]of e.headers.entries())this.headers[n.toLowerCase()]=o}}var m$=S$((t,e,A,r,i)=>async(n,o,s={})=>{n=i+(n||"");let a=new URL(n);if(r||(r={}),a.username&&(r.Authorization="Basic "+btoa(a.username+":"+a.password),a=new URL(a.protocol+"//"+a.host+a.pathname+a.search)),a.protocol!=="https:"&&a.protocol!=="http:")throw new Error(`Unknown protocol, ${a.protocol}`);if(o&&!(o instanceof ArrayBuffer||ArrayBuffer.isView(o)||typeof o=="string"))if(typeof o=="object")o=JSON.stringify(o),r["Content-Type"]="application/json";else throw new Error("Unknown body type.");s=new Headers({...r||{},...s});const c=await fetch(a,{method:e,headers:s,body:o});if(c.statusCode=c.status,!t.has(c.status))throw new F0(c);return A==="json"?c.json():A==="buffer"?c.arrayBuffer():A==="string"?c.text():c});(function(t){var e=xt&&xt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.RestMessageAdapter=t.RestRequestType=void 0;const A=e(m$),r=Mt();var i;(function(o){o.Get="GET",o.Post="POST",o.Delete="DELETE",o.File="file"})(i=t.RestRequestType||(t.RestRequestType={}));class n{constructor(s){if(!s)throw new r.ArgumentNullError("configParams");this.privHeaders=s.headers,this.privIgnoreCache=s.ignoreCache}static extractHeaderValue(s,a){let c="";try{const u=a.trim().split(/[\r\n]+/),l={};u.forEach(g=>{const h=g.split(": "),p=h.shift().toLowerCase(),C=h.join(": ");l[p]=C}),c=l[s.toLowerCase()]}catch{}return c}set options(s){this.privHeaders=s.headers,this.privIgnoreCache=s.ignoreCache}setHeaders(s,a){this.privHeaders[s]=a}request(s,a,c={},u=null){const l=new r.Deferred,g=s===i.File?"POST":s,h=(C,I={})=>{const E=C;return{data:JSON.stringify(I),headers:JSON.stringify(C.headers),json:I,ok:C.statusCode>=200&&C.statusCode<300,status:C.statusCode,statusText:I.error?I.error.message:E.statusText?E.statusText:E.statusMessage}},p=C=>{const I=(0,A.default)(a,g,this.privHeaders,200,201,202,204,400,401,402,403,404),E=this.queryParams(c)===""?"":`?${this.queryParams(c)}`;I(E,C).then(async v=>{if(s===i.Delete||v.statusCode===204)l.resolve(h(v));else try{const m=await v.json();l.resolve(h(v,m))}catch{l.resolve(h(v))}}).catch(v=>{l.reject(v)})};return this.privIgnoreCache&&(this.privHeaders["Cache-Control"]="no-cache"),s===i.Post&&u&&(this.privHeaders["content-type"]="application/json",this.privHeaders["Content-Type"]="application/json"),p(u),l.promise}queryParams(s={}){return Object.keys(s).map(a=>encodeURIComponent(a)+"="+encodeURIComponent(s[a])).join("&")}}t.RestMessageAdapter=n})(cL);var Nd={};Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.RestConfigBase=void 0;class Ra{static get requestOptions(){return Ra.privDefaultRequestOptions}static get configParams(){return Ra.privDefaultParams}static get restErrors(){return Ra.privRestErrors}}Nd.RestConfigBase=Ra,Ra.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},Ra.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},Ra.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"};var uL;function Zr(){return uL||(uL=1,function(t){var e=xt&&xt.__createBinding||(Object.create?function(r,i,n,o){o===void 0&&(o=n),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[n]}})}:function(r,i,n,o){o===void 0&&(o=n),r[o]=i[n]}),A=xt&&xt.__exportStar||function(r,i){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&e(i,r,n)};Object.defineProperty(t,"__esModule",{value:!0}),A(LC,t),A(l2,t),A(wX(),t),A(SX(),t),A(FC,t),A(OC,t),A(Dg,t),A(bC,t),A(B$(),t),A(cL,t),A(Nd,t)}(h0)),h0}var lL;function M$(){if(lL)return yg;lL=1,Object.defineProperty(yg,"__esModule",{value:!0}),yg.IntentConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr;let n=class extends A.ConnectionFactoryBase{create(s,a,c){let u=s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint);if(!u){const p=s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_IntentRegion),C=A.ConnectionFactoryBase.getHostSuffix(p);u=s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,"wss://"+p+".sr.speech"+C)+"/speech/recognition/interactive/cognitiveservices/v1"}const l={format:"simple",language:s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecoLanguage)};this.setCommonUrlParams(s,l,u);const g={};a.token!==void 0&&a.token!==""&&(g[a.headerName]=a.token),g[i.HeaderNames.ConnectionId]=c,s.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,u);const h=s.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(u,l,g,new r.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(s),h,c))}getSpeechRegionFromIntentRegion(s){switch(s){case"West US":case"US West":case"westus":return"uswest";case"West US 2":case"US West 2":case"westus2":return"uswest2";case"South Central US":case"US South Central":case"southcentralus":return"ussouthcentral";case"West Central US":case"US West Central":case"westcentralus":return"uswestcentral";case"East US":case"US East":case"eastus":return"useast";case"East US 2":case"US East 2":case"eastus2":return"useast2";case"West Europe":case"Europe West":case"westeurope":return"europewest";case"North Europe":case"Europe North":case"northeurope":return"europenorth";case"Brazil South":case"South Brazil":case"southbrazil":return"brazilsouth";case"Australia East":case"East Australia":case"eastaustralia":return"australiaeast";case"Southeast Asia":case"Asia Southeast":case"southeastasia":return"asiasoutheast";case"East Asia":case"Asia East":case"eastasia":return"asiaeast";default:return s}}};return yg.IntentConnectionFactory=n,yg}var Wc={},hL;function y$(){if(hL)return Wc;hL=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.VoiceProfileConnectionFactory=Wc.SpeakerRecognitionConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr;class n extends A.ConnectionFactoryBase{create(c,u,l,g){let h=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint);if(!h){const E=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region),v=A.ConnectionFactoryBase.getHostSuffix(E),m=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,`wss://${E}.spr-frontend.speech${v}`),M=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_SpeakerIdMode,"TextIndependentIdentification");h=`${m}/speaker/ws/${this.scenarioToPath(M)}/${l}`}const p={format:"simple",language:c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecoLanguage)};this.setCommonUrlParams(c,p,h);const C={};u.token!==void 0&&u.token!==""&&(C[u.headerName]=u.token),C[i.HeaderNames.ConnectionId]=g,C[i.HeaderNames.SpIDAuthKey]=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Key),c.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,h);const I=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(h,p,C,new r.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(c),I,g))}scenarioToPath(c){switch(c){case"TextIndependentVerification":case"2":return"verification/text-independent";case"TextDependentVerification":case"1":return"verification/text-dependent";default:return"identification/text-independent"}}}let o=class extends n{create(c,u,l){return super.create(c,u,"recognition",l)}};Wc.SpeakerRecognitionConnectionFactory=o;class s extends n{create(c,u,l){return super.create(c,u,"profile",l)}}return Wc.VoiceProfileConnectionFactory=s,Wc}var oI={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionEndedEvent=t.RecognitionCompletionStatus=t.RecognitionStartedEvent=t.ConnectingToServiceEvent=t.ListeningStartedEvent=t.RecognitionTriggeredEvent=t.SpeechRecognitionEvent=void 0;const e=Mt();class A extends e.PlatformEvent{constructor(u,l,g,h=e.EventType.Info){super(u,h),this.privRequestId=l,this.privSessionId=g}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}t.SpeechRecognitionEvent=A;class r extends A{constructor(u,l,g,h){super("RecognitionTriggeredEvent",u,l),this.privAudioSourceId=g,this.privAudioNodeId=h}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}t.RecognitionTriggeredEvent=r;class i extends A{constructor(u,l,g,h){super("ListeningStartedEvent",u,l),this.privAudioSourceId=g,this.privAudioNodeId=h}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}t.ListeningStartedEvent=i;class n extends A{constructor(u,l,g){super("ConnectingToServiceEvent",u,g),this.privAuthFetchEventid=l}get authFetchEventid(){return this.privAuthFetchEventid}}t.ConnectingToServiceEvent=n;class o extends A{constructor(u,l,g,h,p){super("RecognitionStartedEvent",u,p),this.privAudioSourceId=l,this.privAudioNodeId=g,this.privAuthFetchEventId=h}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}}t.RecognitionStartedEvent=o;var s;(function(c){c[c.Success=0]="Success",c[c.AudioSourceError=1]="AudioSourceError",c[c.AudioSourceTimeout=2]="AudioSourceTimeout",c[c.AuthTokenFetchError=3]="AuthTokenFetchError",c[c.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",c[c.UnAuthorized=5]="UnAuthorized",c[c.ConnectTimeout=6]="ConnectTimeout",c[c.ConnectError=7]="ConnectError",c[c.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",c[c.UnknownError=9]="UnknownError"})(s=t.RecognitionCompletionStatus||(t.RecognitionCompletionStatus={}));class a extends A{constructor(u,l,g,h,p,C,I,E){super("RecognitionEndedEvent",u,p,I===s.Success?e.EventType.Info:e.EventType.Error),this.privAudioSourceId=l,this.privAudioNodeId=g,this.privAuthFetchEventId=h,this.privStatus=I,this.privError=E,this.privServiceTag=C}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}get serviceTag(){return this.privServiceTag}get status(){return this.privStatus}get error(){return this.privError}}t.RecognitionEndedEvent=a})(oI);var Kd={},Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Co.SpeechConnectionMessage=void 0;const O0=Mt(),Io=Wr;class b0 extends O0.ConnectionMessage{constructor(e,A,r,i,n,o,s,a){if(!A)throw new O0.ArgumentNullError("path");if(!r)throw new O0.ArgumentNullError("requestId");const c={};if(c[Io.HeaderNames.Path]=A,c[Io.HeaderNames.RequestId]=r,c[Io.HeaderNames.RequestTimestamp]=new Date().toISOString(),i&&(c[Io.HeaderNames.ContentType]=i),o&&(c[Io.HeaderNames.RequestStreamId]=o),s)for(const u in s)u&&(c[u]=s[u]);a?super(e,n,c,a):super(e,n,c),this.privPath=A,this.privRequestId=r,this.privContentType=i,this.privStreamId=o,this.privAdditionalHeaders=s}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}static fromConnectionMessage(e){let A=null,r=null,i=null,n=null;const o={};if(e.headers)for(const s in e.headers)s&&(s.toLowerCase()===Io.HeaderNames.Path.toLowerCase()?A=e.headers[s]:s.toLowerCase()===Io.HeaderNames.RequestId.toLowerCase()?r=e.headers[s]:s.toLowerCase()===Io.HeaderNames.ContentType.toLowerCase()?i=e.headers[s]:s.toLowerCase()===Io.HeaderNames.RequestStreamId.toLowerCase()?n=e.headers[s]:o[s]=e.headers[s]);return new b0(e.messageType,A,r,i,e.body,n,o,e.id)}}Co.SpeechConnectionMessage=b0;var gL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentationMode=void 0,function(e){e.Normal="Normal",e.Disabled="Disabled",e.Custom="Custom",e.Semantic="Semantic"}(t.SegmentationMode||(t.SegmentationMode={}))})(gL);var dL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,function(e){e.None="None",e.Synthesize="Synthesize"}(t.NextAction||(t.NextAction={}))})(dL);var pL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Mode=void 0,function(e){e.None="None",e.Always="Always"}(t.Mode||(t.Mode={}))})(pL);var fL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageIdDetectionPriority=t.LanguageIdDetectionMode=void 0,function(e){e.DetectAtAudioStart="DetectAtAudioStart",e.DetectContinuous="DetectContinuous",e.DetectSegments="DetectSegments"}(t.LanguageIdDetectionMode||(t.LanguageIdDetectionMode={})),function(e){e.Auto="Auto",e.PrioritizeLatency="PrioritizeLatency",e.PrioritizeAccuracy="PrioritizeAccuracy"}(t.LanguageIdDetectionPriority||(t.LanguageIdDetectionPriority={}))})(fL);var EL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,function(e){e.Recognize="Recognize",e.None="None"}(t.NextAction||(t.NextAction={}))})(EL);var CL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.OnUnknownAction=void 0,function(e){e.RecognizeWithDefaultLanguage="RecognizeWithDefaultLanguage",e.None="None"}(t.OnUnknownAction||(t.OnUnknownAction={}))})(CL);var IL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ResultType=void 0,function(e){e.Auto="Auto",e.StableFragment="StableFragment",e.Hypothesis="Hypothesis",e.None="None"}(t.ResultType||(t.ResultType={}))})(IL);var BL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PhraseResultOutputType=void 0,function(e){e.Always="Always",e.None="None"}(t.PhraseResultOutputType||(t.PhraseResultOutputType={}))})(BL);var vL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,function(e){e.None="None",e.Translate="Translate"}(t.NextAction||(t.NextAction={}))})(vL);var wL;function Q$(){if(wL)return Kd;wL=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.ServiceRecognizerBase=void 0;const t=Zr(),e=Mt(),A=Ve(),r=ut(),i=Co,n=gL,o=vn,s=dL,a=pL,c=fL,u=EL,l=CL,g=IL,h=BL,p=vL;let C=class aE{constructor(E,v,m,M,O){if(this.privConnectionConfigurationPromise=void 0,this.privConnectionPromise=void 0,this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.privAverageBytesPerMs=0,this.privEnableSpeakerId=!1,this.privExpectContentAssessmentResponse=!1,this.recognizeOverride=void 0,this.recognizeSpeaker=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,this.handleSpeechPhraseMessage=void 0,this.handleSpeechHypothesisMessage=void 0,!E)throw new e.ArgumentNullError("authentication");if(!v)throw new e.ArgumentNullError("connectionFactory");if(!m)throw new e.ArgumentNullError("audioSource");if(!M)throw new e.ArgumentNullError("recognizerConfig");this.privEnableSpeakerId=M.isSpeakerDiarizationEnabled,this.privMustReportEndOfStream=!1,this.privAuthentication=E,this.privConnectionFactory=v,this.privAudioSource=m,this.privRecognizerConfig=M,this.privIsDisposed=!1,this.privRecognizer=O,this.privRequestSession=new r.RequestSession(this.privAudioSource.id()),this.privConnectionEvents=new e.EventSource,this.privServiceEvents=new e.EventSource,this.privDynamicGrammar=new r.DynamicGrammarBuilder,this.privSpeechContext=new r.SpeechContext(this.privDynamicGrammar),this.privAgentConfig=new r.AgentConfig,this.privRecognizerConfig.parameters.getProperty(A.PropertyId.WebWorkerLoadType,"on").toLowerCase()==="on"&&typeof Blob<"u"&&typeof Worker<"u"?this.privSetTimeout=e.Timeout.setTimeout:(typeof window<"u"&&(this.privSetTimeout=window.setTimeout.bind(window)),typeof globalThis<"u"&&(this.privSetTimeout=globalThis.setTimeout.bind(globalThis))),this.connectionEvents.attach(P=>{if(P.name==="ConnectionClosedEvent"){const D=P;(D.statusCode===1003||D.statusCode===1007||D.statusCode===1002||D.statusCode===4e3||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&this.cancelRecognitionLocal(A.CancellationReason.Error,D.statusCode===1007?A.CancellationErrorCode.BadRequestParameters:A.CancellationErrorCode.ConnectionFailure,`${D.reason} websocket error code: ${D.statusCode}`)}}),this.privEnableSpeakerId&&(this.privDiarizationSessionId=(0,e.createNoDashGuid)())}setTranslationJson(){const E=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0);if(E!==void 0){const v=E.split(","),m=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,void 0),M=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationCategoryId,void 0),O=m!==void 0?s.NextAction.Synthesize:s.NextAction.None;if(this.privSpeechContext.getContext().translation={onPassthrough:{action:O},onSuccess:{action:O},output:{includePassThroughResults:!0,interimResults:{mode:a.Mode.Always}},targetLanguages:v},M!==void 0&&(this.privSpeechContext.getContext().translation.category=M),m!==void 0){const P={};for(const D of v)P[D]=m;this.privSpeechContext.getContext().synthesis={defaultVoices:P}}const x=this.privSpeechContext.getContext().phraseDetection||{};x.onSuccess={action:p.NextAction.Translate},x.onInterim={action:p.NextAction.Translate},this.privSpeechContext.getContext().phraseDetection=x}}setSpeechSegmentationTimeoutJson(){const E=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.Speech_SegmentationSilenceTimeoutMs,void 0),v=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.Speech_SegmentationMaximumTimeMs,void 0),m=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.Speech_SegmentationStrategy,void 0),M={mode:n.SegmentationMode.Normal,segmentationForcedTimeoutMs:0,segmentationSilenceTimeoutMs:0};let O=!1;if(m!==void 0){O=!0;let x=n.SegmentationMode.Normal;switch(m.toLowerCase()){case"default":break;case"time":x=n.SegmentationMode.Custom;break;case"semantic":x=n.SegmentationMode.Semantic;break}M.mode=x}if(E!==void 0){O=!0;const x=parseInt(E,10);M.mode=n.SegmentationMode.Custom,M.segmentationSilenceTimeoutMs=x}if(v!==void 0){O=!0;const x=parseInt(v,10);M.mode=n.SegmentationMode.Custom,M.segmentationForcedTimeoutMs=x}if(O){const x=this.privSpeechContext.getContext().phraseDetection||{};switch(x.mode=this.recognitionMode,this.recognitionMode){case o.RecognitionMode.Conversation:x.conversation=x.conversation??{segmentation:{}},x.conversation.segmentation=M;break;case o.RecognitionMode.Interactive:x.interactive=x.interactive??{segmentation:{}},x.interactive.segmentation=M;break;case o.RecognitionMode.Dictation:x.dictation=x.dictation??{},x.dictation.segmentation=M;break}this.privSpeechContext.getContext().phraseDetection=x}}setLanguageIdJson(){const E=this.privSpeechContext.getContext().phraseDetection||{};if(this.privRecognizerConfig.autoDetectSourceLanguages!==void 0){const v=this.privRecognizerConfig.autoDetectSourceLanguages.split(",");v.length===1&&v[0]===r.AutoDetectSourceLanguagesOpenRangeOptionName&&(v[0]="UND");let m;this.privRecognizerConfig.languageIdMode==="Continuous"?m=c.LanguageIdDetectionMode.DetectContinuous:m=c.LanguageIdDetectionMode.DetectAtAudioStart,this.privSpeechContext.getContext().languageId={languages:v,mode:m,onSuccess:{action:u.NextAction.Recognize},onUnknown:{action:l.OnUnknownAction.None},priority:c.LanguageIdDetectionPriority.PrioritizeLatency},this.privSpeechContext.getContext().phraseOutput={interimResults:{resultType:g.ResultType.Auto},phraseResults:{resultType:h.PhraseResultOutputType.Always}};const M=this.privRecognizerConfig.sourceLanguageModels;M!==void 0&&(E.customModels=M,E.onInterim={action:p.NextAction.None},E.onSuccess={action:p.NextAction.None})}this.privSpeechContext.getContext().phraseDetection=E}setOutputDetailLevelJson(){this.privEnableSpeakerId&&(this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"false").toLowerCase()==="true"?this.privSpeechContext.setWordLevelTimings():this.privRecognizerConfig.parameters.getProperty(r.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Simple]).toLowerCase()===A.OutputFormat[A.OutputFormat.Detailed].toLocaleLowerCase()&&this.privSpeechContext.setDetailedOutputFormat())}get isSpeakerDiarizationEnabled(){return this.privEnableSpeakerId}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(E){this.privRecognizerConfig.parameters.setProperty(A.PropertyId.ConversationTranslator_Token,E)}set voiceProfileType(E){this.privRecognizerConfig.parameters.setProperty(A.PropertyId.SpeechServiceConnection_SpeakerIdMode,E)}set authentication(E){this.privAuthentication=E}isDisposed(){return this.privIsDisposed}async dispose(E){if(this.privIsDisposed=!0,this.privConnectionPromise!==void 0)try{await(await this.privConnectionPromise).dispose(E)}catch{return}}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}async recognize(E,v,m){if(this.recognizeOverride!==void 0){await this.recognizeOverride(E,v,m);return}if(this.privConnectionConfigurationPromise=void 0,this.privRecognizerConfig.recognitionMode=E,this.privRecognizerConfig.recognitionEndpointVersion==="2"){const D=this.privSpeechContext.getContext().phraseDetection||{};D.mode=E,this.privSpeechContext.getContext().phraseDetection=D}this.setLanguageIdJson(),this.setTranslationJson(),this.privRecognizerConfig.autoDetectSourceLanguages!==void 0&&this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0&&this.setupTranslationWithLanguageId(),this.setSpeechSegmentationTimeoutJson(),this.setOutputDetailLevelJson(),this.privSuccessCallback=v,this.privErrorCallback=m,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const M=this.connectImpl();let O;try{const D=await this.audioSource.attach(this.privRequestSession.audioNodeId),T=await this.audioSource.format,q=await this.audioSource.deviceInfo;this.privIsLiveAudio=q.type&&q.type===r.type.Microphones,O=new t.ReplayableAudioNode(D,T.avgBytesPerSec),await this.privRequestSession.onAudioSourceAttachCompleted(O,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:q}}catch(D){throw await this.privRequestSession.onStopRecognizing(),D}try{await M}catch(D){await this.cancelRecognitionLocal(A.CancellationReason.Error,A.CancellationErrorCode.ConnectionFailure,D);return}const x=new A.SessionEventArgs(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,x),this.receiveMessage(),this.sendAudio(O).catch(async D=>{await this.cancelRecognitionLocal(A.CancellationReason.Error,A.CancellationErrorCode.RuntimeError,D)})}async stopRecognizing(){if(this.privRequestSession.isRecognizing)try{await this.audioSource.turnOff(),await this.sendFinalAudio(),await this.privRequestSession.onStopRecognizing(),await this.privRequestSession.turnCompletionPromise}finally{await this.privRequestSession.dispose()}}async connect(){return await this.connectImpl(),Promise.resolve()}connectAsync(E,v){this.connectImpl().then(()=>{try{E&&E()}catch(m){v&&v(m)}},m=>{try{v&&v(m)}catch{}})}async disconnect(){if(await this.cancelRecognitionLocal(A.CancellationReason.Error,A.CancellationErrorCode.NoError,"Disconnecting"),this.disconnectOverride!==void 0&&await this.disconnectOverride(),this.privConnectionPromise!==void 0)try{await(await this.privConnectionPromise).dispose()}catch{}this.privConnectionPromise=void 0}sendMessage(E){}async sendNetworkMessage(E,v){const m=typeof v=="string"?e.MessageType.Text:e.MessageType.Binary,M=typeof v=="string"?"application/json":"";return(await this.fetchConnection()).send(new i.SpeechConnectionMessage(m,E,this.privRequestSession.requestId,M,v))}set activityTemplate(E){this.privActivityTemplate=E}get activityTemplate(){return this.privActivityTemplate}set expectContentAssessmentResponse(E){this.privExpectContentAssessmentResponse=E}async sendTelemetryData(){const E=this.privRequestSession.getTelemetry();if(aE.telemetryDataEnabled!==!0||this.privIsDisposed||E===null)return;if(aE.telemetryData)try{aE.telemetryData(E)}catch{}await(await this.fetchConnection()).send(new i.SpeechConnectionMessage(e.MessageType.Text,"telemetry",this.privRequestSession.requestId,"application/json",E))}async cancelRecognitionLocal(E,v,m){this.privRequestSession.isRecognizing&&(await this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,E,v,m))}async receiveMessage(){try{if(this.privIsDisposed)return;let E=await this.fetchConnection();const v=await E.read();if(this.receiveMessageOverride!==void 0)return this.receiveMessageOverride();if(!v)return this.receiveMessage();this.privServiceHasSentMessage=!0;const m=i.SpeechConnectionMessage.fromConnectionMessage(v);if(m.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(m.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const M=r.SpeechDetected.fromJSON(m.textBody,this.privRequestSession.currentTurnAudioOffset),O=new A.RecognitionEventArgs(M.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,O);break;case"speech.enddetected":let x;m.textBody.length>0?x=m.textBody:x="{ Offset: 0 }";const P=r.SpeechDetected.fromJSON(x,this.privRequestSession.currentTurnAudioOffset),D=new A.RecognitionEventArgs(P.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,D);break;case"turn.end":await this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,await this.cancelRecognitionLocal(A.CancellationReason.EndOfStream,A.CancellationErrorCode.NoError,void 0));const T=new A.SessionEventArgs(this.privRequestSession.sessionId);if(await this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing){this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,T);return}else E=await this.fetchConnection(),await this.sendPrePayloadJSON(E);break;default:await this.processTypeSpecificMessages(m)||this.privServiceEvents&&this.serviceEvents.onEvent(new e.ServiceEvent(m.path.toLowerCase(),m.textBody))}return this.receiveMessage()}catch{return null}}updateSpeakerDiarizationAudioOffset(){const E=this.privRequestSession.recognitionBytesSent,v=this.privAverageBytesPerMs!==0?E/this.privAverageBytesPerMs:0;this.privSpeechContext.setSpeakerDiarizationAudioOffsetMs(v)}sendSpeechContext(E,v){this.privEnableSpeakerId&&this.updateSpeakerDiarizationAudioOffset();const m=this.speechContext.toJSON();if(v&&this.privRequestSession.onSpeechContext(),m)return E.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speech.context",this.privRequestSession.requestId,"application/json",m))}setupTranslationWithLanguageId(){const E=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0),v=this.privRecognizerConfig.autoDetectSourceLanguages!==void 0;if(E!==void 0&&v){this.privSpeechContext.getContext().phraseOutput={interimResults:{resultType:g.ResultType.None},phraseResults:{resultType:h.PhraseResultOutputType.None}};const m=this.privSpeechContext.getContext().translation;if(m){const M=this.privRecognizerConfig.sourceLanguageModels;if(M!==void 0&&M.length>0){const x=this.privSpeechContext.getContext().phraseDetection||{};x.customModels=M,this.privSpeechContext.getContext().phraseDetection=x}this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)!==void 0&&(m.onSuccess={action:s.NextAction.Synthesize},m.onPassthrough={action:s.NextAction.Synthesize})}}}noOp(){}async sendPrePayloadJSON(E,v=!0){if(this.sendPrePayloadJSONOverride!==void 0)return this.sendPrePayloadJSONOverride(E);await this.sendSpeechContext(E,v),await this.sendWaveHeader(E)}async sendWaveHeader(E){const v=await this.audioSource.format;return E.send(new i.SpeechConnectionMessage(e.MessageType.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",v.header))}connectImpl(){return this.privConnectionPromise!==void 0?this.privConnectionPromise.then(E=>E.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise,()=>(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl())):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch(()=>{}),this.postConnectImplOverride!==void 0?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}sendSpeechServiceConfig(E,v,m){if(v.onSpeechContext(),aE.telemetryDataEnabled!==!0){const O={context:{system:JSON.parse(m).context.system}};m=JSON.stringify(O)}if(this.privRecognizerConfig.parameters.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase()==="true"){const M=JSON.parse(m);M.context.DisableReferenceChannel="True",M.context.MicSpec="1_0_0",m=JSON.stringify(M)}if(m)return E.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speech.config",v.requestId,"application/json",m))}async fetchConnection(){return this.privConnectionConfigurationPromise!==void 0?this.privConnectionConfigurationPromise.then(E=>E.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async sendAudio(E){const v=await this.audioSource.format;this.privAverageBytesPerMs=v.avgBytesPerSec/1e3;let m=Date.now();const M=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),O=v.avgBytesPerSec/1e3*parseInt(M,10),x=this.privRequestSession.recogNumber,P=async()=>{if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===x){const D=await this.fetchConnection(),T=await E.read();if(this.privRequestSession.isSpeechEnded)return;let q,Q;if(!T||T.isEnd?(q=null,Q=0):(q=T.buffer,this.privRequestSession.onAudioSent(q.byteLength),O>=this.privRequestSession.bytesSent?Q=0:Q=Math.max(0,m-Date.now())),Q!==0&&await this.delay(Q),q!==null&&(m=Date.now()+q.byteLength*1e3/(v.avgBytesPerSec*2)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===x)if(D.send(new i.SpeechConnectionMessage(e.MessageType.Binary,"audio",this.privRequestSession.requestId,null,q)).catch(()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch(()=>{})}),T!=null&&T.isEnd)this.privIsLiveAudio||this.privRequestSession.onSpeechEnded();else return P()}};return P()}async retryableConnect(){let E=!1;this.privAuthFetchEventId=(0,e.createNoDashGuid)();const v=this.privRequestSession.sessionId;this.privConnectionId=v!==void 0?v:(0,e.createNoDashGuid)(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let m=0,M="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){this.privRequestSession.onRetryConnection();const x=await(E?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId));await this.privRequestSession.onAuthCompleted(!1);const P=await this.privConnectionFactory.create(this.privRecognizerConfig,x,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(P.events),P.events.attach(T=>{this.connectionEvents.onEvent(T)});const D=await P.open();if(D.statusCode===200)return await this.privRequestSession.onConnectionEstablishCompleted(D.statusCode),Promise.resolve(P);D.statusCode===1006&&(E=!0),m=D.statusCode,M=D.reason}return await this.privRequestSession.onConnectionEstablishCompleted(m,M),Promise.reject(`Unable to contact server. StatusCode: ${m}, ${this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint)} Reason: ${M}`)}delay(E){return new Promise(v=>this.privSetTimeout(v,E))}writeBufferToConsole(E){let v="Buffer Size: ";if(E===null)v+="null";else{const m=new Uint8Array(E);v+=`${E.byteLength}\r
30
+ File System access not available, please use Push or PullAudioOutputStream`),this.privFd=Fg.openSync(e,"w")}set format(e){C0.Contracts.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let A=0;this.privAudioFormat.hasHeader&&(A=this.privAudioFormat.header.byteLength),this.privFd!==void 0&&(this.privWriteStream=Fg.createWriteStream("",{fd:this.privFd,start:A,autoClose:!1}))}write(e){C0.Contracts.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),this.privWriteStream!==void 0&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){this.privFd!==void 0&&(this.privWriteStream.on("finish",()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),Fg.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),Fg.closeSync(this.privFd),this.privFd=void 0}),this.privWriteStream.end())}id(){return this.privId}}Lg.AudioFileWriter=GX;var Bn={},p2;function f2(){if(p2)return Bn;p2=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.PullAudioInputStreamImpl=Bn.PullAudioInputStream=Bn.PushAudioInputStreamImpl=Bn.PushAudioInputStream=Bn.AudioInputStream=void 0;const t=ut(),e=Mt(),A=Hn,r=Ve(),i=ya;let n=class{constructor(){}static createPushStream(l){return o.create(l)}static createPullStream(l,g){return a.create(l,g)}};Bn.AudioInputStream=n;class o extends n{static create(l){return new s(l)}}Bn.PushAudioInputStream=o;class s extends o{constructor(l){super(),l===void 0?this.privFormat=i.AudioStreamFormatImpl.getDefaultInputFormat():this.privFormat=l,this.privEvents=new e.EventSource,this.privId=(0,A.createNoDashGuid)(),this.privStream=new e.ChunkedArrayBufferStream(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(l){this.privStream.writeStreamChunk({buffer:l,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}turnOn(){this.onEvent(new e.AudioSourceInitializingEvent(this.privId)),this.onEvent(new e.AudioSourceReadyEvent(this.privId))}async attach(l){this.onEvent(new e.AudioStreamNodeAttachingEvent(this.privId,l)),await this.turnOn();const g=this.privStream;return this.onEvent(new e.AudioStreamNodeAttachedEvent(this.privId,l)),{detach:async()=>(this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l)),this.turnOff()),id:()=>l,read:()=>g.read()}}detach(l){this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:t.connectivity.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:t.type.Stream})}onEvent(l){this.privEvents.onEvent(l),e.Events.instance.onEvent(l)}toBuffer(l){const g=Buffer.alloc(l.byteLength),h=new Uint8Array(l);for(let p=0;p<g.length;++p)g[p]=h[p];return g}}Bn.PushAudioInputStreamImpl=s;class a extends n{constructor(){super()}static create(l,g){return new c(l,g)}}Bn.PullAudioInputStream=a;class c extends a{constructor(l,g){super(),g===void 0?this.privFormat=r.AudioStreamFormat.getDefaultInputFormat():this.privFormat=g,this.privEvents=new e.EventSource,this.privId=(0,A.createNoDashGuid)(),this.privCallback=l,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}turnOn(){this.onEvent(new e.AudioSourceInitializingEvent(this.privId)),this.onEvent(new e.AudioSourceReadyEvent(this.privId))}async attach(l){return this.onEvent(new e.AudioStreamNodeAttachingEvent(this.privId,l)),await this.turnOn(),this.onEvent(new e.AudioStreamNodeAttachedEvent(this.privId,l)),{detach:()=>(this.privCallback.close(),this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l)),this.turnOff()),id:()=>l,read:()=>{let g=0,h;for(;g<this.privBufferSize;){const p=new ArrayBuffer(this.privBufferSize-g),C=this.privCallback.read(p);if(h===void 0?h=p:new Int8Array(h).set(new Int8Array(p),g),C===0)break;g+=C}return Promise.resolve({buffer:h.slice(0,g),isEnd:this.privIsClosed||g===0,timeReceived:Date.now()})}}}detach(l){this.onEvent(new e.AudioStreamNodeDetachedEvent(this.privId,l))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:t.connectivity.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:t.type.Stream})}onEvent(l){this.privEvents.onEvent(l),e.Events.instance.onEvent(l)}}return Bn.PullAudioInputStreamImpl=c,Bn}var li={},Qa={},I0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisOutputFormat=void 0,function(e){e[e.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",e[e.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",e[e.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",e[e.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",e[e.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",e[e.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",e[e.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",e[e.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",e[e.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",e[e.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",e[e.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",e[e.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",e[e.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",e[e.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",e[e.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",e[e.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",e[e.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",e[e.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",e[e.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",e[e.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",e[e.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",e[e.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",e[e.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",e[e.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",e[e.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",e[e.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",e[e.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",e[e.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",e[e.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",e[e.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",e[e.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",e[e.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",e[e.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",e[e.Raw22050Hz16BitMonoPcm=33]="Raw22050Hz16BitMonoPcm",e[e.Riff22050Hz16BitMonoPcm=34]="Riff22050Hz16BitMonoPcm",e[e.Raw44100Hz16BitMonoPcm=35]="Raw44100Hz16BitMonoPcm",e[e.Riff44100Hz16BitMonoPcm=36]="Riff44100Hz16BitMonoPcm",e[e.AmrWb16000Hz=37]="AmrWb16000Hz",e[e.G72216Khz64Kbps=38]="G72216Khz64Kbps"}(t.SpeechSynthesisOutputFormat||(t.SpeechSynthesisOutputFormat={}))})(I0),Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.AudioOutputFormatImpl=void 0;const _t=I0,zt=ya;class Tt extends zt.AudioStreamFormatImpl{constructor(e,A,r,i,n,o,s,a,c){super(r,o,A,e),this.formatTag=e,this.avgBytesPerSec=i,this.blockAlign=n,this.priAudioFormatString=s,this.priRequestAudioFormatString=a,this.priHasHeader=c}static fromSpeechSynthesisOutputFormat(e){return e===void 0?Tt.getDefaultOutputFormat():Tt.fromSpeechSynthesisOutputFormatString(Tt.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new Tt(zt.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new Tt(zt.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new Tt(zt.AudioFormatTag.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,16e3,32<<7,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,16e3,128<<7,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,16e3,64<<7,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,24e3,48<<7,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,24e3,96<<7,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,24e3,160<<7,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new Tt(zt.AudioFormatTag.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new Tt(zt.AudioFormatTag.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,48e3,96<<7,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new Tt(zt.AudioFormatTag.MP3,1,48e3,192<<7,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new Tt(zt.AudioFormatTag.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new Tt(zt.AudioFormatTag.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new Tt(zt.AudioFormatTag.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new Tt(zt.AudioFormatTag.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new Tt(zt.AudioFormatTag.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new Tt(zt.AudioFormatTag.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new Tt(zt.AudioFormatTag.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new Tt(zt.AudioFormatTag.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new Tt(zt.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new Tt(zt.AudioFormatTag.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);case"raw-22050hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,22050,44100,2,16,e,e,!1);case"riff-22050hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,22050,44100,2,16,e,"raw-22050hz-16bit-mono-pcm",!0);case"raw-44100hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,44100,88200,2,16,e,e,!1);case"riff-44100hz-16bit-mono-pcm":return new Tt(zt.AudioFormatTag.PCM,1,44100,88200,2,16,e,"raw-44100hz-16bit-mono-pcm",!0);case"amr-wb-16000h":return new Tt(zt.AudioFormatTag.AMR_WB,1,16e3,3052,2,16,e,e,!1);case"g722-16khz-64kbps":return new Tt(zt.AudioFormatTag.G722,1,16e3,8e3,2,16,e,e,!1);case"riff-16khz-16bit-mono-pcm":default:return new Tt(zt.AudioFormatTag.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return Tt.fromSpeechSynthesisOutputFormatString(typeof window<"u"?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){const A=new DataView(this.privHeader);A.setUint32(4,e+this.privHeader.byteLength-8,!0),A.setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}addHeader(e){if(!this.hasHeader)return e;this.updateHeader(e.byteLength);const A=new Uint8Array(e.byteLength+this.header.byteLength);return A.set(new Uint8Array(this.header),0),A.set(new Uint8Array(e),this.header.byteLength),A.buffer}}Qa.AudioOutputFormatImpl=Tt,Tt.SpeechSynthesisOutputFormatToString={[_t.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[_t.SpeechSynthesisOutputFormat.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[_t.SpeechSynthesisOutputFormat.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[_t.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[_t.SpeechSynthesisOutputFormat.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[_t.SpeechSynthesisOutputFormat.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[_t.SpeechSynthesisOutputFormat.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[_t.SpeechSynthesisOutputFormat.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[_t.SpeechSynthesisOutputFormat.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[_t.SpeechSynthesisOutputFormat.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[_t.SpeechSynthesisOutputFormat.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus",[_t.SpeechSynthesisOutputFormat.Raw22050Hz16BitMonoPcm]:"raw-22050hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff22050Hz16BitMonoPcm]:"riff-22050hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Raw44100Hz16BitMonoPcm]:"raw-44100hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.Riff44100Hz16BitMonoPcm]:"riff-44100hz-16bit-mono-pcm",[_t.SpeechSynthesisOutputFormat.AmrWb16000Hz]:"amr-wb-16000hz",[_t.SpeechSynthesisOutputFormat.G72216Khz64Kbps]:"g722-16khz-64kbps"},Object.defineProperty(li,"__esModule",{value:!0}),li.PushAudioOutputStreamImpl=li.PushAudioOutputStream=li.PullAudioOutputStreamImpl=li.PullAudioOutputStream=li.AudioOutputStream=void 0;const B0=Mt(),jX=Ut,YX=Qa;class v0{constructor(){}static createPullStream(){return w0.create()}}li.AudioOutputStream=v0;class w0 extends v0{static create(){return new E2}}li.PullAudioOutputStream=w0;class E2 extends w0{constructor(){super(),this.privId=(0,B0.createNoDashGuid)(),this.privStream=new B0.Stream}set format(e){e==null&&(this.privFormat=YX.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}async read(e){const A=new Int8Array(e);let r=0;if(this.privLastChunkView!==void 0){if(this.privLastChunkView.length>e.byteLength)return A.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);A.set(this.privLastChunkView),r=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;r<e.byteLength&&!this.privStream.isReadEnded;){const i=await this.privStream.read();if(i!==void 0&&!i.isEnd){let n;i.buffer.byteLength>e.byteLength-r?(n=i.buffer.slice(0,e.byteLength-r),this.privLastChunkView=new Int8Array(i.buffer.slice(e.byteLength-r))):n=i.buffer,A.set(new Int8Array(n),r),r+=n.byteLength}else this.privStream.readEnded()}return r}write(e){jX.Contracts.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}li.PullAudioOutputStreamImpl=E2;class C2 extends v0{constructor(){super()}static create(e){return new I2(e)}}li.PushAudioOutputStream=C2;class I2 extends C2{constructor(e){super(),this.privId=(0,B0.createNoDashGuid)(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}li.PushAudioOutputStreamImpl=I2;var B2;function v2(){if(B2)return fo;B2=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.AudioOutputConfigImpl=fo.AudioConfigImpl=fo.AudioConfig=void 0;const t=Zr(),e=Ut,A=Ve(),r=Lg,i=f2(),n=li;let o=class V3{static fromDefaultMicrophoneInput(){const u=new t.PcmRecorder(!0);return new s(new t.MicAudioSource(u))}static fromMicrophoneInput(u){const l=new t.PcmRecorder(!0);return new s(new t.MicAudioSource(l,u))}static fromWavFileInput(u,l="unnamedBuffer.wav"){return new s(new t.FileAudioSource(u,l))}static fromStreamInput(u){if(u instanceof A.PullAudioInputStreamCallback)return new s(new i.PullAudioInputStreamImpl(u));if(u instanceof A.AudioInputStream)return new s(u);if(typeof MediaStream<"u"&&u instanceof MediaStream){const l=new t.PcmRecorder(!1);return new s(new t.MicAudioSource(l,null,null,u))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new a(new A.SpeakerAudioDestination)}static fromSpeakerOutput(u){if(u===void 0)return V3.fromDefaultSpeakerOutput();if(u instanceof A.SpeakerAudioDestination)return new a(u);throw new Error("Not Supported Type")}static fromAudioFileOutput(u){return new a(new r.AudioFileWriter(u))}static fromStreamOutput(u){if(u instanceof A.PushAudioOutputStreamCallback)return new a(new n.PushAudioOutputStreamImpl(u));if(u instanceof A.PushAudioOutputStream)return new a(u);if(u instanceof A.PullAudioOutputStream)return new a(u);throw new Error("Not Supported Type")}};fo.AudioConfig=o;class s extends o{constructor(u){super(),this.privSource=u}get format(){return this.privSource.format}close(u,l){this.privSource.turnOff().then(()=>{u&&u()},g=>{l&&l(g)})}id(){return this.privSource.id()}turnOn(){return this.privSource.turnOn()}attach(u){return this.privSource.attach(u)}detach(u){return this.privSource.detach(u)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(u,l){if(e.Contracts.throwIfNull(l,"value"),this.privSource.setProperty!==void 0)this.privSource.setProperty(u,l);else throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(u,l){if(this.privSource.getProperty!==void 0)return this.privSource.getProperty(u,l);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}fo.AudioConfigImpl=s;class a extends o{constructor(u){super(),this.privDestination=u}set format(u){this.privDestination.format=u}write(u){this.privDestination.write(u)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(){throw new Error("This AudioConfig instance does not support getting properties.")}}return fo.AudioOutputConfigImpl=a,fo}var w2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationReason=void 0,function(e){e[e.Error=0]="Error",e[e.EndOfStream=1]="EndOfStream"}(t.CancellationReason||(t.CancellationReason={}))})(w2);var xC={};Object.defineProperty(xC,"__esModule",{value:!0}),xC.PullAudioInputStreamCallback=void 0;class HX{}xC.PullAudioInputStreamCallback=HX;var NC={};Object.defineProperty(NC,"__esModule",{value:!0}),NC.PushAudioOutputStreamCallback=void 0;class zX{}NC.PushAudioOutputStreamCallback=zX;var KC={};Object.defineProperty(KC,"__esModule",{value:!0}),KC.KeywordRecognitionModel=void 0;const S2=Ut;class JX{constructor(){this.privDisposed=!1}static fromFile(e){throw S2.Contracts.throwIfFileDoesNotExist(e,"fileName"),new Error("Not yet implemented.")}static fromStream(e){throw S2.Contracts.throwIfNull(e,"file"),new Error("Not yet implemented.")}close(){this.privDisposed||(this.privDisposed=!0)}}KC.KeywordRecognitionModel=JX;var kC={};Object.defineProperty(kC,"__esModule",{value:!0}),kC.SessionEventArgs=void 0;class qX{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}kC.SessionEventArgs=qX;var Og={},m2;function VX(){if(m2)return Og;m2=1,Object.defineProperty(Og,"__esModule",{value:!0}),Og.RecognitionEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i){super(i),this.privOffset=r}get offset(){return this.privOffset}};return Og.RecognitionEventArgs=e,Og}var M2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.OutputFormat=void 0,function(e){e[e.Simple=0]="Simple",e[e.Detailed=1]="Detailed"}(t.OutputFormat||(t.OutputFormat={}))})(M2);var bg={},y2;function WX(){if(y2)return bg;y2=1,Object.defineProperty(bg,"__esModule",{value:!0}),bg.IntentRecognitionEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n){super(i,n),this.privResult=r}get result(){return this.privResult}};return bg.IntentRecognitionEventArgs=e,bg}var PC={};Object.defineProperty(PC,"__esModule",{value:!0}),PC.RecognitionResult=void 0;class ZX{constructor(e,A,r,i,n,o,s,a,c,u){this.privResultId=e,this.privReason=A,this.privText=r,this.privDuration=i,this.privOffset=n,this.privLanguage=o,this.privLanguageDetectionConfidence=s,this.privErrorDetails=a,this.privJson=c,this.privProperties=u}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}PC.RecognitionResult=ZX;var xg={},Q2;function XX(){if(Q2)return xg;Q2=1,Object.defineProperty(xg,"__esModule",{value:!0}),xg.SpeechRecognitionResult=void 0;const t=Ve();let e=class extends t.RecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(r,i,n,o,s,a,c,l,g,h),this.privSpeakerId=u}get speakerId(){return this.privSpeakerId}};return xg.SpeechRecognitionResult=e,xg}var Ng={},R2;function _X(){if(R2)return Ng;R2=1,Object.defineProperty(Ng,"__esModule",{value:!0}),Ng.IntentRecognitionResult=void 0;const t=Ve();let e=class extends t.SpeechRecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(i,n,o,s,a,c,u,void 0,l,g,h),this.privIntentId=r}get intentId(){return this.privIntentId}};return Ng.IntentRecognitionResult=e,Ng}var yl={};Object.defineProperty(yl,"__esModule",{value:!0}),yl.LanguageUnderstandingModelImpl=yl.LanguageUnderstandingModel=void 0;const Ql=Ut;class D2{constructor(){}static fromEndpoint(e){Ql.Contracts.throwIfNull(e,"uri"),Ql.Contracts.throwIfNullOrWhitespace(e.hostname,"uri");const A=new GC,r=e.host.indexOf(".");if(r===-1)throw new Error("Could not determine region from endpoint");A.region=e.host.substr(0,r);const i=e.pathname.lastIndexOf("/")+1;if(i===-1)throw new Error("Could not determine appId from endpoint");if(A.appId=e.pathname.substr(i),A.subscriptionKey=e.searchParams.get("subscription-key"),A.subscriptionKey===void 0)throw new Error("Could not determine subscription key from endpoint");return A}static fromAppId(e){Ql.Contracts.throwIfNullOrWhitespace(e,"appId");const A=new GC;return A.appId=e,A}static fromSubscription(e,A,r){Ql.Contracts.throwIfNullOrWhitespace(e,"subscriptionKey"),Ql.Contracts.throwIfNullOrWhitespace(A,"appId"),Ql.Contracts.throwIfNullOrWhitespace(r,"region");const i=new GC;return i.appId=A,i.region=r,i.subscriptionKey=e,i}}yl.LanguageUnderstandingModel=D2;class GC extends D2{}yl.LanguageUnderstandingModelImpl=GC;var Eo={},T2;function $X(){if(T2)return Eo;T2=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.MeetingTranscriptionEventArgs=Eo.ConversationTranscriptionEventArgs=Eo.SpeechRecognitionEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(n,o,s){super(o,s),this.privResult=n}get result(){return this.privResult}};Eo.SpeechRecognitionEventArgs=e;class A extends t.RecognitionEventArgs{constructor(n,o,s){super(o,s),this.privResult=n}get result(){return this.privResult}}Eo.ConversationTranscriptionEventArgs=A;class r extends e{}return Eo.MeetingTranscriptionEventArgs=r,Eo}var Kg={},kg={},U2;function Pg(){if(U2)return kg;U2=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.CancellationEventArgsBase=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n,o,s){super(o,s),this.privReason=r,this.privErrorDetails=i,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}};return kg.CancellationEventArgsBase=e,kg}var L2;function e_(){if(L2)return Kg;L2=1,Object.defineProperty(Kg,"__esModule",{value:!0}),Kg.SpeechRecognitionCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Kg.SpeechRecognitionCanceledEventArgs=e,Kg}var Gg={},F2;function t_(){if(F2)return Gg;F2=1,Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.TranslationRecognitionEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n){super(i,n),this.privResult=r}get result(){return this.privResult}};return Gg.TranslationRecognitionEventArgs=e,Gg}var jg={},O2;function A_(){if(O2)return jg;O2=1,Object.defineProperty(jg,"__esModule",{value:!0}),jg.TranslationSynthesisEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i){super(i),this.privResult=r}get result(){return this.privResult}};return jg.TranslationSynthesisEventArgs=e,jg}var Yg={},b2;function x2(){if(b2)return Yg;b2=1,Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.TranslationRecognitionResult=void 0;const t=Ve();let e=class W3 extends t.SpeechRecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(i,n,o,s,a,c,u,void 0,l,g,h),this.privTranslations=r}static fromSpeechRecognitionResult(r){return new W3(void 0,r.resultId,r.reason,r.text,r.duration,r.offset,r.language,r.languageDetectionConfidence,r.errorDetails,r.json,r.properties)}get translations(){return this.privTranslations}};return Yg.TranslationRecognitionResult=e,Yg}var jC={};Object.defineProperty(jC,"__esModule",{value:!0}),jC.TranslationSynthesisResult=void 0;class r_{constructor(e,A){this.privReason=e,this.privAudio=A}get audio(){return this.privAudio}get reason(){return this.privReason}}jC.TranslationSynthesisResult=r_;var N2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ResultReason=void 0,function(e){e[e.NoMatch=0]="NoMatch",e[e.Canceled=1]="Canceled",e[e.RecognizingSpeech=2]="RecognizingSpeech",e[e.RecognizedSpeech=3]="RecognizedSpeech",e[e.RecognizedKeyword=4]="RecognizedKeyword",e[e.RecognizingIntent=5]="RecognizingIntent",e[e.RecognizedIntent=6]="RecognizedIntent",e[e.TranslatingSpeech=7]="TranslatingSpeech",e[e.TranslatedSpeech=8]="TranslatedSpeech",e[e.SynthesizingAudio=9]="SynthesizingAudio",e[e.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",e[e.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",e[e.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",e[e.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",e[e.RecognizedSpeakers=14]="RecognizedSpeakers",e[e.RecognizedSpeaker=15]="RecognizedSpeaker",e[e.ResetVoiceProfile=16]="ResetVoiceProfile",e[e.DeletedVoiceProfile=17]="DeletedVoiceProfile",e[e.VoicesListRetrieved=18]="VoicesListRetrieved",e[e.TranslatingParticipantSpeech=19]="TranslatingParticipantSpeech",e[e.TranslatedParticipantSpeech=20]="TranslatedParticipantSpeech",e[e.TranslatedInstantMessage=21]="TranslatedInstantMessage",e[e.TranslatedParticipantInstantMessage=22]="TranslatedParticipantInstantMessage"}(t.ResultReason||(t.ResultReason={}))})(N2);var Nc={},K2;function i_(){if(K2)return Nc;K2=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.SpeechConfigImpl=Nc.SpeechConfig=void 0;const t=ut(),e=Ut,A=Ve();let r=class{constructor(){}static fromSubscription(o,s){e.Contracts.throwIfNullOrWhitespace(o,"subscriptionKey"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a.setProperty(A.PropertyId.SpeechServiceConnection_IntentRegion,s),a.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),a}static fromEndpoint(o,s){e.Contracts.throwIfNull(o,"endpoint");const a=typeof s=="string"&&s.trim().length>0,c=typeof s=="object"&&s!==null&&typeof s.getToken=="function";if(s!==void 0&&!a&&!c)throw new Error("Invalid 'auth' parameter: must be a non-empty key string or a valid TokenCredential object.");const u=typeof s=="object"?new i(s):new i;return u.setProperty(A.PropertyId.SpeechServiceConnection_Endpoint,o.href),typeof s=="string"&&s.trim().length>0&&u.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),u}static fromHost(o,s){e.Contracts.throwIfNull(o,"hostName");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Host,o.protocol+"//"+o.hostname+(o.port===""?"":":"+o.port)),a.setProperty(A.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"1"),s!==void 0&&a.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),a}static fromAuthorizationToken(o,s){e.Contracts.throwIfNull(o,"authorizationToken"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a.setProperty(A.PropertyId.SpeechServiceConnection_IntentRegion,s),a.authorizationToken=o,a}close(){}};Nc.SpeechConfig=r;class i extends r{constructor(o){super(),this.privProperties=new A.PropertyCollection,this.speechRecognitionLanguage="en-US",this.outputFormat=A.OutputFormat.Simple,this.privTokenCredential=o}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o)}get speechRecognitionLanguage(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,o)}get autoDetectSourceLanguages(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,o)}get outputFormat(){return A.OutputFormat[this.privProperties.getProperty(t.OutputFormatPropertyName,void 0)]}set outputFormat(o){this.privProperties.setProperty(t.OutputFormatPropertyName,A.OutputFormat[o])}get endpointId(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_EndpointId)}set endpointId(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_EndpointId,o)}get tokenCredential(){return this.privTokenCredential}setProperty(o,s){e.Contracts.throwIfNull(s,"value"),this.privProperties.setProperty(o,s)}getProperty(o,s){return this.privProperties.getProperty(o,s)}setProxy(o,s,a,c){this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyHostName],o),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPort],s),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyUserName],a),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPassword],c)}setServiceProperty(o,s){const a=JSON.parse(this.privProperties.getProperty(t.ServicePropertiesPropertyName,"{}"));a[o]=s,this.privProperties.setProperty(t.ServicePropertiesPropertyName,JSON.stringify(a))}setProfanity(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceResponse_ProfanityOption,A.ProfanityOption[o])}enableAudioLogging(){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty(A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true"),this.privProperties.setProperty(t.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Detailed])}enableDictation(){this.privProperties.setProperty(t.ForceDictationPropertyName,"true")}clone(){const o=new i(this.tokenCredential);return o.privProperties=this.privProperties.clone(),o}get speechSynthesisLanguage(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage,o)}get speechSynthesisVoiceName(){return this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthVoice,o)}get speechSynthesisOutputFormat(){return A.SpeechSynthesisOutputFormat[this.privProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(o){this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,A.SpeechSynthesisOutputFormat[o])}}return Nc.SpeechConfigImpl=i,Nc}var Kc={},k2;function n_(){if(k2)return Kc;k2=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.SpeechTranslationConfigImpl=Kc.SpeechTranslationConfig=void 0;const t=ut(),e=Ut,A=Ve();let r=class extends A.SpeechConfig{constructor(){super()}static fromSubscription(o,s){e.Contracts.throwIfNullOrWhitespace(o,"subscriptionKey"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.properties.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),a.properties.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}static fromAuthorizationToken(o,s){e.Contracts.throwIfNullOrWhitespace(o,"authorizationToken"),e.Contracts.throwIfNullOrWhitespace(s,"region");const a=new i;return a.properties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o),a.properties.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}static fromHost(o,s){e.Contracts.throwIfNull(o,"hostName");const a=new i;return a.setProperty(A.PropertyId.SpeechServiceConnection_Host,o.protocol+"//"+o.hostname+(o.port===""?"":":"+o.port)),s!==void 0&&a.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),a}static fromEndpoint(o,s){e.Contracts.throwIfNull(o,"endpoint");const a=typeof s=="string"&&s.trim().length>0,c=typeof s=="object"&&s!==null&&typeof s.getToken=="function";if(s!==void 0&&!a&&!c)throw new Error("Invalid 'auth' parameter: must be a non-empty key string or a valid TokenCredential object.");const u=typeof s=="object"?new i(s):new i;return u.setProperty(A.PropertyId.SpeechServiceConnection_Endpoint,o.href),typeof s=="string"&&s.trim().length>0&&u.setProperty(A.PropertyId.SpeechServiceConnection_Key,s),u}};Kc.SpeechTranslationConfig=r;class i extends r{constructor(o){super(),this.privSpeechProperties=new A.PropertyCollection,this.outputFormat=A.OutputFormat.Simple,this.privTokenCredential=o}set authorizationToken(o){e.Contracts.throwIfNullOrWhitespace(o,"value"),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o)}set speechRecognitionLanguage(o){e.Contracts.throwIfNullOrWhitespace(o,"value"),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,o)}get speechRecognitionLanguage(){return this.privSpeechProperties.getProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_RecoLanguage])}get subscriptionKey(){return this.privSpeechProperties.getProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_Key])}get outputFormat(){return A.OutputFormat[this.privSpeechProperties.getProperty(t.OutputFormatPropertyName,void 0)]}set outputFormat(o){this.privSpeechProperties.setProperty(t.OutputFormatPropertyName,A.OutputFormat[o])}get endpointId(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_EndpointId)}set endpointId(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_EndpointId,o)}addTargetLanguage(o){e.Contracts.throwIfNullOrWhitespace(o,"value");const s=this.targetLanguages;s.includes(o)||(s.push(o),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,s.join(",")))}get targetLanguages(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0?this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","):[]}get voiceName(){return this.getProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_TranslationVoice])}set voiceName(o){e.Contracts.throwIfNullOrWhitespace(o,"value"),this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,o)}get region(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_Region)}get tokenCredential(){return this.privTokenCredential}setProxy(o,s,a,c){this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyHostName],o),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPort],s),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyUserName],a),this.setProperty(A.PropertyId[A.PropertyId.SpeechServiceConnection_ProxyPassword],c)}getProperty(o,s){return this.privSpeechProperties.getProperty(o,s)}setProperty(o,s){this.privSpeechProperties.setProperty(o,s)}get properties(){return this.privSpeechProperties}close(){}setServiceProperty(o,s){const a=JSON.parse(this.privSpeechProperties.getProperty(t.ServicePropertiesPropertyName,"{}"));a[o]=s,this.privSpeechProperties.setProperty(t.ServicePropertiesPropertyName,JSON.stringify(a))}setProfanity(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceResponse_ProfanityOption,A.ProfanityOption[o])}enableAudioLogging(){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privSpeechProperties.setProperty(t.ForceDictationPropertyName,"true")}get speechSynthesisLanguage(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthLanguage,o)}get speechSynthesisVoiceName(){return this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthVoice,o)}get speechSynthesisOutputFormat(){return A.SpeechSynthesisOutputFormat[this.privSpeechProperties.getProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(o){this.privSpeechProperties.setProperty(A.PropertyId.SpeechServiceConnection_SynthOutputFormat,A.SpeechSynthesisOutputFormat[o])}}return Kc.SpeechTranslationConfigImpl=i,Kc}var Hg={},P2;function G2(){if(P2)return Hg;P2=1,Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.PropertyCollection=void 0;const t=Ve();let e=class Z3{constructor(){this.privKeys=[],this.privValues=[]}getProperty(r,i){let n;typeof r=="string"?n=r:n=t.PropertyId[r];for(let o=0;o<this.privKeys.length;o++)if(this.privKeys[o]===n)return this.privValues[o];if(i!==void 0)return String(i)}setProperty(r,i){let n;typeof r=="string"?n=r:n=t.PropertyId[r];for(let o=0;o<this.privKeys.length;o++)if(this.privKeys[o]===n){this.privValues[o]=i;return}this.privKeys.push(n),this.privValues.push(i)}clone(){const r=new Z3;for(let i=0;i<this.privKeys.length;i++)r.privKeys.push(this.privKeys[i]),r.privValues.push(this.privValues[i]);return r}mergeTo(r){this.privKeys.forEach(i=>{if(r.getProperty(i,void 0)===void 0){const n=this.getProperty(i);r.setProperty(i,n)}})}get keys(){return this.privKeys}};return Hg.PropertyCollection=e,Hg}var YC={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyId=void 0,function(e){e[e.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",e[e.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",e[e.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",e[e.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",e[e.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",e[e.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",e[e.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",e[e.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",e[e.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",e[e.SpeechServiceConnection_TranslationCategoryId=9]="SpeechServiceConnection_TranslationCategoryId",e[e.SpeechServiceConnection_IntentRegion=10]="SpeechServiceConnection_IntentRegion",e[e.SpeechServiceConnection_ProxyHostName=11]="SpeechServiceConnection_ProxyHostName",e[e.SpeechServiceConnection_ProxyPort=12]="SpeechServiceConnection_ProxyPort",e[e.SpeechServiceConnection_ProxyUserName=13]="SpeechServiceConnection_ProxyUserName",e[e.SpeechServiceConnection_ProxyPassword=14]="SpeechServiceConnection_ProxyPassword",e[e.SpeechServiceConnection_RecoMode=15]="SpeechServiceConnection_RecoMode",e[e.SpeechServiceConnection_RecoLanguage=16]="SpeechServiceConnection_RecoLanguage",e[e.Speech_SessionId=17]="Speech_SessionId",e[e.SpeechServiceConnection_SynthLanguage=18]="SpeechServiceConnection_SynthLanguage",e[e.SpeechServiceConnection_SynthVoice=19]="SpeechServiceConnection_SynthVoice",e[e.SpeechServiceConnection_SynthOutputFormat=20]="SpeechServiceConnection_SynthOutputFormat",e[e.SpeechServiceConnection_AutoDetectSourceLanguages=21]="SpeechServiceConnection_AutoDetectSourceLanguages",e[e.SpeechServiceResponse_RequestDetailedResultTrueFalse=22]="SpeechServiceResponse_RequestDetailedResultTrueFalse",e[e.SpeechServiceResponse_RequestProfanityFilterTrueFalse=23]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",e[e.SpeechServiceResponse_JsonResult=24]="SpeechServiceResponse_JsonResult",e[e.SpeechServiceResponse_JsonErrorDetails=25]="SpeechServiceResponse_JsonErrorDetails",e[e.CancellationDetails_Reason=26]="CancellationDetails_Reason",e[e.CancellationDetails_ReasonText=27]="CancellationDetails_ReasonText",e[e.CancellationDetails_ReasonDetailedText=28]="CancellationDetails_ReasonDetailedText",e[e.LanguageUnderstandingServiceResponse_JsonResult=29]="LanguageUnderstandingServiceResponse_JsonResult",e[e.SpeechServiceConnection_Url=30]="SpeechServiceConnection_Url",e[e.SpeechServiceConnection_InitialSilenceTimeoutMs=31]="SpeechServiceConnection_InitialSilenceTimeoutMs",e[e.SpeechServiceConnection_EndSilenceTimeoutMs=32]="SpeechServiceConnection_EndSilenceTimeoutMs",e[e.Speech_SegmentationSilenceTimeoutMs=33]="Speech_SegmentationSilenceTimeoutMs",e[e.Speech_SegmentationMaximumTimeMs=34]="Speech_SegmentationMaximumTimeMs",e[e.Speech_SegmentationStrategy=35]="Speech_SegmentationStrategy",e[e.SpeechServiceConnection_EnableAudioLogging=36]="SpeechServiceConnection_EnableAudioLogging",e[e.SpeechServiceConnection_LanguageIdMode=37]="SpeechServiceConnection_LanguageIdMode",e[e.SpeechServiceConnection_RecognitionEndpointVersion=38]="SpeechServiceConnection_RecognitionEndpointVersion",e[e.SpeechServiceConnection_SpeakerIdMode=39]="SpeechServiceConnection_SpeakerIdMode",e[e.SpeechServiceResponse_ProfanityOption=40]="SpeechServiceResponse_ProfanityOption",e[e.SpeechServiceResponse_PostProcessingOption=41]="SpeechServiceResponse_PostProcessingOption",e[e.SpeechServiceResponse_RequestWordLevelTimestamps=42]="SpeechServiceResponse_RequestWordLevelTimestamps",e[e.SpeechServiceResponse_StablePartialResultThreshold=43]="SpeechServiceResponse_StablePartialResultThreshold",e[e.SpeechServiceResponse_OutputFormatOption=44]="SpeechServiceResponse_OutputFormatOption",e[e.SpeechServiceResponse_TranslationRequestStablePartialResult=45]="SpeechServiceResponse_TranslationRequestStablePartialResult",e[e.SpeechServiceResponse_RequestWordBoundary=46]="SpeechServiceResponse_RequestWordBoundary",e[e.SpeechServiceResponse_RequestPunctuationBoundary=47]="SpeechServiceResponse_RequestPunctuationBoundary",e[e.SpeechServiceResponse_RequestSentenceBoundary=48]="SpeechServiceResponse_RequestSentenceBoundary",e[e.SpeechServiceResponse_DiarizeIntermediateResults=49]="SpeechServiceResponse_DiarizeIntermediateResults",e[e.Conversation_ApplicationId=50]="Conversation_ApplicationId",e[e.Conversation_DialogType=51]="Conversation_DialogType",e[e.Conversation_Initial_Silence_Timeout=52]="Conversation_Initial_Silence_Timeout",e[e.Conversation_From_Id=53]="Conversation_From_Id",e[e.Conversation_Conversation_Id=54]="Conversation_Conversation_Id",e[e.Conversation_Custom_Voice_Deployment_Ids=55]="Conversation_Custom_Voice_Deployment_Ids",e[e.Conversation_Speech_Activity_Template=56]="Conversation_Speech_Activity_Template",e[e.Conversation_Request_Bot_Status_Messages=57]="Conversation_Request_Bot_Status_Messages",e[e.Conversation_Agent_Connection_Id=58]="Conversation_Agent_Connection_Id",e[e.SpeechServiceConnection_Host=59]="SpeechServiceConnection_Host",e[e.ConversationTranslator_Host=60]="ConversationTranslator_Host",e[e.ConversationTranslator_Name=61]="ConversationTranslator_Name",e[e.ConversationTranslator_CorrelationId=62]="ConversationTranslator_CorrelationId",e[e.ConversationTranslator_Token=63]="ConversationTranslator_Token",e[e.PronunciationAssessment_ReferenceText=64]="PronunciationAssessment_ReferenceText",e[e.PronunciationAssessment_GradingSystem=65]="PronunciationAssessment_GradingSystem",e[e.PronunciationAssessment_Granularity=66]="PronunciationAssessment_Granularity",e[e.PronunciationAssessment_EnableMiscue=67]="PronunciationAssessment_EnableMiscue",e[e.PronunciationAssessment_Json=68]="PronunciationAssessment_Json",e[e.PronunciationAssessment_Params=69]="PronunciationAssessment_Params",e[e.SpeakerRecognition_Api_Version=70]="SpeakerRecognition_Api_Version",e[e.WebWorkerLoadType=71]="WebWorkerLoadType",e[e.TalkingAvatarService_WebRTC_SDP=72]="TalkingAvatarService_WebRTC_SDP"}(t.PropertyId||(t.PropertyId={}))})(YC);var zg={},j2;function s_(){if(j2)return zg;j2=1,Object.defineProperty(zg,"__esModule",{value:!0}),zg.Recognizer=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class X3{constructor(o,s,a,c){this.audioConfig=o!==void 0?o:r.AudioConfig.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=s.clone(),this.privConnectionFactory=a,this.tokenCredential=c,this.implCommonRecognizerSetup()}close(o,s){A.Contracts.throwIfDisposed(this.privDisposed),(0,e.marshalPromiseToCallbacks)(this.dispose(!0),o,s)}get internalData(){return this.privReco}async dispose(o){this.privDisposed||(this.privDisposed=!0,o&&this.privReco&&(await this.privReco.audioSource.turnOff(),await this.privReco.dispose()))}static get telemetryEnabled(){return t.ServiceRecognizerBase.telemetryDataEnabled}static enableTelemetry(o){t.ServiceRecognizerBase.telemetryDataEnabled=o}implCommonRecognizerSetup(){let o=typeof window<"u"?"Browser":"Node",s="unknown",a="unknown";typeof navigator<"u"&&(o=o+"/"+navigator.platform,s=navigator.userAgent,a=navigator.appVersion);const c=this.createRecognizerConfig(new t.SpeechServiceConfig(new t.Context(new t.OS(o,s,a))));this.privReco=this.createServiceRecognizer(X3.getAuth(this.privProperties,this.tokenCredential),this.privConnectionFactory,this.audioConfig,c)}async recognizeOnceAsyncImpl(o){A.Contracts.throwIfDisposed(this.privDisposed);const s=new e.Deferred;await this.implRecognizerStop(),await this.privReco.recognize(o,s.resolve,s.reject);const a=await s.promise;return await this.implRecognizerStop(),a}async startContinuousRecognitionAsyncImpl(o){A.Contracts.throwIfDisposed(this.privDisposed),await this.implRecognizerStop(),await this.privReco.recognize(o,void 0,void 0)}async stopContinuousRecognitionAsyncImpl(){A.Contracts.throwIfDisposed(this.privDisposed),await this.implRecognizerStop()}async implRecognizerStop(){this.privReco&&await this.privReco.stopRecognizing()}static getAuth(o,s){const a=o.getProperty(r.PropertyId.SpeechServiceConnection_Key,void 0);return a&&a!==""?new t.CognitiveSubscriptionKeyAuthentication(a):s?new t.CognitiveTokenAuthentication(async()=>{try{const c=await s.getToken("https://cognitiveservices.azure.com/.default");return(c==null?void 0:c.token)??""}catch(c){throw c}},async()=>{try{const c=await s.getToken("https://cognitiveservices.azure.com/.default");return(c==null?void 0:c.token)??""}catch(c){throw c}}):new t.CognitiveTokenAuthentication(()=>{const c=o.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(c)},()=>{const c=o.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(c)})}};return zg.Recognizer=i,zg}var Jg={},vn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionMode=void 0,function(e){e.Interactive="Interactive",e.Dictation="Dictation",e.Conversation="Conversation",e.None="None"}(t.RecognitionMode||(t.RecognitionMode={}))})(vn);var Y2;function o_(){if(Y2)return Jg;Y2=1,Object.defineProperty(Jg,"__esModule",{value:!0}),Jg.SpeechRecognizer=void 0;const t=ut(),e=vn,A=Mt(),r=Ut,i=Ve();let n=class _3 extends i.Recognizer{constructor(s,a){const c=s;r.Contracts.throwIfNull(c,"speechConfig"),r.Contracts.throwIfNullOrWhitespace(c.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage]),super(a,c.properties,new t.SpeechConnectionFactory,s.tokenCredential),this.privDisposedRecognizer=!1}static FromConfig(s,a,c){const u=s;return a.properties.mergeTo(u.properties),new _3(s,c)}get endpointId(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){r.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,s)}get speechRecognitionLanguage(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(t.OutputFormatPropertyName,i.OutputFormat[i.OutputFormat.Simple])===i.OutputFormat[i.OutputFormat.Simple]?i.OutputFormat.Simple:i.OutputFormat.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(e.RecognitionMode.Interactive),s,a)}startContinuousRecognitionAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),s,a)}stopContinuousRecognitionAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}startKeywordRecognitionAsync(s,a,c){r.Contracts.throwIfNull(s,"model"),c&&c("Not yet implemented.")}stopKeywordRecognitionAsync(s){s&&s()}close(s,a){r.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}async dispose(s){this.privDisposedRecognizer||(s&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(s))}createRecognizerConfig(s){return new t.RecognizerConfig(s,this.privProperties)}createServiceRecognizer(s,a,c,u){const l=c;return new t.SpeechServiceRecognizer(s,a,l,u,this)}};return Jg.SpeechRecognizer=n,Jg}var qg={},H2;function a_(){if(H2)return qg;H2=1,Object.defineProperty(qg,"__esModule",{value:!0}),qg.IntentRecognizer=void 0;const t=ut(),e=vn,A=Mt(),r=Ut,i=Ve();let n=class extends i.Recognizer{constructor(s,a){r.Contracts.throwIfNullOrUndefined(s,"speechConfig");const c=s;r.Contracts.throwIfNullOrUndefined(c,"speechConfig"),super(a,c.properties,new t.IntentConnectionFactory),this.privAddedIntents=[],this.privAddedLmIntents={},this.privDisposedIntentRecognizer=!1,this.privProperties=c.properties,r.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage])}get speechRecognitionLanguage(){return r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,s)}get properties(){return this.privProperties}recognizeOnceAsync(s,a){if(r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),Object.keys(this.privAddedLmIntents).length!==0||this.privUmbrellaIntent!==void 0){const c=this.buildSpeechContext();this.privReco.speechContext.getContext().intent=c.Intent,this.privReco.dynamicGrammar.addReferenceGrammar(c.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}(0,A.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(e.RecognitionMode.Interactive),s,a)}startContinuousRecognitionAsync(s,a){if(Object.keys(this.privAddedLmIntents).length!==0||this.privUmbrellaIntent!==void 0){const c=this.buildSpeechContext();this.privReco.speechContext.getContext().intent=c.Intent,this.privReco.dynamicGrammar.addReferenceGrammar(c.ReferenceGrammars),this.privReco.setIntents(this.privAddedLmIntents,this.privUmbrellaIntent)}(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),s,a)}stopContinuousRecognitionAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}startKeywordRecognitionAsync(s,a,c){r.Contracts.throwIfNull(s,"model"),c&&c("Not yet implemented.")}stopKeywordRecognitionAsync(s,a){if(s)try{s()}catch(c){a&&a(c)}}addIntent(s,a){r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),r.Contracts.throwIfNullOrWhitespace(a,"intentId"),r.Contracts.throwIfNullOrWhitespace(s,"simplePhrase"),this.privAddedIntents.push([a,s])}addIntentWithLanguageModel(s,a,c){r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),r.Contracts.throwIfNullOrWhitespace(s,"intentId"),r.Contracts.throwIfNull(a,"model");const u=a;r.Contracts.throwIfNullOrWhitespace(u.appId,"model.appId"),this.privAddedLmIntents[s]=new t.AddedLmIntent(u,c)}addAllIntents(s,a){r.Contracts.throwIfNull(s,"model");const c=s;r.Contracts.throwIfNullOrWhitespace(c.appId,"model.appId"),this.privUmbrellaIntent=new t.AddedLmIntent(c,a)}close(s,a){r.Contracts.throwIfDisposed(this.privDisposedIntentRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}createRecognizerConfig(s){return new t.RecognizerConfig(s,this.privProperties)}createServiceRecognizer(s,a,c,u){const l=c;return new t.IntentServiceRecognizer(s,a,l,u,this)}async dispose(s){this.privDisposedIntentRecognizer||s&&(this.privDisposedIntentRecognizer=!0,await super.dispose(s))}buildSpeechContext(){let s,a,c;const u=[];this.privUmbrellaIntent!==void 0&&(s=this.privUmbrellaIntent.modelImpl.appId,a=this.privUmbrellaIntent.modelImpl.region,c=this.privUmbrellaIntent.modelImpl.subscriptionKey);for(const l of Object.keys(this.privAddedLmIntents)){const g=this.privAddedLmIntents[l];if(s===void 0)s=g.modelImpl.appId;else if(s!==g.modelImpl.appId)throw new Error("Intents must all be from the same LUIS model");if(a===void 0)a=g.modelImpl.region;else if(a!==g.modelImpl.region)throw new Error("Intents must all be from the same LUIS model in a single region");if(c===void 0)c=g.modelImpl.subscriptionKey;else if(c!==g.modelImpl.subscriptionKey)throw new Error("Intents must all use the same subscription key");const h="luis/"+s+"-PRODUCTION#"+l;u.push(h)}return{Intent:{id:s,key:c===void 0?this.privProperties.getProperty(i.PropertyId[i.PropertyId.SpeechServiceConnection_Key]):c,provider:"LUIS"},ReferenceGrammars:this.privUmbrellaIntent===void 0?u:["luis/"+s+"-PRODUCTION"]}}};return qg.IntentRecognizer=n,qg}var z2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceProfileType=void 0,function(e){e[e.TextIndependentIdentification=0]="TextIndependentIdentification",e[e.TextDependentVerification=1]="TextDependentVerification",e[e.TextIndependentVerification=2]="TextIndependentVerification"}(t.VoiceProfileType||(t.VoiceProfileType={}))})(z2);var Vg={},Wg={},kc={},J2;function q2(){if(J2)return kc;J2=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.ConnectionMessageImpl=kc.ConnectionMessage=void 0;const t=Wr,e=Mt(),A=G2(),r=YC;let i=class{};kc.ConnectionMessage=i;class n{constructor(s){this.privConnectionMessage=s,this.privProperties=new A.PropertyCollection,this.privConnectionMessage.headers[t.HeaderNames.ConnectionId]&&this.privProperties.setProperty(r.PropertyId.Speech_SessionId,this.privConnectionMessage.headers[t.HeaderNames.ConnectionId]),Object.keys(this.privConnectionMessage.headers).forEach(a=>{this.privProperties.setProperty(a,this.privConnectionMessage.headers[a])})}get path(){return this.privConnectionMessage.headers[Object.keys(this.privConnectionMessage.headers).find(s=>s.toLowerCase()==="path".toLowerCase())]}get isTextMessage(){return this.privConnectionMessage.messageType===e.MessageType.Text}get isBinaryMessage(){return this.privConnectionMessage.messageType===e.MessageType.Binary}get TextMessage(){return this.privConnectionMessage.textBody}get binaryMessage(){return this.privConnectionMessage.binaryBody}get properties(){return this.privProperties}toString(){return""}}return kc.ConnectionMessageImpl=n,kc}var V2;function W2(){if(V2)return Wg;V2=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.Connection=void 0;const t=ut(),e=Mt(),A=q2(),r=Ut,i=Ve();let n=class uR{static fromRecognizer(s){const a=s.internalData,c=new uR;return c.privInternalData=a,c.setupEvents(),c}static fromSynthesizer(s){const a=s.internalData,c=new uR;return c.privInternalData=a,c.setupEvents(),c}openConnection(s,a){(0,e.marshalPromiseToCallbacks)(this.privInternalData.connect(),s,a)}closeConnection(s,a){if(this.privInternalData instanceof t.SynthesisAdapterBase)throw new Error("Disconnecting a synthesizer's connection is currently not supported");(0,e.marshalPromiseToCallbacks)(this.privInternalData.disconnect(),s,a)}setMessageProperty(s,a,c){if(r.Contracts.throwIfNullOrWhitespace(a,"propertyName"),this.privInternalData instanceof t.ServiceRecognizerBase){if(s.toLowerCase()!=="speech.context")throw new Error("Only speech.context message property sets are currently supported for recognizer");{const u=this.privInternalData.speechContext.getContext();u[a]=c}}else if(this.privInternalData instanceof t.SynthesisAdapterBase){if(s.toLowerCase()!=="synthesis.context")throw new Error("Only synthesis.context message property sets are currently supported for synthesizer");this.privInternalData.synthesisContext.setSection(a,c)}}sendMessageAsync(s,a,c,u){(0,e.marshalPromiseToCallbacks)(this.privInternalData.sendNetworkMessage(s,a),c,u)}close(){}setupEvents(){this.privEventListener=this.privInternalData.connectionEvents.attach(s=>{s.name==="ConnectionEstablishedEvent"?this.connected&&this.connected(new i.ConnectionEventArgs(s.connectionId)):s.name==="ConnectionClosedEvent"?this.disconnected&&this.disconnected(new i.ConnectionEventArgs(s.connectionId)):s.name==="ConnectionMessageSentEvent"?this.messageSent&&this.messageSent(new i.ConnectionMessageEventArgs(new A.ConnectionMessageImpl(s.message))):s.name==="ConnectionMessageReceivedEvent"&&this.messageReceived&&this.messageReceived(new i.ConnectionMessageEventArgs(new A.ConnectionMessageImpl(s.message)))}),this.privServiceEventListener=this.privInternalData.serviceEvents.attach(s=>{this.receivedServiceMessage&&this.receivedServiceMessage(new i.ServiceEventArgs(s.jsonString,s.name))})}};return Wg.Connection=n,Wg}var Z2;function c_(){if(Z2)return Vg;Z2=1,Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.TranslationRecognizer=void 0;const t=ut(),e=vn,A=Mt(),r=W2(),i=Ut,n=Ve();let o=class $3 extends n.Recognizer{constructor(a,c,u){const l=a;i.Contracts.throwIfNull(l,"speechConfig"),super(c,l.properties,u||new t.TranslationConnectionFactory,a.tokenCredential),this.privDisposedTranslationRecognizer=!1,this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)!==void 0&&i.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationVoice),n.PropertyId[n.PropertyId.SpeechServiceConnection_TranslationVoice]),i.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages),n.PropertyId[n.PropertyId.SpeechServiceConnection_TranslationToLanguages]),i.Contracts.throwIfNullOrWhitespace(this.properties.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage),n.PropertyId[n.PropertyId.SpeechServiceConnection_RecoLanguage])}static FromConfig(a,c,u){const l=a;return c.properties.mergeTo(l.properties),c.properties.getProperty(n.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)===t.AutoDetectSourceLanguagesOpenRangeOptionName&&l.properties.setProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),new $3(a,u)}get speechRecognitionLanguage(){return i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_RecoLanguage)}get targetLanguages(){return i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(",")}get voiceName(){return i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(n.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(a){this.properties.setProperty(n.PropertyId.SpeechServiceAuthorization_Token,a)}recognizeOnceAsync(a,c){i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),(0,A.marshalPromiseToCallbacks)(this.recognizeOnceAsyncImpl(e.RecognitionMode.Interactive),a,c)}startContinuousRecognitionAsync(a,c){(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),a,c)}stopContinuousRecognitionAsync(a,c){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),a,c)}removeTargetLanguage(a){if(i.Contracts.throwIfNullOrUndefined(a,"language to be removed"),this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0){const c=this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","),u=c.indexOf(a);u>-1&&(c.splice(u,1),this.properties.setProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,c.join(",")),this.updateLanguages(c))}}addTargetLanguage(a){i.Contracts.throwIfNullOrUndefined(a,"language to be added");let c=[];this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0?(c=this.properties.getProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages).split(","),c.includes(a)||(c.push(a),this.properties.setProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,c.join(",")))):(this.properties.setProperty(n.PropertyId.SpeechServiceConnection_TranslationToLanguages,a),c=[a]),this.updateLanguages(c)}close(a,c){i.Contracts.throwIfDisposed(this.privDisposedTranslationRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),a,c)}onConnection(){}async dispose(a){this.privDisposedTranslationRecognizer||(this.privDisposedTranslationRecognizer=!0,a&&(await this.implRecognizerStop(),await super.dispose(a)))}createRecognizerConfig(a){return new t.RecognizerConfig(a,this.privProperties)}createServiceRecognizer(a,c,u,l){const g=u;return new t.TranslationServiceRecognizer(a,c,g,l,this)}updateLanguages(a){const c=r.Connection.fromRecognizer(this);c&&(c.setMessageProperty("speech.context","translationcontext",{to:a}),c.sendMessageAsync("event",JSON.stringify({id:"translation",name:"updateLanguage",to:a})))}};return Vg.TranslationRecognizer=o,Vg}var Zg={},X2;function u_(){if(X2)return Zg;X2=1,Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.Translations=void 0;const t=Ve();let e=class{constructor(){this.privMap=new t.PropertyCollection}get languages(){return this.privMap.keys}get(r,i){return this.privMap.getProperty(r,i)}set(r,i){this.privMap.setProperty(r,i)}};return Zg.Translations=e,Zg}var _2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NoMatchReason=void 0,function(e){e[e.NotRecognized=0]="NotRecognized",e[e.InitialSilenceTimeout=1]="InitialSilenceTimeout",e[e.InitialBabbleTimeout=2]="InitialBabbleTimeout"}(t.NoMatchReason||(t.NoMatchReason={}))})(_2);var Xg={},$2;function l_(){if($2)return Xg;$2=1,Object.defineProperty(Xg,"__esModule",{value:!0}),Xg.NoMatchDetails=void 0;const t=ut(),e=Ve();let A=class ej{constructor(i){this.privReason=i}static fromResult(i){const n=t.SimpleSpeechPhrase.fromJSON(i.json,0);let o=e.NoMatchReason.NotRecognized;switch(n.RecognitionStatus){case t.RecognitionStatus.BabbleTimeout:o=e.NoMatchReason.InitialBabbleTimeout;break;case t.RecognitionStatus.InitialSilenceTimeout:o=e.NoMatchReason.InitialSilenceTimeout;break;default:o=e.NoMatchReason.NotRecognized;break}return new ej(o)}get reason(){return this.privReason}};return Xg.NoMatchDetails=A,Xg}var HC={};Object.defineProperty(HC,"__esModule",{value:!0}),HC.TranslationRecognitionCanceledEventArgs=void 0;class h_{constructor(e,A,r,i,n){this.privCancelReason=A,this.privErrorDetails=r,this.privResult=n,this.privSessionId=e,this.privErrorCode=i}get result(){return this.privResult}get sessionId(){return this.privSessionId}get reason(){return this.privCancelReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}HC.TranslationRecognitionCanceledEventArgs=h_;var _g={},eU;function g_(){if(eU)return _g;eU=1,Object.defineProperty(_g,"__esModule",{value:!0}),_g.IntentRecognitionCanceledEventArgs=void 0;const t=Ve();let e=class extends t.IntentRecognitionEventArgs{constructor(r,i,n,o,s,a){super(o,s,a),this.privReason=r,this.privErrorDetails=i,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}};return _g.IntentRecognitionCanceledEventArgs=e,_g}var $g={};Object.defineProperty($g,"__esModule",{value:!0}),$g.CancellationDetailsBase=void 0;class d_{constructor(e,A,r){this.privReason=e,this.privErrorDetails=A,this.privErrorCode=r}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get ErrorCode(){return this.privErrorCode}}$g.CancellationDetailsBase=d_;var ed={},tU;function p_(){if(tU)return ed;tU=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.CancellationDetails=void 0;const t=ut(),e=$g,A=Ve();let r=class tj extends e.CancellationDetailsBase{constructor(n,o,s){super(n,o,s)}static fromResult(n){let o=A.CancellationReason.Error,s=A.CancellationErrorCode.NoError;if(n instanceof A.RecognitionResult&&n.json){const a=t.SimpleSpeechPhrase.fromJSON(n.json,0);o=t.EnumTranslation.implTranslateCancelResult(a.RecognitionStatus)}return n.properties&&(s=A.CancellationErrorCode[n.properties.getProperty(t.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.NoError])]),new tj(o,n.errorDetails||t.EnumTranslation.implTranslateErrorDetails(s),s)}};return ed.CancellationDetails=r,ed}var AU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationErrorCode=void 0,function(e){e[e.NoError=0]="NoError",e[e.AuthenticationFailure=1]="AuthenticationFailure",e[e.BadRequestParameters=2]="BadRequestParameters",e[e.TooManyRequests=3]="TooManyRequests",e[e.ConnectionFailure=4]="ConnectionFailure",e[e.ServiceTimeout=5]="ServiceTimeout",e[e.ServiceError=6]="ServiceError",e[e.RuntimeError=7]="RuntimeError",e[e.Forbidden=8]="Forbidden"}(t.CancellationErrorCode||(t.CancellationErrorCode={}))})(AU);var td={},rU;function f_(){if(rU)return td;rU=1,Object.defineProperty(td,"__esModule",{value:!0}),td.ConnectionEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{};return td.ConnectionEventArgs=e,td}var Ad={},iU;function E_(){if(iU)return Ad;iU=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.ServiceEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i,n){super(n),this.privJsonResult=r,this.privEventName=i}get jsonString(){return this.privJsonResult}get eventName(){return this.privEventName}};return Ad.ServiceEventArgs=e,Ad}var zC={};Object.defineProperty(zC,"__esModule",{value:!0}),zC.PhraseListGrammar=void 0;class S0{constructor(e){this.privGrammerBuilder=e.dynamicGrammar}static fromRecognizer(e){const A=e.internalData;return new S0(A)}addPhrase(e){this.privGrammerBuilder.addPhrase(e)}addPhrases(e){this.privGrammerBuilder.addPhrase(e)}clear(){this.privGrammerBuilder.clearPhrases()}}zC.PhraseListGrammar=S0;var Pc={},nU;function m0(){if(nU)return Pc;nU=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.DialogServiceConfigImpl=Pc.DialogServiceConfig=void 0;const t=Ut,e=Ve();let A=class{constructor(){}set applicationId(n){}static get DialogTypes(){return{BotFramework:"bot_framework",CustomCommands:"custom_commands"}}};Pc.DialogServiceConfig=A;class r extends A{constructor(){super(),this.privSpeechConfig=new e.SpeechConfigImpl}get properties(){return this.privSpeechConfig.properties}get speechRecognitionLanguage(){return this.privSpeechConfig.speechRecognitionLanguage}set speechRecognitionLanguage(n){t.Contracts.throwIfNullOrWhitespace(n,"value"),this.privSpeechConfig.speechRecognitionLanguage=n}get outputFormat(){return this.privSpeechConfig.outputFormat}set outputFormat(n){this.privSpeechConfig.outputFormat=n}setProperty(n,o){this.privSpeechConfig.setProperty(n,o)}getProperty(n,o){return this.privSpeechConfig.getProperty(n)}setProxy(n,o,s,a){this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyHostName,n),this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyPort,`${o}`),s&&this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyUserName,s),a&&this.setProperty(e.PropertyId.SpeechServiceConnection_ProxyPassword,a)}setServiceProperty(n,o,s){this.privSpeechConfig.setServiceProperty(n,o)}close(){}}return Pc.DialogServiceConfigImpl=r,Pc}var rd={},sU;function C_(){if(sU)return rd;sU=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.BotFrameworkConfig=void 0;const t=Ut,e=m0(),A=Ve();let r=class extends e.DialogServiceConfigImpl{constructor(){super()}static fromSubscription(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"subscription"),t.Contracts.throwIfNullOrWhitespace(o,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),a.setProperty(A.PropertyId.SpeechServiceConnection_Key,n),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,o),s&&a.setProperty(A.PropertyId.Conversation_ApplicationId,s),a}static fromAuthorizationToken(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"authorizationToken"),t.Contracts.throwIfNullOrWhitespace(o,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),a.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,n),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,o),s&&a.setProperty(A.PropertyId.Conversation_ApplicationId,s),a}static fromHost(n,o,s){t.Contracts.throwIfNullOrUndefined(n,"host");const a=n instanceof URL?n:new URL(`wss://${n}.convai.speech.azure.us`);t.Contracts.throwIfNullOrUndefined(a,"resolvedHost");const c=new e.DialogServiceConfigImpl;return c.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),c.setProperty(A.PropertyId.SpeechServiceConnection_Host,a.toString()),o!==void 0&&c.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),c}static fromEndpoint(n,o){t.Contracts.throwIfNull(n,"endpoint");const s=new e.DialogServiceConfigImpl;return s.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.BotFramework),s.setProperty(A.PropertyId.SpeechServiceConnection_Endpoint,n.toString()),o!==void 0&&s.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),s}};return rd.BotFrameworkConfig=r,rd}var id={},oU;function I_(){if(oU)return id;oU=1,Object.defineProperty(id,"__esModule",{value:!0}),id.CustomCommandsConfig=void 0;const t=Ut,e=m0(),A=Ve();let r=class extends e.DialogServiceConfigImpl{constructor(){super()}static fromSubscription(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"applicationId"),t.Contracts.throwIfNullOrWhitespace(o,"subscription"),t.Contracts.throwIfNullOrWhitespace(s,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.CustomCommands),a.setProperty(A.PropertyId.Conversation_ApplicationId,n),a.setProperty(A.PropertyId.SpeechServiceConnection_Key,o),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}static fromAuthorizationToken(n,o,s){t.Contracts.throwIfNullOrWhitespace(n,"applicationId"),t.Contracts.throwIfNullOrWhitespace(o,"authorizationToken"),t.Contracts.throwIfNullOrWhitespace(s,"region");const a=new e.DialogServiceConfigImpl;return a.setProperty(A.PropertyId.Conversation_DialogType,e.DialogServiceConfig.DialogTypes.CustomCommands),a.setProperty(A.PropertyId.Conversation_ApplicationId,n),a.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,o),a.setProperty(A.PropertyId.SpeechServiceConnection_Region,s),a}set applicationId(n){t.Contracts.throwIfNullOrWhitespace(n,"value"),this.setProperty(A.PropertyId.Conversation_ApplicationId,n)}get applicationId(){return this.getProperty(A.PropertyId.Conversation_ApplicationId)}};return id.CustomCommandsConfig=r,id}var nd={},sd={},od={},ds={};Object.defineProperty(ds,"__esModule",{value:!0}),ds.QueryParameterNames=void 0;class JA{}ds.QueryParameterNames=JA,JA.BotId="botid",JA.CustomSpeechDeploymentId="cid",JA.CustomVoiceDeploymentId="deploymentId",JA.EnableAudioLogging="storeAudio",JA.EnableLanguageId="lidEnabled",JA.EnableWordLevelTimestamps="wordLevelTimestamps",JA.EndSilenceTimeoutMs="endSilenceTimeoutMs",JA.SegmentationSilenceTimeoutMs="segmentationSilenceTimeoutMs",JA.SegmentationMaximumTimeMs="segmentationMaximumTimeMs",JA.SegmentationStrategy="segmentationStrategy",JA.Format="format",JA.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",JA.Language="language",JA.Profanity="profanity",JA.RequestBotStatusMessages="enableBotMessageStatus",JA.StableIntermediateThreshold="stableIntermediateThreshold",JA.StableTranslation="stableTranslation",JA.TestHooks="testhooks",JA.Postprocessing="postprocessing",JA.CtsMeetingId="meetingId",JA.CtsDeviceId="deviceId",JA.CtsIsParticipant="isParticipant",JA.EnableAvatar="enableTalkingAvatar";var aU;function ps(){if(aU)return od;aU=1,Object.defineProperty(od,"__esModule",{value:!0}),od.ConnectionFactoryBase=void 0;const t=ut(),e=Mt(),A=Ve(),r=ds;let i=class{static getHostSuffix(o){if(o){if(o.toLowerCase().startsWith("china"))return".azure.cn";if(o.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(o,s,a){new Map([[A.PropertyId.Speech_SegmentationSilenceTimeoutMs,r.QueryParameterNames.SegmentationSilenceTimeoutMs],[A.PropertyId.SpeechServiceConnection_EnableAudioLogging,r.QueryParameterNames.EnableAudioLogging],[A.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,r.QueryParameterNames.EndSilenceTimeoutMs],[A.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,r.QueryParameterNames.InitialSilenceTimeoutMs],[A.PropertyId.SpeechServiceResponse_PostProcessingOption,r.QueryParameterNames.Postprocessing],[A.PropertyId.SpeechServiceResponse_ProfanityOption,r.QueryParameterNames.Profanity],[A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,r.QueryParameterNames.EnableWordLevelTimestamps],[A.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,r.QueryParameterNames.StableIntermediateThreshold]]).forEach((l,g)=>{this.setUrlParameter(g,l,o,s,a)});const u=JSON.parse(o.parameters.getProperty(t.ServicePropertiesPropertyName,"{}"));Object.keys(u).forEach(l=>{s[l]=u[l]})}setUrlParameter(o,s,a,c,u){const l=a.parameters.getProperty(o,void 0);l&&(!u||u.search(s)===-1)&&(c[s]=l.toLocaleLowerCase())}static async getRedirectUrlFromEndpoint(o){let s;if(typeof window<"u"&&typeof window.fetch<"u"){const a=new URL(o);a.protocol="https:",a.port="443",a.searchParams.append("GenerateRedirectResponse","true");const u=a.toString();e.Events.instance.onEvent(new e.ConnectionRedirectEvent("",u,void 0,"ConnectionFactoryBase: redirectUrl request"));const l=await fetch(u);if(l.status!==200)return o;s=await l.text()}else s=o;e.Events.instance.onEvent(new e.ConnectionRedirectEvent("",s,o,"ConnectionFactoryBase: redirectUrlString"));try{return new URL(s.trim()).toString()}catch{return o}}};return od.ConnectionFactoryBase=i,od}var cU;function B_(){if(cU)return sd;cU=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.DialogConnectionFactory=void 0;const t=Zr(),e=ut(),A=Ve(),r=ps(),i=ut(),n=Wr,o=ds;class s extends r.ConnectionFactoryBase{create(c,u,l){const g=c.parameters.getProperty(A.PropertyId.Conversation_ApplicationId,""),h=c.parameters.getProperty(A.PropertyId.Conversation_DialogType),p=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Region),C=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),I=c.parameters.getProperty(A.PropertyId.Conversation_Request_Bot_Status_Messages,"true"),E={};E[n.HeaderNames.ConnectionId]=l,E[o.QueryParameterNames.Format]=c.parameters.getProperty(e.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Simple]).toLowerCase(),E[o.QueryParameterNames.Language]=C,E[o.QueryParameterNames.RequestBotStatusMessages]=I,g&&(E[o.QueryParameterNames.BotId]=g,h===A.DialogServiceConfig.DialogTypes.CustomCommands&&(E[n.HeaderNames.CustomCommandsAppId]=g));const v=h===A.DialogServiceConfig.DialogTypes.CustomCommands?"commands/":"",m=h===A.DialogServiceConfig.DialogTypes.CustomCommands?"v1":h===A.DialogServiceConfig.DialogTypes.BotFramework?"v3":"v0",M={};u.token!=null&&u.token!==""&&(M[u.headerName]=u.token);let O=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint,"");if(!O){const P=r.ConnectionFactoryBase.getHostSuffix(p),D=c.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Host,`wss://${p}.${s.BaseUrl}${P}`);O=`${D.endsWith("/")?D:D+"/"}${v}${s.ApiKey}/${m}`}this.setCommonUrlParams(c,E,O);const x=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(O,E,M,new i.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(c),x,l))}}return sd.DialogConnectionFactory=s,s.ApiKey="api",s.BaseUrl="convai.speech",sd}var uU;function v_(){if(uU)return nd;uU=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.DialogServiceConnector=void 0;const t=B_(),e=ut(),A=vn,r=Mt(),i=Ut,n=Ve(),o=YC;let s=class extends n.Recognizer{constructor(c,u){const l=c;i.Contracts.throwIfNull(c,"dialogConfig"),super(u,l.properties,new t.DialogConnectionFactory),this.isTurnComplete=!0,this.privIsDisposed=!1,this.privProperties=l.properties.clone();const g=this.buildAgentConfig();this.privReco.agentConfig.set(g)}connect(c,u){(0,r.marshalPromiseToCallbacks)(this.privReco.connect(),c,u)}disconnect(c,u){(0,r.marshalPromiseToCallbacks)(this.privReco.disconnect(),c,u)}get authorizationToken(){return this.properties.getProperty(o.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(c){i.Contracts.throwIfNullOrWhitespace(c,"token"),this.properties.setProperty(o.PropertyId.SpeechServiceAuthorization_Token,c)}get properties(){return this.privProperties}get speechActivityTemplate(){return this.properties.getProperty(o.PropertyId.Conversation_Speech_Activity_Template)}set speechActivityTemplate(c){this.properties.setProperty(o.PropertyId.Conversation_Speech_Activity_Template,c)}listenOnceAsync(c,u){if(this.isTurnComplete){i.Contracts.throwIfDisposed(this.privIsDisposed);const g=(async()=>{await this.privReco.connect(),await this.implRecognizerStop(),this.isTurnComplete=!1;const h=new r.Deferred;await this.privReco.recognize(A.RecognitionMode.Conversation,h.resolve,h.reject);const p=await h.promise;return await this.implRecognizerStop(),p})();g.catch(()=>{this.dispose(!0).catch(()=>{})}),(0,r.marshalPromiseToCallbacks)(g.finally(()=>{this.isTurnComplete=!0}),c,u)}}sendActivityAsync(c,u,l){(0,r.marshalPromiseToCallbacks)(this.privReco.sendMessage(c),u,l)}close(c,u){i.Contracts.throwIfDisposed(this.privIsDisposed),(0,r.marshalPromiseToCallbacks)(this.dispose(!0),c,u)}async dispose(c){this.privIsDisposed||c&&(this.privIsDisposed=!0,await this.implRecognizerStop(),await super.dispose(c))}createRecognizerConfig(c){return new e.RecognizerConfig(c,this.privProperties)}createServiceRecognizer(c,u,l,g){const h=l;return new e.DialogServiceAdapter(c,u,h,g,this)}buildAgentConfig(){return{botInfo:{commType:this.properties.getProperty("Conversation_Communication_Type","Default"),commandsCulture:void 0,connectionId:this.properties.getProperty(o.PropertyId.Conversation_Agent_Connection_Id),conversationId:this.properties.getProperty(o.PropertyId.Conversation_Conversation_Id,void 0),fromId:this.properties.getProperty(o.PropertyId.Conversation_From_Id,void 0),ttsAudioFormat:this.properties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)},version:.2}}};return nd.DialogServiceConnector=s,nd}var JC={};Object.defineProperty(JC,"__esModule",{value:!0}),JC.ActivityReceivedEventArgs=void 0;class w_{constructor(e,A){this.privActivity=e,this.privAudioStream=A}get activity(){return this.privActivity}get audioStream(){return this.privAudioStream}}JC.ActivityReceivedEventArgs=w_;var qC={},VC={};Object.defineProperty(VC,"__esModule",{value:!0}),VC.TurnStatusResponsePayload=void 0;class M0{constructor(e){this.privMessageStatusResponse=JSON.parse(e)}static fromJSON(e){return new M0(e)}get interactionId(){return this.privMessageStatusResponse.interactionId}get conversationId(){return this.privMessageStatusResponse.conversationId}get statusCode(){switch(this.privMessageStatusResponse.statusCode){case"Success":return 200;case"Failed":return 400;case"TimedOut":return 429;default:return this.privMessageStatusResponse.statusCode}}}VC.TurnStatusResponsePayload=M0,Object.defineProperty(qC,"__esModule",{value:!0}),qC.TurnStatusReceivedEventArgs=void 0;const S_=VC;class m_{constructor(e){this.privTurnStatus=S_.TurnStatusResponsePayload.fromJSON(e)}get interactionId(){return this.privTurnStatus.interactionId}get conversationId(){return this.privTurnStatus.conversationId}get statusCode(){return this.privTurnStatus.statusCode}}qC.TurnStatusReceivedEventArgs=m_;var lU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ServicePropertyChannel=void 0,function(e){e[e.UriQueryParameter=0]="UriQueryParameter"}(t.ServicePropertyChannel||(t.ServicePropertyChannel={}))})(lU);var hU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProfanityOption=void 0,function(e){e[e.Masked=0]="Masked",e[e.Removed=1]="Removed",e[e.Raw=2]="Raw"}(t.ProfanityOption||(t.ProfanityOption={}))})(hU);var ad={},gU;function M_(){if(gU)return ad;gU=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.BaseAudioPlayer=void 0;const t=ai,e=Ve(),A=ya;let r=class{constructor(n){this.audioContext=null,this.gainNode=null,this.autoUpdateBufferTimer=0,n===void 0&&(n=e.AudioStreamFormat.getDefaultInputFormat()),this.init(n)}playAudioSample(n,o,s){try{this.ensureInitializedContext();const a=this.formatAudioData(n),c=new Float32Array(this.samples.length+a.length);c.set(this.samples,0),c.set(a,this.samples.length),this.samples=c,o&&o()}catch(a){s&&s(a)}}stopAudio(n,o){this.audioContext!==null&&(this.samples=new Float32Array,clearInterval(this.autoUpdateBufferTimer),this.audioContext.close().then(()=>{n&&n()},s=>{o&&o(s)}),this.audioContext=null)}init(n){this.audioFormat=n,this.samples=new Float32Array}ensureInitializedContext(){if(this.audioContext===null){this.createAudioContext();const n=200;this.autoUpdateBufferTimer=setInterval(()=>{this.updateAudioBuffer()},n)}}createAudioContext(){this.audioContext=A.AudioStreamFormatImpl.getAudioContext(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),this.startTime=this.audioContext.currentTime}formatAudioData(n){switch(this.audioFormat.bitsPerSample){case 8:return this.formatArrayBuffer(new Int8Array(n),128);case 16:return this.formatArrayBuffer(new Int16Array(n),32768);case 32:return this.formatArrayBuffer(new Int32Array(n),2147483648);default:throw new t.InvalidOperationError("Only WAVE_FORMAT_PCM (8/16/32 bps) format supported at this time")}}formatArrayBuffer(n,o){const s=new Float32Array(n.length);for(let a=0;a<n.length;a++)s[a]=n[a]/o;return s}updateAudioBuffer(){if(this.samples.length===0)return;const n=this.audioFormat.channels,o=this.audioContext.createBufferSource(),s=this.samples.length/n,a=this.audioContext.createBuffer(n,s,this.audioFormat.samplesPerSec);for(let c=0;c<n;c++){let u=c;const l=a.getChannelData(c);for(let g=0;g<this.samples.length;g++,u+=n)l[g]=this.samples[u]}this.startTime<this.audioContext.currentTime&&(this.startTime=this.audioContext.currentTime),o.buffer=a,o.connect(this.gainNode),o.start(this.startTime),this.startTime+=a.duration,this.samples=new Float32Array}async playAudio(n){this.audioContext===null&&this.createAudioContext();const o=this.audioContext.createBufferSource(),s=this.audioContext.destination;await this.audioContext.decodeAudioData(n,a=>{o.buffer=a,o.connect(s),o.start(0)})}};return ad.BaseAudioPlayer=r,ad}var WC={};Object.defineProperty(WC,"__esModule",{value:!0}),WC.ConnectionMessageEventArgs=void 0;class y_{constructor(e){this.privConnectionMessage=e}get message(){return this.privConnectionMessage}toString(){return"Message: "+this.privConnectionMessage.toString()}}WC.ConnectionMessageEventArgs=y_;var ZC={};Object.defineProperty(ZC,"__esModule",{value:!0}),ZC.VoiceProfile=void 0;class Q_{constructor(e,A){this.privId=e,this.privProfileType=A}get profileId(){return this.privId}get profileType(){return this.privProfileType}}ZC.VoiceProfile=Q_;var Gc={},dU;function R_(){if(dU)return Gc;dU=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.VoiceProfileEnrollmentCancellationDetails=Gc.VoiceProfileEnrollmentResult=void 0;const t=ut(),e=Ve();let A=class lR{constructor(n,o,s){this.privReason=n,this.privProperties=new e.PropertyCollection,this.privReason!==e.ResultReason.Canceled?o&&(this.privDetails=JSON.parse(o),this.privDetails.enrollmentStatus.toLowerCase()==="enrolling"&&(this.privReason=e.ResultReason.EnrollingVoiceProfile)):(this.privErrorDetails=s,this.privProperties.setProperty(t.CancellationErrorCodePropertyName,e.CancellationErrorCode[e.CancellationErrorCode.ServiceError]))}get reason(){return this.privReason}get enrollmentsCount(){return this.privDetails.enrollmentsCount}get enrollmentsLength(){return this.privDetails.enrollmentsLength}get properties(){return this.privProperties}get enrollmentResultDetails(){return this.privDetails}get errorDetails(){return this.privErrorDetails}static FromIdentificationProfileList(n){const o=[];for(const s of n.value){const a=s.enrollmentStatus.toLowerCase()==="enrolling"?e.ResultReason.EnrollingVoiceProfile:s.enrollmentStatus.toLowerCase()==="enrolled"?e.ResultReason.EnrolledVoiceProfile:e.ResultReason.Canceled,c=new lR(a,null,null);c.privDetails=this.getIdentificationDetails(s),o.push(c)}return o}static FromVerificationProfileList(n){const o=[];for(const s of n.value){const a=s.enrollmentStatus.toLowerCase()==="enrolling"?e.ResultReason.EnrollingVoiceProfile:s.enrollmentStatus.toLowerCase()==="enrolled"?e.ResultReason.EnrolledVoiceProfile:e.ResultReason.Canceled,c=new lR(a,null,null);c.privDetails=this.getVerificationDetails(s),o.push(c)}return o}static getIdentificationDetails(n){return{audioLength:n.audioLength?parseFloat(n.audioLength):0,audioSpeechLength:n.audioSpeechLength?parseFloat(n.audioSpeechLength):0,enrollmentStatus:n.enrollmentStatus,enrollmentsCount:n.enrollmentsCount||0,enrollmentsLength:n.enrollmentsLength?parseFloat(n.enrollmentsLength):0,enrollmentsSpeechLength:n.enrollmentsSpeechLength?parseFloat(n.enrollmentsSpeechLength):0,profileId:n.profileId||n.identificationProfileId,remainingEnrollmentsSpeechLength:n.remainingEnrollmentsSpeechLength?parseFloat(n.remainingEnrollmentsSpeechLength):0}}static getVerificationDetails(n){return{audioLength:n.audioLength?parseFloat(n.audioLength):0,audioSpeechLength:n.audioSpeechLength?parseFloat(n.audioSpeechLength):0,enrollmentStatus:n.enrollmentStatus,enrollmentsCount:n.enrollmentsCount,enrollmentsLength:n.enrollmentsLength?parseFloat(n.enrollmentsLength):0,enrollmentsSpeechLength:n.enrollmentsSpeechLength?parseFloat(n.enrollmentsSpeechLength):0,profileId:n.profileId||n.verificationProfileId,remainingEnrollmentsCount:n.remainingEnrollments||n.remainingEnrollmentsCount,remainingEnrollmentsSpeechLength:n.remainingEnrollmentsSpeechLength?parseFloat(n.remainingEnrollmentsSpeechLength):0}}};Gc.VoiceProfileEnrollmentResult=A;class r extends e.CancellationDetailsBase{constructor(n,o,s){super(n,o,s)}static fromResult(n){const o=e.CancellationReason.Error;let s=e.CancellationErrorCode.NoError;return n.properties&&(s=e.CancellationErrorCode[n.properties.getProperty(t.CancellationErrorCodePropertyName,e.CancellationErrorCode[e.CancellationErrorCode.NoError])]),new r(o,n.errorDetails,s)}}return Gc.VoiceProfileEnrollmentCancellationDetails=r,Gc}var jc={},pU;function D_(){if(pU)return jc;pU=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.VoiceProfileCancellationDetails=jc.VoiceProfileResult=void 0;const t=ut(),e=Ut,A=Ve();let r=class{constructor(o,s){this.privReason=o,this.privProperties=new A.PropertyCollection,o===A.ResultReason.Canceled&&(e.Contracts.throwIfNullOrUndefined(s,"statusText"),this.privErrorDetails=s,this.privProperties.setProperty(t.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.ServiceError]))}get reason(){return this.privReason}get properties(){return this.privProperties}get errorDetails(){return this.privErrorDetails}};jc.VoiceProfileResult=r;class i extends A.CancellationDetailsBase{constructor(o,s,a){super(o,s,a)}static fromResult(o){const s=A.CancellationReason.Error;let a=A.CancellationErrorCode.NoError;return o.properties&&(a=A.CancellationErrorCode[o.properties.getProperty(t.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.NoError])]),new i(s,o.errorDetails,a)}}return jc.VoiceProfileCancellationDetails=i,jc}var cd={},fU;function T_(){if(fU)return cd;fU=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.VoiceProfilePhraseResult=void 0;const t=Ut,e=Ve();let A=class extends e.VoiceProfileResult{constructor(i,n,o,s){super(i,n),this.privPhrases=[],t.Contracts.throwIfNullOrUndefined(s,"phrase array"),this.privType=o,s&&s[0]&&(this.privPhrases=s)}get phrases(){return this.privPhrases}get type(){return this.privType}};return cd.VoiceProfilePhraseResult=A,cd}var ud={},EU;function U_(){if(EU)return ud;EU=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.VoiceProfileClient=void 0;const t=ut(),e=v2(),A=Ut,r=Ve();let i=class extends r.Recognizer{constructor(o){A.Contracts.throwIfNullOrUndefined(o,"speechConfig");const s=o;A.Contracts.throwIfNull(s,"speechConfig"),super(e.AudioConfig.fromStreamInput(r.AudioInputStream.createPushStream()),s.properties,new t.VoiceProfileConnectionFactory),this.privProperties=s.properties.clone(),this.privVoiceAdapter=this.privReco,this.privDisposedVoiceAdapter=!1}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(o){A.Contracts.throwIfNullOrWhitespace(o,"token"),this.properties.setProperty(r.PropertyId.SpeechServiceAuthorization_Token,o)}async createProfileAsync(o,s){const a=await this.privVoiceAdapter.createProfile(o,s);return new r.VoiceProfile(a[0],o)}async retrieveEnrollmentResultAsync(o){return this.privVoiceAdapter.retrieveEnrollmentResult(o)}async getAllProfilesAsync(o){return this.privVoiceAdapter.getAllProfiles(o)}async getActivationPhrasesAsync(o,s){return this.privVoiceAdapter.getActivationPhrases(o,s)}async enrollProfileAsync(o,s){const a=s;return A.Contracts.throwIfNullOrUndefined(a,"audioConfig"),this.audioConfig=s,this.privVoiceAdapter.SpeakerAudioSource=a,this.privVoiceAdapter.enrollProfile(o)}async deleteProfileAsync(o){return this.privVoiceAdapter.deleteProfile(o)}async resetProfileAsync(o){return this.privVoiceAdapter.resetProfile(o)}async close(){await this.dispose(!0)}createServiceRecognizer(o,s,a,c){const u=a;return new t.VoiceServiceRecognizer(o,s,u,c,this)}async dispose(o){this.privDisposedVoiceAdapter||(this.privDisposedVoiceAdapter=!0,o&&await super.dispose(o))}createRecognizerConfig(o){return new t.RecognizerConfig(o,this.properties)}getResult(o,s){return new r.VoiceProfileResult(o.ok?s:r.ResultReason.Canceled,o.statusText)}};return ud.VoiceProfileClient=i,ud}var ld={},CU;function L_(){if(CU)return ld;CU=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.SpeakerRecognizer=void 0;const t=ut(),e=Ut,A=Ve();let r=class extends A.Recognizer{constructor(n,o){e.Contracts.throwIfNullOrUndefined(n,"speechConfig");const s=n;e.Contracts.throwIfNullOrUndefined(s,"speechConfig"),super(o,s.properties,new t.SpeakerRecognitionConnectionFactory),this.privAudioConfigImpl=o,e.Contracts.throwIfNull(this.privAudioConfigImpl,"audioConfig"),this.privDisposedSpeakerRecognizer=!1,this.privProperties=s.properties}get authorizationToken(){return this.properties.getProperty(A.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(n){e.Contracts.throwIfNullOrWhitespace(n,"token"),this.properties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,n)}get properties(){return this.privProperties}async recognizeOnceAsync(n){return e.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),this.recognizeSpeakerOnceAsyncImpl(n)}async close(){e.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),await this.dispose(!0)}async recognizeSpeakerOnceAsyncImpl(n){e.Contracts.throwIfDisposed(this.privDisposedSpeakerRecognizer),await this.implRecognizerStop();const o=await this.privReco.recognizeSpeaker(n);return await this.implRecognizerStop(),o}async implRecognizerStop(){this.privReco&&await this.privReco.stopRecognizing()}createRecognizerConfig(n){return new t.RecognizerConfig(n,this.privProperties)}createServiceRecognizer(n,o,s,a){const c=s;return new t.SpeakerServiceRecognizer(n,o,c,a,this)}async dispose(n){this.privDisposedSpeakerRecognizer||n&&(this.privDisposedSpeakerRecognizer=!0,await super.dispose(n))}};return ld.SpeakerRecognizer=r,ld}var hd={},IU;function F_(){if(IU)return hd;IU=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.SpeakerIdentificationModel=void 0;const t=Ut,e=Ve();let A=class Aj{constructor(i){if(this.privVoiceProfiles=[],this.privProfileIds=[],t.Contracts.throwIfNullOrUndefined(i,"VoiceProfiles"),i.length===0)throw new Error("Empty Voice Profiles array");for(const n of i){if(n.profileType!==e.VoiceProfileType.TextIndependentIdentification)throw new Error("Identification model can only be created from Identification profile: "+n.profileId);this.privVoiceProfiles.push(n),this.privProfileIds.push(n.profileId)}}static fromProfiles(i){return new Aj(i)}get voiceProfileIds(){return this.privProfileIds.join(",")}get profileIds(){return this.privProfileIds}get scenario(){return"TextIndependentIdentification"}};return hd.SpeakerIdentificationModel=A,hd}var gd={},BU;function O_(){if(BU)return gd;BU=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.SpeakerVerificationModel=void 0;const t=Ut,e=Ve();let A=class rj{constructor(i){if(t.Contracts.throwIfNullOrUndefined(i,"VoiceProfile"),i.profileType===e.VoiceProfileType.TextIndependentIdentification)throw new Error("Verification model cannot be created from Identification profile");this.privVoiceProfile=i}static fromProfile(i){return new rj(i)}get voiceProfile(){return this.privVoiceProfile}get profileIds(){return[this.voiceProfile.profileId]}get scenario(){return this.voiceProfile.profileType===e.VoiceProfileType.TextDependentVerification?"TextDependentVerification":"TextIndependentVerification"}};return gd.SpeakerVerificationModel=A,gd}var dd={},y0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageIdMode=void 0,function(e){e[e.AtStart=0]="AtStart",e[e.Continuous=1]="Continuous"}(t.LanguageIdMode||(t.LanguageIdMode={}))})(y0);var vU;function b_(){if(vU)return dd;vU=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.AutoDetectSourceLanguageConfig=void 0;const t=ut(),e=Ut,A=Ve(),r=y0;let i=class Uw{constructor(){this.privProperties=new A.PropertyCollection,this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_LanguageIdMode,"AtStart"),this.privLanguageIdMode=r.LanguageIdMode.AtStart}static fromOpenRange(){const o=new Uw;return o.properties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,t.AutoDetectSourceLanguagesOpenRangeOptionName),o.properties.setProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,"en-US"),o}static fromLanguages(o){e.Contracts.throwIfArrayEmptyOrWhitespace(o,"languages");const s=new Uw;return s.properties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,o.join()),s}static fromSourceLanguageConfigs(o){if(o.length<1)throw new Error("Expected non-empty SourceLanguageConfig array.");const s=new Uw,a=[];return o.forEach(c=>{if(a.push(c.language),c.endpointId!==void 0&&c.endpointId!==""){const u=c.language+A.PropertyId.SpeechServiceConnection_EndpointId.toString();s.properties.setProperty(u,c.endpointId)}}),s.properties.setProperty(A.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,a.join()),s}get properties(){return this.privProperties}set mode(o){o===r.LanguageIdMode.Continuous?(this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2"),this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_LanguageIdMode,"Continuous")):(this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"1"),this.privProperties.setProperty(A.PropertyId.SpeechServiceConnection_LanguageIdMode,"AtStart")),this.privLanguageIdMode=o}};return dd.AutoDetectSourceLanguageConfig=i,dd}var XC={};Object.defineProperty(XC,"__esModule",{value:!0}),XC.AutoDetectSourceLanguageResult=void 0;const wU=Ut;class _C{constructor(e,A){wU.Contracts.throwIfNullOrUndefined(e,"language"),wU.Contracts.throwIfNullOrUndefined(A,"languageDetectionConfidence"),this.privLanguage=e,this.privLanguageDetectionConfidence=A}static fromResult(e){return new _C(e.language,e.languageDetectionConfidence)}static fromConversationTranscriptionResult(e){return new _C(e.language,e.languageDetectionConfidence)}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}}XC.AutoDetectSourceLanguageResult=_C;var $C={};Object.defineProperty($C,"__esModule",{value:!0}),$C.SourceLanguageConfig=void 0;const x_=Ut;class Q0{constructor(e,A){x_.Contracts.throwIfNullOrUndefined(e,"language"),this.privLanguage=e,this.privEndpointId=A}static fromLanguage(e,A){return new Q0(e,A)}get language(){return this.privLanguage}get endpointId(){return this.privEndpointId}}$C.SourceLanguageConfig=Q0;var R0={},SU;function N_(){return SU||(SU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResult=t.SpeakerRecognitionResultType=void 0;const e=ut(),A=Ve();var r;(function(o){o[o.Verify=0]="Verify",o[o.Identify=1]="Identify"})(r=t.SpeakerRecognitionResultType||(t.SpeakerRecognitionResultType={}));class i{constructor(s,a=A.ResultReason.RecognizedSpeaker,c=A.CancellationErrorCode.NoError,u=""){this.privProperties=new A.PropertyCollection;const l=s.scenario==="TextIndependentIdentification"?r.Identify:r.Verify;this.privReason=a,this.privReason!==A.ResultReason.Canceled?l===r.Identify?(this.privProfileId=s.identificationResult.identifiedProfile.profileId,this.privScore=s.identificationResult.identifiedProfile.score,this.privReason=A.ResultReason.RecognizedSpeakers):(this.privScore=s.verificationResult.score,s.verificationResult.recognitionResult.toLowerCase()!=="accept"&&(this.privReason=A.ResultReason.NoMatch),s.verificationResult.profileId!==void 0&&s.verificationResult.profileId!==""&&(this.privProfileId=s.verificationResult.profileId)):(this.privErrorDetails=u,this.privProperties.setProperty(e.CancellationErrorCodePropertyName,A.CancellationErrorCode[c])),this.privProperties.setProperty(A.PropertyId.SpeechServiceResponse_JsonResult,JSON.stringify(s))}get properties(){return this.privProperties}get reason(){return this.privReason}get profileId(){return this.privProfileId}get errorDetails(){return this.privErrorDetails}get score(){return this.privScore}}t.SpeakerRecognitionResult=i;class n extends A.CancellationDetailsBase{constructor(s,a,c){super(s,a,c)}static fromResult(s){const a=A.CancellationReason.Error;let c=A.CancellationErrorCode.NoError;return s.properties&&(c=A.CancellationErrorCode[s.properties.getProperty(e.CancellationErrorCodePropertyName,A.CancellationErrorCode[A.CancellationErrorCode.NoError])]),new n(a,s.errorDetails,c)}}t.SpeakerRecognitionCancellationDetails=n}(R0)),R0}var D0={},Yc={},mU;function MU(){if(mU)return Yc;mU=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.ConversationImpl=Yc.Conversation=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class{constructor(){}static createConversationAsync(s,a,c,u){A.Contracts.throwIfNullOrUndefined(s,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),A.Contracts.throwIfNullOrUndefined(s.region,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),!s.subscriptionKey&&!s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceAuthorization_Token])&&A.Contracts.throwIfNullOrUndefined(s.subscriptionKey,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key"));let l,g,h;return typeof a=="string"?(l=new n(s,a),(0,e.marshalPromiseToCallbacks)((async()=>{})(),c,u)):(l=new n(s),g=a,h=c,l.createConversationAsync(()=>{g&&g()},p=>{h&&h(p)})),l}};Yc.Conversation=i;class n extends i{constructor(s,a){if(super(),this.privErrors=t.ConversationConnectionConfig.restErrors,this.onConnected=l=>{var g;this.privIsConnected=!0;try{(g=this.privConversationTranslator)!=null&&g.sessionStarted&&this.privConversationTranslator.sessionStarted(this.privConversationTranslator,l)}catch{}},this.onDisconnected=l=>{var g;try{(g=this.privConversationTranslator)!=null&&g.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,l)}catch{}finally{this.close(!1)}},this.onCanceled=(l,g)=>{var h;try{(h=this.privConversationTranslator)!=null&&h.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,g)}catch{}},this.onParticipantUpdateCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.id);if(h!==void 0){switch(g.key){case t.ConversationTranslatorCommandTypes.changeNickname:h.displayName=g.value;break;case t.ConversationTranslatorCommandTypes.setUseTTS:h.isUsingTts=g.value;break;case t.ConversationTranslatorCommandTypes.setProfanityFiltering:h.profanity=g.value;break;case t.ConversationTranslatorCommandTypes.setMute:h.isMuted=g.value;break;case t.ConversationTranslatorCommandTypes.setTranslateToLanguages:h.translateToLanguages=g.value;break}this.privParticipants.addOrUpdateParticipant(h),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,[this.toParticipant(h)],g.sessionId))}}catch{}},this.onLockRoomCommandReceived=()=>{},this.onMuteAllCommandReceived=(l,g)=>{try{this.privParticipants.participants.forEach(h=>h.isMuted=h.isHost?!1:g.isMuted),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,this.toParticipants(!1),g.sessionId))}catch{}},this.onParticipantJoinCommandReceived=(l,g)=>{try{const h=this.privParticipants.addOrUpdateParticipant(g.participant);h!==void 0&&this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,[this.toParticipant(h)],g.sessionId))}catch{}},this.onParticipantLeaveCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.participant.id);h!==void 0&&(this.privParticipants.deleteParticipant(g.participant.id),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.LeftConversation,[this.toParticipant(h)],g.sessionId)))}catch{}},this.onTranslationReceived=(l,g)=>{try{switch(g.command){case t.ConversationTranslatorMessageTypes.final:this.privConversationTranslator&&this.privConversationTranslator.transcribed(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.partial:this.privConversationTranslator&&this.privConversationTranslator.transcribing(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.instantMessage:this.privConversationTranslator&&this.privConversationTranslator.textMessageReceived(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break}}catch{}},this.onParticipantsListReceived=(l,g)=>{var h;try{if(g.sessionToken!==void 0&&g.sessionToken!==null&&(this.privRoom.token=g.sessionToken),this.privParticipants.participants=[...g.participants],this.privParticipants.me!==void 0&&(this.privIsReady=!0),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,this.toParticipants(!0),g.sessionId)),this.me.isHost){const p=(h=this.privConversationTranslator)==null?void 0:h.properties.getProperty(r.PropertyId.ConversationTranslator_Name);p!==void 0&&p.length>0&&p!==this.me.displayName&&this.changeNicknameAsync(p)}}catch{}},this.onConversationExpiration=(l,g)=>{try{this.privConversationTranslator&&this.privConversationTranslator.conversationExpiration(this.privConversationTranslator,g)}catch{}},this.privIsConnected=!1,this.privIsDisposed=!1,this.privConversationId="",this.privProperties=new r.PropertyCollection,this.privManager=new t.ConversationManager,s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage])||s.setProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage],t.ConversationConnectionConfig.defaultLanguageCode),this.privLanguage=s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage]),a)this.privConversationId=a;else{s.targetLanguages.length===0&&s.addTargetLanguage(this.privLanguage),s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceResponse_ProfanityOption])||s.setProfanity(r.ProfanityOption.Masked);let g=s.getProperty(r.PropertyId[r.PropertyId.ConversationTranslator_Name]);g==null&&(g="Host"),A.Contracts.throwIfNullOrTooLong(g,"nickname",50),A.Contracts.throwIfNullOrTooShort(g,"nickname",2),s.setProperty(r.PropertyId[r.PropertyId.ConversationTranslator_Name],g)}this.privConfig=s;const u=s;A.Contracts.throwIfNull(u,"speechConfig"),this.privProperties=u.properties.clone(),this.privIsConnected=!1,this.privParticipants=new t.InternalParticipants,this.privIsReady=!1,this.privTextMessageMaxLength=1e3}get room(){return this.privRoom}get connection(){return this.privConversationRecognizer}get config(){return this.privConfig}get conversationId(){return this.privRoom?this.privRoom.roomId:this.privConversationId}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privLanguage}get isMutedByHost(){var s,a;return(s=this.privParticipants.me)!=null&&s.isHost?!1:(a=this.privParticipants.me)==null?void 0:a.isMuted}get isConnected(){return this.privIsConnected&&this.privIsReady}get participants(){return this.toParticipants(!0)}get me(){return this.toParticipant(this.privParticipants.me)}get host(){return this.toParticipant(this.privParticipants.host)}get transcriberRecognizer(){return this.privTranscriberRecognizer}get conversationInfo(){const s=this.conversationId,a=this.participants.map(l=>({id:l.id,preferredLanguage:l.preferredLanguage,voice:l.voice})),c={};for(const l of t.ConversationConnectionConfig.transcriptionEventKeys){const g=this.properties.getProperty(l,"");g!==""&&(c[l]=g)}return{id:s,participants:a,conversationProperties:c}}get canSend(){var s;return this.privIsConnected&&!((s=this.privParticipants.me)!=null&&s.isMuted)}get canSendAsHost(){var s;return this.privIsConnected&&((s=this.privParticipants.me)==null?void 0:s.isHost)}get authorizationToken(){return this.privToken}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"authorizationToken"),this.privToken=s}set conversationTranslator(s){this.privConversationTranslator=s}onToken(s){this.privConversationTranslator.onToken(s)}createConversationAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),this.privManager.createOrJoin(this.privProperties,void 0,c=>{c||this.handleError(new Error(this.privErrors.permissionDeniedConnect),a),this.privRoom=c,this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}startConversationAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer=t.ConversationRecognizerFactory.fromConfig(this,this.privConfig),this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}addParticipantAsync(s,a,c){A.Contracts.throwIfNullOrUndefined(s,"Participant"),(0,e.marshalPromiseToCallbacks)(this.addParticipantImplAsync(s),a,c)}joinConversationAsync(s,a,c,u,l){try{A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","conversationId")),A.Contracts.throwIfNullOrWhitespace(a,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrWhitespace(c,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,s,g=>{A.Contracts.throwIfNullOrUndefined(g,this.privErrors.permissionDeniedConnect),this.privRoom=g,this.privConfig.authorizationToken=g.cognitiveSpeechAuthToken,u&&u(g.cognitiveSpeechAuthToken)},g=>{this.handleError(g,l)})}catch(g){this.handleError(g,l)}}deleteConversationAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.deleteConversationImplAsync(),s,a)}async deleteConversationImplAsync(){A.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),A.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),await this.privManager.leave(this.privProperties,this.privRoom.token),this.dispose()}endConversationAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.endConversationImplAsync(),s,a)}endConversationImplAsync(){return this.close(!0)}lockConversationAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!0),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}removeParticipantAsync(s,a,c){try{if(A.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&s.hasOwnProperty("id"))(0,e.marshalPromiseToCallbacks)(this.removeParticipantImplAsync(s),a,c);else{A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),c);let u="";typeof s=="string"?u=s:s.hasOwnProperty("id")?u=s.id:s.hasOwnProperty("userId")&&(u=s.userId),A.Contracts.throwIfNullOrWhitespace(u,this.privErrors.invalidArgs.replace("{arg}","userId")),this.participants.findIndex(g=>g.id===u)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getEjectCommand(u),()=>{this.handleCallback(a,c)},g=>{this.handleError(g,c)})}}catch(u){this.handleError(u,c)}}unlockConversationAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!1),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}sendTextMessageAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","message")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),s.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMessageCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}setTranslatedLanguagesAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfArrayEmptyOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","languages")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getSetTranslateToLanguagesCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}changeNicknameAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getChangeNicknameCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}isDisposed(){return this.privIsDisposed}dispose(){this.isDisposed||(this.privIsDisposed=!0,this.config&&this.config.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)}async connectTranscriberRecognizer(s){this.privTranscriberRecognizer&&await this.privTranscriberRecognizer.close(),await s.enforceAudioGating(),this.privTranscriberRecognizer=s,this.privTranscriberRecognizer.conversation=this}getKeepAlive(){const s=this.me?this.me.displayName:"default_nickname";return JSON.stringify({id:"0",nickname:s,participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.keepAlive})}addParticipantImplAsync(s){if(this.privParticipants.addOrUpdateParticipant(s)!==void 0&&this.privTranscriberRecognizer){const c=this.conversationInfo;return c.participants=[s],this.privTranscriberRecognizer.pushConversationEvent(c,"join")}}removeParticipantImplAsync(s){this.privParticipants.deleteParticipant(s.id);const a=this.conversationInfo;return a.participants=[s],this.privTranscriberRecognizer.pushConversationEvent(a,"leave")}async close(s){var a;try{this.privIsConnected=!1,await((a=this.privConversationRecognizer)==null?void 0:a.close()),this.privConversationRecognizer=void 0,this.privConversationTranslator&&this.privConversationTranslator.dispose()}catch(c){throw c}s&&this.dispose()}handleCallback(s,a){if(s){try{s()}catch(c){a&&a(c)}s=void 0}}handleError(s,a){if(a)if(s instanceof Error){const c=s;a(c.name+": "+c.message)}else a(s)}toParticipants(s){const a=this.privParticipants.participants.map(c=>this.toParticipant(c));return s?a:a.filter(c=>c.isHost===!1)}toParticipant(s){return new r.Participant(s.id,s.avatar,s.displayName,s.isHost,s.isMuted,s.isUsingTts,s.preferredLanguage,s.voice)}getMuteAllCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMuteCommand(s,a){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMute,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:a})}getLockCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getEjectCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.ejectParticipant,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand})}getSetTranslateToLanguagesCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setTranslateToLanguages,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getChangeNicknameCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"nickname"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.changeNickname,nickname:s,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMessageCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),A.Contracts.throwIfNullOrWhitespace(s,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:s,type:t.ConversationTranslatorMessageTypes.instantMessage})}}return Yc.ConversationImpl=n,Yc}var eI={};Object.defineProperty(eI,"__esModule",{value:!0}),eI.ConversationCommon=void 0;class K_{constructor(e){this.privAudioConfig=e}handleCallback(e,A){if(e){try{e()}catch(r){A&&A(r)}e=void 0}}handleError(e,A){if(A)if(e instanceof Error){const r=e;A(r.name+": "+r.message)}else A(e)}}eI.ConversationCommon=K_;var pd={},yU;function k_(){if(yU)return pd;yU=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.ConversationExpirationEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i){super(i),this.privExpirationTime=r}get expirationTime(){return this.privExpirationTime}};return pd.ConversationExpirationEventArgs=e,pd}var fd={},QU;function P_(){if(QU)return fd;QU=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.ConversationParticipantsChangedEventArgs=void 0;const t=Ve();let e=class extends t.SessionEventArgs{constructor(r,i,n){super(n),this.privReason=r,this.privParticipant=i}get reason(){return this.privReason}get participants(){return this.privParticipant}};return fd.ConversationParticipantsChangedEventArgs=e,fd}var Ed={},RU;function G_(){if(RU)return Ed;RU=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.ConversationTranslationCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Ed.ConversationTranslationCanceledEventArgs=e,Ed}var Cd={},DU;function j_(){if(DU)return Cd;DU=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.ConversationTranslationEventArgs=void 0;const t=Ve();let e=class extends t.RecognitionEventArgs{constructor(r,i,n){super(i,n),this.privResult=r}get result(){return this.privResult}};return Cd.ConversationTranslationEventArgs=e,Cd}var Id={},TU;function Y_(){if(TU)return Id;TU=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.ConversationTranslationResult=void 0;const t=x2();let e=class extends t.TranslationRecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(i,o,s,a,c,u,void 0,void 0,l,g,h),this.privId=r,this.privOrigLang=n}get participantId(){return this.privId}get originalLang(){return this.privOrigLang}};return Id.ConversationTranslationResult=e,Id}var T0={},Bd={},vd={};Object.defineProperty(vd,"__esModule",{value:!0}),vd.StringUtils=void 0;class H_{static formatString(e,A){if(!e)return"";if(!A)return e;let r="",i="";const n=a=>{r+=a},o=a=>{i+=a};let s=n;for(let a=0;a<e.length;a++){const c=e[a],u=a+1<e.length?e[a+1]:"";switch(c){case"{":u==="{"?(s("{"),a++):s=o;break;case"}":u==="}"?(s("}"),a++):(A.hasOwnProperty(i)&&(r+=A[i]),s=n,i="");break;default:s(c);break}}return r}}vd.StringUtils=H_;var UU;function z_(){if(UU)return Bd;UU=1,Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.ConversationTranslatorConnectionFactory=void 0;const t=Zr(),e=vd,A=Ut,r=Ve(),i=Wr,n=ds,o=ps(),s=ut();let a=class ij extends o.ConnectionFactoryBase{constructor(u){super(),A.Contracts.throwIfNullOrUndefined(u,"convGetter"),this.privConvGetter=u}create(u,l,g){const h=u.parameters.getProperty("ConversationTranslator_MultiChannelAudio","").toUpperCase()==="TRUE",p=this.privConvGetter().room,C=p.cognitiveSpeechRegion||u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_Region,""),I={hostSuffix:o.ConnectionFactoryBase.getHostSuffix(C),path:ij.CTS_VIRT_MIC_PATH,region:encodeURIComponent(C)};I[n.QueryParameterNames.Language]=encodeURIComponent(u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_RecoLanguage,"")),I[n.QueryParameterNames.CtsMeetingId]=encodeURIComponent(p.roomId),I[n.QueryParameterNames.CtsDeviceId]=encodeURIComponent(p.participantId),I[n.QueryParameterNames.CtsIsParticipant]=p.isHost?"":"&"+n.QueryParameterNames.CtsIsParticipant;let E="";const v={},m={};if(h){E=u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_Endpoint),E||(E="wss://"+u.parameters.getProperty(r.PropertyId.SpeechServiceConnection_Host,"transcribe.{region}.cts.speech{hostSuffix}")+"{path}"),E=e.StringUtils.formatString(E,I);const O=new URL(E);O.searchParams.forEach((P,D)=>{v[D]=P}),new s.TranscriberConnectionFactory().setQueryParams(v,u,E),v[n.QueryParameterNames.CtsMeetingId]=I[n.QueryParameterNames.CtsMeetingId],v[n.QueryParameterNames.CtsDeviceId]=I[n.QueryParameterNames.CtsDeviceId],p.isHost||(v[n.QueryParameterNames.CtsIsParticipant]=""),n.QueryParameterNames.Format in v||(v[n.QueryParameterNames.Format]="simple"),O.searchParams.forEach((P,D)=>{O.searchParams.set(D,v[D]),delete v[D]}),E=O.toString()}else{const O=new s.TranslationConnectionFactory;E=O.getEndpointUrl(u,!0),E=e.StringUtils.formatString(E,I),O.setQueryParams(v,u,E)}m[i.HeaderNames.ConnectionId]=g,m[t.RestConfigBase.configParams.token]=p.token,l.token&&(m[l.headerName]=l.token);const M=u.parameters.getProperty("SPEECH-EnableWebsocketCompression","").toUpperCase()==="TRUE";return Promise.resolve(new t.WebsocketConnection(E,v,m,new s.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(u),M,g))}};return Bd.ConversationTranslatorConnectionFactory=a,a.CTS_VIRT_MIC_PATH="/speech/recognition/dynamicaudio",Bd}var LU;function J_(){return LU||(LU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranslator=t.SpeechState=void 0;const e=ut(),A=z_(),r=Mt(),i=Ut,n=Ve(),o=MU(),s=U0();var a;(function(l){l[l.Inactive=0]="Inactive",l[l.Connecting=1]="Connecting",l[l.Connected=2]="Connected"})(a=t.SpeechState||(t.SpeechState={}));class c extends n.TranslationRecognizer{constructor(g,h,p,C){super(g,h,new A.ConversationTranslatorConnectionFactory(C)),this.privSpeechState=a.Inactive,p&&(this.privTranslator=p,this.sessionStarted=()=>{this.privSpeechState=a.Connected},this.sessionStopped=()=>{this.privSpeechState=a.Inactive},this.recognizing=(I,E)=>{this.privTranslator.recognizing&&this.privTranslator.recognizing(this.privTranslator,E)},this.recognized=async(I,E)=>{var v;(v=E.result)!=null&&v.errorDetails?(await this.cancelSpeech(),this.fireCancelEvent(E.result.errorDetails)):this.privTranslator.recognized&&this.privTranslator.recognized(this.privTranslator,E)},this.canceled=async()=>{if(this.privSpeechState!==a.Inactive)try{await this.cancelSpeech()}catch{this.privSpeechState=a.Inactive}})}get state(){return this.privSpeechState}set state(g){this.privSpeechState=g}set authentication(g){this.privReco.authentication=g}onConnection(){this.privSpeechState=a.Connected}async onCancelSpeech(){this.privSpeechState=a.Inactive,await this.cancelSpeech()}fireCancelEvent(g){try{if(this.privTranslator.canceled){const h=new s.ConversationTranslationCanceledEventArgs(n.CancellationReason.Error,g,n.CancellationErrorCode.RuntimeError);this.privTranslator.canceled(this.privTranslator,h)}}catch{}}async cancelSpeech(){var g;try{this.stopContinuousRecognitionAsync(),await((g=this.privReco)==null?void 0:g.disconnect()),this.privSpeechState=a.Inactive}catch{}}}class u extends s.ConversationCommon{constructor(g){super(g),this.privErrors=e.ConversationConnectionConfig.restErrors,this.privIsDisposed=!1,this.privIsSpeaking=!1,this.privPlaceholderKey="abcdefghijklmnopqrstuvwxyz012345",this.privPlaceholderRegion="westus",this.privProperties=new n.PropertyCollection}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privSpeechRecognitionLanguage}get participants(){var g;return(g=this.privConversation)==null?void 0:g.participants}get canSpeak(){return!(!this.privConversation.isConnected||!this.privCTRecognizer||this.privIsSpeaking||this.privCTRecognizer.state===a.Connected||this.privCTRecognizer.state===a.Connecting||this.privConversation.isMutedByHost)}onToken(g){this.privCTRecognizer.authentication=g}setServiceProperty(g,h){const p=JSON.parse(this.privProperties.getProperty(e.ServicePropertiesPropertyName,"{}"));p[g]=h,this.privProperties.setProperty(e.ServicePropertiesPropertyName,JSON.stringify(p))}joinConversationAsync(g,h,p,C,I){try{if(typeof g=="string"){i.Contracts.throwIfNullOrUndefined(g,this.privErrors.invalidArgs.replace("{arg}","conversation id")),i.Contracts.throwIfNullOrWhitespace(h,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privConversation&&this.handleError(new Error(this.privErrors.permissionDeniedStart),I);let E=p;(E==null||E==="")&&(E=e.ConversationConnectionConfig.defaultLanguageCode),this.privSpeechTranslationConfig=n.SpeechTranslationConfig.fromSubscription(this.privPlaceholderKey,this.privPlaceholderRegion),this.privSpeechTranslationConfig.setProfanity(n.ProfanityOption.Masked),this.privSpeechTranslationConfig.addTargetLanguage(E),this.privSpeechTranslationConfig.setProperty(n.PropertyId[n.PropertyId.SpeechServiceConnection_RecoLanguage],E),this.privSpeechTranslationConfig.setProperty(n.PropertyId[n.PropertyId.ConversationTranslator_Name],h);const v=[n.PropertyId.SpeechServiceConnection_Host,n.PropertyId.ConversationTranslator_Host,n.PropertyId.SpeechServiceConnection_Endpoint,n.PropertyId.SpeechServiceConnection_ProxyHostName,n.PropertyId.SpeechServiceConnection_ProxyPassword,n.PropertyId.SpeechServiceConnection_ProxyPort,n.PropertyId.SpeechServiceConnection_ProxyUserName,"ConversationTranslator_MultiChannelAudio","ConversationTranslator_Region"];for(const M of v){const O=this.privProperties.getProperty(M);if(O){const x=typeof M=="string"?M:n.PropertyId[M];this.privSpeechTranslationConfig.setProperty(x,O)}}const m=JSON.parse(this.privProperties.getProperty(e.ServicePropertiesPropertyName,"{}"));for(const M of Object.keys(m))this.privSpeechTranslationConfig.setServiceProperty(M,m[M],n.ServicePropertyChannel.UriQueryParameter);this.privConversation=new o.ConversationImpl(this.privSpeechTranslationConfig),this.privConversation.conversationTranslator=this,this.privConversation.joinConversationAsync(g,h,E,M=>{M||this.handleError(new Error(this.privErrors.permissionDeniedConnect),I),this.privSpeechTranslationConfig.authorizationToken=M,this.privConversation.room.isHost=!1,this.privConversation.startConversationAsync(()=>{this.handleCallback(C,I)},O=>{this.handleError(O,I)})},M=>{this.handleError(M,I)})}else typeof g=="object"?(i.Contracts.throwIfNullOrUndefined(g,this.privErrors.invalidArgs.replace("{arg}","conversation id")),i.Contracts.throwIfNullOrWhitespace(h,this.privErrors.invalidArgs.replace("{arg}","nickname")),this.privProperties.setProperty(n.PropertyId.ConversationTranslator_Name,h),this.privConversation=g,this.privConversation.conversationTranslator=this,this.privConversation.room.isHost=!0,i.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedConnect),i.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),this.privSpeechTranslationConfig=g.config,this.handleCallback(p,C)):this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","invalid conversation type")),C)}catch(E){this.handleError(E,typeof p=="string"?I:C)}}leaveConversationAsync(g,h){(0,r.marshalPromiseToCallbacks)((async()=>{await this.cancelSpeech(),await this.privConversation.endConversationImplAsync(),await this.privConversation.deleteConversationImplAsync(),this.dispose()})(),g,h)}sendTextMessageAsync(g,h,p){try{i.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),i.Contracts.throwIfNullOrWhitespace(g,this.privErrors.invalidArgs.replace("{arg}",g)),this.privConversation.sendTextMessageAsync(g,h,p)}catch(C){this.handleError(C,p)}}startTranscribingAsync(g,h){(0,r.marshalPromiseToCallbacks)((async()=>{try{i.Contracts.throwIfNullOrUndefined(this.privConversation,this.privErrors.permissionDeniedSend),i.Contracts.throwIfNullOrUndefined(this.privConversation.room.token,this.privErrors.permissionDeniedConnect),this.privCTRecognizer===void 0&&await this.connectTranslatorRecognizer(),i.Contracts.throwIfNullOrUndefined(this.privCTRecognizer,this.privErrors.permissionDeniedSend),this.canSpeak||this.handleError(new Error(this.privErrors.permissionDeniedSend),h),await this.startContinuousRecognition(),this.privIsSpeaking=!0}catch(p){throw this.privIsSpeaking=!1,await this.cancelSpeech(),p}})(),g,h)}stopTranscribingAsync(g,h){(0,r.marshalPromiseToCallbacks)((async()=>{try{if(!this.privIsSpeaking){await this.cancelSpeech();return}this.privIsSpeaking=!1,await new Promise((p,C)=>{this.privCTRecognizer.stopContinuousRecognitionAsync(p,C)})}catch{await this.cancelSpeech()}})(),g,h)}isDisposed(){return this.privIsDisposed}dispose(g,h,p){(0,r.marshalPromiseToCallbacks)((async()=>{this.isDisposed&&!this.privIsSpeaking||(await this.cancelSpeech(),this.privIsDisposed=!0,this.privSpeechTranslationConfig.close(),this.privSpeechRecognitionLanguage=void 0,this.privProperties=void 0,this.privAudioConfig=void 0,this.privSpeechTranslationConfig=void 0,this.privConversation.dispose(),this.privConversation=void 0)})(),h,p)}async cancelSpeech(){var g;try{this.privIsSpeaking=!1,await((g=this.privCTRecognizer)==null?void 0:g.onCancelSpeech()),this.privCTRecognizer=void 0}catch{}}async connectTranslatorRecognizer(){try{this.privAudioConfig===void 0&&(this.privAudioConfig=n.AudioConfig.fromDefaultMicrophoneInput()),this.privSpeechTranslationConfig.getProperty(n.PropertyId[n.PropertyId.SpeechServiceConnection_Key])===this.privPlaceholderKey&&this.privSpeechTranslationConfig.setProperty(n.PropertyId[n.PropertyId.SpeechServiceConnection_Key],"");const g=()=>this.privConversation;this.privCTRecognizer=new c(this.privSpeechTranslationConfig,this.privAudioConfig,this,g)}catch(g){throw await this.cancelSpeech(),g}}startContinuousRecognition(){return new Promise((g,h)=>{this.privCTRecognizer.startContinuousRecognitionAsync(g,h)})}}t.ConversationTranslator=u}(T0)),T0}var wd={},FU;function q_(){if(FU)return wd;FU=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.ConversationTranscriber=void 0;const t=ut(),e=vn,A=Mt(),r=Ut,i=Ve();let n=class nj extends i.Recognizer{constructor(s,a){const c=s;r.Contracts.throwIfNull(c,"speechConfig"),r.Contracts.throwIfNullOrWhitespace(c.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage),i.PropertyId[i.PropertyId.SpeechServiceConnection_RecoLanguage]),super(a,c.properties,new t.ConversationTranscriberConnectionFactory,s.tokenCredential),this.privProperties.setProperty(i.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2"),this.privDisposedRecognizer=!1}static FromConfig(s,a,c){const u=s;return a.properties.mergeTo(u.properties),new nj(s,c)}get endpointId(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(i.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){r.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(i.PropertyId.SpeechServiceAuthorization_Token,s)}get speechRecognitionLanguage(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return r.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(t.OutputFormatPropertyName,i.OutputFormat[i.OutputFormat.Simple])===i.OutputFormat[i.OutputFormat.Simple]?i.OutputFormat.Simple:i.OutputFormat.Detailed}get properties(){return this.privProperties}startTranscribingAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(e.RecognitionMode.Conversation),s,a)}stopTranscribingAsync(s,a){(0,A.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}close(s,a){r.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,A.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}async dispose(s){this.privDisposedRecognizer||(s&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(s))}createRecognizerConfig(s){return new t.RecognizerConfig(s,this.privProperties)}createServiceRecognizer(s,a,c,u){const l=c;return u.isSpeakerDiarizationEnabled=!0,new t.ConversationTranscriptionServiceRecognizer(s,a,l,u,this)}};return wd.ConversationTranscriber=n,wd}var Hc={},OU;function V_(){if(OU)return Hc;OU=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.Participant=Hc.User=void 0;const t=Ve();class e{constructor(i){this.privUserId=i}get userId(){return this.privUserId}}Hc.User=e;class A{constructor(i,n,o,s,a,c,u,l){this.privId=i,this.privAvatar=n,this.privDisplayName=o,this.privIsHost=s,this.privIsMuted=a,this.privIsUsingTts=c,this.privPreferredLanguage=u,this.privVoice=l,this.privProperties=new t.PropertyCollection}get avatar(){return this.privAvatar}get displayName(){return this.privDisplayName}get id(){return this.privId}get preferredLanguage(){return this.privPreferredLanguage}get isHost(){return this.privIsHost}get isMuted(){return this.privIsMuted}get isUsingTts(){return this.privIsUsingTts}get voice(){return this.privVoice}get properties(){return this.privProperties}static From(i,n,o){return new A(i,"",i,!1,!1,!1,n,o)}}return Hc.Participant=A,Hc}var bU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantChangedReason=void 0,function(e){e[e.JoinedConversation=0]="JoinedConversation",e[e.LeftConversation=1]="LeftConversation",e[e.Updated=2]="Updated"}(t.ParticipantChangedReason||(t.ParticipantChangedReason={}))})(bU);var zc={},xU;function W_(){if(xU)return zc;xU=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.MeetingImpl=zc.Meeting=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class{constructor(){}static createMeetingAsync(s,a,c,u){if(A.Contracts.throwIfNullOrUndefined(s,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","config")),A.Contracts.throwIfNullOrUndefined(s.region,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Region")),A.Contracts.throwIfNull(a,"meetingId"),a.length===0)throw new Error("meetingId cannot be empty");!s.subscriptionKey&&!s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceAuthorization_Token])&&A.Contracts.throwIfNullOrUndefined(s.subscriptionKey,t.ConversationConnectionConfig.restErrors.invalidArgs.replace("{arg}","SpeechServiceConnection_Key"));const l=new n(s,a);return(0,e.marshalPromiseToCallbacks)((async()=>{})(),c,u),l}};zc.Meeting=i;class n extends i{constructor(s,a){super(),this.privErrors=t.ConversationConnectionConfig.restErrors,this.onConnected=l=>{var g;this.privIsConnected=!0;try{(g=this.privConversationTranslator)!=null&&g.sessionStarted&&this.privConversationTranslator.sessionStarted(this.privConversationTranslator,l)}catch{}},this.onDisconnected=l=>{var g;try{(g=this.privConversationTranslator)!=null&&g.sessionStopped&&this.privConversationTranslator.sessionStopped(this.privConversationTranslator,l)}catch{}finally{this.close(!1)}},this.onCanceled=(l,g)=>{var h;try{(h=this.privConversationTranslator)!=null&&h.canceled&&this.privConversationTranslator.canceled(this.privConversationTranslator,g)}catch{}},this.onParticipantUpdateCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.id);if(h!==void 0){switch(g.key){case t.ConversationTranslatorCommandTypes.changeNickname:h.displayName=g.value;break;case t.ConversationTranslatorCommandTypes.setUseTTS:h.isUsingTts=g.value;break;case t.ConversationTranslatorCommandTypes.setProfanityFiltering:h.profanity=g.value;break;case t.ConversationTranslatorCommandTypes.setMute:h.isMuted=g.value;break;case t.ConversationTranslatorCommandTypes.setTranslateToLanguages:h.translateToLanguages=g.value;break}this.privParticipants.addOrUpdateParticipant(h),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,[this.toParticipant(h)],g.sessionId))}}catch{}},this.onLockRoomCommandReceived=()=>{},this.onMuteAllCommandReceived=(l,g)=>{try{this.privParticipants.participants.forEach(h=>h.isMuted=h.isHost?!1:g.isMuted),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.Updated,this.toParticipants(!1),g.sessionId))}catch{}},this.onParticipantJoinCommandReceived=(l,g)=>{try{const h=this.privParticipants.addOrUpdateParticipant(g.participant);h!==void 0&&this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,[this.toParticipant(h)],g.sessionId))}catch{}},this.onParticipantLeaveCommandReceived=(l,g)=>{try{const h=this.privParticipants.getParticipant(g.participant.id);h!==void 0&&(this.privParticipants.deleteParticipant(g.participant.id),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.LeftConversation,[this.toParticipant(h)],g.sessionId)))}catch{}},this.onTranslationReceived=(l,g)=>{try{switch(g.command){case t.ConversationTranslatorMessageTypes.final:this.privConversationTranslator&&this.privConversationTranslator.transcribed(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.partial:this.privConversationTranslator&&this.privConversationTranslator.transcribing(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break;case t.ConversationTranslatorMessageTypes.instantMessage:this.privConversationTranslator&&this.privConversationTranslator.textMessageReceived(this.privConversationTranslator,new r.ConversationTranslationEventArgs(g.payload,void 0,g.sessionId));break}}catch{}},this.onParticipantsListReceived=(l,g)=>{var h;try{if(g.sessionToken!==void 0&&g.sessionToken!==null&&(this.privRoom.token=g.sessionToken),this.privParticipants.participants=[...g.participants],this.privParticipants.me!==void 0&&(this.privIsReady=!0),this.privConversationTranslator&&this.privConversationTranslator.participantsChanged(this.privConversationTranslator,new r.ConversationParticipantsChangedEventArgs(r.ParticipantChangedReason.JoinedConversation,this.toParticipants(!0),g.sessionId)),this.me.isHost){const p=(h=this.privConversationTranslator)==null?void 0:h.properties.getProperty(r.PropertyId.ConversationTranslator_Name);p!==void 0&&p.length>0&&p!==this.me.displayName&&this.changeNicknameAsync(p)}}catch{}},this.onConversationExpiration=(l,g)=>{try{this.privConversationTranslator&&this.privConversationTranslator.conversationExpiration(this.privConversationTranslator,g)}catch{}},this.privIsConnected=!1,this.privIsDisposed=!1,this.privConversationId="",this.privProperties=new r.PropertyCollection,this.privManager=new t.ConversationManager,s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage])||s.setProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage],t.ConversationConnectionConfig.defaultLanguageCode),this.privLanguage=s.getProperty(r.PropertyId[r.PropertyId.SpeechServiceConnection_RecoLanguage]),this.privConversationId=a,this.privConfig=s;const u=s;A.Contracts.throwIfNull(u,"speechConfig"),this.privProperties=u.properties.clone(),this.privIsConnected=!1,this.privParticipants=new t.InternalParticipants,this.privIsReady=!1,this.privTextMessageMaxLength=1e3}get room(){return this.privRoom}get connection(){return this.privConversationRecognizer}get config(){return this.privConfig}get meetingId(){return this.privRoom?this.privRoom.roomId:this.privConversationId}get properties(){return this.privProperties}get speechRecognitionLanguage(){return this.privLanguage}get isMutedByHost(){var s,a;return(s=this.privParticipants.me)!=null&&s.isHost?!1:(a=this.privParticipants.me)==null?void 0:a.isMuted}get isConnected(){return this.privIsConnected&&this.privIsReady}get participants(){return this.toParticipants(!0)}get me(){return this.toParticipant(this.privParticipants.me)}get host(){return this.toParticipant(this.privParticipants.host)}get transcriberRecognizer(){return this.privTranscriberRecognizer}get meetingInfo(){const s=this.meetingId,a=this.participants.map(l=>({id:l.id,preferredLanguage:l.preferredLanguage,voice:l.voice})),c={};for(const l of t.ConversationConnectionConfig.transcriptionEventKeys){const g=this.properties.getProperty(l,"");g!==""&&(c[l]=g)}return{id:s,participants:a,meetingProperties:c}}get canSend(){var s;return this.privIsConnected&&!((s=this.privParticipants.me)!=null&&s.isMuted)}get canSendAsHost(){var s;return this.privIsConnected&&((s=this.privParticipants.me)==null?void 0:s.isHost)}get authorizationToken(){return this.privToken}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"authorizationToken"),this.privToken=s}createMeetingAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),this.privManager.createOrJoin(this.privProperties,void 0,c=>{c||this.handleError(new Error(this.privErrors.permissionDeniedConnect),a),this.privRoom=c,this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}startMeetingAsync(s,a){try{this.privConversationRecognizer&&this.handleError(new Error(this.privErrors.permissionDeniedStart),a),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedConnect),this.privParticipants.meId=this.privRoom.participantId,this.privConversationRecognizer.connected=this.onConnected,this.privConversationRecognizer.disconnected=this.onDisconnected,this.privConversationRecognizer.canceled=this.onCanceled,this.privConversationRecognizer.participantUpdateCommandReceived=this.onParticipantUpdateCommandReceived,this.privConversationRecognizer.lockRoomCommandReceived=this.onLockRoomCommandReceived,this.privConversationRecognizer.muteAllCommandReceived=this.onMuteAllCommandReceived,this.privConversationRecognizer.participantJoinCommandReceived=this.onParticipantJoinCommandReceived,this.privConversationRecognizer.participantLeaveCommandReceived=this.onParticipantLeaveCommandReceived,this.privConversationRecognizer.translationReceived=this.onTranslationReceived,this.privConversationRecognizer.participantsListReceived=this.onParticipantsListReceived,this.privConversationRecognizer.conversationExpiration=this.onConversationExpiration,this.privConversationRecognizer.connect(this.privRoom.token,()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}addParticipantAsync(s,a,c){A.Contracts.throwIfNullOrUndefined(s,"Participant"),(0,e.marshalPromiseToCallbacks)(this.addParticipantImplAsync(s),a,c)}joinMeetingAsync(s,a,c,u,l){try{A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","conversationId")),A.Contracts.throwIfNullOrWhitespace(a,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrWhitespace(c,this.privErrors.invalidArgs.replace("{arg}","language")),this.privManager.createOrJoin(this.privProperties,s,g=>{A.Contracts.throwIfNullOrUndefined(g,this.privErrors.permissionDeniedConnect),this.privRoom=g,this.privConfig.authorizationToken=g.cognitiveSpeechAuthToken,u&&u(g.cognitiveSpeechAuthToken)},g=>{this.handleError(g,l)})}catch(g){this.handleError(g,l)}}deleteMeetingAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.deleteMeetingImplAsync(),s,a)}async deleteMeetingImplAsync(){A.Contracts.throwIfNullOrUndefined(this.privProperties,this.privErrors.permissionDeniedConnect),A.Contracts.throwIfNullOrWhitespace(this.privRoom.token,this.privErrors.permissionDeniedConnect),await this.privManager.leave(this.privProperties,this.privRoom.token),this.dispose()}endMeetingAsync(s,a){(0,e.marshalPromiseToCallbacks)(this.endMeetingImplAsync(),s,a)}endMeetingImplAsync(){return this.close(!0)}lockMeetingAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","lock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privConversationRecognizer,this.privErrors.permissionDeniedSend),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","mute")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!0),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}muteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!0),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}removeParticipantAsync(s,a,c){try{if(A.Contracts.throwIfDisposed(this.privIsDisposed),this.privTranscriberRecognizer&&s.hasOwnProperty("id"))(0,e.marshalPromiseToCallbacks)(this.removeParticipantImplAsync(s),a,c);else{A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","remove")),c);let u="";typeof s=="string"?u=s:s.hasOwnProperty("id")?u=s.id:s.hasOwnProperty("userId")&&(u=s.userId),A.Contracts.throwIfNullOrWhitespace(u,this.privErrors.invalidArgs.replace("{arg}","userId")),this.participants.findIndex(g=>g.id===u)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getEjectCommand(u),()=>{this.handleCallback(a,c)},g=>{this.handleError(g,c)})}}catch(u){this.handleError(u,c)}}unlockMeetingAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unlock")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getLockCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteAllParticipantsAsync(s,a){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSendAsHost||this.handleError(new Error(this.privErrors.permissionDeniedConversation.replace("{command}","unmute all")),a),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteAllCommand(!1),()=>{this.handleCallback(s,a)},c=>{this.handleError(c,a)})}catch(c){this.handleError(c,a)}}unmuteParticipantAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","userId")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),!this.me.isHost&&this.me.id!==s&&this.handleError(new Error(this.privErrors.permissionDeniedParticipant.replace("{command}","mute")),c),this.privParticipants.getParticipantIndex(s)===-1&&this.handleError(new Error(this.privErrors.invalidParticipantRequest),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMuteCommand(s,!1),()=>{this.handleCallback(a,c)},l=>{this.handleError(l,c)})}catch(u){this.handleError(u,c)}}sendTextMessageAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","message")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),s.length>this.privTextMessageMaxLength&&this.handleError(new Error(this.privErrors.invalidArgs.replace("{arg}","message length")),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getMessageCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}setTranslatedLanguagesAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfArrayEmptyOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","languages")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getSetTranslateToLanguagesCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}changeNicknameAsync(s,a,c){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfDisposed(this.privConversationRecognizer.isDisposed()),A.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","nickname")),A.Contracts.throwIfNullOrUndefined(this.privRoom,this.privErrors.permissionDeniedSend),this.canSend||this.handleError(new Error(this.privErrors.permissionDeniedSend),c),this.privConversationRecognizer&&this.privConversationRecognizer.sendRequest(this.getChangeNicknameCommand(s),()=>{this.handleCallback(a,c)},u=>{this.handleError(u,c)})}catch(u){this.handleError(u,c)}}isDisposed(){return this.privIsDisposed}dispose(){this.isDisposed||(this.privIsDisposed=!0,this.config&&this.config.close(),this.privConfig=void 0,this.privLanguage=void 0,this.privProperties=void 0,this.privRoom=void 0,this.privToken=void 0,this.privManager=void 0,this.privIsConnected=!1,this.privIsReady=!1,this.privParticipants=void 0)}async connectTranscriberRecognizer(s){this.privTranscriberRecognizer&&await this.privTranscriberRecognizer.close(),await s.enforceAudioGating(),this.privTranscriberRecognizer=s,this.privTranscriberRecognizer.meeting=this}getKeepAlive(){const s=this.me?this.me.displayName:"default_nickname";return JSON.stringify({id:"0",nickname:s,participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.keepAlive})}addParticipantImplAsync(s){if(this.privParticipants.addOrUpdateParticipant(s)!==void 0&&this.privTranscriberRecognizer){const c=this.meetingInfo;return c.participants=[s],this.privTranscriberRecognizer.pushMeetingEvent(c,"join")}}removeParticipantImplAsync(s){this.privParticipants.deleteParticipant(s.id);const a=this.meetingInfo;return a.participants=[s],this.privTranscriberRecognizer.pushMeetingEvent(a,"leave")}async close(s){var a;try{this.privIsConnected=!1,await((a=this.privConversationRecognizer)==null?void 0:a.close()),this.privConversationRecognizer=void 0,this.privConversationTranslator&&this.privConversationTranslator.dispose()}catch(c){throw c}s&&this.dispose()}handleCallback(s,a){if(s){try{s()}catch(c){a&&a(c)}s=void 0}}handleError(s,a){if(a)if(s instanceof Error){const c=s;a(c.name+": "+c.message)}else a(s)}toParticipants(s){const a=this.privParticipants.participants.map(c=>this.toParticipant(c));return s?a:a.filter(c=>c.isHost===!1)}toParticipant(s){return new r.Participant(s.id,s.avatar,s.displayName,s.isHost,s.isMuted,s.isUsingTts,s.preferredLanguage,s.voice)}getMuteAllCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingd"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMuteAll,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMuteCommand(s,a){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"conversationId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setMute,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:a})}getLockCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setLockState,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getEjectCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(s,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.ejectParticipant,participantId:s,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand})}getSetTranslateToLanguagesCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.setTranslateToLanguages,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getChangeNicknameCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(s,"nickname"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),JSON.stringify({command:t.ConversationTranslatorCommandTypes.changeNickname,nickname:s,participantId:this.privRoom.participantId,roomid:this.privRoom.roomId,type:t.ConversationTranslatorMessageTypes.participantCommand,value:s})}getMessageCommand(s){return A.Contracts.throwIfNullOrWhitespace(this.privRoom.roomId,"meetingId"),A.Contracts.throwIfNullOrWhitespace(this.privRoom.participantId,"participantId"),A.Contracts.throwIfNullOrWhitespace(s,"message"),JSON.stringify({participantId:this.privRoom.participantId,roomId:this.privRoom.roomId,text:s,type:t.ConversationTranslatorMessageTypes.instantMessage})}}return zc.MeetingImpl=n,zc}var Sd={},NU;function Z_(){if(NU)return Sd;NU=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.MeetingTranscriptionCanceledEventArgs=void 0;const t=Pg();class e extends t.CancellationEventArgsBase{}return Sd.MeetingTranscriptionCanceledEventArgs=e,Sd}var md={},KU;function X_(){if(KU)return md;KU=1,Object.defineProperty(md,"__esModule",{value:!0}),md.MeetingTranscriber=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve(),i=U0();let n=class{constructor(s){this.privAudioConfig=s,this.privProperties=new r.PropertyCollection,this.privRecognizer=void 0,this.privDisposedRecognizer=!1}get speechRecognitionLanguage(){return A.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(r.PropertyId.SpeechServiceConnection_RecoLanguage)}get properties(){return this.privProperties}get internalData(){return this.privRecognizer.internalData}get connection(){return r.Connection.fromRecognizer(this.privRecognizer)}get authorizationToken(){return this.properties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(r.PropertyId.SpeechServiceAuthorization_Token,s)}joinMeetingAsync(s,a,c){const u=s;A.Contracts.throwIfNullOrUndefined(i.MeetingImpl,"Meeting"),this.privRecognizer=new t.TranscriberRecognizer(s.config,this.privAudioConfig),A.Contracts.throwIfNullOrUndefined(this.privRecognizer,"Recognizer"),this.privRecognizer.connectMeetingCallbacks(this),(0,e.marshalPromiseToCallbacks)(u.connectTranscriberRecognizer(this.privRecognizer),a,c)}startTranscribingAsync(s,a){this.privRecognizer.startContinuousRecognitionAsync(s,a)}stopTranscribingAsync(s,a){this.privRecognizer.stopContinuousRecognitionAsync(s,a)}leaveMeetingAsync(s,a){this.privRecognizer.disconnectCallbacks(),(0,e.marshalPromiseToCallbacks)((async()=>{})(),s,a)}close(s,a){A.Contracts.throwIfDisposed(this.privDisposedRecognizer),(0,e.marshalPromiseToCallbacks)(this.dispose(!0),s,a)}async dispose(s){this.privDisposedRecognizer||(this.privRecognizer&&(await this.privRecognizer.close(),this.privRecognizer=void 0),s&&(this.privDisposedRecognizer=!0))}};return md.MeetingTranscriber=n,md}var Md={},kU;function __(){if(kU)return Md;kU=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.ConversationTranscriptionResult=void 0;const t=Ve();let e=class extends t.RecognitionResult{constructor(r,i,n,o,s,a,c,u,l,g,h){super(r,i,n,o,s,a,c,l,g,h),this.privSpeakerId=u}get speakerId(){return this.privSpeakerId}};return Md.ConversationTranscriptionResult=e,Md}var PU;function U0(){return PU||(PU=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConversationTranscriptionResult=t.MeetingTranscriber=t.MeetingTranscriptionCanceledEventArgs=t.MeetingImpl=t.Meeting=t.ParticipantChangedReason=t.User=t.Participant=t.ConversationTranscriber=t.ConversationTranslator=t.ConversationTranslationResult=t.ConversationTranslationEventArgs=t.ConversationTranslationCanceledEventArgs=t.ConversationParticipantsChangedEventArgs=t.ConversationExpirationEventArgs=t.ConversationCommon=t.ConversationImpl=t.Conversation=void 0;var e=MU();Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return e.Conversation}}),Object.defineProperty(t,"ConversationImpl",{enumerable:!0,get:function(){return e.ConversationImpl}});var A=eI;Object.defineProperty(t,"ConversationCommon",{enumerable:!0,get:function(){return A.ConversationCommon}});var r=k_();Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return r.ConversationExpirationEventArgs}});var i=P_();Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return i.ConversationParticipantsChangedEventArgs}});var n=G_();Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return n.ConversationTranslationCanceledEventArgs}});var o=j_();Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return o.ConversationTranslationEventArgs}});var s=Y_();Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return s.ConversationTranslationResult}});var a=J_();Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return a.ConversationTranslator}});var c=q_();Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return c.ConversationTranscriber}});var u=V_();Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return u.Participant}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return u.User}});var l=bU;Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return l.ParticipantChangedReason}});var g=W_();Object.defineProperty(t,"Meeting",{enumerable:!0,get:function(){return g.Meeting}}),Object.defineProperty(t,"MeetingImpl",{enumerable:!0,get:function(){return g.MeetingImpl}});var h=Z_();Object.defineProperty(t,"MeetingTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return h.MeetingTranscriptionCanceledEventArgs}});var p=X_();Object.defineProperty(t,"MeetingTranscriber",{enumerable:!0,get:function(){return p.MeetingTranscriber}});var C=__();Object.defineProperty(t,"ConversationTranscriptionResult",{enumerable:!0,get:function(){return C.ConversationTranscriptionResult}})}(D0)),D0}var Jc={},GU;function L0(){if(GU)return Jc;GU=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.SynthesisRequest=Jc.Synthesizer=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve();let i=class sj{constructor(s){const a=s;A.Contracts.throwIfNull(a,"speechConfig"),this.privProperties=a.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.synthesisRequestQueue=new e.Queue,this.tokenCredential=s.tokenCredential}get authorizationToken(){return this.properties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){A.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(r.PropertyId.SpeechServiceAuthorization_Token,s)}get properties(){return this.privProperties}get autoDetectSourceLanguage(){return this.properties.getProperty(r.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages)===t.AutoDetectSourceLanguagesOpenRangeOptionName}buildSsml(s){const a={["af-ZA"]:"af-ZA-AdriNeural",["am-ET"]:"am-ET-AmehaNeural",["ar-AE"]:"ar-AE-FatimaNeural",["ar-BH"]:"ar-BH-AliNeural",["ar-DZ"]:"ar-DZ-AminaNeural",["ar-EG"]:"ar-EG-SalmaNeural",["ar-IQ"]:"ar-IQ-BasselNeural",["ar-JO"]:"ar-JO-SanaNeural",["ar-KW"]:"ar-KW-FahedNeural",["ar-LY"]:"ar-LY-ImanNeural",["ar-MA"]:"ar-MA-JamalNeural",["ar-QA"]:"ar-QA-AmalNeural",["ar-SA"]:"ar-SA-HamedNeural",["ar-SY"]:"ar-SY-AmanyNeural",["ar-TN"]:"ar-TN-HediNeural",["ar-YE"]:"ar-YE-MaryamNeural",["bg-BG"]:"bg-BG-BorislavNeural",["bn-BD"]:"bn-BD-NabanitaNeural",["bn-IN"]:"bn-IN-BashkarNeural",["ca-ES"]:"ca-ES-JoanaNeural",["cs-CZ"]:"cs-CZ-AntoninNeural",["cy-GB"]:"cy-GB-AledNeural",["da-DK"]:"da-DK-ChristelNeural",["de-AT"]:"de-AT-IngridNeural",["de-CH"]:"de-CH-JanNeural",["de-DE"]:"de-DE-KatjaNeural",["el-GR"]:"el-GR-AthinaNeural",["en-AU"]:"en-AU-NatashaNeural",["en-CA"]:"en-CA-ClaraNeural",["en-GB"]:"en-GB-LibbyNeural",["en-HK"]:"en-HK-SamNeural",["en-IE"]:"en-IE-ConnorNeural",["en-IN"]:"en-IN-NeerjaNeural",["en-KE"]:"en-KE-AsiliaNeural",["en-NG"]:"en-NG-AbeoNeural",["en-NZ"]:"en-NZ-MitchellNeural",["en-PH"]:"en-PH-JamesNeural",["en-SG"]:"en-SG-LunaNeural",["en-TZ"]:"en-TZ-ElimuNeural",["en-US"]:"en-US-AvaMultilingualNeural",["en-ZA"]:"en-ZA-LeahNeural",["es-AR"]:"es-AR-ElenaNeural",["es-BO"]:"es-BO-MarceloNeural",["es-CL"]:"es-CL-CatalinaNeural",["es-CO"]:"es-CO-GonzaloNeural",["es-CR"]:"es-CR-JuanNeural",["es-CU"]:"es-CU-BelkysNeural",["es-DO"]:"es-DO-EmilioNeural",["es-EC"]:"es-EC-AndreaNeural",["es-ES"]:"es-ES-AlvaroNeural",["es-GQ"]:"es-GQ-JavierNeural",["es-GT"]:"es-GT-AndresNeural",["es-HN"]:"es-HN-CarlosNeural",["es-MX"]:"es-MX-DaliaNeural",["es-NI"]:"es-NI-FedericoNeural",["es-PA"]:"es-PA-MargaritaNeural",["es-PE"]:"es-PE-AlexNeural",["es-PR"]:"es-PR-KarinaNeural",["es-PY"]:"es-PY-MarioNeural",["es-SV"]:"es-SV-LorenaNeural",["es-US"]:"es-US-AlonsoNeural",["es-UY"]:"es-UY-MateoNeural",["es-VE"]:"es-VE-PaolaNeural",["et-EE"]:"et-EE-AnuNeural",["fa-IR"]:"fa-IR-DilaraNeural",["fi-FI"]:"fi-FI-SelmaNeural",["fil-PH"]:"fil-PH-AngeloNeural",["fr-BE"]:"fr-BE-CharlineNeural",["fr-CA"]:"fr-CA-SylvieNeural",["fr-CH"]:"fr-CH-ArianeNeural",["fr-FR"]:"fr-FR-DeniseNeural",["ga-IE"]:"ga-IE-ColmNeural",["gl-ES"]:"gl-ES-RoiNeural",["gu-IN"]:"gu-IN-DhwaniNeural",["he-IL"]:"he-IL-AvriNeural",["hi-IN"]:"hi-IN-MadhurNeural",["hr-HR"]:"hr-HR-GabrijelaNeural",["hu-HU"]:"hu-HU-NoemiNeural",["id-ID"]:"id-ID-ArdiNeural",["is-IS"]:"is-IS-GudrunNeural",["it-IT"]:"it-IT-IsabellaNeural",["ja-JP"]:"ja-JP-NanamiNeural",["jv-ID"]:"jv-ID-DimasNeural",["kk-KZ"]:"kk-KZ-AigulNeural",["km-KH"]:"km-KH-PisethNeural",["kn-IN"]:"kn-IN-GaganNeural",["ko-KR"]:"ko-KR-SunHiNeural",["lo-LA"]:"lo-LA-ChanthavongNeural",["lt-LT"]:"lt-LT-LeonasNeural",["lv-LV"]:"lv-LV-EveritaNeural",["mk-MK"]:"mk-MK-AleksandarNeural",["ml-IN"]:"ml-IN-MidhunNeural",["mr-IN"]:"mr-IN-AarohiNeural",["ms-MY"]:"ms-MY-OsmanNeural",["mt-MT"]:"mt-MT-GraceNeural",["my-MM"]:"my-MM-NilarNeural",["nb-NO"]:"nb-NO-PernilleNeural",["nl-BE"]:"nl-BE-ArnaudNeural",["nl-NL"]:"nl-NL-ColetteNeural",["pl-PL"]:"pl-PL-AgnieszkaNeural",["ps-AF"]:"ps-AF-GulNawazNeural",["pt-BR"]:"pt-BR-FranciscaNeural",["pt-PT"]:"pt-PT-DuarteNeural",["ro-RO"]:"ro-RO-AlinaNeural",["ru-RU"]:"ru-RU-SvetlanaNeural",["si-LK"]:"si-LK-SameeraNeural",["sk-SK"]:"sk-SK-LukasNeural",["sl-SI"]:"sl-SI-PetraNeural",["so-SO"]:"so-SO-MuuseNeural",["sr-RS"]:"sr-RS-NicholasNeural",["su-ID"]:"su-ID-JajangNeural",["sv-SE"]:"sv-SE-SofieNeural",["sw-KE"]:"sw-KE-RafikiNeural",["sw-TZ"]:"sw-TZ-DaudiNeural",["ta-IN"]:"ta-IN-PallaviNeural",["ta-LK"]:"ta-LK-KumarNeural",["ta-SG"]:"ta-SG-AnbuNeural",["te-IN"]:"te-IN-MohanNeural",["th-TH"]:"th-TH-PremwadeeNeural",["tr-TR"]:"tr-TR-AhmetNeural",["uk-UA"]:"uk-UA-OstapNeural",["ur-IN"]:"ur-IN-GulNeural",["ur-PK"]:"ur-PK-AsadNeural",["uz-UZ"]:"uz-UZ-MadinaNeural",["vi-VN"]:"vi-VN-HoaiMyNeural",["zh-CN"]:"zh-CN-XiaoxiaoNeural",["zh-HK"]:"zh-HK-HiuMaanNeural",["zh-TW"]:"zh-TW-HsiaoChenNeural",["zu-ZA"]:"zu-ZA-ThandoNeural"};let c=this.properties.getProperty(r.PropertyId.SpeechServiceConnection_SynthLanguage,"en-US"),u=this.properties.getProperty(r.PropertyId.SpeechServiceConnection_SynthVoice,""),l=sj.XMLEncode(s);return this.autoDetectSourceLanguage?c="en-US":u=u||a[c],u&&(l=`<voice name='${u}'>${l}</voice>`),l=`<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='${c}'>${l}</speak>`,l}async dispose(s){this.privDisposed||(s&&this.privAdapter&&await this.privAdapter.dispose(),this.privDisposed=!0)}async adapterSpeak(){if(!this.privDisposed&&!this.privSynthesizing){this.privSynthesizing=!0;const s=await this.synthesisRequestQueue.dequeue();return this.privAdapter.Speak(s.text,s.isSSML,s.requestId,s.cb,s.err,s.dataStream)}}createSynthesizerConfig(s){return new t.SynthesizerConfig(s,this.privProperties)}implCommonSynthesizeSetup(){let s=typeof window<"u"?"Browser":"Node",a="unknown",c="unknown";typeof navigator<"u"&&(s=s+"/"+navigator.platform,a=navigator.userAgent,c=navigator.appVersion);const u=this.createSynthesizerConfig(new t.SpeechServiceConfig(new t.Context(new t.OS(s,a,c)))),l=this.privProperties.getProperty(r.PropertyId.SpeechServiceConnection_Key,void 0),g=l&&l!==""?new t.CognitiveSubscriptionKeyAuthentication(l):this.tokenCredential?new t.CognitiveTokenAuthentication(async()=>{try{const h=await this.tokenCredential.getToken("https://cognitiveservices.azure.com/.default");return(h==null?void 0:h.token)??""}catch(h){throw h}},async()=>{try{const h=await this.tokenCredential.getToken("https://cognitiveservices.azure.com/.default");return(h==null?void 0:h.token)??""}catch(h){throw h}}):new t.CognitiveTokenAuthentication(()=>{const h=this.privProperties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(h)},()=>{const h=this.privProperties.getProperty(r.PropertyId.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(h)});this.privAdapter=this.createSynthesisAdapter(g,this.privConnectionFactory,u),this.privRestAdapter=this.createRestSynthesisAdapter(g,u)}static XMLEncode(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}};Jc.Synthesizer=i;class n{constructor(s,a,c,u,l,g){this.requestId=s,this.text=a,this.isSSML=c,this.cb=u,this.err=l,this.dataStream=g}}return Jc.SynthesisRequest=n,Jc}var yd={},jU;function $_(){if(jU)return yd;jU=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.SpeechSynthesizer=void 0;const t=ut(),e=Mt(),A=Lg,r=Qa,i=li,n=Ut,o=Ve(),s=L0();let a=class oj extends o.Synthesizer{constructor(u,l){super(u),l!==null&&(l===void 0?this.audioConfig=typeof window>"u"?void 0:o.AudioConfig.fromDefaultSpeakerOutput():this.audioConfig=l),this.privConnectionFactory=new t.SpeechSynthesisConnectionFactory,this.implCommonSynthesizeSetup()}static FromConfig(u,l,g){const h=u;return l.properties.mergeTo(h.properties),new oj(u,g)}speakTextAsync(u,l,g,h){this.speakImpl(u,!1,l,g,h)}speakSsmlAsync(u,l,g,h){this.speakImpl(u,!0,l,g,h)}async getVoicesAsync(u=""){return this.getVoices(u)}close(u,l){n.Contracts.throwIfDisposed(this.privDisposed),(0,e.marshalPromiseToCallbacks)(this.dispose(!0),u,l)}get internalData(){return this.privAdapter}createSynthesisAdapter(u,l,g){return new t.SpeechSynthesisAdapter(u,l,g,this,this.audioConfig)}createRestSynthesisAdapter(u,l){return new t.SynthesisRestAdapter(l,u)}implCommonSynthesizeSetup(){super.implCommonSynthesizeSetup(),this.privAdapter.audioOutputFormat=r.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(o.SpeechSynthesisOutputFormat[this.properties.getProperty(o.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0)])}speakImpl(u,l,g,h,p){try{n.Contracts.throwIfDisposed(this.privDisposed);const C=(0,e.createNoDashGuid)();let I;p instanceof o.PushAudioOutputStreamCallback?I=new i.PushAudioOutputStreamImpl(p):p instanceof o.PullAudioOutputStream?I=p:p!==void 0?I=new A.AudioFileWriter(p):I=void 0,this.synthesisRequestQueue.enqueue(new s.SynthesisRequest(C,u,l,E=>{if(this.privSynthesizing=!1,g)try{g(E)}catch(v){h&&h(v)}g=void 0,this.adapterSpeak().catch(()=>{})},E=>{h&&h(E)},I)),this.adapterSpeak().catch(()=>{})}catch(C){if(h)if(C instanceof Error){const I=C;h(I.name+": "+I.message)}else h(C);this.dispose(!0).catch(()=>{})}}async getVoices(u){const l=(0,e.createNoDashGuid)(),g=await this.privRestAdapter.getVoicesList(l);if(g.ok&&Array.isArray(g.json)){let h=g.json;return u&&u.length>0&&(h=h.filter(p=>!!p.Locale&&p.Locale.toLowerCase()===u.toLowerCase())),new o.SynthesisVoicesResult(l,h,void 0)}else return new o.SynthesisVoicesResult(l,void 0,`Error: ${g.status}: ${g.statusText}`)}};return yd.SpeechSynthesizer=a,yd}var tI={};Object.defineProperty(tI,"__esModule",{value:!0}),tI.SynthesisResult=void 0;class e${constructor(e,A,r,i){this.privResultId=e,this.privReason=A,this.privErrorDetails=r,this.privProperties=i}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}tI.SynthesisResult=e$;var Qd={},YU;function t$(){if(YU)return Qd;YU=1,Object.defineProperty(Qd,"__esModule",{value:!0}),Qd.SpeechSynthesisResult=void 0;const t=Ve();let e=class extends t.SynthesisResult{constructor(r,i,n,o,s,a){super(r,i,o,s),this.privAudioData=n,this.privAudioDuration=a}get audioData(){return this.privAudioData}get audioDuration(){return this.privAudioDuration}};return Qd.SpeechSynthesisResult=e,Qd}var AI={};Object.defineProperty(AI,"__esModule",{value:!0}),AI.SpeechSynthesisEventArgs=void 0;class A${constructor(e){this.privResult=e}get result(){return this.privResult}}AI.SpeechSynthesisEventArgs=A$;var rI={};Object.defineProperty(rI,"__esModule",{value:!0}),rI.SpeechSynthesisWordBoundaryEventArgs=void 0;class r${constructor(e,A,r,i,n,o){this.privAudioOffset=e,this.privDuration=A,this.privText=r,this.privWordLength=i,this.privTextOffset=n,this.privBoundaryType=o}get audioOffset(){return this.privAudioOffset}get duration(){return this.privDuration}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}get boundaryType(){return this.privBoundaryType}}rI.SpeechSynthesisWordBoundaryEventArgs=r$;var iI={};Object.defineProperty(iI,"__esModule",{value:!0}),iI.SpeechSynthesisBookmarkEventArgs=void 0;class i${constructor(e,A){this.privAudioOffset=e,this.privText=A}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}iI.SpeechSynthesisBookmarkEventArgs=i$;var nI={};Object.defineProperty(nI,"__esModule",{value:!0}),nI.SpeechSynthesisVisemeEventArgs=void 0;class n${constructor(e,A,r){this.privAudioOffset=e,this.privVisemeId=A,this.privAnimation=r}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}nI.SpeechSynthesisVisemeEventArgs=n$;var HU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SpeechSynthesisBoundaryType=void 0,function(e){e.Word="WordBoundary",e.Punctuation="PunctuationBoundary",e.Sentence="SentenceBoundary"}(t.SpeechSynthesisBoundaryType||(t.SpeechSynthesisBoundaryType={}))})(HU);var Rd={},zU;function s$(){if(zU)return Rd;zU=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.SynthesisVoicesResult=void 0;const t=Ve();let e=class extends t.SynthesisResult{constructor(r,i,n){if(Array.isArray(i)){super(r,t.ResultReason.VoicesListRetrieved,void 0,new t.PropertyCollection),this.privVoices=[];for(const o of i)this.privVoices.push(new t.VoiceInfo(o))}else super(r,t.ResultReason.Canceled,n||"Error information unavailable",new t.PropertyCollection)}get voices(){return this.privVoices}};return Rd.SynthesisVoicesResult=e,Rd}var JU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.VoiceInfo=t.SynthesisVoiceType=t.SynthesisVoiceGender=void 0;var e;(function(o){o[o.Unknown=0]="Unknown",o[o.Female=1]="Female",o[o.Male=2]="Male",o[o.Neutral=3]="Neutral"})(e=t.SynthesisVoiceGender||(t.SynthesisVoiceGender={}));var A;(function(o){o[o.Unknown=0]="Unknown",o[o.OnlineNeural=1]="OnlineNeural",o[o.OnlineStandard=2]="OnlineStandard",o[o.OfflineNeural=3]="OfflineNeural",o[o.OfflineStandard=4]="OfflineStandard",o[o.OnlineNeuralHD=5]="OnlineNeuralHD"})(A=t.SynthesisVoiceType||(t.SynthesisVoiceType={}));const r={[e[e.Neutral]]:e.Neutral,[e[e.Male]]:e.Male,[e[e.Female]]:e.Female},i={Neural:A.OnlineNeural,NeuralHD:A.OnlineNeuralHD};class n{constructor(s){if(this.privStyleList=[],s){if(this.privName=s.Name,this.privLocale=s.Locale,this.privShortName=s.ShortName,this.privLocaleName=s.LocaleName,this.privDisplayName=s.DisplayName,this.privLocalName=s.LocalName,this.privVoiceType=i[s.VoiceType]||A.Unknown,this.privGender=r[s.Gender]||e.Unknown,s.StyleList&&Array.isArray(s.StyleList))for(const a of s.StyleList)this.privStyleList.push(a);this.privSampleRateHertz=s.SampleRateHertz,this.privStatus=s.Status,s.ExtendedPropertyMap&&(this.privExtendedPropertyMap=s.ExtendedPropertyMap),this.privWordsPerMinute=s.WordsPerMinute,Array.isArray(s.SecondaryLocaleList)&&(this.privSecondaryLocaleList=[...s.SecondaryLocaleList]),Array.isArray(s.RolePlayList)&&(this.privRolePlayList=[...s.RolePlayList]),s.VoiceTag&&(this.privVoiceTag=s.VoiceTag)}}get name(){return this.privName}get locale(){return this.privLocale}get shortName(){return this.privShortName}get displayName(){return this.privDisplayName}get localName(){return this.privLocalName}get localeName(){return this.privLocaleName}get gender(){return this.privGender}get voiceType(){return this.privVoiceType}get styleList(){return this.privStyleList}get sampleRateHertz(){return this.privSampleRateHertz}get status(){return this.privStatus}get extendedPropertyMap(){return this.privExtendedPropertyMap}get wordsPerMinute(){return this.privWordsPerMinute}get secondaryLocaleList(){return this.privSecondaryLocaleList}get rolePlayList(){return this.privRolePlayList}get voiceTag(){return this.privVoiceTag}}t.VoiceInfo=n})(JU);var sI={};Object.defineProperty(sI,"__esModule",{value:!0}),sI.SpeakerAudioDestination=void 0;const qc=Mt(),o$=li,an=ya,a$=60*30,qU={[an.AudioFormatTag.PCM]:"audio/wav",[an.AudioFormatTag.MuLaw]:"audio/x-wav",[an.AudioFormatTag.MP3]:"audio/mpeg",[an.AudioFormatTag.OGG_OPUS]:"audio/ogg",[an.AudioFormatTag.WEBM_OPUS]:"audio/webm; codecs=opus",[an.AudioFormatTag.ALaw]:"audio/x-wav",[an.AudioFormatTag.FLAC]:"audio/flac",[an.AudioFormatTag.AMR_WB]:"audio/amr-wb",[an.AudioFormatTag.G722]:"audio/G722"};class c${constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||(0,qc.createNoDashGuid)(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,A,r){this.privAudioBuffer!==void 0?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then(()=>{A&&A()},i=>{r&&r(i)})):this.privAudioOutputStream!==void 0&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,A){if(this.privIsClosed=!0,this.privSourceBuffer!==void 0)this.handleSourceBufferUpdateEnd().then(()=>{e&&e()},r=>{A&&A(r)});else if(this.privAudioOutputStream!==void 0&&typeof window<"u")if((this.privFormat.formatTag===an.AudioFormatTag.PCM||this.privFormat.formatTag===an.AudioFormatTag.MuLaw||this.privFormat.formatTag===an.AudioFormatTag.ALaw)&&this.privFormat.hasHeader===!1)console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else{let r=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(r).then(()=>{r=this.privFormat.addHeader(r);const i=new Blob([r],{type:qU[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(i),this.notifyPlayback().then(()=>{e&&e()},n=>{A&&A(n)})},i=>{A&&A(i)})}else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if(typeof AudioContext<"u"||typeof window<"u"&&typeof window.webkitAudioContext<"u"){this.privFormat=e;const A=qU[this.privFormat.formatTag];A===void 0?console.warn(`Unknown mimeType for format ${an.AudioFormatTag[this.privFormat.formatTag]}; playback is not supported.`):typeof MediaSource<"u"&&MediaSource.isTypeSupported(A)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=()=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=a$,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(A),this.privSourceBuffer.onupdate=()=>{this.updateSourceBuffer().catch(r=>{qc.Events.instance.onEvent(new qc.BackgroundEvent(r))})},this.privSourceBuffer.onupdateend=()=>{this.handleSourceBufferUpdateEnd().catch(r=>{qc.Events.instance.onEvent(new qc.BackgroundEvent(r))})},this.privSourceBuffer.onupdatestart=()=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch(r=>{qc.Events.instance.onEvent(new qc.BackgroundEvent(r))})):(console.warn(`Format ${an.AudioFormatTag[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new o$.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){var e;return((e=this.privAudio)==null?void 0:e.volume)??-1}set volume(e){this.privAudio&&(this.privAudio.volume=e)}mute(){this.privAudio&&(this.privAudio.muted=!0)}unmute(){this.privAudio&&(this.privAudio.muted=!1)}get isClosed(){return this.privIsClosed}get currentTime(){return this.privAudio!==void 0?this.privAudio.currentTime:-1}pause(){!this.privIsPaused&&this.privAudio!==void 0&&(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,A){this.privIsPaused&&this.privAudio!==void 0&&(this.privAudio.play().then(()=>{e&&e()},r=>{A&&A(r)}),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}async updateSourceBuffer(){if(this.privAudioBuffer!==void 0&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch{this.privAudioBuffer.unshift(e),console.log("buffer filled, pausing addition of binaries until space is made");return}await this.notifyPlayback()}else this.canEndStream()&&await this.handleSourceBufferUpdateEnd()}async handleSourceBufferUpdateEnd(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),await this.notifyPlayback())}async notifyPlayback(){!this.privPlaybackStarted&&this.privAudio!==void 0&&(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||await this.privAudio.play())}canEndStream(){return this.isClosed&&this.privSourceBuffer!==void 0&&this.privAudioBuffer.length===0&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&this.privMediaSource.readyState==="open"}sourceBufferAvailable(){return this.privSourceBuffer!==void 0&&!this.privSourceBuffer.updating}}sI.SpeakerAudioDestination=c$;var Dd={},VU;function u$(){if(VU)return Dd;VU=1,Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.ConversationTranscriptionCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Dd.ConversationTranscriptionCanceledEventArgs=e,Dd}var Td={},WU;function l$(){if(WU)return Td;WU=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.MeetingTranscriptionCanceledEventArgs=void 0;const t=Pg();let e=class extends t.CancellationEventArgsBase{};return Td.MeetingTranscriptionCanceledEventArgs=e,Td}var ZU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGradingSystem=void 0,function(e){e[e.FivePoint=1]="FivePoint",e[e.HundredMark=2]="HundredMark"}(t.PronunciationAssessmentGradingSystem||(t.PronunciationAssessmentGradingSystem={}))})(ZU);var XU={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PronunciationAssessmentGranularity=void 0,function(e){e[e.Phoneme=1]="Phoneme",e[e.Word=2]="Word",e[e.FullText=3]="FullText"}(t.PronunciationAssessmentGranularity||(t.PronunciationAssessmentGranularity={}))})(XU);var Ud={},_U;function h$(){if(_U)return Ud;_U=1,Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.PronunciationAssessmentConfig=void 0;const t=Ut,e=Ve();let A=class aj{constructor(i,n=e.PronunciationAssessmentGradingSystem.FivePoint,o=e.PronunciationAssessmentGranularity.Phoneme,s=!1){t.Contracts.throwIfNullOrUndefined(i,"referenceText"),this.privProperties=new e.PropertyCollection,this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_ReferenceText,i),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_GradingSystem,e.PronunciationAssessmentGradingSystem[n]),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_Granularity,e.PronunciationAssessmentGranularity[o]),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_EnableMiscue,String(s))}static fromJSON(i){t.Contracts.throwIfNullOrUndefined(i,"json");const n=new aj("");return n.privProperties=new e.PropertyCollection,n.properties.setProperty(e.PropertyId.PronunciationAssessment_Json,i),n}toJSON(){return this.updateJson(),this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_Params)}applyTo(i){this.updateJson();const n=i.internalData;n.expectContentAssessmentResponse=!!this.privContentAssessmentTopic,n.speechContext.setPronunciationAssessmentParams(this.properties.getProperty(e.PropertyId.PronunciationAssessment_Params),this.privContentAssessmentTopic,n.isSpeakerDiarizationEnabled)}get referenceText(){return this.properties.getProperty(e.PropertyId.PronunciationAssessment_ReferenceText)}set referenceText(i){t.Contracts.throwIfNullOrWhitespace(i,"referenceText"),this.properties.setProperty(e.PropertyId.PronunciationAssessment_ReferenceText,i)}set phonemeAlphabet(i){t.Contracts.throwIfNullOrWhitespace(i,"phonemeAlphabet"),this.privPhonemeAlphabet=i}set enableMiscue(i){const n=i?"true":"false";this.properties.setProperty(e.PropertyId.PronunciationAssessment_EnableMiscue,n)}get enableMiscue(){return this.properties.getProperty(e.PropertyId.PronunciationAssessment_EnableMiscue,"false").toLowerCase()==="true"}set nbestPhonemeCount(i){this.privNBestPhonemeCount=i}set enableProsodyAssessment(i){this.privEnableProsodyAssessment=i}enableContentAssessmentWithTopic(i){this.privContentAssessmentTopic=i}get properties(){return this.privProperties}updateJson(){const i=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_Json,"{}"),n=JSON.parse(i),o=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_ReferenceText);o&&(n.referenceText=o);const s=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_GradingSystem);s&&(n.gradingSystem=s);const a=this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_Granularity);a&&(n.granularity=a),this.privPhonemeAlphabet&&(n.phonemeAlphabet=this.privPhonemeAlphabet),this.privNBestPhonemeCount&&(n.nbestPhonemeCount=this.privNBestPhonemeCount),n.enableProsodyAssessment=this.privEnableProsodyAssessment,n.dimension="Comprehensive",this.privProperties.getProperty(e.PropertyId.PronunciationAssessment_EnableMiscue)&&(n.enableMiscue=this.enableMiscue),this.privProperties.setProperty(e.PropertyId.PronunciationAssessment_Params,JSON.stringify(n))}};return Ud.PronunciationAssessmentConfig=A,Ud}var Vc={},$U;function g$(){if($U)return Vc;$U=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.PronunciationAssessmentResult=Vc.ContentAssessmentResult=void 0;const t=Ut,e=Ve();class A{constructor(n){this.privPronJson=n}get grammarScore(){return this.privPronJson.ContentAssessment.GrammarScore}get vocabularyScore(){return this.privPronJson.ContentAssessment.VocabularyScore}get topicScore(){return this.privPronJson.ContentAssessment.TopicScore}}Vc.ContentAssessmentResult=A;let r=class cj{constructor(n){const o=JSON.parse(n);t.Contracts.throwIfNullOrUndefined(o.NBest[0],"NBest"),this.privPronJson=o.NBest[0]}static fromResult(n){t.Contracts.throwIfNullOrUndefined(n,"result");const o=n.properties.getProperty(e.PropertyId.SpeechServiceResponse_JsonResult);return t.Contracts.throwIfNullOrUndefined(o,"json"),new cj(o)}get detailResult(){return this.privPronJson}get accuracyScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.AccuracyScore}get pronunciationScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.PronScore}get completenessScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.CompletenessScore}get fluencyScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.FluencyScore}get prosodyScore(){var n;return(n=this.detailResult.PronunciationAssessment)==null?void 0:n.ProsodyScore}get contentAssessmentResult(){if(this.detailResult.ContentAssessment!==void 0)return new A(this.detailResult)}};return Vc.PronunciationAssessmentResult=r,Vc}var Ld={},eL;function d$(){if(eL)return Ld;eL=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.AvatarConfig=void 0;const t=Ut,e=Ve();let A=class{constructor(i,n,o){this.privCustomized=!1,this.privUseBuiltInVoice=!1,t.Contracts.throwIfNullOrWhitespace(i,"character"),this.character=i,this.style=n,o===void 0&&(o=new e.AvatarVideoFormat),this.videoFormat=o}get customized(){return this.privCustomized}set customized(i){this.privCustomized=i}get useBuiltInVoice(){return this.privUseBuiltInVoice}set useBuiltInVoice(i){this.privUseBuiltInVoice=i}get backgroundColor(){return this.privBackgroundColor}set backgroundColor(i){this.privBackgroundColor=i}get backgroundImage(){return this.privBackgroundImage}set backgroundImage(i){this.privBackgroundImage=i}get remoteIceServers(){return this.privRemoteIceServers}set remoteIceServers(i){this.privRemoteIceServers=i}};return Ld.AvatarConfig=A,Ld}var tL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.AvatarEventArgs=t.AvatarEventTypes=void 0,function(A){A.SwitchedToSpeaking="SwitchedToSpeaking",A.SwitchedToIdle="SwitchedToIdle",A.SessionClosed="SessionClosed"}(t.AvatarEventTypes||(t.AvatarEventTypes={}));class e{constructor(r,i){this.privOffset=r,this.privDescription=i}get type(){return this.privType}get offset(){return this.privOffset}get description(){return this.privDescription}}t.AvatarEventArgs=e})(tL);var Fd={},Od={},AL;function rL(){if(AL)return Od;AL=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.SpeechSynthesisConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr,n=ds;let o=class{constructor(){this.synthesisUri="/tts/cognitiveservices/websocket/v1"}async create(a,c,u){let l=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint,void 0);const g=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region,void 0),h=A.ConnectionFactoryBase.getHostSuffix(g),p=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_EndpointId,void 0),C=p===void 0?"tts":"voice",I=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,"wss://"+g+"."+C+".speech"+h),E={},v={};if(c.token!==void 0&&c.token!==""&&(v[c.headerName]=c.token),v[i.HeaderNames.ConnectionId]=u,p!==void 0&&p!==""&&(!l||l.search(n.QueryParameterNames.CustomVoiceDeploymentId)===-1)&&(E[n.QueryParameterNames.CustomVoiceDeploymentId]=p),a.avatarEnabled&&(!l||l.search(n.QueryParameterNames.EnableAvatar)===-1)&&(E[n.QueryParameterNames.EnableAvatar]="true"),l){const M=new URL(l),O=M.pathname;(O===""||O==="/")&&(M.pathname=this.synthesisUri,l=await A.ConnectionFactoryBase.getRedirectUrlFromEndpoint(M.toString()))}l||(l=I+this.synthesisUri),a.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,l);const m=a.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return new t.WebsocketConnection(l,E,v,new r.WebsocketMessageFormatter,t.ProxyInfo.fromParameters(a.parameters),m,u)}};return Od.SpeechSynthesisConnectionFactory=o,Od}var iL;function p$(){if(iL)return Fd;iL=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.AvatarSynthesizer=void 0;const t=rL(),e=ut(),A=Mt(),r=Qa,i=Ve(),n=Ut,o=L0();let s=class extends i.Synthesizer{constructor(c,u){super(c),n.Contracts.throwIfNullOrUndefined(u,"avatarConfig"),this.privConnectionFactory=new t.SpeechSynthesisConnectionFactory,this.privAvatarConfig=u,this.implCommonSynthesizeSetup()}implCommonSynthesizeSetup(){super.implCommonSynthesizeSetup(),this.privAdapter.audioOutputFormat=r.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormat(i.SpeechSynthesisOutputFormat.Riff24Khz16BitMonoPcm)}async startAvatarAsync(c){n.Contracts.throwIfNullOrUndefined(c,"peerConnection"),this.privIceServers=c.getConfiguration().iceServers,n.Contracts.throwIfNullOrUndefined(this.privIceServers,"Ice servers must be set.");const u=new A.Deferred;c.onicegatheringstatechange=()=>{A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice gathering state: "+c.iceGatheringState,A.EventType.Debug)),c.iceGatheringState==="complete"&&(A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice gathering complete.",A.EventType.Info)),u.resolve())},c.onicecandidate=C=>{C.candidate?A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice candidate: "+C.candidate.candidate,A.EventType.Debug)):(A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice candidate: complete",A.EventType.Debug)),u.resolve())},setTimeout(()=>{c.iceGatheringState!=="complete"&&(A.Events.instance.onEvent(new A.PlatformEvent("peer connection: ice gathering timeout.",A.EventType.Warning)),u.resolve())},2e3);const l=await c.createOffer();await c.setLocalDescription(l),await u.promise,A.Events.instance.onEvent(new A.PlatformEvent("peer connection: got local SDP.",A.EventType.Info)),this.privProperties.setProperty(i.PropertyId.TalkingAvatarService_WebRTC_SDP,JSON.stringify(c.localDescription));const g=await this.speak("",!1);if(g.reason!==i.ResultReason.SynthesizingAudioCompleted)return new i.SynthesisResult(g.resultId,g.reason,g.errorDetails,g.properties);const h=atob(g.properties.getProperty(i.PropertyId.TalkingAvatarService_WebRTC_SDP)),p=new RTCSessionDescription(JSON.parse(h));return await c.setRemoteDescription(p),new i.SynthesisResult(g.resultId,g.reason,void 0,g.properties)}async speakTextAsync(c){const u=await this.speak(c,!1);return new i.SynthesisResult(u.resultId,u.reason,u.errorDetails,u.properties)}async speakSsmlAsync(c){const u=await this.speak(c,!0);return new i.SynthesisResult(u.resultId,u.reason,u.errorDetails,u.properties)}async stopSpeakingAsync(){for(;this.synthesisRequestQueue.length()>0;)(await this.synthesisRequestQueue.dequeue()).err("Synthesis is canceled by user.");return this.privAdapter.stopSpeaking()}async stopAvatarAsync(){return n.Contracts.throwIfDisposed(this.privDisposed),this.dispose(!0)}async close(){if(!this.privDisposed)return this.dispose(!0)}get iceServers(){return this.privIceServers}createSynthesisAdapter(c,u,l){return new e.AvatarSynthesisAdapter(c,u,l,this,this.privAvatarConfig)}createRestSynthesisAdapter(c,u){}createSynthesizerConfig(c){const u=super.createSynthesizerConfig(c);return u.avatarEnabled=!0,u}async speak(c,u){const l=(0,A.createNoDashGuid)(),g=new A.Deferred;return this.synthesisRequestQueue.enqueue(new o.SynthesisRequest(l,c,u,h=>{g.resolve(h),this.privSynthesizing=!1,this.adapterSpeak()},h=>{g.reject(h),this.privSynthesizing=!1})),this.adapterSpeak(),g.promise}};return Fd.AvatarSynthesizer=s,Fd}var Rl={};Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.AvatarVideoFormat=Rl.Coordinate=void 0;class f${constructor(e,A){this.x=e,this.y=A}}Rl.Coordinate=f$;class E${constructor(e="H264",A=2e6,r=1920,i=1080){this.codec=e,this.bitrate=A,this.width=r,this.height=i}setCropRange(e,A){this.cropRange={bottomRight:A,topLeft:e}}}Rl.AvatarVideoFormat=E$;var bd={},nL;function C$(){if(nL)return bd;nL=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.AvatarWebRTCConnectionResult=void 0;const t=Ve();let e=class extends t.SynthesisResult{constructor(r,i,n,o,s){super(i,n,o,s),this.privSDPAnswer=r}get SDPAnswer(){return this.privSDPAnswer}};return bd.AvatarWebRTCConnectionResult=e,bd}var xd={},sL;function I$(){if(sL)return xd;sL=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Diagnostics=void 0;const t=Zr(),e=Mt();let A=class{static SetLoggingLevel(i){this.privListener=new t.ConsoleLoggingListener(i),e.Events.instance.attachConsoleListener(this.privListener)}static StartConsoleOutput(){this.privListener&&(this.privListener.enableConsoleOutput=!0)}static StopConsoleOutput(){this.privListener&&(this.privListener.enableConsoleOutput=!1)}static SetLogOutputPath(i){if(typeof window>"u")this.privListener&&(this.privListener.logPath=i);else throw new Error("File system logging not available in browser.")}static set onLogOutput(i){this.privListener&&(this.privListener.logCallback=i)}};return xd.Diagnostics=A,A.privListener=void 0,xd}var oL;function Ve(){return oL||(oL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionEventArgs=t.CancellationErrorCode=t.CancellationDetails=t.CancellationDetailsBase=t.IntentRecognitionCanceledEventArgs=t.TranslationRecognitionCanceledEventArgs=t.NoMatchDetails=t.NoMatchReason=t.Translations=t.TranslationRecognizer=t.VoiceProfileType=t.IntentRecognizer=t.SpeechRecognizer=t.Recognizer=t.PropertyId=t.PropertyCollection=t.SpeechTranslationConfigImpl=t.SpeechTranslationConfig=t.SpeechConfigImpl=t.SpeechConfig=t.ResultReason=t.TranslationSynthesisResult=t.TranslationRecognitionResult=t.TranslationSynthesisEventArgs=t.TranslationRecognitionEventArgs=t.SpeechRecognitionCanceledEventArgs=t.MeetingTranscriptionEventArgs=t.ConversationTranscriptionEventArgs=t.SpeechRecognitionEventArgs=t.LanguageUnderstandingModel=t.IntentRecognitionResult=t.SpeechRecognitionResult=t.RecognitionResult=t.IntentRecognitionEventArgs=t.OutputFormat=t.RecognitionEventArgs=t.SessionEventArgs=t.KeywordRecognitionModel=t.PushAudioOutputStreamCallback=t.PullAudioInputStreamCallback=t.CancellationReason=t.PushAudioOutputStream=t.PullAudioOutputStream=t.AudioOutputStream=t.PushAudioInputStream=t.PullAudioInputStream=t.AudioInputStream=t.AudioFormatTag=t.AudioStreamFormat=t.AudioConfig=void 0,t.SpeechSynthesisEventArgs=t.SpeechSynthesisResult=t.SynthesisResult=t.SpeechSynthesizer=t.SpeechSynthesisOutputFormat=t.Synthesizer=t.User=t.ParticipantChangedReason=t.Participant=t.MeetingTranscriber=t.Meeting=t.ConversationTranscriptionResult=t.ConversationTranscriber=t.ConversationTranslator=t.ConversationTranslationResult=t.ConversationTranslationEventArgs=t.ConversationTranslationCanceledEventArgs=t.ConversationParticipantsChangedEventArgs=t.ConversationExpirationEventArgs=t.Conversation=t.SpeakerRecognitionCancellationDetails=t.SpeakerRecognitionResultType=t.SpeakerRecognitionResult=t.SourceLanguageConfig=t.AutoDetectSourceLanguageResult=t.AutoDetectSourceLanguageConfig=t.SpeakerVerificationModel=t.SpeakerIdentificationModel=t.SpeakerRecognizer=t.VoiceProfileClient=t.VoiceProfilePhraseResult=t.VoiceProfileCancellationDetails=t.VoiceProfileResult=t.VoiceProfileEnrollmentCancellationDetails=t.VoiceProfileEnrollmentResult=t.VoiceProfile=t.ConnectionMessage=t.ConnectionMessageEventArgs=t.BaseAudioPlayer=t.ProfanityOption=t.ServicePropertyChannel=t.TurnStatusReceivedEventArgs=t.ActivityReceivedEventArgs=t.DialogServiceConnector=t.CustomCommandsConfig=t.BotFrameworkConfig=t.DialogServiceConfig=t.PhraseListGrammar=t.Connection=t.ServiceEventArgs=void 0,t.LogLevel=t.Diagnostics=t.AvatarWebRTCConnectionResult=t.Coordinate=t.AvatarVideoFormat=t.AvatarSynthesizer=t.AvatarEventArgs=t.AvatarConfig=t.LanguageIdMode=t.PronunciationAssessmentResult=t.PronunciationAssessmentConfig=t.PronunciationAssessmentGranularity=t.PronunciationAssessmentGradingSystem=t.MeetingTranscriptionCanceledEventArgs=t.ConversationTranscriptionCanceledEventArgs=t.SpeakerAudioDestination=t.VoiceInfo=t.SynthesisVoiceType=t.SynthesisVoiceGender=t.SynthesisVoicesResult=t.SpeechSynthesisBoundaryType=t.SpeechSynthesisVisemeEventArgs=t.SpeechSynthesisBookmarkEventArgs=t.SpeechSynthesisWordBoundaryEventArgs=void 0;var e=v2();Object.defineProperty(t,"AudioConfig",{enumerable:!0,get:function(){return e.AudioConfig}});var A=ya;Object.defineProperty(t,"AudioStreamFormat",{enumerable:!0,get:function(){return A.AudioStreamFormat}}),Object.defineProperty(t,"AudioFormatTag",{enumerable:!0,get:function(){return A.AudioFormatTag}});var r=f2();Object.defineProperty(t,"AudioInputStream",{enumerable:!0,get:function(){return r.AudioInputStream}}),Object.defineProperty(t,"PullAudioInputStream",{enumerable:!0,get:function(){return r.PullAudioInputStream}}),Object.defineProperty(t,"PushAudioInputStream",{enumerable:!0,get:function(){return r.PushAudioInputStream}});var i=li;Object.defineProperty(t,"AudioOutputStream",{enumerable:!0,get:function(){return i.AudioOutputStream}}),Object.defineProperty(t,"PullAudioOutputStream",{enumerable:!0,get:function(){return i.PullAudioOutputStream}}),Object.defineProperty(t,"PushAudioOutputStream",{enumerable:!0,get:function(){return i.PushAudioOutputStream}});var n=w2;Object.defineProperty(t,"CancellationReason",{enumerable:!0,get:function(){return n.CancellationReason}});var o=xC;Object.defineProperty(t,"PullAudioInputStreamCallback",{enumerable:!0,get:function(){return o.PullAudioInputStreamCallback}});var s=NC;Object.defineProperty(t,"PushAudioOutputStreamCallback",{enumerable:!0,get:function(){return s.PushAudioOutputStreamCallback}});var a=KC;Object.defineProperty(t,"KeywordRecognitionModel",{enumerable:!0,get:function(){return a.KeywordRecognitionModel}});var c=kC;Object.defineProperty(t,"SessionEventArgs",{enumerable:!0,get:function(){return c.SessionEventArgs}});var u=VX();Object.defineProperty(t,"RecognitionEventArgs",{enumerable:!0,get:function(){return u.RecognitionEventArgs}});var l=M2;Object.defineProperty(t,"OutputFormat",{enumerable:!0,get:function(){return l.OutputFormat}});var g=WX();Object.defineProperty(t,"IntentRecognitionEventArgs",{enumerable:!0,get:function(){return g.IntentRecognitionEventArgs}});var h=PC;Object.defineProperty(t,"RecognitionResult",{enumerable:!0,get:function(){return h.RecognitionResult}});var p=XX();Object.defineProperty(t,"SpeechRecognitionResult",{enumerable:!0,get:function(){return p.SpeechRecognitionResult}});var C=_X();Object.defineProperty(t,"IntentRecognitionResult",{enumerable:!0,get:function(){return C.IntentRecognitionResult}});var I=yl;Object.defineProperty(t,"LanguageUnderstandingModel",{enumerable:!0,get:function(){return I.LanguageUnderstandingModel}});var E=$X();Object.defineProperty(t,"SpeechRecognitionEventArgs",{enumerable:!0,get:function(){return E.SpeechRecognitionEventArgs}}),Object.defineProperty(t,"ConversationTranscriptionEventArgs",{enumerable:!0,get:function(){return E.ConversationTranscriptionEventArgs}}),Object.defineProperty(t,"MeetingTranscriptionEventArgs",{enumerable:!0,get:function(){return E.MeetingTranscriptionEventArgs}});var v=e_();Object.defineProperty(t,"SpeechRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return v.SpeechRecognitionCanceledEventArgs}});var m=t_();Object.defineProperty(t,"TranslationRecognitionEventArgs",{enumerable:!0,get:function(){return m.TranslationRecognitionEventArgs}});var M=A_();Object.defineProperty(t,"TranslationSynthesisEventArgs",{enumerable:!0,get:function(){return M.TranslationSynthesisEventArgs}});var O=x2();Object.defineProperty(t,"TranslationRecognitionResult",{enumerable:!0,get:function(){return O.TranslationRecognitionResult}});var x=jC;Object.defineProperty(t,"TranslationSynthesisResult",{enumerable:!0,get:function(){return x.TranslationSynthesisResult}});var P=N2;Object.defineProperty(t,"ResultReason",{enumerable:!0,get:function(){return P.ResultReason}});var D=i_();Object.defineProperty(t,"SpeechConfig",{enumerable:!0,get:function(){return D.SpeechConfig}}),Object.defineProperty(t,"SpeechConfigImpl",{enumerable:!0,get:function(){return D.SpeechConfigImpl}});var T=n_();Object.defineProperty(t,"SpeechTranslationConfig",{enumerable:!0,get:function(){return T.SpeechTranslationConfig}}),Object.defineProperty(t,"SpeechTranslationConfigImpl",{enumerable:!0,get:function(){return T.SpeechTranslationConfigImpl}});var q=G2();Object.defineProperty(t,"PropertyCollection",{enumerable:!0,get:function(){return q.PropertyCollection}});var Q=YC;Object.defineProperty(t,"PropertyId",{enumerable:!0,get:function(){return Q.PropertyId}});var R=s_();Object.defineProperty(t,"Recognizer",{enumerable:!0,get:function(){return R.Recognizer}});var G=o_();Object.defineProperty(t,"SpeechRecognizer",{enumerable:!0,get:function(){return G.SpeechRecognizer}});var k=a_();Object.defineProperty(t,"IntentRecognizer",{enumerable:!0,get:function(){return k.IntentRecognizer}});var te=z2;Object.defineProperty(t,"VoiceProfileType",{enumerable:!0,get:function(){return te.VoiceProfileType}});var X=c_();Object.defineProperty(t,"TranslationRecognizer",{enumerable:!0,get:function(){return X.TranslationRecognizer}});var ie=u_();Object.defineProperty(t,"Translations",{enumerable:!0,get:function(){return ie.Translations}});var W=_2;Object.defineProperty(t,"NoMatchReason",{enumerable:!0,get:function(){return W.NoMatchReason}});var se=l_();Object.defineProperty(t,"NoMatchDetails",{enumerable:!0,get:function(){return se.NoMatchDetails}});var Be=HC;Object.defineProperty(t,"TranslationRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return Be.TranslationRecognitionCanceledEventArgs}});var Ee=g_();Object.defineProperty(t,"IntentRecognitionCanceledEventArgs",{enumerable:!0,get:function(){return Ee.IntentRecognitionCanceledEventArgs}});var U=$g;Object.defineProperty(t,"CancellationDetailsBase",{enumerable:!0,get:function(){return U.CancellationDetailsBase}});var Y=p_();Object.defineProperty(t,"CancellationDetails",{enumerable:!0,get:function(){return Y.CancellationDetails}});var _=AU;Object.defineProperty(t,"CancellationErrorCode",{enumerable:!0,get:function(){return _.CancellationErrorCode}});var re=f_();Object.defineProperty(t,"ConnectionEventArgs",{enumerable:!0,get:function(){return re.ConnectionEventArgs}});var ae=E_();Object.defineProperty(t,"ServiceEventArgs",{enumerable:!0,get:function(){return ae.ServiceEventArgs}});var Z=W2();Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return Z.Connection}});var ce=zC;Object.defineProperty(t,"PhraseListGrammar",{enumerable:!0,get:function(){return ce.PhraseListGrammar}});var oe=m0();Object.defineProperty(t,"DialogServiceConfig",{enumerable:!0,get:function(){return oe.DialogServiceConfig}});var de=C_();Object.defineProperty(t,"BotFrameworkConfig",{enumerable:!0,get:function(){return de.BotFrameworkConfig}});var De=I_();Object.defineProperty(t,"CustomCommandsConfig",{enumerable:!0,get:function(){return De.CustomCommandsConfig}});var j=v_();Object.defineProperty(t,"DialogServiceConnector",{enumerable:!0,get:function(){return j.DialogServiceConnector}});var J=JC;Object.defineProperty(t,"ActivityReceivedEventArgs",{enumerable:!0,get:function(){return J.ActivityReceivedEventArgs}});var z=qC;Object.defineProperty(t,"TurnStatusReceivedEventArgs",{enumerable:!0,get:function(){return z.TurnStatusReceivedEventArgs}});var b=lU;Object.defineProperty(t,"ServicePropertyChannel",{enumerable:!0,get:function(){return b.ServicePropertyChannel}});var Me=hU;Object.defineProperty(t,"ProfanityOption",{enumerable:!0,get:function(){return Me.ProfanityOption}});var Qe=M_();Object.defineProperty(t,"BaseAudioPlayer",{enumerable:!0,get:function(){return Qe.BaseAudioPlayer}});var Te=WC;Object.defineProperty(t,"ConnectionMessageEventArgs",{enumerable:!0,get:function(){return Te.ConnectionMessageEventArgs}});var Ce=q2();Object.defineProperty(t,"ConnectionMessage",{enumerable:!0,get:function(){return Ce.ConnectionMessage}});var Re=ZC;Object.defineProperty(t,"VoiceProfile",{enumerable:!0,get:function(){return Re.VoiceProfile}});var ve=R_();Object.defineProperty(t,"VoiceProfileEnrollmentResult",{enumerable:!0,get:function(){return ve.VoiceProfileEnrollmentResult}}),Object.defineProperty(t,"VoiceProfileEnrollmentCancellationDetails",{enumerable:!0,get:function(){return ve.VoiceProfileEnrollmentCancellationDetails}});var Ke=D_();Object.defineProperty(t,"VoiceProfileResult",{enumerable:!0,get:function(){return Ke.VoiceProfileResult}}),Object.defineProperty(t,"VoiceProfileCancellationDetails",{enumerable:!0,get:function(){return Ke.VoiceProfileCancellationDetails}});var Ue=T_();Object.defineProperty(t,"VoiceProfilePhraseResult",{enumerable:!0,get:function(){return Ue.VoiceProfilePhraseResult}});var ke=U_();Object.defineProperty(t,"VoiceProfileClient",{enumerable:!0,get:function(){return ke.VoiceProfileClient}});var Ye=L_();Object.defineProperty(t,"SpeakerRecognizer",{enumerable:!0,get:function(){return Ye.SpeakerRecognizer}});var Je=F_();Object.defineProperty(t,"SpeakerIdentificationModel",{enumerable:!0,get:function(){return Je.SpeakerIdentificationModel}});var rt=O_();Object.defineProperty(t,"SpeakerVerificationModel",{enumerable:!0,get:function(){return rt.SpeakerVerificationModel}});var Ze=b_();Object.defineProperty(t,"AutoDetectSourceLanguageConfig",{enumerable:!0,get:function(){return Ze.AutoDetectSourceLanguageConfig}});var We=XC;Object.defineProperty(t,"AutoDetectSourceLanguageResult",{enumerable:!0,get:function(){return We.AutoDetectSourceLanguageResult}});var At=$C;Object.defineProperty(t,"SourceLanguageConfig",{enumerable:!0,get:function(){return At.SourceLanguageConfig}});var _e=N_();Object.defineProperty(t,"SpeakerRecognitionResult",{enumerable:!0,get:function(){return _e.SpeakerRecognitionResult}}),Object.defineProperty(t,"SpeakerRecognitionResultType",{enumerable:!0,get:function(){return _e.SpeakerRecognitionResultType}}),Object.defineProperty(t,"SpeakerRecognitionCancellationDetails",{enumerable:!0,get:function(){return _e.SpeakerRecognitionCancellationDetails}});var It=U0();Object.defineProperty(t,"Conversation",{enumerable:!0,get:function(){return It.Conversation}}),Object.defineProperty(t,"ConversationExpirationEventArgs",{enumerable:!0,get:function(){return It.ConversationExpirationEventArgs}}),Object.defineProperty(t,"ConversationParticipantsChangedEventArgs",{enumerable:!0,get:function(){return It.ConversationParticipantsChangedEventArgs}}),Object.defineProperty(t,"ConversationTranslationCanceledEventArgs",{enumerable:!0,get:function(){return It.ConversationTranslationCanceledEventArgs}}),Object.defineProperty(t,"ConversationTranslationEventArgs",{enumerable:!0,get:function(){return It.ConversationTranslationEventArgs}}),Object.defineProperty(t,"ConversationTranslationResult",{enumerable:!0,get:function(){return It.ConversationTranslationResult}}),Object.defineProperty(t,"ConversationTranslator",{enumerable:!0,get:function(){return It.ConversationTranslator}}),Object.defineProperty(t,"ConversationTranscriber",{enumerable:!0,get:function(){return It.ConversationTranscriber}}),Object.defineProperty(t,"ConversationTranscriptionResult",{enumerable:!0,get:function(){return It.ConversationTranscriptionResult}}),Object.defineProperty(t,"Meeting",{enumerable:!0,get:function(){return It.Meeting}}),Object.defineProperty(t,"MeetingTranscriber",{enumerable:!0,get:function(){return It.MeetingTranscriber}}),Object.defineProperty(t,"Participant",{enumerable:!0,get:function(){return It.Participant}}),Object.defineProperty(t,"ParticipantChangedReason",{enumerable:!0,get:function(){return It.ParticipantChangedReason}}),Object.defineProperty(t,"User",{enumerable:!0,get:function(){return It.User}});var yt=L0();Object.defineProperty(t,"Synthesizer",{enumerable:!0,get:function(){return yt.Synthesizer}});var tt=I0;Object.defineProperty(t,"SpeechSynthesisOutputFormat",{enumerable:!0,get:function(){return tt.SpeechSynthesisOutputFormat}});var et=$_();Object.defineProperty(t,"SpeechSynthesizer",{enumerable:!0,get:function(){return et.SpeechSynthesizer}});var St=tI;Object.defineProperty(t,"SynthesisResult",{enumerable:!0,get:function(){return St.SynthesisResult}});var ct=t$();Object.defineProperty(t,"SpeechSynthesisResult",{enumerable:!0,get:function(){return ct.SpeechSynthesisResult}});var Rt=AI;Object.defineProperty(t,"SpeechSynthesisEventArgs",{enumerable:!0,get:function(){return Rt.SpeechSynthesisEventArgs}});var Ge=rI;Object.defineProperty(t,"SpeechSynthesisWordBoundaryEventArgs",{enumerable:!0,get:function(){return Ge.SpeechSynthesisWordBoundaryEventArgs}});var Jt=iI;Object.defineProperty(t,"SpeechSynthesisBookmarkEventArgs",{enumerable:!0,get:function(){return Jt.SpeechSynthesisBookmarkEventArgs}});var oA=nI;Object.defineProperty(t,"SpeechSynthesisVisemeEventArgs",{enumerable:!0,get:function(){return oA.SpeechSynthesisVisemeEventArgs}});var Qt=HU;Object.defineProperty(t,"SpeechSynthesisBoundaryType",{enumerable:!0,get:function(){return Qt.SpeechSynthesisBoundaryType}});var Xe=s$();Object.defineProperty(t,"SynthesisVoicesResult",{enumerable:!0,get:function(){return Xe.SynthesisVoicesResult}});var AA=JU;Object.defineProperty(t,"SynthesisVoiceGender",{enumerable:!0,get:function(){return AA.SynthesisVoiceGender}}),Object.defineProperty(t,"SynthesisVoiceType",{enumerable:!0,get:function(){return AA.SynthesisVoiceType}}),Object.defineProperty(t,"VoiceInfo",{enumerable:!0,get:function(){return AA.VoiceInfo}});var dn=sI;Object.defineProperty(t,"SpeakerAudioDestination",{enumerable:!0,get:function(){return dn.SpeakerAudioDestination}});var $t=u$();Object.defineProperty(t,"ConversationTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return $t.ConversationTranscriptionCanceledEventArgs}});var Tr=l$();Object.defineProperty(t,"MeetingTranscriptionCanceledEventArgs",{enumerable:!0,get:function(){return Tr.MeetingTranscriptionCanceledEventArgs}});var Ni=ZU;Object.defineProperty(t,"PronunciationAssessmentGradingSystem",{enumerable:!0,get:function(){return Ni.PronunciationAssessmentGradingSystem}});var Bt=XU;Object.defineProperty(t,"PronunciationAssessmentGranularity",{enumerable:!0,get:function(){return Bt.PronunciationAssessmentGranularity}});var Ur=h$();Object.defineProperty(t,"PronunciationAssessmentConfig",{enumerable:!0,get:function(){return Ur.PronunciationAssessmentConfig}});var Ei=g$();Object.defineProperty(t,"PronunciationAssessmentResult",{enumerable:!0,get:function(){return Ei.PronunciationAssessmentResult}});var ti=y0;Object.defineProperty(t,"LanguageIdMode",{enumerable:!0,get:function(){return ti.LanguageIdMode}});var Ai=d$();Object.defineProperty(t,"AvatarConfig",{enumerable:!0,get:function(){return Ai.AvatarConfig}});var iA=tL;Object.defineProperty(t,"AvatarEventArgs",{enumerable:!0,get:function(){return iA.AvatarEventArgs}});var yA=p$();Object.defineProperty(t,"AvatarSynthesizer",{enumerable:!0,get:function(){return yA.AvatarSynthesizer}});var HA=Rl;Object.defineProperty(t,"AvatarVideoFormat",{enumerable:!0,get:function(){return HA.AvatarVideoFormat}}),Object.defineProperty(t,"Coordinate",{enumerable:!0,get:function(){return HA.Coordinate}});var pn=C$();Object.defineProperty(t,"AvatarWebRTCConnectionResult",{enumerable:!0,get:function(){return pn.AvatarWebRTCConnectionResult}});var ri=I$();Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return ri.Diagnostics}});var ii=g0;Object.defineProperty(t,"LogLevel",{enumerable:!0,get:function(){return ii.LogLevel}})}(E0)),E0}var aL;function B$(){if(aL)return Ug;aL=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.ProxyInfo=void 0;const t=Ve();let e=class uj{constructor(r,i,n,o){this.privProxyHostName=r,this.privProxyPort=i,this.privProxyUserName=n,this.privProxyPassword=o}static fromParameters(r){return new uj(r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyHostName),parseInt(r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyPort),10),r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyUserName),r.getProperty(t.PropertyId.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(r){return this.fromParameters(r.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}};return Ug.ProxyInfo=e,Ug}var cL={};const v$=new Set(["json","buffer","string"]);var w$=t=>(...e)=>{const A=new Set;let r,i,n,o="";return e.forEach(s=>{if(typeof s=="string")if(s.toUpperCase()===s)if(r){const a=`Can't set method to ${s}, already set to ${r}.`;throw new Error(a)}else r=s;else if(s.startsWith("http:")||s.startsWith("https:"))o=s;else if(v$.has(s))i=s;else throw new Error(`Unknown encoding, ${s}`);else if(typeof s=="number")A.add(s);else if(typeof s=="object")if(Array.isArray(s)||s instanceof Set)s.forEach(a=>A.add(a));else{if(n)throw new Error("Cannot set headers twice.");n=s}else throw new Error(`Unknown type: ${typeof s}`)}),r||(r="GET"),A.size===0&&A.add(200),t(A,r,i,n,o)};const S$=w$;class F0 extends Error{constructor(e,...A){super(...A),Error.captureStackTrace&&Error.captureStackTrace(this,F0),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);let r;Object.defineProperty(this,"responseBody",{get:()=>(r||(r=this.arrayBuffer()),r)}),this.headers={};for(const[n,o]of e.headers.entries())this.headers[n.toLowerCase()]=o}}var m$=S$((t,e,A,r,i)=>async(n,o,s={})=>{n=i+(n||"");let a=new URL(n);if(r||(r={}),a.username&&(r.Authorization="Basic "+btoa(a.username+":"+a.password),a=new URL(a.protocol+"//"+a.host+a.pathname+a.search)),a.protocol!=="https:"&&a.protocol!=="http:")throw new Error(`Unknown protocol, ${a.protocol}`);if(o&&!(o instanceof ArrayBuffer||ArrayBuffer.isView(o)||typeof o=="string"))if(typeof o=="object")o=JSON.stringify(o),r["Content-Type"]="application/json";else throw new Error("Unknown body type.");s=new Headers({...r||{},...s});const c=await fetch(a,{method:e,headers:s,body:o});if(c.statusCode=c.status,!t.has(c.status))throw new F0(c);return A==="json"?c.json():A==="buffer"?c.arrayBuffer():A==="string"?c.text():c});(function(t){var e=xt&&xt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(t,"__esModule",{value:!0}),t.RestMessageAdapter=t.RestRequestType=void 0;const A=e(m$),r=Mt();var i;(function(o){o.Get="GET",o.Post="POST",o.Delete="DELETE",o.File="file"})(i=t.RestRequestType||(t.RestRequestType={}));class n{constructor(s){if(!s)throw new r.ArgumentNullError("configParams");this.privHeaders=s.headers,this.privIgnoreCache=s.ignoreCache}static extractHeaderValue(s,a){let c="";try{const u=a.trim().split(/[\r\n]+/),l={};u.forEach(g=>{const h=g.split(": "),p=h.shift().toLowerCase(),C=h.join(": ");l[p]=C}),c=l[s.toLowerCase()]}catch{}return c}set options(s){this.privHeaders=s.headers,this.privIgnoreCache=s.ignoreCache}setHeaders(s,a){this.privHeaders[s]=a}request(s,a,c={},u=null){const l=new r.Deferred,g=s===i.File?"POST":s,h=(C,I={})=>{const E=C;return{data:JSON.stringify(I),headers:JSON.stringify(C.headers),json:I,ok:C.statusCode>=200&&C.statusCode<300,status:C.statusCode,statusText:I.error?I.error.message:E.statusText?E.statusText:E.statusMessage}},p=C=>{const I=(0,A.default)(a,g,this.privHeaders,200,201,202,204,400,401,402,403,404),E=this.queryParams(c)===""?"":`?${this.queryParams(c)}`;I(E,C).then(async v=>{if(s===i.Delete||v.statusCode===204)l.resolve(h(v));else try{const m=await v.json();l.resolve(h(v,m))}catch{l.resolve(h(v))}}).catch(v=>{l.reject(v)})};return this.privIgnoreCache&&(this.privHeaders["Cache-Control"]="no-cache"),s===i.Post&&u&&(this.privHeaders["content-type"]="application/json",this.privHeaders["Content-Type"]="application/json"),p(u),l.promise}queryParams(s={}){return Object.keys(s).map(a=>encodeURIComponent(a)+"="+encodeURIComponent(s[a])).join("&")}}t.RestMessageAdapter=n})(cL);var Nd={};Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.RestConfigBase=void 0;class Ra{static get requestOptions(){return Ra.privDefaultRequestOptions}static get configParams(){return Ra.privDefaultParams}static get restErrors(){return Ra.privRestErrors}}Nd.RestConfigBase=Ra,Ra.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},Ra.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},Ra.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"};var uL;function Zr(){return uL||(uL=1,function(t){var e=xt&&xt.__createBinding||(Object.create?function(r,i,n,o){o===void 0&&(o=n),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[n]}})}:function(r,i,n,o){o===void 0&&(o=n),r[o]=i[n]}),A=xt&&xt.__exportStar||function(r,i){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(i,n)&&e(i,r,n)};Object.defineProperty(t,"__esModule",{value:!0}),A(LC,t),A(l2,t),A(wX(),t),A(SX(),t),A(FC,t),A(OC,t),A(Dg,t),A(bC,t),A(B$(),t),A(cL,t),A(Nd,t)}(h0)),h0}var lL;function M$(){if(lL)return yg;lL=1,Object.defineProperty(yg,"__esModule",{value:!0}),yg.IntentConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr;let n=class extends A.ConnectionFactoryBase{create(s,a,c){let u=s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint);if(!u){const p=s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_IntentRegion),C=A.ConnectionFactoryBase.getHostSuffix(p);u=s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,"wss://"+p+".sr.speech"+C)+"/speech/recognition/interactive/cognitiveservices/v1"}const l={format:"simple",language:s.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecoLanguage)};this.setCommonUrlParams(s,l,u);const g={};a.token!==void 0&&a.token!==""&&(g[a.headerName]=a.token),g[i.HeaderNames.ConnectionId]=c,s.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,u);const h=s.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(u,l,g,new r.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(s),h,c))}getSpeechRegionFromIntentRegion(s){switch(s){case"West US":case"US West":case"westus":return"uswest";case"West US 2":case"US West 2":case"westus2":return"uswest2";case"South Central US":case"US South Central":case"southcentralus":return"ussouthcentral";case"West Central US":case"US West Central":case"westcentralus":return"uswestcentral";case"East US":case"US East":case"eastus":return"useast";case"East US 2":case"US East 2":case"eastus2":return"useast2";case"West Europe":case"Europe West":case"westeurope":return"europewest";case"North Europe":case"Europe North":case"northeurope":return"europenorth";case"Brazil South":case"South Brazil":case"southbrazil":return"brazilsouth";case"Australia East":case"East Australia":case"eastaustralia":return"australiaeast";case"Southeast Asia":case"Asia Southeast":case"southeastasia":return"asiasoutheast";case"East Asia":case"Asia East":case"eastasia":return"asiaeast";default:return s}}};return yg.IntentConnectionFactory=n,yg}var Wc={},hL;function y$(){if(hL)return Wc;hL=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.VoiceProfileConnectionFactory=Wc.SpeakerRecognitionConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr;class n extends A.ConnectionFactoryBase{create(c,u,l,g){let h=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint);if(!h){const E=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region),v=A.ConnectionFactoryBase.getHostSuffix(E),m=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,`wss://${E}.spr-frontend.speech${v}`),M=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_SpeakerIdMode,"TextIndependentIdentification");h=`${m}/speaker/ws/${this.scenarioToPath(M)}/${l}`}const p={format:"simple",language:c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecoLanguage)};this.setCommonUrlParams(c,p,h);const C={};u.token!==void 0&&u.token!==""&&(C[u.headerName]=u.token),C[i.HeaderNames.ConnectionId]=g,C[i.HeaderNames.SpIDAuthKey]=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Key),c.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,h);const I=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(h,p,C,new r.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(c),I,g))}scenarioToPath(c){switch(c){case"TextIndependentVerification":case"2":return"verification/text-independent";case"TextDependentVerification":case"1":return"verification/text-dependent";default:return"identification/text-independent"}}}let o=class extends n{create(c,u,l){return super.create(c,u,"recognition",l)}};Wc.SpeakerRecognitionConnectionFactory=o;class s extends n{create(c,u,l){return super.create(c,u,"profile",l)}}return Wc.VoiceProfileConnectionFactory=s,Wc}var oI={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionEndedEvent=t.RecognitionCompletionStatus=t.RecognitionStartedEvent=t.ConnectingToServiceEvent=t.ListeningStartedEvent=t.RecognitionTriggeredEvent=t.SpeechRecognitionEvent=void 0;const e=Mt();class A extends e.PlatformEvent{constructor(u,l,g,h=e.EventType.Info){super(u,h),this.privRequestId=l,this.privSessionId=g}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}t.SpeechRecognitionEvent=A;class r extends A{constructor(u,l,g,h){super("RecognitionTriggeredEvent",u,l),this.privAudioSourceId=g,this.privAudioNodeId=h}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}t.RecognitionTriggeredEvent=r;class i extends A{constructor(u,l,g,h){super("ListeningStartedEvent",u,l),this.privAudioSourceId=g,this.privAudioNodeId=h}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}t.ListeningStartedEvent=i;class n extends A{constructor(u,l,g){super("ConnectingToServiceEvent",u,g),this.privAuthFetchEventid=l}get authFetchEventid(){return this.privAuthFetchEventid}}t.ConnectingToServiceEvent=n;class o extends A{constructor(u,l,g,h,p){super("RecognitionStartedEvent",u,p),this.privAudioSourceId=l,this.privAudioNodeId=g,this.privAuthFetchEventId=h}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}}t.RecognitionStartedEvent=o;var s;(function(c){c[c.Success=0]="Success",c[c.AudioSourceError=1]="AudioSourceError",c[c.AudioSourceTimeout=2]="AudioSourceTimeout",c[c.AuthTokenFetchError=3]="AuthTokenFetchError",c[c.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",c[c.UnAuthorized=5]="UnAuthorized",c[c.ConnectTimeout=6]="ConnectTimeout",c[c.ConnectError=7]="ConnectError",c[c.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",c[c.UnknownError=9]="UnknownError"})(s=t.RecognitionCompletionStatus||(t.RecognitionCompletionStatus={}));class a extends A{constructor(u,l,g,h,p,C,I,E){super("RecognitionEndedEvent",u,p,I===s.Success?e.EventType.Info:e.EventType.Error),this.privAudioSourceId=l,this.privAudioNodeId=g,this.privAuthFetchEventId=h,this.privStatus=I,this.privError=E,this.privServiceTag=C}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}get serviceTag(){return this.privServiceTag}get status(){return this.privStatus}get error(){return this.privError}}t.RecognitionEndedEvent=a})(oI);var Kd={},Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Co.SpeechConnectionMessage=void 0;const O0=Mt(),Io=Wr;class b0 extends O0.ConnectionMessage{constructor(e,A,r,i,n,o,s,a){if(!A)throw new O0.ArgumentNullError("path");if(!r)throw new O0.ArgumentNullError("requestId");const c={};if(c[Io.HeaderNames.Path]=A,c[Io.HeaderNames.RequestId]=r,c[Io.HeaderNames.RequestTimestamp]=new Date().toISOString(),i&&(c[Io.HeaderNames.ContentType]=i),o&&(c[Io.HeaderNames.RequestStreamId]=o),s)for(const u in s)u&&(c[u]=s[u]);a?super(e,n,c,a):super(e,n,c),this.privPath=A,this.privRequestId=r,this.privContentType=i,this.privStreamId=o,this.privAdditionalHeaders=s}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}static fromConnectionMessage(e){let A=null,r=null,i=null,n=null;const o={};if(e.headers)for(const s in e.headers)s&&(s.toLowerCase()===Io.HeaderNames.Path.toLowerCase()?A=e.headers[s]:s.toLowerCase()===Io.HeaderNames.RequestId.toLowerCase()?r=e.headers[s]:s.toLowerCase()===Io.HeaderNames.ContentType.toLowerCase()?i=e.headers[s]:s.toLowerCase()===Io.HeaderNames.RequestStreamId.toLowerCase()?n=e.headers[s]:o[s]=e.headers[s]);return new b0(e.messageType,A,r,i,e.body,n,o,e.id)}}Co.SpeechConnectionMessage=b0;var gL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SegmentationMode=void 0,function(e){e.Normal="Normal",e.Disabled="Disabled",e.Custom="Custom",e.Semantic="Semantic"}(t.SegmentationMode||(t.SegmentationMode={}))})(gL);var dL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,function(e){e.None="None",e.Synthesize="Synthesize"}(t.NextAction||(t.NextAction={}))})(dL);var pL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Mode=void 0,function(e){e.None="None",e.Always="Always"}(t.Mode||(t.Mode={}))})(pL);var fL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageIdDetectionPriority=t.LanguageIdDetectionMode=void 0,function(e){e.DetectAtAudioStart="DetectAtAudioStart",e.DetectContinuous="DetectContinuous",e.DetectSegments="DetectSegments"}(t.LanguageIdDetectionMode||(t.LanguageIdDetectionMode={})),function(e){e.Auto="Auto",e.PrioritizeLatency="PrioritizeLatency",e.PrioritizeAccuracy="PrioritizeAccuracy"}(t.LanguageIdDetectionPriority||(t.LanguageIdDetectionPriority={}))})(fL);var EL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,function(e){e.Recognize="Recognize",e.None="None"}(t.NextAction||(t.NextAction={}))})(EL);var CL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.OnUnknownAction=void 0,function(e){e.RecognizeWithDefaultLanguage="RecognizeWithDefaultLanguage",e.None="None"}(t.OnUnknownAction||(t.OnUnknownAction={}))})(CL);var IL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ResultType=void 0,function(e){e.Auto="Auto",e.StableFragment="StableFragment",e.Hypothesis="Hypothesis",e.None="None"}(t.ResultType||(t.ResultType={}))})(IL);var BL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.PhraseResultOutputType=void 0,function(e){e.Always="Always",e.None="None"}(t.PhraseResultOutputType||(t.PhraseResultOutputType={}))})(BL);var vL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NextAction=void 0,function(e){e.None="None",e.Translate="Translate"}(t.NextAction||(t.NextAction={}))})(vL);var wL;function Q$(){if(wL)return Kd;wL=1,Object.defineProperty(Kd,"__esModule",{value:!0}),Kd.ServiceRecognizerBase=void 0;const t=Zr(),e=Mt(),A=Ve(),r=ut(),i=Co,n=gL,o=vn,s=dL,a=pL,c=fL,u=EL,l=CL,g=IL,h=BL,p=vL;let C=class aE{constructor(E,v,m,M,O){if(this.privConnectionConfigurationPromise=void 0,this.privConnectionPromise=void 0,this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.privAverageBytesPerMs=0,this.privEnableSpeakerId=!1,this.privExpectContentAssessmentResponse=!1,this.recognizeOverride=void 0,this.recognizeSpeaker=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,this.handleSpeechPhraseMessage=void 0,this.handleSpeechHypothesisMessage=void 0,!E)throw new e.ArgumentNullError("authentication");if(!v)throw new e.ArgumentNullError("connectionFactory");if(!m)throw new e.ArgumentNullError("audioSource");if(!M)throw new e.ArgumentNullError("recognizerConfig");this.privEnableSpeakerId=M.isSpeakerDiarizationEnabled,this.privMustReportEndOfStream=!1,this.privAuthentication=E,this.privConnectionFactory=v,this.privAudioSource=m,this.privRecognizerConfig=M,this.privIsDisposed=!1,this.privRecognizer=O,this.privRequestSession=new r.RequestSession(this.privAudioSource.id()),this.privConnectionEvents=new e.EventSource,this.privServiceEvents=new e.EventSource,this.privDynamicGrammar=new r.DynamicGrammarBuilder,this.privSpeechContext=new r.SpeechContext(this.privDynamicGrammar),this.privAgentConfig=new r.AgentConfig,this.privRecognizerConfig.parameters.getProperty(A.PropertyId.WebWorkerLoadType,"on").toLowerCase()==="on"&&typeof Blob<"u"&&typeof Worker<"u"?this.privSetTimeout=e.Timeout.setTimeout:(typeof window<"u"&&(this.privSetTimeout=window.setTimeout.bind(window)),typeof globalThis<"u"&&(this.privSetTimeout=globalThis.setTimeout.bind(globalThis))),this.connectionEvents.attach(P=>{if(P.name==="ConnectionClosedEvent"){const D=P;(D.statusCode===1003||D.statusCode===1007||D.statusCode===1002||D.statusCode===4e3||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&this.cancelRecognitionLocal(A.CancellationReason.Error,D.statusCode===1007?A.CancellationErrorCode.BadRequestParameters:A.CancellationErrorCode.ConnectionFailure,`${D.reason} websocket error code: ${D.statusCode}`)}}),this.privEnableSpeakerId&&(this.privDiarizationSessionId=(0,e.createNoDashGuid)())}setTranslationJson(){const E=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0);if(E!==void 0){const v=E.split(","),m=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,void 0),M=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationCategoryId,void 0),O=m!==void 0?s.NextAction.Synthesize:s.NextAction.None;if(this.privSpeechContext.getContext().translation={onPassthrough:{action:O},onSuccess:{action:O},output:{includePassThroughResults:!0,interimResults:{mode:a.Mode.Always}},targetLanguages:v},M!==void 0&&(this.privSpeechContext.getContext().translation.category=M),m!==void 0){const P={};for(const D of v)P[D]=m;this.privSpeechContext.getContext().synthesis={defaultVoices:P}}const x=this.privSpeechContext.getContext().phraseDetection||{};x.onSuccess={action:p.NextAction.Translate},x.onInterim={action:p.NextAction.Translate},this.privSpeechContext.getContext().phraseDetection=x}}setSpeechSegmentationTimeoutJson(){const E=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.Speech_SegmentationSilenceTimeoutMs,void 0),v=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.Speech_SegmentationMaximumTimeMs,void 0),m=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.Speech_SegmentationStrategy,void 0),M={mode:n.SegmentationMode.Normal,segmentationForcedTimeoutMs:0,segmentationSilenceTimeoutMs:0};let O=!1;if(m!==void 0){O=!0;let x=n.SegmentationMode.Normal;switch(m.toLowerCase()){case"default":break;case"time":x=n.SegmentationMode.Custom;break;case"semantic":x=n.SegmentationMode.Semantic;break}M.mode=x}if(E!==void 0){O=!0;const x=parseInt(E,10);M.mode=n.SegmentationMode.Custom,M.segmentationSilenceTimeoutMs=x}if(v!==void 0){O=!0;const x=parseInt(v,10);M.mode=n.SegmentationMode.Custom,M.segmentationForcedTimeoutMs=x}if(O){const x=this.privSpeechContext.getContext().phraseDetection||{};switch(x.mode=this.recognitionMode,this.recognitionMode){case o.RecognitionMode.Conversation:x.conversation=x.conversation??{segmentation:{}},x.conversation.segmentation=M;break;case o.RecognitionMode.Interactive:x.interactive=x.interactive??{segmentation:{}},x.interactive.segmentation=M;break;case o.RecognitionMode.Dictation:x.dictation=x.dictation??{},x.dictation.segmentation=M;break}this.privSpeechContext.getContext().phraseDetection=x}}setLanguageIdJson(){const E=this.privSpeechContext.getContext().phraseDetection||{};if(this.privRecognizerConfig.autoDetectSourceLanguages!==void 0){const v=this.privRecognizerConfig.autoDetectSourceLanguages.split(",");v.length===1&&v[0]===r.AutoDetectSourceLanguagesOpenRangeOptionName&&(v[0]="UND");let m;this.privRecognizerConfig.languageIdMode==="Continuous"?m=c.LanguageIdDetectionMode.DetectContinuous:m=c.LanguageIdDetectionMode.DetectAtAudioStart,this.privSpeechContext.getContext().languageId={languages:v,mode:m,onSuccess:{action:u.NextAction.Recognize},onUnknown:{action:l.OnUnknownAction.None},priority:c.LanguageIdDetectionPriority.PrioritizeLatency},this.privSpeechContext.getContext().phraseOutput={interimResults:{resultType:g.ResultType.Auto},phraseResults:{resultType:h.PhraseResultOutputType.Always}};const M=this.privRecognizerConfig.sourceLanguageModels;M!==void 0&&(E.customModels=M,E.onInterim={action:p.NextAction.None},E.onSuccess={action:p.NextAction.None})}this.privSpeechContext.getContext().phraseDetection=E}setOutputDetailLevelJson(){this.privEnableSpeakerId&&(this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"false").toLowerCase()==="true"?this.privSpeechContext.setWordLevelTimings():this.privRecognizerConfig.parameters.getProperty(r.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Simple]).toLowerCase()===A.OutputFormat[A.OutputFormat.Detailed].toLocaleLowerCase()&&this.privSpeechContext.setDetailedOutputFormat())}get isSpeakerDiarizationEnabled(){return this.privEnableSpeakerId}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(E){this.privRecognizerConfig.parameters.setProperty(A.PropertyId.ConversationTranslator_Token,E)}set voiceProfileType(E){this.privRecognizerConfig.parameters.setProperty(A.PropertyId.SpeechServiceConnection_SpeakerIdMode,E)}set authentication(E){this.privAuthentication=E}isDisposed(){return this.privIsDisposed}async dispose(E){if(this.privIsDisposed=!0,this.privConnectionPromise!==void 0)try{await(await this.privConnectionPromise).dispose(E)}catch{return}}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}async recognize(E,v,m){if(this.recognizeOverride!==void 0){await this.recognizeOverride(E,v,m);return}if(this.privConnectionConfigurationPromise=void 0,this.privRecognizerConfig.recognitionMode=E,this.privRecognizerConfig.recognitionEndpointVersion==="2"){const D=this.privSpeechContext.getContext().phraseDetection||{};D.mode=E,this.privSpeechContext.getContext().phraseDetection=D}this.setLanguageIdJson(),this.setTranslationJson(),this.privRecognizerConfig.autoDetectSourceLanguages!==void 0&&this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0)!==void 0&&this.setupTranslationWithLanguageId(),this.setSpeechSegmentationTimeoutJson(),this.setOutputDetailLevelJson(),this.privSuccessCallback=v,this.privErrorCallback=m,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const M=this.connectImpl();let O;try{const D=await this.audioSource.attach(this.privRequestSession.audioNodeId),T=await this.audioSource.format,q=await this.audioSource.deviceInfo;this.privIsLiveAudio=q.type&&q.type===r.type.Microphones,O=new t.ReplayableAudioNode(D,T.avgBytesPerSec),await this.privRequestSession.onAudioSourceAttachCompleted(O,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:q}}catch(D){throw await this.privRequestSession.onStopRecognizing(),D}try{await M}catch(D){await this.cancelRecognitionLocal(A.CancellationReason.Error,A.CancellationErrorCode.ConnectionFailure,D);return}const x=new A.SessionEventArgs(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,x),this.receiveMessage(),this.sendAudio(O).catch(async D=>{await this.cancelRecognitionLocal(A.CancellationReason.Error,A.CancellationErrorCode.RuntimeError,D)})}async stopRecognizing(){if(this.privRequestSession.isRecognizing)try{await this.audioSource.turnOff(),await this.sendFinalAudio(),await this.privRequestSession.onStopRecognizing(),await this.privRequestSession.turnCompletionPromise}finally{await this.privRequestSession.dispose()}}async connect(){return await this.connectImpl(),Promise.resolve()}connectAsync(E,v){this.connectImpl().then(()=>{try{E&&E()}catch(m){v&&v(m)}},m=>{try{v&&v(m)}catch{}})}async disconnect(){if(await this.cancelRecognitionLocal(A.CancellationReason.Error,A.CancellationErrorCode.NoError,"Disconnecting"),this.disconnectOverride!==void 0&&await this.disconnectOverride(),this.privConnectionPromise!==void 0)try{await(await this.privConnectionPromise).dispose()}catch{}this.privConnectionPromise=void 0}sendMessage(E){}async sendNetworkMessage(E,v){const m=typeof v=="string"?e.MessageType.Text:e.MessageType.Binary,M=typeof v=="string"?"application/json":"";return(await this.fetchConnection()).send(new i.SpeechConnectionMessage(m,E,this.privRequestSession.requestId,M,v))}set activityTemplate(E){this.privActivityTemplate=E}get activityTemplate(){return this.privActivityTemplate}set expectContentAssessmentResponse(E){this.privExpectContentAssessmentResponse=E}async sendTelemetryData(){const E=this.privRequestSession.getTelemetry();if(aE.telemetryDataEnabled!==!0||this.privIsDisposed||E===null)return;if(aE.telemetryData)try{aE.telemetryData(E)}catch{}await(await this.fetchConnection()).send(new i.SpeechConnectionMessage(e.MessageType.Text,"telemetry",this.privRequestSession.requestId,"application/json",E))}async cancelRecognitionLocal(E,v,m){this.privRequestSession.isRecognizing&&(await this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,E,v,m))}async receiveMessage(){try{if(this.privIsDisposed)return;let E=await this.fetchConnection();const v=await E.read();if(this.receiveMessageOverride!==void 0)return this.receiveMessageOverride();if(!v)return this.receiveMessage();this.privServiceHasSentMessage=!0;const m=i.SpeechConnectionMessage.fromConnectionMessage(v);if(m.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(m.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const M=r.SpeechDetected.fromJSON(m.textBody,this.privRequestSession.currentTurnAudioOffset),O=new A.RecognitionEventArgs(M.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,O);break;case"speech.enddetected":let x;m.textBody.length>0?x=m.textBody:x="{ Offset: 0 }";const P=r.SpeechDetected.fromJSON(x,this.privRequestSession.currentTurnAudioOffset),D=new A.RecognitionEventArgs(P.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,D);break;case"turn.end":await this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,await this.cancelRecognitionLocal(A.CancellationReason.EndOfStream,A.CancellationErrorCode.NoError,void 0));const T=new A.SessionEventArgs(this.privRequestSession.sessionId);if(await this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing){this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,T);return}else E=await this.fetchConnection(),await this.sendPrePayloadJSON(E);break;default:await this.processTypeSpecificMessages(m)||this.privServiceEvents&&this.serviceEvents.onEvent(new e.ServiceEvent(m.path.toLowerCase(),m.textBody))}return this.receiveMessage()}catch{return null}}updateSpeakerDiarizationAudioOffset(){const E=this.privRequestSession.recognitionBytesSent,v=this.privAverageBytesPerMs!==0?E/this.privAverageBytesPerMs:0;this.privSpeechContext.setSpeakerDiarizationAudioOffsetMs(v)}sendSpeechContext(E,v){this.privEnableSpeakerId&&this.updateSpeakerDiarizationAudioOffset();const m=this.speechContext.toJSON();if(v&&this.privRequestSession.onSpeechContext(),m)return E.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speech.context",this.privRequestSession.requestId,"application/json",m))}setupTranslationWithLanguageId(){const E=this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages,void 0),v=this.privRecognizerConfig.autoDetectSourceLanguages!==void 0;if(E!==void 0&&v){this.privSpeechContext.getContext().phraseOutput={interimResults:{resultType:g.ResultType.None},phraseResults:{resultType:h.PhraseResultOutputType.None}};const m=this.privSpeechContext.getContext().translation;if(m){const M=this.privRecognizerConfig.sourceLanguageModels;if(M!==void 0&&M.length>0){const x=this.privSpeechContext.getContext().phraseDetection||{};x.customModels=M,this.privSpeechContext.getContext().phraseDetection=x}this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,void 0)!==void 0&&(m.onSuccess={action:s.NextAction.Synthesize},m.onPassthrough={action:s.NextAction.Synthesize})}}}noOp(){}async sendPrePayloadJSON(E,v=!0){if(this.sendPrePayloadJSONOverride!==void 0)return this.sendPrePayloadJSONOverride(E);await this.sendSpeechContext(E,v),await this.sendWaveHeader(E)}async sendWaveHeader(E){const v=await this.audioSource.format;return E.send(new i.SpeechConnectionMessage(e.MessageType.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",v.header))}connectImpl(){return this.privConnectionPromise!==void 0?this.privConnectionPromise.then(E=>E.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise,()=>(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl())):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch(()=>{}),this.postConnectImplOverride!==void 0?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}sendSpeechServiceConfig(E,v,m){if(v.onSpeechContext(),aE.telemetryDataEnabled!==!0){const O={context:{system:JSON.parse(m).context.system}};m=JSON.stringify(O)}if(this.privRecognizerConfig.parameters.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase()==="true"){const M=JSON.parse(m);M.context.DisableReferenceChannel="True",M.context.MicSpec="1_0_0",m=JSON.stringify(M)}if(m)return E.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speech.config",v.requestId,"application/json",m))}async fetchConnection(){return this.privConnectionConfigurationPromise!==void 0?this.privConnectionConfigurationPromise.then(E=>E.state()===e.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async sendAudio(E){const v=await this.audioSource.format;this.privAverageBytesPerMs=v.avgBytesPerSec/1e3;let m=Date.now();const M=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),O=v.avgBytesPerSec/1e3*parseInt(M,10),x=this.privRequestSession.recogNumber,P=async()=>{if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===x){const D=await this.fetchConnection(),T=await E.read();if(this.privRequestSession.isSpeechEnded)return;let q,Q;if(!T||T.isEnd?(q=null,Q=0):(q=T.buffer,this.privRequestSession.onAudioSent(q.byteLength),O>=this.privRequestSession.bytesSent?Q=0:Q=Math.max(0,m-Date.now())),Q!==0&&await this.delay(Q),q!==null&&(m=Date.now()+q.byteLength*1e3/(v.avgBytesPerSec*2)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===x)if(D.send(new i.SpeechConnectionMessage(e.MessageType.Binary,"audio",this.privRequestSession.requestId,null,q)).catch(()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch(()=>{})}),T!=null&&T.isEnd)this.privIsLiveAudio||this.privRequestSession.onSpeechEnded();else return P()}};return P()}async retryableConnect(){let E=!1;this.privAuthFetchEventId=(0,e.createNoDashGuid)();const v=this.privRequestSession.sessionId;this.privConnectionId=v!==void 0?v:(0,e.createNoDashGuid)(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let m=0,M="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){this.privRequestSession.onRetryConnection();const x=await(E?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId));await this.privRequestSession.onAuthCompleted(!1);const P=await this.privConnectionFactory.create(this.privRecognizerConfig,x,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(P.events),P.events.attach(T=>{this.connectionEvents.onEvent(T)});const D=await P.open();if(D.statusCode===200)return await this.privRequestSession.onConnectionEstablishCompleted(D.statusCode),Promise.resolve(P);D.statusCode===1006&&(E=!0),m=D.statusCode,M=D.reason}return await this.privRequestSession.onConnectionEstablishCompleted(m,M),Promise.reject(`Unable to contact server. StatusCode: ${m}, ${this.privRecognizerConfig.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint)} Reason: ${M}`)}delay(E){return new Promise(v=>this.privSetTimeout(v,E))}writeBufferToConsole(E){let v="Buffer Size: ";if(E===null)v+="null";else{const m=new Uint8Array(E);v+=`${E.byteLength}\r
31
31
  `;for(let M=0;M<E.byteLength;M++)v+=m[M].toString(16).padStart(2,"0")+" ",(M+1)%16===0&&(console.info(v),v="")}console.info(v)}async sendFinalAudio(){await(await this.fetchConnection()).send(new i.SpeechConnectionMessage(e.MessageType.Binary,"audio",this.privRequestSession.requestId,null,null))}async configureConnection(){const E=await this.connectImpl();return this.configConnectionOverride!==void 0?this.configConnectionOverride(E):(await this.sendSpeechServiceConfig(E,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),await this.sendPrePayloadJSON(E,!1),E)}};return Kd.ServiceRecognizerBase=C,C.telemetryDataEnabled=!0,Kd}var kd={},SL;function R$(){if(SL)return kd;SL=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.ConversationServiceRecognizer=void 0;const t=Ve(),e=ut();let A=class extends e.ServiceRecognizerBase{constructor(i,n,o,s,a){super(i,n,o,s,a),this.handleSpeechPhraseMessage=async c=>this.handleSpeechPhrase(c),this.handleSpeechHypothesisMessage=c=>this.handleSpeechHypothesis(c)}processTypeSpecificMessages(i){}handleRecognizedCallback(i,n,o){}handleRecognizingCallback(i,n,o){}async processSpeechMessages(i){let n=!1;switch(i.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":this.handleSpeechHypothesisMessage&&this.handleSpeechHypothesisMessage(i.textBody),n=!0;break;case"speech.phrase":this.handleSpeechPhraseMessage&&await this.handleSpeechPhraseMessage(i.textBody),n=!0;break}return n}cancelRecognition(i,n,o,s,a){}async handleSpeechPhrase(i){const n=e.SimpleSpeechPhrase.fromJSON(i,this.privRequestSession.currentTurnAudioOffset),o=e.EnumTranslation.implTranslateRecognitionResult(n.RecognitionStatus);let s;const a=new t.PropertyCollection;if(a.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,i),this.privRequestSession.onPhraseRecognized(n.Offset+n.Duration),t.ResultReason.Canceled===o){const c=e.EnumTranslation.implTranslateCancelResult(n.RecognitionStatus),u=e.EnumTranslation.implTranslateCancelErrorCode(n.RecognitionStatus);await this.cancelRecognitionLocal(c,u,e.EnumTranslation.implTranslateErrorDetails(u))}else if(n.RecognitionStatus!==e.RecognitionStatus.EndOfDictation){if(this.privRecognizerConfig.parameters.getProperty(e.OutputFormatPropertyName)===t.OutputFormat[t.OutputFormat.Simple])s=new t.SpeechRecognitionResult(this.privRequestSession.requestId,o,n.DisplayText,n.Duration,n.Offset,n.Language,n.LanguageDetectionConfidence,n.SpeakerId,void 0,n.asJson(),a);else{const c=e.DetailedSpeechPhrase.fromJSON(i,this.privRequestSession.currentTurnAudioOffset);s=new t.SpeechRecognitionResult(this.privRequestSession.requestId,o,c.Text,c.Duration,c.Offset,c.Language,c.LanguageDetectionConfidence,c.SpeakerId,void 0,c.asJson(),a)}this.handleRecognizedCallback(s,s.offset,this.privRequestSession.sessionId)}}handleSpeechHypothesis(i){const n=e.SpeechHypothesis.fromJSON(i,this.privRequestSession.currentTurnAudioOffset),o=new t.PropertyCollection;o.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,i);const s=new t.SpeechRecognitionResult(this.privRequestSession.requestId,t.ResultReason.RecognizingSpeech,n.Text,n.Duration,n.Offset,n.Language,n.LanguageDetectionConfidence,n.SpeakerId,void 0,n.asJson(),o);this.privRequestSession.onHypothesis(n.Offset),this.handleRecognizingCallback(s,n.Duration,this.privRequestSession.sessionId)}};return kd.ConversationServiceRecognizer=A,kd}var x0={},mL;function D$(){return mL||(mL=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RecognizerConfig=t.SpeechResultFormat=void 0;const e=Ve(),A=ut(),r=vn;(function(n){n[n.Simple=0]="Simple",n[n.Detailed=1]="Detailed"})(t.SpeechResultFormat||(t.SpeechResultFormat={}));class i{constructor(o,s){this.privSpeechServiceConfig=o||new A.SpeechServiceConfig(new A.Context(null)),this.privParameters=s,this.privMaxRetryCount=parseInt(s.getProperty("SPEECH-Error-MaxRetryCount","4"),10),this.privLanguageIdMode=s.getProperty(e.PropertyId.SpeechServiceConnection_LanguageIdMode,void 0),this.privEnableSpeakerId=!1}get parameters(){return this.privParameters}get recognitionMode(){return this.privRecognitionMode}set recognitionMode(o){this.privRecognitionMode=o,this.privRecognitionActivityTimeout=o===r.RecognitionMode.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=r.RecognitionMode[o]}get SpeechServiceConfig(){return this.privSpeechServiceConfig}get recognitionActivityTimeout(){return this.privRecognitionActivityTimeout}get isContinuousRecognition(){return this.privRecognitionMode!==r.RecognitionMode.Interactive}get languageIdMode(){return this.privLanguageIdMode}get autoDetectSourceLanguages(){return this.parameters.getProperty(e.PropertyId.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)}get recognitionEndpointVersion(){return this.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,"2")}set recognitionEndpointVersion(o){this.parameters.setProperty(e.PropertyId.SpeechServiceConnection_RecognitionEndpointVersion,o)}get sourceLanguageModels(){const o=[];let s=!1;if(this.autoDetectSourceLanguages!==void 0)for(const a of this.autoDetectSourceLanguages.split(",")){const c=a+e.PropertyId.SpeechServiceConnection_EndpointId.toString(),u=this.parameters.getProperty(c,void 0);u!==void 0?(o.push({language:a,endpoint:u}),s=!0):o.push({language:a,endpoint:""})}return s?o:void 0}get maxRetryCount(){return this.privMaxRetryCount}get isSpeakerDiarizationEnabled(){return this.privEnableSpeakerId}set isSpeakerDiarizationEnabled(o){this.privEnableSpeakerId=o}}t.RecognizerConfig=i}(x0)),x0}var ML={};Object.defineProperty(ML,"__esModule",{value:!0});var aI={};Object.defineProperty(aI,"__esModule",{value:!0}),aI.WebsocketMessageFormatter=void 0;const zn=Mt(),yL=`\r
32
32
  `;class T${toConnectionMessage(e){const A=new zn.Deferred;try{if(e.messageType===zn.MessageType.Text){const r=e.textContent;let i={},n=null;if(r){const o=r.split(`\r
33
33
  \r
34
34
  `);o&&o.length>0&&(i=this.parseHeaders(o[0]),o.length>1&&(n=o[1]))}A.resolve(new zn.ConnectionMessage(e.messageType,n,i,e.id))}else if(e.messageType===zn.MessageType.Binary){const r=e.binaryContent;let i={},n=null;if(!r||r.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const o=new DataView(r),s=o.getInt16(0);if(r.byteLength<s+2)throw new Error("Invalid binary message format. Header content missing.");let a="";for(let c=0;c<s;c++)a+=String.fromCharCode(o.getInt8(c+2));i=this.parseHeaders(a),r.byteLength>s+2&&(n=r.slice(2+s)),A.resolve(new zn.ConnectionMessage(e.messageType,n,i,e.id))}}catch(r){A.reject(`Error formatting the message. Error: ${r}`)}return A.promise}fromConnectionMessage(e){const A=new zn.Deferred;try{if(e.messageType===zn.MessageType.Text){const r=`${this.makeHeaders(e)}${yL}${e.textBody?e.textBody:""}`;A.resolve(new zn.RawWebsocketMessage(zn.MessageType.Text,r,e.id))}else if(e.messageType===zn.MessageType.Binary){const r=this.makeHeaders(e),i=e.binaryBody,n=this.stringToArrayBuffer(r),o=new Int8Array(n),s=o.byteLength,a=new Int8Array(2+s+(i?i.byteLength:0));if(a[0]=s>>8&255,a[1]=s&255,a.set(o,2),i){const u=new Int8Array(i);a.set(u,2+s)}const c=a.buffer;A.resolve(new zn.RawWebsocketMessage(zn.MessageType.Binary,c,e.id))}}catch(r){A.reject(`Error formatting the message. ${r}`)}return A.promise}makeHeaders(e){let A="";if(e.headers)for(const r in e.headers)r&&(A+=`${r}: ${e.headers[r]}${yL}`);return A}parseHeaders(e){const A={};if(e){const r=e.match(/[^\r\n]+/g);if(A){for(const i of r)if(i){const n=i.indexOf(":"),o=n>0?i.substr(0,n).trim().toLowerCase():i,s=n>0&&i.length>n+1?i.substr(n+1).trim():"";A[o]=s}}}return A}stringToArrayBuffer(e){const A=new ArrayBuffer(e.length),r=new DataView(A);for(let i=0;i<e.length;i++)r.setUint8(i,e.charCodeAt(i));return A}}aI.WebsocketMessageFormatter=T$;var Pd={},QL;function U$(){if(QL)return Pd;QL=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.SpeechConnectionFactory=void 0;const t=Zr(),e=ut(),A=Ve(),r=ps(),i=ut(),n=Wr,o=ds,s=vn;let a=class extends r.ConnectionFactoryBase{constructor(){super(...arguments),this.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",this.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",this.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",this.universalUri="/stt/speech/universal/v"}async create(u,l,g){let h=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint,void 0);const p=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Region,void 0),C=r.ConnectionFactoryBase.getHostSuffix(p),I=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Host,"wss://"+p+".stt.speech"+C),E={},v=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_EndpointId,void 0),m=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(v?(!h||h.search(o.QueryParameterNames.CustomSpeechDeploymentId)===-1)&&(E[o.QueryParameterNames.CustomSpeechDeploymentId]=v):m&&(!h||h.search(o.QueryParameterNames.Language)===-1)&&(E[o.QueryParameterNames.Language]=m),(!h||h.search(o.QueryParameterNames.Format)===-1)&&(E[o.QueryParameterNames.Format]=u.parameters.getProperty(e.OutputFormatPropertyName,A.OutputFormat[A.OutputFormat.Simple]).toLowerCase()),u.autoDetectSourceLanguages!==void 0&&(E[o.QueryParameterNames.EnableLanguageId]="true"),this.setCommonUrlParams(u,E,h),h){const D=new URL(h),T=D.pathname;(T===""||T==="/")&&(D.pathname=this.universalUri+u.recognitionEndpointVersion,h=await r.ConnectionFactoryBase.getRedirectUrlFromEndpoint(D.toString()))}if(!h)switch(u.recognitionMode){case s.RecognitionMode.Conversation:u.parameters.getProperty(e.ForceDictationPropertyName,"false")==="true"?h=I+this.dictationRelativeUri:u.recognitionEndpointVersion!==void 0&&parseInt(u.recognitionEndpointVersion,10)>1?h=`${I}${this.universalUri}${u.recognitionEndpointVersion}`:h=I+this.conversationRelativeUri;break;case s.RecognitionMode.Dictation:h=I+this.dictationRelativeUri;break;default:u.recognitionEndpointVersion!==void 0&&parseInt(u.recognitionEndpointVersion,10)>1?h=`${I}${this.universalUri}${u.recognitionEndpointVersion}`:h=I+this.interactiveRelativeUri;break}const M={};l.token!==void 0&&l.token!==""&&(M[l.headerName]=l.token),M[n.HeaderNames.ConnectionId]=g,M.connectionId=g;const O=u.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true",x=new t.WebsocketConnection(h,E,M,new i.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(u),O,g),P=x.uri;return u.parameters.setProperty(A.PropertyId.SpeechServiceConnection_Url,P),x}};return Pd.SpeechConnectionFactory=a,Pd}var Gd={},RL;function L$(){if(RL)return Gd;RL=1,Object.defineProperty(Gd,"__esModule",{value:!0}),Gd.ConversationTranscriberConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ut(),r=ps(),i=ut(),n=Wr,o=ds;let s=class extends r.ConnectionFactoryBase{constructor(){super(...arguments),this.universalUri="/speech/universal/v2"}async create(c,u,l){let g=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint,void 0);const h=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region,void 0),p=r.ConnectionFactoryBase.getHostSuffix(h),C=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,"wss://"+h+".stt.speech"+p),I={},E=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_EndpointId,void 0),v=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);if(E?(!g||g.search(o.QueryParameterNames.CustomSpeechDeploymentId)===-1)&&(I[o.QueryParameterNames.CustomSpeechDeploymentId]=E):v&&(!g||g.search(o.QueryParameterNames.Language)===-1)&&(I[o.QueryParameterNames.Language]=v),c.autoDetectSourceLanguages!==void 0&&(I[o.QueryParameterNames.EnableLanguageId]="true"),this.setV2UrlParams(c,I,g),g){const P=new URL(g),D=P.pathname;(D===""||D==="/")&&(P.pathname=this.universalUri,g=await r.ConnectionFactoryBase.getRedirectUrlFromEndpoint(P.toString()))}g||(g=`${C}${this.universalUri}`);const m={};u.token!==void 0&&u.token!==""&&(m[u.headerName]=u.token),m[n.HeaderNames.ConnectionId]=l;const M=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true",O=new t.WebsocketConnection(g,I,m,new i.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(c),M,l),x=O.uri;return c.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,x),O}setV2UrlParams(c,u,l){new Map([[e.PropertyId.Speech_SegmentationSilenceTimeoutMs,o.QueryParameterNames.SegmentationSilenceTimeoutMs],[e.PropertyId.SpeechServiceConnection_EnableAudioLogging,o.QueryParameterNames.EnableAudioLogging],[e.PropertyId.SpeechServiceConnection_EndSilenceTimeoutMs,o.QueryParameterNames.EndSilenceTimeoutMs],[e.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,o.QueryParameterNames.InitialSilenceTimeoutMs],[e.PropertyId.SpeechServiceResponse_PostProcessingOption,o.QueryParameterNames.Postprocessing],[e.PropertyId.SpeechServiceResponse_ProfanityOption,o.QueryParameterNames.Profanity],[e.PropertyId.SpeechServiceResponse_StablePartialResultThreshold,o.QueryParameterNames.StableIntermediateThreshold]]).forEach((p,C)=>{this.setUrlParameter(C,p,c,u,l)});const h=JSON.parse(c.parameters.getProperty(A.ServicePropertiesPropertyName,"{}"));Object.keys(h).forEach(p=>{u[p]=h[p]})}};return Gd.ConversationTranscriberConnectionFactory=s,Gd}var jd={},DL;function F$(){if(DL)return jd;DL=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.TranscriberConnectionFactory=void 0;const t=Zr(),e=Ve(),A=ps(),r=ut(),i=Wr,n=ds;let o=class extends A.ConnectionFactoryBase{constructor(){super(...arguments),this.multiaudioRelativeUri="/speech/recognition/multiaudio"}create(a,c,u){let l=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint,void 0);const g=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region,"centralus"),h=A.ConnectionFactoryBase.getHostSuffix(g),p="wss://transcribe."+g+".cts.speech"+h+this.multiaudioRelativeUri,C=a.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,p),I={};this.setQueryParams(I,a,l),l||(l=C);const E={};c.token!==void 0&&c.token!==""&&(E[c.headerName]=c.token),E[i.HeaderNames.ConnectionId]=u,a.parameters.setProperty(e.PropertyId.SpeechServiceConnection_Url,l);const v=a.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(l,I,E,new r.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(a),v,u))}setQueryParams(a,c,u){const l=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_EndpointId,void 0),g=c.parameters.getProperty(e.PropertyId.SpeechServiceConnection_RecoLanguage,void 0);l&&!(n.QueryParameterNames.CustomSpeechDeploymentId in a)&&(a[n.QueryParameterNames.CustomSpeechDeploymentId]=l),g&&!(n.QueryParameterNames.Language in a)&&(a[n.QueryParameterNames.Language]=g);const h=c.parameters.getProperty(e.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps,"false").toLowerCase()==="true",p=c.parameters.getProperty(r.OutputFormatPropertyName,e.OutputFormat[e.OutputFormat.Simple])!==e.OutputFormat[e.OutputFormat.Simple];(h||p)&&(a[n.QueryParameterNames.Format]=e.OutputFormat[e.OutputFormat.Detailed].toLowerCase()),this.setCommonUrlParams(c,a,u)}};return jd.TranscriberConnectionFactory=o,jd}var Yd={},TL;function O$(){if(TL)return Yd;TL=1,Object.defineProperty(Yd,"__esModule",{value:!0}),Yd.TranslationConnectionFactory=void 0;const t=Zr(),e=vd,A=Ve(),r=ps(),i=ut(),n=Wr,o=ds,s=vn;let a=class extends r.ConnectionFactoryBase{constructor(){super(...arguments),this.universalUri="/stt/speech/universal/v2",this.translationV1Uri="/speech/translation/cognitiveservices/v1"}async create(u,l,g){let h=this.getEndpointUrl(u);const p={};if(this.setQueryParams(p,u,h),h){const v=new URL(h),m=v.pathname;(m===""||m==="/")&&(v.pathname=this.universalUri,h=await r.ConnectionFactoryBase.getRedirectUrlFromEndpoint(v.toString()))}const C={};l.token!==void 0&&l.token!==""&&(C[l.headerName]=l.token),C[n.HeaderNames.ConnectionId]=g,u.parameters.setProperty(A.PropertyId.SpeechServiceConnection_Url,h);const I=u.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return new t.WebsocketConnection(h,p,C,new i.WebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(u),I,g)}getEndpointUrl(u,l){const g=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Region),h=r.ConnectionFactoryBase.getHostSuffix(g);let p=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Endpoint,void 0);return p?l===!0?p:e.StringUtils.formatString(p,{region:g}):(u.parameters.getProperty("SPEECH-ForceV1Endpoint","false")==="true"?p=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Host,"wss://{region}.s2s.speech"+h)+this.translationV1Uri:p=u.parameters.getProperty(A.PropertyId.SpeechServiceConnection_Host,"wss://{region}.stt.speech"+h)+this.universalUri,l===!0?p:e.StringUtils.formatString(p,{region:g}))}setQueryParams(u,l,g){u.from=l.parameters.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage),u.to=l.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationToLanguages),u.scenario=l.recognitionMode===s.RecognitionMode.Interactive?"interactive":l.recognitionMode===s.RecognitionMode.Conversation?"conversation":"",this.setCommonUrlParams(l,u,g),this.setUrlParameter(A.PropertyId.SpeechServiceResponse_TranslationRequestStablePartialResult,o.QueryParameterNames.StableTranslation,l,u,g);const h=l.parameters.getProperty(A.PropertyId.SpeechServiceConnection_TranslationVoice,void 0);h!==void 0&&(u.voice=h,u.features="requireVoice")}};return Yd.TranslationConnectionFactory=a,Yd}var Hd={},UL;function b$(){if(UL)return Hd;UL=1,Object.defineProperty(Hd,"__esModule",{value:!0}),Hd.EnumTranslation=void 0;const t=Ve(),e=ut();let A=class{static implTranslateRecognitionResult(i,n=!1){let o=t.ResultReason.Canceled;switch(i){case e.RecognitionStatus.Success:o=t.ResultReason.RecognizedSpeech;break;case e.RecognitionStatus.EndOfDictation:o=n?t.ResultReason.RecognizedSpeech:t.ResultReason.NoMatch;break;case e.RecognitionStatus.NoMatch:case e.RecognitionStatus.InitialSilenceTimeout:case e.RecognitionStatus.BabbleTimeout:o=t.ResultReason.NoMatch;break;case e.RecognitionStatus.Error:case e.RecognitionStatus.BadRequest:case e.RecognitionStatus.Forbidden:default:o=t.ResultReason.Canceled;break}return o}static implTranslateCancelResult(i){let n=t.CancellationReason.EndOfStream;switch(i){case e.RecognitionStatus.Success:case e.RecognitionStatus.EndOfDictation:case e.RecognitionStatus.NoMatch:n=t.CancellationReason.EndOfStream;break;case e.RecognitionStatus.InitialSilenceTimeout:case e.RecognitionStatus.BabbleTimeout:case e.RecognitionStatus.Error:case e.RecognitionStatus.BadRequest:case e.RecognitionStatus.Forbidden:default:n=t.CancellationReason.Error;break}return n}static implTranslateCancelErrorCode(i){let n=t.CancellationErrorCode.NoError;switch(i){case e.RecognitionStatus.Error:n=t.CancellationErrorCode.ServiceError;break;case e.RecognitionStatus.TooManyRequests:n=t.CancellationErrorCode.TooManyRequests;break;case e.RecognitionStatus.BadRequest:n=t.CancellationErrorCode.BadRequestParameters;break;case e.RecognitionStatus.Forbidden:n=t.CancellationErrorCode.Forbidden;break;default:n=t.CancellationErrorCode.NoError;break}return n}static implTranslateErrorDetails(i){let n="The speech service encountered an internal error and could not continue.";switch(i){case t.CancellationErrorCode.Forbidden:n="The recognizer is using a free subscription that ran out of quota.";break;case t.CancellationErrorCode.BadRequestParameters:n="Invalid parameter or unsupported audio format in the request.";break;case t.CancellationErrorCode.TooManyRequests:n="The number of parallel requests exceeded the number of allowed concurrent transcriptions.";break}return n}};return Hd.EnumTranslation=A,Hd}var LL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RecognitionStatus=t.SynthesisStatus=void 0,function(e){e[e.Success=0]="Success",e[e.SynthesisEnd=1]="SynthesisEnd",e[e.Error=2]="Error"}(t.SynthesisStatus||(t.SynthesisStatus={})),function(e){e[e.Success=0]="Success",e[e.NoMatch=1]="NoMatch",e[e.InitialSilenceTimeout=2]="InitialSilenceTimeout",e[e.BabbleTimeout=3]="BabbleTimeout",e[e.Error=4]="Error",e[e.EndOfDictation=5]="EndOfDictation",e[e.TooManyRequests=6]="TooManyRequests",e[e.BadRequest=7]="BadRequest",e[e.Forbidden=8]="Forbidden"}(t.RecognitionStatus||(t.RecognitionStatus={}))})(LL);var zd={},FL;function x$(){if(FL)return zd;FL=1,Object.defineProperty(zd,"__esModule",{value:!0}),zd.TranslationSynthesisEnd=void 0;const t=ut();let e=class lj{constructor(r){this.privSynthesisEnd=JSON.parse(r),this.privSynthesisEnd.SynthesisStatus&&(this.privSynthesisEnd.SynthesisStatus=t.SynthesisStatus[this.privSynthesisEnd.SynthesisStatus]),this.privSynthesisEnd.Status&&(this.privSynthesisEnd.SynthesisStatus=t.SynthesisStatus[this.privSynthesisEnd.Status])}static fromJSON(r){return new lj(r)}get SynthesisStatus(){return this.privSynthesisEnd.SynthesisStatus}get FailureReason(){return this.privSynthesisEnd.FailureReason}};return zd.TranslationSynthesisEnd=e,zd}var cI={};Object.defineProperty(cI,"__esModule",{value:!0}),cI.TranslationHypothesis=void 0;const N$=Ut,OL=DC;class uI{constructor(e,A){this.privTranslationHypothesis=e,this.privTranslationHypothesis.Offset+=A,this.privTranslationHypothesis.Translation.TranslationStatus=this.mapTranslationStatus(this.privTranslationHypothesis.Translation.TranslationStatus)}static fromJSON(e,A){return new uI(JSON.parse(e),A)}static fromTranslationResponse(e,A){N$.Contracts.throwIfNullOrUndefined(e,"translationHypothesis");const r=e.SpeechHypothesis;return e.SpeechHypothesis=void 0,r.Translation=e,new uI(r,A)}get Duration(){return this.privTranslationHypothesis.Duration}get Offset(){return this.privTranslationHypothesis.Offset}get Text(){return this.privTranslationHypothesis.Text}get Translation(){return this.privTranslationHypothesis.Translation}get Language(){var e;return(e=this.privTranslationHypothesis.PrimaryLanguage)==null?void 0:e.Language}asJson(){const e={...this.privTranslationHypothesis};return e.Translation!==void 0?JSON.stringify({...e,TranslationStatus:OL.TranslationStatus[e.Translation.TranslationStatus]}):JSON.stringify(e)}mapTranslationStatus(e){if(typeof e=="string")return OL.TranslationStatus[e];if(typeof e=="number")return e}}cI.TranslationHypothesis=uI;var Jd={},bL;function K$(){if(bL)return Jd;bL=1,Object.defineProperty(Jd,"__esModule",{value:!0}),Jd.TranslationPhrase=void 0;const t=Ut,e=ut(),A=DC;let r=class hR{constructor(n,o){this.privTranslationPhrase=n,this.privTranslationPhrase.Offset+=o,this.privTranslationPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privTranslationPhrase.RecognitionStatus),this.privTranslationPhrase.Translation!==void 0&&(this.privTranslationPhrase.Translation.TranslationStatus=this.mapTranslationStatus(this.privTranslationPhrase.Translation.TranslationStatus))}static fromJSON(n,o){return new hR(JSON.parse(n),o)}static fromTranslationResponse(n,o){t.Contracts.throwIfNullOrUndefined(n,"translationResponse");const s=n.SpeechPhrase;return n.SpeechPhrase=void 0,s.Translation=n,s.Text=s.DisplayText,new hR(s,o)}get RecognitionStatus(){return this.privTranslationPhrase.RecognitionStatus}get Offset(){return this.privTranslationPhrase.Offset}get Duration(){return this.privTranslationPhrase.Duration}get Text(){return this.privTranslationPhrase.Text}get Language(){var n;return(n=this.privTranslationPhrase.PrimaryLanguage)==null?void 0:n.Language}get Confidence(){var n;return(n=this.privTranslationPhrase.PrimaryLanguage)==null?void 0:n.Confidence}get Translation(){return this.privTranslationPhrase.Translation}asJson(){const n={...this.privTranslationPhrase},o={...n,RecognitionStatus:e.RecognitionStatus[n.RecognitionStatus]};return n.Translation&&(o.Translation={...n.Translation,TranslationStatus:A.TranslationStatus[n.Translation.TranslationStatus]}),JSON.stringify(o)}mapRecognitionStatus(n){if(typeof n=="string")return e.RecognitionStatus[n];if(typeof n=="number")return n}mapTranslationStatus(n){if(typeof n=="string")return A.TranslationStatus[n];if(typeof n=="number")return n}};return Jd.TranslationPhrase=r,Jd}var qd={},xL;function k$(){if(xL)return qd;xL=1,Object.defineProperty(qd,"__esModule",{value:!0}),qd.TranslationServiceRecognizer=void 0;const t=Mt(),e=Ve(),A=ut();let r=class extends A.ConversationServiceRecognizer{constructor(n,o,s,a,c){super(n,o,s,a,c),this.privTranslationRecognizer=c,this.connectionEvents.attach(u=>{u.name==="ConnectionEstablishedEvent"&&this.privTranslationRecognizer.onConnection()})}async processTypeSpecificMessages(n){const o=new e.PropertyCollection;let s=await this.processSpeechMessages(n);if(s)return!0;const a=async u=>{if(o.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,u.asJson()),this.privRequestSession.onPhraseRecognized(u.Offset+u.Duration),u.RecognitionStatus===A.RecognitionStatus.Success){const l=this.fireEventForResult(u,o);if(this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,l)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(l.result)}catch(g){this.privErrorCallback&&this.privErrorCallback(g)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}else{const l=A.EnumTranslation.implTranslateRecognitionResult(u.RecognitionStatus),g=new e.TranslationRecognitionResult(void 0,this.privRequestSession.requestId,l,u.Text,u.Duration,u.Offset,u.Language,u.Confidence,void 0,u.asJson(),o);if(l===e.ResultReason.Canceled){const h=A.EnumTranslation.implTranslateCancelResult(u.RecognitionStatus),p=A.EnumTranslation.implTranslateCancelErrorCode(u.RecognitionStatus);await this.cancelRecognitionLocal(h,p,A.EnumTranslation.implTranslateErrorDetails(p))}else if(u.RecognitionStatus!==A.RecognitionStatus.EndOfDictation){const h=new e.TranslationRecognitionEventArgs(g,g.offset,this.privRequestSession.sessionId);if(this.privTranslationRecognizer.recognized)try{this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,h)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(g)}catch(p){this.privErrorCallback&&this.privErrorCallback(p)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}s=!0}},c=u=>{o.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,u.asJson());const l=this.fireEventForResult(u,o);if(this.privRequestSession.onHypothesis(l.offset),this.privTranslationRecognizer.recognizing)try{this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,l)}catch{}s=!0};switch(n.messageType===t.MessageType.Text&&o.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,n.textBody),n.path.toLowerCase()){case"translation.hypothesis":c(A.TranslationHypothesis.fromJSON(n.textBody,this.privRequestSession.currentTurnAudioOffset));break;case"translation.response":const u=JSON.parse(n.textBody);if(u.SpeechPhrase)await a(A.TranslationPhrase.fromTranslationResponse(u,this.privRequestSession.currentTurnAudioOffset));else{const g=JSON.parse(n.textBody);g.SpeechHypothesis&&c(A.TranslationHypothesis.fromTranslationResponse(g,this.privRequestSession.currentTurnAudioOffset))}break;case"translation.phrase":await a(A.TranslationPhrase.fromJSON(n.textBody,this.privRequestSession.currentTurnAudioOffset));break;case"translation.synthesis":case"audio":this.sendSynthesisAudio(n.binaryBody,this.privRequestSession.sessionId),s=!0;break;case"audio.end":case"translation.synthesis.end":const l=A.TranslationSynthesisEnd.fromJSON(n.textBody);switch(l.SynthesisStatus){case A.SynthesisStatus.Error:if(this.privTranslationRecognizer.synthesizing){const g=new e.TranslationSynthesisResult(e.ResultReason.Canceled,void 0),h=new e.TranslationSynthesisEventArgs(g,this.privRequestSession.sessionId);try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,h)}catch{}}if(this.privTranslationRecognizer.canceled){const g=new e.TranslationRecognitionCanceledEventArgs(this.privRequestSession.sessionId,e.CancellationReason.Error,l.FailureReason,e.CancellationErrorCode.ServiceError,null);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,g)}catch{}}break;case A.SynthesisStatus.Success:this.sendSynthesisAudio(void 0,this.privRequestSession.sessionId);break}s=!0;break}return s}cancelRecognition(n,o,s,a,c){const u=new e.PropertyCollection;if(u.setProperty(A.CancellationErrorCodePropertyName,e.CancellationErrorCode[a]),this.privTranslationRecognizer.canceled){const l=new e.TranslationRecognitionCanceledEventArgs(n,s,c,a,void 0);try{this.privTranslationRecognizer.canceled(this.privTranslationRecognizer,l)}catch{}}if(this.privSuccessCallback){const l=new e.TranslationRecognitionResult(void 0,o,e.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,c,void 0,u);try{this.privSuccessCallback(l),this.privSuccessCallback=void 0}catch{}}}handleRecognizingCallback(n,o,s){try{const a=new e.TranslationRecognitionEventArgs(e.TranslationRecognitionResult.fromSpeechRecognitionResult(n),o,s);this.privTranslationRecognizer.recognizing(this.privTranslationRecognizer,a)}catch{}}handleRecognizedCallback(n,o,s){try{const a=new e.TranslationRecognitionEventArgs(e.TranslationRecognitionResult.fromSpeechRecognitionResult(n),o,s);this.privTranslationRecognizer.recognized(this.privTranslationRecognizer,a)}catch{}}fireEventForResult(n,o){let s;if(n.Translation.Translations!==void 0){s=new e.Translations;for(const h of n.Translation.Translations)s.set(h.Language,h.Text||h.DisplayText)}let a,c;n instanceof A.TranslationPhrase?(n.Translation&&n.Translation.TranslationStatus===t.TranslationStatus.Success?a=e.ResultReason.TranslatedSpeech:a=e.ResultReason.RecognizedSpeech,c=n.Confidence):a=e.ResultReason.TranslatingSpeech;const u=n.Language,l=new e.TranslationRecognitionResult(s,this.privRequestSession.requestId,a,n.Text,n.Duration,n.Offset,u,c,n.Translation.FailureReason,n.asJson(),o);return new e.TranslationRecognitionEventArgs(l,n.Offset,this.privRequestSession.sessionId)}sendSynthesisAudio(n,o){const s=n===void 0?e.ResultReason.SynthesizingAudioCompleted:e.ResultReason.SynthesizingAudio,a=new e.TranslationSynthesisResult(s,n),c=new e.TranslationSynthesisEventArgs(a,o);if(this.privTranslationRecognizer.synthesizing)try{this.privTranslationRecognizer.synthesizing(this.privTranslationRecognizer,c)}catch{}}};return qd.TranslationServiceRecognizer=r,qd}var lI={};Object.defineProperty(lI,"__esModule",{value:!0}),lI.SpeechDetected=void 0;class N0{constructor(e,A){this.privSpeechStartDetected=JSON.parse(e),this.privSpeechStartDetected.Offset+=A}static fromJSON(e,A){return new N0(e,A)}get Offset(){return this.privSpeechStartDetected.Offset}}lI.SpeechDetected=N0;var hI={};Object.defineProperty(hI,"__esModule",{value:!0}),hI.SpeechHypothesis=void 0;class K0{constructor(e,A){this.privSpeechHypothesis=JSON.parse(e),this.updateOffset(A)}static fromJSON(e,A){return new K0(e,A)}updateOffset(e){this.privSpeechHypothesis.Offset+=e}asJson(){return JSON.stringify(this.privSpeechHypothesis)}get Text(){return this.privSpeechHypothesis.Text}get Offset(){return this.privSpeechHypothesis.Offset}get Duration(){return this.privSpeechHypothesis.Duration}get Language(){return this.privSpeechHypothesis.PrimaryLanguage===void 0?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return this.privSpeechHypothesis.PrimaryLanguage===void 0?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}hI.SpeechHypothesis=K0;var gI={};Object.defineProperty(gI,"__esModule",{value:!0}),gI.SpeechKeyword=void 0;class k0{constructor(e,A){this.privSpeechKeyword=JSON.parse(e),this.privSpeechKeyword.Offset+=A}static fromJSON(e,A){return new k0(e,A)}get Status(){return this.privSpeechKeyword.Status}get Text(){return this.privSpeechKeyword.Text}get Offset(){return this.privSpeechKeyword.Offset}get Duration(){return this.privSpeechKeyword.Duration}asJson(){return JSON.stringify(this.privSpeechKeyword)}}gI.SpeechKeyword=k0;var Vd={},NL;function P$(){if(NL)return Vd;NL=1,Object.defineProperty(Vd,"__esModule",{value:!0}),Vd.SpeechServiceRecognizer=void 0;const t=Ve(),e=ut();let A=class extends e.ServiceRecognizerBase{constructor(i,n,o,s,a){super(i,n,o,s,a),this.privSpeechRecognizer=a}async processTypeSpecificMessages(i){let n;const o=new t.PropertyCollection;let s=!1;switch(i.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const a=e.SpeechHypothesis.fromJSON(i.textBody,this.privRequestSession.currentTurnAudioOffset);o.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,a.asJson()),n=new t.SpeechRecognitionResult(this.privRequestSession.requestId,t.ResultReason.RecognizingSpeech,a.Text,a.Duration,a.Offset,a.Language,a.LanguageDetectionConfidence,void 0,void 0,a.asJson(),o),this.privRequestSession.onHypothesis(a.Offset);const c=new t.SpeechRecognitionEventArgs(n,a.Offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,c)}catch{}s=!0;break;case"speech.phrase":const u=e.SimpleSpeechPhrase.fromJSON(i.textBody,this.privRequestSession.currentTurnAudioOffset);o.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,u.asJson());const l=e.EnumTranslation.implTranslateRecognitionResult(u.RecognitionStatus,this.privExpectContentAssessmentResponse);if(this.privRequestSession.onPhraseRecognized(u.Offset+u.Duration),t.ResultReason.Canceled===l){const g=e.EnumTranslation.implTranslateCancelResult(u.RecognitionStatus),h=e.EnumTranslation.implTranslateCancelErrorCode(u.RecognitionStatus);await this.cancelRecognitionLocal(g,h,e.EnumTranslation.implTranslateErrorDetails(h))}else{if(u.RecognitionStatus===e.RecognitionStatus.EndOfDictation)break;if(this.privRecognizerConfig.parameters.getProperty(e.OutputFormatPropertyName)===t.OutputFormat[t.OutputFormat.Simple])n=new t.SpeechRecognitionResult(this.privRequestSession.requestId,l,u.DisplayText,u.Duration,u.Offset,u.Language,u.LanguageDetectionConfidence,void 0,void 0,u.asJson(),o);else{const h=e.DetailedSpeechPhrase.fromJSON(i.textBody,this.privRequestSession.currentTurnAudioOffset);o.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,h.asJson()),n=new t.SpeechRecognitionResult(this.privRequestSession.requestId,l,h.RecognitionStatus===e.RecognitionStatus.Success?h.NBest[0].Display:"",h.Duration,h.Offset,h.Language,h.LanguageDetectionConfidence,void 0,void 0,h.asJson(),o)}const g=new t.SpeechRecognitionEventArgs(n,n.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,g)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(n)}catch(h){this.privErrorCallback&&this.privErrorCallback(h)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}s=!0;break}return s}cancelRecognition(i,n,o,s,a){const c=new t.PropertyCollection;if(c.setProperty(e.CancellationErrorCodePropertyName,t.CancellationErrorCode[s]),this.privSpeechRecognizer.canceled){const u=new t.SpeechRecognitionCanceledEventArgs(o,a,s,void 0,i);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,u)}catch{}}if(this.privSuccessCallback){const u=new t.SpeechRecognitionResult(n,t.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,a,void 0,c);try{this.privSuccessCallback(u),this.privSuccessCallback=void 0}catch{}}}};return Vd.SpeechServiceRecognizer=A,Vd}var Wd={},KL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IdentityProvider=t.SpeakerDiarizationMode=void 0,function(e){e.None="None",e.Identity="Identity",e.Anonymous="Anonymous"}(t.SpeakerDiarizationMode||(t.SpeakerDiarizationMode={})),function(e){e.CallCenter="CallCenter"}(t.IdentityProvider||(t.IdentityProvider={}))})(KL);var kL;function G$(){if(kL)return Wd;kL=1,Object.defineProperty(Wd,"__esModule",{value:!0}),Wd.ConversationTranscriptionServiceRecognizer=void 0;const t=Ve(),e=ut(),A=KL,r=vn;let i=class extends e.ServiceRecognizerBase{constructor(o,s,a,c,u){super(o,s,a,c,u),this.privConversationTranscriber=u,this.setSpeakerDiarizationJson()}setSpeakerDiarizationJson(){if(this.privEnableSpeakerId){const o=this.privSpeechContext.getContext().phraseDetection||{};o.mode=r.RecognitionMode.Conversation;const s={};s.mode=A.SpeakerDiarizationMode.Anonymous,s.audioSessionId=this.privDiarizationSessionId,s.audioOffsetMs=0,s.diarizeIntermediates=this.privRecognizerConfig.parameters.getProperty(t.PropertyId.SpeechServiceResponse_DiarizeIntermediateResults,"false")==="true",o.speakerDiarization=s,this.privSpeechContext.getContext().phraseDetection=o}}async processTypeSpecificMessages(o){let s;const a=new t.PropertyCollection;a.setProperty(t.PropertyId.SpeechServiceResponse_JsonResult,o.textBody);let c=!1;switch(o.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const u=e.SpeechHypothesis.fromJSON(o.textBody,this.privRequestSession.currentTurnAudioOffset);s=new t.ConversationTranscriptionResult(this.privRequestSession.requestId,t.ResultReason.RecognizingSpeech,u.Text,u.Duration,u.Offset,u.Language,u.LanguageDetectionConfidence,u.SpeakerId,void 0,u.asJson(),a),this.privRequestSession.onHypothesis(u.Offset);const l=new t.ConversationTranscriptionEventArgs(s,u.Duration,this.privRequestSession.sessionId);if(this.privConversationTranscriber.transcribing)try{this.privConversationTranscriber.transcribing(this.privConversationTranscriber,l)}catch{}c=!0;break;case"speech.phrase":const g=e.SimpleSpeechPhrase.fromJSON(o.textBody,this.privRequestSession.currentTurnAudioOffset),h=e.EnumTranslation.implTranslateRecognitionResult(g.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(g.Offset+g.Duration),t.ResultReason.Canceled===h){const p=e.EnumTranslation.implTranslateCancelResult(g.RecognitionStatus),C=e.EnumTranslation.implTranslateCancelErrorCode(g.RecognitionStatus);await this.cancelRecognitionLocal(p,C,e.EnumTranslation.implTranslateErrorDetails(C))}else if(!(this.privRequestSession.isSpeechEnded&&h===t.ResultReason.NoMatch&&g.RecognitionStatus!==e.RecognitionStatus.InitialSilenceTimeout)){if(this.privRecognizerConfig.parameters.getProperty(e.OutputFormatPropertyName)===t.OutputFormat[t.OutputFormat.Simple])s=new t.ConversationTranscriptionResult(this.privRequestSession.requestId,h,g.DisplayText,g.Duration,g.Offset,g.Language,g.LanguageDetectionConfidence,g.SpeakerId,void 0,g.asJson(),a);else{const C=e.DetailedSpeechPhrase.fromJSON(o.textBody,this.privRequestSession.currentTurnAudioOffset);s=new t.ConversationTranscriptionResult(this.privRequestSession.requestId,h,C.RecognitionStatus===e.RecognitionStatus.Success?C.NBest[0].Display:void 0,C.Duration,C.Offset,C.Language,C.LanguageDetectionConfidence,g.SpeakerId,void 0,C.asJson(),a)}const p=new t.ConversationTranscriptionEventArgs(s,s.offset,this.privRequestSession.sessionId);if(this.privConversationTranscriber.transcribed)try{this.privConversationTranscriber.transcribed(this.privConversationTranscriber,p)}catch{}}c=!0;break}return c}cancelRecognition(o,s,a,c,u){if(new t.PropertyCollection().setProperty(e.CancellationErrorCodePropertyName,t.CancellationErrorCode[c]),this.privConversationTranscriber.canceled){const g=new t.ConversationTranscriptionCanceledEventArgs(a,u,c,void 0,o);try{this.privConversationTranscriber.canceled(this.privConversationTranscriber,g)}catch{}}}};return Wd.ConversationTranscriptionServiceRecognizer=i,Wd}var Zd={},PL;function j$(){if(PL)return Zd;PL=1,Object.defineProperty(Zd,"__esModule",{value:!0}),Zd.TranscriptionServiceRecognizer=void 0;const t=Mt(),e=Ve(),A=ut(),r=Co;let i=class extends A.ConversationServiceRecognizer{constructor(o,s,a,c,u){super(o,s,a,c,u),this.privTranscriberRecognizer=u,this.sendPrePayloadJSONOverride=l=>this.sendTranscriptionStartJSON(l),this.privRecognizerConfig.parameters.getProperty(e.PropertyId.SpeechServiceResponse_RequestWordLevelTimestamps)==="true"&&this.privSpeechContext.setWordLevelTimings()}async sendSpeechEventAsync(o,s){if(this.privRequestSession.isRecognizing){const a=await this.fetchConnection();await this.sendSpeechEvent(a,this.createSpeechEventPayload(o,s))}}async sendMeetingSpeechEventAsync(o,s){if(this.privRequestSession.isRecognizing){const a=await this.fetchConnection();await this.sendSpeechEvent(a,this.createMeetingSpeechEventPayload(o,s))}}processTypeSpecificMessages(o){return this.processSpeechMessages(o)}handleRecognizedCallback(o,s,a){try{const c=new e.SpeechRecognitionEventArgs(o,s,a);if(this.privTranscriberRecognizer.recognized(this.privTranscriberRecognizer,c),this.privSuccessCallback){try{this.privSuccessCallback(o)}catch(u){this.privErrorCallback&&this.privErrorCallback(u)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}catch{}}handleRecognizingCallback(o,s,a){try{const c=new e.SpeechRecognitionEventArgs(o,s,a);this.privTranscriberRecognizer.recognizing(this.privTranscriberRecognizer,c)}catch{}}cancelRecognition(o,s,a,c,u){const l=new e.PropertyCollection;if(l.setProperty(A.CancellationErrorCodePropertyName,e.CancellationErrorCode[c]),this.privTranscriberRecognizer.IsMeetingRecognizer()){if(this.privTranscriberRecognizer.canceled){const g=new e.MeetingTranscriptionCanceledEventArgs(a,u,c,void 0,o);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,g)}catch{}}}else if(this.privTranscriberRecognizer.canceled){const g=new e.ConversationTranscriptionCanceledEventArgs(a,u,c,void 0,o);try{this.privTranscriberRecognizer.canceled(this.privTranscriberRecognizer,g)}catch{}}if(this.privSuccessCallback){const g=new e.SpeechRecognitionResult(s,e.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,u,void 0,l);try{this.privSuccessCallback(g),this.privSuccessCallback=void 0}catch{}}}async sendTranscriptionStartJSON(o){if(await this.sendSpeechContext(o,!0),this.privTranscriberRecognizer.IsMeetingRecognizer()){const s=this.privTranscriberRecognizer.getMeetingInfo(),a=this.createMeetingSpeechEventPayload(s,"start");await this.sendSpeechEvent(o,a)}else{const s=this.privTranscriberRecognizer.getConversationInfo(),a=this.createSpeechEventPayload(s,"start");await this.sendSpeechEvent(o,a)}await this.sendWaveHeader(o)}sendSpeechEvent(o,s){const a=JSON.stringify(s);if(a)return o.send(new r.SpeechConnectionMessage(t.MessageType.Text,"speech.event",this.privRequestSession.requestId,"application/json",a))}createSpeechEventPayload(o,s){const a={id:"meeting",name:s,meeting:o.conversationProperties};return a.meeting.id=o.id,a.meeting.attendees=o.participants,a}createMeetingSpeechEventPayload(o,s){const a={id:"meeting",name:s,meeting:o.meetingProperties};return a.meeting.id=o.id,a.meeting.attendees=o.participants,a}};return Zd.TranscriptionServiceRecognizer=i,Zd}var Xd={},GL;function Y$(){if(GL)return Xd;GL=1,Object.defineProperty(Xd,"__esModule",{value:!0}),Xd.DetailedSpeechPhrase=void 0;const t=ut();let e=class hj{constructor(r,i){this.privDetailedSpeechPhrase=JSON.parse(r),this.privDetailedSpeechPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privDetailedSpeechPhrase.RecognitionStatus),this.updateOffsets(i)}static fromJSON(r,i){return new hj(r,i)}updateOffsets(r){if(this.privDetailedSpeechPhrase.Offset+=r,this.privDetailedSpeechPhrase.NBest)for(const i of this.privDetailedSpeechPhrase.NBest){if(i.Words)for(const n of i.Words)n.Offset+=r;if(i.DisplayWords)for(const n of i.DisplayWords)n.Offset+=r}}asJson(){const r={...this.privDetailedSpeechPhrase};return JSON.stringify({...r,RecognitionStatus:t.RecognitionStatus[r.RecognitionStatus]})}get RecognitionStatus(){return this.privDetailedSpeechPhrase.RecognitionStatus}get NBest(){return this.privDetailedSpeechPhrase.NBest}get Duration(){return this.privDetailedSpeechPhrase.Duration}get Offset(){return this.privDetailedSpeechPhrase.Offset}get Language(){return this.privDetailedSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return this.privDetailedSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence}get Text(){return this.privDetailedSpeechPhrase.NBest&&this.privDetailedSpeechPhrase.NBest[0]?this.privDetailedSpeechPhrase.NBest[0].Display||this.privDetailedSpeechPhrase.NBest[0].DisplayText:this.privDetailedSpeechPhrase.DisplayText}get SpeakerId(){return this.privDetailedSpeechPhrase.SpeakerId}mapRecognitionStatus(r){if(typeof r=="string")return t.RecognitionStatus[r];if(typeof r=="number")return r}};return Xd.DetailedSpeechPhrase=e,Xd}var _d={},jL;function H$(){if(jL)return _d;jL=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.SimpleSpeechPhrase=void 0;const t=ut();let e=class gj{constructor(r,i=0){this.privSimpleSpeechPhrase=JSON.parse(r),this.privSimpleSpeechPhrase.RecognitionStatus=this.mapRecognitionStatus(this.privSimpleSpeechPhrase.RecognitionStatus),this.updateOffset(i)}static fromJSON(r,i){return new gj(r,i)}updateOffset(r){this.privSimpleSpeechPhrase.Offset+=r}asJson(){const r={...this.privSimpleSpeechPhrase};return JSON.stringify({...r,RecognitionStatus:t.RecognitionStatus[r.RecognitionStatus]})}get RecognitionStatus(){return this.privSimpleSpeechPhrase.RecognitionStatus}get DisplayText(){return this.privSimpleSpeechPhrase.DisplayText}get Offset(){return this.privSimpleSpeechPhrase.Offset}get Duration(){return this.privSimpleSpeechPhrase.Duration}get Language(){return this.privSimpleSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return this.privSimpleSpeechPhrase.PrimaryLanguage===void 0?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}mapRecognitionStatus(r){if(typeof r=="string")return t.RecognitionStatus[r];if(typeof r=="number")return r}};return _d.SimpleSpeechPhrase=e,_d}var dI={};Object.defineProperty(dI,"__esModule",{value:!0}),dI.AddedLmIntent=void 0;class z${constructor(e,A){this.modelImpl=e,this.intentName=A}}dI.AddedLmIntent=z$;var $d={},YL;function J$(){if(YL)return $d;YL=1,Object.defineProperty($d,"__esModule",{value:!0}),$d.IntentServiceRecognizer=void 0;const t=Mt(),e=Ve(),A=ut();let r=class extends A.ServiceRecognizerBase{constructor(n,o,s,a,c){super(n,o,s,a,c),this.privIntentRecognizer=c,this.privIntentDataSent=!1,a.recognitionEndpointVersion="1"}setIntents(n,o){this.privAddedLmIntents=n,this.privUmbrellaIntent=o,this.privIntentDataSent=!0}processTypeSpecificMessages(n){let o,s,a=!1;const c=new e.PropertyCollection;switch(n.messageType===t.MessageType.Text&&c.setProperty(e.PropertyId.SpeechServiceResponse_JsonResult,n.textBody),n.path.toLowerCase()){case"speech.hypothesis":const l=A.SpeechHypothesis.fromJSON(n.textBody,this.privRequestSession.currentTurnAudioOffset);if(o=new e.IntentRecognitionResult(void 0,this.privRequestSession.requestId,e.ResultReason.RecognizingIntent,l.Text,l.Duration,l.Offset,l.Language,l.LanguageDetectionConfidence,void 0,l.asJson(),c),this.privRequestSession.onHypothesis(o.offset),s=new e.IntentRecognitionEventArgs(o,l.Offset,this.privRequestSession.sessionId),this.privIntentRecognizer.recognizing)try{this.privIntentRecognizer.recognizing(this.privIntentRecognizer,s)}catch{}a=!0;break;case"speech.phrase":const g=A.SimpleSpeechPhrase.fromJSON(n.textBody,this.privRequestSession.currentTurnAudioOffset);o=new e.IntentRecognitionResult(void 0,this.privRequestSession.requestId,A.EnumTranslation.implTranslateRecognitionResult(g.RecognitionStatus),g.DisplayText,g.Duration,g.Offset,g.Language,g.LanguageDetectionConfidence,void 0,g.asJson(),c),s=new e.IntentRecognitionEventArgs(o,o.offset,this.privRequestSession.sessionId);const h=()=>{if(this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,s)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(o)}catch(C){this.privErrorCallback&&this.privErrorCallback(C)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}};this.privIntentDataSent===!1||e.ResultReason.NoMatch===s.result.reason?(this.privRequestSession.onPhraseRecognized(s.offset+s.result.duration),h()):this.privPendingIntentArgs=s,a=!0;break;case"response":if(s=this.privPendingIntentArgs,this.privPendingIntentArgs=void 0,s===void 0){if(n.textBody==="")return;s=new e.IntentRecognitionEventArgs(new e.IntentRecognitionResult,0,this.privRequestSession.sessionId)}const p=A.IntentResponse.fromJSON(n.textBody);if(p!==null&&p.topScoringIntent&&p.topScoringIntent.intent){let C=this.privAddedLmIntents[p.topScoringIntent.intent];if(this.privUmbrellaIntent!==void 0&&(C=this.privUmbrellaIntent),C){const I=C===void 0||C.intentName===void 0?p.topScoringIntent.intent:C.intentName;let E=s.result.reason;I!==void 0&&(E=e.ResultReason.RecognizedIntent);const v=s.result.properties!==void 0?s.result.properties:new e.PropertyCollection;v.setProperty(e.PropertyId.LanguageUnderstandingServiceResponse_JsonResult,n.textBody),s=new e.IntentRecognitionEventArgs(new e.IntentRecognitionResult(I,s.result.resultId,E,s.result.text,s.result.duration,s.result.offset,void 0,void 0,s.result.errorDetails,s.result.json,v),s.offset,s.sessionId)}}if(this.privRequestSession.onPhraseRecognized(s.offset+s.result.duration),this.privIntentRecognizer.recognized)try{this.privIntentRecognizer.recognized(this.privIntentRecognizer,s)}catch{}if(this.privSuccessCallback){try{this.privSuccessCallback(s.result)}catch(C){this.privErrorCallback&&this.privErrorCallback(C)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}a=!0;break}const u=new t.Deferred;return u.resolve(a),u.promise}cancelRecognition(n,o,s,a,c){const u=new e.PropertyCollection;if(u.setProperty(A.CancellationErrorCodePropertyName,e.CancellationErrorCode[a]),this.privIntentRecognizer.canceled){const l=new e.IntentRecognitionCanceledEventArgs(s,c,a,void 0,void 0,n);try{this.privIntentRecognizer.canceled(this.privIntentRecognizer,l)}catch{}}if(this.privSuccessCallback){const l=new e.IntentRecognitionResult(void 0,o,e.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,c,void 0,u);try{this.privSuccessCallback(l),this.privSuccessCallback=void 0}catch{}}}};return $d.IntentServiceRecognizer=r,$d}var pI={};Object.defineProperty(pI,"__esModule",{value:!0}),pI.IntentResponse=void 0;class P0{constructor(e){e===""?this.privIntentResponse={}:this.privIntentResponse=JSON.parse(e)}static fromJSON(e){return new P0(e)}get query(){return this.privIntentResponse.query}get topScoringIntent(){return this.privIntentResponse.topScoringIntent}get entities(){return this.privIntentResponse.entities}}pI.IntentResponse=P0;var HL={};Object.defineProperty(HL,"__esModule",{value:!0});var fI={},EI={};Object.defineProperty(EI,"__esModule",{value:!0}),EI.ServiceTelemetryListener=void 0;const Bo=Mt(),zL=oI;class q${constructor(e,A,r){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privRequestId=e,this.privAudioSourceId=A,this.privAudioNodeId=r,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)}hypothesisReceived(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)}onEvent(e){if(!this.privIsDisposed&&(e instanceof zL.RecognitionTriggeredEvent&&e.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof Bo.AudioStreamNodeAttachingEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof Bo.AudioStreamNodeAttachedEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof Bo.AudioSourceErrorEvent&&e.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Bo.AudioStreamNodeErrorEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Bo.AudioStreamNodeDetachedEvent&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Name:"Microphone",Start:this.privMicStartTime})),e instanceof zL.ConnectingToServiceEvent&&e.requestId===this.privRequestId&&(this.privConnectionId=e.sessionId),e instanceof Bo.ConnectionStartEvent&&e.connectionId===this.privConnectionId&&(this.privConnectionStartTime=e.eventTime),e instanceof Bo.ConnectionEstablishedEvent&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof Bo.ConnectionEstablishErrorEvent&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Error:this.getConnectionError(e.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof Bo.ConnectionMessageReceivedEvent&&e.connectionId===this.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path)){this.privReceivedMessages[e.message.headers.path]||(this.privReceivedMessages[e.message.headers.path]=new Array);const A=50;this.privReceivedMessages[e.message.headers.path].length<A&&this.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)}}getTelemetry(){const e=new Array;this.privListeningTriggerMetric&&e.push(this.privListeningTriggerMetric),this.privMicMetric&&e.push(this.privMicMetric),this.privConnectionEstablishMetric&&e.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const A={Metrics:e,ReceivedMessages:this.privReceivedMessages},r=JSON.stringify(A);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],r}get hasTelemetry(){return Object.keys(this.privReceivedMessages).length!==0||this.privListeningTriggerMetric!==null||this.privMicMetric!==null||this.privConnectionEstablishMetric!==null||this.privPhraseLatencies.length!==0||this.privHypothesisLatencies.length!==0}dispose(){this.privIsDisposed=!0}getConnectionError(e){switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}}}EI.ServiceTelemetryListener=q$,Object.defineProperty(fI,"__esModule",{value:!0}),fI.RequestSession=void 0;const Dl=Mt(),CI=oI,V$=EI;class W${constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privIsAudioNodeDetached=!1,this.privIsRecognizing=!1,this.privIsSpeechEnded=!1,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privHypothesisReceived=!1,this.privBytesSent=0,this.privRecognitionBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.privAudioSourceId=e,this.privRequestId=(0,Dl.createNoDashGuid)(),this.privAudioNodeId=(0,Dl.createNoDashGuid)(),this.privTurnDeferral=new Dl.Deferred,this.privTurnDeferral.resolve()}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get audioNodeId(){return this.privAudioNodeId}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSpeechEnded(){return this.privIsSpeechEnded}get isRecognizing(){return this.privIsRecognizing}get currentTurnAudioOffset(){return this.privTurnStartAudioOffset}get recogNumber(){return this.privRecogNumber}get numConnectionAttempts(){return this.privConnectionAttempts}get bytesSent(){return this.privBytesSent}get recognitionBytesSent(){return this.privRecognitionBytesSent}listenForServiceTelemetry(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privRecognitionBytesSent=0,this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new V$.ServiceTelemetryListener(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new CI.RecognitionTriggeredEvent(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}async onAudioSourceAttachCompleted(e,A){this.privAudioNode=e,this.privIsAudioNodeDetached=!1,A?await this.onComplete():this.onEvent(new CI.ListeningStartedEvent(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onPreConnectionStart(e,A){this.privAuthFetchEventId=e,this.privSessionId=A,this.onEvent(new CI.ConnectingToServiceEvent(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))}async onAuthCompleted(e){e&&await this.onComplete()}async onConnectionEstablishCompleted(e,A){if(e===200){this.onEvent(new CI.RecognitionStartedEvent(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privBytesSent=0;return}else e===403&&await this.onComplete()}async onServiceTurnEndResponse(e){this.privTurnDeferral.resolve(),!e||this.isSpeechEnded?(await this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}onSpeechContext(){this.privRequestId=(0,Dl.createNoDashGuid)()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch(()=>{})),this.privInTurn=!0,this.privTurnDeferral=new Dl.Deferred}onHypothesis(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))}onPhraseRecognized(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)}onServiceRecognized(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0}onAudioSent(e){this.privBytesSent+=e,this.privRecognitionBytesSent+=e}onRetryConnection(){this.privConnectionAttempts++}async dispose(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)await e.detach();this.privServiceTelemetryListener&&this.privServiceTelemetryListener.dispose(),this.privIsRecognizing=!1}}getTelemetry(){return this.privServiceTelemetryListener.hasTelemetry?this.privServiceTelemetryListener.getTelemetry():null}async onStopRecognizing(){await this.onComplete()}onSpeechEnded(){this.privIsSpeechEnded=!0}onEvent(e){this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(e),Dl.Events.instance.onEvent(e)}async onComplete(){this.privIsRecognizing&&(this.privIsRecognizing=!1,await this.detachAudioNode())}async detachAudioNode(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&await this.privAudioNode.detach())}}fI.RequestSession=W$;var II={},JL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TentativePhraseResultsOption=t.OutputFormat=t.PhraseExtension=t.PhraseOption=void 0,function(e){e.WordTimings="WordTimings",e.SNR="SNR",e.Pronunciation="Pronunciation",e.WordPronunciation="WordPronunciation",e.WordConfidence="WordConfidence",e.Words="Words",e.Sentiment="Sentiment",e.PronunciationAssessment="PronunciationAssessment",e.ContentAssessment="ContentAssessment",e.PhraseAMScore="PhraseAMScore",e.PhraseLMScore="PhraseLMScore",e.WordAMScore="WordAMScore",e.WordLMScore="WordLMScore",e.RuleTree="RuleTree",e.NBestTimings="NBestTimings",e.DecoderDiagnostics="DecoderDiagnostics",e.DisplayWordTimings="DisplayWordTimings",e.DisplayWords="DisplayWords"}(t.PhraseOption||(t.PhraseOption={})),function(e){e.Graph="Graph",e.Corrections="Corrections",e.Sentiment="Sentiment"}(t.PhraseExtension||(t.PhraseExtension={})),function(e){e.Simple="Simple",e.Detailed="Detailed"}(t.OutputFormat||(t.OutputFormat={})),function(e){e.None="None",e.Always="Always"}(t.TentativePhraseResultsOption||(t.TentativePhraseResultsOption={}))})(JL),Object.defineProperty(II,"__esModule",{value:!0}),II.SpeechContext=void 0;const Z$=vn,Da=JL;class X${constructor(e){this.privContext={},this.privDynamicGrammar=e}getContext(){return this.privContext}setPronunciationAssessmentParams(e,A,r=!1){this.privContext.phraseDetection===void 0&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment===void 0&&(this.privContext.phraseDetection.enrichment={pronunciationAssessment:{}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e)||{},r&&(this.privContext.phraseDetection.mode=Z$.RecognitionMode.Conversation),this.setWordLevelTimings(),this.privContext.phraseOutput.detailed.options.push(Da.PhraseOption.PronunciationAssessment),this.privContext.phraseOutput.detailed.options.indexOf(Da.PhraseOption.SNR)===-1&&this.privContext.phraseOutput.detailed.options.push(Da.PhraseOption.SNR),A&&(this.privContext.phraseDetection.enrichment.contentAssessment={topic:A},this.privContext.phraseOutput.detailed.options.push(Da.PhraseOption.ContentAssessment))}setDetailedOutputFormat(){this.privContext.phraseOutput===void 0&&(this.privContext.phraseOutput={detailed:{options:[]}}),this.privContext.phraseOutput.detailed===void 0&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format=Da.OutputFormat.Detailed}setWordLevelTimings(){this.privContext.phraseOutput===void 0&&(this.privContext.phraseOutput={detailed:{options:[]}}),this.privContext.phraseOutput.detailed===void 0&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format=Da.OutputFormat.Detailed,this.privContext.phraseOutput.detailed.options.indexOf(Da.PhraseOption.WordTimings)===-1&&this.privContext.phraseOutput.detailed.options.push(Da.PhraseOption.WordTimings)}setSpeakerDiarizationAudioOffsetMs(e){this.privContext.phraseDetection.speakerDiarization.audioOffsetMs=e}toJSON(){const e=this.privDynamicGrammar.generateGrammarObject();return this.privContext.dgi=e,JSON.stringify(this.privContext)}}II.SpeechContext=X$;var BI={},qL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SubstringMatchType=t.GroupType=void 0,function(e){e.IntentText="IntentText",e.IntentEntity="IntentEntity",e.Generic="Generic",e.People="People",e.Place="Place",e.DynamicEntity="DynamicEntity"}(t.GroupType||(t.GroupType={})),function(e){e.None="None",e.LeftRooted="LeftRooted",e.PartialName="PartialName",e.MiddleOfSentence="MiddleOfSentence"}(t.SubstringMatchType||(t.SubstringMatchType={}))})(qL),Object.defineProperty(BI,"__esModule",{value:!0}),BI.DynamicGrammarBuilder=void 0;const _$=qL;class $${addPhrase(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)}clearGrammars(){this.privGrammars=void 0}generateGrammarObject(){if(this.privGrammars===void 0&&this.privPhrases===void 0)return;const e={};if(e.referenceGrammars=this.privGrammars,this.privPhrases!==void 0&&this.privPhrases.length!==0){const A=[];this.privPhrases.forEach(r=>{A.push({text:r})}),e.groups=[{type:_$.GroupType.Generic,items:A}]}return e}}BI.DynamicGrammarBuilder=$$;var ep={},vI={},wI={},G0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataStreamType=t.ActivityPayloadResponse=void 0;class e{constructor(r){this.privActivityResponse=JSON.parse(r)}static fromJSON(r){return new e(r)}get conversationId(){return this.privActivityResponse.conversationId}get messageDataStreamType(){return this.privActivityResponse.messageDataStreamType}get messagePayload(){return this.privActivityResponse.messagePayload}get version(){return this.privActivityResponse.version}}t.ActivityPayloadResponse=e,function(A){A[A.None=0]="None",A[A.TextToSpeechAudio=1]="TextToSpeechAudio"}(t.MessageDataStreamType||(t.MessageDataStreamType={}))})(G0),Object.defineProperty(wI,"__esModule",{value:!0}),wI.DialogServiceTurnState=void 0;const eee=Qa,tee=li,Aee=G0;class ree{constructor(e,A){this.privRequestId=A,this.privIsCompleted=!1,this.privAudioStream=null,this.privTurnManager=e,this.resetTurnEndTimeout()}get audioStream(){return this.resetTurnEndTimeout(),this.privAudioStream}processActivityPayload(e,A){return e.messageDataStreamType===Aee.MessageDataStreamType.TextToSpeechAudio&&(this.privAudioStream=tee.AudioOutputStream.createPullStream(),this.privAudioStream.format=A!==void 0?A:eee.AudioOutputFormatImpl.getDefaultOutputFormat()),this.privAudioStream}endAudioStream(){this.privAudioStream!==null&&!this.privAudioStream.isClosed&&this.privAudioStream.close()}complete(){this.privTimeoutToken!==void 0&&clearTimeout(this.privTimeoutToken),this.endAudioStream()}resetTurnEndTimeout(){this.privTimeoutToken!==void 0&&clearTimeout(this.privTimeoutToken),this.privTimeoutToken=setTimeout(()=>{this.privTurnManager.CompleteTurn(this.privRequestId)},2e3)}}wI.DialogServiceTurnState=ree,Object.defineProperty(vI,"__esModule",{value:!0}),vI.DialogServiceTurnStateManager=void 0;const VL=ai,iee=wI;class nee{constructor(){this.privTurnMap=new Map}StartTurn(e){if(this.privTurnMap.has(e))throw new VL.InvalidOperationError("Service error: There is already a turn with id:"+e);const A=new iee.DialogServiceTurnState(this,e);return this.privTurnMap.set(e,A),this.privTurnMap.get(e)}GetTurn(e){return this.privTurnMap.get(e)}CompleteTurn(e){if(!this.privTurnMap.has(e))throw new VL.InvalidOperationError("Service error: Received turn end for an unknown turn id:"+e);const A=this.privTurnMap.get(e);return A.complete(),this.privTurnMap.delete(e),A}}vI.DialogServiceTurnStateManager=nee;var WL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationSource=void 0,function(e){e.None="None",e.VoiceActivationWithKeyword="VoiceActivationWithKeyword"}(t.InvocationSource||(t.InvocationSource={}))})(WL);var ZL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.OnRejectAction=t.KeywordDetectionType=void 0,function(e){e.StartTrigger="StartTrigger"}(t.KeywordDetectionType||(t.KeywordDetectionType={})),function(e){e.EndOfTurn="EndOfTurn",e.Continue="Continue"}(t.OnRejectAction||(t.OnRejectAction={}))})(ZL);var XL;function see(){if(XL)return ep;XL=1,Object.defineProperty(ep,"__esModule",{value:!0}),ep.DialogServiceAdapter=void 0;const t=Zr(),e=bc,A=Mt(),r=Qa,i=Ve(),n=vI,o=ut(),s=G0,a=WL,c=ZL,u=Co;let l=class extends o.ServiceRecognizerBase{constructor(h,p,C,I,E){super(h,p,C,I,E),this.privEvents=new A.EventSource,this.privDialogServiceConnector=E,this.receiveMessageOverride=()=>this.receiveDialogMessageOverride(),this.privTurnStateManager=new n.DialogServiceTurnStateManager,this.recognizeOverride=(v,m,M)=>this.listenOnce(v,m,M),this.postConnectImplOverride=v=>this.dialogConnectImpl(v),this.configConnectionOverride=v=>this.configConnection(v),this.disconnectOverride=()=>this.privDisconnect(),this.privDialogAudioSource=C,this.agentConfigSent=!1,this.privLastResult=null,this.connectionEvents.attach(v=>{v.name==="ConnectionClosedEvent"&&(this.terminateMessageLoop=!0)})}async sendMessage(h){const p=(0,A.createGuid)(),C=(0,A.createNoDashGuid)(),I={context:{interactionId:p},messagePayload:JSON.parse(h),version:.5},E=JSON.stringify(I);await(await this.fetchConnection()).send(new u.SpeechConnectionMessage(A.MessageType.Text,"agent",C,"application/json",E))}async privDisconnect(){await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,this.agentConfigSent=!1}processTypeSpecificMessages(h){const p=new i.PropertyCollection;h.messageType===A.MessageType.Text&&p.setProperty(i.PropertyId.SpeechServiceResponse_JsonResult,h.textBody);let C,I;switch(h.path.toLowerCase()){case"speech.phrase":const v=o.SimpleSpeechPhrase.fromJSON(h.textBody,this.privRequestSession.currentTurnAudioOffset);if(this.privRequestSession.onPhraseRecognized(v.Offset+v.Duration),v.RecognitionStatus!==o.RecognitionStatus.TooManyRequests&&v.RecognitionStatus!==o.RecognitionStatus.Error){const P=this.fireEventForResult(v,p);if(this.privLastResult=P.result,this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,P)}catch{}}I=!0;break;case"speech.hypothesis":const m=o.SpeechHypothesis.fromJSON(h.textBody,this.privRequestSession.currentTurnAudioOffset);C=new i.SpeechRecognitionResult(this.privRequestSession.requestId,i.ResultReason.RecognizingSpeech,m.Text,m.Duration,m.Offset,m.Language,m.LanguageDetectionConfidence,void 0,void 0,m.asJson(),p),this.privRequestSession.onHypothesis(m.Offset);const M=new i.SpeechRecognitionEventArgs(C,m.Offset,this.privRequestSession.sessionId);if(this.privDialogServiceConnector.recognizing)try{this.privDialogServiceConnector.recognizing(this.privDialogServiceConnector,M)}catch{}I=!0;break;case"speech.keyword":const O=o.SpeechKeyword.fromJSON(h.textBody,this.privRequestSession.currentTurnAudioOffset);C=new i.SpeechRecognitionResult(this.privRequestSession.requestId,O.Status==="Accepted"?i.ResultReason.RecognizedKeyword:i.ResultReason.NoMatch,O.Text,O.Duration,O.Offset,void 0,void 0,void 0,void 0,O.asJson(),p),O.Status!=="Accepted"&&(this.privLastResult=C);const x=new i.SpeechRecognitionEventArgs(C,C.duration,C.resultId);if(this.privDialogServiceConnector.recognized)try{this.privDialogServiceConnector.recognized(this.privDialogServiceConnector,x)}catch{}I=!0;break;case"audio":{const P=h.requestId.toUpperCase(),D=this.privTurnStateManager.GetTurn(P);try{h.binaryBody?D.audioStream.write(h.binaryBody):D.endAudioStream()}catch{}}I=!0;break;case"response":this.handleResponseMessage(h),I=!0;break}const E=new A.Deferred;return E.resolve(I),E.promise}async cancelRecognition(h,p,C,I,E){if(this.terminateMessageLoop=!0,this.privRequestSession.isRecognizing&&await this.privRequestSession.onStopRecognizing(),this.privDialogServiceConnector.canceled){const v=new i.PropertyCollection;v.setProperty(o.CancellationErrorCodePropertyName,i.CancellationErrorCode[I]);const m=new i.SpeechRecognitionCanceledEventArgs(C,E,I,void 0,h);try{this.privDialogServiceConnector.canceled(this.privDialogServiceConnector,m)}catch{}if(this.privSuccessCallback){const M=new i.SpeechRecognitionResult(void 0,i.ResultReason.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,E,void 0,v);try{this.privSuccessCallback(M),this.privSuccessCallback=void 0}catch{}}}}async listenOnce(h,p,C){this.privRecognizerConfig.recognitionMode=h,this.privSuccessCallback=p,this.privErrorCallback=C,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privDialogAudioSource.events),this.privRecognizerConfig.parameters.setProperty(i.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const I=this.connectImpl(),E=this.sendPreAudioMessages(),v=await this.privDialogAudioSource.attach(this.privRequestSession.audioNodeId),m=await this.privDialogAudioSource.format,M=await this.privDialogAudioSource.deviceInfo,O=new t.ReplayableAudioNode(v,m.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(O,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:M};try{await I,await E}catch(D){return await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.ConnectionFailure,D),Promise.resolve()}const x=new i.SessionEventArgs(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,x),this.sendAudio(O).then(()=>{},async D=>{await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.RuntimeError,D)})}dialogConnectImpl(h){return this.privConnectionLoop=this.startMessageLoop(),h}receiveDialogMessageOverride(){const h=new A.Deferred,p=async()=>{try{const C=this.isDisposed(),I=!this.isDisposed()&&this.terminateMessageLoop;if(C||I){h.resolve(void 0);return}const v=await(await this.fetchConnection()).read();if(!v)return p();const m=u.SpeechConnectionMessage.fromConnectionMessage(v);switch(m.path.toLowerCase()){case"turn.start":{const q=m.requestId.toUpperCase(),Q=this.privRequestSession.requestId.toUpperCase();q!==Q?this.privTurnStateManager.StartTurn(q):this.privRequestSession.onServiceTurnStartResponse()}break;case"speech.startdetected":const O=o.SpeechDetected.fromJSON(m.textBody,this.privRequestSession.currentTurnAudioOffset),x=new i.RecognitionEventArgs(O.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,x);break;case"speech.enddetected":let P;m.textBody.length>0?P=m.textBody:P="{ Offset: 0 }";const D=o.SpeechDetected.fromJSON(P,this.privRequestSession.currentTurnAudioOffset);this.privRequestSession.onServiceRecognized(D.Offset);const T=new i.RecognitionEventArgs(D.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,T);break;case"turn.end":{const q=m.requestId.toUpperCase(),Q=this.privRequestSession.requestId.toUpperCase();if(q!==Q)this.privTurnStateManager.CompleteTurn(q);else{const R=new i.SessionEventArgs(this.privRequestSession.sessionId);if(await this.privRequestSession.onServiceTurnEndResponse(!1),(!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)&&this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,R),this.privSuccessCallback&&this.privLastResult){try{this.privSuccessCallback(this.privLastResult),this.privLastResult=null}catch(G){this.privErrorCallback&&this.privErrorCallback(G)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}}break;default:try{await this.processTypeSpecificMessages(m)||this.serviceEvents&&this.serviceEvents.onEvent(new A.ServiceEvent(m.path.toLowerCase(),m.textBody))}catch{}}return p()}catch{this.terminateMessageLoop=!0,h.resolve()}};return p().catch(C=>{A.Events.instance.onEvent(new A.BackgroundEvent(C))}),h.promise}async startMessageLoop(){this.terminateMessageLoop=!1;try{await this.receiveDialogMessageOverride()}catch(h){await this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,i.CancellationReason.Error,i.CancellationErrorCode.RuntimeError,h)}return Promise.resolve()}async configConnection(h){return this.terminateMessageLoop?(this.terminateMessageLoop=!1,Promise.reject("Connection to service terminated.")):(await this.sendSpeechServiceConfig(h,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),await this.sendAgentConfig(h),h)}async sendPreAudioMessages(){const h=await this.fetchConnection();this.addKeywordContextData(),await this.sendSpeechContext(h,!0),await this.sendAgentContext(h),await this.sendWaveHeader(h)}sendAgentConfig(h){if(this.agentConfig&&!this.agentConfigSent){if(this.privRecognizerConfig.parameters.getProperty(i.PropertyId.Conversation_DialogType)===i.DialogServiceConfig.DialogTypes.CustomCommands){const C=this.agentConfig.get();C.botInfo.commandsCulture=this.privRecognizerConfig.parameters.getProperty(i.PropertyId.SpeechServiceConnection_RecoLanguage,"en-us"),this.agentConfig.set(C)}this.onEvent(new e.SendingAgentContextMessageEvent(this.agentConfig));const p=this.agentConfig.toJsonString();return this.agentConfigSent=!0,h.send(new u.SpeechConnectionMessage(A.MessageType.Text,"agent.config",this.privRequestSession.requestId,"application/json",p))}}sendAgentContext(h){const p=(0,A.createGuid)(),C=this.privDialogServiceConnector.properties.getProperty(i.PropertyId.Conversation_Speech_Activity_Template),E=JSON.stringify({channelData:"",context:{interactionId:p},messagePayload:typeof C===void 0?void 0:C,version:.5});return h.send(new u.SpeechConnectionMessage(A.MessageType.Text,"speech.agent.context",this.privRequestSession.requestId,"application/json",E))}fireEventForResult(h,p){const C=o.EnumTranslation.implTranslateRecognitionResult(h.RecognitionStatus),I=new i.SpeechRecognitionResult(this.privRequestSession.requestId,C,h.DisplayText,h.Duration,h.Offset,h.Language,h.LanguageDetectionConfidence,void 0,void 0,h.asJson(),p);return new i.SpeechRecognitionEventArgs(I,h.Offset,this.privRequestSession.sessionId)}handleResponseMessage(h){const p=JSON.parse(h.textBody);switch(p.messageType.toLowerCase()){case"message":const C=h.requestId.toUpperCase(),I=s.ActivityPayloadResponse.fromJSON(h.textBody),E=this.privTurnStateManager.GetTurn(C);if(I.conversationId){const M=this.agentConfig.get();M.botInfo.conversationId=I.conversationId,this.agentConfig.set(M)}const v=E.processActivityPayload(I,r.AudioOutputFormatImpl.fromSpeechSynthesisOutputFormatString(this.privDialogServiceConnector.properties.getProperty(i.PropertyId.SpeechServiceConnection_SynthOutputFormat,void 0))),m=new i.ActivityReceivedEventArgs(I.messagePayload,v);if(this.privDialogServiceConnector.activityReceived)try{this.privDialogServiceConnector.activityReceived(this.privDialogServiceConnector,m)}catch{}break;case"messagestatus":if(this.privDialogServiceConnector.turnStatusReceived)try{this.privDialogServiceConnector.turnStatusReceived(this.privDialogServiceConnector,new i.TurnStatusReceivedEventArgs(h.textBody))}catch{}break;default:A.Events.instance.onEvent(new A.BackgroundEvent(`Unexpected response of type ${p.messageType}. Ignoring.`));break}}onEvent(h){this.privEvents.onEvent(h),A.Events.instance.onEvent(h)}addKeywordContextData(){const h=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect");if(h===void 0)return;const p=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Offsets"),C=this.privRecognizerConfig.parameters.getProperty("SPEECH-KeywordsToDetect-Durations"),I=h.split(";"),E=p===void 0?[]:p.split(";"),v=C===void 0?[]:C.split(";"),m=[];for(let M=0;M<I.length;M++){const O={text:I[M]};M<E.length&&(O.startOffset=Number(E[M])),M<v.length&&(O.duration=Number(v[M])),m.push(O)}this.speechContext.getContext().invocationSource=a.InvocationSource.VoiceActivationWithKeyword,this.speechContext.getContext().keywordDetection=[{clientDetectedKeywords:m,onReject:{action:c.OnRejectAction.EndOfTurn},type:c.KeywordDetectionType.StartTrigger}]}};return ep.DialogServiceAdapter=l,ep}var SI={};Object.defineProperty(SI,"__esModule",{value:!0}),SI.AgentConfig=void 0;class oee{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(e){this.iPrivConfig=e}}SI.AgentConfig=oee;var j0={},tp={},Tl={};Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.ConversationConnectionConfig=void 0;const aee=Nd;class Di extends aee.RestConfigBase{static get host(){return Di.privHost}static get apiVersion(){return Di.privApiVersion}static get clientAppId(){return Di.privClientAppId}static get defaultLanguageCode(){return Di.privDefaultLanguageCode}static get restPath(){return Di.privRestPath}static get webSocketPath(){return Di.privWebSocketPath}static get transcriptionEventKeys(){return Di.privTranscriptionEventKeys}}Tl.ConversationConnectionConfig=Di,Di.privHost="dev.microsofttranslator.com",Di.privRestPath="/capito/room",Di.privApiVersion="2.0",Di.privDefaultLanguageCode="en-US",Di.privClientAppId="FC539C22-1767-4F1F-84BC-B4D811114F15",Di.privWebSocketPath="/capito/translate",Di.privTranscriptionEventKeys=["iCalUid","callId","organizer","FLAC","MTUri","DifferentiateGuestSpeakers","audiorecording","Threadid","OrganizerMri","OrganizerTenantId","UserToken"];var _L;function cee(){if(_L)return tp;_L=1,Object.defineProperty(tp,"__esModule",{value:!0}),tp.ConversationManager=void 0;const t=Zr(),e=Ut,A=Ve(),r=Tl;let i=class{constructor(){this.privRequestParams=r.ConversationConnectionConfig.configParams,this.privErrors=r.ConversationConnectionConfig.restErrors,this.privHost=r.ConversationConnectionConfig.host,this.privApiVersion=r.ConversationConnectionConfig.apiVersion,this.privRestPath=r.ConversationConnectionConfig.restPath,this.privRestAdapter=new t.RestMessageAdapter({})}createOrJoin(o,s,a,c){try{e.Contracts.throwIfNullOrUndefined(o,"args");const u=o.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage,r.ConversationConnectionConfig.defaultLanguageCode),l=o.getProperty(A.PropertyId.ConversationTranslator_Name,"conversation_host"),g=o.getProperty(A.PropertyId.ConversationTranslator_Host,this.privHost),h=o.getProperty(A.PropertyId.ConversationTranslator_CorrelationId),p=o.getProperty(A.PropertyId.SpeechServiceConnection_Key),C=o.getProperty(A.PropertyId.SpeechServiceConnection_Region),I=o.getProperty(A.PropertyId.SpeechServiceAuthorization_Token);e.Contracts.throwIfNullOrWhitespace(u,"languageCode"),e.Contracts.throwIfNullOrWhitespace(l,"nickname"),e.Contracts.throwIfNullOrWhitespace(g,"endpointHost");const E={};E[this.privRequestParams.apiVersion]=this.privApiVersion,E[this.privRequestParams.languageCode]=u,E[this.privRequestParams.nickname]=l;const v={};h&&(v[this.privRequestParams.correlationId]=h),v[this.privRequestParams.clientAppId]=r.ConversationConnectionConfig.clientAppId,s!==void 0?E[this.privRequestParams.roomId]=s:(e.Contracts.throwIfNullOrUndefined(C,this.privErrors.authInvalidSubscriptionRegion),v[this.privRequestParams.subscriptionRegion]=C,p?v[this.privRequestParams.subscriptionKey]=p:I?v[this.privRequestParams.authorization]=`Bearer ${I}`:e.Contracts.throwIfNullOrUndefined(p,this.privErrors.authInvalidSubscriptionKey));const m={};m.headers=v,this.privRestAdapter.options=m;const M=`https://${g}${this.privRestPath}`;this.privRestAdapter.request(t.RestRequestType.Post,M,E,null).then(O=>{const x=t.RestMessageAdapter.extractHeaderValue(this.privRequestParams.requestId,O.headers);if(!O.ok){if(c){let D=this.privErrors.invalidCreateJoinConversationResponse.replace("{status}",O.status.toString()),T;try{T=JSON.parse(O.data),D+=` [${T.error.code}: ${T.error.message}]`}catch{D+=` [${O.data}]`}x&&(D+=` ${x}`),c(D)}return}const P=JSON.parse(O.data);if(P&&(P.requestId=x),a){try{a(P)}catch(D){c&&c(D)}a=void 0}}).catch(()=>{})}catch(u){if(c)if(u instanceof Error){const l=u;c(l.name+": "+l.message)}else c(u)}}leave(o,s){return new Promise((a,c)=>{try{e.Contracts.throwIfNullOrUndefined(o,this.privErrors.invalidArgs.replace("{arg}","config")),e.Contracts.throwIfNullOrWhitespace(s,this.privErrors.invalidArgs.replace("{arg}","token"));const u=o.getProperty(A.PropertyId.ConversationTranslator_Host,this.privHost),l=o.getProperty(A.PropertyId.ConversationTranslator_CorrelationId),g={};g[this.privRequestParams.apiVersion]=this.privApiVersion,g[this.privRequestParams.sessionToken]=s;const h={};l&&(h[this.privRequestParams.correlationId]=l);const p={};p.headers=h,this.privRestAdapter.options=p;const C=`https://${u}${this.privRestPath}`;this.privRestAdapter.request(t.RestRequestType.Delete,C,g,null).then(I=>{I.ok,a()}).catch(()=>{})}catch(u){if(u instanceof Error){const l=u;c(l.name+": "+l.message)}else c(u)}})}};return tp.ConversationManager=i,tp}var Zc={},Ap={},mI={},rp={};Object.defineProperty(rp,"__esModule",{value:!0}),rp.ConversationConnectionMessage=void 0;const uee=Mt();class lee extends uee.ConnectionMessage{constructor(e,A,r,i){super(e,A,r,i);const n=JSON.parse(this.textBody);n.type!==void 0&&(this.privConversationMessageType=n.type)}get conversationMessageType(){return this.privConversationMessageType}}rp.ConversationConnectionMessage=lee,Object.defineProperty(mI,"__esModule",{value:!0}),mI.ConversationWebsocketMessageFormatter=void 0;const Xc=Mt(),$L=rp;class hee{toConnectionMessage(e){const A=new Xc.Deferred;try{if(e.messageType===Xc.MessageType.Text){const r=new $L.ConversationConnectionMessage(e.messageType,e.textContent,{},e.id);A.resolve(r)}else e.messageType===Xc.MessageType.Binary&&A.resolve(new $L.ConversationConnectionMessage(e.messageType,e.binaryContent,void 0,e.id))}catch(r){A.reject(`Error formatting the message. Error: ${r}`)}return A.promise}fromConnectionMessage(e){const A=new Xc.Deferred;try{if(e.messageType===Xc.MessageType.Text){const r=`${e.textBody?e.textBody:""}`;A.resolve(new Xc.RawWebsocketMessage(Xc.MessageType.Text,r,e.id))}}catch(r){A.reject(`Error formatting the message. ${r}`)}return A.promise}}mI.ConversationWebsocketMessageFormatter=hee;var eF;function gee(){if(eF)return Ap;eF=1,Object.defineProperty(Ap,"__esModule",{value:!0}),Ap.ConversationConnectionFactory=void 0;const t=Zr(),e=Mt(),A=Ut,r=Ve(),i=ps(),n=Tl,o=mI;let s=class extends i.ConnectionFactoryBase{create(c,u,l){const g=c.parameters.getProperty(r.PropertyId.ConversationTranslator_Host,n.ConversationConnectionConfig.host),h=c.parameters.getProperty(r.PropertyId.ConversationTranslator_CorrelationId,(0,e.createGuid)()),p=`wss://${g}${n.ConversationConnectionConfig.webSocketPath}`,C=c.parameters.getProperty(r.PropertyId.ConversationTranslator_Token,void 0);A.Contracts.throwIfNullOrUndefined(C,"token");const I={};I[n.ConversationConnectionConfig.configParams.apiVersion]=n.ConversationConnectionConfig.apiVersion,I[n.ConversationConnectionConfig.configParams.token]=C,I[n.ConversationConnectionConfig.configParams.correlationId]=h;const E=c.parameters.getProperty("SPEECH-EnableWebsocketCompression","false")==="true";return Promise.resolve(new t.WebsocketConnection(p,I,{},new o.ConversationWebsocketMessageFormatter,t.ProxyInfo.fromRecognizerConfig(c),E,l))}};return Ap.ConversationConnectionFactory=s,Ap}var ip={},MI={};Object.defineProperty(MI,"__esModule",{value:!0}),MI.ConversationRequestSession=void 0;const Y0=Mt();class dee{constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privSessionId=e,this.privRequestId=(0,Y0.createNoDashGuid)(),this.privRequestCompletionDeferral=new Y0.Deferred}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get completionPromise(){return this.privRequestCompletionDeferral.promise}onPreConnectionStart(e,A){this.privSessionId=A}onAuthCompleted(e){e&&this.onComplete()}onConnectionEstablishCompleted(e){e!==200&&e===403&&this.onComplete()}onServiceTurnEndResponse(e){e?this.privRequestId=(0,Y0.createNoDashGuid)():this.onComplete()}async dispose(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)await e.detach()}}onComplete(){}}MI.ConversationRequestSession=dee;var Hi={},tF;function AF(){if(tF)return Hi;tF=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.ConversationReceivedTranslationEventArgs=Hi.ParticipantsListEventArgs=Hi.ParticipantAttributeEventArgs=Hi.ParticipantEventArgs=Hi.LockRoomEventArgs=Hi.MuteAllEventArgs=void 0;const t=Ve();class e extends t.SessionEventArgs{constructor(a,c){super(c),this.privIsMuted=a}get isMuted(){return this.privIsMuted}}Hi.MuteAllEventArgs=e;class A extends t.SessionEventArgs{constructor(a,c){super(c),this.privIsLocked=a}get isMuted(){return this.privIsLocked}}Hi.LockRoomEventArgs=A;class r extends t.SessionEventArgs{constructor(a,c){super(c),this.privParticipant=a}get participant(){return this.privParticipant}}Hi.ParticipantEventArgs=r;class i extends t.SessionEventArgs{constructor(a,c,u,l){super(l),this.privKey=c,this.privValue=u,this.privParticipantId=a}get value(){return this.privValue}get key(){return this.privKey}get id(){return this.privParticipantId}}Hi.ParticipantAttributeEventArgs=i;class n extends t.SessionEventArgs{constructor(a,c,u,l,g,h,p,C,I){super(I),this.privRoomId=a,this.privSessionToken=c,this.privTranslateTo=u,this.privProfanityFilter=l,this.privRoomProfanityFilter=g,this.privIsRoomLocked=h,this.privIsRoomLocked=p,this.privParticipants=C}get sessionToken(){return this.privSessionToken}get conversationId(){return this.privRoomId}get translateTo(){return this.privTranslateTo}get profanityFilter(){return this.privProfanityFilter}get roomProfanityFilter(){return this.privRoomProfanityFilter}get isRoomLocked(){return this.privIsRoomLocked}get isMuteAll(){return this.privIsMuteAll}get participants(){return this.privParticipants}}Hi.ParticipantsListEventArgs=n;class o{constructor(a,c,u){this.privPayload=c,this.privCommand=a,this.privSessionId=u}get payload(){return this.privPayload}get command(){return this.privCommand}get sessionId(){return this.privSessionId}}return Hi.ConversationReceivedTranslationEventArgs=o,Hi}var vo={};Object.defineProperty(vo,"__esModule",{value:!0}),vo.ConversationTranslatorCommandTypes=vo.ConversationTranslatorMessageTypes=vo.InternalParticipants=void 0;class pee{constructor(e=[],A){this.participants=e,this.meId=A}addOrUpdateParticipant(e){if(e===void 0)return;const A=this.getParticipantIndex(e.id);return A>-1?this.participants.splice(A,1,e):this.participants.push(e),this.getParticipant(e.id)}getParticipantIndex(e){return this.participants.findIndex(A=>A.id===e)}getParticipant(e){return this.participants.find(A=>A.id===e)}deleteParticipant(e){this.participants=this.participants.filter(A=>A.id!==e)}get host(){return this.participants.find(e=>e.isHost===!0)}get me(){return this.getParticipant(this.meId)}}vo.InternalParticipants=pee,vo.ConversationTranslatorMessageTypes={command:"command",final:"final",info:"info",instantMessage:"instant_message",keepAlive:"keep_alive",partial:"partial",participantCommand:"participant_command",translatedMessage:"translated_message"},vo.ConversationTranslatorCommandTypes={changeNickname:"ChangeNickname",disconnectSession:"DisconnectSession",ejectParticipant:"EjectParticipant",instant_message:"instant_message",joinSession:"JoinSession",leaveSession:"LeaveSession",participantList:"ParticipantList",roomExpirationWarning:"RoomExpirationWarning",setLockState:"SetLockState",setMute:"SetMute",setMuteAll:"SetMuteAll",setProfanityFiltering:"SetProfanityFiltering",setTranslateToLanguages:"SetTranslateToLanguages",setUseTTS:"SetUseTTS"};var rF={},yI={};Object.defineProperty(yI,"__esModule",{value:!0}),yI.CommandResponsePayload=void 0;const fee=t=>JSON.parse(t);class H0{constructor(e){this.privCommandResponse=fee(e)}get type(){return this.privCommandResponse.type}get command(){return this.privCommandResponse.command}get id(){return this.privCommandResponse.id}get nickname(){return this.privCommandResponse.nickname}get participantId(){return this.privCommandResponse.participantId}get roomid(){return this.privCommandResponse.roomid}get value(){return this.privCommandResponse.value}get token(){return this.privCommandResponse.token}static fromJSON(e){return new H0(e)}}yI.CommandResponsePayload=H0;var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0}),Ul.ParticipantPayloadResponse=Ul.ParticipantsListPayloadResponse=void 0;const Eee=t=>JSON.parse(t),Cee=t=>JSON.parse(t);class z0{constructor(e){this.privParticipantsPayloadResponse=Eee(e)}get roomid(){return this.privParticipantsPayloadResponse.roomid}get id(){return this.privParticipantsPayloadResponse.id}get command(){return this.privParticipantsPayloadResponse.command}get participants(){return this.privParticipantsPayloadResponse.participants}get token(){return this.privParticipantsPayloadResponse.token}get translateTo(){return this.privParticipantsPayloadResponse.translateTo}get profanityFilter(){return this.privParticipantsPayloadResponse.profanityFilter}get roomProfanityFilter(){return this.privParticipantsPayloadResponse.roomProfanityFilter}get roomLocked(){return this.privParticipantsPayloadResponse.roomLocked}get muteAll(){return this.privParticipantsPayloadResponse.muteAll}get type(){return this.privParticipantsPayloadResponse.type}static fromJSON(e){return new z0(e)}}Ul.ParticipantsListPayloadResponse=z0;class J0{constructor(e){this.privParticipantPayloadResponse=Cee(e)}get nickname(){return this.privParticipantPayloadResponse.nickname}get locale(){return this.privParticipantPayloadResponse.locale}get usetts(){return this.privParticipantPayloadResponse.usetts}get ismuted(){return this.privParticipantPayloadResponse.ismuted}get ishost(){return this.privParticipantPayloadResponse.ishost}get participantId(){return this.privParticipantPayloadResponse.participantId}get avatar(){return this.privParticipantPayloadResponse.avatar}static fromJSON(e){return new J0(e)}}Ul.ParticipantPayloadResponse=J0;var Ll={};Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.TextResponsePayload=Ll.SpeechResponsePayload=void 0;const Iee=t=>JSON.parse(t),Bee=t=>JSON.parse(t);class q0{constructor(e){this.privSpeechResponse=Iee(e)}get recognition(){return this.privSpeechResponse.recognition}get translations(){return this.privSpeechResponse.translations}get id(){return this.privSpeechResponse.id}get language(){return this.privSpeechResponse.language}get nickname(){return this.privSpeechResponse.nickname}get participantId(){return this.privSpeechResponse.participantId}get roomid(){return this.privSpeechResponse.roomid}get timestamp(){return this.privSpeechResponse.timestamp}get type(){return this.privSpeechResponse.type}get isFinal(){return this.privSpeechResponse.type==="final"}static fromJSON(e){return new q0(e)}}Ll.SpeechResponsePayload=q0;class V0{constructor(e){this.privTextResponse=Bee(e)}get originalText(){return this.privTextResponse.originalText}get translations(){return this.privTextResponse.translations}get id(){return this.privTextResponse.id}get language(){return this.privTextResponse.language}get nickname(){return this.privTextResponse.nickname}get participantId(){return this.privTextResponse.participantId}get roomid(){return this.privTextResponse.roomid}get timestamp(){return this.privTextResponse.timestamp}get type(){return this.privTextResponse.type}static fromJSON(e){return new V0(e)}}Ll.TextResponsePayload=V0,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextResponsePayload=t.SpeechResponsePayload=t.ParticipantPayloadResponse=t.ParticipantsListPayloadResponse=t.CommandResponsePayload=void 0;var e=yI;Object.defineProperty(t,"CommandResponsePayload",{enumerable:!0,get:function(){return e.CommandResponsePayload}});var A=Ul;Object.defineProperty(t,"ParticipantsListPayloadResponse",{enumerable:!0,get:function(){return A.ParticipantsListPayloadResponse}}),Object.defineProperty(t,"ParticipantPayloadResponse",{enumerable:!0,get:function(){return A.ParticipantPayloadResponse}});var r=Ll;Object.defineProperty(t,"SpeechResponsePayload",{enumerable:!0,get:function(){return r.SpeechResponsePayload}}),Object.defineProperty(t,"TextResponsePayload",{enumerable:!0,get:function(){return r.TextResponsePayload}})}(rF);var iF;function vee(){if(iF)return ip;iF=1,Object.defineProperty(ip,"__esModule",{value:!0}),ip.ConversationServiceAdapter=void 0;const t=Mt(),e=Ve(),A=ut(),r=rp,i=MI,n=AF(),o=vo,s=rF;let a=class extends A.ServiceRecognizerBase{constructor(u,l,g,h,p){super(u,l,g,h,p),this.privConnectionConfigPromise=void 0,this.privLastPartialUtteranceId="",this.privConversationServiceConnector=p,this.privConversationAuthentication=u,this.receiveMessageOverride=()=>this.receiveConversationMessageOverride(),this.recognizeOverride=()=>this.noOp(),this.postConnectImplOverride=C=>this.conversationConnectImpl(C),this.configConnectionOverride=()=>this.configConnection(),this.disconnectOverride=()=>this.privDisconnect(),this.privConversationRequestSession=new i.ConversationRequestSession((0,t.createNoDashGuid)()),this.privConversationConnectionFactory=l,this.privConversationIsDisposed=!1}isDisposed(){return super.isDisposed()||this.privConversationIsDisposed}async dispose(u){this.privConversationIsDisposed=!0,this.privConnectionConfigPromise!==void 0&&await(await this.privConnectionConfigPromise).dispose(u),await super.dispose(u)}async sendMessage(u){return(await this.fetchConnection()).send(new r.ConversationConnectionMessage(t.MessageType.Text,u))}async sendMessageAsync(u){await(await this.fetchConnection()).send(new r.ConversationConnectionMessage(t.MessageType.Text,u))}privDisconnect(){if(!this.terminateMessageLoop)return this.cancelRecognition(this.privConversationRequestSession.sessionId,this.privConversationRequestSession.requestId,e.CancellationReason.Error,e.CancellationErrorCode.NoError,"Disconnecting"),this.terminateMessageLoop=!0,Promise.resolve()}async processTypeSpecificMessages(){return!0}cancelRecognition(u,l,g,h,p){this.terminateMessageLoop=!0;const C=new e.ConversationTranslationCanceledEventArgs(g,p,h,void 0,u);try{this.privConversationServiceConnector.canceled&&this.privConversationServiceConnector.canceled(this.privConversationServiceConnector,C)}catch{}}async conversationConnectImpl(u){return this.privConnectionLoop=this.startMessageLoop(),u}async receiveConversationMessageOverride(){if(this.isDisposed()||this.terminateMessageLoop)return Promise.resolve();const u=new t.Deferred;try{const g=await(await this.fetchConnection()).read();if(this.isDisposed()||this.terminateMessageLoop)return u.resolve(),Promise.resolve();if(!g)return this.receiveConversationMessageOverride();const h=this.privConversationRequestSession.sessionId,p=g.conversationMessageType.toLowerCase();let C=!1;try{switch(p){case"info":case"participant_command":case"command":const I=s.CommandResponsePayload.fromJSON(g.textBody);switch(I.command.toLowerCase()){case"participantlist":const x=s.ParticipantsListPayloadResponse.fromJSON(g.textBody),P=x.participants.map(G=>({avatar:G.avatar,displayName:G.nickname,id:G.participantId,isHost:G.ishost,isMuted:G.ismuted,isUsingTts:G.usetts,preferredLanguage:G.locale}));this.privConversationServiceConnector.participantsListReceived&&this.privConversationServiceConnector.participantsListReceived(this.privConversationServiceConnector,new n.ParticipantsListEventArgs(x.roomid,x.token,x.translateTo,x.profanityFilter,x.roomProfanityFilter,x.roomLocked,x.muteAll,P,h));break;case"settranslatetolanguages":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new n.ParticipantAttributeEventArgs(I.participantId,o.ConversationTranslatorCommandTypes.setTranslateToLanguages,I.value,h));break;case"setprofanityfiltering":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new n.ParticipantAttributeEventArgs(I.participantId,o.ConversationTranslatorCommandTypes.setProfanityFiltering,I.value,h));break;case"setmute":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new n.ParticipantAttributeEventArgs(I.participantId,o.ConversationTranslatorCommandTypes.setMute,I.value,h));break;case"setmuteall":this.privConversationServiceConnector.muteAllCommandReceived&&this.privConversationServiceConnector.muteAllCommandReceived(this.privConversationServiceConnector,new n.MuteAllEventArgs(I.value,h));break;case"roomexpirationwarning":this.privConversationServiceConnector.conversationExpiration&&this.privConversationServiceConnector.conversationExpiration(this.privConversationServiceConnector,new e.ConversationExpirationEventArgs(I.value,this.privConversationRequestSession.sessionId));break;case"setusetts":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new n.ParticipantAttributeEventArgs(I.participantId,o.ConversationTranslatorCommandTypes.setUseTTS,I.value,h));break;case"setlockstate":this.privConversationServiceConnector.lockRoomCommandReceived&&this.privConversationServiceConnector.lockRoomCommandReceived(this.privConversationServiceConnector,new n.LockRoomEventArgs(I.value,h));break;case"changenickname":this.privConversationServiceConnector.participantUpdateCommandReceived&&this.privConversationServiceConnector.participantUpdateCommandReceived(this.privConversationServiceConnector,new n.ParticipantAttributeEventArgs(I.participantId,o.ConversationTranslatorCommandTypes.changeNickname,I.value,h));break;case"joinsession":const D=s.ParticipantPayloadResponse.fromJSON(g.textBody),T={avatar:D.avatar,displayName:D.nickname,id:D.participantId,isHost:D.ishost,isMuted:D.ismuted,isUsingTts:D.usetts,preferredLanguage:D.locale};this.privConversationServiceConnector.participantJoinCommandReceived&&this.privConversationServiceConnector.participantJoinCommandReceived(this.privConversationServiceConnector,new n.ParticipantEventArgs(T,h));break;case"leavesession":const q={id:I.participantId};this.privConversationServiceConnector.participantLeaveCommandReceived&&this.privConversationServiceConnector.participantLeaveCommandReceived(this.privConversationServiceConnector,new n.ParticipantEventArgs(q,h));break;case"disconnectsession":const Q={id:I.participantId};break;case"token":const R=new A.CognitiveTokenAuthentication(()=>{const G=I.token;return Promise.resolve(G)},()=>{const G=I.token;return Promise.resolve(G)});this.authentication=R,this.privConversationServiceConnector.onToken(R);break;default:break}break;case"partial":case"final":const E=s.SpeechResponsePayload.fromJSON(g.textBody),v=p==="final"?e.ResultReason.TranslatedParticipantSpeech:e.ResultReason.TranslatingParticipantSpeech,m=new e.ConversationTranslationResult(E.participantId,this.getTranslations(E.translations),E.language,E.id,v,E.recognition,void 0,void 0,g.textBody,void 0);E.isFinal?((m.text!==void 0&&m.text.length>0||E.id===this.privLastPartialUtteranceId)&&(C=!0),C&&this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new n.ConversationReceivedTranslationEventArgs(o.ConversationTranslatorMessageTypes.final,m,h))):m.text!==void 0&&(this.privLastPartialUtteranceId=E.id,this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new n.ConversationReceivedTranslationEventArgs(o.ConversationTranslatorMessageTypes.partial,m,h)));break;case"translated_message":const M=s.TextResponsePayload.fromJSON(g.textBody),O=new e.ConversationTranslationResult(M.participantId,this.getTranslations(M.translations),M.language,void 0,void 0,M.originalText,void 0,void 0,void 0,g.textBody,void 0);this.privConversationServiceConnector.translationReceived&&this.privConversationServiceConnector.translationReceived(this.privConversationServiceConnector,new n.ConversationReceivedTranslationEventArgs(o.ConversationTranslatorMessageTypes.instantMessage,O,h));break;default:break}}catch{}return this.receiveConversationMessageOverride()}catch{this.terminateMessageLoop=!0}return u.promise}async startMessageLoop(){if(this.isDisposed())return Promise.resolve();this.terminateMessageLoop=!1;const u=this.receiveConversationMessageOverride();try{return await u}catch(l){return this.cancelRecognition(this.privRequestSession?this.privRequestSession.sessionId:"",this.privRequestSession?this.privRequestSession.requestId:"",e.CancellationReason.Error,e.CancellationErrorCode.RuntimeError,l),null}}configConnection(){return this.isDisposed()?Promise.resolve(void 0):this.privConnectionConfigPromise!==void 0?this.privConnectionConfigPromise.then(u=>u.state()===t.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigPromise=void 0,this.configConnection()):this.privConnectionConfigPromise,()=>(this.privConnectionId=null,this.privConnectionConfigPromise=void 0,this.configConnection())):this.terminateMessageLoop?Promise.resolve(void 0):(this.privConnectionConfigPromise=this.connectImpl().then(u=>u),this.privConnectionConfigPromise)}getTranslations(u){let l;if(u!==void 0){l=new e.Translations;for(const g of u)l.set(g.lang,g.translation)}return l}};return ip.ConversationServiceAdapter=a,ip}var nF;function wee(){if(nF)return Zc;nF=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.ConversationTranslatorRecognizer=Zc.ConversationRecognizerFactory=void 0;const t=ut(),e=Mt(),A=Ut,r=Ve(),i=gee(),n=vee();class o{static fromConfig(c,u,l){return new s(c,u,l)}}Zc.ConversationRecognizerFactory=o;let s=class extends r.Recognizer{constructor(c,u,l){const g=u;A.Contracts.throwIfNull(g,"speechConfig");const h=c;A.Contracts.throwIfNull(h,"conversationImpl"),super(l,g.properties,new i.ConversationConnectionFactory),this.privConversation=h,this.privIsDisposed=!1,this.privProperties=g.properties.clone(),this.privConnection=r.Connection.fromRecognizer(this),this.privProperties.getProperty(r.PropertyId.WebWorkerLoadType,"on").toLowerCase()==="on"&&typeof Blob<"u"&&typeof Worker<"u"?(this.privSetTimeout=e.Timeout.setTimeout,this.privClearTimeout=e.Timeout.clearTimeout):typeof window<"u"?(this.privSetTimeout=window.setTimeout.bind(window),this.privClearTimeout=window.clearTimeout.bind(window)):(this.privSetTimeout=setTimeout,this.privClearTimeout=clearTimeout)}set connected(c){this.privConnection.connected=c}set disconnected(c){this.privConnection.disconnected=c}get speechRecognitionLanguage(){return this.privSpeechRecognitionLanguage}get properties(){return this.privProperties}isDisposed(){return this.privIsDisposed}connect(c,u,l){try{A.Contracts.throwIfDisposed(this.privIsDisposed),A.Contracts.throwIfNullOrWhitespace(c,"token"),this.privReco.conversationTranslatorToken=c,this.resetConversationTimeout(),this.privReco.connectAsync(u,l)}catch(g){if(l)if(g instanceof Error){const h=g;l(h.name+": "+h.message)}else l(g)}}disconnect(c,u){try{A.Contracts.throwIfDisposed(this.privIsDisposed),this.privTimeoutToken!==void 0&&this.privClearTimeout(this.privTimeoutToken),this.privReco.disconnect().then(()=>{c&&c()},l=>{u&&u(l)})}catch(l){if(u)if(l instanceof Error){const g=l;u(g.name+": "+g.message)}else u(l);this.dispose(!0).catch(g=>{e.Events.instance.onEvent(new e.BackgroundEvent(g))})}}sendRequest(c,u,l){try{A.Contracts.throwIfDisposed(this.privIsDisposed),this.sendMessage(c,u,l)}catch(g){if(l)if(g instanceof Error){const h=g;l(h.name+": "+h.message)}else l(g);this.dispose(!0).catch(h=>{e.Events.instance.onEvent(new e.BackgroundEvent(h))})}}onToken(c){this.privConversation.onToken(c)}async close(){this.privIsDisposed||(this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close()),this.privConnection=void 0,await this.dispose(!0))}async dispose(c){this.privIsDisposed||c&&(this.privTimeoutToken!==void 0&&this.privClearTimeout(this.privTimeoutToken),this.privIsDisposed=!0,this.privConnection&&(this.privConnection.closeConnection(),this.privConnection.close(),this.privConnection=void 0),await super.dispose(c))}createRecognizerConfig(c){return new t.RecognizerConfig(c,this.privProperties)}createServiceRecognizer(c,u,l,g){const h=l;return new n.ConversationServiceAdapter(c,u,h,g,this)}sendMessage(c,u,l){const g=this.privReco;((p,C,I)=>{p!==void 0?p.then(()=>{try{C&&C()}catch(E){I&&I(`'Unhandled error on promise callback: ${E}'`)}},E=>{try{I&&I(E)}catch{}}):I&&I("Null promise")})(g.sendMessageAsync(c),u,l),this.resetConversationTimeout()}resetConversationTimeout(){this.privTimeoutToken!==void 0&&this.privClearTimeout(this.privTimeoutToken),this.privTimeoutToken=this.privSetTimeout(()=>{this.sendRequest(this.privConversation.getKeepAlive())},6e4)}};return Zc.ConversationTranslatorRecognizer=s,Zc}var np={},sF;function See(){if(sF)return np;sF=1,Object.defineProperty(np,"__esModule",{value:!0}),np.TranscriberRecognizer=void 0;const t=Mt(),e=Ut,A=Ve(),r=ut(),i=vn;let n=class extends A.Recognizer{constructor(s,a){const c=s;e.Contracts.throwIfNull(c,"speechTranslationConfig");const u=a;e.Contracts.throwIfNull(u,"audioConfigImpl"),e.Contracts.throwIfNullOrWhitespace(c.speechRecognitionLanguage,A.PropertyId[A.PropertyId.SpeechServiceConnection_RecoLanguage]),super(a,c.properties,new r.TranscriberConnectionFactory),this.privDisposedRecognizer=!1,this.isMeetingRecognizer=!1}get speechRecognitionLanguage(){return e.Contracts.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(A.PropertyId.SpeechServiceConnection_RecoLanguage)}get properties(){return this.privProperties}get authorizationToken(){return this.properties.getProperty(A.PropertyId.SpeechServiceAuthorization_Token)}set authorizationToken(s){e.Contracts.throwIfNullOrWhitespace(s,"token"),this.properties.setProperty(A.PropertyId.SpeechServiceAuthorization_Token,s)}set conversation(s){e.Contracts.throwIfNullOrUndefined(s,"Conversation"),this.isMeetingRecognizer=!1,this.privConversation=s}getConversationInfo(){return e.Contracts.throwIfNullOrUndefined(this.privConversation,"Conversation"),this.privConversation.conversationInfo}set meeting(s){e.Contracts.throwIfNullOrUndefined(s,"Meeting"),this.isMeetingRecognizer=!0,this.privMeeting=s}getMeetingInfo(){return e.Contracts.throwIfNullOrUndefined(this.privMeeting,"Meeting"),this.privMeeting.meetingInfo}IsMeetingRecognizer(){return this.isMeetingRecognizer}startContinuousRecognitionAsync(s,a){(0,t.marshalPromiseToCallbacks)(this.startContinuousRecognitionAsyncImpl(i.RecognitionMode.Conversation),s,a)}stopContinuousRecognitionAsync(s,a){(0,t.marshalPromiseToCallbacks)(this.stopContinuousRecognitionAsyncImpl(),s,a)}async close(){this.privDisposedRecognizer||await this.dispose(!0)}async pushConversationEvent(s,a){const c=this.privReco;e.Contracts.throwIfNullOrUndefined(c,"serviceRecognizer"),await c.sendSpeechEventAsync(s,a)}async pushMeetingEvent(s,a){const c=this.privReco;e.Contracts.throwIfNullOrUndefined(c,"serviceRecognizer"),await c.sendMeetingSpeechEventAsync(s,a)}async enforceAudioGating(){const c=(await this.audioConfig.format).channels;if(c===1){if(this.properties.getProperty("f0f5debc-f8c9-4892-ac4b-90a7ab359fd2","false").toLowerCase()!=="true")throw new Error("Single channel audio configuration for MeetingTranscriber is currently under private preview, please contact diarizationrequest@microsoft.com for more details")}else if(c!==8)throw new Error(`Unsupported audio configuration: Detected ${c}-channel audio`)}connectMeetingCallbacks(s){this.isMeetingRecognizer=!0,this.canceled=(a,c)=>{s.canceled&&s.canceled(s,c)},this.recognizing=(a,c)=>{s.transcribing&&s.transcribing(s,c)},this.recognized=(a,c)=>{s.transcribed&&s.transcribed(s,c)},this.sessionStarted=(a,c)=>{s.sessionStarted&&s.sessionStarted(s,c)},this.sessionStopped=(a,c)=>{s.sessionStopped&&s.sessionStopped(s,c)}}disconnectCallbacks(){this.canceled=void 0,this.recognizing=void 0,this.recognized=void 0,this.sessionStarted=void 0,this.sessionStopped=void 0}async dispose(s){this.privDisposedRecognizer||(s&&(this.privDisposedRecognizer=!0,await this.implRecognizerStop()),await super.dispose(s))}createRecognizerConfig(s){return new r.RecognizerConfig(s,this.properties)}createServiceRecognizer(s,a,c,u){const l=c;return new r.TranscriptionServiceRecognizer(s,a,l,u,this)}};return np.TranscriberRecognizer=n,np}var oF;function mee(){return oF||(oF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.InternalParticipants=t.ConversationTranslatorMessageTypes=t.ConversationTranslatorCommandTypes=t.ParticipantsListEventArgs=t.ParticipantEventArgs=t.ParticipantAttributeEventArgs=t.MuteAllEventArgs=t.LockRoomEventArgs=t.ConversationReceivedTranslationEventArgs=t.TranscriberRecognizer=t.ConversationRecognizerFactory=t.ConversationConnectionConfig=t.ConversationManager=void 0;var e=cee();Object.defineProperty(t,"ConversationManager",{enumerable:!0,get:function(){return e.ConversationManager}});var A=Tl;Object.defineProperty(t,"ConversationConnectionConfig",{enumerable:!0,get:function(){return A.ConversationConnectionConfig}});var r=wee();Object.defineProperty(t,"ConversationRecognizerFactory",{enumerable:!0,get:function(){return r.ConversationRecognizerFactory}});var i=See();Object.defineProperty(t,"TranscriberRecognizer",{enumerable:!0,get:function(){return i.TranscriberRecognizer}});var n=AF();Object.defineProperty(t,"ConversationReceivedTranslationEventArgs",{enumerable:!0,get:function(){return n.ConversationReceivedTranslationEventArgs}}),Object.defineProperty(t,"LockRoomEventArgs",{enumerable:!0,get:function(){return n.LockRoomEventArgs}}),Object.defineProperty(t,"MuteAllEventArgs",{enumerable:!0,get:function(){return n.MuteAllEventArgs}}),Object.defineProperty(t,"ParticipantAttributeEventArgs",{enumerable:!0,get:function(){return n.ParticipantAttributeEventArgs}}),Object.defineProperty(t,"ParticipantEventArgs",{enumerable:!0,get:function(){return n.ParticipantEventArgs}}),Object.defineProperty(t,"ParticipantsListEventArgs",{enumerable:!0,get:function(){return n.ParticipantsListEventArgs}});var o=vo;Object.defineProperty(t,"ConversationTranslatorCommandTypes",{enumerable:!0,get:function(){return o.ConversationTranslatorCommandTypes}}),Object.defineProperty(t,"ConversationTranslatorMessageTypes",{enumerable:!0,get:function(){return o.ConversationTranslatorMessageTypes}}),Object.defineProperty(t,"InternalParticipants",{enumerable:!0,get:function(){return o.InternalParticipants}})}(j0)),j0}var W0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesisAudioMetadata=t.MetadataType=void 0,function(A){A.WordBoundary="WordBoundary",A.Bookmark="Bookmark",A.Viseme="Viseme",A.SentenceBoundary="SentenceBoundary",A.SessionEnd="SessionEnd",A.AvatarSignal="TalkingAvatarSignal"}(t.MetadataType||(t.MetadataType={}));class e{constructor(r){this.privSynthesisAudioMetadata=JSON.parse(r)}static fromJSON(r){return new e(r)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}t.SynthesisAudioMetadata=e})(W0);var sp={},Gs={};Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.SynthesisStartedEvent=Gs.ConnectingToSynthesisServiceEvent=Gs.SynthesisTriggeredEvent=Gs.SpeechSynthesisEvent=void 0;const aF=Mt();class QI extends aF.PlatformEvent{constructor(e,A,r=aF.EventType.Info){super(e,r),this.privRequestId=A}get requestId(){return this.privRequestId}}Gs.SpeechSynthesisEvent=QI;class Mee extends QI{constructor(e,A,r){super("SynthesisTriggeredEvent",e),this.privSessionAudioDestinationId=A,this.privTurnAudioDestinationId=r}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}}Gs.SynthesisTriggeredEvent=Mee;class yee extends QI{constructor(e,A){super("ConnectingToSynthesisServiceEvent",e),this.privAuthFetchEventId=A}get authFetchEventId(){return this.privAuthFetchEventId}}Gs.ConnectingToSynthesisServiceEvent=yee;class Qee extends QI{constructor(e,A){super("SynthesisStartedEvent",e),this.privAuthFetchEventId=A}get authFetchEventId(){return this.privAuthFetchEventId}}Gs.SynthesisStartedEvent=Qee;var cF;function Ree(){if(cF)return sp;cF=1,Object.defineProperty(sp,"__esModule",{value:!0}),sp.SynthesisTurn=void 0;const t=Mt(),e=li,A=Ve(),r=W0,i=Gs;let n=class gR{constructor(){this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privRequestId=(0,t.createNoDashGuid)(),this.privTurnDeferral=new t.Deferred,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(s){this.privStreamId=s}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(s){this.privAudioOutputFormat=s}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSynthesisEnded(){return this.privIsSynthesisEnded}get isSynthesizing(){return this.privIsSynthesizing}get currentTextOffset(){return this.privTextOffset}get currentSentenceOffset(){return this.privSentenceOffset}get bytesReceived(){return this.privBytesReceived}get audioDuration(){return this.privAudioDuration}get extraProperties(){if(this.privWebRTCSDP){const s=new A.PropertyCollection;return s.setProperty(A.PropertyId.TalkingAvatarService_WebRTC_SDP,this.privWebRTCSDP),s}}async getAllReceivedAudio(){return this.privReceivedAudio?Promise.resolve(this.privReceivedAudio):this.privIsSynthesisEnded?(await this.readAllAudioFromStream(),Promise.resolve(this.privReceivedAudio)):null}async getAllReceivedAudioWithHeader(){if(this.privReceivedAudioWithHeader)return this.privReceivedAudioWithHeader;if(!this.privIsSynthesisEnded)return null;if(this.audioOutputFormat.hasHeader){const s=await this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=this.audioOutputFormat.addHeader(s),this.privReceivedAudioWithHeader}else return this.getAllReceivedAudio()}startNewSynthesis(s,a,c,u){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=s,this.privRawText=a,this.privIsSSML=c,this.privAudioOutputStream=new e.PullAudioOutputStreamImpl,this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privPartialVisemeAnimation="",this.privWebRTCSDP="",u!==void 0&&(this.privTurnAudioDestination=u,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new i.SynthesisTriggeredEvent(this.requestId,void 0,u===void 0?void 0:u.id()))}onPreConnectionStart(s){this.privAuthFetchEventId=s,this.onEvent(new i.ConnectingToSynthesisServiceEvent(this.privRequestId,this.privAuthFetchEventId))}onAuthCompleted(s){s&&this.onComplete()}onConnectionEstablishCompleted(s){if(s===200){this.onEvent(new i.SynthesisStartedEvent(this.requestId,this.privAuthFetchEventId)),this.privBytesReceived=0;return}else s===403&&this.onComplete()}onServiceResponseMessage(s){const a=JSON.parse(s);this.streamId=a.audio.streamId}onServiceTurnEndResponse(){this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()}onServiceTurnStartResponse(s){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch(()=>{})),this.privInTurn=!0,this.privTurnDeferral=new t.Deferred;const a=JSON.parse(s);a.webrtc&&(this.privWebRTCSDP=a.webrtc.connectionString)}onAudioChunkReceived(s){this.isSynthesizing&&(this.privAudioOutputStream.write(s),this.privBytesReceived+=s.byteLength,this.privTurnAudioDestination!==void 0&&this.privTurnAudioDestination.write(s))}onTextBoundaryEvent(s){this.updateTextOffset(s.Data.text.Text,s.Type)}onVisemeMetadataReceived(s){s.Data.AnimationChunk!==void 0&&(this.privPartialVisemeAnimation+=s.Data.AnimationChunk)}onSessionEnd(s){this.privAudioDuration=s.Data.Offset}async constructSynthesisResult(){const s=await this.getAllReceivedAudioWithHeader();return new A.SpeechSynthesisResult(this.requestId,A.ResultReason.SynthesizingAudioCompleted,s,void 0,this.extraProperties,this.audioDuration)}dispose(){this.privIsDisposed||(this.privIsDisposed=!0)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const s=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",s}onEvent(s){t.Events.instance.onEvent(s)}static isXmlTag(s){return s.length>=2&&s[0]==="<"&&s[s.length-1]===">"}updateTextOffset(s,a){a===r.MetadataType.WordBoundary?(this.privTextOffset=this.privRawText.indexOf(s,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+s.length,this.privIsSSML&&this.withinXmlTag(this.privTextOffset)&&!gR.isXmlTag(s)&&this.updateTextOffset(s,a))):(this.privSentenceOffset=this.privRawText.indexOf(s,this.privNextSearchSentenceIndex),this.privSentenceOffset>=0&&(this.privNextSearchSentenceIndex=this.privSentenceOffset+s.length,this.privIsSSML&&this.withinXmlTag(this.privSentenceOffset)&&!gR.isXmlTag(s)&&this.updateTextOffset(s,a)))}onComplete(){this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,this.privTurnAudioDestination!==void 0&&(this.privTurnAudioDestination.close(),this.privTurnAudioDestination=void 0))}async readAllAudioFromStream(){if(this.privIsSynthesisEnded){this.privReceivedAudio=new ArrayBuffer(this.bytesReceived);try{await this.privAudioOutputStream.read(this.privReceivedAudio)}catch{this.privReceivedAudio=new ArrayBuffer(0)}}}withinXmlTag(s){return this.privRawText.indexOf("<",s+1)>this.privRawText.indexOf(">",s+1)}};return sp.SynthesisTurn=n,sp}var op={},uF;function Dee(){if(uF)return op;uF=1,Object.defineProperty(op,"__esModule",{value:!0}),op.SynthesisAdapterBase=void 0;const t=Mt(),e=Ve(),A=ut(),r=Co;let i=class{constructor(o,s,a,c){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.privConnectionConfigurationPromise=void 0,!o)throw new t.ArgumentNullError("authentication");if(!s)throw new t.ArgumentNullError("connectionFactory");if(!a)throw new t.ArgumentNullError("synthesizerConfig");this.privAuthentication=o,this.privConnectionFactory=s,this.privSynthesizerConfig=a,this.privIsDisposed=!1,this.privSessionAudioDestination=c,this.privSynthesisTurn=new A.SynthesisTurn,this.privConnectionEvents=new t.EventSource,this.privServiceEvents=new t.EventSource,this.privSynthesisContext=new A.SynthesisContext,this.privAgentConfig=new A.AgentConfig,this.connectionEvents.attach(u=>{if(u.name==="ConnectionClosedEvent"){const l=u;l.statusCode!==1e3&&this.cancelSynthesisLocal(e.CancellationReason.Error,l.statusCode===1007?e.CancellationErrorCode.BadRequestParameters:e.CancellationErrorCode.ConnectionFailure,`${l.reason} websocket error code: ${l.statusCode}`)}})}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(o){this.privActivityTemplate=o}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(o){this.privAudioOutputFormat=o,this.privSynthesisTurn.audioOutputFormat=o,this.privSessionAudioDestination!==void 0&&(this.privSessionAudioDestination.format=o),this.synthesisContext!==void 0&&(this.synthesisContext.audioOutputFormat=o)}isDisposed(){return this.privIsDisposed}async dispose(o){this.privIsDisposed=!0,this.privSessionAudioDestination!==void 0&&this.privSessionAudioDestination.close(),this.privConnectionConfigurationPromise!==void 0&&await(await this.privConnectionConfigurationPromise).dispose(o)}async connect(){await this.connectImpl()}async sendNetworkMessage(o,s){const a=typeof s=="string"?t.MessageType.Text:t.MessageType.Binary,c=typeof s=="string"?"application/json":"";return(await this.fetchConnection()).send(new r.SpeechConnectionMessage(a,o,this.privSynthesisTurn.requestId,c,s))}async Speak(o,s,a,c,u,l){let g;if(s?g=o:g=this.privSynthesizer.buildSsml(o),this.speakOverride!==void 0)return this.speakOverride(g,a,c,u);this.privSuccessCallback=c,this.privErrorCallback=u,this.privSynthesisTurn.startNewSynthesis(a,o,s,l);try{await this.connectImpl();const h=await this.fetchConnection();await this.sendSynthesisContext(h),await this.sendSsmlMessage(h,g,a),this.onSynthesisStarted(a),this.receiveMessage()}catch(h){return this.cancelSynthesisLocal(e.CancellationReason.Error,e.CancellationErrorCode.ConnectionFailure,h),Promise.reject(h)}}async stopSpeaking(){return await this.connectImpl(),(await this.fetchConnection()).send(new r.SpeechConnectionMessage(t.MessageType.Text,"synthesis.control",this.privSynthesisTurn.requestId,"application/json",JSON.stringify({action:"stop"})))}cancelSynthesis(o,s,a,c){const u=new e.PropertyCollection;u.setProperty(A.CancellationErrorCodePropertyName,e.CancellationErrorCode[a]);const l=new e.SpeechSynthesisResult(o,e.ResultReason.Canceled,void 0,c,u);if(this.onSynthesisCancelled(l),this.privSuccessCallback)try{this.privSuccessCallback(l)}catch{}}cancelSynthesisLocal(o,s,a){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,o,s,a))}processTypeSpecificMessages(o){return!0}async receiveMessage(){try{const s=await(await this.fetchConnection()).read();if(this.receiveMessageOverride!==void 0)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!s)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;const a=r.SpeechConnectionMessage.fromConnectionMessage(s);if(a.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(a.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse(a.textBody);break;case"response":this.privSynthesisTurn.onServiceResponseMessage(a.textBody);break;case"audio":this.privSynthesisTurn.streamId.toLowerCase()===a.streamId.toLowerCase()&&a.binaryBody&&(this.privSynthesisTurn.onAudioChunkReceived(a.binaryBody),this.onSynthesizing(a.binaryBody),this.privSessionAudioDestination!==void 0&&this.privSessionAudioDestination.write(a.binaryBody));break;case"audio.metadata":const c=A.SynthesisAudioMetadata.fromJSON(a.textBody).Metadata;for(const l of c)switch(l.Type){case A.MetadataType.WordBoundary:case A.MetadataType.SentenceBoundary:this.privSynthesisTurn.onTextBoundaryEvent(l);const g=new e.SpeechSynthesisWordBoundaryEventArgs(l.Data.Offset,l.Data.Duration,l.Data.text.Text,l.Data.text.Length,l.Type===A.MetadataType.WordBoundary?this.privSynthesisTurn.currentTextOffset:this.privSynthesisTurn.currentSentenceOffset,l.Data.text.BoundaryType);this.onWordBoundary(g);break;case A.MetadataType.Bookmark:const h=new e.SpeechSynthesisBookmarkEventArgs(l.Data.Offset,l.Data.Bookmark);this.onBookmarkReached(h);break;case A.MetadataType.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(l),l.Data.IsLastAnimation){const p=new e.SpeechSynthesisVisemeEventArgs(l.Data.Offset,l.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());this.onVisemeReceived(p)}break;case A.MetadataType.AvatarSignal:this.onAvatarEvent(l);break;case A.MetadataType.SessionEnd:this.privSynthesisTurn.onSessionEnd(l);break}break;case"turn.end":this.privSynthesisTurn.onServiceTurnEndResponse();let u;try{u=await this.privSynthesisTurn.constructSynthesisResult(),this.privSuccessCallback&&this.privSuccessCallback(u)}catch(l){this.privErrorCallback&&this.privErrorCallback(l)}this.onSynthesisCompleted(u);break;default:this.processTypeSpecificMessages(a)||this.privServiceEvents&&this.serviceEvents.onEvent(new t.ServiceEvent(a.path.toLowerCase(),a.textBody))}return this.receiveMessage()}catch{}}sendSynthesisContext(o){this.setSynthesisContextSynthesisSection();const s=this.synthesisContext.toJSON();if(s)return o.send(new r.SpeechConnectionMessage(t.MessageType.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",s))}setSpeechConfigSynthesisSection(){}connectImpl(o=!1){if(this.privConnectionPromise!=null)return this.privConnectionPromise.then(a=>a.state()===t.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()):this.privConnectionPromise,()=>(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()));this.privAuthFetchEventId=(0,t.createNoDashGuid)(),this.privConnectionId=(0,t.createNoDashGuid)(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId);const s=o?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=s.then(async a=>{this.privSynthesisTurn.onAuthCompleted(!1);const c=await this.privConnectionFactory.create(this.privSynthesizerConfig,a,this.privConnectionId);c.events.attach(l=>{this.connectionEvents.onEvent(l)});const u=await c.open();return u.statusCode===200?(this.privSynthesisTurn.onConnectionEstablishCompleted(u.statusCode),Promise.resolve(c)):u.statusCode===403&&!o?this.connectImpl(!0):(this.privSynthesisTurn.onConnectionEstablishCompleted(u.statusCode),Promise.reject(`Unable to contact server. StatusCode: ${u.statusCode},
35
- ${this.privSynthesizerConfig.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Url)} Reason: ${u.reason}`))},a=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(a)}),this.privConnectionPromise.catch(()=>{}),this.privConnectionPromise}sendSpeechServiceConfig(o,s){if(s)return o.send(new r.SpeechConnectionMessage(t.MessageType.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",s))}sendSsmlMessage(o,s,a){return o.send(new r.SpeechConnectionMessage(t.MessageType.Text,"ssml",a,"application/ssml+xml",s))}async fetchConnection(){return this.privConnectionConfigurationPromise!==void 0?this.privConnectionConfigurationPromise.then(o=>o.state()===t.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async configureConnection(){const o=await this.connectImpl();return this.configConnectionOverride!==void 0?this.configConnectionOverride(o):(this.setSpeechConfigSynthesisSection(),await this.sendSpeechServiceConfig(o,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),o)}onAvatarEvent(o){}onSynthesisStarted(o){}onSynthesizing(o){}onSynthesisCancelled(o){}onSynthesisCompleted(o){}onWordBoundary(o){}onVisemeReceived(o){}onBookmarkReached(o){}};return op.SynthesisAdapterBase=i,i.telemetryDataEnabled=!0,op}var ap={},lF;function Tee(){if(lF)return ap;lF=1,Object.defineProperty(ap,"__esModule",{value:!0}),ap.AvatarSynthesisAdapter=void 0;const t=Ve(),e=ut();let A=class extends e.SynthesisAdapterBase{constructor(i,n,o,s,a){super(i,n,o,void 0),this.privAvatarSynthesizer=s,this.privSynthesizer=s,this.privAvatarConfig=a}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(void 0)}setSpeechConfigSynthesisSection(){var i,n,o,s,a,c,u,l,g,h,p,C,I,E,v,m,M;this.privSynthesizerConfig.synthesisVideoSection={format:{bitrate:(i=this.privAvatarConfig.videoFormat)==null?void 0:i.bitrate,codec:(n=this.privAvatarConfig.videoFormat)==null?void 0:n.codec,crop:{bottomRight:{x:(a=(s=(o=this.privAvatarConfig.videoFormat)==null?void 0:o.cropRange)==null?void 0:s.bottomRight)==null?void 0:a.x,y:(l=(u=(c=this.privAvatarConfig.videoFormat)==null?void 0:c.cropRange)==null?void 0:u.bottomRight)==null?void 0:l.y},topLeft:{x:(p=(h=(g=this.privAvatarConfig.videoFormat)==null?void 0:g.cropRange)==null?void 0:h.topLeft)==null?void 0:p.x,y:(E=(I=(C=this.privAvatarConfig.videoFormat)==null?void 0:C.cropRange)==null?void 0:I.topLeft)==null?void 0:E.y}},resolution:{height:(v=this.privAvatarConfig.videoFormat)==null?void 0:v.height,width:(m=this.privAvatarConfig.videoFormat)==null?void 0:m.width}},protocol:{name:"WebRTC",webrtcConfig:{clientDescription:btoa(this.privSynthesizerConfig.parameters.getProperty(t.PropertyId.TalkingAvatarService_WebRTC_SDP)),iceServers:this.privAvatarConfig.remoteIceServers??this.privAvatarSynthesizer.iceServers}},talkingAvatar:{background:{color:this.privAvatarConfig.backgroundColor,image:{url:(M=this.privAvatarConfig.backgroundImage)==null?void 0:M.toString()}},character:this.privAvatarConfig.character,customized:this.privAvatarConfig.customized,style:this.privAvatarConfig.style,useBuiltInVoice:this.privAvatarConfig.useBuiltInVoice}}}onAvatarEvent(i){if(this.privAvatarSynthesizer.avatarEventReceived){const n=new t.AvatarEventArgs(i.Data.Offset,i.Data.Name);try{this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer,n)}catch{}}}};return ap.AvatarSynthesisAdapter=A,ap}var cp={},hF;function Uee(){if(hF)return cp;hF=1,Object.defineProperty(cp,"__esModule",{value:!0}),cp.SpeechSynthesisAdapter=void 0;const t=Ve(),e=ut();let A=class extends e.SynthesisAdapterBase{constructor(i,n,o,s,a){super(i,n,o,a),this.privSpeechSynthesizer=s,this.privSynthesizer=s}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(this.privSpeechSynthesizer)}onSynthesisStarted(i){const n=new t.SpeechSynthesisEventArgs(new t.SpeechSynthesisResult(i,t.ResultReason.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,n)}onSynthesizing(i){if(this.privSpeechSynthesizer.synthesizing)try{const n=this.privSynthesisTurn.audioOutputFormat.addHeader(i),o=new t.SpeechSynthesisEventArgs(new t.SpeechSynthesisResult(this.privSynthesisTurn.requestId,t.ResultReason.SynthesizingAudio,n));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,o)}catch{}}onSynthesisCancelled(i){if(this.privSpeechSynthesizer.SynthesisCanceled){const n=new t.SpeechSynthesisEventArgs(i);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,n)}catch{}}}onSynthesisCompleted(i){if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new t.SpeechSynthesisEventArgs(i))}catch{}}onWordBoundary(i){if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,i)}catch{}}onVisemeReceived(i){if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,i)}catch{}}onBookmarkReached(i){if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,i)}catch{}}};return cp.SpeechSynthesisAdapter=A,cp}var up={},gF;function Lee(){if(gF)return up;gF=1,Object.defineProperty(up,"__esModule",{value:!0}),up.SynthesisRestAdapter=void 0;const t=Zr(),e=Ve(),A=ps(),r=Wr;let i=class{constructor(o,s){let a=o.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!a){const u=o.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region,"westus"),l=A.ConnectionFactoryBase.getHostSuffix(u);a=o.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,`https://${u}.tts.speech${l}`)}this.privUri=`${a}/cognitiveservices/voices/list`;const c=t.RestConfigBase.requestOptions;this.privRestAdapter=new t.RestMessageAdapter(c),this.privAuthentication=s}getVoicesList(o){return this.privRestAdapter.setHeaders(r.HeaderNames.ConnectionId,o),this.privAuthentication.fetch(o).then(s=>(this.privRestAdapter.setHeaders(s.headerName,s.token),this.privRestAdapter.request(t.RestRequestType.Get,this.privUri)))}};return up.SynthesisRestAdapter=i,up}var Z0={},dF;function Fee(){return dF||(dF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesizerConfig=t.SynthesisServiceType=void 0;const e=ut();var A;(function(i){i[i.Standard=0]="Standard",i[i.Custom=1]="Custom"})(A=t.SynthesisServiceType||(t.SynthesisServiceType={}));class r{constructor(n,o){this.privSynthesisServiceType=A.Standard,this.avatarEnabled=!1,this.privSpeechServiceConfig=n||new e.SpeechServiceConfig(new e.Context(null)),this.privParameters=o}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(n){this.privSynthesisServiceType=n}set synthesisVideoSection(n){this.privSpeechServiceConfig.Context.synthesis={video:n}}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}t.SynthesizerConfig=r}(Z0)),Z0}var lp={},pF;function Oee(){if(pF)return lp;pF=1,Object.defineProperty(lp,"__esModule",{value:!0}),lp.SynthesisContext=void 0;const t=Ve();let e=class{constructor(){this.privContext={}}setSection(r,i){this.privContext[r]=i}set audioOutputFormat(r){this.privAudioOutputFormat=r}toJSON(){return JSON.stringify(this.privContext)}setSynthesisSection(r){const i=this.buildSynthesisContext(r);this.setSection("synthesis",i)}buildSynthesisContext(r){return{audio:{metadataOptions:{bookmarkEnabled:!!(r!=null&&r.bookmarkReached),punctuationBoundaryEnabled:r==null?void 0:r.properties.getProperty(t.PropertyId.SpeechServiceResponse_RequestPunctuationBoundary,!!(r!=null&&r.wordBoundary)),sentenceBoundaryEnabled:r==null?void 0:r.properties.getProperty(t.PropertyId.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!(r!=null&&r.visemeReceived),wordBoundaryEnabled:r==null?void 0:r.properties.getProperty(t.PropertyId.SpeechServiceResponse_RequestWordBoundary,!!(r!=null&&r.wordBoundary))},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:r==null?void 0:r.autoDetectSourceLanguage}}}};return lp.SynthesisContext=e,lp}var hp={},fF;function bee(){if(fF)return hp;fF=1,Object.defineProperty(hp,"__esModule",{value:!0}),hp.SpeakerRecognitionConfig=void 0;const t=ut();let e=class{constructor(r,i){this.privContext=r||new t.Context(null),this.privParameters=i}get parameters(){return this.privParameters}get Context(){return this.privContext}};return hp.SpeakerRecognitionConfig=e,hp}var gp={},EF;function xee(){if(EF)return gp;EF=1,Object.defineProperty(gp,"__esModule",{value:!0}),gp.SpeakerServiceRecognizer=void 0;const t=Zr(),e=Mt(),A=Ve(),r=ut(),i=Co;let n=class extends r.ServiceRecognizerBase{constructor(s,a,c,u,l){super(s,a,c,u,l),this.privSpeakerRecognizer=l,this.privSpeakerAudioSource=c,this.recognizeSpeaker=g=>this.recognizeSpeakerOnce(g),this.sendPrePayloadJSONOverride=()=>this.noOp()}processTypeSpecificMessages(s){let a=!1;const c=new A.PropertyCollection;switch(s.messageType===e.MessageType.Text&&c.setProperty(A.PropertyId.SpeechServiceResponse_JsonResult,s.textBody),s.path.toLowerCase()){case"speaker.response":const l=JSON.parse(s.textBody);let g;l.status.statusCode.toLowerCase()!=="success"?g=new A.SpeakerRecognitionResult(l,A.ResultReason.Canceled,A.CancellationErrorCode.ServiceError,l.status.reason):g=new A.SpeakerRecognitionResult(l,A.ResultReason.RecognizedSpeaker),this.privResultDeferral&&this.privResultDeferral.resolve(g),a=!0;break}const u=new e.Deferred;return u.resolve(a),u.promise}cancelRecognition(s,a,c,u,l){if(new A.PropertyCollection().setProperty(r.CancellationErrorCodePropertyName,A.CancellationErrorCode[u]),this.privResultDeferral){const h=new A.SpeakerRecognitionResult({scenario:this.privSpeakerModel.scenario,status:{statusCode:l,reason:l}},A.ResultReason.Canceled,u,l);try{this.privResultDeferral.resolve(h)}catch(p){this.privResultDeferral.reject(p)}}}async recognizeSpeakerOnce(s){this.privSpeakerModel=s,this.voiceProfileType=s.scenario,this.privResultDeferral||(this.privResultDeferral=new e.Deferred),this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(A.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const a=this.connectImpl(),c=this.sendPreAudioMessages(this.extractSpeakerContext(s)),u=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),l=await this.privSpeakerAudioSource.format,g=await this.privSpeakerAudioSource.deviceInfo,h=new t.ReplayableAudioNode(u,l.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(h,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:g};try{await a,await c}catch(I){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.ConnectionFailure,I)}const p=new A.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,p),this.receiveMessage(),this.sendAudio(h).then(()=>{},I=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.RuntimeError,I)}),this.privResultDeferral.promise}async sendPreAudioMessages(s){const a=await this.fetchConnection();await this.sendSpeakerRecognition(a,s)}async sendSpeakerRecognition(s,a){const c=JSON.stringify(a);return s.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speaker.context",this.privRequestSession.requestId,"application/json; charset=utf-8",c))}extractSpeakerContext(s){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:s.profileIds,scenario:s.scenario}}};return gp.SpeakerServiceRecognizer=n,gp}var dp={},CF;function Nee(){if(CF)return dp;CF=1,Object.defineProperty(dp,"__esModule",{value:!0}),dp.VoiceServiceRecognizer=void 0;const t=Zr(),e=Mt(),A=Ve(),r=ut(),i=Co;let n=class extends r.ServiceRecognizerBase{constructor(s,a,c,u,l){super(s,a,c,u,l),this.privDeferralMap=new e.DeferralMap,this.privSpeakerAudioSource=c,this.sendPrePayloadJSONOverride=()=>this.noOp()}set SpeakerAudioSource(s){this.privSpeakerAudioSource=s}processTypeSpecificMessages(s){let a=!1;const c=new A.PropertyCollection;switch(s.messageType===e.MessageType.Text&&c.setProperty(A.PropertyId.SpeechServiceResponse_JsonResult,s.textBody),s.path.toLowerCase()){case"speaker.profiles":const l=JSON.parse(s.textBody);switch(l.operation.toLowerCase()){case"create":this.handleCreateResponse(l,s.requestId);break;case"delete":case"reset":this.handleResultResponse(l,s.requestId);break;case"fetch":const C=JSON.parse(s.textBody);this.handleFetchResponse(C,s.requestId);break}a=!0;break;case"speaker.phrases":const g=JSON.parse(s.textBody);this.handlePhrasesResponse(g,s.requestId),a=!0;break;case"speaker.profile.enrollment":const h=JSON.parse(s.textBody),p=new A.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(h.enrollment?h.enrollment.enrollmentStatus:h.status.statusCode),h.enrollment?JSON.stringify(h.enrollment):void 0,h.status.reason);this.privDeferralMap.getId(s.requestId)&&this.privDeferralMap.complete(s.requestId,p),this.privRequestSession.onSpeechEnded(),a=!0;break}const u=new e.Deferred;return u.resolve(a),u.promise}cancelRecognition(s,a,c,u,l){new A.PropertyCollection().setProperty(r.CancellationErrorCodePropertyName,A.CancellationErrorCode[u]);const h=new A.VoiceProfileEnrollmentResult(A.ResultReason.Canceled,l,l);this.privDeferralMap.getId(a)&&this.privDeferralMap.complete(a,h)}async createProfile(s,a){this.voiceProfileType=s.toString();const c=this.connectImpl();try{const u=new e.Deferred;return await c,await this.sendCreateProfile(u,s,a),this.receiveMessage(),u.promise}catch(u){throw u}}async resetProfile(s){return this.voiceProfileType=s.profileType.toString(),this.sendCommonRequest("reset",s.profileType,s)}async deleteProfile(s){return this.voiceProfileType=s.profileType.toString(),this.sendCommonRequest("delete",s.profileType,s)}async retrieveEnrollmentResult(s){return this.voiceProfileType=s.profileType.toString(),this.privExpectedProfileId=s.profileId,this.sendCommonRequest("fetch",s.profileType,s)}async getAllProfiles(s){return this.voiceProfileType=s.toString(),this.sendCommonRequest("fetch",s)}async getActivationPhrases(s,a){this.voiceProfileType=s.toString();const c=this.connectImpl();try{const u=new e.Deferred;return await c,await this.sendPhrasesRequest(u,s,a),this.receiveMessage(),u.promise}catch(u){throw u}}async enrollProfile(s){this.voiceProfileType=s.profileType.toString();const a=new e.Deferred;this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(A.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const c=this.connectImpl(),u=this.sendPreAudioMessages(s,a),l=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),g=await this.privSpeakerAudioSource.format,h=await this.privSpeakerAudioSource.deviceInfo,p=new t.ReplayableAudioNode(l,g.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(p,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:h};try{await c,await u}catch(E){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.ConnectionFailure,E)}const C=new A.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,C),this.receiveMessage(),this.sendAudio(p).then(()=>{},E=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.RuntimeError,E)}),a.promise}async sendPreAudioMessages(s,a){const c=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,a),await this.sendBaseRequest(c,"enroll",this.scenarioFrom(s.profileType),s)}async sendPhrasesRequest(s,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,s);const l=this.scenarioFrom(a),g={locale:c,scenario:l};return u.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speaker.profile.phrases",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCreateProfile(s,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,s);const l=a===A.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":a===A.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification",g={locale:c,number:"1",scenario:l};return u.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speaker.profile.create",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCommonRequest(s,a,c=void 0){const u=this.connectImpl();try{const l=new e.Deferred;this.privRequestSession.onSpeechContext(),await u;const g=await this.fetchConnection();return this.privDeferralMap.add(this.privRequestSession.requestId,l),await this.sendBaseRequest(g,s,this.scenarioFrom(a),c),this.receiveMessage(),l.promise}catch(l){throw l}}async sendBaseRequest(s,a,c,u){const l={scenario:c};return u?l.profileIds=[u.profileId]:l.maxPageSize=-1,s.send(new i.SpeechConnectionMessage(e.MessageType.Text,`speaker.profile.${a}`,this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(l)))}extractSpeakerContext(s){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:s.profileIds,scenario:s.scenario}}handlePhrasesResponse(s,a){if(this.privDeferralMap.getId(a))if(s.status.statusCode.toLowerCase()!=="success"){const c=A.ResultReason.Canceled,u=new A.VoiceProfilePhraseResult(c,s.status.statusCode,s.passPhraseType,[]);this.privDeferralMap.complete(a,u)}else if(s.phrases&&s.phrases.length>0){const c=A.ResultReason.EnrollingVoiceProfile,u=new A.VoiceProfilePhraseResult(c,s.status.statusCode,s.passPhraseType,s.phrases);this.privDeferralMap.complete(a,u)}else throw new Error("Voice Profile get activation phrases failed, no phrases received");else throw new Error(`Voice Profile get activation phrases request for requestID ${a} not found`)}handleCreateResponse(s,a){if(s.profiles&&s.profiles.length>0)if(this.privDeferralMap.getId(a)){const c=s.profiles.map(u=>u.profileId);this.privDeferralMap.complete(a,c)}else throw new Error(`Voice Profile create request for requestID ${a} not found`);else throw new Error("Voice Profile create failed, no profile id received")}handleResultResponse(s,a){if(this.privDeferralMap.getId(a)){const c=s.operation.toLowerCase()==="delete"?A.ResultReason.DeletedVoiceProfile:A.ResultReason.ResetVoiceProfile,u=s.status.statusCode.toLowerCase()==="success"?c:A.ResultReason.Canceled,l=new A.VoiceProfileResult(u,`statusCode: ${s.status.statusCode}, errorDetails: ${s.status.reason}`);this.privDeferralMap.complete(a,l)}else throw new Error(`Voice Profile create request for requestID ${a} not found`)}handleFetchResponse(s,a){if(this.privDeferralMap.getId(a)&&s.profiles[0]){if(this.privExpectedProfileId&&s.profiles.length===1&&s.profiles[0].profileId===this.privExpectedProfileId){this.privExpectedProfileId=void 0;const c=s.profiles[0],u=new A.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(c.enrollmentStatus),JSON.stringify(c),s.status.reason);this.privDeferralMap.complete(a,u)}else if(s.profiles.length>0){const c=s.profiles,u=[];for(const l of c)u.push(new A.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(l.enrollmentStatus),JSON.stringify(l),s.status.reason));this.privDeferralMap.complete(a,u)}}else throw new Error(`Voice Profile fetch request for requestID ${a} not found`)}enrollmentReasonFrom(s){switch(s.toLowerCase()){case"enrolled":return A.ResultReason.EnrolledVoiceProfile;case"invalidlocale":case"invalidphrase":case"invalidaudioformat":case"invalidscenario":case"invalidprofilecount":case"invalidoperation":case"audiotooshort":case"audiotoolong":case"toomanyenrollments":case"storageconflict":case"profilenotfound":case"incompatibleprofiles":case"incompleteenrollment":return A.ResultReason.Canceled;default:return A.ResultReason.EnrollingVoiceProfile}}scenarioFrom(s){return s===A.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":s===A.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification"}};return dp.VoiceServiceRecognizer=n,dp}var IF={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.type=t.connectivity=t.Device=t.OS=t.System=t.Context=t.SpeechServiceConfig=void 0;class e{constructor(s){this.context=s}serialize(){return JSON.stringify(this,(s,a)=>{if(a&&typeof a=="object"&&!Array.isArray(a)){const c={};for(const u in a)Object.hasOwnProperty.call(a,u)&&(c[u&&u.charAt(0).toLowerCase()+u.substring(1)]=a[u]);return c}return a})}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(s){this.recognition=s.toLowerCase()}}t.SpeechServiceConfig=e;class A{constructor(s){this.system=new r,this.os=s}}t.Context=A;class r{constructor(){const s="1.44.0";this.name="SpeechSDK",this.version=s,this.build="JavaScript",this.lang="JavaScript"}}t.System=r;class i{constructor(s,a,c){this.platform=s,this.name=a,this.version=c}}t.OS=i;class n{constructor(s,a,c){this.manufacturer=s,this.model=a,this.version=c}}t.Device=n,function(o){o.Bluetooth="Bluetooth",o.Wired="Wired",o.WiFi="WiFi",o.Cellular="Cellular",o.InBuilt="InBuilt",o.Unknown="Unknown"}(t.connectivity||(t.connectivity={})),function(o){o.Phone="Phone",o.Speaker="Speaker",o.Car="Car",o.Headset="Headset",o.Thermostat="Thermostat",o.Microphones="Microphones",o.Deskphone="Deskphone",o.RemoteControl="RemoteControl",o.Unknown="Unknown",o.File="File",o.Stream="Stream"}(t.type||(t.type={}))})(IF);var BF;function ut(){return BF||(BF=1,function(t){var e=xt&&xt.__createBinding||(Object.create?function(n,o,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return o[s]}})}:function(n,o,s,a){a===void 0&&(a=s),n[a]=o[s]}),A=xt&&xt.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguagesOpenRangeOptionName=t.ForceDictationPropertyName=t.ServicePropertiesPropertyName=t.CancellationErrorCodePropertyName=t.OutputFormatPropertyName=t.SpeechSynthesisAdapter=t.AvatarSynthesisAdapter=void 0,A(aC,t),A(UC,t),A(Ml,t),A(a2,t),A(c2,t),A(M$(),t),A(y$(),t),A(oI,t),A(Q$(),t),A(R$(),t),A(D$(),t),A(ML,t),A(aI,t),A(U$(),t),A(L$(),t),A(F$(),t),A(O$(),t),A(rL(),t),A(b$(),t),A(LL,t),A(x$(),t),A(cI,t),A(K$(),t),A(k$(),t),A(lI,t),A(hI,t),A(gI,t),A(P$(),t),A(G$(),t),A(j$(),t),A(Y$(),t),A(H$(),t),A(dI,t),A(J$(),t),A(pI,t),A(HL,t),A(fI,t),A(II,t),A(BI,t),A(see(),t),A(SI,t),A(mee(),t),A(W0,t),A(Ree(),t),A(Dee(),t);var r=Tee();Object.defineProperty(t,"AvatarSynthesisAdapter",{enumerable:!0,get:function(){return r.AvatarSynthesisAdapter}});var i=Uee();Object.defineProperty(t,"SpeechSynthesisAdapter",{enumerable:!0,get:function(){return i.SpeechSynthesisAdapter}}),A(Lee(),t),A(Fee(),t),A(Oee(),t),A(bee(),t),A(xee(),t),A(Nee(),t),A(IF,t),t.OutputFormatPropertyName="OutputFormat",t.CancellationErrorCodePropertyName="CancellationErrorCode",t.ServicePropertiesPropertyName="ServiceProperties",t.ForceDictationPropertyName="ForceDictation",t.AutoDetectSourceLanguagesOpenRangeOptionName="UND"}(t0)),t0}(function(t){var e=xt&&xt.__createBinding||(Object.create?function(i,n,o,s){s===void 0&&(s=o),Object.defineProperty(i,s,{enumerable:!0,get:function(){return n[o]}})}:function(i,n,o,s){s===void 0&&(s=o),i[s]=n[o]}),A=xt&&xt.__exportStar||function(i,n){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&e(n,i,o)};Object.defineProperty(t,"__esModule",{value:!0});const r=ut();new r.AgentConfig,A(Ve(),t)})(Ps);const hi=[];for(let t=0;t<256;++t)hi.push((t+256).toString(16).slice(1));function Kee(t,e=0){return(hi[t[e+0]]+hi[t[e+1]]+hi[t[e+2]]+hi[t[e+3]]+"-"+hi[t[e+4]]+hi[t[e+5]]+"-"+hi[t[e+6]]+hi[t[e+7]]+"-"+hi[t[e+8]]+hi[t[e+9]]+"-"+hi[t[e+10]]+hi[t[e+11]]+hi[t[e+12]]+hi[t[e+13]]+hi[t[e+14]]+hi[t[e+15]]).toLowerCase()}let X0;const kee=new Uint8Array(16);function Pee(){if(!X0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");X0=crypto.getRandomValues.bind(crypto)}return X0(kee)}const vF={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gee(t,e,A){var i;if(vF.randomUUID&&!e&&!t)return vF.randomUUID();t=t||{};const r=t.random??((i=t.rng)==null?void 0:i.call(t))??Pee();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(A=A||0,A<0||A+16>e.length)throw new RangeError(`UUID byte range ${A}:${A+15} is out of buffer bounds`);for(let n=0;n<16;++n)e[A+n]=r[n];return e}return Kee(r)}const Fl=kr(),wo=dA(),Ol=ne(""),_c=ne(""),Ta=ne(""),wn=ne("");let So=null,_0=[];const wF=ne("");let Ua=null;const SF=4e3;sn(async()=>{wo.authToken=await DI()});let gr=null,bl=null,js=null,RI=null,xl=null;const mF=`${window.location.origin}/assets/ffmpeg`,mo=()=>{js&&js.mute(),gr&&(gr.close(),gr=null),bl=null},DI=async()=>{var t,e,A;try{const r=await jn("/voiceTesting");return(t=r==null?void 0:r.data)==null?void 0:t.token}catch(r){if(console.error(r),Xt.isAxiosError(r)){const i=r;console.log("Error found!"),console.error((e=i.response)==null?void 0:e.data),Fl.setError(((A=i.response)==null?void 0:A.data).message)}else Fl.setError("There was an issue while fetching data")}},Nl=()=>{Ua&&clearTimeout(Ua),RI&&(RI.stopContinuousRecognitionAsync(()=>{},t=>{console.error("Error stopping recognition",t)}),RI=null),So&&So.state!=="inactive"&&So.stop()},jee=async t=>(wo.authToken=await DI(),await mo(),new Promise((e,A)=>{const r=Ps.SpeechConfig.fromAuthorizationToken(wo.authToken,"eastus2");r.speechSynthesisVoiceName="en-US-EmmaMultilingualNeural",js=new Ps.SpeakerAudioDestination;const i=Ps.AudioConfig.fromSpeakerOutput(js);gr=new Ps.SpeechSynthesizer(r,i);const n=Gee();bl=n,gr.speakTextAsync(t,o=>{if(n!==bl)return js==null||js.mute(),gr==null||gr.close(),gr=null,e();o.reason===Ps.ResultReason.SynthesizingAudioCompleted?e():A(new Error("Speech synthesis failed")),gr==null||gr.close(),gr=null,bl=null},o=>{if(n!==bl)return js==null||js.mute(),gr==null||gr.close(),gr=null,e();gr==null||gr.close(),gr=null,bl=null,A(o)})})),Yee=async t=>{wo.authToken=await DI();const e=Ps.SpeechConfig.fromAuthorizationToken(wo.authToken,"eastus2");e.speechRecognitionLanguage="en-US";const A=Ps.AudioConfig.fromDefaultMicrophoneInput(),r=new Ps.SpeechRecognizer(e,A);return RI=r,Ol.value="",_c.value="",await QF(),r.recognizing=(i,n)=>{n.result.text&&n.result.text.trim()&&(Ol.value=n.result.text.trim(),mo(),wo.userspeaking=!0,wo.userSpeechText=(_c.value?_c.value+" ":"")+Ol.value,wn.value="user",Ua&&clearTimeout(Ua),Ua=setTimeout(()=>{Ol.value&&(t(Ol.value.trim()),Ol.value="")},SF))},r.recognized=async(i,n)=>{n.result.reason===Ps.ResultReason.RecognizedSpeech&&n.result.text&&n.result.text.trim()&&(_c.value+=" "+n.result.text.trim(),Ua&&clearTimeout(Ua),Ua=setTimeout(async()=>{_c.value&&(t(_c.value),console.log("Audio stop recording"),_c.value="")},SF))},r.canceled=async(i,n)=>{console.error("Recognition canceled:",n),console.log("Audio stop recording")},r.startContinuousRecognitionAsync(),r},MF=async()=>{var t,e;Ta.value="",wF.value="";try{mo(),await Yee(async A=>{if(A){console.log("triggering Audio sentiment:");const r=await Hee();console.log("Audio sentiment:",r),Ta.value=A;const i=QF()}})}catch(A){if(console.error(A),Xt.isAxiosError(A)){const r=A;console.log("Error found!"),console.error((t=r.response)==null?void 0:t.data),Fl.setError(((e=r.response)==null?void 0:e.data).message)}else Fl.setError("There was an issue while fetching data")}},yF=async t=>{var e,A;wF.value="";try{(wn.value=="user"||wn.value=="listening")&&mo(),await jee(t)}catch(r){if(console.error(r),Xt.isAxiosError(r)){const i=r;console.log("Error found!"),console.error((e=i.response)==null?void 0:e.data),Fl.setError(((A=i.response)==null?void 0:A.data).message)}else Fl.setError("There was an issue while fetching data")}};async function QF(){try{const t=await navigator.mediaDevices.getUserMedia({audio:!0});So=new MediaRecorder(t,{mimeType:"audio/webm"}),So.ondataavailable=e=>{e.data.size>0&&_0.push(e.data)},So.start(),console.log("Audio recording started")}catch(t){console.error("Error starting audio recording:",t)}}async function Hee(){return new Promise((t,e)=>{if(!So)return e("No active recorder found");So.onstop=async()=>{var r,i,n;const A=new Blob(_0,{type:"audio/webm"});_0=[];try{console.log("Sending audio for analysis...");const o=await zee(A);console.log("Converting WebM to MP3...",o);const a={audio:await qee(o),format:"mp3",finalAnalysis:!1};console.log("Payload for analysis:",a);const c=await Xt.post("/fetchPdfAssessment",a,{headers:{"Content-Type":"application/json"}});console.log("Server response:",(r=c==null?void 0:c.data)==null?void 0:r.body),wo.audioAnaysis.push((n=(i=c==null?void 0:c.data)==null?void 0:i.body)==null?void 0:n.answer),console.log("store audioAnaysis",wo.audioAnaysis),console.log("Audio analysis result:",c.data),t(c.data)}catch(o){e(o)}},So.stop(),console.log("Audio recording stopped")})}async function zee(t){try{console.log("⏳ Initializing FFmpeg...");const e=await Jee();console.log("✅ FFmpeg loaded");const A=await gZ(t);e.writeFile("input.webm",A),await e.exec(["-i","input.webm","-vn","-acodec","libmp3lame","-ar","16000","-ac","1","-ab","32k","output.mp3"]),console.log("Conversion complete");const r=await e.readFile("output.mp3");return await e.deleteFile("input.webm"),await e.deleteFile("output.mp3"),new Blob([r],{type:"audio/mpeg"})}catch(e){throw console.error("❌ Error:",e),e}}async function Jee(){if(xl!=null&&xl.loaded)return xl;const t=xl||new aZ;return t.on("log",({message:e})=>{console.log(e)}),await t.load({coreURL:await R4(`${mF}/ffmpeg-core.js`,"text/javascript"),wasmURL:await R4(`${mF}/ffmpeg-core.wasm`,"application/wasm")}),xl=t,t}const qee=t=>new Promise((e,A)=>{const r=new FileReader;r.onloadend=()=>{const i=r.result.split(",")[1];e(i)},r.onerror=A,r.readAsDataURL(t)}),Vee={class:"flex items-center gap-4 py-2 rounded-full z-10"},Wee={key:0,class:"flex items-center"},Zee={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},Xee=[sl('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],_ee={key:1,class:"flex items-center"},$ee={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},ete=[sl('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],tte={key:2,class:"flex items-center"},Ate=[sl('<svg width="30" height="30" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="12" y="16" width="40" height="32" rx="8" fill="white" stroke="#9CA3AF" stroke-width="2"></rect><circle cx="24" cy="32" r="4" fill="black"></circle><circle cx="40" cy="32" r="4" fill="black"></circle><line x1="32" y1="10" x2="32" y2="16" stroke="#9CA3AF" stroke-width="2"></line><circle cx="32" cy="8" r="2" fill="white"></circle><circle cx="52" cy="14" r="3" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0s" repeatCount="indefinite"></animate></circle><circle cx="58" cy="10" r="2.5" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.2s" repeatCount="indefinite"></animate></circle><circle cx="63" cy="6" r="2" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.4s" repeatCount="indefinite"></animate></circle></svg>',1)],rte={class:"tooltiptext text-genpact-darkest-teal"},ite=[S("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[S("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"})],-1)],nte=[S("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[S("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"}),S("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)],ste=Zt({__name:"NewVoiceConversation",setup(t){const e=dA(),A=kr(),r=ne(""),i=ne(!1),n=ne("Turn on mic"),o=()=>{i.value===!1?e.elevenLabs?(console.log("mic enabled true 11labs"),i.value=!0,oC(),wn.value="user",n.value="Turn off mic"):(console.log("mic enabled true"),i.value=!0,mo(),MF(),wn.value="user",n.value="Turn off mic"):e.elevenLabs?(console.log("mic enabled false"),wl(),i.value=!1,n.value="Turn on mic"):(console.log("mic enabled false"),Nl(),i.value=!1,n.value="Turn on mic")},s=()=>{e.elevenLabs?(console.log("closeConversation 11 labs"),wl(),wn.value="none",i.value=!1):(console.log("closeConversation"),Nl(),mo(),wn.value="none",i.value=!1)},a=async()=>{var c,u,l,g,h,p,C,I;try{const E={question:Ta.value||iC.value};e.conversations.push(E),e.dotLoader=!0,e.question="";const v={past_messages:e.past_messages,question:Ta.value||iC.value,skillId:e.simulationSkill,bandCode:e.band_code,userGenomeFunction:e.genomeFunctionValue,userGenomeRole:e.genomeRoleValue},m=await si("/sqlTest",v);if(wn.value="bot",r.value=(u=(c=m==null?void 0:m.data)==null?void 0:c.body)==null?void 0:u.answer,r.value===""){console.log("in the if case calling api again");const M=await si("/sqlTest",v);e.addConversation((l=M.data)==null?void 0:l.body,"new")}else console.log("in the else case"),e.addConversation((g=m.data)==null?void 0:g.body,"new");if(e.dotLoader=!1,e.elevenLabs)await iZ(r.value.replace(/[*#]/g,""));else if(r.value.includes("Feedback and Assessment")){Nl();const M={pastAudioAnalysis:e.audioAnaysis,finalAnalysis:!0},O=await Xt.post("/fetchPdfAssessment",M,{headers:{"Content-Type":"application/json"}});if(console.log((h=O==null?void 0:O.data)==null?void 0:h.body),e.addConversation((p=O==null?void 0:O.data)==null?void 0:p.body,"new"),i.value=!1,r.value.includes("END ROLE PLAY")){const x=r.value.split("END ROLE PLAY")[0];if(x.length<0){e.showVoiceComponent=!1;return}await yF(x.replace(/[*#]/g,"")),e.showVoiceComponent=!1}else e.showVoiceComponent=!1}else await yF(r.value.replace(/[*#]/g,""))}catch(E){if(console.error(E),Xt.isAxiosError(E)){const v=E;console.log("Error found!"),console.error((C=v.response)==null?void 0:C.data),A.setError(((I=v.response)==null?void 0:I.data).message)}else A.setError("There was an issue, please contact helpmate")}};return oo(Ta,async c=>{if(c){if(console.log("Recognized text:",c),Ta.value.toLowerCase().includes("play")&&Ta.value.length<10){console.log("play command detected, ignoring input");return}wn.value="listening",e.userspeaking=!1,await a(),Ta.value=""}}),oo(iC,async c=>{c&&(console.log("Recognized text:",c),wn.value="listening",await a(),iC.value="")}),(c,u)=>(ue(),ge("div",Vee,[fe(wn)==="bot"?(ue(),ge("div",Wee,[S("span",null,[(ue(),ge("svg",Zee,Xee))])])):fe(wn)==="user"?(ue(),ge("div",_ee,[S("span",null,[(ue(),ge("svg",$ee,ete))])])):fe(wn)==="listening"?(ue(),ge("div",tte,Ate)):Dt("",!0),S("div",{class:mt([i.value?"":"animate-pulse","tooltip"])},[S("span",rte,bt(n.value),1),i.value?(ue(),ge("button",{key:0,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:u[0]||(u[0]=l=>o())},ite)):(ue(),ge("button",{key:1,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:u[1]||(u[1]=l=>o())},nte))],2),S("button",{class:"rounded-full bg-white p-2 hover:bg-gray-300",onClick:u[2]||(u[2]=l=>s())},[ot(fe(d4),{class:"h-[10px] w-[10px] text-gray-700"})])]))}}),La=t=>(xr("data-v-9ec493aa"),t=t(),Nr(),t),ote={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},ate={class:"py-2"},cte={class:"flex"},ute={class:"z-1 relative w-full"},lte={class:"flex justify-between my-2 w-full"},hte=La(()=>S("div",null,null,-1)),gte={key:0,class:"flex justify-center bg-genpact-darkest-blue px-4 rounded-full"},dte={class:"relative w-full"},pte={class:"absolute inset-y-0 left-0 flex items-center pl-3"},fte={class:"tooltip"},Ete=La(()=>S("span",{class:"tooltiptext text-genpact-darkest-teal"},"Restart",-1)),Cte=[La(()=>S("path",{d:"M12 4C8.229 4 6.343 4 5.172 5.172C4.001 6.344 4 8.229 4 12V18C4 18.943 4 19.414 4.293 19.707C4.586 20 5.057 20 6 20H12C15.771 20 17.657 20 18.828 18.828C19.999 17.656 20 15.771 20 12",stroke:"currentColor","stroke-width":"2"},null,-1)),La(()=>S("path",{d:"M9 10H15M9 14H12M19 8V2M16 5H22",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1))],Ite={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},Bte={key:0},vte=["disabled"],wte=[La(()=>S("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],Ste={key:1,class:"tooltip"},mte=[La(()=>S("span",{class:"tooltiptext text-genpact-darkest-teal"},"Processing",-1)),La(()=>S("img",{class:"w-7 h-7",src:$S,alt:"watingIcon"},null,-1))],Mte={class:"flex justify-start gap-2 md:gap-1"},yte=["disabled"],Qte=La(()=>S("div",{class:"pt-1 text-start font-sans text-xs font-bold text-gray-500 md:text-sm"},[S("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),Rte=Zt({__name:"NewQuestionSimulation",setup(t,{expose:e}){const A=dA(),r=kr(),i=ne(""),n=ne("");A.question="";const o=ne(null),s=ne(!1),a=ne(0);n.value=A.recognizedText,sn(()=>{o.value.focus()});const c=()=>{window.location.reload()},u=async()=>{var h,p,C,I,E,v,m,M,O,x,P;try{if(A.question.trim().length<1){console.log("Please enter answer!");return}s.value=!0,A.dotLoader=!0;const D={question:A.question||A.recognizedText};A.conversations.push(D);const T=ne("");T.value=A.question||A.recognizedText,A.question="",o.value&&(o.value.style.height="auto");const q={ohr_id:i.value,past_messages:A.past_messages,question:T.value||A.recognizedText,bandCode:A.band_code,userGenomeFunction:A.genomeFunctionValue,userGenomeRole:A.genomeRoleValue,skillId:A.simulationSkill||"937e84ef-e95d-4327-9afe-e7be2bf420eb"},Q=await si("/sqlTest",q);if(a.value+=(p=(h=Q.data)==null?void 0:h.body)==null?void 0:p.totalTokenCount,console.log("Token Count:",a.value),i.value=(I=(C=Q.data)==null?void 0:C.body)==null?void 0:I.ohr,((v=(E=Q==null?void 0:Q.data)==null?void 0:E.body)==null?void 0:v.answer)===""){console.log("in the if case calling api again");const G=await si("/sqlTest",q);A.addConversation((m=G.data)==null?void 0:m.body,"new")}else console.log("in the else case"),A.addConversation((M=Q.data)==null?void 0:M.body,"new");s.value=!1,A.dotLoader=!1,A.recognizedText=""}catch(D){if(console.error(D),A.dotLoader=!1,s.value=!1,Xt.isAxiosError(D)){const T=D;console.log("Error found!"),console.error((O=T.response)==null?void 0:O.data),r.setError((P=(x=T.response)==null?void 0:x.data)==null?void 0:P.message)}else r.setError("There was an issue, please contact helpmate")}},l=h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),u())},g=h=>{const p=h.target;p.style.height="auto",p.style.height=p.scrollHeight+"px"};return e({sendQuestion:u}),(h,p)=>(ue(),ge("div",ote,[S("div",ate,[S("div",cte,[S("div",ute,[S("div",lte,[hte,fe(A).showVoiceComponent?(ue(),ge("div",gte,[ot(ste)])):Dt("",!0)]),S("div",dte,[S("div",pte,[S("div",fte,[Ete,(ue(),ge("svg",{onClick:c,class:"ml-2 h-7 w-7 rounded",id:"newTopicDisable",width:"7",height:"",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",title:"restart"},Cte))])]),S("div",Ite,[s.value?(ue(),ge("div",Ste,mte)):(ue(),ge("div",Bte,[(ue(),ge("svg",{disabled:fe(A).beginFlag===!0,class:mt([fe(A).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:p[0]||(p[0]=C=>fe(A).searchBoxdisable===!1||fe(A).beginFlag===!0?"":u()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},wte,10,vte))]))]),S("div",Mte,[tA(S("textarea",{onPaste:p[1]||(p[1]=IS(()=>{},["prevent"])),onKeydown:p[2]||(p[2]=C=>s.value?"":l(C)),disabled:fe(A).searchBoxdisable===!1||fe(A).beginFlag===!0,"onUpdate:modelValue":p[3]||(p[3]=C=>fe(A).question=C),class:mt(["fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] px-[70px]",fe(A).beginFlag===!0||fe(A).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white"]),placeholder:"Write your answer here...",ref_key:"AiSearch",ref:o,rows:"1",onInput:p[4]||(p[4]=C=>g(C)),style:{overflow:"hidden",transition:"height 0.2s"}},null,42,yte),[[bA,fe(A).question]])])]),Qte])])])]))}}),IRe="",Dte=SA(Rte,[["__scopeId","data-v-9ec493aa"]]),TI=t=>(xr("data-v-6c0980b5"),t=t(),Nr(),t),Tte={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},Ute={class:"py-2"},Lte={class:"flex"},Fte={class:"z-1 relative w-full"},Ote={class:"relative w-full"},bte={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},xte={key:0},Nte=["disabled"],Kte=[TI(()=>S("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],kte={key:1,class:"tooltip"},Pte=[TI(()=>S("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),TI(()=>S("img",{class:"w-7 h-7",src:$S,alt:"watingIcon"},null,-1))],Gte={class:"flex justify-start gap-2 md:gap-1"},jte=["disabled"],Yte=TI(()=>S("div",{class:"pt-1 text-start font-sans text-[0.8125rem] md:text-[0.9375rem] font-bold text-gray-500"},[S("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),Hte=Zt({__name:"NewMDMQuestionSimulation",setup(t){const e=dA(),A=kr(),r=ne("");e.question="";const i=ne(null),n=ne(!1),o=ne(ho),s=ne(!1);r.value=e.recognizedText,sn(()=>{i.value.focus()});const a=u=>{const l=u.length;o.value=ho-l,n.value=l>=ho},c=async()=>{var u,l,g;console.log("options fdsfdscdzxfsdv",e.recognizedText);try{if(console.log("options fdsfdscdzxfsdv",e.recognizedText),e.question.trim().length<1){console.log("Please enter answer!");return}s.value=!0,e.dotLoader=!0;const h={question:e.question||e.recognizedText};console.log("ques",h),e.conversations.push(h);const p=ne("");p.value=e.question||e.recognizedText,e.question="";const C={assessmentId:e.simulationSkill,question:p.value,past_messages:e.past_messages,prompt:e.generatedPrompt,assessmentType:e.assessmentType,userFunction:"HR",empSeniority:e.empSeniority,functionRole:e.functionRole,userBand:e.band_code,storeFinalFeedback:e.storeFinalFeedback,storeFinalScore:e.storeFinalScore};console.log("Payload for MDM1==> ",C);let I;Ks==="prod"?I="/ManualExportActivity":I="/fetchCompletionDemo";const E=await si(I,C);e.addConversation((u=E.data)==null?void 0:u.body,"new"),s.value=!1,e.dotLoader=!1,e.recognizedText=""}catch(h){if(console.error(h),Xt.isAxiosError(h)){const p=h;console.log("Error found!"),console.error((l=p.response)==null?void 0:l.data),A.setError(((g=p.response)==null?void 0:g.data).message)}else A.setError("There was an issue, please contact helpmate")}};return(u,l)=>(ue(),ge("div",Tte,[S("div",Ute,[S("div",Lte,[S("div",Fte,[S("div",Ote,[S("div",bte,[s.value?(ue(),ge("div",kte,Pte)):(ue(),ge("div",xte,[(ue(),ge("svg",{disabled:fe(e).beginFlag===!0,class:mt([fe(e).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:l[0]||(l[0]=g=>fe(e).searchBoxdisable===!1||fe(e).beginFlag===!0?"":c()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},Kte,10,Nte))]))]),S("div",Gte,[tA(S("input",{onKeyup:[l[1]||(l[1]=eT(g=>s.value?"":c(),["enter"])),l[3]||(l[3]=g=>a(fe(e).question))],disabled:fe(e).beginFlag===!0||fe(e).searchBoxdisable===!1,class:mt([fe(e).beginFlag===!0||fe(e).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white","fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] pl-[30px] pr-[70px]"]),"onUpdate:modelValue":l[2]||(l[2]=g=>fe(e).question=g),placeholder:"Write your answer here...",type:"text",ref_key:"AiSearch",ref:i},null,42,jte),[[bA,fe(e).question]])])]),Yte])])])]))}}),SRe="",zte=SA(Hte,[["__scopeId","data-v-6c0980b5"]]),Jte={},qte={class:"flex min-h-screen justify-center -mt-16"},Vte=[S("div",{class:"flex items-center justify-center"},[S("img",{class:"loadercss",src:go,alt:"Loader Gif"})],-1)];function Wte(t,e){return ue(),ge("div",qte,Vte)}const RF=SA(Jte,[["render",Wte]]);function BA(t){return BA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BA(t)}var fs=Uint8Array,Sn=Uint16Array,$0=Int32Array,em=new fs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),tm=new fs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),DF=new fs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),TF=function(t,e){for(var A=new Sn(31),r=0;r<31;++r)A[r]=e+=1<<t[r-1];for(var i=new $0(A[30]),r=1;r<30;++r)for(var n=A[r];n<A[r+1];++n)i[n]=n-A[r]<<5|r;return{b:A,r:i}},UF=TF(em,2),Zte=UF.b,Am=UF.r;Zte[28]=258,Am[258]=28;for(var Xte=TF(tm,0),LF=Xte.r,rm=new Sn(32768),YA=0;YA<32768;++YA){var Fa=(YA&43690)>>1|(YA&21845)<<1;Fa=(Fa&52428)>>2|(Fa&13107)<<2,Fa=(Fa&61680)>>4|(Fa&3855)<<4,rm[YA]=((Fa&65280)>>8|(Fa&255)<<8)>>1}for(var pp=function(t,e,A){for(var r=t.length,i=0,n=new Sn(e);i<r;++i)t[i]&&++n[t[i]-1];var o=new Sn(e);for(i=1;i<e;++i)o[i]=o[i-1]+n[i-1]<<1;var s;if(A){s=new Sn(1<<e);var a=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],l=o[t[i]-1]++<<u,g=l|(1<<u)-1;l<=g;++l)s[rm[l]>>a]=c}else for(s=new Sn(r),i=0;i<r;++i)t[i]&&(s[i]=rm[o[t[i]-1]++]>>15-t[i]);return s},$c=new fs(288),YA=0;YA<144;++YA)$c[YA]=8;for(var YA=144;YA<256;++YA)$c[YA]=9;for(var YA=256;YA<280;++YA)$c[YA]=7;for(var YA=280;YA<288;++YA)$c[YA]=8;for(var UI=new fs(32),YA=0;YA<32;++YA)UI[YA]=5;var _te=pp($c,9,0),$te=pp(UI,5,0),FF=function(t){return(t+7)/8|0},eAe=function(t,e,A){return(e==null||e<0)&&(e=0),(A==null||A>t.length)&&(A=t.length),new fs(t.subarray(e,A))},Mo=function(t,e,A){A<<=e&7;var r=e/8|0;t[r]|=A,t[r+1]|=A>>8},fp=function(t,e,A){A<<=e&7;var r=e/8|0;t[r]|=A,t[r+1]|=A>>8,t[r+2]|=A>>16},im=function(t,e){for(var A=[],r=0;r<t.length;++r)t[r]&&A.push({s:r,f:t[r]});var i=A.length,n=A.slice();if(!i)return{t:NF,l:0};if(i==1){var o=new fs(A[0].s+1);return o[A[0].s]=1,{t:o,l:1}}A.sort(function(O,x){return O.f-x.f}),A.push({s:-1,f:25001});var s=A[0],a=A[1],c=0,u=1,l=2;for(A[0]={s:-1,f:s.f+a.f,l:s,r:a};u!=i-1;)s=A[A[c].f<A[l].f?c++:l++],a=A[c!=u&&A[c].f<A[l].f?c++:l++],A[u++]={s:-1,f:s.f+a.f,l:s,r:a};for(var g=n[0].s,r=1;r<i;++r)n[r].s>g&&(g=n[r].s);var h=new Sn(g+1),p=nm(A[u-1],h,0);if(p>e){var r=0,C=0,I=p-e,E=1<<I;for(n.sort(function(x,P){return h[P.s]-h[x.s]||x.f-P.f});r<i;++r){var v=n[r].s;if(h[v]>e)C+=E-(1<<p-h[v]),h[v]=e;else break}for(C>>=I;C>0;){var m=n[r].s;h[m]<e?C-=1<<e-h[m]++-1:++r}for(;r>=0&&C;--r){var M=n[r].s;h[M]==e&&(--h[M],++C)}p=e}return{t:new fs(h),l:p}},nm=function(t,e,A){return t.s==-1?Math.max(nm(t.l,e,A+1),nm(t.r,e,A+1)):e[t.s]=A},OF=function(t){for(var e=t.length;e&&!t[--e];);for(var A=new Sn(++e),r=0,i=t[0],n=1,o=function(a){A[r++]=a},s=1;s<=e;++s)if(t[s]==i&&s!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(i),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(i);n=1,i=t[s]}return{c:A.subarray(0,r),n:e}},Ep=function(t,e){for(var A=0,r=0;r<e.length;++r)A+=t[r]*e[r];return A},bF=function(t,e,A){var r=A.length,i=FF(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var n=0;n<r;++n)t[i+n+4]=A[n];return(i+4+r)*8},xF=function(t,e,A,r,i,n,o,s,a,c,u){Mo(e,u++,A),++i[256];for(var l=im(i,15),g=l.t,h=l.l,p=im(n,15),C=p.t,I=p.l,E=OF(g),v=E.c,m=E.n,M=OF(C),O=M.c,x=M.n,P=new Sn(19),D=0;D<v.length;++D)++P[v[D]&31];for(var D=0;D<O.length;++D)++P[O[D]&31];for(var T=im(P,7),q=T.t,Q=T.l,R=19;R>4&&!q[DF[R-1]];--R);var G=c+5<<3,k=Ep(i,$c)+Ep(n,UI)+o,te=Ep(i,g)+Ep(n,C)+o+14+3*R+Ep(P,q)+2*P[16]+3*P[17]+7*P[18];if(a>=0&&G<=k&&G<=te)return bF(e,u,t.subarray(a,a+c));var X,ie,W,se;if(Mo(e,u,1+(te<k)),u+=2,te<k){X=pp(g,h,0),ie=g,W=pp(C,I,0),se=C;var Be=pp(q,Q,0);Mo(e,u,m-257),Mo(e,u+5,x-1),Mo(e,u+10,R-4),u+=14;for(var D=0;D<R;++D)Mo(e,u+3*D,q[DF[D]]);u+=3*R;for(var Ee=[v,O],U=0;U<2;++U)for(var Y=Ee[U],D=0;D<Y.length;++D){var _=Y[D]&31;Mo(e,u,Be[_]),u+=q[_],_>15&&(Mo(e,u,Y[D]>>5&127),u+=Y[D]>>12)}}else X=_te,ie=$c,W=$te,se=UI;for(var D=0;D<s;++D){var re=r[D];if(re>255){var _=re>>18&31;fp(e,u,X[_+257]),u+=ie[_+257],_>7&&(Mo(e,u,re>>23&31),u+=em[_]);var ae=re&31;fp(e,u,W[ae]),u+=se[ae],ae>3&&(fp(e,u,re>>5&8191),u+=tm[ae])}else fp(e,u,X[re]),u+=ie[re]}return fp(e,u,X[256]),u+ie[256]},tAe=new $0([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),NF=new fs(0),AAe=function(t,e,A,r,i,n){var o=n.z||t.length,s=new fs(r+o+5*(1+Math.ceil(o/7e3))+i),a=s.subarray(r,s.length-i),c=n.l,u=(n.r||0)&7;if(e){u&&(a[0]=n.r>>3);for(var l=tAe[e-1],g=l>>13,h=l&8191,p=(1<<A)-1,C=n.p||new Sn(32768),I=n.h||new Sn(p+1),E=Math.ceil(A/3),v=2*E,m=function(z){return(t[z]^t[z+1]<<E^t[z+2]<<v)&p},M=new $0(25e3),O=new Sn(288),x=new Sn(32),P=0,D=0,T=n.i||0,q=0,Q=n.w||0,R=0;T+2<o;++T){var G=m(T),k=T&32767,te=I[G];if(C[k]=te,I[G]=k,Q<=T){var X=o-T;if((P>7e3||q>24576)&&(X>423||!c)){u=xF(t,a,0,M,O,x,D,q,R,T-R,u),q=P=D=0,R=T;for(var ie=0;ie<286;++ie)O[ie]=0;for(var ie=0;ie<30;++ie)x[ie]=0}var W=2,se=0,Be=h,Ee=k-te&32767;if(X>2&&G==m(T-Ee))for(var U=Math.min(g,X)-1,Y=Math.min(32767,T),_=Math.min(258,X);Ee<=Y&&--Be&&k!=te;){if(t[T+W]==t[T+W-Ee]){for(var re=0;re<_&&t[T+re]==t[T+re-Ee];++re);if(re>W){if(W=re,se=Ee,re>U)break;for(var ae=Math.min(Ee,re-2),Z=0,ie=0;ie<ae;++ie){var ce=T-Ee+ie&32767,oe=C[ce],de=ce-oe&32767;de>Z&&(Z=de,te=ce)}}}k=te,te=C[k],Ee+=k-te&32767}if(se){M[q++]=268435456|Am[W]<<18|LF[se];var De=Am[W]&31,j=LF[se]&31;D+=em[De]+tm[j],++O[257+De],++x[j],Q=T+W,++P}else M[q++]=t[T],++O[t[T]]}}for(T=Math.max(T,Q);T<o;++T)M[q++]=t[T],++O[t[T]];u=xF(t,a,c,M,O,x,D,q,R,T-R,u),c||(n.r=u&7|a[u/8|0]<<3,u-=7,n.h=I,n.p=C,n.i=T,n.w=Q)}else{for(var T=n.w||0;T<o+c;T+=65535){var J=T+65535;J>=o&&(a[u/8|0]=c,J=o),u=bF(a,u+1,t.subarray(T,J))}n.i=o}return eAe(s,0,r+FF(u)+i)},KF=function(){var t=1,e=0;return{p:function(A){for(var r=t,i=e,n=A.length|0,o=0;o!=n;){for(var s=Math.min(o+2655,n);o<s;++o)i+=r+=A[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},rAe=function(t,e,A,r,i){if(!i&&(i={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),o=new fs(n.length+t.length);o.set(n),o.set(t,n.length),t=o,i.w=n.length}return AAe(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,A,r,i)},kF=function(t,e,A){for(;A;++e)t[e]=A,A>>>=8},iAe=function(t,e){var A=e.level,r=A==0?0:A<6?1:A==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=KF();i.p(e.dictionary),kF(t,2,i.d())}};function sm(t,e){e||(e={});var A=KF();A.p(t);var r=rAe(t,e,e.dictionary?6:2,4);return iAe(r,e),kF(r,r.length-4,A.d()),r}var nAe=typeof TextDecoder<"u"&&new TextDecoder,sAe=0;try{nAe.decode(NF,{stream:!0}),sAe=1}catch{}function oAe(t){if(Array.isArray(t))return t}function aAe(t,e){var A=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(A!=null){var r,i,n,o,s=[],a=!0,c=!1;try{if(n=(A=A.call(t)).next,e===0){if(Object(A)!==A)return;a=!1}else for(;!(a=(r=n.call(A)).done)&&(s.push(r.value),s.length!==e);a=!0);}catch(u){c=!0,i=u}finally{try{if(!a&&A.return!=null&&(o=A.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function PF(t,e){(e==null||e>t.length)&&(e=t.length);for(var A=0,r=Array(e);A<e;A++)r[A]=t[A];return r}function cAe(t,e){if(t){if(typeof t=="string")return PF(t,e);var A={}.toString.call(t).slice(8,-1);return A==="Object"&&t.constructor&&(A=t.constructor.name),A==="Map"||A==="Set"?Array.from(t):A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?PF(t,e):void 0}}function uAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35
+ ${this.privSynthesizerConfig.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Url)} Reason: ${u.reason}`))},a=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(a)}),this.privConnectionPromise.catch(()=>{}),this.privConnectionPromise}sendSpeechServiceConfig(o,s){if(s)return o.send(new r.SpeechConnectionMessage(t.MessageType.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",s))}sendSsmlMessage(o,s,a){return o.send(new r.SpeechConnectionMessage(t.MessageType.Text,"ssml",a,"application/ssml+xml",s))}async fetchConnection(){return this.privConnectionConfigurationPromise!==void 0?this.privConnectionConfigurationPromise.then(o=>o.state()===t.ConnectionState.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise,()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection())):(this.privConnectionConfigurationPromise=this.configureConnection(),await this.privConnectionConfigurationPromise)}async configureConnection(){const o=await this.connectImpl();return this.configConnectionOverride!==void 0?this.configConnectionOverride(o):(this.setSpeechConfigSynthesisSection(),await this.sendSpeechServiceConfig(o,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),o)}onAvatarEvent(o){}onSynthesisStarted(o){}onSynthesizing(o){}onSynthesisCancelled(o){}onSynthesisCompleted(o){}onWordBoundary(o){}onVisemeReceived(o){}onBookmarkReached(o){}};return op.SynthesisAdapterBase=i,i.telemetryDataEnabled=!0,op}var ap={},lF;function Tee(){if(lF)return ap;lF=1,Object.defineProperty(ap,"__esModule",{value:!0}),ap.AvatarSynthesisAdapter=void 0;const t=Ve(),e=ut();let A=class extends e.SynthesisAdapterBase{constructor(i,n,o,s,a){super(i,n,o,void 0),this.privAvatarSynthesizer=s,this.privSynthesizer=s,this.privAvatarConfig=a}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(void 0)}setSpeechConfigSynthesisSection(){var i,n,o,s,a,c,u,l,g,h,p,C,I,E,v,m,M;this.privSynthesizerConfig.synthesisVideoSection={format:{bitrate:(i=this.privAvatarConfig.videoFormat)==null?void 0:i.bitrate,codec:(n=this.privAvatarConfig.videoFormat)==null?void 0:n.codec,crop:{bottomRight:{x:(a=(s=(o=this.privAvatarConfig.videoFormat)==null?void 0:o.cropRange)==null?void 0:s.bottomRight)==null?void 0:a.x,y:(l=(u=(c=this.privAvatarConfig.videoFormat)==null?void 0:c.cropRange)==null?void 0:u.bottomRight)==null?void 0:l.y},topLeft:{x:(p=(h=(g=this.privAvatarConfig.videoFormat)==null?void 0:g.cropRange)==null?void 0:h.topLeft)==null?void 0:p.x,y:(E=(I=(C=this.privAvatarConfig.videoFormat)==null?void 0:C.cropRange)==null?void 0:I.topLeft)==null?void 0:E.y}},resolution:{height:(v=this.privAvatarConfig.videoFormat)==null?void 0:v.height,width:(m=this.privAvatarConfig.videoFormat)==null?void 0:m.width}},protocol:{name:"WebRTC",webrtcConfig:{clientDescription:btoa(this.privSynthesizerConfig.parameters.getProperty(t.PropertyId.TalkingAvatarService_WebRTC_SDP)),iceServers:this.privAvatarConfig.remoteIceServers??this.privAvatarSynthesizer.iceServers}},talkingAvatar:{background:{color:this.privAvatarConfig.backgroundColor,image:{url:(M=this.privAvatarConfig.backgroundImage)==null?void 0:M.toString()}},character:this.privAvatarConfig.character,customized:this.privAvatarConfig.customized,style:this.privAvatarConfig.style,useBuiltInVoice:this.privAvatarConfig.useBuiltInVoice}}}onAvatarEvent(i){if(this.privAvatarSynthesizer.avatarEventReceived){const n=new t.AvatarEventArgs(i.Data.Offset,i.Data.Name);try{this.privAvatarSynthesizer.avatarEventReceived(this.privAvatarSynthesizer,n)}catch{}}}};return ap.AvatarSynthesisAdapter=A,ap}var cp={},hF;function Uee(){if(hF)return cp;hF=1,Object.defineProperty(cp,"__esModule",{value:!0}),cp.SpeechSynthesisAdapter=void 0;const t=Ve(),e=ut();let A=class extends e.SynthesisAdapterBase{constructor(i,n,o,s,a){super(i,n,o,a),this.privSpeechSynthesizer=s,this.privSynthesizer=s}setSynthesisContextSynthesisSection(){this.privSynthesisContext.setSynthesisSection(this.privSpeechSynthesizer)}onSynthesisStarted(i){const n=new t.SpeechSynthesisEventArgs(new t.SpeechSynthesisResult(i,t.ResultReason.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,n)}onSynthesizing(i){if(this.privSpeechSynthesizer.synthesizing)try{const n=this.privSynthesisTurn.audioOutputFormat.addHeader(i),o=new t.SpeechSynthesisEventArgs(new t.SpeechSynthesisResult(this.privSynthesisTurn.requestId,t.ResultReason.SynthesizingAudio,n));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,o)}catch{}}onSynthesisCancelled(i){if(this.privSpeechSynthesizer.SynthesisCanceled){const n=new t.SpeechSynthesisEventArgs(i);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,n)}catch{}}}onSynthesisCompleted(i){if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new t.SpeechSynthesisEventArgs(i))}catch{}}onWordBoundary(i){if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,i)}catch{}}onVisemeReceived(i){if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,i)}catch{}}onBookmarkReached(i){if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,i)}catch{}}};return cp.SpeechSynthesisAdapter=A,cp}var up={},gF;function Lee(){if(gF)return up;gF=1,Object.defineProperty(up,"__esModule",{value:!0}),up.SynthesisRestAdapter=void 0;const t=Zr(),e=Ve(),A=ps(),r=Wr;let i=class{constructor(o,s){let a=o.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Endpoint,void 0);if(!a){const u=o.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Region,"westus"),l=A.ConnectionFactoryBase.getHostSuffix(u);a=o.parameters.getProperty(e.PropertyId.SpeechServiceConnection_Host,`https://${u}.tts.speech${l}`)}this.privUri=`${a}/cognitiveservices/voices/list`;const c=t.RestConfigBase.requestOptions;this.privRestAdapter=new t.RestMessageAdapter(c),this.privAuthentication=s}getVoicesList(o){return this.privRestAdapter.setHeaders(r.HeaderNames.ConnectionId,o),this.privAuthentication.fetch(o).then(s=>(this.privRestAdapter.setHeaders(s.headerName,s.token),this.privRestAdapter.request(t.RestRequestType.Get,this.privUri)))}};return up.SynthesisRestAdapter=i,up}var Z0={},dF;function Fee(){return dF||(dF=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SynthesizerConfig=t.SynthesisServiceType=void 0;const e=ut();var A;(function(i){i[i.Standard=0]="Standard",i[i.Custom=1]="Custom"})(A=t.SynthesisServiceType||(t.SynthesisServiceType={}));class r{constructor(n,o){this.privSynthesisServiceType=A.Standard,this.avatarEnabled=!1,this.privSpeechServiceConfig=n||new e.SpeechServiceConfig(new e.Context(null)),this.privParameters=o}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(n){this.privSynthesisServiceType=n}set synthesisVideoSection(n){this.privSpeechServiceConfig.Context.synthesis={video:n}}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}t.SynthesizerConfig=r}(Z0)),Z0}var lp={},pF;function Oee(){if(pF)return lp;pF=1,Object.defineProperty(lp,"__esModule",{value:!0}),lp.SynthesisContext=void 0;const t=Ve();let e=class{constructor(){this.privContext={}}setSection(r,i){this.privContext[r]=i}set audioOutputFormat(r){this.privAudioOutputFormat=r}toJSON(){return JSON.stringify(this.privContext)}setSynthesisSection(r){const i=this.buildSynthesisContext(r);this.setSection("synthesis",i)}buildSynthesisContext(r){return{audio:{metadataOptions:{bookmarkEnabled:!!(r!=null&&r.bookmarkReached),punctuationBoundaryEnabled:r==null?void 0:r.properties.getProperty(t.PropertyId.SpeechServiceResponse_RequestPunctuationBoundary,!!(r!=null&&r.wordBoundary)),sentenceBoundaryEnabled:r==null?void 0:r.properties.getProperty(t.PropertyId.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!(r!=null&&r.visemeReceived),wordBoundaryEnabled:r==null?void 0:r.properties.getProperty(t.PropertyId.SpeechServiceResponse_RequestWordBoundary,!!(r!=null&&r.wordBoundary))},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:r==null?void 0:r.autoDetectSourceLanguage}}}};return lp.SynthesisContext=e,lp}var hp={},fF;function bee(){if(fF)return hp;fF=1,Object.defineProperty(hp,"__esModule",{value:!0}),hp.SpeakerRecognitionConfig=void 0;const t=ut();let e=class{constructor(r,i){this.privContext=r||new t.Context(null),this.privParameters=i}get parameters(){return this.privParameters}get Context(){return this.privContext}};return hp.SpeakerRecognitionConfig=e,hp}var gp={},EF;function xee(){if(EF)return gp;EF=1,Object.defineProperty(gp,"__esModule",{value:!0}),gp.SpeakerServiceRecognizer=void 0;const t=Zr(),e=Mt(),A=Ve(),r=ut(),i=Co;let n=class extends r.ServiceRecognizerBase{constructor(s,a,c,u,l){super(s,a,c,u,l),this.privSpeakerRecognizer=l,this.privSpeakerAudioSource=c,this.recognizeSpeaker=g=>this.recognizeSpeakerOnce(g),this.sendPrePayloadJSONOverride=()=>this.noOp()}processTypeSpecificMessages(s){let a=!1;const c=new A.PropertyCollection;switch(s.messageType===e.MessageType.Text&&c.setProperty(A.PropertyId.SpeechServiceResponse_JsonResult,s.textBody),s.path.toLowerCase()){case"speaker.response":const l=JSON.parse(s.textBody);let g;l.status.statusCode.toLowerCase()!=="success"?g=new A.SpeakerRecognitionResult(l,A.ResultReason.Canceled,A.CancellationErrorCode.ServiceError,l.status.reason):g=new A.SpeakerRecognitionResult(l,A.ResultReason.RecognizedSpeaker),this.privResultDeferral&&this.privResultDeferral.resolve(g),a=!0;break}const u=new e.Deferred;return u.resolve(a),u.promise}cancelRecognition(s,a,c,u,l){if(new A.PropertyCollection().setProperty(r.CancellationErrorCodePropertyName,A.CancellationErrorCode[u]),this.privResultDeferral){const h=new A.SpeakerRecognitionResult({scenario:this.privSpeakerModel.scenario,status:{statusCode:l,reason:l}},A.ResultReason.Canceled,u,l);try{this.privResultDeferral.resolve(h)}catch(p){this.privResultDeferral.reject(p)}}}async recognizeSpeakerOnce(s){this.privSpeakerModel=s,this.voiceProfileType=s.scenario,this.privResultDeferral||(this.privResultDeferral=new e.Deferred),this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(A.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const a=this.connectImpl(),c=this.sendPreAudioMessages(this.extractSpeakerContext(s)),u=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),l=await this.privSpeakerAudioSource.format,g=await this.privSpeakerAudioSource.deviceInfo,h=new t.ReplayableAudioNode(u,l.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(h,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:g};try{await a,await c}catch(I){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.ConnectionFailure,I)}const p=new A.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,p),this.receiveMessage(),this.sendAudio(h).then(()=>{},I=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.RuntimeError,I)}),this.privResultDeferral.promise}async sendPreAudioMessages(s){const a=await this.fetchConnection();await this.sendSpeakerRecognition(a,s)}async sendSpeakerRecognition(s,a){const c=JSON.stringify(a);return s.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speaker.context",this.privRequestSession.requestId,"application/json; charset=utf-8",c))}extractSpeakerContext(s){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:s.profileIds,scenario:s.scenario}}};return gp.SpeakerServiceRecognizer=n,gp}var dp={},CF;function Nee(){if(CF)return dp;CF=1,Object.defineProperty(dp,"__esModule",{value:!0}),dp.VoiceServiceRecognizer=void 0;const t=Zr(),e=Mt(),A=Ve(),r=ut(),i=Co;let n=class extends r.ServiceRecognizerBase{constructor(s,a,c,u,l){super(s,a,c,u,l),this.privDeferralMap=new e.DeferralMap,this.privSpeakerAudioSource=c,this.sendPrePayloadJSONOverride=()=>this.noOp()}set SpeakerAudioSource(s){this.privSpeakerAudioSource=s}processTypeSpecificMessages(s){let a=!1;const c=new A.PropertyCollection;switch(s.messageType===e.MessageType.Text&&c.setProperty(A.PropertyId.SpeechServiceResponse_JsonResult,s.textBody),s.path.toLowerCase()){case"speaker.profiles":const l=JSON.parse(s.textBody);switch(l.operation.toLowerCase()){case"create":this.handleCreateResponse(l,s.requestId);break;case"delete":case"reset":this.handleResultResponse(l,s.requestId);break;case"fetch":const C=JSON.parse(s.textBody);this.handleFetchResponse(C,s.requestId);break}a=!0;break;case"speaker.phrases":const g=JSON.parse(s.textBody);this.handlePhrasesResponse(g,s.requestId),a=!0;break;case"speaker.profile.enrollment":const h=JSON.parse(s.textBody),p=new A.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(h.enrollment?h.enrollment.enrollmentStatus:h.status.statusCode),h.enrollment?JSON.stringify(h.enrollment):void 0,h.status.reason);this.privDeferralMap.getId(s.requestId)&&this.privDeferralMap.complete(s.requestId,p),this.privRequestSession.onSpeechEnded(),a=!0;break}const u=new e.Deferred;return u.resolve(a),u.promise}cancelRecognition(s,a,c,u,l){new A.PropertyCollection().setProperty(r.CancellationErrorCodePropertyName,A.CancellationErrorCode[u]);const h=new A.VoiceProfileEnrollmentResult(A.ResultReason.Canceled,l,l);this.privDeferralMap.getId(a)&&this.privDeferralMap.complete(a,h)}async createProfile(s,a){this.voiceProfileType=s.toString();const c=this.connectImpl();try{const u=new e.Deferred;return await c,await this.sendCreateProfile(u,s,a),this.receiveMessage(),u.promise}catch(u){throw u}}async resetProfile(s){return this.voiceProfileType=s.profileType.toString(),this.sendCommonRequest("reset",s.profileType,s)}async deleteProfile(s){return this.voiceProfileType=s.profileType.toString(),this.sendCommonRequest("delete",s.profileType,s)}async retrieveEnrollmentResult(s){return this.voiceProfileType=s.profileType.toString(),this.privExpectedProfileId=s.profileId,this.sendCommonRequest("fetch",s.profileType,s)}async getAllProfiles(s){return this.voiceProfileType=s.toString(),this.sendCommonRequest("fetch",s)}async getActivationPhrases(s,a){this.voiceProfileType=s.toString();const c=this.connectImpl();try{const u=new e.Deferred;return await c,await this.sendPhrasesRequest(u,s,a),this.receiveMessage(),u.promise}catch(u){throw u}}async enrollProfile(s){this.voiceProfileType=s.profileType.toString();const a=new e.Deferred;this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privSpeakerAudioSource.events),this.privRecognizerConfig.parameters.setProperty(A.PropertyId.Speech_SessionId,this.privRequestSession.sessionId);const c=this.connectImpl(),u=this.sendPreAudioMessages(s,a),l=await this.privSpeakerAudioSource.attach(this.privRequestSession.audioNodeId),g=await this.privSpeakerAudioSource.format,h=await this.privSpeakerAudioSource.deviceInfo,p=new t.ReplayableAudioNode(l,g.avgBytesPerSec);await this.privRequestSession.onAudioSourceAttachCompleted(p,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:h};try{await c,await u}catch(E){this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.ConnectionFailure,E)}const C=new A.SessionEventArgs(this.privRequestSession.sessionId);return this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,C),this.receiveMessage(),this.sendAudio(p).then(()=>{},E=>{this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,A.CancellationReason.Error,A.CancellationErrorCode.RuntimeError,E)}),a.promise}async sendPreAudioMessages(s,a){const c=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,a),await this.sendBaseRequest(c,"enroll",this.scenarioFrom(s.profileType),s)}async sendPhrasesRequest(s,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,s);const l=this.scenarioFrom(a),g={locale:c,scenario:l};return u.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speaker.profile.phrases",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCreateProfile(s,a,c){const u=await this.fetchConnection();this.privRequestSession.onSpeechContext(),this.privDeferralMap.add(this.privRequestSession.requestId,s);const l=a===A.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":a===A.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification",g={locale:c,number:"1",scenario:l};return u.send(new i.SpeechConnectionMessage(e.MessageType.Text,"speaker.profile.create",this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(g)))}async sendCommonRequest(s,a,c=void 0){const u=this.connectImpl();try{const l=new e.Deferred;this.privRequestSession.onSpeechContext(),await u;const g=await this.fetchConnection();return this.privDeferralMap.add(this.privRequestSession.requestId,l),await this.sendBaseRequest(g,s,this.scenarioFrom(a),c),this.receiveMessage(),l.promise}catch(l){throw l}}async sendBaseRequest(s,a,c,u){const l={scenario:c};return u?l.profileIds=[u.profileId]:l.maxPageSize=-1,s.send(new i.SpeechConnectionMessage(e.MessageType.Text,`speaker.profile.${a}`,this.privRequestSession.requestId,"application/json; charset=utf-8",JSON.stringify(l)))}extractSpeakerContext(s){return{features:{interimResult:"enabled",progressiveDetection:"disabled"},profileIds:s.profileIds,scenario:s.scenario}}handlePhrasesResponse(s,a){if(this.privDeferralMap.getId(a))if(s.status.statusCode.toLowerCase()!=="success"){const c=A.ResultReason.Canceled,u=new A.VoiceProfilePhraseResult(c,s.status.statusCode,s.passPhraseType,[]);this.privDeferralMap.complete(a,u)}else if(s.phrases&&s.phrases.length>0){const c=A.ResultReason.EnrollingVoiceProfile,u=new A.VoiceProfilePhraseResult(c,s.status.statusCode,s.passPhraseType,s.phrases);this.privDeferralMap.complete(a,u)}else throw new Error("Voice Profile get activation phrases failed, no phrases received");else throw new Error(`Voice Profile get activation phrases request for requestID ${a} not found`)}handleCreateResponse(s,a){if(s.profiles&&s.profiles.length>0)if(this.privDeferralMap.getId(a)){const c=s.profiles.map(u=>u.profileId);this.privDeferralMap.complete(a,c)}else throw new Error(`Voice Profile create request for requestID ${a} not found`);else throw new Error("Voice Profile create failed, no profile id received")}handleResultResponse(s,a){if(this.privDeferralMap.getId(a)){const c=s.operation.toLowerCase()==="delete"?A.ResultReason.DeletedVoiceProfile:A.ResultReason.ResetVoiceProfile,u=s.status.statusCode.toLowerCase()==="success"?c:A.ResultReason.Canceled,l=new A.VoiceProfileResult(u,`statusCode: ${s.status.statusCode}, errorDetails: ${s.status.reason}`);this.privDeferralMap.complete(a,l)}else throw new Error(`Voice Profile create request for requestID ${a} not found`)}handleFetchResponse(s,a){if(this.privDeferralMap.getId(a)&&s.profiles[0]){if(this.privExpectedProfileId&&s.profiles.length===1&&s.profiles[0].profileId===this.privExpectedProfileId){this.privExpectedProfileId=void 0;const c=s.profiles[0],u=new A.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(c.enrollmentStatus),JSON.stringify(c),s.status.reason);this.privDeferralMap.complete(a,u)}else if(s.profiles.length>0){const c=s.profiles,u=[];for(const l of c)u.push(new A.VoiceProfileEnrollmentResult(this.enrollmentReasonFrom(l.enrollmentStatus),JSON.stringify(l),s.status.reason));this.privDeferralMap.complete(a,u)}}else throw new Error(`Voice Profile fetch request for requestID ${a} not found`)}enrollmentReasonFrom(s){switch(s.toLowerCase()){case"enrolled":return A.ResultReason.EnrolledVoiceProfile;case"invalidlocale":case"invalidphrase":case"invalidaudioformat":case"invalidscenario":case"invalidprofilecount":case"invalidoperation":case"audiotooshort":case"audiotoolong":case"toomanyenrollments":case"storageconflict":case"profilenotfound":case"incompatibleprofiles":case"incompleteenrollment":return A.ResultReason.Canceled;default:return A.ResultReason.EnrollingVoiceProfile}}scenarioFrom(s){return s===A.VoiceProfileType.TextIndependentIdentification?"TextIndependentIdentification":s===A.VoiceProfileType.TextIndependentVerification?"TextIndependentVerification":"TextDependentVerification"}};return dp.VoiceServiceRecognizer=n,dp}var IF={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.type=t.connectivity=t.Device=t.OS=t.System=t.Context=t.SpeechServiceConfig=void 0;class e{constructor(s){this.context=s}serialize(){return JSON.stringify(this,(s,a)=>{if(a&&typeof a=="object"&&!Array.isArray(a)){const c={};for(const u in a)Object.hasOwnProperty.call(a,u)&&(c[u&&u.charAt(0).toLowerCase()+u.substring(1)]=a[u]);return c}return a})}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(s){this.recognition=s.toLowerCase()}}t.SpeechServiceConfig=e;class A{constructor(s){this.system=new r,this.os=s}}t.Context=A;class r{constructor(){const s="1.44.0";this.name="SpeechSDK",this.version=s,this.build="JavaScript",this.lang="JavaScript"}}t.System=r;class i{constructor(s,a,c){this.platform=s,this.name=a,this.version=c}}t.OS=i;class n{constructor(s,a,c){this.manufacturer=s,this.model=a,this.version=c}}t.Device=n,function(o){o.Bluetooth="Bluetooth",o.Wired="Wired",o.WiFi="WiFi",o.Cellular="Cellular",o.InBuilt="InBuilt",o.Unknown="Unknown"}(t.connectivity||(t.connectivity={})),function(o){o.Phone="Phone",o.Speaker="Speaker",o.Car="Car",o.Headset="Headset",o.Thermostat="Thermostat",o.Microphones="Microphones",o.Deskphone="Deskphone",o.RemoteControl="RemoteControl",o.Unknown="Unknown",o.File="File",o.Stream="Stream"}(t.type||(t.type={}))})(IF);var BF;function ut(){return BF||(BF=1,function(t){var e=xt&&xt.__createBinding||(Object.create?function(n,o,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return o[s]}})}:function(n,o,s,a){a===void 0&&(a=s),n[a]=o[s]}),A=xt&&xt.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.AutoDetectSourceLanguagesOpenRangeOptionName=t.ForceDictationPropertyName=t.ServicePropertiesPropertyName=t.CancellationErrorCodePropertyName=t.OutputFormatPropertyName=t.SpeechSynthesisAdapter=t.AvatarSynthesisAdapter=void 0,A(aC,t),A(UC,t),A(Ml,t),A(a2,t),A(c2,t),A(M$(),t),A(y$(),t),A(oI,t),A(Q$(),t),A(R$(),t),A(D$(),t),A(ML,t),A(aI,t),A(U$(),t),A(L$(),t),A(F$(),t),A(O$(),t),A(rL(),t),A(b$(),t),A(LL,t),A(x$(),t),A(cI,t),A(K$(),t),A(k$(),t),A(lI,t),A(hI,t),A(gI,t),A(P$(),t),A(G$(),t),A(j$(),t),A(Y$(),t),A(H$(),t),A(dI,t),A(J$(),t),A(pI,t),A(HL,t),A(fI,t),A(II,t),A(BI,t),A(see(),t),A(SI,t),A(mee(),t),A(W0,t),A(Ree(),t),A(Dee(),t);var r=Tee();Object.defineProperty(t,"AvatarSynthesisAdapter",{enumerable:!0,get:function(){return r.AvatarSynthesisAdapter}});var i=Uee();Object.defineProperty(t,"SpeechSynthesisAdapter",{enumerable:!0,get:function(){return i.SpeechSynthesisAdapter}}),A(Lee(),t),A(Fee(),t),A(Oee(),t),A(bee(),t),A(xee(),t),A(Nee(),t),A(IF,t),t.OutputFormatPropertyName="OutputFormat",t.CancellationErrorCodePropertyName="CancellationErrorCode",t.ServicePropertiesPropertyName="ServiceProperties",t.ForceDictationPropertyName="ForceDictation",t.AutoDetectSourceLanguagesOpenRangeOptionName="UND"}(t0)),t0}(function(t){var e=xt&&xt.__createBinding||(Object.create?function(i,n,o,s){s===void 0&&(s=o),Object.defineProperty(i,s,{enumerable:!0,get:function(){return n[o]}})}:function(i,n,o,s){s===void 0&&(s=o),i[s]=n[o]}),A=xt&&xt.__exportStar||function(i,n){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(n,o)&&e(n,i,o)};Object.defineProperty(t,"__esModule",{value:!0});const r=ut();new r.AgentConfig,A(Ve(),t)})(Ps);const hi=[];for(let t=0;t<256;++t)hi.push((t+256).toString(16).slice(1));function Kee(t,e=0){return(hi[t[e+0]]+hi[t[e+1]]+hi[t[e+2]]+hi[t[e+3]]+"-"+hi[t[e+4]]+hi[t[e+5]]+"-"+hi[t[e+6]]+hi[t[e+7]]+"-"+hi[t[e+8]]+hi[t[e+9]]+"-"+hi[t[e+10]]+hi[t[e+11]]+hi[t[e+12]]+hi[t[e+13]]+hi[t[e+14]]+hi[t[e+15]]).toLowerCase()}let X0;const kee=new Uint8Array(16);function Pee(){if(!X0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");X0=crypto.getRandomValues.bind(crypto)}return X0(kee)}const vF={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gee(t,e,A){var i;if(vF.randomUUID&&!e&&!t)return vF.randomUUID();t=t||{};const r=t.random??((i=t.rng)==null?void 0:i.call(t))??Pee();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(A=A||0,A<0||A+16>e.length)throw new RangeError(`UUID byte range ${A}:${A+15} is out of buffer bounds`);for(let n=0;n<16;++n)e[A+n]=r[n];return e}return Kee(r)}const Fl=kr(),wo=dA(),Ol=ne(""),_c=ne(""),Ta=ne(""),wn=ne("");let So=null,_0=[];const wF=ne("");let Ua=null;const SF=4e3;sn(async()=>{wo.authToken=await DI()});let gr=null,bl=null,js=null,RI=null,xl=null;const mF="/assets/ffmpeg",mo=()=>{js&&js.mute(),gr&&(gr.close(),gr=null),bl=null},DI=async()=>{var t,e,A;try{const r=await jn("/voiceTesting");return(t=r==null?void 0:r.data)==null?void 0:t.token}catch(r){if(console.error(r),Xt.isAxiosError(r)){const i=r;console.log("Error found!"),console.error((e=i.response)==null?void 0:e.data),Fl.setError(((A=i.response)==null?void 0:A.data).message)}else Fl.setError("There was an issue while fetching data")}},Nl=()=>{Ua&&clearTimeout(Ua),RI&&(RI.stopContinuousRecognitionAsync(()=>{},t=>{console.error("Error stopping recognition",t)}),RI=null),So&&So.state!=="inactive"&&So.stop()},jee=async t=>(wo.authToken=await DI(),await mo(),new Promise((e,A)=>{const r=Ps.SpeechConfig.fromAuthorizationToken(wo.authToken,"eastus2");r.speechSynthesisVoiceName="en-US-EmmaMultilingualNeural",js=new Ps.SpeakerAudioDestination;const i=Ps.AudioConfig.fromSpeakerOutput(js);gr=new Ps.SpeechSynthesizer(r,i);const n=Gee();bl=n,gr.speakTextAsync(t,o=>{if(n!==bl)return js==null||js.mute(),gr==null||gr.close(),gr=null,e();o.reason===Ps.ResultReason.SynthesizingAudioCompleted?e():A(new Error("Speech synthesis failed")),gr==null||gr.close(),gr=null,bl=null},o=>{if(n!==bl)return js==null||js.mute(),gr==null||gr.close(),gr=null,e();gr==null||gr.close(),gr=null,bl=null,A(o)})})),Yee=async t=>{wo.authToken=await DI();const e=Ps.SpeechConfig.fromAuthorizationToken(wo.authToken,"eastus2");e.speechRecognitionLanguage="en-US";const A=Ps.AudioConfig.fromDefaultMicrophoneInput(),r=new Ps.SpeechRecognizer(e,A);return RI=r,Ol.value="",_c.value="",await QF(),r.recognizing=(i,n)=>{n.result.text&&n.result.text.trim()&&(Ol.value=n.result.text.trim(),mo(),wo.userspeaking=!0,wo.userSpeechText=(_c.value?_c.value+" ":"")+Ol.value,wn.value="user",Ua&&clearTimeout(Ua),Ua=setTimeout(()=>{Ol.value&&(t(Ol.value.trim()),Ol.value="")},SF))},r.recognized=async(i,n)=>{n.result.reason===Ps.ResultReason.RecognizedSpeech&&n.result.text&&n.result.text.trim()&&(_c.value+=" "+n.result.text.trim(),Ua&&clearTimeout(Ua),Ua=setTimeout(async()=>{_c.value&&(t(_c.value),console.log("Audio stop recording"),_c.value="")},SF))},r.canceled=async(i,n)=>{console.error("Recognition canceled:",n),console.log("Audio stop recording")},r.startContinuousRecognitionAsync(),r},MF=async()=>{var t,e;Ta.value="",wF.value="";try{mo(),await Yee(async A=>{if(A){console.log("triggering Audio sentiment:");const r=await Hee();console.log("Audio sentiment:",r),Ta.value=A;const i=QF()}})}catch(A){if(console.error(A),Xt.isAxiosError(A)){const r=A;console.log("Error found!"),console.error((t=r.response)==null?void 0:t.data),Fl.setError(((e=r.response)==null?void 0:e.data).message)}else Fl.setError("There was an issue while fetching data")}},yF=async t=>{var e,A;wF.value="";try{(wn.value=="user"||wn.value=="listening")&&mo(),await jee(t)}catch(r){if(console.error(r),Xt.isAxiosError(r)){const i=r;console.log("Error found!"),console.error((e=i.response)==null?void 0:e.data),Fl.setError(((A=i.response)==null?void 0:A.data).message)}else Fl.setError("There was an issue while fetching data")}};async function QF(){try{const t=await navigator.mediaDevices.getUserMedia({audio:!0});So=new MediaRecorder(t,{mimeType:"audio/webm"}),So.ondataavailable=e=>{e.data.size>0&&_0.push(e.data)},So.start(),console.log("Audio recording started")}catch(t){console.error("Error starting audio recording:",t)}}async function Hee(){return new Promise((t,e)=>{if(!So)return e("No active recorder found");So.onstop=async()=>{var r,i,n;const A=new Blob(_0,{type:"audio/webm"});_0=[];try{console.log("Sending audio for analysis...");const o=await zee(A);console.log("Converting WebM to MP3...",o);const a={audio:await qee(o),format:"mp3",finalAnalysis:!1};console.log("Payload for analysis:",a);const c=await Xt.post("/fetchPdfAssessment",a,{headers:{"Content-Type":"application/json"}});console.log("Server response:",(r=c==null?void 0:c.data)==null?void 0:r.body),wo.audioAnaysis.push((n=(i=c==null?void 0:c.data)==null?void 0:i.body)==null?void 0:n.answer),console.log("store audioAnaysis",wo.audioAnaysis),console.log("Audio analysis result:",c.data),t(c.data)}catch(o){e(o)}},So.stop(),console.log("Audio recording stopped")})}async function zee(t){try{console.log("⏳ Initializing FFmpeg...");const e=await Jee();console.log("✅ FFmpeg loaded");const A=await gZ(t);e.writeFile("input.webm",A),await e.exec(["-i","input.webm","-vn","-acodec","libmp3lame","-ar","16000","-ac","1","-ab","32k","output.mp3"]),console.log("Conversion complete");const r=await e.readFile("output.mp3");return await e.deleteFile("input.webm"),await e.deleteFile("output.mp3"),new Blob([r],{type:"audio/mpeg"})}catch(e){throw console.error("❌ Error:",e),e}}async function Jee(){if(xl!=null&&xl.loaded)return xl;const t=xl||new aZ;return t.on("log",({message:e})=>{console.log(e)}),await t.load({coreURL:await R4(`${mF}/ffmpeg-core.js`,"text/javascript"),wasmURL:await R4(`${mF}/ffmpeg-core.wasm`,"application/wasm")}),xl=t,t}const qee=t=>new Promise((e,A)=>{const r=new FileReader;r.onloadend=()=>{const i=r.result.split(",")[1];e(i)},r.onerror=A,r.readAsDataURL(t)}),Vee={class:"flex items-center gap-4 py-2 rounded-full z-10"},Wee={key:0,class:"flex items-center"},Zee={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},Xee=[sl('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],_ee={key:1,class:"flex items-center"},$ee={width:"30",height:"30",viewBox:"0 0 36 24",class:"fill-white",style:{transform:"scaleX(-1)"}},ete=[sl('<rect x="0" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0s"></animate></rect><rect x="4" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.1s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.1s"></animate></rect><rect x="8" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.2s"></animate></rect><rect x="12" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.3s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.3s"></animate></rect><rect x="16" y="4" width="2" height="16" rx="1"><animate attributeName="height" values="16;20;16" dur="1s" repeatCount="indefinite" begin="0.4s"></animate><animate attributeName="y" values="4;2;4" dur="1s" repeatCount="indefinite" begin="0.4s"></animate></rect><rect x="20" y="6" width="2" height="12" rx="1"><animate attributeName="height" values="12;16;12" dur="1s" repeatCount="indefinite" begin="0.5s"></animate><animate attributeName="y" values="6;4;6" dur="1s" repeatCount="indefinite" begin="0.5s"></animate></rect><rect x="24" y="8" width="2" height="8" rx="1"><animate attributeName="height" values="8;12;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate><animate attributeName="y" values="8;6;8" dur="1s" repeatCount="indefinite" begin="0.6s"></animate></rect><rect x="28" y="10" width="2" height="4" rx="1"><animate attributeName="height" values="4;8;4" dur="1s" repeatCount="indefinite" begin="0.7s"></animate><animate attributeName="y" values="10;8;10" dur="1s" repeatCount="indefinite" begin="0.7s"></animate></rect><rect x="32" y="11" width="2" height="2" rx="1"><animate attributeName="height" values="2;6;2" dur="1s" repeatCount="indefinite" begin="0.8s"></animate><animate attributeName="y" values="11;9;11" dur="1s" repeatCount="indefinite" begin="0.8s"></animate></rect>',9)],tte={key:2,class:"flex items-center"},Ate=[sl('<svg width="30" height="30" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="12" y="16" width="40" height="32" rx="8" fill="white" stroke="#9CA3AF" stroke-width="2"></rect><circle cx="24" cy="32" r="4" fill="black"></circle><circle cx="40" cy="32" r="4" fill="black"></circle><line x1="32" y1="10" x2="32" y2="16" stroke="#9CA3AF" stroke-width="2"></line><circle cx="32" cy="8" r="2" fill="white"></circle><circle cx="52" cy="14" r="3" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0s" repeatCount="indefinite"></animate></circle><circle cx="58" cy="10" r="2.5" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.2s" repeatCount="indefinite"></animate></circle><circle cx="63" cy="6" r="2" fill="white"><animate attributeName="opacity" values="0;1;0" dur="1.2s" begin="0.4s" repeatCount="indefinite"></animate></circle></svg>',1)],rte={class:"tooltiptext text-genpact-darkest-teal"},ite=[S("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[S("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"})],-1)],nte=[S("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-[10px] w-[10px] text-gray-700",fill:"currentColor",viewBox:"0 0 24 24"},[S("path",{d:"M12 14a3 3 0 0 0 3-3V5a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 14 0h-2zm-5 9a7 7 0 0 0 7-7h2a9 9 0 0 1-8 8.94V22h-2v-1.06A9 9 0 0 1 3 13h2a7 7 0 0 0 7 7z"}),S("line",{x1:"4",y1:"4",x2:"20",y2:"20",stroke:"currentColor","stroke-width":"2"})],-1)],ste=Zt({__name:"NewVoiceConversation",setup(t){const e=dA(),A=kr(),r=ne(""),i=ne(!1),n=ne("Turn on mic"),o=()=>{i.value===!1?e.elevenLabs?(console.log("mic enabled true 11labs"),i.value=!0,oC(),wn.value="user",n.value="Turn off mic"):(console.log("mic enabled true"),i.value=!0,mo(),MF(),wn.value="user",n.value="Turn off mic"):e.elevenLabs?(console.log("mic enabled false"),wl(),i.value=!1,n.value="Turn on mic"):(console.log("mic enabled false"),Nl(),i.value=!1,n.value="Turn on mic")},s=()=>{e.elevenLabs?(console.log("closeConversation 11 labs"),wl(),wn.value="none",i.value=!1):(console.log("closeConversation"),Nl(),mo(),wn.value="none",i.value=!1)},a=async()=>{var c,u,l,g,h,p,C,I;try{const E={question:Ta.value||iC.value};e.conversations.push(E),e.dotLoader=!0,e.question="";const v={past_messages:e.past_messages,question:Ta.value||iC.value,skillId:e.simulationSkill,bandCode:e.band_code,userGenomeFunction:e.genomeFunctionValue,userGenomeRole:e.genomeRoleValue},m=await si("/sqlTest",v);if(wn.value="bot",r.value=(u=(c=m==null?void 0:m.data)==null?void 0:c.body)==null?void 0:u.answer,r.value===""){console.log("in the if case calling api again");const M=await si("/sqlTest",v);e.addConversation((l=M.data)==null?void 0:l.body,"new")}else console.log("in the else case"),e.addConversation((g=m.data)==null?void 0:g.body,"new");if(e.dotLoader=!1,e.elevenLabs)await iZ(r.value.replace(/[*#]/g,""));else if(r.value.includes("Feedback and Assessment")){Nl();const M={pastAudioAnalysis:e.audioAnaysis,finalAnalysis:!0},O=await Xt.post("/fetchPdfAssessment",M,{headers:{"Content-Type":"application/json"}});if(console.log((h=O==null?void 0:O.data)==null?void 0:h.body),e.addConversation((p=O==null?void 0:O.data)==null?void 0:p.body,"new"),i.value=!1,r.value.includes("END ROLE PLAY")){const x=r.value.split("END ROLE PLAY")[0];if(x.length<0){e.showVoiceComponent=!1;return}await yF(x.replace(/[*#]/g,"")),e.showVoiceComponent=!1}else e.showVoiceComponent=!1}else await yF(r.value.replace(/[*#]/g,""))}catch(E){if(console.error(E),Xt.isAxiosError(E)){const v=E;console.log("Error found!"),console.error((C=v.response)==null?void 0:C.data),A.setError(((I=v.response)==null?void 0:I.data).message)}else A.setError("There was an issue, please contact helpmate")}};return oo(Ta,async c=>{if(c){if(console.log("Recognized text:",c),Ta.value.toLowerCase().includes("play")&&Ta.value.length<10){console.log("play command detected, ignoring input");return}wn.value="listening",e.userspeaking=!1,await a(),Ta.value=""}}),oo(iC,async c=>{c&&(console.log("Recognized text:",c),wn.value="listening",await a(),iC.value="")}),(c,u)=>(ue(),ge("div",Vee,[fe(wn)==="bot"?(ue(),ge("div",Wee,[S("span",null,[(ue(),ge("svg",Zee,Xee))])])):fe(wn)==="user"?(ue(),ge("div",_ee,[S("span",null,[(ue(),ge("svg",$ee,ete))])])):fe(wn)==="listening"?(ue(),ge("div",tte,Ate)):Dt("",!0),S("div",{class:mt([i.value?"":"animate-pulse","tooltip"])},[S("span",rte,bt(n.value),1),i.value?(ue(),ge("button",{key:0,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:u[0]||(u[0]=l=>o())},ite)):(ue(),ge("button",{key:1,class:"rounded-full bg-white p-2 transition hover:bg-gray-300",onClick:u[1]||(u[1]=l=>o())},nte))],2),S("button",{class:"rounded-full bg-white p-2 hover:bg-gray-300",onClick:u[2]||(u[2]=l=>s())},[ot(fe(d4),{class:"h-[10px] w-[10px] text-gray-700"})])]))}}),La=t=>(xr("data-v-9ec493aa"),t=t(),Nr(),t),ote={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},ate={class:"py-2"},cte={class:"flex"},ute={class:"z-1 relative w-full"},lte={class:"flex justify-between my-2 w-full"},hte=La(()=>S("div",null,null,-1)),gte={key:0,class:"flex justify-center bg-genpact-darkest-blue px-4 rounded-full"},dte={class:"relative w-full"},pte={class:"absolute inset-y-0 left-0 flex items-center pl-3"},fte={class:"tooltip"},Ete=La(()=>S("span",{class:"tooltiptext text-genpact-darkest-teal"},"Restart",-1)),Cte=[La(()=>S("path",{d:"M12 4C8.229 4 6.343 4 5.172 5.172C4.001 6.344 4 8.229 4 12V18C4 18.943 4 19.414 4.293 19.707C4.586 20 5.057 20 6 20H12C15.771 20 17.657 20 18.828 18.828C19.999 17.656 20 15.771 20 12",stroke:"currentColor","stroke-width":"2"},null,-1)),La(()=>S("path",{d:"M9 10H15M9 14H12M19 8V2M16 5H22",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1))],Ite={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},Bte={key:0},vte=["disabled"],wte=[La(()=>S("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],Ste={key:1,class:"tooltip"},mte=[La(()=>S("span",{class:"tooltiptext text-genpact-darkest-teal"},"Processing",-1)),La(()=>S("img",{class:"w-7 h-7",src:$S,alt:"watingIcon"},null,-1))],Mte={class:"flex justify-start gap-2 md:gap-1"},yte=["disabled"],Qte=La(()=>S("div",{class:"pt-1 text-start font-sans text-xs font-bold text-gray-500 md:text-sm"},[S("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),Rte=Zt({__name:"NewQuestionSimulation",setup(t,{expose:e}){const A=dA(),r=kr(),i=ne(""),n=ne("");A.question="";const o=ne(null),s=ne(!1),a=ne(0);n.value=A.recognizedText,sn(()=>{o.value.focus()});const c=()=>{window.location.reload()},u=async()=>{var h,p,C,I,E,v,m,M,O,x,P;try{if(A.question.trim().length<1){console.log("Please enter answer!");return}s.value=!0,A.dotLoader=!0;const D={question:A.question||A.recognizedText};A.conversations.push(D);const T=ne("");T.value=A.question||A.recognizedText,A.question="",o.value&&(o.value.style.height="auto");const q={ohr_id:i.value,past_messages:A.past_messages,question:T.value||A.recognizedText,bandCode:A.band_code,userGenomeFunction:A.genomeFunctionValue,userGenomeRole:A.genomeRoleValue,skillId:A.simulationSkill||"937e84ef-e95d-4327-9afe-e7be2bf420eb"},Q=await si("/sqlTest",q);if(a.value+=(p=(h=Q.data)==null?void 0:h.body)==null?void 0:p.totalTokenCount,console.log("Token Count:",a.value),i.value=(I=(C=Q.data)==null?void 0:C.body)==null?void 0:I.ohr,((v=(E=Q==null?void 0:Q.data)==null?void 0:E.body)==null?void 0:v.answer)===""){console.log("in the if case calling api again");const G=await si("/sqlTest",q);A.addConversation((m=G.data)==null?void 0:m.body,"new")}else console.log("in the else case"),A.addConversation((M=Q.data)==null?void 0:M.body,"new");s.value=!1,A.dotLoader=!1,A.recognizedText=""}catch(D){if(console.error(D),A.dotLoader=!1,s.value=!1,Xt.isAxiosError(D)){const T=D;console.log("Error found!"),console.error((O=T.response)==null?void 0:O.data),r.setError((P=(x=T.response)==null?void 0:x.data)==null?void 0:P.message)}else r.setError("There was an issue, please contact helpmate")}},l=h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),u())},g=h=>{const p=h.target;p.style.height="auto",p.style.height=p.scrollHeight+"px"};return e({sendQuestion:u}),(h,p)=>(ue(),ge("div",ote,[S("div",ate,[S("div",cte,[S("div",ute,[S("div",lte,[hte,fe(A).showVoiceComponent?(ue(),ge("div",gte,[ot(ste)])):Dt("",!0)]),S("div",dte,[S("div",pte,[S("div",fte,[Ete,(ue(),ge("svg",{onClick:c,class:"ml-2 h-7 w-7 rounded",id:"newTopicDisable",width:"7",height:"",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",title:"restart"},Cte))])]),S("div",Ite,[s.value?(ue(),ge("div",Ste,mte)):(ue(),ge("div",Bte,[(ue(),ge("svg",{disabled:fe(A).beginFlag===!0,class:mt([fe(A).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:p[0]||(p[0]=C=>fe(A).searchBoxdisable===!1||fe(A).beginFlag===!0?"":u()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},wte,10,vte))]))]),S("div",Mte,[tA(S("textarea",{onPaste:p[1]||(p[1]=IS(()=>{},["prevent"])),onKeydown:p[2]||(p[2]=C=>s.value?"":l(C)),disabled:fe(A).searchBoxdisable===!1||fe(A).beginFlag===!0,"onUpdate:modelValue":p[3]||(p[3]=C=>fe(A).question=C),class:mt(["fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] px-[70px]",fe(A).beginFlag===!0||fe(A).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white"]),placeholder:"Write your answer here...",ref_key:"AiSearch",ref:o,rows:"1",onInput:p[4]||(p[4]=C=>g(C)),style:{overflow:"hidden",transition:"height 0.2s"}},null,42,yte),[[bA,fe(A).question]])])]),Qte])])])]))}}),IRe="",Dte=SA(Rte,[["__scopeId","data-v-9ec493aa"]]),TI=t=>(xr("data-v-6c0980b5"),t=t(),Nr(),t),Tte={class:"z-3 absolute bottom-0 mt-4 w-full bg-white px-2 md:px-6"},Ute={class:"py-2"},Lte={class:"flex"},Fte={class:"z-1 relative w-full"},Ote={class:"relative w-full"},bte={class:"absolute inset-y-0 right-0 flex items-center md:pr-8 pr-3"},xte={key:0},Nte=["disabled"],Kte=[TI(()=>S("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"},null,-1))],kte={key:1,class:"tooltip"},Pte=[TI(()=>S("span",{class:"tooltiptext fontFormattingAMA"},"Waiting for response",-1)),TI(()=>S("img",{class:"w-7 h-7",src:$S,alt:"watingIcon"},null,-1))],Gte={class:"flex justify-start gap-2 md:gap-1"},jte=["disabled"],Yte=TI(()=>S("div",{class:"pt-1 text-start font-sans text-[0.8125rem] md:text-[0.9375rem] font-bold text-gray-500"},[S("div",null," Note: AI-generated response may not be fully accurate; check with experts for critical information. ")],-1)),Hte=Zt({__name:"NewMDMQuestionSimulation",setup(t){const e=dA(),A=kr(),r=ne("");e.question="";const i=ne(null),n=ne(!1),o=ne(ho),s=ne(!1);r.value=e.recognizedText,sn(()=>{i.value.focus()});const a=u=>{const l=u.length;o.value=ho-l,n.value=l>=ho},c=async()=>{var u,l,g;console.log("options fdsfdscdzxfsdv",e.recognizedText);try{if(console.log("options fdsfdscdzxfsdv",e.recognizedText),e.question.trim().length<1){console.log("Please enter answer!");return}s.value=!0,e.dotLoader=!0;const h={question:e.question||e.recognizedText};console.log("ques",h),e.conversations.push(h);const p=ne("");p.value=e.question||e.recognizedText,e.question="";const C={assessmentId:e.simulationSkill,question:p.value,past_messages:e.past_messages,prompt:e.generatedPrompt,assessmentType:e.assessmentType,userFunction:"HR",empSeniority:e.empSeniority,functionRole:e.functionRole,userBand:e.band_code,storeFinalFeedback:e.storeFinalFeedback,storeFinalScore:e.storeFinalScore};console.log("Payload for MDM1==> ",C);let I;Ks==="prod"?I="/ManualExportActivity":I="/fetchCompletionDemo";const E=await si(I,C);e.addConversation((u=E.data)==null?void 0:u.body,"new"),s.value=!1,e.dotLoader=!1,e.recognizedText=""}catch(h){if(console.error(h),Xt.isAxiosError(h)){const p=h;console.log("Error found!"),console.error((l=p.response)==null?void 0:l.data),A.setError(((g=p.response)==null?void 0:g.data).message)}else A.setError("There was an issue, please contact helpmate")}};return(u,l)=>(ue(),ge("div",Tte,[S("div",Ute,[S("div",Lte,[S("div",Fte,[S("div",Ote,[S("div",bte,[s.value?(ue(),ge("div",kte,Pte)):(ue(),ge("div",xte,[(ue(),ge("svg",{disabled:fe(e).beginFlag===!0,class:mt([fe(e).beginFlag===!0?"cursor-not-allowed text-gray-600":"cursor-pointer","bi bi-send ml-2 h-7 w-7 rotate-45 rounded"]),onClick:l[0]||(l[0]=g=>fe(e).searchBoxdisable===!1||fe(e).beginFlag===!0?"":c()),xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 16 16"},Kte,10,Nte))]))]),S("div",Gte,[tA(S("input",{onKeyup:[l[1]||(l[1]=eT(g=>s.value?"":c(),["enter"])),l[3]||(l[3]=g=>a(fe(e).question))],disabled:fe(e).beginFlag===!0||fe(e).searchBoxdisable===!1,class:mt([fe(e).beginFlag===!0||fe(e).searchBoxdisable===!1?"cursor-not-allowed bg-[#e5e7eb]":"bg-white","fontFormattingAMA rounded-lg flex w-full border border-genpact-darkest-teal py-[18px] pl-[30px] pr-[70px]"]),"onUpdate:modelValue":l[2]||(l[2]=g=>fe(e).question=g),placeholder:"Write your answer here...",type:"text",ref_key:"AiSearch",ref:i},null,42,jte),[[bA,fe(e).question]])])]),Yte])])])]))}}),SRe="",zte=SA(Hte,[["__scopeId","data-v-6c0980b5"]]),Jte={},qte={class:"flex min-h-screen justify-center -mt-16"},Vte=[S("div",{class:"flex items-center justify-center"},[S("img",{class:"loadercss",src:go,alt:"Loader Gif"})],-1)];function Wte(t,e){return ue(),ge("div",qte,Vte)}const RF=SA(Jte,[["render",Wte]]);function BA(t){return BA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BA(t)}var fs=Uint8Array,Sn=Uint16Array,$0=Int32Array,em=new fs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),tm=new fs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),DF=new fs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),TF=function(t,e){for(var A=new Sn(31),r=0;r<31;++r)A[r]=e+=1<<t[r-1];for(var i=new $0(A[30]),r=1;r<30;++r)for(var n=A[r];n<A[r+1];++n)i[n]=n-A[r]<<5|r;return{b:A,r:i}},UF=TF(em,2),Zte=UF.b,Am=UF.r;Zte[28]=258,Am[258]=28;for(var Xte=TF(tm,0),LF=Xte.r,rm=new Sn(32768),YA=0;YA<32768;++YA){var Fa=(YA&43690)>>1|(YA&21845)<<1;Fa=(Fa&52428)>>2|(Fa&13107)<<2,Fa=(Fa&61680)>>4|(Fa&3855)<<4,rm[YA]=((Fa&65280)>>8|(Fa&255)<<8)>>1}for(var pp=function(t,e,A){for(var r=t.length,i=0,n=new Sn(e);i<r;++i)t[i]&&++n[t[i]-1];var o=new Sn(e);for(i=1;i<e;++i)o[i]=o[i-1]+n[i-1]<<1;var s;if(A){s=new Sn(1<<e);var a=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],l=o[t[i]-1]++<<u,g=l|(1<<u)-1;l<=g;++l)s[rm[l]>>a]=c}else for(s=new Sn(r),i=0;i<r;++i)t[i]&&(s[i]=rm[o[t[i]-1]++]>>15-t[i]);return s},$c=new fs(288),YA=0;YA<144;++YA)$c[YA]=8;for(var YA=144;YA<256;++YA)$c[YA]=9;for(var YA=256;YA<280;++YA)$c[YA]=7;for(var YA=280;YA<288;++YA)$c[YA]=8;for(var UI=new fs(32),YA=0;YA<32;++YA)UI[YA]=5;var _te=pp($c,9,0),$te=pp(UI,5,0),FF=function(t){return(t+7)/8|0},eAe=function(t,e,A){return(e==null||e<0)&&(e=0),(A==null||A>t.length)&&(A=t.length),new fs(t.subarray(e,A))},Mo=function(t,e,A){A<<=e&7;var r=e/8|0;t[r]|=A,t[r+1]|=A>>8},fp=function(t,e,A){A<<=e&7;var r=e/8|0;t[r]|=A,t[r+1]|=A>>8,t[r+2]|=A>>16},im=function(t,e){for(var A=[],r=0;r<t.length;++r)t[r]&&A.push({s:r,f:t[r]});var i=A.length,n=A.slice();if(!i)return{t:NF,l:0};if(i==1){var o=new fs(A[0].s+1);return o[A[0].s]=1,{t:o,l:1}}A.sort(function(O,x){return O.f-x.f}),A.push({s:-1,f:25001});var s=A[0],a=A[1],c=0,u=1,l=2;for(A[0]={s:-1,f:s.f+a.f,l:s,r:a};u!=i-1;)s=A[A[c].f<A[l].f?c++:l++],a=A[c!=u&&A[c].f<A[l].f?c++:l++],A[u++]={s:-1,f:s.f+a.f,l:s,r:a};for(var g=n[0].s,r=1;r<i;++r)n[r].s>g&&(g=n[r].s);var h=new Sn(g+1),p=nm(A[u-1],h,0);if(p>e){var r=0,C=0,I=p-e,E=1<<I;for(n.sort(function(x,P){return h[P.s]-h[x.s]||x.f-P.f});r<i;++r){var v=n[r].s;if(h[v]>e)C+=E-(1<<p-h[v]),h[v]=e;else break}for(C>>=I;C>0;){var m=n[r].s;h[m]<e?C-=1<<e-h[m]++-1:++r}for(;r>=0&&C;--r){var M=n[r].s;h[M]==e&&(--h[M],++C)}p=e}return{t:new fs(h),l:p}},nm=function(t,e,A){return t.s==-1?Math.max(nm(t.l,e,A+1),nm(t.r,e,A+1)):e[t.s]=A},OF=function(t){for(var e=t.length;e&&!t[--e];);for(var A=new Sn(++e),r=0,i=t[0],n=1,o=function(a){A[r++]=a},s=1;s<=e;++s)if(t[s]==i&&s!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(i),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(i);n=1,i=t[s]}return{c:A.subarray(0,r),n:e}},Ep=function(t,e){for(var A=0,r=0;r<e.length;++r)A+=t[r]*e[r];return A},bF=function(t,e,A){var r=A.length,i=FF(e+2);t[i]=r&255,t[i+1]=r>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var n=0;n<r;++n)t[i+n+4]=A[n];return(i+4+r)*8},xF=function(t,e,A,r,i,n,o,s,a,c,u){Mo(e,u++,A),++i[256];for(var l=im(i,15),g=l.t,h=l.l,p=im(n,15),C=p.t,I=p.l,E=OF(g),v=E.c,m=E.n,M=OF(C),O=M.c,x=M.n,P=new Sn(19),D=0;D<v.length;++D)++P[v[D]&31];for(var D=0;D<O.length;++D)++P[O[D]&31];for(var T=im(P,7),q=T.t,Q=T.l,R=19;R>4&&!q[DF[R-1]];--R);var G=c+5<<3,k=Ep(i,$c)+Ep(n,UI)+o,te=Ep(i,g)+Ep(n,C)+o+14+3*R+Ep(P,q)+2*P[16]+3*P[17]+7*P[18];if(a>=0&&G<=k&&G<=te)return bF(e,u,t.subarray(a,a+c));var X,ie,W,se;if(Mo(e,u,1+(te<k)),u+=2,te<k){X=pp(g,h,0),ie=g,W=pp(C,I,0),se=C;var Be=pp(q,Q,0);Mo(e,u,m-257),Mo(e,u+5,x-1),Mo(e,u+10,R-4),u+=14;for(var D=0;D<R;++D)Mo(e,u+3*D,q[DF[D]]);u+=3*R;for(var Ee=[v,O],U=0;U<2;++U)for(var Y=Ee[U],D=0;D<Y.length;++D){var _=Y[D]&31;Mo(e,u,Be[_]),u+=q[_],_>15&&(Mo(e,u,Y[D]>>5&127),u+=Y[D]>>12)}}else X=_te,ie=$c,W=$te,se=UI;for(var D=0;D<s;++D){var re=r[D];if(re>255){var _=re>>18&31;fp(e,u,X[_+257]),u+=ie[_+257],_>7&&(Mo(e,u,re>>23&31),u+=em[_]);var ae=re&31;fp(e,u,W[ae]),u+=se[ae],ae>3&&(fp(e,u,re>>5&8191),u+=tm[ae])}else fp(e,u,X[re]),u+=ie[re]}return fp(e,u,X[256]),u+ie[256]},tAe=new $0([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),NF=new fs(0),AAe=function(t,e,A,r,i,n){var o=n.z||t.length,s=new fs(r+o+5*(1+Math.ceil(o/7e3))+i),a=s.subarray(r,s.length-i),c=n.l,u=(n.r||0)&7;if(e){u&&(a[0]=n.r>>3);for(var l=tAe[e-1],g=l>>13,h=l&8191,p=(1<<A)-1,C=n.p||new Sn(32768),I=n.h||new Sn(p+1),E=Math.ceil(A/3),v=2*E,m=function(z){return(t[z]^t[z+1]<<E^t[z+2]<<v)&p},M=new $0(25e3),O=new Sn(288),x=new Sn(32),P=0,D=0,T=n.i||0,q=0,Q=n.w||0,R=0;T+2<o;++T){var G=m(T),k=T&32767,te=I[G];if(C[k]=te,I[G]=k,Q<=T){var X=o-T;if((P>7e3||q>24576)&&(X>423||!c)){u=xF(t,a,0,M,O,x,D,q,R,T-R,u),q=P=D=0,R=T;for(var ie=0;ie<286;++ie)O[ie]=0;for(var ie=0;ie<30;++ie)x[ie]=0}var W=2,se=0,Be=h,Ee=k-te&32767;if(X>2&&G==m(T-Ee))for(var U=Math.min(g,X)-1,Y=Math.min(32767,T),_=Math.min(258,X);Ee<=Y&&--Be&&k!=te;){if(t[T+W]==t[T+W-Ee]){for(var re=0;re<_&&t[T+re]==t[T+re-Ee];++re);if(re>W){if(W=re,se=Ee,re>U)break;for(var ae=Math.min(Ee,re-2),Z=0,ie=0;ie<ae;++ie){var ce=T-Ee+ie&32767,oe=C[ce],de=ce-oe&32767;de>Z&&(Z=de,te=ce)}}}k=te,te=C[k],Ee+=k-te&32767}if(se){M[q++]=268435456|Am[W]<<18|LF[se];var De=Am[W]&31,j=LF[se]&31;D+=em[De]+tm[j],++O[257+De],++x[j],Q=T+W,++P}else M[q++]=t[T],++O[t[T]]}}for(T=Math.max(T,Q);T<o;++T)M[q++]=t[T],++O[t[T]];u=xF(t,a,c,M,O,x,D,q,R,T-R,u),c||(n.r=u&7|a[u/8|0]<<3,u-=7,n.h=I,n.p=C,n.i=T,n.w=Q)}else{for(var T=n.w||0;T<o+c;T+=65535){var J=T+65535;J>=o&&(a[u/8|0]=c,J=o),u=bF(a,u+1,t.subarray(T,J))}n.i=o}return eAe(s,0,r+FF(u)+i)},KF=function(){var t=1,e=0;return{p:function(A){for(var r=t,i=e,n=A.length|0,o=0;o!=n;){for(var s=Math.min(o+2655,n);o<s;++o)i+=r+=A[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}t=r,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},rAe=function(t,e,A,r,i){if(!i&&(i={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),o=new fs(n.length+t.length);o.set(n),o.set(t,n.length),t=o,i.w=n.length}return AAe(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,A,r,i)},kF=function(t,e,A){for(;A;++e)t[e]=A,A>>>=8},iAe=function(t,e){var A=e.level,r=A==0?0:A<6?1:A==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=KF();i.p(e.dictionary),kF(t,2,i.d())}};function sm(t,e){e||(e={});var A=KF();A.p(t);var r=rAe(t,e,e.dictionary?6:2,4);return iAe(r,e),kF(r,r.length-4,A.d()),r}var nAe=typeof TextDecoder<"u"&&new TextDecoder,sAe=0;try{nAe.decode(NF,{stream:!0}),sAe=1}catch{}function oAe(t){if(Array.isArray(t))return t}function aAe(t,e){var A=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(A!=null){var r,i,n,o,s=[],a=!0,c=!1;try{if(n=(A=A.call(t)).next,e===0){if(Object(A)!==A)return;a=!1}else for(;!(a=(r=n.call(A)).done)&&(s.push(r.value),s.length!==e);a=!0);}catch(u){c=!0,i=u}finally{try{if(!a&&A.return!=null&&(o=A.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function PF(t,e){(e==null||e>t.length)&&(e=t.length);for(var A=0,r=Array(e);A<e;A++)r[A]=t[A];return r}function cAe(t,e){if(t){if(typeof t=="string")return PF(t,e);var A={}.toString.call(t).slice(8,-1);return A==="Object"&&t.constructor&&(A=t.constructor.name),A==="Map"||A==="Set"?Array.from(t):A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?PF(t,e):void 0}}function uAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
36
36
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GF(t,e){return oAe(t)||aAe(t,e)||cAe(t,e)||uAe()}function jF(t,e="utf8"){return new TextDecoder(e).decode(t)}const lAe=new TextEncoder;function hAe(t){return lAe.encode(t)}const gAe=1024*8,dAe=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),om={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class am{constructor(e=gAe,A={}){Ht(this,"buffer");Ht(this,"byteLength");Ht(this,"byteOffset");Ht(this,"length");Ht(this,"offset");Ht(this,"lastWrittenByte");Ht(this,"littleEndian");Ht(this,"_data");Ht(this,"_mark");Ht(this,"_marks");let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const i=A.offset?A.offset>>>0:0,n=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof am)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),r?this.lastWrittenByte=n:this.lastWrittenByte=0,this.buffer=e,this.length=n,this.byteLength=n,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,n),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,A){const r=om[A].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,n=this.buffer.slice(i,i+r);if(this.littleEndian===dAe&&A!=="uint8"&&A!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+r));s.reverse();const a=new om[A](s.buffer);return this.offset+=r,a.reverse(),a}const o=new om[A](n);return this.offset+=r,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let A="";for(let r=0;r<e;r++)A+=this.readChar();return A}readUtf8(e=1){return jF(this.readBytes(e))}decodeText(e=1,A="utf8"){return jF(this.readBytes(e),A)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let A=0;A<e.length;A++)this._data.setUint8(this.offset++,e[A]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let A=0;A<e.length;A++)this.writeUint8(e.charCodeAt(A));return this}writeUtf8(e){return this.writeBytes(hAe(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const pAe=4,YF=0,HF=1,fAe=2;function Kl(t){let e=t.length;for(;--e>=0;)t[e]=0}const EAe=0,zF=1,CAe=2,IAe=3,BAe=258,cm=29,Cp=256,Ip=Cp+1+cm,kl=30,um=19,JF=2*Ip+1,eu=15,lm=16,vAe=7,hm=256,qF=16,VF=17,WF=18,gm=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),LI=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wAe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ZF=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),SAe=512,yo=new Array((Ip+2)*2);Kl(yo);const Bp=new Array(kl*2);Kl(Bp);const vp=new Array(SAe);Kl(vp);const wp=new Array(BAe-IAe+1);Kl(wp);const dm=new Array(cm);Kl(dm);const FI=new Array(kl);Kl(FI);function pm(t,e,A,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=A,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let XF,_F,$F;function fm(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}const eO=t=>t<256?vp[t]:vp[256+(t>>>7)],Sp=(t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},cn=(t,e,A)=>{t.bi_valid>lm-A?(t.bi_buf|=e<<t.bi_valid&65535,Sp(t,t.bi_buf),t.bi_buf=e>>lm-t.bi_valid,t.bi_valid+=A-lm):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=A)},Ys=(t,e,A)=>{cn(t,A[e*2],A[e*2+1])},tO=(t,e)=>{let A=0;do A|=t&1,t>>>=1,A<<=1;while(--e>0);return A>>>1},mAe=t=>{t.bi_valid===16?(Sp(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},MAe=(t,e)=>{const A=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,a=e.stat_desc.max_length;let c,u,l,g,h,p,C=0;for(g=0;g<=eu;g++)t.bl_count[g]=0;for(A[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<JF;c++)u=t.heap[c],g=A[A[u*2+1]*2+1]+1,g>a&&(g=a,C++),A[u*2+1]=g,!(u>r)&&(t.bl_count[g]++,h=0,u>=s&&(h=o[u-s]),p=A[u*2],t.opt_len+=p*(g+h),n&&(t.static_len+=p*(i[u*2+1]+h)));if(C!==0){do{for(g=a-1;t.bl_count[g]===0;)g--;t.bl_count[g]--,t.bl_count[g+1]+=2,t.bl_count[a]--,C-=2}while(C>0);for(g=a;g!==0;g--)for(u=t.bl_count[g];u!==0;)l=t.heap[--c],!(l>r)&&(A[l*2+1]!==g&&(t.opt_len+=(g-A[l*2+1])*A[l*2],A[l*2+1]=g),u--)}},AO=(t,e,A)=>{const r=new Array(eu+1);let i=0,n,o;for(n=1;n<=eu;n++)i=i+A[n-1]<<1,r[n]=i;for(o=0;o<=e;o++){let s=t[o*2+1];s!==0&&(t[o*2]=tO(r[s]++,s))}},yAe=()=>{let t,e,A,r,i;const n=new Array(eu+1);for(A=0,r=0;r<cm-1;r++)for(dm[r]=A,t=0;t<1<<gm[r];t++)wp[A++]=r;for(wp[A-1]=r,i=0,r=0;r<16;r++)for(FI[r]=i,t=0;t<1<<LI[r];t++)vp[i++]=r;for(i>>=7;r<kl;r++)for(FI[r]=i<<7,t=0;t<1<<LI[r]-7;t++)vp[256+i++]=r;for(e=0;e<=eu;e++)n[e]=0;for(t=0;t<=143;)yo[t*2+1]=8,t++,n[8]++;for(;t<=255;)yo[t*2+1]=9,t++,n[9]++;for(;t<=279;)yo[t*2+1]=7,t++,n[7]++;for(;t<=287;)yo[t*2+1]=8,t++,n[8]++;for(AO(yo,Ip+1,n),t=0;t<kl;t++)Bp[t*2+1]=5,Bp[t*2]=tO(t,5);XF=new pm(yo,gm,Cp+1,Ip,eu),_F=new pm(Bp,LI,0,kl,eu),$F=new pm(new Array(0),wAe,0,um,vAe)},rO=t=>{let e;for(e=0;e<Ip;e++)t.dyn_ltree[e*2]=0;for(e=0;e<kl;e++)t.dyn_dtree[e*2]=0;for(e=0;e<um;e++)t.bl_tree[e*2]=0;t.dyn_ltree[hm*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},iO=t=>{t.bi_valid>8?Sp(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},nO=(t,e,A,r)=>{const i=e*2,n=A*2;return t[i]<t[n]||t[i]===t[n]&&r[e]<=r[A]},Em=(t,e,A)=>{const r=t.heap[A];let i=A<<1;for(;i<=t.heap_len&&(i<t.heap_len&&nO(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!nO(e,r,t.heap[i],t.depth));)t.heap[A]=t.heap[i],A=i,i<<=1;t.heap[A]=r},sO=(t,e,A)=>{let r,i,n=0,o,s;if(t.sym_next!==0)do r=t.pending_buf[t.sym_buf+n++]&255,r+=(t.pending_buf[t.sym_buf+n++]&255)<<8,i=t.pending_buf[t.sym_buf+n++],r===0?Ys(t,i,e):(o=wp[i],Ys(t,o+Cp+1,e),s=gm[o],s!==0&&(i-=dm[o],cn(t,i,s)),r--,o=eO(r),Ys(t,o,A),s=LI[o],s!==0&&(r-=FI[o],cn(t,r,s)));while(n<t.sym_next);Ys(t,hm,e)},Cm=(t,e)=>{const A=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,n=e.stat_desc.elems;let o,s,a=-1,c;for(t.heap_len=0,t.heap_max=JF,o=0;o<n;o++)A[o*2]!==0?(t.heap[++t.heap_len]=a=o,t.depth[o]=0):A[o*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=a<2?++a:0,A[c*2]=1,t.depth[c]=0,t.opt_len--,i&&(t.static_len-=r[c*2+1]);for(e.max_code=a,o=t.heap_len>>1;o>=1;o--)Em(t,A,o);c=n;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Em(t,A,1),s=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=s,A[c*2]=A[o*2]+A[s*2],t.depth[c]=(t.depth[o]>=t.depth[s]?t.depth[o]:t.depth[s])+1,A[o*2+1]=A[s*2+1]=c,t.heap[1]=c++,Em(t,A,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],MAe(t,e),AO(A,a,t.bl_count)},oO=(t,e,A)=>{let r,i=-1,n,o=e[0*2+1],s=0,a=7,c=4;for(o===0&&(a=138,c=3),e[(A+1)*2+1]=65535,r=0;r<=A;r++)n=o,o=e[(r+1)*2+1],!(++s<a&&n===o)&&(s<c?t.bl_tree[n*2]+=s:n!==0?(n!==i&&t.bl_tree[n*2]++,t.bl_tree[qF*2]++):s<=10?t.bl_tree[VF*2]++:t.bl_tree[WF*2]++,s=0,i=n,o===0?(a=138,c=3):n===o?(a=6,c=3):(a=7,c=4))},aO=(t,e,A)=>{let r,i=-1,n,o=e[0*2+1],s=0,a=7,c=4;for(o===0&&(a=138,c=3),r=0;r<=A;r++)if(n=o,o=e[(r+1)*2+1],!(++s<a&&n===o)){if(s<c)do Ys(t,n,t.bl_tree);while(--s!==0);else n!==0?(n!==i&&(Ys(t,n,t.bl_tree),s--),Ys(t,qF,t.bl_tree),cn(t,s-3,2)):s<=10?(Ys(t,VF,t.bl_tree),cn(t,s-3,3)):(Ys(t,WF,t.bl_tree),cn(t,s-11,7));s=0,i=n,o===0?(a=138,c=3):n===o?(a=6,c=3):(a=7,c=4)}},QAe=t=>{let e;for(oO(t,t.dyn_ltree,t.l_desc.max_code),oO(t,t.dyn_dtree,t.d_desc.max_code),Cm(t,t.bl_desc),e=um-1;e>=3&&t.bl_tree[ZF[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},RAe=(t,e,A,r)=>{let i;for(cn(t,e-257,5),cn(t,A-1,5),cn(t,r-4,4),i=0;i<r;i++)cn(t,t.bl_tree[ZF[i]*2+1],3);aO(t,t.dyn_ltree,e-1),aO(t,t.dyn_dtree,A-1)},DAe=t=>{let e=4093624447,A;for(A=0;A<=31;A++,e>>>=1)if(e&1&&t.dyn_ltree[A*2]!==0)return YF;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return HF;for(A=32;A<Cp;A++)if(t.dyn_ltree[A*2]!==0)return HF;return YF};let cO=!1;const TAe=t=>{cO||(yAe(),cO=!0),t.l_desc=new fm(t.dyn_ltree,XF),t.d_desc=new fm(t.dyn_dtree,_F),t.bl_desc=new fm(t.bl_tree,$F),t.bi_buf=0,t.bi_valid=0,rO(t)},uO=(t,e,A,r)=>{cn(t,(EAe<<1)+(r?1:0),3),iO(t),Sp(t,A),Sp(t,~A),A&&t.pending_buf.set(t.window.subarray(e,e+A),t.pending),t.pending+=A},UAe=t=>{cn(t,zF<<1,3),Ys(t,hm,yo),mAe(t)},LAe=(t,e,A,r)=>{let i,n,o=0;t.level>0?(t.strm.data_type===fAe&&(t.strm.data_type=DAe(t)),Cm(t,t.l_desc),Cm(t,t.d_desc),o=QAe(t),i=t.opt_len+3+7>>>3,n=t.static_len+3+7>>>3,n<=i&&(i=n)):i=n=A+5,A+4<=i&&e!==-1?uO(t,e,A,r):t.strategy===pAe||n===i?(cn(t,(zF<<1)+(r?1:0),3),sO(t,yo,Bp)):(cn(t,(CAe<<1)+(r?1:0),3),RAe(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),sO(t,t.dyn_ltree,t.dyn_dtree)),rO(t),r&&iO(t)},FAe=(t,e,A)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=A,e===0?t.dyn_ltree[A*2]++:(t.matches++,e--,t.dyn_ltree[(wp[A]+Cp+1)*2]++,t.dyn_dtree[eO(e)*2]++),t.sym_next===t.sym_end);var OAe=TAe,bAe=uO,xAe=LAe,NAe=FAe,KAe=UAe,kAe={_tr_init:OAe,_tr_stored_block:bAe,_tr_flush_block:xAe,_tr_tally:NAe,_tr_align:KAe},mp=(t,e,A,r)=>{let i=t&65535|0,n=t>>>16&65535|0,o=0;for(;A!==0;){o=A>2e3?2e3:A,A-=o;do i=i+e[r++]|0,n=n+i|0;while(--o);i%=65521,n%=65521}return i|n<<16|0};const PAe=()=>{let t,e=[];for(var A=0;A<256;A++){t=A;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[A]=t}return e},GAe=new Uint32Array(PAe());var Xr=(t,e,A,r)=>{const i=GAe,n=r+A;t^=-1;for(let o=r;o<n;o++)t=t>>>8^i[(t^e[o])&255];return t^-1},Pl={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Mp={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:jAe,_tr_stored_block:Im,_tr_flush_block:YAe,_tr_tally:Oa,_tr_align:HAe}=kAe,{Z_NO_FLUSH:ba,Z_PARTIAL_FLUSH:zAe,Z_FULL_FLUSH:JAe,Z_FINISH:Jn,Z_BLOCK:lO,Z_OK:gi,Z_STREAM_END:hO,Z_STREAM_ERROR:Hs,Z_DATA_ERROR:qAe,Z_BUF_ERROR:Bm,Z_DEFAULT_COMPRESSION:VAe,Z_FILTERED:WAe,Z_HUFFMAN_ONLY:OI,Z_RLE:ZAe,Z_FIXED:XAe,Z_DEFAULT_STRATEGY:_Ae,Z_UNKNOWN:$Ae,Z_DEFLATED:bI}=Mp,ere=9,tre=15,Are=8,rre=29,vm=256+1+rre,ire=30,nre=19,sre=2*vm+1,ore=15,cA=3,xa=258,zs=xa+cA+1,are=32,Gl=42,wm=57,Sm=69,mm=73,Mm=91,ym=103,tu=113,yp=666,zi=1,jl=2,Au=3,Yl=4,cre=3,ru=(t,e)=>(t.msg=Pl[e],e),gO=t=>t*2-(t>4?9:0),Na=t=>{let e=t.length;for(;--e>=0;)t[e]=0},ure=t=>{let e,A,r,i=t.w_size;e=t.hash_size,r=e;do A=t.head[--r],t.head[r]=A>=i?A-i:0;while(--e);e=i,r=e;do A=t.prev[--r],t.prev[r]=A>=i?A-i:0;while(--e)};let Ka=(t,e,A)=>(e<<t.hash_shift^A)&t.hash_mask;const mn=t=>{const e=t.state;let A=e.pending;A>t.avail_out&&(A=t.avail_out),A!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+A),t.next_out),t.next_out+=A,e.pending_out+=A,t.total_out+=A,t.avail_out-=A,e.pending-=A,e.pending===0&&(e.pending_out=0))},Mn=(t,e)=>{YAe(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mn(t.strm)},vA=(t,e)=>{t.pending_buf[t.pending++]=e},Qp=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},Qm=(t,e,A,r)=>{let i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),A),t.state.wrap===1?t.adler=mp(t.adler,e,i,A):t.state.wrap===2&&(t.adler=Xr(t.adler,e,i,A)),t.next_in+=i,t.total_in+=i,i)},dO=(t,e)=>{let A=t.max_chain_length,r=t.strstart,i,n,o=t.prev_length,s=t.nice_match;const a=t.strstart>t.w_size-zs?t.strstart-(t.w_size-zs):0,c=t.window,u=t.w_mask,l=t.prev,g=t.strstart+xa;let h=c[r+o-1],p=c[r+o];t.prev_length>=t.good_match&&(A>>=2),s>t.lookahead&&(s=t.lookahead);do if(i=e,!(c[i+o]!==p||c[i+o-1]!==h||c[i]!==c[r]||c[++i]!==c[r+1])){r+=2,i++;do;while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<g);if(n=xa-(g-r),r=g-xa,n>o){if(t.match_start=e,o=n,n>=s)break;h=c[r+o-1],p=c[r+o]}}while((e=l[e&u])>a&&--A!==0);return o<=t.lookahead?o:t.lookahead},Hl=t=>{const e=t.w_size;let A,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-zs)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),ure(t),r+=e),t.strm.avail_in===0)break;if(A=Qm(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=A,t.lookahead+t.insert>=cA)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Ka(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Ka(t,t.ins_h,t.window[i+cA-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<cA)););}while(t.lookahead<zs&&t.strm.avail_in!==0)},pO=(t,e)=>{let A=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r,i,n,o=0,s=t.strm.avail_in;do{if(r=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n||(n=t.strm.avail_out-n,i=t.strstart-t.block_start,r>i+t.strm.avail_in&&(r=i+t.strm.avail_in),r>n&&(r=n),r<A&&(r===0&&e!==Jn||e===ba||r!==i+t.strm.avail_in)))break;o=e===Jn&&r===i+t.strm.avail_in?1:0,Im(t,0,0,o),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,mn(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(Qm(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(o===0);return s-=t.strm.avail_in,s&&(s>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=s&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-s,t.strm.next_in),t.strstart),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?Yl:e!==ba&&e!==Jn&&t.strm.avail_in===0&&t.strstart===t.block_start?jl:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(Qm(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,A=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=A||(i||e===Jn)&&e!==ba&&t.strm.avail_in===0&&i<=n)&&(r=i>n?n:i,o=e===Jn&&t.strm.avail_in===0&&r===i?1:0,Im(t,t.block_start,r,o),t.block_start+=r,mn(t.strm)),o?Au:zi)},Rm=(t,e)=>{let A,r;for(;;){if(t.lookahead<zs){if(Hl(t),t.lookahead<zs&&e===ba)return zi;if(t.lookahead===0)break}if(A=0,t.lookahead>=cA&&(t.ins_h=Ka(t,t.ins_h,t.window[t.strstart+cA-1]),A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),A!==0&&t.strstart-A<=t.w_size-zs&&(t.match_length=dO(t,A)),t.match_length>=cA)if(r=Oa(t,t.strstart-t.match_start,t.match_length-cA),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=cA){t.match_length--;do t.strstart++,t.ins_h=Ka(t,t.ins_h,t.window[t.strstart+cA-1]),A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Ka(t,t.ins_h,t.window[t.strstart+1]);else r=Oa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(Mn(t,!1),t.strm.avail_out===0))return zi}return t.insert=t.strstart<cA-1?t.strstart:cA-1,e===Jn?(Mn(t,!0),t.strm.avail_out===0?Au:Yl):t.sym_next&&(Mn(t,!1),t.strm.avail_out===0)?zi:jl},zl=(t,e)=>{let A,r,i;for(;;){if(t.lookahead<zs){if(Hl(t),t.lookahead<zs&&e===ba)return zi;if(t.lookahead===0)break}if(A=0,t.lookahead>=cA&&(t.ins_h=Ka(t,t.ins_h,t.window[t.strstart+cA-1]),A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=cA-1,A!==0&&t.prev_length<t.max_lazy_match&&t.strstart-A<=t.w_size-zs&&(t.match_length=dO(t,A),t.match_length<=5&&(t.strategy===WAe||t.match_length===cA&&t.strstart-t.match_start>4096)&&(t.match_length=cA-1)),t.prev_length>=cA&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-cA,r=Oa(t,t.strstart-1-t.prev_match,t.prev_length-cA),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=Ka(t,t.ins_h,t.window[t.strstart+cA-1]),A=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=cA-1,t.strstart++,r&&(Mn(t,!1),t.strm.avail_out===0))return zi}else if(t.match_available){if(r=Oa(t,0,t.window[t.strstart-1]),r&&Mn(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return zi}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Oa(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<cA-1?t.strstart:cA-1,e===Jn?(Mn(t,!0),t.strm.avail_out===0?Au:Yl):t.sym_next&&(Mn(t,!1),t.strm.avail_out===0)?zi:jl},lre=(t,e)=>{let A,r,i,n;const o=t.window;for(;;){if(t.lookahead<=xa){if(Hl(t),t.lookahead<=xa&&e===ba)return zi;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=cA&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){n=t.strstart+xa;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<n);t.match_length=xa-(n-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=cA?(A=Oa(t,1,t.match_length-cA),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(A=Oa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),A&&(Mn(t,!1),t.strm.avail_out===0))return zi}return t.insert=0,e===Jn?(Mn(t,!0),t.strm.avail_out===0?Au:Yl):t.sym_next&&(Mn(t,!1),t.strm.avail_out===0)?zi:jl},hre=(t,e)=>{let A;for(;;){if(t.lookahead===0&&(Hl(t),t.lookahead===0)){if(e===ba)return zi;break}if(t.match_length=0,A=Oa(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,A&&(Mn(t,!1),t.strm.avail_out===0))return zi}return t.insert=0,e===Jn?(Mn(t,!0),t.strm.avail_out===0?Au:Yl):t.sym_next&&(Mn(t,!1),t.strm.avail_out===0)?zi:jl};function Js(t,e,A,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=A,this.max_chain=r,this.func=i}const Rp=[new Js(0,0,0,0,pO),new Js(4,4,8,4,Rm),new Js(4,5,16,8,Rm),new Js(4,6,32,32,Rm),new Js(4,4,16,16,zl),new Js(8,16,32,32,zl),new Js(8,16,128,128,zl),new Js(8,32,128,256,zl),new Js(32,128,258,1024,zl),new Js(32,258,258,4096,zl)],gre=t=>{t.window_size=2*t.w_size,Na(t.head),t.max_lazy_match=Rp[t.level].max_lazy,t.good_match=Rp[t.level].good_length,t.nice_match=Rp[t.level].nice_length,t.max_chain_length=Rp[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=cA-1,t.match_available=0,t.ins_h=0};function dre(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=bI,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(sre*2),this.dyn_dtree=new Uint16Array((2*ire+1)*2),this.bl_tree=new Uint16Array((2*nre+1)*2),Na(this.dyn_ltree),Na(this.dyn_dtree),Na(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ore+1),this.heap=new Uint16Array(2*vm+1),Na(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*vm+1),Na(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Dp=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Gl&&e.status!==wm&&e.status!==Sm&&e.status!==mm&&e.status!==Mm&&e.status!==ym&&e.status!==tu&&e.status!==yp?1:0},fO=t=>{if(Dp(t))return ru(t,Hs);t.total_in=t.total_out=0,t.data_type=$Ae;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?wm:e.wrap?Gl:tu,t.adler=e.wrap===2?0:1,e.last_flush=-2,jAe(e),gi},EO=t=>{const e=fO(t);return e===gi&&gre(t.state),e},pre=(t,e)=>Dp(t)||t.state.wrap!==2?Hs:(t.state.gzhead=e,gi),CO=(t,e,A,r,i,n)=>{if(!t)return Hs;let o=1;if(e===VAe&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>ere||A!==bI||r<8||r>15||e<0||e>9||n<0||n>XAe||r===8&&o!==1)return ru(t,Hs);r===8&&(r=9);const s=new dre;return t.state=s,s.strm=t,s.status=Gl,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+cA-1)/cA),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=n,s.method=A,EO(t)},fre=(t,e)=>CO(t,e,bI,tre,Are,_Ae),Ere=(t,e)=>{if(Dp(t)||e>lO||e<0)return t?ru(t,Hs):Hs;const A=t.state;if(!t.output||t.avail_in!==0&&!t.input||A.status===yp&&e!==Jn)return ru(t,t.avail_out===0?Bm:Hs);const r=A.last_flush;if(A.last_flush=e,A.pending!==0){if(mn(t),t.avail_out===0)return A.last_flush=-1,gi}else if(t.avail_in===0&&gO(e)<=gO(r)&&e!==Jn)return ru(t,Bm);if(A.status===yp&&t.avail_in!==0)return ru(t,Bm);if(A.status===Gl&&A.wrap===0&&(A.status=tu),A.status===Gl){let i=bI+(A.w_bits-8<<4)<<8,n=-1;if(A.strategy>=OI||A.level<2?n=0:A.level<6?n=1:A.level===6?n=2:n=3,i|=n<<6,A.strstart!==0&&(i|=are),i+=31-i%31,Qp(A,i),A.strstart!==0&&(Qp(A,t.adler>>>16),Qp(A,t.adler&65535)),t.adler=1,A.status=tu,mn(t),A.pending!==0)return A.last_flush=-1,gi}if(A.status===wm){if(t.adler=0,vA(A,31),vA(A,139),vA(A,8),A.gzhead)vA(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),vA(A,A.gzhead.time&255),vA(A,A.gzhead.time>>8&255),vA(A,A.gzhead.time>>16&255),vA(A,A.gzhead.time>>24&255),vA(A,A.level===9?2:A.strategy>=OI||A.level<2?4:0),vA(A,A.gzhead.os&255),A.gzhead.extra&&A.gzhead.extra.length&&(vA(A,A.gzhead.extra.length&255),vA(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(t.adler=Xr(t.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=Sm;else if(vA(A,0),vA(A,0),vA(A,0),vA(A,0),vA(A,0),vA(A,A.level===9?2:A.strategy>=OI||A.level<2?4:0),vA(A,cre),A.status=tu,mn(t),A.pending!==0)return A.last_flush=-1,gi}if(A.status===Sm){if(A.gzhead.extra){let i=A.pending,n=(A.gzhead.extra.length&65535)-A.gzindex;for(;A.pending+n>A.pending_buf_size;){let s=A.pending_buf_size-A.pending;if(A.pending_buf.set(A.gzhead.extra.subarray(A.gzindex,A.gzindex+s),A.pending),A.pending=A.pending_buf_size,A.gzhead.hcrc&&A.pending>i&&(t.adler=Xr(t.adler,A.pending_buf,A.pending-i,i)),A.gzindex+=s,mn(t),A.pending!==0)return A.last_flush=-1,gi;i=0,n-=s}let o=new Uint8Array(A.gzhead.extra);A.pending_buf.set(o.subarray(A.gzindex,A.gzindex+n),A.pending),A.pending+=n,A.gzhead.hcrc&&A.pending>i&&(t.adler=Xr(t.adler,A.pending_buf,A.pending-i,i)),A.gzindex=0}A.status=mm}if(A.status===mm){if(A.gzhead.name){let i=A.pending,n;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>i&&(t.adler=Xr(t.adler,A.pending_buf,A.pending-i,i)),mn(t),A.pending!==0)return A.last_flush=-1,gi;i=0}A.gzindex<A.gzhead.name.length?n=A.gzhead.name.charCodeAt(A.gzindex++)&255:n=0,vA(A,n)}while(n!==0);A.gzhead.hcrc&&A.pending>i&&(t.adler=Xr(t.adler,A.pending_buf,A.pending-i,i)),A.gzindex=0}A.status=Mm}if(A.status===Mm){if(A.gzhead.comment){let i=A.pending,n;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>i&&(t.adler=Xr(t.adler,A.pending_buf,A.pending-i,i)),mn(t),A.pending!==0)return A.last_flush=-1,gi;i=0}A.gzindex<A.gzhead.comment.length?n=A.gzhead.comment.charCodeAt(A.gzindex++)&255:n=0,vA(A,n)}while(n!==0);A.gzhead.hcrc&&A.pending>i&&(t.adler=Xr(t.adler,A.pending_buf,A.pending-i,i))}A.status=ym}if(A.status===ym){if(A.gzhead.hcrc){if(A.pending+2>A.pending_buf_size&&(mn(t),A.pending!==0))return A.last_flush=-1,gi;vA(A,t.adler&255),vA(A,t.adler>>8&255),t.adler=0}if(A.status=tu,mn(t),A.pending!==0)return A.last_flush=-1,gi}if(t.avail_in!==0||A.lookahead!==0||e!==ba&&A.status!==yp){let i=A.level===0?pO(A,e):A.strategy===OI?hre(A,e):A.strategy===ZAe?lre(A,e):Rp[A.level].func(A,e);if((i===Au||i===Yl)&&(A.status=yp),i===zi||i===Au)return t.avail_out===0&&(A.last_flush=-1),gi;if(i===jl&&(e===zAe?HAe(A):e!==lO&&(Im(A,0,0,!1),e===JAe&&(Na(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),mn(t),t.avail_out===0))return A.last_flush=-1,gi}return e!==Jn?gi:A.wrap<=0?hO:(A.wrap===2?(vA(A,t.adler&255),vA(A,t.adler>>8&255),vA(A,t.adler>>16&255),vA(A,t.adler>>24&255),vA(A,t.total_in&255),vA(A,t.total_in>>8&255),vA(A,t.total_in>>16&255),vA(A,t.total_in>>24&255)):(Qp(A,t.adler>>>16),Qp(A,t.adler&65535)),mn(t),A.wrap>0&&(A.wrap=-A.wrap),A.pending!==0?gi:hO)},Cre=t=>{if(Dp(t))return Hs;const e=t.state.status;return t.state=null,e===tu?ru(t,qAe):gi},Ire=(t,e)=>{let A=e.length;if(Dp(t))return Hs;const r=t.state,i=r.wrap;if(i===2||i===1&&r.status!==Gl||r.lookahead)return Hs;if(i===1&&(t.adler=mp(t.adler,e,A,0)),r.wrap=0,A>=r.w_size){i===0&&(Na(r.head),r.strstart=0,r.block_start=0,r.insert=0);let a=new Uint8Array(r.w_size);a.set(e.subarray(A-r.w_size,A),0),e=a,A=r.w_size}const n=t.avail_in,o=t.next_in,s=t.input;for(t.avail_in=A,t.next_in=0,t.input=e,Hl(r);r.lookahead>=cA;){let a=r.strstart,c=r.lookahead-(cA-1);do r.ins_h=Ka(r,r.ins_h,r.window[a+cA-1]),r.prev[a&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=a,a++;while(--c);r.strstart=a,r.lookahead=cA-1,Hl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=cA-1,r.match_available=0,t.next_in=o,t.input=s,t.avail_in=n,r.wrap=i,gi};var Bre=fre,vre=CO,wre=EO,Sre=fO,mre=pre,Mre=Ere,yre=Cre,Qre=Ire,Rre="pako deflate (from Nodeca project)",Tp={deflateInit:Bre,deflateInit2:vre,deflateReset:wre,deflateResetKeep:Sre,deflateSetHeader:mre,deflate:Mre,deflateEnd:yre,deflateSetDictionary:Qre,deflateInfo:Rre};const Dre=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tre=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const A=e.shift();if(A){if(typeof A!="object")throw new TypeError(A+"must be non-object");for(const r in A)Dre(A,r)&&(t[r]=A[r])}}return t},Ure=t=>{let e=0;for(let r=0,i=t.length;r<i;r++)e+=t[r].length;const A=new Uint8Array(e);for(let r=0,i=0,n=t.length;r<n;r++){let o=t[r];A.set(o,i),i+=o.length}return A},xI={assign:Tre,flattenChunks:Ure};let IO=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{IO=!1}const Up=new Uint8Array(256);for(let t=0;t<256;t++)Up[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Up[254]=Up[254]=1;var Lre=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,A,r,i,n,o=t.length,s=0;for(i=0;i<o;i++)A=t.charCodeAt(i),(A&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(A=65536+(A-55296<<10)+(r-56320),i++)),s+=A<128?1:A<2048?2:A<65536?3:4;for(e=new Uint8Array(s),n=0,i=0;n<s;i++)A=t.charCodeAt(i),(A&64512)===55296&&i+1<o&&(r=t.charCodeAt(i+1),(r&64512)===56320&&(A=65536+(A-55296<<10)+(r-56320),i++)),A<128?e[n++]=A:A<2048?(e[n++]=192|A>>>6,e[n++]=128|A&63):A<65536?(e[n++]=224|A>>>12,e[n++]=128|A>>>6&63,e[n++]=128|A&63):(e[n++]=240|A>>>18,e[n++]=128|A>>>12&63,e[n++]=128|A>>>6&63,e[n++]=128|A&63);return e};const Fre=(t,e)=>{if(e<65534&&t.subarray&&IO)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let A="";for(let r=0;r<e;r++)A+=String.fromCharCode(t[r]);return A};var Ore=(t,e)=>{const A=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,i;const n=new Array(A*2);for(i=0,r=0;r<A;){let o=t[r++];if(o<128){n[i++]=o;continue}let s=Up[o];if(s>4){n[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<A;)o=o<<6|t[r++]&63,s--;if(s>1){n[i++]=65533;continue}o<65536?n[i++]=o:(o-=65536,n[i++]=55296|o>>10&1023,n[i++]=56320|o&1023)}return Fre(n,i)},bre=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let A=e-1;for(;A>=0&&(t[A]&192)===128;)A--;return A<0||A===0?e:A+Up[t[A]]>e?A:e},Lp={string2buf:Lre,buf2string:Ore,utf8border:bre};function xre(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var BO=xre;const vO=Object.prototype.toString,{Z_NO_FLUSH:Nre,Z_SYNC_FLUSH:Kre,Z_FULL_FLUSH:kre,Z_FINISH:Pre,Z_OK:NI,Z_STREAM_END:Gre,Z_DEFAULT_COMPRESSION:jre,Z_DEFAULT_STRATEGY:Yre,Z_DEFLATED:Hre}=Mp;function Dm(t){this.options=xI.assign({level:jre,method:Hre,chunkSize:16384,windowBits:15,memLevel:8,strategy:Yre},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new BO,this.strm.avail_out=0;let A=Tp.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(A!==NI)throw new Error(Pl[A]);if(e.header&&Tp.deflateSetHeader(this.strm,e.header),e.dictionary){let r;if(typeof e.dictionary=="string"?r=Lp.string2buf(e.dictionary):vO.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,A=Tp.deflateSetDictionary(this.strm,r),A!==NI)throw new Error(Pl[A]);this._dict_set=!0}}Dm.prototype.push=function(t,e){const A=this.strm,r=this.options.chunkSize;let i,n;if(this.ended)return!1;for(e===~~e?n=e:n=e===!0?Pre:Nre,typeof t=="string"?A.input=Lp.string2buf(t):vO.call(t)==="[object ArrayBuffer]"?A.input=new Uint8Array(t):A.input=t,A.next_in=0,A.avail_in=A.input.length;;){if(A.avail_out===0&&(A.output=new Uint8Array(r),A.next_out=0,A.avail_out=r),(n===Kre||n===kre)&&A.avail_out<=6){this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;continue}if(i=Tp.deflate(A,n),i===Gre)return A.next_out>0&&this.onData(A.output.subarray(0,A.next_out)),i=Tp.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===NI;if(A.avail_out===0){this.onData(A.output);continue}if(n>0&&A.next_out>0){this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;continue}if(A.avail_in===0)break}return!0},Dm.prototype.onData=function(t){this.chunks.push(t)},Dm.prototype.onEnd=function(t){t===NI&&(this.result=xI.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const KI=16209,zre=16191;var Jre=function(e,A){let r,i,n,o,s,a,c,u,l,g,h,p,C,I,E,v,m,M,O,x,P,D,T,q;const Q=e.state;r=e.next_in,T=e.input,i=r+(e.avail_in-5),n=e.next_out,q=e.output,o=n-(A-e.avail_out),s=n+(e.avail_out-257),a=Q.dmax,c=Q.wsize,u=Q.whave,l=Q.wnext,g=Q.window,h=Q.hold,p=Q.bits,C=Q.lencode,I=Q.distcode,E=(1<<Q.lenbits)-1,v=(1<<Q.distbits)-1;e:do{p<15&&(h+=T[r++]<<p,p+=8,h+=T[r++]<<p,p+=8),m=C[h&E];t:for(;;){if(M=m>>>24,h>>>=M,p-=M,M=m>>>16&255,M===0)q[n++]=m&65535;else if(M&16){O=m&65535,M&=15,M&&(p<M&&(h+=T[r++]<<p,p+=8),O+=h&(1<<M)-1,h>>>=M,p-=M),p<15&&(h+=T[r++]<<p,p+=8,h+=T[r++]<<p,p+=8),m=I[h&v];A:for(;;){if(M=m>>>24,h>>>=M,p-=M,M=m>>>16&255,M&16){if(x=m&65535,M&=15,p<M&&(h+=T[r++]<<p,p+=8,p<M&&(h+=T[r++]<<p,p+=8)),x+=h&(1<<M)-1,x>a){e.msg="invalid distance too far back",Q.mode=KI;break e}if(h>>>=M,p-=M,M=n-o,x>M){if(M=x-M,M>u&&Q.sane){e.msg="invalid distance too far back",Q.mode=KI;break e}if(P=0,D=g,l===0){if(P+=c-M,M<O){O-=M;do q[n++]=g[P++];while(--M);P=n-x,D=q}}else if(l<M){if(P+=c+l-M,M-=l,M<O){O-=M;do q[n++]=g[P++];while(--M);if(P=0,l<O){M=l,O-=M;do q[n++]=g[P++];while(--M);P=n-x,D=q}}}else if(P+=l-M,M<O){O-=M;do q[n++]=g[P++];while(--M);P=n-x,D=q}for(;O>2;)q[n++]=D[P++],q[n++]=D[P++],q[n++]=D[P++],O-=3;O&&(q[n++]=D[P++],O>1&&(q[n++]=D[P++]))}else{P=n-x;do q[n++]=q[P++],q[n++]=q[P++],q[n++]=q[P++],O-=3;while(O>2);O&&(q[n++]=q[P++],O>1&&(q[n++]=q[P++]))}}else if(M&64){e.msg="invalid distance code",Q.mode=KI;break e}else{m=I[(m&65535)+(h&(1<<M)-1)];continue A}break}}else if(M&64)if(M&32){Q.mode=zre;break e}else{e.msg="invalid literal/length code",Q.mode=KI;break e}else{m=C[(m&65535)+(h&(1<<M)-1)];continue t}break}}while(r<i&&n<s);O=p>>3,r-=O,p-=O<<3,h&=(1<<p)-1,e.next_in=r,e.next_out=n,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=n<s?257+(s-n):257-(n-s),Q.hold=h,Q.bits=p};const Jl=15,wO=852,SO=592,mO=0,Tm=1,MO=2,qre=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Vre=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Wre=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Zre=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Fp=(t,e,A,r,i,n,o,s)=>{const a=s.bits;let c=0,u=0,l=0,g=0,h=0,p=0,C=0,I=0,E=0,v=0,m,M,O,x,P,D=null,T;const q=new Uint16Array(Jl+1),Q=new Uint16Array(Jl+1);let R=null,G,k,te;for(c=0;c<=Jl;c++)q[c]=0;for(u=0;u<r;u++)q[e[A+u]]++;for(h=a,g=Jl;g>=1&&q[g]===0;g--);if(h>g&&(h=g),g===0)return i[n++]=1<<24|64<<16|0,i[n++]=1<<24|64<<16|0,s.bits=1,0;for(l=1;l<g&&q[l]===0;l++);for(h<l&&(h=l),I=1,c=1;c<=Jl;c++)if(I<<=1,I-=q[c],I<0)return-1;if(I>0&&(t===mO||g!==1))return-1;for(Q[1]=0,c=1;c<Jl;c++)Q[c+1]=Q[c]+q[c];for(u=0;u<r;u++)e[A+u]!==0&&(o[Q[e[A+u]]++]=u);if(t===mO?(D=R=o,T=20):t===Tm?(D=qre,R=Vre,T=257):(D=Wre,R=Zre,T=0),v=0,u=0,c=l,P=n,p=h,C=0,O=-1,E=1<<h,x=E-1,t===Tm&&E>wO||t===MO&&E>SO)return 1;for(;;){G=c-C,o[u]+1<T?(k=0,te=o[u]):o[u]>=T?(k=R[o[u]-T],te=D[o[u]-T]):(k=32+64,te=0),m=1<<c-C,M=1<<p,l=M;do M-=m,i[P+(v>>C)+M]=G<<24|k<<16|te|0;while(M!==0);for(m=1<<c-1;v&m;)m>>=1;if(m!==0?(v&=m-1,v+=m):v=0,u++,--q[c]===0){if(c===g)break;c=e[A+o[u]]}if(c>h&&(v&x)!==O){for(C===0&&(C=h),P+=l,p=c-C,I=1<<p;p+C<g&&(I-=q[p+C],!(I<=0));)p++,I<<=1;if(E+=1<<p,t===Tm&&E>wO||t===MO&&E>SO)return 1;O=v&x,i[O]=h<<24|p<<16|P-n|0}}return v!==0&&(i[P+v]=c-C<<24|64<<16|0),s.bits=h,0};const Xre=0,yO=1,QO=2,{Z_FINISH:RO,Z_BLOCK:_re,Z_TREES:kI,Z_OK:iu,Z_STREAM_END:$re,Z_NEED_DICT:eie,Z_STREAM_ERROR:qn,Z_DATA_ERROR:DO,Z_MEM_ERROR:TO,Z_BUF_ERROR:tie,Z_DEFLATED:UO}=Mp,PI=16180,LO=16181,FO=16182,OO=16183,bO=16184,xO=16185,NO=16186,KO=16187,kO=16188,PO=16189,GI=16190,Qo=16191,Um=16192,GO=16193,Lm=16194,jO=16195,YO=16196,HO=16197,zO=16198,jI=16199,YI=16200,JO=16201,qO=16202,VO=16203,WO=16204,ZO=16205,Fm=16206,XO=16207,_O=16208,qA=16209,$O=16210,eb=16211,Aie=852,rie=592,iie=15,tb=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function nie(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const nu=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<PI||e.mode>eb?1:0},Ab=t=>{if(nu(t))return qn;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=PI,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Aie),e.distcode=e.distdyn=new Int32Array(rie),e.sane=1,e.back=-1,iu},rb=t=>{if(nu(t))return qn;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ab(t)},ib=(t,e)=>{let A;if(nu(t))return qn;const r=t.state;return e<0?(A=0,e=-e):(A=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?qn:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=A,r.wbits=e,rb(t))},nb=(t,e)=>{if(!t)return qn;const A=new nie;t.state=A,A.strm=t,A.window=null,A.mode=PI;const r=ib(t,e);return r!==iu&&(t.state=null),r},sie=t=>nb(t,iie);let sb=!0,Om,bm;const oie=t=>{if(sb){Om=new Int32Array(512),bm=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Fp(yO,t.lens,0,288,Om,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Fp(QO,t.lens,0,32,bm,0,t.work,{bits:5}),sb=!1}t.lencode=Om,t.lenbits=9,t.distcode=bm,t.distbits=5},ob=(t,e,A,r)=>{let i;const n=t.state;return n.window===null&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(e.subarray(A-n.wsize,A),0),n.wnext=0,n.whave=n.wsize):(i=n.wsize-n.wnext,i>r&&(i=r),n.window.set(e.subarray(A-r,A-r+i),n.wnext),r-=i,r?(n.window.set(e.subarray(A-r,A),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=i,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=i))),0},aie=(t,e)=>{let A,r,i,n,o,s,a,c,u,l,g,h,p,C,I=0,E,v,m,M,O,x,P,D;const T=new Uint8Array(4);let q,Q;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(nu(t)||!t.output||!t.input&&t.avail_in!==0)return qn;A=t.state,A.mode===Qo&&(A.mode=Um),o=t.next_out,i=t.output,a=t.avail_out,n=t.next_in,r=t.input,s=t.avail_in,c=A.hold,u=A.bits,l=s,g=a,D=iu;e:for(;;)switch(A.mode){case PI:if(A.wrap===0){A.mode=Um;break}for(;u<16;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(A.wrap&2&&c===35615){A.wbits===0&&(A.wbits=15),A.check=0,T[0]=c&255,T[1]=c>>>8&255,A.check=Xr(A.check,T,2,0),c=0,u=0,A.mode=LO;break}if(A.head&&(A.head.done=!1),!(A.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",A.mode=qA;break}if((c&15)!==UO){t.msg="unknown compression method",A.mode=qA;break}if(c>>>=4,u-=4,P=(c&15)+8,A.wbits===0&&(A.wbits=P),P>15||P>A.wbits){t.msg="invalid window size",A.mode=qA;break}A.dmax=1<<A.wbits,A.flags=0,t.adler=A.check=1,A.mode=c&512?PO:Qo,c=0,u=0;break;case LO:for(;u<16;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(A.flags=c,(A.flags&255)!==UO){t.msg="unknown compression method",A.mode=qA;break}if(A.flags&57344){t.msg="unknown header flags set",A.mode=qA;break}A.head&&(A.head.text=c>>8&1),A.flags&512&&A.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,A.check=Xr(A.check,T,2,0)),c=0,u=0,A.mode=FO;case FO:for(;u<32;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}A.head&&(A.head.time=c),A.flags&512&&A.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,T[2]=c>>>16&255,T[3]=c>>>24&255,A.check=Xr(A.check,T,4,0)),c=0,u=0,A.mode=OO;case OO:for(;u<16;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}A.head&&(A.head.xflags=c&255,A.head.os=c>>8),A.flags&512&&A.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,A.check=Xr(A.check,T,2,0)),c=0,u=0,A.mode=bO;case bO:if(A.flags&1024){for(;u<16;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}A.length=c,A.head&&(A.head.extra_len=c),A.flags&512&&A.wrap&4&&(T[0]=c&255,T[1]=c>>>8&255,A.check=Xr(A.check,T,2,0)),c=0,u=0}else A.head&&(A.head.extra=null);A.mode=xO;case xO:if(A.flags&1024&&(h=A.length,h>s&&(h=s),h&&(A.head&&(P=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Uint8Array(A.head.extra_len)),A.head.extra.set(r.subarray(n,n+h),P)),A.flags&512&&A.wrap&4&&(A.check=Xr(A.check,r,h,n)),s-=h,n+=h,A.length-=h),A.length))break e;A.length=0,A.mode=NO;case NO:if(A.flags&2048){if(s===0)break e;h=0;do P=r[n+h++],A.head&&P&&A.length<65536&&(A.head.name+=String.fromCharCode(P));while(P&&h<s);if(A.flags&512&&A.wrap&4&&(A.check=Xr(A.check,r,h,n)),s-=h,n+=h,P)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=KO;case KO:if(A.flags&4096){if(s===0)break e;h=0;do P=r[n+h++],A.head&&P&&A.length<65536&&(A.head.comment+=String.fromCharCode(P));while(P&&h<s);if(A.flags&512&&A.wrap&4&&(A.check=Xr(A.check,r,h,n)),s-=h,n+=h,P)break e}else A.head&&(A.head.comment=null);A.mode=kO;case kO:if(A.flags&512){for(;u<16;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(A.wrap&4&&c!==(A.check&65535)){t.msg="header crc mismatch",A.mode=qA;break}c=0,u=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),t.adler=A.check=0,A.mode=Qo;break;case PO:for(;u<32;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}t.adler=A.check=tb(c),c=0,u=0,A.mode=GI;case GI:if(A.havedict===0)return t.next_out=o,t.avail_out=a,t.next_in=n,t.avail_in=s,A.hold=c,A.bits=u,eie;t.adler=A.check=1,A.mode=Qo;case Qo:if(e===_re||e===kI)break e;case Um:if(A.last){c>>>=u&7,u-=u&7,A.mode=Fm;break}for(;u<3;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}switch(A.last=c&1,c>>>=1,u-=1,c&3){case 0:A.mode=GO;break;case 1:if(oie(A),A.mode=jI,e===kI){c>>>=2,u-=2;break e}break;case 2:A.mode=YO;break;case 3:t.msg="invalid block type",A.mode=qA}c>>>=2,u-=2;break;case GO:for(c>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",A.mode=qA;break}if(A.length=c&65535,c=0,u=0,A.mode=Lm,e===kI)break e;case Lm:A.mode=jO;case jO:if(h=A.length,h){if(h>s&&(h=s),h>a&&(h=a),h===0)break e;i.set(r.subarray(n,n+h),o),s-=h,n+=h,a-=h,o+=h,A.length-=h;break}A.mode=Qo;break;case YO:for(;u<14;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(A.nlen=(c&31)+257,c>>>=5,u-=5,A.ndist=(c&31)+1,c>>>=5,u-=5,A.ncode=(c&15)+4,c>>>=4,u-=4,A.nlen>286||A.ndist>30){t.msg="too many length or distance symbols",A.mode=qA;break}A.have=0,A.mode=HO;case HO:for(;A.have<A.ncode;){for(;u<3;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}A.lens[R[A.have++]]=c&7,c>>>=3,u-=3}for(;A.have<19;)A.lens[R[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,q={bits:A.lenbits},D=Fp(Xre,A.lens,0,19,A.lencode,0,A.work,q),A.lenbits=q.bits,D){t.msg="invalid code lengths set",A.mode=qA;break}A.have=0,A.mode=zO;case zO:for(;A.have<A.nlen+A.ndist;){for(;I=A.lencode[c&(1<<A.lenbits)-1],E=I>>>24,v=I>>>16&255,m=I&65535,!(E<=u);){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(m<16)c>>>=E,u-=E,A.lens[A.have++]=m;else{if(m===16){for(Q=E+2;u<Q;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(c>>>=E,u-=E,A.have===0){t.msg="invalid bit length repeat",A.mode=qA;break}P=A.lens[A.have-1],h=3+(c&3),c>>>=2,u-=2}else if(m===17){for(Q=E+3;u<Q;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}c>>>=E,u-=E,P=0,h=3+(c&7),c>>>=3,u-=3}else{for(Q=E+7;u<Q;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}c>>>=E,u-=E,P=0,h=11+(c&127),c>>>=7,u-=7}if(A.have+h>A.nlen+A.ndist){t.msg="invalid bit length repeat",A.mode=qA;break}for(;h--;)A.lens[A.have++]=P}}if(A.mode===qA)break;if(A.lens[256]===0){t.msg="invalid code -- missing end-of-block",A.mode=qA;break}if(A.lenbits=9,q={bits:A.lenbits},D=Fp(yO,A.lens,0,A.nlen,A.lencode,0,A.work,q),A.lenbits=q.bits,D){t.msg="invalid literal/lengths set",A.mode=qA;break}if(A.distbits=6,A.distcode=A.distdyn,q={bits:A.distbits},D=Fp(QO,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,q),A.distbits=q.bits,D){t.msg="invalid distances set",A.mode=qA;break}if(A.mode=jI,e===kI)break e;case jI:A.mode=YI;case YI:if(s>=6&&a>=258){t.next_out=o,t.avail_out=a,t.next_in=n,t.avail_in=s,A.hold=c,A.bits=u,Jre(t,g),o=t.next_out,i=t.output,a=t.avail_out,n=t.next_in,r=t.input,s=t.avail_in,c=A.hold,u=A.bits,A.mode===Qo&&(A.back=-1);break}for(A.back=0;I=A.lencode[c&(1<<A.lenbits)-1],E=I>>>24,v=I>>>16&255,m=I&65535,!(E<=u);){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(v&&!(v&240)){for(M=E,O=v,x=m;I=A.lencode[x+((c&(1<<M+O)-1)>>M)],E=I>>>24,v=I>>>16&255,m=I&65535,!(M+E<=u);){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}c>>>=M,u-=M,A.back+=M}if(c>>>=E,u-=E,A.back+=E,A.length=m,v===0){A.mode=ZO;break}if(v&32){A.back=-1,A.mode=Qo;break}if(v&64){t.msg="invalid literal/length code",A.mode=qA;break}A.extra=v&15,A.mode=JO;case JO:if(A.extra){for(Q=A.extra;u<Q;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}A.length+=c&(1<<A.extra)-1,c>>>=A.extra,u-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=qO;case qO:for(;I=A.distcode[c&(1<<A.distbits)-1],E=I>>>24,v=I>>>16&255,m=I&65535,!(E<=u);){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(!(v&240)){for(M=E,O=v,x=m;I=A.distcode[x+((c&(1<<M+O)-1)>>M)],E=I>>>24,v=I>>>16&255,m=I&65535,!(M+E<=u);){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}c>>>=M,u-=M,A.back+=M}if(c>>>=E,u-=E,A.back+=E,v&64){t.msg="invalid distance code",A.mode=qA;break}A.offset=m,A.extra=v&15,A.mode=VO;case VO:if(A.extra){for(Q=A.extra;u<Q;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}A.offset+=c&(1<<A.extra)-1,c>>>=A.extra,u-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){t.msg="invalid distance too far back",A.mode=qA;break}A.mode=WO;case WO:if(a===0)break e;if(h=g-a,A.offset>h){if(h=A.offset-h,h>A.whave&&A.sane){t.msg="invalid distance too far back",A.mode=qA;break}h>A.wnext?(h-=A.wnext,p=A.wsize-h):p=A.wnext-h,h>A.length&&(h=A.length),C=A.window}else C=i,p=o-A.offset,h=A.length;h>a&&(h=a),a-=h,A.length-=h;do i[o++]=C[p++];while(--h);A.length===0&&(A.mode=YI);break;case ZO:if(a===0)break e;i[o++]=A.length,a--,A.mode=YI;break;case Fm:if(A.wrap){for(;u<32;){if(s===0)break e;s--,c|=r[n++]<<u,u+=8}if(g-=a,t.total_out+=g,A.total+=g,A.wrap&4&&g&&(t.adler=A.check=A.flags?Xr(A.check,i,g,o-g):mp(A.check,i,g,o-g)),g=a,A.wrap&4&&(A.flags?c:tb(c))!==A.check){t.msg="incorrect data check",A.mode=qA;break}c=0,u=0}A.mode=XO;case XO:if(A.wrap&&A.flags){for(;u<32;){if(s===0)break e;s--,c+=r[n++]<<u,u+=8}if(A.wrap&4&&c!==(A.total&4294967295)){t.msg="incorrect length check",A.mode=qA;break}c=0,u=0}A.mode=_O;case _O:D=$re;break e;case qA:D=DO;break e;case $O:return TO;case eb:default:return qn}return t.next_out=o,t.avail_out=a,t.next_in=n,t.avail_in=s,A.hold=c,A.bits=u,(A.wsize||g!==t.avail_out&&A.mode<qA&&(A.mode<Fm||e!==RO))&&ob(t,t.output,t.next_out,g-t.avail_out),l-=t.avail_in,g-=t.avail_out,t.total_in+=l,t.total_out+=g,A.total+=g,A.wrap&4&&g&&(t.adler=A.check=A.flags?Xr(A.check,i,g,t.next_out-g):mp(A.check,i,g,t.next_out-g)),t.data_type=A.bits+(A.last?64:0)+(A.mode===Qo?128:0)+(A.mode===jI||A.mode===Lm?256:0),(l===0&&g===0||e===RO)&&D===iu&&(D=tie),D},cie=t=>{if(nu(t))return qn;let e=t.state;return e.window&&(e.window=null),t.state=null,iu},uie=(t,e)=>{if(nu(t))return qn;const A=t.state;return A.wrap&2?(A.head=e,e.done=!1,iu):qn},lie=(t,e)=>{const A=e.length;let r,i,n;return nu(t)||(r=t.state,r.wrap!==0&&r.mode!==GI)?qn:r.mode===GI&&(i=1,i=mp(i,e,A,0),i!==r.check)?DO:(n=ob(t,e,A,A),n?(r.mode=$O,TO):(r.havedict=1,iu))};var hie=rb,gie=ib,die=Ab,pie=sie,fie=nb,Eie=aie,Cie=cie,Iie=uie,Bie=lie,vie="pako inflate (from Nodeca project)",Ro={inflateReset:hie,inflateReset2:gie,inflateResetKeep:die,inflateInit:pie,inflateInit2:fie,inflate:Eie,inflateEnd:Cie,inflateGetHeader:Iie,inflateSetDictionary:Bie,inflateInfo:vie};function wie(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Sie=wie;const ab=Object.prototype.toString,{Z_NO_FLUSH:mie,Z_FINISH:Mie,Z_OK:Op,Z_STREAM_END:xm,Z_NEED_DICT:Nm,Z_STREAM_ERROR:yie,Z_DATA_ERROR:cb,Z_MEM_ERROR:Qie}=Mp;function bp(t){this.options=xI.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new BO,this.strm.avail_out=0;let A=Ro.inflateInit2(this.strm,e.windowBits);if(A!==Op)throw new Error(Pl[A]);if(this.header=new Sie,Ro.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Lp.string2buf(e.dictionary):ab.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(A=Ro.inflateSetDictionary(this.strm,e.dictionary),A!==Op)))throw new Error(Pl[A])}bp.prototype.push=function(t,e){const A=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let n,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?Mie:mie,ab.call(t)==="[object ArrayBuffer]"?A.input=new Uint8Array(t):A.input=t,A.next_in=0,A.avail_in=A.input.length;;){for(A.avail_out===0&&(A.output=new Uint8Array(r),A.next_out=0,A.avail_out=r),n=Ro.inflate(A,o),n===Nm&&i&&(n=Ro.inflateSetDictionary(A,i),n===Op?n=Ro.inflate(A,o):n===cb&&(n=Nm));A.avail_in>0&&n===xm&&A.state.wrap>0&&t[A.next_in]!==0;)Ro.inflateReset(A),n=Ro.inflate(A,o);switch(n){case yie:case cb:case Nm:case Qie:return this.onEnd(n),this.ended=!0,!1}if(s=A.avail_out,A.next_out&&(A.avail_out===0||n===xm))if(this.options.to==="string"){let a=Lp.utf8border(A.output,A.next_out),c=A.next_out-a,u=Lp.buf2string(A.output,a);A.next_out=c,A.avail_out=r-c,c&&A.output.set(A.output.subarray(a,a+c),0),this.onData(u)}else this.onData(A.output.length===A.next_out?A.output:A.output.subarray(0,A.next_out));if(!(n===Op&&s===0)){if(n===xm)return n=Ro.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(A.avail_in===0)break}}return!0},bp.prototype.onData=function(t){this.chunks.push(t)},bp.prototype.onEnd=function(t){t===Op&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=xI.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Km(t,e){const A=new bp(e);if(A.push(t),A.err)throw A.msg||Pl[A.err];return A.result}function Rie(t,e){return e=e||{},e.raw=!0,Km(t,e)}var Die=bp,Tie=Km,Uie=Rie,Lie=Km,Fie=Mp,Oie={Inflate:Die,inflate:Tie,inflateRaw:Uie,ungzip:Lie,constants:Fie};const{Inflate:bie,inflate:xie,inflateRaw:URe,ungzip:LRe}=Oie;var ub=bie,Nie=xie;const lb=[];for(let t=0;t<256;t++){let e=t;for(let A=0;A<8;A++)e&1?e=3988292384^e>>>1:e=e>>>1;lb[t]=e}const hb=4294967295;function Kie(t,e,A){let r=t;for(let i=0;i<A;i++)r=lb[(r^e[i])&255]^r>>>8;return r}function kie(t,e){return(Kie(hb,t,e)^hb)>>>0}function gb(t,e,A){const r=t.readUint32(),i=kie(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(i!==r)throw new Error(`CRC mismatch for chunk ${A}. Expected ${r}, found ${i}`)}function db(t,e,A){for(let r=0;r<A;r++)e[r]=t[r]}function pb(t,e,A,r){let i=0;for(;i<r;i++)e[i]=t[i];for(;i<A;i++)e[i]=t[i]+e[i-r]&255}function fb(t,e,A,r){let i=0;if(A.length===0)for(;i<r;i++)e[i]=t[i];else for(;i<r;i++)e[i]=t[i]+A[i]&255}function Eb(t,e,A,r,i){let n=0;if(A.length===0){for(;n<i;n++)e[n]=t[n];for(;n<r;n++)e[n]=t[n]+(e[n-i]>>1)&255}else{for(;n<i;n++)e[n]=t[n]+(A[n]>>1)&255;for(;n<r;n++)e[n]=t[n]+(e[n-i]+A[n]>>1)&255}}function Cb(t,e,A,r,i){let n=0;if(A.length===0){for(;n<i;n++)e[n]=t[n];for(;n<r;n++)e[n]=t[n]+e[n-i]&255}else{for(;n<i;n++)e[n]=t[n]+A[n]&255;for(;n<r;n++)e[n]=t[n]+Pie(e[n-i],A[n],A[n-i])&255}}function Pie(t,e,A){const r=t+e-A,i=Math.abs(r-t),n=Math.abs(r-e),o=Math.abs(r-A);return i<=n&&i<=o?t:n<=o?e:A}function Gie(t,e,A,r,i,n){switch(t){case 0:db(e,A,i);break;case 1:pb(e,A,i,n);break;case 2:fb(e,A,r,i);break;case 3:Eb(e,A,r,i,n);break;case 4:Cb(e,A,r,i,n);break;default:throw new Error(`Unsupported filter: ${t}`)}}const jie=new Uint16Array([255]),Yie=new Uint8Array(jie.buffer)[0]===255;function Hie(t){const{data:e,width:A,height:r,channels:i,depth:n}=t,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(n/8)*i,a=new Uint8Array(r*A*s);let c=0;for(let u=0;u<7;u++){const l=o[u],g=Math.ceil((A-l.x)/l.xStep),h=Math.ceil((r-l.y)/l.yStep);if(g<=0||h<=0)continue;const p=g*s,C=new Uint8Array(p);for(let I=0;I<h;I++){const E=e[c++],v=e.subarray(c,c+p);c+=p;const m=new Uint8Array(p);Gie(E,v,m,C,p,s),C.set(m);for(let M=0;M<g;M++){const O=l.x+M*l.xStep,x=l.y+I*l.yStep;if(!(O>=A||x>=r))for(let P=0;P<s;P++)a[(x*A+O)*s+P]=m[M*s+P]}}}if(n===16){const u=new Uint16Array(a.buffer);if(Yie)for(let l=0;l<u.length;l++)u[l]=zie(u[l]);return u}else return a}function zie(t){return(t&255)<<8|t>>8&255}const Jie=new Uint16Array([255]),qie=new Uint8Array(Jie.buffer)[0]===255,Vie=new Uint8Array(0);function Ib(t){const{data:e,width:A,height:r,channels:i,depth:n}=t,o=Math.ceil(n/8)*i,s=Math.ceil(n/8*i*A),a=new Uint8Array(r*s);let c=Vie,u=0,l,g;for(let h=0;h<r;h++){switch(l=e.subarray(u+1,u+1+s),g=a.subarray(h*s,(h+1)*s),e[u]){case 0:db(l,g,s);break;case 1:pb(l,g,s,o);break;case 2:fb(l,g,c,s);break;case 3:Eb(l,g,c,s,o);break;case 4:Cb(l,g,c,s,o);break;default:throw new Error(`Unsupported filter: ${e[u]}`)}c=g,u+=s+1}if(n===16){const h=new Uint16Array(a.buffer);if(qie)for(let p=0;p<h.length;p++)h[p]=Wie(h[p]);return h}else return a}function Wie(t){return(t&255)<<8|t>>8&255}const HI=Uint8Array.of(137,80,78,71,13,10,26,10);function Bb(t){if(!Zie(t.readBytes(HI.length)))throw new Error("wrong PNG signature")}function Zie(t){if(t.length<HI.length)return!1;for(let e=0;e<HI.length;e++)if(t[e]!==HI[e])return!1;return!0}const Xie="tEXt",_ie=0,vb=new TextDecoder("latin1");function $ie(t){if(tne(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const ene=/^[\u0000-\u00FF]*$/;function tne(t){if(!ene.test(t))throw new Error("invalid latin1 text")}function Ane(t,e,A){const r=wb(e);t[r]=rne(e,A-r.length-1)}function wb(t){for(t.mark();t.readByte()!==_ie;);const e=t.offset;t.reset();const A=vb.decode(t.readBytes(e-t.offset-1));return t.skip(1),$ie(A),A}function rne(t,e){return vb.decode(t.readBytes(e))}const yn={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},km={UNKNOWN:-1,DEFLATE:0},Sb={UNKNOWN:-1,ADAPTIVE:0},Pm={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},zI={NONE:0,BACKGROUND:1,PREVIOUS:2},Gm={SOURCE:0,OVER:1};class ine extends am{constructor(A,r={}){super(A);Ht(this,"_checkCrc");Ht(this,"_inflator");Ht(this,"_png");Ht(this,"_apng");Ht(this,"_end");Ht(this,"_hasPalette");Ht(this,"_palette");Ht(this,"_hasTransparency");Ht(this,"_transparency");Ht(this,"_compressionMethod");Ht(this,"_filterMethod");Ht(this,"_interlaceMethod");Ht(this,"_colorType");Ht(this,"_isAnimated");Ht(this,"_numberOfFrames");Ht(this,"_numberOfPlays");Ht(this,"_frames");Ht(this,"_writingDataChunks");const{checkCrc:i=!1}=r;this._checkCrc=i,this._inflator=new ub,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=km.UNKNOWN,this._filterMethod=Sb.UNKNOWN,this._interlaceMethod=Pm.UNKNOWN,this._colorType=yn.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(Bb(this);!this._end;){const A=this.readUint32(),r=this.readChars(4);this.decodeChunk(A,r)}return this.decodeImage(),this._png}decodeApng(){for(Bb(this);!this._end;){const A=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(A,r)}return this.decodeApngImage(),this._apng}decodeChunk(A,r){const i=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(A);break;case"IDAT":this.decodeIDAT(A);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(A);break;case"iCCP":this.decodeiCCP(A);break;case Xie:Ane(this._png.text,this,A);break;case"pHYs":this.decodepHYs();break;default:this.skip(A);break}if(this.offset-i!==A)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?gb(this,A+4,r):this.skip(4)}decodeApngChunk(A,r){const i=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(A);break;default:this.decodeChunk(A,r),this.offset=i+A;break}if(this.offset-i!==A)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?gb(this,A+4,r):this.skip(4)}decodeIHDR(){const A=this._png;A.width=this.readUint32(),A.height=this.readUint32(),A.depth=nne(this.readUint8());const r=this.readUint8();this._colorType=r;let i;switch(r){case yn.GREYSCALE:i=1;break;case yn.TRUECOLOUR:i=3;break;case yn.INDEXED_COLOUR:i=1;break;case yn.GREYSCALE_ALPHA:i=2;break;case yn.TRUECOLOUR_ALPHA:i=4;break;case yn.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==km.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const A={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(A)}decodePLTE(A){if(A%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${A}`);const r=A/3;this._hasPalette=!0;const i=[];this._palette=i;for(let n=0;n<r;n++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(A){this._writingDataChunks=!0;const r=A,i=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(A)}decodeFDAT(A){this._writingDataChunks=!0;let r=A,i=this.offset+this.byteOffset;if(i+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(A)}decodetRNS(A){switch(this._colorType){case yn.GREYSCALE:case yn.TRUECOLOUR:{if(A%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${A}`);if(A/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${A/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(A/2);for(let r=0;r<A/2;r++)this._transparency[r]=this.readUint16();break}case yn.INDEXED_COLOUR:{if(A>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${A} vs ${this._palette.length})`);let r=0;for(;r<A;r++){const i=this.readByte();this._palette[r].push(i)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case yn.UNKNOWN:case yn.GREYSCALE_ALPHA:case yn.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(A){const r=wb(this),i=this.readUint8();if(i!==km.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const n=this.readBytes(A-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:Nie(n)}}decodepHYs(){const A=this.readUint32(),r=this.readUint32(),i=this.readByte();this._png.resolution={x:A,y:r,unit:i}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let A=0;A<this._numberOfFrames;A++){const r={sequenceNumber:this._frames[A].sequenceNumber,delayNumber:this._frames[A].delayNumber,delayDenominator:this._frames[A].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},i=this._frames.at(A);if(i){if(i.data=Ib({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),A===0||i.xOffset===0&&i.yOffset===0&&i.width===this._png.width&&i.height===this._png.height)r.data=i.data;else{const n=this._apng.frames.at(A-1);this.disposeFrame(i,n,r),this.addFrameDataToCanvas(r,i)}this._apng.frames.push(r)}}return this._apng}disposeFrame(A,r,i){switch(A.disposeOp){case zI.NONE:break;case zI.BACKGROUND:for(let n=0;n<this._png.height;n++)for(let o=0;o<this._png.width;o++){const s=(n*A.width+o)*this._png.channels;for(let a=0;a<this._png.channels;a++)i.data[s+a]=0}break;case zI.PREVIOUS:i.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(A,r){const i=1<<this._png.depth,n=(o,s)=>{const a=((o+r.yOffset)*this._png.width+r.xOffset+s)*this._png.channels,c=(o*r.width+s)*this._png.channels;return{index:a,frameIndex:c}};switch(r.blendOp){case Gm.SOURCE:for(let o=0;o<r.height;o++)for(let s=0;s<r.width;s++){const{index:a,frameIndex:c}=n(o,s);for(let u=0;u<this._png.channels;u++)A.data[a+u]=r.data[c+u]}break;case Gm.OVER:for(let o=0;o<r.height;o++)for(let s=0;s<r.width;s++){const{index:a,frameIndex:c}=n(o,s);for(let u=0;u<this._png.channels;u++){const l=r.data[c+this._png.channels-1]/i,g=u%(this._png.channels-1)===0?1:r.data[c+u],h=Math.floor(l*g+(1-l)*A.data[a+u]);A.data[a+u]+=h}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const A=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==Sb.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Pm.NO_INTERLACE)this._png.data=Ib({data:A,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Pm.ADAM7)this._png.data=Hie({data:A,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const A=this._inflator.result,r=this._frames.at(-1);r?r.data=A:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:zI.NONE,blendOp:Gm.SOURCE,data:A}),this._inflator=new ub,this._writingDataChunks=!1}}function nne(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var mb;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(mb||(mb={}));function sne(t,e){return new ine(t,e).decode()}/** @license
37
37
  *
38
38
  * jsPDF - PDF Document creation from JavaScript
@@ -187,7 +187,7 @@ T* `):B.join(` Tj
187
187
  *
188
188
  * Licensed under the MIT License.
189
189
  * http://opensource.org/licenses/mit-license
190
- */function Cs(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function ix(t){function e(T){if(!T)throw Error("assert :P")}function A(T,q,Q){for(var R=0;4>R;R++)if(T[q+R]!=Q.charCodeAt(R))return!0;return!1}function r(T,q,Q,R,G){for(var k=0;k<G;k++)T[q+k]=Q[R+k]}function i(T,q,Q,R){for(var G=0;G<R;G++)T[q+G]=Q}function n(T){return new Int32Array(T)}function o(T,q){for(var Q=[],R=0;R<T;R++)Q.push(new q);return Q}function s(T,q){var Q=[];return function R(G,k,te){for(var X=te[k],ie=0;ie<X&&(G.push(te.length>k+1?[]:new q),!(te.length<k+1));ie++)R(G[ie],k+1,te)}(Q,0,T),Q}var a=function(){var T=this;function q(d,f){for(var w=1<<f-1>>>0;d&w;)w>>>=1;return w?(d&w-1)+w:d}function Q(d,f,w,y,F){e(!(y%w));do d[f+(y-=w)]=F;while(0<y)}function R(d,f,w,y,F){if(e(2328>=F),512>=F)var N=n(512);else if((N=n(F))==null)return 0;return function(K,H,V,$,pe,ye){var ee,Ie,Se=H,Le=1<<V,me=n(16),Fe=n(16);for(e(pe!=0),e($!=null),e(K!=null),e(0<V),Ie=0;Ie<pe;++Ie){if(15<$[Ie])return 0;++me[$[Ie]]}if(me[0]==pe)return 0;for(Fe[1]=0,ee=1;15>ee;++ee){if(me[ee]>1<<ee)return 0;Fe[ee+1]=Fe[ee]+me[ee]}for(Ie=0;Ie<pe;++Ie)ee=$[Ie],0<$[Ie]&&(ye[Fe[ee]++]=Ie);if(Fe[15]==1)return($=new G).g=0,$.value=ye[0],Q(K,Se,1,Le,$),Le;var be,qe=-1,je=Le-1,Et=0,lt=1,qt=1,dt=1<<V;for(Ie=0,ee=1,pe=2;ee<=V;++ee,pe<<=1){if(lt+=qt<<=1,0>(qt-=me[ee]))return 0;for(;0<me[ee];--me[ee])($=new G).g=ee,$.value=ye[Ie++],Q(K,Se+Et,pe,dt,$),Et=q(Et,ee)}for(ee=V+1,pe=2;15>=ee;++ee,pe<<=1){if(lt+=qt<<=1,0>(qt-=me[ee]))return 0;for(;0<me[ee];--me[ee]){if($=new G,(Et&je)!=qe){for(Se+=dt,be=1<<(qe=ee)-V;15>qe&&!(0>=(be-=me[qe]));)++qe,be<<=1;Le+=dt=1<<(be=qe-V),K[H+(qe=Et&je)].g=be+V,K[H+qe].value=Se-H-qe}$.g=ee-V,$.value=ye[Ie++],Q(K,Se+(Et>>V),pe,dt,$),Et=q(Et,ee)}}return lt!=2*Fe[15]-1?0:Le}(d,f,w,y,F,N)}function G(){this.value=this.g=0}function k(){this.value=this.g=0}function te(){this.G=o(5,G),this.H=n(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Vu,k)}function X(d,f,w,y){e(d!=null),e(f!=null),e(2147483648>y),d.Ca=254,d.I=0,d.b=-8,d.Ka=0,d.oa=f,d.pa=w,d.Jd=f,d.Yc=w+y,d.Zc=4<=y?w+y-4+1:w,ce(d)}function ie(d,f){for(var w=0;0<f--;)w|=de(d,128)<<f;return w}function W(d,f){var w=ie(d,f);return oe(d)?-w:w}function se(d,f,w,y){var F,N=0;for(e(d!=null),e(f!=null),e(4294967288>y),d.Sb=y,d.Ra=0,d.u=0,d.h=0,4<y&&(y=4),F=0;F<y;++F)N+=f[w+F]<<8*F;d.Ra=N,d.bb=y,d.oa=f,d.pa=w}function Be(d){for(;8<=d.u&&d.bb<d.Sb;)d.Ra>>>=8,d.Ra+=d.oa[d.pa+d.bb]<<oc-8>>>0,++d.bb,d.u-=8;re(d)&&(d.h=1,d.u=0)}function Ee(d,f){if(e(0<=f),!d.h&&f<=Un){var w=_(d)&Tn[f];return d.u+=f,Be(d),w}return d.h=1,d.u=0}function U(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function Y(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function _(d){return d.Ra>>>(d.u&oc-1)>>>0}function re(d){return e(d.bb<=d.Sb),d.h||d.bb==d.Sb&&d.u>oc}function ae(d,f){d.u=f,d.h=re(d)}function Z(d){d.u>=Xo&&(e(d.u>=Xo),Be(d))}function ce(d){e(d!=null&&d.oa!=null),d.pa<d.Zc?(d.I=(d.oa[d.pa++]|d.I<<8)>>>0,d.b+=8):(e(d!=null&&d.oa!=null),d.pa<d.Yc?(d.b+=8,d.I=d.oa[d.pa++]|d.I<<8):d.Ka?d.b=0:(d.I<<=8,d.b+=8,d.Ka=1))}function oe(d){return ie(d,1)}function de(d,f){var w=d.Ca;0>d.b&&ce(d);var y=d.b,F=w*f>>>8,N=(d.I>>>y>F)+0;for(N?(w-=F,d.I-=F+1<<y>>>0):w=F+1,y=w,F=0;256<=y;)F+=8,y>>=8;return y=7^F+ac[y],d.b-=y,d.Ca=(w<<y)-1,N}function De(d,f,w){d[f+0]=w>>24&255,d[f+1]=w>>16&255,d[f+2]=w>>8&255,d[f+3]=255&w}function j(d,f){return d[f+0]|d[f+1]<<8}function J(d,f){return j(d,f)|d[f+2]<<16}function z(d,f){return j(d,f)|j(d,f+2)<<16}function b(d,f){var w=1<<f;return e(d!=null),e(0<f),d.X=n(w),d.X==null?0:(d.Mb=32-f,d.Xa=f,1)}function Me(d,f){e(d!=null),e(f!=null),e(d.Xa==f.Xa),r(f.X,0,d.X,0,1<<f.Xa)}function Qe(){this.X=[],this.Xa=this.Mb=0}function Te(d,f,w,y){e(w!=null),e(y!=null);var F=w[0],N=y[0];return F==0&&(F=(d*N+f/2)/f),N==0&&(N=(f*F+d/2)/d),0>=F||0>=N?0:(w[0]=F,y[0]=N,1)}function Ce(d,f){return d+(1<<f)-1>>>f}function Re(d,f){return((4278255360&d)+(4278255360&f)>>>0&4278255360)+((16711935&d)+(16711935&f)>>>0&16711935)>>>0}function ve(d,f){T[f]=function(w,y,F,N,K,H,V){var $;for($=0;$<K;++$){var pe=T[d](H[V+$-1],F,N+$);H[V+$]=Re(w[y+$],pe)}}}function Ke(){this.ud=this.hd=this.jd=0}function Ue(d,f){return((4278124286&(d^f))>>>1)+(d&f)>>>0}function ke(d){return 0<=d&&256>d?d:0>d?0:255<d?255:void 0}function Ye(d,f){return ke(d+(d-f+.5>>1))}function Je(d,f,w){return Math.abs(f-w)-Math.abs(d-w)}function rt(d,f,w,y,F,N,K){for(y=N[K-1],w=0;w<F;++w)N[K+w]=y=Re(d[f+w],y)}function Ze(d,f,w,y,F){var N;for(N=0;N<w;++N){var K=d[f+N],H=K>>8&255,V=16711935&(V=(V=16711935&K)+((H<<16)+H));y[F+N]=(4278255360&K)+V>>>0}}function We(d,f){f.jd=255&d,f.hd=d>>8&255,f.ud=d>>16&255}function At(d,f,w,y,F,N){var K;for(K=0;K<y;++K){var H=f[w+K],V=H>>>8,$=H,pe=255&(pe=(pe=H>>>16)+((d.jd<<24>>24)*(V<<24>>24)>>>5));$=255&($=($+=(d.hd<<24>>24)*(V<<24>>24)>>>5)+((d.ud<<24>>24)*(pe<<24>>24)>>>5)),F[N+K]=(4278255360&H)+(pe<<16)+$}}function _e(d,f,w,y,F){T[f]=function(N,K,H,V,$,pe,ye,ee,Ie){for(V=ye;V<ee;++V)for(ye=0;ye<Ie;++ye)$[pe++]=F(H[y(N[K++])])},T[d]=function(N,K,H,V,$,pe,ye){var ee=8>>N.b,Ie=N.Ea,Se=N.K[0],Le=N.w;if(8>ee)for(N=(1<<N.b)-1,Le=(1<<ee)-1;K<H;++K){var me,Fe=0;for(me=0;me<Ie;++me)me&N||(Fe=y(V[$++])),pe[ye++]=F(Se[Fe&Le]),Fe>>=ee}else T["VP8LMapColor"+w](V,$,Se,Le,pe,ye,K,H,Ie)}}function It(d,f,w,y,F){for(w=f+w;f<w;){var N=d[f++];y[F++]=N>>16&255,y[F++]=N>>8&255,y[F++]=255&N}}function yt(d,f,w,y,F){for(w=f+w;f<w;){var N=d[f++];y[F++]=N>>16&255,y[F++]=N>>8&255,y[F++]=255&N,y[F++]=N>>24&255}}function tt(d,f,w,y,F){for(w=f+w;f<w;){var N=(K=d[f++])>>16&240|K>>12&15,K=240&K|K>>28&15;y[F++]=N,y[F++]=K}}function et(d,f,w,y,F){for(w=f+w;f<w;){var N=(K=d[f++])>>16&248|K>>13&7,K=K>>5&224|K>>3&31;y[F++]=N,y[F++]=K}}function St(d,f,w,y,F){for(w=f+w;f<w;){var N=d[f++];y[F++]=255&N,y[F++]=N>>8&255,y[F++]=N>>16&255}}function ct(d,f,w,y,F,N){if(N==0)for(w=f+w;f<w;)De(y,((N=d[f++])[0]>>24|N[1]>>8&65280|N[2]<<8&16711680|N[3]<<24)>>>0),F+=32;else r(y,F,d,f,w)}function Rt(d,f){T[f][0]=T[d+"0"],T[f][1]=T[d+"1"],T[f][2]=T[d+"2"],T[f][3]=T[d+"3"],T[f][4]=T[d+"4"],T[f][5]=T[d+"5"],T[f][6]=T[d+"6"],T[f][7]=T[d+"7"],T[f][8]=T[d+"8"],T[f][9]=T[d+"9"],T[f][10]=T[d+"10"],T[f][11]=T[d+"11"],T[f][12]=T[d+"12"],T[f][13]=T[d+"13"],T[f][14]=T[d+"0"],T[f][15]=T[d+"0"]}function Ge(d){return d==Z1||d==X1||d==Bw||d==_1}function Jt(){this.eb=[],this.size=this.A=this.fb=0}function oA(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Qt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Jt,this.f.kb=new oA,this.sd=null}function Xe(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function AA(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function dn(d){return alert("todo:WebPSamplerProcessPlane"),d.T}function $t(d,f){var w=d.T,y=f.ba.f.RGBA,F=y.eb,N=y.fb+d.ka*y.A,K=ss[f.ba.S],H=d.y,V=d.O,$=d.f,pe=d.N,ye=d.ea,ee=d.W,Ie=f.cc,Se=f.dc,Le=f.Mc,me=f.Nc,Fe=d.ka,be=d.ka+d.T,qe=d.U,je=qe+1>>1;for(Fe==0?K(H,V,null,null,$,pe,ye,ee,$,pe,ye,ee,F,N,null,null,qe):(K(f.ec,f.fc,H,V,Ie,Se,Le,me,$,pe,ye,ee,F,N-y.A,F,N,qe),++w);Fe+2<be;Fe+=2)Ie=$,Se=pe,Le=ye,me=ee,pe+=d.Rc,ee+=d.Rc,N+=2*y.A,K(H,(V+=2*d.fa)-d.fa,H,V,Ie,Se,Le,me,$,pe,ye,ee,F,N-y.A,F,N,qe);return V+=d.fa,d.j+be<d.o?(r(f.ec,f.fc,H,V,qe),r(f.cc,f.dc,$,pe,je),r(f.Mc,f.Nc,ye,ee,je),w--):1&be||K(H,V,null,null,$,pe,ye,ee,$,pe,ye,ee,F,N+y.A,null,null,qe),w}function Tr(d,f,w){var y=d.F,F=[d.J];if(y!=null){var N=d.U,K=f.ba.S,H=K==Iw||K==Bw;f=f.ba.f.RGBA;var V=[0],$=d.ka;V[0]=d.T,d.Kb&&($==0?--V[0]:(--$,F[0]-=d.width),d.j+d.ka+d.T==d.o&&(V[0]=d.o-d.j-$));var pe=f.eb;$=f.fb+$*f.A,d=fG(y,F[0],d.width,N,V,pe,$+(H?0:3),f.A),e(w==V),d&&Ge(K)&&tE(pe,$,H,N,V,f.A)}return 0}function Ni(d){var f=d.ma,w=f.ba.S,y=11>w,F=w==Ew||w==Cw||w==Iw||w==W1||w==12||Ge(w);if(f.memory=null,f.Ib=null,f.Jb=null,f.Nd=null,!qf(f.Oa,d,F?11:12))return 0;if(F&&Ge(w)&&lw(),d.da)alert("todo:use_scaling");else{if(y){if(f.Ib=dn,d.Kb){if(w=d.U+1>>1,f.memory=n(d.U+2*w),f.memory==null)return 0;f.ec=f.memory,f.fc=0,f.cc=f.ec,f.dc=f.fc+d.U,f.Mc=f.cc,f.Nc=f.dc+w,f.Ib=$t,lw()}}else alert("todo:EmitYUV");F&&(f.Jb=Tr,y&&As())}if(y&&!FG){for(d=0;256>d;++d)bQe[d]=89858*(d-128)+ww>>vw,KQe[d]=-22014*(d-128)+ww,NQe[d]=-45773*(d-128),xQe[d]=113618*(d-128)+ww>>vw;for(d=rE;d<tR;++d)f=76283*(d-16)+ww>>vw,kQe[d-rE]=cr(f,255),PQe[d-rE]=cr(f+8>>4,15);FG=1}return 1}function Bt(d){var f=d.ma,w=d.U,y=d.T;return e(!(1&d.ka)),0>=w||0>=y?0:(w=f.Ib(d,f),f.Jb!=null&&f.Jb(d,f,w),f.Dc+=w,1)}function Ur(d){d.ma.memory=null}function Ei(d,f,w,y){return Ee(d,8)!=47?0:(f[0]=Ee(d,14)+1,w[0]=Ee(d,14)+1,y[0]=Ee(d,1),Ee(d,3)!=0?0:!d.h)}function ti(d,f){if(4>d)return d+1;var w=d-2>>1;return(2+(1&d)<<w)+Ee(f,w)+1}function Ai(d,f){return 120<f?f-120:1<=(w=((w=vQe[f-1])>>4)*d+(8-(15&w)))?w:1;var w}function iA(d,f,w){var y=_(w),F=d[f+=255&y].g-8;return 0<F&&(ae(w,w.u+8),y=_(w),f+=d[f].value,f+=y&(1<<F)-1),ae(w,w.u+d[f].g),d[f].value}function yA(d,f,w){return w.g+=d.g,w.value+=d.value<<f>>>0,e(8>=w.g),d.g}function HA(d,f,w){var y=d.xc;return e((f=y==0?0:d.vc[d.md*(w>>y)+(f>>y)])<d.Wb),d.Ya[f]}function pn(d,f,w,y){var F=d.ab,N=d.c*f,K=d.C;f=K+f;var H=w,V=y;for(y=d.Ta,w=d.Ua;0<F--;){var $=d.gc[F],pe=K,ye=f,ee=H,Ie=V,Se=(V=y,H=w,$.Ea);switch(e(pe<ye),e(ye<=$.nc),$.hc){case 2:vr(ee,Ie,(ye-pe)*Se,V,H);break;case 0:var Le=pe,me=ye,Fe=V,be=H,qe=(dt=$).Ea;Le==0&&(Wf(ee,Ie,null,null,1,Fe,be),rt(ee,Ie+1,0,0,qe-1,Fe,be+1),Ie+=qe,be+=qe,++Le);for(var je=1<<dt.b,Et=je-1,lt=Ce(qe,dt.b),qt=dt.K,dt=dt.w+(Le>>dt.b)*lt;Le<me;){var hA=qt,Hr=dt,Vt=1;for(Nh(ee,Ie,Fe,be-qe,1,Fe,be);Vt<qe;){var pt=(Vt&~Et)+je;pt>qe&&(pt=qe),(0,Xf[hA[Hr++]>>8&15])(ee,Ie+ +Vt,Fe,be+Vt-qe,pt-Vt,Fe,be+Vt),Vt=pt}Ie+=qe,be+=qe,++Le&Et||(dt+=lt)}ye!=$.nc&&r(V,H-Se,V,H+(ye-pe-1)*Se,Se);break;case 1:for(Se=ee,me=Ie,qe=(ee=$.Ea)-(be=ee&~(Fe=(Ie=1<<$.b)-1)),Le=Ce(ee,$.b),je=$.K,$=$.w+(pe>>$.b)*Le;pe<ye;){for(Et=je,lt=$,qt=new Ke,dt=me+be,hA=me+ee;me<dt;)We(Et[lt++],qt),_f(qt,Se,me,Ie,V,H),me+=Ie,H+=Ie;me<hA&&(We(Et[lt++],qt),_f(qt,Se,me,qe,V,H),me+=qe,H+=qe),++pe&Fe||($+=Le)}break;case 3:if(ee==V&&Ie==H&&0<$.b){for(me=V,ee=Se=H+(ye-pe)*Se-(be=(ye-pe)*Ce($.Ea,$.b)),Ie=V,Fe=H,Le=[],be=(qe=be)-1;0<=be;--be)Le[be]=Ie[Fe+be];for(be=qe-1;0<=be;--be)me[ee+be]=Le[be];gw($,pe,ye,V,Se,V,H)}else gw($,pe,ye,ee,Ie,V,H)}H=y,V=w}V!=w&&r(y,w,H,V,N)}function ri(d,f){var w=d.V,y=d.Ba+d.c*d.C,F=f-d.C;if(e(f<=d.l.o),e(16>=F),0<F){var N=d.l,K=d.Ta,H=d.Ua,V=N.width;if(pn(d,F,w,y),F=H=[H],e((w=d.C)<(y=f)),e(N.v<N.va),y>N.o&&(y=N.o),w<N.j){var $=N.j-w;w=N.j,F[0]+=$*V}if(w>=y?w=0:(F[0]+=4*N.v,N.ka=w-N.j,N.U=N.va-N.v,N.T=y-w,w=1),w){if(H=H[0],11>(w=d.ca).S){var pe=w.f.RGBA,ye=(y=w.S,F=N.U,N=N.T,$=pe.eb,pe.A),ee=N;for(pe=pe.fb+d.Ma*pe.A;0<ee--;){var Ie=K,Se=H,Le=F,me=$,Fe=pe;switch(y){case fw:$f(Ie,Se,Le,me,Fe);break;case Ew:cc(Ie,Se,Le,me,Fe);break;case Z1:cc(Ie,Se,Le,me,Fe),tE(me,Fe,0,Le,1,0);break;case SG:Wu(Ie,Se,Le,me,Fe);break;case Cw:ct(Ie,Se,Le,me,Fe,1);break;case X1:ct(Ie,Se,Le,me,Fe,1),tE(me,Fe,0,Le,1,0);break;case Iw:ct(Ie,Se,Le,me,Fe,0);break;case Bw:ct(Ie,Se,Le,me,Fe,0),tE(me,Fe,1,Le,1,0);break;case W1:uc(Ie,Se,Le,me,Fe);break;case _1:uc(Ie,Se,Le,me,Fe),pG(me,Fe,Le,1,0);break;case mG:lc(Ie,Se,Le,me,Fe);break;default:e(0)}H+=V,pe+=ye}d.Ma+=N}else alert("todo:EmitRescaledRowsYUVA");e(d.Ma<=w.height)}}d.C=f,e(d.C<=d.i)}function ii(d){var f;if(0<d.ua)return 0;for(f=0;f<d.Wb;++f){var w=d.Ya[f].G,y=d.Ya[f].H;if(0<w[1][y[1]+0].g||0<w[2][y[2]+0].g||0<w[3][y[3]+0].g)return 0}return 1}function or(d,f,w,y,F,N){if(d.Z!=0){var K=d.qd,H=d.rd;for(e(dc[d.Z]!=null);f<w;++f)dc[d.Z](K,H,y,F,y,F,N),K=y,H=F,F+=N;d.qd=K,d.rd=H}}function Ki(d,f){var w=d.l.ma,y=w.Z==0||w.Z==1?d.l.j:d.C;if(y=d.C<y?y:d.C,e(f<=d.l.o),f>y){var F=d.l.width,N=w.ca,K=w.tb+F*y,H=d.V,V=d.Ba+d.c*y,$=d.gc;e(d.ab==1),e($[0].hc==3),ro($[0],y,f,H,V,N,K),or(w,y,f,N,K,F)}d.C=d.Ma=f}function ki(d,f,w,y,F,N,K){var H=d.$/y,V=d.$%y,$=d.m,pe=d.s,ye=w+d.$,ee=ye;F=w+y*F;var Ie=w+y*N,Se=280+pe.ua,Le=d.Pb?H:16777216,me=0<pe.ua?pe.Wa:null,Fe=pe.wc,be=ye<Ie?HA(pe,V,H):null;e(d.C<N),e(Ie<=F);var qe=!1;e:for(;;){for(;qe||ye<Ie;){var je=0;if(H>=Le){var Et=ye-w;e((Le=d).Pb),Le.wd=Le.m,Le.xd=Et,0<Le.s.ua&&Me(Le.s.Wa,Le.s.vb),Le=H+SQe}if(V&Fe||(be=HA(pe,V,H)),e(be!=null),be.Qb&&(f[ye]=be.qb,qe=!0),!qe)if(Z($),be.jc){je=$,Et=f;var lt=ye,qt=be.pd[_(je)&Vu-1];e(be.jc),256>qt.g?(ae(je,je.u+qt.g),Et[lt]=qt.value,je=0):(ae(je,je.u+qt.g-256),e(256<=qt.value),je=qt.value),je==0&&(qe=!0)}else je=iA(be.G[0],be.H[0],$);if($.h)break;if(qe||256>je){if(!qe)if(be.nd)f[ye]=(be.qb|je<<8)>>>0;else{if(Z($),qe=iA(be.G[1],be.H[1],$),Z($),Et=iA(be.G[2],be.H[2],$),lt=iA(be.G[3],be.H[3],$),$.h)break;f[ye]=(lt<<24|qe<<16|je<<8|Et)>>>0}if(qe=!1,++ye,++V>=y&&(V=0,++H,K!=null&&H<=N&&!(H%16)&&K(d,H),me!=null))for(;ee<ye;)je=f[ee++],me.X[(506832829*je&4294967295)>>>me.Mb]=je}else if(280>je){if(je=ti(je-256,$),Et=iA(be.G[4],be.H[4],$),Z($),Et=Ai(y,Et=ti(Et,$)),$.h)break;if(ye-w<Et||F-ye<je)break e;for(lt=0;lt<je;++lt)f[ye+lt]=f[ye+lt-Et];for(ye+=je,V+=je;V>=y;)V-=y,++H,K!=null&&H<=N&&!(H%16)&&K(d,H);if(e(ye<=F),V&Fe&&(be=HA(pe,V,H)),me!=null)for(;ee<ye;)je=f[ee++],me.X[(506832829*je&4294967295)>>>me.Mb]=je}else{if(!(je<Se))break e;for(qe=je-280,e(me!=null);ee<ye;)je=f[ee++],me.X[(506832829*je&4294967295)>>>me.Mb]=je;je=ye,e(!(qe>>>(Et=me).Xa)),f[je]=Et.X[qe],qe=!0}qe||e($.h==re($))}if(d.Pb&&$.h&&ye<F)e(d.m.h),d.a=5,d.m=d.wd,d.$=d.xd,0<d.s.ua&&Me(d.s.vb,d.s.Wa);else{if($.h)break e;K!=null&&K(d,H>N?N:H),d.a=0,d.$=ye-w}return 1}return d.a=3,0}function Lr(d){e(d!=null),d.vc=null,d.yc=null,d.Ya=null;var f=d.Wa;f!=null&&(f.X=null),d.vb=null,e(d!=null)}function Ne(){var d=new ft;return d==null?null:(d.a=0,d.xb=QG,Rt("Predictor","VP8LPredictors"),Rt("Predictor","VP8LPredictors_C"),Rt("PredictorAdd","VP8LPredictorsAdd"),Rt("PredictorAdd","VP8LPredictorsAdd_C"),vr=Ze,_f=At,$f=It,cc=yt,uc=tt,lc=et,Wu=St,T.VP8LMapColor32b=Ao,T.VP8LMapColor8b=Zf,d)}function FA(d,f,w,y,F){var N=1,K=[d],H=[f],V=y.m,$=y.s,pe=null,ye=0;e:for(;;){if(w)for(;N&&Ee(V,1);){var ee=K,Ie=H,Se=y,Le=1,me=Se.m,Fe=Se.gc[Se.ab],be=Ee(me,2);if(Se.Oc&1<<be)N=0;else{switch(Se.Oc|=1<<be,Fe.hc=be,Fe.Ea=ee[0],Fe.nc=Ie[0],Fe.K=[null],++Se.ab,e(4>=Se.ab),be){case 0:case 1:Fe.b=Ee(me,3)+2,Le=FA(Ce(Fe.Ea,Fe.b),Ce(Fe.nc,Fe.b),0,Se,Fe.K),Fe.K=Fe.K[0];break;case 3:var qe,je=Ee(me,8)+1,Et=16<je?0:4<je?1:2<je?2:3;if(ee[0]=Ce(Fe.Ea,Et),Fe.b=Et,qe=Le=FA(je,1,0,Se,Fe.K)){var lt,qt=je,dt=Fe,hA=1<<(8>>dt.b),Hr=n(hA);if(Hr==null)qe=0;else{var Vt=dt.K[0],pt=dt.w;for(Hr[0]=dt.K[0][0],lt=1;lt<1*qt;++lt)Hr[lt]=Re(Vt[pt+lt],Hr[lt-1]);for(;lt<4*hA;++lt)Hr[lt]=0;dt.K[0]=null,dt.K[0]=Hr,qe=1}}Le=qe;break;case 2:break;default:e(0)}N=Le}}if(K=K[0],H=H[0],N&&Ee(V,1)&&!(N=1<=(ye=Ee(V,4))&&11>=ye)){y.a=3;break e}var $e;if($e=N)t:{var Sr,Yt,fA,zA=y,Ii=K,$i=H,ur=ye,Gi=w,en=zA.m,zr=zA.s,IA=[null],TA=1,lr=0,UA=wQe[ur];A:for(;;){if(Gi&&Ee(en,1)){var Bi=Ee(en,3)+2,Us=Ce(Ii,Bi),mr=Ce($i,Bi),En=Us*mr;if(!FA(Us,mr,0,zA,IA))break A;for(IA=IA[0],zr.xc=Bi,Sr=0;Sr<En;++Sr){var KA=IA[Sr]>>8&65535;IA[Sr]=KA,KA>=TA&&(TA=KA+1)}}if(en.h)break A;for(Yt=0;5>Yt;++Yt){var Jr=MG[Yt];!Yt&&0<ur&&(Jr+=1<<ur),lr<Jr&&(lr=Jr)}var Fn=o(TA*UA,G),tn=TA,On=o(tn,te);if(On==null)var bn=null;else e(65536>=tn),bn=On;var Cn=n(lr);if(bn==null||Cn==null||Fn==null){zA.a=1;break A}var xn=Fn;for(Sr=fA=0;Sr<TA;++Sr){var jA=bn[Sr],Nn=jA.G,Ls=jA.H,Xu=0,ea=1,vi=0;for(Yt=0;5>Yt;++Yt){Jr=MG[Yt],Nn[Yt]=xn,Ls[Yt]=fA,!Yt&&0<ur&&(Jr+=1<<ur);i:{var mw,AR=Jr,Mw=zA,iE=Cn,YQe=xn,HQe=fA,rR=0,pc=Mw.m,zQe=Ee(pc,1);if(i(iE,0,0,AR),zQe){var JQe=Ee(pc,1)+1,qQe=Ee(pc,1),xG=Ee(pc,qQe==0?1:8);iE[xG]=1,JQe==2&&(iE[xG=Ee(pc,8)]=1);var yw=1}else{var NG=n(19),KG=Ee(pc,4)+4;if(19<KG){Mw.a=3;var Qw=0;break i}for(mw=0;mw<KG;++mw)NG[BQe[mw]]=Ee(pc,3);var iR=void 0,nE=void 0,kG=Mw,VQe=NG,Rw=AR,PG=iE,nR=0,fc=kG.m,GG=8,jG=o(128,G);r:for(;R(jG,0,7,VQe,19);){if(Ee(fc,1)){var WQe=2+2*Ee(fc,3);if((iR=2+Ee(fc,WQe))>Rw)break r}else iR=Rw;for(nE=0;nE<Rw&&iR--;){Z(fc);var YG=jG[0+(127&_(fc))];ae(fc,fc.u+YG.g);var kh=YG.value;if(16>kh)PG[nE++]=kh,kh!=0&&(GG=kh);else{var ZQe=kh==16,HG=kh-16,XQe=CQe[HG],zG=Ee(fc,EQe[HG])+XQe;if(nE+zG>Rw)break r;for(var _Qe=ZQe?GG:0;0<zG--;)PG[nE++]=_Qe}}nR=1;break r}nR||(kG.a=3),yw=nR}(yw=yw&&!pc.h)&&(rR=R(YQe,HQe,8,iE,AR)),yw&&rR!=0?Qw=rR:(Mw.a=3,Qw=0)}if(Qw==0)break A;if(ea&&IQe[Yt]==1&&(ea=xn[fA].g==0),Xu+=xn[fA].g,fA+=Qw,3>=Yt){var sE,sR=Cn[0];for(sE=1;sE<Jr;++sE)Cn[sE]>sR&&(sR=Cn[sE]);vi+=sR}}if(jA.nd=ea,jA.Qb=0,ea&&(jA.qb=(Nn[3][Ls[3]+0].value<<24|Nn[1][Ls[1]+0].value<<16|Nn[2][Ls[2]+0].value)>>>0,Xu==0&&256>Nn[0][Ls[0]+0].value&&(jA.Qb=1,jA.qb+=Nn[0][Ls[0]+0].value<<8)),jA.jc=!jA.Qb&&6>vi,jA.jc){var Dw,ta=jA;for(Dw=0;Dw<Vu;++Dw){var Ec=Dw,Cc=ta.pd[Ec],Tw=ta.G[0][ta.H[0]+Ec];256<=Tw.value?(Cc.g=Tw.g+256,Cc.value=Tw.value):(Cc.g=0,Cc.value=0,Ec>>=yA(Tw,8,Cc),Ec>>=yA(ta.G[1][ta.H[1]+Ec],16,Cc),Ec>>=yA(ta.G[2][ta.H[2]+Ec],0,Cc),yA(ta.G[3][ta.H[3]+Ec],24,Cc))}}}zr.vc=IA,zr.Wb=TA,zr.Ya=bn,zr.yc=Fn,$e=1;break t}$e=0}if(!(N=$e)){y.a=3;break e}if(0<ye){if($.ua=1<<ye,!b($.Wa,ye)){y.a=1,N=0;break e}}else $.ua=0;var oR=y,JG=K,$Qe=H,aR=oR.s,cR=aR.xc;if(oR.c=JG,oR.i=$Qe,aR.md=Ce(JG,cR),aR.wc=cR==0?-1:(1<<cR)-1,w){y.xb=TQe;break e}if((pe=n(K*H))==null){y.a=1,N=0;break e}N=(N=ki(y,pe,0,K,H,H,null))&&!V.h;break e}return N?(F!=null?F[0]=pe:(e(pe==null),e(w)),y.$=0,w||Lr($)):Lr($),N}function st(d,f){var w=d.c*d.i,y=w+f+16*f;return e(d.c<=f),d.V=n(y),d.V==null?(d.Ta=null,d.Ua=0,d.a=1,0):(d.Ta=d.V,d.Ua=d.Ba+w+f,1)}function le(d,f){var w=d.C,y=f-w,F=d.V,N=d.Ba+d.c*w;for(e(f<=d.l.o);0<y;){var K=16<y?16:y,H=d.l.ma,V=d.l.width,$=V*K,pe=H.ca,ye=H.tb+V*w,ee=d.Ta,Ie=d.Ua;pn(d,K,F,N),EG(ee,Ie,pe,ye,$),or(H,w,w+K,pe,ye,V),y-=K,F+=K*d.c,w+=K}e(w==f),d.C=d.Ma=f}function Pe(){this.ub=this.yd=this.td=this.Rb=0}function it(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function pA(){this.Fb=this.Bb=this.Cb=0,this.Zb=n(4),this.Lb=n(4)}function uA(){this.Yb=function(){var d=[];return function f(w,y,F){for(var N=F[y],K=0;K<N&&(w.push(F.length>y+1?[]:0),!(F.length<y+1));K++)f(w[K],y+1,F)}(d,0,[3,11]),d}()}function lA(){this.jb=n(3),this.Wc=s([4,8],uA),this.Xc=s([4,17],uA)}function Gr(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new n(4),this.od=new n(4)}function ar(){this.ld=this.La=this.dd=this.tc=0}function ts(){this.Na=this.la=0}function Ac(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function _A(){this.ad=n(384),this.Za=0,this.Ob=n(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Tu(){this.uc=this.M=this.Nb=0,this.wa=Array(new ar),this.Y=0,this.ya=Array(new _A),this.aa=0,this.l=new Th}function Uu(){this.y=n(16),this.f=n(8),this.ea=n(8)}function tw(){this.cb=this.a=0,this.sc="",this.m=new U,this.Od=new Pe,this.Kc=new it,this.ed=new Gr,this.Qa=new pA,this.Ic=this.$c=this.Aa=0,this.D=new Tu,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,U),this.ia=0,this.pb=o(4,Ac),this.Pa=new lA,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Uu),this.Hd=0,this.rb=Array(new ts),this.sb=0,this.wa=Array(new ar),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new _A),this.L=this.aa=0,this.gd=s([4,2],ar),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Th(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function F1(){var d=new tw;return d!=null&&(d.a=0,d.sc="OK",d.cb=0,d.Xb=0,AE||(AE=zo)),d}function Fr(d,f,w){return d.a==0&&(d.a=f,d.sc=w,d.cb=0),0}function Aw(d,f,w){return 3<=w&&d[f+0]==157&&d[f+1]==1&&d[f+2]==42}function rw(d,f){if(d==null)return 0;if(d.a=0,d.sc="OK",f==null)return Fr(d,2,"null VP8Io passed to VP8GetHeaders()");var w=f.data,y=f.w,F=f.ha;if(4>F)return Fr(d,7,"Truncated header.");var N=w[y+0]|w[y+1]<<8|w[y+2]<<16,K=d.Od;if(K.Rb=!(1&N),K.td=N>>1&7,K.yd=N>>4&1,K.ub=N>>5,3<K.td)return Fr(d,3,"Incorrect keyframe parameters.");if(!K.yd)return Fr(d,4,"Frame not displayable.");y+=3,F-=3;var H=d.Kc;if(K.Rb){if(7>F)return Fr(d,7,"cannot parse picture header");if(!Aw(w,y,F))return Fr(d,3,"Bad code word");H.c=16383&(w[y+4]<<8|w[y+3]),H.Td=w[y+4]>>6,H.i=16383&(w[y+6]<<8|w[y+5]),H.Ud=w[y+6]>>6,y+=7,F-=7,d.za=H.c+15>>4,d.Ub=H.i+15>>4,f.width=H.c,f.height=H.i,f.Da=0,f.j=0,f.v=0,f.va=f.width,f.o=f.height,f.da=0,f.ib=f.width,f.hb=f.height,f.U=f.width,f.T=f.height,i((N=d.Pa).jb,0,255,N.jb.length),e((N=d.Qa)!=null),N.Cb=0,N.Bb=0,N.Fb=1,i(N.Zb,0,0,N.Zb.length),i(N.Lb,0,0,N.Lb)}if(K.ub>F)return Fr(d,7,"bad partition length");X(N=d.m,w,y,K.ub),y+=K.ub,F-=K.ub,K.Rb&&(H.Ld=oe(N),H.Kd=oe(N)),H=d.Qa;var V,$=d.Pa;if(e(N!=null),e(H!=null),H.Cb=oe(N),H.Cb){if(H.Bb=oe(N),oe(N)){for(H.Fb=oe(N),V=0;4>V;++V)H.Zb[V]=oe(N)?W(N,7):0;for(V=0;4>V;++V)H.Lb[V]=oe(N)?W(N,6):0}if(H.Bb)for(V=0;3>V;++V)$.jb[V]=oe(N)?ie(N,8):255}else H.Bb=0;if(N.Ka)return Fr(d,3,"cannot parse segment header");if((H=d.ed).zd=oe(N),H.Tb=ie(N,6),H.wb=ie(N,3),H.Pc=oe(N),H.Pc&&oe(N)){for($=0;4>$;++$)oe(N)&&(H.vd[$]=W(N,6));for($=0;4>$;++$)oe(N)&&(H.od[$]=W(N,6))}if(d.L=H.Tb==0?0:H.zd?1:2,N.Ka)return Fr(d,3,"cannot parse filter header");var pe=F;if(F=V=y,y=V+pe,H=pe,d.Xb=(1<<ie(d.m,2))-1,pe<3*($=d.Xb))w=7;else{for(V+=3*$,H-=3*$,pe=0;pe<$;++pe){var ye=w[F+0]|w[F+1]<<8|w[F+2]<<16;ye>H&&(ye=H),X(d.Jc[+pe],w,V,ye),V+=ye,H-=ye,F+=3}X(d.Jc[+$],w,V,H),w=V<y?0:5}if(w!=0)return Fr(d,w,"cannot parse partitions");for(w=ie(V=d.m,7),F=oe(V)?W(V,4):0,y=oe(V)?W(V,4):0,H=oe(V)?W(V,4):0,$=oe(V)?W(V,4):0,V=oe(V)?W(V,4):0,pe=d.Qa,ye=0;4>ye;++ye){if(pe.Cb){var ee=pe.Zb[ye];pe.Fb||(ee+=w)}else{if(0<ye){d.pb[ye]=d.pb[0];continue}ee=w}var Ie=d.pb[ye];Ie.Sc[0]=$1[cr(ee+F,127)],Ie.Sc[1]=eR[cr(ee+0,127)],Ie.Eb[0]=2*$1[cr(ee+y,127)],Ie.Eb[1]=101581*eR[cr(ee+H,127)]>>16,8>Ie.Eb[1]&&(Ie.Eb[1]=8),Ie.Qc[0]=$1[cr(ee+$,117)],Ie.Qc[1]=eR[cr(ee+V,127)],Ie.lc=ee+V}if(!K.Rb)return Fr(d,4,"Not a key frame.");for(oe(N),K=d.Pa,w=0;4>w;++w){for(F=0;8>F;++F)for(y=0;3>y;++y)for(H=0;11>H;++H)$=de(N,RQe[w][F][y][H])?ie(N,8):yQe[w][F][y][H],K.Wc[w][F].Yb[y][H]=$;for(F=0;17>F;++F)K.Xc[w][F]=K.Wc[w][DQe[F]]}return d.kc=oe(N),d.kc&&(d.Bd=ie(N,8)),d.cb=1}function zo(d,f,w,y,F,N,K){var H=f[F].Yb[w];for(w=0;16>F;++F){if(!de(d,H[w+0]))return F;for(;!de(d,H[w+1]);)if(H=f[++F].Yb[0],w=0,F==16)return 16;var V=f[F+1].Yb;if(de(d,H[w+2])){var $=d,pe=0;if(de($,(ee=H)[(ye=w)+3]))if(de($,ee[ye+6])){for(H=0,ye=2*(pe=de($,ee[ye+8]))+(ee=de($,ee[ye+9+pe])),pe=0,ee=mQe[ye];ee[H];++H)pe+=pe+de($,ee[H]);pe+=3+(8<<ye)}else de($,ee[ye+7])?(pe=7+2*de($,165),pe+=de($,145)):pe=5+de($,159);else pe=de($,ee[ye+4])?3+de($,ee[ye+5]):2;H=V[2]}else pe=1,H=V[1];V=K+MQe[F],0>($=d).b&&ce($);var ye,ee=$.b,Ie=(ye=$.Ca>>1)-($.I>>ee)>>31;--$.b,$.Ca+=Ie,$.Ca|=1,$.I-=(ye+1&Ie)<<ee,N[V]=((pe^Ie)-Ie)*y[(0<F)+0]}return 16}function Lu(d){var f=d.rb[d.sb-1];f.la=0,f.Na=0,i(d.zc,0,0,d.zc.length),d.ja=0}function Ds(d,f,w,y,F){F=d[f+w+32*y]+(F>>3),d[f+w+32*y]=-256&F?0>F?0:255:F}function Fu(d,f,w,y,F,N){Ds(d,f,0,w,y+F),Ds(d,f,1,w,y+N),Ds(d,f,2,w,y-N),Ds(d,f,3,w,y-F)}function Br(d){return(20091*d>>16)+d}function xf(d,f,w,y){var F,N=0,K=n(16);for(F=0;4>F;++F){var H=d[f+0]+d[f+8],V=d[f+0]-d[f+8],$=(35468*d[f+4]>>16)-Br(d[f+12]),pe=Br(d[f+4])+(35468*d[f+12]>>16);K[N+0]=H+pe,K[N+1]=V+$,K[N+2]=V-$,K[N+3]=H-pe,N+=4,f++}for(F=N=0;4>F;++F)H=(d=K[N+0]+4)+K[N+8],V=d-K[N+8],$=(35468*K[N+4]>>16)-Br(K[N+12]),Ds(w,y,0,0,H+(pe=Br(K[N+4])+(35468*K[N+12]>>16))),Ds(w,y,1,0,V+$),Ds(w,y,2,0,V-$),Ds(w,y,3,0,H-pe),N++,y+=32}function O1(d,f,w,y){var F=d[f+0]+4,N=35468*d[f+4]>>16,K=Br(d[f+4]),H=35468*d[f+1]>>16;Fu(w,y,0,F+K,d=Br(d[f+1]),H),Fu(w,y,1,F+N,d,H),Fu(w,y,2,F-N,d,H),Fu(w,y,3,F-K,d,H)}function b1(d,f,w,y,F){xf(d,f,w,y),F&&xf(d,f+16,w,y+4)}function x1(d,f,w,y){Zu(d,f+0,w,y,1),Zu(d,f+32,w,y+128,1)}function to(d,f,w,y){var F;for(d=d[f+0]+4,F=0;4>F;++F)for(f=0;4>f;++f)Ds(w,y,f,F,d)}function iw(d,f,w,y){d[f+0]&&QA(d,f+0,w,y),d[f+16]&&QA(d,f+16,w,y+4),d[f+32]&&QA(d,f+32,w,y+128),d[f+48]&&QA(d,f+48,w,y+128+4)}function nw(d,f,w,y){var F,N=n(16);for(F=0;4>F;++F){var K=d[f+0+F]+d[f+12+F],H=d[f+4+F]+d[f+8+F],V=d[f+4+F]-d[f+8+F],$=d[f+0+F]-d[f+12+F];N[0+F]=K+H,N[8+F]=K-H,N[4+F]=$+V,N[12+F]=$-V}for(F=0;4>F;++F)K=(d=N[0+4*F]+3)+N[3+4*F],H=N[1+4*F]+N[2+4*F],V=N[1+4*F]-N[2+4*F],$=d-N[3+4*F],w[y+0]=K+H>>3,w[y+16]=$+V>>3,w[y+32]=K-H>>3,w[y+48]=$-V>>3,y+=64}function rc(d,f,w){var y,F=f-32,N=Ln,K=255-d[F-1];for(y=0;y<w;++y){var H,V=N,$=K+d[f-1];for(H=0;H<w;++H)d[f+H]=V[$+d[F+H]];f+=32}}function Nf(d,f){rc(d,f,4)}function N1(d,f){rc(d,f,8)}function K1(d,f){rc(d,f,16)}function k1(d,f){var w;for(w=0;16>w;++w)r(d,f+32*w,d,f-32,16)}function Kf(d,f){var w;for(w=16;0<w;--w)i(d,f,d[f-1],16),f+=32}function Ou(d,f,w){var y;for(y=0;16>y;++y)i(f,w+32*y,d,16)}function ic(d,f){var w,y=16;for(w=0;16>w;++w)y+=d[f-1+32*w]+d[f+w-32];Ou(y>>5,d,f)}function P1(d,f){var w,y=8;for(w=0;16>w;++w)y+=d[f-1+32*w];Ou(y>>4,d,f)}function bu(d,f){var w,y=8;for(w=0;16>w;++w)y+=d[f+w-32];Ou(y>>4,d,f)}function kf(d,f){Ou(128,d,f)}function Kt(d,f,w){return d+2*f+w+2>>2}function G1(d,f){var w,y=f-32;for(y=new Uint8Array([Kt(d[y-1],d[y+0],d[y+1]),Kt(d[y+0],d[y+1],d[y+2]),Kt(d[y+1],d[y+2],d[y+3]),Kt(d[y+2],d[y+3],d[y+4])]),w=0;4>w;++w)r(d,f+32*w,y,0,y.length)}function j1(d,f){var w=d[f-1],y=d[f-1+32],F=d[f-1+64],N=d[f-1+96];De(d,f+0,16843009*Kt(d[f-1-32],w,y)),De(d,f+32,16843009*Kt(w,y,F)),De(d,f+64,16843009*Kt(y,F,N)),De(d,f+96,16843009*Kt(F,N,N))}function Y1(d,f){var w,y=4;for(w=0;4>w;++w)y+=d[f+w-32]+d[f-1+32*w];for(y>>=3,w=0;4>w;++w)i(d,f+32*w,y,4)}function H1(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1-32],K=d[f+0-32],H=d[f+1-32],V=d[f+2-32],$=d[f+3-32];d[f+0+96]=Kt(y,F,d[f-1+96]),d[f+1+96]=d[f+0+64]=Kt(w,y,F),d[f+2+96]=d[f+1+64]=d[f+0+32]=Kt(N,w,y),d[f+3+96]=d[f+2+64]=d[f+1+32]=d[f+0+0]=Kt(K,N,w),d[f+3+64]=d[f+2+32]=d[f+1+0]=Kt(H,K,N),d[f+3+32]=d[f+2+0]=Kt(V,H,K),d[f+3+0]=Kt($,V,H)}function Jo(d,f){var w=d[f+1-32],y=d[f+2-32],F=d[f+3-32],N=d[f+4-32],K=d[f+5-32],H=d[f+6-32],V=d[f+7-32];d[f+0+0]=Kt(d[f+0-32],w,y),d[f+1+0]=d[f+0+32]=Kt(w,y,F),d[f+2+0]=d[f+1+32]=d[f+0+64]=Kt(y,F,N),d[f+3+0]=d[f+2+32]=d[f+1+64]=d[f+0+96]=Kt(F,N,K),d[f+3+32]=d[f+2+64]=d[f+1+96]=Kt(N,K,H),d[f+3+64]=d[f+2+96]=Kt(K,H,V),d[f+3+96]=Kt(H,V,V)}function qo(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1-32],K=d[f+0-32],H=d[f+1-32],V=d[f+2-32],$=d[f+3-32];d[f+0+0]=d[f+1+64]=N+K+1>>1,d[f+1+0]=d[f+2+64]=K+H+1>>1,d[f+2+0]=d[f+3+64]=H+V+1>>1,d[f+3+0]=V+$+1>>1,d[f+0+96]=Kt(F,y,w),d[f+0+64]=Kt(y,w,N),d[f+0+32]=d[f+1+96]=Kt(w,N,K),d[f+1+32]=d[f+2+96]=Kt(N,K,H),d[f+2+32]=d[f+3+96]=Kt(K,H,V),d[f+3+32]=Kt(H,V,$)}function z1(d,f){var w=d[f+0-32],y=d[f+1-32],F=d[f+2-32],N=d[f+3-32],K=d[f+4-32],H=d[f+5-32],V=d[f+6-32],$=d[f+7-32];d[f+0+0]=w+y+1>>1,d[f+1+0]=d[f+0+64]=y+F+1>>1,d[f+2+0]=d[f+1+64]=F+N+1>>1,d[f+3+0]=d[f+2+64]=N+K+1>>1,d[f+0+32]=Kt(w,y,F),d[f+1+32]=d[f+0+96]=Kt(y,F,N),d[f+2+32]=d[f+1+96]=Kt(F,N,K),d[f+3+32]=d[f+2+96]=Kt(N,K,H),d[f+3+64]=Kt(K,H,V),d[f+3+96]=Kt(H,V,$)}function J1(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1+96];d[f+0+0]=w+y+1>>1,d[f+2+0]=d[f+0+32]=y+F+1>>1,d[f+2+32]=d[f+0+64]=F+N+1>>1,d[f+1+0]=Kt(w,y,F),d[f+3+0]=d[f+1+32]=Kt(y,F,N),d[f+3+32]=d[f+1+64]=Kt(F,N,N),d[f+3+64]=d[f+2+64]=d[f+0+96]=d[f+1+96]=d[f+2+96]=d[f+3+96]=N}function Uh(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1+96],K=d[f-1-32],H=d[f+0-32],V=d[f+1-32],$=d[f+2-32];d[f+0+0]=d[f+2+32]=w+K+1>>1,d[f+0+32]=d[f+2+64]=y+w+1>>1,d[f+0+64]=d[f+2+96]=F+y+1>>1,d[f+0+96]=N+F+1>>1,d[f+3+0]=Kt(H,V,$),d[f+2+0]=Kt(K,H,V),d[f+1+0]=d[f+3+32]=Kt(w,K,H),d[f+1+32]=d[f+3+64]=Kt(y,w,K),d[f+1+64]=d[f+3+96]=Kt(F,y,w),d[f+1+96]=Kt(N,F,y)}function Pf(d,f){var w;for(w=0;8>w;++w)r(d,f+32*w,d,f-32,8)}function xu(d,f){var w;for(w=0;8>w;++w)i(d,f,d[f-1],8),f+=32}function Lh(d,f,w){var y;for(y=0;8>y;++y)i(f,w+32*y,d,8)}function Fh(d,f){var w,y=8;for(w=0;8>w;++w)y+=d[f+w-32]+d[f-1+32*w];Lh(y>>4,d,f)}function q1(d,f){var w,y=4;for(w=0;8>w;++w)y+=d[f+w-32];Lh(y>>3,d,f)}function Gf(d,f){var w,y=4;for(w=0;8>w;++w)y+=d[f-1+32*w];Lh(y>>3,d,f)}function jf(d,f){Lh(128,d,f)}function Nu(d,f,w){var y=d[f-w],F=d[f+0],N=3*(F-y)+V1[1020+d[f-2*w]-d[f+w]],K=pw[112+(N+4>>3)];d[f-w]=Ln[255+y+pw[112+(N+3>>3)]],d[f+0]=Ln[255+F-K]}function Ku(d,f,w,y){var F=d[f+0],N=d[f+w];return ns[255+d[f-2*w]-d[f-w]]>y||ns[255+N-F]>y}function Yf(d,f,w,y){return 4*ns[255+d[f-w]-d[f+0]]+ns[255+d[f-2*w]-d[f+w]]<=y}function Oh(d,f,w,y,F){var N=d[f-3*w],K=d[f-2*w],H=d[f-w],V=d[f+0],$=d[f+w],pe=d[f+2*w],ye=d[f+3*w];return 4*ns[255+H-V]+ns[255+K-$]>y?0:ns[255+d[f-4*w]-N]<=F&&ns[255+N-K]<=F&&ns[255+K-H]<=F&&ns[255+ye-pe]<=F&&ns[255+pe-$]<=F&&ns[255+$-V]<=F}function Hf(d,f,w,y){var F=2*y+1;for(y=0;16>y;++y)Yf(d,f+y,w,F)&&Nu(d,f+y,w)}function ku(d,f,w,y){var F=2*y+1;for(y=0;16>y;++y)Yf(d,f+y*w,1,F)&&Nu(d,f+y*w,1)}function sw(d,f,w,y){var F;for(F=3;0<F;--F)Hf(d,f+=4*w,w,y)}function ow(d,f,w,y){var F;for(F=3;0<F;--F)ku(d,f+=4,w,y)}function Vo(d,f,w,y,F,N,K,H){for(N=2*N+1;0<F--;){if(Oh(d,f,w,N,K))if(Ku(d,f,w,H))Nu(d,f,w);else{var V=d,$=f,pe=w,ye=V[$-2*pe],ee=V[$-pe],Ie=V[$+0],Se=V[$+pe],Le=V[$+2*pe],me=27*(be=V1[1020+3*(Ie-ee)+V1[1020+ye-Se]])+63>>7,Fe=18*be+63>>7,be=9*be+63>>7;V[$-3*pe]=Ln[255+V[$-3*pe]+be],V[$-2*pe]=Ln[255+ye+Fe],V[$-pe]=Ln[255+ee+me],V[$+0]=Ln[255+Ie-me],V[$+pe]=Ln[255+Se-Fe],V[$+2*pe]=Ln[255+Le-be]}f+=y}}function Wo(d,f,w,y,F,N,K,H){for(N=2*N+1;0<F--;){if(Oh(d,f,w,N,K))if(Ku(d,f,w,H))Nu(d,f,w);else{var V=d,$=f,pe=w,ye=V[$-pe],ee=V[$+0],Ie=V[$+pe],Se=pw[112+(4+(Le=3*(ee-ye))>>3)],Le=pw[112+(Le+3>>3)],me=Se+1>>1;V[$-2*pe]=Ln[255+V[$-2*pe]+me],V[$-pe]=Ln[255+ye+Le],V[$+0]=Ln[255+ee-Se],V[$+pe]=Ln[255+Ie-me]}f+=y}}function aw(d,f,w,y,F,N){Vo(d,f,w,1,16,y,F,N)}function cw(d,f,w,y,F,N){Vo(d,f,1,w,16,y,F,N)}function Pu(d,f,w,y,F,N){var K;for(K=3;0<K;--K)Wo(d,f+=4*w,w,1,16,y,F,N)}function uw(d,f,w,y,F,N){var K;for(K=3;0<K;--K)Wo(d,f+=4,1,w,16,y,F,N)}function B(d,f,w,y,F,N,K,H){Vo(d,f,F,1,8,N,K,H),Vo(w,y,F,1,8,N,K,H)}function L(d,f,w,y,F,N,K,H){Vo(d,f,1,F,8,N,K,H),Vo(w,y,1,F,8,N,K,H)}function Ae(d,f,w,y,F,N,K,H){Wo(d,f+4*F,F,1,8,N,K,H),Wo(w,y+4*F,F,1,8,N,K,H)}function he(d,f,w,y,F,N,K,H){Wo(d,f+4,1,F,8,N,K,H),Wo(w,y+4,1,F,8,N,K,H)}function we(){this.ba=new Qt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new AA,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Oe(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function He(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function gt(){this.ua=0,this.Wa=new Qe,this.vb=new Qe,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new te,this.yc=new G}function ft(){this.xb=this.a=0,this.l=new Th,this.ca=new Qt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new Y,this.Pb=0,this.wd=new Y,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new gt,this.ab=0,this.gc=o(4,He),this.Oc=0}function Ot(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Th,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Pt(d,f,w,y,F,N,K){for(d=d==null?0:d[f+0],f=0;f<K;++f)F[N+f]=d+w[y+f]&255,d=F[N+f]}function wA(d,f,w,y,F,N,K){var H;if(d==null)Pt(null,null,w,y,F,N,K);else for(H=0;H<K;++H)F[N+H]=d[f+H]+w[y+H]&255}function $A(d,f,w,y,F,N,K){if(d==null)Pt(null,null,w,y,F,N,K);else{var H,V=d[f+0],$=V,pe=V;for(H=0;H<K;++H)$=pe+(V=d[f+H])-$,pe=w[y+H]+(-256&$?0>$?0:255:$)&255,$=V,F[N+H]=pe}}function Or(d,f,w,y){var F=f.width,N=f.o;if(e(d!=null&&f!=null),0>w||0>=y||w+y>N)return null;if(!d.Cc){if(d.ga==null){var K;if(d.ga=new Ot,(K=d.ga==null)||(K=f.width*f.o,e(d.Gb.length==0),d.Gb=n(K),d.Uc=0,d.Gb==null?K=0:(d.mb=d.Gb,d.nb=d.Uc,d.rc=null,K=1),K=!K),!K){K=d.ga;var H=d.Fa,V=d.P,$=d.qc,pe=d.mb,ye=d.nb,ee=V+1,Ie=$-1,Se=K.l;if(e(H!=null&&pe!=null&&f!=null),dc[0]=null,dc[1]=Pt,dc[2]=wA,dc[3]=$A,K.ca=pe,K.tb=ye,K.c=f.width,K.i=f.height,e(0<K.c&&0<K.i),1>=$)f=0;else if(K.$a=3&H[V+0],K.Z=H[V+0]>>2&3,K.Lc=H[V+0]>>4&3,V=H[V+0]>>6&3,0>K.$a||1<K.$a||4<=K.Z||1<K.Lc||V)f=0;else if(Se.put=Bt,Se.ac=Ni,Se.bc=Ur,Se.ma=K,Se.width=f.width,Se.height=f.height,Se.Da=f.Da,Se.v=f.v,Se.va=f.va,Se.j=f.j,Se.o=f.o,K.$a)e:{e(K.$a==1),f=Ne();t:for(;;){if(f==null){f=0;break e}if(e(K!=null),K.mc=f,f.c=K.c,f.i=K.i,f.l=K.l,f.l.ma=K,f.l.width=K.c,f.l.height=K.i,f.a=0,se(f.m,H,ee,Ie),!FA(K.c,K.i,1,f,null)||(f.ab==1&&f.gc[0].hc==3&&ii(f.s)?(K.ic=1,H=f.c*f.i,f.Ta=null,f.Ua=0,f.V=n(H),f.Ba=0,f.V==null?(f.a=1,f=0):f=1):(K.ic=0,f=st(f,K.c)),!f))break t;f=1;break e}K.mc=null,f=0}else f=Ie>=K.c*K.i;K=!f}if(K)return null;d.ga.Lc!=1?d.Ga=0:y=N-w}e(d.ga!=null),e(w+y<=N);e:{if(f=(H=d.ga).c,N=H.l.o,H.$a==0){if(ee=d.rc,Ie=d.Vc,Se=d.Fa,V=d.P+1+w*f,$=d.mb,pe=d.nb+w*f,e(V<=d.P+d.qc),H.Z!=0)for(e(dc[H.Z]!=null),K=0;K<y;++K)dc[H.Z](ee,Ie,Se,V,$,pe,f),ee=$,Ie=pe,pe+=f,V+=f;else for(K=0;K<y;++K)r($,pe,Se,V,f),ee=$,Ie=pe,pe+=f,V+=f;d.rc=ee,d.Vc=Ie}else{if(e(H.mc!=null),f=w+y,e((K=H.mc)!=null),e(f<=K.i),K.C>=f)f=1;else if(H.ic||As(),H.ic){H=K.V,ee=K.Ba,Ie=K.c;var Le=K.i,me=(Se=1,V=K.$/Ie,$=K.$%Ie,pe=K.m,ye=K.s,K.$),Fe=Ie*Le,be=Ie*f,qe=ye.wc,je=me<be?HA(ye,$,V):null;e(me<=Fe),e(f<=Le),e(ii(ye));t:for(;;){for(;!pe.h&&me<be;){if($&qe||(je=HA(ye,$,V)),e(je!=null),Z(pe),256>(Le=iA(je.G[0],je.H[0],pe)))H[ee+me]=Le,++me,++$>=Ie&&($=0,++V<=f&&!(V%16)&&Ki(K,V));else{if(!(280>Le)){Se=0;break t}Le=ti(Le-256,pe);var Et,lt=iA(je.G[4],je.H[4],pe);if(Z(pe),!(me>=(lt=Ai(Ie,lt=ti(lt,pe)))&&Fe-me>=Le)){Se=0;break t}for(Et=0;Et<Le;++Et)H[ee+me+Et]=H[ee+me+Et-lt];for(me+=Le,$+=Le;$>=Ie;)$-=Ie,++V<=f&&!(V%16)&&Ki(K,V);me<be&&$&qe&&(je=HA(ye,$,V))}e(pe.h==re(pe))}Ki(K,V>f?f:V);break t}!Se||pe.h&&me<Fe?(Se=0,K.a=pe.h?5:3):K.$=me,f=Se}else f=ki(K,K.V,K.Ba,K.c,K.i,f,le);if(!f){y=0;break e}}w+y>=N&&(d.Cc=1),y=1}if(!y)return null;if(d.Cc&&((y=d.ga)!=null&&(y.mc=null),d.ga=null,0<d.Ga))return alert("todo:WebPDequantizeLevels"),null}return d.nb+w*F}function GA(d,f,w,y,F,N){for(;0<F--;){var K,H=d,V=f+(w?1:0),$=d,pe=f+(w?0:3);for(K=0;K<y;++K){var ye=$[pe+4*K];ye!=255&&(ye*=32897,H[V+4*K+0]=H[V+4*K+0]*ye>>23,H[V+4*K+1]=H[V+4*K+1]*ye>>23,H[V+4*K+2]=H[V+4*K+2]*ye>>23)}f+=N}}function jr(d,f,w,y,F){for(;0<y--;){var N;for(N=0;N<w;++N){var K=d[f+2*N+0],H=15&($=d[f+2*N+1]),V=4369*H,$=(240&$|$>>4)*V>>16;d[f+2*N+0]=(240&K|K>>4)*V>>16&240|(15&K|K<<4)*V>>16>>4&15,d[f+2*N+1]=240&$|H}f+=F}}function br(d,f,w,y,F,N,K,H){var V,$,pe=255;for($=0;$<F;++$){for(V=0;V<y;++V){var ye=d[f+V];N[K+4*V]=ye,pe&=ye}f+=w,K+=H}return pe!=255}function Ci(d,f,w,y,F){var N;for(N=0;N<F;++N)w[y+N]=d[f+N]>>8}function As(){tE=GA,pG=jr,fG=br,EG=Ci}function fn(d,f,w){T[d]=function(y,F,N,K,H,V,$,pe,ye,ee,Ie,Se,Le,me,Fe,be,qe){var je,Et=qe-1>>1,lt=H[V+0]|$[pe+0]<<16,qt=ye[ee+0]|Ie[Se+0]<<16;e(y!=null);var dt=3*lt+qt+131074>>2;for(f(y[F+0],255&dt,dt>>16,Le,me),N!=null&&(dt=3*qt+lt+131074>>2,f(N[K+0],255&dt,dt>>16,Fe,be)),je=1;je<=Et;++je){var hA=H[V+je]|$[pe+je]<<16,Hr=ye[ee+je]|Ie[Se+je]<<16,Vt=lt+hA+qt+Hr+524296,pt=Vt+2*(hA+qt)>>3;dt=pt+lt>>1,lt=(Vt=Vt+2*(lt+Hr)>>3)+hA>>1,f(y[F+2*je-1],255&dt,dt>>16,Le,me+(2*je-1)*w),f(y[F+2*je-0],255&lt,lt>>16,Le,me+(2*je-0)*w),N!=null&&(dt=Vt+qt>>1,lt=pt+Hr>>1,f(N[K+2*je-1],255&dt,dt>>16,Fe,be+(2*je-1)*w),f(N[K+2*je+0],255&lt,lt>>16,Fe,be+(2*je+0)*w)),lt=hA,qt=Hr}1&qe||(dt=3*lt+qt+131074>>2,f(y[F+qe-1],255&dt,dt>>16,Le,me+(qe-1)*w),N!=null&&(dt=3*qt+lt+131074>>2,f(N[K+qe-1],255&dt,dt>>16,Fe,be+(qe-1)*w)))}}function lw(){ss[fw]=UQe,ss[Ew]=RG,ss[SG]=LQe,ss[Cw]=DG,ss[Iw]=TG,ss[W1]=UG,ss[mG]=FQe,ss[Z1]=RG,ss[X1]=DG,ss[Bw]=TG,ss[_1]=UG}function bh(d){return d&~OQe?0>d?0:255:d>>LG}function Gu(d,f){return bh((19077*d>>8)+(26149*f>>8)-14234)}function nc(d,f,w){return bh((19077*d>>8)-(6419*f>>8)-(13320*w>>8)+8708)}function ju(d,f){return bh((19077*d>>8)+(33050*f>>8)-17685)}function Yu(d,f,w,y,F){y[F+0]=Gu(d,w),y[F+1]=nc(d,f,w),y[F+2]=ju(d,f)}function Hu(d,f,w,y,F){y[F+0]=ju(d,f),y[F+1]=nc(d,f,w),y[F+2]=Gu(d,w)}function Pi(d,f,w,y,F){var N=nc(d,f,w);f=N<<3&224|ju(d,f)>>3,y[F+0]=248&Gu(d,w)|N>>5,y[F+1]=f}function zu(d,f,w,y,F){var N=240&ju(d,f)|15;y[F+0]=240&Gu(d,w)|nc(d,f,w)>>4,y[F+1]=N}function Ju(d,f,w,y,F){y[F+0]=255,Yu(d,f,w,y,F+1)}function zf(d,f,w,y,F){Hu(d,f,w,y,F),y[F+3]=255}function Jf(d,f,w,y,F){Yu(d,f,w,y,F),y[F+3]=255}function cr(d,f){return 0>d?0:d>f?f:d}function Zo(d,f,w){T[d]=function(y,F,N,K,H,V,$,pe,ye){for(var ee=pe+(-2&ye)*w;pe!=ee;)f(y[F+0],N[K+0],H[V+0],$,pe),f(y[F+1],N[K+0],H[V+0],$,pe+w),F+=2,++K,++V,pe+=2*w;1&ye&&f(y[F+0],N[K+0],H[V+0],$,pe)}}function xh(d,f,w){return w==0?d==0?f==0?6:5:f==0?4:0:w}function hw(d,f,w,y,F){switch(d>>>30){case 3:Zu(f,w,y,F,0);break;case 2:is(f,w,y,F);break;case 1:QA(f,w,y,F)}}function rs(d,f){var w,y,F=f.M,N=f.Nb,K=d.oc,H=d.pc+40,V=d.oc,$=d.pc+584,pe=d.oc,ye=d.pc+600;for(w=0;16>w;++w)K[H+32*w-1]=129;for(w=0;8>w;++w)V[$+32*w-1]=129,pe[ye+32*w-1]=129;for(0<F?K[H-1-32]=V[$-1-32]=pe[ye-1-32]=129:(i(K,H-32-1,127,21),i(V,$-32-1,127,9),i(pe,ye-32-1,127,9)),y=0;y<d.za;++y){var ee=f.ya[f.aa+y];if(0<y){for(w=-1;16>w;++w)r(K,H+32*w-4,K,H+32*w+12,4);for(w=-1;8>w;++w)r(V,$+32*w-4,V,$+32*w+4,4),r(pe,ye+32*w-4,pe,ye+32*w+4,4)}var Ie=d.Gd,Se=d.Hd+y,Le=ee.ad,me=ee.Hc;if(0<F&&(r(K,H-32,Ie[Se].y,0,16),r(V,$-32,Ie[Se].f,0,8),r(pe,ye-32,Ie[Se].ea,0,8)),ee.Za){var Fe=K,be=H-32+16;for(0<F&&(y>=d.za-1?i(Fe,be,Ie[Se].y[15],4):r(Fe,be,Ie[Se+1].y,0,4)),w=0;4>w;w++)Fe[be+128+w]=Fe[be+256+w]=Fe[be+384+w]=Fe[be+0+w];for(w=0;16>w;++w,me<<=2)Fe=K,be=H+OG[w],Ts[ee.Ob[w]](Fe,be),hw(me,Le,16*+w,Fe,be)}else if(Fe=xh(y,F,ee.Ob[0]),gc[Fe](K,H),me!=0)for(w=0;16>w;++w,me<<=2)hw(me,Le,16*+w,K,H+OG[w]);for(w=ee.Gc,Fe=xh(y,F,ee.Dd),$o[Fe](V,$),$o[Fe](pe,ye),me=Le,Fe=V,be=$,255&(ee=0|w)&&(170&ee?io(me,256,Fe,be):NA(me,256,Fe,be)),ee=pe,me=ye,255&(w>>=8)&&(170&w?io(Le,320,ee,me):NA(Le,320,ee,me)),F<d.Ub-1&&(r(Ie[Se].y,0,K,H+480,16),r(Ie[Se].f,0,V,$+224,8),r(Ie[Se].ea,0,pe,ye+224,8)),w=8*N*d.B,Ie=d.sa,Se=d.ta+16*y+16*N*d.R,Le=d.qa,ee=d.ra+8*y+w,me=d.Ha,Fe=d.Ia+8*y+w,w=0;16>w;++w)r(Ie,Se+w*d.R,K,H+32*w,16);for(w=0;8>w;++w)r(Le,ee+w*d.B,V,$+32*w,8),r(me,Fe+w*d.B,pe,ye+32*w,8)}}function qu(d,f,w,y,F,N,K,H,V){var $=[0],pe=[0],ye=0,ee=V!=null?V.kd:0,Ie=V??new Oe;if(d==null||12>w)return 7;Ie.data=d,Ie.w=f,Ie.ha=w,f=[f],w=[w],Ie.gb=[Ie.gb];e:{var Se=f,Le=w,me=Ie.gb;if(e(d!=null),e(Le!=null),e(me!=null),me[0]=0,12<=Le[0]&&!A(d,Se[0],"RIFF")){if(A(d,Se[0]+8,"WEBP")){me=3;break e}var Fe=z(d,Se[0]+4);if(12>Fe||4294967286<Fe){me=3;break e}if(ee&&Fe>Le[0]-8){me=7;break e}me[0]=Fe,Se[0]+=12,Le[0]-=12}me=0}if(me!=0)return me;for(Fe=0<Ie.gb[0],w=w[0];;){e:{var be=d;Le=f,me=w;var qe=$,je=pe,Et=Se=[0];if((dt=ye=[ye])[0]=0,8>me[0])me=7;else{if(!A(be,Le[0],"VP8X")){if(z(be,Le[0]+4)!=10){me=3;break e}if(18>me[0]){me=7;break e}var lt=z(be,Le[0]+8),qt=1+J(be,Le[0]+12);if(2147483648<=qt*(be=1+J(be,Le[0]+15))){me=3;break e}Et!=null&&(Et[0]=lt),qe!=null&&(qe[0]=qt),je!=null&&(je[0]=be),Le[0]+=18,me[0]-=18,dt[0]=1}me=0}}if(ye=ye[0],Se=Se[0],me!=0)return me;if(Le=!!(2&Se),!Fe&&ye)return 3;if(N!=null&&(N[0]=!!(16&Se)),K!=null&&(K[0]=Le),H!=null&&(H[0]=0),K=$[0],Se=pe[0],ye&&Le&&V==null){me=0;break}if(4>w){me=7;break}if(Fe&&ye||!Fe&&!ye&&!A(d,f[0],"ALPH")){w=[w],Ie.na=[Ie.na],Ie.P=[Ie.P],Ie.Sa=[Ie.Sa];e:{lt=d,me=f,Fe=w;var dt=Ie.gb;qe=Ie.na,je=Ie.P,Et=Ie.Sa,qt=22,e(lt!=null),e(Fe!=null),be=me[0];var hA=Fe[0];for(e(qe!=null),e(Et!=null),qe[0]=null,je[0]=null,Et[0]=0;;){if(me[0]=be,Fe[0]=hA,8>hA){me=7;break e}var Hr=z(lt,be+4);if(4294967286<Hr){me=3;break e}var Vt=8+Hr+1&-2;if(qt+=Vt,0<dt&&qt>dt){me=3;break e}if(!A(lt,be,"VP8 ")||!A(lt,be,"VP8L")){me=0;break e}if(hA[0]<Vt){me=7;break e}A(lt,be,"ALPH")||(qe[0]=lt,je[0]=be+8,Et[0]=Hr),be+=Vt,hA-=Vt}}if(w=w[0],Ie.na=Ie.na[0],Ie.P=Ie.P[0],Ie.Sa=Ie.Sa[0],me!=0)break}w=[w],Ie.Ja=[Ie.Ja],Ie.xa=[Ie.xa];e:if(dt=d,me=f,Fe=w,qe=Ie.gb[0],je=Ie.Ja,Et=Ie.xa,lt=me[0],be=!A(dt,lt,"VP8 "),qt=!A(dt,lt,"VP8L"),e(dt!=null),e(Fe!=null),e(je!=null),e(Et!=null),8>Fe[0])me=7;else{if(be||qt){if(dt=z(dt,lt+4),12<=qe&&dt>qe-12){me=3;break e}if(ee&&dt>Fe[0]-8){me=7;break e}je[0]=dt,me[0]+=8,Fe[0]-=8,Et[0]=qt}else Et[0]=5<=Fe[0]&&dt[lt+0]==47&&!(dt[lt+4]>>5),je[0]=Fe[0];me=0}if(w=w[0],Ie.Ja=Ie.Ja[0],Ie.xa=Ie.xa[0],f=f[0],me!=0)break;if(4294967286<Ie.Ja)return 3;if(H==null||Le||(H[0]=Ie.xa?2:1),K=[K],Se=[Se],Ie.xa){if(5>w){me=7;break}H=K,ee=Se,Le=N,d==null||5>w?d=0:5<=w&&d[f+0]==47&&!(d[f+4]>>5)?(Fe=[0],dt=[0],qe=[0],se(je=new Y,d,f,w),Ei(je,Fe,dt,qe)?(H!=null&&(H[0]=Fe[0]),ee!=null&&(ee[0]=dt[0]),Le!=null&&(Le[0]=qe[0]),d=1):d=0):d=0}else{if(10>w){me=7;break}H=Se,d==null||10>w||!Aw(d,f+3,w-3)?d=0:(ee=d[f+0]|d[f+1]<<8|d[f+2]<<16,Le=16383&(d[f+7]<<8|d[f+6]),d=16383&(d[f+9]<<8|d[f+8]),1&ee||3<(ee>>1&7)||!(ee>>4&1)||ee>>5>=Ie.Ja||!Le||!d?d=0:(K&&(K[0]=Le),H&&(H[0]=d),d=1))}if(!d||(K=K[0],Se=Se[0],ye&&($[0]!=K||pe[0]!=Se)))return 3;V!=null&&(V[0]=Ie,V.offset=f-V.w,e(4294967286>f-V.w),e(V.offset==V.ha-w));break}return me==0||me==7&&ye&&V==null?(N!=null&&(N[0]|=Ie.na!=null&&0<Ie.na.length),y!=null&&(y[0]=K),F!=null&&(F[0]=Se),0):me}function qf(d,f,w){var y=f.width,F=f.height,N=0,K=0,H=y,V=F;if(f.Da=d!=null&&0<d.Da,f.Da&&(H=d.cd,V=d.bd,N=d.v,K=d.j,11>w||(N&=-2,K&=-2),0>N||0>K||0>=H||0>=V||N+H>y||K+V>F))return 0;if(f.v=N,f.j=K,f.va=N+H,f.o=K+V,f.U=H,f.T=V,f.da=d!=null&&0<d.da,f.da){if(!Te(H,V,w=[d.ib],N=[d.hb]))return 0;f.ib=w[0],f.hb=N[0]}return f.ob=d!=null&&d.ob,f.Kb=d==null||!d.Sd,f.da&&(f.ob=f.ib<3*y/4&&f.hb<3*F/4,f.Kb=0),1}function Vf(d){if(d==null)return 2;if(11>d.S){var f=d.f.RGBA;f.fb+=(d.height-1)*f.A,f.A=-f.A}else f=d.f.kb,d=d.height,f.O+=(d-1)*f.fa,f.fa=-f.fa,f.N+=(d-1>>1)*f.Ab,f.Ab=-f.Ab,f.W+=(d-1>>1)*f.Db,f.Db=-f.Db,f.F!=null&&(f.J+=(d-1)*f.lb,f.lb=-f.lb);return 0}function sc(d,f,w,y){if(y==null||0>=d||0>=f)return 2;if(w!=null){if(w.Da){var F=w.cd,N=w.bd,K=-2&w.v,H=-2&w.j;if(0>K||0>H||0>=F||0>=N||K+F>d||H+N>f)return 2;d=F,f=N}if(w.da){if(!Te(d,f,F=[w.ib],N=[w.hb]))return 2;d=F[0],f=N[0]}}y.width=d,y.height=f;e:{var V=y.width,$=y.height;if(d=y.S,0>=V||0>=$||!(d>=fw&&13>d))d=2;else{if(0>=y.Rd&&y.sd==null){K=N=F=f=0;var pe=(H=V*bG[d])*$;if(11>d||(N=($+1)/2*(f=(V+1)/2),d==12&&(K=(F=V)*$)),($=n(pe+2*N+K))==null){d=1;break e}y.sd=$,11>d?((V=y.f.RGBA).eb=$,V.fb=0,V.A=H,V.size=pe):((V=y.f.kb).y=$,V.O=0,V.fa=H,V.Fd=pe,V.f=$,V.N=0+pe,V.Ab=f,V.Cd=N,V.ea=$,V.W=0+pe+N,V.Db=f,V.Ed=N,d==12&&(V.F=$,V.J=0+pe+2*N),V.Tc=K,V.lb=F)}if(f=1,F=y.S,N=y.width,K=y.height,F>=fw&&13>F)if(11>F)d=y.f.RGBA,f&=(H=Math.abs(d.A))*(K-1)+N<=d.size,f&=H>=N*bG[F],f&=d.eb!=null;else{d=y.f.kb,H=(N+1)/2,pe=(K+1)/2,V=Math.abs(d.fa),$=Math.abs(d.Ab);var ye=Math.abs(d.Db),ee=Math.abs(d.lb),Ie=ee*(K-1)+N;f&=V*(K-1)+N<=d.Fd,f&=$*(pe-1)+H<=d.Cd,f=(f&=ye*(pe-1)+H<=d.Ed)&V>=N&$>=H&ye>=H,f&=d.y!=null,f&=d.f!=null,f&=d.ea!=null,F==12&&(f&=ee>=N,f&=Ie<=d.Tc,f&=d.F!=null)}else f=0;d=f?0:2}}return d!=0||w!=null&&w.fd&&(d=Vf(y)),d}var Vu=64,Tn=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Un=24,oc=32,Xo=8,ac=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ve("Predictor0","PredictorAdd0"),T.Predictor0=function(){return 4278190080},T.Predictor1=function(d){return d},T.Predictor2=function(d,f,w){return f[w+0]},T.Predictor3=function(d,f,w){return f[w+1]},T.Predictor4=function(d,f,w){return f[w-1]},T.Predictor5=function(d,f,w){return Ue(Ue(d,f[w+1]),f[w+0])},T.Predictor6=function(d,f,w){return Ue(d,f[w-1])},T.Predictor7=function(d,f,w){return Ue(d,f[w+0])},T.Predictor8=function(d,f,w){return Ue(f[w-1],f[w+0])},T.Predictor9=function(d,f,w){return Ue(f[w+0],f[w+1])},T.Predictor10=function(d,f,w){return Ue(Ue(d,f[w-1]),Ue(f[w+0],f[w+1]))},T.Predictor11=function(d,f,w){var y=f[w+0];return 0>=Je(y>>24&255,d>>24&255,(f=f[w-1])>>24&255)+Je(y>>16&255,d>>16&255,f>>16&255)+Je(y>>8&255,d>>8&255,f>>8&255)+Je(255&y,255&d,255&f)?y:d},T.Predictor12=function(d,f,w){var y=f[w+0];return(ke((d>>24&255)+(y>>24&255)-((f=f[w-1])>>24&255))<<24|ke((d>>16&255)+(y>>16&255)-(f>>16&255))<<16|ke((d>>8&255)+(y>>8&255)-(f>>8&255))<<8|ke((255&d)+(255&y)-(255&f)))>>>0},T.Predictor13=function(d,f,w){var y=f[w-1];return(Ye((d=Ue(d,f[w+0]))>>24&255,y>>24&255)<<24|Ye(d>>16&255,y>>16&255)<<16|Ye(d>>8&255,y>>8&255)<<8|Ye(255&d,255&y))>>>0};var Wf=T.PredictorAdd0;T.PredictorAdd1=rt,ve("Predictor2","PredictorAdd2"),ve("Predictor3","PredictorAdd3"),ve("Predictor4","PredictorAdd4"),ve("Predictor5","PredictorAdd5"),ve("Predictor6","PredictorAdd6"),ve("Predictor7","PredictorAdd7"),ve("Predictor8","PredictorAdd8"),ve("Predictor9","PredictorAdd9"),ve("Predictor10","PredictorAdd10"),ve("Predictor11","PredictorAdd11"),ve("Predictor12","PredictorAdd12"),ve("Predictor13","PredictorAdd13");var Nh=T.PredictorAdd2;_e("ColorIndexInverseTransform","MapARGB","32b",function(d){return d>>8&255},function(d){return d}),_e("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(d){return d},function(d){return d>>8&255});var vr,gw=T.ColorIndexInverseTransform,Ao=T.MapARGB,ro=T.VP8LColorIndexInverseTransformAlpha,Zf=T.MapAlpha,Xf=T.VP8LPredictorsAdd=[];Xf.length=16,(T.VP8LPredictors=[]).length=16,(T.VP8LPredictorsAdd_C=[]).length=16,(T.VP8LPredictors_C=[]).length=16;var _f,$f,cc,uc,lc,Wu,hc,Zu,is,io,QA,NA,wr,Yr,_o,eE,Kh,dw,cG,uG,lG,hG,gG,dG,tE,pG,fG,EG,CG=n(511),IG=n(2041),BG=n(225),vG=n(767),wG=0,V1=IG,pw=BG,Ln=vG,ns=CG,fw=0,Ew=1,SG=2,Cw=3,Iw=4,W1=5,mG=6,Z1=7,X1=8,Bw=9,_1=10,EQe=[2,3,7],CQe=[3,3,11],MG=[280,256,256,256,40],IQe=[0,1,1,1,0],BQe=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],vQe=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],wQe=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],SQe=8,$1=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],eR=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],AE=null,mQe=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],MQe=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],yG=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],yQe=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],QQe=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],RQe=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],DQe=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],gc=[],Ts=[],$o=[],TQe=1,QG=2,dc=[],ss=[];fn("UpsampleRgbLinePair",Yu,3),fn("UpsampleBgrLinePair",Hu,3),fn("UpsampleRgbaLinePair",Jf,4),fn("UpsampleBgraLinePair",zf,4),fn("UpsampleArgbLinePair",Ju,4),fn("UpsampleRgba4444LinePair",zu,2),fn("UpsampleRgb565LinePair",Pi,2);var UQe=T.UpsampleRgbLinePair,LQe=T.UpsampleBgrLinePair,RG=T.UpsampleRgbaLinePair,DG=T.UpsampleBgraLinePair,TG=T.UpsampleArgbLinePair,UG=T.UpsampleRgba4444LinePair,FQe=T.UpsampleRgb565LinePair,vw=16,ww=1<<vw-1,rE=-227,tR=482,LG=6,OQe=(256<<LG)-1,FG=0,bQe=n(256),xQe=n(256),NQe=n(256),KQe=n(256),kQe=n(tR-rE),PQe=n(tR-rE);Zo("YuvToRgbRow",Yu,3),Zo("YuvToBgrRow",Hu,3),Zo("YuvToRgbaRow",Jf,4),Zo("YuvToBgraRow",zf,4),Zo("YuvToArgbRow",Ju,4),Zo("YuvToRgba4444Row",zu,2),Zo("YuvToRgb565Row",Pi,2);var OG=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Sw=[0,2,8],GQe=[8,7,6,4,4,2,2,2,1,1,1,1],jQe=1;this.WebPDecodeRGBA=function(d,f,w,y,F){var N=Ew,K=new we,H=new Qt;K.ba=H,H.S=N,H.width=[H.width],H.height=[H.height];var V=H.width,$=H.height,pe=new Xe;if(pe==null||d==null)var ye=2;else e(pe!=null),ye=qu(d,f,w,pe.width,pe.height,pe.Pd,pe.Qd,pe.format,null);if(ye!=0?V=0:(V!=null&&(V[0]=pe.width[0]),$!=null&&($[0]=pe.height[0]),V=1),V){H.width=H.width[0],H.height=H.height[0],y!=null&&(y[0]=H.width),F!=null&&(F[0]=H.height);e:{if(y=new Th,(F=new Oe).data=d,F.w=f,F.ha=w,F.kd=1,f=[0],e(F!=null),((d=qu(F.data,F.w,F.ha,null,null,null,f,null,F))==0||d==7)&&f[0]&&(d=4),(f=d)==0){if(e(K!=null),y.data=F.data,y.w=F.w+F.offset,y.ha=F.ha-F.offset,y.put=Bt,y.ac=Ni,y.bc=Ur,y.ma=K,F.xa){if((d=Ne())==null){K=1;break e}if(function(ee,Ie){var Se=[0],Le=[0],me=[0];t:for(;;){if(ee==null)return 0;if(Ie==null)return ee.a=2,0;if(ee.l=Ie,ee.a=0,se(ee.m,Ie.data,Ie.w,Ie.ha),!Ei(ee.m,Se,Le,me)){ee.a=3;break t}if(ee.xb=QG,Ie.width=Se[0],Ie.height=Le[0],!FA(Se[0],Le[0],1,ee,null))break t;return 1}return e(ee.a!=0),0}(d,y)){if(y=(f=sc(y.width,y.height,K.Oa,K.ba))==0){t:{y=d;A:for(;;){if(y==null){y=0;break t}if(e(y.s.yc!=null),e(y.s.Ya!=null),e(0<y.s.Wb),e((w=y.l)!=null),e((F=w.ma)!=null),y.xb!=0){if(y.ca=F.ba,y.tb=F.tb,e(y.ca!=null),!qf(F.Oa,w,Cw)){y.a=2;break A}if(!st(y,w.width)||w.da)break A;if((w.da||Ge(y.ca.S))&&As(),11>y.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),y.ca.f.kb.F!=null&&As()),y.Pb&&0<y.s.ua&&y.s.vb.X==null&&!b(y.s.vb,y.s.Wa.Xa)){y.a=1;break A}y.xb=0}if(!ki(y,y.V,y.Ba,y.c,y.i,w.o,ri))break A;F.Dc=y.Ma,y=1;break t}e(y.a!=0),y=0}y=!y}y&&(f=d.a)}else f=d.a}else{if((d=new F1)==null){K=1;break e}if(d.Fa=F.na,d.P=F.P,d.qc=F.Sa,rw(d,y)){if((f=sc(y.width,y.height,K.Oa,K.ba))==0){if(d.Aa=0,w=K.Oa,e((F=d)!=null),w!=null){if(0<(V=0>(V=w.Md)?0:100<V?255:255*V/100)){for($=pe=0;4>$;++$)12>(ye=F.pb[$]).lc&&(ye.ia=V*GQe[0>ye.lc?0:ye.lc]>>3),pe|=ye.ia;pe&&(alert("todo:VP8InitRandom"),F.ia=1)}F.Ga=w.Id,100<F.Ga?F.Ga=100:0>F.Ga&&(F.Ga=0)}(function(ee,Ie){if(ee==null)return 0;if(Ie==null)return Fr(ee,2,"NULL VP8Io parameter in VP8Decode().");if(!ee.cb&&!rw(ee,Ie))return 0;if(e(ee.cb),Ie.ac==null||Ie.ac(Ie)){Ie.ob&&(ee.L=0);var Se=Sw[ee.L];if(ee.L==2?(ee.yb=0,ee.zb=0):(ee.yb=Ie.v-Se>>4,ee.zb=Ie.j-Se>>4,0>ee.yb&&(ee.yb=0),0>ee.zb&&(ee.zb=0)),ee.Va=Ie.o+15+Se>>4,ee.Hb=Ie.va+15+Se>>4,ee.Hb>ee.za&&(ee.Hb=ee.za),ee.Va>ee.Ub&&(ee.Va=ee.Ub),0<ee.L){var Le=ee.ed;for(Se=0;4>Se;++Se){var me;if(ee.Qa.Cb){var Fe=ee.Qa.Lb[Se];ee.Qa.Fb||(Fe+=Le.Tb)}else Fe=Le.Tb;for(me=0;1>=me;++me){var be=ee.gd[Se][me],qe=Fe;if(Le.Pc&&(qe+=Le.vd[0],me&&(qe+=Le.od[0])),0<(qe=0>qe?0:63<qe?63:qe)){var je=qe;0<Le.wb&&(je=4<Le.wb?je>>2:je>>1)>9-Le.wb&&(je=9-Le.wb),1>je&&(je=1),be.dd=je,be.tc=2*qe+je,be.ld=40<=qe?2:15<=qe?1:0}else be.tc=0;be.La=me}}}Se=0}else Fr(ee,6,"Frame setup failed"),Se=ee.a;if(Se=Se==0){if(Se){ee.$c=0,0<ee.Aa||(ee.Ic=jQe);t:{Se=ee.Ic,Le=4*(je=ee.za);var Et=32*je,lt=je+1,qt=0<ee.L?je*(0<ee.Aa?2:1):0,dt=(ee.Aa==2?2:1)*je;if((be=Le+832+(me=3*(16*Se+Sw[ee.L])/2*Et)+(Fe=ee.Fa!=null&&0<ee.Fa.length?ee.Kc.c*ee.Kc.i:0))!=be)Se=0;else{if(be>ee.Vb){if(ee.Vb=0,ee.Ec=n(be),ee.Fc=0,ee.Ec==null){Se=Fr(ee,1,"no memory during frame initialization.");break t}ee.Vb=be}be=ee.Ec,qe=ee.Fc,ee.Ac=be,ee.Bc=qe,qe+=Le,ee.Gd=o(Et,Uu),ee.Hd=0,ee.rb=o(lt+1,ts),ee.sb=1,ee.wa=qt?o(qt,ar):null,ee.Y=0,ee.D.Nb=0,ee.D.wa=ee.wa,ee.D.Y=ee.Y,0<ee.Aa&&(ee.D.Y+=je),e(!0),ee.oc=be,ee.pc=qe,qe+=832,ee.ya=o(dt,_A),ee.aa=0,ee.D.ya=ee.ya,ee.D.aa=ee.aa,ee.Aa==2&&(ee.D.aa+=je),ee.R=16*je,ee.B=8*je,je=(Et=Sw[ee.L])*ee.R,Et=Et/2*ee.B,ee.sa=be,ee.ta=qe+je,ee.qa=ee.sa,ee.ra=ee.ta+16*Se*ee.R+Et,ee.Ha=ee.qa,ee.Ia=ee.ra+8*Se*ee.B+Et,ee.$c=0,qe+=me,ee.mb=Fe?be:null,ee.nb=Fe?qe:null,e(qe+Fe<=ee.Fc+ee.Vb),Lu(ee),i(ee.Ac,ee.Bc,0,Le),Se=1}}if(Se){if(Ie.ka=0,Ie.y=ee.sa,Ie.O=ee.ta,Ie.f=ee.qa,Ie.N=ee.ra,Ie.ea=ee.Ha,Ie.Vd=ee.Ia,Ie.fa=ee.R,Ie.Rc=ee.B,Ie.F=null,Ie.J=0,!wG){for(Se=-255;255>=Se;++Se)CG[255+Se]=0>Se?-Se:Se;for(Se=-1020;1020>=Se;++Se)IG[1020+Se]=-128>Se?-128:127<Se?127:Se;for(Se=-112;112>=Se;++Se)BG[112+Se]=-16>Se?-16:15<Se?15:Se;for(Se=-255;510>=Se;++Se)vG[255+Se]=0>Se?0:255<Se?255:Se;wG=1}hc=nw,Zu=b1,io=x1,QA=to,NA=iw,is=O1,wr=aw,Yr=cw,_o=B,eE=L,Kh=Pu,dw=uw,cG=Ae,uG=he,lG=Hf,hG=ku,gG=sw,dG=ow,Ts[0]=Y1,Ts[1]=Nf,Ts[2]=G1,Ts[3]=j1,Ts[4]=H1,Ts[5]=qo,Ts[6]=Jo,Ts[7]=z1,Ts[8]=Uh,Ts[9]=J1,gc[0]=ic,gc[1]=K1,gc[2]=k1,gc[3]=Kf,gc[4]=P1,gc[5]=bu,gc[6]=kf,$o[0]=Fh,$o[1]=N1,$o[2]=Pf,$o[3]=xu,$o[4]=Gf,$o[5]=q1,$o[6]=jf,Se=1}else Se=0}Se&&(Se=function(hA,Hr){for(hA.M=0;hA.M<hA.Va;++hA.M){var Vt,pt=hA.Jc[hA.M&hA.Xb],$e=hA.m,Sr=hA;for(Vt=0;Vt<Sr.za;++Vt){var Yt=$e,fA=Sr,zA=fA.Ac,Ii=fA.Bc+4*Vt,$i=fA.zc,ur=fA.ya[fA.aa+Vt];if(fA.Qa.Bb?ur.$b=de(Yt,fA.Pa.jb[0])?2+de(Yt,fA.Pa.jb[2]):de(Yt,fA.Pa.jb[1]):ur.$b=0,fA.kc&&(ur.Ad=de(Yt,fA.Bd)),ur.Za=!de(Yt,145)+0,ur.Za){var Gi=ur.Ob,en=0;for(fA=0;4>fA;++fA){var zr,IA=$i[0+fA];for(zr=0;4>zr;++zr){IA=QQe[zA[Ii+zr]][IA];for(var TA=yG[de(Yt,IA[0])];0<TA;)TA=yG[2*TA+de(Yt,IA[TA])];IA=-TA,zA[Ii+zr]=IA}r(Gi,en,zA,Ii,4),en+=4,$i[0+fA]=IA}}else IA=de(Yt,156)?de(Yt,128)?1:3:de(Yt,163)?2:0,ur.Ob[0]=IA,i(zA,Ii,IA,4),i($i,0,IA,4);ur.Dd=de(Yt,142)?de(Yt,114)?de(Yt,183)?1:3:2:0}if(Sr.m.Ka)return Fr(hA,7,"Premature end-of-partition0 encountered.");for(;hA.ja<hA.za;++hA.ja){if(Sr=pt,Yt=($e=hA).rb[$e.sb-1],zA=$e.rb[$e.sb+$e.ja],Vt=$e.ya[$e.aa+$e.ja],Ii=$e.kc?Vt.Ad:0)Yt.la=zA.la=0,Vt.Za||(Yt.Na=zA.Na=0),Vt.Hc=0,Vt.Gc=0,Vt.ia=0;else{var lr,UA;if(Yt=zA,zA=Sr,Ii=$e.Pa.Xc,$i=$e.ya[$e.aa+$e.ja],ur=$e.pb[$i.$b],fA=$i.ad,Gi=0,en=$e.rb[$e.sb-1],IA=zr=0,i(fA,Gi,0,384),$i.Za)var Bi=0,Us=Ii[3];else{TA=n(16);var mr=Yt.Na+en.Na;if(mr=AE(zA,Ii[1],mr,ur.Eb,0,TA,0),Yt.Na=en.Na=(0<mr)+0,1<mr)hc(TA,0,fA,Gi);else{var En=TA[0]+3>>3;for(TA=0;256>TA;TA+=16)fA[Gi+TA]=En}Bi=1,Us=Ii[0]}var KA=15&Yt.la,Jr=15&en.la;for(TA=0;4>TA;++TA){var Fn=1&Jr;for(En=UA=0;4>En;++En)KA=KA>>1|(Fn=(mr=AE(zA,Us,mr=Fn+(1&KA),ur.Sc,Bi,fA,Gi))>Bi)<<7,UA=UA<<2|(3<mr?3:1<mr?2:fA[Gi+0]!=0),Gi+=16;KA>>=4,Jr=Jr>>1|Fn<<7,zr=(zr<<8|UA)>>>0}for(Us=KA,Bi=Jr>>4,lr=0;4>lr;lr+=2){for(UA=0,KA=Yt.la>>4+lr,Jr=en.la>>4+lr,TA=0;2>TA;++TA){for(Fn=1&Jr,En=0;2>En;++En)mr=Fn+(1&KA),KA=KA>>1|(Fn=0<(mr=AE(zA,Ii[2],mr,ur.Qc,0,fA,Gi)))<<3,UA=UA<<2|(3<mr?3:1<mr?2:fA[Gi+0]!=0),Gi+=16;KA>>=2,Jr=Jr>>1|Fn<<5}IA|=UA<<4*lr,Us|=KA<<4<<lr,Bi|=(240&Jr)<<lr}Yt.la=Us,en.la=Bi,$i.Hc=zr,$i.Gc=IA,$i.ia=43690&IA?0:ur.ia,Ii=!(zr|IA)}if(0<$e.L&&($e.wa[$e.Y+$e.ja]=$e.gd[Vt.$b][Vt.Za],$e.wa[$e.Y+$e.ja].La|=!Ii),Sr.Ka)return Fr(hA,7,"Premature end-of-file encountered.")}if(Lu(hA),$e=Hr,Sr=1,Vt=(pt=hA).D,Yt=0<pt.L&&pt.M>=pt.zb&&pt.M<=pt.Va,pt.Aa==0)t:{if(Vt.M=pt.M,Vt.uc=Yt,rs(pt,Vt),Sr=1,Vt=(UA=pt.D).Nb,Yt=(IA=Sw[pt.L])*pt.R,zA=IA/2*pt.B,TA=16*Vt*pt.R,En=8*Vt*pt.B,Ii=pt.sa,$i=pt.ta-Yt+TA,ur=pt.qa,fA=pt.ra-zA+En,Gi=pt.Ha,en=pt.Ia-zA+En,Jr=(KA=UA.M)==0,zr=KA>=pt.Va-1,pt.Aa==2&&rs(pt,UA),UA.uc)for(Fn=(mr=pt).D.M,e(mr.D.uc),UA=mr.yb;UA<mr.Hb;++UA){Bi=UA,Us=Fn;var tn=(On=(vi=mr).D).Nb;lr=vi.R;var On=On.wa[On.Y+Bi],bn=vi.sa,Cn=vi.ta+16*tn*lr+16*Bi,xn=On.dd,jA=On.tc;if(jA!=0)if(e(3<=jA),vi.L==1)0<Bi&&hG(bn,Cn,lr,jA+4),On.La&&dG(bn,Cn,lr,jA),0<Us&&lG(bn,Cn,lr,jA+4),On.La&&gG(bn,Cn,lr,jA);else{var Nn=vi.B,Ls=vi.qa,Xu=vi.ra+8*tn*Nn+8*Bi,ea=vi.Ha,vi=vi.Ia+8*tn*Nn+8*Bi;tn=On.ld,0<Bi&&(Yr(bn,Cn,lr,jA+4,xn,tn),eE(Ls,Xu,ea,vi,Nn,jA+4,xn,tn)),On.La&&(dw(bn,Cn,lr,jA,xn,tn),uG(Ls,Xu,ea,vi,Nn,jA,xn,tn)),0<Us&&(wr(bn,Cn,lr,jA+4,xn,tn),_o(Ls,Xu,ea,vi,Nn,jA+4,xn,tn)),On.La&&(Kh(bn,Cn,lr,jA,xn,tn),cG(Ls,Xu,ea,vi,Nn,jA,xn,tn))}}if(pt.ia&&alert("todo:DitherRow"),$e.put!=null){if(UA=16*KA,KA=16*(KA+1),Jr?($e.y=pt.sa,$e.O=pt.ta+TA,$e.f=pt.qa,$e.N=pt.ra+En,$e.ea=pt.Ha,$e.W=pt.Ia+En):(UA-=IA,$e.y=Ii,$e.O=$i,$e.f=ur,$e.N=fA,$e.ea=Gi,$e.W=en),zr||(KA-=IA),KA>$e.o&&(KA=$e.o),$e.F=null,$e.J=null,pt.Fa!=null&&0<pt.Fa.length&&UA<KA&&($e.J=Or(pt,$e,UA,KA-UA),$e.F=pt.mb,$e.F==null&&$e.F.length==0)){Sr=Fr(pt,3,"Could not decode alpha data.");break t}UA<$e.j&&(IA=$e.j-UA,UA=$e.j,e(!(1&IA)),$e.O+=pt.R*IA,$e.N+=pt.B*(IA>>1),$e.W+=pt.B*(IA>>1),$e.F!=null&&($e.J+=$e.width*IA)),UA<KA&&($e.O+=$e.v,$e.N+=$e.v>>1,$e.W+=$e.v>>1,$e.F!=null&&($e.J+=$e.v),$e.ka=UA-$e.j,$e.U=$e.va-$e.v,$e.T=KA-UA,Sr=$e.put($e))}Vt+1!=pt.Ic||zr||(r(pt.sa,pt.ta-Yt,Ii,$i+16*pt.R,Yt),r(pt.qa,pt.ra-zA,ur,fA+8*pt.B,zA),r(pt.Ha,pt.Ia-zA,Gi,en+8*pt.B,zA))}if(!Sr)return Fr(hA,6,"Output aborted.")}return 1}(ee,Ie)),Ie.bc!=null&&Ie.bc(Ie),Se&=1}return Se?(ee.cb=0,Se):0})(d,y)||(f=d.a)}}else f=d.a}f==0&&K.Oa!=null&&K.Oa.fd&&(f=Vf(K.ba))}K=f}N=K!=0?null:11>N?H.f.RGBA.eb:H.f.kb.y}else N=null;return N};var bG=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(T,q){for(var Q="",R=0;R<4;R++)Q+=String.fromCharCode(T[q++]);return Q}function u(T,q){return T[q+0]|T[q+1]<<8}function l(T,q){return(T[q+0]|T[q+1]<<8|T[q+2]<<16)>>>0}function g(T,q){return(T[q+0]|T[q+1]<<8|T[q+2]<<16|T[q+3]<<24)>>>0}new a;var h=[0],p=[0],C=[],I=new a,E=t,v=function(T,q){var Q={},R=0,G=!1,k=0,te=0;if(Q.frames=[],!function(U,Y){for(var _=0;_<4;_++)if(U[Y+_]!="RIFF".charCodeAt(_))return!0;return!1}(T,q)){for(g(T,q+=4),q+=8;q<T.length;){var X=c(T,q),ie=g(T,q+=4);q+=4;var W=ie+(1&ie);switch(X){case"VP8 ":case"VP8L":Q.frames[R]===void 0&&(Q.frames[R]={}),(Ee=Q.frames[R]).src_off=G?te:q-8,Ee.src_size=k+ie+8,R++,G&&(G=!1,k=0,te=0);break;case"VP8X":(Ee=Q.header={}).feature_flags=T[q];var se=q+4;Ee.canvas_width=1+l(T,se),se+=3,Ee.canvas_height=1+l(T,se),se+=3;break;case"ALPH":G=!0,k=W+8,te=q-8;break;case"ANIM":(Ee=Q.header).bgcolor=g(T,q),se=q+4,Ee.loop_count=u(T,se),se+=2;break;case"ANMF":var Be,Ee;(Ee=Q.frames[R]={}).offset_x=2*l(T,q),q+=3,Ee.offset_y=2*l(T,q),q+=3,Ee.width=1+l(T,q),q+=3,Ee.height=1+l(T,q),q+=3,Ee.duration=l(T,q),q+=3,Be=T[q++],Ee.dispose=1&Be,Ee.blend=Be>>1&1}X!="ANMF"&&(q+=W)}return Q}}(E,0);v.response=E,v.rgbaoutput=!0,v.dataurl=!1;var m=v.header?v.header:null,M=v.frames?v.frames:null;if(m){m.loop_counter=m.loop_count,h=[m.canvas_height],p=[m.canvas_width];for(var O=0;O<M.length&&M[O].blend!=0;O++);}var x=M[0],P=I.WebPDecodeRGBA(E,x.src_off,x.src_size,p,h);x.rgba=P,x.imgwidth=p[0],x.imgheight=h[0];for(var D=0;D<p[0]*h[0]*4;D++)C[D]=P[D];return this.width=p,this.height=h,this.data=C,this}(function(t){var e,A,r,i,n,o,s,a,c,u=function(U){return U=U||{},this.isStrokeTransparent=U.isStrokeTransparent||!1,this.strokeOpacity=U.strokeOpacity||1,this.strokeStyle=U.strokeStyle||"#000000",this.fillStyle=U.fillStyle||"#000000",this.isFillTransparent=U.isFillTransparent||!1,this.fillOpacity=U.fillOpacity||1,this.font=U.font||"10px sans-serif",this.textBaseline=U.textBaseline||"alphabetic",this.textAlign=U.textAlign||"left",this.lineWidth=U.lineWidth||1,this.lineJoin=U.lineJoin||"miter",this.lineCap=U.lineCap||"butt",this.path=U.path||[],this.transform=U.transform!==void 0?U.transform.clone():new a,this.globalCompositeOperation=U.globalCompositeOperation||"normal",this.globalAlpha=U.globalAlpha||1,this.clip_path=U.clip_path||[],this.currentPoint=U.currentPoint||new o,this.miterLimit=U.miterLimit||10,this.lastPoint=U.lastPoint||new o,this.lineDashOffset=U.lineDashOffset||0,this.lineDash=U.lineDash||[],this.margin=U.margin||[0,0,0,0],this.prevPageLastElemOffset=U.prevPageLastElemOffset||0,this.ignoreClearRect=typeof U.ignoreClearRect!="boolean"||U.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new l(this),e=this.internal.f2,A=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,a=this.internal.Matrix,c=new u}]);var l=function(U){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var Y=U;Object.defineProperty(this,"pdf",{get:function(){return Y}});var _=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return _},set:function(z){_=!!z}});var re=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return re},set:function(z){re=!!z}});var ae=0;Object.defineProperty(this,"posX",{get:function(){return ae},set:function(z){isNaN(z)||(ae=z)}});var Z=0;Object.defineProperty(this,"posY",{get:function(){return Z},set:function(z){isNaN(z)||(Z=z)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(z){var b;typeof z=="number"?b=[z,z,z,z]:((b=new Array(4))[0]=z[0],b[1]=z.length>=2?z[1]:b[0],b[2]=z.length>=3?z[2]:b[0],b[3]=z.length>=4?z[3]:b[1]),c.margin=b}});var ce=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ce},set:function(z){ce=z}});var oe=0;Object.defineProperty(this,"lastBreak",{get:function(){return oe},set:function(z){oe=z}});var de=[];Object.defineProperty(this,"pageBreaks",{get:function(){return de},set:function(z){de=z}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(z){z instanceof u&&(c=z)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(z){c.path=z}});var De=[];Object.defineProperty(this,"ctxStack",{get:function(){return De},set:function(z){De=z}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(z){var b;b=g(z),this.ctx.fillStyle=b.style,this.ctx.isFillTransparent=b.a===0,this.ctx.fillOpacity=b.a,this.pdf.setFillColor(b.r,b.g,b.b,{a:b.a}),this.pdf.setTextColor(b.r,b.g,b.b,{a:b.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(z){var b=g(z);this.ctx.strokeStyle=b.style,this.ctx.isStrokeTransparent=b.a===0,this.ctx.strokeOpacity=b.a,b.a===0?this.pdf.setDrawColor(255,255,255):(b.a,this.pdf.setDrawColor(b.r,b.g,b.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(z){["butt","round","square"].indexOf(z)!==-1&&(this.ctx.lineCap=z,this.pdf.setLineCap(z))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(z){isNaN(z)||(this.ctx.lineWidth=z,this.pdf.setLineWidth(z))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(z){["bevel","round","miter"].indexOf(z)!==-1&&(this.ctx.lineJoin=z,this.pdf.setLineJoin(z))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(z){isNaN(z)||(this.ctx.miterLimit=z,this.pdf.setMiterLimit(z))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(z){this.ctx.textBaseline=z}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(z){["right","end","center","left","start"].indexOf(z)!==-1&&(this.ctx.textAlign=z)}});var j=null,J=null;Object.defineProperty(this,"fontFaces",{get:function(){return J},set:function(z){j=null,J=z}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(z){var b;if(this.ctx.font=z,(b=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(z))!==null){var Me=b[1];b[2];var Qe=b[3],Te=b[4];b[5];var Ce=b[6],Re=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Te)[2];Te=Math.floor(Re==="px"?parseFloat(Te)*this.pdf.internal.scaleFactor:Re==="em"?parseFloat(Te)*this.pdf.getFontSize():parseFloat(Te)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Te);var ve=function(At){var _e,It,yt=[],tt=At.trim();if(tt==="")return _m;if(tt in jb)return[jb[tt]];for(;tt!=="";){switch(It=null,_e=(tt=Hb(tt)).charAt(0)){case'"':case"'":It=wne(tt.substring(1),_e);break;default:It=Sne(tt)}if(It===null||(yt.push(It[0]),(tt=Hb(It[1]))!==""&&tt.charAt(0)!==","))return _m;tt=tt.replace(/^,/,"")}return yt}(Ce);if(this.fontFaces){var Ke=function(At,_e){if(j===null){var It=function(yt){var tt=[];return Object.keys(yt).forEach(function(et){yt[et].forEach(function(St){var ct=null;switch(St){case"bold":ct={family:et,weight:"bold"};break;case"italic":ct={family:et,style:"italic"};break;case"bolditalic":ct={family:et,weight:"bold",style:"italic"};break;case"":case"normal":ct={family:et}}ct!==null&&(ct.ref={name:et,style:St},tt.push(ct))})}),tt}(At.getFontList());j=function(yt){for(var tt={},et=0;et<yt.length;++et){var St=Xm(yt[et]),ct=St.family,Rt=St.stretch,Ge=St.style,Jt=St.weight;tt[ct]=tt[ct]||{},tt[ct][Rt]=tt[ct][Rt]||{},tt[ct][Rt][Ge]=tt[ct][Rt][Ge]||{},tt[ct][Rt][Ge][Jt]=St}return tt}(It.concat(_e))}return j}(this.pdf,this.fontFaces),Ue=ve.map(function(At){return{family:At,stretch:"normal",weight:Qe,style:Me}}),ke=function(At,_e,It){for(var yt=(It=It||{}).defaultFontFamily||"times",tt=Object.assign({},vne,It.genericFontFamilies||{}),et=null,St=null,ct=0;ct<_e.length;++ct)if(tt[(et=Xm(_e[ct])).family]&&(et.family=tt[et.family]),At.hasOwnProperty(et.family)){St=At[et.family];break}if(!(St=St||At[yt]))throw new Error("Could not find a font-family for the rule '"+Yb(et)+"' and default family '"+yt+"'.");if(St=function(Rt,Ge){if(Ge[Rt])return Ge[Rt];var Jt=Zm[Rt],oA=Jt<=Zm.normal?-1:1,Qt=Gb(Ge,kb,Jt,oA);if(!Qt)throw new Error("Could not find a matching font-stretch value for "+Rt);return Qt}(et.stretch,St),St=function(Rt,Ge){if(Ge[Rt])return Ge[Rt];for(var Jt=Kb[Rt],oA=0;oA<Jt.length;++oA)if(Ge[Jt[oA]])return Ge[Jt[oA]];throw new Error("Could not find a matching font-style for "+Rt)}(et.style,St),!(St=function(Rt,Ge){if(Ge[Rt])return Ge[Rt];if(Rt===400&&Ge[500])return Ge[500];if(Rt===500&&Ge[400])return Ge[400];var Jt=Bne[Rt],oA=Gb(Ge,Pb,Jt,Rt<400?-1:1);if(!oA)throw new Error("Could not find a matching font-weight for value "+Rt);return oA}(et.weight,St)))throw new Error("Failed to resolve a font for the rule '"+Yb(et)+"'.");return St}(Ke,Ue);this.pdf.setFont(ke.ref.name,ke.ref.style)}else{var Ye="";(Qe==="bold"||parseInt(Qe,10)>=700||Me==="bold")&&(Ye="bold"),Me==="italic"&&(Ye+="italic"),Ye.length===0&&(Ye="normal");for(var Je="",rt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Ze=0;Ze<ve.length;Ze++){if(this.pdf.internal.getFont(ve[Ze],Ye,{noFallback:!0,disableWarning:!0})!==void 0){Je=ve[Ze];break}if(Ye==="bolditalic"&&this.pdf.internal.getFont(ve[Ze],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Je=ve[Ze],Ye="bold";else if(this.pdf.internal.getFont(ve[Ze],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Je=ve[Ze],Ye="normal";break}}if(Je===""){for(var We=0;We<ve.length;We++)if(rt[ve[We]]){Je=rt[ve[We]];break}}Je=Je===""?"Times":Je,this.pdf.setFont(Je,Ye)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(z){this.ctx.globalCompositeOperation=z}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(z){this.ctx.globalAlpha=z}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(z){this.ctx.lineDashOffset=z,Ee.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(z){this.ctx.lineDash=z,Ee.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(z){this.ctx.ignoreClearRect=!!z}})};l.prototype.setLineDash=function(U){this.lineDash=U},l.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},l.prototype.fill=function(){M.call(this,"fill",!1)},l.prototype.stroke=function(){M.call(this,"stroke",!1)},l.prototype.beginPath=function(){this.path=[{type:"begin"}]},l.prototype.moveTo=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var _=this.ctx.transform.applyToPoint(new o(U,Y));this.path.push({type:"mt",x:_.x,y:_.y}),this.ctx.lastPoint=new o(U,Y)},l.prototype.closePath=function(){var U=new o(0,0),Y=0;for(Y=this.path.length-1;Y!==-1;Y--)if(this.path[Y].type==="begin"&&BA(this.path[Y+1])==="object"&&typeof this.path[Y+1].x=="number"){U=new o(this.path[Y+1].x,this.path[Y+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(U.x,U.y)},l.prototype.lineTo=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var _=this.ctx.transform.applyToPoint(new o(U,Y));this.path.push({type:"lt",x:_.x,y:_.y}),this.ctx.lastPoint=new o(_.x,_.y)},l.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),M.call(this,null,!0)},l.prototype.quadraticCurveTo=function(U,Y,_,re){if(isNaN(_)||isNaN(re)||isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var ae=this.ctx.transform.applyToPoint(new o(_,re)),Z=this.ctx.transform.applyToPoint(new o(U,Y));this.path.push({type:"qct",x1:Z.x,y1:Z.y,x:ae.x,y:ae.y}),this.ctx.lastPoint=new o(ae.x,ae.y)},l.prototype.bezierCurveTo=function(U,Y,_,re,ae,Z){if(isNaN(ae)||isNaN(Z)||isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ce=this.ctx.transform.applyToPoint(new o(ae,Z)),oe=this.ctx.transform.applyToPoint(new o(U,Y)),de=this.ctx.transform.applyToPoint(new o(_,re));this.path.push({type:"bct",x1:oe.x,y1:oe.y,x2:de.x,y2:de.y,x:ce.x,y:ce.y}),this.ctx.lastPoint=new o(ce.x,ce.y)},l.prototype.arc=function(U,Y,_,re,ae,Z){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re)||isNaN(ae))throw xA.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Z=!!Z,!this.ctx.transform.isIdentity){var ce=this.ctx.transform.applyToPoint(new o(U,Y));U=ce.x,Y=ce.y;var oe=this.ctx.transform.applyToPoint(new o(0,_)),de=this.ctx.transform.applyToPoint(new o(0,0));_=Math.sqrt(Math.pow(oe.x-de.x,2)+Math.pow(oe.y-de.y,2))}Math.abs(ae-re)>=2*Math.PI&&(re=0,ae=2*Math.PI),this.path.push({type:"arc",x:U,y:Y,radius:_,startAngle:re,endAngle:ae,counterclockwise:Z})},l.prototype.arcTo=function(U,Y,_,re,ae){throw new Error("arcTo not implemented.")},l.prototype.rect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(U,Y),this.lineTo(U+_,Y),this.lineTo(U+_,Y+re),this.lineTo(U,Y+re),this.lineTo(U,Y),this.lineTo(U+_,Y),this.lineTo(U,Y)},l.prototype.fillRect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var ae={};this.lineCap!=="butt"&&(ae.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(ae.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(U,Y,_,re),this.fill(),ae.hasOwnProperty("lineCap")&&(this.lineCap=ae.lineCap),ae.hasOwnProperty("lineJoin")&&(this.lineJoin=ae.lineJoin)}},l.prototype.strokeRect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(U,Y,_,re),this.stroke())},l.prototype.clearRect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(U,Y,_,re))},l.prototype.save=function(U){U=typeof U!="boolean"||U;for(var Y=this.pdf.internal.getCurrentPageInfo().pageNumber,_=0;_<this.pdf.internal.getNumberOfPages();_++)this.pdf.setPage(_+1),this.pdf.internal.out("q");if(this.pdf.setPage(Y),U){this.ctx.fontSize=this.pdf.internal.getFontSize();var re=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=re}},l.prototype.restore=function(U){U=typeof U!="boolean"||U;for(var Y=this.pdf.internal.getCurrentPageInfo().pageNumber,_=0;_<this.pdf.internal.getNumberOfPages();_++)this.pdf.setPage(_+1),this.pdf.internal.out("Q");this.pdf.setPage(Y),U&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},l.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var g=function(U){var Y,_,re,ae;if(U.isCanvasGradient===!0&&(U=U.getColor()),!U)return{r:0,g:0,b:0,a:0,style:U};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(U))Y=0,_=0,re=0,ae=0;else{var Z=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(U);if(Z!==null)Y=parseInt(Z[1]),_=parseInt(Z[2]),re=parseInt(Z[3]),ae=1;else if((Z=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(U))!==null)Y=parseInt(Z[1]),_=parseInt(Z[2]),re=parseInt(Z[3]),ae=parseFloat(Z[4]);else{if(ae=1,typeof U=="string"&&U.charAt(0)!=="#"){var ce=new yb(U);U=ce.ok?ce.toHex():"#000000"}U.length===4?(Y=U.substring(1,2),Y+=Y,_=U.substring(2,3),_+=_,re=U.substring(3,4),re+=re):(Y=U.substring(1,3),_=U.substring(3,5),re=U.substring(5,7)),Y=parseInt(Y,16),_=parseInt(_,16),re=parseInt(re,16)}}return{r:Y,g:_,b:re,a:ae,style:U}},h=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};l.prototype.fillText=function(U,Y,_,re){if(isNaN(Y)||isNaN(_)||typeof U!="string")throw xA.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(re=isNaN(re)?void 0:re,!h.call(this)){var ae=W(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;R.call(this,{text:U,x:Y,y:_,scale:Z,angle:ae,align:this.textAlign,maxWidth:re})}},l.prototype.strokeText=function(U,Y,_,re){if(isNaN(Y)||isNaN(_)||typeof U!="string")throw xA.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){re=isNaN(re)?void 0:re;var ae=W(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;R.call(this,{text:U,x:Y,y:_,scale:Z,renderingMode:"stroke",angle:ae,align:this.textAlign,maxWidth:re})}},l.prototype.measureText=function(U){if(typeof U!="string")throw xA.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var Y=this.pdf,_=this.pdf.internal.scaleFactor,re=Y.internal.getFontSize(),ae=Y.getStringUnitWidth(U)*re/Y.internal.scaleFactor;return new function(Z){var ce=(Z=Z||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return ce}}),this}({width:ae*=Math.round(96*_/72*1e4)/1e4})},l.prototype.scale=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var _=new a(U,0,0,Y,0,0);this.ctx.transform=this.ctx.transform.multiply(_)},l.prototype.rotate=function(U){if(isNaN(U))throw xA.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var Y=new a(Math.cos(U),Math.sin(U),-Math.sin(U),Math.cos(U),0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},l.prototype.translate=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var _=new a(1,0,0,1,U,Y);this.ctx.transform=this.ctx.transform.multiply(_)},l.prototype.transform=function(U,Y,_,re,ae,Z){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re)||isNaN(ae)||isNaN(Z))throw xA.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ce=new a(U,Y,_,re,ae,Z);this.ctx.transform=this.ctx.transform.multiply(ce)},l.prototype.setTransform=function(U,Y,_,re,ae,Z){U=isNaN(U)?1:U,Y=isNaN(Y)?0:Y,_=isNaN(_)?0:_,re=isNaN(re)?1:re,ae=isNaN(ae)?0:ae,Z=isNaN(Z)?0:Z,this.ctx.transform=new a(U,Y,_,re,ae,Z)};var C=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};l.prototype.drawImage=function(U,Y,_,re,ae,Z,ce,oe,de){var De=this.pdf.getImageProperties(U),j=1,J=1,z=1,b=1;re!==void 0&&oe!==void 0&&(z=oe/re,b=de/ae,j=De.width/re*oe/re,J=De.height/ae*de/ae),Z===void 0&&(Z=Y,ce=_,Y=0,_=0),re!==void 0&&oe===void 0&&(oe=re,de=ae),re===void 0&&oe===void 0&&(oe=De.width,de=De.height);for(var Me,Qe=this.ctx.transform.decompose(),Te=W(Qe.rotate.shx),Ce=new a,Re=(Ce=(Ce=(Ce=Ce.multiply(Qe.translate)).multiply(Qe.skew)).multiply(Qe.scale)).applyToRectangle(new s(Z-Y*z,ce-_*b,re*j,ae*J)),ve=I.call(this,Re),Ke=[],Ue=0;Ue<ve.length;Ue+=1)Ke.indexOf(ve[Ue])===-1&&Ke.push(ve[Ue]);if(m(Ke),this.autoPaging)for(var ke=Ke[0],Ye=Ke[Ke.length-1],Je=ke;Je<Ye+1;Je++){this.pdf.setPage(Je);var rt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ze=Je===1?this.posY+this.margin[0]:this.margin[0],We=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],At=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],_e=Je===1?0:We+(Je-2)*At;if(this.ctx.clip_path.length!==0){var It=this.path;Me=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Me,this.posX+this.margin[3],-_e+Ze+this.ctx.prevPageLastElemOffset),O.call(this,"fill",!0),this.path=It}var yt=JSON.parse(JSON.stringify(Re));yt=v([yt],this.posX+this.margin[3],-_e+Ze+this.ctx.prevPageLastElemOffset)[0];var tt=(Je>ke||Je<Ye)&&C.call(this);tt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],rt,At,null).clip().discardPath()),this.pdf.addImage(U,"JPEG",yt.x,yt.y,yt.w,yt.h,null,null,Te),tt&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(U,"JPEG",Re.x,Re.y,Re.w,Re.h,null,null,Te)};var I=function(U,Y,_){var re=[];Y=Y||this.pdf.internal.pageSize.width,_=_||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var ae=this.posY+this.ctx.prevPageLastElemOffset;switch(U.type){default:case"mt":case"lt":re.push(Math.floor((U.y+ae)/_)+1);break;case"arc":re.push(Math.floor((U.y+ae-U.radius)/_)+1),re.push(Math.floor((U.y+ae+U.radius)/_)+1);break;case"qct":var Z=se(this.ctx.lastPoint.x,this.ctx.lastPoint.y,U.x1,U.y1,U.x,U.y);re.push(Math.floor((Z.y+ae)/_)+1),re.push(Math.floor((Z.y+Z.h+ae)/_)+1);break;case"bct":var ce=Be(this.ctx.lastPoint.x,this.ctx.lastPoint.y,U.x1,U.y1,U.x2,U.y2,U.x,U.y);re.push(Math.floor((ce.y+ae)/_)+1),re.push(Math.floor((ce.y+ce.h+ae)/_)+1);break;case"rect":re.push(Math.floor((U.y+ae)/_)+1),re.push(Math.floor((U.y+U.h+ae)/_)+1)}for(var oe=0;oe<re.length;oe+=1)for(;this.pdf.internal.getNumberOfPages()<re[oe];)E.call(this);return re},E=function(){var U=this.fillStyle,Y=this.strokeStyle,_=this.font,re=this.lineCap,ae=this.lineWidth,Z=this.lineJoin;this.pdf.addPage(),this.fillStyle=U,this.strokeStyle=Y,this.font=_,this.lineCap=re,this.lineWidth=ae,this.lineJoin=Z},v=function(U,Y,_){for(var re=0;re<U.length;re++)switch(U[re].type){case"bct":U[re].x2+=Y,U[re].y2+=_;case"qct":U[re].x1+=Y,U[re].y1+=_;default:U[re].x+=Y,U[re].y+=_}return U},m=function(U){return U.sort(function(Y,_){return Y-_})},M=function(U,Y){for(var _,re,ae=this.fillStyle,Z=this.strokeStyle,ce=this.lineCap,oe=this.lineWidth,de=Math.abs(oe*this.ctx.transform.scaleX),De=this.lineJoin,j=JSON.parse(JSON.stringify(this.path)),J=JSON.parse(JSON.stringify(this.path)),z=[],b=0;b<J.length;b++)if(J[b].x!==void 0)for(var Me=I.call(this,J[b]),Qe=0;Qe<Me.length;Qe+=1)z.indexOf(Me[Qe])===-1&&z.push(Me[Qe]);for(var Te=0;Te<z.length;Te++)for(;this.pdf.internal.getNumberOfPages()<z[Te];)E.call(this);if(m(z),this.autoPaging)for(var Ce=z[0],Re=z[z.length-1],ve=Ce;ve<Re+1;ve++){this.pdf.setPage(ve),this.fillStyle=ae,this.strokeStyle=Z,this.lineCap=ce,this.lineWidth=de,this.lineJoin=De;var Ke=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ue=ve===1?this.posY+this.margin[0]:this.margin[0],ke=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ye=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Je=ve===1?0:ke+(ve-2)*Ye;if(this.ctx.clip_path.length!==0){var rt=this.path;_=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(_,this.posX+this.margin[3],-Je+Ue+this.ctx.prevPageLastElemOffset),O.call(this,U,!0),this.path=rt}if(re=JSON.parse(JSON.stringify(j)),this.path=v(re,this.posX+this.margin[3],-Je+Ue+this.ctx.prevPageLastElemOffset),Y===!1||ve===0){var Ze=(ve>Ce||ve<Re)&&C.call(this);Ze&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ke,Ye,null).clip().discardPath()),O.call(this,U,Y),Ze&&this.pdf.restoreGraphicsState()}this.lineWidth=oe}else this.lineWidth=de,O.call(this,U,Y),this.lineWidth=oe;this.path=j},O=function(U,Y){if((U!=="stroke"||Y||!p.call(this))&&(U==="stroke"||Y||!h.call(this))){for(var _,re,ae=[],Z=this.path,ce=0;ce<Z.length;ce++){var oe=Z[ce];switch(oe.type){case"begin":ae.push({begin:!0});break;case"close":ae.push({close:!0});break;case"mt":ae.push({start:oe,deltas:[],abs:[]});break;case"lt":var de=ae.length;if(Z[ce-1]&&!isNaN(Z[ce-1].x)&&(_=[oe.x-Z[ce-1].x,oe.y-Z[ce-1].y],de>0)){for(;de>=0;de--)if(ae[de-1].close!==!0&&ae[de-1].begin!==!0){ae[de-1].deltas.push(_),ae[de-1].abs.push(oe);break}}break;case"bct":_=[oe.x1-Z[ce-1].x,oe.y1-Z[ce-1].y,oe.x2-Z[ce-1].x,oe.y2-Z[ce-1].y,oe.x-Z[ce-1].x,oe.y-Z[ce-1].y],ae[ae.length-1].deltas.push(_);break;case"qct":var De=Z[ce-1].x+2/3*(oe.x1-Z[ce-1].x),j=Z[ce-1].y+2/3*(oe.y1-Z[ce-1].y),J=oe.x+2/3*(oe.x1-oe.x),z=oe.y+2/3*(oe.y1-oe.y),b=oe.x,Me=oe.y;_=[De-Z[ce-1].x,j-Z[ce-1].y,J-Z[ce-1].x,z-Z[ce-1].y,b-Z[ce-1].x,Me-Z[ce-1].y],ae[ae.length-1].deltas.push(_);break;case"arc":ae.push({deltas:[],abs:[],arc:!0}),Array.isArray(ae[ae.length-1].abs)&&ae[ae.length-1].abs.push(oe)}}re=Y?null:U==="stroke"?"stroke":"fill";for(var Qe=!1,Te=0;Te<ae.length;Te++)if(ae[Te].arc)for(var Ce=ae[Te].abs,Re=0;Re<Ce.length;Re++){var ve=Ce[Re];ve.type==="arc"?D.call(this,ve.x,ve.y,ve.radius,ve.startAngle,ve.endAngle,ve.counterclockwise,void 0,Y,!Qe):G.call(this,ve.x,ve.y),Qe=!0}else if(ae[Te].close===!0)this.pdf.internal.out("h"),Qe=!1;else if(ae[Te].begin!==!0){var Ke=ae[Te].start.x,Ue=ae[Te].start.y;k.call(this,ae[Te].deltas,Ke,Ue),Qe=!0}re&&T.call(this,re),Y&&q.call(this)}},x=function(U){var Y=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,_=Y*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return U-_;case"top":return U+Y-_;case"hanging":return U+Y-2*_;case"middle":return U+Y/2-_;default:return U}},P=function(U){return U+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};l.prototype.createLinearGradient=function(){var U=function(){};return U.colorStops=[],U.addColorStop=function(Y,_){this.colorStops.push([Y,_])},U.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},U.isCanvasGradient=!0,U},l.prototype.createPattern=function(){return this.createLinearGradient()},l.prototype.createRadialGradient=function(){return this.createLinearGradient()};var D=function(U,Y,_,re,ae,Z,ce,oe,de){for(var De=X.call(this,_,re,ae,Z),j=0;j<De.length;j++){var J=De[j];j===0&&(de?Q.call(this,J.x1+U,J.y1+Y):G.call(this,J.x1+U,J.y1+Y)),te.call(this,U,Y,J.x2,J.y2,J.x3,J.y3,J.x4,J.y4)}oe?q.call(this):T.call(this,ce)},T=function(U){switch(U){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},q=function(){this.pdf.clip(),this.pdf.discardPath()},Q=function(U,Y){this.pdf.internal.out(A(U)+" "+r(Y)+" m")},R=function(U){var Y;switch(U.align){case"right":case"end":Y="right";break;case"center":Y="center";break;default:Y="left"}var _=this.pdf.getTextDimensions(U.text),re=x.call(this,U.y),ae=P.call(this,re)-_.h,Z=this.ctx.transform.applyToPoint(new o(U.x,re)),ce=this.ctx.transform.decompose(),oe=new a;oe=(oe=(oe=oe.multiply(ce.translate)).multiply(ce.skew)).multiply(ce.scale);for(var de,De,j,J=this.ctx.transform.applyToRectangle(new s(U.x,re,_.w,_.h)),z=oe.applyToRectangle(new s(U.x,ae,_.w,_.h)),b=I.call(this,z),Me=[],Qe=0;Qe<b.length;Qe+=1)Me.indexOf(b[Qe])===-1&&Me.push(b[Qe]);if(m(Me),this.autoPaging)for(var Te=Me[0],Ce=Me[Me.length-1],Re=Te;Re<Ce+1;Re++){this.pdf.setPage(Re);var ve=Re===1?this.posY+this.margin[0]:this.margin[0],Ke=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[2],ke=Ue-this.margin[0],Ye=this.pdf.internal.pageSize.width-this.margin[1],Je=Ye-this.margin[3],rt=Re===1?0:Ke+(Re-2)*ke;if(this.ctx.clip_path.length!==0){var Ze=this.path;de=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(de,this.posX+this.margin[3],-1*rt+ve),O.call(this,"fill",!0),this.path=Ze}var We=v([JSON.parse(JSON.stringify(z))],this.posX+this.margin[3],-rt+ve+this.ctx.prevPageLastElemOffset)[0];U.scale>=.01&&(De=this.pdf.internal.getFontSize(),this.pdf.setFontSize(De*U.scale),j=this.lineWidth,this.lineWidth=j*U.scale);var At=this.autoPaging!=="text";if(At||We.y+We.h<=Ue){if(At||We.y>=ve&&We.x<=Ye){var _e=At?U.text:this.pdf.splitTextToSize(U.text,U.maxWidth||Ye-We.x)[0],It=v([JSON.parse(JSON.stringify(J))],this.posX+this.margin[3],-rt+ve+this.ctx.prevPageLastElemOffset)[0],yt=At&&(Re>Te||Re<Ce)&&C.call(this);yt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Je,ke,null).clip().discardPath()),this.pdf.text(_e,It.x,It.y,{angle:U.angle,align:Y,renderingMode:U.renderingMode}),yt&&this.pdf.restoreGraphicsState()}}else We.y<Ue&&(this.ctx.prevPageLastElemOffset+=Ue-We.y);U.scale>=.01&&(this.pdf.setFontSize(De),this.lineWidth=j)}else U.scale>=.01&&(De=this.pdf.internal.getFontSize(),this.pdf.setFontSize(De*U.scale),j=this.lineWidth,this.lineWidth=j*U.scale),this.pdf.text(U.text,Z.x+this.posX,Z.y+this.posY,{angle:U.angle,align:Y,renderingMode:U.renderingMode,maxWidth:U.maxWidth}),U.scale>=.01&&(this.pdf.setFontSize(De),this.lineWidth=j)},G=function(U,Y,_,re){_=_||0,re=re||0,this.pdf.internal.out(A(U+_)+" "+r(Y+re)+" l")},k=function(U,Y,_){return this.pdf.lines(U,Y,_,null,null)},te=function(U,Y,_,re,ae,Z,ce,oe){this.pdf.internal.out([e(i(_+U)),e(n(re+Y)),e(i(ae+U)),e(n(Z+Y)),e(i(ce+U)),e(n(oe+Y)),"c"].join(" "))},X=function(U,Y,_,re){for(var ae=2*Math.PI,Z=Math.PI/2;Y>_;)Y-=ae;var ce=Math.abs(_-Y);ce<ae&&re&&(ce=ae-ce);for(var oe=[],de=re?-1:1,De=Y;ce>1e-5;){var j=De+de*Math.min(ce,Z);oe.push(ie.call(this,U,De,j)),ce-=Math.abs(j-De),De=j}return oe},ie=function(U,Y,_){var re=(_-Y)/2,ae=U*Math.cos(re),Z=U*Math.sin(re),ce=ae,oe=-Z,de=ce*ce+oe*oe,De=de+ce*ae+oe*Z,j=4/3*(Math.sqrt(2*de*De)-De)/(ce*Z-oe*ae),J=ce-j*oe,z=oe+j*ce,b=J,Me=-z,Qe=re+Y,Te=Math.cos(Qe),Ce=Math.sin(Qe);return{x1:U*Math.cos(Y),y1:U*Math.sin(Y),x2:J*Te-z*Ce,y2:J*Ce+z*Te,x3:b*Te-Me*Ce,y3:b*Ce+Me*Te,x4:U*Math.cos(_),y4:U*Math.sin(_)}},W=function(U){return 180*U/Math.PI},se=function(U,Y,_,re,ae,Z){var ce=U+.5*(_-U),oe=Y+.5*(re-Y),de=ae+.5*(_-ae),De=Z+.5*(re-Z),j=Math.min(U,ae,ce,de),J=Math.max(U,ae,ce,de),z=Math.min(Y,Z,oe,De),b=Math.max(Y,Z,oe,De);return new s(j,z,J-j,b-z)},Be=function(U,Y,_,re,ae,Z,ce,oe){var de,De,j,J,z,b,Me,Qe,Te,Ce,Re,ve,Ke,Ue,ke=_-U,Ye=re-Y,Je=ae-_,rt=Z-re,Ze=ce-ae,We=oe-Z;for(De=0;De<41;De++)Te=(Me=(j=U+(de=De/40)*ke)+de*((z=_+de*Je)-j))+de*(z+de*(ae+de*Ze-z)-Me),Ce=(Qe=(J=Y+de*Ye)+de*((b=re+de*rt)-J))+de*(b+de*(Z+de*We-b)-Qe),De==0?(Re=Te,ve=Ce,Ke=Te,Ue=Ce):(Re=Math.min(Re,Te),ve=Math.min(ve,Ce),Ke=Math.max(Ke,Te),Ue=Math.max(Ue,Ce));return new s(Math.round(Re),Math.round(ve),Math.round(Ke-Re),Math.round(Ue-ve))},Ee=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var U,Y,_=(U=this.ctx.lineDash,Y=this.ctx.lineDashOffset,JSON.stringify({lineDash:U,lineDashOffset:Y}));this.prevLineDash!==_&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=_)}}})(Ct.API),function(t){var e=function(o){var s,a,c,u,l,g,h,p,C,I;for(a=[],c=0,u=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;u>c;c+=4)(l=(o.charCodeAt(c)<<24)+(o.charCodeAt(c+1)<<16)+(o.charCodeAt(c+2)<<8)+o.charCodeAt(c+3))!==0?(g=(l=((l=((l=((l=(l-(I=l%85))/85)-(C=l%85))/85)-(p=l%85))/85)-(h=l%85))/85)%85,a.push(g+33,h+33,p+33,C+33,I+33)):a.push(122);return function(E,v){for(var m=v;m>0;m--)E.pop()}(a,s.length),String.fromCharCode.apply(String,a)+"~>"},A=function(o){var s,a,c,u,l,g=String,h="length",p=255,C="charCodeAt",I="slice",E="replace";for(o[I](-2),o=o[I](0,-2)[E](/\s/g,"")[E]("z","!!!!!"),c=[],u=0,l=(o+=s="uuuuu"[I](o[h]%5||5))[h];l>u;u+=5)a=52200625*(o[C](u)-33)+614125*(o[C](u+1)-33)+7225*(o[C](u+2)-33)+85*(o[C](u+3)-33)+(o[C](u+4)-33),c.push(p&a>>24,p&a>>16,p&a>>8,p&a);return function(v,m){for(var M=m;M>0;M--)v.pop()}(c,s[h]),g.fromCharCode.apply(g,c)},r=function(o){return o.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),s.test(o)===!1)return"";for(var a="",c=0;c<o.length;c+=2)a+=String.fromCharCode("0x"+(o[c]+o[c+1]));return a},n=function(o){for(var s=new Uint8Array(o.length),a=o.length;a--;)s[a]=o.charCodeAt(a);return(s=sm(s)).reduce(function(c,u){return c+String.fromCharCode(u)},"")};t.processDataByFilters=function(o,s){var a=0,c=o||"",u=[];for(typeof(s=s||[])=="string"&&(s=[s]),a=0;a<s.length;a+=1)switch(s[a]){case"ASCII85Decode":case"/ASCII85Decode":c=A(c),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":c=e(c),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":c=i(c),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":c=r(c),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":c=n(c),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[a]+'" is not implemented')}return{data:c,reverseChain:u.reverse().join(" ")}}}(Ct.API),function(t){t.loadFile=function(e,A,r){return function(i,n,o){n=n!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(a,c,u){var l=new XMLHttpRequest,g=0,h=function(p){var C=p.length,I=[],E=String.fromCharCode;for(g=0;g<C;g+=1)I.push(E(255&p.charCodeAt(g)));return I.join("")};if(l.open("GET",a,!c),l.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(l.onload=function(){l.status===200?u(h(this.responseText)):u(void 0)}),l.send(null),c&&l.status===200)return h(l.responseText)}(i,n,o)}catch{}return s}(e,A,r)},t.loadImageFile=t.loadFile}(Ct.API),function(t){function e(){return(Lt.html2canvas?Promise.resolve(Lt.html2canvas):Promise.resolve().then(()=>qpe)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function A(){return(Lt.DOMPurify?Promise.resolve(Lt.DOMPurify):Promise.resolve().then(()=>ffe)).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var r=function(s){var a=BA(s);return a==="undefined"?"undefined":a==="string"||s instanceof String?"string":a==="number"||s instanceof Number?"number":a==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":a==="object"?"object":"unknown"},i=function(s,a){var c=document.createElement(s);for(var u in a.className&&(c.className=a.className),a.innerHTML&&a.dompurify&&(c.innerHTML=a.dompurify.sanitize(a.innerHTML)),a.style)c.style[u]=a.style[u];return c},n=function s(a,c){for(var u=a.nodeType===3?document.createTextNode(a.nodeValue):a.cloneNode(!1),l=a.firstChild;l;l=l.nextSibling)c!==!0&&l.nodeType===1&&l.nodeName==="SCRIPT"||u.appendChild(s(l,c));return a.nodeType===1&&(a.nodeName==="CANVAS"?(u.width=a.width,u.height=a.height,u.getContext("2d").drawImage(a,0,0)):a.nodeName!=="TEXTAREA"&&a.nodeName!=="SELECT"||(u.value=a.value),u.addEventListener("load",function(){u.scrollTop=a.scrollTop,u.scrollLeft=a.scrollLeft},!0)),u},o=function s(a){var c=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),u=s.convert(Promise.resolve(),c);return(u=u.setProgress(1,s,1,[s])).set(a)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(s,a){return s.__proto__=a||o.prototype,s},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(s,a){return this.then(function(){switch(a=a||function(c){switch(r(c)){case"string":return"string";case"element":return c.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(s),a){case"string":return this.then(A).then(function(c){return this.set({src:i("div",{innerHTML:s,dompurify:c})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},o.prototype.to=function(s){switch(s){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var s={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},a=n(this.prop.src,this.opt.html2canvas.javascriptEnabled);a.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(a),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(a){var c=Object.assign({},this.opt.html2canvas);return delete c.onrendered,a(this.prop.container,c)}).then(function(a){(this.opt.html2canvas.onrendered||function(){})(a),this.prop.canvas=a,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(a){var c=this.opt.jsPDF,u=this.opt.fontFaces,l=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,g=Object.assign({async:!0,allowTaint:!0,scale:l,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete g.onrendered,c.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,c.context2d.posX=this.opt.x,c.context2d.posY=this.opt.y,c.context2d.margin=this.opt.margin,c.context2d.fontFaces=u,u)for(var h=0;h<u.length;++h){var p=u[h],C=p.src.find(function(I){return I.format==="truetype"});C&&c.addFont(C.url,p.ref.name,p.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,c.context2d.save(!0),a(this.prop.container,g)}).then(function(a){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(a),this.prop.canvas=a,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(s,a,c){return(c=c||"pdf").toLowerCase()==="img"||c.toLowerCase()==="image"?this.outputImg(s,a):this.outputPdf(s,a)},o.prototype.outputPdf=function(s,a){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,a)})},o.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+s+'" is not supported.'}})},o.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(s){if(r(s)!=="object")return this;var a=Object.keys(s||{}).map(function(c){if(c in o.template.prop)return function(){this.prop[c]=s[c]};switch(c){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[c]=s[c]}}},this);return this.then(function(){return this.thenList(a)})},o.prototype.get=function(s,a){return this.then(function(){var c=s in o.template.prop?this.prop[s]:this.opt[s];return a?a(c):c})},o.prototype.setMargin=function(s){return this.then(function(){switch(r(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},o.prototype.setPageSize=function(s){function a(c,u){return Math.floor(c*u/72*96)}return this.then(function(){(s=s||Ct.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:a(s.inner.width,s.k),height:a(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},o.prototype.setProgress=function(s,a,c,u){return s!=null&&(this.progress.val=s),a!=null&&(this.progress.state=a),c!=null&&(this.progress.n=c),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(s,a,c,u){return this.setProgress(s?this.progress.val+s:null,a||null,c?this.progress.n+c:null,u?this.progress.stack.concat(u):null)},o.prototype.then=function(s,a){var c=this;return this.thenCore(s,a,function(u,l){return c.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(g){return c.updateProgress(null,u),g}).then(u,l).then(function(g){return c.updateProgress(1),g})})},o.prototype.thenCore=function(s,a,c){c=c||Promise.prototype.then;var u=this;s&&(s=s.bind(u)),a&&(a=a.bind(u));var l=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:o.convert(Object.assign({},u),Promise.prototype),g=c.call(l,s,a);return o.convert(g,u.__proto__)},o.prototype.thenExternal=function(s,a){return Promise.prototype.then.call(this,s,a)},o.prototype.thenList=function(s){var a=this;return s.forEach(function(c){a=a.thenCore(c)}),a},o.prototype.catch=function(s){s&&(s=s.bind(this));var a=Promise.prototype.catch.call(this,s);return o.convert(a,this)},o.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},o.prototype.error=function(s){return this.then(function(){throw new Error(s)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,Ct.getPageSize=function(s,a,c){if(BA(s)==="object"){var u=s;s=u.orientation,a=u.unit||a,c=u.format||c}a=a||"mm",c=c||"a4",s=(""+(s||"P")).toLowerCase();var l,g=(""+c).toLowerCase(),h={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(a){case"pt":l=1;break;case"mm":l=72/25.4;break;case"cm":l=72/2.54;break;case"in":l=72;break;case"px":l=.75;break;case"pc":case"em":l=12;break;case"ex":l=6;break;default:throw"Invalid unit: "+a}var p,C=0,I=0;if(h.hasOwnProperty(g))C=h[g][1]/l,I=h[g][0]/l;else try{C=c[1],I=c[0]}catch{throw new Error("Invalid format: "+c)}if(s==="p"||s==="portrait")s="p",I>C&&(p=I,I=C,C=p);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",C>I&&(p=I,I=C,C=p)}return{width:I,height:C,unit:a,k:l,orientation:s}},t.html=function(s,a){(a=a||{}).callback=a.callback||function(){},a.html2canvas=a.html2canvas||{},a.html2canvas.canvas=a.html2canvas.canvas||this.canvas,a.jsPDF=a.jsPDF||this,a.fontFaces=a.fontFaces?a.fontFaces.map(Xm):null;var c=new o(a);return a.worker?c:c.from(s).doCallback()}}(Ct.API),Ct.API.addJS=function(t){return Jb=t,this.internal.events.subscribe("postPutResources",function(){AB=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(AB+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),zb=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Jb+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){AB!==void 0&&zb!==void 0&&this.internal.out("/Names <</JavaScript "+AB+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var A=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=A.outline.render().split(/\r\n/),n=0;n<i.length;n++){var o=i[n],s=r.exec(o);if(s!=null){var a=s[1];A.internal.newObjectDeferredBegin(a,!1)}A.internal.write(o)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,u=[];for(n=0;n<c;n++){var l=A.internal.newObject();u.push(l);var g=A.internal.getPageInfo(n+1);A.internal.write("<< /D["+g.objId+" 0 R /XYZ null null null]>> endobj")}var h=A.internal.newObject();for(A.internal.write("<< /Names [ "),n=0;n<u.length;n++)A.internal.write("(page_"+(n+1)+")"+u[n]+" 0 R");A.internal.write(" ] >>","endobj"),e=A.internal.newObject(),A.internal.write("<< /Dests "+h+" 0 R"),A.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var A=this;A.outline.root.children.length>0&&(A.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&A.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var A=this;A.outline={createNamedDestinations:!1,root:{children:[]}},A.outline.add=function(r,i,n){var o={title:i,options:n,children:[]};return r==null&&(r=this.root),r.children.push(o),o},A.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=A,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},A.outline.genIds_r=function(r){r.id=A.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},A.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},A.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,n=0;n<r.children.length;n++){var o=r.children[n];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(r)),n>0&&this.line("/Prev "+this.makeRef(r.children[n-1])),n<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[n+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var a=A.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+a.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var c=0;c<r.children.length;c++)this.renderItems(r.children[c])},A.outline.line=function(r){this.ctx.val+=r+`\r
190
+ */function Cs(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function ix(t){function e(T){if(!T)throw Error("assert :P")}function A(T,q,Q){for(var R=0;4>R;R++)if(T[q+R]!=Q.charCodeAt(R))return!0;return!1}function r(T,q,Q,R,G){for(var k=0;k<G;k++)T[q+k]=Q[R+k]}function i(T,q,Q,R){for(var G=0;G<R;G++)T[q+G]=Q}function n(T){return new Int32Array(T)}function o(T,q){for(var Q=[],R=0;R<T;R++)Q.push(new q);return Q}function s(T,q){var Q=[];return function R(G,k,te){for(var X=te[k],ie=0;ie<X&&(G.push(te.length>k+1?[]:new q),!(te.length<k+1));ie++)R(G[ie],k+1,te)}(Q,0,T),Q}var a=function(){var T=this;function q(d,f){for(var w=1<<f-1>>>0;d&w;)w>>>=1;return w?(d&w-1)+w:d}function Q(d,f,w,y,F){e(!(y%w));do d[f+(y-=w)]=F;while(0<y)}function R(d,f,w,y,F){if(e(2328>=F),512>=F)var N=n(512);else if((N=n(F))==null)return 0;return function(K,H,V,$,pe,ye){var ee,Ie,Se=H,Le=1<<V,me=n(16),Fe=n(16);for(e(pe!=0),e($!=null),e(K!=null),e(0<V),Ie=0;Ie<pe;++Ie){if(15<$[Ie])return 0;++me[$[Ie]]}if(me[0]==pe)return 0;for(Fe[1]=0,ee=1;15>ee;++ee){if(me[ee]>1<<ee)return 0;Fe[ee+1]=Fe[ee]+me[ee]}for(Ie=0;Ie<pe;++Ie)ee=$[Ie],0<$[Ie]&&(ye[Fe[ee]++]=Ie);if(Fe[15]==1)return($=new G).g=0,$.value=ye[0],Q(K,Se,1,Le,$),Le;var be,qe=-1,je=Le-1,Et=0,lt=1,qt=1,dt=1<<V;for(Ie=0,ee=1,pe=2;ee<=V;++ee,pe<<=1){if(lt+=qt<<=1,0>(qt-=me[ee]))return 0;for(;0<me[ee];--me[ee])($=new G).g=ee,$.value=ye[Ie++],Q(K,Se+Et,pe,dt,$),Et=q(Et,ee)}for(ee=V+1,pe=2;15>=ee;++ee,pe<<=1){if(lt+=qt<<=1,0>(qt-=me[ee]))return 0;for(;0<me[ee];--me[ee]){if($=new G,(Et&je)!=qe){for(Se+=dt,be=1<<(qe=ee)-V;15>qe&&!(0>=(be-=me[qe]));)++qe,be<<=1;Le+=dt=1<<(be=qe-V),K[H+(qe=Et&je)].g=be+V,K[H+qe].value=Se-H-qe}$.g=ee-V,$.value=ye[Ie++],Q(K,Se+(Et>>V),pe,dt,$),Et=q(Et,ee)}}return lt!=2*Fe[15]-1?0:Le}(d,f,w,y,F,N)}function G(){this.value=this.g=0}function k(){this.value=this.g=0}function te(){this.G=o(5,G),this.H=n(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Vu,k)}function X(d,f,w,y){e(d!=null),e(f!=null),e(2147483648>y),d.Ca=254,d.I=0,d.b=-8,d.Ka=0,d.oa=f,d.pa=w,d.Jd=f,d.Yc=w+y,d.Zc=4<=y?w+y-4+1:w,ce(d)}function ie(d,f){for(var w=0;0<f--;)w|=de(d,128)<<f;return w}function W(d,f){var w=ie(d,f);return oe(d)?-w:w}function se(d,f,w,y){var F,N=0;for(e(d!=null),e(f!=null),e(4294967288>y),d.Sb=y,d.Ra=0,d.u=0,d.h=0,4<y&&(y=4),F=0;F<y;++F)N+=f[w+F]<<8*F;d.Ra=N,d.bb=y,d.oa=f,d.pa=w}function Be(d){for(;8<=d.u&&d.bb<d.Sb;)d.Ra>>>=8,d.Ra+=d.oa[d.pa+d.bb]<<oc-8>>>0,++d.bb,d.u-=8;re(d)&&(d.h=1,d.u=0)}function Ee(d,f){if(e(0<=f),!d.h&&f<=Un){var w=_(d)&Tn[f];return d.u+=f,Be(d),w}return d.h=1,d.u=0}function U(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function Y(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function _(d){return d.Ra>>>(d.u&oc-1)>>>0}function re(d){return e(d.bb<=d.Sb),d.h||d.bb==d.Sb&&d.u>oc}function ae(d,f){d.u=f,d.h=re(d)}function Z(d){d.u>=Xo&&(e(d.u>=Xo),Be(d))}function ce(d){e(d!=null&&d.oa!=null),d.pa<d.Zc?(d.I=(d.oa[d.pa++]|d.I<<8)>>>0,d.b+=8):(e(d!=null&&d.oa!=null),d.pa<d.Yc?(d.b+=8,d.I=d.oa[d.pa++]|d.I<<8):d.Ka?d.b=0:(d.I<<=8,d.b+=8,d.Ka=1))}function oe(d){return ie(d,1)}function de(d,f){var w=d.Ca;0>d.b&&ce(d);var y=d.b,F=w*f>>>8,N=(d.I>>>y>F)+0;for(N?(w-=F,d.I-=F+1<<y>>>0):w=F+1,y=w,F=0;256<=y;)F+=8,y>>=8;return y=7^F+ac[y],d.b-=y,d.Ca=(w<<y)-1,N}function De(d,f,w){d[f+0]=w>>24&255,d[f+1]=w>>16&255,d[f+2]=w>>8&255,d[f+3]=255&w}function j(d,f){return d[f+0]|d[f+1]<<8}function J(d,f){return j(d,f)|d[f+2]<<16}function z(d,f){return j(d,f)|j(d,f+2)<<16}function b(d,f){var w=1<<f;return e(d!=null),e(0<f),d.X=n(w),d.X==null?0:(d.Mb=32-f,d.Xa=f,1)}function Me(d,f){e(d!=null),e(f!=null),e(d.Xa==f.Xa),r(f.X,0,d.X,0,1<<f.Xa)}function Qe(){this.X=[],this.Xa=this.Mb=0}function Te(d,f,w,y){e(w!=null),e(y!=null);var F=w[0],N=y[0];return F==0&&(F=(d*N+f/2)/f),N==0&&(N=(f*F+d/2)/d),0>=F||0>=N?0:(w[0]=F,y[0]=N,1)}function Ce(d,f){return d+(1<<f)-1>>>f}function Re(d,f){return((4278255360&d)+(4278255360&f)>>>0&4278255360)+((16711935&d)+(16711935&f)>>>0&16711935)>>>0}function ve(d,f){T[f]=function(w,y,F,N,K,H,V){var $;for($=0;$<K;++$){var pe=T[d](H[V+$-1],F,N+$);H[V+$]=Re(w[y+$],pe)}}}function Ke(){this.ud=this.hd=this.jd=0}function Ue(d,f){return((4278124286&(d^f))>>>1)+(d&f)>>>0}function ke(d){return 0<=d&&256>d?d:0>d?0:255<d?255:void 0}function Ye(d,f){return ke(d+(d-f+.5>>1))}function Je(d,f,w){return Math.abs(f-w)-Math.abs(d-w)}function rt(d,f,w,y,F,N,K){for(y=N[K-1],w=0;w<F;++w)N[K+w]=y=Re(d[f+w],y)}function Ze(d,f,w,y,F){var N;for(N=0;N<w;++N){var K=d[f+N],H=K>>8&255,V=16711935&(V=(V=16711935&K)+((H<<16)+H));y[F+N]=(4278255360&K)+V>>>0}}function We(d,f){f.jd=255&d,f.hd=d>>8&255,f.ud=d>>16&255}function At(d,f,w,y,F,N){var K;for(K=0;K<y;++K){var H=f[w+K],V=H>>>8,$=H,pe=255&(pe=(pe=H>>>16)+((d.jd<<24>>24)*(V<<24>>24)>>>5));$=255&($=($+=(d.hd<<24>>24)*(V<<24>>24)>>>5)+((d.ud<<24>>24)*(pe<<24>>24)>>>5)),F[N+K]=(4278255360&H)+(pe<<16)+$}}function _e(d,f,w,y,F){T[f]=function(N,K,H,V,$,pe,ye,ee,Ie){for(V=ye;V<ee;++V)for(ye=0;ye<Ie;++ye)$[pe++]=F(H[y(N[K++])])},T[d]=function(N,K,H,V,$,pe,ye){var ee=8>>N.b,Ie=N.Ea,Se=N.K[0],Le=N.w;if(8>ee)for(N=(1<<N.b)-1,Le=(1<<ee)-1;K<H;++K){var me,Fe=0;for(me=0;me<Ie;++me)me&N||(Fe=y(V[$++])),pe[ye++]=F(Se[Fe&Le]),Fe>>=ee}else T["VP8LMapColor"+w](V,$,Se,Le,pe,ye,K,H,Ie)}}function It(d,f,w,y,F){for(w=f+w;f<w;){var N=d[f++];y[F++]=N>>16&255,y[F++]=N>>8&255,y[F++]=255&N}}function yt(d,f,w,y,F){for(w=f+w;f<w;){var N=d[f++];y[F++]=N>>16&255,y[F++]=N>>8&255,y[F++]=255&N,y[F++]=N>>24&255}}function tt(d,f,w,y,F){for(w=f+w;f<w;){var N=(K=d[f++])>>16&240|K>>12&15,K=240&K|K>>28&15;y[F++]=N,y[F++]=K}}function et(d,f,w,y,F){for(w=f+w;f<w;){var N=(K=d[f++])>>16&248|K>>13&7,K=K>>5&224|K>>3&31;y[F++]=N,y[F++]=K}}function St(d,f,w,y,F){for(w=f+w;f<w;){var N=d[f++];y[F++]=255&N,y[F++]=N>>8&255,y[F++]=N>>16&255}}function ct(d,f,w,y,F,N){if(N==0)for(w=f+w;f<w;)De(y,((N=d[f++])[0]>>24|N[1]>>8&65280|N[2]<<8&16711680|N[3]<<24)>>>0),F+=32;else r(y,F,d,f,w)}function Rt(d,f){T[f][0]=T[d+"0"],T[f][1]=T[d+"1"],T[f][2]=T[d+"2"],T[f][3]=T[d+"3"],T[f][4]=T[d+"4"],T[f][5]=T[d+"5"],T[f][6]=T[d+"6"],T[f][7]=T[d+"7"],T[f][8]=T[d+"8"],T[f][9]=T[d+"9"],T[f][10]=T[d+"10"],T[f][11]=T[d+"11"],T[f][12]=T[d+"12"],T[f][13]=T[d+"13"],T[f][14]=T[d+"0"],T[f][15]=T[d+"0"]}function Ge(d){return d==Z1||d==X1||d==Bw||d==_1}function Jt(){this.eb=[],this.size=this.A=this.fb=0}function oA(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Qt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Jt,this.f.kb=new oA,this.sd=null}function Xe(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function AA(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function dn(d){return alert("todo:WebPSamplerProcessPlane"),d.T}function $t(d,f){var w=d.T,y=f.ba.f.RGBA,F=y.eb,N=y.fb+d.ka*y.A,K=ss[f.ba.S],H=d.y,V=d.O,$=d.f,pe=d.N,ye=d.ea,ee=d.W,Ie=f.cc,Se=f.dc,Le=f.Mc,me=f.Nc,Fe=d.ka,be=d.ka+d.T,qe=d.U,je=qe+1>>1;for(Fe==0?K(H,V,null,null,$,pe,ye,ee,$,pe,ye,ee,F,N,null,null,qe):(K(f.ec,f.fc,H,V,Ie,Se,Le,me,$,pe,ye,ee,F,N-y.A,F,N,qe),++w);Fe+2<be;Fe+=2)Ie=$,Se=pe,Le=ye,me=ee,pe+=d.Rc,ee+=d.Rc,N+=2*y.A,K(H,(V+=2*d.fa)-d.fa,H,V,Ie,Se,Le,me,$,pe,ye,ee,F,N-y.A,F,N,qe);return V+=d.fa,d.j+be<d.o?(r(f.ec,f.fc,H,V,qe),r(f.cc,f.dc,$,pe,je),r(f.Mc,f.Nc,ye,ee,je),w--):1&be||K(H,V,null,null,$,pe,ye,ee,$,pe,ye,ee,F,N+y.A,null,null,qe),w}function Tr(d,f,w){var y=d.F,F=[d.J];if(y!=null){var N=d.U,K=f.ba.S,H=K==Iw||K==Bw;f=f.ba.f.RGBA;var V=[0],$=d.ka;V[0]=d.T,d.Kb&&($==0?--V[0]:(--$,F[0]-=d.width),d.j+d.ka+d.T==d.o&&(V[0]=d.o-d.j-$));var pe=f.eb;$=f.fb+$*f.A,d=f3(y,F[0],d.width,N,V,pe,$+(H?0:3),f.A),e(w==V),d&&Ge(K)&&tE(pe,$,H,N,V,f.A)}return 0}function Ni(d){var f=d.ma,w=f.ba.S,y=11>w,F=w==Ew||w==Cw||w==Iw||w==W1||w==12||Ge(w);if(f.memory=null,f.Ib=null,f.Jb=null,f.Nd=null,!qf(f.Oa,d,F?11:12))return 0;if(F&&Ge(w)&&lw(),d.da)alert("todo:use_scaling");else{if(y){if(f.Ib=dn,d.Kb){if(w=d.U+1>>1,f.memory=n(d.U+2*w),f.memory==null)return 0;f.ec=f.memory,f.fc=0,f.cc=f.ec,f.dc=f.fc+d.U,f.Mc=f.cc,f.Nc=f.dc+w,f.Ib=$t,lw()}}else alert("todo:EmitYUV");F&&(f.Jb=Tr,y&&As())}if(y&&!F3){for(d=0;256>d;++d)bQe[d]=89858*(d-128)+ww>>vw,KQe[d]=-22014*(d-128)+ww,NQe[d]=-45773*(d-128),xQe[d]=113618*(d-128)+ww>>vw;for(d=rE;d<tR;++d)f=76283*(d-16)+ww>>vw,kQe[d-rE]=cr(f,255),PQe[d-rE]=cr(f+8>>4,15);F3=1}return 1}function Bt(d){var f=d.ma,w=d.U,y=d.T;return e(!(1&d.ka)),0>=w||0>=y?0:(w=f.Ib(d,f),f.Jb!=null&&f.Jb(d,f,w),f.Dc+=w,1)}function Ur(d){d.ma.memory=null}function Ei(d,f,w,y){return Ee(d,8)!=47?0:(f[0]=Ee(d,14)+1,w[0]=Ee(d,14)+1,y[0]=Ee(d,1),Ee(d,3)!=0?0:!d.h)}function ti(d,f){if(4>d)return d+1;var w=d-2>>1;return(2+(1&d)<<w)+Ee(f,w)+1}function Ai(d,f){return 120<f?f-120:1<=(w=((w=vQe[f-1])>>4)*d+(8-(15&w)))?w:1;var w}function iA(d,f,w){var y=_(w),F=d[f+=255&y].g-8;return 0<F&&(ae(w,w.u+8),y=_(w),f+=d[f].value,f+=y&(1<<F)-1),ae(w,w.u+d[f].g),d[f].value}function yA(d,f,w){return w.g+=d.g,w.value+=d.value<<f>>>0,e(8>=w.g),d.g}function HA(d,f,w){var y=d.xc;return e((f=y==0?0:d.vc[d.md*(w>>y)+(f>>y)])<d.Wb),d.Ya[f]}function pn(d,f,w,y){var F=d.ab,N=d.c*f,K=d.C;f=K+f;var H=w,V=y;for(y=d.Ta,w=d.Ua;0<F--;){var $=d.gc[F],pe=K,ye=f,ee=H,Ie=V,Se=(V=y,H=w,$.Ea);switch(e(pe<ye),e(ye<=$.nc),$.hc){case 2:vr(ee,Ie,(ye-pe)*Se,V,H);break;case 0:var Le=pe,me=ye,Fe=V,be=H,qe=(dt=$).Ea;Le==0&&(Wf(ee,Ie,null,null,1,Fe,be),rt(ee,Ie+1,0,0,qe-1,Fe,be+1),Ie+=qe,be+=qe,++Le);for(var je=1<<dt.b,Et=je-1,lt=Ce(qe,dt.b),qt=dt.K,dt=dt.w+(Le>>dt.b)*lt;Le<me;){var hA=qt,Hr=dt,Vt=1;for(Nh(ee,Ie,Fe,be-qe,1,Fe,be);Vt<qe;){var pt=(Vt&~Et)+je;pt>qe&&(pt=qe),(0,Xf[hA[Hr++]>>8&15])(ee,Ie+ +Vt,Fe,be+Vt-qe,pt-Vt,Fe,be+Vt),Vt=pt}Ie+=qe,be+=qe,++Le&Et||(dt+=lt)}ye!=$.nc&&r(V,H-Se,V,H+(ye-pe-1)*Se,Se);break;case 1:for(Se=ee,me=Ie,qe=(ee=$.Ea)-(be=ee&~(Fe=(Ie=1<<$.b)-1)),Le=Ce(ee,$.b),je=$.K,$=$.w+(pe>>$.b)*Le;pe<ye;){for(Et=je,lt=$,qt=new Ke,dt=me+be,hA=me+ee;me<dt;)We(Et[lt++],qt),_f(qt,Se,me,Ie,V,H),me+=Ie,H+=Ie;me<hA&&(We(Et[lt++],qt),_f(qt,Se,me,qe,V,H),me+=qe,H+=qe),++pe&Fe||($+=Le)}break;case 3:if(ee==V&&Ie==H&&0<$.b){for(me=V,ee=Se=H+(ye-pe)*Se-(be=(ye-pe)*Ce($.Ea,$.b)),Ie=V,Fe=H,Le=[],be=(qe=be)-1;0<=be;--be)Le[be]=Ie[Fe+be];for(be=qe-1;0<=be;--be)me[ee+be]=Le[be];gw($,pe,ye,V,Se,V,H)}else gw($,pe,ye,ee,Ie,V,H)}H=y,V=w}V!=w&&r(y,w,H,V,N)}function ri(d,f){var w=d.V,y=d.Ba+d.c*d.C,F=f-d.C;if(e(f<=d.l.o),e(16>=F),0<F){var N=d.l,K=d.Ta,H=d.Ua,V=N.width;if(pn(d,F,w,y),F=H=[H],e((w=d.C)<(y=f)),e(N.v<N.va),y>N.o&&(y=N.o),w<N.j){var $=N.j-w;w=N.j,F[0]+=$*V}if(w>=y?w=0:(F[0]+=4*N.v,N.ka=w-N.j,N.U=N.va-N.v,N.T=y-w,w=1),w){if(H=H[0],11>(w=d.ca).S){var pe=w.f.RGBA,ye=(y=w.S,F=N.U,N=N.T,$=pe.eb,pe.A),ee=N;for(pe=pe.fb+d.Ma*pe.A;0<ee--;){var Ie=K,Se=H,Le=F,me=$,Fe=pe;switch(y){case fw:$f(Ie,Se,Le,me,Fe);break;case Ew:cc(Ie,Se,Le,me,Fe);break;case Z1:cc(Ie,Se,Le,me,Fe),tE(me,Fe,0,Le,1,0);break;case S3:Wu(Ie,Se,Le,me,Fe);break;case Cw:ct(Ie,Se,Le,me,Fe,1);break;case X1:ct(Ie,Se,Le,me,Fe,1),tE(me,Fe,0,Le,1,0);break;case Iw:ct(Ie,Se,Le,me,Fe,0);break;case Bw:ct(Ie,Se,Le,me,Fe,0),tE(me,Fe,1,Le,1,0);break;case W1:uc(Ie,Se,Le,me,Fe);break;case _1:uc(Ie,Se,Le,me,Fe),p3(me,Fe,Le,1,0);break;case m3:lc(Ie,Se,Le,me,Fe);break;default:e(0)}H+=V,pe+=ye}d.Ma+=N}else alert("todo:EmitRescaledRowsYUVA");e(d.Ma<=w.height)}}d.C=f,e(d.C<=d.i)}function ii(d){var f;if(0<d.ua)return 0;for(f=0;f<d.Wb;++f){var w=d.Ya[f].G,y=d.Ya[f].H;if(0<w[1][y[1]+0].g||0<w[2][y[2]+0].g||0<w[3][y[3]+0].g)return 0}return 1}function or(d,f,w,y,F,N){if(d.Z!=0){var K=d.qd,H=d.rd;for(e(dc[d.Z]!=null);f<w;++f)dc[d.Z](K,H,y,F,y,F,N),K=y,H=F,F+=N;d.qd=K,d.rd=H}}function Ki(d,f){var w=d.l.ma,y=w.Z==0||w.Z==1?d.l.j:d.C;if(y=d.C<y?y:d.C,e(f<=d.l.o),f>y){var F=d.l.width,N=w.ca,K=w.tb+F*y,H=d.V,V=d.Ba+d.c*y,$=d.gc;e(d.ab==1),e($[0].hc==3),ro($[0],y,f,H,V,N,K),or(w,y,f,N,K,F)}d.C=d.Ma=f}function ki(d,f,w,y,F,N,K){var H=d.$/y,V=d.$%y,$=d.m,pe=d.s,ye=w+d.$,ee=ye;F=w+y*F;var Ie=w+y*N,Se=280+pe.ua,Le=d.Pb?H:16777216,me=0<pe.ua?pe.Wa:null,Fe=pe.wc,be=ye<Ie?HA(pe,V,H):null;e(d.C<N),e(Ie<=F);var qe=!1;e:for(;;){for(;qe||ye<Ie;){var je=0;if(H>=Le){var Et=ye-w;e((Le=d).Pb),Le.wd=Le.m,Le.xd=Et,0<Le.s.ua&&Me(Le.s.Wa,Le.s.vb),Le=H+SQe}if(V&Fe||(be=HA(pe,V,H)),e(be!=null),be.Qb&&(f[ye]=be.qb,qe=!0),!qe)if(Z($),be.jc){je=$,Et=f;var lt=ye,qt=be.pd[_(je)&Vu-1];e(be.jc),256>qt.g?(ae(je,je.u+qt.g),Et[lt]=qt.value,je=0):(ae(je,je.u+qt.g-256),e(256<=qt.value),je=qt.value),je==0&&(qe=!0)}else je=iA(be.G[0],be.H[0],$);if($.h)break;if(qe||256>je){if(!qe)if(be.nd)f[ye]=(be.qb|je<<8)>>>0;else{if(Z($),qe=iA(be.G[1],be.H[1],$),Z($),Et=iA(be.G[2],be.H[2],$),lt=iA(be.G[3],be.H[3],$),$.h)break;f[ye]=(lt<<24|qe<<16|je<<8|Et)>>>0}if(qe=!1,++ye,++V>=y&&(V=0,++H,K!=null&&H<=N&&!(H%16)&&K(d,H),me!=null))for(;ee<ye;)je=f[ee++],me.X[(506832829*je&4294967295)>>>me.Mb]=je}else if(280>je){if(je=ti(je-256,$),Et=iA(be.G[4],be.H[4],$),Z($),Et=Ai(y,Et=ti(Et,$)),$.h)break;if(ye-w<Et||F-ye<je)break e;for(lt=0;lt<je;++lt)f[ye+lt]=f[ye+lt-Et];for(ye+=je,V+=je;V>=y;)V-=y,++H,K!=null&&H<=N&&!(H%16)&&K(d,H);if(e(ye<=F),V&Fe&&(be=HA(pe,V,H)),me!=null)for(;ee<ye;)je=f[ee++],me.X[(506832829*je&4294967295)>>>me.Mb]=je}else{if(!(je<Se))break e;for(qe=je-280,e(me!=null);ee<ye;)je=f[ee++],me.X[(506832829*je&4294967295)>>>me.Mb]=je;je=ye,e(!(qe>>>(Et=me).Xa)),f[je]=Et.X[qe],qe=!0}qe||e($.h==re($))}if(d.Pb&&$.h&&ye<F)e(d.m.h),d.a=5,d.m=d.wd,d.$=d.xd,0<d.s.ua&&Me(d.s.vb,d.s.Wa);else{if($.h)break e;K!=null&&K(d,H>N?N:H),d.a=0,d.$=ye-w}return 1}return d.a=3,0}function Lr(d){e(d!=null),d.vc=null,d.yc=null,d.Ya=null;var f=d.Wa;f!=null&&(f.X=null),d.vb=null,e(d!=null)}function Ne(){var d=new ft;return d==null?null:(d.a=0,d.xb=Q3,Rt("Predictor","VP8LPredictors"),Rt("Predictor","VP8LPredictors_C"),Rt("PredictorAdd","VP8LPredictorsAdd"),Rt("PredictorAdd","VP8LPredictorsAdd_C"),vr=Ze,_f=At,$f=It,cc=yt,uc=tt,lc=et,Wu=St,T.VP8LMapColor32b=Ao,T.VP8LMapColor8b=Zf,d)}function FA(d,f,w,y,F){var N=1,K=[d],H=[f],V=y.m,$=y.s,pe=null,ye=0;e:for(;;){if(w)for(;N&&Ee(V,1);){var ee=K,Ie=H,Se=y,Le=1,me=Se.m,Fe=Se.gc[Se.ab],be=Ee(me,2);if(Se.Oc&1<<be)N=0;else{switch(Se.Oc|=1<<be,Fe.hc=be,Fe.Ea=ee[0],Fe.nc=Ie[0],Fe.K=[null],++Se.ab,e(4>=Se.ab),be){case 0:case 1:Fe.b=Ee(me,3)+2,Le=FA(Ce(Fe.Ea,Fe.b),Ce(Fe.nc,Fe.b),0,Se,Fe.K),Fe.K=Fe.K[0];break;case 3:var qe,je=Ee(me,8)+1,Et=16<je?0:4<je?1:2<je?2:3;if(ee[0]=Ce(Fe.Ea,Et),Fe.b=Et,qe=Le=FA(je,1,0,Se,Fe.K)){var lt,qt=je,dt=Fe,hA=1<<(8>>dt.b),Hr=n(hA);if(Hr==null)qe=0;else{var Vt=dt.K[0],pt=dt.w;for(Hr[0]=dt.K[0][0],lt=1;lt<1*qt;++lt)Hr[lt]=Re(Vt[pt+lt],Hr[lt-1]);for(;lt<4*hA;++lt)Hr[lt]=0;dt.K[0]=null,dt.K[0]=Hr,qe=1}}Le=qe;break;case 2:break;default:e(0)}N=Le}}if(K=K[0],H=H[0],N&&Ee(V,1)&&!(N=1<=(ye=Ee(V,4))&&11>=ye)){y.a=3;break e}var $e;if($e=N)t:{var Sr,Yt,fA,zA=y,Ii=K,$i=H,ur=ye,Gi=w,en=zA.m,zr=zA.s,IA=[null],TA=1,lr=0,UA=wQe[ur];A:for(;;){if(Gi&&Ee(en,1)){var Bi=Ee(en,3)+2,Us=Ce(Ii,Bi),mr=Ce($i,Bi),En=Us*mr;if(!FA(Us,mr,0,zA,IA))break A;for(IA=IA[0],zr.xc=Bi,Sr=0;Sr<En;++Sr){var KA=IA[Sr]>>8&65535;IA[Sr]=KA,KA>=TA&&(TA=KA+1)}}if(en.h)break A;for(Yt=0;5>Yt;++Yt){var Jr=M3[Yt];!Yt&&0<ur&&(Jr+=1<<ur),lr<Jr&&(lr=Jr)}var Fn=o(TA*UA,G),tn=TA,On=o(tn,te);if(On==null)var bn=null;else e(65536>=tn),bn=On;var Cn=n(lr);if(bn==null||Cn==null||Fn==null){zA.a=1;break A}var xn=Fn;for(Sr=fA=0;Sr<TA;++Sr){var jA=bn[Sr],Nn=jA.G,Ls=jA.H,Xu=0,ea=1,vi=0;for(Yt=0;5>Yt;++Yt){Jr=M3[Yt],Nn[Yt]=xn,Ls[Yt]=fA,!Yt&&0<ur&&(Jr+=1<<ur);i:{var mw,AR=Jr,Mw=zA,iE=Cn,YQe=xn,HQe=fA,rR=0,pc=Mw.m,zQe=Ee(pc,1);if(i(iE,0,0,AR),zQe){var JQe=Ee(pc,1)+1,qQe=Ee(pc,1),x3=Ee(pc,qQe==0?1:8);iE[x3]=1,JQe==2&&(iE[x3=Ee(pc,8)]=1);var yw=1}else{var N3=n(19),K3=Ee(pc,4)+4;if(19<K3){Mw.a=3;var Qw=0;break i}for(mw=0;mw<K3;++mw)N3[BQe[mw]]=Ee(pc,3);var iR=void 0,nE=void 0,k3=Mw,VQe=N3,Rw=AR,P3=iE,nR=0,fc=k3.m,G3=8,j3=o(128,G);r:for(;R(j3,0,7,VQe,19);){if(Ee(fc,1)){var WQe=2+2*Ee(fc,3);if((iR=2+Ee(fc,WQe))>Rw)break r}else iR=Rw;for(nE=0;nE<Rw&&iR--;){Z(fc);var Y3=j3[0+(127&_(fc))];ae(fc,fc.u+Y3.g);var kh=Y3.value;if(16>kh)P3[nE++]=kh,kh!=0&&(G3=kh);else{var ZQe=kh==16,H3=kh-16,XQe=CQe[H3],z3=Ee(fc,EQe[H3])+XQe;if(nE+z3>Rw)break r;for(var _Qe=ZQe?G3:0;0<z3--;)P3[nE++]=_Qe}}nR=1;break r}nR||(k3.a=3),yw=nR}(yw=yw&&!pc.h)&&(rR=R(YQe,HQe,8,iE,AR)),yw&&rR!=0?Qw=rR:(Mw.a=3,Qw=0)}if(Qw==0)break A;if(ea&&IQe[Yt]==1&&(ea=xn[fA].g==0),Xu+=xn[fA].g,fA+=Qw,3>=Yt){var sE,sR=Cn[0];for(sE=1;sE<Jr;++sE)Cn[sE]>sR&&(sR=Cn[sE]);vi+=sR}}if(jA.nd=ea,jA.Qb=0,ea&&(jA.qb=(Nn[3][Ls[3]+0].value<<24|Nn[1][Ls[1]+0].value<<16|Nn[2][Ls[2]+0].value)>>>0,Xu==0&&256>Nn[0][Ls[0]+0].value&&(jA.Qb=1,jA.qb+=Nn[0][Ls[0]+0].value<<8)),jA.jc=!jA.Qb&&6>vi,jA.jc){var Dw,ta=jA;for(Dw=0;Dw<Vu;++Dw){var Ec=Dw,Cc=ta.pd[Ec],Tw=ta.G[0][ta.H[0]+Ec];256<=Tw.value?(Cc.g=Tw.g+256,Cc.value=Tw.value):(Cc.g=0,Cc.value=0,Ec>>=yA(Tw,8,Cc),Ec>>=yA(ta.G[1][ta.H[1]+Ec],16,Cc),Ec>>=yA(ta.G[2][ta.H[2]+Ec],0,Cc),yA(ta.G[3][ta.H[3]+Ec],24,Cc))}}}zr.vc=IA,zr.Wb=TA,zr.Ya=bn,zr.yc=Fn,$e=1;break t}$e=0}if(!(N=$e)){y.a=3;break e}if(0<ye){if($.ua=1<<ye,!b($.Wa,ye)){y.a=1,N=0;break e}}else $.ua=0;var oR=y,J3=K,$Qe=H,aR=oR.s,cR=aR.xc;if(oR.c=J3,oR.i=$Qe,aR.md=Ce(J3,cR),aR.wc=cR==0?-1:(1<<cR)-1,w){y.xb=TQe;break e}if((pe=n(K*H))==null){y.a=1,N=0;break e}N=(N=ki(y,pe,0,K,H,H,null))&&!V.h;break e}return N?(F!=null?F[0]=pe:(e(pe==null),e(w)),y.$=0,w||Lr($)):Lr($),N}function st(d,f){var w=d.c*d.i,y=w+f+16*f;return e(d.c<=f),d.V=n(y),d.V==null?(d.Ta=null,d.Ua=0,d.a=1,0):(d.Ta=d.V,d.Ua=d.Ba+w+f,1)}function le(d,f){var w=d.C,y=f-w,F=d.V,N=d.Ba+d.c*w;for(e(f<=d.l.o);0<y;){var K=16<y?16:y,H=d.l.ma,V=d.l.width,$=V*K,pe=H.ca,ye=H.tb+V*w,ee=d.Ta,Ie=d.Ua;pn(d,K,F,N),E3(ee,Ie,pe,ye,$),or(H,w,w+K,pe,ye,V),y-=K,F+=K*d.c,w+=K}e(w==f),d.C=d.Ma=f}function Pe(){this.ub=this.yd=this.td=this.Rb=0}function it(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function pA(){this.Fb=this.Bb=this.Cb=0,this.Zb=n(4),this.Lb=n(4)}function uA(){this.Yb=function(){var d=[];return function f(w,y,F){for(var N=F[y],K=0;K<N&&(w.push(F.length>y+1?[]:0),!(F.length<y+1));K++)f(w[K],y+1,F)}(d,0,[3,11]),d}()}function lA(){this.jb=n(3),this.Wc=s([4,8],uA),this.Xc=s([4,17],uA)}function Gr(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new n(4),this.od=new n(4)}function ar(){this.ld=this.La=this.dd=this.tc=0}function ts(){this.Na=this.la=0}function Ac(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function _A(){this.ad=n(384),this.Za=0,this.Ob=n(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Tu(){this.uc=this.M=this.Nb=0,this.wa=Array(new ar),this.Y=0,this.ya=Array(new _A),this.aa=0,this.l=new Th}function Uu(){this.y=n(16),this.f=n(8),this.ea=n(8)}function tw(){this.cb=this.a=0,this.sc="",this.m=new U,this.Od=new Pe,this.Kc=new it,this.ed=new Gr,this.Qa=new pA,this.Ic=this.$c=this.Aa=0,this.D=new Tu,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,U),this.ia=0,this.pb=o(4,Ac),this.Pa=new lA,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Uu),this.Hd=0,this.rb=Array(new ts),this.sb=0,this.wa=Array(new ar),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new _A),this.L=this.aa=0,this.gd=s([4,2],ar),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Th(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function F1(){var d=new tw;return d!=null&&(d.a=0,d.sc="OK",d.cb=0,d.Xb=0,AE||(AE=zo)),d}function Fr(d,f,w){return d.a==0&&(d.a=f,d.sc=w,d.cb=0),0}function Aw(d,f,w){return 3<=w&&d[f+0]==157&&d[f+1]==1&&d[f+2]==42}function rw(d,f){if(d==null)return 0;if(d.a=0,d.sc="OK",f==null)return Fr(d,2,"null VP8Io passed to VP8GetHeaders()");var w=f.data,y=f.w,F=f.ha;if(4>F)return Fr(d,7,"Truncated header.");var N=w[y+0]|w[y+1]<<8|w[y+2]<<16,K=d.Od;if(K.Rb=!(1&N),K.td=N>>1&7,K.yd=N>>4&1,K.ub=N>>5,3<K.td)return Fr(d,3,"Incorrect keyframe parameters.");if(!K.yd)return Fr(d,4,"Frame not displayable.");y+=3,F-=3;var H=d.Kc;if(K.Rb){if(7>F)return Fr(d,7,"cannot parse picture header");if(!Aw(w,y,F))return Fr(d,3,"Bad code word");H.c=16383&(w[y+4]<<8|w[y+3]),H.Td=w[y+4]>>6,H.i=16383&(w[y+6]<<8|w[y+5]),H.Ud=w[y+6]>>6,y+=7,F-=7,d.za=H.c+15>>4,d.Ub=H.i+15>>4,f.width=H.c,f.height=H.i,f.Da=0,f.j=0,f.v=0,f.va=f.width,f.o=f.height,f.da=0,f.ib=f.width,f.hb=f.height,f.U=f.width,f.T=f.height,i((N=d.Pa).jb,0,255,N.jb.length),e((N=d.Qa)!=null),N.Cb=0,N.Bb=0,N.Fb=1,i(N.Zb,0,0,N.Zb.length),i(N.Lb,0,0,N.Lb)}if(K.ub>F)return Fr(d,7,"bad partition length");X(N=d.m,w,y,K.ub),y+=K.ub,F-=K.ub,K.Rb&&(H.Ld=oe(N),H.Kd=oe(N)),H=d.Qa;var V,$=d.Pa;if(e(N!=null),e(H!=null),H.Cb=oe(N),H.Cb){if(H.Bb=oe(N),oe(N)){for(H.Fb=oe(N),V=0;4>V;++V)H.Zb[V]=oe(N)?W(N,7):0;for(V=0;4>V;++V)H.Lb[V]=oe(N)?W(N,6):0}if(H.Bb)for(V=0;3>V;++V)$.jb[V]=oe(N)?ie(N,8):255}else H.Bb=0;if(N.Ka)return Fr(d,3,"cannot parse segment header");if((H=d.ed).zd=oe(N),H.Tb=ie(N,6),H.wb=ie(N,3),H.Pc=oe(N),H.Pc&&oe(N)){for($=0;4>$;++$)oe(N)&&(H.vd[$]=W(N,6));for($=0;4>$;++$)oe(N)&&(H.od[$]=W(N,6))}if(d.L=H.Tb==0?0:H.zd?1:2,N.Ka)return Fr(d,3,"cannot parse filter header");var pe=F;if(F=V=y,y=V+pe,H=pe,d.Xb=(1<<ie(d.m,2))-1,pe<3*($=d.Xb))w=7;else{for(V+=3*$,H-=3*$,pe=0;pe<$;++pe){var ye=w[F+0]|w[F+1]<<8|w[F+2]<<16;ye>H&&(ye=H),X(d.Jc[+pe],w,V,ye),V+=ye,H-=ye,F+=3}X(d.Jc[+$],w,V,H),w=V<y?0:5}if(w!=0)return Fr(d,w,"cannot parse partitions");for(w=ie(V=d.m,7),F=oe(V)?W(V,4):0,y=oe(V)?W(V,4):0,H=oe(V)?W(V,4):0,$=oe(V)?W(V,4):0,V=oe(V)?W(V,4):0,pe=d.Qa,ye=0;4>ye;++ye){if(pe.Cb){var ee=pe.Zb[ye];pe.Fb||(ee+=w)}else{if(0<ye){d.pb[ye]=d.pb[0];continue}ee=w}var Ie=d.pb[ye];Ie.Sc[0]=$1[cr(ee+F,127)],Ie.Sc[1]=eR[cr(ee+0,127)],Ie.Eb[0]=2*$1[cr(ee+y,127)],Ie.Eb[1]=101581*eR[cr(ee+H,127)]>>16,8>Ie.Eb[1]&&(Ie.Eb[1]=8),Ie.Qc[0]=$1[cr(ee+$,117)],Ie.Qc[1]=eR[cr(ee+V,127)],Ie.lc=ee+V}if(!K.Rb)return Fr(d,4,"Not a key frame.");for(oe(N),K=d.Pa,w=0;4>w;++w){for(F=0;8>F;++F)for(y=0;3>y;++y)for(H=0;11>H;++H)$=de(N,RQe[w][F][y][H])?ie(N,8):yQe[w][F][y][H],K.Wc[w][F].Yb[y][H]=$;for(F=0;17>F;++F)K.Xc[w][F]=K.Wc[w][DQe[F]]}return d.kc=oe(N),d.kc&&(d.Bd=ie(N,8)),d.cb=1}function zo(d,f,w,y,F,N,K){var H=f[F].Yb[w];for(w=0;16>F;++F){if(!de(d,H[w+0]))return F;for(;!de(d,H[w+1]);)if(H=f[++F].Yb[0],w=0,F==16)return 16;var V=f[F+1].Yb;if(de(d,H[w+2])){var $=d,pe=0;if(de($,(ee=H)[(ye=w)+3]))if(de($,ee[ye+6])){for(H=0,ye=2*(pe=de($,ee[ye+8]))+(ee=de($,ee[ye+9+pe])),pe=0,ee=mQe[ye];ee[H];++H)pe+=pe+de($,ee[H]);pe+=3+(8<<ye)}else de($,ee[ye+7])?(pe=7+2*de($,165),pe+=de($,145)):pe=5+de($,159);else pe=de($,ee[ye+4])?3+de($,ee[ye+5]):2;H=V[2]}else pe=1,H=V[1];V=K+MQe[F],0>($=d).b&&ce($);var ye,ee=$.b,Ie=(ye=$.Ca>>1)-($.I>>ee)>>31;--$.b,$.Ca+=Ie,$.Ca|=1,$.I-=(ye+1&Ie)<<ee,N[V]=((pe^Ie)-Ie)*y[(0<F)+0]}return 16}function Lu(d){var f=d.rb[d.sb-1];f.la=0,f.Na=0,i(d.zc,0,0,d.zc.length),d.ja=0}function Ds(d,f,w,y,F){F=d[f+w+32*y]+(F>>3),d[f+w+32*y]=-256&F?0>F?0:255:F}function Fu(d,f,w,y,F,N){Ds(d,f,0,w,y+F),Ds(d,f,1,w,y+N),Ds(d,f,2,w,y-N),Ds(d,f,3,w,y-F)}function Br(d){return(20091*d>>16)+d}function xf(d,f,w,y){var F,N=0,K=n(16);for(F=0;4>F;++F){var H=d[f+0]+d[f+8],V=d[f+0]-d[f+8],$=(35468*d[f+4]>>16)-Br(d[f+12]),pe=Br(d[f+4])+(35468*d[f+12]>>16);K[N+0]=H+pe,K[N+1]=V+$,K[N+2]=V-$,K[N+3]=H-pe,N+=4,f++}for(F=N=0;4>F;++F)H=(d=K[N+0]+4)+K[N+8],V=d-K[N+8],$=(35468*K[N+4]>>16)-Br(K[N+12]),Ds(w,y,0,0,H+(pe=Br(K[N+4])+(35468*K[N+12]>>16))),Ds(w,y,1,0,V+$),Ds(w,y,2,0,V-$),Ds(w,y,3,0,H-pe),N++,y+=32}function O1(d,f,w,y){var F=d[f+0]+4,N=35468*d[f+4]>>16,K=Br(d[f+4]),H=35468*d[f+1]>>16;Fu(w,y,0,F+K,d=Br(d[f+1]),H),Fu(w,y,1,F+N,d,H),Fu(w,y,2,F-N,d,H),Fu(w,y,3,F-K,d,H)}function b1(d,f,w,y,F){xf(d,f,w,y),F&&xf(d,f+16,w,y+4)}function x1(d,f,w,y){Zu(d,f+0,w,y,1),Zu(d,f+32,w,y+128,1)}function to(d,f,w,y){var F;for(d=d[f+0]+4,F=0;4>F;++F)for(f=0;4>f;++f)Ds(w,y,f,F,d)}function iw(d,f,w,y){d[f+0]&&QA(d,f+0,w,y),d[f+16]&&QA(d,f+16,w,y+4),d[f+32]&&QA(d,f+32,w,y+128),d[f+48]&&QA(d,f+48,w,y+128+4)}function nw(d,f,w,y){var F,N=n(16);for(F=0;4>F;++F){var K=d[f+0+F]+d[f+12+F],H=d[f+4+F]+d[f+8+F],V=d[f+4+F]-d[f+8+F],$=d[f+0+F]-d[f+12+F];N[0+F]=K+H,N[8+F]=K-H,N[4+F]=$+V,N[12+F]=$-V}for(F=0;4>F;++F)K=(d=N[0+4*F]+3)+N[3+4*F],H=N[1+4*F]+N[2+4*F],V=N[1+4*F]-N[2+4*F],$=d-N[3+4*F],w[y+0]=K+H>>3,w[y+16]=$+V>>3,w[y+32]=K-H>>3,w[y+48]=$-V>>3,y+=64}function rc(d,f,w){var y,F=f-32,N=Ln,K=255-d[F-1];for(y=0;y<w;++y){var H,V=N,$=K+d[f-1];for(H=0;H<w;++H)d[f+H]=V[$+d[F+H]];f+=32}}function Nf(d,f){rc(d,f,4)}function N1(d,f){rc(d,f,8)}function K1(d,f){rc(d,f,16)}function k1(d,f){var w;for(w=0;16>w;++w)r(d,f+32*w,d,f-32,16)}function Kf(d,f){var w;for(w=16;0<w;--w)i(d,f,d[f-1],16),f+=32}function Ou(d,f,w){var y;for(y=0;16>y;++y)i(f,w+32*y,d,16)}function ic(d,f){var w,y=16;for(w=0;16>w;++w)y+=d[f-1+32*w]+d[f+w-32];Ou(y>>5,d,f)}function P1(d,f){var w,y=8;for(w=0;16>w;++w)y+=d[f-1+32*w];Ou(y>>4,d,f)}function bu(d,f){var w,y=8;for(w=0;16>w;++w)y+=d[f+w-32];Ou(y>>4,d,f)}function kf(d,f){Ou(128,d,f)}function Kt(d,f,w){return d+2*f+w+2>>2}function G1(d,f){var w,y=f-32;for(y=new Uint8Array([Kt(d[y-1],d[y+0],d[y+1]),Kt(d[y+0],d[y+1],d[y+2]),Kt(d[y+1],d[y+2],d[y+3]),Kt(d[y+2],d[y+3],d[y+4])]),w=0;4>w;++w)r(d,f+32*w,y,0,y.length)}function j1(d,f){var w=d[f-1],y=d[f-1+32],F=d[f-1+64],N=d[f-1+96];De(d,f+0,16843009*Kt(d[f-1-32],w,y)),De(d,f+32,16843009*Kt(w,y,F)),De(d,f+64,16843009*Kt(y,F,N)),De(d,f+96,16843009*Kt(F,N,N))}function Y1(d,f){var w,y=4;for(w=0;4>w;++w)y+=d[f+w-32]+d[f-1+32*w];for(y>>=3,w=0;4>w;++w)i(d,f+32*w,y,4)}function H1(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1-32],K=d[f+0-32],H=d[f+1-32],V=d[f+2-32],$=d[f+3-32];d[f+0+96]=Kt(y,F,d[f-1+96]),d[f+1+96]=d[f+0+64]=Kt(w,y,F),d[f+2+96]=d[f+1+64]=d[f+0+32]=Kt(N,w,y),d[f+3+96]=d[f+2+64]=d[f+1+32]=d[f+0+0]=Kt(K,N,w),d[f+3+64]=d[f+2+32]=d[f+1+0]=Kt(H,K,N),d[f+3+32]=d[f+2+0]=Kt(V,H,K),d[f+3+0]=Kt($,V,H)}function Jo(d,f){var w=d[f+1-32],y=d[f+2-32],F=d[f+3-32],N=d[f+4-32],K=d[f+5-32],H=d[f+6-32],V=d[f+7-32];d[f+0+0]=Kt(d[f+0-32],w,y),d[f+1+0]=d[f+0+32]=Kt(w,y,F),d[f+2+0]=d[f+1+32]=d[f+0+64]=Kt(y,F,N),d[f+3+0]=d[f+2+32]=d[f+1+64]=d[f+0+96]=Kt(F,N,K),d[f+3+32]=d[f+2+64]=d[f+1+96]=Kt(N,K,H),d[f+3+64]=d[f+2+96]=Kt(K,H,V),d[f+3+96]=Kt(H,V,V)}function qo(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1-32],K=d[f+0-32],H=d[f+1-32],V=d[f+2-32],$=d[f+3-32];d[f+0+0]=d[f+1+64]=N+K+1>>1,d[f+1+0]=d[f+2+64]=K+H+1>>1,d[f+2+0]=d[f+3+64]=H+V+1>>1,d[f+3+0]=V+$+1>>1,d[f+0+96]=Kt(F,y,w),d[f+0+64]=Kt(y,w,N),d[f+0+32]=d[f+1+96]=Kt(w,N,K),d[f+1+32]=d[f+2+96]=Kt(N,K,H),d[f+2+32]=d[f+3+96]=Kt(K,H,V),d[f+3+32]=Kt(H,V,$)}function z1(d,f){var w=d[f+0-32],y=d[f+1-32],F=d[f+2-32],N=d[f+3-32],K=d[f+4-32],H=d[f+5-32],V=d[f+6-32],$=d[f+7-32];d[f+0+0]=w+y+1>>1,d[f+1+0]=d[f+0+64]=y+F+1>>1,d[f+2+0]=d[f+1+64]=F+N+1>>1,d[f+3+0]=d[f+2+64]=N+K+1>>1,d[f+0+32]=Kt(w,y,F),d[f+1+32]=d[f+0+96]=Kt(y,F,N),d[f+2+32]=d[f+1+96]=Kt(F,N,K),d[f+3+32]=d[f+2+96]=Kt(N,K,H),d[f+3+64]=Kt(K,H,V),d[f+3+96]=Kt(H,V,$)}function J1(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1+96];d[f+0+0]=w+y+1>>1,d[f+2+0]=d[f+0+32]=y+F+1>>1,d[f+2+32]=d[f+0+64]=F+N+1>>1,d[f+1+0]=Kt(w,y,F),d[f+3+0]=d[f+1+32]=Kt(y,F,N),d[f+3+32]=d[f+1+64]=Kt(F,N,N),d[f+3+64]=d[f+2+64]=d[f+0+96]=d[f+1+96]=d[f+2+96]=d[f+3+96]=N}function Uh(d,f){var w=d[f-1+0],y=d[f-1+32],F=d[f-1+64],N=d[f-1+96],K=d[f-1-32],H=d[f+0-32],V=d[f+1-32],$=d[f+2-32];d[f+0+0]=d[f+2+32]=w+K+1>>1,d[f+0+32]=d[f+2+64]=y+w+1>>1,d[f+0+64]=d[f+2+96]=F+y+1>>1,d[f+0+96]=N+F+1>>1,d[f+3+0]=Kt(H,V,$),d[f+2+0]=Kt(K,H,V),d[f+1+0]=d[f+3+32]=Kt(w,K,H),d[f+1+32]=d[f+3+64]=Kt(y,w,K),d[f+1+64]=d[f+3+96]=Kt(F,y,w),d[f+1+96]=Kt(N,F,y)}function Pf(d,f){var w;for(w=0;8>w;++w)r(d,f+32*w,d,f-32,8)}function xu(d,f){var w;for(w=0;8>w;++w)i(d,f,d[f-1],8),f+=32}function Lh(d,f,w){var y;for(y=0;8>y;++y)i(f,w+32*y,d,8)}function Fh(d,f){var w,y=8;for(w=0;8>w;++w)y+=d[f+w-32]+d[f-1+32*w];Lh(y>>4,d,f)}function q1(d,f){var w,y=4;for(w=0;8>w;++w)y+=d[f+w-32];Lh(y>>3,d,f)}function Gf(d,f){var w,y=4;for(w=0;8>w;++w)y+=d[f-1+32*w];Lh(y>>3,d,f)}function jf(d,f){Lh(128,d,f)}function Nu(d,f,w){var y=d[f-w],F=d[f+0],N=3*(F-y)+V1[1020+d[f-2*w]-d[f+w]],K=pw[112+(N+4>>3)];d[f-w]=Ln[255+y+pw[112+(N+3>>3)]],d[f+0]=Ln[255+F-K]}function Ku(d,f,w,y){var F=d[f+0],N=d[f+w];return ns[255+d[f-2*w]-d[f-w]]>y||ns[255+N-F]>y}function Yf(d,f,w,y){return 4*ns[255+d[f-w]-d[f+0]]+ns[255+d[f-2*w]-d[f+w]]<=y}function Oh(d,f,w,y,F){var N=d[f-3*w],K=d[f-2*w],H=d[f-w],V=d[f+0],$=d[f+w],pe=d[f+2*w],ye=d[f+3*w];return 4*ns[255+H-V]+ns[255+K-$]>y?0:ns[255+d[f-4*w]-N]<=F&&ns[255+N-K]<=F&&ns[255+K-H]<=F&&ns[255+ye-pe]<=F&&ns[255+pe-$]<=F&&ns[255+$-V]<=F}function Hf(d,f,w,y){var F=2*y+1;for(y=0;16>y;++y)Yf(d,f+y,w,F)&&Nu(d,f+y,w)}function ku(d,f,w,y){var F=2*y+1;for(y=0;16>y;++y)Yf(d,f+y*w,1,F)&&Nu(d,f+y*w,1)}function sw(d,f,w,y){var F;for(F=3;0<F;--F)Hf(d,f+=4*w,w,y)}function ow(d,f,w,y){var F;for(F=3;0<F;--F)ku(d,f+=4,w,y)}function Vo(d,f,w,y,F,N,K,H){for(N=2*N+1;0<F--;){if(Oh(d,f,w,N,K))if(Ku(d,f,w,H))Nu(d,f,w);else{var V=d,$=f,pe=w,ye=V[$-2*pe],ee=V[$-pe],Ie=V[$+0],Se=V[$+pe],Le=V[$+2*pe],me=27*(be=V1[1020+3*(Ie-ee)+V1[1020+ye-Se]])+63>>7,Fe=18*be+63>>7,be=9*be+63>>7;V[$-3*pe]=Ln[255+V[$-3*pe]+be],V[$-2*pe]=Ln[255+ye+Fe],V[$-pe]=Ln[255+ee+me],V[$+0]=Ln[255+Ie-me],V[$+pe]=Ln[255+Se-Fe],V[$+2*pe]=Ln[255+Le-be]}f+=y}}function Wo(d,f,w,y,F,N,K,H){for(N=2*N+1;0<F--;){if(Oh(d,f,w,N,K))if(Ku(d,f,w,H))Nu(d,f,w);else{var V=d,$=f,pe=w,ye=V[$-pe],ee=V[$+0],Ie=V[$+pe],Se=pw[112+(4+(Le=3*(ee-ye))>>3)],Le=pw[112+(Le+3>>3)],me=Se+1>>1;V[$-2*pe]=Ln[255+V[$-2*pe]+me],V[$-pe]=Ln[255+ye+Le],V[$+0]=Ln[255+ee-Se],V[$+pe]=Ln[255+Ie-me]}f+=y}}function aw(d,f,w,y,F,N){Vo(d,f,w,1,16,y,F,N)}function cw(d,f,w,y,F,N){Vo(d,f,1,w,16,y,F,N)}function Pu(d,f,w,y,F,N){var K;for(K=3;0<K;--K)Wo(d,f+=4*w,w,1,16,y,F,N)}function uw(d,f,w,y,F,N){var K;for(K=3;0<K;--K)Wo(d,f+=4,1,w,16,y,F,N)}function B(d,f,w,y,F,N,K,H){Vo(d,f,F,1,8,N,K,H),Vo(w,y,F,1,8,N,K,H)}function L(d,f,w,y,F,N,K,H){Vo(d,f,1,F,8,N,K,H),Vo(w,y,1,F,8,N,K,H)}function Ae(d,f,w,y,F,N,K,H){Wo(d,f+4*F,F,1,8,N,K,H),Wo(w,y+4*F,F,1,8,N,K,H)}function he(d,f,w,y,F,N,K,H){Wo(d,f+4,1,F,8,N,K,H),Wo(w,y+4,1,F,8,N,K,H)}function we(){this.ba=new Qt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new AA,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Oe(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function He(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function gt(){this.ua=0,this.Wa=new Qe,this.vb=new Qe,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new te,this.yc=new G}function ft(){this.xb=this.a=0,this.l=new Th,this.ca=new Qt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new Y,this.Pb=0,this.wd=new Y,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new gt,this.ab=0,this.gc=o(4,He),this.Oc=0}function Ot(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Th,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Pt(d,f,w,y,F,N,K){for(d=d==null?0:d[f+0],f=0;f<K;++f)F[N+f]=d+w[y+f]&255,d=F[N+f]}function wA(d,f,w,y,F,N,K){var H;if(d==null)Pt(null,null,w,y,F,N,K);else for(H=0;H<K;++H)F[N+H]=d[f+H]+w[y+H]&255}function $A(d,f,w,y,F,N,K){if(d==null)Pt(null,null,w,y,F,N,K);else{var H,V=d[f+0],$=V,pe=V;for(H=0;H<K;++H)$=pe+(V=d[f+H])-$,pe=w[y+H]+(-256&$?0>$?0:255:$)&255,$=V,F[N+H]=pe}}function Or(d,f,w,y){var F=f.width,N=f.o;if(e(d!=null&&f!=null),0>w||0>=y||w+y>N)return null;if(!d.Cc){if(d.ga==null){var K;if(d.ga=new Ot,(K=d.ga==null)||(K=f.width*f.o,e(d.Gb.length==0),d.Gb=n(K),d.Uc=0,d.Gb==null?K=0:(d.mb=d.Gb,d.nb=d.Uc,d.rc=null,K=1),K=!K),!K){K=d.ga;var H=d.Fa,V=d.P,$=d.qc,pe=d.mb,ye=d.nb,ee=V+1,Ie=$-1,Se=K.l;if(e(H!=null&&pe!=null&&f!=null),dc[0]=null,dc[1]=Pt,dc[2]=wA,dc[3]=$A,K.ca=pe,K.tb=ye,K.c=f.width,K.i=f.height,e(0<K.c&&0<K.i),1>=$)f=0;else if(K.$a=3&H[V+0],K.Z=H[V+0]>>2&3,K.Lc=H[V+0]>>4&3,V=H[V+0]>>6&3,0>K.$a||1<K.$a||4<=K.Z||1<K.Lc||V)f=0;else if(Se.put=Bt,Se.ac=Ni,Se.bc=Ur,Se.ma=K,Se.width=f.width,Se.height=f.height,Se.Da=f.Da,Se.v=f.v,Se.va=f.va,Se.j=f.j,Se.o=f.o,K.$a)e:{e(K.$a==1),f=Ne();t:for(;;){if(f==null){f=0;break e}if(e(K!=null),K.mc=f,f.c=K.c,f.i=K.i,f.l=K.l,f.l.ma=K,f.l.width=K.c,f.l.height=K.i,f.a=0,se(f.m,H,ee,Ie),!FA(K.c,K.i,1,f,null)||(f.ab==1&&f.gc[0].hc==3&&ii(f.s)?(K.ic=1,H=f.c*f.i,f.Ta=null,f.Ua=0,f.V=n(H),f.Ba=0,f.V==null?(f.a=1,f=0):f=1):(K.ic=0,f=st(f,K.c)),!f))break t;f=1;break e}K.mc=null,f=0}else f=Ie>=K.c*K.i;K=!f}if(K)return null;d.ga.Lc!=1?d.Ga=0:y=N-w}e(d.ga!=null),e(w+y<=N);e:{if(f=(H=d.ga).c,N=H.l.o,H.$a==0){if(ee=d.rc,Ie=d.Vc,Se=d.Fa,V=d.P+1+w*f,$=d.mb,pe=d.nb+w*f,e(V<=d.P+d.qc),H.Z!=0)for(e(dc[H.Z]!=null),K=0;K<y;++K)dc[H.Z](ee,Ie,Se,V,$,pe,f),ee=$,Ie=pe,pe+=f,V+=f;else for(K=0;K<y;++K)r($,pe,Se,V,f),ee=$,Ie=pe,pe+=f,V+=f;d.rc=ee,d.Vc=Ie}else{if(e(H.mc!=null),f=w+y,e((K=H.mc)!=null),e(f<=K.i),K.C>=f)f=1;else if(H.ic||As(),H.ic){H=K.V,ee=K.Ba,Ie=K.c;var Le=K.i,me=(Se=1,V=K.$/Ie,$=K.$%Ie,pe=K.m,ye=K.s,K.$),Fe=Ie*Le,be=Ie*f,qe=ye.wc,je=me<be?HA(ye,$,V):null;e(me<=Fe),e(f<=Le),e(ii(ye));t:for(;;){for(;!pe.h&&me<be;){if($&qe||(je=HA(ye,$,V)),e(je!=null),Z(pe),256>(Le=iA(je.G[0],je.H[0],pe)))H[ee+me]=Le,++me,++$>=Ie&&($=0,++V<=f&&!(V%16)&&Ki(K,V));else{if(!(280>Le)){Se=0;break t}Le=ti(Le-256,pe);var Et,lt=iA(je.G[4],je.H[4],pe);if(Z(pe),!(me>=(lt=Ai(Ie,lt=ti(lt,pe)))&&Fe-me>=Le)){Se=0;break t}for(Et=0;Et<Le;++Et)H[ee+me+Et]=H[ee+me+Et-lt];for(me+=Le,$+=Le;$>=Ie;)$-=Ie,++V<=f&&!(V%16)&&Ki(K,V);me<be&&$&qe&&(je=HA(ye,$,V))}e(pe.h==re(pe))}Ki(K,V>f?f:V);break t}!Se||pe.h&&me<Fe?(Se=0,K.a=pe.h?5:3):K.$=me,f=Se}else f=ki(K,K.V,K.Ba,K.c,K.i,f,le);if(!f){y=0;break e}}w+y>=N&&(d.Cc=1),y=1}if(!y)return null;if(d.Cc&&((y=d.ga)!=null&&(y.mc=null),d.ga=null,0<d.Ga))return alert("todo:WebPDequantizeLevels"),null}return d.nb+w*F}function GA(d,f,w,y,F,N){for(;0<F--;){var K,H=d,V=f+(w?1:0),$=d,pe=f+(w?0:3);for(K=0;K<y;++K){var ye=$[pe+4*K];ye!=255&&(ye*=32897,H[V+4*K+0]=H[V+4*K+0]*ye>>23,H[V+4*K+1]=H[V+4*K+1]*ye>>23,H[V+4*K+2]=H[V+4*K+2]*ye>>23)}f+=N}}function jr(d,f,w,y,F){for(;0<y--;){var N;for(N=0;N<w;++N){var K=d[f+2*N+0],H=15&($=d[f+2*N+1]),V=4369*H,$=(240&$|$>>4)*V>>16;d[f+2*N+0]=(240&K|K>>4)*V>>16&240|(15&K|K<<4)*V>>16>>4&15,d[f+2*N+1]=240&$|H}f+=F}}function br(d,f,w,y,F,N,K,H){var V,$,pe=255;for($=0;$<F;++$){for(V=0;V<y;++V){var ye=d[f+V];N[K+4*V]=ye,pe&=ye}f+=w,K+=H}return pe!=255}function Ci(d,f,w,y,F){var N;for(N=0;N<F;++N)w[y+N]=d[f+N]>>8}function As(){tE=GA,p3=jr,f3=br,E3=Ci}function fn(d,f,w){T[d]=function(y,F,N,K,H,V,$,pe,ye,ee,Ie,Se,Le,me,Fe,be,qe){var je,Et=qe-1>>1,lt=H[V+0]|$[pe+0]<<16,qt=ye[ee+0]|Ie[Se+0]<<16;e(y!=null);var dt=3*lt+qt+131074>>2;for(f(y[F+0],255&dt,dt>>16,Le,me),N!=null&&(dt=3*qt+lt+131074>>2,f(N[K+0],255&dt,dt>>16,Fe,be)),je=1;je<=Et;++je){var hA=H[V+je]|$[pe+je]<<16,Hr=ye[ee+je]|Ie[Se+je]<<16,Vt=lt+hA+qt+Hr+524296,pt=Vt+2*(hA+qt)>>3;dt=pt+lt>>1,lt=(Vt=Vt+2*(lt+Hr)>>3)+hA>>1,f(y[F+2*je-1],255&dt,dt>>16,Le,me+(2*je-1)*w),f(y[F+2*je-0],255&lt,lt>>16,Le,me+(2*je-0)*w),N!=null&&(dt=Vt+qt>>1,lt=pt+Hr>>1,f(N[K+2*je-1],255&dt,dt>>16,Fe,be+(2*je-1)*w),f(N[K+2*je+0],255&lt,lt>>16,Fe,be+(2*je+0)*w)),lt=hA,qt=Hr}1&qe||(dt=3*lt+qt+131074>>2,f(y[F+qe-1],255&dt,dt>>16,Le,me+(qe-1)*w),N!=null&&(dt=3*qt+lt+131074>>2,f(N[K+qe-1],255&dt,dt>>16,Fe,be+(qe-1)*w)))}}function lw(){ss[fw]=UQe,ss[Ew]=R3,ss[S3]=LQe,ss[Cw]=D3,ss[Iw]=T3,ss[W1]=U3,ss[m3]=FQe,ss[Z1]=R3,ss[X1]=D3,ss[Bw]=T3,ss[_1]=U3}function bh(d){return d&~OQe?0>d?0:255:d>>L3}function Gu(d,f){return bh((19077*d>>8)+(26149*f>>8)-14234)}function nc(d,f,w){return bh((19077*d>>8)-(6419*f>>8)-(13320*w>>8)+8708)}function ju(d,f){return bh((19077*d>>8)+(33050*f>>8)-17685)}function Yu(d,f,w,y,F){y[F+0]=Gu(d,w),y[F+1]=nc(d,f,w),y[F+2]=ju(d,f)}function Hu(d,f,w,y,F){y[F+0]=ju(d,f),y[F+1]=nc(d,f,w),y[F+2]=Gu(d,w)}function Pi(d,f,w,y,F){var N=nc(d,f,w);f=N<<3&224|ju(d,f)>>3,y[F+0]=248&Gu(d,w)|N>>5,y[F+1]=f}function zu(d,f,w,y,F){var N=240&ju(d,f)|15;y[F+0]=240&Gu(d,w)|nc(d,f,w)>>4,y[F+1]=N}function Ju(d,f,w,y,F){y[F+0]=255,Yu(d,f,w,y,F+1)}function zf(d,f,w,y,F){Hu(d,f,w,y,F),y[F+3]=255}function Jf(d,f,w,y,F){Yu(d,f,w,y,F),y[F+3]=255}function cr(d,f){return 0>d?0:d>f?f:d}function Zo(d,f,w){T[d]=function(y,F,N,K,H,V,$,pe,ye){for(var ee=pe+(-2&ye)*w;pe!=ee;)f(y[F+0],N[K+0],H[V+0],$,pe),f(y[F+1],N[K+0],H[V+0],$,pe+w),F+=2,++K,++V,pe+=2*w;1&ye&&f(y[F+0],N[K+0],H[V+0],$,pe)}}function xh(d,f,w){return w==0?d==0?f==0?6:5:f==0?4:0:w}function hw(d,f,w,y,F){switch(d>>>30){case 3:Zu(f,w,y,F,0);break;case 2:is(f,w,y,F);break;case 1:QA(f,w,y,F)}}function rs(d,f){var w,y,F=f.M,N=f.Nb,K=d.oc,H=d.pc+40,V=d.oc,$=d.pc+584,pe=d.oc,ye=d.pc+600;for(w=0;16>w;++w)K[H+32*w-1]=129;for(w=0;8>w;++w)V[$+32*w-1]=129,pe[ye+32*w-1]=129;for(0<F?K[H-1-32]=V[$-1-32]=pe[ye-1-32]=129:(i(K,H-32-1,127,21),i(V,$-32-1,127,9),i(pe,ye-32-1,127,9)),y=0;y<d.za;++y){var ee=f.ya[f.aa+y];if(0<y){for(w=-1;16>w;++w)r(K,H+32*w-4,K,H+32*w+12,4);for(w=-1;8>w;++w)r(V,$+32*w-4,V,$+32*w+4,4),r(pe,ye+32*w-4,pe,ye+32*w+4,4)}var Ie=d.Gd,Se=d.Hd+y,Le=ee.ad,me=ee.Hc;if(0<F&&(r(K,H-32,Ie[Se].y,0,16),r(V,$-32,Ie[Se].f,0,8),r(pe,ye-32,Ie[Se].ea,0,8)),ee.Za){var Fe=K,be=H-32+16;for(0<F&&(y>=d.za-1?i(Fe,be,Ie[Se].y[15],4):r(Fe,be,Ie[Se+1].y,0,4)),w=0;4>w;w++)Fe[be+128+w]=Fe[be+256+w]=Fe[be+384+w]=Fe[be+0+w];for(w=0;16>w;++w,me<<=2)Fe=K,be=H+O3[w],Ts[ee.Ob[w]](Fe,be),hw(me,Le,16*+w,Fe,be)}else if(Fe=xh(y,F,ee.Ob[0]),gc[Fe](K,H),me!=0)for(w=0;16>w;++w,me<<=2)hw(me,Le,16*+w,K,H+O3[w]);for(w=ee.Gc,Fe=xh(y,F,ee.Dd),$o[Fe](V,$),$o[Fe](pe,ye),me=Le,Fe=V,be=$,255&(ee=0|w)&&(170&ee?io(me,256,Fe,be):NA(me,256,Fe,be)),ee=pe,me=ye,255&(w>>=8)&&(170&w?io(Le,320,ee,me):NA(Le,320,ee,me)),F<d.Ub-1&&(r(Ie[Se].y,0,K,H+480,16),r(Ie[Se].f,0,V,$+224,8),r(Ie[Se].ea,0,pe,ye+224,8)),w=8*N*d.B,Ie=d.sa,Se=d.ta+16*y+16*N*d.R,Le=d.qa,ee=d.ra+8*y+w,me=d.Ha,Fe=d.Ia+8*y+w,w=0;16>w;++w)r(Ie,Se+w*d.R,K,H+32*w,16);for(w=0;8>w;++w)r(Le,ee+w*d.B,V,$+32*w,8),r(me,Fe+w*d.B,pe,ye+32*w,8)}}function qu(d,f,w,y,F,N,K,H,V){var $=[0],pe=[0],ye=0,ee=V!=null?V.kd:0,Ie=V??new Oe;if(d==null||12>w)return 7;Ie.data=d,Ie.w=f,Ie.ha=w,f=[f],w=[w],Ie.gb=[Ie.gb];e:{var Se=f,Le=w,me=Ie.gb;if(e(d!=null),e(Le!=null),e(me!=null),me[0]=0,12<=Le[0]&&!A(d,Se[0],"RIFF")){if(A(d,Se[0]+8,"WEBP")){me=3;break e}var Fe=z(d,Se[0]+4);if(12>Fe||4294967286<Fe){me=3;break e}if(ee&&Fe>Le[0]-8){me=7;break e}me[0]=Fe,Se[0]+=12,Le[0]-=12}me=0}if(me!=0)return me;for(Fe=0<Ie.gb[0],w=w[0];;){e:{var be=d;Le=f,me=w;var qe=$,je=pe,Et=Se=[0];if((dt=ye=[ye])[0]=0,8>me[0])me=7;else{if(!A(be,Le[0],"VP8X")){if(z(be,Le[0]+4)!=10){me=3;break e}if(18>me[0]){me=7;break e}var lt=z(be,Le[0]+8),qt=1+J(be,Le[0]+12);if(2147483648<=qt*(be=1+J(be,Le[0]+15))){me=3;break e}Et!=null&&(Et[0]=lt),qe!=null&&(qe[0]=qt),je!=null&&(je[0]=be),Le[0]+=18,me[0]-=18,dt[0]=1}me=0}}if(ye=ye[0],Se=Se[0],me!=0)return me;if(Le=!!(2&Se),!Fe&&ye)return 3;if(N!=null&&(N[0]=!!(16&Se)),K!=null&&(K[0]=Le),H!=null&&(H[0]=0),K=$[0],Se=pe[0],ye&&Le&&V==null){me=0;break}if(4>w){me=7;break}if(Fe&&ye||!Fe&&!ye&&!A(d,f[0],"ALPH")){w=[w],Ie.na=[Ie.na],Ie.P=[Ie.P],Ie.Sa=[Ie.Sa];e:{lt=d,me=f,Fe=w;var dt=Ie.gb;qe=Ie.na,je=Ie.P,Et=Ie.Sa,qt=22,e(lt!=null),e(Fe!=null),be=me[0];var hA=Fe[0];for(e(qe!=null),e(Et!=null),qe[0]=null,je[0]=null,Et[0]=0;;){if(me[0]=be,Fe[0]=hA,8>hA){me=7;break e}var Hr=z(lt,be+4);if(4294967286<Hr){me=3;break e}var Vt=8+Hr+1&-2;if(qt+=Vt,0<dt&&qt>dt){me=3;break e}if(!A(lt,be,"VP8 ")||!A(lt,be,"VP8L")){me=0;break e}if(hA[0]<Vt){me=7;break e}A(lt,be,"ALPH")||(qe[0]=lt,je[0]=be+8,Et[0]=Hr),be+=Vt,hA-=Vt}}if(w=w[0],Ie.na=Ie.na[0],Ie.P=Ie.P[0],Ie.Sa=Ie.Sa[0],me!=0)break}w=[w],Ie.Ja=[Ie.Ja],Ie.xa=[Ie.xa];e:if(dt=d,me=f,Fe=w,qe=Ie.gb[0],je=Ie.Ja,Et=Ie.xa,lt=me[0],be=!A(dt,lt,"VP8 "),qt=!A(dt,lt,"VP8L"),e(dt!=null),e(Fe!=null),e(je!=null),e(Et!=null),8>Fe[0])me=7;else{if(be||qt){if(dt=z(dt,lt+4),12<=qe&&dt>qe-12){me=3;break e}if(ee&&dt>Fe[0]-8){me=7;break e}je[0]=dt,me[0]+=8,Fe[0]-=8,Et[0]=qt}else Et[0]=5<=Fe[0]&&dt[lt+0]==47&&!(dt[lt+4]>>5),je[0]=Fe[0];me=0}if(w=w[0],Ie.Ja=Ie.Ja[0],Ie.xa=Ie.xa[0],f=f[0],me!=0)break;if(4294967286<Ie.Ja)return 3;if(H==null||Le||(H[0]=Ie.xa?2:1),K=[K],Se=[Se],Ie.xa){if(5>w){me=7;break}H=K,ee=Se,Le=N,d==null||5>w?d=0:5<=w&&d[f+0]==47&&!(d[f+4]>>5)?(Fe=[0],dt=[0],qe=[0],se(je=new Y,d,f,w),Ei(je,Fe,dt,qe)?(H!=null&&(H[0]=Fe[0]),ee!=null&&(ee[0]=dt[0]),Le!=null&&(Le[0]=qe[0]),d=1):d=0):d=0}else{if(10>w){me=7;break}H=Se,d==null||10>w||!Aw(d,f+3,w-3)?d=0:(ee=d[f+0]|d[f+1]<<8|d[f+2]<<16,Le=16383&(d[f+7]<<8|d[f+6]),d=16383&(d[f+9]<<8|d[f+8]),1&ee||3<(ee>>1&7)||!(ee>>4&1)||ee>>5>=Ie.Ja||!Le||!d?d=0:(K&&(K[0]=Le),H&&(H[0]=d),d=1))}if(!d||(K=K[0],Se=Se[0],ye&&($[0]!=K||pe[0]!=Se)))return 3;V!=null&&(V[0]=Ie,V.offset=f-V.w,e(4294967286>f-V.w),e(V.offset==V.ha-w));break}return me==0||me==7&&ye&&V==null?(N!=null&&(N[0]|=Ie.na!=null&&0<Ie.na.length),y!=null&&(y[0]=K),F!=null&&(F[0]=Se),0):me}function qf(d,f,w){var y=f.width,F=f.height,N=0,K=0,H=y,V=F;if(f.Da=d!=null&&0<d.Da,f.Da&&(H=d.cd,V=d.bd,N=d.v,K=d.j,11>w||(N&=-2,K&=-2),0>N||0>K||0>=H||0>=V||N+H>y||K+V>F))return 0;if(f.v=N,f.j=K,f.va=N+H,f.o=K+V,f.U=H,f.T=V,f.da=d!=null&&0<d.da,f.da){if(!Te(H,V,w=[d.ib],N=[d.hb]))return 0;f.ib=w[0],f.hb=N[0]}return f.ob=d!=null&&d.ob,f.Kb=d==null||!d.Sd,f.da&&(f.ob=f.ib<3*y/4&&f.hb<3*F/4,f.Kb=0),1}function Vf(d){if(d==null)return 2;if(11>d.S){var f=d.f.RGBA;f.fb+=(d.height-1)*f.A,f.A=-f.A}else f=d.f.kb,d=d.height,f.O+=(d-1)*f.fa,f.fa=-f.fa,f.N+=(d-1>>1)*f.Ab,f.Ab=-f.Ab,f.W+=(d-1>>1)*f.Db,f.Db=-f.Db,f.F!=null&&(f.J+=(d-1)*f.lb,f.lb=-f.lb);return 0}function sc(d,f,w,y){if(y==null||0>=d||0>=f)return 2;if(w!=null){if(w.Da){var F=w.cd,N=w.bd,K=-2&w.v,H=-2&w.j;if(0>K||0>H||0>=F||0>=N||K+F>d||H+N>f)return 2;d=F,f=N}if(w.da){if(!Te(d,f,F=[w.ib],N=[w.hb]))return 2;d=F[0],f=N[0]}}y.width=d,y.height=f;e:{var V=y.width,$=y.height;if(d=y.S,0>=V||0>=$||!(d>=fw&&13>d))d=2;else{if(0>=y.Rd&&y.sd==null){K=N=F=f=0;var pe=(H=V*b3[d])*$;if(11>d||(N=($+1)/2*(f=(V+1)/2),d==12&&(K=(F=V)*$)),($=n(pe+2*N+K))==null){d=1;break e}y.sd=$,11>d?((V=y.f.RGBA).eb=$,V.fb=0,V.A=H,V.size=pe):((V=y.f.kb).y=$,V.O=0,V.fa=H,V.Fd=pe,V.f=$,V.N=0+pe,V.Ab=f,V.Cd=N,V.ea=$,V.W=0+pe+N,V.Db=f,V.Ed=N,d==12&&(V.F=$,V.J=0+pe+2*N),V.Tc=K,V.lb=F)}if(f=1,F=y.S,N=y.width,K=y.height,F>=fw&&13>F)if(11>F)d=y.f.RGBA,f&=(H=Math.abs(d.A))*(K-1)+N<=d.size,f&=H>=N*b3[F],f&=d.eb!=null;else{d=y.f.kb,H=(N+1)/2,pe=(K+1)/2,V=Math.abs(d.fa),$=Math.abs(d.Ab);var ye=Math.abs(d.Db),ee=Math.abs(d.lb),Ie=ee*(K-1)+N;f&=V*(K-1)+N<=d.Fd,f&=$*(pe-1)+H<=d.Cd,f=(f&=ye*(pe-1)+H<=d.Ed)&V>=N&$>=H&ye>=H,f&=d.y!=null,f&=d.f!=null,f&=d.ea!=null,F==12&&(f&=ee>=N,f&=Ie<=d.Tc,f&=d.F!=null)}else f=0;d=f?0:2}}return d!=0||w!=null&&w.fd&&(d=Vf(y)),d}var Vu=64,Tn=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Un=24,oc=32,Xo=8,ac=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ve("Predictor0","PredictorAdd0"),T.Predictor0=function(){return 4278190080},T.Predictor1=function(d){return d},T.Predictor2=function(d,f,w){return f[w+0]},T.Predictor3=function(d,f,w){return f[w+1]},T.Predictor4=function(d,f,w){return f[w-1]},T.Predictor5=function(d,f,w){return Ue(Ue(d,f[w+1]),f[w+0])},T.Predictor6=function(d,f,w){return Ue(d,f[w-1])},T.Predictor7=function(d,f,w){return Ue(d,f[w+0])},T.Predictor8=function(d,f,w){return Ue(f[w-1],f[w+0])},T.Predictor9=function(d,f,w){return Ue(f[w+0],f[w+1])},T.Predictor10=function(d,f,w){return Ue(Ue(d,f[w-1]),Ue(f[w+0],f[w+1]))},T.Predictor11=function(d,f,w){var y=f[w+0];return 0>=Je(y>>24&255,d>>24&255,(f=f[w-1])>>24&255)+Je(y>>16&255,d>>16&255,f>>16&255)+Je(y>>8&255,d>>8&255,f>>8&255)+Je(255&y,255&d,255&f)?y:d},T.Predictor12=function(d,f,w){var y=f[w+0];return(ke((d>>24&255)+(y>>24&255)-((f=f[w-1])>>24&255))<<24|ke((d>>16&255)+(y>>16&255)-(f>>16&255))<<16|ke((d>>8&255)+(y>>8&255)-(f>>8&255))<<8|ke((255&d)+(255&y)-(255&f)))>>>0},T.Predictor13=function(d,f,w){var y=f[w-1];return(Ye((d=Ue(d,f[w+0]))>>24&255,y>>24&255)<<24|Ye(d>>16&255,y>>16&255)<<16|Ye(d>>8&255,y>>8&255)<<8|Ye(255&d,255&y))>>>0};var Wf=T.PredictorAdd0;T.PredictorAdd1=rt,ve("Predictor2","PredictorAdd2"),ve("Predictor3","PredictorAdd3"),ve("Predictor4","PredictorAdd4"),ve("Predictor5","PredictorAdd5"),ve("Predictor6","PredictorAdd6"),ve("Predictor7","PredictorAdd7"),ve("Predictor8","PredictorAdd8"),ve("Predictor9","PredictorAdd9"),ve("Predictor10","PredictorAdd10"),ve("Predictor11","PredictorAdd11"),ve("Predictor12","PredictorAdd12"),ve("Predictor13","PredictorAdd13");var Nh=T.PredictorAdd2;_e("ColorIndexInverseTransform","MapARGB","32b",function(d){return d>>8&255},function(d){return d}),_e("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(d){return d},function(d){return d>>8&255});var vr,gw=T.ColorIndexInverseTransform,Ao=T.MapARGB,ro=T.VP8LColorIndexInverseTransformAlpha,Zf=T.MapAlpha,Xf=T.VP8LPredictorsAdd=[];Xf.length=16,(T.VP8LPredictors=[]).length=16,(T.VP8LPredictorsAdd_C=[]).length=16,(T.VP8LPredictors_C=[]).length=16;var _f,$f,cc,uc,lc,Wu,hc,Zu,is,io,QA,NA,wr,Yr,_o,eE,Kh,dw,c3,u3,l3,h3,g3,d3,tE,p3,f3,E3,C3=n(511),I3=n(2041),B3=n(225),v3=n(767),w3=0,V1=I3,pw=B3,Ln=v3,ns=C3,fw=0,Ew=1,S3=2,Cw=3,Iw=4,W1=5,m3=6,Z1=7,X1=8,Bw=9,_1=10,EQe=[2,3,7],CQe=[3,3,11],M3=[280,256,256,256,40],IQe=[0,1,1,1,0],BQe=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],vQe=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],wQe=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],SQe=8,$1=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],eR=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],AE=null,mQe=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],MQe=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],y3=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],yQe=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],QQe=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],RQe=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],DQe=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],gc=[],Ts=[],$o=[],TQe=1,Q3=2,dc=[],ss=[];fn("UpsampleRgbLinePair",Yu,3),fn("UpsampleBgrLinePair",Hu,3),fn("UpsampleRgbaLinePair",Jf,4),fn("UpsampleBgraLinePair",zf,4),fn("UpsampleArgbLinePair",Ju,4),fn("UpsampleRgba4444LinePair",zu,2),fn("UpsampleRgb565LinePair",Pi,2);var UQe=T.UpsampleRgbLinePair,LQe=T.UpsampleBgrLinePair,R3=T.UpsampleRgbaLinePair,D3=T.UpsampleBgraLinePair,T3=T.UpsampleArgbLinePair,U3=T.UpsampleRgba4444LinePair,FQe=T.UpsampleRgb565LinePair,vw=16,ww=1<<vw-1,rE=-227,tR=482,L3=6,OQe=(256<<L3)-1,F3=0,bQe=n(256),xQe=n(256),NQe=n(256),KQe=n(256),kQe=n(tR-rE),PQe=n(tR-rE);Zo("YuvToRgbRow",Yu,3),Zo("YuvToBgrRow",Hu,3),Zo("YuvToRgbaRow",Jf,4),Zo("YuvToBgraRow",zf,4),Zo("YuvToArgbRow",Ju,4),Zo("YuvToRgba4444Row",zu,2),Zo("YuvToRgb565Row",Pi,2);var O3=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Sw=[0,2,8],GQe=[8,7,6,4,4,2,2,2,1,1,1,1],jQe=1;this.WebPDecodeRGBA=function(d,f,w,y,F){var N=Ew,K=new we,H=new Qt;K.ba=H,H.S=N,H.width=[H.width],H.height=[H.height];var V=H.width,$=H.height,pe=new Xe;if(pe==null||d==null)var ye=2;else e(pe!=null),ye=qu(d,f,w,pe.width,pe.height,pe.Pd,pe.Qd,pe.format,null);if(ye!=0?V=0:(V!=null&&(V[0]=pe.width[0]),$!=null&&($[0]=pe.height[0]),V=1),V){H.width=H.width[0],H.height=H.height[0],y!=null&&(y[0]=H.width),F!=null&&(F[0]=H.height);e:{if(y=new Th,(F=new Oe).data=d,F.w=f,F.ha=w,F.kd=1,f=[0],e(F!=null),((d=qu(F.data,F.w,F.ha,null,null,null,f,null,F))==0||d==7)&&f[0]&&(d=4),(f=d)==0){if(e(K!=null),y.data=F.data,y.w=F.w+F.offset,y.ha=F.ha-F.offset,y.put=Bt,y.ac=Ni,y.bc=Ur,y.ma=K,F.xa){if((d=Ne())==null){K=1;break e}if(function(ee,Ie){var Se=[0],Le=[0],me=[0];t:for(;;){if(ee==null)return 0;if(Ie==null)return ee.a=2,0;if(ee.l=Ie,ee.a=0,se(ee.m,Ie.data,Ie.w,Ie.ha),!Ei(ee.m,Se,Le,me)){ee.a=3;break t}if(ee.xb=Q3,Ie.width=Se[0],Ie.height=Le[0],!FA(Se[0],Le[0],1,ee,null))break t;return 1}return e(ee.a!=0),0}(d,y)){if(y=(f=sc(y.width,y.height,K.Oa,K.ba))==0){t:{y=d;A:for(;;){if(y==null){y=0;break t}if(e(y.s.yc!=null),e(y.s.Ya!=null),e(0<y.s.Wb),e((w=y.l)!=null),e((F=w.ma)!=null),y.xb!=0){if(y.ca=F.ba,y.tb=F.tb,e(y.ca!=null),!qf(F.Oa,w,Cw)){y.a=2;break A}if(!st(y,w.width)||w.da)break A;if((w.da||Ge(y.ca.S))&&As(),11>y.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),y.ca.f.kb.F!=null&&As()),y.Pb&&0<y.s.ua&&y.s.vb.X==null&&!b(y.s.vb,y.s.Wa.Xa)){y.a=1;break A}y.xb=0}if(!ki(y,y.V,y.Ba,y.c,y.i,w.o,ri))break A;F.Dc=y.Ma,y=1;break t}e(y.a!=0),y=0}y=!y}y&&(f=d.a)}else f=d.a}else{if((d=new F1)==null){K=1;break e}if(d.Fa=F.na,d.P=F.P,d.qc=F.Sa,rw(d,y)){if((f=sc(y.width,y.height,K.Oa,K.ba))==0){if(d.Aa=0,w=K.Oa,e((F=d)!=null),w!=null){if(0<(V=0>(V=w.Md)?0:100<V?255:255*V/100)){for($=pe=0;4>$;++$)12>(ye=F.pb[$]).lc&&(ye.ia=V*GQe[0>ye.lc?0:ye.lc]>>3),pe|=ye.ia;pe&&(alert("todo:VP8InitRandom"),F.ia=1)}F.Ga=w.Id,100<F.Ga?F.Ga=100:0>F.Ga&&(F.Ga=0)}(function(ee,Ie){if(ee==null)return 0;if(Ie==null)return Fr(ee,2,"NULL VP8Io parameter in VP8Decode().");if(!ee.cb&&!rw(ee,Ie))return 0;if(e(ee.cb),Ie.ac==null||Ie.ac(Ie)){Ie.ob&&(ee.L=0);var Se=Sw[ee.L];if(ee.L==2?(ee.yb=0,ee.zb=0):(ee.yb=Ie.v-Se>>4,ee.zb=Ie.j-Se>>4,0>ee.yb&&(ee.yb=0),0>ee.zb&&(ee.zb=0)),ee.Va=Ie.o+15+Se>>4,ee.Hb=Ie.va+15+Se>>4,ee.Hb>ee.za&&(ee.Hb=ee.za),ee.Va>ee.Ub&&(ee.Va=ee.Ub),0<ee.L){var Le=ee.ed;for(Se=0;4>Se;++Se){var me;if(ee.Qa.Cb){var Fe=ee.Qa.Lb[Se];ee.Qa.Fb||(Fe+=Le.Tb)}else Fe=Le.Tb;for(me=0;1>=me;++me){var be=ee.gd[Se][me],qe=Fe;if(Le.Pc&&(qe+=Le.vd[0],me&&(qe+=Le.od[0])),0<(qe=0>qe?0:63<qe?63:qe)){var je=qe;0<Le.wb&&(je=4<Le.wb?je>>2:je>>1)>9-Le.wb&&(je=9-Le.wb),1>je&&(je=1),be.dd=je,be.tc=2*qe+je,be.ld=40<=qe?2:15<=qe?1:0}else be.tc=0;be.La=me}}}Se=0}else Fr(ee,6,"Frame setup failed"),Se=ee.a;if(Se=Se==0){if(Se){ee.$c=0,0<ee.Aa||(ee.Ic=jQe);t:{Se=ee.Ic,Le=4*(je=ee.za);var Et=32*je,lt=je+1,qt=0<ee.L?je*(0<ee.Aa?2:1):0,dt=(ee.Aa==2?2:1)*je;if((be=Le+832+(me=3*(16*Se+Sw[ee.L])/2*Et)+(Fe=ee.Fa!=null&&0<ee.Fa.length?ee.Kc.c*ee.Kc.i:0))!=be)Se=0;else{if(be>ee.Vb){if(ee.Vb=0,ee.Ec=n(be),ee.Fc=0,ee.Ec==null){Se=Fr(ee,1,"no memory during frame initialization.");break t}ee.Vb=be}be=ee.Ec,qe=ee.Fc,ee.Ac=be,ee.Bc=qe,qe+=Le,ee.Gd=o(Et,Uu),ee.Hd=0,ee.rb=o(lt+1,ts),ee.sb=1,ee.wa=qt?o(qt,ar):null,ee.Y=0,ee.D.Nb=0,ee.D.wa=ee.wa,ee.D.Y=ee.Y,0<ee.Aa&&(ee.D.Y+=je),e(!0),ee.oc=be,ee.pc=qe,qe+=832,ee.ya=o(dt,_A),ee.aa=0,ee.D.ya=ee.ya,ee.D.aa=ee.aa,ee.Aa==2&&(ee.D.aa+=je),ee.R=16*je,ee.B=8*je,je=(Et=Sw[ee.L])*ee.R,Et=Et/2*ee.B,ee.sa=be,ee.ta=qe+je,ee.qa=ee.sa,ee.ra=ee.ta+16*Se*ee.R+Et,ee.Ha=ee.qa,ee.Ia=ee.ra+8*Se*ee.B+Et,ee.$c=0,qe+=me,ee.mb=Fe?be:null,ee.nb=Fe?qe:null,e(qe+Fe<=ee.Fc+ee.Vb),Lu(ee),i(ee.Ac,ee.Bc,0,Le),Se=1}}if(Se){if(Ie.ka=0,Ie.y=ee.sa,Ie.O=ee.ta,Ie.f=ee.qa,Ie.N=ee.ra,Ie.ea=ee.Ha,Ie.Vd=ee.Ia,Ie.fa=ee.R,Ie.Rc=ee.B,Ie.F=null,Ie.J=0,!w3){for(Se=-255;255>=Se;++Se)C3[255+Se]=0>Se?-Se:Se;for(Se=-1020;1020>=Se;++Se)I3[1020+Se]=-128>Se?-128:127<Se?127:Se;for(Se=-112;112>=Se;++Se)B3[112+Se]=-16>Se?-16:15<Se?15:Se;for(Se=-255;510>=Se;++Se)v3[255+Se]=0>Se?0:255<Se?255:Se;w3=1}hc=nw,Zu=b1,io=x1,QA=to,NA=iw,is=O1,wr=aw,Yr=cw,_o=B,eE=L,Kh=Pu,dw=uw,c3=Ae,u3=he,l3=Hf,h3=ku,g3=sw,d3=ow,Ts[0]=Y1,Ts[1]=Nf,Ts[2]=G1,Ts[3]=j1,Ts[4]=H1,Ts[5]=qo,Ts[6]=Jo,Ts[7]=z1,Ts[8]=Uh,Ts[9]=J1,gc[0]=ic,gc[1]=K1,gc[2]=k1,gc[3]=Kf,gc[4]=P1,gc[5]=bu,gc[6]=kf,$o[0]=Fh,$o[1]=N1,$o[2]=Pf,$o[3]=xu,$o[4]=Gf,$o[5]=q1,$o[6]=jf,Se=1}else Se=0}Se&&(Se=function(hA,Hr){for(hA.M=0;hA.M<hA.Va;++hA.M){var Vt,pt=hA.Jc[hA.M&hA.Xb],$e=hA.m,Sr=hA;for(Vt=0;Vt<Sr.za;++Vt){var Yt=$e,fA=Sr,zA=fA.Ac,Ii=fA.Bc+4*Vt,$i=fA.zc,ur=fA.ya[fA.aa+Vt];if(fA.Qa.Bb?ur.$b=de(Yt,fA.Pa.jb[0])?2+de(Yt,fA.Pa.jb[2]):de(Yt,fA.Pa.jb[1]):ur.$b=0,fA.kc&&(ur.Ad=de(Yt,fA.Bd)),ur.Za=!de(Yt,145)+0,ur.Za){var Gi=ur.Ob,en=0;for(fA=0;4>fA;++fA){var zr,IA=$i[0+fA];for(zr=0;4>zr;++zr){IA=QQe[zA[Ii+zr]][IA];for(var TA=y3[de(Yt,IA[0])];0<TA;)TA=y3[2*TA+de(Yt,IA[TA])];IA=-TA,zA[Ii+zr]=IA}r(Gi,en,zA,Ii,4),en+=4,$i[0+fA]=IA}}else IA=de(Yt,156)?de(Yt,128)?1:3:de(Yt,163)?2:0,ur.Ob[0]=IA,i(zA,Ii,IA,4),i($i,0,IA,4);ur.Dd=de(Yt,142)?de(Yt,114)?de(Yt,183)?1:3:2:0}if(Sr.m.Ka)return Fr(hA,7,"Premature end-of-partition0 encountered.");for(;hA.ja<hA.za;++hA.ja){if(Sr=pt,Yt=($e=hA).rb[$e.sb-1],zA=$e.rb[$e.sb+$e.ja],Vt=$e.ya[$e.aa+$e.ja],Ii=$e.kc?Vt.Ad:0)Yt.la=zA.la=0,Vt.Za||(Yt.Na=zA.Na=0),Vt.Hc=0,Vt.Gc=0,Vt.ia=0;else{var lr,UA;if(Yt=zA,zA=Sr,Ii=$e.Pa.Xc,$i=$e.ya[$e.aa+$e.ja],ur=$e.pb[$i.$b],fA=$i.ad,Gi=0,en=$e.rb[$e.sb-1],IA=zr=0,i(fA,Gi,0,384),$i.Za)var Bi=0,Us=Ii[3];else{TA=n(16);var mr=Yt.Na+en.Na;if(mr=AE(zA,Ii[1],mr,ur.Eb,0,TA,0),Yt.Na=en.Na=(0<mr)+0,1<mr)hc(TA,0,fA,Gi);else{var En=TA[0]+3>>3;for(TA=0;256>TA;TA+=16)fA[Gi+TA]=En}Bi=1,Us=Ii[0]}var KA=15&Yt.la,Jr=15&en.la;for(TA=0;4>TA;++TA){var Fn=1&Jr;for(En=UA=0;4>En;++En)KA=KA>>1|(Fn=(mr=AE(zA,Us,mr=Fn+(1&KA),ur.Sc,Bi,fA,Gi))>Bi)<<7,UA=UA<<2|(3<mr?3:1<mr?2:fA[Gi+0]!=0),Gi+=16;KA>>=4,Jr=Jr>>1|Fn<<7,zr=(zr<<8|UA)>>>0}for(Us=KA,Bi=Jr>>4,lr=0;4>lr;lr+=2){for(UA=0,KA=Yt.la>>4+lr,Jr=en.la>>4+lr,TA=0;2>TA;++TA){for(Fn=1&Jr,En=0;2>En;++En)mr=Fn+(1&KA),KA=KA>>1|(Fn=0<(mr=AE(zA,Ii[2],mr,ur.Qc,0,fA,Gi)))<<3,UA=UA<<2|(3<mr?3:1<mr?2:fA[Gi+0]!=0),Gi+=16;KA>>=2,Jr=Jr>>1|Fn<<5}IA|=UA<<4*lr,Us|=KA<<4<<lr,Bi|=(240&Jr)<<lr}Yt.la=Us,en.la=Bi,$i.Hc=zr,$i.Gc=IA,$i.ia=43690&IA?0:ur.ia,Ii=!(zr|IA)}if(0<$e.L&&($e.wa[$e.Y+$e.ja]=$e.gd[Vt.$b][Vt.Za],$e.wa[$e.Y+$e.ja].La|=!Ii),Sr.Ka)return Fr(hA,7,"Premature end-of-file encountered.")}if(Lu(hA),$e=Hr,Sr=1,Vt=(pt=hA).D,Yt=0<pt.L&&pt.M>=pt.zb&&pt.M<=pt.Va,pt.Aa==0)t:{if(Vt.M=pt.M,Vt.uc=Yt,rs(pt,Vt),Sr=1,Vt=(UA=pt.D).Nb,Yt=(IA=Sw[pt.L])*pt.R,zA=IA/2*pt.B,TA=16*Vt*pt.R,En=8*Vt*pt.B,Ii=pt.sa,$i=pt.ta-Yt+TA,ur=pt.qa,fA=pt.ra-zA+En,Gi=pt.Ha,en=pt.Ia-zA+En,Jr=(KA=UA.M)==0,zr=KA>=pt.Va-1,pt.Aa==2&&rs(pt,UA),UA.uc)for(Fn=(mr=pt).D.M,e(mr.D.uc),UA=mr.yb;UA<mr.Hb;++UA){Bi=UA,Us=Fn;var tn=(On=(vi=mr).D).Nb;lr=vi.R;var On=On.wa[On.Y+Bi],bn=vi.sa,Cn=vi.ta+16*tn*lr+16*Bi,xn=On.dd,jA=On.tc;if(jA!=0)if(e(3<=jA),vi.L==1)0<Bi&&h3(bn,Cn,lr,jA+4),On.La&&d3(bn,Cn,lr,jA),0<Us&&l3(bn,Cn,lr,jA+4),On.La&&g3(bn,Cn,lr,jA);else{var Nn=vi.B,Ls=vi.qa,Xu=vi.ra+8*tn*Nn+8*Bi,ea=vi.Ha,vi=vi.Ia+8*tn*Nn+8*Bi;tn=On.ld,0<Bi&&(Yr(bn,Cn,lr,jA+4,xn,tn),eE(Ls,Xu,ea,vi,Nn,jA+4,xn,tn)),On.La&&(dw(bn,Cn,lr,jA,xn,tn),u3(Ls,Xu,ea,vi,Nn,jA,xn,tn)),0<Us&&(wr(bn,Cn,lr,jA+4,xn,tn),_o(Ls,Xu,ea,vi,Nn,jA+4,xn,tn)),On.La&&(Kh(bn,Cn,lr,jA,xn,tn),c3(Ls,Xu,ea,vi,Nn,jA,xn,tn))}}if(pt.ia&&alert("todo:DitherRow"),$e.put!=null){if(UA=16*KA,KA=16*(KA+1),Jr?($e.y=pt.sa,$e.O=pt.ta+TA,$e.f=pt.qa,$e.N=pt.ra+En,$e.ea=pt.Ha,$e.W=pt.Ia+En):(UA-=IA,$e.y=Ii,$e.O=$i,$e.f=ur,$e.N=fA,$e.ea=Gi,$e.W=en),zr||(KA-=IA),KA>$e.o&&(KA=$e.o),$e.F=null,$e.J=null,pt.Fa!=null&&0<pt.Fa.length&&UA<KA&&($e.J=Or(pt,$e,UA,KA-UA),$e.F=pt.mb,$e.F==null&&$e.F.length==0)){Sr=Fr(pt,3,"Could not decode alpha data.");break t}UA<$e.j&&(IA=$e.j-UA,UA=$e.j,e(!(1&IA)),$e.O+=pt.R*IA,$e.N+=pt.B*(IA>>1),$e.W+=pt.B*(IA>>1),$e.F!=null&&($e.J+=$e.width*IA)),UA<KA&&($e.O+=$e.v,$e.N+=$e.v>>1,$e.W+=$e.v>>1,$e.F!=null&&($e.J+=$e.v),$e.ka=UA-$e.j,$e.U=$e.va-$e.v,$e.T=KA-UA,Sr=$e.put($e))}Vt+1!=pt.Ic||zr||(r(pt.sa,pt.ta-Yt,Ii,$i+16*pt.R,Yt),r(pt.qa,pt.ra-zA,ur,fA+8*pt.B,zA),r(pt.Ha,pt.Ia-zA,Gi,en+8*pt.B,zA))}if(!Sr)return Fr(hA,6,"Output aborted.")}return 1}(ee,Ie)),Ie.bc!=null&&Ie.bc(Ie),Se&=1}return Se?(ee.cb=0,Se):0})(d,y)||(f=d.a)}}else f=d.a}f==0&&K.Oa!=null&&K.Oa.fd&&(f=Vf(K.ba))}K=f}N=K!=0?null:11>N?H.f.RGBA.eb:H.f.kb.y}else N=null;return N};var b3=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function c(T,q){for(var Q="",R=0;R<4;R++)Q+=String.fromCharCode(T[q++]);return Q}function u(T,q){return T[q+0]|T[q+1]<<8}function l(T,q){return(T[q+0]|T[q+1]<<8|T[q+2]<<16)>>>0}function g(T,q){return(T[q+0]|T[q+1]<<8|T[q+2]<<16|T[q+3]<<24)>>>0}new a;var h=[0],p=[0],C=[],I=new a,E=t,v=function(T,q){var Q={},R=0,G=!1,k=0,te=0;if(Q.frames=[],!function(U,Y){for(var _=0;_<4;_++)if(U[Y+_]!="RIFF".charCodeAt(_))return!0;return!1}(T,q)){for(g(T,q+=4),q+=8;q<T.length;){var X=c(T,q),ie=g(T,q+=4);q+=4;var W=ie+(1&ie);switch(X){case"VP8 ":case"VP8L":Q.frames[R]===void 0&&(Q.frames[R]={}),(Ee=Q.frames[R]).src_off=G?te:q-8,Ee.src_size=k+ie+8,R++,G&&(G=!1,k=0,te=0);break;case"VP8X":(Ee=Q.header={}).feature_flags=T[q];var se=q+4;Ee.canvas_width=1+l(T,se),se+=3,Ee.canvas_height=1+l(T,se),se+=3;break;case"ALPH":G=!0,k=W+8,te=q-8;break;case"ANIM":(Ee=Q.header).bgcolor=g(T,q),se=q+4,Ee.loop_count=u(T,se),se+=2;break;case"ANMF":var Be,Ee;(Ee=Q.frames[R]={}).offset_x=2*l(T,q),q+=3,Ee.offset_y=2*l(T,q),q+=3,Ee.width=1+l(T,q),q+=3,Ee.height=1+l(T,q),q+=3,Ee.duration=l(T,q),q+=3,Be=T[q++],Ee.dispose=1&Be,Ee.blend=Be>>1&1}X!="ANMF"&&(q+=W)}return Q}}(E,0);v.response=E,v.rgbaoutput=!0,v.dataurl=!1;var m=v.header?v.header:null,M=v.frames?v.frames:null;if(m){m.loop_counter=m.loop_count,h=[m.canvas_height],p=[m.canvas_width];for(var O=0;O<M.length&&M[O].blend!=0;O++);}var x=M[0],P=I.WebPDecodeRGBA(E,x.src_off,x.src_size,p,h);x.rgba=P,x.imgwidth=p[0],x.imgheight=h[0];for(var D=0;D<p[0]*h[0]*4;D++)C[D]=P[D];return this.width=p,this.height=h,this.data=C,this}(function(t){var e,A,r,i,n,o,s,a,c,u=function(U){return U=U||{},this.isStrokeTransparent=U.isStrokeTransparent||!1,this.strokeOpacity=U.strokeOpacity||1,this.strokeStyle=U.strokeStyle||"#000000",this.fillStyle=U.fillStyle||"#000000",this.isFillTransparent=U.isFillTransparent||!1,this.fillOpacity=U.fillOpacity||1,this.font=U.font||"10px sans-serif",this.textBaseline=U.textBaseline||"alphabetic",this.textAlign=U.textAlign||"left",this.lineWidth=U.lineWidth||1,this.lineJoin=U.lineJoin||"miter",this.lineCap=U.lineCap||"butt",this.path=U.path||[],this.transform=U.transform!==void 0?U.transform.clone():new a,this.globalCompositeOperation=U.globalCompositeOperation||"normal",this.globalAlpha=U.globalAlpha||1,this.clip_path=U.clip_path||[],this.currentPoint=U.currentPoint||new o,this.miterLimit=U.miterLimit||10,this.lastPoint=U.lastPoint||new o,this.lineDashOffset=U.lineDashOffset||0,this.lineDash=U.lineDash||[],this.margin=U.margin||[0,0,0,0],this.prevPageLastElemOffset=U.prevPageLastElemOffset||0,this.ignoreClearRect=typeof U.ignoreClearRect!="boolean"||U.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new l(this),e=this.internal.f2,A=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,a=this.internal.Matrix,c=new u}]);var l=function(U){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var Y=U;Object.defineProperty(this,"pdf",{get:function(){return Y}});var _=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return _},set:function(z){_=!!z}});var re=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return re},set:function(z){re=!!z}});var ae=0;Object.defineProperty(this,"posX",{get:function(){return ae},set:function(z){isNaN(z)||(ae=z)}});var Z=0;Object.defineProperty(this,"posY",{get:function(){return Z},set:function(z){isNaN(z)||(Z=z)}}),Object.defineProperty(this,"margin",{get:function(){return c.margin},set:function(z){var b;typeof z=="number"?b=[z,z,z,z]:((b=new Array(4))[0]=z[0],b[1]=z.length>=2?z[1]:b[0],b[2]=z.length>=3?z[2]:b[0],b[3]=z.length>=4?z[3]:b[1]),c.margin=b}});var ce=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ce},set:function(z){ce=z}});var oe=0;Object.defineProperty(this,"lastBreak",{get:function(){return oe},set:function(z){oe=z}});var de=[];Object.defineProperty(this,"pageBreaks",{get:function(){return de},set:function(z){de=z}}),Object.defineProperty(this,"ctx",{get:function(){return c},set:function(z){z instanceof u&&(c=z)}}),Object.defineProperty(this,"path",{get:function(){return c.path},set:function(z){c.path=z}});var De=[];Object.defineProperty(this,"ctxStack",{get:function(){return De},set:function(z){De=z}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(z){var b;b=g(z),this.ctx.fillStyle=b.style,this.ctx.isFillTransparent=b.a===0,this.ctx.fillOpacity=b.a,this.pdf.setFillColor(b.r,b.g,b.b,{a:b.a}),this.pdf.setTextColor(b.r,b.g,b.b,{a:b.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(z){var b=g(z);this.ctx.strokeStyle=b.style,this.ctx.isStrokeTransparent=b.a===0,this.ctx.strokeOpacity=b.a,b.a===0?this.pdf.setDrawColor(255,255,255):(b.a,this.pdf.setDrawColor(b.r,b.g,b.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(z){["butt","round","square"].indexOf(z)!==-1&&(this.ctx.lineCap=z,this.pdf.setLineCap(z))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(z){isNaN(z)||(this.ctx.lineWidth=z,this.pdf.setLineWidth(z))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(z){["bevel","round","miter"].indexOf(z)!==-1&&(this.ctx.lineJoin=z,this.pdf.setLineJoin(z))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(z){isNaN(z)||(this.ctx.miterLimit=z,this.pdf.setMiterLimit(z))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(z){this.ctx.textBaseline=z}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(z){["right","end","center","left","start"].indexOf(z)!==-1&&(this.ctx.textAlign=z)}});var j=null,J=null;Object.defineProperty(this,"fontFaces",{get:function(){return J},set:function(z){j=null,J=z}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(z){var b;if(this.ctx.font=z,(b=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(z))!==null){var Me=b[1];b[2];var Qe=b[3],Te=b[4];b[5];var Ce=b[6],Re=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Te)[2];Te=Math.floor(Re==="px"?parseFloat(Te)*this.pdf.internal.scaleFactor:Re==="em"?parseFloat(Te)*this.pdf.getFontSize():parseFloat(Te)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Te);var ve=function(At){var _e,It,yt=[],tt=At.trim();if(tt==="")return _m;if(tt in jb)return[jb[tt]];for(;tt!=="";){switch(It=null,_e=(tt=Hb(tt)).charAt(0)){case'"':case"'":It=wne(tt.substring(1),_e);break;default:It=Sne(tt)}if(It===null||(yt.push(It[0]),(tt=Hb(It[1]))!==""&&tt.charAt(0)!==","))return _m;tt=tt.replace(/^,/,"")}return yt}(Ce);if(this.fontFaces){var Ke=function(At,_e){if(j===null){var It=function(yt){var tt=[];return Object.keys(yt).forEach(function(et){yt[et].forEach(function(St){var ct=null;switch(St){case"bold":ct={family:et,weight:"bold"};break;case"italic":ct={family:et,style:"italic"};break;case"bolditalic":ct={family:et,weight:"bold",style:"italic"};break;case"":case"normal":ct={family:et}}ct!==null&&(ct.ref={name:et,style:St},tt.push(ct))})}),tt}(At.getFontList());j=function(yt){for(var tt={},et=0;et<yt.length;++et){var St=Xm(yt[et]),ct=St.family,Rt=St.stretch,Ge=St.style,Jt=St.weight;tt[ct]=tt[ct]||{},tt[ct][Rt]=tt[ct][Rt]||{},tt[ct][Rt][Ge]=tt[ct][Rt][Ge]||{},tt[ct][Rt][Ge][Jt]=St}return tt}(It.concat(_e))}return j}(this.pdf,this.fontFaces),Ue=ve.map(function(At){return{family:At,stretch:"normal",weight:Qe,style:Me}}),ke=function(At,_e,It){for(var yt=(It=It||{}).defaultFontFamily||"times",tt=Object.assign({},vne,It.genericFontFamilies||{}),et=null,St=null,ct=0;ct<_e.length;++ct)if(tt[(et=Xm(_e[ct])).family]&&(et.family=tt[et.family]),At.hasOwnProperty(et.family)){St=At[et.family];break}if(!(St=St||At[yt]))throw new Error("Could not find a font-family for the rule '"+Yb(et)+"' and default family '"+yt+"'.");if(St=function(Rt,Ge){if(Ge[Rt])return Ge[Rt];var Jt=Zm[Rt],oA=Jt<=Zm.normal?-1:1,Qt=Gb(Ge,kb,Jt,oA);if(!Qt)throw new Error("Could not find a matching font-stretch value for "+Rt);return Qt}(et.stretch,St),St=function(Rt,Ge){if(Ge[Rt])return Ge[Rt];for(var Jt=Kb[Rt],oA=0;oA<Jt.length;++oA)if(Ge[Jt[oA]])return Ge[Jt[oA]];throw new Error("Could not find a matching font-style for "+Rt)}(et.style,St),!(St=function(Rt,Ge){if(Ge[Rt])return Ge[Rt];if(Rt===400&&Ge[500])return Ge[500];if(Rt===500&&Ge[400])return Ge[400];var Jt=Bne[Rt],oA=Gb(Ge,Pb,Jt,Rt<400?-1:1);if(!oA)throw new Error("Could not find a matching font-weight for value "+Rt);return oA}(et.weight,St)))throw new Error("Failed to resolve a font for the rule '"+Yb(et)+"'.");return St}(Ke,Ue);this.pdf.setFont(ke.ref.name,ke.ref.style)}else{var Ye="";(Qe==="bold"||parseInt(Qe,10)>=700||Me==="bold")&&(Ye="bold"),Me==="italic"&&(Ye+="italic"),Ye.length===0&&(Ye="normal");for(var Je="",rt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Ze=0;Ze<ve.length;Ze++){if(this.pdf.internal.getFont(ve[Ze],Ye,{noFallback:!0,disableWarning:!0})!==void 0){Je=ve[Ze];break}if(Ye==="bolditalic"&&this.pdf.internal.getFont(ve[Ze],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Je=ve[Ze],Ye="bold";else if(this.pdf.internal.getFont(ve[Ze],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Je=ve[Ze],Ye="normal";break}}if(Je===""){for(var We=0;We<ve.length;We++)if(rt[ve[We]]){Je=rt[ve[We]];break}}Je=Je===""?"Times":Je,this.pdf.setFont(Je,Ye)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(z){this.ctx.globalCompositeOperation=z}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(z){this.ctx.globalAlpha=z}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(z){this.ctx.lineDashOffset=z,Ee.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(z){this.ctx.lineDash=z,Ee.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(z){this.ctx.ignoreClearRect=!!z}})};l.prototype.setLineDash=function(U){this.lineDash=U},l.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},l.prototype.fill=function(){M.call(this,"fill",!1)},l.prototype.stroke=function(){M.call(this,"stroke",!1)},l.prototype.beginPath=function(){this.path=[{type:"begin"}]},l.prototype.moveTo=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var _=this.ctx.transform.applyToPoint(new o(U,Y));this.path.push({type:"mt",x:_.x,y:_.y}),this.ctx.lastPoint=new o(U,Y)},l.prototype.closePath=function(){var U=new o(0,0),Y=0;for(Y=this.path.length-1;Y!==-1;Y--)if(this.path[Y].type==="begin"&&BA(this.path[Y+1])==="object"&&typeof this.path[Y+1].x=="number"){U=new o(this.path[Y+1].x,this.path[Y+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(U.x,U.y)},l.prototype.lineTo=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var _=this.ctx.transform.applyToPoint(new o(U,Y));this.path.push({type:"lt",x:_.x,y:_.y}),this.ctx.lastPoint=new o(_.x,_.y)},l.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),M.call(this,null,!0)},l.prototype.quadraticCurveTo=function(U,Y,_,re){if(isNaN(_)||isNaN(re)||isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var ae=this.ctx.transform.applyToPoint(new o(_,re)),Z=this.ctx.transform.applyToPoint(new o(U,Y));this.path.push({type:"qct",x1:Z.x,y1:Z.y,x:ae.x,y:ae.y}),this.ctx.lastPoint=new o(ae.x,ae.y)},l.prototype.bezierCurveTo=function(U,Y,_,re,ae,Z){if(isNaN(ae)||isNaN(Z)||isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ce=this.ctx.transform.applyToPoint(new o(ae,Z)),oe=this.ctx.transform.applyToPoint(new o(U,Y)),de=this.ctx.transform.applyToPoint(new o(_,re));this.path.push({type:"bct",x1:oe.x,y1:oe.y,x2:de.x,y2:de.y,x:ce.x,y:ce.y}),this.ctx.lastPoint=new o(ce.x,ce.y)},l.prototype.arc=function(U,Y,_,re,ae,Z){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re)||isNaN(ae))throw xA.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Z=!!Z,!this.ctx.transform.isIdentity){var ce=this.ctx.transform.applyToPoint(new o(U,Y));U=ce.x,Y=ce.y;var oe=this.ctx.transform.applyToPoint(new o(0,_)),de=this.ctx.transform.applyToPoint(new o(0,0));_=Math.sqrt(Math.pow(oe.x-de.x,2)+Math.pow(oe.y-de.y,2))}Math.abs(ae-re)>=2*Math.PI&&(re=0,ae=2*Math.PI),this.path.push({type:"arc",x:U,y:Y,radius:_,startAngle:re,endAngle:ae,counterclockwise:Z})},l.prototype.arcTo=function(U,Y,_,re,ae){throw new Error("arcTo not implemented.")},l.prototype.rect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(U,Y),this.lineTo(U+_,Y),this.lineTo(U+_,Y+re),this.lineTo(U,Y+re),this.lineTo(U,Y),this.lineTo(U+_,Y),this.lineTo(U,Y)},l.prototype.fillRect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var ae={};this.lineCap!=="butt"&&(ae.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(ae.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(U,Y,_,re),this.fill(),ae.hasOwnProperty("lineCap")&&(this.lineCap=ae.lineCap),ae.hasOwnProperty("lineJoin")&&(this.lineJoin=ae.lineJoin)}},l.prototype.strokeRect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(U,Y,_,re),this.stroke())},l.prototype.clearRect=function(U,Y,_,re){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re))throw xA.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(U,Y,_,re))},l.prototype.save=function(U){U=typeof U!="boolean"||U;for(var Y=this.pdf.internal.getCurrentPageInfo().pageNumber,_=0;_<this.pdf.internal.getNumberOfPages();_++)this.pdf.setPage(_+1),this.pdf.internal.out("q");if(this.pdf.setPage(Y),U){this.ctx.fontSize=this.pdf.internal.getFontSize();var re=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=re}},l.prototype.restore=function(U){U=typeof U!="boolean"||U;for(var Y=this.pdf.internal.getCurrentPageInfo().pageNumber,_=0;_<this.pdf.internal.getNumberOfPages();_++)this.pdf.setPage(_+1),this.pdf.internal.out("Q");this.pdf.setPage(Y),U&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},l.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var g=function(U){var Y,_,re,ae;if(U.isCanvasGradient===!0&&(U=U.getColor()),!U)return{r:0,g:0,b:0,a:0,style:U};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(U))Y=0,_=0,re=0,ae=0;else{var Z=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(U);if(Z!==null)Y=parseInt(Z[1]),_=parseInt(Z[2]),re=parseInt(Z[3]),ae=1;else if((Z=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(U))!==null)Y=parseInt(Z[1]),_=parseInt(Z[2]),re=parseInt(Z[3]),ae=parseFloat(Z[4]);else{if(ae=1,typeof U=="string"&&U.charAt(0)!=="#"){var ce=new yb(U);U=ce.ok?ce.toHex():"#000000"}U.length===4?(Y=U.substring(1,2),Y+=Y,_=U.substring(2,3),_+=_,re=U.substring(3,4),re+=re):(Y=U.substring(1,3),_=U.substring(3,5),re=U.substring(5,7)),Y=parseInt(Y,16),_=parseInt(_,16),re=parseInt(re,16)}}return{r:Y,g:_,b:re,a:ae,style:U}},h=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};l.prototype.fillText=function(U,Y,_,re){if(isNaN(Y)||isNaN(_)||typeof U!="string")throw xA.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(re=isNaN(re)?void 0:re,!h.call(this)){var ae=W(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;R.call(this,{text:U,x:Y,y:_,scale:Z,angle:ae,align:this.textAlign,maxWidth:re})}},l.prototype.strokeText=function(U,Y,_,re){if(isNaN(Y)||isNaN(_)||typeof U!="string")throw xA.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){re=isNaN(re)?void 0:re;var ae=W(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;R.call(this,{text:U,x:Y,y:_,scale:Z,renderingMode:"stroke",angle:ae,align:this.textAlign,maxWidth:re})}},l.prototype.measureText=function(U){if(typeof U!="string")throw xA.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var Y=this.pdf,_=this.pdf.internal.scaleFactor,re=Y.internal.getFontSize(),ae=Y.getStringUnitWidth(U)*re/Y.internal.scaleFactor;return new function(Z){var ce=(Z=Z||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return ce}}),this}({width:ae*=Math.round(96*_/72*1e4)/1e4})},l.prototype.scale=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var _=new a(U,0,0,Y,0,0);this.ctx.transform=this.ctx.transform.multiply(_)},l.prototype.rotate=function(U){if(isNaN(U))throw xA.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var Y=new a(Math.cos(U),Math.sin(U),-Math.sin(U),Math.cos(U),0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},l.prototype.translate=function(U,Y){if(isNaN(U)||isNaN(Y))throw xA.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var _=new a(1,0,0,1,U,Y);this.ctx.transform=this.ctx.transform.multiply(_)},l.prototype.transform=function(U,Y,_,re,ae,Z){if(isNaN(U)||isNaN(Y)||isNaN(_)||isNaN(re)||isNaN(ae)||isNaN(Z))throw xA.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ce=new a(U,Y,_,re,ae,Z);this.ctx.transform=this.ctx.transform.multiply(ce)},l.prototype.setTransform=function(U,Y,_,re,ae,Z){U=isNaN(U)?1:U,Y=isNaN(Y)?0:Y,_=isNaN(_)?0:_,re=isNaN(re)?1:re,ae=isNaN(ae)?0:ae,Z=isNaN(Z)?0:Z,this.ctx.transform=new a(U,Y,_,re,ae,Z)};var C=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};l.prototype.drawImage=function(U,Y,_,re,ae,Z,ce,oe,de){var De=this.pdf.getImageProperties(U),j=1,J=1,z=1,b=1;re!==void 0&&oe!==void 0&&(z=oe/re,b=de/ae,j=De.width/re*oe/re,J=De.height/ae*de/ae),Z===void 0&&(Z=Y,ce=_,Y=0,_=0),re!==void 0&&oe===void 0&&(oe=re,de=ae),re===void 0&&oe===void 0&&(oe=De.width,de=De.height);for(var Me,Qe=this.ctx.transform.decompose(),Te=W(Qe.rotate.shx),Ce=new a,Re=(Ce=(Ce=(Ce=Ce.multiply(Qe.translate)).multiply(Qe.skew)).multiply(Qe.scale)).applyToRectangle(new s(Z-Y*z,ce-_*b,re*j,ae*J)),ve=I.call(this,Re),Ke=[],Ue=0;Ue<ve.length;Ue+=1)Ke.indexOf(ve[Ue])===-1&&Ke.push(ve[Ue]);if(m(Ke),this.autoPaging)for(var ke=Ke[0],Ye=Ke[Ke.length-1],Je=ke;Je<Ye+1;Je++){this.pdf.setPage(Je);var rt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ze=Je===1?this.posY+this.margin[0]:this.margin[0],We=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],At=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],_e=Je===1?0:We+(Je-2)*At;if(this.ctx.clip_path.length!==0){var It=this.path;Me=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Me,this.posX+this.margin[3],-_e+Ze+this.ctx.prevPageLastElemOffset),O.call(this,"fill",!0),this.path=It}var yt=JSON.parse(JSON.stringify(Re));yt=v([yt],this.posX+this.margin[3],-_e+Ze+this.ctx.prevPageLastElemOffset)[0];var tt=(Je>ke||Je<Ye)&&C.call(this);tt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],rt,At,null).clip().discardPath()),this.pdf.addImage(U,"JPEG",yt.x,yt.y,yt.w,yt.h,null,null,Te),tt&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(U,"JPEG",Re.x,Re.y,Re.w,Re.h,null,null,Te)};var I=function(U,Y,_){var re=[];Y=Y||this.pdf.internal.pageSize.width,_=_||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var ae=this.posY+this.ctx.prevPageLastElemOffset;switch(U.type){default:case"mt":case"lt":re.push(Math.floor((U.y+ae)/_)+1);break;case"arc":re.push(Math.floor((U.y+ae-U.radius)/_)+1),re.push(Math.floor((U.y+ae+U.radius)/_)+1);break;case"qct":var Z=se(this.ctx.lastPoint.x,this.ctx.lastPoint.y,U.x1,U.y1,U.x,U.y);re.push(Math.floor((Z.y+ae)/_)+1),re.push(Math.floor((Z.y+Z.h+ae)/_)+1);break;case"bct":var ce=Be(this.ctx.lastPoint.x,this.ctx.lastPoint.y,U.x1,U.y1,U.x2,U.y2,U.x,U.y);re.push(Math.floor((ce.y+ae)/_)+1),re.push(Math.floor((ce.y+ce.h+ae)/_)+1);break;case"rect":re.push(Math.floor((U.y+ae)/_)+1),re.push(Math.floor((U.y+U.h+ae)/_)+1)}for(var oe=0;oe<re.length;oe+=1)for(;this.pdf.internal.getNumberOfPages()<re[oe];)E.call(this);return re},E=function(){var U=this.fillStyle,Y=this.strokeStyle,_=this.font,re=this.lineCap,ae=this.lineWidth,Z=this.lineJoin;this.pdf.addPage(),this.fillStyle=U,this.strokeStyle=Y,this.font=_,this.lineCap=re,this.lineWidth=ae,this.lineJoin=Z},v=function(U,Y,_){for(var re=0;re<U.length;re++)switch(U[re].type){case"bct":U[re].x2+=Y,U[re].y2+=_;case"qct":U[re].x1+=Y,U[re].y1+=_;default:U[re].x+=Y,U[re].y+=_}return U},m=function(U){return U.sort(function(Y,_){return Y-_})},M=function(U,Y){for(var _,re,ae=this.fillStyle,Z=this.strokeStyle,ce=this.lineCap,oe=this.lineWidth,de=Math.abs(oe*this.ctx.transform.scaleX),De=this.lineJoin,j=JSON.parse(JSON.stringify(this.path)),J=JSON.parse(JSON.stringify(this.path)),z=[],b=0;b<J.length;b++)if(J[b].x!==void 0)for(var Me=I.call(this,J[b]),Qe=0;Qe<Me.length;Qe+=1)z.indexOf(Me[Qe])===-1&&z.push(Me[Qe]);for(var Te=0;Te<z.length;Te++)for(;this.pdf.internal.getNumberOfPages()<z[Te];)E.call(this);if(m(z),this.autoPaging)for(var Ce=z[0],Re=z[z.length-1],ve=Ce;ve<Re+1;ve++){this.pdf.setPage(ve),this.fillStyle=ae,this.strokeStyle=Z,this.lineCap=ce,this.lineWidth=de,this.lineJoin=De;var Ke=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ue=ve===1?this.posY+this.margin[0]:this.margin[0],ke=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ye=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Je=ve===1?0:ke+(ve-2)*Ye;if(this.ctx.clip_path.length!==0){var rt=this.path;_=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(_,this.posX+this.margin[3],-Je+Ue+this.ctx.prevPageLastElemOffset),O.call(this,U,!0),this.path=rt}if(re=JSON.parse(JSON.stringify(j)),this.path=v(re,this.posX+this.margin[3],-Je+Ue+this.ctx.prevPageLastElemOffset),Y===!1||ve===0){var Ze=(ve>Ce||ve<Re)&&C.call(this);Ze&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ke,Ye,null).clip().discardPath()),O.call(this,U,Y),Ze&&this.pdf.restoreGraphicsState()}this.lineWidth=oe}else this.lineWidth=de,O.call(this,U,Y),this.lineWidth=oe;this.path=j},O=function(U,Y){if((U!=="stroke"||Y||!p.call(this))&&(U==="stroke"||Y||!h.call(this))){for(var _,re,ae=[],Z=this.path,ce=0;ce<Z.length;ce++){var oe=Z[ce];switch(oe.type){case"begin":ae.push({begin:!0});break;case"close":ae.push({close:!0});break;case"mt":ae.push({start:oe,deltas:[],abs:[]});break;case"lt":var de=ae.length;if(Z[ce-1]&&!isNaN(Z[ce-1].x)&&(_=[oe.x-Z[ce-1].x,oe.y-Z[ce-1].y],de>0)){for(;de>=0;de--)if(ae[de-1].close!==!0&&ae[de-1].begin!==!0){ae[de-1].deltas.push(_),ae[de-1].abs.push(oe);break}}break;case"bct":_=[oe.x1-Z[ce-1].x,oe.y1-Z[ce-1].y,oe.x2-Z[ce-1].x,oe.y2-Z[ce-1].y,oe.x-Z[ce-1].x,oe.y-Z[ce-1].y],ae[ae.length-1].deltas.push(_);break;case"qct":var De=Z[ce-1].x+2/3*(oe.x1-Z[ce-1].x),j=Z[ce-1].y+2/3*(oe.y1-Z[ce-1].y),J=oe.x+2/3*(oe.x1-oe.x),z=oe.y+2/3*(oe.y1-oe.y),b=oe.x,Me=oe.y;_=[De-Z[ce-1].x,j-Z[ce-1].y,J-Z[ce-1].x,z-Z[ce-1].y,b-Z[ce-1].x,Me-Z[ce-1].y],ae[ae.length-1].deltas.push(_);break;case"arc":ae.push({deltas:[],abs:[],arc:!0}),Array.isArray(ae[ae.length-1].abs)&&ae[ae.length-1].abs.push(oe)}}re=Y?null:U==="stroke"?"stroke":"fill";for(var Qe=!1,Te=0;Te<ae.length;Te++)if(ae[Te].arc)for(var Ce=ae[Te].abs,Re=0;Re<Ce.length;Re++){var ve=Ce[Re];ve.type==="arc"?D.call(this,ve.x,ve.y,ve.radius,ve.startAngle,ve.endAngle,ve.counterclockwise,void 0,Y,!Qe):G.call(this,ve.x,ve.y),Qe=!0}else if(ae[Te].close===!0)this.pdf.internal.out("h"),Qe=!1;else if(ae[Te].begin!==!0){var Ke=ae[Te].start.x,Ue=ae[Te].start.y;k.call(this,ae[Te].deltas,Ke,Ue),Qe=!0}re&&T.call(this,re),Y&&q.call(this)}},x=function(U){var Y=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,_=Y*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return U-_;case"top":return U+Y-_;case"hanging":return U+Y-2*_;case"middle":return U+Y/2-_;default:return U}},P=function(U){return U+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};l.prototype.createLinearGradient=function(){var U=function(){};return U.colorStops=[],U.addColorStop=function(Y,_){this.colorStops.push([Y,_])},U.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},U.isCanvasGradient=!0,U},l.prototype.createPattern=function(){return this.createLinearGradient()},l.prototype.createRadialGradient=function(){return this.createLinearGradient()};var D=function(U,Y,_,re,ae,Z,ce,oe,de){for(var De=X.call(this,_,re,ae,Z),j=0;j<De.length;j++){var J=De[j];j===0&&(de?Q.call(this,J.x1+U,J.y1+Y):G.call(this,J.x1+U,J.y1+Y)),te.call(this,U,Y,J.x2,J.y2,J.x3,J.y3,J.x4,J.y4)}oe?q.call(this):T.call(this,ce)},T=function(U){switch(U){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},q=function(){this.pdf.clip(),this.pdf.discardPath()},Q=function(U,Y){this.pdf.internal.out(A(U)+" "+r(Y)+" m")},R=function(U){var Y;switch(U.align){case"right":case"end":Y="right";break;case"center":Y="center";break;default:Y="left"}var _=this.pdf.getTextDimensions(U.text),re=x.call(this,U.y),ae=P.call(this,re)-_.h,Z=this.ctx.transform.applyToPoint(new o(U.x,re)),ce=this.ctx.transform.decompose(),oe=new a;oe=(oe=(oe=oe.multiply(ce.translate)).multiply(ce.skew)).multiply(ce.scale);for(var de,De,j,J=this.ctx.transform.applyToRectangle(new s(U.x,re,_.w,_.h)),z=oe.applyToRectangle(new s(U.x,ae,_.w,_.h)),b=I.call(this,z),Me=[],Qe=0;Qe<b.length;Qe+=1)Me.indexOf(b[Qe])===-1&&Me.push(b[Qe]);if(m(Me),this.autoPaging)for(var Te=Me[0],Ce=Me[Me.length-1],Re=Te;Re<Ce+1;Re++){this.pdf.setPage(Re);var ve=Re===1?this.posY+this.margin[0]:this.margin[0],Ke=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[2],ke=Ue-this.margin[0],Ye=this.pdf.internal.pageSize.width-this.margin[1],Je=Ye-this.margin[3],rt=Re===1?0:Ke+(Re-2)*ke;if(this.ctx.clip_path.length!==0){var Ze=this.path;de=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(de,this.posX+this.margin[3],-1*rt+ve),O.call(this,"fill",!0),this.path=Ze}var We=v([JSON.parse(JSON.stringify(z))],this.posX+this.margin[3],-rt+ve+this.ctx.prevPageLastElemOffset)[0];U.scale>=.01&&(De=this.pdf.internal.getFontSize(),this.pdf.setFontSize(De*U.scale),j=this.lineWidth,this.lineWidth=j*U.scale);var At=this.autoPaging!=="text";if(At||We.y+We.h<=Ue){if(At||We.y>=ve&&We.x<=Ye){var _e=At?U.text:this.pdf.splitTextToSize(U.text,U.maxWidth||Ye-We.x)[0],It=v([JSON.parse(JSON.stringify(J))],this.posX+this.margin[3],-rt+ve+this.ctx.prevPageLastElemOffset)[0],yt=At&&(Re>Te||Re<Ce)&&C.call(this);yt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Je,ke,null).clip().discardPath()),this.pdf.text(_e,It.x,It.y,{angle:U.angle,align:Y,renderingMode:U.renderingMode}),yt&&this.pdf.restoreGraphicsState()}}else We.y<Ue&&(this.ctx.prevPageLastElemOffset+=Ue-We.y);U.scale>=.01&&(this.pdf.setFontSize(De),this.lineWidth=j)}else U.scale>=.01&&(De=this.pdf.internal.getFontSize(),this.pdf.setFontSize(De*U.scale),j=this.lineWidth,this.lineWidth=j*U.scale),this.pdf.text(U.text,Z.x+this.posX,Z.y+this.posY,{angle:U.angle,align:Y,renderingMode:U.renderingMode,maxWidth:U.maxWidth}),U.scale>=.01&&(this.pdf.setFontSize(De),this.lineWidth=j)},G=function(U,Y,_,re){_=_||0,re=re||0,this.pdf.internal.out(A(U+_)+" "+r(Y+re)+" l")},k=function(U,Y,_){return this.pdf.lines(U,Y,_,null,null)},te=function(U,Y,_,re,ae,Z,ce,oe){this.pdf.internal.out([e(i(_+U)),e(n(re+Y)),e(i(ae+U)),e(n(Z+Y)),e(i(ce+U)),e(n(oe+Y)),"c"].join(" "))},X=function(U,Y,_,re){for(var ae=2*Math.PI,Z=Math.PI/2;Y>_;)Y-=ae;var ce=Math.abs(_-Y);ce<ae&&re&&(ce=ae-ce);for(var oe=[],de=re?-1:1,De=Y;ce>1e-5;){var j=De+de*Math.min(ce,Z);oe.push(ie.call(this,U,De,j)),ce-=Math.abs(j-De),De=j}return oe},ie=function(U,Y,_){var re=(_-Y)/2,ae=U*Math.cos(re),Z=U*Math.sin(re),ce=ae,oe=-Z,de=ce*ce+oe*oe,De=de+ce*ae+oe*Z,j=4/3*(Math.sqrt(2*de*De)-De)/(ce*Z-oe*ae),J=ce-j*oe,z=oe+j*ce,b=J,Me=-z,Qe=re+Y,Te=Math.cos(Qe),Ce=Math.sin(Qe);return{x1:U*Math.cos(Y),y1:U*Math.sin(Y),x2:J*Te-z*Ce,y2:J*Ce+z*Te,x3:b*Te-Me*Ce,y3:b*Ce+Me*Te,x4:U*Math.cos(_),y4:U*Math.sin(_)}},W=function(U){return 180*U/Math.PI},se=function(U,Y,_,re,ae,Z){var ce=U+.5*(_-U),oe=Y+.5*(re-Y),de=ae+.5*(_-ae),De=Z+.5*(re-Z),j=Math.min(U,ae,ce,de),J=Math.max(U,ae,ce,de),z=Math.min(Y,Z,oe,De),b=Math.max(Y,Z,oe,De);return new s(j,z,J-j,b-z)},Be=function(U,Y,_,re,ae,Z,ce,oe){var de,De,j,J,z,b,Me,Qe,Te,Ce,Re,ve,Ke,Ue,ke=_-U,Ye=re-Y,Je=ae-_,rt=Z-re,Ze=ce-ae,We=oe-Z;for(De=0;De<41;De++)Te=(Me=(j=U+(de=De/40)*ke)+de*((z=_+de*Je)-j))+de*(z+de*(ae+de*Ze-z)-Me),Ce=(Qe=(J=Y+de*Ye)+de*((b=re+de*rt)-J))+de*(b+de*(Z+de*We-b)-Qe),De==0?(Re=Te,ve=Ce,Ke=Te,Ue=Ce):(Re=Math.min(Re,Te),ve=Math.min(ve,Ce),Ke=Math.max(Ke,Te),Ue=Math.max(Ue,Ce));return new s(Math.round(Re),Math.round(ve),Math.round(Ke-Re),Math.round(Ue-ve))},Ee=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var U,Y,_=(U=this.ctx.lineDash,Y=this.ctx.lineDashOffset,JSON.stringify({lineDash:U,lineDashOffset:Y}));this.prevLineDash!==_&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=_)}}})(Ct.API),function(t){var e=function(o){var s,a,c,u,l,g,h,p,C,I;for(a=[],c=0,u=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;u>c;c+=4)(l=(o.charCodeAt(c)<<24)+(o.charCodeAt(c+1)<<16)+(o.charCodeAt(c+2)<<8)+o.charCodeAt(c+3))!==0?(g=(l=((l=((l=((l=(l-(I=l%85))/85)-(C=l%85))/85)-(p=l%85))/85)-(h=l%85))/85)%85,a.push(g+33,h+33,p+33,C+33,I+33)):a.push(122);return function(E,v){for(var m=v;m>0;m--)E.pop()}(a,s.length),String.fromCharCode.apply(String,a)+"~>"},A=function(o){var s,a,c,u,l,g=String,h="length",p=255,C="charCodeAt",I="slice",E="replace";for(o[I](-2),o=o[I](0,-2)[E](/\s/g,"")[E]("z","!!!!!"),c=[],u=0,l=(o+=s="uuuuu"[I](o[h]%5||5))[h];l>u;u+=5)a=52200625*(o[C](u)-33)+614125*(o[C](u+1)-33)+7225*(o[C](u+2)-33)+85*(o[C](u+3)-33)+(o[C](u+4)-33),c.push(p&a>>24,p&a>>16,p&a>>8,p&a);return function(v,m){for(var M=m;M>0;M--)v.pop()}(c,s[h]),g.fromCharCode.apply(g,c)},r=function(o){return o.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),s.test(o)===!1)return"";for(var a="",c=0;c<o.length;c+=2)a+=String.fromCharCode("0x"+(o[c]+o[c+1]));return a},n=function(o){for(var s=new Uint8Array(o.length),a=o.length;a--;)s[a]=o.charCodeAt(a);return(s=sm(s)).reduce(function(c,u){return c+String.fromCharCode(u)},"")};t.processDataByFilters=function(o,s){var a=0,c=o||"",u=[];for(typeof(s=s||[])=="string"&&(s=[s]),a=0;a<s.length;a+=1)switch(s[a]){case"ASCII85Decode":case"/ASCII85Decode":c=A(c),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":c=e(c),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":c=i(c),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":c=r(c),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":c=n(c),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[a]+'" is not implemented')}return{data:c,reverseChain:u.reverse().join(" ")}}}(Ct.API),function(t){t.loadFile=function(e,A,r){return function(i,n,o){n=n!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(a,c,u){var l=new XMLHttpRequest,g=0,h=function(p){var C=p.length,I=[],E=String.fromCharCode;for(g=0;g<C;g+=1)I.push(E(255&p.charCodeAt(g)));return I.join("")};if(l.open("GET",a,!c),l.overrideMimeType("text/plain; charset=x-user-defined"),c===!1&&(l.onload=function(){l.status===200?u(h(this.responseText)):u(void 0)}),l.send(null),c&&l.status===200)return h(l.responseText)}(i,n,o)}catch{}return s}(e,A,r)},t.loadImageFile=t.loadFile}(Ct.API),function(t){function e(){return(Lt.html2canvas?Promise.resolve(Lt.html2canvas):Promise.resolve().then(()=>qpe)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function A(){return(Lt.DOMPurify?Promise.resolve(Lt.DOMPurify):Promise.resolve().then(()=>ffe)).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var r=function(s){var a=BA(s);return a==="undefined"?"undefined":a==="string"||s instanceof String?"string":a==="number"||s instanceof Number?"number":a==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":a==="object"?"object":"unknown"},i=function(s,a){var c=document.createElement(s);for(var u in a.className&&(c.className=a.className),a.innerHTML&&a.dompurify&&(c.innerHTML=a.dompurify.sanitize(a.innerHTML)),a.style)c.style[u]=a.style[u];return c},n=function s(a,c){for(var u=a.nodeType===3?document.createTextNode(a.nodeValue):a.cloneNode(!1),l=a.firstChild;l;l=l.nextSibling)c!==!0&&l.nodeType===1&&l.nodeName==="SCRIPT"||u.appendChild(s(l,c));return a.nodeType===1&&(a.nodeName==="CANVAS"?(u.width=a.width,u.height=a.height,u.getContext("2d").drawImage(a,0,0)):a.nodeName!=="TEXTAREA"&&a.nodeName!=="SELECT"||(u.value=a.value),u.addEventListener("load",function(){u.scrollTop=a.scrollTop,u.scrollLeft=a.scrollLeft},!0)),u},o=function s(a){var c=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),u=s.convert(Promise.resolve(),c);return(u=u.setProgress(1,s,1,[s])).set(a)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(s,a){return s.__proto__=a||o.prototype,s},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(s,a){return this.then(function(){switch(a=a||function(c){switch(r(c)){case"string":return"string";case"element":return c.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(s),a){case"string":return this.then(A).then(function(c){return this.set({src:i("div",{innerHTML:s,dompurify:c})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},o.prototype.to=function(s){switch(s){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var s={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},a=n(this.prop.src,this.opt.html2canvas.javascriptEnabled);a.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(a),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(a){var c=Object.assign({},this.opt.html2canvas);return delete c.onrendered,a(this.prop.container,c)}).then(function(a){(this.opt.html2canvas.onrendered||function(){})(a),this.prop.canvas=a,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(a){var c=this.opt.jsPDF,u=this.opt.fontFaces,l=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,g=Object.assign({async:!0,allowTaint:!0,scale:l,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete g.onrendered,c.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,c.context2d.posX=this.opt.x,c.context2d.posY=this.opt.y,c.context2d.margin=this.opt.margin,c.context2d.fontFaces=u,u)for(var h=0;h<u.length;++h){var p=u[h],C=p.src.find(function(I){return I.format==="truetype"});C&&c.addFont(C.url,p.ref.name,p.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,c.context2d.save(!0),a(this.prop.container,g)}).then(function(a){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(a),this.prop.canvas=a,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(s,a,c){return(c=c||"pdf").toLowerCase()==="img"||c.toLowerCase()==="image"?this.outputImg(s,a):this.outputPdf(s,a)},o.prototype.outputPdf=function(s,a){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,a)})},o.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+s+'" is not supported.'}})},o.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(s){if(r(s)!=="object")return this;var a=Object.keys(s||{}).map(function(c){if(c in o.template.prop)return function(){this.prop[c]=s[c]};switch(c){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[c]=s[c]}}},this);return this.then(function(){return this.thenList(a)})},o.prototype.get=function(s,a){return this.then(function(){var c=s in o.template.prop?this.prop[s]:this.opt[s];return a?a(c):c})},o.prototype.setMargin=function(s){return this.then(function(){switch(r(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},o.prototype.setPageSize=function(s){function a(c,u){return Math.floor(c*u/72*96)}return this.then(function(){(s=s||Ct.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:a(s.inner.width,s.k),height:a(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},o.prototype.setProgress=function(s,a,c,u){return s!=null&&(this.progress.val=s),a!=null&&(this.progress.state=a),c!=null&&(this.progress.n=c),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(s,a,c,u){return this.setProgress(s?this.progress.val+s:null,a||null,c?this.progress.n+c:null,u?this.progress.stack.concat(u):null)},o.prototype.then=function(s,a){var c=this;return this.thenCore(s,a,function(u,l){return c.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(g){return c.updateProgress(null,u),g}).then(u,l).then(function(g){return c.updateProgress(1),g})})},o.prototype.thenCore=function(s,a,c){c=c||Promise.prototype.then;var u=this;s&&(s=s.bind(u)),a&&(a=a.bind(u));var l=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:o.convert(Object.assign({},u),Promise.prototype),g=c.call(l,s,a);return o.convert(g,u.__proto__)},o.prototype.thenExternal=function(s,a){return Promise.prototype.then.call(this,s,a)},o.prototype.thenList=function(s){var a=this;return s.forEach(function(c){a=a.thenCore(c)}),a},o.prototype.catch=function(s){s&&(s=s.bind(this));var a=Promise.prototype.catch.call(this,s);return o.convert(a,this)},o.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},o.prototype.error=function(s){return this.then(function(){throw new Error(s)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,Ct.getPageSize=function(s,a,c){if(BA(s)==="object"){var u=s;s=u.orientation,a=u.unit||a,c=u.format||c}a=a||"mm",c=c||"a4",s=(""+(s||"P")).toLowerCase();var l,g=(""+c).toLowerCase(),h={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(a){case"pt":l=1;break;case"mm":l=72/25.4;break;case"cm":l=72/2.54;break;case"in":l=72;break;case"px":l=.75;break;case"pc":case"em":l=12;break;case"ex":l=6;break;default:throw"Invalid unit: "+a}var p,C=0,I=0;if(h.hasOwnProperty(g))C=h[g][1]/l,I=h[g][0]/l;else try{C=c[1],I=c[0]}catch{throw new Error("Invalid format: "+c)}if(s==="p"||s==="portrait")s="p",I>C&&(p=I,I=C,C=p);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",C>I&&(p=I,I=C,C=p)}return{width:I,height:C,unit:a,k:l,orientation:s}},t.html=function(s,a){(a=a||{}).callback=a.callback||function(){},a.html2canvas=a.html2canvas||{},a.html2canvas.canvas=a.html2canvas.canvas||this.canvas,a.jsPDF=a.jsPDF||this,a.fontFaces=a.fontFaces?a.fontFaces.map(Xm):null;var c=new o(a);return a.worker?c:c.from(s).doCallback()}}(Ct.API),Ct.API.addJS=function(t){return Jb=t,this.internal.events.subscribe("postPutResources",function(){AB=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(AB+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),zb=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Jb+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){AB!==void 0&&zb!==void 0&&this.internal.out("/Names <</JavaScript "+AB+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var A=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=A.outline.render().split(/\r\n/),n=0;n<i.length;n++){var o=i[n],s=r.exec(o);if(s!=null){var a=s[1];A.internal.newObjectDeferredBegin(a,!1)}A.internal.write(o)}if(this.outline.createNamedDestinations){var c=this.internal.pages.length,u=[];for(n=0;n<c;n++){var l=A.internal.newObject();u.push(l);var g=A.internal.getPageInfo(n+1);A.internal.write("<< /D["+g.objId+" 0 R /XYZ null null null]>> endobj")}var h=A.internal.newObject();for(A.internal.write("<< /Names [ "),n=0;n<u.length;n++)A.internal.write("(page_"+(n+1)+")"+u[n]+" 0 R");A.internal.write(" ] >>","endobj"),e=A.internal.newObject(),A.internal.write("<< /Dests "+h+" 0 R"),A.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var A=this;A.outline.root.children.length>0&&(A.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&A.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var A=this;A.outline={createNamedDestinations:!1,root:{children:[]}},A.outline.add=function(r,i,n){var o={title:i,options:n,children:[]};return r==null&&(r=this.root),r.children.push(o),o},A.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=A,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},A.outline.genIds_r=function(r){r.id=A.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},A.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},A.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,n=0;n<r.children.length;n++){var o=r.children[n];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(r)),n>0&&this.line("/Prev "+this.makeRef(r.children[n-1])),n<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[n+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var a=A.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+a.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var c=0;c<r.children.length;c++)this.renderItems(r.children[c])},A.outline.line=function(r){this.ctx.val+=r+`\r
191
191
  `},A.outline.makeRef=function(r){return r.id+" 0 R"},A.outline.makeString=function(r){return"("+A.internal.pdfEscape(r)+")"},A.outline.objStart=function(r){this.ctx.val+=`\r
192
192
  `+r.id+` 0 obj\r
193
193
  <<\r
@@ -249,7 +249,7 @@ end`};e.events.push(["putFont",function(n){(function(o){var s=o.font,a=o.out,c=o
249
249
  `+Gr),J&&_B([R,G,k],ar=>{Gr=af(Gr,ar," ")}),M&&Re?M.createHTML(Gr):Gr},e.setConfig=function(){let st=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ur(st),Me=!0},e.clearConfig=function(){Tr=null,Me=!1},e.isValidAttribute=function(st,le,Pe){Tr||Ur({});const it=$t(st),pA=$t(le);return ki(it,pA,Pe)},e.addHook=function(st,le){typeof le=="function"&&of(Q[st],le)},e.removeHook=function(st,le){if(le!==void 0){const Pe=Xpe(Q[st],le);return Pe===-1?void 0:_pe(Q[st],Pe,1)[0]}return I5(Q[st])},e.removeHooks=function(st){Q[st]=[]},e.removeAllHooks=function(){Q=Q5()},e}var pfe=R5();const ffe=Object.freeze(Object.defineProperty({__proto__:null,default:pfe},Symbol.toStringTag,{value:"Module"}));var hf=function(t){return t&&t.Math===Math&&t},WA=hf(typeof globalThis=="object"&&globalThis)||hf(typeof window=="object"&&window)||hf(typeof self=="object"&&self)||hf(typeof xt=="object"&&xt)||hf(typeof xt=="object"&&xt)||function(){return this}()||Function("return this")(),gf={},ir=function(t){try{return!!t()}catch{return!0}},Efe=ir,Ss=!Efe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Cfe=ir,tv=!Cfe(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),Ife=tv,Av=Function.prototype.call,fi=Ife?Av.bind(Av):function(){return Av.apply(Av,arguments)},D5={},T5={}.propertyIsEnumerable,U5=Object.getOwnPropertyDescriptor,Bfe=U5&&!T5.call({1:2},1);D5.f=Bfe?function(e){var A=U5(this,e);return!!A&&A.enumerable}:T5;var ly=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},L5=tv,F5=Function.prototype,hy=F5.call,vfe=L5&&F5.bind.bind(hy,hy),nr=L5?vfe:function(t){return function(){return hy.apply(t,arguments)}},O5=nr,wfe=O5({}.toString),Sfe=O5("".slice),pu=function(t){return Sfe(wfe(t),8,-1)},mfe=nr,Mfe=ir,yfe=pu,gy=Object,Qfe=mfe("".split),b5=Mfe(function(){return!gy("z").propertyIsEnumerable(0)})?function(t){return yfe(t)==="String"?Qfe(t,""):gy(t)}:gy,rv=function(t){return t==null},Rfe=rv,Dfe=TypeError,ms=function(t){if(Rfe(t))throw new Dfe("Can't call method on "+t);return t},Tfe=b5,Ufe=ms,df=function(t){return Tfe(Ufe(t))},dy=typeof document=="object"&&document.all,Ir=typeof dy>"u"&&dy!==void 0?function(t){return typeof t=="function"||t===dy}:function(t){return typeof t=="function"},Lfe=Ir,hn=function(t){return typeof t=="object"?t!==null:Lfe(t)},py=WA,Ffe=Ir,Ofe=function(t){return Ffe(t)?t:void 0},fu=function(t,e){return arguments.length<2?Ofe(py[t]):py[t]&&py[t][e]},bfe=nr,iv=bfe({}.isPrototypeOf),xfe=WA,x5=xfe.navigator,N5=x5&&x5.userAgent,pf=N5?String(N5):"",K5=WA,fy=pf,k5=K5.process,P5=K5.Deno,G5=k5&&k5.versions||P5&&P5.version,j5=G5&&G5.v8,Ms,nv;j5&&(Ms=j5.split("."),nv=Ms[0]>0&&Ms[0]<4?1:+(Ms[0]+Ms[1])),!nv&&fy&&(Ms=fy.match(/Edge\/(\d+)/),(!Ms||Ms[1]>=74)&&(Ms=fy.match(/Chrome\/(\d+)/),Ms&&(nv=+Ms[1])));var Ey=nv,Y5=Ey,Nfe=ir,Kfe=WA,kfe=Kfe.String,H5=!!Object.getOwnPropertySymbols&&!Nfe(function(){var t=Symbol("symbol detection");return!kfe(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Y5&&Y5<41}),Pfe=H5,z5=Pfe&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Gfe=fu,jfe=Ir,Yfe=iv,Hfe=z5,zfe=Object,J5=Hfe?function(t){return typeof t=="symbol"}:function(t){var e=Gfe("Symbol");return jfe(e)&&Yfe(e.prototype,zfe(t))},Jfe=String,sv=function(t){try{return Jfe(t)}catch{return"Object"}},qfe=Ir,Vfe=sv,Wfe=TypeError,xo=function(t){if(qfe(t))return t;throw new Wfe(Vfe(t)+" is not a function")},Zfe=xo,Xfe=rv,dh=function(t,e){var A=t[e];return Xfe(A)?void 0:Zfe(A)},Cy=fi,Iy=Ir,By=hn,_fe=TypeError,$fe=function(t,e){var A,r;if(e==="string"&&Iy(A=t.toString)&&!By(r=Cy(A,t))||Iy(A=t.valueOf)&&!By(r=Cy(A,t))||e!=="string"&&Iy(A=t.toString)&&!By(r=Cy(A,t)))return r;throw new _fe("Can't convert object to primitive value")},q5={exports:{}},V5=WA,eEe=Object.defineProperty,vy=function(t,e){try{eEe(V5,t,{value:e,configurable:!0,writable:!0})}catch{V5[t]=e}return e},tEe=WA,AEe=vy,W5="__core-js_shared__",Z5=q5.exports=tEe[W5]||AEe(W5,{});(Z5.versions||(Z5.versions=[])).push({version:"3.46.0",mode:"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"});var wy=q5.exports,X5=wy,Sy=function(t,e){return X5[t]||(X5[t]=e||{})},rEe=ms,iEe=Object,ov=function(t){return iEe(rEe(t))},nEe=nr,sEe=ov,oEe=nEe({}.hasOwnProperty),ys=Object.hasOwn||function(e,A){return oEe(sEe(e),A)},aEe=nr,cEe=0,uEe=Math.random(),lEe=aEe(1.1.toString),_5=function(t){return"Symbol("+(t===void 0?"":t)+")_"+lEe(++cEe+uEe,36)},hEe=WA,gEe=Sy,$5=ys,dEe=_5,pEe=H5,fEe=z5,ph=hEe.Symbol,my=gEe("wks"),EEe=fEe?ph.for||ph:ph&&ph.withoutSetter||dEe,ei=function(t){return $5(my,t)||(my[t]=pEe&&$5(ph,t)?ph[t]:EEe("Symbol."+t)),my[t]},CEe=fi,eK=hn,tK=J5,IEe=dh,BEe=$fe,vEe=ei,wEe=TypeError,SEe=vEe("toPrimitive"),mEe=function(t,e){if(!eK(t)||tK(t))return t;var A=IEe(t,SEe),r;if(A){if(e===void 0&&(e="default"),r=CEe(A,t,e),!eK(r)||tK(r))return r;throw new wEe("Can't convert object to primitive value")}return e===void 0&&(e="number"),BEe(t,e)},MEe=mEe,yEe=J5,AK=function(t){var e=MEe(t,"string");return yEe(e)?e:e+""},QEe=WA,rK=hn,My=QEe.document,REe=rK(My)&&rK(My.createElement),av=function(t){return REe?My.createElement(t):{}},DEe=Ss,TEe=ir,UEe=av,iK=!DEe&&!TEe(function(){return Object.defineProperty(UEe("div"),"a",{get:function(){return 7}}).a!==7}),LEe=Ss,FEe=fi,OEe=D5,bEe=ly,xEe=df,NEe=AK,KEe=ys,kEe=iK,nK=Object.getOwnPropertyDescriptor;gf.f=LEe?nK:function(e,A){if(e=xEe(e),A=NEe(A),kEe)try{return nK(e,A)}catch{}if(KEe(e,A))return bEe(!FEe(OEe.f,e,A),e[A])};var No={},PEe=Ss,GEe=ir,sK=PEe&&GEe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),jEe=hn,YEe=String,HEe=TypeError,Zi=function(t){if(jEe(t))return t;throw new HEe(YEe(t)+" is not an object")},zEe=Ss,JEe=iK,qEe=sK,cv=Zi,oK=AK,VEe=TypeError,yy=Object.defineProperty,WEe=Object.getOwnPropertyDescriptor,Qy="enumerable",Ry="configurable",Dy="writable";No.f=zEe?qEe?function(e,A,r){if(cv(e),A=oK(A),cv(r),typeof e=="function"&&A==="prototype"&&"value"in r&&Dy in r&&!r[Dy]){var i=WEe(e,A);i&&i[Dy]&&(e[A]=r.value,r={configurable:Ry in r?r[Ry]:i[Ry],enumerable:Qy in r?r[Qy]:i[Qy],writable:!1})}return yy(e,A,r)}:yy:function(e,A,r){if(cv(e),A=oK(A),cv(r),JEe)try{return yy(e,A,r)}catch{}if("get"in r||"set"in r)throw new VEe("Accessors not supported");return"value"in r&&(e[A]=r.value),e};var ZEe=Ss,XEe=No,_Ee=ly,ff=ZEe?function(t,e,A){return XEe.f(t,e,_Ee(1,A))}:function(t,e,A){return t[e]=A,t},aK={exports:{}},Ty=Ss,$Ee=ys,cK=Function.prototype,eCe=Ty&&Object.getOwnPropertyDescriptor,Uy=$Ee(cK,"name"),tCe=Uy&&function(){}.name==="something",ACe=Uy&&(!Ty||Ty&&eCe(cK,"name").configurable),uv={EXISTS:Uy,PROPER:tCe,CONFIGURABLE:ACe},rCe=nr,iCe=Ir,Ly=wy,nCe=rCe(Function.toString);iCe(Ly.inspectSource)||(Ly.inspectSource=function(t){return nCe(t)});var Fy=Ly.inspectSource,sCe=WA,oCe=Ir,uK=sCe.WeakMap,aCe=oCe(uK)&&/native code/.test(String(uK)),cCe=Sy,uCe=_5,lK=cCe("keys"),Oy=function(t){return lK[t]||(lK[t]=uCe(t))},by={},lCe=aCe,hK=WA,hCe=hn,gCe=ff,xy=ys,Ny=wy,dCe=Oy,pCe=by,gK="Object already initialized",Ky=hK.TypeError,fCe=hK.WeakMap,lv,Ef,hv,ECe=function(t){return hv(t)?Ef(t):lv(t,{})},CCe=function(t){return function(e){var A;if(!hCe(e)||(A=Ef(e)).type!==t)throw new Ky("Incompatible receiver, "+t+" required");return A}};if(lCe||Ny.state){var $s=Ny.state||(Ny.state=new fCe);$s.get=$s.get,$s.has=$s.has,$s.set=$s.set,lv=function(t,e){if($s.has(t))throw new Ky(gK);return e.facade=t,$s.set(t,e),e},Ef=function(t){return $s.get(t)||{}},hv=function(t){return $s.has(t)}}else{var fh=dCe("state");pCe[fh]=!0,lv=function(t,e){if(xy(t,fh))throw new Ky(gK);return e.facade=t,gCe(t,fh,e),e},Ef=function(t){return xy(t,fh)?t[fh]:{}},hv=function(t){return xy(t,fh)}}var gv={set:lv,get:Ef,has:hv,enforce:ECe,getterFor:CCe},ky=nr,ICe=ir,BCe=Ir,dv=ys,Py=Ss,vCe=uv.CONFIGURABLE,wCe=Fy,dK=gv,SCe=dK.enforce,mCe=dK.get,pK=String,pv=Object.defineProperty,MCe=ky("".slice),yCe=ky("".replace),QCe=ky([].join),RCe=Py&&!ICe(function(){return pv(function(){},"length",{value:8}).length!==8}),DCe=String(String).split("String"),TCe=aK.exports=function(t,e,A){MCe(pK(e),0,7)==="Symbol("&&(e="["+yCe(pK(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),A&&A.getter&&(e="get "+e),A&&A.setter&&(e="set "+e),(!dv(t,"name")||vCe&&t.name!==e)&&(Py?pv(t,"name",{value:e,configurable:!0}):t.name=e),RCe&&A&&dv(A,"arity")&&t.length!==A.arity&&pv(t,"length",{value:A.arity});try{A&&dv(A,"constructor")&&A.constructor?Py&&pv(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var r=SCe(t);return dv(r,"source")||(r.source=QCe(DCe,typeof e=="string"?e:"")),t};Function.prototype.toString=TCe(function(){return BCe(this)&&mCe(this).source||wCe(this)},"toString");var fK=aK.exports,UCe=Ir,LCe=No,FCe=fK,OCe=vy,Eu=function(t,e,A,r){r||(r={});var i=r.enumerable,n=r.name!==void 0?r.name:e;if(UCe(A)&&FCe(A,n,r),r.global)i?t[e]=A:OCe(e,A);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch{}i?t[e]=A:LCe.f(t,e,{value:A,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},EK={},bCe=Math.ceil,xCe=Math.floor,NCe=Math.trunc||function(e){var A=+e;return(A>0?xCe:bCe)(A)},KCe=NCe,fv=function(t){var e=+t;return e!==e||e===0?0:KCe(e)},kCe=fv,PCe=Math.max,GCe=Math.min,jCe=function(t,e){var A=kCe(t);return A<0?PCe(A+e,0):GCe(A,e)},YCe=fv,HCe=Math.min,Eh=function(t){var e=YCe(t);return e>0?HCe(e,9007199254740991):0},zCe=Eh,Gy=function(t){return zCe(t.length)},JCe=df,qCe=jCe,VCe=Gy,CK=function(t){return function(e,A,r){var i=JCe(e),n=VCe(i);if(n===0)return!t&&-1;var o=qCe(r,n),s;if(t&&A!==A){for(;n>o;)if(s=i[o++],s!==s)return!0}else for(;n>o;o++)if((t||o in i)&&i[o]===A)return t||o||0;return!t&&-1}},IK={includes:CK(!0),indexOf:CK(!1)},WCe=nr,jy=ys,ZCe=df,XCe=IK.indexOf,_Ce=by,BK=WCe([].push),vK=function(t,e){var A=ZCe(t),r=0,i=[],n;for(n in A)!jy(_Ce,n)&&jy(A,n)&&BK(i,n);for(;e.length>r;)jy(A,n=e[r++])&&(~XCe(i,n)||BK(i,n));return i},Yy=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$Ce=vK,eIe=Yy,tIe=eIe.concat("length","prototype");EK.f=Object.getOwnPropertyNames||function(e){return $Ce(e,tIe)};var wK={};wK.f=Object.getOwnPropertySymbols;var AIe=fu,rIe=nr,iIe=EK,nIe=wK,sIe=Zi,oIe=rIe([].concat),aIe=AIe("Reflect","ownKeys")||function(e){var A=iIe.f(sIe(e)),r=nIe.f;return r?oIe(A,r(e)):A},SK=ys,cIe=aIe,uIe=gf,lIe=No,hIe=function(t,e,A){for(var r=cIe(e),i=lIe.f,n=uIe.f,o=0;o<r.length;o++){var s=r[o];!SK(t,s)&&!(A&&SK(A,s))&&i(t,s,n(e,s))}},gIe=ir,dIe=Ir,pIe=/#|\.prototype\./,Cf=function(t,e){var A=EIe[fIe(t)];return A===IIe?!0:A===CIe?!1:dIe(e)?gIe(e):!!e},fIe=Cf.normalize=function(t){return String(t).replace(pIe,".").toLowerCase()},EIe=Cf.data={},CIe=Cf.NATIVE="N",IIe=Cf.POLYFILL="P",mK=Cf,Ev=WA,BIe=gf.f,vIe=ff,wIe=Eu,SIe=vy,mIe=hIe,MIe=mK,Xi=function(t,e){var A=t.target,r=t.global,i=t.stat,n,o,s,a,c,u;if(r?o=Ev:i?o=Ev[A]||SIe(A,{}):o=Ev[A]&&Ev[A].prototype,o)for(s in e){if(c=e[s],t.dontCallGetSet?(u=BIe(o,s),a=u&&u.value):a=o[s],n=MIe(r?s:A+(i?".":"#")+s,t.forced),!n&&a!==void 0){if(typeof c==typeof a)continue;mIe(c,a)}(t.sham||a&&a.sham)&&vIe(c,"sham",!0),wIe(o,s,c,t)}},If=WA,yIe=pf,QIe=pu,Cv=function(t){return yIe.slice(0,t.length)===t},MK=function(){return Cv("Bun/")?"BUN":Cv("Cloudflare-Workers")?"CLOUDFLARE":Cv("Deno/")?"DENO":Cv("Node.js/")?"NODE":If.Bun&&typeof Bun.version=="string"?"BUN":If.Deno&&typeof Deno.version=="object"?"DENO":QIe(If.process)==="process"?"NODE":If.window&&If.document?"BROWSER":"REST"}(),RIe=MK,Iv=RIe==="NODE",DIe=WA,TIe=DIe,UIe=nr,LIe=xo,FIe=function(t,e,A){try{return UIe(LIe(Object.getOwnPropertyDescriptor(t,e)[A]))}catch{}},OIe=hn,bIe=function(t){return OIe(t)||t===null},xIe=bIe,NIe=String,KIe=TypeError,kIe=function(t){if(xIe(t))return t;throw new KIe("Can't set "+NIe(t)+" as a prototype")},PIe=FIe,GIe=hn,jIe=ms,YIe=kIe,yK=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},A;try{A=PIe(Object.prototype,"__proto__","set"),A(e,[]),t=e instanceof Array}catch{}return function(i,n){return jIe(i),YIe(n),GIe(i)&&(t?A(i,n):i.__proto__=n),i}}():void 0),HIe=No.f,zIe=ys,JIe=ei,QK=JIe("toStringTag"),Bv=function(t,e,A){t&&!A&&(t=t.prototype),t&&!zIe(t,QK)&&HIe(t,QK,{configurable:!0,value:e})},RK=fK,qIe=No,VIe=function(t,e,A){return A.get&&RK(A.get,e,{getter:!0}),A.set&&RK(A.set,e,{setter:!0}),qIe.f(t,e,A)},WIe=fu,ZIe=VIe,XIe=ei,_Ie=Ss,DK=XIe("species"),$Ie=function(t){var e=WIe(t);_Ie&&e&&!e[DK]&&ZIe(e,DK,{configurable:!0,get:function(){return this}})},eBe=iv,tBe=TypeError,ABe=function(t,e){if(eBe(e,t))return t;throw new tBe("Incorrect invocation")},rBe=ei,iBe=rBe("toStringTag"),TK={};TK[iBe]="z";var nBe=String(TK)==="[object z]",sBe=nBe,oBe=Ir,vv=pu,aBe=ei,cBe=aBe("toStringTag"),uBe=Object,lBe=vv(function(){return arguments}())==="Arguments",hBe=function(t,e){try{return t[e]}catch{}},Hy=sBe?vv:function(t){var e,A,r;return t===void 0?"Undefined":t===null?"Null":typeof(A=hBe(e=uBe(t),cBe))=="string"?A:lBe?vv(e):(r=vv(e))==="Object"&&oBe(e.callee)?"Arguments":r},gBe=nr,dBe=ir,UK=Ir,pBe=Hy,fBe=fu,EBe=Fy,LK=function(){},FK=fBe("Reflect","construct"),zy=/^\s*(?:class|function)\b/,CBe=gBe(zy.exec),IBe=!zy.test(LK),Bf=function(e){if(!UK(e))return!1;try{return FK(LK,[],e),!0}catch{return!1}},OK=function(e){if(!UK(e))return!1;switch(pBe(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return IBe||!!CBe(zy,EBe(e))}catch{return!0}};OK.sham=!0;var BBe=!FK||dBe(function(){var t;return Bf(Bf.call)||!Bf(Object)||!Bf(function(){t=!0})||t})?OK:Bf,vBe=BBe,wBe=sv,SBe=TypeError,mBe=function(t){if(vBe(t))return t;throw new SBe(wBe(t)+" is not a constructor")},bK=Zi,MBe=mBe,yBe=rv,QBe=ei,RBe=QBe("species"),xK=function(t,e){var A=bK(t).constructor,r;return A===void 0||yBe(r=bK(A)[RBe])?e:MBe(r)},DBe=tv,NK=Function.prototype,KK=NK.apply,kK=NK.call,PK=typeof Reflect=="object"&&Reflect.apply||(DBe?kK.bind(KK):function(){return kK.apply(KK,arguments)}),TBe=pu,UBe=nr,wv=function(t){if(TBe(t)==="Function")return UBe(t)},GK=wv,LBe=xo,FBe=tv,OBe=GK(GK.bind),Jy=function(t,e){return LBe(t),e===void 0?t:FBe?OBe(t,e):function(){return t.apply(e,arguments)}},bBe=fu,jK=bBe("document","documentElement"),xBe=nr,NBe=xBe([].slice),KBe=TypeError,kBe=function(t,e){if(t<e)throw new KBe("Not enough arguments");return t},PBe=pf,YK=/(?:ipad|iphone|ipod).*applewebkit/i.test(PBe),Rn=WA,GBe=PK,jBe=Jy,HK=Ir,YBe=ys,zK=ir,JK=jK,HBe=NBe,qK=av,zBe=kBe,JBe=YK,qBe=Iv,qy=Rn.setImmediate,Vy=Rn.clearImmediate,VBe=Rn.process,Wy=Rn.Dispatch,WBe=Rn.Function,VK=Rn.MessageChannel,ZBe=Rn.String,Zy=0,vf={},WK="onreadystatechange",wf,Cu,Xy,_y;zK(function(){wf=Rn.location});var $y=function(t){if(YBe(vf,t)){var e=vf[t];delete vf[t],e()}},eQ=function(t){return function(){$y(t)}},ZK=function(t){$y(t.data)},XK=function(t){Rn.postMessage(ZBe(t),wf.protocol+"//"+wf.host)};(!qy||!Vy)&&(qy=function(e){zBe(arguments.length,1);var A=HK(e)?e:WBe(e),r=HBe(arguments,1);return vf[++Zy]=function(){GBe(A,void 0,r)},Cu(Zy),Zy},Vy=function(e){delete vf[e]},qBe?Cu=function(t){VBe.nextTick(eQ(t))}:Wy&&Wy.now?Cu=function(t){Wy.now(eQ(t))}:VK&&!JBe?(Xy=new VK,_y=Xy.port2,Xy.port1.onmessage=ZK,Cu=jBe(_y.postMessage,_y)):Rn.addEventListener&&HK(Rn.postMessage)&&!Rn.importScripts&&wf&&wf.protocol!=="file:"&&!zK(XK)?(Cu=XK,Rn.addEventListener("message",ZK,!1)):WK in qK("script")?Cu=function(t){JK.appendChild(qK("script"))[WK]=function(){JK.removeChild(this),$y(t)}}:Cu=function(t){setTimeout(eQ(t),0)});var _K={set:qy,clear:Vy},$K=WA,XBe=Ss,_Be=Object.getOwnPropertyDescriptor,$Be=function(t){if(!XBe)return $K[t];var e=_Be($K,t);return e&&e.value},ek=function(){this.head=null,this.tail=null};ek.prototype={add:function(t){var e={item:t,next:null},A=this.tail;A?A.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t){var e=this.head=t.next;return e===null&&(this.tail=null),t.item}}};var tk=ek,eve=pf,tve=/ipad|iphone|ipod/i.test(eve)&&typeof Pebble<"u",Ave=pf,rve=/web0s(?!.*chrome)/i.test(Ave),Ch=WA,ive=$Be,Ak=Jy,tQ=_K.set,nve=tk,sve=YK,ove=tve,ave=rve,AQ=Iv,rk=Ch.MutationObserver||Ch.WebKitMutationObserver,ik=Ch.document,nk=Ch.process,Sv=Ch.Promise,rQ=ive("queueMicrotask"),Ih,iQ,nQ,mv,sk;if(!rQ){var Mv=new nve,yv=function(){var t,e;for(AQ&&(t=nk.domain)&&t.exit();e=Mv.get();)try{e()}catch(A){throw Mv.head&&Ih(),A}t&&t.enter()};!sve&&!AQ&&!ave&&rk&&ik?(iQ=!0,nQ=ik.createTextNode(""),new rk(yv).observe(nQ,{characterData:!0}),Ih=function(){nQ.data=iQ=!iQ}):!ove&&Sv&&Sv.resolve?(mv=Sv.resolve(void 0),mv.constructor=Sv,sk=Ak(mv.then,mv),Ih=function(){sk(yv)}):AQ?Ih=function(){nk.nextTick(yv)}:(tQ=Ak(tQ,Ch),Ih=function(){tQ(yv)}),rQ=function(t){Mv.head||Ih(),Mv.add(t)}}var cve=rQ,uve=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}},sQ=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}},lve=WA,Qv=lve.Promise,hve=WA,Sf=Qv,gve=Ir,dve=mK,pve=Fy,fve=ei,ok=MK,oQ=Ey;Sf&&Sf.prototype;var Eve=fve("species"),aQ=!1,ak=gve(hve.PromiseRejectionEvent),Cve=dve("Promise",function(){var t=pve(Sf),e=t!==String(Sf);if(!e&&oQ===66)return!0;if(!oQ||oQ<51||!/native code/.test(t)){var A=new Sf(function(n){n(1)}),r=function(n){n(function(){},function(){})},i=A.constructor={};if(i[Eve]=r,aQ=A.then(function(){})instanceof r,!aQ)return!0}return!e&&(ok==="BROWSER"||ok==="DENO")&&!ak}),mf={CONSTRUCTOR:Cve,REJECTION_EVENT:ak,SUBCLASSING:aQ},Bh={},ck=xo,Ive=TypeError,Bve=function(t){var e,A;this.promise=new t(function(r,i){if(e!==void 0||A!==void 0)throw new Ive("Bad Promise constructor");e=r,A=i}),this.resolve=ck(e),this.reject=ck(A)};Bh.f=function(t){return new Bve(t)};var vve=Xi,Rv=Iv,Xa=WA,wve=TIe,vh=fi,uk=Eu,lk=yK,Sve=Bv,mve=$Ie,Mve=xo,Dv=Ir,yve=hn,Qve=ABe,Rve=xK,hk=_K.set,cQ=cve,Dve=uve,Tve=sQ,Uve=tk,gk=gv,Tv=Qv,uQ=mf,dk=Bh,Uv="Promise",pk=uQ.CONSTRUCTOR,Lve=uQ.REJECTION_EVENT,Fve=uQ.SUBCLASSING,lQ=gk.getterFor(Uv),Ove=gk.set,wh=Tv&&Tv.prototype,Iu=Tv,Lv=wh,fk=Xa.TypeError,hQ=Xa.document,gQ=Xa.process,dQ=dk.f,bve=dQ,xve=!!(hQ&&hQ.createEvent&&Xa.dispatchEvent),Ek="unhandledrejection",Nve="rejectionhandled",Ck=0,Ik=1,Kve=2,pQ=1,Bk=2,Fv,vk,wk,Sk,mk=function(t){var e;return yve(t)&&Dv(e=t.then)?e:!1},Mk=function(t,e){var A=e.value,r=e.state===Ik,i=r?t.ok:t.fail,n=t.resolve,o=t.reject,s=t.domain,a,c,u;try{i?(r||(e.rejection===Bk&&Pve(e),e.rejection=pQ),i===!0?a=A:(s&&s.enter(),a=i(A),s&&(s.exit(),u=!0)),a===t.promise?o(new fk("Promise-chain cycle")):(c=mk(a))?vh(c,a,n,o):n(a)):o(A)}catch(l){s&&!u&&s.exit(),o(l)}},yk=function(t,e){t.notified||(t.notified=!0,cQ(function(){for(var A=t.reactions,r;r=A.get();)Mk(r,t);t.notified=!1,e&&!t.rejection&&kve(t)}))},Qk=function(t,e,A){var r,i;xve?(r=hQ.createEvent("Event"),r.promise=e,r.reason=A,r.initEvent(t,!1,!0),Xa.dispatchEvent(r)):r={promise:e,reason:A},!Lve&&(i=Xa["on"+t])?i(r):t===Ek&&Dve("Unhandled promise rejection",A)},kve=function(t){vh(hk,Xa,function(){var e=t.facade,A=t.value,r=Rk(t),i;if(r&&(i=Tve(function(){Rv?gQ.emit("unhandledRejection",A,e):Qk(Ek,e,A)}),t.rejection=Rv||Rk(t)?Bk:pQ,i.error))throw i.value})},Rk=function(t){return t.rejection!==pQ&&!t.parent},Pve=function(t){vh(hk,Xa,function(){var e=t.facade;Rv?gQ.emit("rejectionHandled",e):Qk(Nve,e,t.value)})},Sh=function(t,e,A){return function(r){t(e,r,A)}},mh=function(t,e,A){t.done||(t.done=!0,A&&(t=A),t.value=e,t.state=Kve,yk(t,!0))},fQ=function(t,e,A){if(!t.done){t.done=!0,A&&(t=A);try{if(t.facade===e)throw new fk("Promise can't be resolved itself");var r=mk(e);r?cQ(function(){var i={done:!1};try{vh(r,e,Sh(fQ,i,t),Sh(mh,i,t))}catch(n){mh(i,n,t)}}):(t.value=e,t.state=Ik,yk(t,!1))}catch(i){mh({done:!1},i,t)}}};if(pk&&(Iu=function(e){Qve(this,Lv),Mve(e),vh(Fv,this);var A=lQ(this);try{e(Sh(fQ,A),Sh(mh,A))}catch(r){mh(A,r)}},Lv=Iu.prototype,Fv=function(e){Ove(this,{type:Uv,done:!1,notified:!1,parent:!1,reactions:new Uve,rejection:!1,state:Ck,value:null})},Fv.prototype=uk(Lv,"then",function(e,A){var r=lQ(this),i=dQ(Rve(this,Iu));return r.parent=!0,i.ok=Dv(e)?e:!0,i.fail=Dv(A)&&A,i.domain=Rv?gQ.domain:void 0,r.state===Ck?r.reactions.add(i):cQ(function(){Mk(i,r)}),i.promise}),vk=function(){var t=new Fv,e=lQ(t);this.promise=t,this.resolve=Sh(fQ,e),this.reject=Sh(mh,e)},dk.f=dQ=function(t){return t===Iu||t===wk?new vk(t):bve(t)},Dv(Tv)&&wh!==Object.prototype)){Sk=wh.then,Fve||uk(wh,"then",function(e,A){var r=this;return new Iu(function(i,n){vh(Sk,r,i,n)}).then(e,A)},{unsafe:!0});try{delete wh.constructor}catch{}lk&&lk(wh,Lv)}vve({global:!0,constructor:!0,wrap:!0,forced:pk},{Promise:Iu}),wk=wve.Promise,Sve(Iu,Uv,!1),mve(Uv);var Mf={},Gve=ei,jve=Mf,Yve=Gve("iterator"),Hve=Array.prototype,zve=function(t){return t!==void 0&&(jve.Array===t||Hve[Yve]===t)},Jve=Hy,Dk=dh,qve=rv,Vve=Mf,Wve=ei,Zve=Wve("iterator"),Tk=function(t){if(!qve(t))return Dk(t,Zve)||Dk(t,"@@iterator")||Vve[Jve(t)]},Xve=fi,_ve=xo,$ve=Zi,ewe=sv,twe=Tk,Awe=TypeError,rwe=function(t,e){var A=arguments.length<2?twe(t):e;if(_ve(A))return $ve(Xve(A,t));throw new Awe(ewe(t)+" is not iterable")},iwe=fi,Uk=Zi,nwe=dh,swe=function(t,e,A){var r,i;Uk(t);try{if(r=nwe(t,"return"),!r){if(e==="throw")throw A;return A}r=iwe(r,t)}catch(n){i=!0,r=n}if(e==="throw")throw A;if(i)throw r;return Uk(r),A},owe=Jy,awe=fi,cwe=Zi,uwe=sv,lwe=zve,hwe=Gy,Lk=iv,gwe=rwe,dwe=Tk,Fk=swe,pwe=TypeError,Ov=function(t,e){this.stopped=t,this.result=e},Ok=Ov.prototype,bk=function(t,e,A){var r=A&&A.that,i=!!(A&&A.AS_ENTRIES),n=!!(A&&A.IS_RECORD),o=!!(A&&A.IS_ITERATOR),s=!!(A&&A.INTERRUPTED),a=owe(e,r),c,u,l,g,h,p,C,I=function(v){return c&&Fk(c,"normal"),new Ov(!0,v)},E=function(v){return i?(cwe(v),s?a(v[0],v[1],I):a(v[0],v[1])):s?a(v,I):a(v)};if(n)c=t.iterator;else if(o)c=t;else{if(u=dwe(t),!u)throw new pwe(uwe(t)+" is not iterable");if(lwe(u)){for(l=0,g=hwe(t);g>l;l++)if(h=E(t[l]),h&&Lk(Ok,h))return h;return new Ov(!1)}c=gwe(t,u)}for(p=n?t.next:c.next;!(C=awe(p,c)).done;){try{h=E(C.value)}catch(v){Fk(c,"throw",v)}if(typeof h=="object"&&h&&Lk(Ok,h))return h}return new Ov(!1)},fwe=ei,xk=fwe("iterator"),Nk=!1;try{var Ewe=0,Kk={next:function(){return{done:!!Ewe++}},return:function(){Nk=!0}};Kk[xk]=function(){return this},Array.from(Kk,function(){throw 2})}catch{}var Cwe=function(t,e){try{if(!e&&!Nk)return!1}catch{return!1}var A=!1;try{var r={};r[xk]=function(){return{next:function(){return{done:A=!0}}}},t(r)}catch{}return A},Iwe=Qv,Bwe=Cwe,vwe=mf.CONSTRUCTOR,kk=vwe||!Bwe(function(t){Iwe.all(t).then(void 0,function(){})}),wwe=Xi,Swe=fi,mwe=xo,Mwe=Bh,ywe=sQ,Qwe=bk,Rwe=kk;wwe({target:"Promise",stat:!0,forced:Rwe},{all:function(e){var A=this,r=Mwe.f(A),i=r.resolve,n=r.reject,o=ywe(function(){var s=mwe(A.resolve),a=[],c=0,u=1;Qwe(e,function(l){var g=c++,h=!1;u++,Swe(s,A,l).then(function(p){h||(h=!0,a[g]=p,--u||i(a))},n)}),--u||i(a)});return o.error&&n(o.value),r.promise}});var Dwe=Xi,Twe=mf.CONSTRUCTOR,EQ=Qv,Uwe=fu,Lwe=Ir,Fwe=Eu,Pk=EQ&&EQ.prototype;if(Dwe({target:"Promise",proto:!0,forced:Twe,real:!0},{catch:function(t){return this.then(void 0,t)}}),Lwe(EQ)){var Gk=Uwe("Promise").prototype.catch;Pk.catch!==Gk&&Fwe(Pk,"catch",Gk,{unsafe:!0})}var Owe=Xi,bwe=fi,xwe=xo,Nwe=Bh,Kwe=sQ,kwe=bk,Pwe=kk;Owe({target:"Promise",stat:!0,forced:Pwe},{race:function(e){var A=this,r=Nwe.f(A),i=r.reject,n=Kwe(function(){var o=xwe(A.resolve);kwe(e,function(s){bwe(o,A,s).then(r.resolve,i)})});return n.error&&i(n.value),r.promise}});var Gwe=Xi,jwe=Bh,Ywe=mf.CONSTRUCTOR;Gwe({target:"Promise",stat:!0,forced:Ywe},{reject:function(e){var A=jwe.f(this),r=A.reject;return r(e),A.promise}});var Hwe=Zi,zwe=hn,Jwe=Bh,qwe=function(t,e){if(Hwe(t),zwe(e)&&e.constructor===t)return e;var A=Jwe.f(t),r=A.resolve;return r(e),A.promise},Vwe=Xi,Wwe=fu,Zwe=mf.CONSTRUCTOR,Xwe=qwe;Wwe("Promise"),Vwe({target:"Promise",stat:!0,forced:Zwe},{resolve:function(e){return Xwe(this,e)}});function jk(t,e,A,r,i,n,o){try{var s=t[n](o),a=s.value}catch(c){return void A(c)}s.done?e(a):Promise.resolve(a).then(r,i)}function Ko(t){return function(){var e=this,A=arguments;return new Promise(function(r,i){var n=t.apply(e,A);function o(a){jk(n,r,i,o,s,"next",a)}function s(a){jk(n,r,i,o,s,"throw",a)}o(void 0)})}}var _we=Hy,$we=String,eo=function(t){if(_we(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $we(t)},eSe=Zi,Yk=function(){var t=eSe(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},CQ=ir,tSe=WA,IQ=tSe.RegExp,BQ=CQ(function(){var t=IQ("a","y");return t.lastIndex=2,t.exec("abcd")!==null}),ASe=BQ||CQ(function(){return!IQ("a","y").sticky}),rSe=BQ||CQ(function(){var t=IQ("^r","gy");return t.lastIndex=2,t.exec("str")!==null}),Hk={BROKEN_CARET:rSe,MISSED_STICKY:ASe,UNSUPPORTED_Y:BQ},zk={},iSe=vK,nSe=Yy,sSe=Object.keys||function(e){return iSe(e,nSe)},oSe=Ss,aSe=sK,cSe=No,uSe=Zi,lSe=df,hSe=sSe;zk.f=oSe&&!aSe?Object.defineProperties:function(e,A){uSe(e);for(var r=lSe(A),i=hSe(A),n=i.length,o=0,s;n>o;)cSe.f(e,s=i[o++],r[s]);return e};var gSe=Zi,dSe=zk,Jk=Yy,pSe=by,fSe=jK,ESe=av,CSe=Oy,qk=">",Vk="<",vQ="prototype",wQ="script",Wk=CSe("IE_PROTO"),SQ=function(){},Zk=function(t){return Vk+wQ+qk+t+Vk+"/"+wQ+qk},Xk=function(t){t.write(Zk("")),t.close();var e=t.parentWindow.Object;return t=null,e},ISe=function(){var t=ESe("iframe"),e="java"+wQ+":",A;return t.style.display="none",fSe.appendChild(t),t.src=String(e),A=t.contentWindow.document,A.open(),A.write(Zk("document.F=Object")),A.close(),A.F},bv,xv=function(){try{bv=new ActiveXObject("htmlfile")}catch{}xv=typeof document<"u"?document.domain&&bv?Xk(bv):ISe():Xk(bv);for(var t=Jk.length;t--;)delete xv[vQ][Jk[t]];return xv()};pSe[Wk]=!0;var mQ=Object.create||function(e,A){var r;return e!==null?(SQ[vQ]=gSe(e),r=new SQ,SQ[vQ]=null,r[Wk]=e):r=xv(),A===void 0?r:dSe.f(r,A)},BSe=ir,vSe=WA,wSe=vSe.RegExp,SSe=BSe(function(){var t=wSe(".","s");return!(t.dotAll&&t.test(`
250
250
  `)&&t.flags==="s")}),mSe=ir,MSe=WA,ySe=MSe.RegExp,QSe=mSe(function(){var t=ySe("(?<a>b)","g");return t.exec("b").groups.a!=="b"||"b".replace(t,"$<a>c")!=="bc"}),Mh=fi,Nv=nr,RSe=eo,DSe=Yk,TSe=Hk,USe=Sy,LSe=mQ,FSe=gv.get,OSe=SSe,bSe=QSe,xSe=USe("native-string-replace",String.prototype.replace),Kv=RegExp.prototype.exec,MQ=Kv,NSe=Nv("".charAt),KSe=Nv("".indexOf),kSe=Nv("".replace),yQ=Nv("".slice),QQ=function(){var t=/a/,e=/b*/g;return Mh(Kv,t,"a"),Mh(Kv,e,"a"),t.lastIndex!==0||e.lastIndex!==0}(),_k=TSe.BROKEN_CARET,RQ=/()??/.exec("")[1]!==void 0,PSe=QQ||RQ||_k||OSe||bSe;PSe&&(MQ=function(e){var A=this,r=FSe(A),i=RSe(e),n=r.raw,o,s,a,c,u,l,g;if(n)return n.lastIndex=A.lastIndex,o=Mh(MQ,n,i),A.lastIndex=n.lastIndex,o;var h=r.groups,p=_k&&A.sticky,C=Mh(DSe,A),I=A.source,E=0,v=i;if(p&&(C=kSe(C,"y",""),KSe(C,"g")===-1&&(C+="g"),v=yQ(i,A.lastIndex),A.lastIndex>0&&(!A.multiline||A.multiline&&NSe(i,A.lastIndex-1)!==`
251
251
  `)&&(I="(?: "+I+")",v=" "+v,E++),s=new RegExp("^(?:"+I+")",C)),RQ&&(s=new RegExp("^"+I+"$(?!\\s)",C)),QQ&&(a=A.lastIndex),c=Mh(Kv,p?s:A,v),p?c?(c.input=yQ(c.input,E),c[0]=yQ(c[0],E),c.index=A.lastIndex,A.lastIndex+=c[0].length):A.lastIndex=0:QQ&&c&&(A.lastIndex=A.global?c.index+c[0].length:a),RQ&&c&&c.length>1&&Mh(xSe,c[0],s,function(){for(u=1;u<arguments.length-2;u++)arguments[u]===void 0&&(c[u]=void 0)}),c&&h)for(c.groups=l=LSe(null),u=0;u<h.length;u++)g=h[u],l[g[0]]=c[g[1]];return c});var DQ=MQ,GSe=Xi,$k=DQ;GSe({target:"RegExp",proto:!0,forced:/./.exec!==$k},{exec:$k});var eP=fi,tP=Eu,jSe=DQ,AP=ir,rP=ei,YSe=ff,HSe=rP("species"),TQ=RegExp.prototype,UQ=function(t,e,A,r){var i=rP(t),n=!AP(function(){var c={};return c[i]=function(){return 7},""[t](c)!==7}),o=n&&!AP(function(){var c=!1,u=/a/;return t==="split"&&(u={},u.constructor={},u.constructor[HSe]=function(){return u},u.flags="",u[i]=/./[i]),u.exec=function(){return c=!0,null},u[i](""),!c});if(!n||!o||A){var s=/./[i],a=e(i,""[t],function(c,u,l,g,h){var p=u.exec;return p===jSe||p===TQ.exec?n&&!h?{done:!0,value:eP(s,u,l,g)}:{done:!0,value:eP(c,l,u,g)}:{done:!1}});tP(String.prototype,t,a[0]),tP(TQ,i,a[1])}r&&YSe(TQ[i],"sham",!0)},LQ=nr,zSe=fv,JSe=eo,qSe=ms,VSe=LQ("".charAt),iP=LQ("".charCodeAt),WSe=LQ("".slice),nP=function(t){return function(e,A){var r=JSe(qSe(e)),i=zSe(A),n=r.length,o,s;return i<0||i>=n?t?"":void 0:(o=iP(r,i),o<55296||o>56319||i+1===n||(s=iP(r,i+1))<56320||s>57343?t?VSe(r,i):o:t?WSe(r,i,i+2):(o-55296<<10)+(s-56320)+65536)}},ZSe={codeAt:nP(!1),charAt:nP(!0)},XSe=ZSe.charAt,FQ=function(t,e,A){return e+(A?XSe(t,e).length:1)},_Se=WA,$Se=ir,sP=_Se.RegExp,e0e=!$Se(function(){var t=!0;try{sP(".","d")}catch{t=!1}var e={},A="",r=t?"dgimsy":"gimsy",i=function(a,c){Object.defineProperty(e,a,{get:function(){return A+=c,!0}})},n={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};t&&(n.hasIndices="d");for(var o in n)i(o,n[o]);var s=Object.getOwnPropertyDescriptor(sP.prototype,"flags").get.call(e);return s!==r||A!==r}),t0e={correct:e0e},A0e=fi,r0e=ys,i0e=iv,oP=t0e,n0e=Yk,s0e=RegExp.prototype,OQ=oP.correct?function(t){return t.flags}:function(t){return!oP.correct&&i0e(s0e,t)&&!r0e(t,"flags")?A0e(n0e,t):t.flags},aP=fi,o0e=Zi,a0e=Ir,c0e=pu,u0e=DQ,l0e=TypeError,bQ=function(t,e){var A=t.exec;if(a0e(A)){var r=aP(A,t,e);return r!==null&&o0e(r),r}if(c0e(t)==="RegExp")return aP(u0e,t,e);throw new l0e("RegExp#exec called on incompatible receiver")},h0e=fi,g0e=nr,d0e=UQ,p0e=Zi,f0e=hn,E0e=Eh,kv=eo,C0e=ms,I0e=dh,B0e=FQ,v0e=OQ,cP=bQ,uP=g0e("".indexOf);d0e("match",function(t,e,A){return[function(i){var n=C0e(this),o=f0e(i)?I0e(i,t):void 0;return o?h0e(o,i,n):new RegExp(i)[t](kv(n))},function(r){var i=p0e(this),n=kv(r),o=A(e,i,n);if(o.done)return o.value;var s=kv(v0e(i));if(uP(s,"g")===-1)return cP(i,n);var a=uP(s,"u")!==-1;i.lastIndex=0;for(var c=[],u=0,l;(l=cP(i,n))!==null;){var g=kv(l[0]);c[u]=g,g===""&&(i.lastIndex=B0e(n,E0e(i.lastIndex),a)),u++}return u===0?null:c}]});var xQ=nr,w0e=ov,S0e=Math.floor,NQ=xQ("".charAt),m0e=xQ("".replace),KQ=xQ("".slice),M0e=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,y0e=/\$([$&'`]|\d{1,2})/g,Q0e=function(t,e,A,r,i,n){var o=A+t.length,s=r.length,a=y0e;return i!==void 0&&(i=w0e(i),a=M0e),m0e(n,a,function(c,u){var l;switch(NQ(u,0)){case"$":return"$";case"&":return t;case"`":return KQ(e,0,A);case"'":return KQ(e,o);case"<":l=i[KQ(u,1,-1)];break;default:var g=+u;if(g===0)return c;if(g>s){var h=S0e(g/10);return h===0?c:h<=s?r[h-1]===void 0?NQ(u,1):r[h-1]+NQ(u,1):c}l=r[g-1]}return l===void 0?"":l})},R0e=PK,lP=fi,Pv=nr,D0e=UQ,T0e=ir,U0e=Zi,L0e=Ir,F0e=hn,O0e=fv,b0e=Eh,Bu=eo,x0e=ms,N0e=FQ,K0e=dh,k0e=Q0e,P0e=OQ,G0e=bQ,j0e=ei,kQ=j0e("replace"),Y0e=Math.max,H0e=Math.min,z0e=Pv([].concat),PQ=Pv([].push),Gv=Pv("".indexOf),hP=Pv("".slice),J0e=function(t){return t===void 0?t:String(t)},q0e=function(){return"a".replace(/./,"$0")==="$0"}(),gP=function(){return/./[kQ]?/./[kQ]("a","$0")==="":!1}(),V0e=!T0e(function(){var t=/./;return t.exec=function(){var e=[];return e.groups={a:"7"},e},"".replace(t,"$<a>")!=="7"});D0e("replace",function(t,e,A){var r=gP?"$":"$0";return[function(n,o){var s=x0e(this),a=F0e(n)?K0e(n,kQ):void 0;return a?lP(a,n,s,o):lP(e,Bu(s),n,o)},function(i,n){var o=U0e(this),s=Bu(i);if(typeof n=="string"&&Gv(n,r)===-1&&Gv(n,"$<")===-1){var a=A(e,o,s,n);if(a.done)return a.value}var c=L0e(n);c||(n=Bu(n));var u=Bu(P0e(o)),l=Gv(u,"g")!==-1,g;l&&(g=Gv(u,"u")!==-1,o.lastIndex=0);for(var h=[],p;p=G0e(o,s),!(p===null||(PQ(h,p),!l));){var C=Bu(p[0]);C===""&&(o.lastIndex=N0e(s,b0e(o.lastIndex),g))}for(var I="",E=0,v=0;v<h.length;v++){p=h[v];for(var m=Bu(p[0]),M=Y0e(H0e(O0e(p.index),s.length),0),O=[],x,P=1;P<p.length;P++)PQ(O,J0e(p[P]));var D=p.groups;if(c){var T=z0e([m],O,M,s);D!==void 0&&PQ(T,D),x=Bu(R0e(n,void 0,T))}else x=k0e(m,s,M,O,D,n);M>=E&&(I+=hP(s,E,M)+x,E=M+m.length)}return I+hP(s,E)}]},!V0e||!q0e||gP);var W0e=hn,Z0e=pu,X0e=ei,_0e=X0e("match"),$0e=function(t){var e;return W0e(t)&&((e=t[_0e])!==void 0?!!e:Z0e(t)==="RegExp")},eme=$0e,tme=TypeError,GQ=function(t){if(eme(t))throw new tme("The method doesn't accept regular expressions");return t},Ame=ei,rme=Ame("match"),jQ=function(t){var e=/./;try{"/./"[t](e)}catch{try{return e[rme]=!1,"/./"[t](e)}catch{}}return!1},ime=Xi,nme=wv,sme=gf.f,ome=Eh,dP=eo,ame=GQ,cme=ms,ume=jQ,lme=nme("".slice),hme=Math.min,pP=ume("startsWith"),gme=!pP&&!!function(){var t=sme(String.prototype,"startsWith");return t&&!t.writable}();ime({target:"String",proto:!0,forced:!gme&&!pP},{startsWith:function(e){var A=dP(cme(this));ame(e);var r=ome(hme(arguments.length>1?arguments[1]:void 0,A.length)),i=dP(e);return lme(A,r,r+i.length)===i}});var dme=ei,pme=mQ,fme=No.f,YQ=dme("unscopables"),HQ=Array.prototype;HQ[YQ]===void 0&&fme(HQ,YQ,{configurable:!0,value:pme(null)});var Eme=function(t){HQ[YQ][t]=!0},Cme=ir,Ime=!Cme(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Bme=ys,vme=Ir,wme=ov,Sme=Oy,mme=Ime,fP=Sme("IE_PROTO"),zQ=Object,Mme=zQ.prototype,EP=mme?zQ.getPrototypeOf:function(t){var e=wme(t);if(Bme(e,fP))return e[fP];var A=e.constructor;return vme(A)&&e instanceof A?A.prototype:e instanceof zQ?Mme:null},yme=ir,Qme=Ir,Rme=hn,CP=EP,Dme=Eu,Tme=ei,JQ=Tme("iterator"),IP=!1,vu,qQ,VQ;[].keys&&(VQ=[].keys(),"next"in VQ?(qQ=CP(CP(VQ)),qQ!==Object.prototype&&(vu=qQ)):IP=!0);var Ume=!Rme(vu)||yme(function(){var t={};return vu[JQ].call(t)!==t});Ume&&(vu={}),Qme(vu[JQ])||Dme(vu,JQ,function(){return this});var BP={IteratorPrototype:vu,BUGGY_SAFARI_ITERATORS:IP},Lme=BP.IteratorPrototype,Fme=mQ,Ome=ly,bme=Bv,xme=Mf,Nme=function(){return this},Kme=function(t,e,A,r){var i=e+" Iterator";return t.prototype=Fme(Lme,{next:Ome(+!r,A)}),bme(t,i,!1),xme[i]=Nme,t},kme=Xi,Pme=fi,vP=uv,Gme=Ir,jme=Kme,wP=EP,SP=yK,Yme=Bv,Hme=ff,WQ=Eu,zme=ei,Jme=Mf,mP=BP,qme=vP.PROPER,Vme=vP.CONFIGURABLE,MP=mP.IteratorPrototype,jv=mP.BUGGY_SAFARI_ITERATORS,yf=zme("iterator"),yP="keys",Qf="values",QP="entries",Wme=function(){return this},Zme=function(t,e,A,r,i,n,o){jme(A,e,r);var s=function(E){if(E===i&&g)return g;if(!jv&&E&&E in u)return u[E];switch(E){case yP:return function(){return new A(this,E)};case Qf:return function(){return new A(this,E)};case QP:return function(){return new A(this,E)}}return function(){return new A(this)}},a=e+" Iterator",c=!1,u=t.prototype,l=u[yf]||u["@@iterator"]||i&&u[i],g=!jv&&l||s(i),h=e==="Array"&&u.entries||l,p,C,I;if(h&&(p=wP(h.call(new t)),p!==Object.prototype&&p.next&&(wP(p)!==MP&&(SP?SP(p,MP):Gme(p[yf])||WQ(p,yf,Wme)),Yme(p,a,!0))),qme&&i===Qf&&l&&l.name!==Qf&&(Vme?Hme(u,"name",Qf):(c=!0,g=function(){return Pme(l,this)})),i)if(C={values:s(Qf),keys:n?g:s(yP),entries:s(QP)},o)for(I in C)(jv||c||!(I in u))&&WQ(u,I,C[I]);else kme({target:e,proto:!0,forced:jv||c},C);return u[yf]!==g&&WQ(u,yf,g,{name:i}),Jme[e]=g,C},Xme=function(t,e){return{value:t,done:e}},_me=df,ZQ=Eme,RP=Mf,DP=gv,$me=No.f,eMe=Zme,Yv=Xme,tMe=Ss,TP="Array Iterator",AMe=DP.set,rMe=DP.getterFor(TP),iMe=eMe(Array,"Array",function(t,e){AMe(this,{type:TP,target:_me(t),index:0,kind:e})},function(){var t=rMe(this),e=t.target,A=t.index++;if(!e||A>=e.length)return t.target=null,Yv(void 0,!0);switch(t.kind){case"keys":return Yv(A,!1);case"values":return Yv(e[A],!1)}return Yv([A,e[A]],!1)},"values"),UP=RP.Arguments=RP.Array;if(ZQ("keys"),ZQ("values"),ZQ("entries"),tMe&&UP.name!=="values")try{$me(UP,"name",{value:"values"})}catch{}var nMe={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},sMe=av,XQ=sMe("span").classList,LP=XQ&&XQ.constructor&&XQ.constructor.prototype,oMe=LP===Object.prototype?void 0:LP,FP=WA,OP=nMe,aMe=oMe,Rf=iMe,bP=ff,cMe=Bv,uMe=ei,_Q=uMe("iterator"),$Q=Rf.values,xP=function(t,e){if(t){if(t[_Q]!==$Q)try{bP(t,_Q,$Q)}catch{t[_Q]=$Q}if(cMe(t,e,!0),OP[e]){for(var A in Rf)if(t[A]!==Rf[A])try{bP(t,A,Rf[A])}catch{t[A]=Rf[A]}}}};for(var e1 in OP)xP(FP[e1]&&FP[e1].prototype,e1);xP(aMe,"DOMTokenList");function lMe(t,e){if(BA(t)!="object"||!t)return t;var A=t[Symbol.toPrimitive];if(A!==void 0){var r=A.call(t,e||"default");if(BA(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hMe(t){var e=lMe(t,"string");return BA(e)=="symbol"?e:e+""}function t1(t,e,A){return(e=hMe(e))in t?Object.defineProperty(t,e,{value:A,enumerable:!0,configurable:!0,writable:!0}):t[e]=A,t}var gMe=xo,dMe=ov,pMe=b5,fMe=Gy,NP=TypeError,KP="Reduce of empty array with no initial value",kP=function(t){return function(e,A,r,i){var n=dMe(e),o=pMe(n),s=fMe(n);if(gMe(A),s===0&&r<2)throw new NP(KP);var a=t?s-1:0,c=t?-1:1;if(r<2)for(;;){if(a in o){i=o[a],a+=c;break}if(a+=c,t?a<0:s<=a)throw new NP(KP)}for(;t?a>=0:s>a;a+=c)a in o&&(i=A(i,o[a],a,n));return i}},EMe={left:kP(!1),right:kP(!0)},CMe=ir,PP=function(t,e){var A=[][t];return!!A&&CMe(function(){A.call(null,e||function(){return 1},1)})},IMe=Xi,BMe=EMe.left,vMe=PP,GP=Ey,wMe=Iv,SMe=!wMe&&GP>79&&GP<83,mMe=SMe||!vMe("reduce");IMe({target:"Array",proto:!0,forced:mMe},{reduce:function(e){var A=arguments.length;return BMe(this,e,A,A>1?arguments[1]:void 0)}});var MMe=Xi,yMe=wv,QMe=gf.f,RMe=Eh,jP=eo,DMe=GQ,TMe=ms,UMe=jQ,LMe=yMe("".slice),FMe=Math.min,YP=UMe("endsWith"),OMe=!YP&&!!function(){var t=QMe(String.prototype,"endsWith");return t&&!t.writable}();MMe({target:"String",proto:!0,forced:!OMe&&!YP},{endsWith:function(e){var A=jP(TMe(this));DMe(e);var r=arguments.length>1?arguments[1]:void 0,i=A.length,n=r===void 0?i:FMe(RMe(r),i),o=jP(e);return LMe(A,n-o.length,n)===o}});var A1=fi,HP=nr,bMe=UQ,xMe=Zi,NMe=hn,KMe=ms,kMe=xK,PMe=FQ,GMe=Eh,zP=eo,jMe=dh,JP=bQ,YMe=Hk,HMe=ir,yh=YMe.UNSUPPORTED_Y,zMe=4294967295,JMe=Math.min,r1=HP([].push),i1=HP("".slice),qMe=!HMe(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var A="ab".split(t);return A.length!==2||A[0]!=="a"||A[1]!=="b"}),qP="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;bMe("split",function(t,e,A){var r="0".split(void 0,0).length?function(i,n){return i===void 0&&n===0?[]:A1(e,this,i,n)}:e;return[function(n,o){var s=KMe(this),a=NMe(n)?jMe(n,t):void 0;return a?A1(a,n,s,o):A1(r,zP(s),n,o)},function(i,n){var o=xMe(this),s=zP(i);if(!qP){var a=A(r,o,s,n,r!==e);if(a.done)return a.value}var c=kMe(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(yh?"g":"y"),g=new c(yh?"^(?:"+o.source+")":o,l),h=n===void 0?zMe:n>>>0;if(h===0)return[];if(s.length===0)return JP(g,s)===null?[s]:[];for(var p=0,C=0,I=[];C<s.length;){g.lastIndex=yh?0:C;var E=JP(g,yh?i1(s,C):s),v;if(E===null||(v=JMe(GMe(g.lastIndex+(yh?C:0)),s.length))===p)C=PMe(s,C,u);else{if(r1(I,i1(s,p,C)),I.length===h)return I;for(var m=1;m<=E.length-1;m++)if(r1(I,E[m]),I.length===h)return I;C=p=v}}return r1(I,i1(s,p)),I}]},qP||!qMe,yh);var Hv={exports:{}},Df={exports:{}};(function(){var t,e,A,r,i,n;typeof performance<"u"&&performance!==null&&performance.now?Df.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Df.exports=function(){return(t()-i)/1e6},e=process.hrtime,t=function(){var o;return o=e(),o[0]*1e9+o[1]},r=t(),n=process.uptime()*1e9,i=r-n):Date.now?(Df.exports=function(){return Date.now()-A},A=Date.now()):(Df.exports=function(){return new Date().getTime()-A},A=new Date().getTime())}).call(xt);for(var VMe=Df.exports,WMe=VMe,ko=typeof window>"u"?xt:window,zv=["moz","webkit"],Qh="AnimationFrame",Rh=ko["request"+Qh],Tf=ko["cancel"+Qh]||ko["cancelRequest"+Qh],Uf=0;!Rh&&Uf<zv.length;Uf++)Rh=ko[zv[Uf]+"Request"+Qh],Tf=ko[zv[Uf]+"Cancel"+Qh]||ko[zv[Uf]+"CancelRequest"+Qh];if(!Rh||!Tf){var n1=0,VP=0,wu=[],ZMe=1e3/60;Rh=function(t){if(wu.length===0){var e=WMe(),A=Math.max(0,ZMe-(e-n1));n1=A+e,setTimeout(function(){var r=wu.slice(0);wu.length=0;for(var i=0;i<r.length;i++)if(!r[i].cancelled)try{r[i].callback(n1)}catch(n){setTimeout(function(){throw n},0)}},Math.round(A))}return wu.push({handle:++VP,callback:t,cancelled:!1}),VP},Tf=function(t){for(var e=0;e<wu.length;e++)wu[e].handle===t&&(wu[e].cancelled=!0)}}Hv.exports=function(t){return Rh.call(ko,t)},Hv.exports.cancel=function(){Tf.apply(ko,arguments)},Hv.exports.polyfill=function(t){t||(t=ko),t.requestAnimationFrame=Rh,t.cancelAnimationFrame=Tf};var XMe=Hv.exports;const s1=VS(XMe);var WP=`
252
- \v\f\r                 \u2028\u2029\uFEFF`,_Me=nr,$Me=ms,eye=eo,o1=WP,ZP=_Me("".replace),tye=RegExp("^["+o1+"]+"),Aye=RegExp("(^|[^"+o1+"])["+o1+"]+$"),a1=function(t){return function(e){var A=eye($Me(e));return t&1&&(A=ZP(A,tye,"")),t&2&&(A=ZP(A,Aye,"$1")),A}},rye={start:a1(1),end:a1(2),trim:a1(3)},iye=uv.PROPER,nye=ir,XP=WP,_P="​…᠎",sye=function(t){return nye(function(){return!!XP[t]()||_P[t]()!==_P||iye&&XP[t].name!==t})},oye=Xi,aye=rye.trim,cye=sye;oye({target:"String",proto:!0,forced:cye("trim")},{trim:function(){return aye(this)}});var uye=function(t){this.ok=!1,this.alpha=1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=e[t]||t;for(var A=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseFloat(a[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}],r=0;r<A.length;r++){var i=A[r].re,n=A[r].process,o=i.exec(t);if(o){var s=n(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var a=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return a.length==1&&(a="0"+a),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+a+c+u},this.getHelpXML=function(){for(var a=new Array,c=0;c<A.length;c++)for(var u=A[c].example,l=0;l<u.length;l++)a[a.length]=u[l];for(var g in e)a[a.length]=g;var h=document.createElement("ul");h.setAttribute("id","rgbcolor-examples");for(var c=0;c<a.length;c++)try{var p=document.createElement("li"),C=new RGBColor(a[c]),I=document.createElement("div");I.style.cssText="margin: 3px; border: 1px solid black; background:"+C.toHex()+"; color:"+C.toHex(),I.appendChild(document.createTextNode("test"));var E=document.createTextNode(" "+a[c]+" -> "+C.toRGB()+" -> "+C.toHex());p.appendChild(I),p.appendChild(E),h.appendChild(p)}catch{}return h}};const c1=VS(uye);var lye=Xi,hye=wv,gye=IK.indexOf,dye=PP,u1=hye([].indexOf),$P=!!u1&&1/u1([1],1,-0)<0,pye=$P||!dye("indexOf");lye({target:"Array",proto:!0,forced:pye},{indexOf:function(e){var A=arguments.length>1?arguments[1]:void 0;return $P?u1(this,e,A)||0:gye(this,e,A)}});var fye=Xi,Eye=nr,Cye=GQ,Iye=ms,e3=eo,Bye=jQ,vye=Eye("".indexOf);fye({target:"String",proto:!0,forced:!Bye("includes")},{includes:function(e){return!!~vye(e3(Iye(this)),e3(Cye(e)),arguments.length>1?arguments[1]:void 0)}});var wye=pu,Sye=Array.isArray||function(e){return wye(e)==="Array"},mye=Xi,Mye=nr,yye=Sye,Qye=Mye([].reverse),t3=[1,2];mye({target:"Array",proto:!0,forced:String(t3)===String(t3.reverse())},{reverse:function(){return yye(this)&&(this.length=this.length),Qye(this)}});/*! *****************************************************************************
252
+ \v\f\r                 \u2028\u2029\uFEFF`,_Me=nr,$Me=ms,eye=eo,o1=WP,ZP=_Me("".replace),tye=RegExp("^["+o1+"]+"),Aye=RegExp("(^|[^"+o1+"])["+o1+"]+$"),a1=function(t){return function(e){var A=eye($Me(e));return t&1&&(A=ZP(A,tye,"")),t&2&&(A=ZP(A,Aye,"$1")),A}},rye={start:a1(1),end:a1(2),trim:a1(3)},iye=uv.PROPER,nye=ir,XP=WP,_P="​…᠎",sye=function(t){return nye(function(){return!!XP[t]()||_P[t]()!==_P||iye&&XP[t].name!==t})},oye=Xi,aye=rye.trim,cye=sye;oye({target:"String",proto:!0,forced:cye("trim")},{trim:function(){return aye(this)}});var uye=function(t){this.ok=!1,this.alpha=1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t=t.replace(/ /g,""),t=t.toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=e[t]||t;for(var A=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseFloat(a[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}],r=0;r<A.length;r++){var i=A[r].re,n=A[r].process,o=i.exec(t);if(o){var s=n(o);this.r=s[0],this.g=s[1],this.b=s[2],s.length>3&&(this.alpha=s[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var a=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return a.length==1&&(a="0"+a),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+a+c+u},this.getHelpXML=function(){for(var a=new Array,c=0;c<A.length;c++)for(var u=A[c].example,l=0;l<u.length;l++)a[a.length]=u[l];for(var g in e)a[a.length]=g;var h=document.createElement("ul");h.setAttribute("id","rgbcolor-examples");for(var c=0;c<a.length;c++)try{var p=document.createElement("li"),C=new RGBColor(a[c]),I=document.createElement("div");I.style.cssText="margin: 3px; border: 1px solid black; background:"+C.toHex()+"; color:"+C.toHex(),I.appendChild(document.createTextNode("test"));var E=document.createTextNode(" "+a[c]+" -> "+C.toRGB()+" -> "+C.toHex());p.appendChild(I),p.appendChild(E),h.appendChild(p)}catch{}return h}};const c1=VS(uye);var lye=Xi,hye=wv,gye=IK.indexOf,dye=PP,u1=hye([].indexOf),$P=!!u1&&1/u1([1],1,-0)<0,pye=$P||!dye("indexOf");lye({target:"Array",proto:!0,forced:pye},{indexOf:function(e){var A=arguments.length>1?arguments[1]:void 0;return $P?u1(this,e,A)||0:gye(this,e,A)}});var fye=Xi,Eye=nr,Cye=GQ,Iye=ms,eG=eo,Bye=jQ,vye=Eye("".indexOf);fye({target:"String",proto:!0,forced:!Bye("includes")},{includes:function(e){return!!~vye(eG(Iye(this)),eG(Cye(e)),arguments.length>1?arguments[1]:void 0)}});var wye=pu,Sye=Array.isArray||function(e){return wye(e)==="Array"},mye=Xi,Mye=nr,yye=Sye,Qye=Mye([].reverse),tG=[1,2];mye({target:"Array",proto:!0,forced:String(tG)===String(tG.reverse())},{reverse:function(){return yye(this)&&(this.length=this.length),Qye(this)}});/*! *****************************************************************************
253
253
  Copyright (c) Microsoft Corporation.
254
254
 
255
255
  Permission to use, copy, modify, and/or distribute this software for any
@@ -262,5 +262,5 @@ end`};e.events.push(["putFont",function(n){(function(o){var s=o.font,a=o.out,c=o
262
262
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
263
263
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
264
264
  PERFORMANCE OF THIS SOFTWARE.
265
- ***************************************************************************** */var A3=function(t,e){return(A3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,r){A.__proto__=r}||function(A,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(A[i]=r[i])})(t,e)};function r3(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function A(){this.constructor=t}A3(t,e),t.prototype=e===null?Object.create(e):(A.prototype=e.prototype,new A)}function Rye(t){var e="";Array.isArray(t)||(t=[t]);for(var A=0;A<t.length;A++){var r=t[A];if(r.type===ze.CLOSE_PATH)e+="z";else if(r.type===ze.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===ze.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===ze.MOVE_TO)e+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===ze.LINE_TO)e+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===ze.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===ze.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===ze.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===ze.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==ze.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+A+".");e+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return e}function l1(t,e){var A=t[0],r=t[1];return[A*Math.cos(e)-r*Math.sin(e),A*Math.sin(e)+r*Math.cos(e)]}function Qs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var A=0;A<t.length;A++)if(typeof t[A]!="number")throw new Error("assertNumbers arguments["+A+"] is not a number. "+typeof t[A]+" == typeof "+t[A]);return!0}var _a=Math.PI;function h1(t,e,A){t.lArcFlag=t.lArcFlag===0?0:1,t.sweepFlag=t.sweepFlag===0?0:1;var r=t.rX,i=t.rY,n=t.x,o=t.y;r=Math.abs(t.rX),i=Math.abs(t.rY);var s=l1([(e-n)/2,(A-o)/2],-t.xRot/180*_a),a=s[0],c=s[1],u=Math.pow(a,2)/Math.pow(r,2)+Math.pow(c,2)/Math.pow(i,2);1<u&&(r*=Math.sqrt(u),i*=Math.sqrt(u)),t.rX=r,t.rY=i;var l=Math.pow(r,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(a,2),g=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-l)/l)),h=r*c/i*g,p=-i*a/r*g,C=l1([h,p],t.xRot/180*_a);t.cX=C[0]+(e+n)/2,t.cY=C[1]+(A+o)/2,t.phi1=Math.atan2((c-p)/i,(a-h)/r),t.phi2=Math.atan2((-c-p)/i,(-a-h)/r),t.sweepFlag===0&&t.phi2>t.phi1&&(t.phi2-=2*_a),t.sweepFlag===1&&t.phi2<t.phi1&&(t.phi2+=2*_a),t.phi1*=180/_a,t.phi2*=180/_a}function i3(t,e,A){Qs(t,e,A);var r=t*t+e*e-A*A;if(0>r)return[];if(r===0)return[[t*A/(t*t+e*e),e*A/(t*t+e*e)]];var i=Math.sqrt(r);return[[(t*A+e*i)/(t*t+e*e),(e*A-t*i)/(t*t+e*e)],[(t*A-e*i)/(t*t+e*e),(e*A+t*i)/(t*t+e*e)]]}var Rr,Po=Math.PI/180;function n3(t,e,A){return(1-A)*t+A*e}function s3(t,e,A,r){return t+Math.cos(r/180*_a)*e+Math.sin(r/180*_a)*A}function o3(t,e,A,r){var i=1e-6,n=e-t,o=A-e,s=3*n+3*(r-A)-6*o,a=6*(o-n),c=3*n;return Math.abs(s)<i?[-c/a]:function(u,l,g){g===void 0&&(g=1e-6);var h=u*u/4-l;if(h<-g)return[];if(h<=g)return[-u/2];var p=Math.sqrt(h);return[-u/2-p,-u/2+p]}(a/s,c/s,i)}function a3(t,e,A,r,i){var n=1-i;return t*(n*n*n)+e*(3*n*n*i)+A*(3*n*i*i)+r*(i*i*i)}(function(t){function e(){return i(function(s,a,c){return s.relative&&(s.x1!==void 0&&(s.x1+=a),s.y1!==void 0&&(s.y1+=c),s.x2!==void 0&&(s.x2+=a),s.y2!==void 0&&(s.y2+=c),s.x!==void 0&&(s.x+=a),s.y!==void 0&&(s.y+=c),s.relative=!1),s})}function A(){var s=NaN,a=NaN,c=NaN,u=NaN;return i(function(l,g,h){return l.type&ze.SMOOTH_CURVE_TO&&(l.type=ze.CURVE_TO,s=isNaN(s)?g:s,a=isNaN(a)?h:a,l.x1=l.relative?g-s:2*g-s,l.y1=l.relative?h-a:2*h-a),l.type&ze.CURVE_TO?(s=l.relative?g+l.x2:l.x2,a=l.relative?h+l.y2:l.y2):(s=NaN,a=NaN),l.type&ze.SMOOTH_QUAD_TO&&(l.type=ze.QUAD_TO,c=isNaN(c)?g:c,u=isNaN(u)?h:u,l.x1=l.relative?g-c:2*g-c,l.y1=l.relative?h-u:2*h-u),l.type&ze.QUAD_TO?(c=l.relative?g+l.x1:l.x1,u=l.relative?h+l.y1:l.y1):(c=NaN,u=NaN),l})}function r(){var s=NaN,a=NaN;return i(function(c,u,l){if(c.type&ze.SMOOTH_QUAD_TO&&(c.type=ze.QUAD_TO,s=isNaN(s)?u:s,a=isNaN(a)?l:a,c.x1=c.relative?u-s:2*u-s,c.y1=c.relative?l-a:2*l-a),c.type&ze.QUAD_TO){s=c.relative?u+c.x1:c.x1,a=c.relative?l+c.y1:c.y1;var g=c.x1,h=c.y1;c.type=ze.CURVE_TO,c.x1=((c.relative?0:u)+2*g)/3,c.y1=((c.relative?0:l)+2*h)/3,c.x2=(c.x+2*g)/3,c.y2=(c.y+2*h)/3}else s=NaN,a=NaN;return c})}function i(s){var a=0,c=0,u=NaN,l=NaN;return function(g){if(isNaN(u)&&!(g.type&ze.MOVE_TO))throw new Error("path must start with moveto");var h=s(g,a,c,u,l);return g.type&ze.CLOSE_PATH&&(a=u,c=l),g.x!==void 0&&(a=g.relative?a+g.x:g.x),g.y!==void 0&&(c=g.relative?c+g.y:g.y),g.type&ze.MOVE_TO&&(u=a,l=c),h}}function n(s,a,c,u,l,g){return Qs(s,a,c,u,l,g),i(function(h,p,C,I){var E=h.x1,v=h.x2,m=h.relative&&!isNaN(I),M=h.x!==void 0?h.x:m?0:p,O=h.y!==void 0?h.y:m?0:C;function x(U){return U*U}h.type&ze.HORIZ_LINE_TO&&a!==0&&(h.type=ze.LINE_TO,h.y=h.relative?0:C),h.type&ze.VERT_LINE_TO&&c!==0&&(h.type=ze.LINE_TO,h.x=h.relative?0:p),h.x!==void 0&&(h.x=h.x*s+O*c+(m?0:l)),h.y!==void 0&&(h.y=M*a+h.y*u+(m?0:g)),h.x1!==void 0&&(h.x1=h.x1*s+h.y1*c+(m?0:l)),h.y1!==void 0&&(h.y1=E*a+h.y1*u+(m?0:g)),h.x2!==void 0&&(h.x2=h.x2*s+h.y2*c+(m?0:l)),h.y2!==void 0&&(h.y2=v*a+h.y2*u+(m?0:g));var P=s*u-a*c;if(h.xRot!==void 0&&(s!==1||a!==0||c!==0||u!==1))if(P===0)delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag,h.type=ze.LINE_TO;else{var D=h.xRot*Math.PI/180,T=Math.sin(D),q=Math.cos(D),Q=1/x(h.rX),R=1/x(h.rY),G=x(q)*Q+x(T)*R,k=2*T*q*(Q-R),te=x(T)*Q+x(q)*R,X=G*u*u-k*a*u+te*a*a,ie=k*(s*u+a*c)-2*(G*c*u+te*s*a),W=G*c*c-k*s*c+te*s*s,se=(Math.atan2(ie,X-W)+Math.PI)%Math.PI/2,Be=Math.sin(se),Ee=Math.cos(se);h.rX=Math.abs(P)/Math.sqrt(X*x(Ee)+ie*Be*Ee+W*x(Be)),h.rY=Math.abs(P)/Math.sqrt(X*x(Be)-ie*Be*Ee+W*x(Ee)),h.xRot=180*se/Math.PI}return h.sweepFlag!==void 0&&0>P&&(h.sweepFlag=+!h.sweepFlag),h})}function o(){return function(s){var a={};for(var c in s)a[c]=s[c];return a}}t.ROUND=function(s){function a(c){return Math.round(c*s)/s}return s===void 0&&(s=1e13),Qs(s),function(c){return c.x1!==void 0&&(c.x1=a(c.x1)),c.y1!==void 0&&(c.y1=a(c.y1)),c.x2!==void 0&&(c.x2=a(c.x2)),c.y2!==void 0&&(c.y2=a(c.y2)),c.x!==void 0&&(c.x=a(c.x)),c.y!==void 0&&(c.y=a(c.y)),c.rX!==void 0&&(c.rX=a(c.rX)),c.rY!==void 0&&(c.rY=a(c.rY)),c}},t.TO_ABS=e,t.TO_REL=function(){return i(function(s,a,c){return s.relative||(s.x1!==void 0&&(s.x1-=a),s.y1!==void 0&&(s.y1-=c),s.x2!==void 0&&(s.x2-=a),s.y2!==void 0&&(s.y2-=c),s.x!==void 0&&(s.x-=a),s.y!==void 0&&(s.y-=c),s.relative=!0),s})},t.NORMALIZE_HVZ=function(s,a,c){return s===void 0&&(s=!0),a===void 0&&(a=!0),c===void 0&&(c=!0),i(function(u,l,g,h,p){if(isNaN(h)&&!(u.type&ze.MOVE_TO))throw new Error("path must start with moveto");return a&&u.type&ze.HORIZ_LINE_TO&&(u.type=ze.LINE_TO,u.y=u.relative?0:g),c&&u.type&ze.VERT_LINE_TO&&(u.type=ze.LINE_TO,u.x=u.relative?0:l),s&&u.type&ze.CLOSE_PATH&&(u.type=ze.LINE_TO,u.x=u.relative?h-l:h,u.y=u.relative?p-g:p),u.type&ze.ARC&&(u.rX===0||u.rY===0)&&(u.type=ze.LINE_TO,delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag),u})},t.NORMALIZE_ST=A,t.QT_TO_C=r,t.INFO=i,t.SANITIZE=function(s){s===void 0&&(s=0),Qs(s);var a=NaN,c=NaN,u=NaN,l=NaN;return i(function(g,h,p,C,I){var E=Math.abs,v=!1,m=0,M=0;if(g.type&ze.SMOOTH_CURVE_TO&&(m=isNaN(a)?0:h-a,M=isNaN(c)?0:p-c),g.type&(ze.CURVE_TO|ze.SMOOTH_CURVE_TO)?(a=g.relative?h+g.x2:g.x2,c=g.relative?p+g.y2:g.y2):(a=NaN,c=NaN),g.type&ze.SMOOTH_QUAD_TO?(u=isNaN(u)?h:2*h-u,l=isNaN(l)?p:2*p-l):g.type&ze.QUAD_TO?(u=g.relative?h+g.x1:g.x1,l=g.relative?p+g.y1:g.y2):(u=NaN,l=NaN),g.type&ze.LINE_COMMANDS||g.type&ze.ARC&&(g.rX===0||g.rY===0||!g.lArcFlag)||g.type&ze.CURVE_TO||g.type&ze.SMOOTH_CURVE_TO||g.type&ze.QUAD_TO||g.type&ze.SMOOTH_QUAD_TO){var O=g.x===void 0?0:g.relative?g.x:g.x-h,x=g.y===void 0?0:g.relative?g.y:g.y-p;m=isNaN(u)?g.x1===void 0?m:g.relative?g.x:g.x1-h:u-h,M=isNaN(l)?g.y1===void 0?M:g.relative?g.y:g.y1-p:l-p;var P=g.x2===void 0?0:g.relative?g.x:g.x2-h,D=g.y2===void 0?0:g.relative?g.y:g.y2-p;E(O)<=s&&E(x)<=s&&E(m)<=s&&E(M)<=s&&E(P)<=s&&E(D)<=s&&(v=!0)}return g.type&ze.CLOSE_PATH&&E(h-C)<=s&&E(p-I)<=s&&(v=!0),v?[]:g})},t.MATRIX=n,t.ROTATE=function(s,a,c){a===void 0&&(a=0),c===void 0&&(c=0),Qs(s,a,c);var u=Math.sin(s),l=Math.cos(s);return n(l,u,-u,l,a-a*l+c*u,c-a*u-c*l)},t.TRANSLATE=function(s,a){return a===void 0&&(a=0),Qs(s,a),n(1,0,0,1,s,a)},t.SCALE=function(s,a){return a===void 0&&(a=s),Qs(s,a),n(s,0,0,a,0,0)},t.SKEW_X=function(s){return Qs(s),n(1,0,Math.atan(s),1,0,0)},t.SKEW_Y=function(s){return Qs(s),n(1,Math.atan(s),0,1,0,0)},t.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Qs(s),n(-1,0,0,1,s,0)},t.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Qs(s),n(1,0,0,-1,0,s)},t.A_TO_C=function(){return i(function(s,a,c){return ze.ARC===s.type?function(u,l,g){var h,p,C,I;u.cX||h1(u,l,g);for(var E=Math.min(u.phi1,u.phi2),v=Math.max(u.phi1,u.phi2)-E,m=Math.ceil(v/90),M=new Array(m),O=l,x=g,P=0;P<m;P++){var D=n3(u.phi1,u.phi2,P/m),T=n3(u.phi1,u.phi2,(P+1)/m),q=T-D,Q=4/3*Math.tan(q*Po/4),R=[Math.cos(D*Po)-Q*Math.sin(D*Po),Math.sin(D*Po)+Q*Math.cos(D*Po)],G=R[0],k=R[1],te=[Math.cos(T*Po),Math.sin(T*Po)],X=te[0],ie=te[1],W=[X+Q*Math.sin(T*Po),ie-Q*Math.cos(T*Po)],se=W[0],Be=W[1];M[P]={relative:u.relative,type:ze.CURVE_TO};var Ee=function(U,Y){var _=l1([U*u.rX,Y*u.rY],u.xRot),re=_[0],ae=_[1];return[u.cX+re,u.cY+ae]};h=Ee(G,k),M[P].x1=h[0],M[P].y1=h[1],p=Ee(se,Be),M[P].x2=p[0],M[P].y2=p[1],C=Ee(X,ie),M[P].x=C[0],M[P].y=C[1],u.relative&&(M[P].x1-=O,M[P].y1-=x,M[P].x2-=O,M[P].y2-=x,M[P].x-=O,M[P].y-=x),O=(I=[M[P].x,M[P].y])[0],x=I[1]}return M}(s,s.relative?0:a,s.relative?0:c):s})},t.ANNOTATE_ARCS=function(){return i(function(s,a,c){return s.relative&&(a=0,c=0),ze.ARC===s.type&&h1(s,a,c),s})},t.CLONE=o,t.CALCULATE_BOUNDS=function(){var s=function(g){var h={};for(var p in g)h[p]=g[p];return h},a=e(),c=r(),u=A(),l=i(function(g,h,p){var C=u(c(a(s(g))));function I(Be){Be>l.maxX&&(l.maxX=Be),Be<l.minX&&(l.minX=Be)}function E(Be){Be>l.maxY&&(l.maxY=Be),Be<l.minY&&(l.minY=Be)}if(C.type&ze.DRAWING_COMMANDS&&(I(h),E(p)),C.type&ze.HORIZ_LINE_TO&&I(C.x),C.type&ze.VERT_LINE_TO&&E(C.y),C.type&ze.LINE_TO&&(I(C.x),E(C.y)),C.type&ze.CURVE_TO){I(C.x),E(C.y);for(var v=0,m=o3(h,C.x1,C.x2,C.x);v<m.length;v++)0<(se=m[v])&&1>se&&I(a3(h,C.x1,C.x2,C.x,se));for(var M=0,O=o3(p,C.y1,C.y2,C.y);M<O.length;M++)0<(se=O[M])&&1>se&&E(a3(p,C.y1,C.y2,C.y,se))}if(C.type&ze.ARC){I(C.x),E(C.y),h1(C,h,p);for(var x=C.xRot/180*Math.PI,P=Math.cos(x)*C.rX,D=Math.sin(x)*C.rX,T=-Math.sin(x)*C.rY,q=Math.cos(x)*C.rY,Q=C.phi1<C.phi2?[C.phi1,C.phi2]:-180>C.phi2?[C.phi2+360,C.phi1+360]:[C.phi2,C.phi1],R=Q[0],G=Q[1],k=function(Be){var Ee=Be[0],U=Be[1],Y=180*Math.atan2(U,Ee)/Math.PI;return Y<R?Y+360:Y},te=0,X=i3(T,-P,0).map(k);te<X.length;te++)(se=X[te])>R&&se<G&&I(s3(C.cX,P,T,se));for(var ie=0,W=i3(q,-D,0).map(k);ie<W.length;ie++){var se;(se=W[ie])>R&&se<G&&E(s3(C.cY,D,q,se))}}return g});return l.minX=1/0,l.maxX=-1/0,l.minY=1/0,l.maxY=-1/0,l}})(Rr||(Rr={}));var Rs,c3=function(){function t(){}return t.prototype.round=function(e){return this.transform(Rr.ROUND(e))},t.prototype.toAbs=function(){return this.transform(Rr.TO_ABS())},t.prototype.toRel=function(){return this.transform(Rr.TO_REL())},t.prototype.normalizeHVZ=function(e,A,r){return this.transform(Rr.NORMALIZE_HVZ(e,A,r))},t.prototype.normalizeST=function(){return this.transform(Rr.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(Rr.QT_TO_C())},t.prototype.aToC=function(){return this.transform(Rr.A_TO_C())},t.prototype.sanitize=function(e){return this.transform(Rr.SANITIZE(e))},t.prototype.translate=function(e,A){return this.transform(Rr.TRANSLATE(e,A))},t.prototype.scale=function(e,A){return this.transform(Rr.SCALE(e,A))},t.prototype.rotate=function(e,A,r){return this.transform(Rr.ROTATE(e,A,r))},t.prototype.matrix=function(e,A,r,i,n,o){return this.transform(Rr.MATRIX(e,A,r,i,n,o))},t.prototype.skewX=function(e){return this.transform(Rr.SKEW_X(e))},t.prototype.skewY=function(e){return this.transform(Rr.SKEW_Y(e))},t.prototype.xSymmetry=function(e){return this.transform(Rr.X_AXIS_SYMMETRY(e))},t.prototype.ySymmetry=function(e){return this.transform(Rr.Y_AXIS_SYMMETRY(e))},t.prototype.annotateArcs=function(){return this.transform(Rr.ANNOTATE_ARCS())},t}(),Dye=function(t){return t===" "||t===" "||t==="\r"||t===`
266
- `},u3=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},Tye=function(t){function e(){var A=t.call(this)||this;return A.curNumber="",A.curCommandType=-1,A.curCommandRelative=!1,A.canParseCommandOrComma=!0,A.curNumberHasExp=!1,A.curNumberHasExpDigits=!1,A.curNumberHasDecimal=!1,A.curArgs=[],A}return r3(e,t),e.prototype.finish=function(A){if(A===void 0&&(A=[]),this.parse(" ",A),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return A},e.prototype.parse=function(A,r){var i=this;r===void 0&&(r=[]);for(var n=function(l){r.push(l),i.curArgs.length=0,i.canParseCommandOrComma=!0},o=0;o<A.length;o++){var s=A[o],a=!(this.curCommandType!==ze.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),c=u3(s)&&(this.curNumber==="0"&&s==="0"||a);if(!u3(s)||c)if(s!=="e"&&s!=="E")if(s!=="-"&&s!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(s!=="."||this.curNumberHasExp||this.curNumberHasDecimal||a){if(this.curNumber&&this.curCommandType!==-1){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===ze.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(u),this.curArgs.length===Uye[this.curCommandType]&&(ze.HORIZ_LINE_TO===this.curCommandType?n({type:ze.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):ze.VERT_LINE_TO===this.curCommandType?n({type:ze.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===ze.MOVE_TO||this.curCommandType===ze.LINE_TO||this.curCommandType===ze.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),ze.MOVE_TO===this.curCommandType&&(this.curCommandType=ze.LINE_TO)):this.curCommandType===ze.CURVE_TO?n({type:ze.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===ze.SMOOTH_CURVE_TO?n({type:ze.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ze.QUAD_TO?n({type:ze.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ze.ARC&&n({type:ze.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Dye(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(c)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=ze.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=ze.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=ze.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=ze.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=ze.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=ze.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=ze.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=ze.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=ze.ARC,this.curCommandRelative=s==="a"}else r.push({type:ze.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(A){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var n=0,o=Object.getPrototypeOf(this).parse.call(this,r);n<o.length;n++){var s=o[n],a=A(s);Array.isArray(a)?i.push.apply(i,a):i.push(a)}return i}}})},e}(c3),ze=function(t){function e(A){var r=t.call(this)||this;return r.commands=typeof A=="string"?e.parse(A):A,r}return r3(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var A=Rr.CALCULATE_BOUNDS();return this.transform(A),A},e.prototype.transform=function(A){for(var r=[],i=0,n=this.commands;i<n.length;i++){var o=A(n[i]);Array.isArray(o)?r.push.apply(r,o):r.push(o)}return this.commands=r,this},e.encode=function(A){return Rye(A)},e.parse=function(A){var r=new Tye,i=[];return r.parse(A,i),r.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(c3),Uye=((Rs={})[ze.MOVE_TO]=2,Rs[ze.LINE_TO]=2,Rs[ze.HORIZ_LINE_TO]=1,Rs[ze.VERT_LINE_TO]=1,Rs[ze.CLOSE_PATH]=0,Rs[ze.QUAD_TO]=4,Rs[ze.SMOOTH_QUAD_TO]=2,Rs[ze.CURVE_TO]=6,Rs[ze.SMOOTH_CURVE_TO]=4,Rs[ze.ARC]=7,Rs),Lye=uv.PROPER,Fye=Eu,Oye=Zi,l3=eo,bye=ir,xye=OQ,g1="toString",h3=RegExp.prototype,g3=h3[g1],Nye=bye(function(){return g3.call({source:"a",flags:"b"})!=="/a/b"}),Kye=Lye&&g3.name!==g1;(Nye||Kye)&&Fye(h3,g1,function(){var e=Oye(this),A=l3(e.source),r=l3(xye(e));return"/"+A+"/"+r},{unsafe:!0});function Jv(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jv=function(e){return typeof e}:Jv=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jv(t)}function kye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Pye=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Gye=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function jye(t,e,A,r,i){if(typeof t=="string"&&(t=document.getElementById(t)),!t||Jv(t)!=="object"||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var n=t.getContext("2d");try{return n.getImageData(e,A,r,i)}catch(o){throw new Error("unable to access image data: "+o)}}function Yye(t,e,A,r,i,n){if(!(isNaN(n)||n<1)){n|=0;var o=jye(t,e,A,r,i);o=Hye(o,e,A,r,i,n),t.getContext("2d").putImageData(o,e,A)}}function Hye(t,e,A,r,i,n){for(var o=t.data,s=2*n+1,a=r-1,c=i-1,u=n+1,l=u*(u+1)/2,g=new d3,h=g,p,C=1;C<s;C++)h=h.next=new d3,C===u&&(p=h);h.next=g;for(var I=null,E=null,v=0,m=0,M=Pye[n],O=Gye[n],x=0;x<i;x++){h=g;for(var P=o[m],D=o[m+1],T=o[m+2],q=o[m+3],Q=0;Q<u;Q++)h.r=P,h.g=D,h.b=T,h.a=q,h=h.next;for(var R=0,G=0,k=0,te=0,X=u*P,ie=u*D,W=u*T,se=u*q,Be=l*P,Ee=l*D,U=l*T,Y=l*q,_=1;_<u;_++){var re=m+((a<_?a:_)<<2),ae=o[re],Z=o[re+1],ce=o[re+2],oe=o[re+3],de=u-_;Be+=(h.r=ae)*de,Ee+=(h.g=Z)*de,U+=(h.b=ce)*de,Y+=(h.a=oe)*de,R+=ae,G+=Z,k+=ce,te+=oe,h=h.next}I=g,E=p;for(var De=0;De<r;De++){var j=Y*M>>>O;if(o[m+3]=j,j!==0){var J=255/j;o[m]=(Be*M>>>O)*J,o[m+1]=(Ee*M>>>O)*J,o[m+2]=(U*M>>>O)*J}else o[m]=o[m+1]=o[m+2]=0;Be-=X,Ee-=ie,U-=W,Y-=se,X-=I.r,ie-=I.g,W-=I.b,se-=I.a;var z=De+n+1;z=v+(z<a?z:a)<<2,R+=I.r=o[z],G+=I.g=o[z+1],k+=I.b=o[z+2],te+=I.a=o[z+3],Be+=R,Ee+=G,U+=k,Y+=te,I=I.next;var b=E,Me=b.r,Qe=b.g,Te=b.b,Ce=b.a;X+=Me,ie+=Qe,W+=Te,se+=Ce,R-=Me,G-=Qe,k-=Te,te-=Ce,E=E.next,m+=4}v+=r}for(var Re=0;Re<r;Re++){m=Re<<2;var ve=o[m],Ke=o[m+1],Ue=o[m+2],ke=o[m+3],Ye=u*ve,Je=u*Ke,rt=u*Ue,Ze=u*ke,We=l*ve,At=l*Ke,_e=l*Ue,It=l*ke;h=g;for(var yt=0;yt<u;yt++)h.r=ve,h.g=Ke,h.b=Ue,h.a=ke,h=h.next;for(var tt=r,et=0,St=0,ct=0,Rt=0,Ge=1;Ge<=n;Ge++){m=tt+Re<<2;var Jt=u-Ge;We+=(h.r=ve=o[m])*Jt,At+=(h.g=Ke=o[m+1])*Jt,_e+=(h.b=Ue=o[m+2])*Jt,It+=(h.a=ke=o[m+3])*Jt,Rt+=ve,et+=Ke,St+=Ue,ct+=ke,h=h.next,Ge<c&&(tt+=r)}m=Re,I=g,E=p;for(var oA=0;oA<i;oA++){var Qt=m<<2;o[Qt+3]=ke=It*M>>>O,ke>0?(ke=255/ke,o[Qt]=(We*M>>>O)*ke,o[Qt+1]=(At*M>>>O)*ke,o[Qt+2]=(_e*M>>>O)*ke):o[Qt]=o[Qt+1]=o[Qt+2]=0,We-=Ye,At-=Je,_e-=rt,It-=Ze,Ye-=I.r,Je-=I.g,rt-=I.b,Ze-=I.a,Qt=Re+((Qt=oA+u)<c?Qt:c)*r<<2,We+=Rt+=I.r=o[Qt],At+=et+=I.g=o[Qt+1],_e+=St+=I.b=o[Qt+2],It+=ct+=I.a=o[Qt+3],I=I.next,Ye+=ve=E.r,Je+=Ke=E.g,rt+=Ue=E.b,Ze+=ke=E.a,Rt-=ve,et-=Ke,St-=Ue,ct-=ke,E=E.next,m+=r}}return t}var d3=function t(){kye(this,t),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function zye(){var{DOMParser:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas(A,r){return new OffscreenCanvas(A,r)},createImage(A){return Ko(function*(){var r=yield fetch(A),i=yield r.blob(),n=yield createImageBitmap(i);return n})()}};return(typeof DOMParser<"u"||typeof t>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function Jye(t){var{DOMParser:e,canvas:A,fetch:r}=t;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:A.createCanvas,createImage:A.loadImage}}var qye=Object.freeze({__proto__:null,offscreen:zye,node:Jye});function Su(t){return t.replace(/(?!\u3000)\s+/gm," ")}function p3(t){return t.replace(/^[\n \t]+/,"")}function f3(t){return t.replace(/[\n \t]+$/,"")}function gn(t){var e=(t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var Vye=/^[A-Z-]+$/;function E3(t){return Vye.test(t)?t.toLowerCase():t}function d1(t){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t)||[];return e[2]||e[3]||e[4]}function C3(t){if(!t.startsWith("rgb"))return t;var e=3,A=t.replace(/\d+(\.\d+)?/g,(r,i)=>e--&&i?String(Math.round(parseFloat(r))):r);return A}var Wye=/(\[[^\]]+\])/g,Zye=/(#[^\s+>~.[:]+)/g,Xye=/(\.[^\s+>~.[:]+)/g,_ye=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,$ye=/(:[\w-]+\([^)]*\))/gi,eQe=/(:[^\s+>~.[:]+)/g,tQe=/([^\s+>~.[:]+)/g;function mu(t,e){var A=e.exec(t);return A?[t.replace(e," "),A.length]:[t,0]}function I3(t){var e=[0,0,0],A=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[A,r]=mu(A,Wye),e[1]+=r,[A,r]=mu(A,Zye),e[0]+=r,[A,r]=mu(A,Xye),e[1]+=r,[A,r]=mu(A,_ye),e[2]+=r,[A,r]=mu(A,$ye),e[1]+=r,[A,r]=mu(A,eQe),e[1]+=r,A=A.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[A,r]=mu(A,tQe),e[2]+=r,e.join("")}var Mu=1e-8;function p1(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function qv(t,e){return(t[0]*e[0]+t[1]*e[1])/(p1(t)*p1(e))}function f1(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(qv(t,e))}function E1(t){return t*t*t}function C1(t){return 3*t*t*(1-t)}function I1(t){return 3*t*(1-t)*(1-t)}function B1(t){return(1-t)*(1-t)*(1-t)}function v1(t){return t*t}function w1(t){return 2*t*(1-t)}function S1(t){return(1-t)*(1-t)}class wt{constructor(e,A,r){this.document=e,this.name=A,this.value=r,this.isNormalizedColor=!1}static empty(e){return new wt(e,"EMPTY","")}split(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:A,name:r}=this;return Su(this.getString()).trim().split(e).map(i=>new wt(A,r,i))}hasValue(e){var{value:A}=this;return A!==null&&A!==""&&(e||A!==0)&&typeof A<"u"}isString(e){var{value:A}=this,r=typeof A=="string";return!r||!e?r:e.test(A)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:A}=this,r=parseFloat(A);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var A=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,A=C3(A),this.value=A),A}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(r);default:{var o=this.getNumber();return A&&o<1?o*n.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),A=/#([^)'"]+)/.exec(e);return A&&(A=A[1]),A||(A=e),this.document.definitions[A]}getFillStyleDefinition(e,A){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,A);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,A)}return null}getTextBaseline(){return this.hasValue()?wt.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var A=this.getColor(),r=A.length,i=0,n=0;n<r&&(A[n]===","&&i++,i!==3);n++);if(e.hasValue()&&this.isString()&&i!==3){var o=new c1(A);o.ok&&(o.alpha=e.getNumber(),A=o.toRGBA())}return new wt(this.document,this.name,A)}}wt.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class B3{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,A){this.viewPorts.push({width:e,height:A})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class sr{constructor(e,A){this.x=e,this.y=A}static parse(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[r=A,i=A]=gn(e);return new sr(r,i)}static parseScale(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=A,i=r]=gn(e);return new sr(r,i)}static parsePath(e){for(var A=gn(e),r=A.length,i=[],n=0;n<r;n+=2)i.push(new sr(A[n],A[n+1]));return i}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:A,y:r}=this,i=A*e[0]+r*e[2]+e[4],n=A*e[1]+r*e[3]+e[5];this.x=i,this.y=n}}class v3{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:A,onMouseMove:r}=this,i=e.ctx.canvas;i.onclick=A,i.onmousemove=r,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:A,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),A.forEach((n,o)=>{for(var{run:s}=n,a=r[o];a;)s(a),a=a.parent}),this.events=[],this.eventElements=[]}}checkPath(e,A){if(!(!this.working||!A)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:a}=n;!i[o]&&A.isPointInPath&&A.isPointInPath(s,a)&&(i[o]=e)})}}checkBoundingBox(e,A){if(!(!this.working||!A)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:a}=n;!i[o]&&A.isPointInBox(s,a)&&(i[o]=e)})}}mapXY(e,A){for(var{window:r,ctx:i}=this.screen,n=new sr(e,A),o=i.canvas;o;)n.x-=o.offsetLeft,n.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(n.x+=r.scrollX),r.scrollY&&(n.y+=r.scrollY),n}onClick(e){var{x:A,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:A,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:A,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:A,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var w3=typeof window<"u"?window:null,S3=typeof fetch<"u"?fetch.bind(void 0):null;class Lf{constructor(e){var{fetch:A=S3,window:r=w3}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new B3,this.mouse=new v3(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=A}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(A=>A());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:A,ctx:r,aspectRatio:i,width:n,desiredWidth:o,height:s,desiredHeight:a,minX:c=0,minY:u=0,refX:l,refY:g,clip:h=!1,clipX:p=0,clipY:C=0}=e,I=Su(i).replace(/^defer\s/,""),[E,v]=I.split(" "),m=E||"xMidYMid",M=v||"meet",O=n/o,x=s/a,P=Math.min(O,x),D=Math.max(O,x),T=o,q=a;M==="meet"&&(T*=P,q*=P),M==="slice"&&(T*=D,q*=D);var Q=new wt(A,"refX",l),R=new wt(A,"refY",g),G=Q.hasValue()&&R.hasValue();if(G&&r.translate(-P*Q.getPixels("x"),-P*R.getPixels("y")),h){var k=P*p,te=P*C;r.beginPath(),r.moveTo(k,te),r.lineTo(n,te),r.lineTo(n,s),r.lineTo(k,s),r.closePath(),r.clip()}if(!G){var X=M==="meet"&&P===x,ie=M==="slice"&&D===x,W=M==="meet"&&P===O,se=M==="slice"&&D===O;m.startsWith("xMid")&&(X||ie)&&r.translate(n/2-T/2,0),m.endsWith("YMid")&&(W||se)&&r.translate(0,s/2-q/2),m.startsWith("xMax")&&(X||ie)&&r.translate(n-T,0),m.endsWith("YMax")&&(W||se)&&r.translate(0,s-q)}switch(!0){case m==="none":r.scale(O,x);break;case M==="meet":r.scale(P,P);break;case M==="slice":r.scale(D,D);break}r.translate(-c,-u)}start(e){var{enableRedraw:A=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:n=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:a,scaleHeight:c,offsetX:u,offsetY:l}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:g,mouse:h}=this,p=1e3/g;if(this.frameDuration=p,this.readyPromise=new Promise(m=>{this.resolveReady=m}),this.isReady()&&this.render(e,n,o,a,c,u,l),!!A){var C=Date.now(),I=C,E=0,v=()=>{C=Date.now(),E=C-I,E>=p&&(I=C-E%p,this.shouldUpdate(i,s)&&(this.render(e,n,o,a,c,u,l),h.runEvents())),this.intervalId=s1(v)};r||h.start(),this.intervalId=s1(v)}}stop(){this.intervalId&&(s1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,A){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((n,o)=>o.update(r)||n,!1);if(i)return!0}return!!(typeof A=="function"&&A()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,A,r,i,n,o,s){var{CLIENT_WIDTH:a,CLIENT_HEIGHT:c,viewPort:u,ctx:l,isFirstRender:g}=this,h=l.canvas;u.clear(),h.width&&h.height?u.setCurrent(h.width,h.height):u.setCurrent(a,c);var p=e.getStyle("width"),C=e.getStyle("height");!A&&(g||typeof i!="number"&&typeof n!="number")&&(p.hasValue()&&(h.width=p.getPixels("x"),h.style&&(h.style.width="".concat(h.width,"px"))),C.hasValue()&&(h.height=C.getPixels("y"),h.style&&(h.style.height="".concat(h.height,"px"))));var I=h.clientWidth||h.width,E=h.clientHeight||h.height;if(A&&p.hasValue()&&C.hasValue()&&(I=p.getPixels("x"),E=C.getPixels("y")),u.setCurrent(I,E),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof n=="number"){var v=gn(e.getAttribute("viewBox").getString()),m=0,M=0;if(typeof i=="number"){var O=e.getStyle("width");O.hasValue()?m=O.getPixels("x")/i:isNaN(v[2])||(m=v[2]/i)}if(typeof n=="number"){var x=e.getStyle("height");x.hasValue()?M=x.getPixels("y")/n:isNaN(v[3])||(M=v[3]/n)}m||(m=M),M||(M=m),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(n);var P=e.getStyle("transform",!0,!0);P.setValue("".concat(P.getString()," scale(").concat(1/m,", ").concat(1/M,")"))}r||l.clearRect(0,0,I,E),e.render(l),g&&(this.isFirstRender=!1)}}Lf.defaultWindow=w3,Lf.defaultFetch=S3;var{defaultFetch:AQe}=Lf,rQe=typeof DOMParser<"u"?DOMParser:null;class Vv{constructor(){var{fetch:e=AQe,DOMParser:A=rQe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=A}parse(e){var A=this;return Ko(function*(){return e.startsWith("<")?A.parseFromString(e):A.load(e)})()}parseFromString(e){var A=new this.DOMParser;try{return this.checkDocument(A.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(A.parseFromString(e,"text/xml"))}}checkDocument(e){var A=e.getElementsByTagName("parsererror")[0];if(A)throw new Error(A.textContent);return e}load(e){var A=this;return Ko(function*(){var r=yield A.fetch(e),i=yield r.text();return A.parseFromString(i)})()}}class m3{constructor(e,A){this.type="translate",this.point=null,this.point=sr.parse(A)}apply(e){var{x:A,y:r}=this.point;e.translate(A||0,r||0)}unapply(e){var{x:A,y:r}=this.point;e.translate(-1*A||0,-1*r||0)}applyToPoint(e){var{x:A,y:r}=this.point;e.applyTransform([1,0,0,1,A||0,r||0])}}class M3{constructor(e,A,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=gn(A);this.angle=new wt(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:A,cy:r,originX:i,originY:n,angle:o}=this,s=A+i.getPixels("x"),a=r+n.getPixels("y");e.translate(s,a),e.rotate(o.getRadians()),e.translate(-s,-a)}unapply(e){var{cx:A,cy:r,originX:i,originY:n,angle:o}=this,s=A+i.getPixels("x"),a=r+n.getPixels("y");e.translate(s,a),e.rotate(-1*o.getRadians()),e.translate(-s,-a)}applyToPoint(e){var{cx:A,cy:r,angle:i}=this,n=i.getRadians();e.applyTransform([1,0,0,1,A||0,r||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-A||0,-r||0])}}class y3{constructor(e,A,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=sr.parseScale(A);(i.x===0||i.y===0)&&(i.x=Mu,i.y=Mu),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:A,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(A,r||A),e.translate(-o,-s)}unapply(e){var{scale:{x:A,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(1/A,1/r||A),e.translate(-o,-s)}applyToPoint(e){var{x:A,y:r}=this.scale;e.applyTransform([A||0,0,0,r||0,0,0])}}class m1{constructor(e,A,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=gn(A),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:A,originY:r,matrix:i}=this,n=A.getPixels("x"),o=r.getPixels("y");e.translate(n,o),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-n,-o)}unapply(e){var{originX:A,originY:r,matrix:i}=this,n=i[0],o=i[2],s=i[4],a=i[1],c=i[3],u=i[5],l=0,g=0,h=1,p=1/(n*(c*h-u*g)-o*(a*h-u*l)+s*(a*g-c*l)),C=A.getPixels("x"),I=r.getPixels("y");e.translate(C,I),e.transform(p*(c*h-u*g),p*(u*l-a*h),p*(s*g-o*h),p*(n*h-s*l),p*(o*u-s*c),p*(s*a-n*u)),e.translate(-C,-I)}applyToPoint(e){e.applyTransform(this.matrix)}}class M1 extends m1{constructor(e,A,r){super(e,A,r),this.type="skew",this.angle=null,this.angle=new wt(e,"angle",A)}}class Q3 extends M1{constructor(e,A,r){super(e,A,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class R3 extends M1{constructor(e,A,r){super(e,A,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function iQe(t){return Su(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function nQe(t){var[e,A]=t.split("(");return[e.trim(),A.trim().replace(")","")]}class $a{constructor(e,A,r){this.document=e,this.transforms=[];var i=iQe(A);i.forEach(n=>{if(n!=="none"){var[o,s]=nQe(n),a=$a.transformTypes[o];typeof a<"u"&&this.transforms.push(new a(this.document,s,r))}})}static fromElement(e,A){var r=A.getStyle("transform",!1,!0),[i,n=i]=A.getStyle("transform-origin",!1,!0).split(),o=[i,n];return r.hasValue()?new $a(e,r.getString(),o):null}apply(e){for(var{transforms:A}=this,r=A.length,i=0;i<r;i++)A[i].apply(e)}unapply(e){for(var{transforms:A}=this,r=A.length,i=r-1;i>=0;i--)A[i].unapply(e)}applyToPoint(e){for(var{transforms:A}=this,r=A.length,i=0;i<r;i++)A[i].applyToPoint(e)}}$a.transformTypes={translate:m3,rotate:M3,scale:y3,matrix:m1,skewX:Q3,skewY:R3};let XA=class dR{constructor(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=A,this.captureTextNodes=r,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!A||A.nodeType!==1)){if(Array.from(A.attributes).forEach(s=>{var a=E3(s.nodeName);this.attributes[a]=new wt(e,a,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(s){var[a,c]=s.split(":").map(u=>u.trim());this.styles[a]=new wt(e,a,c)}})}var{definitions:n}=e,o=this.getAttribute("id");o.hasValue()&&(n[o.getString()]||(n[o.getString()]=this)),Array.from(A.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var a=e.createTextNode(s);a.getText().length>0&&this.addChild(a)}})}}getAttribute(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&A){var i=new wt(this.document,e,"");return this.attributes[e]=i,i}return r||wt.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return wt.empty(this.document)}getStyle(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var n=this.getAttribute(e);if(n!=null&&n.hasValue())return this.styles[e]=n,n;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(e);if(s!=null&&s.hasValue())return s}}if(A){var a=new wt(this.document,e,"");return this.styles[e]=a,a}return i||wt.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var A=this.getStyle("mask").getDefinition();A&&(this.applyEffects(e),A.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var A=$a.fromElement(this.document,this);A&&A.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(A=>{A.render(e)})}addChild(e){var A=e instanceof dR?e:this.document.createElement(e);A.parent=this,dR.ignoreChildTypes.includes(A.type)||this.children.push(A)}matchesSelector(e){var A,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(A=r.getAttribute)===null||A===void 0?void 0:A.call(r,"class");return!i||i===""?!1:i.split(" ").some(n=>".".concat(n)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:A}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],n=A[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),n>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=n)}}}removeStyles(e,A){var r=A.reduce((i,n)=>{var o=e.getStyle(n);if(!o.hasValue())return i;var s=o.getString();return o.setValue(""),[...i,[n,s]]},[]);return r}restoreStyles(e,A){A.forEach(r=>{var[i,n]=r;e.getStyle(i,!0).setValue(n)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}};XA.ignoreChildTypes=["title"];class D3 extends XA{constructor(e,A,r){super(e,A,r)}}function sQe(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function oQe(t){return typeof process>"u"?t:t.trim().split(",").map(sQe).join(",")}function aQe(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function cQe(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class xi{constructor(e,A,r,i,n,o){var s=o?typeof o=="string"?xi.parse(o):o:{};this.fontFamily=n||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=A||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,r="",i="",n="",o="",s="",a=Su(e).trim().split(" "),c={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return a.forEach(u=>{switch(!0){case(!c.fontStyle&&xi.styles.includes(u)):u!=="inherit"&&(r=u),c.fontStyle=!0;break;case(!c.fontVariant&&xi.variants.includes(u)):u!=="inherit"&&(i=u),c.fontStyle=!0,c.fontVariant=!0;break;case(!c.fontWeight&&xi.weights.includes(u)):u!=="inherit"&&(n=u),c.fontStyle=!0,c.fontVariant=!0,c.fontWeight=!0;break;case!c.fontSize:u!=="inherit"&&([o]=u.split("/")),c.fontStyle=!0,c.fontVariant=!0,c.fontWeight=!0,c.fontSize=!0;break;default:u!=="inherit"&&(s+=u)}}),new xi(r,i,n,o,s,A)}toString(){return[aQe(this.fontStyle),this.fontVariant,cQe(this.fontWeight),this.fontSize,oQe(this.fontFamily)].join(" ").trim()}}xi.styles="normal|italic|oblique|inherit",xi.variants="normal|small-caps|inherit",xi.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class es{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=A,this.x2=r,this.y2=i,this.addPoint(e,A),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,A){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof A<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=A,this.y2=A),A<this.y1&&(this.y1=A),A>this.y2&&(this.y2=A))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:A,y1:r,x2:i,y2:n}=e;this.addPoint(A,r),this.addPoint(i,n)}}sumCubic(e,A,r,i,n){return Math.pow(1-e,3)*A+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*n}bezierCurveAdd(e,A,r,i,n){var o=6*A-12*r+6*i,s=-3*A+9*r-9*i+3*n,a=3*r-3*A;if(s===0){if(o===0)return;var c=-a/o;0<c&&c<1&&(e?this.addX(this.sumCubic(c,A,r,i,n)):this.addY(this.sumCubic(c,A,r,i,n)));return}var u=Math.pow(o,2)-4*a*s;if(!(u<0)){var l=(-o+Math.sqrt(u))/(2*s);0<l&&l<1&&(e?this.addX(this.sumCubic(l,A,r,i,n)):this.addY(this.sumCubic(l,A,r,i,n)));var g=(-o-Math.sqrt(u))/(2*s);0<g&&g<1&&(e?this.addX(this.sumCubic(g,A,r,i,n)):this.addY(this.sumCubic(g,A,r,i,n)))}}addBezierCurve(e,A,r,i,n,o,s,a){this.addPoint(e,A),this.addPoint(s,a),this.bezierCurveAdd(!0,e,r,n,s),this.bezierCurveAdd(!1,A,i,o,a)}addQuadraticCurve(e,A,r,i,n,o){var s=e+.6666666666666666*(r-e),a=A+2/3*(i-A),c=s+1/3*(n-e),u=a+1/3*(o-A);this.addBezierCurve(e,A,s,c,a,u,n,o)}isPointInBox(e,A){var{x1:r,y1:i,x2:n,y2:o}=this;return r<=e&&e<=n&&i<=A&&A<=o}}class jt extends ze{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new sr(0,0),this.control=new sr(0,0),this.current=new sr(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:A}=this;return e>=A.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new sr(this.command[e],this.command[A]);return this.makeAbsolute(r)}getAsControlPoint(e,A){var r=this.getPoint(e,A);return this.control=r,r}getAsCurrentPoint(e,A){var r=this.getPoint(e,A);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==ze.CURVE_TO&&e!==ze.SMOOTH_CURVE_TO&&e!==ze.QUAD_TO&&e!==ze.SMOOTH_QUAD_TO)return this.current;var{current:{x:A,y:r},control:{x:i,y:n}}=this,o=new sr(2*A-i,2*r-n);return o}makeAbsolute(e){if(this.command.relative){var{x:A,y:r}=this.current;e.x+=A,e.y+=r}return e}addMarker(e,A,r){var{points:i,angles:n}=this;r&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,A?A.angleTo(e):null)}addMarkerAngle(e,A){this.points.push(e),this.angles.push(A)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,A=e.length,r=0;r<A;r++)if(!e[r]){for(var i=r+1;i<A;i++)if(e[i]){e[r]=e[i];break}}return e}}class ec extends XA{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,A=this;A;){var r=A.getStyle("opacity",!1,!0);r.hasValue(!0)&&(e*=r.getNumber()),A=A.parent}return e}setContext(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!A){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var a=r.getColor();a!=="inherit"&&(e.fillStyle=a==="none"?"rgba(0,0,0,0)":a)}if(i.hasValue()){var c=new wt(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=c}if(n.isUrlDefinition()){var u=n.getFillStyleDefinition(this,o);u&&(e.strokeStyle=u)}else if(n.hasValue()){n.getString()==="currentColor"&&n.setValue(this.getStyle("color").getColor());var l=n.getString();l!=="inherit"&&(e.strokeStyle=l==="none"?"rgba(0,0,0,0)":l)}if(o.hasValue()){var g=new wt(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=g}var h=this.getStyle("stroke-width");if(h.hasValue()){var p=h.getPixels();e.lineWidth=p||Mu}var C=this.getStyle("stroke-linecap"),I=this.getStyle("stroke-linejoin"),E=this.getStyle("stroke-miterlimit"),v=this.getStyle("stroke-dasharray"),m=this.getStyle("stroke-dashoffset");if(C.hasValue()&&(e.lineCap=C.getString()),I.hasValue()&&(e.lineJoin=I.getString()),E.hasValue()&&(e.miterLimit=E.getNumber()),v.hasValue()&&v.getString()!=="none"){var M=gn(v.getString());typeof e.setLineDash<"u"?e.setLineDash(M):typeof e.webkitLineDash<"u"?e.webkitLineDash=M:typeof e.mozDash<"u"&&!(M.length===1&&M[0]===0)&&(e.mozDash=M);var O=m.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=O:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=O:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=O)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var x=this.getStyle("font"),P=this.getStyle("font-style"),D=this.getStyle("font-variant"),T=this.getStyle("font-weight"),q=this.getStyle("font-size"),Q=this.getStyle("font-family"),R=new xi(P.getString(),D.getString(),T.getString(),q.hasValue()?"".concat(q.getPixels(!0),"px"):"",Q.getString(),xi.parse(x.getString(),e.font));P.setValue(R.fontStyle),D.setValue(R.fontVariant),T.setValue(R.fontWeight),q.setValue(R.fontSize),Q.setValue(R.fontFamily),e.font=R.toString(),q.isPixels()&&(this.document.emSize=q.getPixels(),this.modifiedEmSizeStack=!0)}A||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class MA extends ec{constructor(e,A,r){super(e,A,r),this.type="path",this.pathParser=null,this.pathParser=new jt(this.getAttribute("d").getString())}path(e){var{pathParser:A}=this,r=new es;for(A.reset(),e&&e.beginPath();!A.isEnd();)switch(A.next().type){case jt.MOVE_TO:this.pathM(e,r);break;case jt.LINE_TO:this.pathL(e,r);break;case jt.HORIZ_LINE_TO:this.pathH(e,r);break;case jt.VERT_LINE_TO:this.pathV(e,r);break;case jt.CURVE_TO:this.pathC(e,r);break;case jt.SMOOTH_CURVE_TO:this.pathS(e,r);break;case jt.QUAD_TO:this.pathQ(e,r);break;case jt.SMOOTH_QUAD_TO:this.pathT(e,r);break;case jt.ARC:this.pathA(e,r);break;case jt.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,A=e.getMarkerPoints(),r=e.getMarkerAngles(),i=A.map((n,o)=>[n,r[o]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var A=this.getStyle("fill-rule");e.fillStyle!==""&&(A.getString("inherit")!=="inherit"?e.fill(A.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,n=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var a=n.getDefinition(),[c,u]=r[0];a.render(e,c,u)}if(o.isUrlDefinition())for(var l=o.getDefinition(),g=1;g<i;g++){var[h,p]=r[g];l.render(e,h,p)}if(s.isUrlDefinition()){var C=s.getDefinition(),[I,E]=r[i];C.render(e,I,E)}}}static pathM(e){var A=e.getAsCurrentPoint();return e.start=e.current,{point:A}}pathM(e,A){var{pathParser:r}=this,{point:i}=MA.pathM(r),{x:n,y:o}=i;r.addMarker(i),A.addPoint(n,o),e&&e.moveTo(n,o)}static pathL(e){var{current:A}=e,r=e.getAsCurrentPoint();return{current:A,point:r}}pathL(e,A){var{pathParser:r}=this,{current:i,point:n}=MA.pathL(r),{x:o,y:s}=n;r.addMarker(n,i),A.addPoint(o,s),e&&e.lineTo(o,s)}static pathH(e){var{current:A,command:r}=e,i=new sr((r.relative?A.x:0)+r.x,A.y);return e.current=i,{current:A,point:i}}pathH(e,A){var{pathParser:r}=this,{current:i,point:n}=MA.pathH(r),{x:o,y:s}=n;r.addMarker(n,i),A.addPoint(o,s),e&&e.lineTo(o,s)}static pathV(e){var{current:A,command:r}=e,i=new sr(A.x,(r.relative?A.y:0)+r.y);return e.current=i,{current:A,point:i}}pathV(e,A){var{pathParser:r}=this,{current:i,point:n}=MA.pathV(r),{x:o,y:s}=n;r.addMarker(n,i),A.addPoint(o,s),e&&e.lineTo(o,s)}static pathC(e){var{current:A}=e,r=e.getPoint("x1","y1"),i=e.getAsControlPoint("x2","y2"),n=e.getAsCurrentPoint();return{current:A,point:r,controlPoint:i,currentPoint:n}}pathC(e,A){var{pathParser:r}=this,{current:i,point:n,controlPoint:o,currentPoint:s}=MA.pathC(r);r.addMarker(s,o,n),A.addBezierCurve(i.x,i.y,n.x,n.y,o.x,o.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,o.x,o.y,s.x,s.y)}static pathS(e){var{current:A}=e,r=e.getReflectedControlPoint(),i=e.getAsControlPoint("x2","y2"),n=e.getAsCurrentPoint();return{current:A,point:r,controlPoint:i,currentPoint:n}}pathS(e,A){var{pathParser:r}=this,{current:i,point:n,controlPoint:o,currentPoint:s}=MA.pathS(r);r.addMarker(s,o,n),A.addBezierCurve(i.x,i.y,n.x,n.y,o.x,o.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,o.x,o.y,s.x,s.y)}static pathQ(e){var{current:A}=e,r=e.getAsControlPoint("x1","y1"),i=e.getAsCurrentPoint();return{current:A,controlPoint:r,currentPoint:i}}pathQ(e,A){var{pathParser:r}=this,{current:i,controlPoint:n,currentPoint:o}=MA.pathQ(r);r.addMarker(o,n,n),A.addQuadraticCurve(i.x,i.y,n.x,n.y,o.x,o.y),e&&e.quadraticCurveTo(n.x,n.y,o.x,o.y)}static pathT(e){var{current:A}=e,r=e.getReflectedControlPoint();e.control=r;var i=e.getAsCurrentPoint();return{current:A,controlPoint:r,currentPoint:i}}pathT(e,A){var{pathParser:r}=this,{current:i,controlPoint:n,currentPoint:o}=MA.pathT(r);r.addMarker(o,n,n),A.addQuadraticCurve(i.x,i.y,n.x,n.y,o.x,o.y),e&&e.quadraticCurveTo(n.x,n.y,o.x,o.y)}static pathA(e){var{current:A,command:r}=e,{rX:i,rY:n,xRot:o,lArcFlag:s,sweepFlag:a}=r,c=o*(Math.PI/180),u=e.getAsCurrentPoint(),l=new sr(Math.cos(c)*(A.x-u.x)/2+Math.sin(c)*(A.y-u.y)/2,-Math.sin(c)*(A.x-u.x)/2+Math.cos(c)*(A.y-u.y)/2),g=Math.pow(l.x,2)/Math.pow(i,2)+Math.pow(l.y,2)/Math.pow(n,2);g>1&&(i*=Math.sqrt(g),n*=Math.sqrt(g));var h=(s===a?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(n,2)-Math.pow(i,2)*Math.pow(l.y,2)-Math.pow(n,2)*Math.pow(l.x,2))/(Math.pow(i,2)*Math.pow(l.y,2)+Math.pow(n,2)*Math.pow(l.x,2)));isNaN(h)&&(h=0);var p=new sr(h*i*l.y/n,h*-n*l.x/i),C=new sr((A.x+u.x)/2+Math.cos(c)*p.x-Math.sin(c)*p.y,(A.y+u.y)/2+Math.sin(c)*p.x+Math.cos(c)*p.y),I=f1([1,0],[(l.x-p.x)/i,(l.y-p.y)/n]),E=[(l.x-p.x)/i,(l.y-p.y)/n],v=[(-l.x-p.x)/i,(-l.y-p.y)/n],m=f1(E,v);return qv(E,v)<=-1&&(m=Math.PI),qv(E,v)>=1&&(m=0),{currentPoint:u,rX:i,rY:n,sweepFlag:a,xAxisRotation:c,centp:C,a1:I,ad:m}}pathA(e,A){var{pathParser:r}=this,{currentPoint:i,rX:n,rY:o,sweepFlag:s,xAxisRotation:a,centp:c,a1:u,ad:l}=MA.pathA(r),g=1-s?1:-1,h=u+g*(l/2),p=new sr(c.x+n*Math.cos(h),c.y+o*Math.sin(h));if(r.addMarkerAngle(p,h-g*Math.PI/2),r.addMarkerAngle(i,h-g*Math.PI),A.addPoint(i.x,i.y),e&&!isNaN(u)&&!isNaN(l)){var C=n>o?n:o,I=n>o?1:n/o,E=n>o?o/n:1;e.translate(c.x,c.y),e.rotate(a),e.scale(I,E),e.arc(0,0,C,u,u+l,!!(1-s)),e.scale(1/I,1/E),e.rotate(-a),e.translate(-c.x,-c.y)}}static pathZ(e){e.current=e.start}pathZ(e,A){MA.pathZ(this.pathParser),e&&A.x1!==A.x2&&A.y1!==A.y2&&e.closePath()}}class y1 extends MA{constructor(e,A,r){super(e,A,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Go extends ec{constructor(e,A,r){super(e,A,new.target===Go?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,A);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var A=null;return this.children.forEach((r,i)=>{var n=this.getChildBoundingBox(e,this,this,i);A?A.addBoundingBox(n):A=n}),A}getFontSize(){var{document:e,parent:A}=this,r=xi.parse(e.ctx.font).fontSize,i=A.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var A=this.getFontSize();return new es(this.x,this.y-A,this.x+this.measureText(e),this.y)}getGlyph(e,A,r){var i=A[r],n=null;if(e.isArabic){var o=A.length,s=A[r-1],a=A[r+1],c="isolated";if((r===0||s===" ")&&r<o-1&&a!==" "&&(c="terminal"),r>0&&s!==" "&&r<o-1&&a!==" "&&(c="medial"),r>0&&s!==" "&&(r===o-1||a===" ")&&(c="initial"),typeof e.glyphs[i]<"u"){var u=e.glyphs[i];n=u instanceof y1?u:u[c]}}else n=e.glyphs[i];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var A=e||this.node,r=Array.from(A.parentNode.childNodes),i=r.indexOf(A),n=r.length-1,o=Su(A.textContent||"");return i===0&&(o=p3(o)),i===n&&(o=f3(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:A}=this.document.screen;A.isWorking()&&A.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:A,parent:r}=this,i=this.getText(),n=r.getStyle("font-family").getDefinition();if(n){for(var{unitsPerEm:o}=n.fontFace,s=xi.parse(A.ctx.font),a=r.getStyle("font-size").getNumber(s.fontSize),c=r.getStyle("font-style").getString(s.fontStyle),u=a/o,l=n.isRTL?i.split("").reverse().join(""):i,g=gn(r.getAttribute("dx").getString()),h=l.length,p=0;p<h;p++){var C=this.getGlyph(n,l,p);e.translate(this.x,this.y),e.scale(u,-u);var I=e.lineWidth;e.lineWidth=e.lineWidth*o/a,c==="italic"&&e.transform(1,0,.4,1,0,0),C.render(e),c==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=I,e.scale(1/u,-1/u),e.translate(-this.x,-this.y),this.x+=a*(C.horizAdvX||n.horizAdvX)/o,typeof g[p]<"u"&&!isNaN(g[p])&&(this.x+=g[p])}return}var{x:E,y:v}=this;e.fillStyle&&e.fillText(i,E,v),e.strokeStyle&&e.strokeText(i,E,v)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],A=e.getStyle("text-anchor").getString("start"),r=!1,i=0;A==="start"&&!r||A==="end"&&r?i=e.x-this.minX:A==="end"&&!r||A==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var n=this.textChunkStart;n<this.leafTexts.length;n++)this.leafTexts[n].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((A,r)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,A,r,i){var n=r.children[i];n.children.length>0?n.children.forEach((o,s)=>{A.adjustChildCoordinatesRecursiveCore(e,A,n,s)}):this.adjustChildCoordinates(e,A,r,i)}adjustChildCoordinates(e,A,r,i){var n=r.children[i];if(typeof n.measureText!="function")return n;e.save(),n.setContext(e,!0);var o=n.getAttribute("x"),s=n.getAttribute("y"),a=n.getAttribute("dx"),c=n.getAttribute("dy"),u=n.getStyle("font-family").getDefinition(),l=!!u&&u.isRTL;i===0&&(o.hasValue()||o.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),a.hasValue()||a.setValue(n.getInheritedAttribute("dx")),c.hasValue()||c.setValue(n.getInheritedAttribute("dy")));var g=n.measureText(e);return l&&(A.x-=g),o.hasValue()?(A.applyAnchoring(),n.x=o.getPixels("x"),a.hasValue()&&(n.x+=a.getPixels("x"))):(a.hasValue()&&(A.x+=a.getPixels("x")),n.x=A.x),A.x=n.x,l||(A.x+=g),s.hasValue()?(n.y=s.getPixels("y"),c.hasValue()&&(n.y+=c.getPixels("y"))):(c.hasValue()&&(A.y+=c.getPixels("y")),n.y=A.y),A.y=n.y,A.leafTexts.push(n),A.minX=Math.min(A.minX,n.x,n.x+g),A.maxX=Math.max(A.maxX,n.x,n.x+g),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,A,r,i){var n=r.children[i];if(typeof n.getBoundingBox!="function")return null;var o=n.getBoundingBox(e);return o?(n.children.forEach((s,a)=>{var c=A.getChildBoundingBox(e,A,n,a);o.addBoundingBox(c)}),o):null}renderChild(e,A,r,i){var n=r.children[i];n.render(e),n.children.forEach((o,s)=>{A.renderChild(e,A,n,s)})}measureText(e){var{measureCache:A}=this;if(~A)return A;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,A){if(!A.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var n=this.getFontSize(),o=i.isRTL?A.split("").reverse().join(""):A,s=gn(r.getAttribute("dx").getString()),a=o.length,c=0,u=0;u<a;u++){var l=this.getGlyph(i,o,u);c+=(l.horizAdvX||i.horizAdvX)*n/i.fontFace.unitsPerEm,typeof s[u]<"u"&&!isNaN(s[u])&&(c+=s[u])}return c}if(!e.measureText)return A.length*10;e.save(),this.setContext(e,!0);var{width:g}=e.measureText(A);return this.clearContext(e),e.restore(),g}getInheritedAttribute(e){for(var A=this;A instanceof Go&&A.isFirstChild();){var r=A.parent.getAttribute(e);if(r.hasValue(!0))return r.getValue("0");A=A.parent}return null}}class Ff extends Go{constructor(e,A,r){super(e,A,new.target===Ff?!0:r),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class uQe extends Ff{constructor(){super(...arguments),this.type="textNode"}}let Dh=class extends ec{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var A,{document:r}=this,{screen:i,window:n}=r,o=e.canvas;if(i.setDefaults(e),o.style&&typeof e.font<"u"&&n&&typeof n.getComputedStyle<"u"){e.font=n.getComputedStyle(o).getPropertyValue("font");var s=new wt(r,"fontSize",xi.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:a,height:c}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var u=this.getAttribute("refX"),l=this.getAttribute("refY"),g=this.getAttribute("viewBox"),h=g.hasValue()?gn(g.getString()):null,p=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",C=0,I=0,E=0,v=0;h&&(C=h[0],I=h[1]),this.root||(a=this.getStyle("width").getPixels("x"),c=this.getStyle("height").getPixels("y"),this.type==="marker"&&(E=C,v=I,C=0,I=0)),i.viewPort.setCurrent(a,c),this.node&&(!this.parent||((A=this.node.parentNode)===null||A===void 0?void 0:A.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),h&&(a=h[2],c=h[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:a,height:i.viewPort.height,desiredHeight:c,minX:C,minY:I,refX:u.getValue(),refY:l.getValue(),clip:p,clipX:E,clipY:v}),h&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(a,c))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),n=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),a=i.getNumber(0),c=n.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var u=this.getAttribute("preserveAspectRatio");u.hasValue()&&u.setValue(u.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),n.setValue(A),o.hasValue()||o.setValue("0 0 ".concat(a||e," ").concat(c||A)),s.hasValue()){var l=this.getStyle("width"),g=this.getStyle("height");l.hasValue()&&l.setValue("".concat(e,"px")),g.hasValue()&&g.setValue("".concat(A,"px"))}}};class Q1 extends MA{constructor(){super(...arguments),this.type="rect"}path(e){var A=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),a=o.getPixels("x"),c=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(c=a),s.hasValue()&&!o.hasValue()&&(a=c),a=Math.min(a,i/2),c=Math.min(c,n/2),e){var u=4*((Math.sqrt(2)-1)/3);e.beginPath(),n>0&&i>0&&(e.moveTo(A+a,r),e.lineTo(A+i-a,r),e.bezierCurveTo(A+i-a+u*a,r,A+i,r+c-u*c,A+i,r+c),e.lineTo(A+i,r+n-c),e.bezierCurveTo(A+i,r+n-c+u*c,A+i-a+u*a,r+n,A+i-a,r+n),e.lineTo(A+a,r+n),e.bezierCurveTo(A+a-u*a,r+n,A,r+n-c+u*c,A,r+n-c),e.lineTo(A,r+c),e.bezierCurveTo(A,r+c-u*c,A+a-u*a,r,A+a,r),e.closePath())}return new es(A,r,A+i,r+n)}getMarkers(){return null}}class T3 extends MA{constructor(){super(...arguments),this.type="circle"}path(e){var A=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(A,r,i,0,Math.PI*2,!1),e.closePath()),new es(A-i,r-i,A+i,r+i)}getMarkers(){return null}}class U3 extends MA{constructor(){super(...arguments),this.type="ellipse"}path(e){var A=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(n+r,o),e.bezierCurveTo(n+r,o+A*i,n+A*r,o+i,n,o+i),e.bezierCurveTo(n-A*r,o+i,n-r,o+A*i,n-r,o),e.bezierCurveTo(n-r,o-A*i,n-A*r,o-i,n,o-i),e.bezierCurveTo(n+A*r,o-i,n+r,o-A*i,n+r,o),e.closePath()),new es(n-r,o-i,n+r,o+i)}getMarkers(){return null}}class L3 extends MA{constructor(){super(...arguments),this.type="line"}getPoints(){return[new sr(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new sr(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:A,y:r},{x:i,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(A,r),e.lineTo(i,n)),new es(A,r,i,n)}getMarkers(){var[e,A]=this.getPoints(),r=e.angleTo(A);return[[e,r],[A,r]]}}class R1 extends MA{constructor(e,A,r){super(e,A,r),this.type="polyline",this.points=[],this.points=sr.parsePath(this.getAttribute("points").getString())}path(e){var{points:A}=this,[{x:r,y:i}]=A,n=new es(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),A.forEach(o=>{var{x:s,y:a}=o;n.addPoint(s,a),e&&e.lineTo(s,a)}),n}getMarkers(){var{points:e}=this,A=e.length-1,r=[];return e.forEach((i,n)=>{n!==A&&r.push([i,i.angleTo(e[n+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class F3 extends R1{constructor(){super(...arguments),this.type="polygon"}path(e){var A=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),A}}class O3 extends XA{constructor(){super(...arguments),this.type="pattern"}createPattern(e,A,r){var i=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),o=new Dh(this.document,null);o.attributes.viewBox=new wt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new wt(this.document,"width","".concat(i,"px")),o.attributes.height=new wt(this.document,"height","".concat(n,"px")),o.attributes.transform=new wt(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(i,n),a=s.getContext("2d"),c=this.getAttribute("x"),u=this.getAttribute("y");c.hasValue()&&u.hasValue()&&a.translate(c.getPixels("x",!0),u.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var l=-1;l<=1;l++)for(var g=-1;g<=1;g++)a.save(),o.attributes.x=new wt(this.document,"x",l*s.width),o.attributes.y=new wt(this.document,"y",g*s.height),o.render(a),a.restore();var h=e.createPattern(s,"repeat");return h}}class b3 extends XA{constructor(){super(...arguments),this.type="marker"}render(e,A,r){if(A){var{x:i,y:n}=A,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,n),o==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var a=new Dh(this.document,null);a.type=this.type,a.attributes.viewBox=new wt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.refX=new wt(this.document,"refX",this.getAttribute("refX").getValue()),a.attributes.refY=new wt(this.document,"refY",this.getAttribute("refY").getValue()),a.attributes.width=new wt(this.document,"width",this.getAttribute("markerWidth").getValue()),a.attributes.height=new wt(this.document,"height",this.getAttribute("markerHeight").getValue()),a.attributes.overflow=new wt(this.document,"overflow",this.getAttribute("overflow").getValue()),a.attributes.fill=new wt(this.document,"fill",this.getAttribute("fill").getColor("black")),a.attributes.stroke=new wt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),a.children=this.children,a.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-r),e.translate(-i,-n)}}}class x3 extends XA{constructor(){super(...arguments),this.type="defs"}render(){}}class Wv extends ec{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var A=new es;return this.children.forEach(r=>{A.addBoundingBox(r.getBoundingBox(e))}),A}}class D1 extends XA{constructor(e,A,r){super(e,A,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:n}=this;n.forEach(o=>{o.type==="stop"&&i.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,A,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:n}=i,o=this.getGradient(e,A);if(!o)return this.addParentOpacity(r,n[n.length-1].color);if(n.forEach(I=>{o.addColorStop(I.offset,this.addParentOpacity(r,I.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:a,viewPort:c}=s.screen,[u]=c.viewPorts,l=new Q1(s,null);l.attributes.x=new wt(s,"x",-a/3),l.attributes.y=new wt(s,"y",-a/3),l.attributes.width=new wt(s,"width",a),l.attributes.height=new wt(s,"height",a);var g=new Wv(s,null);g.attributes.transform=new wt(s,"transform",this.getAttribute("gradientTransform").getValue()),g.children=[l];var h=new Dh(s,null);h.attributes.x=new wt(s,"x",0),h.attributes.y=new wt(s,"y",0),h.attributes.width=new wt(s,"width",u.width),h.attributes.height=new wt(s,"height",u.height),h.children=[g];var p=s.createCanvas(u.width,u.height),C=p.getContext("2d");return C.fillStyle=o,h.render(C),C.createPattern(p,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(A=>{!this.getAttribute(A).hasValue()&&e.getAttribute(A).hasValue()&&this.getAttribute(A,!0).setValue(e.getAttribute(A).getValue())})}addParentOpacity(e,A){if(e.hasValue()){var r=new wt(this.document,"color",A);return r.addOpacity(e).getColor()}return A}}class N3 extends D1{constructor(e,A,r){super(e,A,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,A){var r=this.getGradientUnits()==="objectBoundingBox",i=r?A.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),a=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&o===a?null:e.createLinearGradient(n,o,s,a)}}class K3 extends D1{constructor(e,A,r){super(e,A,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,A){var r=this.getGradientUnits()==="objectBoundingBox",i=A.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,a=o;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(a=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var c=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),u=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,a,u,n,o,c)}}class k3 extends XA{constructor(e,A,r){super(e,A,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),n.hasValue()&&(o=o.addOpacity(n)),this.offset=i,this.color=o.getColor()}}class Zv extends XA{constructor(e,A,r){super(e,A,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new wt(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),A=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(A,!0):this.parent.getAttribute(A,!0)}calcValue(){var{initialUnits:e}=this,{progress:A,from:r,to:i}=this.getProgress(),n=r.getNumber()+(i.getNumber()-r.getNumber())*A;return e==="%"&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:A}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,A.animationFrozen=!0,A.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(A.animationFrozen?A.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var n=!1;if(this.begin<this.duration){var o=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var a=s.getString();o="".concat(a,"(").concat(o,")")}r.setValue(o),n=!0}return n}getProgress(){var{document:e,values:A}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(A.hasValue()){var i=r.progress*(A.getValue().length-1),n=Math.floor(i),o=Math.ceil(i);r.from=new wt(e,"from",parseFloat(A.getValue()[n])),r.to=new wt(e,"to",parseFloat(A.getValue()[o])),r.progress=(i-n)/(o-n)}else r.from=this.from,r.to=this.to;return r}}class P3 extends Zv{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:A,to:r}=this.getProgress(),i=new c1(A.getColor()),n=new c1(r.getColor());if(i.ok&&n.ok){var o=i.r+(n.r-i.r)*e,s=i.g+(n.g-i.g)*e,a=i.b+(n.b-i.b)*e;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(s),", ").concat(Math.floor(a),")")}return this.getAttribute("from").getColor()}}class G3 extends Zv{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:A,to:r}=this.getProgress(),i=gn(A.getString()),n=gn(r.getString()),o=i.map((s,a)=>{var c=n[a];return s+(c-s)*e}).join(" ");return o}}class j3 extends XA{constructor(e,A,r){super(e,A,r),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:n}=this;for(var o of n)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var a=o;a.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[a.unicode]>"u"&&(this.glyphs[a.unicode]=Object.create(null)),this.glyphs[a.unicode][a.arabicForm]=a):this.glyphs[a.unicode]=a;break}}}render(){}}class Y3 extends XA{constructor(e,A,r){super(e,A,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class H3 extends MA{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class z3 extends Go{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var A=e.children[0];if(A)return A.getText()}return""}}class J3 extends Go{constructor(e,A,r){super(e,A,r),this.type="a";var{childNodes:i}=A,n=i[0],o=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:A,x:r,y:i}=this,{mouse:n}=A.screen,o=new wt(A,"fontSize",xi.parse(A.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new es(r,i-o.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new Wv(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function q3(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),A.push.apply(A,r)}return A}function Xv(t){for(var e=1;e<arguments.length;e++){var A=arguments[e]!=null?arguments[e]:{};e%2?q3(Object(A),!0).forEach(function(r){t1(t,r,A[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):q3(Object(A)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(A,r))})}return t}class V3 extends Go{constructor(e,A,r){super(e,A,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){var{dataArray:A}=this;e&&e.beginPath(),A.forEach(r=>{var{type:i,points:n}=r;switch(i){case jt.LINE_TO:e&&e.lineTo(n[0],n[1]);break;case jt.MOVE_TO:e&&e.moveTo(n[0],n[1]);break;case jt.CURVE_TO:e&&e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);break;case jt.QUAD_TO:e&&e.quadraticCurveTo(n[0],n[1],n[2],n[3]);break;case jt.ARC:{var[o,s,a,c,u,l,g,h]=n,p=a>c?a:c,C=a>c?1:a/c,I=a>c?c/a:1;e&&(e.translate(o,s),e.rotate(g),e.scale(C,I),e.arc(0,0,p,u,u+l,!!(1-h)),e.scale(1/C,1/I),e.rotate(-g),e.translate(-o,-s));break}case jt.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var A=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,n=e.fillStyle;A==="underline"&&e.beginPath(),i.forEach((o,s)=>{var{p0:a,p1:c,rotation:u,text:l}=o;e.save(),e.translate(a.x,a.y),e.rotate(u),e.fillStyle&&e.fillText(l,0,0),e.strokeStyle&&e.strokeText(l,0,0),e.restore(),A==="underline"&&(s===0&&e.moveTo(a.x,a.y+r/8),e.lineTo(c.x,c.y+r/5))}),A==="underline"&&(e.lineWidth=r/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,A,r,i,n,o,s,a,c){var u=o,l=this.measureText(e,a);a===" "&&A==="justify"&&r<i&&(l+=(i-r)/n),c>-1&&(u+=this.getLetterSpacingAt(c));var g=this.textHeight/20,h=this.getEquidistantPointOnPath(u,g,0),p=this.getEquidistantPointOnPath(u+l,g,0),C={p0:h,p1:p},I=h&&p?Math.atan2(p.y-h.y,p.x-h.x):0;if(s){var E=Math.cos(Math.PI/2+I)*s,v=Math.cos(-I)*s;C.p0=Xv(Xv({},h),{},{x:h.x+E,y:h.y+v}),C.p1=Xv(Xv({},p),{},{x:p.x+E,y:p.y+v})}return u+=l,{offset:u,segment:C,rotation:I}}measureText(e,A){var{measuresCache:r}=this,i=A||this.getText();if(r.has(i))return r.get(i);var n=this.measureTargetText(e,i);return r.set(i,n),n}setTextData(e){if(!this.glyphInfo){var A=this.getText(),r=A.split(""),i=A.split(" ").length-1,n=this.parent.getAttribute("dx").split().map(M=>M.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),a=this.getStyle("letter-spacing"),c=this.parent.getStyle("letter-spacing"),u=0;!a.hasValue()||a.getValue()==="inherit"?u=c.getPixels():a.hasValue()&&a.getValue()!=="initial"&&a.getValue()!=="unset"&&(u=a.getPixels());var l=[],g=A.length;this.letterSpacingCache=l;for(var h=0;h<g;h++)l.push(typeof n[h]<"u"?n[h]:u);var p=l.reduce((M,O,x)=>x===0?0:M+O||0,0),C=this.measureText(e),I=Math.max(C+p,0);this.textWidth=C,this.textHeight=this.getFontSize(),this.glyphInfo=[];var E=this.getPathLength(),v=this.getStyle("startOffset").getNumber(0)*E,m=0;(s==="middle"||s==="center")&&(m=-I/2),(s==="end"||s==="right")&&(m=-I),m+=v,r.forEach((M,O)=>{var{offset:x,segment:P,rotation:D}=this.findSegmentToFitChar(e,s,I,E,i,m,o,M,O);m=x,!(!P.p0||!P.p1)&&this.glyphInfo.push({text:r[O],p0:P.p0,p1:P.p1,rotation:D})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var A=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,n=i?i.x:0,o=i?i.y:0,s=r.next(),a=s.type,c=[];switch(s.type){case jt.MOVE_TO:this.pathM(r,c);break;case jt.LINE_TO:a=this.pathL(r,c);break;case jt.HORIZ_LINE_TO:a=this.pathH(r,c);break;case jt.VERT_LINE_TO:a=this.pathV(r,c);break;case jt.CURVE_TO:this.pathC(r,c);break;case jt.SMOOTH_CURVE_TO:a=this.pathS(r,c);break;case jt.QUAD_TO:this.pathQ(r,c);break;case jt.SMOOTH_QUAD_TO:a=this.pathT(r,c);break;case jt.ARC:c=this.pathA(r);break;case jt.CLOSE_PATH:MA.pathZ(r);break}s.type!==jt.CLOSE_PATH?A.push({type:a,points:c,start:{x:n,y:o},pathLength:this.calcLength(n,o,a,c)}):A.push({type:jt.CLOSE_PATH,points:[],pathLength:0})}return A}pathM(e,A){var{x:r,y:i}=MA.pathM(e).point;A.push(r,i)}pathL(e,A){var{x:r,y:i}=MA.pathL(e).point;return A.push(r,i),jt.LINE_TO}pathH(e,A){var{x:r,y:i}=MA.pathH(e).point;return A.push(r,i),jt.LINE_TO}pathV(e,A){var{x:r,y:i}=MA.pathV(e).point;return A.push(r,i),jt.LINE_TO}pathC(e,A){var{point:r,controlPoint:i,currentPoint:n}=MA.pathC(e);A.push(r.x,r.y,i.x,i.y,n.x,n.y)}pathS(e,A){var{point:r,controlPoint:i,currentPoint:n}=MA.pathS(e);return A.push(r.x,r.y,i.x,i.y,n.x,n.y),jt.CURVE_TO}pathQ(e,A){var{controlPoint:r,currentPoint:i}=MA.pathQ(e);A.push(r.x,r.y,i.x,i.y)}pathT(e,A){var{controlPoint:r,currentPoint:i}=MA.pathT(e);return A.push(r.x,r.y,i.x,i.y),jt.QUAD_TO}pathA(e){var{rX:A,rY:r,sweepFlag:i,xAxisRotation:n,centp:o,a1:s,ad:a}=MA.pathA(e);return i===0&&a>0&&(a-=2*Math.PI),i===1&&a<0&&(a+=2*Math.PI),[o.x,o.y,A,r,s,a,n,i]}calcLength(e,A,r,i){var n=0,o=null,s=null,a=0;switch(r){case jt.LINE_TO:return this.getLineLength(e,A,i[0],i[1]);case jt.CURVE_TO:for(n=0,o=this.getPointOnCubicBezier(0,e,A,i[0],i[1],i[2],i[3],i[4],i[5]),a=.01;a<=1;a+=.01)s=this.getPointOnCubicBezier(a,e,A,i[0],i[1],i[2],i[3],i[4],i[5]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case jt.QUAD_TO:for(n=0,o=this.getPointOnQuadraticBezier(0,e,A,i[0],i[1],i[2],i[3]),a=.01;a<=1;a+=.01)s=this.getPointOnQuadraticBezier(a,e,A,i[0],i[1],i[2],i[3]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case jt.ARC:{n=0;var c=i[4],u=i[5],l=i[4]+u,g=Math.PI/180;if(Math.abs(c-l)<g&&(g=Math.abs(c-l)),o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),u<0)for(a=c-g;a>l;a-=g)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],a,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(a=c+g;a<l;a+=g)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],a,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),n}}return 0}getPointOnLine(e,A,r,i,n){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:A,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,a=(n-r)/(i-A+Mu),c=Math.sqrt(e*e/(1+a*a));i<A&&(c*=-1);var u=a*c,l=null;if(i===A)l={x:o,y:s+u};else if((s-r)/(o-A+Mu)===a)l={x:o+c,y:s+u};else{var g=0,h=0,p=this.getLineLength(A,r,i,n);if(p<Mu)return null;var C=(o-A)*(i-A)+(s-r)*(n-r);C/=p*p,g=A+C*(i-A),h=r+C*(n-r);var I=this.getLineLength(o,s,g,h),E=Math.sqrt(e*e-I*I);c=Math.sqrt(E*E/(1+a*a)),i<A&&(c*=-1),u=a*c,l={x:g+c,y:h+u}}return l}getPointOnPath(e){var A=this.getPathLength(),r=0,i=null;if(e<-5e-5||e-5e-5>A)return null;var{dataArray:n}=this;for(var o of n){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5<e)){r+=o.pathLength;continue}var s=e-r,a=0;switch(o.type){case jt.LINE_TO:i=this.getPointOnLine(s,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case jt.ARC:{var c=o.points[4],u=o.points[5],l=o.points[4]+u;if(a=c+s/o.pathLength*u,u<0&&a<l||u>=0&&a>l)break;i=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],a,o.points[6]);break}case jt.CURVE_TO:a=s/o.pathLength,a>1&&(a=1),i=this.getPointOnCubicBezier(a,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case jt.QUAD_TO:a=s/o.pathLength,a>1&&(a=1),i=this.getPointOnQuadraticBezier(a,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(i)return i;break}return null}getLineLength(e,A,r,i){return Math.sqrt((r-e)*(r-e)+(i-A)*(i-A))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,A)=>A.pathLength>0?e+A.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,A,r,i,n,o,s,a,c){var u=a*E1(e)+o*C1(e)+i*I1(e)+A*B1(e),l=c*E1(e)+s*C1(e)+n*I1(e)+r*B1(e);return{x:u,y:l}}getPointOnQuadraticBezier(e,A,r,i,n,o,s){var a=o*v1(e)+i*w1(e)+A*S1(e),c=s*v1(e)+n*w1(e)+r*S1(e);return{x:a,y:c}}getPointOnEllipticalArc(e,A,r,i,n,o){var s=Math.cos(o),a=Math.sin(o),c={x:r*Math.cos(n),y:i*Math.sin(n)};return{x:e+(c.x*s-c.y*a),y:A+(c.x*a+c.y*s)}}buildEquidistantCache(e,A){var r=this.getPathLength(),i=A||.25,n=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==i){this.equidistantCache={step:n,precision:i,points:[]};for(var o=0,s=0;s<=r;s+=i){var a=this.getPointOnPath(s),c=this.getPointOnPath(s+i);!a||!c||(o+=this.getLineLength(a.x,a.y,c.x,c.y),o>=n&&(this.equidistantCache.points.push({x:a.x,y:a.y,distance:s}),o-=n))}}}getEquidistantPointOnPath(e,A,r){if(this.buildEquidistantCache(A,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var lQe=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class W3 extends ec{constructor(e,A,r){super(e,A,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(i){var n=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),n?this.loadSvg(i):this.loadImage(i),this.isSvg=n}}loadImage(e){var A=this;return Ko(function*(){try{var r=yield A.document.createImage(e);A.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}A.loaded=!0})()}loadSvg(e){var A=this;return Ko(function*(){var r=lQe.exec(e);if(r){var i=r[5];r[4]==="base64"?A.image=atob(i):A.image=decodeURIComponent(i)}else try{var n=yield A.document.fetch(e),o=yield n.text();A.image=o}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}A.loaded=!0})()}renderChildren(e){var{document:A,image:r,loaded:i}=this,n=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!a)){if(e.save(),e.translate(n,o),this.isSvg){var c=A.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:a});c.document.documentElement.parent=this,c.render()}else{var u=this.image;A.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:u.width,height:a,desiredHeight:u.height}),this.loaded&&(typeof u.complete>"u"||u.complete)&&e.drawImage(u,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new es(e,A,e+r,A+i)}}class Z3 extends ec{constructor(){super(...arguments),this.type="symbol"}render(e){}}class X3{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,A){var r=this;return Ko(function*(){try{var{document:i}=r,n=yield i.canvg.parser.load(A),o=n.getElementsByTagName("font");Array.from(o).forEach(s=>{var a=i.createElement(s);i.definitions[e]=a})}catch(s){console.error('Error while loading font "'.concat(A,'":'),s)}r.loaded=!0})()}}class T1 extends XA{constructor(e,A,r){super(e,A,r),this.type="style";var i=Su(Array.from(A.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),n=i.split("}");n.forEach(o=>{var s=o.trim();if(s){var a=s.split("{"),c=a[0].split(","),u=a[1].split(";");c.forEach(l=>{var g=l.trim();if(g){var h=e.styles[g]||{};if(u.forEach(I=>{var E=I.indexOf(":"),v=I.substr(0,E).trim(),m=I.substr(E+1,I.length-E).trim();v&&m&&(h[v]=new wt(e,v,m))}),e.styles[g]=h,e.stylesSpecificity[g]=I3(g),g==="@font-face"){var p=h["font-family"].getString().replace(/"|'/g,""),C=h.src.getString().split(",");C.forEach(I=>{if(I.indexOf('format("svg")')>0){var E=d1(I);E&&new X3(e).load(p,E)}})}}})}})}}T1.parseExternalUrl=d1;class _3 extends ec{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var A=this.getAttribute("x"),r=this.getAttribute("y");A.hasValue()&&e.translate(A.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:A}=this;A&&A.path(e)}renderChildren(e){var{document:A,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new Dh(A,null),i.attributes.viewBox=new wt(A,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new wt(A,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new wt(A,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new wt(A,"opacity",this.calculateOpacity())),i.type==="svg"){var n=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);n.hasValue()&&(i.attributes.width=new wt(A,"width",n.getString())),o.hasValue()&&(i.attributes.height=new wt(A,"height",o.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:A}=this;return A?A.getBoundingBox(e):null}elementTransform(){var{document:e,element:A}=this;return $a.fromElement(e,A)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function _v(t,e,A,r,i,n){return t[A*r*4+e*4+n]}function $v(t,e,A,r,i,n,o){t[A*r*4+e*4+n]=o}function Dr(t,e,A){var r=t[e];return r*A}function jo(t,e,A,r){return e+Math.cos(t)*A+Math.sin(t)*r}class U1 extends XA{constructor(e,A,r){super(e,A,r),this.type="feColorMatrix";var i=gn(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var n=i[0];i=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=i[0]*Math.PI/180;i=[jo(o,.213,.787,-.213),jo(o,.715,-.715,-.715),jo(o,.072,-.072,.928),0,0,jo(o,.213,-.213,.143),jo(o,.715,.285,.14),jo(o,.072,-.072,-.283),0,0,jo(o,.213,-.213,-.787),jo(o,.715,-.715,.715),jo(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,A,r,i,n){for(var{includeOpacity:o,matrix:s}=this,a=e.getImageData(0,0,i,n),c=0;c<n;c++)for(var u=0;u<i;u++){var l=_v(a.data,u,c,i,n,0),g=_v(a.data,u,c,i,n,1),h=_v(a.data,u,c,i,n,2),p=_v(a.data,u,c,i,n,3),C=Dr(s,0,l)+Dr(s,1,g)+Dr(s,2,h)+Dr(s,3,p)+Dr(s,4,1),I=Dr(s,5,l)+Dr(s,6,g)+Dr(s,7,h)+Dr(s,8,p)+Dr(s,9,1),E=Dr(s,10,l)+Dr(s,11,g)+Dr(s,12,h)+Dr(s,13,p)+Dr(s,14,1),v=Dr(s,15,l)+Dr(s,16,g)+Dr(s,17,h)+Dr(s,18,p)+Dr(s,19,1);o&&(C=0,I=0,E=0,v*=p/255),$v(a.data,u,c,i,n,0,C),$v(a.data,u,c,i,n,1,I),$v(a.data,u,c,i,n,2,E),$v(a.data,u,c,i,n,3,v)}e.clearRect(0,0,i,n),e.putImageData(a,0,0)}}class Of extends XA{constructor(){super(...arguments),this.type="mask"}apply(e,A){var{document:r}=this,i=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!o&&!s){var a=new es;this.children.forEach(p=>{a.addBoundingBox(p.getBoundingBox(e))}),i=Math.floor(a.x1),n=Math.floor(a.y1),o=Math.floor(a.width),s=Math.floor(a.height)}var c=this.removeStyles(A,Of.ignoreStyles),u=r.createCanvas(i+o,n+s),l=u.getContext("2d");r.screen.setDefaults(l),this.renderChildren(l),new U1(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(l,0,0,i+o,n+s);var g=r.createCanvas(i+o,n+s),h=g.getContext("2d");r.screen.setDefaults(h),A.render(h),h.globalCompositeOperation="destination-in",h.fillStyle=l.createPattern(u,"no-repeat"),h.fillRect(0,0,i+o,n+s),e.fillStyle=h.createPattern(g,"no-repeat"),e.fillRect(0,0,i+o,n+s),this.restoreStyles(A,c)}render(e){}}Of.ignoreStyles=["mask","transform","clip-path"];var $3=()=>{};class eG extends XA{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:A}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:n}=e;r&&(r.beginPath=$3,r.closePath=$3),Reflect.apply(i,e,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=$a.fromElement(A,o)),s&&s.apply(e),o.path(e),r&&(r.closePath=n),s&&s.unapply(e)}}),Reflect.apply(n,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=n)}render(e){}}class bf extends XA{constructor(){super(...arguments),this.type="filter"}apply(e,A){var{document:r,children:i}=this,n=A.getBoundingBox(e);if(n){var o=0,s=0;i.forEach(E=>{var v=E.extraFilterDistance||0;o=Math.max(o,v),s=Math.max(s,v)});var a=Math.floor(n.width),c=Math.floor(n.height),u=a+2*o,l=c+2*s;if(!(u<1||l<1)){var g=Math.floor(n.x),h=Math.floor(n.y),p=this.removeStyles(A,bf.ignoreStyles),C=r.createCanvas(u,l),I=C.getContext("2d");r.screen.setDefaults(I),I.translate(-g+o,-h+s),A.render(I),i.forEach(E=>{typeof E.apply=="function"&&E.apply(I,0,0,u,l)}),e.drawImage(C,0,0,u,l,g-o,h-s,u,l),this.restoreStyles(A,p)}}}render(e){}}bf.ignoreStyles=["filter","transform","clip-path"];class tG extends XA{constructor(e,A,r){super(e,A,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,A,r,i,n){}}class AG extends XA{constructor(){super(...arguments),this.type="feMorphology"}apply(e,A,r,i,n){}}class rG extends XA{constructor(){super(...arguments),this.type="feComposite"}apply(e,A,r,i,n){}}class iG extends XA{constructor(e,A,r){super(e,A,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,A,r,i,n){var{document:o,blurRadius:s}=this,a=o.window?o.window.document.body:null,c=e.canvas;c.id=o.getUniqueId(),a&&(c.style.display="none",a.appendChild(c)),Yye(c,A,r,i,n,s),a&&a.removeChild(c)}}class nG extends XA{constructor(){super(...arguments),this.type="title"}}class sG extends XA{constructor(){super(...arguments),this.type="desc"}}var hQe={svg:Dh,rect:Q1,circle:T3,ellipse:U3,line:L3,polyline:R1,polygon:F3,path:MA,pattern:O3,marker:b3,defs:x3,linearGradient:N3,radialGradient:K3,stop:k3,animate:Zv,animateColor:P3,animateTransform:G3,font:j3,"font-face":Y3,"missing-glyph":H3,glyph:y1,text:Go,tspan:Ff,tref:z3,a:J3,textPath:V3,image:W3,g:Wv,symbol:Z3,style:T1,use:_3,mask:Of,clipPath:eG,filter:bf,feDropShadow:tG,feMorphology:AG,feComposite:rG,feColorMatrix:U1,feGaussianBlur:iG,title:nG,desc:sG};function oG(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),A.push.apply(A,r)}return A}function gQe(t){for(var e=1;e<arguments.length;e++){var A=arguments[e]!=null?arguments[e]:{};e%2?oG(Object(A),!0).forEach(function(r){t1(t,r,A[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):oG(Object(A)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(A,r))})}return t}function dQe(t,e){var A=document.createElement("canvas");return A.width=t,A.height=e,A}function pQe(t){return L1.apply(this,arguments)}function L1(){return L1=Ko(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=document.createElement("img");return e&&(A.crossOrigin="Anonymous"),new Promise((r,i)=>{A.onload=()=>{r(A)},A.onerror=(n,o,s,a,c)=>{i(c)},A.src=t})}),L1.apply(this,arguments)}class Yo{constructor(e){var{rootEmSize:A=12,emSize:r=12,createCanvas:i=Yo.createCanvas,createImage:n=Yo.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=A,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(n,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,A){return typeof A=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:A):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:A}=this;A.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var A=this.createElement(e.documentElement);return A.root=!0,A.addStylesFromStyleDefinition(),this.documentElement=A,A}createElement(e){var A=e.nodeName.replace(/^[^:]+:/,""),r=Yo.elementTypes[A];return typeof r<"u"?new r(this,e):new D3(this,e)}createTextNode(e){return new uQe(this,e)}setViewBox(e){this.screen.setViewBox(gQe({document:this},e))}}Yo.createCanvas=dQe,Yo.createImage=pQe,Yo.elementTypes=hQe;function aG(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),A.push.apply(A,r)}return A}function yu(t){for(var e=1;e<arguments.length;e++){var A=arguments[e]!=null?arguments[e]:{};e%2?aG(Object(A),!0).forEach(function(r){t1(t,r,A[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):aG(Object(A)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(A,r))})}return t}class Qu{constructor(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Vv(r),this.screen=new Lf(e,r),this.options=r;var i=new Yo(this,r),n=i.createDocumentElement(A);this.document=i,this.documentElement=n}static from(e,A){var r=arguments;return Ko(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},n=new Vv(i),o=yield n.parse(A);return new Qu(e,o,i)})()}static fromString(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new Vv(r),n=i.parseFromString(A);return new Qu(e,n,r)}fork(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Qu.from(e,A,yu(yu({},this.options),r))}forkString(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Qu.fromString(e,A,yu(yu({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,A=this;return Ko(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};A.start(yu({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield A.ready(),A.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:A,screen:r,options:i}=this;r.start(A,yu(yu({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,A,r)}}const fQe=Object.freeze(Object.defineProperty({__proto__:null,AElement:J3,AnimateColorElement:P3,AnimateElement:Zv,AnimateTransformElement:G3,BoundingBox:es,CB1:E1,CB2:C1,CB3:I1,CB4:B1,Canvg:Qu,CircleElement:T3,ClipPathElement:eG,DefsElement:x3,DescElement:sG,Document:Yo,Element:XA,EllipseElement:U3,FeColorMatrixElement:U1,FeCompositeElement:rG,FeDropShadowElement:tG,FeGaussianBlurElement:iG,FeMorphologyElement:AG,FilterElement:bf,Font:xi,FontElement:j3,FontFaceElement:Y3,GElement:Wv,GlyphElement:y1,GradientElement:D1,ImageElement:W3,LineElement:L3,LinearGradientElement:N3,MarkerElement:b3,MaskElement:Of,Matrix:m1,MissingGlyphElement:H3,Mouse:v3,PSEUDO_ZERO:Mu,Parser:Vv,PathElement:MA,PathParser:jt,PatternElement:O3,Point:sr,PolygonElement:F3,PolylineElement:R1,Property:wt,QB1:v1,QB2:w1,QB3:S1,RadialGradientElement:K3,RectElement:Q1,RenderedElement:ec,Rotate:M3,SVGElement:Dh,SVGFontLoader:X3,Scale:y3,Screen:Lf,Skew:M1,SkewX:Q3,SkewY:R3,StopElement:k3,StyleElement:T1,SymbolElement:Z3,TRefElement:z3,TSpanElement:Ff,TextElement:Go,TextPathElement:V3,TitleElement:nG,Transform:$a,Translate:m3,UnknownElement:D3,UseElement:_3,ViewPort:B3,compressSpaces:Su,default:Qu,getSelectorSpecificity:I3,normalizeAttributeName:E3,normalizeColor:C3,parseExternalUrl:d1,presets:qye,toNumbers:gn,trimLeft:p3,trimRight:f3,vectorMagnitude:p1,vectorsAngle:f1,vectorsRatio:qv},Symbol.toStringTag,{value:"Module"}))});
265
+ ***************************************************************************** */var AG=function(t,e){return(AG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,r){A.__proto__=r}||function(A,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(A[i]=r[i])})(t,e)};function rG(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function A(){this.constructor=t}AG(t,e),t.prototype=e===null?Object.create(e):(A.prototype=e.prototype,new A)}function Rye(t){var e="";Array.isArray(t)||(t=[t]);for(var A=0;A<t.length;A++){var r=t[A];if(r.type===ze.CLOSE_PATH)e+="z";else if(r.type===ze.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===ze.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===ze.MOVE_TO)e+=(r.relative?"m":"M")+r.x+" "+r.y;else if(r.type===ze.LINE_TO)e+=(r.relative?"l":"L")+r.x+" "+r.y;else if(r.type===ze.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+" "+r.y1+" "+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===ze.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+" "+r.y2+" "+r.x+" "+r.y;else if(r.type===ze.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+" "+r.y1+" "+r.x+" "+r.y;else if(r.type===ze.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+" "+r.y;else{if(r.type!==ze.ARC)throw new Error('Unexpected command type "'+r.type+'" at index '+A+".");e+=(r.relative?"a":"A")+r.rX+" "+r.rY+" "+r.xRot+" "+ +r.lArcFlag+" "+ +r.sweepFlag+" "+r.x+" "+r.y}}return e}function l1(t,e){var A=t[0],r=t[1];return[A*Math.cos(e)-r*Math.sin(e),A*Math.sin(e)+r*Math.cos(e)]}function Qs(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var A=0;A<t.length;A++)if(typeof t[A]!="number")throw new Error("assertNumbers arguments["+A+"] is not a number. "+typeof t[A]+" == typeof "+t[A]);return!0}var _a=Math.PI;function h1(t,e,A){t.lArcFlag=t.lArcFlag===0?0:1,t.sweepFlag=t.sweepFlag===0?0:1;var r=t.rX,i=t.rY,n=t.x,o=t.y;r=Math.abs(t.rX),i=Math.abs(t.rY);var s=l1([(e-n)/2,(A-o)/2],-t.xRot/180*_a),a=s[0],c=s[1],u=Math.pow(a,2)/Math.pow(r,2)+Math.pow(c,2)/Math.pow(i,2);1<u&&(r*=Math.sqrt(u),i*=Math.sqrt(u)),t.rX=r,t.rY=i;var l=Math.pow(r,2)*Math.pow(c,2)+Math.pow(i,2)*Math.pow(a,2),g=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(i,2)-l)/l)),h=r*c/i*g,p=-i*a/r*g,C=l1([h,p],t.xRot/180*_a);t.cX=C[0]+(e+n)/2,t.cY=C[1]+(A+o)/2,t.phi1=Math.atan2((c-p)/i,(a-h)/r),t.phi2=Math.atan2((-c-p)/i,(-a-h)/r),t.sweepFlag===0&&t.phi2>t.phi1&&(t.phi2-=2*_a),t.sweepFlag===1&&t.phi2<t.phi1&&(t.phi2+=2*_a),t.phi1*=180/_a,t.phi2*=180/_a}function iG(t,e,A){Qs(t,e,A);var r=t*t+e*e-A*A;if(0>r)return[];if(r===0)return[[t*A/(t*t+e*e),e*A/(t*t+e*e)]];var i=Math.sqrt(r);return[[(t*A+e*i)/(t*t+e*e),(e*A-t*i)/(t*t+e*e)],[(t*A-e*i)/(t*t+e*e),(e*A+t*i)/(t*t+e*e)]]}var Rr,Po=Math.PI/180;function nG(t,e,A){return(1-A)*t+A*e}function sG(t,e,A,r){return t+Math.cos(r/180*_a)*e+Math.sin(r/180*_a)*A}function oG(t,e,A,r){var i=1e-6,n=e-t,o=A-e,s=3*n+3*(r-A)-6*o,a=6*(o-n),c=3*n;return Math.abs(s)<i?[-c/a]:function(u,l,g){g===void 0&&(g=1e-6);var h=u*u/4-l;if(h<-g)return[];if(h<=g)return[-u/2];var p=Math.sqrt(h);return[-u/2-p,-u/2+p]}(a/s,c/s,i)}function aG(t,e,A,r,i){var n=1-i;return t*(n*n*n)+e*(3*n*n*i)+A*(3*n*i*i)+r*(i*i*i)}(function(t){function e(){return i(function(s,a,c){return s.relative&&(s.x1!==void 0&&(s.x1+=a),s.y1!==void 0&&(s.y1+=c),s.x2!==void 0&&(s.x2+=a),s.y2!==void 0&&(s.y2+=c),s.x!==void 0&&(s.x+=a),s.y!==void 0&&(s.y+=c),s.relative=!1),s})}function A(){var s=NaN,a=NaN,c=NaN,u=NaN;return i(function(l,g,h){return l.type&ze.SMOOTH_CURVE_TO&&(l.type=ze.CURVE_TO,s=isNaN(s)?g:s,a=isNaN(a)?h:a,l.x1=l.relative?g-s:2*g-s,l.y1=l.relative?h-a:2*h-a),l.type&ze.CURVE_TO?(s=l.relative?g+l.x2:l.x2,a=l.relative?h+l.y2:l.y2):(s=NaN,a=NaN),l.type&ze.SMOOTH_QUAD_TO&&(l.type=ze.QUAD_TO,c=isNaN(c)?g:c,u=isNaN(u)?h:u,l.x1=l.relative?g-c:2*g-c,l.y1=l.relative?h-u:2*h-u),l.type&ze.QUAD_TO?(c=l.relative?g+l.x1:l.x1,u=l.relative?h+l.y1:l.y1):(c=NaN,u=NaN),l})}function r(){var s=NaN,a=NaN;return i(function(c,u,l){if(c.type&ze.SMOOTH_QUAD_TO&&(c.type=ze.QUAD_TO,s=isNaN(s)?u:s,a=isNaN(a)?l:a,c.x1=c.relative?u-s:2*u-s,c.y1=c.relative?l-a:2*l-a),c.type&ze.QUAD_TO){s=c.relative?u+c.x1:c.x1,a=c.relative?l+c.y1:c.y1;var g=c.x1,h=c.y1;c.type=ze.CURVE_TO,c.x1=((c.relative?0:u)+2*g)/3,c.y1=((c.relative?0:l)+2*h)/3,c.x2=(c.x+2*g)/3,c.y2=(c.y+2*h)/3}else s=NaN,a=NaN;return c})}function i(s){var a=0,c=0,u=NaN,l=NaN;return function(g){if(isNaN(u)&&!(g.type&ze.MOVE_TO))throw new Error("path must start with moveto");var h=s(g,a,c,u,l);return g.type&ze.CLOSE_PATH&&(a=u,c=l),g.x!==void 0&&(a=g.relative?a+g.x:g.x),g.y!==void 0&&(c=g.relative?c+g.y:g.y),g.type&ze.MOVE_TO&&(u=a,l=c),h}}function n(s,a,c,u,l,g){return Qs(s,a,c,u,l,g),i(function(h,p,C,I){var E=h.x1,v=h.x2,m=h.relative&&!isNaN(I),M=h.x!==void 0?h.x:m?0:p,O=h.y!==void 0?h.y:m?0:C;function x(U){return U*U}h.type&ze.HORIZ_LINE_TO&&a!==0&&(h.type=ze.LINE_TO,h.y=h.relative?0:C),h.type&ze.VERT_LINE_TO&&c!==0&&(h.type=ze.LINE_TO,h.x=h.relative?0:p),h.x!==void 0&&(h.x=h.x*s+O*c+(m?0:l)),h.y!==void 0&&(h.y=M*a+h.y*u+(m?0:g)),h.x1!==void 0&&(h.x1=h.x1*s+h.y1*c+(m?0:l)),h.y1!==void 0&&(h.y1=E*a+h.y1*u+(m?0:g)),h.x2!==void 0&&(h.x2=h.x2*s+h.y2*c+(m?0:l)),h.y2!==void 0&&(h.y2=v*a+h.y2*u+(m?0:g));var P=s*u-a*c;if(h.xRot!==void 0&&(s!==1||a!==0||c!==0||u!==1))if(P===0)delete h.rX,delete h.rY,delete h.xRot,delete h.lArcFlag,delete h.sweepFlag,h.type=ze.LINE_TO;else{var D=h.xRot*Math.PI/180,T=Math.sin(D),q=Math.cos(D),Q=1/x(h.rX),R=1/x(h.rY),G=x(q)*Q+x(T)*R,k=2*T*q*(Q-R),te=x(T)*Q+x(q)*R,X=G*u*u-k*a*u+te*a*a,ie=k*(s*u+a*c)-2*(G*c*u+te*s*a),W=G*c*c-k*s*c+te*s*s,se=(Math.atan2(ie,X-W)+Math.PI)%Math.PI/2,Be=Math.sin(se),Ee=Math.cos(se);h.rX=Math.abs(P)/Math.sqrt(X*x(Ee)+ie*Be*Ee+W*x(Be)),h.rY=Math.abs(P)/Math.sqrt(X*x(Be)-ie*Be*Ee+W*x(Ee)),h.xRot=180*se/Math.PI}return h.sweepFlag!==void 0&&0>P&&(h.sweepFlag=+!h.sweepFlag),h})}function o(){return function(s){var a={};for(var c in s)a[c]=s[c];return a}}t.ROUND=function(s){function a(c){return Math.round(c*s)/s}return s===void 0&&(s=1e13),Qs(s),function(c){return c.x1!==void 0&&(c.x1=a(c.x1)),c.y1!==void 0&&(c.y1=a(c.y1)),c.x2!==void 0&&(c.x2=a(c.x2)),c.y2!==void 0&&(c.y2=a(c.y2)),c.x!==void 0&&(c.x=a(c.x)),c.y!==void 0&&(c.y=a(c.y)),c.rX!==void 0&&(c.rX=a(c.rX)),c.rY!==void 0&&(c.rY=a(c.rY)),c}},t.TO_ABS=e,t.TO_REL=function(){return i(function(s,a,c){return s.relative||(s.x1!==void 0&&(s.x1-=a),s.y1!==void 0&&(s.y1-=c),s.x2!==void 0&&(s.x2-=a),s.y2!==void 0&&(s.y2-=c),s.x!==void 0&&(s.x-=a),s.y!==void 0&&(s.y-=c),s.relative=!0),s})},t.NORMALIZE_HVZ=function(s,a,c){return s===void 0&&(s=!0),a===void 0&&(a=!0),c===void 0&&(c=!0),i(function(u,l,g,h,p){if(isNaN(h)&&!(u.type&ze.MOVE_TO))throw new Error("path must start with moveto");return a&&u.type&ze.HORIZ_LINE_TO&&(u.type=ze.LINE_TO,u.y=u.relative?0:g),c&&u.type&ze.VERT_LINE_TO&&(u.type=ze.LINE_TO,u.x=u.relative?0:l),s&&u.type&ze.CLOSE_PATH&&(u.type=ze.LINE_TO,u.x=u.relative?h-l:h,u.y=u.relative?p-g:p),u.type&ze.ARC&&(u.rX===0||u.rY===0)&&(u.type=ze.LINE_TO,delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag),u})},t.NORMALIZE_ST=A,t.QT_TO_C=r,t.INFO=i,t.SANITIZE=function(s){s===void 0&&(s=0),Qs(s);var a=NaN,c=NaN,u=NaN,l=NaN;return i(function(g,h,p,C,I){var E=Math.abs,v=!1,m=0,M=0;if(g.type&ze.SMOOTH_CURVE_TO&&(m=isNaN(a)?0:h-a,M=isNaN(c)?0:p-c),g.type&(ze.CURVE_TO|ze.SMOOTH_CURVE_TO)?(a=g.relative?h+g.x2:g.x2,c=g.relative?p+g.y2:g.y2):(a=NaN,c=NaN),g.type&ze.SMOOTH_QUAD_TO?(u=isNaN(u)?h:2*h-u,l=isNaN(l)?p:2*p-l):g.type&ze.QUAD_TO?(u=g.relative?h+g.x1:g.x1,l=g.relative?p+g.y1:g.y2):(u=NaN,l=NaN),g.type&ze.LINE_COMMANDS||g.type&ze.ARC&&(g.rX===0||g.rY===0||!g.lArcFlag)||g.type&ze.CURVE_TO||g.type&ze.SMOOTH_CURVE_TO||g.type&ze.QUAD_TO||g.type&ze.SMOOTH_QUAD_TO){var O=g.x===void 0?0:g.relative?g.x:g.x-h,x=g.y===void 0?0:g.relative?g.y:g.y-p;m=isNaN(u)?g.x1===void 0?m:g.relative?g.x:g.x1-h:u-h,M=isNaN(l)?g.y1===void 0?M:g.relative?g.y:g.y1-p:l-p;var P=g.x2===void 0?0:g.relative?g.x:g.x2-h,D=g.y2===void 0?0:g.relative?g.y:g.y2-p;E(O)<=s&&E(x)<=s&&E(m)<=s&&E(M)<=s&&E(P)<=s&&E(D)<=s&&(v=!0)}return g.type&ze.CLOSE_PATH&&E(h-C)<=s&&E(p-I)<=s&&(v=!0),v?[]:g})},t.MATRIX=n,t.ROTATE=function(s,a,c){a===void 0&&(a=0),c===void 0&&(c=0),Qs(s,a,c);var u=Math.sin(s),l=Math.cos(s);return n(l,u,-u,l,a-a*l+c*u,c-a*u-c*l)},t.TRANSLATE=function(s,a){return a===void 0&&(a=0),Qs(s,a),n(1,0,0,1,s,a)},t.SCALE=function(s,a){return a===void 0&&(a=s),Qs(s,a),n(s,0,0,a,0,0)},t.SKEW_X=function(s){return Qs(s),n(1,0,Math.atan(s),1,0,0)},t.SKEW_Y=function(s){return Qs(s),n(1,Math.atan(s),0,1,0,0)},t.X_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Qs(s),n(-1,0,0,1,s,0)},t.Y_AXIS_SYMMETRY=function(s){return s===void 0&&(s=0),Qs(s),n(1,0,0,-1,0,s)},t.A_TO_C=function(){return i(function(s,a,c){return ze.ARC===s.type?function(u,l,g){var h,p,C,I;u.cX||h1(u,l,g);for(var E=Math.min(u.phi1,u.phi2),v=Math.max(u.phi1,u.phi2)-E,m=Math.ceil(v/90),M=new Array(m),O=l,x=g,P=0;P<m;P++){var D=nG(u.phi1,u.phi2,P/m),T=nG(u.phi1,u.phi2,(P+1)/m),q=T-D,Q=4/3*Math.tan(q*Po/4),R=[Math.cos(D*Po)-Q*Math.sin(D*Po),Math.sin(D*Po)+Q*Math.cos(D*Po)],G=R[0],k=R[1],te=[Math.cos(T*Po),Math.sin(T*Po)],X=te[0],ie=te[1],W=[X+Q*Math.sin(T*Po),ie-Q*Math.cos(T*Po)],se=W[0],Be=W[1];M[P]={relative:u.relative,type:ze.CURVE_TO};var Ee=function(U,Y){var _=l1([U*u.rX,Y*u.rY],u.xRot),re=_[0],ae=_[1];return[u.cX+re,u.cY+ae]};h=Ee(G,k),M[P].x1=h[0],M[P].y1=h[1],p=Ee(se,Be),M[P].x2=p[0],M[P].y2=p[1],C=Ee(X,ie),M[P].x=C[0],M[P].y=C[1],u.relative&&(M[P].x1-=O,M[P].y1-=x,M[P].x2-=O,M[P].y2-=x,M[P].x-=O,M[P].y-=x),O=(I=[M[P].x,M[P].y])[0],x=I[1]}return M}(s,s.relative?0:a,s.relative?0:c):s})},t.ANNOTATE_ARCS=function(){return i(function(s,a,c){return s.relative&&(a=0,c=0),ze.ARC===s.type&&h1(s,a,c),s})},t.CLONE=o,t.CALCULATE_BOUNDS=function(){var s=function(g){var h={};for(var p in g)h[p]=g[p];return h},a=e(),c=r(),u=A(),l=i(function(g,h,p){var C=u(c(a(s(g))));function I(Be){Be>l.maxX&&(l.maxX=Be),Be<l.minX&&(l.minX=Be)}function E(Be){Be>l.maxY&&(l.maxY=Be),Be<l.minY&&(l.minY=Be)}if(C.type&ze.DRAWING_COMMANDS&&(I(h),E(p)),C.type&ze.HORIZ_LINE_TO&&I(C.x),C.type&ze.VERT_LINE_TO&&E(C.y),C.type&ze.LINE_TO&&(I(C.x),E(C.y)),C.type&ze.CURVE_TO){I(C.x),E(C.y);for(var v=0,m=oG(h,C.x1,C.x2,C.x);v<m.length;v++)0<(se=m[v])&&1>se&&I(aG(h,C.x1,C.x2,C.x,se));for(var M=0,O=oG(p,C.y1,C.y2,C.y);M<O.length;M++)0<(se=O[M])&&1>se&&E(aG(p,C.y1,C.y2,C.y,se))}if(C.type&ze.ARC){I(C.x),E(C.y),h1(C,h,p);for(var x=C.xRot/180*Math.PI,P=Math.cos(x)*C.rX,D=Math.sin(x)*C.rX,T=-Math.sin(x)*C.rY,q=Math.cos(x)*C.rY,Q=C.phi1<C.phi2?[C.phi1,C.phi2]:-180>C.phi2?[C.phi2+360,C.phi1+360]:[C.phi2,C.phi1],R=Q[0],G=Q[1],k=function(Be){var Ee=Be[0],U=Be[1],Y=180*Math.atan2(U,Ee)/Math.PI;return Y<R?Y+360:Y},te=0,X=iG(T,-P,0).map(k);te<X.length;te++)(se=X[te])>R&&se<G&&I(sG(C.cX,P,T,se));for(var ie=0,W=iG(q,-D,0).map(k);ie<W.length;ie++){var se;(se=W[ie])>R&&se<G&&E(sG(C.cY,D,q,se))}}return g});return l.minX=1/0,l.maxX=-1/0,l.minY=1/0,l.maxY=-1/0,l}})(Rr||(Rr={}));var Rs,cG=function(){function t(){}return t.prototype.round=function(e){return this.transform(Rr.ROUND(e))},t.prototype.toAbs=function(){return this.transform(Rr.TO_ABS())},t.prototype.toRel=function(){return this.transform(Rr.TO_REL())},t.prototype.normalizeHVZ=function(e,A,r){return this.transform(Rr.NORMALIZE_HVZ(e,A,r))},t.prototype.normalizeST=function(){return this.transform(Rr.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(Rr.QT_TO_C())},t.prototype.aToC=function(){return this.transform(Rr.A_TO_C())},t.prototype.sanitize=function(e){return this.transform(Rr.SANITIZE(e))},t.prototype.translate=function(e,A){return this.transform(Rr.TRANSLATE(e,A))},t.prototype.scale=function(e,A){return this.transform(Rr.SCALE(e,A))},t.prototype.rotate=function(e,A,r){return this.transform(Rr.ROTATE(e,A,r))},t.prototype.matrix=function(e,A,r,i,n,o){return this.transform(Rr.MATRIX(e,A,r,i,n,o))},t.prototype.skewX=function(e){return this.transform(Rr.SKEW_X(e))},t.prototype.skewY=function(e){return this.transform(Rr.SKEW_Y(e))},t.prototype.xSymmetry=function(e){return this.transform(Rr.X_AXIS_SYMMETRY(e))},t.prototype.ySymmetry=function(e){return this.transform(Rr.Y_AXIS_SYMMETRY(e))},t.prototype.annotateArcs=function(){return this.transform(Rr.ANNOTATE_ARCS())},t}(),Dye=function(t){return t===" "||t===" "||t==="\r"||t===`
266
+ `},uG=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},Tye=function(t){function e(){var A=t.call(this)||this;return A.curNumber="",A.curCommandType=-1,A.curCommandRelative=!1,A.canParseCommandOrComma=!0,A.curNumberHasExp=!1,A.curNumberHasExpDigits=!1,A.curNumberHasDecimal=!1,A.curArgs=[],A}return rG(e,t),e.prototype.finish=function(A){if(A===void 0&&(A=[]),this.parse(" ",A),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return A},e.prototype.parse=function(A,r){var i=this;r===void 0&&(r=[]);for(var n=function(l){r.push(l),i.curArgs.length=0,i.canParseCommandOrComma=!0},o=0;o<A.length;o++){var s=A[o],a=!(this.curCommandType!==ze.ARC||this.curArgs.length!==3&&this.curArgs.length!==4||this.curNumber.length!==1||this.curNumber!=="0"&&this.curNumber!=="1"),c=uG(s)&&(this.curNumber==="0"&&s==="0"||a);if(!uG(s)||c)if(s!=="e"&&s!=="E")if(s!=="-"&&s!=="+"||!this.curNumberHasExp||this.curNumberHasExpDigits)if(s!=="."||this.curNumberHasExp||this.curNumberHasDecimal||a){if(this.curNumber&&this.curCommandType!==-1){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+o);if(this.curCommandType===ze.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+o+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+o+'"')}this.curArgs.push(u),this.curArgs.length===Uye[this.curCommandType]&&(ze.HORIZ_LINE_TO===this.curCommandType?n({type:ze.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):ze.VERT_LINE_TO===this.curCommandType?n({type:ze.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===ze.MOVE_TO||this.curCommandType===ze.LINE_TO||this.curCommandType===ze.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),ze.MOVE_TO===this.curCommandType&&(this.curCommandType=ze.LINE_TO)):this.curCommandType===ze.CURVE_TO?n({type:ze.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===ze.SMOOTH_CURVE_TO?n({type:ze.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ze.QUAD_TO?n({type:ze.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===ze.ARC&&n({type:ze.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Dye(s))if(s===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(s!=="+"&&s!=="-"&&s!==".")if(c)this.curNumber=s,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+o+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+s+'" at index '+o+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,s!=="z"&&s!=="Z")if(s==="h"||s==="H")this.curCommandType=ze.HORIZ_LINE_TO,this.curCommandRelative=s==="h";else if(s==="v"||s==="V")this.curCommandType=ze.VERT_LINE_TO,this.curCommandRelative=s==="v";else if(s==="m"||s==="M")this.curCommandType=ze.MOVE_TO,this.curCommandRelative=s==="m";else if(s==="l"||s==="L")this.curCommandType=ze.LINE_TO,this.curCommandRelative=s==="l";else if(s==="c"||s==="C")this.curCommandType=ze.CURVE_TO,this.curCommandRelative=s==="c";else if(s==="s"||s==="S")this.curCommandType=ze.SMOOTH_CURVE_TO,this.curCommandRelative=s==="s";else if(s==="q"||s==="Q")this.curCommandType=ze.QUAD_TO,this.curCommandRelative=s==="q";else if(s==="t"||s==="T")this.curCommandType=ze.SMOOTH_QUAD_TO,this.curCommandRelative=s==="t";else{if(s!=="a"&&s!=="A")throw new SyntaxError('Unexpected character "'+s+'" at index '+o+".");this.curCommandType=ze.ARC,this.curCommandRelative=s==="a"}else r.push({type:ze.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=s,this.curNumberHasDecimal=s==="."}else this.curNumber+=s,this.curNumberHasDecimal=!0;else this.curNumber+=s;else this.curNumber+=s,this.curNumberHasExp=!0;else this.curNumber+=s,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(A){return Object.create(this,{parse:{value:function(r,i){i===void 0&&(i=[]);for(var n=0,o=Object.getPrototypeOf(this).parse.call(this,r);n<o.length;n++){var s=o[n],a=A(s);Array.isArray(a)?i.push.apply(i,a):i.push(a)}return i}}})},e}(cG),ze=function(t){function e(A){var r=t.call(this)||this;return r.commands=typeof A=="string"?e.parse(A):A,r}return rG(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var A=Rr.CALCULATE_BOUNDS();return this.transform(A),A},e.prototype.transform=function(A){for(var r=[],i=0,n=this.commands;i<n.length;i++){var o=A(n[i]);Array.isArray(o)?r.push.apply(r,o):r.push(o)}return this.commands=r,this},e.encode=function(A){return Rye(A)},e.parse=function(A){var r=new Tye,i=[];return r.parse(A,i),r.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(cG),Uye=((Rs={})[ze.MOVE_TO]=2,Rs[ze.LINE_TO]=2,Rs[ze.HORIZ_LINE_TO]=1,Rs[ze.VERT_LINE_TO]=1,Rs[ze.CLOSE_PATH]=0,Rs[ze.QUAD_TO]=4,Rs[ze.SMOOTH_QUAD_TO]=2,Rs[ze.CURVE_TO]=6,Rs[ze.SMOOTH_CURVE_TO]=4,Rs[ze.ARC]=7,Rs),Lye=uv.PROPER,Fye=Eu,Oye=Zi,lG=eo,bye=ir,xye=OQ,g1="toString",hG=RegExp.prototype,gG=hG[g1],Nye=bye(function(){return gG.call({source:"a",flags:"b"})!=="/a/b"}),Kye=Lye&&gG.name!==g1;(Nye||Kye)&&Fye(hG,g1,function(){var e=Oye(this),A=lG(e.source),r=lG(xye(e));return"/"+A+"/"+r},{unsafe:!0});function Jv(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Jv=function(e){return typeof e}:Jv=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jv(t)}function kye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Pye=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Gye=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function jye(t,e,A,r,i){if(typeof t=="string"&&(t=document.getElementById(t)),!t||Jv(t)!=="object"||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var n=t.getContext("2d");try{return n.getImageData(e,A,r,i)}catch(o){throw new Error("unable to access image data: "+o)}}function Yye(t,e,A,r,i,n){if(!(isNaN(n)||n<1)){n|=0;var o=jye(t,e,A,r,i);o=Hye(o,e,A,r,i,n),t.getContext("2d").putImageData(o,e,A)}}function Hye(t,e,A,r,i,n){for(var o=t.data,s=2*n+1,a=r-1,c=i-1,u=n+1,l=u*(u+1)/2,g=new dG,h=g,p,C=1;C<s;C++)h=h.next=new dG,C===u&&(p=h);h.next=g;for(var I=null,E=null,v=0,m=0,M=Pye[n],O=Gye[n],x=0;x<i;x++){h=g;for(var P=o[m],D=o[m+1],T=o[m+2],q=o[m+3],Q=0;Q<u;Q++)h.r=P,h.g=D,h.b=T,h.a=q,h=h.next;for(var R=0,G=0,k=0,te=0,X=u*P,ie=u*D,W=u*T,se=u*q,Be=l*P,Ee=l*D,U=l*T,Y=l*q,_=1;_<u;_++){var re=m+((a<_?a:_)<<2),ae=o[re],Z=o[re+1],ce=o[re+2],oe=o[re+3],de=u-_;Be+=(h.r=ae)*de,Ee+=(h.g=Z)*de,U+=(h.b=ce)*de,Y+=(h.a=oe)*de,R+=ae,G+=Z,k+=ce,te+=oe,h=h.next}I=g,E=p;for(var De=0;De<r;De++){var j=Y*M>>>O;if(o[m+3]=j,j!==0){var J=255/j;o[m]=(Be*M>>>O)*J,o[m+1]=(Ee*M>>>O)*J,o[m+2]=(U*M>>>O)*J}else o[m]=o[m+1]=o[m+2]=0;Be-=X,Ee-=ie,U-=W,Y-=se,X-=I.r,ie-=I.g,W-=I.b,se-=I.a;var z=De+n+1;z=v+(z<a?z:a)<<2,R+=I.r=o[z],G+=I.g=o[z+1],k+=I.b=o[z+2],te+=I.a=o[z+3],Be+=R,Ee+=G,U+=k,Y+=te,I=I.next;var b=E,Me=b.r,Qe=b.g,Te=b.b,Ce=b.a;X+=Me,ie+=Qe,W+=Te,se+=Ce,R-=Me,G-=Qe,k-=Te,te-=Ce,E=E.next,m+=4}v+=r}for(var Re=0;Re<r;Re++){m=Re<<2;var ve=o[m],Ke=o[m+1],Ue=o[m+2],ke=o[m+3],Ye=u*ve,Je=u*Ke,rt=u*Ue,Ze=u*ke,We=l*ve,At=l*Ke,_e=l*Ue,It=l*ke;h=g;for(var yt=0;yt<u;yt++)h.r=ve,h.g=Ke,h.b=Ue,h.a=ke,h=h.next;for(var tt=r,et=0,St=0,ct=0,Rt=0,Ge=1;Ge<=n;Ge++){m=tt+Re<<2;var Jt=u-Ge;We+=(h.r=ve=o[m])*Jt,At+=(h.g=Ke=o[m+1])*Jt,_e+=(h.b=Ue=o[m+2])*Jt,It+=(h.a=ke=o[m+3])*Jt,Rt+=ve,et+=Ke,St+=Ue,ct+=ke,h=h.next,Ge<c&&(tt+=r)}m=Re,I=g,E=p;for(var oA=0;oA<i;oA++){var Qt=m<<2;o[Qt+3]=ke=It*M>>>O,ke>0?(ke=255/ke,o[Qt]=(We*M>>>O)*ke,o[Qt+1]=(At*M>>>O)*ke,o[Qt+2]=(_e*M>>>O)*ke):o[Qt]=o[Qt+1]=o[Qt+2]=0,We-=Ye,At-=Je,_e-=rt,It-=Ze,Ye-=I.r,Je-=I.g,rt-=I.b,Ze-=I.a,Qt=Re+((Qt=oA+u)<c?Qt:c)*r<<2,We+=Rt+=I.r=o[Qt],At+=et+=I.g=o[Qt+1],_e+=St+=I.b=o[Qt+2],It+=ct+=I.a=o[Qt+3],I=I.next,Ye+=ve=E.r,Je+=Ke=E.g,rt+=Ue=E.b,Ze+=ke=E.a,Rt-=ve,et-=Ke,St-=Ue,ct-=ke,E=E.next,m+=r}}return t}var dG=function t(){kye(this,t),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null};function zye(){var{DOMParser:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas(A,r){return new OffscreenCanvas(A,r)},createImage(A){return Ko(function*(){var r=yield fetch(A),i=yield r.blob(),n=yield createImageBitmap(i);return n})()}};return(typeof DOMParser<"u"||typeof t>"u")&&Reflect.deleteProperty(e,"DOMParser"),e}function Jye(t){var{DOMParser:e,canvas:A,fetch:r}=t;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:A.createCanvas,createImage:A.loadImage}}var qye=Object.freeze({__proto__:null,offscreen:zye,node:Jye});function Su(t){return t.replace(/(?!\u3000)\s+/gm," ")}function pG(t){return t.replace(/^[\n \t]+/,"")}function fG(t){return t.replace(/[\n \t]+$/,"")}function gn(t){var e=(t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var Vye=/^[A-Z-]+$/;function EG(t){return Vye.test(t)?t.toLowerCase():t}function d1(t){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t)||[];return e[2]||e[3]||e[4]}function CG(t){if(!t.startsWith("rgb"))return t;var e=3,A=t.replace(/\d+(\.\d+)?/g,(r,i)=>e--&&i?String(Math.round(parseFloat(r))):r);return A}var Wye=/(\[[^\]]+\])/g,Zye=/(#[^\s+>~.[:]+)/g,Xye=/(\.[^\s+>~.[:]+)/g,_ye=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,$ye=/(:[\w-]+\([^)]*\))/gi,eQe=/(:[^\s+>~.[:]+)/g,tQe=/([^\s+>~.[:]+)/g;function mu(t,e){var A=e.exec(t);return A?[t.replace(e," "),A.length]:[t,0]}function IG(t){var e=[0,0,0],A=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[A,r]=mu(A,Wye),e[1]+=r,[A,r]=mu(A,Zye),e[0]+=r,[A,r]=mu(A,Xye),e[1]+=r,[A,r]=mu(A,_ye),e[2]+=r,[A,r]=mu(A,$ye),e[1]+=r,[A,r]=mu(A,eQe),e[1]+=r,A=A.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[A,r]=mu(A,tQe),e[2]+=r,e.join("")}var Mu=1e-8;function p1(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function qv(t,e){return(t[0]*e[0]+t[1]*e[1])/(p1(t)*p1(e))}function f1(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(qv(t,e))}function E1(t){return t*t*t}function C1(t){return 3*t*t*(1-t)}function I1(t){return 3*t*(1-t)*(1-t)}function B1(t){return(1-t)*(1-t)*(1-t)}function v1(t){return t*t}function w1(t){return 2*t*(1-t)}function S1(t){return(1-t)*(1-t)}class wt{constructor(e,A,r){this.document=e,this.name=A,this.value=r,this.isNormalizedColor=!1}static empty(e){return new wt(e,"EMPTY","")}split(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:" ",{document:A,name:r}=this;return Su(this.getString()).trim().split(e).map(i=>new wt(A,r,i))}hasValue(e){var{value:A}=this;return A!==null&&A!==""&&(e||A!==0)&&typeof A<"u"}isString(e){var{value:A}=this,r=typeof A=="string";return!r||!e?r:e.test(A)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:A}=this,r=parseFloat(A);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var A=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,A=CG(A),this.value=A),A}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;var[r,i]=typeof e=="boolean"?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&i):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(r);default:{var o=this.getNumber();return A&&o<1?o*n.computeSize(r):o}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),A=/#([^)'"]+)/.exec(e);return A&&(A=A[1]),A||(A=e),this.document.definitions[A]}getFillStyleDefinition(e,A){var r=this.getDefinition();if(!r)return null;if(typeof r.createGradient=="function")return r.createGradient(this.document.ctx,e,A);if(typeof r.createPattern=="function"){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,A)}return null}getTextBaseline(){return this.hasValue()?wt.textBaselineMapping[this.getString()]:null}addOpacity(e){for(var A=this.getColor(),r=A.length,i=0,n=0;n<r&&(A[n]===","&&i++,i!==3);n++);if(e.hasValue()&&this.isString()&&i!==3){var o=new c1(A);o.ok&&(o.alpha=e.getNumber(),A=o.toRGBA())}return new wt(this.document,this.name,A)}}wt.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class BG{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,A){this.viewPorts.push({width:e,height:A})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return typeof e=="number"?e:e==="x"?this.width:e==="y"?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class sr{constructor(e,A){this.x=e,this.y=A}static parse(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,[r=A,i=A]=gn(e);return new sr(r,i)}static parseScale(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,[r=A,i=r]=gn(e);return new sr(r,i)}static parsePath(e){for(var A=gn(e),r=A.length,i=[],n=0;n<r;n+=2)i.push(new sr(A[n],A[n+1]));return i}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:A,y:r}=this,i=A*e[0]+r*e[2]+e[4],n=A*e[1]+r*e[3]+e[5];this.x=i,this.y=n}}class vG{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:A,onMouseMove:r}=this,i=e.ctx.canvas;i.onclick=A,i.onmousemove=r,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:A,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),A.forEach((n,o)=>{for(var{run:s}=n,a=r[o];a;)s(a),a=a.parent}),this.events=[],this.eventElements=[]}}checkPath(e,A){if(!(!this.working||!A)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:a}=n;!i[o]&&A.isPointInPath&&A.isPointInPath(s,a)&&(i[o]=e)})}}checkBoundingBox(e,A){if(!(!this.working||!A)){var{events:r,eventElements:i}=this;r.forEach((n,o)=>{var{x:s,y:a}=n;!i[o]&&A.isPointInBox(s,a)&&(i[o]=e)})}}mapXY(e,A){for(var{window:r,ctx:i}=this.screen,n=new sr(e,A),o=i.canvas;o;)n.x-=o.offsetLeft,n.y-=o.offsetTop,o=o.offsetParent;return r.scrollX&&(n.x+=r.scrollX),r.scrollY&&(n.y+=r.scrollY),n}onClick(e){var{x:A,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:A,y:r,run(i){i.onClick&&i.onClick()}})}onMouseMove(e){var{x:A,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:A,y:r,run(i){i.onMouseMove&&i.onMouseMove()}})}}var wG=typeof window<"u"?window:null,SG=typeof fetch<"u"?fetch.bind(void 0):null;class Lf{constructor(e){var{fetch:A=SG,window:r=wG}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new BG,this.mouse=new vG(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=A}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every(A=>A());return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:A,ctx:r,aspectRatio:i,width:n,desiredWidth:o,height:s,desiredHeight:a,minX:c=0,minY:u=0,refX:l,refY:g,clip:h=!1,clipX:p=0,clipY:C=0}=e,I=Su(i).replace(/^defer\s/,""),[E,v]=I.split(" "),m=E||"xMidYMid",M=v||"meet",O=n/o,x=s/a,P=Math.min(O,x),D=Math.max(O,x),T=o,q=a;M==="meet"&&(T*=P,q*=P),M==="slice"&&(T*=D,q*=D);var Q=new wt(A,"refX",l),R=new wt(A,"refY",g),G=Q.hasValue()&&R.hasValue();if(G&&r.translate(-P*Q.getPixels("x"),-P*R.getPixels("y")),h){var k=P*p,te=P*C;r.beginPath(),r.moveTo(k,te),r.lineTo(n,te),r.lineTo(n,s),r.lineTo(k,s),r.closePath(),r.clip()}if(!G){var X=M==="meet"&&P===x,ie=M==="slice"&&D===x,W=M==="meet"&&P===O,se=M==="slice"&&D===O;m.startsWith("xMid")&&(X||ie)&&r.translate(n/2-T/2,0),m.endsWith("YMid")&&(W||se)&&r.translate(0,s/2-q/2),m.startsWith("xMax")&&(X||ie)&&r.translate(n-T,0),m.endsWith("YMax")&&(W||se)&&r.translate(0,s-q)}switch(!0){case m==="none":r.scale(O,x);break;case M==="meet":r.scale(P,P);break;case M==="slice":r.scale(D,D);break}r.translate(-c,-u)}start(e){var{enableRedraw:A=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:n=!1,ignoreClear:o=!1,forceRedraw:s,scaleWidth:a,scaleHeight:c,offsetX:u,offsetY:l}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{FRAMERATE:g,mouse:h}=this,p=1e3/g;if(this.frameDuration=p,this.readyPromise=new Promise(m=>{this.resolveReady=m}),this.isReady()&&this.render(e,n,o,a,c,u,l),!!A){var C=Date.now(),I=C,E=0,v=()=>{C=Date.now(),E=C-I,E>=p&&(I=C-E%p,this.shouldUpdate(i,s)&&(this.render(e,n,o,a,c,u,l),h.runEvents())),this.intervalId=s1(v)};r||h.start(),this.intervalId=s1(v)}}stop(){this.intervalId&&(s1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,A){if(!e){var{frameDuration:r}=this,i=this.animations.reduce((n,o)=>o.update(r)||n,!1);if(i)return!0}return!!(typeof A=="function"&&A()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,A,r,i,n,o,s){var{CLIENT_WIDTH:a,CLIENT_HEIGHT:c,viewPort:u,ctx:l,isFirstRender:g}=this,h=l.canvas;u.clear(),h.width&&h.height?u.setCurrent(h.width,h.height):u.setCurrent(a,c);var p=e.getStyle("width"),C=e.getStyle("height");!A&&(g||typeof i!="number"&&typeof n!="number")&&(p.hasValue()&&(h.width=p.getPixels("x"),h.style&&(h.style.width="".concat(h.width,"px"))),C.hasValue()&&(h.height=C.getPixels("y"),h.style&&(h.style.height="".concat(h.height,"px"))));var I=h.clientWidth||h.width,E=h.clientHeight||h.height;if(A&&p.hasValue()&&C.hasValue()&&(I=p.getPixels("x"),E=C.getPixels("y")),u.setCurrent(I,E),typeof o=="number"&&e.getAttribute("x",!0).setValue(o),typeof s=="number"&&e.getAttribute("y",!0).setValue(s),typeof i=="number"||typeof n=="number"){var v=gn(e.getAttribute("viewBox").getString()),m=0,M=0;if(typeof i=="number"){var O=e.getStyle("width");O.hasValue()?m=O.getPixels("x")/i:isNaN(v[2])||(m=v[2]/i)}if(typeof n=="number"){var x=e.getStyle("height");x.hasValue()?M=x.getPixels("y")/n:isNaN(v[3])||(M=v[3]/n)}m||(m=M),M||(M=m),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(n);var P=e.getStyle("transform",!0,!0);P.setValue("".concat(P.getString()," scale(").concat(1/m,", ").concat(1/M,")"))}r||l.clearRect(0,0,I,E),e.render(l),g&&(this.isFirstRender=!1)}}Lf.defaultWindow=wG,Lf.defaultFetch=SG;var{defaultFetch:AQe}=Lf,rQe=typeof DOMParser<"u"?DOMParser:null;class Vv{constructor(){var{fetch:e=AQe,DOMParser:A=rQe}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.fetch=e,this.DOMParser=A}parse(e){var A=this;return Ko(function*(){return e.startsWith("<")?A.parseFromString(e):A.load(e)})()}parseFromString(e){var A=new this.DOMParser;try{return this.checkDocument(A.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(A.parseFromString(e,"text/xml"))}}checkDocument(e){var A=e.getElementsByTagName("parsererror")[0];if(A)throw new Error(A.textContent);return e}load(e){var A=this;return Ko(function*(){var r=yield A.fetch(e),i=yield r.text();return A.parseFromString(i)})()}}class mG{constructor(e,A){this.type="translate",this.point=null,this.point=sr.parse(A)}apply(e){var{x:A,y:r}=this.point;e.translate(A||0,r||0)}unapply(e){var{x:A,y:r}=this.point;e.translate(-1*A||0,-1*r||0)}applyToPoint(e){var{x:A,y:r}=this.point;e.applyTransform([1,0,0,1,A||0,r||0])}}class MG{constructor(e,A,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=gn(A);this.angle=new wt(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:A,cy:r,originX:i,originY:n,angle:o}=this,s=A+i.getPixels("x"),a=r+n.getPixels("y");e.translate(s,a),e.rotate(o.getRadians()),e.translate(-s,-a)}unapply(e){var{cx:A,cy:r,originX:i,originY:n,angle:o}=this,s=A+i.getPixels("x"),a=r+n.getPixels("y");e.translate(s,a),e.rotate(-1*o.getRadians()),e.translate(-s,-a)}applyToPoint(e){var{cx:A,cy:r,angle:i}=this,n=i.getRadians();e.applyTransform([1,0,0,1,A||0,r||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-A||0,-r||0])}}class yG{constructor(e,A,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=sr.parseScale(A);(i.x===0||i.y===0)&&(i.x=Mu,i.y=Mu),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:A,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(A,r||A),e.translate(-o,-s)}unapply(e){var{scale:{x:A,y:r},originX:i,originY:n}=this,o=i.getPixels("x"),s=n.getPixels("y");e.translate(o,s),e.scale(1/A,1/r||A),e.translate(-o,-s)}applyToPoint(e){var{x:A,y:r}=this.scale;e.applyTransform([A||0,0,0,r||0,0,0])}}class m1{constructor(e,A,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=gn(A),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:A,originY:r,matrix:i}=this,n=A.getPixels("x"),o=r.getPixels("y");e.translate(n,o),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-n,-o)}unapply(e){var{originX:A,originY:r,matrix:i}=this,n=i[0],o=i[2],s=i[4],a=i[1],c=i[3],u=i[5],l=0,g=0,h=1,p=1/(n*(c*h-u*g)-o*(a*h-u*l)+s*(a*g-c*l)),C=A.getPixels("x"),I=r.getPixels("y");e.translate(C,I),e.transform(p*(c*h-u*g),p*(u*l-a*h),p*(s*g-o*h),p*(n*h-s*l),p*(o*u-s*c),p*(s*a-n*u)),e.translate(-C,-I)}applyToPoint(e){e.applyTransform(this.matrix)}}class M1 extends m1{constructor(e,A,r){super(e,A,r),this.type="skew",this.angle=null,this.angle=new wt(e,"angle",A)}}class QG extends M1{constructor(e,A,r){super(e,A,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class RG extends M1{constructor(e,A,r){super(e,A,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function iQe(t){return Su(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function nQe(t){var[e,A]=t.split("(");return[e.trim(),A.trim().replace(")","")]}class $a{constructor(e,A,r){this.document=e,this.transforms=[];var i=iQe(A);i.forEach(n=>{if(n!=="none"){var[o,s]=nQe(n),a=$a.transformTypes[o];typeof a<"u"&&this.transforms.push(new a(this.document,s,r))}})}static fromElement(e,A){var r=A.getStyle("transform",!1,!0),[i,n=i]=A.getStyle("transform-origin",!1,!0).split(),o=[i,n];return r.hasValue()?new $a(e,r.getString(),o):null}apply(e){for(var{transforms:A}=this,r=A.length,i=0;i<r;i++)A[i].apply(e)}unapply(e){for(var{transforms:A}=this,r=A.length,i=r-1;i>=0;i--)A[i].unapply(e)}applyToPoint(e){for(var{transforms:A}=this,r=A.length,i=0;i<r;i++)A[i].applyToPoint(e)}}$a.transformTypes={translate:mG,rotate:MG,scale:yG,matrix:m1,skewX:QG,skewY:RG};let XA=class dR{constructor(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.document=e,this.node=A,this.captureTextNodes=r,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!(!A||A.nodeType!==1)){if(Array.from(A.attributes).forEach(s=>{var a=EG(s.nodeName);this.attributes[a]=new wt(e,a,s.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map(s=>s.trim());i.forEach(s=>{if(s){var[a,c]=s.split(":").map(u=>u.trim());this.styles[a]=new wt(e,a,c)}})}var{definitions:n}=e,o=this.getAttribute("id");o.hasValue()&&(n[o.getString()]||(n[o.getString()]=this)),Array.from(A.childNodes).forEach(s=>{if(s.nodeType===1)this.addChild(s);else if(r&&(s.nodeType===3||s.nodeType===4)){var a=e.createTextNode(s);a.getText().length>0&&this.addChild(a)}})}}getAttribute(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=this.attributes[e];if(!r&&A){var i=new wt(this.document,e,"");return this.attributes[e]=i,i}return r||wt.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if(e==="href"||e.endsWith(":href"))return this.attributes[e];return wt.empty(this.document)}getStyle(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.styles[e];if(i)return i;var n=this.getAttribute(e);if(n!=null&&n.hasValue())return this.styles[e]=n,n;if(!r){var{parent:o}=this;if(o){var s=o.getStyle(e);if(s!=null&&s.hasValue())return s}}if(A){var a=new wt(this.document,e,"");return this.styles[e]=a,a}return i||wt.empty(this.document)}render(e){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(e.save(),this.getStyle("mask").hasValue()){var A=this.getStyle("mask").getDefinition();A&&(this.applyEffects(e),A.apply(e,this))}else if(this.getStyle("filter").getValue("none")!=="none"){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var A=$a.fromElement(this.document,this);A&&A.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach(A=>{A.render(e)})}addChild(e){var A=e instanceof dR?e:this.document.createElement(e);A.parent=this,dR.ignoreChildTypes.includes(A.type)||this.children.push(A)}matchesSelector(e){var A,{node:r}=this;if(typeof r.matches=="function")return r.matches(e);var i=(A=r.getAttribute)===null||A===void 0?void 0:A.call(r,"class");return!i||i===""?!1:i.split(" ").some(n=>".".concat(n)===e)}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:A}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],n=A[r];if(i)for(var o in i){var s=this.stylesSpecificity[o];typeof s>"u"&&(s="000"),n>=s&&(this.styles[o]=i[o],this.stylesSpecificity[o]=n)}}}removeStyles(e,A){var r=A.reduce((i,n)=>{var o=e.getStyle(n);if(!o.hasValue())return i;var s=o.getString();return o.setValue(""),[...i,[n,s]]},[]);return r}restoreStyles(e,A){A.forEach(r=>{var[i,n]=r;e.getStyle(i,!0).setValue(n)})}isFirstChild(){var e;return((e=this.parent)===null||e===void 0?void 0:e.children.indexOf(this))===0}};XA.ignoreChildTypes=["title"];class DG extends XA{constructor(e,A,r){super(e,A,r)}}function sQe(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function oQe(t){return typeof process>"u"?t:t.trim().split(",").map(sQe).join(",")}function aQe(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function cQe(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class xi{constructor(e,A,r,i,n,o){var s=o?typeof o=="string"?xi.parse(o):o:{};this.fontFamily=n||s.fontFamily,this.fontSize=i||s.fontSize,this.fontStyle=e||s.fontStyle,this.fontWeight=r||s.fontWeight,this.fontVariant=A||s.fontVariant}static parse(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",A=arguments.length>1?arguments[1]:void 0,r="",i="",n="",o="",s="",a=Su(e).trim().split(" "),c={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return a.forEach(u=>{switch(!0){case(!c.fontStyle&&xi.styles.includes(u)):u!=="inherit"&&(r=u),c.fontStyle=!0;break;case(!c.fontVariant&&xi.variants.includes(u)):u!=="inherit"&&(i=u),c.fontStyle=!0,c.fontVariant=!0;break;case(!c.fontWeight&&xi.weights.includes(u)):u!=="inherit"&&(n=u),c.fontStyle=!0,c.fontVariant=!0,c.fontWeight=!0;break;case!c.fontSize:u!=="inherit"&&([o]=u.split("/")),c.fontStyle=!0,c.fontVariant=!0,c.fontWeight=!0,c.fontSize=!0;break;default:u!=="inherit"&&(s+=u)}}),new xi(r,i,n,o,s,A)}toString(){return[aQe(this.fontStyle),this.fontVariant,cQe(this.fontWeight),this.fontSize,oQe(this.fontFamily)].join(" ").trim()}}xi.styles="normal|italic|oblique|inherit",xi.variants="normal|small-caps|inherit",xi.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class es{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.NaN,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.NaN,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Number.NaN,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Number.NaN;this.x1=e,this.y1=A,this.x2=r,this.y2=i,this.addPoint(e,A),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,A){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof A<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=A,this.y2=A),A<this.y1&&(this.y1=A),A>this.y2&&(this.y2=A))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:A,y1:r,x2:i,y2:n}=e;this.addPoint(A,r),this.addPoint(i,n)}}sumCubic(e,A,r,i,n){return Math.pow(1-e,3)*A+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*n}bezierCurveAdd(e,A,r,i,n){var o=6*A-12*r+6*i,s=-3*A+9*r-9*i+3*n,a=3*r-3*A;if(s===0){if(o===0)return;var c=-a/o;0<c&&c<1&&(e?this.addX(this.sumCubic(c,A,r,i,n)):this.addY(this.sumCubic(c,A,r,i,n)));return}var u=Math.pow(o,2)-4*a*s;if(!(u<0)){var l=(-o+Math.sqrt(u))/(2*s);0<l&&l<1&&(e?this.addX(this.sumCubic(l,A,r,i,n)):this.addY(this.sumCubic(l,A,r,i,n)));var g=(-o-Math.sqrt(u))/(2*s);0<g&&g<1&&(e?this.addX(this.sumCubic(g,A,r,i,n)):this.addY(this.sumCubic(g,A,r,i,n)))}}addBezierCurve(e,A,r,i,n,o,s,a){this.addPoint(e,A),this.addPoint(s,a),this.bezierCurveAdd(!0,e,r,n,s),this.bezierCurveAdd(!1,A,i,o,a)}addQuadraticCurve(e,A,r,i,n,o){var s=e+.6666666666666666*(r-e),a=A+2/3*(i-A),c=s+1/3*(n-e),u=a+1/3*(o-A);this.addBezierCurve(e,A,s,c,a,u,n,o)}isPointInBox(e,A){var{x1:r,y1:i,x2:n,y2:o}=this;return r<=e&&e<=n&&i<=A&&A<=o}}class jt extends ze{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new sr(0,0),this.control=new sr(0,0),this.current=new sr(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:A}=this;return e>=A.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y",r=new sr(this.command[e],this.command[A]);return this.makeAbsolute(r)}getAsControlPoint(e,A){var r=this.getPoint(e,A);return this.control=r,r}getAsCurrentPoint(e,A){var r=this.getPoint(e,A);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==ze.CURVE_TO&&e!==ze.SMOOTH_CURVE_TO&&e!==ze.QUAD_TO&&e!==ze.SMOOTH_QUAD_TO)return this.current;var{current:{x:A,y:r},control:{x:i,y:n}}=this,o=new sr(2*A-i,2*r-n);return o}makeAbsolute(e){if(this.command.relative){var{x:A,y:r}=this.current;e.x+=A,e.y+=r}return e}addMarker(e,A,r){var{points:i,angles:n}=this;r&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,A?A.angleTo(e):null)}addMarkerAngle(e,A){this.points.push(e),this.angles.push(A)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,A=e.length,r=0;r<A;r++)if(!e[r]){for(var i=r+1;i<A;i++)if(e[i]){e[r]=e[i];break}}return e}}class ec extends XA{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,A=this;A;){var r=A.getStyle("opacity",!1,!0);r.hasValue(!0)&&(e*=r.getNumber()),A=A.parent}return e}setContext(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!A){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),o=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){r.getString()==="currentColor"&&r.setValue(this.getStyle("color").getColor());var a=r.getColor();a!=="inherit"&&(e.fillStyle=a==="none"?"rgba(0,0,0,0)":a)}if(i.hasValue()){var c=new wt(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=c}if(n.isUrlDefinition()){var u=n.getFillStyleDefinition(this,o);u&&(e.strokeStyle=u)}else if(n.hasValue()){n.getString()==="currentColor"&&n.setValue(this.getStyle("color").getColor());var l=n.getString();l!=="inherit"&&(e.strokeStyle=l==="none"?"rgba(0,0,0,0)":l)}if(o.hasValue()){var g=new wt(this.document,"stroke",e.strokeStyle).addOpacity(o).getString();e.strokeStyle=g}var h=this.getStyle("stroke-width");if(h.hasValue()){var p=h.getPixels();e.lineWidth=p||Mu}var C=this.getStyle("stroke-linecap"),I=this.getStyle("stroke-linejoin"),E=this.getStyle("stroke-miterlimit"),v=this.getStyle("stroke-dasharray"),m=this.getStyle("stroke-dashoffset");if(C.hasValue()&&(e.lineCap=C.getString()),I.hasValue()&&(e.lineJoin=I.getString()),E.hasValue()&&(e.miterLimit=E.getNumber()),v.hasValue()&&v.getString()!=="none"){var M=gn(v.getString());typeof e.setLineDash<"u"?e.setLineDash(M):typeof e.webkitLineDash<"u"?e.webkitLineDash=M:typeof e.mozDash<"u"&&!(M.length===1&&M[0]===0)&&(e.mozDash=M);var O=m.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=O:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=O:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=O)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var x=this.getStyle("font"),P=this.getStyle("font-style"),D=this.getStyle("font-variant"),T=this.getStyle("font-weight"),q=this.getStyle("font-size"),Q=this.getStyle("font-family"),R=new xi(P.getString(),D.getString(),T.getString(),q.hasValue()?"".concat(q.getPixels(!0),"px"):"",Q.getString(),xi.parse(x.getString(),e.font));P.setValue(R.fontStyle),D.setValue(R.fontVariant),T.setValue(R.fontWeight),q.setValue(R.fontSize),Q.setValue(R.fontFamily),e.font=R.toString(),q.isPixels()&&(this.document.emSize=q.getPixels(),this.modifiedEmSizeStack=!0)}A||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}}class MA extends ec{constructor(e,A,r){super(e,A,r),this.type="path",this.pathParser=null,this.pathParser=new jt(this.getAttribute("d").getString())}path(e){var{pathParser:A}=this,r=new es;for(A.reset(),e&&e.beginPath();!A.isEnd();)switch(A.next().type){case jt.MOVE_TO:this.pathM(e,r);break;case jt.LINE_TO:this.pathL(e,r);break;case jt.HORIZ_LINE_TO:this.pathH(e,r);break;case jt.VERT_LINE_TO:this.pathV(e,r);break;case jt.CURVE_TO:this.pathC(e,r);break;case jt.SMOOTH_CURVE_TO:this.pathS(e,r);break;case jt.QUAD_TO:this.pathQ(e,r);break;case jt.SMOOTH_QUAD_TO:this.pathT(e,r);break;case jt.ARC:this.pathA(e,r);break;case jt.CLOSE_PATH:this.pathZ(e,r);break}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,A=e.getMarkerPoints(),r=e.getMarkerAngles(),i=A.map((n,o)=>[n,r[o]]);return i}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var A=this.getStyle("fill-rule");e.fillStyle!==""&&(A.getString("inherit")!=="inherit"?e.fill(A.getString()):e.fill()),e.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,n=this.getStyle("marker-start"),o=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var a=n.getDefinition(),[c,u]=r[0];a.render(e,c,u)}if(o.isUrlDefinition())for(var l=o.getDefinition(),g=1;g<i;g++){var[h,p]=r[g];l.render(e,h,p)}if(s.isUrlDefinition()){var C=s.getDefinition(),[I,E]=r[i];C.render(e,I,E)}}}static pathM(e){var A=e.getAsCurrentPoint();return e.start=e.current,{point:A}}pathM(e,A){var{pathParser:r}=this,{point:i}=MA.pathM(r),{x:n,y:o}=i;r.addMarker(i),A.addPoint(n,o),e&&e.moveTo(n,o)}static pathL(e){var{current:A}=e,r=e.getAsCurrentPoint();return{current:A,point:r}}pathL(e,A){var{pathParser:r}=this,{current:i,point:n}=MA.pathL(r),{x:o,y:s}=n;r.addMarker(n,i),A.addPoint(o,s),e&&e.lineTo(o,s)}static pathH(e){var{current:A,command:r}=e,i=new sr((r.relative?A.x:0)+r.x,A.y);return e.current=i,{current:A,point:i}}pathH(e,A){var{pathParser:r}=this,{current:i,point:n}=MA.pathH(r),{x:o,y:s}=n;r.addMarker(n,i),A.addPoint(o,s),e&&e.lineTo(o,s)}static pathV(e){var{current:A,command:r}=e,i=new sr(A.x,(r.relative?A.y:0)+r.y);return e.current=i,{current:A,point:i}}pathV(e,A){var{pathParser:r}=this,{current:i,point:n}=MA.pathV(r),{x:o,y:s}=n;r.addMarker(n,i),A.addPoint(o,s),e&&e.lineTo(o,s)}static pathC(e){var{current:A}=e,r=e.getPoint("x1","y1"),i=e.getAsControlPoint("x2","y2"),n=e.getAsCurrentPoint();return{current:A,point:r,controlPoint:i,currentPoint:n}}pathC(e,A){var{pathParser:r}=this,{current:i,point:n,controlPoint:o,currentPoint:s}=MA.pathC(r);r.addMarker(s,o,n),A.addBezierCurve(i.x,i.y,n.x,n.y,o.x,o.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,o.x,o.y,s.x,s.y)}static pathS(e){var{current:A}=e,r=e.getReflectedControlPoint(),i=e.getAsControlPoint("x2","y2"),n=e.getAsCurrentPoint();return{current:A,point:r,controlPoint:i,currentPoint:n}}pathS(e,A){var{pathParser:r}=this,{current:i,point:n,controlPoint:o,currentPoint:s}=MA.pathS(r);r.addMarker(s,o,n),A.addBezierCurve(i.x,i.y,n.x,n.y,o.x,o.y,s.x,s.y),e&&e.bezierCurveTo(n.x,n.y,o.x,o.y,s.x,s.y)}static pathQ(e){var{current:A}=e,r=e.getAsControlPoint("x1","y1"),i=e.getAsCurrentPoint();return{current:A,controlPoint:r,currentPoint:i}}pathQ(e,A){var{pathParser:r}=this,{current:i,controlPoint:n,currentPoint:o}=MA.pathQ(r);r.addMarker(o,n,n),A.addQuadraticCurve(i.x,i.y,n.x,n.y,o.x,o.y),e&&e.quadraticCurveTo(n.x,n.y,o.x,o.y)}static pathT(e){var{current:A}=e,r=e.getReflectedControlPoint();e.control=r;var i=e.getAsCurrentPoint();return{current:A,controlPoint:r,currentPoint:i}}pathT(e,A){var{pathParser:r}=this,{current:i,controlPoint:n,currentPoint:o}=MA.pathT(r);r.addMarker(o,n,n),A.addQuadraticCurve(i.x,i.y,n.x,n.y,o.x,o.y),e&&e.quadraticCurveTo(n.x,n.y,o.x,o.y)}static pathA(e){var{current:A,command:r}=e,{rX:i,rY:n,xRot:o,lArcFlag:s,sweepFlag:a}=r,c=o*(Math.PI/180),u=e.getAsCurrentPoint(),l=new sr(Math.cos(c)*(A.x-u.x)/2+Math.sin(c)*(A.y-u.y)/2,-Math.sin(c)*(A.x-u.x)/2+Math.cos(c)*(A.y-u.y)/2),g=Math.pow(l.x,2)/Math.pow(i,2)+Math.pow(l.y,2)/Math.pow(n,2);g>1&&(i*=Math.sqrt(g),n*=Math.sqrt(g));var h=(s===a?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(n,2)-Math.pow(i,2)*Math.pow(l.y,2)-Math.pow(n,2)*Math.pow(l.x,2))/(Math.pow(i,2)*Math.pow(l.y,2)+Math.pow(n,2)*Math.pow(l.x,2)));isNaN(h)&&(h=0);var p=new sr(h*i*l.y/n,h*-n*l.x/i),C=new sr((A.x+u.x)/2+Math.cos(c)*p.x-Math.sin(c)*p.y,(A.y+u.y)/2+Math.sin(c)*p.x+Math.cos(c)*p.y),I=f1([1,0],[(l.x-p.x)/i,(l.y-p.y)/n]),E=[(l.x-p.x)/i,(l.y-p.y)/n],v=[(-l.x-p.x)/i,(-l.y-p.y)/n],m=f1(E,v);return qv(E,v)<=-1&&(m=Math.PI),qv(E,v)>=1&&(m=0),{currentPoint:u,rX:i,rY:n,sweepFlag:a,xAxisRotation:c,centp:C,a1:I,ad:m}}pathA(e,A){var{pathParser:r}=this,{currentPoint:i,rX:n,rY:o,sweepFlag:s,xAxisRotation:a,centp:c,a1:u,ad:l}=MA.pathA(r),g=1-s?1:-1,h=u+g*(l/2),p=new sr(c.x+n*Math.cos(h),c.y+o*Math.sin(h));if(r.addMarkerAngle(p,h-g*Math.PI/2),r.addMarkerAngle(i,h-g*Math.PI),A.addPoint(i.x,i.y),e&&!isNaN(u)&&!isNaN(l)){var C=n>o?n:o,I=n>o?1:n/o,E=n>o?o/n:1;e.translate(c.x,c.y),e.rotate(a),e.scale(I,E),e.arc(0,0,C,u,u+l,!!(1-s)),e.scale(1/I,1/E),e.rotate(-a),e.translate(-c.x,-c.y)}}static pathZ(e){e.current=e.start}pathZ(e,A){MA.pathZ(this.pathParser),e&&A.x1!==A.x2&&A.y1!==A.y2&&e.closePath()}}class y1 extends MA{constructor(e,A,r){super(e,A,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class Go extends ec{constructor(e,A,r){super(e,A,new.target===Go?!0:r),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(e,A);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if(this.type!=="text")return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var A=null;return this.children.forEach((r,i)=>{var n=this.getChildBoundingBox(e,this,this,i);A?A.addBoundingBox(n):A=n}),A}getFontSize(){var{document:e,parent:A}=this,r=xi.parse(e.ctx.font).fontSize,i=A.getStyle("font-size").getNumber(r);return i}getTElementBoundingBox(e){var A=this.getFontSize();return new es(this.x,this.y-A,this.x+this.measureText(e),this.y)}getGlyph(e,A,r){var i=A[r],n=null;if(e.isArabic){var o=A.length,s=A[r-1],a=A[r+1],c="isolated";if((r===0||s===" ")&&r<o-1&&a!==" "&&(c="terminal"),r>0&&s!==" "&&r<o-1&&a!==" "&&(c="medial"),r>0&&s!==" "&&(r===o-1||a===" ")&&(c="initial"),typeof e.glyphs[i]<"u"){var u=e.glyphs[i];n=u instanceof y1?u:u[c]}}else n=e.glyphs[i];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var A=e||this.node,r=Array.from(A.parentNode.childNodes),i=r.indexOf(A),n=r.length-1,o=Su(A.textContent||"");return i===0&&(o=pG(o)),i===n&&(o=fG(o)),o}renderChildren(e){if(this.type!=="text"){this.renderTElementChildren(e);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach((r,i)=>{this.renderChild(e,this,this,i)});var{mouse:A}=this.document.screen;A.isWorking()&&A.checkBoundingBox(this,this.getBoundingBox(e))}renderTElementChildren(e){var{document:A,parent:r}=this,i=this.getText(),n=r.getStyle("font-family").getDefinition();if(n){for(var{unitsPerEm:o}=n.fontFace,s=xi.parse(A.ctx.font),a=r.getStyle("font-size").getNumber(s.fontSize),c=r.getStyle("font-style").getString(s.fontStyle),u=a/o,l=n.isRTL?i.split("").reverse().join(""):i,g=gn(r.getAttribute("dx").getString()),h=l.length,p=0;p<h;p++){var C=this.getGlyph(n,l,p);e.translate(this.x,this.y),e.scale(u,-u);var I=e.lineWidth;e.lineWidth=e.lineWidth*o/a,c==="italic"&&e.transform(1,0,.4,1,0,0),C.render(e),c==="italic"&&e.transform(1,0,-.4,1,0,0),e.lineWidth=I,e.scale(1/u,-1/u),e.translate(-this.x,-this.y),this.x+=a*(C.horizAdvX||n.horizAdvX)/o,typeof g[p]<"u"&&!isNaN(g[p])&&(this.x+=g[p])}return}var{x:E,y:v}=this;e.fillStyle&&e.fillText(i,E,v),e.strokeStyle&&e.strokeText(i,E,v)}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],A=e.getStyle("text-anchor").getString("start"),r=!1,i=0;A==="start"&&!r||A==="end"&&r?i=e.x-this.minX:A==="end"&&!r||A==="start"&&r?i=e.x-this.maxX:i=e.x-(this.minX+this.maxX)/2;for(var n=this.textChunkStart;n<this.leafTexts.length;n++)this.leafTexts[n].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach((A,r)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,A,r,i){var n=r.children[i];n.children.length>0?n.children.forEach((o,s)=>{A.adjustChildCoordinatesRecursiveCore(e,A,n,s)}):this.adjustChildCoordinates(e,A,r,i)}adjustChildCoordinates(e,A,r,i){var n=r.children[i];if(typeof n.measureText!="function")return n;e.save(),n.setContext(e,!0);var o=n.getAttribute("x"),s=n.getAttribute("y"),a=n.getAttribute("dx"),c=n.getAttribute("dy"),u=n.getStyle("font-family").getDefinition(),l=!!u&&u.isRTL;i===0&&(o.hasValue()||o.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),a.hasValue()||a.setValue(n.getInheritedAttribute("dx")),c.hasValue()||c.setValue(n.getInheritedAttribute("dy")));var g=n.measureText(e);return l&&(A.x-=g),o.hasValue()?(A.applyAnchoring(),n.x=o.getPixels("x"),a.hasValue()&&(n.x+=a.getPixels("x"))):(a.hasValue()&&(A.x+=a.getPixels("x")),n.x=A.x),A.x=n.x,l||(A.x+=g),s.hasValue()?(n.y=s.getPixels("y"),c.hasValue()&&(n.y+=c.getPixels("y"))):(c.hasValue()&&(A.y+=c.getPixels("y")),n.y=A.y),A.y=n.y,A.leafTexts.push(n),A.minX=Math.min(A.minX,n.x,n.x+g),A.maxX=Math.max(A.maxX,n.x,n.x+g),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,A,r,i){var n=r.children[i];if(typeof n.getBoundingBox!="function")return null;var o=n.getBoundingBox(e);return o?(n.children.forEach((s,a)=>{var c=A.getChildBoundingBox(e,A,n,a);o.addBoundingBox(c)}),o):null}renderChild(e,A,r,i){var n=r.children[i];n.render(e),n.children.forEach((o,s)=>{A.renderChild(e,A,n,s)})}measureText(e){var{measureCache:A}=this;if(~A)return A;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,A){if(!A.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var n=this.getFontSize(),o=i.isRTL?A.split("").reverse().join(""):A,s=gn(r.getAttribute("dx").getString()),a=o.length,c=0,u=0;u<a;u++){var l=this.getGlyph(i,o,u);c+=(l.horizAdvX||i.horizAdvX)*n/i.fontFace.unitsPerEm,typeof s[u]<"u"&&!isNaN(s[u])&&(c+=s[u])}return c}if(!e.measureText)return A.length*10;e.save(),this.setContext(e,!0);var{width:g}=e.measureText(A);return this.clearContext(e),e.restore(),g}getInheritedAttribute(e){for(var A=this;A instanceof Go&&A.isFirstChild();){var r=A.parent.getAttribute(e);if(r.hasValue(!0))return r.getValue("0");A=A.parent}return null}}class Ff extends Go{constructor(e,A,r){super(e,A,new.target===Ff?!0:r),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class uQe extends Ff{constructor(){super(...arguments),this.type="textNode"}}let Dh=class extends ec{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var A,{document:r}=this,{screen:i,window:n}=r,o=e.canvas;if(i.setDefaults(e),o.style&&typeof e.font<"u"&&n&&typeof n.getComputedStyle<"u"){e.font=n.getComputedStyle(o).getPropertyValue("font");var s=new wt(r,"fontSize",xi.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:a,height:c}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var u=this.getAttribute("refX"),l=this.getAttribute("refY"),g=this.getAttribute("viewBox"),h=g.hasValue()?gn(g.getString()):null,p=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible",C=0,I=0,E=0,v=0;h&&(C=h[0],I=h[1]),this.root||(a=this.getStyle("width").getPixels("x"),c=this.getStyle("height").getPixels("y"),this.type==="marker"&&(E=C,v=I,C=0,I=0)),i.viewPort.setCurrent(a,c),this.node&&(!this.parent||((A=this.node.parentNode)===null||A===void 0?void 0:A.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),h&&(a=h[2],c=h[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:a,height:i.viewPort.height,desiredHeight:c,minX:C,minY:I,refX:u.getValue(),refY:l.getValue(),clip:p,clipX:E,clipY:v}),h&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(a,c))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getAttribute("width",!0),n=this.getAttribute("height",!0),o=this.getAttribute("viewBox"),s=this.getAttribute("style"),a=i.getNumber(0),c=n.getNumber(0);if(r)if(typeof r=="string")this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var u=this.getAttribute("preserveAspectRatio");u.hasValue()&&u.setValue(u.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),n.setValue(A),o.hasValue()||o.setValue("0 0 ".concat(a||e," ").concat(c||A)),s.hasValue()){var l=this.getStyle("width"),g=this.getStyle("height");l.hasValue()&&l.setValue("".concat(e,"px")),g.hasValue()&&g.setValue("".concat(A,"px"))}}};class Q1 extends MA{constructor(){super(...arguments),this.type="rect"}path(e){var A=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),o=this.getAttribute("rx"),s=this.getAttribute("ry"),a=o.getPixels("x"),c=s.getPixels("y");if(o.hasValue()&&!s.hasValue()&&(c=a),s.hasValue()&&!o.hasValue()&&(a=c),a=Math.min(a,i/2),c=Math.min(c,n/2),e){var u=4*((Math.sqrt(2)-1)/3);e.beginPath(),n>0&&i>0&&(e.moveTo(A+a,r),e.lineTo(A+i-a,r),e.bezierCurveTo(A+i-a+u*a,r,A+i,r+c-u*c,A+i,r+c),e.lineTo(A+i,r+n-c),e.bezierCurveTo(A+i,r+n-c+u*c,A+i-a+u*a,r+n,A+i-a,r+n),e.lineTo(A+a,r+n),e.bezierCurveTo(A+a-u*a,r+n,A,r+n-c+u*c,A,r+n-c),e.lineTo(A,r+c),e.bezierCurveTo(A,r+c-u*c,A+a-u*a,r,A+a,r),e.closePath())}return new es(A,r,A+i,r+n)}getMarkers(){return null}}class TG extends MA{constructor(){super(...arguments),this.type="circle"}path(e){var A=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(A,r,i,0,Math.PI*2,!1),e.closePath()),new es(A-i,r-i,A+i,r+i)}getMarkers(){return null}}class UG extends MA{constructor(){super(...arguments),this.type="ellipse"}path(e){var A=4*((Math.sqrt(2)-1)/3),r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),o=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(n+r,o),e.bezierCurveTo(n+r,o+A*i,n+A*r,o+i,n,o+i),e.bezierCurveTo(n-A*r,o+i,n-r,o+A*i,n-r,o),e.bezierCurveTo(n-r,o-A*i,n-A*r,o-i,n,o-i),e.bezierCurveTo(n+A*r,o-i,n+r,o-A*i,n+r,o),e.closePath()),new es(n-r,o-i,n+r,o+i)}getMarkers(){return null}}class LG extends MA{constructor(){super(...arguments),this.type="line"}getPoints(){return[new sr(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new sr(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:A,y:r},{x:i,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(A,r),e.lineTo(i,n)),new es(A,r,i,n)}getMarkers(){var[e,A]=this.getPoints(),r=e.angleTo(A);return[[e,r],[A,r]]}}class R1 extends MA{constructor(e,A,r){super(e,A,r),this.type="polyline",this.points=[],this.points=sr.parsePath(this.getAttribute("points").getString())}path(e){var{points:A}=this,[{x:r,y:i}]=A,n=new es(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),A.forEach(o=>{var{x:s,y:a}=o;n.addPoint(s,a),e&&e.lineTo(s,a)}),n}getMarkers(){var{points:e}=this,A=e.length-1,r=[];return e.forEach((i,n)=>{n!==A&&r.push([i,i.angleTo(e[n+1])])}),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}}class FG extends R1{constructor(){super(...arguments),this.type="polygon"}path(e){var A=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),A}}class OG extends XA{constructor(){super(...arguments),this.type="pattern"}createPattern(e,A,r){var i=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),o=new Dh(this.document,null);o.attributes.viewBox=new wt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.width=new wt(this.document,"width","".concat(i,"px")),o.attributes.height=new wt(this.document,"height","".concat(n,"px")),o.attributes.transform=new wt(this.document,"transform",this.getAttribute("patternTransform").getValue()),o.children=this.children;var s=this.document.createCanvas(i,n),a=s.getContext("2d"),c=this.getAttribute("x"),u=this.getAttribute("y");c.hasValue()&&u.hasValue()&&a.translate(c.getPixels("x",!0),u.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var l=-1;l<=1;l++)for(var g=-1;g<=1;g++)a.save(),o.attributes.x=new wt(this.document,"x",l*s.width),o.attributes.y=new wt(this.document,"y",g*s.height),o.render(a),a.restore();var h=e.createPattern(s,"repeat");return h}}class bG extends XA{constructor(){super(...arguments),this.type="marker"}render(e,A,r){if(A){var{x:i,y:n}=A,o=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,n),o==="auto"&&e.rotate(r),s==="strokeWidth"&&e.scale(e.lineWidth,e.lineWidth),e.save();var a=new Dh(this.document,null);a.type=this.type,a.attributes.viewBox=new wt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.refX=new wt(this.document,"refX",this.getAttribute("refX").getValue()),a.attributes.refY=new wt(this.document,"refY",this.getAttribute("refY").getValue()),a.attributes.width=new wt(this.document,"width",this.getAttribute("markerWidth").getValue()),a.attributes.height=new wt(this.document,"height",this.getAttribute("markerHeight").getValue()),a.attributes.overflow=new wt(this.document,"overflow",this.getAttribute("overflow").getValue()),a.attributes.fill=new wt(this.document,"fill",this.getAttribute("fill").getColor("black")),a.attributes.stroke=new wt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),a.children=this.children,a.render(e),e.restore(),s==="strokeWidth"&&e.scale(1/e.lineWidth,1/e.lineWidth),o==="auto"&&e.rotate(-r),e.translate(-i,-n)}}}class xG extends XA{constructor(){super(...arguments),this.type="defs"}render(){}}class Wv extends ec{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var A=new es;return this.children.forEach(r=>{A.addBoundingBox(r.getBoundingBox(e))}),A}}class D1 extends XA{constructor(e,A,r){super(e,A,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:n}=this;n.forEach(o=>{o.type==="stop"&&i.push(o)})}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,A,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:n}=i,o=this.getGradient(e,A);if(!o)return this.addParentOpacity(r,n[n.length-1].color);if(n.forEach(I=>{o.addColorStop(I.offset,this.addParentOpacity(r,I.color))}),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:a,viewPort:c}=s.screen,[u]=c.viewPorts,l=new Q1(s,null);l.attributes.x=new wt(s,"x",-a/3),l.attributes.y=new wt(s,"y",-a/3),l.attributes.width=new wt(s,"width",a),l.attributes.height=new wt(s,"height",a);var g=new Wv(s,null);g.attributes.transform=new wt(s,"transform",this.getAttribute("gradientTransform").getValue()),g.children=[l];var h=new Dh(s,null);h.attributes.x=new wt(s,"x",0),h.attributes.y=new wt(s,"y",0),h.attributes.width=new wt(s,"width",u.width),h.attributes.height=new wt(s,"height",u.height),h.children=[g];var p=s.createCanvas(u.width,u.height),C=p.getContext("2d");return C.fillStyle=o,h.render(C),C.createPattern(p,"no-repeat")}return o}inheritStopContainer(e){this.attributesToInherit.forEach(A=>{!this.getAttribute(A).hasValue()&&e.getAttribute(A).hasValue()&&this.getAttribute(A,!0).setValue(e.getAttribute(A).getValue())})}addParentOpacity(e,A){if(e.hasValue()){var r=new wt(this.document,"color",A);return r.addOpacity(e).getColor()}return A}}class NG extends D1{constructor(e,A,r){super(e,A,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,A){var r=this.getGradientUnits()==="objectBoundingBox",i=r?A.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),a=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&o===a?null:e.createLinearGradient(n,o,s,a)}}class KG extends D1{constructor(e,A,r){super(e,A,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,A){var r=this.getGradientUnits()==="objectBoundingBox",i=A.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),o=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,a=o;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(a=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var c=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),u=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,a,u,n,o,c)}}class kG extends XA{constructor(e,A,r){super(e,A,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),o=this.getStyle("stop-color",!0);o.getString()===""&&o.setValue("#000"),n.hasValue()&&(o=o.addOpacity(n)),this.offset=i,this.color=o.getColor()}}class Zv extends XA{constructor(e,A,r){super(e,A,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new wt(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),A=this.getAttribute("attributeName").getString();return e==="CSS"?this.parent.getStyle(A,!0):this.parent.getAttribute(A,!0)}calcValue(){var{initialUnits:e}=this,{progress:A,from:r,to:i}=this.getProgress(),n=r.getNumber()+(i.getNumber()-r.getNumber())*A;return e==="%"&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:A}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(i==="freeze"&&!this.frozen)this.frozen=!0,A.animationFrozen=!0,A.animationFrozenValue=r.getString();else if(i==="remove"&&!this.removed)return this.removed=!0,r.setValue(A.animationFrozen?A.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=e;var n=!1;if(this.begin<this.duration){var o=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var a=s.getString();o="".concat(a,"(").concat(o,")")}r.setValue(o),n=!0}return n}getProgress(){var{document:e,values:A}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(A.hasValue()){var i=r.progress*(A.getValue().length-1),n=Math.floor(i),o=Math.ceil(i);r.from=new wt(e,"from",parseFloat(A.getValue()[n])),r.to=new wt(e,"to",parseFloat(A.getValue()[o])),r.progress=(i-n)/(o-n)}else r.from=this.from,r.to=this.to;return r}}class PG extends Zv{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:A,to:r}=this.getProgress(),i=new c1(A.getColor()),n=new c1(r.getColor());if(i.ok&&n.ok){var o=i.r+(n.r-i.r)*e,s=i.g+(n.g-i.g)*e,a=i.b+(n.b-i.b)*e;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(s),", ").concat(Math.floor(a),")")}return this.getAttribute("from").getColor()}}class GG extends Zv{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:A,to:r}=this.getProgress(),i=gn(A.getString()),n=gn(r.getString()),o=i.map((s,a)=>{var c=n[a];return s+(c-s)*e}).join(" ");return o}}class jG extends XA{constructor(e,A,r){super(e,A,r),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:n}=this;for(var o of n)switch(o.type){case"font-face":{this.fontFace=o;var s=o.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break}case"missing-glyph":this.missingGlyph=o;break;case"glyph":{var a=o;a.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[a.unicode]>"u"&&(this.glyphs[a.unicode]=Object.create(null)),this.glyphs[a.unicode][a.arabicForm]=a):this.glyphs[a.unicode]=a;break}}}render(){}}class YG extends XA{constructor(e,A,r){super(e,A,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class HG extends MA{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}}class zG extends Go{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var A=e.children[0];if(A)return A.getText()}return""}}class JG extends Go{constructor(e,A,r){super(e,A,r),this.type="a";var{childNodes:i}=A,n=i[0],o=i.length>0&&Array.from(i).every(s=>s.nodeType===3);this.hasText=o,this.text=o?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:A,x:r,y:i}=this,{mouse:n}=A.screen,o=new wt(A,"fontSize",xi.parse(A.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new es(r,i-o.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new Wv(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){var e=this.document.ctx;e.canvas.style.cursor="pointer"}}function qG(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),A.push.apply(A,r)}return A}function Xv(t){for(var e=1;e<arguments.length;e++){var A=arguments[e]!=null?arguments[e]:{};e%2?qG(Object(A),!0).forEach(function(r){t1(t,r,A[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):qG(Object(A)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(A,r))})}return t}class VG extends Go{constructor(e,A,r){super(e,A,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){var{dataArray:A}=this;e&&e.beginPath(),A.forEach(r=>{var{type:i,points:n}=r;switch(i){case jt.LINE_TO:e&&e.lineTo(n[0],n[1]);break;case jt.MOVE_TO:e&&e.moveTo(n[0],n[1]);break;case jt.CURVE_TO:e&&e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]);break;case jt.QUAD_TO:e&&e.quadraticCurveTo(n[0],n[1],n[2],n[3]);break;case jt.ARC:{var[o,s,a,c,u,l,g,h]=n,p=a>c?a:c,C=a>c?1:a/c,I=a>c?c/a:1;e&&(e.translate(o,s),e.rotate(g),e.scale(C,I),e.arc(0,0,p,u,u+l,!!(1-h)),e.scale(1/C,1/I),e.rotate(-g),e.translate(-o,-s));break}case jt.CLOSE_PATH:e&&e.closePath();break}})}renderChildren(e){this.setTextData(e),e.save();var A=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,n=e.fillStyle;A==="underline"&&e.beginPath(),i.forEach((o,s)=>{var{p0:a,p1:c,rotation:u,text:l}=o;e.save(),e.translate(a.x,a.y),e.rotate(u),e.fillStyle&&e.fillText(l,0,0),e.strokeStyle&&e.strokeText(l,0,0),e.restore(),A==="underline"&&(s===0&&e.moveTo(a.x,a.y+r/8),e.lineTo(c.x,c.y+r/5))}),A==="underline"&&(e.lineWidth=r/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,A,r,i,n,o,s,a,c){var u=o,l=this.measureText(e,a);a===" "&&A==="justify"&&r<i&&(l+=(i-r)/n),c>-1&&(u+=this.getLetterSpacingAt(c));var g=this.textHeight/20,h=this.getEquidistantPointOnPath(u,g,0),p=this.getEquidistantPointOnPath(u+l,g,0),C={p0:h,p1:p},I=h&&p?Math.atan2(p.y-h.y,p.x-h.x):0;if(s){var E=Math.cos(Math.PI/2+I)*s,v=Math.cos(-I)*s;C.p0=Xv(Xv({},h),{},{x:h.x+E,y:h.y+v}),C.p1=Xv(Xv({},p),{},{x:p.x+E,y:p.y+v})}return u+=l,{offset:u,segment:C,rotation:I}}measureText(e,A){var{measuresCache:r}=this,i=A||this.getText();if(r.has(i))return r.get(i);var n=this.measureTargetText(e,i);return r.set(i,n),n}setTextData(e){if(!this.glyphInfo){var A=this.getText(),r=A.split(""),i=A.split(" ").length-1,n=this.parent.getAttribute("dx").split().map(M=>M.getPixels("x")),o=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),a=this.getStyle("letter-spacing"),c=this.parent.getStyle("letter-spacing"),u=0;!a.hasValue()||a.getValue()==="inherit"?u=c.getPixels():a.hasValue()&&a.getValue()!=="initial"&&a.getValue()!=="unset"&&(u=a.getPixels());var l=[],g=A.length;this.letterSpacingCache=l;for(var h=0;h<g;h++)l.push(typeof n[h]<"u"?n[h]:u);var p=l.reduce((M,O,x)=>x===0?0:M+O||0,0),C=this.measureText(e),I=Math.max(C+p,0);this.textWidth=C,this.textHeight=this.getFontSize(),this.glyphInfo=[];var E=this.getPathLength(),v=this.getStyle("startOffset").getNumber(0)*E,m=0;(s==="middle"||s==="center")&&(m=-I/2),(s==="end"||s==="right")&&(m=-I),m+=v,r.forEach((M,O)=>{var{offset:x,segment:P,rotation:D}=this.findSegmentToFitChar(e,s,I,E,i,m,o,M,O);m=x,!(!P.p0||!P.p1)&&this.glyphInfo.push({text:r[O],p0:P.p0,p1:P.p1,rotation:D})})}}parsePathData(e){if(this.pathLength=-1,!e)return[];var A=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,n=i?i.x:0,o=i?i.y:0,s=r.next(),a=s.type,c=[];switch(s.type){case jt.MOVE_TO:this.pathM(r,c);break;case jt.LINE_TO:a=this.pathL(r,c);break;case jt.HORIZ_LINE_TO:a=this.pathH(r,c);break;case jt.VERT_LINE_TO:a=this.pathV(r,c);break;case jt.CURVE_TO:this.pathC(r,c);break;case jt.SMOOTH_CURVE_TO:a=this.pathS(r,c);break;case jt.QUAD_TO:this.pathQ(r,c);break;case jt.SMOOTH_QUAD_TO:a=this.pathT(r,c);break;case jt.ARC:c=this.pathA(r);break;case jt.CLOSE_PATH:MA.pathZ(r);break}s.type!==jt.CLOSE_PATH?A.push({type:a,points:c,start:{x:n,y:o},pathLength:this.calcLength(n,o,a,c)}):A.push({type:jt.CLOSE_PATH,points:[],pathLength:0})}return A}pathM(e,A){var{x:r,y:i}=MA.pathM(e).point;A.push(r,i)}pathL(e,A){var{x:r,y:i}=MA.pathL(e).point;return A.push(r,i),jt.LINE_TO}pathH(e,A){var{x:r,y:i}=MA.pathH(e).point;return A.push(r,i),jt.LINE_TO}pathV(e,A){var{x:r,y:i}=MA.pathV(e).point;return A.push(r,i),jt.LINE_TO}pathC(e,A){var{point:r,controlPoint:i,currentPoint:n}=MA.pathC(e);A.push(r.x,r.y,i.x,i.y,n.x,n.y)}pathS(e,A){var{point:r,controlPoint:i,currentPoint:n}=MA.pathS(e);return A.push(r.x,r.y,i.x,i.y,n.x,n.y),jt.CURVE_TO}pathQ(e,A){var{controlPoint:r,currentPoint:i}=MA.pathQ(e);A.push(r.x,r.y,i.x,i.y)}pathT(e,A){var{controlPoint:r,currentPoint:i}=MA.pathT(e);return A.push(r.x,r.y,i.x,i.y),jt.QUAD_TO}pathA(e){var{rX:A,rY:r,sweepFlag:i,xAxisRotation:n,centp:o,a1:s,ad:a}=MA.pathA(e);return i===0&&a>0&&(a-=2*Math.PI),i===1&&a<0&&(a+=2*Math.PI),[o.x,o.y,A,r,s,a,n,i]}calcLength(e,A,r,i){var n=0,o=null,s=null,a=0;switch(r){case jt.LINE_TO:return this.getLineLength(e,A,i[0],i[1]);case jt.CURVE_TO:for(n=0,o=this.getPointOnCubicBezier(0,e,A,i[0],i[1],i[2],i[3],i[4],i[5]),a=.01;a<=1;a+=.01)s=this.getPointOnCubicBezier(a,e,A,i[0],i[1],i[2],i[3],i[4],i[5]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case jt.QUAD_TO:for(n=0,o=this.getPointOnQuadraticBezier(0,e,A,i[0],i[1],i[2],i[3]),a=.01;a<=1;a+=.01)s=this.getPointOnQuadraticBezier(a,e,A,i[0],i[1],i[2],i[3]),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return n;case jt.ARC:{n=0;var c=i[4],u=i[5],l=i[4]+u,g=Math.PI/180;if(Math.abs(c-l)<g&&(g=Math.abs(c-l)),o=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),u<0)for(a=c-g;a>l;a-=g)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],a,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(a=c+g;a<l;a+=g)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],a,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),n+=this.getLineLength(o.x,o.y,s.x,s.y),n}}return 0}getPointOnLine(e,A,r,i,n){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:A,s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:r,a=(n-r)/(i-A+Mu),c=Math.sqrt(e*e/(1+a*a));i<A&&(c*=-1);var u=a*c,l=null;if(i===A)l={x:o,y:s+u};else if((s-r)/(o-A+Mu)===a)l={x:o+c,y:s+u};else{var g=0,h=0,p=this.getLineLength(A,r,i,n);if(p<Mu)return null;var C=(o-A)*(i-A)+(s-r)*(n-r);C/=p*p,g=A+C*(i-A),h=r+C*(n-r);var I=this.getLineLength(o,s,g,h),E=Math.sqrt(e*e-I*I);c=Math.sqrt(E*E/(1+a*a)),i<A&&(c*=-1),u=a*c,l={x:g+c,y:h+u}}return l}getPointOnPath(e){var A=this.getPathLength(),r=0,i=null;if(e<-5e-5||e-5e-5>A)return null;var{dataArray:n}=this;for(var o of n){if(o&&(o.pathLength<5e-5||r+o.pathLength+5e-5<e)){r+=o.pathLength;continue}var s=e-r,a=0;switch(o.type){case jt.LINE_TO:i=this.getPointOnLine(s,o.start.x,o.start.y,o.points[0],o.points[1],o.start.x,o.start.y);break;case jt.ARC:{var c=o.points[4],u=o.points[5],l=o.points[4]+u;if(a=c+s/o.pathLength*u,u<0&&a<l||u>=0&&a>l)break;i=this.getPointOnEllipticalArc(o.points[0],o.points[1],o.points[2],o.points[3],a,o.points[6]);break}case jt.CURVE_TO:a=s/o.pathLength,a>1&&(a=1),i=this.getPointOnCubicBezier(a,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3],o.points[4],o.points[5]);break;case jt.QUAD_TO:a=s/o.pathLength,a>1&&(a=1),i=this.getPointOnQuadraticBezier(a,o.start.x,o.start.y,o.points[0],o.points[1],o.points[2],o.points[3]);break}if(i)return i;break}return null}getLineLength(e,A,r,i){return Math.sqrt((r-e)*(r-e)+(i-A)*(i-A))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((e,A)=>A.pathLength>0?e+A.pathLength:e,0)),this.pathLength}getPointOnCubicBezier(e,A,r,i,n,o,s,a,c){var u=a*E1(e)+o*C1(e)+i*I1(e)+A*B1(e),l=c*E1(e)+s*C1(e)+n*I1(e)+r*B1(e);return{x:u,y:l}}getPointOnQuadraticBezier(e,A,r,i,n,o,s){var a=o*v1(e)+i*w1(e)+A*S1(e),c=s*v1(e)+n*w1(e)+r*S1(e);return{x:a,y:c}}getPointOnEllipticalArc(e,A,r,i,n,o){var s=Math.cos(o),a=Math.sin(o),c={x:r*Math.cos(n),y:i*Math.sin(n)};return{x:e+(c.x*s-c.y*a),y:A+(c.x*a+c.y*s)}}buildEquidistantCache(e,A){var r=this.getPathLength(),i=A||.25,n=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==i){this.equidistantCache={step:n,precision:i,points:[]};for(var o=0,s=0;s<=r;s+=i){var a=this.getPointOnPath(s),c=this.getPointOnPath(s+i);!a||!c||(o+=this.getLineLength(a.x,a.y,c.x,c.y),o>=n&&(this.equidistantCache.points.push({x:a.x,y:a.y,distance:s}),o-=n))}}}getEquidistantPointOnPath(e,A,r){if(this.buildEquidistantCache(A,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}}var lQe=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class WG extends ec{constructor(e,A,r){super(e,A,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(i){var n=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),n?this.loadSvg(i):this.loadImage(i),this.isSvg=n}}loadImage(e){var A=this;return Ko(function*(){try{var r=yield A.document.createImage(e);A.image=r}catch(i){console.error('Error while loading image "'.concat(e,'":'),i)}A.loaded=!0})()}loadSvg(e){var A=this;return Ko(function*(){var r=lQe.exec(e);if(r){var i=r[5];r[4]==="base64"?A.image=atob(i):A.image=decodeURIComponent(i)}else try{var n=yield A.document.fetch(e),o=yield n.text();A.image=o}catch(s){console.error('Error while loading image "'.concat(e,'":'),s)}A.loaded=!0})()}renderChildren(e){var{document:A,image:r,loaded:i}=this,n=this.getAttribute("x").getPixels("x"),o=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y");if(!(!i||!r||!s||!a)){if(e.save(),e.translate(n,o),this.isSvg){var c=A.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:a});c.document.documentElement.parent=this,c.render()}else{var u=this.image;A.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:u.width,height:a,desiredHeight:u.height}),this.loaded&&(typeof u.complete>"u"||u.complete)&&e.drawImage(u,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),A=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new es(e,A,e+r,A+i)}}class ZG extends ec{constructor(){super(...arguments),this.type="symbol"}render(e){}}class XG{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,A){var r=this;return Ko(function*(){try{var{document:i}=r,n=yield i.canvg.parser.load(A),o=n.getElementsByTagName("font");Array.from(o).forEach(s=>{var a=i.createElement(s);i.definitions[e]=a})}catch(s){console.error('Error while loading font "'.concat(A,'":'),s)}r.loaded=!0})()}}class T1 extends XA{constructor(e,A,r){super(e,A,r),this.type="style";var i=Su(Array.from(A.childNodes).map(o=>o.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")),n=i.split("}");n.forEach(o=>{var s=o.trim();if(s){var a=s.split("{"),c=a[0].split(","),u=a[1].split(";");c.forEach(l=>{var g=l.trim();if(g){var h=e.styles[g]||{};if(u.forEach(I=>{var E=I.indexOf(":"),v=I.substr(0,E).trim(),m=I.substr(E+1,I.length-E).trim();v&&m&&(h[v]=new wt(e,v,m))}),e.styles[g]=h,e.stylesSpecificity[g]=IG(g),g==="@font-face"){var p=h["font-family"].getString().replace(/"|'/g,""),C=h.src.getString().split(",");C.forEach(I=>{if(I.indexOf('format("svg")')>0){var E=d1(I);E&&new XG(e).load(p,E)}})}}})}})}}T1.parseExternalUrl=d1;class _G extends ec{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var A=this.getAttribute("x"),r=this.getAttribute("y");A.hasValue()&&e.translate(A.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:A}=this;A&&A.path(e)}renderChildren(e){var{document:A,element:r}=this;if(r){var i=r;if(r.type==="symbol"&&(i=new Dh(A,null),i.attributes.viewBox=new wt(A,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new wt(A,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new wt(A,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new wt(A,"opacity",this.calculateOpacity())),i.type==="svg"){var n=this.getStyle("width",!1,!0),o=this.getStyle("height",!1,!0);n.hasValue()&&(i.attributes.width=new wt(A,"width",n.getString())),o.hasValue()&&(i.attributes.height=new wt(A,"height",o.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:A}=this;return A?A.getBoundingBox(e):null}elementTransform(){var{document:e,element:A}=this;return $a.fromElement(e,A)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}function _v(t,e,A,r,i,n){return t[A*r*4+e*4+n]}function $v(t,e,A,r,i,n,o){t[A*r*4+e*4+n]=o}function Dr(t,e,A){var r=t[e];return r*A}function jo(t,e,A,r){return e+Math.cos(t)*A+Math.sin(t)*r}class U1 extends XA{constructor(e,A,r){super(e,A,r),this.type="feColorMatrix";var i=gn(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":{var n=i[0];i=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var o=i[0]*Math.PI/180;i=[jo(o,.213,.787,-.213),jo(o,.715,-.715,-.715),jo(o,.072,-.072,.928),0,0,jo(o,.213,-.213,.143),jo(o,.715,.285,.14),jo(o,.072,-.072,-.283),0,0,jo(o,.213,-.213,-.787),jo(o,.715,-.715,.715),jo(o,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1];break}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,A,r,i,n){for(var{includeOpacity:o,matrix:s}=this,a=e.getImageData(0,0,i,n),c=0;c<n;c++)for(var u=0;u<i;u++){var l=_v(a.data,u,c,i,n,0),g=_v(a.data,u,c,i,n,1),h=_v(a.data,u,c,i,n,2),p=_v(a.data,u,c,i,n,3),C=Dr(s,0,l)+Dr(s,1,g)+Dr(s,2,h)+Dr(s,3,p)+Dr(s,4,1),I=Dr(s,5,l)+Dr(s,6,g)+Dr(s,7,h)+Dr(s,8,p)+Dr(s,9,1),E=Dr(s,10,l)+Dr(s,11,g)+Dr(s,12,h)+Dr(s,13,p)+Dr(s,14,1),v=Dr(s,15,l)+Dr(s,16,g)+Dr(s,17,h)+Dr(s,18,p)+Dr(s,19,1);o&&(C=0,I=0,E=0,v*=p/255),$v(a.data,u,c,i,n,0,C),$v(a.data,u,c,i,n,1,I),$v(a.data,u,c,i,n,2,E),$v(a.data,u,c,i,n,3,v)}e.clearRect(0,0,i,n),e.putImageData(a,0,0)}}class Of extends XA{constructor(){super(...arguments),this.type="mask"}apply(e,A){var{document:r}=this,i=this.getAttribute("x").getPixels("x"),n=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),s=this.getStyle("height").getPixels("y");if(!o&&!s){var a=new es;this.children.forEach(p=>{a.addBoundingBox(p.getBoundingBox(e))}),i=Math.floor(a.x1),n=Math.floor(a.y1),o=Math.floor(a.width),s=Math.floor(a.height)}var c=this.removeStyles(A,Of.ignoreStyles),u=r.createCanvas(i+o,n+s),l=u.getContext("2d");r.screen.setDefaults(l),this.renderChildren(l),new U1(r,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(l,0,0,i+o,n+s);var g=r.createCanvas(i+o,n+s),h=g.getContext("2d");r.screen.setDefaults(h),A.render(h),h.globalCompositeOperation="destination-in",h.fillStyle=l.createPattern(u,"no-repeat"),h.fillRect(0,0,i+o,n+s),e.fillStyle=h.createPattern(g,"no-repeat"),e.fillRect(0,0,i+o,n+s),this.restoreStyles(A,c)}render(e){}}Of.ignoreStyles=["mask","transform","clip-path"];var $G=()=>{};class e3 extends XA{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:A}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:n}=e;r&&(r.beginPath=$G,r.closePath=$G),Reflect.apply(i,e,[]),this.children.forEach(o=>{if(!(typeof o.path>"u")){var s=typeof o.elementTransform<"u"?o.elementTransform():null;s||(s=$a.fromElement(A,o)),s&&s.apply(e),o.path(e),r&&(r.closePath=n),s&&s.unapply(e)}}),Reflect.apply(n,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=n)}render(e){}}class bf extends XA{constructor(){super(...arguments),this.type="filter"}apply(e,A){var{document:r,children:i}=this,n=A.getBoundingBox(e);if(n){var o=0,s=0;i.forEach(E=>{var v=E.extraFilterDistance||0;o=Math.max(o,v),s=Math.max(s,v)});var a=Math.floor(n.width),c=Math.floor(n.height),u=a+2*o,l=c+2*s;if(!(u<1||l<1)){var g=Math.floor(n.x),h=Math.floor(n.y),p=this.removeStyles(A,bf.ignoreStyles),C=r.createCanvas(u,l),I=C.getContext("2d");r.screen.setDefaults(I),I.translate(-g+o,-h+s),A.render(I),i.forEach(E=>{typeof E.apply=="function"&&E.apply(I,0,0,u,l)}),e.drawImage(C,0,0,u,l,g-o,h-s,u,l),this.restoreStyles(A,p)}}}render(e){}}bf.ignoreStyles=["filter","transform","clip-path"];class t3 extends XA{constructor(e,A,r){super(e,A,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,A,r,i,n){}}class A3 extends XA{constructor(){super(...arguments),this.type="feMorphology"}apply(e,A,r,i,n){}}class r3 extends XA{constructor(){super(...arguments),this.type="feComposite"}apply(e,A,r,i,n){}}class i3 extends XA{constructor(e,A,r){super(e,A,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,A,r,i,n){var{document:o,blurRadius:s}=this,a=o.window?o.window.document.body:null,c=e.canvas;c.id=o.getUniqueId(),a&&(c.style.display="none",a.appendChild(c)),Yye(c,A,r,i,n,s),a&&a.removeChild(c)}}class n3 extends XA{constructor(){super(...arguments),this.type="title"}}class s3 extends XA{constructor(){super(...arguments),this.type="desc"}}var hQe={svg:Dh,rect:Q1,circle:TG,ellipse:UG,line:LG,polyline:R1,polygon:FG,path:MA,pattern:OG,marker:bG,defs:xG,linearGradient:NG,radialGradient:KG,stop:kG,animate:Zv,animateColor:PG,animateTransform:GG,font:jG,"font-face":YG,"missing-glyph":HG,glyph:y1,text:Go,tspan:Ff,tref:zG,a:JG,textPath:VG,image:WG,g:Wv,symbol:ZG,style:T1,use:_G,mask:Of,clipPath:e3,filter:bf,feDropShadow:t3,feMorphology:A3,feComposite:r3,feColorMatrix:U1,feGaussianBlur:i3,title:n3,desc:s3};function o3(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),A.push.apply(A,r)}return A}function gQe(t){for(var e=1;e<arguments.length;e++){var A=arguments[e]!=null?arguments[e]:{};e%2?o3(Object(A),!0).forEach(function(r){t1(t,r,A[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):o3(Object(A)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(A,r))})}return t}function dQe(t,e){var A=document.createElement("canvas");return A.width=t,A.height=e,A}function pQe(t){return L1.apply(this,arguments)}function L1(){return L1=Ko(function*(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=document.createElement("img");return e&&(A.crossOrigin="Anonymous"),new Promise((r,i)=>{A.onload=()=>{r(A)},A.onerror=(n,o,s,a,c)=>{i(c)},A.src=t})}),L1.apply(this,arguments)}class Yo{constructor(e){var{rootEmSize:A=12,emSize:r=12,createCanvas:i=Yo.createCanvas,createImage:n=Yo.createImage,anonymousCrossOrigin:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.canvg=e,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=A,this.emSize=r,this.createCanvas=i,this.createImage=this.bindCreateImage(n,o),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,A){return typeof A=="boolean"?(r,i)=>e(r,typeof i=="boolean"?i:A):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:A}=this;A.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(e=>e.loaded)}isFontsLoaded(){return this.fonts.every(e=>e.loaded)}createDocumentElement(e){var A=this.createElement(e.documentElement);return A.root=!0,A.addStylesFromStyleDefinition(),this.documentElement=A,A}createElement(e){var A=e.nodeName.replace(/^[^:]+:/,""),r=Yo.elementTypes[A];return typeof r<"u"?new r(this,e):new DG(this,e)}createTextNode(e){return new uQe(this,e)}setViewBox(e){this.screen.setViewBox(gQe({document:this},e))}}Yo.createCanvas=dQe,Yo.createImage=pQe,Yo.elementTypes=hQe;function a3(t,e){var A=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),A.push.apply(A,r)}return A}function yu(t){for(var e=1;e<arguments.length;e++){var A=arguments[e]!=null?arguments[e]:{};e%2?a3(Object(A),!0).forEach(function(r){t1(t,r,A[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(A)):a3(Object(A)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(A,r))})}return t}class Qu{constructor(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.parser=new Vv(r),this.screen=new Lf(e,r),this.options=r;var i=new Yo(this,r),n=i.createDocumentElement(A);this.document=i,this.documentElement=n}static from(e,A){var r=arguments;return Ko(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:{},n=new Vv(i),o=yield n.parse(A);return new Qu(e,o,i)})()}static fromString(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=new Vv(r),n=i.parseFromString(A);return new Qu(e,n,r)}fork(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Qu.from(e,A,yu(yu({},this.options),r))}forkString(e,A){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Qu.fromString(e,A,yu(yu({},this.options),r))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,A=this;return Ko(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};A.start(yu({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield A.ready(),A.stop()})()}start(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{documentElement:A,screen:r,options:i}=this;r.start(A,yu(yu({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(e,A,r)}}const fQe=Object.freeze(Object.defineProperty({__proto__:null,AElement:JG,AnimateColorElement:PG,AnimateElement:Zv,AnimateTransformElement:GG,BoundingBox:es,CB1:E1,CB2:C1,CB3:I1,CB4:B1,Canvg:Qu,CircleElement:TG,ClipPathElement:e3,DefsElement:xG,DescElement:s3,Document:Yo,Element:XA,EllipseElement:UG,FeColorMatrixElement:U1,FeCompositeElement:r3,FeDropShadowElement:t3,FeGaussianBlurElement:i3,FeMorphologyElement:A3,FilterElement:bf,Font:xi,FontElement:jG,FontFaceElement:YG,GElement:Wv,GlyphElement:y1,GradientElement:D1,ImageElement:WG,LineElement:LG,LinearGradientElement:NG,MarkerElement:bG,MaskElement:Of,Matrix:m1,MissingGlyphElement:HG,Mouse:vG,PSEUDO_ZERO:Mu,Parser:Vv,PathElement:MA,PathParser:jt,PatternElement:OG,Point:sr,PolygonElement:FG,PolylineElement:R1,Property:wt,QB1:v1,QB2:w1,QB3:S1,RadialGradientElement:KG,RectElement:Q1,RenderedElement:ec,Rotate:MG,SVGElement:Dh,SVGFontLoader:XG,Scale:yG,Screen:Lf,Skew:M1,SkewX:QG,SkewY:RG,StopElement:kG,StyleElement:T1,SymbolElement:ZG,TRefElement:zG,TSpanElement:Ff,TextElement:Go,TextPathElement:VG,TitleElement:n3,Transform:$a,Translate:mG,UnknownElement:DG,UseElement:_G,ViewPort:BG,compressSpaces:Su,default:Qu,getSelectorSpecificity:IG,normalizeAttributeName:EG,normalizeColor:CG,parseExternalUrl:d1,presets:qye,toNumbers:gn,trimLeft:pG,trimRight:fG,vectorMagnitude:p1,vectorsAngle:f1,vectorsRatio:qv},Symbol.toStringTag,{value:"Module"}))});