obi-sdk 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modular/chunks/{obi-widget-d6306b0d.js → obi-widget-dffef845.js} +10 -35
- package/dist/modular/chunks/{obi-widget-d6306b0d.js.map → obi-widget-dffef845.js.map} +1 -1
- package/dist/modular/chunks/types-82772f00.js.map +1 -1
- package/dist/modular/core.js.map +1 -1
- package/dist/modular/index.js +1 -1
- package/dist/modular/index.js.map +1 -1
- package/dist/modular/ui.js +12 -18
- package/dist/modular/ui.js.map +1 -1
- package/dist/obi-sdk.es.js +23245 -13349
- package/dist/obi-sdk.es.js.map +1 -0
- package/dist/obi-sdk.standalone.iife.js +40 -41
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +47 -133
- package/dist/obi-sdk.umd.js.map +1 -0
- package/package.json +2 -2
package/dist/obi-sdk.umd.js
CHANGED
|
@@ -1,65 +1,4 @@
|
|
|
1
|
-
(function(ft,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],_):(ft=typeof globalThis<"u"?globalThis:ft||self,_(ft.ObiSDK={},ft.lit))})(this,function(ft,_){"use strict";const qr={}.VITE_API_BASE_URL;function zh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ra={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,A="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(A=!1));function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function r(a,c,l,u,d){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new i(l,u||a,d),g=A?A+c:c;return a._events[g]?a._events[g].fn?a._events[g]=[a._events[g],h]:a._events[g].push(h):(a._events[g]=h,a._eventsCount++),a}function s(a,c){--a._eventsCount===0?a._events=new n:delete a._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)e.call(l,u)&&c.push(A?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},o.prototype.listeners=function(c){var l=A?A+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,h=u.length,g=new Array(h);d<h;d++)g[d]=u[d].fn;return g},o.prototype.listenerCount=function(c){var l=A?A+c:c,u=this._events[l];return u?u.fn?1:u.length:0},o.prototype.emit=function(c,l,u,d,h,g){var f=A?A+c:c;if(!this._events[f])return!1;var p=this._events[f],B=arguments.length,y,b;if(p.fn){switch(p.once&&this.removeListener(c,p.fn,void 0,!0),B){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,l),!0;case 3:return p.fn.call(p.context,l,u),!0;case 4:return p.fn.call(p.context,l,u,d),!0;case 5:return p.fn.call(p.context,l,u,d,h),!0;case 6:return p.fn.call(p.context,l,u,d,h,g),!0}for(b=1,y=new Array(B-1);b<B;b++)y[b-1]=arguments[b];p.fn.apply(p.context,y)}else{var v=p.length,C;for(b=0;b<v;b++)switch(p[b].once&&this.removeListener(c,p[b].fn,void 0,!0),B){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,l);break;case 3:p[b].fn.call(p[b].context,l,u);break;case 4:p[b].fn.call(p[b].context,l,u,d);break;default:if(!y)for(C=1,y=new Array(B-1);C<B;C++)y[C-1]=arguments[C];p[b].fn.apply(p[b].context,y)}}return!0},o.prototype.on=function(c,l,u){return r(this,c,l,u,!1)},o.prototype.once=function(c,l,u){return r(this,c,l,u,!0)},o.prototype.removeListener=function(c,l,u,d){var h=A?A+c:c;if(!this._events[h])return this;if(!l)return s(this,h),this;var g=this._events[h];if(g.fn)g.fn===l&&(!d||g.once)&&(!u||g.context===u)&&s(this,h);else{for(var f=0,p=[],B=g.length;f<B;f++)(g[f].fn!==l||d&&!g[f].once||u&&g[f].context!==u)&&p.push(g[f]);p.length?this._events[h]=p.length===1?p[0]:p:s(this,h)}return this},o.prototype.removeAllListeners=function(c){var l;return c?(l=A?A+c:c,this._events[l]&&s(this,l)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=A,o.EventEmitter=o,t.exports=o})(Ra);var Zh=Ra.exports;const ef=zh(Zh);function Af(t,e){return e.forEach(function(A){A&&typeof A!="string"&&!Array.isArray(A)&&Object.keys(A).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(A,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return A[n]}})}})}),Object.freeze(t)}var tf=Object.defineProperty,nf=(t,e,A)=>e in t?tf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,xa=(t,e,A)=>nf(t,typeof e!="symbol"?e+"":e,A);let De=class{constructor(){xa(this,"_locking"),xa(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const A=new Promise(i=>e=()=>{this._locks-=1,i()}),n=this._locking.then(()=>e);return this._locking=this._locking.then(()=>A),n}};function ae(t,e){if(!t)throw new Error(e)}const rf=34028234663852886e22,sf=-34028234663852886e22,of=4294967295,af=2147483647,cf=-2147483648;function ri(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>af||t<cf)throw new Error("invalid int 32: "+t)}function zr(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>of||t<0)throw new Error("invalid uint 32: "+t)}function Pa(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>rf||t<sf))throw new Error("invalid float 32: "+t)}const La=Symbol("@bufbuild/protobuf/enum-type");function lf(t){const e=t[La];return ae(e,"missing enum type on enum object"),e}function Da(t,e,A,n){t[La]=_a(e,A.map(i=>({no:i.no,name:i.name,localName:t[i.no]})))}function _a(t,e,A){const n=Object.create(null),i=Object.create(null),r=[];for(const s of e){const o=Ha(s);r.push(o),n[s.name]=o,i[s.no]=o}return{typeName:t,values:r,findName(s){return n[s]},findNumber(s){return i[s]}}}function uf(t,e,A){const n={};for(const i of e){const r=Ha(i);n[r.localName]=r.no,n[r.no]=r.localName}return Da(n,t,e),n}function Ha(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}class Zr{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,A){const n=this.getType(),i=n.runtime.bin,r=i.makeReadOptions(A);return i.readMessage(this,r.readerFactory(e),e.byteLength,r),this}fromJson(e,A){const n=this.getType(),i=n.runtime.json,r=i.makeReadOptions(A);return i.readMessage(n,e,r,this),this}fromJsonString(e,A){let n;try{n=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(n,A)}toBinary(e){const A=this.getType(),n=A.runtime.bin,i=n.makeWriteOptions(e),r=i.writerFactory();return n.writeMessage(this,r,i),r.finish()}toJson(e){const A=this.getType(),n=A.runtime.json,i=n.makeWriteOptions(e);return n.writeMessage(this,i)}toJsonString(e){var A;const n=this.toJson(e);return JSON.stringify(n,null,(A=e==null?void 0:e.prettySpaces)!==null&&A!==void 0?A:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function df(t,e,A,n){var i;const r=(i=n==null?void 0:n.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[r]:function(o){t.util.initFields(this),t.util.initPartial(o,this)}}[r];return Object.setPrototypeOf(s.prototype,new Zr),Object.assign(s,{runtime:t,typeName:e,fields:t.util.newFieldList(A),fromBinary(o,a){return new s().fromBinary(o,a)},fromJson(o,a){return new s().fromJson(o,a)},fromJsonString(o,a){return new s().fromJsonString(o,a)},equals(o,a){return t.util.equals(s,o,a)}}),s}function hf(){let t=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}let A=this.buf[this.pos++];if(t|=(A&15)<<28,e=(A&112)>>4,!(A&128))return this.assertBounds(),[t,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function es(t,e,A){for(let r=0;r<28;r=r+7){const s=t>>>r,o=!(!(s>>>7)&&e==0),a=(o?s|128:s)&255;if(A.push(a),!o)return}const n=t>>>28&15|(e&7)<<4,i=!!(e>>3);if(A.push((i?n|128:n)&255),!!i){for(let r=3;r<31;r=r+7){const s=e>>>r,o=!!(s>>>7),a=(o?s|128:s)&255;if(A.push(a),!o)return}A.push(e>>>31&1)}}const si=4294967296;function Oa(t){const e=t[0]==="-";e&&(t=t.slice(1));const A=1e6;let n=0,i=0;function r(s,o){const a=Number(t.slice(s,o));i*=A,n=n*A+a,n>=si&&(i=i+(n/si|0),n=n%si)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),e?Na(n,i):As(n,i)}function ff(t,e){let A=As(t,e);const n=A.hi&2147483648;n&&(A=Na(A.lo,A.hi));const i=Ma(A.lo,A.hi);return n?"-"+i:i}function Ma(t,e){if({lo:t,hi:e}=gf(t,e),e<=2097151)return String(si*e+t);const A=t&16777215,n=(t>>>24|e<<8)&16777215,i=e>>16&65535;let r=A+n*6777216+i*6710656,s=n+i*8147497,o=i*2;const a=1e7;return r>=a&&(s+=Math.floor(r/a),r%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+Ka(s)+Ka(r)}function gf(t,e){return{lo:t>>>0,hi:e>>>0}}function As(t,e){return{lo:t|0,hi:e|0}}function Na(t,e){return e=~e,t?t=~t+1:e+=1,As(t,e)}const Ka=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Va(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let A=0;A<9;A++)e.push(t&127|128),t=t>>7;e.push(1)}}function pf(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let A=5;t&128&&A<10;A++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function mf(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>r||c<i)throw new Error("int64 invalid: ".concat(a));return c},uParse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>o||c<s)throw new Error("uint64 invalid: ".concat(a));return c},enc(a){return t.setBigInt64(0,this.parse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(a){return t.setBigInt64(0,this.uParse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(a,c){return t.setInt32(0,a,!0),t.setInt32(4,c,!0),t.getBigInt64(0,!0)},uDec(a,c){return t.setInt32(0,a,!0),t.setInt32(4,c,!0),t.getBigUint64(0,!0)}}}const A=i=>ae(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),n=i=>ae(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),A(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),A(i),Oa(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),n(i),Oa(i)},dec(i,r){return ff(i,r)},uDec(i,r){return Ma(i,r)}}}const re=mf();var S;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(S||(S={}));var OA;(function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING"})(OA||(OA={}));function MA(t,e,A){if(e===A)return!0;if(t==S.BYTES){if(!(e instanceof Uint8Array)||!(A instanceof Uint8Array)||e.length!==A.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==A[n])return!1;return!0}switch(t){case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return e==A}return!1}function Dt(t,e){switch(t){case S.BOOL:return!1;case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return e==0?re.zero:"0";case S.DOUBLE:case S.FLOAT:return 0;case S.BYTES:return new Uint8Array(0);case S.STRING:return"";default:return 0}}function Ga(t,e){switch(t){case S.BOOL:return e===!1;case S.STRING:return e==="";case S.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var de;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(de||(de={}));class Bf{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let A=new Uint8Array(e),n=0;for(let i=0;i<this.chunks.length;i++)A.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],A}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),A=this.stack.pop();if(!A)throw new Error("invalid state, fork stack empty");return this.chunks=A.chunks,this.buf=A.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,A){return this.uint32((e<<3|A)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(zr(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return ri(e),Va(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let A=this.textEncoder.encode(e);return this.uint32(A.byteLength),this.raw(A)}float(e){Pa(e);let A=new Uint8Array(4);return new DataView(A.buffer).setFloat32(0,e,!0),this.raw(A)}double(e){let A=new Uint8Array(8);return new DataView(A.buffer).setFloat64(0,e,!0),this.raw(A)}fixed32(e){zr(e);let A=new Uint8Array(4);return new DataView(A.buffer).setUint32(0,e,!0),this.raw(A)}sfixed32(e){ri(e);let A=new Uint8Array(4);return new DataView(A.buffer).setInt32(0,e,!0),this.raw(A)}sint32(e){return ri(e),e=(e<<1^e>>31)>>>0,Va(e,this.buf),this}sfixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=re.enc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}fixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=re.uEnc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}int64(e){let A=re.enc(e);return es(A.lo,A.hi,this.buf),this}sint64(e){let A=re.enc(e),n=A.hi>>31,i=A.lo<<1^n,r=(A.hi<<1|A.lo>>>31)^n;return es(i,r,this.buf),this}uint64(e){let A=re.uEnc(e);return es(A.lo,A.hi,this.buf),this}}class vf{constructor(e,A){this.varint64=hf,this.uint32=pf,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=A??new TextDecoder}tag(){let e=this.uint32(),A=e>>>3,n=e&7;if(A<=0||n<0||n>5)throw new Error("illegal tag: field no "+A+" wire type "+n);return[A,n]}skip(e,A){let n=this.pos;switch(e){case de.Varint:for(;this.buf[this.pos++]&128;);break;case de.Bit64:this.pos+=4;case de.Bit32:this.pos+=4;break;case de.LengthDelimited:let i=this.uint32();this.pos+=i;break;case de.StartGroup:for(;;){const[r,s]=this.tag();if(s===de.EndGroup){if(A!==void 0&&r!==A)throw new Error("invalid end group tag");break}this.skip(s,r)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return re.dec(...this.varint64())}uint64(){return re.uDec(...this.varint64())}sint64(){let[e,A]=this.varint64(),n=-(e&1);return e=(e>>>1|(A&1)<<31)^n,A=A>>>1^n,re.dec(e,A)}bool(){let[e,A]=this.varint64();return e!==0||A!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return re.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return re.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),A=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(A,A+e)}string(){return this.textDecoder.decode(this.bytes())}}function Cf(t,e,A,n){let i;return{typeName:e,extendee:A,get field(){if(!i){const r=typeof n=="function"?n():n;r.name=e.split(".").pop(),r.jsonName="[".concat(e,"]"),i=t.util.newFieldList([r]).list()[0]}return i},runtime:t}}function ja(t){const e=t.field.localName,A=Object.create(null);return A[e]=wf(t),[A,()=>A[e]]}function wf(t){const e=t.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Dt(e.T,e.L);case"message":const A=e.T,n=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(n):n;case"map":throw"map fields are not allowed to be extensions"}}function yf(t,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let A=t.length-1;A>=0;--A)if(t[A].no==e.no)return[t[A]];return[]}return t.filter(A=>A.no===e.no)}let SA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),oi=[];for(let t=0;t<SA.length;t++)oi[SA[t].charCodeAt(0)]=t;oi["-".charCodeAt(0)]=SA.indexOf("+"),oi["_".charCodeAt(0)]=SA.indexOf("/");const Wa={dec(t){let e=t.length*3/4;t[t.length-2]=="="?e-=2:t[t.length-1]=="="&&(e-=1);let A=new Uint8Array(e),n=0,i=0,r,s=0;for(let o=0;o<t.length;o++){if(r=oi[t.charCodeAt(o)],r===void 0)switch(t[o]){case"=":i=0;case`
|
|
2
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=r,i=1;break;case 1:A[n++]=s<<2|(r&48)>>4,s=r,i=2;break;case 2:A[n++]=(s&15)<<4|(r&60)>>2,s=r,i=3;break;case 3:A[n++]=(s&3)<<6|r,i=0;break}}if(i==1)throw Error("invalid base64 string.");return A.subarray(0,n)},enc(t){let e="",A=0,n,i=0;for(let r=0;r<t.length;r++)switch(n=t[r],A){case 0:e+=SA[n>>2],i=(n&3)<<4,A=1;break;case 1:e+=SA[i|n>>4],i=(n&15)<<2,A=2;break;case 2:e+=SA[i|n>>6],e+=SA[n&63],A=0;break}return A&&(e+=SA[i],e+="=",A==1&&(e+="=")),e}};function bf(t,e,A){Xa(e,t);const n=e.runtime.bin.makeReadOptions(A),i=yf(t.getType().runtime.bin.listUnknownFields(t),e.field),[r,s]=ja(e);for(const o of i)e.runtime.bin.readField(r,n.readerFactory(o.data),e.field,o.wireType,n);return s()}function Uf(t,e,A,n){Xa(e,t);const i=e.runtime.bin.makeReadOptions(n),r=e.runtime.bin.makeWriteOptions(n);if(Ja(t,e)){const c=t.getType().runtime.bin.listUnknownFields(t).filter(l=>l.no!=e.field.no);t.getType().runtime.bin.discardUnknownFields(t);for(const l of c)t.getType().runtime.bin.onUnknownField(t,l.no,l.wireType,l.data)}const s=r.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,A,s,r);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[c,l]=a.tag(),u=a.skip(l,c);t.getType().runtime.bin.onUnknownField(t,c,l,u)}}function Ja(t,e){const A=t.getType();return e.extendee.typeName===A.typeName&&!!A.runtime.bin.listUnknownFields(t).find(n=>n.no==e.field.no)}function Xa(t,e){ae(t.extendee.typeName==e.getType().typeName,"extension ".concat(t.typeName," can only be applied to message ").concat(t.extendee.typeName))}function $a(t,e){const A=t.localName;if(t.repeated)return e[A].length>0;if(t.oneof)return e[t.oneof.localName].case===A;switch(t.kind){case"enum":case"scalar":return t.opt||t.req?e[A]!==void 0:t.kind=="enum"?e[A]!==t.T.values[0].no:!Ga(t.T,e[A]);case"message":return e[A]!==void 0;case"map":return Object.keys(e[A]).length>0}}function Ya(t,e){const A=t.localName,n=!t.opt&&!t.req;if(t.repeated)e[A]=[];else if(t.oneof)e[t.oneof.localName]={case:void 0};else switch(t.kind){case"map":e[A]={};break;case"enum":e[A]=n?t.T.values[0].no:void 0;break;case"scalar":e[A]=n?Dt(t.T,t.L):void 0;break;case"message":e[A]=void 0;break}}function gt(t,e){if(t===null||typeof t!="object"||!Object.getOwnPropertyNames(Zr.prototype).every(n=>n in t&&typeof t[n]=="function"))return!1;const A=t.getType();return A===null||typeof A!="function"||!("typeName"in A)||typeof A.typeName!="string"?!1:e===void 0?!0:A.typeName==e.typeName}function qa(t,e){return gt(e)||!t.fieldWrapper?e:t.fieldWrapper.wrapField(e)}S.DOUBLE,S.FLOAT,S.INT64,S.UINT64,S.INT32,S.UINT32,S.BOOL,S.STRING,S.BYTES;const za={ignoreUnknownFields:!1},Za={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Qf(t){return t?Object.assign(Object.assign({},za),t):za}function Ef(t){return t?Object.assign(Object.assign({},Za),t):Za}const ai=Symbol(),ci=Symbol();function Sf(){return{makeReadOptions:Qf,makeWriteOptions:Ef,readMessage(t,e,A,n){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(t.typeName," from JSON: ").concat(gA(e)));n=n??new t;const i=new Map,r=A.typeRegistry;for(const[s,o]of Object.entries(e)){const a=t.fields.findJsonName(s);if(a){if(a.oneof){if(o===null&&a.kind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: multiple keys for oneof "').concat(a.oneof.name,'" present: "').concat(c,'", "').concat(s,'"'));i.set(a.oneof,s)}ec(n,o,a,A,t)}else{let c=!1;if(r!=null&&r.findExtension&&s.startsWith("[")&&s.endsWith("]")){const l=r.findExtension(s.substring(1,s.length-1));if(l&&l.extendee.typeName==t.typeName){c=!0;const[u,d]=ja(l);ec(u,o,l.field,A,l),Uf(n,l,d(),A)}}if(!c&&!A.ignoreUnknownFields)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return n},writeMessage(t,e){const A=t.getType(),n={};let i;try{for(i of A.fields.byNumber()){if(!$a(i,t)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!Ff(i))continue}const s=i.oneof?t[i.oneof.localName].value:t[i.localName],o=Ac(i,s,e);o!==void 0&&(n[e.useProtoFieldName?i.name:i.jsonName]=o)}const r=e.typeRegistry;if(r!=null&&r.findExtensionFor)for(const s of A.runtime.bin.listUnknownFields(t)){const o=r.findExtensionFor(A.typeName,s.no);if(o&&Ja(t,o)){const a=bf(t,o,e),c=Ac(o.field,a,e);c!==void 0&&(n[o.field.jsonName]=c)}}}catch(r){const s=i?"cannot encode field ".concat(A.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(A.typeName," to JSON"),o=r instanceof Error?r.message:String(r);throw new Error(s+(o.length>0?": ".concat(o):""))}return n},readScalar(t,e,A){return gn(t,e,A??OA.BIGINT,!0)},writeScalar(t,e,A){if(e!==void 0&&(A||Ga(t,e)))return li(t,e)},debug:gA}}function gA(t){if(t===null)return"null";switch(typeof t){case"object":return Array.isArray(t)?"array":"object";case"string":return t.length>100?"string":'"'.concat(t.split('"').join('\\"'),'"');default:return String(t)}}function ec(t,e,A,n,i){let r=A.localName;if(A.repeated){if(ae(A.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e)));const s=t[r];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(o)));switch(A.kind){case"message":s.push(A.T.fromJson(o,n));break;case"enum":const a=ts(A.T,o,n.ignoreUnknownFields,!0);a!==ci&&s.push(a);break;case"scalar":try{s.push(gn(A.T,o,A.L,!0))}catch(c){let l="cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(o));throw c instanceof Error&&c.message.length>0&&(l+=": ".concat(c.message)),new Error(l)}break}}}else if(A.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e)));const s=t[r];for(const[o,a]of Object.entries(e)){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: map value null"));let c;try{c=Tf(A.K,o)}catch(l){let u="cannot decode map key for field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e));throw l instanceof Error&&l.message.length>0&&(u+=": ".concat(l.message)),new Error(u)}switch(A.V.kind){case"message":s[c]=A.V.T.fromJson(a,n);break;case"enum":const l=ts(A.V.T,a,n.ignoreUnknownFields,!0);l!==ci&&(s[c]=l);break;case"scalar":try{s[c]=gn(A.V.T,a,OA.BIGINT,!0)}catch(u){let d="cannot decode map value for field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e));throw u instanceof Error&&u.message.length>0&&(d+=": ".concat(u.message)),new Error(d)}break}}}else switch(A.oneof&&(t=t[A.oneof.localName]={case:r},r="value"),A.kind){case"message":const s=A.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=t[r];gt(o)?o.fromJson(e,n):(t[r]=o=s.fromJson(e,n),s.fieldWrapper&&!A.oneof&&(t[r]=s.fieldWrapper.unwrapField(o)));break;case"enum":const a=ts(A.T,e,n.ignoreUnknownFields,!1);switch(a){case ai:Ya(A,t);break;case ci:break;default:t[r]=a;break}break;case"scalar":try{const c=gn(A.T,e,A.L,!1);switch(c){case ai:Ya(A,t);break;default:t[r]=c;break}}catch(c){let l="cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e));throw c instanceof Error&&c.message.length>0&&(l+=": ".concat(c.message)),new Error(l)}break}}function Tf(t,e){if(t===S.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return gn(t,e,OA.BIGINT,!0).toString()}function gn(t,e,A,n){if(e===null)return n?Dt(t,A):ai;switch(t){case S.DOUBLE:case S.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return t==S.FLOAT&&Pa(i),i;case S.INT32:case S.FIXED32:case S.SFIXED32:case S.SINT32:case S.UINT32:let r;if(typeof e=="number"?r=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(r=Number(e)),r===void 0)break;return t==S.UINT32||t==S.FIXED32?zr(r):ri(r),r;case S.INT64:case S.SFIXED64:case S.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=re.parse(e);return A?s.toString():s;case S.FIXED64:case S.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=re.uParse(e);return A?o.toString():o;case S.BOOL:if(typeof e!="boolean")break;return e;case S.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case S.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return Wa.dec(e)}throw new Error}function ts(t,e,A,n){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:n?t.values[0].no:ai;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=t.findName(e);if(i!==void 0)return i.no;if(A)return ci;break}throw new Error("cannot decode enum ".concat(t.typeName," from JSON: ").concat(gA(e)))}function Ff(t){return t.repeated||t.kind=="map"?!0:!(t.oneof||t.kind=="message"||t.opt||t.req)}function Ac(t,e,A){if(t.kind=="map"){ae(typeof e=="object"&&e!=null);const n={},i=Object.entries(e);switch(t.V.kind){case"scalar":for(const[s,o]of i)n[s.toString()]=li(t.V.T,o);break;case"message":for(const[s,o]of i)n[s.toString()]=o.toJson(A);break;case"enum":const r=t.V.T;for(const[s,o]of i)n[s.toString()]=ns(r,o,A.enumAsInteger);break}return A.emitDefaultValues||i.length>0?n:void 0}if(t.repeated){ae(Array.isArray(e));const n=[];switch(t.kind){case"scalar":for(let i=0;i<e.length;i++)n.push(li(t.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)n.push(ns(t.T,e[i],A.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)n.push(e[i].toJson(A));break}return A.emitDefaultValues||n.length>0?n:void 0}switch(t.kind){case"scalar":return li(t.T,e);case"enum":return ns(t.T,e,A.enumAsInteger);case"message":return qa(t.T,e).toJson(A)}}function ns(t,e,A){var n;if(ae(typeof e=="number"),t.typeName=="google.protobuf.NullValue")return null;if(A)return e;const i=t.findNumber(e);return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:e}function li(t,e){switch(t){case S.INT32:case S.SFIXED32:case S.SINT32:case S.FIXED32:case S.UINT32:return ae(typeof e=="number"),e;case S.FLOAT:case S.DOUBLE:return ae(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case S.STRING:return ae(typeof e=="string"),e;case S.BOOL:return ae(typeof e=="boolean"),e;case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return ae(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case S.BYTES:return ae(e instanceof Uint8Array),Wa.enc(e)}}const _t=Symbol("@bufbuild/protobuf/unknown-fields"),tc={readUnknownFields:!0,readerFactory:t=>new vf(t)},nc={writeUnknownFields:!0,writerFactory:()=>new Bf};function kf(t){return t?Object.assign(Object.assign({},tc),t):tc}function If(t){return t?Object.assign(Object.assign({},nc),t):nc}function Rf(){return{makeReadOptions:kf,makeWriteOptions:If,listUnknownFields(t){var e;return(e=t[_t])!==null&&e!==void 0?e:[]},discardUnknownFields(t){delete t[_t]},writeUnknownFields(t,e){const n=t[_t];if(n)for(const i of n)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(t,e,A,n){const i=t;Array.isArray(i[_t])||(i[_t]=[]),i[_t].push({no:e,wireType:A,data:n})},readMessage(t,e,A,n,i){const r=t.getType(),s=i?e.len:e.pos+A;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!(i===!0&&a==de.EndGroup));){const c=r.fields.find(o);if(!c){const l=e.skip(a,o);n.readUnknownFields&&this.onUnknownField(t,o,a,l);continue}ic(t,e,c,a,n)}if(i&&(a!=de.EndGroup||o!==A))throw new Error("invalid end group tag")},readField:ic,writeMessage(t,e,A){const n=t.getType();for(const i of n.fields.byNumber()){if(!$a(i,t)){if(i.req)throw new Error("cannot encode field ".concat(n.typeName,".").concat(i.name," to binary: required field not set"));continue}const r=i.oneof?t[i.oneof.localName].value:t[i.localName];rc(i,r,e,A)}return A.writeUnknownFields&&this.writeUnknownFields(t,e),e},writeField(t,e,A,n){e!==void 0&&rc(t,e,A,n)}}}function ic(t,e,A,n,i){let{repeated:r,localName:s}=A;switch(A.oneof&&(t=t[A.oneof.localName],t.case!=s&&delete t.value,t.case=s,s="value"),A.kind){case"scalar":case"enum":const o=A.kind=="enum"?S.INT32:A.T;let a=di;if(A.kind=="scalar"&&A.L>0&&(a=Pf),r){let d=t[s];if(n==de.LengthDelimited&&o!=S.STRING&&o!=S.BYTES){let g=e.uint32()+e.pos;for(;e.pos<g;)d.push(a(e,o))}else d.push(a(e,o))}else t[s]=a(e,o);break;case"message":const c=A.T;r?t[s].push(ui(e,new c,i,A)):gt(t[s])?ui(e,t[s],i,A):(t[s]=ui(e,new c,i,A),c.fieldWrapper&&!A.oneof&&!A.repeated&&(t[s]=c.fieldWrapper.unwrapField(t[s])));break;case"map":let[l,u]=xf(A,e,i);t[s][l]=u;break}}function ui(t,e,A,n){const i=e.getType().runtime.bin,r=n==null?void 0:n.delimited;return i.readMessage(e,t,r?n.no:t.uint32(),A,r),e}function xf(t,e,A){const n=e.uint32(),i=e.pos+n;let r,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:r=di(e,t.K);break;case 2:switch(t.V.kind){case"scalar":s=di(e,t.V.T);break;case"enum":s=e.int32();break;case"message":s=ui(e,new t.V.T,A,void 0);break}break}}if(r===void 0&&(r=Dt(t.K,OA.BIGINT)),typeof r!="string"&&typeof r!="number"&&(r=r.toString()),s===void 0)switch(t.V.kind){case"scalar":s=Dt(t.V.T,OA.BIGINT);break;case"enum":s=t.V.T.values[0].no;break;case"message":s=new t.V.T;break}return[r,s]}function Pf(t,e){const A=di(t,e);return typeof A=="bigint"?A.toString():A}function di(t,e){switch(e){case S.STRING:return t.string();case S.BOOL:return t.bool();case S.DOUBLE:return t.double();case S.FLOAT:return t.float();case S.INT32:return t.int32();case S.INT64:return t.int64();case S.UINT64:return t.uint64();case S.FIXED64:return t.fixed64();case S.BYTES:return t.bytes();case S.FIXED32:return t.fixed32();case S.SFIXED32:return t.sfixed32();case S.SFIXED64:return t.sfixed64();case S.SINT64:return t.sint64();case S.UINT32:return t.uint32();case S.SINT32:return t.sint32()}}function rc(t,e,A,n){ae(e!==void 0);const i=t.repeated;switch(t.kind){case"scalar":case"enum":let r=t.kind=="enum"?S.INT32:t.T;if(i)if(ae(Array.isArray(e)),t.packed)Df(A,r,t.no,e);else for(const s of e)pn(A,r,t.no,s);else pn(A,r,t.no,e);break;case"message":if(i){ae(Array.isArray(e));for(const s of e)sc(A,n,t,s)}else sc(A,n,t,e);break;case"map":ae(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))Lf(A,n,t,s,o);break}}function Lf(t,e,A,n,i){t.tag(A.no,de.LengthDelimited),t.fork();let r=n;switch(A.K){case S.INT32:case S.FIXED32:case S.UINT32:case S.SFIXED32:case S.SINT32:r=Number.parseInt(n);break;case S.BOOL:ae(n=="true"||n=="false"),r=n=="true";break}switch(pn(t,A.K,1,r),A.V.kind){case"scalar":pn(t,A.V.T,2,i);break;case"enum":pn(t,S.INT32,2,i);break;case"message":ae(i!==void 0),t.tag(2,de.LengthDelimited).bytes(i.toBinary(e));break}t.join()}function sc(t,e,A,n){const i=qa(A.T,n);A.delimited?t.tag(A.no,de.StartGroup).raw(i.toBinary(e)).tag(A.no,de.EndGroup):t.tag(A.no,de.LengthDelimited).bytes(i.toBinary(e))}function pn(t,e,A,n){ae(n!==void 0);let[i,r]=oc(e);t.tag(A,i)[r](n)}function Df(t,e,A,n){if(!n.length)return;t.tag(A,de.LengthDelimited).fork();let[,i]=oc(e);for(let r=0;r<n.length;r++)t[i](n[r]);t.join()}function oc(t){let e=de.Varint;switch(t){case S.BYTES:case S.STRING:e=de.LengthDelimited;break;case S.DOUBLE:case S.FIXED64:case S.SFIXED64:e=de.Bit64;break;case S.FIXED32:case S.SFIXED32:case S.FLOAT:e=de.Bit32;break}const A=S[t].toLowerCase();return[e,A]}function _f(){return{setEnumType:Da,initPartial(t,e){if(t===void 0)return;const A=e.getType();for(const n of A.fields.byMember()){const i=n.localName,r=e,s=t;if(s[i]!=null)switch(n.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const a=n.findField(o);let c=s[i].value;a&&a.kind=="message"&&!gt(c,a.T)?c=new a.T(c):a&&a.kind==="scalar"&&a.T===S.BYTES&&(c=mn(c)),r[i]={case:o,value:c};break;case"scalar":case"enum":let l=s[i];n.T===S.BYTES&&(l=n.repeated?l.map(mn):mn(l)),r[i]=l;break;case"map":switch(n.V.kind){case"scalar":case"enum":if(n.V.T===S.BYTES)for(const[h,g]of Object.entries(s[i]))r[i][h]=mn(g);else Object.assign(r[i],s[i]);break;case"message":const d=n.V.T;for(const h of Object.keys(s[i])){let g=s[i][h];d.fieldWrapper||(g=new d(g)),r[i][h]=g}break}break;case"message":const u=n.T;if(n.repeated)r[i]=s[i].map(d=>gt(d,u)?d:new u(d));else{const d=s[i];u.fieldWrapper?u.typeName==="google.protobuf.BytesValue"?r[i]=mn(d):r[i]=d:r[i]=gt(d,u)?d:new u(d)}break}}},equals(t,e,A){return e===A?!0:!e||!A?!1:t.fields.byMember().every(n=>{const i=e[n.localName],r=A[n.localName];if(n.repeated){if(i.length!==r.length)return!1;switch(n.kind){case"message":return i.every((s,o)=>n.T.equals(s,r[o]));case"scalar":return i.every((s,o)=>MA(n.T,s,r[o]));case"enum":return i.every((s,o)=>MA(S.INT32,s,r[o]))}throw new Error("repeated cannot contain ".concat(n.kind))}switch(n.kind){case"message":return n.T.equals(i,r);case"enum":return MA(S.INT32,i,r);case"scalar":return MA(n.T,i,r);case"oneof":if(i.case!==r.case)return!1;const s=n.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,r.value);case"enum":return MA(S.INT32,i.value,r.value);case"scalar":return MA(s.T,i.value,r.value)}throw new Error("oneof cannot contain ".concat(s.kind));case"map":const o=Object.keys(i).concat(Object.keys(r));switch(n.V.kind){case"message":const a=n.V.T;return o.every(l=>a.equals(i[l],r[l]));case"enum":return o.every(l=>MA(S.INT32,i[l],r[l]));case"scalar":const c=n.V.T;return o.every(l=>MA(c,i[l],r[l]))}break}})},clone(t){const e=t.getType(),A=new e,n=A;for(const i of e.fields.byMember()){const r=t[i.localName];let s;if(i.repeated)s=r.map(hi);else if(i.kind=="map"){s=n[i.localName];for(const[o,a]of Object.entries(r))s[o]=hi(a)}else i.kind=="oneof"?s=i.findField(r.case)?{case:r.case,value:hi(r.value)}:{case:void 0}:s=hi(r);n[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(t))e.runtime.bin.onUnknownField(n,i.no,i.wireType,i.data);return A}}}function hi(t){if(t===void 0)return t;if(gt(t))return t.clone();if(t instanceof Uint8Array){const e=new Uint8Array(t.byteLength);return e.set(t),e}return t}function mn(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function Hf(t,e,A){return{syntax:t,json:Sf(),bin:Rf(),util:Object.assign(Object.assign({},_f()),{newFieldList:e,initFields:A}),makeMessageType(n,i,r){return df(this,n,i,r)},makeEnum:uf,makeEnumType:_a,getEnumType:lf,makeExtension(n,i,r){return Cf(this,n,i,r)}}}class Of{constructor(e,A){this._fields=e,this._normalizer=A}findJsonName(e){if(!this.jsonNames){const A={};for(const n of this.list())A[n.jsonName]=A[n.name]=n;this.jsonNames=A}return this.jsonNames[e]}find(e){if(!this.numbers){const A={};for(const n of this.list())A[n.no]=n;this.numbers=A}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,A)=>e.no-A.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let A;for(const n of this.list())n.oneof?n.oneof!==A&&(A=n.oneof,e.push(A)):e.push(n)}return this.members}}function ac(t,e){const A=cc(t);return e?A:jf(Gf(A))}function Mf(t){return ac(t,!1)}const Nf=cc;function cc(t){let e=!1;const A=[];for(let n=0;n<t.length;n++){let i=t.charAt(n);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":A.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),A.push(i);break}}return A.join("")}const Kf=new Set(["constructor","toString","toJSON","valueOf"]),Vf=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),lc=t=>"".concat(t,"$"),Gf=t=>Vf.has(t)?lc(t):t,jf=t=>Kf.has(t)?lc(t):t;class Wf{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=Mf(e)}addField(e){ae(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let A=0;A<this.fields.length;A++)this._lookup[this.fields[A].localName]=this.fields[A]}return this._lookup[e]}}function Jf(t,e){var A,n,i,r,s,o;const a=[];let c;for(const l of typeof t=="function"?t():t){const u=l;if(u.localName=ac(l.name,l.oneof!==void 0),u.jsonName=(A=l.jsonName)!==null&&A!==void 0?A:Nf(l.name),u.repeated=(n=l.repeated)!==null&&n!==void 0?n:!1,l.kind=="scalar"&&(u.L=(i=l.L)!==null&&i!==void 0?i:OA.BIGINT),u.delimited=(r=l.delimited)!==null&&r!==void 0?r:!1,u.req=(s=l.req)!==null&&s!==void 0?s:!1,u.opt=(o=l.opt)!==null&&o!==void 0?o:!1,l.packed===void 0&&(u.packed=l.kind=="enum"||l.kind=="scalar"&&l.T!=S.BYTES&&l.T!=S.STRING),l.oneof!==void 0){const d=typeof l.oneof=="string"?l.oneof:l.oneof.name;(!c||c.name!=d)&&(c=new Wf(d)),u.oneof=c,c.addField(u)}a.push(u)}return a}const U=Hf("proto3",t=>new Of(t,e=>Jf(e)),t=>{for(const e of t.getType().fields.byMember()){if(e.opt)continue;const A=e.localName,n=t;if(e.repeated){n[A]=[];continue}switch(e.kind){case"oneof":n[A]={case:void 0};break;case"enum":n[A]=0;break;case"map":n[A]={};break;case"scalar":n[A]=Dt(e.T,e.L);break}}});class _e extends Zr{constructor(e){super(),this.seconds=re.zero,this.nanos=0,U.util.initPartial(e,this)}fromJson(e,A){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(U.json.debug(e)));const n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=re.parse(i/1e3),this.nanos=0,n[7]&&(this.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),this}toJson(e){const A=Number(this.seconds)*1e3;if(A<Date.parse("0001-01-01T00:00:00Z")||A>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let n="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?n="."+i.substring(0,3)+"Z":i.substring(6)==="000"?n="."+i.substring(0,6)+"Z":n="."+i+"Z"}return new Date(A).toISOString().replace(".000Z",n)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return _e.fromDate(new Date)}static fromDate(e){const A=e.getTime();return new _e({seconds:re.parse(Math.floor(A/1e3)),nanos:A%1e3*1e6})}static fromBinary(e,A){return new _e().fromBinary(e,A)}static fromJson(e,A){return new _e().fromJson(e,A)}static fromJsonString(e,A){return new _e().fromJsonString(e,A)}static equals(e,A){return U.util.equals(_e,e,A)}}_e.runtime=U,_e.typeName="google.protobuf.Timestamp",_e.fields=U.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const Xf=U.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:_e},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:$f,repeated:!0},{no:5,name:"events",kind:"message",T:qf,repeated:!0}]),$f=U.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:Yf,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),Yf=U.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:_e},{no:3,name:"value",kind:"scalar",T:2}]),qf=U.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:_e},{no:7,name:"normalized_end_timestamp",kind:"message",T:_e,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),uc=U.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),tA=U.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),ge=U.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),Ht=U.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),Bn=U.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),vn=U.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),nA=U.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),Ot=U.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),zf=U.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),iA=U.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),fi=U.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:gi,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:Uc}]),gi=U.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),Zf=U.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:U.getEnumType(ge),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),pt=U.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:U.getEnumType(Mt)},{no:4,name:"tracks",kind:"message",T:Nt,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:Zf},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:U.getEnumType(pi)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:U.getEnumType(nA)},{no:18,name:"kind_details",kind:"enum",T:U.getEnumType(eg),repeated:!0}]),Mt=U.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),pi=U.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),eg=U.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),je=U.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),Ag=U.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:mt,repeated:!0}]),Nt=U.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:U.getEnumType(tA)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:U.getEnumType(ge)},{no:10,name:"layers",kind:"message",T:mt,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:Ag,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:U.getEnumType(je)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Uc},{no:19,name:"audio_features",kind:"enum",T:U.getEnumType(iA),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(uc)}]),mt=U.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:U.getEnumType(Ht)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),He=U.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:U.getEnumType(W)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:hc,oneof:"value"},{no:3,name:"speaker",kind:"message",T:tg,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:fc,oneof:"value"},{no:7,name:"transcription",kind:"message",T:ng,oneof:"value"},{no:8,name:"metrics",kind:"message",T:Xf,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:is,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:gc,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:pc,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:mc,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:ss,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:os,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:as,oneof:"value"}]),W=U.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),tg=U.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:dc,repeated:!0}]),dc=U.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),hc=U.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),fc=U.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),ng=U.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:ig,repeated:!0}]),ig=U.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),is=U.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),gc=U.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),pc=U.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),mc=U.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Bc,oneof:"value"}]),Bc=U.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),vc=U.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),rg=U.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:U.getEnumType(Cc)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),Cc=U.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),sg=U.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:U.getEnumType(wc)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),wc=U.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),yc=U.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:bc},{no:2,name:"screen",kind:"message",T:bc},{no:3,name:"resume_connection",kind:"enum",T:U.getEnumType(vn)},{no:4,name:"disabled_codecs",kind:"message",T:og},{no:5,name:"force_relay",kind:"enum",T:U.getEnumType(vn)}]),bc=U.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:U.getEnumType(vn)}]),og=U.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:gi,repeated:!0},{no:2,name:"publish",kind:"message",T:gi,repeated:!0}]),Uc=U.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),rs=U.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Qc=U.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:U.getEnumType(rs)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),Ec=U.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),ss=U.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:U.getEnumType(je)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Qc,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Ec,oneof:"content_header"}],{localName:"DataStream_Header"}),os=U.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),as=U.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),rA=U.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),cs=U.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),ag=U.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),cg=U.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Bt,oneof:"message"},{no:2,name:"answer",kind:"message",T:Bt,oneof:"message"},{no:3,name:"trickle",kind:"message",T:ds,oneof:"message"},{no:4,name:"add_track",kind:"message",T:us,oneof:"message"},{no:5,name:"mute",kind:"message",T:hs,oneof:"message"},{no:6,name:"subscription",kind:"message",T:mi,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Tc,oneof:"message"},{no:8,name:"leave",kind:"message",T:Bi,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:kc,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Pc,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Lc,oneof:"message"},{no:13,name:"simulate",kind:"message",T:pA,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Ic,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:_c,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Fc,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:fg,oneof:"message"}]),Sc=U.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:lg,oneof:"message"},{no:2,name:"answer",kind:"message",T:Bt,oneof:"message"},{no:3,name:"offer",kind:"message",T:Bt,oneof:"message"},{no:4,name:"trickle",kind:"message",T:ds,oneof:"message"},{no:5,name:"update",kind:"message",T:hg,oneof:"message"},{no:6,name:"track_published",kind:"message",T:fs,oneof:"message"},{no:8,name:"leave",kind:"message",T:Bi,oneof:"message"},{no:9,name:"mute",kind:"message",T:hs,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:gg,oneof:"message"},{no:11,name:"room_update",kind:"message",T:pg,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:Bg,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:Cg,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:yg,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:bg,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:dg,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:ug,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:Qg,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:Tg,oneof:"message"},{no:22,name:"request_response",kind:"message",T:Fg,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:kg,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:Ug,oneof:"message"}]),ls=U.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),us=U.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:U.getEnumType(tA)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:U.getEnumType(ge)},{no:9,name:"layers",kind:"message",T:mt,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:ls,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:U.getEnumType(je)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(uc)},{no:17,name:"audio_features",kind:"enum",T:U.getEnumType(iA),repeated:!0}]),ds=U.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:U.getEnumType(rA)},{no:3,name:"final",kind:"scalar",T:8}]),hs=U.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),lg=U.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:fi},{no:2,name:"participant",kind:"message",T:pt},{no:3,name:"other_participants",kind:"message",T:pt,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Rc,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:yc},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:rg},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:gi,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),ug=U.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:Rc,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:yc}]),fs=U.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Nt}]),dg=U.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Bt=U.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),hg=U.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:pt,repeated:!0}]),mi=U.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:vc,repeated:!0}]),Tc=U.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:U.getEnumType(Ht)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),Fc=U.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:U.getEnumType(iA),repeated:!0}]),fg=U.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),Bi=U.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:U.getEnumType(nA)},{no:3,name:"action",kind:"enum",T:U.getEnumType(Kt)},{no:4,name:"regions",kind:"message",T:Eg}]),Kt=U.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),kc=U.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:mt,repeated:!0}]),Ic=U.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),Rc=U.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),gg=U.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:dc,repeated:!0}]),pg=U.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:fi}]),mg=U.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:U.getEnumType(Bn)},{no:3,name:"score",kind:"scalar",T:2}]),Bg=U.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:mg,repeated:!0}]),vg=U.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:U.getEnumType(cs)}]),Cg=U.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:vg,repeated:!0}]),gs=U.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:U.getEnumType(Ht)},{no:2,name:"enabled",kind:"scalar",T:8}]),wg=U.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:gs,repeated:!0}]),yg=U.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:gs,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:wg,repeated:!0}]),xc=U.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),Pc=U.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:xc,repeated:!0}]),bg=U.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),Ug=U.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:fi},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:pt},{no:4,name:"other_participants",kind:"message",T:pt,repeated:!0}]),Lc=U.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Bt},{no:2,name:"subscription",kind:"message",T:mi},{no:3,name:"publish_tracks",kind:"message",T:fs,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Dc,repeated:!0},{no:5,name:"offer",kind:"message",T:Bt},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),Dc=U.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:U.getEnumType(rA)}]),pA=U.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:U.getEnumType(ag),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),_c=U.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),Qg=U.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),Eg=U.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:Sg,repeated:!0}]),Sg=U.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),Tg=U.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:U.getEnumType(zf)}]),Fg=U.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:U.getEnumType(ps)},{no:3,name:"message",kind:"scalar",T:9}]),ps=U.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),kg=U.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function Ig(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vi={exports:{}},Rg=vi.exports,Hc;function xg(){return Hc||(Hc=1,function(t){(function(e,A){t.exports?t.exports=A():e.log=A()})(Rg,function(){var e=function(){},A="undefined",n=typeof window!==A&&typeof window.navigator!==A&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},s=null;function o(f,p){var B=f[p];if(typeof B.bind=="function")return B.bind(f);try{return Function.prototype.bind.call(B,f)}catch{return function(){return Function.prototype.apply.apply(B,[f,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(f){return f==="debug"&&(f="log"),typeof console===A?!1:f==="trace"&&n?a:console[f]!==void 0?o(console,f):console.log!==void 0?o(console,"log"):e}function l(){for(var f=this.getLevel(),p=0;p<i.length;p++){var B=i[p];this[B]=p<f?e:this.methodFactory(B,f,this.name)}if(this.log=this.debug,typeof console===A&&f<this.levels.SILENT)return"No console available for logging"}function u(f){return function(){typeof console!==A&&(l.call(this),this[f].apply(this,arguments))}}function d(f,p,B){return c(f)||u.apply(this,arguments)}function h(f,p){var B=this,y,b,v,C="loglevel";typeof f=="string"?C+=":"+f:typeof f=="symbol"&&(C=void 0);function w(H){var M=(i[H]||"silent").toUpperCase();if(!(typeof window===A||!C)){try{window.localStorage[C]=M;return}catch{}try{window.document.cookie=encodeURIComponent(C)+"="+M+";"}catch{}}}function Q(){var H;if(!(typeof window===A||!C)){try{H=window.localStorage[C]}catch{}if(typeof H===A)try{var M=window.document.cookie,ee=encodeURIComponent(C),Xe=M.indexOf(ee+"=");Xe!==-1&&(H=/^([^;]+)/.exec(M.slice(Xe+ee.length+1))[1])}catch{}return B.levels[H]===void 0&&(H=void 0),H}}function F(){if(!(typeof window===A||!C)){try{window.localStorage.removeItem(C)}catch{}try{window.document.cookie=encodeURIComponent(C)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function R(H){var M=H;if(typeof M=="string"&&B.levels[M.toUpperCase()]!==void 0&&(M=B.levels[M.toUpperCase()]),typeof M=="number"&&M>=0&&M<=B.levels.SILENT)return M;throw new TypeError("log.setLevel() called with invalid level: "+H)}B.name=f,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=p||d,B.getLevel=function(){return v??b??y},B.setLevel=function(H,M){return v=R(H),M!==!1&&w(v),l.call(B)},B.setDefaultLevel=function(H){b=R(H),Q()||B.setLevel(H,!1)},B.resetLevel=function(){v=null,F(),l.call(B)},B.enableAll=function(H){B.setLevel(B.levels.TRACE,H)},B.disableAll=function(H){B.setLevel(B.levels.SILENT,H)},B.rebuild=function(){if(s!==B&&(y=R(s.getLevel())),l.call(B),s===B)for(var H in r)r[H].rebuild()},y=R(s?s.getLevel():"WARN");var D=Q();D!=null&&(v=R(D)),l.call(B)}s=new h,s.getLogger=function(p){if(typeof p!="symbol"&&typeof p!="string"||p==="")throw new TypeError("You must supply a name when creating a logger.");var B=r[p];return B||(B=r[p]=new h(p,s.methodFactory)),B};var g=typeof window!==A?window.log:void 0;return s.noConflict=function(){return typeof window!==A&&window.log===s&&(window.log=g),s},s.getLoggers=function(){return r},s.default=s,s})}(vi)),vi.exports}var Ci=xg(),ms;(function(t){t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent"})(ms||(ms={}));var sA;(function(t){t.Default="livekit",t.Room="livekit-room",t.Participant="livekit-participant",t.Track="livekit-track",t.Publication="livekit-track-publication",t.Engine="livekit-engine",t.Signal="livekit-signal",t.PCManager="livekit-pc-manager",t.PCTransport="livekit-pc-transport",t.E2EE="lk-e2ee"})(sA||(sA={}));let K=Ci.getLogger("livekit");Object.values(sA).map(t=>Ci.getLogger(t)),K.setDefaultLevel(ms.info);function TA(t){const e=Ci.getLogger(t);return e.setDefaultLevel(K.getLevel()),e}const Pg=Ci.getLogger("lk-e2ee"),Cn=7e3,Lg=[0,300,2*2*300,3*3*300,4*4*300,Cn,Cn,Cn,Cn,Cn];class Dg{constructor(e){this._retryDelays=e!==void 0?[...e]:Lg}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const A=this._retryDelays[e.retryCount];return e.retryCount<=1?A:A+Math.random()*1e3}}function _g(t,e){var A={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(A[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(A[n[i]]=t[n[i]]);return A}function m(t,e,A,n){function i(r){return r instanceof A?r:new A(function(s){s(r)})}return new(A||(A=Promise))(function(r,s){function o(l){try{c(n.next(l))}catch(u){s(u)}}function a(l){try{c(n.throw(l))}catch(u){s(u)}}function c(l){l.done?r(l.value):i(l.value).then(o,a)}c((n=n.apply(t,e||[])).next())})}function Oc(t){var e=typeof Symbol=="function"&&Symbol.iterator,A=e&&t[e],n=0;if(A)return A.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function NA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],A;return e?e.call(t):(t=typeof Oc=="function"?Oc(t):t[Symbol.iterator](),A={},n("next"),n("throw"),n("return"),A[Symbol.asyncIterator]=function(){return this},A);function n(r){A[r]=t[r]&&function(s){return new Promise(function(o,a){s=t[r](s),i(o,a,s.done,s.value)})}}function i(r,s,o,a){Promise.resolve(a).then(function(c){r({value:c,done:o})},s)}}typeof SuppressedError=="function"&&SuppressedError;var wi={exports:{}},Mc;function Hg(){if(Mc)return wi.exports;Mc=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(C,w,Q){return Function.prototype.apply.call(C,w,Q)},A;t&&typeof t.ownKeys=="function"?A=t.ownKeys:Object.getOwnPropertySymbols?A=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:A=function(C){return Object.getOwnPropertyNames(C)};function n(v){console&&console.warn&&console.warn(v)}var i=Number.isNaN||function(C){return C!==C};function r(){r.init.call(this)}wi.exports=r,wi.exports.once=B,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function o(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(v){if(typeof v!="number"||v<0||i(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");s=v}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function a(v){return v._maxListeners===void 0?r.defaultMaxListeners:v._maxListeners}r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(C){for(var w=[],Q=1;Q<arguments.length;Q++)w.push(arguments[Q]);var F=C==="error",R=this._events;if(R!==void 0)F=F&&R.error===void 0;else if(!F)return!1;if(F){var D;if(w.length>0&&(D=w[0]),D instanceof Error)throw D;var H=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw H.context=D,H}var M=R[C];if(M===void 0)return!1;if(typeof M=="function")e(M,this,w);else for(var ee=M.length,Xe=g(M,ee),Q=0;Q<ee;++Q)e(Xe[Q],this,w);return!0};function c(v,C,w,Q){var F,R,D;if(o(w),R=v._events,R===void 0?(R=v._events=Object.create(null),v._eventsCount=0):(R.newListener!==void 0&&(v.emit("newListener",C,w.listener?w.listener:w),R=v._events),D=R[C]),D===void 0)D=R[C]=w,++v._eventsCount;else if(typeof D=="function"?D=R[C]=Q?[w,D]:[D,w]:Q?D.unshift(w):D.push(w),F=a(v),F>0&&D.length>F&&!D.warned){D.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=v,H.type=C,H.count=D.length,n(H)}return v}r.prototype.addListener=function(C,w){return c(this,C,w,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(C,w){return c(this,C,w,!0)};function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(v,C,w){var Q={fired:!1,wrapFn:void 0,target:v,type:C,listener:w},F=l.bind(Q);return F.listener=w,Q.wrapFn=F,F}r.prototype.once=function(C,w){return o(w),this.on(C,u(this,C,w)),this},r.prototype.prependOnceListener=function(C,w){return o(w),this.prependListener(C,u(this,C,w)),this},r.prototype.removeListener=function(C,w){var Q,F,R,D,H;if(o(w),F=this._events,F===void 0)return this;if(Q=F[C],Q===void 0)return this;if(Q===w||Q.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete F[C],F.removeListener&&this.emit("removeListener",C,Q.listener||w));else if(typeof Q!="function"){for(R=-1,D=Q.length-1;D>=0;D--)if(Q[D]===w||Q[D].listener===w){H=Q[D].listener,R=D;break}if(R<0)return this;R===0?Q.shift():f(Q,R),Q.length===1&&(F[C]=Q[0]),F.removeListener!==void 0&&this.emit("removeListener",C,H||w)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(C){var w,Q,F;if(Q=this._events,Q===void 0)return this;if(Q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Q[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Q[C]),this;if(arguments.length===0){var R=Object.keys(Q),D;for(F=0;F<R.length;++F)D=R[F],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=Q[C],typeof w=="function")this.removeListener(C,w);else if(w!==void 0)for(F=w.length-1;F>=0;F--)this.removeListener(C,w[F]);return this};function d(v,C,w){var Q=v._events;if(Q===void 0)return[];var F=Q[C];return F===void 0?[]:typeof F=="function"?w?[F.listener||F]:[F]:w?p(F):g(F,F.length)}r.prototype.listeners=function(C){return d(this,C,!0)},r.prototype.rawListeners=function(C){return d(this,C,!1)},r.listenerCount=function(v,C){return typeof v.listenerCount=="function"?v.listenerCount(C):h.call(v,C)},r.prototype.listenerCount=h;function h(v){var C=this._events;if(C!==void 0){var w=C[v];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function g(v,C){for(var w=new Array(C),Q=0;Q<C;++Q)w[Q]=v[Q];return w}function f(v,C){for(;C+1<v.length;C++)v[C]=v[C+1];v.pop()}function p(v){for(var C=new Array(v.length),w=0;w<C.length;++w)C[w]=v[w].listener||v[w];return C}function B(v,C){return new Promise(function(w,Q){function F(D){v.removeListener(C,R),Q(D)}function R(){typeof v.removeListener=="function"&&v.removeListener("error",F),w([].slice.call(arguments))}b(v,C,R,{once:!0}),C!=="error"&&y(v,F,{once:!0})})}function y(v,C,w){typeof v.on=="function"&&b(v,"error",C,w)}function b(v,C,w,Q){if(typeof v.on=="function")Q.once?v.once(C,w):v.on(C,w);else if(typeof v.addEventListener=="function")v.addEventListener(C,function F(R){Q.once&&v.removeEventListener(C,F),w(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}return wi.exports}var mA=Hg();let Nc=!0,Kc=!0;function yi(t,e,A){const n=t.match(e);return n&&n.length>=A&&parseInt(n[A],10)}function vt(t,e,A){if(!t.RTCPeerConnection)return;const n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(s,o){if(s!==e)return i.apply(this,arguments);const a=c=>{const l=A(c);l&&(o.handleEvent?o.handleEvent(l):o(l))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,a),i.apply(this,[s,a])};const r=n.removeEventListener;n.removeEventListener=function(s,o){if(s!==e||!this._eventMap||!this._eventMap[e])return r.apply(this,arguments);if(!this._eventMap[e].has(o))return r.apply(this,arguments);const a=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,r.apply(this,[s,a])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function Og(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Nc=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Mg(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Kc=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Vc(){if(typeof window=="object"){if(Nc)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Bs(t,e){Kc&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Ng(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:A}=t;if(A.userAgentData&&A.userAgentData.brands){const n=A.userAgentData.brands.find(i=>i.brand==="Chromium");if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(A.mozGetUserMedia)e.browser="firefox",e.version=yi(A.userAgent,/Firefox\/(\d+)\./,1);else if(A.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=yi(A.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&A.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=yi(A.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Gc(t){return Object.prototype.toString.call(t)==="[object Object]"}function jc(t){return Gc(t)?Object.keys(t).reduce(function(e,A){const n=Gc(t[A]),i=n?jc(t[A]):t[A],r=n&&!Object.keys(i).length;return i===void 0||r?e:Object.assign(e,{[A]:i})},{}):t}function vs(t,e,A){!e||A.has(e.id)||(A.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?vs(t,t.get(e[n]),A):n.endsWith("Ids")&&e[n].forEach(i=>{vs(t,t.get(i),A)})}))}function Wc(t,e,A){const n=A?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const r=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&r.push(s)}),r.forEach(s=>{t.forEach(o=>{o.type===n&&o.trackId===s.id&&vs(t,o,i)})}),i}const Jc=Vc;function Xc(t,e){const A=t&&t.navigator;if(!A.mediaDevices)return;const n=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const a={};return Object.keys(o).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const l=typeof o[c]=="object"?o[c]:{ideal:o[c]};l.exact!==void 0&&typeof l.exact=="number"&&(l.min=l.max=l.exact);const u=function(d,h){return d?d+h.charAt(0).toUpperCase()+h.slice(1):h==="deviceId"?"sourceId":h};if(l.ideal!==void 0){a.optional=a.optional||[];let d={};typeof l.ideal=="number"?(d[u("min",c)]=l.ideal,a.optional.push(d),d={},d[u("max",c)]=l.ideal,a.optional.push(d)):(d[u("",c)]=l.ideal,a.optional.push(d))}l.exact!==void 0&&typeof l.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[u("",c)]=l.exact):["min","max"].forEach(d=>{l[d]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[u(d,c)]=l[d])})}),o.advanced&&(a.optional=(a.optional||[]).concat(o.advanced)),a},i=function(o,a){if(e.version>=61)return a(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const c=function(l,u,d){u in l&&!(d in l)&&(l[d]=l[u],delete l[u])};o=JSON.parse(JSON.stringify(o)),c(o.audio,"autoGainControl","googAutoGainControl"),c(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=n(o.audio)}if(o&&typeof o.video=="object"){let c=o.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const l=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(A.mediaDevices.getSupportedConstraints&&A.mediaDevices.getSupportedConstraints().facingMode&&!l)){delete o.video.facingMode;let u;if(c.exact==="environment"||c.ideal==="environment"?u=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(u=["front"]),u)return A.mediaDevices.enumerateDevices().then(d=>{d=d.filter(g=>g.kind==="videoinput");let h=d.find(g=>u.some(f=>g.label.toLowerCase().includes(f)));return!h&&d.length&&u.includes("back")&&(h=d[d.length-1]),h&&(o.video.deviceId=c.exact?{exact:h.deviceId}:{ideal:h.deviceId}),o.video=n(o.video),Jc("chrome: "+JSON.stringify(o)),a(o)})}o.video=n(o.video)}return Jc("chrome: "+JSON.stringify(o)),a(o)},r=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,a,c){i(o,l=>{A.webkitGetUserMedia(l,a,u=>{c&&c(r(u))})})};if(A.getUserMedia=s.bind(A),A.mediaDevices.getUserMedia){const o=A.mediaDevices.getUserMedia.bind(A.mediaDevices);A.mediaDevices.getUserMedia=function(a){return i(a,c=>o(c).then(l=>{if(c.audio&&!l.getAudioTracks().length||c.video&&!l.getVideoTracks().length)throw l.getTracks().forEach(u=>{u.stop()}),new DOMException("","NotFoundError");return l},l=>Promise.reject(r(l))))}}}function $c(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function Yc(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(A){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=A)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",i=>{let r;t.RTCPeerConnection.prototype.getReceivers?r=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):r={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=r,s.transceiver={receiver:r},s.streams=[n.stream],this.dispatchEvent(s)}),n.stream.getTracks().forEach(i=>{let r;t.RTCPeerConnection.prototype.getReceivers?r=this.getReceivers().find(o=>o.track&&o.track.id===i.id):r={track:i};const s=new Event("track");s.track=i,s.receiver=r,s.transceiver={receiver:r},s.streams=[n.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else vt(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function qc(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,r){return{track:r,get dtmf(){return this._dtmf===void 0&&(r.kind==="audio"?this._dtmf=i.createDTMFSender(r):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(o,a){let c=i.apply(this,arguments);return c||(c=e(this,o),this._senders.push(c)),c};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(o){r.apply(this,arguments);const a=this._senders.indexOf(o);a!==-1&&this._senders.splice(a,1)}}const A=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(r){this._senders=this._senders||[],A.apply(this,[r]),r.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(r){this._senders=this._senders||[],n.apply(this,[r]),r.getTracks().forEach(s=>{const o=this._senders.find(a=>a.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function zc(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const A=t.RTCPeerConnection.prototype.getSenders;A&&(t.RTCPeerConnection.prototype.getSenders=function(){const r=A.apply(this,[]);return r.forEach(s=>s._pc=this),r});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const r=n.apply(this,arguments);return r._pc=this,r}),t.RTCRtpSender.prototype.getStats=function(){const r=this;return this._pc.getStats().then(s=>Wc(s,r.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const A=t.RTCPeerConnection.prototype.getReceivers;A&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=A.apply(this,[]);return i.forEach(r=>r._pc=this),i}),vt(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(r=>Wc(r,i.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const n=arguments[0];let i,r,s;return this.getSenders().forEach(o=>{o.track===n&&(i?s=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===n&&(r?s=!0:r=o),o.track===n)),s||i&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Zc(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(a)===-1&&this._shimmedLocalStreams[o.id].push(a):this._shimmedLocalStreams[o.id]=[o,a],a};const A=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(u=>u.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();A.apply(this,arguments);const a=this.getSenders().filter(c=>o.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(a)};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const a=this._shimmedLocalStreams[o].indexOf(s);a!==-1&&this._shimmedLocalStreams[o].splice(a,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function el(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Zc(t);const A=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const l=A.apply(this);return this._reverseStreams=this._reverseStreams||{},l.map(u=>this._reverseStreams[u.id])};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(l){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},l.getTracks().forEach(u=>{if(this.getSenders().find(h=>h.track===u))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[l.id]){const u=new t.MediaStream(l.getTracks());this._streams[l.id]=u,this._reverseStreams[u.id]=l,l=u}n.apply(this,[l])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(l){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[l.id]||l]),delete this._reverseStreams[this._streams[l.id]?this._streams[l.id].id:l.id],delete this._streams[l.id]},t.RTCPeerConnection.prototype.addTrack=function(l,u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(f=>f===l))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(f=>f.track===l))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[u.id];if(g)g.addTrack(l),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const f=new t.MediaStream([l]);this._streams[u.id]=f,this._reverseStreams[f.id]=u,this.addStream(f)}return this.getSenders().find(f=>f.track===l)};function r(c,l){let u=l.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],g=c._streams[h.id];u=u.replace(new RegExp(g.id,"g"),h.id)}),new RTCSessionDescription({type:l.type,sdp:u})}function s(c,l){let u=l.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],g=c._streams[h.id];u=u.replace(new RegExp(h.id,"g"),g.id)}),new RTCSessionDescription({type:l.type,sdp:u})}["createOffer","createAnswer"].forEach(function(c){const l=t.RTCPeerConnection.prototype[c],u={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?l.apply(this,[g=>{const f=r(this,g);d[0].apply(null,[f])},g=>{d[1]&&d[1].apply(null,g)},arguments[2]]):l.apply(this,arguments).then(g=>r(this,g))}};t.RTCPeerConnection.prototype[c]=u[c]});const o=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const c=a.get.apply(this);return c.type===""?c:r(this,c)}}),t.RTCPeerConnection.prototype.removeTrack=function(l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!l._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(l._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(h=>{this._streams[h].getTracks().find(f=>l.track===f)&&(d=this._streams[h])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(l.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Cs(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(A){const n=t.RTCPeerConnection.prototype[A],i={[A](){return arguments[0]=new(A==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[A]=i[A]})}function Al(t,e){vt(t,"negotiationneeded",A=>{const n=A.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return A})}var tl=Object.freeze({__proto__:null,fixNegotiationNeeded:Al,shimAddTrackRemoveTrack:el,shimAddTrackRemoveTrackWithNative:Zc,shimGetSendersWithDtmf:qc,shimGetUserMedia:Xc,shimMediaStream:$c,shimOnTrack:Yc,shimPeerConnection:Cs,shimSenderReceiverGetStats:zc});function nl(t,e){const A=t&&t.navigator,n=t&&t.MediaStreamTrack;if(A.getUserMedia=function(i,r,s){Bs("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),A.mediaDevices.getUserMedia(i).then(r,s)},!(e.version>55&&"autoGainControl"in A.mediaDevices.getSupportedConstraints())){const i=function(s,o,a){o in s&&!(a in s)&&(s[a]=s[o],delete s[o])},r=A.mediaDevices.getUserMedia.bind(A.mediaDevices);if(A.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),r(s)},n&&n.prototype.getSettings){const s=n.prototype.getSettings;n.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(n&&n.prototype.applyConstraints){const s=n.prototype.applyConstraints;n.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function Kg(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return n.video===!0?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function il(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ws(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const r=t.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[i]=s[i]});const A={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[r,s,o]=arguments;return n.apply(this,[r||null]).then(a=>{if(e.version<53&&!s)try{a.forEach(c=>{c.type=A[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;a.forEach((l,u)=>{a.set(u,Object.assign({},l,{type:A[l.type]||l.type}))})}return a}).then(s,o)}}function rl(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(r=>r._pc=this),i});const A=t.RTCPeerConnection.prototype.addTrack;A&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=A.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function sl(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n}),vt(t,"track",A=>(A.receiver._pc=A.srcElement,A)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function ol(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(A){Bs("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&A.getTracks().includes(n.track)&&this.removeTrack(n)})})}function al(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function cl(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let n=arguments[1]&&arguments[1].sendEncodings;n===void 0&&(n=[]),n=[...n];const i=n.length>0;i&&n.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(i){const{sender:s}=r,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=n,s.sendEncodings=n,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return r})}function ll(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const n=e.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function ul(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function dl(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var hl=Object.freeze({__proto__:null,shimAddTransceiver:cl,shimCreateAnswer:dl,shimCreateOffer:ul,shimGetDisplayMedia:Kg,shimGetParameters:ll,shimGetUserMedia:nl,shimOnTrack:il,shimPeerConnection:ws,shimRTCDataChannel:al,shimReceiverGetStats:sl,shimRemoveStream:ol,shimSenderGetStats:rl});function fl(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(i=>e.call(this,i,n)),n.getVideoTracks().forEach(i=>e.call(this,i,n))},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];return r&&r.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(A){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(A);if(n===-1)return;this._localStreams.splice(n,1);const i=A.getTracks();this.getSenders().forEach(r=>{i.includes(r.track)&&this.removeTrack(r)})})}}function gl(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(A){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=A),this.addEventListener("track",this._onaddstreampoly=n=>{n.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const r=new Event("addstream");r.stream=i,this.dispatchEvent(r)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(r=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(r)>=0)return;n._remoteStreams.push(r);const s=new Event("addstream");s.stream=r,n.dispatchEvent(s)})}),e.apply(n,arguments)}}}function pl(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,A=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,r=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,l){const u=arguments.length>=2?arguments[2]:arguments[0],d=A.apply(this,[u]);return l?(d.then(c,l),Promise.resolve()):d},e.createAnswer=function(c,l){const u=arguments.length>=2?arguments[2]:arguments[0],d=n.apply(this,[u]);return l?(d.then(c,l),Promise.resolve()):d};let o=function(a,c,l){const u=i.apply(this,[a]);return l?(u.then(c,l),Promise.resolve()):u};e.setLocalDescription=o,o=function(a,c,l){const u=r.apply(this,[a]);return l?(u.then(c,l),Promise.resolve()):u},e.setRemoteDescription=o,o=function(a,c,l){const u=s.apply(this,[a]);return l?(u.then(c,l),Promise.resolve()):u},e.addIceCandidate=o}function ml(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const A=e.mediaDevices,n=A.getUserMedia.bind(A);e.mediaDevices.getUserMedia=i=>n(Bl(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(n,i,r){e.mediaDevices.getUserMedia(n).then(i,r)}).bind(e))}function Bl(t){return t&&t.video!==void 0?Object.assign({},t,{video:jc(t.video)}):t}function vl(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){const r=[];for(let s=0;s<n.iceServers.length;s++){let o=n.iceServers[s];o.urls===void 0&&o.url?(Bs("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,r.push(o)):r.push(n.iceServers[s])}n.iceServers=r}return new e(n,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function Cl(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function wl(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(n){if(n){typeof n.offerToReceiveAudio<"u"&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");n.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):n.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof n.offerToReceiveVideo<"u"&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const r=this.getTransceivers().find(s=>s.receiver.track.kind==="video");n.offerToReceiveVideo===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):n.offerToReceiveVideo===!0&&!r&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function yl(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var bl=Object.freeze({__proto__:null,shimAudioContext:yl,shimCallbacksAPI:pl,shimConstraints:Bl,shimCreateOfferLegacy:wl,shimGetUserMedia:ml,shimLocalStreamsAPI:fl,shimRTCIceServerUrls:vl,shimRemoteStreamsAPI:gl,shimTrackEventTransceiver:Cl}),ys={exports:{}},Ul;function Vg(){return Ul||(Ul=1,function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(A){return A.trim().split(`
|
|
3
|
-
`).map(n=>n.trim())},e.splitSections=function(A){return A.split(`
|
|
4
|
-
m=`).map((i,r)=>(r>0?"m="+i:i).trim()+`\r
|
|
5
|
-
`)},e.getDescription=function(A){const n=e.splitSections(A);return n&&n[0]},e.getMediaSections=function(A){const n=e.splitSections(A);return n.shift(),n},e.matchPrefix=function(A,n){return e.splitLines(A).filter(i=>i.indexOf(n)===0)},e.parseCandidate=function(A){let n;A.indexOf("a=candidate:")===0?n=A.substring(12).split(" "):n=A.substring(10).split(" ");const i={foundation:n[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]};for(let r=8;r<n.length;r+=2)switch(n[r]){case"raddr":i.relatedAddress=n[r+1];break;case"rport":i.relatedPort=parseInt(n[r+1],10);break;case"tcptype":i.tcpType=n[r+1];break;case"ufrag":i.ufrag=n[r+1],i.usernameFragment=n[r+1];break;default:i[n[r]]===void 0&&(i[n[r]]=n[r+1]);break}return i},e.writeCandidate=function(A){const n=[];n.push(A.foundation);const i=A.component;i==="rtp"?n.push(1):i==="rtcp"?n.push(2):n.push(i),n.push(A.protocol.toUpperCase()),n.push(A.priority),n.push(A.address||A.ip),n.push(A.port);const r=A.type;return n.push("typ"),n.push(r),r!=="host"&&A.relatedAddress&&A.relatedPort&&(n.push("raddr"),n.push(A.relatedAddress),n.push("rport"),n.push(A.relatedPort)),A.tcpType&&A.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(A.tcpType)),(A.usernameFragment||A.ufrag)&&(n.push("ufrag"),n.push(A.usernameFragment||A.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(A){return A.substring(14).split(" ")},e.parseRtpMap=function(A){let n=A.substring(9).split(" ");const i={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),i.name=n[0],i.clockRate=parseInt(n[1],10),i.channels=n.length===3?parseInt(n[2],10):1,i.numChannels=i.channels,i},e.writeRtpMap=function(A){let n=A.payloadType;A.preferredPayloadType!==void 0&&(n=A.preferredPayloadType);const i=A.channels||A.numChannels||1;return"a=rtpmap:"+n+" "+A.name+"/"+A.clockRate+(i!==1?"/"+i:"")+`\r
|
|
6
|
-
`},e.parseExtmap=function(A){const n=A.substring(9).split(" ");return{id:parseInt(n[0],10),direction:n[0].indexOf("/")>0?n[0].split("/")[1]:"sendrecv",uri:n[1],attributes:n.slice(2).join(" ")}},e.writeExtmap=function(A){return"a=extmap:"+(A.id||A.preferredId)+(A.direction&&A.direction!=="sendrecv"?"/"+A.direction:"")+" "+A.uri+(A.attributes?" "+A.attributes:"")+`\r
|
|
7
|
-
`},e.parseFmtp=function(A){const n={};let i;const r=A.substring(A.indexOf(" ")+1).split(";");for(let s=0;s<r.length;s++)i=r[s].trim().split("="),n[i[0].trim()]=i[1];return n},e.writeFmtp=function(A){let n="",i=A.payloadType;if(A.preferredPayloadType!==void 0&&(i=A.preferredPayloadType),A.parameters&&Object.keys(A.parameters).length){const r=[];Object.keys(A.parameters).forEach(s=>{A.parameters[s]!==void 0?r.push(s+"="+A.parameters[s]):r.push(s)}),n+="a=fmtp:"+i+" "+r.join(";")+`\r
|
|
8
|
-
`}return n},e.parseRtcpFb=function(A){const n=A.substring(A.indexOf(" ")+1).split(" ");return{type:n.shift(),parameter:n.join(" ")}},e.writeRtcpFb=function(A){let n="",i=A.payloadType;return A.preferredPayloadType!==void 0&&(i=A.preferredPayloadType),A.rtcpFeedback&&A.rtcpFeedback.length&&A.rtcpFeedback.forEach(r=>{n+="a=rtcp-fb:"+i+" "+r.type+(r.parameter&&r.parameter.length?" "+r.parameter:"")+`\r
|
|
9
|
-
`}),n},e.parseSsrcMedia=function(A){const n=A.indexOf(" "),i={ssrc:parseInt(A.substring(7,n),10)},r=A.indexOf(":",n);return r>-1?(i.attribute=A.substring(n+1,r),i.value=A.substring(r+1)):i.attribute=A.substring(n+1),i},e.parseSsrcGroup=function(A){const n=A.substring(13).split(" ");return{semantics:n.shift(),ssrcs:n.map(i=>parseInt(i,10))}},e.getMid=function(A){const n=e.matchPrefix(A,"a=mid:")[0];if(n)return n.substring(6)},e.parseFingerprint=function(A){const n=A.substring(14).split(" ");return{algorithm:n[0].toLowerCase(),value:n[1].toUpperCase()}},e.getDtlsParameters=function(A,n){return{role:"auto",fingerprints:e.matchPrefix(A+n,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(A,n){let i="a=setup:"+n+`\r
|
|
10
|
-
`;return A.fingerprints.forEach(r=>{i+="a=fingerprint:"+r.algorithm+" "+r.value+`\r
|
|
11
|
-
`}),i},e.parseCryptoLine=function(A){const n=A.substring(9).split(" ");return{tag:parseInt(n[0],10),cryptoSuite:n[1],keyParams:n[2],sessionParams:n.slice(3)}},e.writeCryptoLine=function(A){return"a=crypto:"+A.tag+" "+A.cryptoSuite+" "+(typeof A.keyParams=="object"?e.writeCryptoKeyParams(A.keyParams):A.keyParams)+(A.sessionParams?" "+A.sessionParams.join(" "):"")+`\r
|
|
12
|
-
`},e.parseCryptoKeyParams=function(A){if(A.indexOf("inline:")!==0)return null;const n=A.substring(7).split("|");return{keyMethod:"inline",keySalt:n[0],lifeTime:n[1],mkiValue:n[2]?n[2].split(":")[0]:void 0,mkiLength:n[2]?n[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(A){return A.keyMethod+":"+A.keySalt+(A.lifeTime?"|"+A.lifeTime:"")+(A.mkiValue&&A.mkiLength?"|"+A.mkiValue+":"+A.mkiLength:"")},e.getCryptoParameters=function(A,n){return e.matchPrefix(A+n,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(A,n){const i=e.matchPrefix(A+n,"a=ice-ufrag:")[0],r=e.matchPrefix(A+n,"a=ice-pwd:")[0];return i&&r?{usernameFragment:i.substring(12),password:r.substring(10)}:null},e.writeIceParameters=function(A){let n="a=ice-ufrag:"+A.usernameFragment+`\r
|
|
13
|
-
a=ice-pwd:`+A.password+`\r
|
|
14
|
-
`;return A.iceLite&&(n+=`a=ice-lite\r
|
|
15
|
-
`),n},e.parseRtpParameters=function(A){const n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=e.splitLines(A)[0].split(" ");n.profile=r[2];for(let o=3;o<r.length;o++){const a=r[o],c=e.matchPrefix(A,"a=rtpmap:"+a+" ")[0];if(c){const l=e.parseRtpMap(c),u=e.matchPrefix(A,"a=fmtp:"+a+" ");switch(l.parameters=u.length?e.parseFmtp(u[0]):{},l.rtcpFeedback=e.matchPrefix(A,"a=rtcp-fb:"+a+" ").map(e.parseRtcpFb),n.codecs.push(l),l.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(l.name.toUpperCase());break}}}e.matchPrefix(A,"a=extmap:").forEach(o=>{n.headerExtensions.push(e.parseExtmap(o))});const s=e.matchPrefix(A,"a=rtcp-fb:* ").map(e.parseRtcpFb);return n.codecs.forEach(o=>{s.forEach(a=>{o.rtcpFeedback.find(l=>l.type===a.type&&l.parameter===a.parameter)||o.rtcpFeedback.push(a)})}),n},e.writeRtpDescription=function(A,n){let i="";i+="m="+A+" ",i+=n.codecs.length>0?"9":"0",i+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=n.codecs.map(s=>s.preferredPayloadType!==void 0?s.preferredPayloadType:s.payloadType).join(" ")+`\r
|
|
16
|
-
`,i+=`c=IN IP4 0.0.0.0\r
|
|
17
|
-
`,i+=`a=rtcp:9 IN IP4 0.0.0.0\r
|
|
18
|
-
`,n.codecs.forEach(s=>{i+=e.writeRtpMap(s),i+=e.writeFmtp(s),i+=e.writeRtcpFb(s)});let r=0;return n.codecs.forEach(s=>{s.maxptime>r&&(r=s.maxptime)}),r>0&&(i+="a=maxptime:"+r+`\r
|
|
19
|
-
`),n.headerExtensions&&n.headerExtensions.forEach(s=>{i+=e.writeExtmap(s)}),i},e.parseRtpEncodingParameters=function(A){const n=[],i=e.parseRtpParameters(A),r=i.fecMechanisms.indexOf("RED")!==-1,s=i.fecMechanisms.indexOf("ULPFEC")!==-1,o=e.matchPrefix(A,"a=ssrc:").map(d=>e.parseSsrcMedia(d)).filter(d=>d.attribute==="cname"),a=o.length>0&&o[0].ssrc;let c;const l=e.matchPrefix(A,"a=ssrc-group:FID").map(d=>d.substring(17).split(" ").map(g=>parseInt(g,10)));l.length>0&&l[0].length>1&&l[0][0]===a&&(c=l[0][1]),i.codecs.forEach(d=>{if(d.name.toUpperCase()==="RTX"&&d.parameters.apt){let h={ssrc:a,codecPayloadType:parseInt(d.parameters.apt,10)};a&&c&&(h.rtx={ssrc:c}),n.push(h),r&&(h=JSON.parse(JSON.stringify(h)),h.fec={ssrc:a,mechanism:s?"red+ulpfec":"red"},n.push(h))}}),n.length===0&&a&&n.push({ssrc:a});let u=e.matchPrefix(A,"b=");return u.length&&(u[0].indexOf("b=TIAS:")===0?u=parseInt(u[0].substring(7),10):u[0].indexOf("b=AS:")===0?u=parseInt(u[0].substring(5),10)*1e3*.95-50*40*8:u=void 0,n.forEach(d=>{d.maxBitrate=u})),n},e.parseRtcpParameters=function(A){const n={},i=e.matchPrefix(A,"a=ssrc:").map(o=>e.parseSsrcMedia(o)).filter(o=>o.attribute==="cname")[0];i&&(n.cname=i.value,n.ssrc=i.ssrc);const r=e.matchPrefix(A,"a=rtcp-rsize");n.reducedSize=r.length>0,n.compound=r.length===0;const s=e.matchPrefix(A,"a=rtcp-mux");return n.mux=s.length>0,n},e.writeRtcpParameters=function(A){let n="";return A.reducedSize&&(n+=`a=rtcp-rsize\r
|
|
20
|
-
`),A.mux&&(n+=`a=rtcp-mux\r
|
|
21
|
-
`),A.ssrc!==void 0&&A.cname&&(n+="a=ssrc:"+A.ssrc+" cname:"+A.cname+`\r
|
|
22
|
-
`),n},e.parseMsid=function(A){let n;const i=e.matchPrefix(A,"a=msid:");if(i.length===1)return n=i[0].substring(7).split(" "),{stream:n[0],track:n[1]};const r=e.matchPrefix(A,"a=ssrc:").map(s=>e.parseSsrcMedia(s)).filter(s=>s.attribute==="msid");if(r.length>0)return n=r[0].value.split(" "),{stream:n[0],track:n[1]}},e.parseSctpDescription=function(A){const n=e.parseMLine(A),i=e.matchPrefix(A,"a=max-message-size:");let r;i.length>0&&(r=parseInt(i[0].substring(19),10)),isNaN(r)&&(r=65536);const s=e.matchPrefix(A,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:n.fmt,maxMessageSize:r};const o=e.matchPrefix(A,"a=sctpmap:");if(o.length>0){const a=o[0].substring(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:r}}},e.writeSctpDescription=function(A,n){let i=[];return A.protocol!=="DTLS/SCTP"?i=["m="+A.kind+" 9 "+A.protocol+" "+n.protocol+`\r
|
|
23
|
-
`,`c=IN IP4 0.0.0.0\r
|
|
24
|
-
`,"a=sctp-port:"+n.port+`\r
|
|
25
|
-
`]:i=["m="+A.kind+" 9 "+A.protocol+" "+n.port+`\r
|
|
26
|
-
`,`c=IN IP4 0.0.0.0\r
|
|
27
|
-
`,"a=sctpmap:"+n.port+" "+n.protocol+` 65535\r
|
|
28
|
-
`],n.maxMessageSize!==void 0&&i.push("a=max-message-size:"+n.maxMessageSize+`\r
|
|
29
|
-
`),i.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(A,n,i){let r;const s=n!==void 0?n:2;return A?r=A:r=e.generateSessionId(),`v=0\r
|
|
30
|
-
o=`+(i||"thisisadapterortc")+" "+r+" "+s+` IN IP4 127.0.0.1\r
|
|
31
|
-
s=-\r
|
|
32
|
-
t=0 0\r
|
|
33
|
-
`},e.getDirection=function(A,n){const i=e.splitLines(A);for(let r=0;r<i.length;r++)switch(i[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[r].substring(2)}return n?e.getDirection(n):"sendrecv"},e.getKind=function(A){return e.splitLines(A)[0].split(" ")[0].substring(2)},e.isRejected=function(A){return A.split(" ",2)[1]==="0"},e.parseMLine=function(A){const i=e.splitLines(A)[0].substring(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},e.parseOLine=function(A){const i=e.matchPrefix(A,"o=")[0].substring(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},e.isValidSDP=function(A){if(typeof A!="string"||A.length===0)return!1;const n=e.splitLines(A);for(let i=0;i<n.length;i++)if(n[i].length<2||n[i].charAt(1)!=="=")return!1;return!0},t.exports=e}(ys)),ys.exports}var Ql=Vg(),Vt=Ig(Ql),Gg=Af({__proto__:null,default:Vt},[Ql]);function bi(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(n){if(typeof n=="object"&&n.candidate&&n.candidate.indexOf("a=")===0&&(n=JSON.parse(JSON.stringify(n)),n.candidate=n.candidate.substring(2)),n.candidate&&n.candidate.length){const i=new e(n),r=Vt.parseCandidate(n.candidate);for(const s in r)s in i||Object.defineProperty(i,s,{value:r[s]});return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(n)},t.RTCIceCandidate.prototype=e.prototype,vt(t,"icecandidate",A=>(A.candidate&&Object.defineProperty(A,"candidate",{value:new t.RTCIceCandidate(A.candidate),writable:"false"}),A))}function bs(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||vt(t,"icecandidate",e=>{if(e.candidate){const A=Vt.parseCandidate(e.candidate.candidate);A.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[A.priority>>24])}return e})}function Ui(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const A=function(o){if(!o||!o.sdp)return!1;const a=Vt.splitSections(o.sdp);return a.shift(),a.some(c=>{const l=Vt.parseMLine(c);return l&&l.kind==="application"&&l.protocol.indexOf("SCTP")!==-1})},n=function(o){const a=o.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(a===null||a.length<2)return-1;const c=parseInt(a[1],10);return c!==c?-1:c},i=function(o){let a=65536;return e.browser==="firefox"&&(e.version<57?o===-1?a=16384:a=2147483637:e.version<60?a=e.version===57?65535:65536:a=2147483637),a},r=function(o,a){let c=65536;e.browser==="firefox"&&e.version===57&&(c=65535);const l=Vt.matchPrefix(o.sdp,"a=max-message-size:");return l.length>0?c=parseInt(l[0].substring(19),10):e.browser==="firefox"&&a!==-1&&(c=2147483637),c},s=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:a}=this.getConfiguration();a==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(A(arguments[0])){const a=n(arguments[0]),c=i(a),l=r(arguments[0],a);let u;c===0&&l===0?u=Number.POSITIVE_INFINITY:c===0||l===0?u=Math.max(c,l):u=Math.min(c,l);const d={};Object.defineProperty(d,"maxMessageSize",{get(){return u}}),this._sctp=d}return s.apply(this,arguments)}}function Qi(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(n,i){const r=n.send;n.send=function(){const o=arguments[0],a=o.length||o.size||o.byteLength;if(n.readyState==="open"&&i.sctp&&a>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return r.apply(n,arguments)}}const A=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const i=A.apply(this,arguments);return e(i,this),i},vt(t,"datachannel",n=>(e(n.channel,n.target),n))}function Us(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(A){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),A&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=A)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(A=>{const n=e[A];e[A]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=i=>{const r=i.target;if(r._lastConnectionState!==r.connectionState){r._lastConnectionState=r.connectionState;const s=new Event("connectionstatechange",i);r.dispatchEvent(s)}return i},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function Qs(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.version>=71||e.browser==="safari"&&e.version>=605)return;const A=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(i){if(i&&i.sdp&&i.sdp.indexOf(`
|
|
34
|
-
a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
35
|
-
`).filter(s=>s.trim()!=="a=extmap-allow-mixed").join(`
|
|
36
|
-
`);t.RTCSessionDescription&&i instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:i.type,sdp:r}):i.sdp=r}return A.apply(this,arguments)}}function Ei(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const A=t.RTCPeerConnection.prototype.addIceCandidate;!A||A.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():A.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Si(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const A=t.RTCPeerConnection.prototype.setLocalDescription;!A||A.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let i=arguments[0]||{};if(typeof i!="object"||i.type&&i.sdp)return A.apply(this,arguments);if(i={type:i.type,sdp:i.sdp},!i.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":i.type="offer";break;default:i.type="answer";break}return i.sdp||i.type!=="offer"&&i.type!=="answer"?A.apply(this,[i]):(i.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(s=>A.apply(this,[s]))})}var jg=Object.freeze({__proto__:null,removeExtmapAllowMixed:Qs,shimAddIceCandidateNullOrEmpty:Ei,shimConnectionState:Us,shimMaxMessageSize:Ui,shimParameterlessSetLocalDescription:Si,shimRTCIceCandidate:bi,shimRTCIceCandidateRelayProtocol:bs,shimSendThrowTypeError:Qi});function Wg(){let{window:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const A=Vc,n=Ng(t),i={browserDetails:n,commonShim:jg,extractVersion:yi,disableLog:Og,disableWarnings:Mg,sdp:Gg};switch(n.browser){case"chrome":if(!tl||!Cs||!e.shimChrome)return A("Chrome shim is not included in this adapter release."),i;if(n.version===null)return A("Chrome shim can not determine version, not shimming."),i;A("adapter.js shimming chrome."),i.browserShim=tl,Ei(t,n),Si(t),Xc(t,n),$c(t),Cs(t,n),Yc(t),el(t,n),qc(t),zc(t),Al(t,n),bi(t),bs(t),Us(t),Ui(t,n),Qi(t),Qs(t,n);break;case"firefox":if(!hl||!ws||!e.shimFirefox)return A("Firefox shim is not included in this adapter release."),i;A("adapter.js shimming firefox."),i.browserShim=hl,Ei(t,n),Si(t),nl(t,n),ws(t,n),il(t),ol(t),rl(t),sl(t),al(t),cl(t),ll(t),ul(t),dl(t),bi(t),Us(t),Ui(t,n),Qi(t);break;case"safari":if(!bl||!e.shimSafari)return A("Safari shim is not included in this adapter release."),i;A("adapter.js shimming safari."),i.browserShim=bl,Ei(t,n),Si(t),vl(t),wl(t),pl(t),fl(t),gl(t),Cl(t),ml(t),yl(t),bi(t),bs(t),Ui(t,n),Qi(t),Qs(t,n);break;default:A("Unsupported browser!");break}return i}Wg({window:typeof window>"u"?void 0:window});const Jg=10,Ti="lk_e2ee",Xg={sharedKey:!1,ratchetSalt:"LKFrameEncryptionKey",ratchetWindowSize:8,failureTolerance:Jg,keyringSize:16};var KA;(function(t){t.SetKey="setKey",t.RatchetRequest="ratchetRequest",t.KeyRatcheted="keyRatcheted"})(KA||(KA={}));var El;(function(t){t.KeyRatcheted="keyRatcheted"})(El||(El={}));var VA;(function(t){t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError"})(VA||(VA={}));var Sl;(function(t){t.Error="cryptorError"})(Sl||(Sl={}));function $g(){return Yg()||Es()}function Es(){return typeof window.RTCRtpScriptTransform<"u"}function Yg(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}class wU extends mA.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.onKeyRatcheted=(A,n,i)=>{K.debug("key ratcheted event received",{ratchetResult:A,participantId:n,keyIndex:i})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},Xg),e),this.on(KA.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,A,n){const i={key:e,participantIdentity:A,keyIndex:n};if(!this.options.sharedKey&&!A)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(A??"shared","-").concat(n??0),i),this.emit(KA.SetKey,i)}getKeys(){return Array.from(this.keyInfoMap.values())}getOptions(){return this.options}ratchetKey(e,A){this.emit(KA.RatchetRequest,e,A)}}class GA extends Error{constructor(e,A){super(A||"an error has occured"),this.name="LiveKitError",this.code=e}}var G;(function(t){t[t.NotAllowed=0]="NotAllowed",t[t.ServerUnreachable=1]="ServerUnreachable",t[t.InternalError=2]="InternalError",t[t.Cancelled=3]="Cancelled",t[t.LeaveRequest=4]="LeaveRequest"})(G||(G={}));class z extends GA{constructor(e,A,n,i){super(1,e),this.name="ConnectionError",this.status=n,this.reason=A,this.context=i,this.reasonName=G[A]}}class Ss extends GA{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class FA extends GA{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class qg extends GA{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class Be extends GA{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class Ts extends GA{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class Fs extends GA{constructor(e,A){super(15,e),this.name="PublishTrackError",this.status=A}}class Tl extends GA{constructor(e,A){super(15,e),this.reason=A,this.reasonName=typeof A=="string"?A:ps[A]}}var Fi;(function(t){t.PermissionDenied="PermissionDenied",t.NotFound="NotFound",t.DeviceInUse="DeviceInUse",t.Other="Other"})(Fi||(Fi={})),function(t){function e(A){if(A&&"name"in A)return A.name==="NotFoundError"||A.name==="DevicesNotFoundError"?t.NotFound:A.name==="NotAllowedError"||A.name==="PermissionDeniedError"?t.PermissionDenied:A.name==="NotReadableError"||A.name==="TrackStartError"?t.DeviceInUse:t.Other}t.getFailure=e}(Fi||(Fi={}));var Fl;(function(t){t[t.InvalidKey=0]="InvalidKey",t[t.MissingKey=1]="MissingKey",t[t.InternalError=2]="InternalError"})(Fl||(Fl={}));var T;(function(t){t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting",t.Reconnected="reconnected",t.Disconnected="disconnected",t.ConnectionStateChanged="connectionStateChanged",t.Moved="moved",t.MediaDevicesChanged="mediaDevicesChanged",t.ParticipantConnected="participantConnected",t.ParticipantDisconnected="participantDisconnected",t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalAudioSilenceDetected="localAudioSilenceDetected",t.ActiveSpeakersChanged="activeSpeakersChanged",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.ParticipantAttributesChanged="participantAttributesChanged",t.ParticipantActive="participantActive",t.RoomMetadataChanged="roomMetadataChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.AudioPlaybackStatusChanged="audioPlaybackChanged",t.VideoPlaybackStatusChanged="videoPlaybackChanged",t.MediaDevicesError="mediaDevicesError",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.SignalConnected="signalConnected",t.RecordingStatusChanged="recordingStatusChanged",t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ActiveDeviceChanged="activeDeviceChanged",t.ChatMessage="chatMessage",t.LocalTrackSubscribed="localTrackSubscribed",t.MetricsReceived="metricsReceived"})(T||(T={}));var x;(function(t){t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.IsSpeakingChanged="isSpeakingChanged",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.MediaDevicesError="mediaDevicesError",t.AudioStreamAcquired="audioStreamAcquired",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.PCTrackAdded="pcTrackAdded",t.AttributesChanged="attributesChanged",t.LocalTrackSubscribed="localTrackSubscribed",t.ChatMessage="chatMessage",t.Active="active"})(x||(x={}));var I;(function(t){t.TransportsCreated="transportsCreated",t.Connected="connected",t.Disconnected="disconnected",t.Resuming="resuming",t.Resumed="resumed",t.Restarting="restarting",t.Restarted="restarted",t.SignalResumed="signalResumed",t.SignalRestarted="signalRestarted",t.Closing="closing",t.MediaTrackAdded="mediaTrackAdded",t.ActiveSpeakersUpdate="activeSpeakersUpdate",t.DataPacketReceived="dataPacketReceived",t.RTPVideoMapUpdate="rtpVideoMapUpdate",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ParticipantUpdate="participantUpdate",t.RoomUpdate="roomUpdate",t.SpeakersChanged="speakersChanged",t.StreamStateChanged="streamStateChanged",t.ConnectionQualityUpdate="connectionQualityUpdate",t.SubscriptionError="subscriptionError",t.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",t.RemoteMute="remoteMute",t.SubscribedQualityUpdate="subscribedQualityUpdate",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalTrackSubscribed="localTrackSubscribed",t.Offline="offline",t.SignalRequestResponse="signalRequestResponse",t.SignalConnected="signalConnected",t.RoomMoved="roomMoved"})(I||(I={}));var k;(function(t){t.Message="message",t.Muted="muted",t.Unmuted="unmuted",t.Restarted="restarted",t.Ended="ended",t.Subscribed="subscribed",t.Unsubscribed="unsubscribed",t.UpdateSettings="updateSettings",t.UpdateSubscription="updateSubscription",t.AudioPlaybackStarted="audioPlaybackStarted",t.AudioPlaybackFailed="audioPlaybackFailed",t.AudioSilenceDetected="audioSilenceDetected",t.VisibilityChanged="visibilityChanged",t.VideoDimensionsChanged="videoDimensionsChanged",t.VideoPlaybackStarted="videoPlaybackStarted",t.VideoPlaybackFailed="videoPlaybackFailed",t.ElementAttached="elementAttached",t.ElementDetached="elementDetached",t.UpstreamPaused="upstreamPaused",t.UpstreamResumed="upstreamResumed",t.SubscriptionPermissionChanged="subscriptionPermissionChanged",t.SubscriptionStatusChanged="subscriptionStatusChanged",t.SubscriptionFailed="subscriptionFailed",t.TrackProcessorUpdate="trackProcessorUpdate",t.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",t.TranscriptionReceived="transcriptionReceived",t.TimeSyncUpdate="timeSyncUpdate"})(k||(k={}));function zg(t){return typeof t>"u"?t:typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}const Zg=/version\/(\d+(\.?_?\d+)+)/i;let ks;function oA(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof t>"u"&&typeof navigator>"u")return;const A=(t??navigator.userAgent).toLowerCase();if(ks===void 0||e){const n=ep.find(i=>{let{test:r}=i;return r.test(A)});ks=n==null?void 0:n.describe(A)}return ks}const ep=[{test:/firefox|iceweasel|fxios/i,describe(t){return{name:"Firefox",version:ki(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Is(t)}}},{test:/chrom|crios|crmo/i,describe(t){return{name:"Chrome",version:ki(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Is(t)}}},{test:/safari|applewebkit/i,describe(t){return{name:"Safari",version:ki(Zg,t),os:t.includes("mobile/")?"iOS":"macOS",osVersion:Is(t)}}}];function ki(t,e){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const n=e.match(t);return n&&n.length>=A&&n[A]||""}function Is(t){return t.includes("mac os")?ki(/\(.+?(\d+_\d+(:?_\d+)?)/,t,1).replace(/_/g,"."):void 0}var Ap="2.13.0";const tp=Ap,np=16;class ye{}ye.setTimeout=function(){return setTimeout(...arguments)},ye.setInterval=function(){return setInterval(...arguments)},ye.clearTimeout=function(){return clearTimeout(...arguments)},ye.clearInterval=function(){return clearInterval(...arguments)};const ip=5e3,wn=[];var $e;(function(t){t[t.LOW=0]="LOW",t[t.MEDIUM=1]="MEDIUM",t[t.HIGH=2]="HIGH"})($e||($e={}));class E extends mA.EventEmitter{constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=E.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=K,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),ip):this.handleAppVisibilityChanged()},this.log=TA((i=n.loggerName)!==null&&i!==void 0?i:sA.Track),this.loggerContextCb=n.loggerContextCb,this.setMaxListeners(100),this.kind=A,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=E.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),X(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let A="audio";this.kind===E.Kind.Video&&(A="video"),this.attachedElements.length===0&&this.kind===E.Kind.Video&&this.addAppVisibilityListener(),e||(A==="audio"&&(wn.forEach(r=>{r.parentElement===null&&!e&&(e=r)}),e&&wn.splice(wn.indexOf(e),1)),e||(e=document.createElement(A))),this.attachedElements.includes(e)||this.attachedElements.push(e),Gt(this.mediaStreamTrack,e);const n=e.srcObject.getTracks(),i=n.some(r=>r.kind==="audio");return e.play().then(()=>{this.emit(i?k.AudioPlaybackStarted:k.VideoPlaybackStarted)}).catch(r=>{r.name==="NotAllowedError"?this.emit(i?k.AudioPlaybackFailed:k.VideoPlaybackFailed,r):r.name==="AbortError"?K.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):K.warn("could not playback ".concat(i?"audio":"video"),r),i&&e&&n.some(s=>s.kind==="video")&&r.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit(k.ElementAttached,e),e}detach(e){try{if(e){jt(this.mediaStreamTrack,e);const n=this.attachedElements.indexOf(e);return n>=0&&(this.attachedElements.splice(n,1),this.recycleElement(e),this.emit(k.ElementDetached,e)),e}const A=[];return this.attachedElements.forEach(n=>{jt(this.mediaStreamTrack,n),A.push(n),this.recycleElement(n),this.emit(k.ElementDetached,n)}),this.attachedElements=[],A}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=TA(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let A=!0;e.pause(),wn.forEach(n=>{n.parentElement||(A=!1)}),A&&wn.push(e)}}handleAppVisibilityChanged(){return m(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackground&&this.kind===E.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){Me()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){Me()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Gt(t,e){let A;e.srcObject instanceof MediaStream?A=e.srcObject:A=new MediaStream;let n;t.kind==="audio"?n=A.getAudioTracks():n=A.getVideoTracks(),n.includes(t)||(n.forEach(i=>{A.removeTrack(i)}),A.addTrack(t)),(!jA()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=A.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==A&&(e.srcObject=A,(jA()||Wt())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=A,e.play().catch(()=>{})},0))}function jt(t,e){if(e.srcObject instanceof MediaStream){const A=e.srcObject;A.removeTrack(t),A.getTracks().length>0?e.srcObject=A:e.srcObject=null}}(function(t){let e;(function(c){c.Audio="audio",c.Video="video",c.Unknown="unknown"})(e=t.Kind||(t.Kind={}));let A;(function(c){c.Camera="camera",c.Microphone="microphone",c.ScreenShare="screen_share",c.ScreenShareAudio="screen_share_audio",c.Unknown="unknown"})(A=t.Source||(t.Source={}));let n;(function(c){c.Active="active",c.Paused="paused",c.Unknown="unknown"})(n=t.StreamState||(t.StreamState={}));function i(c){switch(c){case e.Audio:return tA.AUDIO;case e.Video:return tA.VIDEO;default:return tA.DATA}}t.kindToProto=i;function r(c){switch(c){case tA.AUDIO:return e.Audio;case tA.VIDEO:return e.Video;default:return e.Unknown}}t.kindFromProto=r;function s(c){switch(c){case A.Camera:return ge.CAMERA;case A.Microphone:return ge.MICROPHONE;case A.ScreenShare:return ge.SCREEN_SHARE;case A.ScreenShareAudio:return ge.SCREEN_SHARE_AUDIO;default:return ge.UNKNOWN}}t.sourceToProto=s;function o(c){switch(c){case ge.CAMERA:return A.Camera;case ge.MICROPHONE:return A.Microphone;case ge.SCREEN_SHARE:return A.ScreenShare;case ge.SCREEN_SHARE_AUDIO:return A.ScreenShareAudio;default:return A.Unknown}}t.sourceFromProto=o;function a(c){switch(c){case cs.ACTIVE:return n.Active;case cs.PAUSED:return n.Paused;default:return n.Unknown}}t.streamStateFromProto=a})(E||(E={}));class q{constructor(e,A,n,i,r){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(A!==void 0&&n!==void 0)this.width=e,this.height=A,this.aspectRatio=e/A,this.encoding={maxBitrate:n,maxFramerate:i,priority:r};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const rp=["vp8","h264"],sp=["vp8","h264","vp9","av1"];function op(t){return!!rp.find(e=>e===t)}var kl;(function(t){t[t.PREFER_REGRESSION=0]="PREFER_REGRESSION",t[t.SIMULCAST=1]="SIMULCAST",t[t.REGRESSION=2]="REGRESSION"})(kl||(kl={}));var Rs;(function(t){t.telephone={maxBitrate:12e3},t.speech={maxBitrate:24e3},t.music={maxBitrate:48e3},t.musicStereo={maxBitrate:64e3},t.musicHighQuality={maxBitrate:96e3},t.musicHighQualityStereo={maxBitrate:128e3}})(Rs||(Rs={}));const yn={h90:new q(160,90,9e4,20),h180:new q(320,180,16e4,20),h216:new q(384,216,18e4,20),h360:new q(640,360,45e4,20),h540:new q(960,540,8e5,25),h720:new q(1280,720,17e5,30),h1080:new q(1920,1080,3e6,30),h1440:new q(2560,1440,5e6,30),h2160:new q(3840,2160,8e6,30)},xs={h120:new q(160,120,7e4,20),h180:new q(240,180,125e3,20),h240:new q(320,240,14e4,20),h360:new q(480,360,33e4,20),h480:new q(640,480,5e5,20),h540:new q(720,540,6e5,25),h720:new q(960,720,13e5,30),h1080:new q(1440,1080,23e5,30),h1440:new q(1920,1440,38e5,30)},Ps={h360fps3:new q(640,360,2e5,3,"medium"),h360fps15:new q(640,360,4e5,15,"medium"),h720fps5:new q(1280,720,8e5,5,"medium"),h720fps15:new q(1280,720,15e5,15,"medium"),h720fps30:new q(1280,720,2e6,30,"medium"),h1080fps15:new q(1920,1080,25e5,15,"medium"),h1080fps30:new q(1920,1080,5e6,30,"medium"),original:new q(0,0,7e6,30,"medium")},ap="|",Il="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function cp(t){const e=t.split(ap);return e.length>1?[e[0],t.substr(e[0].length+1)]:[t,""]}function Oe(t){return m(this,void 0,void 0,function*(){return new Promise(e=>ye.setTimeout(e,t))})}function Ls(){return"addTransceiver"in RTCPeerConnection.prototype}function Ds(){return"addTrack"in RTCPeerConnection.prototype}function lp(){if(!("getCapabilities"in RTCRtpSender)||jA())return!1;const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const A of t.codecs)if(A.mimeType==="video/AV1"){e=!0;break}}return e}function up(){if(!("getCapabilities"in RTCRtpSender)||Wt())return!1;if(jA()){const A=oA();if(A!=null&&A.version&&Ct(A.version,"16")<0)return!1}const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const A of t.codecs)if(A.mimeType==="video/VP9"){e=!0;break}}return e}function bn(t){return t==="av1"||t==="vp9"}function _s(t){return document?(t||(t=document.createElement("audio")),"setSinkId"in t):!1}function dp(){return typeof RTCPeerConnection>"u"?!1:Ls()||Ds()}function Wt(){var t;return((t=oA())===null||t===void 0?void 0:t.name)==="Firefox"}function jA(){var t;return((t=oA())===null||t===void 0?void 0:t.name)==="Safari"}function hp(){const t=oA();return(t==null?void 0:t.name)==="Safari"&&t.version.startsWith("17.")}function Rl(){var t,e;return Me()?(e=(t=navigator.userAgentData)===null||t===void 0?void 0:t.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function fp(){const t=oA(),e="17.2";if(t)return t.name!=="Safari"&&t.os!=="iOS"||t.os==="iOS"&&t.osVersion&&Ct(e,t.osVersion)>=0?!0:t.name==="Safari"&&Ct(e,t.version)>=0}function Me(){return typeof document<"u"}function BA(){return navigator.product=="ReactNative"}function Hs(t){return t.hostname.endsWith(".livekit.cloud")||t.hostname.endsWith(".livekit.run")}function xl(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function Pl(){if(!BA())return;let t=xl();if(t)return t.platform}function Ll(){if(Me())return window.devicePixelRatio;if(BA()){let t=xl();if(t)return t.devicePixelRatio}return 1}function Ct(t,e){const A=t.split("."),n=e.split("."),i=Math.min(A.length,n.length);for(let r=0;r<i;++r){const s=parseInt(A[r],10),o=parseInt(n[r],10);if(s>o)return 1;if(s<o)return-1;if(r===i-1&&s===o)return 0}return t===""&&e!==""?-1:e===""?1:A.length==n.length?0:A.length<n.length?-1:1}function gp(t){for(const e of t)e.target.handleResize(e)}function pp(t){for(const e of t)e.target.handleVisibilityChanged(e)}let Os=null;const Dl=()=>(Os||(Os=new ResizeObserver(gp)),Os);let Ms=null;const _l=()=>(Ms||(Ms=new IntersectionObserver(pp,{root:null,rootMargin:"0px"})),Ms);function mp(){var t;const e=new sg({sdk:wc.JS,protocol:np,version:tp});return BA()&&(e.os=(t=Pl())!==null&&t!==void 0?t:""),e}function Hl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const i=document.createElement("canvas");i.width=t,i.height=e;const r=i.getContext("2d");r==null||r.fillRect(0,0,i.width,i.height),n&&r&&(r.beginPath(),r.arc(t/2,e/2,50,0,Math.PI*2,!0),r.closePath(),r.fillStyle="grey",r.fill());const s=i.captureStream(),[o]=s.getTracks();if(!o)throw Error("Could not get empty media stream video track");return o.enabled=A,o}let Un;function Ns(){if(!Un){const t=new AudioContext,e=t.createOscillator(),A=t.createGain();A.gain.setValueAtTime(0,0);const n=t.createMediaStreamDestination();if(e.connect(A),A.connect(n),e.start(),[Un]=n.stream.getAudioTracks(),!Un)throw Error("Could not get empty media stream audio track");Un.enabled=!1}return Un.clone()}class Ks{constructor(e,A){this.onFinally=A,this.promise=new Promise((n,i)=>m(this,void 0,void 0,function*(){this.resolve=n,this.reject=i,e&&(yield e(n,i))})).finally(()=>{var n;return(n=this.onFinally)===null||n===void 0?void 0:n.call(this)})}}function Bp(t){return sp.includes(t)}function WA(t){if(typeof t=="string"||typeof t=="number")return t;if(Array.isArray(t))return t[0];if(t.exact)return Array.isArray(t.exact)?t.exact[0]:t.exact;if(t.ideal)return Array.isArray(t.ideal)?t.ideal[0]:t.ideal;throw Error("could not unwrap constraint")}function vp(t){return t.startsWith("http")?t.replace(/^(http)/,"ws"):t}function Vs(t){return t.startsWith("ws")?t.replace(/^(ws)/,"http"):t}function Cp(t,e){return t.segments.map(A=>{let{id:n,text:i,language:r,startTime:s,endTime:o,final:a}=A;var c;const l=(c=e.get(n))!==null&&c!==void 0?c:Date.now(),u=Date.now();return a?e.delete(n):e.set(n,l),{id:n,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(o.toString()),final:a,language:r,firstReceivedTime:l,lastReceivedTime:u}})}function wp(t){const{id:e,timestamp:A,message:n,editTimestamp:i}=t;return{id:e,timestamp:Number.parseInt(A.toString()),editTimestamp:i?Number.parseInt(i.toString()):void 0,message:n}}function Ol(t){switch(t.reason){case G.LeaveRequest:return t.context;case G.Cancelled:return nA.CLIENT_INITIATED;case G.NotAllowed:return nA.USER_REJECTED;case G.ServerUnreachable:return nA.JOIN_FAILURE;default:return nA.UNKNOWN_REASON}}function Ii(t){return t!==void 0?Number(t):void 0}function wt(t){return t!==void 0?BigInt(t):void 0}function Jt(t){return!!t&&!(t instanceof MediaStreamTrack)&&t.isLocal}function kA(t){return!!t&&t.kind==E.Kind.Audio}function Xt(t){return!!t&&t.kind==E.Kind.Video}function JA(t){return Jt(t)&&Xt(t)}function yt(t){return Jt(t)&&kA(t)}function Gs(t){return!!t&&!t.isLocal}function yp(t){return!!t&&!t.isLocal}function js(t){return Gs(t)&&Xt(t)}function bp(t){return t.isLocal}function Up(t,e){const A=[];let n=new TextEncoder().encode(t);for(;n.length>e;){let i=e;for(;i>0;){const r=n[i];if(r!==void 0&&(r&192)!==128)break;i--}A.push(n.slice(0,i)),n=n.slice(i)}return n.length>0&&A.push(n),A}function Ml(t,e,A){var n,i,r,s;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=Gl(t??{}),l=e==null?void 0:e.processor,u=A==null?void 0:A.processor,d=o??{};return d.audio===!0&&(d.audio={}),d.video===!0&&(d.video={}),d.audio&&(Ws(d.audio,e),(n=(r=d.audio).deviceId)!==null&&n!==void 0||(r.deviceId={ideal:"default"}),(a||l)&&(d.audio.processor=a??l)),d.video&&(Ws(d.video,A),(i=(s=d.video).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(c||u)&&(d.video.processor=c??u)),d}function Ws(t,e){return Object.keys(e).forEach(A=>{t[A]===void 0&&(t[A]=e[A])}),t}function Js(t){var e,A,n,i;const r={};if(t.video)if(typeof t.video=="object"){const s={},o=s,a=t.video;Object.keys(a).forEach(c=>{switch(c){case"resolution":Ws(o,a.resolution);break;default:o[c]=a[c]}}),r.video=s,(e=(n=r.video).deviceId)!==null&&e!==void 0||(n.deviceId={ideal:"default"})}else r.video=t.video?{deviceId:{ideal:"default"}}:!1;else r.video=!1;return t.audio?typeof t.audio=="object"?(r.audio=t.audio,(A=(i=r.audio).deviceId)!==null&&A!==void 0||(i.deviceId={ideal:"default"})):r.audio={deviceId:{ideal:"default"}}:r.audio=!1,r}function Nl(t){return m(this,arguments,void 0,function(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const n=Kl();if(n){const i=n.createAnalyser();i.fftSize=2048;const r=i.frequencyBinCount,s=new Uint8Array(r);n.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(i),yield Oe(A),i.getByteTimeDomainData(s);const a=s.some(c=>c!==128&&c!==0);return n.close(),!a}return!1}()})}function Kl(){var t;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const A=new e({latencyHint:"interactive"});if(A.state==="suspended"&&typeof window<"u"&&(!((t=window.document)===null||t===void 0)&&t.body)){const n=()=>m(this,void 0,void 0,function*(){var i;try{A.state==="suspended"&&(yield A.resume())}catch(r){console.warn("Error trying to auto-resume audio context",r)}(i=window.document.body)===null||i===void 0||i.removeEventListener("click",n)});window.document.body.addEventListener("click",n)}return A}}function Qp(t){return t==="audioinput"?E.Source.Microphone:t==="videoinput"?E.Source.Camera:E.Source.Unknown}function Vl(t){return t===E.Source.Microphone?"audioinput":t===E.Source.Camera?"videoinput":void 0}function Ep(t){var e,A;let n=(e=t.video)!==null&&e!==void 0?e:!0;return t.resolution&&t.resolution.width>0&&t.resolution.height>0&&(n=typeof n=="boolean"?{}:n,jA()?n=Object.assign(Object.assign({},n),{width:{max:t.resolution.width},height:{max:t.resolution.height},frameRate:t.resolution.frameRate}):n=Object.assign(Object.assign({},n),{width:{ideal:t.resolution.width},height:{ideal:t.resolution.height},frameRate:t.resolution.frameRate})),{audio:(A=t.audio)!==null&&A!==void 0?A:!1,video:n,controller:t.controller,selfBrowserSurface:t.selfBrowserSurface,surfaceSwitching:t.surfaceSwitching,systemAudio:t.systemAudio,preferCurrentTab:t.preferCurrentTab}}function Ri(t){return t.split("/")[1].toLowerCase()}function Sp(t){const e=[];return t.forEach(A=>{A.track!==void 0&&e.push(new fs({cid:A.track.mediaStreamID,track:A.trackInfo}))}),e}function X(t){return"mediaStreamTrack"in t?{trackID:t.sid,source:t.source,muted:t.isMuted,enabled:t.mediaStreamTrack.enabled,kind:t.kind,streamID:t.mediaStreamID,streamTrackID:t.mediaStreamTrack.id}:{trackID:t.trackSid,enabled:t.isEnabled,muted:t.isMuted,trackInfo:Object.assign({mimeType:t.mimeType,name:t.trackName,encrypted:t.isEncrypted,kind:t.kind,source:t.source},t.track?X(t.track):{})}}function Tp(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function Fp(t,e){var A;t===void 0&&(t={}),e===void 0&&(e={});const n=[...Object.keys(e),...Object.keys(t)],i={};for(const r of n)t[r]!==e[r]&&(i[r]=(A=e[r])!==null&&A!==void 0?A:"");return i}function Gl(t){const e=Object.assign({},t);let A,n;return typeof e.audio=="object"&&e.audio.processor&&(A=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(n=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:A,videoProcessor:n,optionsWithoutProcessor:zg(e)}}function kp(t){switch(t){case ge.CAMERA:return E.Source.Camera;case ge.MICROPHONE:return E.Source.Microphone;case ge.SCREEN_SHARE:return E.Source.ScreenShare;case ge.SCREEN_SHARE_AUDIO:return E.Source.ScreenShareAudio;default:return E.Source.Unknown}}class Ip extends mA.EventEmitter{constructor(e){super(),this.onWorkerMessage=A=>{var n,i;const{kind:r,data:s}=A.data;switch(r){case"error":K.error(s.error.message),this.emit(VA.EncryptionError,s.error);break;case"initAck":s.enabled&&this.keyProvider.getKeys().forEach(o=>{this.postKey(o)});break;case"enable":if(s.enabled&&this.keyProvider.getKeys().forEach(o=>{this.postKey(o)}),this.encryptionEnabled!==s.enabled&&s.participantIdentity===((n=this.room)===null||n===void 0?void 0:n.localParticipant.identity))this.emit(VA.ParticipantEncryptionStatusChanged,s.enabled,this.room.localParticipant),this.encryptionEnabled=s.enabled;else if(s.participantIdentity){const o=(i=this.room)===null||i===void 0?void 0:i.getParticipantByIdentity(s.participantIdentity);if(!o)throw TypeError("couldn't set encryption status, participant not found".concat(s.participantIdentity));this.emit(VA.ParticipantEncryptionStatusChanged,s.enabled,o)}break;case"ratchetKey":this.keyProvider.emit(KA.KeyRatcheted,s.ratchetResult,s.participantIdentity,s.keyIndex);break}},this.onWorkerError=A=>{K.error("e2ee worker encountered an error:",{error:A.error}),this.emit(VA.EncryptionError,A.error)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1}setup(e){if(!$g())throw new Ss("tried to setup end-to-end encryption on an unsupported browser");if(K.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const A={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:Pg.getLevel()}};this.worker&&(K.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(A))}}setParticipantCryptorEnabled(e,A){K.debug("set e2ee to ".concat(e," for participant ").concat(A)),this.postEnable(e,A)}setSifTrailer(e){!e||e.length===0?K.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(I.RTPVideoMapUpdate,A=>{this.postRTPMap(A)})}setupEventListeners(e,A){e.on(T.TrackPublished,(n,i)=>this.setParticipantCryptorEnabled(n.trackInfo.encryption!==je.NONE,i.identity)),e.on(T.ConnectionStateChanged,n=>{n===J.Connected&&e.remoteParticipants.forEach(i=>{i.trackPublications.forEach(r=>{this.setParticipantCryptorEnabled(r.trackInfo.encryption!==je.NONE,i.identity)})})}).on(T.TrackUnsubscribed,(n,i,r)=>{var s;const o={kind:"removeTransform",data:{participantIdentity:r.identity,trackId:n.mediaStreamID}};(s=this.worker)===null||s===void 0||s.postMessage(o)}).on(T.TrackSubscribed,(n,i,r)=>{this.setupE2EEReceiver(n,r.identity,i.trackInfo)}).on(T.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");A.getKeys().forEach(n=>{this.postKey(n)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(x.LocalTrackPublished,n=>m(this,void 0,void 0,function*(){this.setupE2EESender(n.track,n.track.sender)})),A.on(KA.SetKey,n=>this.postKey(n)).on(KA.RatchetRequest,(n,i)=>this.postRatchetRequest(n,i))}postRatchetRequest(e,A){if(!this.worker)throw Error("could not ratchet key, worker is missing");const n={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:A}};this.worker.postMessage(n)}postKey(e){let{key:A,participantIdentity:n,keyIndex:i}=e;var r;if(!this.worker)throw Error("could not set key, worker is missing");const s={kind:"setKey",data:{participantIdentity:n,isPublisher:n===((r=this.room)===null||r===void 0?void 0:r.localParticipant.identity),key:A,keyIndex:i}};this.worker.postMessage(s)}postEnable(e,A){if(this.worker){const n={kind:"enable",data:{enabled:e,participantIdentity:A}};this.worker.postMessage(n)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var A;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((A=this.room)===null||A===void 0)&&A.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const n={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(n)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const A={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(A)}setupE2EEReceiver(e,A,n){if(e.receiver){if(!(n!=null&&n.mimeType)||n.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,A,e.kind==="video"?Ri(n.mimeType):void 0)}}setupE2EESender(e,A){if(!Jt(e)||!A){A||K.warn("early return because sender is not ready");return}this.handleSender(A,e.mediaStreamID,void 0)}handleReceiver(e,A,n,i){return m(this,void 0,void 0,function*(){if(this.worker){if(Es()){const r={kind:"decode",participantIdentity:n,trackId:A,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,r)}else{if(Ti in e&&i){const a={kind:"updateCodec",data:{trackId:A,codec:i,participantIdentity:n}};this.worker.postMessage(a);return}let r=e.writableStream,s=e.readableStream;if(!r||!s){const a=e.createEncodedStreams();e.writableStream=a.writable,r=a.writable,e.readableStream=a.readable,s=a.readable}const o={kind:"decode",data:{readableStream:s,writableStream:r,trackId:A,codec:i,participantIdentity:n}};this.worker.postMessage(o,[s,r])}e[Ti]=!0}})}handleSender(e,A,n){var i;if(!(Ti in e||!this.worker)){if(!(!((i=this.room)===null||i===void 0)&&i.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(Es()){K.info("initialize script transform");const r={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:A,codec:n};e.transform=new RTCRtpScriptTransform(this.worker,r)}else{K.info("initialize encoded streams");const r=e.createEncodedStreams(),s={kind:"encode",data:{readableStream:r.readable,writableStream:r.writable,codec:n,trackId:A,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(s,[r.readable,r.writable])}e[Ti]=!0}}}const Xs="default";class Ce{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new Ce),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return m(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var r;if(((r=Ce.userMediaPromiseMap)===null||r===void 0?void 0:r.size)>0){K.debug("awaiting getUserMedia promise");try{A?yield Ce.userMediaPromiseMap.get(A):yield Promise.all(Ce.userMediaPromiseMap.values())}catch{K.warn("error waiting for media permissons")}}let s=yield navigator.mediaDevices.enumerateDevices();if(i&&!(jA()&&n.hasDeviceInUse(A))&&(s.filter(a=>a.kind===A).length===0||s.some(a=>{const c=a.label==="",l=A?a.kind===A:!0;return c&&l}))){const a={video:A!=="audioinput"&&A!=="audiooutput",audio:A!=="videoinput"&&{deviceId:{ideal:"default"}}},c=yield navigator.mediaDevices.getUserMedia(a);s=yield navigator.mediaDevices.enumerateDevices(),c.getTracks().forEach(l=>{l.stop()})}return n._previousDevices=s,A&&(s=s.filter(o=>o.kind===A)),s}()})}normalizeDeviceId(e,A,n){return m(this,void 0,void 0,function*(){if(A!==Xs)return A;const i=yield this.getDevices(e),r=i.find(o=>o.deviceId===Xs);if(!r){K.warn("could not reliably determine default device");return}const s=i.find(o=>o.deviceId!==Xs&&o.groupId===(n??r.groupId));if(!s){K.warn("could not reliably determine default device");return}return s==null?void 0:s.deviceId})}hasDeviceInUse(e){return e?Ce.userMediaPromiseMap.has(e):Ce.userMediaPromiseMap.size>0}}Ce.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],Ce.userMediaPromiseMap=new Map;var Qn;(function(t){t[t.WAITING=0]="WAITING",t[t.RUNNING=1]="RUNNING",t[t.COMPLETED=2]="COMPLETED"})(Qn||(Qn={}));class Rp{constructor(){this.pendingTasks=new Map,this.taskMutex=new De,this.nextTaskIndex=0}run(e){return m(this,void 0,void 0,function*(){const A={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:Qn.WAITING};this.pendingTasks.set(A.id,A);const n=yield this.taskMutex.lock();try{return A.executedAt=Date.now(),A.status=Qn.RUNNING,yield e()}finally{A.status=Qn.COMPLETED,this.pendingTasks.delete(A.id),n()}})}flush(){return m(this,void 0,void 0,function*(){return this.run(()=>m(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}function xp(t,e){const A=new URL(vp(t));return e.forEach((n,i)=>{A.searchParams.set(i,n)}),jl(A,"rtc")}function Pp(t){const e=new URL(Vs(t));return jl(e,"validate")}function Lp(t){return t.endsWith("/")?t:"".concat(t,"/")}function jl(t,e){return t.pathname="".concat(Lp(t.pathname)).concat(e),t.toString()}const Dp=["syncState","trickle","offer","answer","simulate","leave"];function _p(t){const e=Dp.indexOf(t.case)>=0;return K.trace("request allowed to bypass queue:",{canPass:e,req:t}),e}var Ae;(function(t){t[t.CONNECTING=0]="CONNECTING",t[t.CONNECTED=1]="CONNECTED",t[t.RECONNECTING=2]="RECONNECTING",t[t.DISCONNECTING=3]="DISCONNECTING",t[t.DISCONNECTED=4]="DISCONNECTED"})(Ae||(Ae={}));class $s{get currentState(){return this.state}get isDisconnected(){return this.state===Ae.DISCONNECTING||this.state===Ae.DISCONNECTED}get isEstablishingConnection(){return this.state===Ae.CONNECTING||this.state===Ae.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n;this.rtt=0,this.state=Ae.DISCONNECTED,this.log=K,this._requestId=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=TA((n=A.loggerName)!==null&&n!==void 0?n:sA.Signal),this.loggerContextCb=A.loggerContextCb,this.useJSON=e,this.requestQueue=new Rp,this.queuedRequests=[],this.closingLock=new De,this.connectionLock=new De,this.state=Ae.DISCONNECTED}get logContext(){var e,A;return(A=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&A!==void 0?A:{}}join(e,A,n,i){return m(this,void 0,void 0,function*(){return this.state=Ae.CONNECTING,this.options=n,yield this.connect(e,A,n,i)})}reconnect(e,A,n,i){return m(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=Ae.RECONNECTING,this.clearPingInterval(),yield this.connect(e,A,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:n,reconnectReason:i}))})}connect(e,A,n,i){this.connectOptions=n;const r=mp(),s=Hp(A,r,n),o=xp(e,s),a=Pp(o);return new Promise((c,l)=>m(this,void 0,void 0,function*(){const u=yield this.connectionLock.lock();try{const d=()=>m(this,void 0,void 0,function*(){this.close(),clearTimeout(h),l(new z("room connection has been cancelled (signal)",G.Cancelled))}),h=setTimeout(()=>{this.close(),l(new z("room connection has timed out (signal)",G.ServerUnreachable))},n.websocketTimeout);i!=null&&i.aborted&&d(),i==null||i.addEventListener("abort",d);const g=new URL(o);g.searchParams.has("access_token")&&g.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(g),Object.assign({reconnect:n.reconnect,reconnectReason:n.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(o),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(h)},this.ws.onerror=f=>m(this,void 0,void 0,function*(){if(this.state!==Ae.CONNECTED){this.state=Ae.DISCONNECTED,clearTimeout(h);try{const p=yield fetch(a);if(p.status.toFixed(0).startsWith("4")){const B=yield p.text();l(new z(B,G.NotAllowed,p.status))}else l(new z("Encountered unknown websocket error during connection: ".concat(f.toString()),G.InternalError,p.status))}catch(p){l(new z(p instanceof Error?p.message:"server was not reachable",G.ServerUnreachable))}return}this.handleWSError(f)}),this.ws.onmessage=f=>m(this,void 0,void 0,function*(){var p,B,y;let b;if(typeof f.data=="string"){const v=JSON.parse(f.data);b=Sc.fromJson(v,{ignoreUnknownFields:!0})}else if(f.data instanceof ArrayBuffer)b=Sc.fromBinary(new Uint8Array(f.data));else{this.log.error("could not decode websocket message: ".concat(typeof f.data),this.logContext);return}if(this.state!==Ae.CONNECTED){let v=!1;if(((p=b.message)===null||p===void 0?void 0:p.case)==="join"?(this.state=Ae.CONNECTED,i==null||i.removeEventListener("abort",d),this.pingTimeoutDuration=b.message.value.pingTimeout,this.pingIntervalDuration=b.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),c(b.message.value)):this.state===Ae.RECONNECTING&&b.message.case!=="leave"?(this.state=Ae.CONNECTED,i==null||i.removeEventListener("abort",d),this.startPingInterval(),((B=b.message)===null||B===void 0?void 0:B.case)==="reconnect"?c(b.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),c(void 0),v=!0)):this.isEstablishingConnection&&b.message.case==="leave"?l(new z("Received leave request while trying to (re)connect",G.LeaveRequest,void 0,b.message.value.reason)):n.reconnect||l(new z("did not receive join response, got ".concat((y=b.message)===null||y===void 0?void 0:y.case," instead"),G.InternalError)),!v)return}this.signalLatency&&(yield Oe(this.signalLatency)),this.handleSignalResponse(b)}),this.ws.onclose=f=>{this.isEstablishingConnection&&l(new z("Websocket got closed during a (re)connection attempt",G.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:f.reason,code:f.code,wasClean:f.wasClean,state:this.state})),this.handleOnClose(f.reason)}}finally{u()}}))}close(){return m(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const n=yield e.closingLock.lock();try{if(e.clearPingInterval(),A&&(e.state=Ae.DISCONNECTING),e.ws){e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null;const i=new Promise(r=>{e.ws?e.ws.onclose=()=>{r()}:r()});e.ws.readyState<e.ws.CLOSING&&(e.ws.close(),yield Promise.race([i,Oe(250)])),e.ws=void 0}}finally{A&&(e.state=Ae.DISCONNECTED),n()}}()})}sendOffer(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:xi(e)})}sendAnswer(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:xi(e)})}sendIceCandidate(e,A){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new ds({candidateInit:JSON.stringify(e),target:A})})}sendMuteTrack(e,A){return this.sendRequest({case:"mute",value:new hs({sid:e,muted:A})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,A){return m(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const o=r.getNextRequestId();return yield r.sendRequest({case:"updateMetadata",value:new Ic({requestId:o,metadata:n,name:i,attributes:s})}),o}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,A){return this.sendRequest({case:"updateLayers",value:new kc({trackSid:e,layers:A})})}sendUpdateSubscriptionPermissions(e,A){return this.sendRequest({case:"subscriptionPermission",value:new Pc({allParticipants:e,trackPermissions:A})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:re.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new _c({timestamp:re.parse(Date.now()),rtt:re.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,A){return this.sendRequest({case:"updateAudioTrack",value:new Fc({trackSid:e,features:A})})}sendLeave(){return this.sendRequest({case:"leave",value:new Bi({reason:nA.CLIENT_INITIATED,action:Kt.DISCONNECT})})}sendRequest(e){return m(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!i&&!_p(A)&&n.state===Ae.RECONNECTING){n.queuedRequests.push(()=>m(n,void 0,void 0,function*(){yield this.sendRequest(A,!0)}));return}if(i||(yield n.requestQueue.flush()),n.signalLatency&&(yield Oe(n.signalLatency)),!n.ws||n.ws.readyState!==n.ws.OPEN){n.log.error("cannot send signal request before connected, type: ".concat(A==null?void 0:A.case),n.logContext);return}const s=new cg({message:A});try{n.useJSON?n.ws.send(s.toJsonString()):n.ws.send(s.toBinary())}catch(o){n.log.error("error sending signal message",Object.assign(Object.assign({},n.logContext),{error:o}))}}()})}handleSignalResponse(e){var A,n;const i=e.message;if(i==null){this.log.debug("received unsupported message",this.logContext);return}let r=!1;if(i.case==="answer"){const s=Wl(i.value);this.onAnswer&&this.onAnswer(s)}else if(i.case==="offer"){const s=Wl(i.value);this.onOffer&&this.onOffer(s)}else if(i.case==="trickle"){const s=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(s,i.value.target)}else i.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((A=i.value.participants)!==null&&A!==void 0?A:[]):i.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):i.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((n=i.value.speakers)!==null&&n!==void 0?n:[]):i.case==="leave"?this.onLeave&&this.onLeave(i.value):i.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):i.case==="roomUpdate"?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):i.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(i.value):i.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):i.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):i.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):i.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(i.value):i.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):i.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(i.value):i.case==="pong"||(i.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),r=!0):i.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(i.value):i.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):i.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));r||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return m(this,void 0,void 0,function*(){if(this.state===Ae.DISCONNECTED)return;const A=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),A&&A(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=ye.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&ye.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=ye.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&ye.clearInterval(this.pingInterval)}}function Wl(t){const e={type:"offer",sdp:t.sdp};switch(t.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=t.type;break}return e}function xi(t){return new Bt({sdp:t.sdp,type:t.type})}function Hp(t,e,A){var n;const i=new URLSearchParams;return i.set("access_token",t),A.reconnect&&(i.set("reconnect","1"),A.sid&&i.set("sid",A.sid)),i.set("auto_subscribe",A.autoSubscribe?"1":"0"),i.set("sdk",BA()?"reactnative":"js"),i.set("version",e.version),i.set("protocol",e.protocol.toString()),e.deviceModel&&i.set("device_model",e.deviceModel),e.os&&i.set("os",e.os),e.osVersion&&i.set("os_version",e.osVersion),e.browser&&i.set("browser",e.browser),e.browserVersion&&i.set("browser_version",e.browserVersion),A.adaptiveStream&&i.set("adaptive_stream","1"),A.reconnectReason&&i.set("reconnect_reason",A.reconnectReason.toString()),!((n=navigator.connection)===null||n===void 0)&&n.type&&i.set("network",navigator.connection.type),i}var aA={},Ys={},qs={exports:{}},Jl;function zs(){if(Jl)return qs.exports;Jl=1;var t=qs.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var A="candidate:%s %d %s %d %s %d typ %s";return A+=e.raddr!=null?" raddr %s rport %d":"%v%v",A+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(A+=" generation %d"),A+=e["network-id"]!=null?" network-id %d":"%v",A+=e["network-cost"]!=null?" network-cost %d":"%v",A}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var A="ssrc:%d";return e.attribute!=null&&(A+=" %s",e.value!=null&&(A+=":%s")),A}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var A="mediaclk:";return A+=e.id!=null?"id=%s %s":"%v%s",A+=e.mediaClockValue!=null?"=%s":"",A+=e.rateNumerator!=null?" rate=%s":"",A+=e.rateDenominator!=null?"/%s":"",A}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(t).forEach(function(e){var A=t[e];A.forEach(function(n){n.reg||(n.reg=/(.*)/),n.format||(n.format="%s")})}),qs.exports}var Xl;function Op(){return Xl||(Xl=1,function(t){var e=function(o){return String(Number(o))===o?Number(o):o},A=function(o,a,c,l){if(l&&!c)a[l]=e(o[1]);else for(var u=0;u<c.length;u+=1)o[u+1]!=null&&(a[c[u]]=e(o[u+1]))},n=function(o,a,c){var l=o.name&&o.names;o.push&&!a[o.push]?a[o.push]=[]:l&&!a[o.name]&&(a[o.name]={});var u=o.push?{}:l?a[o.name]:a;A(c.match(o.reg),u,o.names,o.name),o.push&&a[o.push].push(u)},i=zs(),r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(o){var a={},c=[],l=a;return o.split(/(\r\n|\r|\n)/).filter(r).forEach(function(u){var d=u[0],h=u.slice(2);d==="m"&&(c.push({rtp:[],fmtp:[]}),l=c[c.length-1]);for(var g=0;g<(i[d]||[]).length;g+=1){var f=i[d][g];if(f.reg.test(h))return n(f,l,h)}}),a.media=c,a};var s=function(o,a){var c=a.split(/=(.+)/,2);return c.length===2?o[c[0]]=e(c[1]):c.length===1&&a.length>1&&(o[c[0]]=void 0),o};t.parseParams=function(o){return o.split(/;\s?/).reduce(s,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(o){return o.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(o){for(var a=[],c=o.split(" ").map(e),l=0;l<c.length;l+=3)a.push({component:c[l],ip:c[l+1],port:c[l+2]});return a},t.parseImageAttributes=function(o){return o.split(" ").map(function(a){return a.substring(1,a.length-1).split(",").reduce(s,{})})},t.parseSimulcastStreamList=function(o){return o.split(";").map(function(a){return a.split(",").map(function(c){var l,u=!1;return c[0]!=="~"?l=e(c):(l=e(c.substring(1,c.length)),u=!0),{scid:l,paused:u}})})}}(Ys)),Ys}var Zs,$l;function Mp(){if($l)return Zs;$l=1;var t=zs(),e=/%[sdv%]/g,A=function(s){var o=1,a=arguments,c=a.length;return s.replace(e,function(l){if(o>=c)return l;var u=a[o];switch(o+=1,l){case"%%":return"%";case"%s":return String(u);case"%d":return Number(u);case"%v":return""}})},n=function(s,o,a){var c=o.format instanceof Function?o.format(o.push?a:a[o.name]):o.format,l=[s+"="+c];if(o.names)for(var u=0;u<o.names.length;u+=1){var d=o.names[u];o.name?l.push(a[o.name][d]):l.push(a[o.names[u]])}else l.push(a[o.name]);return A.apply(null,l)},i=["v","o","s","i","u","e","p","c","b","t","r","z","a"],r=["i","c","b","a"];return Zs=function(s,o){o=o||{},s.version==null&&(s.version=0),s.name==null&&(s.name=" "),s.media.forEach(function(u){u.payloads==null&&(u.payloads="")});var a=o.outerOrder||i,c=o.innerOrder||r,l=[];return a.forEach(function(u){t[u].forEach(function(d){d.name in s&&s[d.name]!=null?l.push(n(u,d,s)):d.push in s&&s[d.push]!=null&&s[d.push].forEach(function(h){l.push(n(u,d,h))})})}),s.media.forEach(function(u){l.push(n("m",t.m[0],u)),c.forEach(function(d){t[d].forEach(function(h){h.name in u&&u[h.name]!=null?l.push(n(d,h,u)):h.push in u&&u[h.push]!=null&&u[h.push].forEach(function(g){l.push(n(d,h,g))})})})}),l.join(`\r
|
|
37
|
-
`)+`\r
|
|
38
|
-
`},Zs}var Yl;function Np(){if(Yl)return aA;Yl=1;var t=Op(),e=Mp(),A=zs();return aA.grammar=A,aA.write=e,aA.parse=t.parse,aA.parseParams=t.parseParams,aA.parseFmtpConfig=t.parseFmtpConfig,aA.parsePayloads=t.parsePayloads,aA.parseRemoteCandidates=t.parseRemoteCandidates,aA.parseImageAttributes=t.parseImageAttributes,aA.parseSimulcastStreamList=t.parseSimulcastStreamList,aA}var XA=Np();function eo(t,e,A){var n,i,r;e===void 0&&(e=50),A===void 0&&(A={});var s=(n=A.isImmediate)!=null&&n,o=(i=A.callback)!=null&&i,a=A.maxWait,c=Date.now(),l=[];function u(){if(a!==void 0){var h=Date.now()-c;if(h+e>=a)return a-h}return e}var d=function(){var h=[].slice.call(arguments),g=this;return new Promise(function(f,p){var B=s&&r===void 0;if(r!==void 0&&clearTimeout(r),r=setTimeout(function(){if(r=void 0,c=Date.now(),!s){var b=t.apply(g,h);o&&o(b),l.forEach(function(v){return(0,v.resolve)(b)}),l=[]}},u()),B){var y=t.apply(g,h);return o&&o(y),f(y)}l.push({resolve:f,reject:p})})};return d.cancel=function(h){r!==void 0&&clearTimeout(r),l.forEach(function(g){return(0,g.reject)(h)}),l=[]},d}const Kp=.7,Vp=20,$t={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class ql extends mA.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n;super(),this.log=K,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=eo(i=>m(this,void 0,void 0,function*(){this.emit($t.NegotiationStarted);try{yield this.createAndSendOffer()}catch(r){if(i)i(r);else throw r}}),Vp),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=TA((n=A.loggerName)!==null&&n!==void 0?n:sA.PCTransport),this.loggerOptions=A,this.config=e,this._pc=this.createPC()}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=A=>{var n;A.candidate&&((n=this.onIceCandidate)===null||n===void 0||n.call(this,A.candidate))},e.onicecandidateerror=A=>{var n;(n=this.onIceCandidateError)===null||n===void 0||n.call(this,A)},e.oniceconnectionstatechange=()=>{var A;(A=this.onIceConnectionStateChange)===null||A===void 0||A.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var A;(A=this.onSignalingStatechange)===null||A===void 0||A.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var A;(A=this.onConnectionStateChange)===null||A===void 0||A.call(this,e.connectionState)},e.ondatachannel=A=>{var n;(n=this.onDataChannel)===null||n===void 0||n.call(this,A)},e.ontrack=A=>{var n;(n=this.onTrack)===null||n===void 0||n.call(this,A)},e}get logContext(){var e,A;return Object.assign({},(A=(e=this.loggerOptions).loggerContextCb)===null||A===void 0?void 0:A.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return m(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e){return m(this,void 0,void 0,function*(){var A;let n;if(e.type==="offer"){let{stereoMids:i,nackMids:r}=Gp(e);this.remoteStereoMids=i,this.remoteNackMids=r}else if(e.type==="answer"){const i=XA.parse((A=e.sdp)!==null&&A!==void 0?A:"");i.media.forEach(r=>{r.type==="audio"&&this.trackBitrates.some(s=>{if(!s.transceiver||r.mid!=s.transceiver.mid)return!1;let o=0;if(r.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0)return!0;let a=!1;for(const c of r.fmtp)if(c.payload===o){c.config=c.config.split(";").filter(l=>!l.includes("maxaveragebitrate")).join(";"),s.maxbr>0&&(c.config+=";maxaveragebitrate=".concat(s.maxbr*1e3)),a=!0;break}return a||s.maxbr>0&&r.fmtp.push({payload:o,config:"maxaveragebitrate=".concat(s.maxbr*1e3)}),!0})}),n=XA.write(i)}yield this.setMungedSDP(e,n,!0),this.pendingCandidates.forEach(i=>{this.pc.addIceCandidate(i)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit($t.NegotiationComplete),e.sdp&&XA.parse(e.sdp).media.forEach(r=>{r.type==="video"&&this.emit($t.RTPVideoPayloadTypes,r.rtp)}))})}createAndSendOffer(e){return m(this,void 0,void 0,function*(){var A;if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const r=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&r)yield this._pc.setRemoteDescription(r);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const n=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:n.sdp},this.logContext));const i=XA.parse((A=n.sdp)!==null&&A!==void 0?A:"");i.media.forEach(r=>{Zl(r),r.type==="audio"?zl(r,[],[]):r.type==="video"&&this.trackBitrates.some(s=>{if(!r.msid||!s.cid||!r.msid.includes(s.cid))return!1;let o=0;if(r.rtp.some(c=>c.codec.toUpperCase()===s.codec.toUpperCase()?(o=c.payload,!0):!1),o===0||(bn(s.codec)&&this.ensureVideoDDExtensionForSVC(r,i),s.codec!=="av1"))return!0;const a=Math.round(s.maxbr*Kp);for(const c of r.fmtp)if(c.payload===o){c.config.includes("x-google-start-bitrate")||(c.config+=";x-google-start-bitrate=".concat(a));break}return!0})}),yield this.setMungedSDP(n,XA.write(i)),this.onOffer(n)})}createAndSetAnswer(){return m(this,void 0,void 0,function*(){var e;const A=yield this.pc.createAnswer(),n=XA.parse((e=A.sdp)!==null&&e!==void 0?e:"");return n.media.forEach(i=>{Zl(i),i.type==="audio"&&zl(i,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(A,XA.write(n)),A})}createDataChannel(e,A){return this.pc.createDataChannel(e,A)}addTransceiver(e,A){return this.pc.addTransceiver(e,A)}addTrack(e){if(!this._pc)throw new Be("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var A;if(!this._pc)throw new Be("PC closed, cannot configure");return(A=this._pc)===null||A===void 0?void 0:A.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var A;return(A=this._pc)===null||A===void 0?void 0:A.removeTrack(e)}getConnectionState(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&A!==void 0?A:"closed"}getICEConnectionState(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&A!==void 0?A:"closed"}getSignallingState(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&A!==void 0?A:"closed"}getTransceivers(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&A!==void 0?A:[]}getSenders(){var e,A;return(A=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&A!==void 0?A:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return m(this,void 0,void 0,function*(){var e;if(!this._pc)return;let A="";const n=new Map,i=new Map;if((yield this._pc.getStats()).forEach(o=>{switch(o.type){case"transport":A=o.selectedCandidatePairId;break;case"candidate-pair":A===""&&o.selected&&(A=o.id),n.set(o.id,o);break;case"remote-candidate":i.set(o.id,"".concat(o.address,":").concat(o.port));break}}),A==="")return;const s=(e=n.get(A))===null||e===void 0?void 0:e.remoteCandidateId;if(s!==void 0)return i.get(s)})}setMungedSDP(e,A,n){return m(this,void 0,void 0,function*(){if(A){const i=e.sdp;e.sdp=A;try{this.log.debug("setting munged ".concat(n?"remote":"local"," description"),this.logContext),n?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(r){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:r,sdp:A})),e.sdp=i}}try{n?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(i){let r="unknown error";i instanceof Error?r=i.message:typeof i=="string"&&(r=i);const s={error:r,sdp:e.sdp};throw!n&&this.pc.remoteDescription&&(s.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:s})),new Ts(r)}})}ensureVideoDDExtensionForSVC(e,A){var n,i;if(!((n=e.ext)===null||n===void 0?void 0:n.some(s=>s.uri===Il))){if(this.ddExtID===0){let s=0;A.media.forEach(o=>{var a;o.type==="video"&&((a=o.ext)===null||a===void 0||a.forEach(c=>{c.value>s&&(s=c.value)}))}),this.ddExtID=s+1}(i=e.ext)===null||i===void 0||i.push({value:this.ddExtID,uri:Il})}}}function zl(t,e,A){let n=0;t.rtp.some(i=>i.codec==="opus"?(n=i.payload,!0):!1),n>0&&(t.rtcpFb||(t.rtcpFb=[]),A.includes(t.mid)&&!t.rtcpFb.some(i=>i.payload===n&&i.type==="nack")&&t.rtcpFb.push({payload:n,type:"nack"}),e.includes(t.mid)&&t.fmtp.some(i=>i.payload===n?(i.config.includes("stereo=1")||(i.config+=";stereo=1"),!0):!1))}function Gp(t){var e;const A=[],n=[],i=XA.parse((e=t.sdp)!==null&&e!==void 0?e:"");let r=0;return i.media.forEach(s=>{var o;s.type==="audio"&&(s.rtp.some(a=>a.codec==="opus"?(r=a.payload,!0):!1),!((o=s.rtcpFb)===null||o===void 0)&&o.some(a=>a.payload===r&&a.type==="nack")&&n.push(s.mid),s.fmtp.some(a=>a.payload===r?(a.config.includes("sprop-stereo=1")&&A.push(s.mid),!0):!1))}),{stereoMids:A,nackMids:n}}function Zl(t){if(t.connection){const e=t.connection.ip.indexOf(":")>=0;(t.connection.version===4&&e||t.connection.version===6&&!e)&&(t.connection.ip="0.0.0.0",t.connection.version=4)}}const Ao="vp8",jp={audioPreset:Rs.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:Ps.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Ao,backupCodec:!0},eu={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},Au={deviceId:{ideal:"default"},resolution:yn.h720.resolution},Wp={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new Dg,disconnectOnPageLeave:!0,webAudioMix:!1},to={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var ce;(function(t){t[t.NEW=0]="NEW",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED",t[t.FAILED=3]="FAILED",t[t.CLOSING=4]="CLOSING",t[t.CLOSED=5]="CLOSED"})(ce||(ce={}));class Jp{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,A,n){var i;this.peerConnectionTimeout=to.peerConnectionTimeout,this.log=K,this.updateState=()=>{var r;const s=this.state,o=this.requiredTransports.map(a=>a.getConnectionState());o.every(a=>a==="connected")?this.state=ce.CONNECTED:o.some(a=>a==="failed")?this.state=ce.FAILED:o.some(a=>a==="connecting")?this.state=ce.CONNECTING:o.every(a=>a==="closed")?this.state=ce.CLOSED:o.some(a=>a==="closed")?this.state=ce.CLOSING:o.every(a=>a==="new")&&(this.state=ce.NEW),s!==this.state&&(this.log.debug("pc state change: from ".concat(ce[s]," to ").concat(ce[this.state]),this.logContext),(r=this.onStateChange)===null||r===void 0||r.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=TA((i=n.loggerName)!==null&&i!==void 0?i:sA.PCManager),this.loggerOptions=n,this.isPublisherConnectionRequired=!A,this.isSubscriberConnectionRequired=A,this.publisher=new ql(e,n),this.subscriber=new ql(e,n),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=r=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,r,rA.PUBLISHER)},this.subscriber.onIceCandidate=r=>{var s;(s=this.onIceCandidate)===null||s===void 0||s.call(this,r,rA.SUBSCRIBER)},this.subscriber.onDataChannel=r=>{var s;(s=this.onDataChannel)===null||s===void 0||s.call(this,r)},this.subscriber.onTrack=r=>{var s;(s=this.onTrack)===null||s===void 0||s.call(this,r)},this.publisher.onOffer=r=>{var s;(s=this.onPublisherOffer)===null||s===void 0||s.call(this,r)},this.state=ce.NEW,this.connectionLock=new De,this.remoteOfferLock=new De}get logContext(){var e,A;return Object.assign({},(A=(e=this.loggerOptions).loggerContextCb)===null||A===void 0?void 0:A.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e){return this.publisher.setRemoteDescription(e)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return m(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const A of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(A)}catch(n){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:n}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return m(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,A){return m(this,void 0,void 0,function*(){A===rA.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e){return m(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const A=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(e),yield this.subscriber.createAndSetAnswer()}finally{A()}})}updateConfiguration(e,A){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),A&&this.triggerIceRestart()}ensurePCTransportConnection(e,A){return m(this,void 0,void 0,function*(){var n;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((n=this.requiredTransports)===null||n===void 0?void 0:n.map(r=>this.ensureTransportConnected(r,e,A)))}finally{i()}})}negotiate(e){return m(this,void 0,void 0,function*(){return new Promise((A,n)=>m(this,void 0,void 0,function*(){const i=setTimeout(()=>{n("negotiation timed out")},this.peerConnectionTimeout),r=()=>{clearTimeout(i),n("negotiation aborted")};e.signal.addEventListener("abort",r),this.publisher.once($t.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once($t.NegotiationComplete,()=>{clearTimeout(i),A()})}),yield this.publisher.negotiate(s=>{clearTimeout(i),n(s)})}))})}addPublisherTransceiver(e,A){return this.publisher.addTransceiver(e,A)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,A){return this.publisher.createDataChannel(e,A)}getConnectedAddress(e){return e===rA.PUBLISHER?this.publisher.getConnectedAddress():e===rA.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,A){return m(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(n.getConnectionState()!=="connected")return new Promise((a,c)=>m(r,void 0,void 0,function*(){const l=()=>{this.log.warn("abort transport connection",this.logContext),ye.clearTimeout(u),c(new z("room connection has been cancelled",G.Cancelled))};i!=null&&i.signal.aborted&&l(),i==null||i.signal.addEventListener("abort",l);const u=ye.setTimeout(()=>{i==null||i.signal.removeEventListener("abort",l),c(new z("could not establish pc connection",G.InternalError))},s);for(;this.state!==ce.CONNECTED;)if(yield Oe(50),i!=null&&i.signal.aborted){c(new z("room connection has been cancelled",G.Cancelled));return}ye.clearTimeout(u),i==null||i.signal.removeEventListener("abort",l),a()}))}()})}}class le extends Error{constructor(e,A,n){super(A),this.code=e,this.message=nu(A,le.MAX_MESSAGE_BYTES),this.data=n?nu(n,le.MAX_DATA_BYTES):void 0}static fromProto(e){return new le(e.code,e.message,e.data)}toProto(){return new Bc({code:this.code,message:this.message,data:this.data})}static builtIn(e,A){return new le(le.ErrorCode[e],le.ErrorMessage[e],A)}}le.MAX_MESSAGE_BYTES=256,le.MAX_DATA_BYTES=15360,le.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},le.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const tu=15360;function no(t){return new TextEncoder().encode(t).length}function nu(t,e){if(no(t)<=e)return t;let A=0,n=t.length;const i=new TextEncoder;for(;A<n;){const r=Math.floor((A+n+1)/2);i.encode(t.slice(0,r)).length<=e?A=r:n=r-1}return t.slice(0,A)}const io=2e3;function Pi(t,e){if(!e)return 0;let A,n;return"bytesReceived"in t?(A=t.bytesReceived,n=e.bytesReceived):"bytesSent"in t&&(A=t.bytesSent,n=e.bytesSent),A===void 0||n===void 0||t.timestamp===void 0||e.timestamp===void 0?0:(A-n)*8*1e3/(t.timestamp-e.timestamp)}const Xp=1e3;class iu extends E{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}constructor(e,A,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,r=arguments.length>4?arguments[4]:void 0;super(e,A,r),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=eo(()=>m(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>m(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(k.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new De,this.pauseUpstreamLock=new De,this.processorLock=new De,this.restartLock=new De,this.setMediaStreamTrack(e,!0),this._constraints=e.getConstraints(),n&&(this._constraints=n)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==E.Kind.Video)return;const{width:e,height:A}=this._mediaStreamTrack.getSettings();if(e&&A)return{width:e,height:A}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,A;return(A=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&A!==void 0?A:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,A){return m(this,void 0,void 0,function*(){var n;if(e===this._mediaStreamTrack&&!A)return;this._mediaStreamTrack&&(this.attachedElements.forEach(r=>{jt(this._mediaStreamTrack,r)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let i;if(this.processor&&e){const r=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Gt(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{r()}}this.sender&&((n=this.sender.transport)===null||n===void 0?void 0:n.state)!=="closed"&&(yield this.sender.replaceTrack(i??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(r=>{Gt(i??e,r)}))})}waitForDimensions(){return m(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xp;return function*(){var n;if(e.kind===E.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((n=oA())===null||n===void 0?void 0:n.os)==="iOS"&&(yield Oe(10));const i=Date.now();for(;Date.now()-i<A;){const r=e.dimensions;if(r)return r;yield Oe(50)}throw new FA("unable to get track dimensions after timeout")}()})}setDeviceId(e){return m(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===WA(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),WA(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return m(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===E.Source.ScreenShare)return;const{deviceId:n,groupId:i}=e._mediaStreamTrack.getSettings(),r=e.kind===E.Kind.Audio?"audioinput":"videoinput";return A?Ce.getInstance().normalizeDeviceId(r,n,i):n}()})}mute(){return m(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return m(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,A){return m(this,void 0,void 0,function*(){if(!this.sender)throw new FA("unable to replace an unpublished track");let n,i;return typeof A=="boolean"?n=A:A!==void 0&&(n=A.userProvidedTrack,i=A.stopProcessor),this.providedByUser=n??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),i&&this.processor&&(yield this.stopProcessor()),this})}restart(e){return m(this,void 0,void 0,function*(){this.manuallyStopped=!1;const A=yield this.restartLock.lock();try{e||(e=this._constraints);const{deviceId:n,facingMode:i}=e,r=_g(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const s={audio:!1,video:!1};this.kind===E.Kind.Video?s.video=n||i?{deviceId:n,facingMode:i}:!0:s.audio=n?{deviceId:n}:!0,this.attachedElements.forEach(c=>{jt(this.mediaStreamTrack,c)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const a=(yield navigator.mediaDevices.getUserMedia(s)).getTracks()[0];return yield a.applyConstraints(r),a.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(a),this._constraints=e,this.emit(k.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{A()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?k.Muted:k.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return m(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),Rl()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return m(this,void 0,void 0,function*(){var e;const A=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit(k.UpstreamPaused,this);const n=oA();if((n==null?void 0:n.name)==="Safari"&&Ct(n.version,"12.0")<0)throw new Ss("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{A()}})}resumeUpstream(){return m(this,void 0,void 0,function*(){var e;const A=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit(k.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{A()}})}getRTCStatsReport(){return m(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return m(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var r;const s=yield n.processorLock.lock();try{n.log.debug("setting up processor",n.logContext);const o=document.createElement(n.kind),a={kind:n.kind,track:n._mediaStreamTrack,element:o,audioContext:n.audioContext};if(yield A.init(a),n.log.debug("processor initialized",n.logContext),n.processor&&(yield n.stopProcessor()),n.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Gt(n._mediaStreamTrack,o),o.muted=!0,o.play().catch(c=>n.log.error("failed to play processor element",Object.assign(Object.assign({},n.logContext),{error:c}))),n.processor=A,n.processorElement=o,n.processor.processedTrack){for(const c of n.attachedElements)c!==n.processorElement&&i&&(jt(n._mediaStreamTrack,c),Gt(n.processor.processedTrack,c));yield(r=n.sender)===null||r===void 0?void 0:r.replaceTrack(n.processor.processedTrack)}n.emit(k.TrackProcessorUpdate,n.processor)}finally{s()}}()})}getProcessor(){return this.processor}stopProcessor(){return m(this,arguments,void 0,function(){var e=this;let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var n,i;e.processor&&(e.log.debug("stopping processor",e.logContext),(n=e.processor.processedTrack)===null||n===void 0||n.stop(),yield e.processor.destroy(),e.processor=void 0,A||((i=e.processorElement)===null||i===void 0||i.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit(k.TrackProcessorUpdate))}()})}}class Li extends iu{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;super(e,E.Kind.Audio,A,n,r),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>m(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}s&&this.prevStats&&(this._currentBitrate=Pi(s,this.prevStats)),this.prevStats=s}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(k.AudioTrackFeatureUpdate,this,iA.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(k.AudioTrackFeatureUpdate,this,iA.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return m(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===E.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{A()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return m(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const n=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==WA(this._constraints.deviceId);return this.source===E.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||n)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{A()}})}restartTrack(e){return m(this,void 0,void 0,function*(){let A;if(e){const n=Js({audio:e});typeof n.audio!="boolean"&&(A=n.audio)}yield this.restart(A)})}restart(e){const A=Object.create(null,{restart:{get:()=>super.restart}});return m(this,void 0,void 0,function*(){const n=yield A.restart.call(this,e);return this.checkForSilence(),n})}startMonitor(){Me()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},io)))}setProcessor(e){return m(this,void 0,void 0,function*(){var A;const n=yield this.processorLock.lock();try{if(!BA()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const i={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(i),this.processor=e,this.processor.processedTrack&&(yield(A=this.sender)===null||A===void 0?void 0:A.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(k.TrackProcessorUpdate,this.processor)}finally{n()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return m(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const A=yield this.sender.getStats();let n;return A.forEach(i=>{i.type==="outbound-rtp"&&(n={type:"audio",streamId:i.id,packetsSent:i.packetsSent,packetsLost:i.packetsLost,bytesSent:i.bytesSent,timestamp:i.timestamp,roundTripTime:i.roundTripTime,jitter:i.jitter})}),n})}checkForSilence(){return m(this,void 0,void 0,function*(){const e=yield Nl(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(k.AudioSilenceDetected)),e})}}function $p(t,e,A){switch(t.kind){case"audio":return new Li(t,e,!1,void 0,A);case"video":return new _i(t,e,!1,A);default:throw new FA("unsupported track type: ".concat(t.kind))}}const Yp=Object.values(yn),qp=Object.values(xs),zp=Object.values(Ps),Zp=[yn.h180,yn.h360],em=[xs.h180,xs.h360],Am=t=>[{scaleResolutionDownBy:2,fps:t.encoding.maxFramerate}].map(A=>{var n,i;return new q(Math.floor(t.width/A.scaleResolutionDownBy),Math.floor(t.height/A.scaleResolutionDownBy),Math.max(15e4,Math.floor(t.encoding.maxBitrate/(Math.pow(A.scaleResolutionDownBy,2)*(((n=t.encoding.maxFramerate)!==null&&n!==void 0?n:30)/((i=A.fps)!==null&&i!==void 0?i:30))))),A.fps,t.encoding.priority)}),ro=["q","h","f"];function so(t,e,A,n){var i,r;let s=n==null?void 0:n.videoEncoding;t&&(s=n==null?void 0:n.screenShareEncoding);const o=n==null?void 0:n.simulcast,a=n==null?void 0:n.scalabilityMode,c=n==null?void 0:n.videoCodec;if(!s&&!o&&!a||!e||!A)return[{}];s||(s=nm(t,e,A,c),K.debug("using video encoding",s));const l=s.maxFramerate,u=new q(e,A,s.maxBitrate,s.maxFramerate,s.priority);if(a&&bn(c)){const g=new Di(a),f=[];if(g.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const p=oA();if(jA()||BA()||(p==null?void 0:p.name)==="Chrome"&&Ct(p==null?void 0:p.version,"113")<0){const B=g.suffix=="h"?2:3;for(let y=0;y<g.spatial;y+=1)f.push({rid:ro[2-y],maxBitrate:s.maxBitrate/Math.pow(B,y),maxFramerate:u.encoding.maxFramerate});f[0].scalabilityMode=a}else f.push({maxBitrate:s.maxBitrate,maxFramerate:u.encoding.maxFramerate,scalabilityMode:a});return u.encoding.priority&&(f[0].priority=u.encoding.priority,f[0].networkPriority=u.encoding.priority),K.debug("using svc encoding",{encodings:f}),f}if(!o)return[s];let d=[];t?d=(i=su(n==null?void 0:n.screenShareSimulcastLayers))!==null&&i!==void 0?i:ru(t,u):d=(r=su(n==null?void 0:n.videoSimulcastLayers))!==null&&r!==void 0?r:ru(t,u);let h;if(d.length>0){const g=d[0];d.length>1&&([,h]=d);const f=Math.max(e,A);if(f>=960&&h)return oo(e,A,[g,h,u],l);if(f>=480)return oo(e,A,[g,u],l)}return oo(e,A,[u])}function tm(t,e,A){var n,i,r,s;if(!A.backupCodec||A.backupCodec===!0||A.backupCodec.codec===A.videoCodec)return;e!==A.backupCodec.codec&&K.warn("requested a different codec than specified as backup",{serverRequested:e,backup:A.backupCodec.codec}),A.videoCodec=e,A.videoEncoding=A.backupCodec.encoding;const o=t.mediaStreamTrack.getSettings(),a=(n=o.width)!==null&&n!==void 0?n:(i=t.dimensions)===null||i===void 0?void 0:i.width,c=(r=o.height)!==null&&r!==void 0?r:(s=t.dimensions)===null||s===void 0?void 0:s.height;return t.source===E.Source.ScreenShare&&A.simulcast&&(A.simulcast=!1),so(t.source===E.Source.ScreenShare,a,c,A)}function nm(t,e,A,n){const i=im(t,e,A);let{encoding:r}=i[0];const s=Math.max(e,A);for(let o=0;o<i.length;o+=1){const a=i[o];if(r=a.encoding,a.width>=s)break}if(n)switch(n){case"av1":r=Object.assign({},r),r.maxBitrate=r.maxBitrate*.7;break;case"vp9":r=Object.assign({},r),r.maxBitrate=r.maxBitrate*.85;break}return r}function im(t,e,A){if(t)return zp;const n=e>A?e/A:A/e;return Math.abs(n-16/9)<Math.abs(n-4/3)?Yp:qp}function ru(t,e){if(t)return Am(e);const{width:A,height:n}=e,i=A>n?A/n:n/A;return Math.abs(i-16/9)<Math.abs(i-4/3)?Zp:em}function oo(t,e,A,n){const i=[];if(A.forEach((r,s)=>{if(s>=ro.length)return;const o=Math.min(t,e),c={rid:ro[s],scaleResolutionDownBy:Math.max(1,o/Math.min(r.width,r.height)),maxBitrate:r.encoding.maxBitrate},l=n&&r.encoding.maxFramerate?Math.min(n,r.encoding.maxFramerate):r.encoding.maxFramerate;l&&(c.maxFramerate=l);const u=Wt()||s===0;r.encoding.priority&&u&&(c.priority=r.encoding.priority,c.networkPriority=r.encoding.priority),i.push(c)}),BA()&&Pl()==="ios"){let r;i.forEach(o=>{r?o.maxFramerate&&o.maxFramerate>r&&(r=o.maxFramerate):r=o.maxFramerate});let s=!0;i.forEach(o=>{var a;o.maxFramerate!=r&&(s&&(s=!1,K.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),K.info('Setting framerate of encoding "'.concat((a=o.rid)!==null&&a!==void 0?a:"",'" to ').concat(r)),o.maxFramerate=r)})}return i}function su(t){if(t)return t.sort((e,A)=>{const{encoding:n}=e,{encoding:i}=A;return n.maxBitrate>i.maxBitrate?1:n.maxBitrate<i.maxBitrate?-1:n.maxBitrate===i.maxBitrate&&n.maxFramerate&&i.maxFramerate?n.maxFramerate>i.maxFramerate?1:-1:0})}class Di{constructor(e){const A=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!A)throw new Error("invalid scalability mode");if(this.spatial=parseInt(A[1]),this.temporal=parseInt(A[2]),A.length>3)switch(A[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=A[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function rm(t){return t.source===E.Source.ScreenShare||t.constraints.height&&WA(t.constraints.height)>=1080?"maintain-resolution":"balanced"}const sm=5e3;class _i extends iu{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3?arguments[3]:void 0;super(e,E.Kind.Video,A,n,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>m(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let r;try{r=yield this.getSenderStats()}catch(o){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:o}));return}const s=new Map(r.map(o=>[o.rid,o]));if(this.prevStats){let o=0;s.forEach((a,c)=>{var l;const u=(l=this.prevStats)===null||l===void 0?void 0:l.get(c);o+=Pi(a,u)}),this._currentBitrate=o}this.prevStats=s}),this.senderLock=new De}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var A;if(this.signalClient=e,!Me())return;const n=(A=this.sender)===null||A===void 0?void 0:A.getParameters();n&&(this.encodings=n.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},io))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return m(this,void 0,void 0,function*(){var A,n,i,r,s;yield e.pauseUpstream.call(this);try{for(var o=!0,a=NA(this.simulcastCodecs.values()),c;c=yield a.next(),A=c.done,!A;o=!0)r=c.value,o=!1,yield(s=r.sender)===null||s===void 0?void 0:s.replaceTrack(null)}catch(l){n={error:l}}finally{try{!o&&!A&&(i=a.return)&&(yield i.call(a))}finally{if(n)throw n.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return m(this,void 0,void 0,function*(){var A,n,i,r,s;yield e.resumeUpstream.call(this);try{for(var o=!0,a=NA(this.simulcastCodecs.values()),c;c=yield a.next(),A=c.done,!A;o=!0){r=c.value,o=!1;const l=r;yield(s=l.sender)===null||s===void 0?void 0:s.replaceTrack(l.mediaStreamTrack)}}catch(l){n={error:l}}finally{try{!o&&!A&&(i=a.return)&&(yield i.call(a))}finally{if(n)throw n.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return m(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===E.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{A()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return m(this,void 0,void 0,function*(){const A=yield this.muteLock.lock();try{return this.isMuted?(this.source===E.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{A()}})}setTrackMuted(e){super.setTrackMuted(e);for(const A of this.simulcastCodecs.values())A.mediaStreamTrack.enabled=!e}getSenderStats(){return m(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const A=[],n=yield this.sender.getStats();return n.forEach(i=>{var r;if(i.type==="outbound-rtp"){const s={type:"video",streamId:i.id,frameHeight:i.frameHeight,frameWidth:i.frameWidth,framesPerSecond:i.framesPerSecond,framesSent:i.framesSent,firCount:i.firCount,pliCount:i.pliCount,nackCount:i.nackCount,packetsSent:i.packetsSent,bytesSent:i.bytesSent,qualityLimitationReason:i.qualityLimitationReason,qualityLimitationDurations:i.qualityLimitationDurations,qualityLimitationResolutionChanges:i.qualityLimitationResolutionChanges,rid:(r=i.rid)!==null&&r!==void 0?r:i.id,retransmittedPacketsSent:i.retransmittedPacketsSent,targetBitrate:i.targetBitrate,timestamp:i.timestamp},o=n.get(i.remoteId);o&&(s.jitter=o.jitter,s.packetsLost=o.packetsLost,s.roundTripTime=o.roundTripTime),A.push(s)}}),A.sort((i,r)=>{var s,o;return((s=r.frameWidth)!==null&&s!==void 0?s:0)-((o=i.frameWidth)!==null&&o!==void 0?o:0)}),A})}setPublishingQuality(e){const A=[];for(let n=$e.LOW;n<=$e.HIGH;n+=1)A.push(new gs({quality:n,enabled:n<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(A)}restartTrack(e){return m(this,void 0,void 0,function*(){var A,n,i,r,s;let o;if(e){const u=Js({video:e});typeof u.video!="boolean"&&(o=u.video)}yield this.restart(o);try{for(var a=!0,c=NA(this.simulcastCodecs.values()),l;l=yield c.next(),A=l.done,!A;a=!0){r=l.value,a=!1;const u=r;u.sender&&((s=u.sender.transport)===null||s===void 0?void 0:s.state)!=="closed"&&(u.mediaStreamTrack=this.mediaStreamTrack.clone(),yield u.sender.replaceTrack(u.mediaStreamTrack))}}catch(u){n={error:u}}finally{try{!a&&!A&&(i=c.return)&&(yield i.call(c))}finally{if(n)throw n.error}}})}setProcessor(e){const A=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return m(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s,o,a,c,l,u;if(yield A.setProcessor.call(i,n,r),!((l=i.processor)===null||l===void 0)&&l.processedTrack)try{for(var d=!0,h=NA(i.simulcastCodecs.values()),g;g=yield h.next(),s=g.done,!s;d=!0)c=g.value,d=!1,yield(u=c.sender)===null||u===void 0?void 0:u.replaceTrack(i.processor.processedTrack)}catch(f){o={error:f}}finally{try{!d&&!s&&(a=h.return)&&(yield a.call(h))}finally{if(o)throw o.error}}}()})}setDegradationPreference(e){return m(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const A=this.sender.getParameters();A.degradationPreference=e,this.sender.setParameters(A)}catch(A){this.log.warn("failed to set degradationPreference",Object.assign({error:A},this.logContext))}})}addSimulcastTrack(e,A){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const n={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:A};return this.simulcastCodecs.set(e,n),n}setSimulcastTrackSender(e,A){const n=this.simulcastCodecs.get(e);n&&(n.sender=A,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},sm))}setPublishingCodecs(e){return m(this,void 0,void 0,function*(){var A,n,i,r,s,o,a;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(e[0].qualities),[];this.subscribedCodecs=e;const c=[];try{for(A=!0,n=NA(e);i=yield n.next(),r=i.done,!r;A=!0){a=i.value,A=!1;const l=a;if(!this.codec||this.codec===l.codec)yield this.setPublishingLayers(l.qualities);else{const u=this.simulcastCodecs.get(l.codec);if(this.log.debug("try setPublishingCodec for ".concat(l.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:u})),!u||!u.sender){for(const d of l.qualities)if(d.enabled){c.push(l.codec);break}}else u.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(l.codec),this.logContext),yield ou(u.sender,u.encodings,l.qualities,this.senderLock,this.log,this.logContext))}}}catch(l){s={error:l}}finally{try{!A&&!r&&(o=n.return)&&(yield o.call(n))}finally{if(s)throw s.error}}return c})}setPublishingLayers(e){return m(this,void 0,void 0,function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:e})),!(!this.sender||!this.encodings)&&(yield ou(this.sender,this.encodings,e,this.senderLock,this.log,this.logContext))})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return m(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),Rl()&&this.isInBackground&&this.source===E.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function ou(t,e,A,n,i,r){return m(this,void 0,void 0,function*(){const s=yield n.lock();i.debug("setPublishingLayersForSender",Object.assign(Object.assign({},r),{sender:t,qualities:A,senderEncodings:e}));try{const o=t.getParameters(),{encodings:a}=o;if(!a)return;if(a.length!==e.length){i.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},r),{encodings:a,senderEncodings:e}));return}let c=!1;const l=oA();if((l==null?void 0:l.name)==="Chrome"&&Ct(l==null?void 0:l.version,"133")>0&&a[0].scalabilityMode){const d=a[0],h=new Di(d.scalabilityMode);let g=Ht.OFF;if(A.forEach(f=>{f.enabled&&(g===Ht.OFF||f.quality>g)&&(g=f.quality)}),g===Ht.OFF)d.active&&(d.active=!1,c=!0);else if(!d.active||h.spatial!==g+1){c=!0,d.active=!0;const f=new Di(e[0].scalabilityMode);h.spatial=g+1,h.suffix=f.suffix,h.spatial===1&&(h.suffix=void 0),d.scalabilityMode=h.toString(),d.scaleResolutionDownBy=Math.pow(2,2-g),e[0].maxBitrate&&(d.maxBitrate=e[0].maxBitrate/(d.scaleResolutionDownBy*d.scaleResolutionDownBy))}}else a.forEach((d,h)=>{var g;let f=(g=d.rid)!==null&&g!==void 0?g:"";f===""&&(f="q");const p=au(f),B=A.find(y=>y.quality===p);B&&d.active!==B.enabled&&(c=!0,d.active=B.enabled,i.debug("setting layer ".concat(B.quality," to ").concat(d.active?"enabled":"disabled"),r),Wt()&&(B.enabled?(d.scaleResolutionDownBy=e[h].scaleResolutionDownBy,d.maxBitrate=e[h].maxBitrate,d.maxFrameRate=e[h].maxFrameRate):(d.scaleResolutionDownBy=4,d.maxBitrate=10,d.maxFrameRate=2)))});c&&(o.encodings=a,i.debug("setting encodings",Object.assign(Object.assign({},r),{encodings:o.encodings})),yield t.setParameters(o))}finally{s()}})}function au(t){switch(t){case"f":return $e.HIGH;case"h":return $e.MEDIUM;case"q":return $e.LOW;default:return $e.HIGH}}function cu(t,e,A,n){if(!A)return[new mt({quality:$e.HIGH,width:t,height:e,bitrate:0,ssrc:0})];if(n){const i=A[0].scalabilityMode,r=new Di(i),s=[],o=r.suffix=="h"?1.5:2,a=r.suffix=="h"?2:3;for(let c=0;c<r.spatial;c+=1)s.push(new mt({quality:Math.min($e.HIGH,r.spatial-1)-c,width:Math.ceil(t/Math.pow(o,c)),height:Math.ceil(e/Math.pow(o,c)),bitrate:A[0].maxBitrate?Math.ceil(A[0].maxBitrate/Math.pow(a,c)):0,ssrc:0}));return s}return A.map(i=>{var r,s,o;const a=(r=i.scaleResolutionDownBy)!==null&&r!==void 0?r:1;let c=au((s=i.rid)!==null&&s!==void 0?s:"");return new mt({quality:c,width:Math.ceil(t/a),height:Math.ceil(e/a),bitrate:(o=i.maxBitrate)!==null&&o!==void 0?o:0,ssrc:0})})}const lu="_lossy",uu="_reliable",om=2*1e3,ao="leave-reconnect";var cA;(function(t){t[t.New=0]="New",t[t.Connected=1]="Connected",t[t.Disconnected=2]="Disconnected",t[t.Reconnecting=3]="Reconnecting",t[t.Closed=4]="Closed"})(cA||(cA={}));class am extends mA.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var A;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=to.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=cA.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=K,this.handleDataChannel=n=>m(this,[n],void 0,function(i){var r=this;let{channel:s}=i;return function*(){if(s){if(s.label===uu)r.reliableDCSub=s;else if(s.label===lu)r.lossyDCSub=s;else return;r.log.debug("on data channel ".concat(s.id,", ").concat(s.label),r.logContext),s.onmessage=r.handleDataMessage}}()}),this.handleDataMessage=n=>m(this,void 0,void 0,function*(){var i,r;const s=yield this.dataProcessLock.lock();try{let o;if(n.data instanceof ArrayBuffer)o=n.data;else if(n.data instanceof Blob)o=yield n.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:n.data}));return}const a=He.fromBinary(new Uint8Array(o));((i=a.value)===null||i===void 0?void 0:i.case)==="speaker"?this.emit(I.ActiveSpeakersUpdate,a.value.value.speakers):(((r=a.value)===null||r===void 0?void 0:r.case)==="user"&&lm(a,a.value.value),this.emit(I.DataPacketReceived,a))}finally{s()}}),this.handleDataError=n=>{const r=n.currentTarget.maxRetransmits===0?"lossy":"reliable";if(n instanceof ErrorEvent&&n.error){const{error:s}=n.error;this.log.error("DataChannel error on ".concat(r,": ").concat(n.message),Object.assign(Object.assign({},this.logContext),{error:s}))}else this.log.error("Unknown DataChannel error on ".concat(r),Object.assign(Object.assign({},this.logContext),{event:n}))},this.handleBufferedAmountLow=n=>{const r=n.currentTarget.maxRetransmits===0?W.LOSSY:W.RELIABLE;this.updateAndEmitDCBufferStatus(r)},this.handleDisconnect=(n,i)=>{if(this._isClosed)return;this.log.warn("".concat(n," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const r=a=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(a,"ms. giving up"),this.logContext),this.emit(I.Disconnected),this.close()},s=Date.now()-this.reconnectStart;let o=this.getNextRetryDelay({elapsedMs:s,retryCount:this.reconnectAttempts});if(o===null){r(s);return}n===ao&&(o=0),this.log.debug("reconnecting in ".concat(o,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=ye.setTimeout(()=>this.attemptReconnect(i).finally(()=>this.reconnectTimeout=void 0),o)},this.waitForRestarted=()=>new Promise((n,i)=>{this.pcState===cA.Connected&&n();const r=()=>{this.off(I.Disconnected,s),n()},s=()=>{this.off(I.Restarted,r),i()};this.once(I.Restarted,r),this.once(I.Disconnected,s)}),this.updateAndEmitDCBufferStatus=n=>{const i=this.isBufferStatusLow(n);typeof i<"u"&&i!==this.dcBufferStatus.get(n)&&(this.dcBufferStatus.set(n,i),this.emit(I.DCBufferStatusChanged,i,n))},this.isBufferStatusLow=n=>{const i=this.dataChannelForKind(n);if(i)return i.bufferedAmount<=i.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===Ae.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(Ot.RR_SIGNAL_DISCONNECTED))},this.log=TA((A=e.loggerName)!==null&&A!==void 0?A:sA.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new $s(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new De,this.dataProcessLock=new De,this.dcBufferStatus=new Map([[W.LOSSY,!0],[W.RELIABLE,!0]]),this.client.onParticipantUpdate=n=>this.emit(I.ParticipantUpdate,n),this.client.onConnectionQuality=n=>this.emit(I.ConnectionQualityUpdate,n),this.client.onRoomUpdate=n=>this.emit(I.RoomUpdate,n),this.client.onSubscriptionError=n=>this.emit(I.SubscriptionError,n),this.client.onSubscriptionPermissionUpdate=n=>this.emit(I.SubscriptionPermissionUpdate,n),this.client.onSpeakersChanged=n=>this.emit(I.SpeakersChanged,n),this.client.onStreamStateUpdate=n=>this.emit(I.StreamStateChanged,n),this.client.onRequestResponse=n=>this.emit(I.SignalRequestResponse,n)}get logContext(){var e,A,n,i,r,s,o,a;return{room:(A=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||A===void 0?void 0:A.name,roomID:(i=(n=this.latestJoinResponse)===null||n===void 0?void 0:n.room)===null||i===void 0?void 0:i.sid,participant:(s=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.participant)===null||s===void 0?void 0:s.identity,pID:(a=(o=this.latestJoinResponse)===null||o===void 0?void 0:o.participant)===null||a===void 0?void 0:a.sid}}join(e,A,n,i){return m(this,void 0,void 0,function*(){this.url=e,this.token=A,this.signalOpts=n,this.maxJoinAttempts=n.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const r=yield this.client.join(e,A,n,i);return this._isClosed=!1,this.latestJoinResponse=r,this.subscriberPrimary=r.subscriberPrimary,this.pcManager||(yield this.configure(r)),(!this.subscriberPrimary||r.fastPublish)&&this.negotiate(),this.clientConfiguration=r.clientConfiguration,setTimeout(()=>{this.emit(I.SignalConnected)},10),r}catch(r){if(r instanceof z&&r.reason===G.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,A,n,i);throw r}})}close(){return m(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(I.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return m(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const A=n=>{n&&(n.close(),n.onbufferedamountlow=null,n.onclose=null,n.onclosing=null,n.onerror=null,n.onmessage=null,n.onopen=null)};A(this.lossyDC),A(this.lossyDCSub),A(this.reliableDC),A(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0})}cleanupClient(){return m(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new FA("a track with the same ID has already been published");return new Promise((A,n)=>{const i=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],n(new z("publication of local track timed out, no response from server",G.InternalError))},1e4);this.pendingTrackResolvers[e.cid]={resolve:r=>{clearTimeout(i),A(r)},reject:()=>{clearTimeout(i),n(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:A}=this.pendingTrackResolvers[e.track.id];A&&A(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(A){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:A}))}return!1}updateMuteStatus(e,A){this.client.sendMuteTrack(e,A)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return m(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return m(this,void 0,void 0,function*(){var A,n;if(this.pcManager&&this.pcManager.currentState!==ce.NEW)return;this.participantSid=(A=e.participant)===null||A===void 0?void 0:A.sid;const i=this.makeRTCConfiguration(e);this.pcManager=new Jp(i,e.subscriberPrimary,this.loggerOptions),this.emit(I.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(r,s)=>{this.client.sendIceCandidate(r,s)},this.pcManager.onPublisherOffer=r=>{this.client.sendOffer(r)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(r,s,o)=>m(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(r),this.logContext),["closed","disconnected","failed"].includes(s)&&(this.publisherConnectionPromise=void 0),r===ce.CONNECTED){const l=this.pcState===cA.New;this.pcState=cA.Connected,l&&this.emit(I.Connected,e)}else r===ce.FAILED&&this.pcState===cA.Connected&&(this.pcState=cA.Disconnected,this.handleDisconnect("peerconnection failed",o==="failed"?Ot.RR_SUBSCRIBER_FAILED:Ot.RR_PUBLISHER_FAILED));const a=this.client.isDisconnected||this.client.currentState===Ae.RECONNECTING,c=[ce.FAILED,ce.CLOSING,ce.CLOSED].includes(r);a&&c&&!this._isClosed&&this.emit(I.Offline)}),this.pcManager.onTrack=r=>{this.emit(I.MediaTrackAdded,r.track,r.streams[0],r.receiver)},cm((n=e.serverInfo)===null||n===void 0?void 0:n.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=e=>m(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e))}),this.client.onTrickle=(e,A)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:A})),this.pcManager.addIceCandidate(e,A))},this.client.onOffer=e=>m(this,void 0,void 0,function*(){if(!this.pcManager)return;const A=yield this.pcManager.createSubscriberAnswerFromOffer(e);this.client.sendAnswer(A)}),this.client.onLocalTrackPublished=e=>{var A;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(A=e.track)===null||A===void 0?void 0:A.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:n}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],n(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(I.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(I.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,A)=>{this.emit(I.RemoteMute,e,A)},this.client.onSubscribedQualityUpdate=e=>{this.emit(I.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var A;this.participantSid=(A=e.participant)===null||A===void 0?void 0:A.sid,this.emit(I.RoomMoved,e)},this.client.onClose=()=>{this.handleDisconnect("signal",Ot.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Kt.DISCONNECT:this.emit(I.Disconnected,e==null?void 0:e.reason),this.close();break;case Kt.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(ao);break;case Kt.RESUME:this.handleDisconnect(ao)}}}makeRTCConfiguration(e){var A;const n=Object.assign({},this.rtcConfig);if(!((A=this.signalOpts)===null||A===void 0)&&A.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),n.encodedInsertableStreams=!0),e.iceServers&&!n.iceServers){const i=[];e.iceServers.forEach(r=>{const s={urls:r.urls};r.username&&(s.username=r.username),r.credential&&(s.credential=r.credential),i.push(s)}),n.iceServers=i}return e.clientConfiguration&&e.clientConfiguration.forceRelay===vn.ENABLED&&(n.iceTransportPolicy="relay"),n.sdpSemantics="unified-plan",n.continualGatheringPolicy="gather_continually",n}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(lu,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(uu,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,A,n){return m(this,void 0,void 0,function*(){if(Ls())return yield this.createTransceiverRTCRtpSender(e,A,n);if(Ds())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new Be("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,A,n,i){return m(this,void 0,void 0,function*(){if(Ls())return this.createSimulcastTransceiverSender(e,A,n,i);if(Ds())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new Be("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,A,n){return m(this,void 0,void 0,function*(){if(!this.pcManager)throw new Be("publisher is closed");const i=[];e.mediaStream&&i.push(e.mediaStream),Xt(e)&&(e.codec=A.videoCodec);const r={direction:"sendonly",streams:i};return n&&(r.sendEncodings=n),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,r)).sender})}createSimulcastTransceiverSender(e,A,n,i){return m(this,void 0,void 0,function*(){if(!this.pcManager)throw new Be("publisher is closed");const r={direction:"sendonly"};i&&(r.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(A.mediaStreamTrack,r);if(n.videoCodec)return e.setSimulcastTrackSender(n.videoCodec,s.sender),s.sender})}createRTCRtpSender(e){return m(this,void 0,void 0,function*(){if(!this.pcManager)throw new Be("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return m(this,void 0,void 0,function*(){var A,n,i;if(!this._isClosed){if(this.attemptingReconnect){K.warn("already attempting reconnect, returning early",this.logContext);return}(((A=this.clientConfiguration)===null||A===void 0?void 0:A.resumeConnection)===vn.DISABLED||((i=(n=this.pcManager)===null||n===void 0?void 0:n.currentState)!==null&&i!==void 0?i:ce.NEW)===ce.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(r){this.reconnectAttempts+=1;let s=!0;r instanceof Be?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:r})),s=!1):r instanceof Yt||(this.fullReconnectOnNext=!0),s?this.handleDisconnect("reconnect",Ot.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(I.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(A){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:A}))}return null}restartConnection(e){return m(this,void 0,void 0,function*(){var A,n,i;try{if(!this.url||!this.token)throw new Be("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(I.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let r;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new Yt;r=yield this.join(e??this.url,this.token,this.signalOpts)}catch(s){throw s instanceof z&&s.reason===G.NotAllowed?new Be("could not reconnect, token might be expired"):new Yt}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(I.SignalRestarted,r),yield this.waitForPCReconnected(),this.client.currentState!==Ae.CONNECTED)throw new Yt("Signal connection got severed during reconnect");(A=this.regionUrlProvider)===null||A===void 0||A.resetAttempts(),this.emit(I.Restarted)}catch(r){const s=yield(n=this.regionUrlProvider)===null||n===void 0?void 0:n.getNextBestRegionUrl();if(s){yield this.restartConnection(s);return}else throw(i=this.regionUrlProvider)===null||i===void 0||i.resetAttempts(),r}})}resumeConnection(e){return m(this,void 0,void 0,function*(){var A;if(!this.url||!this.token)throw new Be("could not reconnect, url or token not saved");if(!this.pcManager)throw new Be("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(I.Resuming);let n;try{this.setupSignalClientCallbacks(),n=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(i){let r="";throw i instanceof Error&&(r=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof z&&i.reason===G.NotAllowed?new Be("could not reconnect, token might be expired"):i instanceof z&&i.reason===G.LeaveRequest?i:new Yt(r)}if(this.emit(I.SignalResumed),n){const i=this.makeRTCConfiguration(n);this.pcManager.updateConfiguration(i)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Ae.CONNECTED)throw new Yt("Signal connection got severed during reconnect");this.client.setReconnected(),((A=this.reliableDC)===null||A===void 0?void 0:A.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(I.Resumed)})}waitForPCInitialConnection(e,A){return m(this,void 0,void 0,function*(){if(!this.pcManager)throw new Be("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(A,e)})}waitForPCReconnected(){return m(this,void 0,void 0,function*(){this.pcState=cA.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield Oe(om),!this.pcManager)throw new Be("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=cA.Connected}catch(e){throw this.pcState=cA.Disconnected,new z("could not establish PC connection, ".concat(e.message),G.InternalError)}})}publishRpcResponse(e,A,n,i){return m(this,void 0,void 0,function*(){const r=new He({destinationIdentities:[e],kind:W.RELIABLE,value:{case:"rpcResponse",value:new mc({requestId:A,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:n??""}})}});yield this.sendDataPacket(r,W.RELIABLE)})}publishRpcAck(e,A){return m(this,void 0,void 0,function*(){const n=new He({destinationIdentities:[e],kind:W.RELIABLE,value:{case:"rpcAck",value:new pc({requestId:A})}});yield this.sendDataPacket(n,W.RELIABLE)})}sendDataPacket(e,A){return m(this,void 0,void 0,function*(){const n=e.toBinary();yield this.ensurePublisherConnected(A);const i=this.dataChannelForKind(A);i&&i.send(n),this.updateAndEmitDCBufferStatus(A)})}waitForBufferStatusLow(e){return new Promise((A,n)=>m(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))A();else{const i=()=>n("Engine closed");for(this.once(I.Closing,i);!this.dcBufferStatus.get(e);)yield Oe(10);this.off(I.Closing,i),A()}}))}ensureDataTransportConnected(e){return m(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var r;if(!n.pcManager)throw new Be("PC manager is closed");const s=i?n.pcManager.subscriber:n.pcManager.publisher,o=i?"Subscriber":"Publisher";if(!s)throw new z("".concat(o," connection not set"),G.InternalError);let a=!1;!i&&!n.dataChannelForKind(A,i)&&(n.createDataChannels(),a=!0),!a&&!i&&!n.pcManager.publisher.isICEConnected&&n.pcManager.publisher.getICEConnectionState()!=="checking"&&(a=!0),a&&n.negotiate();const c=n.dataChannelForKind(A,i);if((c==null?void 0:c.readyState)==="open")return;const l=new Date().getTime()+n.peerConnectionTimeout;for(;new Date().getTime()<l;){if(s.isICEConnected&&((r=n.dataChannelForKind(A,i))===null||r===void 0?void 0:r.readyState)==="open")return;yield Oe(50)}throw new z("could not establish ".concat(o," connection, state: ").concat(s.getICEConnectionState()),G.InternalError)}()})}ensurePublisherConnected(e){return m(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==ce.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return m(this,void 0,void 0,function*(){return new Promise((e,A)=>m(this,void 0,void 0,function*(){if(!this.pcManager){A(new Ts("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const n=new AbortController,i=()=>{n.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&A("cannot negotiate on closed engine"),this.on(I.Closing,i),this.pcManager.publisher.once($t.RTPVideoPayloadTypes,r=>{const s=new Map;r.forEach(o=>{const a=o.codec.toLowerCase();Bp(a)&&s.set(o.payload,a)}),this.emit(I.RTPVideoMapUpdate,s)});try{yield this.pcManager.negotiate(n),e()}catch(r){r instanceof Ts&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",Ot.RR_UNKNOWN),A(r)}finally{this.off(I.Closing,i)}}))})}dataChannelForKind(e,A){if(A){if(e===W.LOSSY)return this.lossyDCSub;if(e===W.RELIABLE)return this.reliableDCSub}else{if(e===W.LOSSY)return this.lossyDC;if(e===W.RELIABLE)return this.reliableDC}}sendSyncState(e,A){var n,i;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const r=this.pcManager.subscriber.getLocalDescription(),s=this.pcManager.subscriber.getRemoteDescription(),o=(i=(n=this.signalOpts)===null||n===void 0?void 0:n.autoSubscribe)!==null&&i!==void 0?i:!0,a=new Array,c=new Array;e.forEach(l=>{l.isDesired!==o&&a.push(l.trackSid),l.isEnabled||c.push(l.trackSid)}),this.client.sendSyncState(new Lc({answer:r?xi({sdp:r.sdp,type:r.type}):void 0,offer:s?xi({sdp:s.sdp,type:s.type}):void 0,subscription:new mi({trackSids:a,subscribe:!o,participantTracks:[]}),publishTracks:Sp(A),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:c}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],A=(n,i)=>{(n==null?void 0:n.id)!==void 0&&n.id!==null&&e.push(new Dc({label:n.label,id:n.id,target:i}))};return A(this.dataChannelForKind(W.LOSSY),rA.PUBLISHER),A(this.dataChannelForKind(W.RELIABLE),rA.PUBLISHER),A(this.dataChannelForKind(W.LOSSY,!0),rA.SUBSCRIBER),A(this.dataChannelForKind(W.RELIABLE,!0),rA.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&ye.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){Me()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){Me()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class Yt extends Error{}function cm(t){return t!==void 0&&t>13}function lm(t,e){const A=t.participantIdentity?t.participantIdentity:e.participantIdentity;t.participantIdentity=A,e.participantIdentity=A;const n=t.destinationIdentities.length!==0?t.destinationIdentities:e.destinationIdentities;t.destinationIdentities=n,e.destinationIdentities=n}class co{constructor(e,A){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=A}updateToken(e){this.token=e}isCloud(){return Hs(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return m(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const A=this.regionSettings.regions.filter(n=>!this.attemptedRegions.find(i=>i.url===n.url));if(A.length>0){const n=A[0];return this.attemptedRegions.push(n),K.debug("next region: ".concat(n.region)),n.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return m(this,void 0,void 0,function*(){const A=yield fetch("".concat(um(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(A.ok){const n=yield A.json();return this.lastUpdateAt=Date.now(),n}else throw new z("Could not fetch region settings: ".concat(A.statusText),A.status===401?G.NotAllowed:G.InternalError,A.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function um(t){return"".concat(t.protocol.replace("ws","http"),"//").concat(t.host,"/settings")}class du{get info(){return this._info}constructor(e,A,n){this.reader=A,this.totalByteSize=n,this._info=e,this.bytesReceived=0}}class dm extends du{handleChunkReceived(e){var A;this.bytesReceived+=e.content.byteLength;const n=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(A=this.onProgress)===null||A===void 0||A.call(this,n)}[Symbol.asyncIterator](){const e=this.reader.getReader();return{next:()=>m(this,void 0,void 0,function*(){try{const{done:A,value:n}=yield e.read();return A?{done:!0,value:void 0}:(this.handleChunkReceived(n),{done:!1,value:n.content})}catch{return{done:!0,value:void 0}}}),return(){return m(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return m(this,void 0,void 0,function*(){var e,A,n,i;let r=new Set;try{for(var s=!0,o=NA(this),a;a=yield o.next(),e=a.done,!e;s=!0){i=a.value,s=!1;const c=i;r.add(c)}}catch(c){A={error:c}}finally{try{!s&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(A)throw A.error}}return Array.from(r)})}}class hm extends du{constructor(e,A,n){super(e,A,n),this.receivedChunks=new Map}handleChunkReceived(e){var A;const n=Ii(e.chunkIndex),i=this.receivedChunks.get(n);if(i&&i.version>e.version)return;this.receivedChunks.set(n,e),this.bytesReceived+=e.content.byteLength;const r=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(A=this.onProgress)===null||A===void 0||A.call(this,r)}[Symbol.asyncIterator](){const e=this.reader.getReader(),A=new TextDecoder;return{next:()=>m(this,void 0,void 0,function*(){try{const{done:n,value:i}=yield e.read();return n?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:A.decode(i.content)})}catch{return{done:!0,value:void 0}}}),return(){return m(this,void 0,void 0,function*(){return e.releaseLock(),{done:!0,value:void 0}})}}}readAll(){return m(this,void 0,void 0,function*(){var e,A,n,i;let r="";try{for(var s=!0,o=NA(this),a;a=yield o.next(),e=a.done,!e;s=!0)i=a.value,s=!1,r+=i}catch(c){A={error:c}}finally{try{!s&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(A)throw A.error}}return r})}}class hu{constructor(e,A,n){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=n,this.info=A}write(e){return this.defaultWriter.write(e)}close(){return m(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class fm extends hu{}class gm extends hu{}class fu extends E{constructor(e,A,n,i,r){super(e,n,r),this.sid=A,this.receiver=i}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?k.Muted:k.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const A=n=>{n.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",A),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit(k.Ended,this))};e.addEventListener("removetrack",A)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return m(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),io)),Tp()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var A;this.timeSyncHandle=requestAnimationFrame(()=>e());const n=(A=this.receiver)===null||A===void 0?void 0:A.getSynchronizationSources()[0];if(n){const{timestamp:i,rtpTimestamp:r}=n;r&&this.rtpTimestamp!==r&&(this.emit(k.TimeSyncUpdate,{timestamp:i,rtpTimestamp:r}),this.rtpTimestamp=r)}};e()}}class pm extends fu{constructor(e,A,n,i,r,s){super(e,A,E.Kind.Audio,n,s),this.monitorReceiver=()=>m(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=Pi(o,this.prevStats)),this.prevStats=o}),this.audioContext=i,this.webAudioPluginNodes=[],r&&(this.sinkId=r.deviceId)}setVolume(e){var A;for(const n of this.attachedElements)this.audioContext?(A=this.gainNode)===null||A===void 0||A.gain.setTargetAtTime(e,0,.1):n.volume=e;BA()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(BA())return 1;let e=0;return this.attachedElements.forEach(A=>{A.volume>e&&(e=A.volume)}),e}setSinkId(e){return m(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(A=>{if(_s(A))return A.setSinkId(e)}))})}attach(e){const A=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&_s(e)&&e.setSinkId(this.sinkId).catch(n=>{this.log.error("Failed to set sink id on remote audio track",n,this.logContext)}),this.audioContext&&A&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let A;return e?(A=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(A=super.detach(),this.disconnectWebAudio()),A}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,A){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(A.srcObject);let n=this.sourceNode;this.webAudioPluginNodes.forEach(i=>{n.connect(i),n=i}),this.gainNode=e.createGain(),n.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit(k.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(i=>{this.emit(k.AudioPlaybackFailed,i)})}disconnectWebAudio(){var e,A;(e=this.gainNode)===null||e===void 0||e.disconnect(),(A=this.sourceNode)===null||A===void 0||A.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return m(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let A;return e.forEach(n=>{n.type==="inbound-rtp"&&(A={type:"audio",streamId:n.id,timestamp:n.timestamp,jitter:n.jitter,bytesReceived:n.bytesReceived,concealedSamples:n.concealedSamples,concealmentEvents:n.concealmentEvents,silentConcealedSamples:n.silentConcealedSamples,silentConcealmentEvents:n.silentConcealmentEvents,totalAudioEnergy:n.totalAudioEnergy,totalSamplesDuration:n.totalSamplesDuration})}),A})}}const lo=100;class mm extends fu{constructor(e,A,n,i,r){super(e,A,E.Kind.Video,n,r),this.elementInfos=[],this.monitorReceiver=()=>m(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const s=yield this.getReceiverStats();s&&this.prevStats&&this.receiver&&(this._currentBitrate=Pi(s,this.prevStats)),this.prevStats=s}),this.debouncedHandleResize=eo(()=>{this.updateDimensions()},lo),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(A=>{e?jt(this._mediaStreamTrack,A):Gt(this._mediaStreamTrack,A)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(A=>A.element===e)===void 0){const A=new Bm(e);this.observeElementInfo(A)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(A=>A===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const A=this.elementInfos.filter(n=>n===e);for(const n of A)n.stopObserving();this.elementInfos=this.elementInfos.filter(n=>n!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let A=[];if(e)return this.stopObservingElement(e),super.detach(e);A=super.detach();for(const n of A)this.stopObservingElement(n);return A}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return m(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let A,n="",i=new Map;return e.forEach(r=>{r.type==="inbound-rtp"?(n=r.codecId,A={type:"video",streamId:r.id,framesDecoded:r.framesDecoded,framesDropped:r.framesDropped,framesReceived:r.framesReceived,packetsReceived:r.packetsReceived,packetsLost:r.packetsLost,frameWidth:r.frameWidth,frameHeight:r.frameHeight,pliCount:r.pliCount,firCount:r.firCount,nackCount:r.nackCount,jitter:r.jitter,timestamp:r.timestamp,bytesReceived:r.bytesReceived,decoderImplementation:r.decoderImplementation}):r.type==="codec"&&i.set(r.id,r)}),A&&n!==""&&i.get(n)&&(A.mimeType=i.get(n).mimeType),A})}stopObservingElement(e){const A=this.elementInfos.filter(n=>n.element===e);for(const n of A)this.stopObservingElementInfo(n)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return m(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(){var e,A;const n=this.elementInfos.reduce((o,a)=>Math.max(o,a.visibilityChangedAt||0),0),i=!((A=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pauseVideoInBackground)!==null&&A!==void 0)||A?this.isInBackground:!1,r=this.elementInfos.some(o=>o.pictureInPicture),s=this.elementInfos.some(o=>o.visible)&&!i||r;if(this.lastVisible!==s){if(!s&&Date.now()-n<lo){ye.setTimeout(()=>{this.updateVisibility()},lo);return}this.lastVisible=s,this.emit(k.VisibilityChanged,s,this)}}updateDimensions(){var e,A;let n=0,i=0;const r=this.getPixelDensity();for(const s of this.elementInfos){const o=s.width()*r,a=s.height()*r;o+a>n+i&&(n=o,i=a)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===n&&((A=this.lastDimensions)===null||A===void 0?void 0:A.height)===i||(this.lastDimensions={width:n,height:i},this.emit(k.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const A=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return A==="screen"?Ll():A||(Ll()>2?2:1)}}class Bm{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,A){this.onVisibilityChanged=n=>{var i;const{target:r,isIntersecting:s}=n;r===this.element&&(this.isIntersecting=s,this.isPiP=En(this.element),this.visibilityChangedAt=Date.now(),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this))},this.onEnterPiP=()=>{var n,i,r;(i=(n=window.documentPictureInPicture)===null||n===void 0?void 0:n.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP),this.isPiP=En(this.element),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this)},this.onLeavePiP=()=>{var n;this.isPiP=En(this.element),(n=this.handleVisibilityChanged)===null||n===void 0||n.call(this)},this.element=e,this.isIntersecting=A??uo(e),this.isPiP=Me()&&En(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,A,n;this.isIntersecting=uo(this.element),this.isPiP=En(this.element),this.element.handleResize=()=>{var i;(i=this.handleResize)===null||i===void 0||i.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,_l().observe(this.element),Dl().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(n=(A=window.documentPictureInPicture)===null||A===void 0?void 0:A.window)===null||n===void 0||n.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,A,n,i,r;(e=_l())===null||e===void 0||e.unobserve(this.element),(A=Dl())===null||A===void 0||A.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(n=window.documentPictureInPicture)===null||n===void 0||n.removeEventListener("enter",this.onEnterPiP),(r=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||r===void 0||r.removeEventListener("pagehide",this.onLeavePiP)}}function En(t){var e,A;return document.pictureInPictureElement===t?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?uo(t,(A=window.documentPictureInPicture)===null||A===void 0?void 0:A.window):!1}function uo(t,e){const A=e||window;let n=t.offsetTop,i=t.offsetLeft;const r=t.offsetWidth,s=t.offsetHeight,{hidden:o}=t,{display:a}=getComputedStyle(t);for(;t.offsetParent;)t=t.offsetParent,n+=t.offsetTop,i+=t.offsetLeft;return n<A.pageYOffset+A.innerHeight&&i<A.pageXOffset+A.innerWidth&&n+s>A.pageYOffset&&i+r>A.pageXOffset&&!o&&a!=="none"}class IA extends mA.EventEmitter{constructor(e,A,n,i){var r;super(),this.metadataMuted=!1,this.encryption=je.NONE,this.log=K,this.handleMuted=()=>{this.emit(k.Muted)},this.handleUnmuted=()=>{this.emit(k.Unmuted)},this.log=TA((r=i==null?void 0:i.loggerName)!==null&&r!==void 0?r:sA.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=A,this.trackName=n,this.source=E.Source.Unknown}setTrack(e){this.track&&(this.track.off(k.Muted,this.handleMuted),this.track.off(k.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on(k.Muted,this.handleMuted),e.on(k.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),X(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==je.NONE}get audioTrack(){if(kA(this.track))return this.track}get videoTrack(){if(Xt(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=E.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===E.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(t){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(t.SubscriptionStatus||(t.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(t.PermissionStatus||(t.PermissionStatus={}))})(IA||(IA={}));class ho extends IA{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,A,n,i){super(e,A.sid,A.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(k.Ended)},this.updateInfo(A),this.setTrack(n)}setTrack(e){this.track&&this.track.off(k.Ended,this.handleTrackEnded),super.setTrack(e),e&&e.on(k.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return m(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return m(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return m(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return m(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(kA(this.track)){const A=this.track.getSourceTrackSettings(),n=new Set;return A.autoGainControl&&n.add(iA.TF_AUTO_GAIN_CONTROL),A.echoCancellation&&n.add(iA.TF_ECHO_CANCELLATION),A.noiseSuppression&&n.add(iA.TF_NOISE_SUPPRESSION),A.channelCount&&A.channelCount>1&&n.add(iA.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||n.add(iA.TF_NO_DTX),this.track.enhancedNoiseCancellation&&n.add(iA.TF_ENHANCED_NOISE_CANCELLATION),Array.from(n.values())}else return[]}}function Hi(t,e){return m(this,void 0,void 0,function*(){t??(t={});let A=!1;const{audioProcessor:n,videoProcessor:i,optionsWithoutProcessor:r}=Gl(t);let s=r.audio,o=r.video;if(n&&typeof r.audio=="object"&&(r.audio.processor=n),i&&typeof r.video=="object"&&(r.video.processor=i),t.audio&&typeof r.audio=="object"&&typeof r.audio.deviceId=="string"){const u=r.audio.deviceId;r.audio.deviceId={exact:u},A=!0,s=Object.assign(Object.assign({},r.audio),{deviceId:{ideal:u}})}if(r.video&&typeof r.video=="object"&&typeof r.video.deviceId=="string"){const u=r.video.deviceId;r.video.deviceId={exact:u},A=!0,o=Object.assign(Object.assign({},r.video),{deviceId:{ideal:u}})}(r.audio===!0||typeof r.audio=="object"&&!r.audio.deviceId)&&(r.audio={deviceId:"default"}),r.video===!0?r.video={deviceId:"default"}:typeof r.video=="object"&&!r.video.deviceId&&(r.video.deviceId="default");const a=Ml(r,eu,Au),c=Js(a),l=navigator.mediaDevices.getUserMedia(c);r.audio&&(Ce.userMediaPromiseMap.set("audioinput",l),l.catch(()=>Ce.userMediaPromiseMap.delete("audioinput"))),r.video&&(Ce.userMediaPromiseMap.set("videoinput",l),l.catch(()=>Ce.userMediaPromiseMap.delete("videoinput")));try{const u=yield l;return yield Promise.all(u.getTracks().map(d=>m(this,void 0,void 0,function*(){const h=d.kind==="audio";let g=h?a.audio:a.video;(typeof g=="boolean"||!g)&&(g={});let f;const p=h?c.audio:c.video;typeof p!="boolean"&&(f=p);const B=d.getSettings().deviceId;f!=null&&f.deviceId&&WA(f.deviceId)!==B?f.deviceId=B:f||(f={deviceId:B});const y=$p(d,f,e);return y.kind===E.Kind.Video?y.source=E.Source.Camera:y.kind===E.Kind.Audio&&(y.source=E.Source.Microphone),y.mediaStream=u,kA(y)&&n?yield y.setProcessor(n):Xt(y)&&i&&(yield y.setProcessor(i)),y})))}catch(u){if(!A)throw u;return Hi(Object.assign(Object.assign({},t),{audio:s,video:o}),e)}})}function vm(t){return m(this,void 0,void 0,function*(){return(yield Hi({audio:!1,video:t??!0}))[0]})}function Cm(t){return m(this,void 0,void 0,function*(){return(yield Hi({audio:t??!0,video:!1}))[0]})}var $A;(function(t){t.Excellent="excellent",t.Good="good",t.Poor="poor",t.Lost="lost",t.Unknown="unknown"})($A||($A={}));function wm(t){switch(t){case Bn.EXCELLENT:return $A.Excellent;case Bn.GOOD:return $A.Good;case Bn.POOR:return $A.Poor;case Bn.LOST:return $A.Lost;default:return $A.Unknown}}class gu extends mA.EventEmitter{get logContext(){var e,A;return Object.assign({},(A=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||A===void 0?void 0:A.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===pi.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Mt.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,A,n,i,r,s){let o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:pi.STANDARD;var a;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=$A.Unknown,this.log=K,this.log=TA((a=s==null?void 0:s.loggerName)!==null&&a!==void 0?a:sA.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=e,this.identity=A,this.name=n,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=o,this._attributes=r??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,A]of this.trackPublications)if(A.source===e)return A}getTrackPublicationByName(e){for(const[,A]of this.trackPublications)if(A.trackName===e)return A}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new Ks,this.once(x.Active,()=>{var e,A;(A=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||A===void 0||A.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const A=this.getTrackPublication(E.Source.Camera);return!(!((e=A==null?void 0:A.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const A=this.getTrackPublication(E.Source.Microphone);return!(!((e=A==null?void 0:A.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(E.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var A;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Mt.ACTIVE&&((A=this.participantInfo)===null||A===void 0?void 0:A.state)!==Mt.ACTIVE&&this.emit(x.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const A=this.metadata!==e,n=this.metadata;this.metadata=e,A&&this.emit(x.ParticipantMetadataChanged,n)}_setName(e){const A=this.name!==e;this.name=e,A&&this.emit(x.ParticipantNameChanged,e)}_setAttributes(e){const A=Fp(this.attributes,e);this._attributes=e,Object.keys(A).length>0&&this.emit(x.AttributesChanged,A)}setPermissions(e){var A,n,i,r,s,o;const a=this.permissions,c=e.canPublish!==((A=this.permissions)===null||A===void 0?void 0:A.canPublish)||e.canSubscribe!==((n=this.permissions)===null||n===void 0?void 0:n.canSubscribe)||e.canPublishData!==((i=this.permissions)===null||i===void 0?void 0:i.canPublishData)||e.hidden!==((r=this.permissions)===null||r===void 0?void 0:r.hidden)||e.recorder!==((s=this.permissions)===null||s===void 0?void 0:s.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((l,u)=>{var d;return l!==((d=this.permissions)===null||d===void 0?void 0:d.canPublishSources[u])})||e.canSubscribeMetrics!==((o=this.permissions)===null||o===void 0?void 0:o.canSubscribeMetrics);return this.permissions=e,c&&this.emit(x.ParticipantPermissionsChanged,a),c}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(x.IsSpeakingChanged,e))}setConnectionQuality(e){const A=this._connectionQuality;this._connectionQuality=wm(e),A!==this._connectionQuality&&this.emit(x.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,A;this.activeFuture&&((A=(e=this.activeFuture).reject)===null||A===void 0||A.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(A=>kA(A.track)&&A.track.setAudioContext(e))}addTrackPublication(e){e.on(k.Muted,()=>{this.emit(x.TrackMuted,e)}),e.on(k.Unmuted,()=>{this.emit(x.TrackUnmuted,e)});const A=e;switch(A.track&&(A.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case E.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case E.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function ym(t){var e,A,n;if(!t.participantSid&&!t.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new xc({participantIdentity:(e=t.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(A=t.participantSid)!==null&&A!==void 0?A:"",allTracks:(n=t.allowAll)!==null&&n!==void 0?n:!1,trackSids:t.allowedTrackSids||[]})}const pu=15e3;class bm extends gu{constructor(e,A,n,i,r){super(e,A,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=je.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ks)},this.handleReconnected=()=>{var s,o;(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.resolve)===null||o===void 0||o.call(s),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var s,o;this.reconnectFuture&&(this.reconnectFuture.promise.catch(a=>this.log.warn(a.message,this.logContext)),(o=(s=this.reconnectFuture)===null||s===void 0?void 0:s.reject)===null||o===void 0||o.call(s,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=s=>{const{requestId:o,reason:a,message:c}=s,l=this.pendingSignalRequests.get(o);l&&(a!==ps.OK&&l.reject(new Tl(c,a)),this.pendingSignalRequests.delete(o))},this.handleDataPacket=s=>{switch(s.value.case){case"rpcResponse":let o=s.value.value,a=null,c=null;o.value.case==="payload"?a=o.value.value:o.value.case==="error"&&(c=le.fromProto(o.value.value)),this.handleIncomingRpcResponse(o.requestId,a,c);break;case"rpcAck":let l=s.value.value;this.handleIncomingRpcAck(l.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(s=>ym(s)))},this.onTrackUnmuted=s=>{this.onTrackMuted(s,s.isUpstreamPaused)},this.onTrackMuted=(s,o)=>{if(o===void 0&&(o=!0),!s.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),X(s)));return}this.engine.updateMuteStatus(s.sid,o)},this.onTrackUpstreamPaused=s=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),X(s))),this.onTrackMuted(s,!0)},this.onTrackUpstreamResumed=s=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),X(s))),this.onTrackMuted(s,s.isMuted)},this.onTrackFeatureUpdate=s=>{const o=this.audioTrackPublications.get(s.sid);if(!o){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(s.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(o.trackSid,o.getTrackFeatures())},this.handleSubscribedQualityUpdate=s=>m(this,void 0,void 0,function*(){var o,a,c,l,u,d;if(!(!((u=this.roomOptions)===null||u===void 0)&&u.dynacast))return;const h=this.videoTrackPublications.get(s.trackSid);if(!h){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}if(s.subscribedCodecs.length>0){if(!h.videoTrack)return;const B=yield h.videoTrack.setPublishingCodecs(s.subscribedCodecs);try{for(var g=!0,f=NA(B),p;p=yield f.next(),o=p.done,!o;g=!0){l=p.value,g=!1;const y=l;op(y)&&(this.log.debug("publish ".concat(y," for ").concat(h.videoTrack.sid),Object.assign(Object.assign({},this.logContext),X(h))),yield this.publishAdditionalCodecForTrack(h.videoTrack,y,h.options))}}catch(y){a={error:y}}finally{try{!g&&!o&&(c=f.return)&&(yield c.call(f))}finally{if(a)throw a.error}}}else s.subscribedQualities.length>0&&(yield(d=h.videoTrack)===null||d===void 0?void 0:d.setPublishingLayers(s.subscribedQualities))}),this.handleLocalTrackUnpublished=s=>{const o=this.trackPublications.get(s.trackSid);if(!o){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:s.trackSid}));return}this.unpublishTrack(o.track)},this.handleTrackEnded=s=>m(this,void 0,void 0,function*(){if(s.source===E.Source.ScreenShare||s.source===E.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),X(s))),this.unpublishTrack(s);else if(s.isUserProvided)yield s.mute();else if(yt(s)||JA(s))try{if(Me())try{const o=yield navigator==null?void 0:navigator.permissions.query({name:s.source===E.Source.Camera?"camera":"microphone"});if(o&&o.state==="denied")throw this.log.warn("user has revoked access to ".concat(s.source),Object.assign(Object.assign({},this.logContext),X(s))),o.onchange=()=>{o.state!=="denied"&&(s.isMuted||s.restartTrack(),o.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}s.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),X(s))),yt(s)?yield s.restartTrack({deviceId:"default"}):yield s.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),X(s))),yield s.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=n,this.roomOptions=i,this.setupEngine(n),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=r}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==je.NONE}getTrackPublication(e){const A=super.getTrackPublication(e);if(A)return A}getTrackPublicationByName(e){const A=super.getTrackPublicationByName(e);if(A)return A}setupEngine(e){this.engine=e,this.engine.on(I.RemoteMute,(A,n)=>{const i=this.trackPublications.get(A);!i||!i.track||(n?i.mute():i.unmute())}),this.engine.on(I.Connected,this.handleReconnected).on(I.SignalRestarted,this.handleReconnected).on(I.SignalResumed,this.handleReconnected).on(I.Restarting,this.handleReconnecting).on(I.Resuming,this.handleReconnecting).on(I.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(I.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(I.Disconnected,this.handleDisconnected).on(I.SignalRequestResponse,this.handleSignalRequestResponse).on(I.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return m(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return m(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return m(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return m(this,arguments,void 0,function(A){var n=this;let{metadata:i,name:r,attributes:s}=A;return function*(){return new Promise((o,a)=>m(n,void 0,void 0,function*(){var c,l;try{let u=!1;const d=yield this.engine.client.sendUpdateLocalMetadata((c=i??this.metadata)!==null&&c!==void 0?c:"",(l=r??this.name)!==null&&l!==void 0?l:"",s),h=performance.now();for(this.pendingSignalRequests.set(d,{resolve:o,reject:g=>{a(g),u=!0},values:{name:r,metadata:i,attributes:s}});performance.now()-h<5e3&&!u;){if((!r||this.name===r)&&(!i||this.metadata===i)&&(!s||Object.entries(s).every(g=>{let[f,p]=g;return this.attributes[f]===p||p===""&&!this.attributes[f]}))){this.pendingSignalRequests.delete(d),o();return}yield Oe(50)}a(new Tl("Request to update local metadata timed out","TimeoutError"))}catch(u){u instanceof Error&&a(u)}}))}()})}setCameraEnabled(e,A,n){return this.setTrackEnabled(E.Source.Camera,e,A,n)}setMicrophoneEnabled(e,A,n){return this.setTrackEnabled(E.Source.Microphone,e,A,n)}setScreenShareEnabled(e,A,n){return this.setTrackEnabled(E.Source.ScreenShare,e,A,n)}setPermissions(e){const A=this.permissions,n=super.setPermissions(e);return n&&A&&this.emit(x.ParticipantPermissionsChanged,A),n}setE2EEEnabled(e){return m(this,void 0,void 0,function*(){this.encryptionType=e?je.GCM:je.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,A,n,i){return m(this,void 0,void 0,function*(){var r,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:A})),this.republishPromise&&(yield this.republishPromise);let o=this.getTrackPublication(e);if(A)if(o)yield o.unmute();else{let a;if(this.pendingPublishing.has(e)){const c=yield this.waitForPendingPublicationOfSource(e);return c||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield c==null?void 0:c.unmute(),c}this.pendingPublishing.add(e);try{switch(e){case E.Source.Camera:a=yield this.createTracks({video:(r=n)!==null&&r!==void 0?r:!0});break;case E.Source.Microphone:a=yield this.createTracks({audio:(s=n)!==null&&s!==void 0?s:!0});break;case E.Source.ScreenShare:a=yield this.createScreenTracks(Object.assign({},n));break;default:throw new FA(e)}}catch(c){throw a==null||a.forEach(l=>{l.stop()}),c instanceof Error&&this.emit(x.MediaDevicesError,c),this.pendingPublishing.delete(e),c}try{const c=[];for(const u of a)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),X(u))),c.push(this.publishTrack(u,i));[o]=yield Promise.all(c)}catch(c){throw a==null||a.forEach(l=>{l.stop()}),c}finally{this.pendingPublishing.delete(e)}}else if(!(o!=null&&o.track)&&this.pendingPublishing.has(e)&&(o=yield this.waitForPendingPublicationOfSource(e),o||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),o&&o.track)if(e===E.Source.ScreenShare){o=yield this.unpublishTrack(o.track);const a=this.getTrackPublication(E.Source.ScreenShareAudio);a&&a.track&&this.unpublishTrack(a.track)}else yield o.mute();return o})}enableCameraAndMicrophone(){return m(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(E.Source.Camera)||this.pendingPublishing.has(E.Source.Microphone))){this.pendingPublishing.add(E.Source.Camera),this.pendingPublishing.add(E.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(A=>this.publishTrack(A)))}finally{this.pendingPublishing.delete(E.Source.Camera),this.pendingPublishing.delete(E.Source.Microphone)}}})}createTracks(e){return m(this,void 0,void 0,function*(){var A,n;e??(e={});const i=Ml(e,(A=this.roomOptions)===null||A===void 0?void 0:A.audioCaptureDefaults,(n=this.roomOptions)===null||n===void 0?void 0:n.videoCaptureDefaults);try{return(yield Hi(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(o=>(kA(o)&&(this.microphoneError=void 0,o.setAudioContext(this.audioContext),o.source=E.Source.Microphone,this.emit(x.AudioStreamAcquired)),Xt(o)&&(this.cameraError=void 0,o.source=E.Source.Camera),o))}catch(r){throw r instanceof Error&&(e.audio&&(this.microphoneError=r),e.video&&(this.cameraError=r)),r}})}createScreenTracks(e){return m(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new Ss("getDisplayMedia not supported");e.resolution===void 0&&!hp()&&(e.resolution=Ps.h1080fps30.resolution);const A=Ep(e),n=yield navigator.mediaDevices.getDisplayMedia(A),i=n.getVideoTracks();if(i.length===0)throw new FA("no video track found");const r=new _i(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});r.source=E.Source.ScreenShare,e.contentHint&&(r.mediaStreamTrack.contentHint=e.contentHint);const s=[r];if(n.getAudioTracks().length>0){this.emit(x.AudioStreamAcquired);const o=new Li(n.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});o.source=E.Source.ScreenShareAudio,s.push(o)}return s})}publishTrack(e,A){return m(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,A)})}publishOrRepublishTrack(e,A){return m(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var o,a,c,l;yt(n)&&n.setAudioContext(r.audioContext),yield(o=r.reconnectFuture)===null||o===void 0?void 0:o.promise,r.republishPromise&&!s&&(yield r.republishPromise),Jt(n)&&r.pendingPublishPromises.has(n)&&(yield r.pendingPublishPromises.get(n));let u;if(n instanceof MediaStreamTrack)u=n.getConstraints();else{u=n.constraints;let B;switch(n.source){case E.Source.Microphone:B="audioinput";break;case E.Source.Camera:B="videoinput"}B&&r.activeDeviceMap.has(B)&&(u=Object.assign(Object.assign({},u),{deviceId:r.activeDeviceMap.get(B)}))}if(n instanceof MediaStreamTrack)switch(n.kind){case"audio":n=new Li(n,u,!0,r.audioContext,{loggerName:r.roomOptions.loggerName,loggerContextCb:()=>r.logContext});break;case"video":n=new _i(n,u,!0,{loggerName:r.roomOptions.loggerName,loggerContextCb:()=>r.logContext});break;default:throw new FA("unsupported MediaStreamTrack kind ".concat(n.kind))}else n.updateLoggerOptions({loggerName:r.roomOptions.loggerName,loggerContextCb:()=>r.logContext});let d;if(r.trackPublications.forEach(B=>{B.track&&B.track===n&&(d=B)}),d)return r.log.warn("track has already been published, skipping",Object.assign(Object.assign({},r.logContext),X(d))),d;const h="channelCount"in n.mediaStreamTrack.getSettings()&&n.mediaStreamTrack.getSettings().channelCount===2||n.mediaStreamTrack.getConstraints().channelCount===2,g=(a=i==null?void 0:i.forceStereo)!==null&&a!==void 0?a:h;g&&(i||(i={}),i.dtx===void 0&&r.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},r.logContext),X(n))),i.red===void 0&&r.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(c=i.dtx)!==null&&c!==void 0||(i.dtx=!1),(l=i.red)!==null&&l!==void 0||(i.red=!1));const f=Object.assign(Object.assign({},r.roomOptions.publishDefaults),i);!fp()&&r.roomOptions.e2ee&&(r.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},r.logContext)),f.simulcast=!1),f.source&&(n.source=f.source);const p=new Promise((B,y)=>m(r,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Ae.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:X(n)}));const b=()=>m(this,void 0,void 0,function*(){try{const v=yield this.publish(n,f,g);B(v)}catch(v){y(v)}});setTimeout(()=>{this.engine.off(I.SignalConnected,b),y(new Fs("publishing rejected as engine not connected within timeout",408))},15e3),this.engine.once(I.SignalConnected,b),this.engine.on(I.Closing,()=>{this.engine.off(I.SignalConnected,b),y(new Fs("publishing rejected as engine closed",499))})}else try{const b=yield this.publish(n,f,g);B(b)}catch(b){y(b)}}catch(b){y(b)}}));r.pendingPublishPromises.set(n,p);try{return yield p}catch(B){throw B}finally{r.pendingPublishPromises.delete(n)}}()})}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),X(e))),!1;const{canPublish:A,canPublishSources:n}=this.permissions;return A&&(n.length===0||n.map(i=>kp(i)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),X(e))),!1)}publish(e,A,n){return m(this,void 0,void 0,function*(){var i,r,s,o,a,c,l,u,d,h;if(!this.hasPermissionsToPublish(e))throw new Fs("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(C=>Jt(e)&&C.source===e.source)&&e.source!==E.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),X(e))),A.stopMicTrackOnMute&&kA(e)&&(e.stopOnMute=!0),e.source===E.Source.ScreenShare&&Wt()&&(A.simulcast=!1),A.videoCodec==="av1"&&!lp()&&(A.videoCodec=void 0),A.videoCodec==="vp9"&&!up()&&(A.videoCodec=void 0),A.videoCodec===void 0&&(A.videoCodec=Ao),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(C=>A.videoCodec===Ri(C.mime))||(A.videoCodec=Ri(this.enabledPublishVideoCodecs[0].mime)));const f=A.videoCodec;e.on(k.Muted,this.onTrackMuted),e.on(k.Unmuted,this.onTrackUnmuted),e.on(k.Ended,this.handleTrackEnded),e.on(k.UpstreamPaused,this.onTrackUpstreamPaused),e.on(k.UpstreamResumed,this.onTrackUpstreamResumed),e.on(k.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const p=new us({cid:e.mediaStreamTrack.id,name:A.name,type:E.kindToProto(e.kind),muted:e.isMuted,source:E.sourceToProto(e.source),disableDtx:!(!((i=A.dtx)!==null&&i!==void 0)||i),encryption:this.encryptionType,stereo:n,disableRed:this.isE2EEEnabled||!(!((r=A.red)!==null&&r!==void 0)||r),stream:A==null?void 0:A.stream,backupCodecPolicy:A==null?void 0:A.backupCodecPolicy});let B;if(e.kind===E.Kind.Video){let C={width:0,height:0};try{C=yield e.waitForDimensions()}catch{const Q=(o=(s=this.roomOptions.videoCaptureDefaults)===null||s===void 0?void 0:s.resolution)!==null&&o!==void 0?o:yn.h720.resolution;C={width:Q.width,height:Q.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),X(e)),{dims:C}))}p.width=C.width,p.height=C.height,JA(e)&&(bn(f)&&(e.source===E.Source.ScreenShare&&(A.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),X(e))))),A.scalabilityMode=(a=A.scalabilityMode)!==null&&a!==void 0?a:"L3T3_KEY"),p.simulcastCodecs=[new ls({codec:f,cid:e.mediaStreamTrack.id})],A.backupCodec===!0&&(A.backupCodec={codec:Ao}),A.backupCodec&&f!==A.backupCodec.codec&&p.encryption===je.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),p.simulcastCodecs.push(new ls({codec:A.backupCodec.codec,cid:""})))),B=so(e.source===E.Source.ScreenShare,p.width,p.height,A),p.layers=cu(p.width,p.height,B,bn(A.videoCodec))}else e.kind===E.Kind.Audio&&(B=[{maxBitrate:(c=A.audioPreset)===null||c===void 0?void 0:c.maxBitrate,priority:(u=(l=A.audioPreset)===null||l===void 0?void 0:l.priority)!==null&&u!==void 0?u:"high",networkPriority:(h=(d=A.audioPreset)===null||d===void 0?void 0:d.priority)!==null&&h!==void 0?h:"high"}]);if(!this.engine||this.engine.isClosed)throw new Be("cannot publish track when not connected");const y=()=>m(this,void 0,void 0,function*(){var C,w,Q;if(!this.engine.pcManager)throw new Be("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,A,B),JA(e)&&((C=A.degradationPreference)!==null&&C!==void 0||(A.degradationPreference=rm(e)),e.setDegradationPreference(A.degradationPreference)),B)if(Wt()&&e.kind===E.Kind.Audio){let F;for(const R of this.engine.pcManager.publisher.getTransceivers())if(R.sender===e.sender){F=R;break}F&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:F,codec:"opus",maxbr:!((w=B[0])===null||w===void 0)&&w.maxBitrate?B[0].maxBitrate/1e3:0})}else e.codec&&bn(e.codec)&&(!((Q=B[0])===null||Q===void 0)&&Q.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:p.cid,codec:e.codec,maxbr:B[0].maxBitrate/1e3});yield this.engine.negotiate()});let b;if(this.enabledPublishVideoCodecs.length>0)b=(yield Promise.all([this.engine.addTrack(p),y()]))[0];else{b=yield this.engine.addTrack(p);let C;if(b.codecs.forEach(w=>{C===void 0&&(C=w.mimeType)}),C&&e.kind===E.Kind.Video){const w=Ri(C);w!==f&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),X(e)),{codec:w})),A.videoCodec=w,B=so(e.source===E.Source.ScreenShare,p.width,p.height,A))}yield y()}const v=new ho(e.kind,b,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return v.options=A,e.sid=b.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:B,trackInfo:b})),JA(e)?e.startMonitor(this.engine.client):yt(e)&&e.startMonitor(),this.addTrackPublication(v),this.emit(x.LocalTrackPublished,v),v})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,A,n){return m(this,void 0,void 0,function*(){var i;if(this.encryptionType!==je.NONE)return;let r;if(this.trackPublications.forEach(h=>{h.track&&h.track===e&&(r=h)}),!r)throw new FA("track is not published");if(!JA(e))throw new FA("track is not a video track");const s=Object.assign(Object.assign({},(i=this.roomOptions)===null||i===void 0?void 0:i.publishDefaults),n),o=tm(e,A,s);if(!o){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),X(e)));return}const a=e.addSimulcastTrack(A,o);if(!a)return;const c=new us({cid:a.mediaStreamTrack.id,type:E.kindToProto(e.kind),muted:e.isMuted,source:E.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:s.videoCodec,cid:a.mediaStreamTrack.id}]});if(c.layers=cu(c.width,c.height,o),!this.engine||this.engine.isClosed)throw new Be("cannot publish track when not connected");const l=()=>m(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,a,s,o),yield this.engine.negotiate()}),d=(yield Promise.all([this.engine.addTrack(c),l()]))[0];this.log.debug("published ".concat(A," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:o,trackInfo:d}))})}unpublishTrack(e,A){return m(this,void 0,void 0,function*(){var n,i;if(Jt(e)){const c=this.pendingPublishPromises.get(e);c&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),X(e))),yield c)}const r=this.getPublicationForTrack(e),s=r?X(r):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!r||!r.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));return}e=r.track,e.off(k.Muted,this.onTrackMuted),e.off(k.Unmuted,this.onTrackUnmuted),e.off(k.Ended,this.handleTrackEnded),e.off(k.UpstreamPaused,this.onTrackUpstreamPaused),e.off(k.UpstreamResumed,this.onTrackUpstreamResumed),e.off(k.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),A===void 0&&(A=(i=(n=this.roomOptions)===null||n===void 0?void 0:n.stopLocalTrackOnUnpublish)!==null&&i!==void 0?i:!0),A?e.stop():e.stopMonitor();let o=!1;const a=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<ce.FAILED&&a)try{for(const c of this.engine.pcManager.publisher.getTransceivers())c.sender===a&&(c.direction="inactive",o=!0);if(this.engine.removeTrack(a)&&(o=!0),JA(e)){for(const[,c]of e.simulcastCodecs)c.sender&&(this.engine.removeTrack(c.sender)&&(o=!0),c.sender=void 0);e.simulcastCodecs.clear()}}catch(c){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:c}))}switch(this.trackPublications.delete(r.trackSid),r.kind){case E.Kind.Audio:this.audioTrackPublications.delete(r.trackSid);break;case E.Kind.Video:this.videoTrackPublications.delete(r.trackSid);break}return this.emit(x.LocalTrackUnpublished,r),r.setTrack(void 0),o&&(yield this.engine.negotiate()),r})}unpublishTracks(e){return m(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>this.unpublishTrack(n)))).filter(n=>!!n)})}republishAllTracks(e){return m(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){n.republishPromise&&(yield n.republishPromise),n.republishPromise=new Promise((r,s)=>m(n,void 0,void 0,function*(){try{const o=[];this.trackPublications.forEach(a=>{a.track&&(A&&(a.options=Object.assign(Object.assign({},a.options),A)),o.push(a))}),yield Promise.all(o.map(a=>m(this,void 0,void 0,function*(){const c=a.track;yield this.unpublishTrack(c,!1),i&&!c.isMuted&&c.source!==E.Source.ScreenShare&&c.source!==E.Source.ScreenShareAudio&&(yt(c)||JA(c))&&!c.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:a.trackSid})),yield c.restartTrack()),yield this.publishOrRepublishTrack(c,a.options,!0)}))),r()}catch(o){s(o)}finally{this.republishPromise=void 0}})),yield n.republishPromise}()})}publishData(e){return m(this,arguments,void 0,function(A){var n=this;let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const r=i.reliable?W.RELIABLE:W.LOSSY,s=i.destinationIdentities,o=i.topic,a=new He({kind:r,value:{case:"user",value:new hc({participantIdentity:n.identity,payload:A,destinationIdentities:s,topic:o})}});yield n.engine.sendDataPacket(a,r)}()})}publishDtmf(e,A){return m(this,void 0,void 0,function*(){const n=new He({kind:W.RELIABLE,value:{case:"sipDtmf",value:new fc({code:e,digit:A})}});yield this.engine.sendDataPacket(n,W.RELIABLE)})}sendChatMessage(e,A){return m(this,void 0,void 0,function*(){const n={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:A==null?void 0:A.attachments},i=new He({value:{case:"chatMessage",value:new is(Object.assign(Object.assign({},n),{timestamp:re.parse(n.timestamp)}))}});return yield this.engine.sendDataPacket(i,W.RELIABLE),this.emit(x.ChatMessage,n),n})}editChatMessage(e,A){return m(this,void 0,void 0,function*(){const n=Object.assign(Object.assign({},A),{message:e,editTimestamp:Date.now()}),i=new He({value:{case:"chatMessage",value:new is(Object.assign(Object.assign({},n),{timestamp:re.parse(n.timestamp),editTimestamp:re.parse(n.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,W.RELIABLE),this.emit(x.ChatMessage,n),n})}sendText(e,A){return m(this,void 0,void 0,function*(){var n;const i=crypto.randomUUID(),s=new TextEncoder().encode(e).byteLength,o=(n=A==null?void 0:A.attachments)===null||n===void 0?void 0:n.map(()=>crypto.randomUUID()),a=new Array(o?o.length+1:1).fill(0),c=(u,d)=>{var h;a[d]=u;const g=a.reduce((f,p)=>f+p,0);(h=A==null?void 0:A.onProgress)===null||h===void 0||h.call(A,g)},l=yield this.streamText({streamId:i,totalSize:s,destinationIdentities:A==null?void 0:A.destinationIdentities,topic:A==null?void 0:A.topic,attachedStreamIds:o,attributes:A==null?void 0:A.attributes});return yield l.write(e),c(1,0),yield l.close(),A!=null&&A.attachments&&o&&(yield Promise.all(A.attachments.map((u,d)=>m(this,void 0,void 0,function*(){return this._sendFile(o[d],u,{topic:A.topic,mimeType:u.type,onProgress:h=>{c(h,d+1)}})})))),l.info})}streamText(e){return m(this,void 0,void 0,function*(){var A,n;const i=(A=e==null?void 0:e.streamId)!==null&&A!==void 0?A:crypto.randomUUID(),r={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:(n=e==null?void 0:e.topic)!==null&&n!==void 0?n:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},s=new ss({streamId:i,mimeType:r.mimeType,topic:r.topic,timestamp:wt(r.timestamp),totalLength:wt(e==null?void 0:e.totalSize),attributes:r.attributes,contentHeader:{case:"textHeader",value:new Qc({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?rs.UPDATE:rs.CREATE})}}),o=e==null?void 0:e.destinationIdentities,a=new He({destinationIdentities:o,value:{case:"streamHeader",value:s}});yield this.engine.sendDataPacket(a,W.RELIABLE);let c=0;const l=this,u=new WritableStream({write(g){return m(this,void 0,void 0,function*(){for(const f of Up(g,pu)){yield l.engine.waitForBufferStatusLow(W.RELIABLE);const p=new os({content:f,streamId:i,chunkIndex:wt(c)}),B=new He({destinationIdentities:o,value:{case:"streamChunk",value:p}});yield l.engine.sendDataPacket(B,W.RELIABLE),c+=1}})},close(){return m(this,void 0,void 0,function*(){const g=new as({streamId:i}),f=new He({destinationIdentities:o,value:{case:"streamTrailer",value:g}});yield l.engine.sendDataPacket(f,W.RELIABLE)})},abort(g){console.log("Sink error:",g)}});let d=()=>m(this,void 0,void 0,function*(){yield h.close()});l.engine.once(I.Closing,d);const h=new fm(u,r,()=>this.engine.off(I.Closing,d));return h})}sendFile(e,A){return m(this,void 0,void 0,function*(){const n=crypto.randomUUID();return yield this._sendFile(n,e,A),{id:n}})}_sendFile(e,A,n){return m(this,void 0,void 0,function*(){var i;const r=yield this.streamBytes({streamId:e,totalSize:A.size,name:A.name,mimeType:(i=n==null?void 0:n.mimeType)!==null&&i!==void 0?i:A.type,topic:n==null?void 0:n.topic,destinationIdentities:n==null?void 0:n.destinationIdentities}),s=A.stream().getReader();for(;;){const{done:o,value:a}=yield s.read();if(o)break;yield r.write(a)}return yield r.close(),r.info})}streamBytes(e){return m(this,void 0,void 0,function*(){var A,n,i,r,s;const o=(A=e==null?void 0:e.streamId)!==null&&A!==void 0?A:crypto.randomUUID(),a=e==null?void 0:e.destinationIdentities,c={id:o,mimeType:(n=e==null?void 0:e.mimeType)!==null&&n!==void 0?n:"application/octet-stream",topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(r=e==null?void 0:e.name)!==null&&r!==void 0?r:"unknown"},l=new ss({totalLength:wt((s=c.size)!==null&&s!==void 0?s:0),mimeType:c.mimeType,streamId:o,topic:c.topic,timestamp:wt(Date.now()),attributes:c.attributes,contentHeader:{case:"byteHeader",value:new Ec({name:c.name})}}),u=new He({destinationIdentities:a,value:{case:"streamHeader",value:l}});yield this.engine.sendDataPacket(u,W.RELIABLE);let d=0;const h=new De,g=this.engine,f=this.log,p=new WritableStream({write(y){return m(this,void 0,void 0,function*(){const b=yield h.lock();let v=0;try{for(;v<y.byteLength;){const C=y.slice(v,v+pu);yield g.waitForBufferStatusLow(W.RELIABLE);const w=new He({destinationIdentities:a,value:{case:"streamChunk",value:new os({content:C,streamId:o,chunkIndex:wt(d)})}});yield g.sendDataPacket(w,W.RELIABLE),d+=1,v+=C.byteLength}}finally{b()}})},close(){return m(this,void 0,void 0,function*(){const y=new as({streamId:o}),b=new He({destinationIdentities:a,value:{case:"streamTrailer",value:y}});yield g.sendDataPacket(b,W.RELIABLE)})},abort(y){f.error("Sink error:",y)}});return new gm(p,c)})}performRpc(e){return m(this,arguments,void 0,function(A){var n=this;let{destinationIdentity:i,method:r,payload:s,responseTimeout:o=1e4}=A;return function*(){return new Promise((c,l)=>m(n,void 0,void 0,function*(){var u,d,h,g;if(no(s)>tu){l(le.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((d=(u=this.engine.latestJoinResponse)===null||u===void 0?void 0:u.serverInfo)===null||d===void 0)&&d.version&&Ct((g=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||g===void 0?void 0:g.version,"1.8.0")<0){l(le.builtIn("UNSUPPORTED_SERVER"));return}const f=crypto.randomUUID();yield this.publishRpcRequest(i,f,r,s,o-2e3);const p=setTimeout(()=>{this.pendingAcks.delete(f),l(le.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(f),clearTimeout(B)},2e3);this.pendingAcks.set(f,{resolve:()=>{clearTimeout(p)},participantIdentity:i});const B=setTimeout(()=>{this.pendingResponses.delete(f),l(le.builtIn("RESPONSE_TIMEOUT"))},o);this.pendingResponses.set(f,{resolve:(y,b)=>{clearTimeout(B),this.pendingAcks.has(f)&&(console.warn("RPC response received before ack",f),this.pendingAcks.delete(f),clearTimeout(p)),b?l(b):c(y??"")},participantIdentity:i})}))}()})}registerRpcMethod(e,A){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,A)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=A,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const A=this.pendingAcks.get(e);A?(A.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,A,n){const i=this.pendingResponses.get(e);i?(i.resolve(A,n),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,A,n,i,r){return m(this,void 0,void 0,function*(){const s=new He({destinationIdentities:[e],kind:W.RELIABLE,value:{case:"rpcRequest",value:new gc({id:A,method:n,payload:i,responseTimeoutMs:r,version:1})}});yield this.engine.sendDataPacket(s,W.RELIABLE)})}handleParticipantDisconnected(e){for(const[A,{participantIdentity:n}]of this.pendingAcks)n===e&&this.pendingAcks.delete(A);for(const[A,{participantIdentity:n,resolve:i}]of this.pendingResponses)n===e&&(i(null,le.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(A))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(A=>A.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(A=>{var n,i;const r=this.trackPublications.get(A.sid);if(r){const s=r.isMuted||((i=(n=r.track)===null||n===void 0?void 0:n.isUpstreamPaused)!==null&&i!==void 0?i:!1);s!==A.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),X(r)),{mutedOnServer:s})),this.engine.client.sendMuteTrack(A.sid,s))}}),!0):!1}getPublicationForTrack(e){let A;return this.trackPublications.forEach(n=>{const i=n.track;i&&(e instanceof MediaStreamTrack?(yt(i)||JA(i))&&i.mediaStreamTrack===e&&(A=n):e===i&&(A=n))}),A}waitForPendingPublicationOfSource(e){return m(this,void 0,void 0,function*(){const n=Date.now();for(;Date.now()<n+1e4;){const i=Array.from(this.pendingPublishPromises.entries()).find(r=>{let[s]=r;return s.source===e});if(i)return i[1];yield Oe(20)}})}}class Um extends IA{constructor(e,A,n,i){super(e,A.sid,A.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=$e.HIGH,this.handleEnded=r=>{this.setTrack(void 0),this.emit(k.Ended,r)},this.handleVisibilityChange=r=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(r),this.logContext),this.disabled=!r,this.emitTrackUpdate()},this.handleVideoDimensionsChange=r=>{this.log.debug("adaptivestream video dimensions ".concat(r.width,"x").concat(r.height),this.logContext),this.videoDimensions=r,this.emitTrackUpdate()},this.subscribed=n,this.updateInfo(A)}setSubscribed(e){const A=this.subscriptionStatus,n=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const i=new mi({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new vc({participantSid:"",trackSids:[this.trackSid]})]});this.emit(k.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(A),this.emitPermissionUpdateIfChanged(n)}get subscriptionStatus(){return this.subscribed===!1?IA.SubscriptionStatus.Unsubscribed:super.isSubscribed?IA.SubscriptionStatus.Subscribed:IA.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?IA.PermissionStatus.Allowed:IA.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.disabled===!e||(this.disabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.currentVideoQuality===e||(this.currentVideoQuality=e,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var A,n;this.isManualOperationAllowed()&&(((A=this.videoDimensions)===null||A===void 0?void 0:A.width)===e.width&&((n=this.videoDimensions)===null||n===void 0?void 0:n.height)===e.height||(js(this.track)&&(this.videoDimensions=e),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&js(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(e){const A=this.subscriptionStatus,n=this.permissionStatus,i=this.track;i!==e&&(i&&(i.off(k.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(k.VisibilityChanged,this.handleVisibilityChange),i.off(k.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(k.Unsubscribed,i)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on(k.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on(k.VisibilityChanged,this.handleVisibilityChange),e.on(k.Ended,this.handleEnded),this.emit(k.Subscribed,e)),this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(A))}setAllowed(e){const A=this.subscriptionStatus,n=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(n),this.emitSubscriptionUpdateIfChanged(A)}setSubscriptionError(e){this.emit(k.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const A=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):A!==e.muted&&this.emit(e.muted?k.Muted:k.Unmuted)}emitSubscriptionUpdateIfChanged(e){const A=this.subscriptionStatus;e!==A&&this.emit(k.SubscriptionStatusChanged,A,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit(k.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.kind===E.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return js(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new Tc({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(e.width=Math.ceil(this.videoDimensions.width),e.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?e.quality=this.currentVideoQuality:e.quality=$e.HIGH,this.emit(k.UpdateSettings,e)}}class Oi extends gu{static fromParticipantInfo(e,A,n){return new Oi(e,A.sid,A.identity,A.name,A.metadata,A.attributes,n,A.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,A,n,i,r,s,o){let a=arguments.length>7&&arguments[7]!==void 0?arguments[7]:pi.STANDARD;super(A,n||"",i,r,s,o,a),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on(k.UpdateSettings,A=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),X(e))),this.signalClient.sendUpdateTrackSettings(A)}),e.on(k.UpdateSubscription,A=>{A.participantTracks.forEach(n=>{n.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(A)}),e.on(k.SubscriptionPermissionChanged,A=>{this.emit(x.TrackSubscriptionPermissionChanged,e,A)}),e.on(k.SubscriptionStatusChanged,A=>{this.emit(x.TrackSubscriptionStatusChanged,e,A)}),e.on(k.Subscribed,A=>{this.emit(x.TrackSubscribed,A,e)}),e.on(k.Unsubscribed,A=>{this.emit(x.TrackUnsubscribed,A,e)}),e.on(k.SubscriptionFailed,A=>{this.emit(x.TrackSubscriptionFailed,e.trackSid,A)})}getTrackPublication(e){const A=super.getTrackPublication(e);if(A)return A}getTrackPublicationByName(e){const A=super.getTrackPublicationByName(e);if(A)return A}setVolume(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E.Source.Microphone;this.volumeMap.set(A,e);const n=this.getTrackPublication(A);n&&n.track&&n.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E.Source.Microphone;const A=this.getTrackPublication(e);return A&&A.track?A.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,A,n,i,r,s){let o=this.getTrackPublicationBySid(A);if(o||A.startsWith("TR")||this.trackPublications.forEach(l=>{!o&&e.kind===l.kind.toString()&&(o=l)}),!o){if(s===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:A})),this.emit(x.TrackSubscriptionFailed,A);return}s===void 0&&(s=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,A,n,i,r,s-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),X(o))),this.emit(x.TrackSubscriptionFailed,A);return}const a=e.kind==="video";let c;return a?c=new mm(e,A,i,r):c=new pm(e,A,i,this.audioContext,this.audioOutput),c.source=o.source,c.isMuted=o.isMuted,c.setMediaStream(n),c.start(),o.setTrack(c),this.volumeMap.has(o.source)&&Gs(c)&&kA(c)&&c.setVolume(this.volumeMap.get(o.source)),o}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const A=new Map,n=new Map;return e.tracks.forEach(i=>{var r,s;let o=this.getTrackPublicationBySid(i.sid);if(o)o.updateInfo(i);else{const a=E.kindFromProto(i.type);if(!a)return;o=new Um(a,i,(r=this.signalClient.connectOptions)===null||r===void 0?void 0:r.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(s=this.loggerOptions)===null||s===void 0?void 0:s.loggerName}),o.updateInfo(i),n.set(i.sid,o);const c=Array.from(this.trackPublications.values()).find(l=>l.source===(o==null?void 0:o.source));c&&o.source!==E.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(o.source),Object.assign(Object.assign({},this.logContext),{oldTrack:X(c),newTrack:X(o)})),this.addTrackPublication(o)}A.set(i.sid,o)}),this.trackPublications.forEach(i=>{A.has(i.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),X(i))),this.unpublishTrack(i.trackSid,!0))}),n.forEach(i=>{this.emit(x.TrackPublished,i)}),!0}unpublishTrack(e,A){const n=this.trackPublications.get(e);if(!n)return;const{track:i}=n;switch(i&&(i.stop(),n.setTrack(void 0)),this.trackPublications.delete(e),n.kind){case E.Kind.Audio:this.audioTrackPublications.delete(e);break;case E.Kind.Video:this.videoTrackPublications.delete(e);break}A&&this.emit(x.TrackUnpublished,n)}setAudioOutput(e){return m(this,void 0,void 0,function*(){this.audioOutput=e;const A=[];this.audioTrackPublications.forEach(n=>{var i;kA(n.track)&&Gs(n.track)&&A.push(n.track.setSinkId((i=e.deviceId)!==null&&i!==void 0?i:"default"))}),yield Promise.all(A)})}emit(e){for(var A=arguments.length,n=new Array(A>1?A-1:0),i=1;i<A;i++)n[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:n})),super.emit(e,...n)}}var J;(function(t){t.Disconnected="disconnected",t.Connecting="connecting",t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting"})(J||(J={}));const Qm=4*1e3;class bt extends mA.EventEmitter{constructor(e){var A,n,i,r;if(super(),A=this,this.state=J.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=K,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(s,o,a)=>m(this,void 0,void 0,function*(){var c;if(!dp())throw BA()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const l=yield this.disconnectLock.lock();if(this.state===J.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),l(),Promise.resolve();if(this.connectFuture)return l(),this.connectFuture.promise;this.setAndEmitConnectionState(J.Connecting),((c=this.regionUrlProvider)===null||c===void 0?void 0:c.getServerUrl().toString())!==s&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Hs(new URL(s))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new co(s,o):this.regionUrlProvider.updateToken(o),this.regionUrlProvider.fetchRegionSettings().then(h=>{var g;(g=this.regionUrlProvider)===null||g===void 0||g.setServerReportedRegions(h)}).catch(h=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:h}))}));const u=(h,g,f)=>m(this,void 0,void 0,function*(){var p,B;this.abortController&&this.abortController.abort();const y=new AbortController;this.abortController=y,l==null||l();try{yield this.attemptConnection(f??s,o,a,y),this.abortController=void 0,h()}catch(b){if(this.regionUrlProvider&&b instanceof z&&b.reason!==G.Cancelled&&b.reason!==G.NotAllowed){let v=null;try{v=yield this.regionUrlProvider.getNextBestRegionUrl((p=this.abortController)===null||p===void 0?void 0:p.signal)}catch(C){if(C instanceof z&&(C.status===401||C.reason===G.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),g(C);return}}v&&!(!((B=this.abortController)===null||B===void 0)&&B.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(b.message,". Retrying with another region: ").concat(v),this.logContext),this.recreateEngine(),yield u(h,g,v)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Ol(b)),g(b))}else{let v=nA.UNKNOWN_REASON;b instanceof z&&(v=Ol(b)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,v),g(b)}}}),d=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ks((h,g)=>{u(h,g,d)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(s,o,a,c,l,u)=>m(this,void 0,void 0,function*(){var d,h,g;const f=yield a.join(s,o,{autoSubscribe:c.autoSubscribe,adaptiveStream:typeof l.adaptiveStream=="object"?!0:l.adaptiveStream,maxRetries:c.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:c.websocketTimeout},u.signal);let p=f.serverInfo;if(p||(p={version:f.serverVersion,region:f.serverRegion}),this.serverInfo=p,this.log.debug("connected to Livekit Server ".concat(Object.entries(p).map(B=>{let[y,b]=B;return"".concat(y,": ").concat(b)}).join(", ")),{room:(d=f.room)===null||d===void 0?void 0:d.name,roomSid:(h=f.room)===null||h===void 0?void 0:h.sid,identity:(g=f.participant)===null||g===void 0?void 0:g.identity}),!p.version)throw new qg("unknown server version");return p.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),l.dynacast=!1),f}),this.applyJoinResponse=s=>{const o=s.participant;if(this.localParticipant.sid=o.sid,this.localParticipant.identity=o.identity,this.localParticipant.setEnabledPublishCodecs(s.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(s.sifTrailer)}catch(a){this.log.error(a instanceof Error?a.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:a}))}this.handleParticipantUpdates([o,...s.otherParticipants]),s.room&&this.handleRoomUpdate(s.room)},this.attemptConnection=(s,o,a,c)=>m(this,void 0,void 0,function*(){var l,u;this.state===J.Reconnecting||this.isResuming||!((l=this.engine)===null||l===void 0)&&l.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((u=this.regionUrlProvider)===null||u===void 0)&&u.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},to),a),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const d=yield this.connectSignal(s,o,this.engine,this.connOptions,this.options,c);this.applyJoinResponse(d),this.setupLocalParticipantEvents(),this.emit(T.SignalConnected)}catch(d){yield this.engine.close(),this.recreateEngine();const h=new z("could not establish signal connection",G.ServerUnreachable);throw d instanceof Error&&(h.message="".concat(h.message,": ").concat(d.message)),d instanceof z&&(h.reason=d.reason,h.status=d.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:d})),h}if(c.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new z("Connection attempt aborted",G.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,c)}catch(d){throw yield this.engine.close(),this.recreateEngine(),d}Me()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),Me()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(J.Connected),this.emit(T.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return m(A,[...o],void 0,function(){var c=this;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var u,d,h,g;const f=yield c.disconnectLock.lock();try{if(c.state===J.Disconnected){c.log.debug("already disconnected",c.logContext);return}c.log.info("disconnect from room",Object.assign({},c.logContext)),(c.state===J.Connecting||c.state===J.Reconnecting||c.isResuming)&&(c.log.warn("abort connection attempt",c.logContext),(u=c.abortController)===null||u===void 0||u.abort(),(h=(d=c.connectFuture)===null||d===void 0?void 0:d.reject)===null||h===void 0||h.call(d,new z("Client initiated disconnect",G.Cancelled)),c.connectFuture=void 0),!((g=c.engine)===null||g===void 0)&&g.client.isDisconnected||(yield c.engine.client.sendLeave()),c.engine&&(yield c.engine.close()),c.handleDisconnect(l,nA.CLIENT_INITIATED),c.engine=void 0}finally{f()}}()})},this.onPageLeave=()=>m(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>m(this,void 0,void 0,function*(){const s=[],o=oA();if(o&&o.os==="iOS"){const a="livekit-dummy-audio-el";let c=document.getElementById(a);if(!c){c=document.createElement("audio"),c.id=a,c.autoplay=!0,c.hidden=!0;const l=Ns();l.enabled=!0;const u=new MediaStream([l]);c.srcObject=u,document.addEventListener("visibilitychange",()=>{c&&(c.srcObject=document.hidden?null:u,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(c),this.once(T.Disconnected,()=>{c==null||c.remove(),c=null})}s.push(c)}this.remoteParticipants.forEach(a=>{a.audioTrackPublications.forEach(c=>{c.track&&c.track.attachedElements.forEach(l=>{s.push(l)})})});try{yield Promise.all([this.acquireAudioContext(),...s.map(a=>(a.muted=!1,a.play()))]),this.handleAudioPlaybackStarted()}catch(a){throw this.handleAudioPlaybackFailed(a),a}}),this.startVideo=()=>m(this,void 0,void 0,function*(){const s=[];for(const o of this.remoteParticipants.values())o.videoTrackPublications.forEach(a=>{var c;(c=a.track)===null||c===void 0||c.attachedElements.forEach(l=>{s.includes(l)||s.push(l)})});yield Promise.all(s.map(o=>o.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(o=>{o.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const s of this.remoteParticipants.values())this.handleParticipantDisconnected(s.identity,s);this.setAndEmitConnectionState(J.Reconnecting)&&this.emit(T.Reconnecting)},this.handleSignalRestarted=s=>m(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(s.serverRegion),Object.assign(Object.assign({},this.logContext),{region:s.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(s);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(o){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:o}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:s.serverRegion}))}catch{return}this.setAndEmitConnectionState(J.Connected),this.emit(T.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=s=>{s.forEach(o=>{var a;if(o.identity===this.localParticipant.identity){this.localParticipant.updateInfo(o);return}o.identity===""&&(o.identity=(a=this.sidToIdentity.get(o.sid))!==null&&a!==void 0?a:"");let c=this.remoteParticipants.get(o.identity);o.state===Mt.DISCONNECTED?this.handleParticipantDisconnected(o.identity,c):c=this.getOrCreateParticipant(o.identity,o)})},this.handleActiveSpeakersUpdate=s=>{const o=[],a={};s.forEach(c=>{if(a[c.sid]=!0,c.sid===this.localParticipant.sid)this.localParticipant.audioLevel=c.level,this.localParticipant.setIsSpeaking(!0),o.push(this.localParticipant);else{const l=this.getRemoteParticipantBySid(c.sid);l&&(l.audioLevel=c.level,l.setIsSpeaking(!0),o.push(l))}}),a[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(c=>{a[c.sid]||(c.audioLevel=0,c.setIsSpeaking(!1))}),this.activeSpeakers=o,this.emitWhenConnected(T.ActiveSpeakersChanged,o)},this.handleSpeakersChanged=s=>{const o=new Map;this.activeSpeakers.forEach(c=>{const l=this.remoteParticipants.get(c.identity);l&&l.sid!==c.sid||o.set(c.sid,c)}),s.forEach(c=>{let l=this.getRemoteParticipantBySid(c.sid);c.sid===this.localParticipant.sid&&(l=this.localParticipant),l&&(l.audioLevel=c.level,l.setIsSpeaking(c.active),c.active?o.set(c.sid,l):o.delete(c.sid))});const a=Array.from(o.values());a.sort((c,l)=>l.audioLevel-c.audioLevel),this.activeSpeakers=a,this.emitWhenConnected(T.ActiveSpeakersChanged,a)},this.handleStreamStateUpdate=s=>{s.streamStates.forEach(o=>{const a=this.getRemoteParticipantBySid(o.participantSid);if(!a)return;const c=a.getTrackPublicationBySid(o.trackSid);if(!c||!c.track)return;const l=E.streamStateFromProto(o.state);l!==c.track.streamState&&(c.track.streamState=l,a.emit(x.TrackStreamStateChanged,c,c.track.streamState),this.emitWhenConnected(T.TrackStreamStateChanged,c,c.track.streamState,a))})},this.handleSubscriptionPermissionUpdate=s=>{const o=this.getRemoteParticipantBySid(s.participantSid);if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setAllowed(s.allowed)},this.handleSubscriptionError=s=>{const o=Array.from(this.remoteParticipants.values()).find(c=>c.trackPublications.has(s.trackSid));if(!o)return;const a=o.getTrackPublicationBySid(s.trackSid);a&&a.setSubscriptionError(s.err)},this.handleDataPacket=s=>{const o=this.remoteParticipants.get(s.participantIdentity);if(s.value.case==="user")this.handleUserPacket(o,s.value.value,s.kind);else if(s.value.case==="transcription")this.handleTranscription(o,s.value.value);else if(s.value.case==="sipDtmf")this.handleSipDtmf(o,s.value.value);else if(s.value.case==="chatMessage")this.handleChatMessage(o,s.value.value);else if(s.value.case==="metrics")this.handleMetrics(s.value.value,o);else if(s.value.case==="streamHeader")this.handleStreamHeader(s.value.value,s.participantIdentity);else if(s.value.case==="streamChunk")this.handleStreamChunk(s.value.value);else if(s.value.case==="streamTrailer")this.handleStreamTrailer(s.value.value);else if(s.value.case==="rpcRequest"){const a=s.value.value;this.handleIncomingRpcRequest(s.participantIdentity,a.id,a.method,a.payload,a.responseTimeoutMs,a.version)}},this.handleUserPacket=(s,o,a)=>{this.emit(T.DataReceived,o.payload,s,a,o.topic),s==null||s.emit(x.DataReceived,o.payload,a)},this.handleSipDtmf=(s,o)=>{this.emit(T.SipDTMFReceived,o,s),s==null||s.emit(x.SipDTMFReceived,o)},this.bufferedSegments=new Map,this.handleTranscription=(s,o)=>{const a=o.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(o.transcribedParticipantIdentity),c=a==null?void 0:a.trackPublications.get(o.trackId),l=Cp(o,this.transcriptionReceivedTimes);c==null||c.emit(k.TranscriptionReceived,l),a==null||a.emit(x.TranscriptionReceived,l,c),this.emit(T.TranscriptionReceived,l,a,c)},this.handleChatMessage=(s,o)=>{const a=wp(o);this.emit(T.ChatMessage,a,s)},this.handleMetrics=(s,o)=>{this.emit(T.MetricsReceived,s,o)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(T.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=s=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:s})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(T.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(T.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(T.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>m(this,void 0,void 0,function*(){var s,o,a;const c=Ce.getInstance().previousDevices,l=yield Ce.getInstance().getDevices(void 0,!1),u=oA();if((u==null?void 0:u.name)==="Chrome"&&u.os!=="iOS")for(let h of l){const g=c.find(f=>f.deviceId===h.deviceId);g&&g.label!==""&&g.kind===h.kind&&g.label!==h.label&&this.getActiveDevice(h.kind)==="default"&&this.emit(T.ActiveDeviceChanged,h.kind,h.deviceId)}const d=["audiooutput","audioinput","videoinput"];for(let h of d){const g=Qp(h),f=this.localParticipant.getTrackPublication(g);if(f&&(!((s=f.track)===null||s===void 0)&&s.isUserProvided))continue;const p=l.filter(y=>y.kind===h),B=this.getActiveDevice(h);if(B===((o=c.filter(y=>y.kind===h)[0])===null||o===void 0?void 0:o.deviceId)&&p.length>0&&((a=p[0])===null||a===void 0?void 0:a.deviceId)!==B){yield this.switchActiveDevice(h,p[0].deviceId);continue}h==="audioinput"&&!jA()||h==="videoinput"||p.length>0&&!p.find(y=>y.deviceId===this.getActiveDevice(h))&&(yield this.switchActiveDevice(h,p[0].deviceId))}this.emit(T.MediaDevicesChanged)}),this.handleRoomUpdate=s=>{const o=this.roomInfo;this.roomInfo=s,o&&o.metadata!==s.metadata&&this.emitWhenConnected(T.RoomMetadataChanged,s.metadata),(o==null?void 0:o.activeRecording)!==s.activeRecording&&this.emitWhenConnected(T.RecordingStatusChanged,s.activeRecording)},this.handleConnectionQualityUpdate=s=>{s.updates.forEach(o=>{if(o.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(o.quality);return}const a=this.getRemoteParticipantBySid(o.participantSid);a&&a.setConnectionQuality(o.quality)})},this.onLocalParticipantMetadataChanged=s=>{this.emit(T.ParticipantMetadataChanged,s,this.localParticipant)},this.onLocalParticipantNameChanged=s=>{this.emit(T.ParticipantNameChanged,s,this.localParticipant)},this.onLocalAttributesChanged=s=>{this.emit(T.ParticipantAttributesChanged,s,this.localParticipant)},this.onLocalTrackMuted=s=>{this.emit(T.TrackMuted,s,this.localParticipant)},this.onLocalTrackUnmuted=s=>{this.emit(T.TrackUnmuted,s,this.localParticipant)},this.onTrackProcessorUpdate=s=>{var o;(o=s==null?void 0:s.onPublish)===null||o===void 0||o.call(s,this)},this.onLocalTrackPublished=s=>m(this,void 0,void 0,function*(){var o,a,c,l,u,d;(o=s.track)===null||o===void 0||o.on(k.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.on(k.Restarted,this.onLocalTrackRestarted),(u=(l=(c=s.track)===null||c===void 0?void 0:c.getProcessor())===null||l===void 0?void 0:l.onPublish)===null||u===void 0||u.call(l,this),this.emit(T.LocalTrackPublished,s,this.localParticipant),yt(s.track)&&(yield s.track.checkForSilence())&&this.emit(T.LocalAudioSilenceDetected,s);const h=yield(d=s.track)===null||d===void 0?void 0:d.getDeviceId(!1),g=Vl(s.source);g&&h&&h!==this.localParticipant.activeDeviceMap.get(g)&&(this.localParticipant.activeDeviceMap.set(g,h),this.emit(T.ActiveDeviceChanged,g,h))}),this.onLocalTrackUnpublished=s=>{var o,a;(o=s.track)===null||o===void 0||o.off(k.TrackProcessorUpdate,this.onTrackProcessorUpdate),(a=s.track)===null||a===void 0||a.off(k.Restarted,this.onLocalTrackRestarted),this.emit(T.LocalTrackUnpublished,s,this.localParticipant)},this.onLocalTrackRestarted=s=>m(this,void 0,void 0,function*(){const o=yield s.getDeviceId(!1),a=Vl(s.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.log.debug("local track restarted, setting ".concat(a," ").concat(o," active"),this.logContext),this.localParticipant.activeDeviceMap.set(a,o),this.emit(T.ActiveDeviceChanged,a,o))}),this.onLocalConnectionQualityChanged=s=>{this.emit(T.ConnectionQualityChanged,s,this.localParticipant)},this.onMediaDevicesError=s=>{this.emit(T.MediaDevicesError,s)},this.onLocalParticipantPermissionsChanged=s=>{this.emit(T.ParticipantPermissionsChanged,s,this.localParticipant)},this.onLocalChatMessageSent=s=>{this.emit(T.ChatMessage,s,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},Wp),e),this.log=TA((n=this.options.loggerName)!==null&&n!==void 0?n:sA.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},eu),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},Au),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},jp),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new De,this.localParticipant=new bm("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",WA(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",WA(this.options.audioCaptureDefaults.deviceId)),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&this.switchActiveDevice("audiooutput",WA(this.options.audioOutput.deviceId)).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),Me()){const s=new AbortController;(r=navigator.mediaDevices)===null||r===void 0||r.addEventListener("devicechange",this.handleDeviceChange,{signal:s.signal}),bt.cleanupRegistry&&bt.cleanupRegistry.register(this,()=>{s.abort()})}}registerTextStreamHandler(e,A){if(this.textStreamHandlers.has(e))throw new TypeError('A text stream handler for topic "'.concat(e,'" has already been set.'));this.textStreamHandlers.set(e,A)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,A){if(this.byteStreamHandlers.has(e))throw new TypeError('A byte stream handler for topic "'.concat(e,'" has already been set.'));this.byteStreamHandlers.set(e,A)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}registerRpcMethod(e,A){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,A)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}handleIncomingRpcRequest(e,A,n,i,r,s){return m(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,A),s!==1){yield this.engine.publishRpcResponse(e,A,null,le.builtIn("UNSUPPORTED_VERSION"));return}const o=this.rpcHandlers.get(n);if(!o){yield this.engine.publishRpcResponse(e,A,null,le.builtIn("UNSUPPORTED_METHOD"));return}let a=null,c=null;try{const l=yield o({requestId:A,callerIdentity:e,payload:i,responseTimeout:r});no(l)>tu?(a=le.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(n))):c=l}catch(l){l instanceof le?a=l:(console.warn("Uncaught error returned by RPC handler for ".concat(n,". Returning APPLICATION_ERROR instead."),l),a=le.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,A,c,a)})}setE2EEEnabled(e){return m(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new Ip(this.options.e2ee),this.e2eeManager.on(VA.ParticipantEncryptionStatusChanged,(A,n)=>{bp(n)&&(this.isE2EEEnabled=A),this.emit(T.ParticipantEncryptionStatusChanged,A,n)}),this.e2eeManager.on(VA.EncryptionError,A=>this.emit(T.EncryptionError,A)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&A!==void 0?A:!1}getSid(){return m(this,void 0,void 0,function*(){return this.state===J.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,A)=>{const n=i=>{i.sid!==""&&(this.engine.off(I.RoomUpdate,n),e(i.sid))};this.engine.on(I.RoomUpdate,n),this.once(T.Disconnected,()=>{this.engine.off(I.RoomUpdate,n),A("Room disconnected before room server id was available")})})})}get name(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&A!==void 0?A:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&A!==void 0?A:0}get numPublishers(){var e,A;return(A=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&A!==void 0?A:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new am(this.options),this.engine.on(I.ParticipantUpdate,this.handleParticipantUpdates).on(I.RoomUpdate,this.handleRoomUpdate).on(I.SpeakersChanged,this.handleSpeakersChanged).on(I.StreamStateChanged,this.handleStreamStateUpdate).on(I.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(I.SubscriptionError,this.handleSubscriptionError).on(I.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(I.MediaTrackAdded,(e,A,n)=>{this.onTrackAdded(e,A,n)}).on(I.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(I.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(I.DataPacketReceived,this.handleDataPacket).on(I.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(J.SignalReconnecting)&&this.emit(T.SignalReconnecting)}).on(I.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(J.Connected)&&this.emit(T.Reconnected)}).on(I.SignalResumed,()=>{this.bufferedEvents=[],(this.state===J.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(I.Restarting,this.handleRestarting).on(I.SignalRestarted,this.handleSignalRestarted).on(I.Offline,()=>{this.setAndEmitConnectionState(J.Reconnecting)&&this.emit(T.Reconnecting)}).on(I.DCBufferStatusChanged,(e,A)=>{this.emit(T.DCBufferStatusChanged,e,A)}).on(I.LocalTrackSubscribed,e=>{const A=this.localParticipant.getTrackPublications().find(n=>{let{trackSid:i}=n;return i===e});if(!A){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(x.LocalTrackSubscribed,A),this.emitWhenConnected(T.LocalTrackSubscribed,A,this.localParticipant)}).on(I.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((A,n)=>{this.handleParticipantDisconnected(n,A)}),this.emit(T.Moved,e.room.name,e.token),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(e){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ce.getInstance().getDevices(e,A)}prepareConnection(e,A){return m(this,void 0,void 0,function*(){if(this.state===J.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(Hs(new URL(e))&&A){this.regionUrlProvider=new co(e,A);const n=yield this.regionUrlProvider.getNextBestRegionUrl();n&&this.state===J.Disconnected&&(this.regionUrl=n,yield fetch(Vs(n),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(n),this.logContext))}else yield fetch(Vs(e),{method:"HEAD"})}catch(n){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:n}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,A){return m(this,void 0,void 0,function*(){let n=()=>{},i;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":i=new pA({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":i=new pA({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":i=new pA({scenario:{case:"serverLeave",value:!0}});break;case"migration":i=new pA({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":n=()=>m(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new pA({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":n=()=>m(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),i=new pA({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":i=new pA({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),n=()=>m(this,void 0,void 0,function*(){const r=this.engine.client.onLeave;r&&r(new Bi({reason:nA.CLIENT_INITIATED,action:Kt.RECONNECT}))});break;case"subscriber-bandwidth":if(A===void 0||typeof A!="number")throw new Error("subscriber-bandwidth requires a number as argument");i=new pA({scenario:{case:"subscriberBandwidth",value:wt(A)}});break;case"leave-full-reconnect":i=new pA({scenario:{case:"leaveRequestFullReconnect",value:!0}})}i&&(yield this.engine.client.sendSimulateScenario(i),yield n())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,A){return m(this,arguments,void 0,function(n,i){var r=this;let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var o,a,c,l,u,d,h,g;let f=!0,p=!1;const B=s?{exact:i}:i;if(n==="audioinput"){p=r.localParticipant.audioTrackPublications.size===0;const y=(o=r.getActiveDevice(n))!==null&&o!==void 0?o:r.options.audioCaptureDefaults.deviceId;r.options.audioCaptureDefaults.deviceId=B;const b=Array.from(r.localParticipant.audioTrackPublications.values()).filter(v=>v.source===E.Source.Microphone);try{f=(yield Promise.all(b.map(v=>{var C;return(C=v.audioTrack)===null||C===void 0?void 0:C.setDeviceId(B)}))).every(v=>v===!0)}catch(v){throw r.options.audioCaptureDefaults.deviceId=y,v}}else if(n==="videoinput"){p=r.localParticipant.videoTrackPublications.size===0;const y=(a=r.getActiveDevice(n))!==null&&a!==void 0?a:r.options.videoCaptureDefaults.deviceId;r.options.videoCaptureDefaults.deviceId=B;const b=Array.from(r.localParticipant.videoTrackPublications.values()).filter(v=>v.source===E.Source.Camera);try{f=(yield Promise.all(b.map(v=>{var C;return(C=v.videoTrack)===null||C===void 0?void 0:C.setDeviceId(B)}))).every(v=>v===!0)}catch(v){throw r.options.videoCaptureDefaults.deviceId=y,v}}else if(n==="audiooutput"){if(!_s()&&!r.options.webAudioMix||r.options.webAudioMix&&r.audioContext&&!("setSinkId"in r.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");r.options.webAudioMix&&(i=(c=yield Ce.getInstance().normalizeDeviceId("audiooutput",i))!==null&&c!==void 0?c:""),(l=(g=r.options).audioOutput)!==null&&l!==void 0||(g.audioOutput={});const y=(u=r.getActiveDevice(n))!==null&&u!==void 0?u:r.options.audioOutput.deviceId;r.options.audioOutput.deviceId=i;try{r.options.webAudioMix&&((d=r.audioContext)===null||d===void 0||d.setSinkId(i)),yield Promise.all(Array.from(r.remoteParticipants.values()).map(b=>b.setAudioOutput({deviceId:i})))}catch(b){throw r.options.audioOutput.deviceId=y,b}}return(p||n==="audiooutput")&&(r.localParticipant.activeDeviceMap.set(n,n==="audiooutput"&&((h=r.options.audioOutput)===null||h===void 0?void 0:h.deviceId)||i),r.emit(T.ActiveDeviceChanged,n,i)),f}()})}setupLocalParticipantEvents(){this.localParticipant.on(x.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(x.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(x.AttributesChanged,this.onLocalAttributesChanged).on(x.TrackMuted,this.onLocalTrackMuted).on(x.TrackUnmuted,this.onLocalTrackUnmuted).on(x.LocalTrackPublished,this.onLocalTrackPublished).on(x.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(x.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(x.MediaDevicesError,this.onMediaDevicesError).on(x.AudioStreamAcquired,this.startAudio).on(x.ChatMessage,this.onLocalChatMessageSent).on(x.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,A,n){if(this.state===J.Connecting||this.state===J.Reconnecting){const l=()=>{this.onTrackAdded(e,A,n),u()},u=()=>{this.off(T.Reconnected,l),this.off(T.Connected,l),this.off(T.Disconnected,u)};this.once(T.Reconnected,l),this.once(T.Connected,l),this.once(T.Disconnected,u);return}if(this.state===J.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const i=cp(A.id),r=i[0];let s=i[1],o=e.id;if(s&&s.startsWith("TR")&&(o=s),r===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const a=Array.from(this.remoteParticipants.values()).find(l=>l.sid===r);if(!a){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(r),this.logContext);return}let c;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?c=this.options.adaptiveStream:c={}),a.addSubscribedMediaTrack(e,o,A,n,c)}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,A=arguments.length>1?arguments[1]:void 0;var n;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==J.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(i=>{i.trackPublications.forEach(r=>{i.unpublishTrack(r.trackSid)})}),this.localParticipant.trackPublications.forEach(i=>{var r,s,o;i.track&&this.localParticipant.unpublishTrack(i.track,e),e?((r=i.track)===null||r===void 0||r.detach(),(s=i.track)===null||s===void 0||s.stop()):(o=i.track)===null||o===void 0||o.stopMonitor()}),this.localParticipant.off(x.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(x.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(x.AttributesChanged,this.onLocalAttributesChanged).off(x.TrackMuted,this.onLocalTrackMuted).off(x.TrackUnmuted,this.onLocalTrackUnmuted).off(x.LocalTrackPublished,this.onLocalTrackPublished).off(x.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(x.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(x.MediaDevicesError,this.onMediaDevicesError).off(x.AudioStreamAcquired,this.startAudio).off(x.ChatMessage,this.onLocalChatMessageSent).off(x.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),Me()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(n=navigator.mediaDevices)===null||n===void 0||n.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(J.Disconnected),this.emit(T.Disconnected,A)}}}handleParticipantDisconnected(e,A){var n;this.remoteParticipants.delete(e),A&&(A.trackPublications.forEach(i=>{A.unpublishTrack(i.trackSid,!0)}),this.emit(T.ParticipantDisconnected,A),A.setDisconnected(),(n=this.localParticipant)===null||n===void 0||n.handleParticipantDisconnected(A.identity))}handleStreamHeader(e,A){return m(this,void 0,void 0,function*(){var n;if(e.contentHeader.case==="byteHeader"){const i=this.byteStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let r;const s={id:e.streamId,name:(n=e.contentHeader.value.name)!==null&&n!==void 0?n:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Ii(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{r=a,this.byteStreamControllers.set(e.streamId,{info:s,controller:r,startTime:Date.now()})}});i(new dm(s,o,Ii(e.totalLength)),{identity:A})}else if(e.contentHeader.case==="textHeader"){const i=this.textStreamHandlers.get(e.topic);if(!i){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let r;const s={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},o=new ReadableStream({start:a=>{r=a,this.textStreamControllers.set(e.streamId,{info:s,controller:r,startTime:Date.now()})}});i(new hm(s,o,Ii(e.totalLength)),{identity:A})}})}handleStreamChunk(e){const A=this.byteStreamControllers.get(e.streamId);A&&e.content.length>0&&A.controller.enqueue(e);const n=this.textStreamControllers.get(e.streamId);n&&e.content.length>0&&n.controller.enqueue(e)}handleStreamTrailer(e){const A=this.textStreamControllers.get(e.streamId);A&&(A.info.attributes=Object.assign(Object.assign({},A.info.attributes),e.attributes),A.controller.close(),this.textStreamControllers.delete(e.streamId));const n=this.byteStreamControllers.get(e.streamId);n&&(n.info.attributes=Object.assign(Object.assign({},n.info.attributes),e.attributes),n.controller.close(),this.byteStreamControllers.delete(e.streamId))}acquireAudioContext(){return m(this,void 0,void 0,function*(){var e,A;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=Kl())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(i=>i.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),Oe(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const n=((A=this.audioContext)===null||A===void 0?void 0:A.state)==="running";n!==this.canPlaybackAudio&&(this.audioEnabled=n,this.emit(T.AudioPlaybackStatusChanged,n))})}createParticipant(e,A){var n;let i;return A?i=Oi.fromParticipantInfo(this.engine.client,A,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):i=new Oi(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),!((n=this.options.audioOutput)===null||n===void 0)&&n.deviceId&&i.setAudioOutput(this.options.audioOutput).catch(r=>this.log.warn("Could not set audio output: ".concat(r.message),this.logContext)),i}getOrCreateParticipant(e,A){if(this.remoteParticipants.has(e)){const i=this.remoteParticipants.get(e);return A&&i.updateInfo(A)&&this.sidToIdentity.set(A.sid,A.identity),i}const n=this.createParticipant(e,A);return this.remoteParticipants.set(e,n),this.sidToIdentity.set(A.sid,A.identity),this.emitWhenConnected(T.ParticipantConnected,n),n.on(x.TrackPublished,i=>{this.emitWhenConnected(T.TrackPublished,i,n)}).on(x.TrackSubscribed,(i,r)=>{i.kind===E.Kind.Audio?(i.on(k.AudioPlaybackStarted,this.handleAudioPlaybackStarted),i.on(k.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):i.kind===E.Kind.Video&&(i.on(k.VideoPlaybackFailed,this.handleVideoPlaybackFailed),i.on(k.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(T.TrackSubscribed,i,r,n)}).on(x.TrackUnpublished,i=>{this.emit(T.TrackUnpublished,i,n)}).on(x.TrackUnsubscribed,(i,r)=>{this.emit(T.TrackUnsubscribed,i,r,n)}).on(x.TrackMuted,i=>{this.emitWhenConnected(T.TrackMuted,i,n)}).on(x.TrackUnmuted,i=>{this.emitWhenConnected(T.TrackUnmuted,i,n)}).on(x.ParticipantMetadataChanged,i=>{this.emitWhenConnected(T.ParticipantMetadataChanged,i,n)}).on(x.ParticipantNameChanged,i=>{this.emitWhenConnected(T.ParticipantNameChanged,i,n)}).on(x.AttributesChanged,i=>{this.emitWhenConnected(T.ParticipantAttributesChanged,i,n)}).on(x.ConnectionQualityChanged,i=>{this.emitWhenConnected(T.ConnectionQualityChanged,i,n)}).on(x.ParticipantPermissionsChanged,i=>{this.emitWhenConnected(T.ParticipantPermissionsChanged,i,n)}).on(x.TrackSubscriptionStatusChanged,(i,r)=>{this.emitWhenConnected(T.TrackSubscriptionStatusChanged,i,r,n)}).on(x.TrackSubscriptionFailed,(i,r)=>{this.emit(T.TrackSubscriptionFailed,i,n,r)}).on(x.TrackSubscriptionPermissionChanged,(i,r)=>{this.emitWhenConnected(T.TrackSubscriptionPermissionChanged,i,r,n)}).on(x.Active,()=>{this.emitWhenConnected(T.ParticipantActive,n)}),A&&n.updateInfo(A),n}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((n,i)=>(n.push(...i.getTrackPublications()),n),[]),A=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,A)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const A of e.videoTrackPublications.values())A.isSubscribed&&yp(A)&&A.emitTrackUpdate()}getRemoteParticipantBySid(e){const A=this.sidToIdentity.get(e);if(A)return this.remoteParticipants.get(A)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=ye.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,nA.STATE_MISMATCH))):e=0},Qm)}clearConnectionReconcile(){this.connectionReconcileInterval&&ye.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(T.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[A,n]=e;this.emit(A,...n)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var A=arguments.length,n=new Array(A>1?A-1:0),i=1;i<A;i++)n[i-1]=arguments[i];if(this.state===J.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,n]);else if(this.state===J.Connected)return this.emit(e,...n);return!1}simulateParticipants(e){return m(this,void 0,void 0,function*(){var A,n;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),r=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new fi({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:re.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new pt({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(T.SignalConnected),this.emit(T.Connected),this.setAndEmitConnectionState(J.Connected),i.video){const s=new ho(E.Kind.Video,new Nt({source:ge.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:tA.AUDIO,name:"video-dummy"}),new _i(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:Hl(160*((A=r.aspectRatios[0])!==null&&A!==void 0?A:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(x.LocalTrackPublished,s)}if(i.audio){const s=new ho(E.Kind.Audio,new Nt({source:ge.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:tA.AUDIO}),new Li(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Ns(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(s),this.localParticipant.emit(x.LocalTrackPublished,s)}for(let s=0;s<r.count-1;s+=1){let o=new pt({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(s),state:Mt.ACTIVE,tracks:[],joinedAt:re.parse(Date.now())});const a=this.getOrCreateParticipant(o.identity,o);if(r.video){const c=Hl(160*((n=r.aspectRatios[s%r.aspectRatios.length])!==null&&n!==void 0?n:1),160,!1,!0),l=new Nt({source:ge.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:tA.AUDIO});a.addSubscribedMediaTrack(c,l.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,l]}if(r.audio){const c=Ns(),l=new Nt({source:ge.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:tA.AUDIO});a.addSubscribedMediaTrack(c,l.sid,new MediaStream([c]),new RTCRtpReceiver),o.tracks=[...o.tracks,l]}a.updateInfo(o)}})}emit(e){for(var A=arguments.length,n=new Array(A>1?A-1:0),i=1;i<A;i++)n[i-1]=arguments[i];if(e!==T.ActiveSpeakersChanged&&e!==T.TranscriptionReceived){const r=mu(n).filter(s=>s!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:r}))}return super.emit(e,...n)}}bt.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(t=>{t()});function mu(t){return t.map(e=>{if(e)return Array.isArray(e)?mu(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var lA;(function(t){t[t.IDLE=0]="IDLE",t[t.RUNNING=1]="RUNNING",t[t.SKIPPED=2]="SKIPPED",t[t.SUCCESS=3]="SUCCESS",t[t.FAILED=4]="FAILED"})(lA||(lA={}));class YA extends mA.EventEmitter{constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=lA.IDLE,this.logs=[],this.options={},this.url=e,this.token=A,this.name=this.constructor.name,this.room=new bt(n.roomOptions),this.connectOptions=n.connectOptions,this.options=n}run(e){return m(this,void 0,void 0,function*(){if(this.status!==lA.IDLE)throw Error("check is running already");this.setStatus(lA.RUNNING);try{yield this.perform()}catch(A){A instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(A.message):this.appendError(A.message))}return yield this.disconnect(),yield new Promise(A=>setTimeout(A,500)),this.status!==lA.SKIPPED&&this.setStatus(this.isSuccess()?lA.SUCCESS:lA.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return m(this,void 0,void 0,function*(){return this.room.state===J.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return m(this,void 0,void 0,function*(){this.room&&this.room.state!==J.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus(lA.SKIPPED)}switchProtocol(e){return m(this,void 0,void 0,function*(){let A=!1,n=!1;if(this.room.on(T.Reconnecting,()=>{A=!0}),this.room.once(T.Reconnected,()=>{n=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(r=>setTimeout(r,1e3)),!A)return;const i=Date.now()+1e4;for(;Date.now()<i;){if(n)return;yield Oe(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class Em extends YA{get description(){return"Cloud regions"}perform(){return m(this,void 0,void 0,function*(){const e=new co(this.url,this.token);if(!e.isCloud()){this.skip();return}const A=[],n=new Set;for(let r=0;r<3;r++){const s=yield e.getNextBestRegionUrl();if(!s)break;if(n.has(s))continue;n.add(s);const o=yield this.checkCloudRegion(s);this.appendMessage("".concat(o.region," RTT: ").concat(o.rtt,"ms, duration: ").concat(o.duration,"ms")),A.push(o)}A.sort((r,s)=>(r.duration-s.duration)*.5+(r.rtt-s.rtt)*.5);const i=A[0];this.bestStats=i,this.appendMessage("best Cloud region: ".concat(i.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return m(this,void 0,void 0,function*(){var A,n;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const i=(A=this.room.serverInfo)===null||A===void 0?void 0:A.region;if(!i)throw new Error("Region not found");const r=yield this.room.localParticipant.streamText({topic:"test"}),s=1e3,a=1e6/s,c="A".repeat(s),l=Date.now();for(let g=0;g<a;g++)yield r.write(c);yield r.close();const u=Date.now(),d=yield(n=this.room.engine.pcManager)===null||n===void 0?void 0:n.publisher.getStats(),h={region:i,rtt:1e4,duration:u-l};return d==null||d.forEach(g=>{g.type==="candidate-pair"&&g.nominated&&(h.rtt=g.currentRoundTripTime*1e3)}),yield this.disconnect(),h})}}const fo=1e4;class Sm extends YA{get description(){return"Connection via UDP vs TCP"}perform(){return m(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),A=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-A.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-A.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=A):this.appendMessage("best connection quality via udp");const n=this.bestStats;this.appendMessage("upstream bitrate: ".concat((n.bitrateTotal/n.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((n.rttTotal/n.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((n.jitterTotal/n.count*1e3).toFixed(2)," ms")),n.packetsLost>0&&this.appendWarning("packets lost: ".concat((n.packetsLost/n.packetsSent*100).toFixed(2),"%")),n.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((n.qualityLimitationDurations.bandwidth/(fo/1e3)*100).toFixed(2),"%")),n.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((n.qualityLimitationDurations.cpu/(fo/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return m(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const A=document.createElement("canvas");A.width=1280,A.height=720;const n=A.getContext("2d");if(!n)throw new Error("Could not get canvas context");let i=0;const r=()=>{i=(i+1)%360,n.fillStyle="hsl(".concat(i,", 100%, 50%)"),n.fillRect(0,0,A.width,A.height),requestAnimationFrame(r)};r();const o=A.captureStream(30).getVideoTracks()[0],c=(yield this.room.localParticipant.publishTrack(o,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,l={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},u=setInterval(()=>m(this,void 0,void 0,function*(){const d=yield c.getRTCStatsReport();d==null||d.forEach(h=>{h.type==="outbound-rtp"?(l.packetsSent=h.packetsSent,l.qualityLimitationDurations=h.qualityLimitationDurations,l.bitrateTotal+=h.targetBitrate,l.count++):h.type==="remote-inbound-rtp"&&(l.packetsLost=h.packetsLost,l.rttTotal+=h.roundTripTime,l.jitterTotal+=h.jitter)})}),1e3);return yield new Promise(d=>setTimeout(d,fo)),clearInterval(u),o.stop(),A.remove(),yield this.disconnect(),l})}}class Tm extends YA{get description(){return"Can publish audio"}perform(){return m(this,void 0,void 0,function*(){var e;const A=yield this.connect(),n=yield Cm();if(yield Nl(n,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),A.localParticipant.publishTrack(n),yield new Promise(o=>setTimeout(o,3e3));const r=yield(e=n.sender)===null||e===void 0?void 0:e.getStats();if(!r)throw new Error("Could not get RTCStats");let s=0;if(r.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="audio"||!o.kind&&o.mediaType==="audio")&&(s=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," audio packets"))})}}class Fm extends YA{get description(){return"Can publish video"}perform(){return m(this,void 0,void 0,function*(){var e;const A=yield this.connect(),n=yield vm();yield this.checkForVideo(n.mediaStreamTrack),A.localParticipant.publishTrack(n),yield new Promise(s=>setTimeout(s,5e3));const i=yield(e=n.sender)===null||e===void 0?void 0:e.getStats();if(!i)throw new Error("Could not get RTCStats");let r=0;if(i.forEach(s=>{s.type==="outbound-rtp"&&(s.kind==="video"||!s.kind&&s.mediaType==="video")&&(r+=s.packetsSent)}),r===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(r," video packets"))})}checkForVideo(e){return m(this,void 0,void 0,function*(){const A=new MediaStream;A.addTrack(e.clone());const n=document.createElement("video");n.srcObject=A,n.muted=!0,yield new Promise(i=>{n.onplay=()=>{setTimeout(()=>{var r,s,o,a;const c=document.createElement("canvas"),l=e.getSettings(),u=(s=(r=l.width)!==null&&r!==void 0?r:n.videoWidth)!==null&&s!==void 0?s:1280,d=(a=(o=l.height)!==null&&o!==void 0?o:n.videoHeight)!==null&&a!==void 0?a:720;c.width=u,c.height=d;const h=c.getContext("2d");h.drawImage(n,0,0);const f=h.getImageData(0,0,c.width,c.height).data;let p=!0;for(let B=0;B<f.length;B+=4)if(f[B]!==0||f[B+1]!==0||f[B+2]!==0){p=!1;break}p?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),i()},1e3)},n.play()}),n.remove()})}}class km extends YA{get description(){return"Resuming connection after interruption"}perform(){return m(this,void 0,void 0,function*(){var e;const A=yield this.connect();let n=!1,i=!1,r;const s=new Promise(c=>{setTimeout(c,5e3),r=c}),o=()=>{n=!0};A.on(T.SignalReconnecting,o).on(T.Reconnecting,o).on(T.Reconnected,()=>{i=!0,r(!0)}),(e=A.engine.client.ws)===null||e===void 0||e.close();const a=A.engine.client.onClose;if(a&&a(""),yield s,n){if(!i||A.state!==J.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class Im extends YA{get description(){return"Can connect via TURN"}perform(){return m(this,void 0,void 0,function*(){var e,A;const n=new $s,i=yield n.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let r=!1,s=!1,o=!1;for(let a of i.iceServers)for(let c of a.urls)c.startsWith("turn:")?(s=!0,o=!0):c.startsWith("turns:")&&(s=!0,o=!0,r=!0),c.startsWith("stun:")&&(o=!0);o?s&&!r&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield n.close(),!((A=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||A===void 0)&&A.iceServers||s?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(a=>setTimeout(a,0)))})}}class Rm extends YA{get description(){return"Establishing WebRTC connection"}perform(){return m(this,void 0,void 0,function*(){let e=!1,A=!1;this.room.on(T.SignalConnected,()=>{const n=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(i,r)=>{if(i.candidate){const s=new RTCIceCandidate(i);let o="".concat(s.protocol," ").concat(s.address,":").concat(s.port," ").concat(s.type);s.address&&(xm(s.address)?o+=" (private)":s.protocol==="tcp"&&s.tcpType==="passive"?(e=!0,o+=" (passive)"):s.protocol==="udp"&&(A=!0)),this.appendMessage(o)}n&&n(i,r)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=i=>{i instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(i.errorCode," ").concat(i.errorText," ").concat(i.url))})});try{yield this.connect(),K.info("now the room is connected")}catch(n){throw this.appendWarning("ports need to be open on firewall in order to connect."),n}e||this.appendWarning("Server is not configured for ICE/TCP"),A||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function xm(t){const e=t.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const A=parseInt(e[1],10);if(A>=16&&A<=31)return!0}}return!1}class Pm extends YA{get description(){return"Connecting to signal connection via WebSocket"}perform(){return m(this,void 0,void 0,function*(){var e,A,n;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let i=new $s;const r=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(r.serverVersion,".")),((e=r.serverInfo)===null||e===void 0?void 0:e.edition)===Cc.Cloud&&(!((A=r.serverInfo)===null||A===void 0)&&A.region)&&this.appendMessage("LiveKit Cloud: ".concat((n=r.serverInfo)===null||n===void 0?void 0:n.region)),yield i.close()})}}class yU extends mA.EventEmitter{constructor(e,A){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=A,this.options=n}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:lA.IDLE,name:"",description:""}),e}updateCheck(e,A){this.checkResults.set(e,A),this.emit("checkUpdate",e,A)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==lA.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return m(this,void 0,void 0,function*(){const A=this.getNextCheckId(),n=new e(this.url,this.token,this.options),i=s=>{this.updateCheck(A,s)};n.on("update",i);const r=yield n.run();return n.off("update",i),r})}checkWebsocket(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(Pm)})}checkWebRTC(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(Rm)})}checkTURN(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(Im)})}checkReconnect(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(km)})}checkPublishAudio(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(Tm)})}checkPublishVideo(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(Fm)})}checkConnectionProtocol(){return m(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(Sm);if(e.data&&"protocol"in e.data){const A=e.data;this.options.protocol=A.protocol}return e})}checkCloudRegion(){return m(this,void 0,void 0,function*(){return this.createAndRunCheck(Em)})}}const Ne=Symbol.for("@ts-pattern/matcher"),Bu=Symbol.for("@ts-pattern/isVariadic"),Mi="@ts-pattern/anonymous-select-key",go=t=>!!(t&&typeof t=="object"),Ni=t=>t&&!!t[Ne],be=(t,e,A)=>{if(Ni(t)){const n=t[Ne](),{matched:i,selections:r}=n.match(e);return i&&r&&Object.keys(r).forEach(s=>A(s,r[s])),i}if(go(t)){if(!go(e))return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let n=[],i=[],r=[];for(const s of t.keys()){const o=t[s];Ni(o)&&o[Bu]?r.push(o):r.length?i.push(o):n.push(o)}if(r.length){if(r.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(e.length<n.length+i.length)return!1;const s=e.slice(0,n.length),o=i.length===0?[]:e.slice(-i.length),a=e.slice(n.length,i.length===0?1/0:-i.length);return n.every((c,l)=>be(c,s[l],A))&&i.every((c,l)=>be(c,o[l],A))&&(r.length===0||be(r[0],a,A))}return t.length===e.length&&t.every((s,o)=>be(s,e[o],A))}return Reflect.ownKeys(t).every(n=>{const i=t[n];return(n in e||Ni(r=i)&&r[Ne]().matcherType==="optional")&&be(i,e[n],A);var r})}return Object.is(e,t)},We=t=>{var e,A,n;return go(t)?Ni(t)?(e=(A=(n=t[Ne]()).getSelectionKeys)==null?void 0:A.call(n))!=null?e:[]:Array.isArray(t)?Sn(t,We):Sn(Object.values(t),We):[]},Sn=(t,e)=>t.reduce((A,n)=>A.concat(e(n)),[]);function Lm(...t){if(t.length===1){const[e]=t;return A=>be(e,A,()=>{})}if(t.length===2){const[e,A]=t;return be(e,A,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function Ue(t){return Object.assign(t,{optional:()=>mo(t),and:e=>te(t,e),or:e=>vu(t,e),select:e=>e===void 0?Tn(t):Tn(e,t)})}function po(t){return Object.assign((e=>Object.assign(e,{[Symbol.iterator](){let A=0;const n=[{value:Object.assign(e,{[Bu]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var i;return(i=n[A++])!=null?i:n.at(-1)}}}}))(t),{optional:()=>po(mo(t)),select:e=>po(e===void 0?Tn(t):Tn(e,t))})}function mo(t){return Ue({[Ne]:()=>({match:e=>{let A={};const n=(i,r)=>{A[i]=r};return e===void 0?(We(t).forEach(i=>n(i,void 0)),{matched:!0,selections:A}):{matched:be(t,e,n),selections:A}},getSelectionKeys:()=>We(t),matcherType:"optional"})})}const Dm=(t,e)=>{for(const A of t)if(!e(A))return!1;return!0},_m=(t,e)=>{for(const[A,n]of t.entries())if(!e(n,A))return!1;return!0};function te(...t){return Ue({[Ne]:()=>({match:e=>{let A={};const n=(i,r)=>{A[i]=r};return{matched:t.every(i=>be(i,e,n)),selections:A}},getSelectionKeys:()=>Sn(t,We),matcherType:"and"})})}function vu(...t){return Ue({[Ne]:()=>({match:e=>{let A={};const n=(i,r)=>{A[i]=r};return Sn(t,We).forEach(i=>n(i,void 0)),{matched:t.some(i=>be(i,e,n)),selections:A}},getSelectionKeys:()=>Sn(t,We),matcherType:"or"})})}function j(t){return{[Ne]:()=>({match:e=>({matched:!!t(e)})})}}function Tn(...t){const e=typeof t[0]=="string"?t[0]:void 0,A=t.length===2?t[1]:typeof t[0]=="string"?void 0:t[0];return Ue({[Ne]:()=>({match:n=>{let i={[e??Mi]:n};return{matched:A===void 0||be(A,n,(r,s)=>{i[r]=s}),selections:i}},getSelectionKeys:()=>[e??Mi].concat(A===void 0?[]:We(A))})})}function vA(t){return typeof t=="number"}function qA(t){return typeof t=="string"}function zA(t){return typeof t=="bigint"}const Cu=Ue(j(function(t){return!0})),Hm=Cu,ZA=t=>Object.assign(Ue(t),{startsWith:e=>{return ZA(te(t,(A=e,j(n=>qA(n)&&n.startsWith(A)))));var A},endsWith:e=>{return ZA(te(t,(A=e,j(n=>qA(n)&&n.endsWith(A)))));var A},minLength:e=>ZA(te(t,(A=>j(n=>qA(n)&&n.length>=A))(e))),length:e=>ZA(te(t,(A=>j(n=>qA(n)&&n.length===A))(e))),maxLength:e=>ZA(te(t,(A=>j(n=>qA(n)&&n.length<=A))(e))),includes:e=>{return ZA(te(t,(A=e,j(n=>qA(n)&&n.includes(A)))));var A},regex:e=>{return ZA(te(t,(A=e,j(n=>qA(n)&&!!n.match(A)))));var A}}),Om=ZA(j(qA)),CA=t=>Object.assign(Ue(t),{between:(e,A)=>CA(te(t,((n,i)=>j(r=>vA(r)&&n<=r&&i>=r))(e,A))),lt:e=>CA(te(t,(A=>j(n=>vA(n)&&n<A))(e))),gt:e=>CA(te(t,(A=>j(n=>vA(n)&&n>A))(e))),lte:e=>CA(te(t,(A=>j(n=>vA(n)&&n<=A))(e))),gte:e=>CA(te(t,(A=>j(n=>vA(n)&&n>=A))(e))),int:()=>CA(te(t,j(e=>vA(e)&&Number.isInteger(e)))),finite:()=>CA(te(t,j(e=>vA(e)&&Number.isFinite(e)))),positive:()=>CA(te(t,j(e=>vA(e)&&e>0))),negative:()=>CA(te(t,j(e=>vA(e)&&e<0)))}),Mm=CA(j(vA)),et=t=>Object.assign(Ue(t),{between:(e,A)=>et(te(t,((n,i)=>j(r=>zA(r)&&n<=r&&i>=r))(e,A))),lt:e=>et(te(t,(A=>j(n=>zA(n)&&n<A))(e))),gt:e=>et(te(t,(A=>j(n=>zA(n)&&n>A))(e))),lte:e=>et(te(t,(A=>j(n=>zA(n)&&n<=A))(e))),gte:e=>et(te(t,(A=>j(n=>zA(n)&&n>=A))(e))),positive:()=>et(te(t,j(e=>zA(e)&&e>0))),negative:()=>et(te(t,j(e=>zA(e)&&e<0)))}),Nm=et(j(zA)),Km=Ue(j(function(t){return typeof t=="boolean"})),Vm=Ue(j(function(t){return typeof t=="symbol"})),Gm=Ue(j(function(t){return t==null})),jm=Ue(j(function(t){return t!=null}));var Wm={__proto__:null,matcher:Ne,optional:mo,array:function(...t){return po({[Ne]:()=>({match:e=>{if(!Array.isArray(e))return{matched:!1};if(t.length===0)return{matched:!0};const A=t[0];let n={};if(e.length===0)return We(A).forEach(r=>{n[r]=[]}),{matched:!0,selections:n};const i=(r,s)=>{n[r]=(n[r]||[]).concat([s])};return{matched:e.every(r=>be(A,r,i)),selections:n}},getSelectionKeys:()=>t.length===0?[]:We(t[0])})})},set:function(...t){return Ue({[Ne]:()=>({match:e=>{if(!(e instanceof Set))return{matched:!1};let A={};if(e.size===0)return{matched:!0,selections:A};if(t.length===0)return{matched:!0};const n=(r,s)=>{A[r]=(A[r]||[]).concat([s])},i=t[0];return{matched:Dm(e,r=>be(i,r,n)),selections:A}},getSelectionKeys:()=>t.length===0?[]:We(t[0])})})},map:function(...t){return Ue({[Ne]:()=>({match:e=>{if(!(e instanceof Map))return{matched:!1};let A={};if(e.size===0)return{matched:!0,selections:A};const n=(o,a)=>{A[o]=(A[o]||[]).concat([a])};if(t.length===0)return{matched:!0};var i;if(t.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=t[0])==null?void 0:i.toString()}`);const[r,s]=t;return{matched:_m(e,(o,a)=>{const c=be(r,a,n),l=be(s,o,n);return c&&l}),selections:A}},getSelectionKeys:()=>t.length===0?[]:[...We(t[0]),...We(t[1])]})})},intersection:te,union:vu,not:function(t){return Ue({[Ne]:()=>({match:e=>({matched:!be(t,e,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:j,select:Tn,any:Cu,_:Hm,string:Om,number:Mm,bigint:Nm,boolean:Km,symbol:Vm,nullish:Gm,nonNullable:jm,instanceOf:function(t){return Ue(j(function(e){return A=>A instanceof e}(t)))},shape:function(t){return Ue(j(Lm(t)))}};class Jm extends Error{constructor(e){let A;try{A=JSON.stringify(e)}catch{A=e}super(`Pattern matching error: no pattern matches value ${A}`),this.input=void 0,this.input=e}}const Bo={matched:!1,value:void 0};function Ki(t){return new Xm(t,Bo)}let Xm=class Ia{constructor(e,A){this.input=void 0,this.state=void 0,this.input=e,this.state=A}with(...e){if(this.state.matched)return this;const A=e[e.length-1],n=[e[0]];let i;e.length===3&&typeof e[1]=="function"?i=e[1]:e.length>2&&n.push(...e.slice(1,e.length-1));let r=!1,s={};const o=(c,l)=>{r=!0,s[c]=l},a=!n.some(c=>be(c,this.input,o))||i&&!i(this.input)?Bo:{matched:!0,value:A(r?Mi in s?s[Mi]:s:this.input,this.input)};return new Ia(this.input,a)}when(e,A){if(this.state.matched)return this;const n=!!e(this.input);return new Ia(this.input,n?{matched:!0,value:A(this.input,this.input)}:Bo)}otherwise(e){return this.state.matched?this.state.value:e(this.input)}exhaustive(e=$m){return this.state.matched?this.state.value:e(this.input)}run(){return this.exhaustive()}returnType(){return this}};function $m(t){throw new Jm(t)}const Ym="https://obi.getcor.io/api";var O;(function(t){t.READY="ready",t.ERROR="error",t.PAUSED="paused",t.LOADING="loading",t.THINKING="thinking",t.RESEARCHING="researching",t.AGENT_SPEAKING="agent_speaking",t.USER_SPEAKING="user_speaking",t.AWAITING_USER_INPUT="awaiting_user_input"})(O||(O={}));class wu{constructor({sessionId:e,apiBaseUrl:A}){this.currentState=O.READY,this.assistantAudioContext=null,this.userAudioContext=null,this._assistantAudioTimer=null,this._userAudioTimer=null,this.sessionId=e,this.apiBaseUrl=A||Ym,this.emitter=new ef}emit(e,A){this.emitter.emit(e,A)}on(e,A){this.emitter.on(e,A)}off(e,A){this.emitter.off(e,A)}setupRoomEventListeners(){this.room&&(this.room.on(T.LocalTrackUnpublished,e=>{e.source===E.Source.ScreenShare&&(this.screenStream=void 0)}),this.room.on(T.Disconnected,()=>{this.disconnect()}),this.room.on(T.ParticipantDisconnected,()=>{this.disconnect()}),this.room.on(T.TrackSubscribed,(e,A,n)=>{if(e.kind==="audio"&&e.attach(),e.source===E.Source.Microphone&&n.identity.includes("agent-")){const i=e.mediaStream;if(!i){console.error("No media stream available for assistant track");return}const r=new AudioContext,s=r.createAnalyser();r.createMediaStreamSource(i).connect(s),s.fftSize=2048;const a=new Uint8Array(s.frequencyBinCount);this.analyzeAudio(s,a,"ASSISTANT"),this.assistantAudioContext=r}}),this.room.on(T.ParticipantAttributesChanged,e=>{if(!e["lk.agent.state"]||this.currentState===O.RESEARCHING||this.currentState===O.PAUSED)return;const A=e["lk.agent.state"],n=Ki(A).with("listening",()=>O.USER_SPEAKING).with("speaking",()=>O.AGENT_SPEAKING).with("thinking",()=>O.AGENT_SPEAKING).otherwise(()=>{});n&&this.setState(n)}),this.room.on(T.DataReceived,async e=>{try{const A=JSON.parse(new TextDecoder().decode(e)),n=A.status||A.request;Ki(n).with("using_tool",()=>{this.currentState=O.RESEARCHING,this.emitter.emit("stateChanged",O.RESEARCHING)}).with("using_tool_ended",()=>{this.currentState=O.AGENT_SPEAKING,this.emitter.emit("stateChanged",O.AGENT_SPEAKING)}).with("share_screen",()=>{this.shareScreen()}).with("prompt_user",()=>{this.promptContinue()}).with("capture_page_html",()=>{this.emitter.emit("capturePageHTML")}).with("fill",()=>{this.emitter.emit("fill",A.value)}).otherwise(()=>{console.warn("Unknown data received:",A)})}catch(A){console.error("Error parsing data:",A)}}),this.room.localParticipant.registerRpcMethod("screen_capture",async e=>(this.emitter.emit("screenCaptureRequested"),new Promise(A=>{this.emitter.once("screenCaptureComplete",async n=>{if(n==="error"){A("error");return}try{await this.room.localParticipant.sendFile(new File([n],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),A("ok")}catch{A("error")}})}))))}async connect(){if(!this.sessionId){console.error("No session ID found"),this.emitter.emit("error",new Error("No session ID provided"));return}try{await this.requestMicrophone(),this.room=new bt({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners();const e=new URLSearchParams({token:this.sessionId,skip_intro:"true"}),A=`${this.apiBaseUrl}/join-token?${e.toString()}`,n=await fetch(A).then(i=>i.json());if(await this.room.connect(n.url,n.token),this.microphoneStream){const i=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(i,{name:"microphone",source:E.Source.Microphone})}return{url:n.url,token:n.token}}catch(e){throw console.error("Failed to connect to LiveKit:",e),this.disconnect(),this.emitter.emit("error",e instanceof Error?e:new Error(String(e))),e}}async disconnect(){var e,A,n;this.room&&(this.room.disconnect(!0),this.room.removeAllListeners(),this.room=void 0),(e=this.screenStream)!=null&&e.track&&this.screenStream.track.stop(),this.microphoneStream&&this.microphoneStream.getTracks().forEach(i=>i.stop()),this._userAudioTimer&&(window.clearTimeout(this._userAudioTimer),this._userAudioTimer=null),this._assistantAudioTimer&&(window.clearTimeout(this._assistantAudioTimer),this._assistantAudioTimer=null),await((A=this.userAudioContext)==null?void 0:A.close().catch(()=>{})),this.userAudioContext=null,await((n=this.assistantAudioContext)==null?void 0:n.close().catch(()=>{})),this.assistantAudioContext=null,this.setState(O.READY),this.emitter.emit("disconnected")}setState(e){e!==this.currentState&&(this.currentState=e,this.emitter.emit("stateChanged",e))}async requestMicrophone(){try{const e=await navigator.mediaDevices.getUserMedia({audio:!0});this.microphoneStream=e;const A=new AudioContext;this.userAudioContext=A;const n=A.createAnalyser(),i=A.createMediaStreamSource(e),r=A.createGain();r.gain.value=1.5,i.connect(r),r.connect(n),n.fftSize=2048;const s=new Uint8Array(n.frequencyBinCount);this.analyzeAudio(n,s,"USER")}catch(e){throw console.error("Microphone permission denied:",e),new Error("Microphone permission denied")}}async shareScreen(){if(!this.room){console.warn("[obi] shareScreen called while not connected");return}this.emitter.emit("preScreenShare");try{if(this.screenStream=await this.room.localParticipant.setScreenShareEnabled(!0,{video:{displaySurface:"window"}}),!this.screenStream){console.warn("Failed to share screen");return}await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify({request:"share_screen",success:!0})),{reliable:!0})}catch(e){console.error("Error sharing screen:",e),this.emitter.emit("error",e instanceof Error?e:new Error(String(e)))}}pauseRecording(){var e,A,n;this.room&&(this.setState(O.PAUSED),this.room.localParticipant.getTrackPublications().forEach(i=>{var r,s;i.handleMuted(),(s=(r=i.track)==null?void 0:r.mediaStream)==null||s.getTracks().forEach(o=>o.enabled=!1)}),(e=this.microphoneStream)==null||e.getTracks().forEach(i=>i.enabled=!1),(n=(A=this.screenStream)==null?void 0:A.track)==null||n.mute())}resumeRecording(){var e,A,n;this.room&&(this.setState(O.USER_SPEAKING),this.room.localParticipant.getTrackPublications().forEach(i=>{var r,s;i.handleUnmuted(),(s=(r=i.track)==null?void 0:r.mediaStream)==null||s.getTracks().forEach(o=>o.enabled=!0)}),(e=this.microphoneStream)==null||e.getTracks().forEach(i=>i.enabled=!0),(n=(A=this.screenStream)==null?void 0:A.track)==null||n.unmute())}async promptContinue(){await this.room.localParticipant.publishData(new TextEncoder().encode(JSON.stringify({request:"prompt_user",success:!0})),{reliable:!0})}async analyzeAudio(e,A,n){if(n==="USER"&&this.currentState===O.USER_SPEAKING||n==="ASSISTANT"&&this.currentState===O.AGENT_SPEAKING){e.getByteFrequencyData(A);const i=A.reduce((o,a)=>o+a,0)/A.length,r=Math.max(.01,Math.min(1,i/128));let s;n==="USER"&&this.currentState===O.USER_SPEAKING?s="USER":n==="ASSISTANT"&&this.currentState===O.AGENT_SPEAKING&&(s="ASSISTANT"),s&&this.emitter.emit("volume",{speaker:s,spectrum:Array.from(A),volume:r})}n==="USER"?this._userAudioTimer=window.setTimeout(()=>this.analyzeAudio(e,A,n),200):this._assistantAudioTimer=window.setTimeout(()=>this.analyzeAudio(e,A,n),200)}async sendHTML(e){if(!this.room){console.log("Cannot send HTML: Not connected to room");return}try{const A={type:"page_content",html:e,timestamp:new Date().toISOString()},n=JSON.stringify(A),r=new TextEncoder().encode(n);await this.room.localParticipant.publishData(r,{reliable:!0})}catch(A){console.error("Error sending HTML to LiveKit:",A),this.emitter.emit("error",A instanceof Error?A:new Error(String(A)))}}async reconnect(e,A,n){try{if(!e||!A)return console.error("Missing room URL or token for reconnection"),this.emitter.emit("error",new Error("Missing room URL or token for reconnection")),!1;if(await this.requestMicrophone(),this.room=new bt({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners(),await this.room.connect(e,A),this.microphoneStream){const i=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(i,{name:"microphone",source:E.Source.Microphone})}return this.setState(n),n===O.PAUSED&&this.pauseRecording(),!0}catch(i){return console.error("Failed to reconnect to room:",i),this.disconnect(),this.emitter.emit("error",i instanceof Error?i:new Error(String(i))),!1}}}/*!
|
|
39
|
-
* html2canvas-pro 1.5.11 <https://yorickshan.github.io/html2canvas-pro/>
|
|
40
|
-
* Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
|
|
41
|
-
* Released under MIT License
|
|
42
|
-
*/var vo=function(t,e){return vo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,n){A.__proto__=n}||function(A,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(A[i]=n[i])},vo(t,e)};function uA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vo(t,e);function A(){this.constructor=t}t.prototype=e===null?Object.create(e):(A.prototype=e.prototype,new A)}var Co=function(){return Co=Object.assign||function(e){for(var A,n=1,i=arguments.length;n<i;n++){A=arguments[n];for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&(e[r]=A[r])}return e},Co.apply(this,arguments)};function Re(t,e,A,n){function i(r){return r instanceof A?r:new A(function(s){s(r)})}return new(A||(A=Promise))(function(r,s){function o(l){try{c(n.next(l))}catch(u){s(u)}}function a(l){try{c(n.throw(l))}catch(u){s(u)}}function c(l){l.done?r(l.value):i(l.value).then(o,a)}c((n=n.apply(t,e||[])).next())})}function Fe(t,e){var A={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(l){return a([c,l])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(A=0)),A;)try{if(n=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return A.label++,{value:c[1],done:!1};case 5:A.label++,i=c[1],c=[0];continue;case 7:c=A.ops.pop(),A.trys.pop();continue;default:if(r=A.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){A=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){A.label=c[1];break}if(c[0]===6&&A.label<r[1]){A.label=r[1],r=c;break}if(r&&A.label<r[2]){A.label=r[2],A.ops.push(c);break}r[2]&&A.ops.pop(),A.trys.pop();continue}c=e.call(t,A)}catch(l){c=[6,l],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Vi(t,e,A){if(A||arguments.length===2)for(var n=0,i=e.length,r;n<i;n++)(r||!(n in e))&&(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;for(var RA=function(){function t(e,A,n,i){this.left=e,this.top=A,this.width=n,this.height=i}return t.prototype.add=function(e,A,n,i){return new t(this.left+e,this.top+A,this.width+n,this.height+i)},t.fromClientRect=function(e,A){return new t(A.left+e.windowBounds.left,A.top+e.windowBounds.top,A.width,A.height)},t.fromDOMRectList=function(e,A){var n=Array.from(A).find(function(i){return i.width!==0});return n?new t(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):t.EMPTY},t.EMPTY=new t(0,0,0,0),t}(),Gi=function(t,e){return RA.fromClientRect(t,e.getBoundingClientRect())},qm=function(t){var e=t.body,A=t.documentElement;if(!e||!A)throw new Error("Unable to get document size");var n=Math.max(Math.max(e.scrollWidth,A.scrollWidth),Math.max(e.offsetWidth,A.offsetWidth),Math.max(e.clientWidth,A.clientWidth)),i=Math.max(Math.max(e.scrollHeight,A.scrollHeight),Math.max(e.offsetHeight,A.offsetHeight),Math.max(e.clientHeight,A.clientHeight));return new RA(0,0,n,i)},ji=function(t){for(var e=[],A=0,n=t.length;A<n;){var i=t.charCodeAt(A++);if(i>=55296&&i<=56319&&A<n){var r=t.charCodeAt(A++);(r&64512)===56320?e.push(((i&1023)<<10)+(r&1023)+65536):(e.push(i),A--)}else e.push(i)}return e},he=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var A=t.length;if(!A)return"";for(var n=[],i=-1,r="";++i<A;){var s=t[i];s<=65535?n.push(s):(s-=65536,n.push((s>>10)+55296,s%1024+56320)),(i+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},yu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zm=typeof Uint8Array>"u"?[]:new Uint8Array(256),Wi=0;Wi<yu.length;Wi++)zm[yu.charCodeAt(Wi)]=Wi;for(var bu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ji=0;Ji<bu.length;Ji++)Fn[bu.charCodeAt(Ji)]=Ji;for(var Zm=function(t){var e=t.length*.75,A=t.length,n,i=0,r,s,o,a;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),l=Array.isArray(c)?c:new Uint8Array(c);for(n=0;n<A;n+=4)r=Fn[t.charCodeAt(n)],s=Fn[t.charCodeAt(n+1)],o=Fn[t.charCodeAt(n+2)],a=Fn[t.charCodeAt(n+3)],l[i++]=r<<2|s>>4,l[i++]=(s&15)<<4|o>>2,l[i++]=(o&3)<<6|a&63;return c},eB=function(t){for(var e=t.length,A=[],n=0;n<e;n+=2)A.push(t[n+1]<<8|t[n]);return A},AB=function(t){for(var e=t.length,A=[],n=0;n<e;n+=4)A.push(t[n+3]<<24|t[n+2]<<16|t[n+1]<<8|t[n]);return A},Ut=5,wo=6+5,yo=2,tB=wo-Ut,Uu=65536>>Ut,nB=1<<Ut,bo=nB-1,iB=1024>>Ut,rB=Uu+iB,sB=rB,oB=32,aB=sB+oB,cB=65536>>wo,lB=1<<tB,uB=lB-1,Qu=function(t,e,A){return t.slice?t.slice(e,A):new Uint16Array(Array.prototype.slice.call(t,e,A))},dB=function(t,e,A){return t.slice?t.slice(e,A):new Uint32Array(Array.prototype.slice.call(t,e,A))},hB=function(t,e){var A=Zm(t),n=Array.isArray(A)?AB(A):new Uint32Array(A),i=Array.isArray(A)?eB(A):new Uint16Array(A),r=24,s=Qu(i,r/2,n[4]/2),o=n[5]===2?Qu(i,(r+n[4])/2):dB(n,Math.ceil((r+n[4])/4));return new fB(n[0],n[1],n[2],n[3],s,o)},fB=function(){function t(e,A,n,i,r,s){this.initialValue=e,this.errorValue=A,this.highStart=n,this.highValueIndex=i,this.index=r,this.data=s}return t.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=this.index[e>>Ut],A=(A<<yo)+(e&bo),this.data[A];if(e<=65535)return A=this.index[Uu+(e-55296>>Ut)],A=(A<<yo)+(e&bo),this.data[A];if(e<this.highStart)return A=aB-cB+(e>>wo),A=this.index[A],A+=e>>Ut&uB,A=this.index[A],A=(A<<yo)+(e&bo),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),Eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gB=typeof Uint8Array>"u"?[]:new Uint8Array(256),Xi=0;Xi<Eu.length;Xi++)gB[Eu.charCodeAt(Xi)]=Xi;var pB="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Su=50,mB=1,Tu=2,Fu=3,BB=4,vB=5,ku=7,Iu=8,Ru=9,At=10,Uo=11,xu=12,Qo=13,CB=14,kn=15,Eo=16,$i=17,In=18,wB=19,Pu=20,So=21,Rn=22,To=23,qt=24,Je=25,xn=26,Pn=27,zt=28,yB=29,Qt=30,bB=31,Yi=32,qi=33,Fo=34,ko=35,Io=36,Ln=37,Ro=38,zi=39,Zi=40,xo=41,Lu=42,UB=43,QB=[9001,65288],Du="!",N="×",er="÷",Po=hB(pB),xA=[Qt,Io],Lo=[mB,Tu,Fu,vB],_u=[At,Iu],Hu=[Pn,xn],EB=Lo.concat(_u),Ou=[Ro,zi,Zi,Fo,ko],SB=[kn,Qo],TB=function(t,e){e===void 0&&(e="strict");var A=[],n=[],i=[];return t.forEach(function(r,s){var o=Po.get(r);if(o>Su?(i.push(!0),o-=Su):i.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(r)!==-1)return n.push(s),A.push(Eo);if(o===BB||o===Uo){if(s===0)return n.push(s),A.push(Qt);var a=A[s-1];return EB.indexOf(a)===-1?(n.push(n[s-1]),A.push(a)):(n.push(s),A.push(Qt))}if(n.push(s),o===bB)return A.push(e==="strict"?So:Ln);if(o===Lu||o===yB)return A.push(Qt);if(o===UB)return r>=131072&&r<=196605||r>=196608&&r<=262141?A.push(Ln):A.push(Qt);A.push(o)}),[n,A,i]},Do=function(t,e,A,n){var i=n[A];if(Array.isArray(t)?t.indexOf(i)!==-1:t===i)for(var r=A;r<=n.length;){r++;var s=n[r];if(s===e)return!0;if(s!==At)break}if(i===At)for(var r=A;r>0;){r--;var o=n[r];if(Array.isArray(t)?t.indexOf(o)!==-1:t===o)for(var a=A;a<=n.length;){a++;var s=n[a];if(s===e)return!0;if(s!==At)break}if(o!==At)break}return!1},Mu=function(t,e){for(var A=t;A>=0;){var n=e[A];if(n===At)A--;else return n}return 0},FB=function(t,e,A,n,i){if(A[n]===0)return N;var r=n-1;if(Array.isArray(i)&&i[r]===!0)return N;var s=r-1,o=r+1,a=e[r],c=s>=0?e[s]:0,l=e[o];if(a===Tu&&l===Fu)return N;if(Lo.indexOf(a)!==-1)return Du;if(Lo.indexOf(l)!==-1||_u.indexOf(l)!==-1)return N;if(Mu(r,e)===Iu)return er;if(Po.get(t[r])===Uo||(a===Yi||a===qi)&&Po.get(t[o])===Uo||a===ku||l===ku||a===Ru||[At,Qo,kn].indexOf(a)===-1&&l===Ru||[$i,In,wB,qt,zt].indexOf(l)!==-1||Mu(r,e)===Rn||Do(To,Rn,r,e)||Do([$i,In],So,r,e)||Do(xu,xu,r,e))return N;if(a===At)return er;if(a===To||l===To)return N;if(l===Eo||a===Eo)return er;if([Qo,kn,So].indexOf(l)!==-1||a===CB||c===Io&&SB.indexOf(a)!==-1||a===zt&&l===Io||l===Pu||xA.indexOf(l)!==-1&&a===Je||xA.indexOf(a)!==-1&&l===Je||a===Pn&&[Ln,Yi,qi].indexOf(l)!==-1||[Ln,Yi,qi].indexOf(a)!==-1&&l===xn||xA.indexOf(a)!==-1&&Hu.indexOf(l)!==-1||Hu.indexOf(a)!==-1&&xA.indexOf(l)!==-1||[Pn,xn].indexOf(a)!==-1&&(l===Je||[Rn,kn].indexOf(l)!==-1&&e[o+1]===Je)||[Rn,kn].indexOf(a)!==-1&&l===Je||a===Je&&[Je,zt,qt].indexOf(l)!==-1)return N;if([Je,zt,qt,$i,In].indexOf(l)!==-1)for(var u=r;u>=0;){var d=e[u];if(d===Je)return N;if([zt,qt].indexOf(d)!==-1)u--;else break}if([Pn,xn].indexOf(l)!==-1)for(var u=[$i,In].indexOf(a)!==-1?s:r;u>=0;){var d=e[u];if(d===Je)return N;if([zt,qt].indexOf(d)!==-1)u--;else break}if(Ro===a&&[Ro,zi,Fo,ko].indexOf(l)!==-1||[zi,Fo].indexOf(a)!==-1&&[zi,Zi].indexOf(l)!==-1||[Zi,ko].indexOf(a)!==-1&&l===Zi||Ou.indexOf(a)!==-1&&[Pu,xn].indexOf(l)!==-1||Ou.indexOf(l)!==-1&&a===Pn||xA.indexOf(a)!==-1&&xA.indexOf(l)!==-1||a===qt&&xA.indexOf(l)!==-1||xA.concat(Je).indexOf(a)!==-1&&l===Rn&&QB.indexOf(t[o])===-1||xA.concat(Je).indexOf(l)!==-1&&a===In)return N;if(a===xo&&l===xo){for(var h=A[r],g=1;h>0&&(h--,e[h]===xo);)g++;if(g%2!==0)return N}return a===Yi&&l===qi?N:er},kB=function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var A=TB(t,e.lineBreak),n=A[0],i=A[1],r=A[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(i=i.map(function(o){return[Je,Qt,Lu].indexOf(o)!==-1?Ln:o}));var s=e.wordBreak==="keep-all"?r.map(function(o,a){return o&&t[a]>=19968&&t[a]<=40959}):void 0;return[n,i,s]},IB=function(){function t(e,A,n,i){this.codePoints=e,this.required=A===Du,this.start=n,this.end=i}return t.prototype.slice=function(){return he.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),RB=function(t,e){var A=ji(t),n=kB(A,e),i=n[0],r=n[1],s=n[2],o=A.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var l=N;c<o&&(l=FB(A,r,i,++c,s))===N;);if(l!==N||c===o){var u=new IB(A,l,a,c);return a=c,{value:u,done:!1}}return{done:!0,value:null}}}},xB=1,PB=2,Dn=4,Nu=8,Ar=10,Ku=47,_n=92,LB=9,DB=32,tr=34,Hn=61,_B=35,HB=36,OB=37,nr=39,ir=40,On=41,MB=95,Ke=45,NB=33,KB=60,VB=62,GB=64,jB=91,WB=93,JB=61,XB=123,rr=63,$B=125,Vu=124,YB=126,qB=128,Gu=65533,_o=42,Et=43,zB=44,ZB=58,e0=59,Mn=46,A0=0,t0=8,n0=11,i0=14,r0=31,s0=127,wA=-1,ju=48,Wu=97,Ju=101,o0=102,a0=117,c0=122,Xu=65,$u=69,Yu=70,l0=85,u0=90,ke=function(t){return t>=ju&&t<=57},d0=function(t){return t>=55296&&t<=57343},Zt=function(t){return ke(t)||t>=Xu&&t<=Yu||t>=Wu&&t<=o0},h0=function(t){return t>=Wu&&t<=c0},f0=function(t){return t>=Xu&&t<=u0},g0=function(t){return h0(t)||f0(t)},p0=function(t){return t>=qB},sr=function(t){return t===Ar||t===LB||t===DB},or=function(t){return g0(t)||p0(t)||t===MB},qu=function(t){return or(t)||ke(t)||t===Ke},m0=function(t){return t>=A0&&t<=t0||t===n0||t>=i0&&t<=r0||t===s0},tt=function(t,e){return t!==_n?!1:e!==Ar},ar=function(t,e,A){return t===Ke?or(e)||tt(e,A):or(t)?!0:!!(t===_n&&tt(t,e))},Ho=function(t,e,A){return t===Et||t===Ke?ke(e)?!0:e===Mn&&ke(A):ke(t===Mn?e:t)},B0=function(t){var e=0,A=1;(t[e]===Et||t[e]===Ke)&&(t[e]===Ke&&(A=-1),e++);for(var n=[];ke(t[e]);)n.push(t[e++]);var i=n.length?parseInt(he.apply(void 0,n),10):0;t[e]===Mn&&e++;for(var r=[];ke(t[e]);)r.push(t[e++]);var s=r.length,o=s?parseInt(he.apply(void 0,r),10):0;(t[e]===$u||t[e]===Ju)&&e++;var a=1;(t[e]===Et||t[e]===Ke)&&(t[e]===Ke&&(a=-1),e++);for(var c=[];ke(t[e]);)c.push(t[e++]);var l=c.length?parseInt(he.apply(void 0,c),10):0;return A*(i+o*Math.pow(10,-s))*Math.pow(10,a*l)},v0={type:2},C0={type:3},w0={type:4},y0={type:13},b0={type:8},U0={type:21},Q0={type:9},E0={type:10},S0={type:11},T0={type:12},F0={type:14},cr={type:23},k0={type:1},I0={type:25},R0={type:24},x0={type:26},P0={type:27},L0={type:28},D0={type:29},_0={type:31},Oo={type:32},zu=function(){function t(){this._value=[]}return t.prototype.write=function(e){this._value=this._value.concat(ji(e))},t.prototype.read=function(){for(var e=[],A=this.consumeToken();A!==Oo;)e.push(A),A=this.consumeToken();return e},t.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case tr:return this.consumeStringToken(tr);case _B:var A=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);if(qu(A)||tt(n,i)){var r=ar(A,n,i)?PB:xB,s=this.consumeName();return{type:5,value:s,flags:r}}break;case HB:if(this.peekCodePoint(0)===Hn)return this.consumeCodePoint(),y0;break;case nr:return this.consumeStringToken(nr);case ir:return v0;case On:return C0;case _o:if(this.peekCodePoint(0)===Hn)return this.consumeCodePoint(),F0;break;case Et:if(Ho(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case zB:return w0;case Ke:var o=e,a=this.peekCodePoint(0),c=this.peekCodePoint(1);if(Ho(o,a,c))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(ar(o,a,c))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(a===Ke&&c===VB)return this.consumeCodePoint(),this.consumeCodePoint(),R0;break;case Mn:if(Ho(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Ku:if(this.peekCodePoint(0)===_o)for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(l===_o&&(l=this.consumeCodePoint(),l===Ku))return this.consumeToken();if(l===wA)return this.consumeToken()}break;case ZB:return x0;case e0:return P0;case KB:if(this.peekCodePoint(0)===NB&&this.peekCodePoint(1)===Ke&&this.peekCodePoint(2)===Ke)return this.consumeCodePoint(),this.consumeCodePoint(),I0;break;case GB:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),h=this.peekCodePoint(2);if(ar(u,d,h)){var s=this.consumeName();return{type:7,value:s}}break;case jB:return L0;case _n:if(tt(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case WB:return D0;case JB:if(this.peekCodePoint(0)===Hn)return this.consumeCodePoint(),b0;break;case XB:return S0;case $B:return T0;case a0:case l0:var g=this.peekCodePoint(0),f=this.peekCodePoint(1);return g===Et&&(Zt(f)||f===rr)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case Vu:if(this.peekCodePoint(0)===Hn)return this.consumeCodePoint(),Q0;if(this.peekCodePoint(0)===Vu)return this.consumeCodePoint(),U0;break;case YB:if(this.peekCodePoint(0)===Hn)return this.consumeCodePoint(),E0;break;case wA:return Oo}return sr(e)?(this.consumeWhiteSpace(),_0):ke(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):or(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:he(e)}},t.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},t.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},t.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},t.prototype.consumeUnicodeRangeToken=function(){for(var e=[],A=this.consumeCodePoint();Zt(A)&&e.length<6;)e.push(A),A=this.consumeCodePoint();for(var n=!1;A===rr&&e.length<6;)e.push(A),A=this.consumeCodePoint(),n=!0;if(n){var i=parseInt(he.apply(void 0,e.map(function(a){return a===rr?ju:a})),16),r=parseInt(he.apply(void 0,e.map(function(a){return a===rr?Yu:a})),16);return{type:30,start:i,end:r}}var s=parseInt(he.apply(void 0,e),16);if(this.peekCodePoint(0)===Ke&&Zt(this.peekCodePoint(1))){this.consumeCodePoint(),A=this.consumeCodePoint();for(var o=[];Zt(A)&&o.length<6;)o.push(A),A=this.consumeCodePoint();var r=parseInt(he.apply(void 0,o),16);return{type:30,start:s,end:r}}else return{type:30,start:s,end:s}},t.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===ir?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ir?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},t.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===wA)return{type:22,value:""};var A=this.peekCodePoint(0);if(A===nr||A===tr){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===wA||this.peekCodePoint(0)===On)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),cr)}for(;;){var i=this.consumeCodePoint();if(i===wA||i===On)return{type:22,value:he.apply(void 0,e)};if(sr(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===wA||this.peekCodePoint(0)===On?(this.consumeCodePoint(),{type:22,value:he.apply(void 0,e)}):(this.consumeBadUrlRemnants(),cr);if(i===tr||i===nr||i===ir||m0(i))return this.consumeBadUrlRemnants(),cr;if(i===_n)if(tt(i,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),cr;else e.push(i)}},t.prototype.consumeWhiteSpace=function(){for(;sr(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===On||e===wA)return;tt(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(e){for(var A=5e4,n="";e>0;){var i=Math.min(A,e);n+=he.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),n},t.prototype.consumeStringToken=function(e){var A="",n=0;do{var i=this._value[n];if(i===wA||i===void 0||i===e)return A+=this.consumeStringSlice(n),{type:0,value:A};if(i===Ar)return this._value.splice(0,n),k0;if(i===_n){var r=this._value[n+1];r!==wA&&r!==void 0&&(r===Ar?(A+=this.consumeStringSlice(n),n=-1,this._value.shift()):tt(i,r)&&(A+=this.consumeStringSlice(n),A+=he(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},t.prototype.consumeNumber=function(){var e=[],A=Dn,n=this.peekCodePoint(0);for((n===Et||n===Ke)&&e.push(this.consumeCodePoint());ke(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(n===Mn&&ke(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=Nu;ke(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),i=this.peekCodePoint(1);var r=this.peekCodePoint(2);if((n===$u||n===Ju)&&((i===Et||i===Ke)&&ke(r)||ke(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),A=Nu;ke(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[B0(e),A]},t.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),A=e[0],n=e[1],i=this.peekCodePoint(0),r=this.peekCodePoint(1),s=this.peekCodePoint(2);if(ar(i,r,s)){var o=this.consumeName();return{type:15,number:A,flags:n,unit:o}}return i===OB?(this.consumeCodePoint(),{type:16,number:A,flags:n}):{type:17,number:A,flags:n}},t.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Zt(e)){for(var A=he(e);Zt(this.peekCodePoint(0))&&A.length<6;)A+=he(this.consumeCodePoint());sr(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(A,16);return n===0||d0(n)||n>1114111?Gu:n}return e===wA?Gu:e},t.prototype.consumeName=function(){for(var e="";;){var A=this.consumeCodePoint();if(qu(A))e+=he(A);else if(tt(A,this.peekCodePoint(0)))e+=he(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(A),e}},t}(),Zu=function(){function t(e){this._tokens=e}return t.create=function(e){var A=new zu;return A.write(e),new t(A.read())},t.parseValue=function(e){return t.create(e).parseComponentValue()},t.parseValues=function(e){return t.create(e).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var A=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return A;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var e=[];;){var A=this.consumeComponentValue();if(A.type===32)return e;e.push(A),e.push()}},t.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},t.prototype.consumeSimpleBlock=function(e){for(var A={type:e,values:[]},n=this.consumeToken();;){if(n.type===32||O0(n,e))return A;this.reconsumeToken(n),A.values.push(this.consumeComponentValue()),n=this.consumeToken()}},t.prototype.consumeFunction=function(e){for(var A={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return A;this.reconsumeToken(n),A.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?Oo:e},t.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},t}(),nt=function(t){return t.type===15},pe=function(t){return t.type===17},V=function(t){return t.type===20},H0=function(t){return t.type===0},Mo=function(t,e){return V(t)&&t.value===e},ed=function(t){return t.type!==31},Qe=function(t){return t.type!==31&&t.type!==4},yA=function(t){var e=[],A=[];return t.forEach(function(n){if(n.type===4){if(A.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(A),A=[];return}n.type!==31&&A.push(n)}),A.length&&e.push(A),e},O0=function(t,e){return e===11&&t.type===12||e===28&&t.type===29?!0:e===2&&t.type===3},it=function(t){return t.type===17||t.type===15},ne=function(t){return t.type===16||it(t)},Ad=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},Ee={type:17,number:0,flags:Dn},No={type:16,number:50,flags:Dn},rt={type:16,number:100,flags:Dn},Nn=function(t,e,A){var n=t[0],i=t[1];return[Y(n,e),Y(typeof i<"u"?i:n,A)]},Y=function(t,e){if(t.type===16)return t.number/100*e;if(nt(t))switch(t.unit){case"rem":case"em":return 16*t.number;case"px":default:return t.number}return t.number},td="deg",nd="grad",id="rad",rd="turn",lr={name:"angle",parse:function(t,e){if(e.type===15)switch(e.unit){case td:return Math.PI*e.number/180;case nd:return Math.PI/200*e.number;case id:return e.number;case rd:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},sd=function(t){return t.type===15&&(t.unit===td||t.unit===nd||t.unit===id||t.unit===rd)},od=function(t){var e=t.filter(V).map(function(A){return A.value}).join(" ");switch(e){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Ee,Ee];case"to top":case"bottom":return Ye(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Ee,rt];case"to right":case"left":return Ye(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[rt,rt];case"to bottom":case"top":return Ye(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[rt,Ee];case"to left":case"right":return Ye(270)}return 0},Ye=function(t){return Math.PI*t/180},st=function(t){return(255&t)===0},we=function(t){var e=255&t,A=255&t>>8,n=255&t>>16,i=255&t>>24;return e<255?"rgba(".concat(i,",").concat(n,",").concat(A,",").concat(e/255,")"):"rgb(".concat(i,",").concat(n,",").concat(A,")")},bA=function(t,e,A,n){return(t<<24|e<<16|A<<8|Math.round(n*255)<<0)>>>0},ur=function(t,e){if(t.type===17)return t.number;if(t.type===16){var A=e===3?1:255;return e===3?t.number/100*A:Math.round(t.number/100*A)}return 0},St=function(t){return(t[0].type===20?t[0].value:"unknown")==="from"},ue=function(t,e,A){return Math.min(Math.max(t,e),A)},Ve=function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]},M0=function(t){return bA(ue(Math.round(t[0]*255),0,255),ue(Math.round(t[1]*255),0,255),ue(Math.round(t[2]*255),0,255),ue(t[3],0,1))},Ko=function(t){var e=t[0],A=t[1],n=t[2],i=t[3],r=Tt([e,A,n]);return bA(ue(Math.round(r[0]*255),0,255),ue(Math.round(r[1]*255),0,255),ue(Math.round(r[2]*255),0,255),i)},Kn=function(t){var e=ot([t[0],t[1],t[2]]);return Ko([e[0],e[1],e[2],t[3]])},N0=function(t,e){if(St(e.filter(Qe)))throw new Error("Relative color not supported for lab()");var A=dr(e),n=A[0],i=A[1],r=A[2],s=A[3],o=Tt(ot(gr([n,i,r])));return bA(ue(Math.round(o[0]*255),0,255),ue(Math.round(o[1]*255),0,255),ue(Math.round(o[2]*255),0,255),s)},K0=function(t,e){if(St(e.filter(Qe)))throw new Error("Relative color not supported for oklab()");var A=dr(e),n=A[0],i=A[1],r=A[2],s=A[3],o=Tt(ot(fr([n,i,r])));return bA(ue(Math.round(o[0]*255),0,255),ue(Math.round(o[1]*255),0,255),ue(Math.round(o[2]*255),0,255),s)},V0=function(t,e){if(St(e.filter(Qe)))throw new Error("Relative color not supported for oklch()");var A=ud(e),n=A[0],i=A[1],r=A[2],s=A[3],o=Tt(ot(fr(hr([n,i,r]))));return bA(ue(Math.round(o[0]*255),0,255),ue(Math.round(o[1]*255),0,255),ue(Math.round(o[2]*255),0,255),s)},G0=function(t,e){if(St(e.filter(Qe)))throw new Error("Relative color not supported for lch()");var A=ld(e),n=A[0],i=A[1],r=A[2],s=A[3],o=Tt(ot(gr(hr([n,i,r]))));return bA(ue(Math.round(o[0]*255),0,255),ue(Math.round(o[1]*255),0,255),ue(Math.round(o[2]*255),0,255),s)},ad=function(t,e){var A=e.filter(Qe),n=A[0],i=A[1],r=A[2],s=A[3],o=(n.type===17?Ye(n.number):lr.parse(t,n))/(Math.PI*2),a=ne(i)?i.number/100:0,c=ne(r)?r.number/100:0,l=typeof s<"u"&&ne(s)?Y(s,1):1;return[o,a,c,l]},cd=function(t,e){if(St(e))throw new Error("Relative color not supported for hsl()");var A=ad(t,e),n=A[0],i=A[1],r=A[2],s=A[3],o=hd([n,i,r]);return bA(o[0]*255,o[1]*255,o[2]*255,i===0?1:s)},ld=function(t){var e=t.filter(Qe),A=ne(e[0])?e[0].number:0,n=ne(e[1])?e[1].number:0,i=pe(e[2])||nt(e[2])?e[2].number:0,r=typeof e[4]<"u"&&ne(e[4])?Y(e[4],1):1;return[A,n,i,r]},dr=function(t){var e=t.filter(Qe),A=e[0].type===16?e[0].number/100:pe(e[0])?e[0].number:0,n=e[1].type===16?e[1].number/100:pe(e[1])?e[1].number:0,i=pe(e[2])||nt(e[2])?e[2].number:0,r=typeof e[4]<"u"&&ne(e[4])?Y(e[4],1):1;return[A,n,i,r]},ud=function(t){var e=t.filter(Qe),A=e[0].type===16?e[0].number/100:pe(e[0])?e[0].number:0,n=e[1].type===16?e[1].number/100:pe(e[1])?e[1].number:0,i=pe(e[2])||nt(e[2])?e[2].number:0,r=typeof e[4]<"u"&&ne(e[4])?Y(e[4],1):1;return[A,n,i,r]},dd=function(t){return Ve([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],t)},Vo=function(t){return Ve([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],t)},Go=function(t,e,A){return A<0&&(A+=1),A>=1&&(A-=1),A<1/6?(e-t)*A*6+t:A<1/2?e:A<2/3?(e-t)*6*(2/3-A)+t:t},hd=function(t){var e=t[0],A=t[1],n=t[2];if(A===0)return[n*255,n*255,n*255];var i=n<=.5?n*(A+1):n+A-n*A,r=n*2-i,s=Go(r,i,e+1/3),o=Go(r,i,e),a=Go(r,i,e-1/3);return[s,o,a]},hr=function(t){var e=t[0],A=t[1],n=t[2];return A<0&&(A=0),isNaN(n)&&(n=0),[e,A*Math.cos(n*Math.PI/180),A*Math.sin(n*Math.PI/180)]},fr=function(t){var e=Ve([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],t),A=e.map(function(n){return Math.pow(n,3)});return Ve([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],A)},gr=function(t){var e=(t[0]+16)/116,A=t[1]/500+e,n=e-t[2]/200,i=24389/27,r=24/116,s=[(A>r?Math.pow(A,3):(116*A-16)/i)*.3457/.3585,t[0]>8?Math.pow(e,3):t[0]/i,(n>r?Math.pow(n,3):(116*n-16)/i)*(1-.3457-.3585)/.3585];return Vo([s[0],s[1],s[2]])},j0=function(t,e){var A=e.filter(Qe);if(A.length===3){var n=A.map(ur),i=n[0],r=n[1],s=n[2],o=Wo([i/255,r/255,s/255]),a=jo([o[0],o[1],o[2]]),c=a[0],l=a[1],u=a[2];return[c,l,u,1]}if(A.length===4){var d=A.map(ur),i=d[0],r=d[1],s=d[2],h=d[3],o=Wo([i/255,r/255,s/255]),g=jo([o[0],o[1],o[2]]),c=g[0],l=g[1],u=g[2];return[c,l,u,h]}return[0,0,0,1]},W0=function(t,e){var A=ad(t,e),n=A[0],i=A[1],r=A[2],s=A[3],o=Wo(hd([n,i,r])),a=jo([o[0],o[1],o[2]]),c=a[0],l=a[1],u=a[2];return[c,l,u,s]},J0=function(t,e){var A=dr(e),n=A[0],i=A[1],r=A[2],s=A[3],o=gr([n,i,r]),a=o[0],c=o[1],l=o[2];return[a,c,l,s]},X0=function(t,e){var A=ld(e),n=A[0],i=A[1],r=A[2],s=A[3],o=gr(hr([n,i,r])),a=o[0],c=o[1],l=o[2];return[a,c,l,s]},$0=function(t,e){var A=ud(e),n=A[0],i=A[1],r=A[2],s=A[3],o=fr(hr([n,i,r])),a=o[0],c=o[1],l=o[2];return[a,c,l,s]},Y0=function(t,e){var A=dr(e),n=A[0],i=A[1],r=A[2],s=A[3],o=fr([n,i,r]),a=o[0],c=o[1],l=o[2];return[a,c,l,s]},q0=function(t){return Vo([t[0],t[1],t[2]])},fd=function(t){return t},z0=function(t){var e=dd([t[0],t[2],t[3]]),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},gd=function(t){return Kn([t[0],t[1],t[2],t[3]])},Z0=function(t){var e=q0([t[0],t[1],t[2]]);return Kn([e[0],e[1],e[2],t[3]])},ot=function(t){return Ve([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],t)},jo=function(t){return Ve([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],t)},Tt=function(t){return t.map(function(e){var A=e<0?-1:1,n=Math.abs(e);return n>.0031308?A*(1.055*Math.pow(n,1/2.4)-.055):12.92*e})},Wo=function(t){return t.map(function(e){var A=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:A*Math.pow((n+.055)/1.055,2.4)})},ev=function(t){var e=Tt(ot([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},Av=function(t){var e=ot([t[0],t[1],t[2]]),A=e[0],n=e[1],i=e[2];return[ue(Math.round(A*255),0,255),ue(Math.round(n*255),0,255),ue(Math.round(i*255),0,255),t[3]]},tv=function(t){return Ve([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],t)},nv=function(t){return Ve([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],t)},iv=function(t){return t.map(function(e){var A=e<0?-1:1,n=e*A;return n<=.04045?e/12.92:A*Math.pow((e+.055)/1.055,2.4)||0})},rv=function(t){return Tt(t)},sv=function(t){var e=iv([t[0],t[1],t[2]]);return tv([e[0],e[1],e[2]])},ov=function(t){var e=rv(nv([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},av=function(t){var e=sv([t[0],t[1],t[2]]);return Kn([e[0],e[1],e[2],t[3]])},cv=function(t){return Ve([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],t)},lv=function(t){return Ve([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],t)},uv=function(t){var e=t.map(function(A){var n=A<0?-1:1,i=Math.abs(A);return n*Math.pow(i,2.19921875)});return[e[0],e[1],e[2]]},dv=function(t){var e=t.map(function(A){var n=A<0?-1:1,i=Math.abs(A);return n*Math.pow(i,.4547069271758437)});return[e[0],e[1],e[2]]},hv=function(t){var e=dv(cv([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},fv=function(t){var e=ot(lv(uv([t[0],t[1],t[2]])));return Ko([e[0],e[1],e[2],t[3]])},gv=function(t){return Ve([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],t)},pv=function(t){return Ve([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],t)},mv=function(t){return t.map(function(e){return e<16/512?e/16:Math.pow(e,1.8)})},Bv=function(t){return t.map(function(e){return e>1/512?Math.pow(e,1/1.8):e*16})},vv=function(t){var e=mv([t[0],t[1],t[2]]);return Vo(gv([e[0],e[1],e[2]]))},Cv=function(t){var e=Bv(pv(dd([t[0],t[1],t[2]]))),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},wv=function(t){var e=vv([t[0],t[1],t[2]]);return Kn([e[0],e[1],e[2],t[3]])},pr=1.09929682680944,pd=.018053968510807,yv=function(t){return t.map(function(e){return e<pd*4.5?e/4.5:Math.pow((e+pr-1)/pr,1/.45)})},bv=function(t){return t.map(function(e){return e>=pd?pr*Math.pow(e,.45)-(pr-1):4.5*e})},Uv=function(t){return Ve([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],t)},Qv=function(t){return Ve([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],t)},Ev=function(t){var e=yv([t[0],t[1],t[2]]);return Uv([e[0],e[1],e[2]])},Sv=function(t){var e=bv(Qv([t[0],t[1],t[2]])),A=e[0],n=e[1],i=e[2];return[A,n,i,t[3]]},Tv=function(t){var e=Ev([t[0],t[1],t[2]]);return Kn([e[0],e[1],e[2],t[3]])},at={name:"color",parse:function(t,e){if(e.type===18){var A=Rv[e.name];if(typeof A>"u")throw new Error('Attempting to parse an unsupported color function "'.concat(e.name,'"'));return A(t,e.values)}if(e.type===5){var n=md(e),i=n[0],r=n[1],s=n[2],o=n[3];return bA(i,r,s,o)}if(e.type===20){var a=UA[e.value.toUpperCase()];if(typeof a<"u")return a}return UA.TRANSPARENT}},md=function(t){if(t.value.length===3){var e=t.value.substring(0,1),A=t.value.substring(1,2),n=t.value.substring(2,3);return[parseInt(e+e,16),parseInt(A+A,16),parseInt(n+n,16),1]}if(t.value.length===4){var e=t.value.substring(0,1),A=t.value.substring(1,2),n=t.value.substring(2,3),i=t.value.substring(3,4);return[parseInt(e+e,16),parseInt(A+A,16),parseInt(n+n,16),parseInt(i+i,16)/255]}if(t.value.length===6){var e=t.value.substring(0,2),A=t.value.substring(2,4),n=t.value.substring(4,6);return[parseInt(e,16),parseInt(A,16),parseInt(n,16),1]}if(t.value.length===8){var e=t.value.substring(0,2),A=t.value.substring(2,4),n=t.value.substring(4,6),i=t.value.substring(6,8);return[parseInt(e,16),parseInt(A,16),parseInt(n,16),parseInt(i,16)/255]}return[0,0,0,1]},Bd=function(t,e){var A=e.filter(Qe);if(St(A))throw new Error("Relative color not supported for rgb()");if(A.length===3){var n=A.map(ur),i=n[0],r=n[1],s=n[2];return bA(i,r,s,1)}if(A.length===4){var o=A.map(ur),i=o[0],r=o[1],s=o[2],a=o[3];return bA(i,r,s,a)}return 0},Fv=function(t,e){var A=e.filter(Qe),n=A[0].type===20?A[0].value:"unknown",i=!St(A);if(i){var r=n,s=vd[r];if(typeof s>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(r,'" for color() function'));var o=pe(A[1])?A[1].number:0,a=pe(A[2])?A[2].number:0,c=pe(A[3])?A[3].number:0,l=A.length>4&&A[4].type===6&&A[4].value==="/"&&pe(A[5])?A[5].number:1;return s([o,a,c,l])}else{var u=function(oe,ie){if(pe(ie))return ie.number;var EA=function(Pe){return Pe==="r"||Pe==="x"?0:Pe==="g"||Pe==="y"?1:2};if(V(ie)){var Ie=EA(ie.value);return oe[Ie]}var Te=function(Pe){for(var HA=Pe.filter(Qe),fA="(",Le=0,hn=HA;Le<hn.length;Le++){var AA=hn[Le];fA+=AA.type===18&&AA.name==="calc"?Te(AA.values):pe(AA)?AA.number:AA.type===6||V(AA)?AA.value:""}return fA+=")",fA};if(ie.type===18){var _A=ie.values.filter(Qe);if(ie.name==="calc"){var eA=Te(_A).replace(/r|x/,oe[0].toString()).replace(/g|y/,oe[1].toString()).replace(/b|z/,oe[2].toString());return new Function("return "+eA)()}}return null},d=A[1].type===18?A[1].name:V(A[1])||A[1].type===5?"rgb":"unknown",h=V(A[2])?A[2].value:"unknown",g=A[1].type===18?A[1].values:V(A[1])?[A[1]]:[];if(V(A[1])){var f=UA[A[1].value.toUpperCase()];if(typeof f>"u")throw new Error("Attempting to use unknown color in relative color 'from'");var p=en(t,A[1].value),B=255&p,y=255&p>>8,b=255&p>>16,v=255&p>>24;g=[{type:17,number:v,flags:1},{type:17,number:b,flags:1},{type:17,number:y,flags:1},{type:17,number:B>1?B/255:B,flags:1}]}else if(A[1].type===5){var C=md(A[1]),v=C[0],b=C[1],y=C[2],B=C[3];g=[{type:17,number:v,flags:1},{type:17,number:b,flags:1},{type:17,number:y,flags:1},{type:17,number:B>1?B/255:B,flags:1}]}if(g.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(h==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");var w=kv[d],Q=Iv[h],F=vd[h];if(typeof w>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(d,'" for color() function'));if(typeof Q>"u")throw new Error('Attempting to parse an unsupported color space "'.concat(h,'" for color() function'));var R=w(t,g),D=Q(R),o=u(D,A[3]),a=u(D,A[4]),c=u(D,A[5]),l=A.length>6&&A[6].type===6&&A[6].value==="/"&&pe(A[7])?A[7].number:1;if(o===null||a===null||c===null)throw new Error("Invalid relative color in color() function");return F([o,a,c,l])}},vd={srgb:M0,"srgb-linear":Ko,"display-p3":av,"a98-rgb":fv,"prophoto-rgb":wv,xyz:gd,"xyz-d50":Z0,"xyz-d65":gd,rec2020:Tv},kv={rgb:j0,hsl:W0,lab:J0,lch:X0,oklab:Y0,oklch:$0},Iv={srgb:ev,"srgb-linear":Av,"display-p3":ov,"a98-rgb":hv,"prophoto-rgb":Cv,xyz:fd,"xyz-d50":z0,"xyz-d65":fd,rec2020:Sv},Rv={hsl:cd,hsla:cd,rgb:Bd,rgba:Bd,lch:G0,oklch:V0,oklab:K0,lab:N0,color:Fv},en=function(t,e){return at.parse(t,Zu.create(e).parseComponentValue())},UA={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},xv={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(A){if(V(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Pv={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},mr=function(t,e){var A=at.parse(t,e[0]),n=e[1];return n&&ne(n)?{color:A,stop:n}:{color:A,stop:null}},Cd=function(t,e){var A=t[0],n=t[t.length-1];A.stop===null&&(A.stop=Ee),n.stop===null&&(n.stop=rt);for(var i=[],r=0,s=0;s<t.length;s++){var o=t[s].stop;if(o!==null){var a=Y(o,e);a>r?i.push(a):i.push(r),r=a}else i.push(null)}for(var c=null,s=0;s<i.length;s++){var l=i[s];if(l===null)c===null&&(c=s);else if(c!==null){for(var u=s-c,d=i[c-1],h=(l-d)/(u+1),g=1;g<=u;g++)i[c+g-1]=h*g;c=null}}return t.map(function(f,p){var B=f.color;return{color:B,stop:Math.max(Math.min(1,i[p]/e),0)}})},Lv=function(t,e,A){var n=e/2,i=A/2,r=Y(t[0],e)-n,s=i-Y(t[1],A);return(Math.atan2(s,r)+Math.PI*2)%(Math.PI*2)},Dv=function(t,e,A){var n=typeof t=="number"?t:Lv(t,e,A),i=Math.abs(e*Math.sin(n))+Math.abs(A*Math.cos(n)),r=e/2,s=A/2,o=i/2,a=Math.sin(n-Math.PI/2)*o,c=Math.cos(n-Math.PI/2)*o;return[i,r-c,r+c,s-a,s+a]},dA=function(t,e){return Math.sqrt(t*t+e*e)},wd=function(t,e,A,n,i){var r=[[0,0],[0,e],[t,0],[t,e]];return r.reduce(function(s,o){var a=o[0],c=o[1],l=dA(A-a,n-c);return(i?l<s.optimumDistance:l>s.optimumDistance)?{optimumCorner:o,optimumDistance:l}:s},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},_v=function(t,e,A,n,i){var r=0,s=0;switch(t.size){case 0:t.shape===0?r=s=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(A),Math.abs(A-i)):t.shape===1&&(r=Math.min(Math.abs(e),Math.abs(e-n)),s=Math.min(Math.abs(A),Math.abs(A-i)));break;case 2:if(t.shape===0)r=s=Math.min(dA(e,A),dA(e,A-i),dA(e-n,A),dA(e-n,A-i));else if(t.shape===1){var o=Math.min(Math.abs(A),Math.abs(A-i))/Math.min(Math.abs(e),Math.abs(e-n)),a=wd(n,i,e,A,!0),c=a[0],l=a[1];r=dA(c-e,(l-A)/o),s=o*r}break;case 1:t.shape===0?r=s=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(A),Math.abs(A-i)):t.shape===1&&(r=Math.max(Math.abs(e),Math.abs(e-n)),s=Math.max(Math.abs(A),Math.abs(A-i)));break;case 3:if(t.shape===0)r=s=Math.max(dA(e,A),dA(e,A-i),dA(e-n,A),dA(e-n,A-i));else if(t.shape===1){var o=Math.max(Math.abs(A),Math.abs(A-i))/Math.max(Math.abs(e),Math.abs(e-n)),u=wd(n,i,e,A,!1),c=u[0],l=u[1];r=dA(c-e,(l-A)/o),s=o*r}break}return Array.isArray(t.size)&&(r=Y(t.size[0],n),s=t.size.length===2?Y(t.size[1],i):r),[r,s]},Hv=function(t,e){var A=Ye(180),n=[];return yA(e).forEach(function(i,r){if(r===0){var s=i[0];if(s.type===20&&s.value==="to"){A=od(i);return}else if(sd(s)){A=lr.parse(t,s);return}}var o=mr(t,i);n.push(o)}),{angle:A,stops:n,type:1}},Br=function(t,e){var A=Ye(180),n=[];return yA(e).forEach(function(i,r){if(r===0){var s=i[0];if(s.type===20&&["top","left","right","bottom"].indexOf(s.value)!==-1){A=od(i);return}else if(sd(s)){A=(lr.parse(t,s)+Ye(270))%Ye(360);return}}var o=mr(t,i);n.push(o)}),{angle:A,stops:n,type:1}},Ov=function(t,e){var A=Ye(180),n=[],i=1,r=0,s=3,o=[];return yA(e).forEach(function(a,c){var l=a[0];if(c===0){if(V(l)&&l.value==="linear"){i=1;return}else if(V(l)&&l.value==="radial"){i=2;return}}if(l.type===18){if(l.name==="from"){var u=at.parse(t,l.values[0]);n.push({stop:Ee,color:u})}else if(l.name==="to"){var u=at.parse(t,l.values[0]);n.push({stop:rt,color:u})}else if(l.name==="color-stop"){var d=l.values.filter(Qe);if(d.length===2){var u=at.parse(t,d[1]),h=d[0];pe(h)&&n.push({stop:{type:16,number:h.number*100,flags:h.flags},color:u})}}}}),i===1?{angle:(A+Ye(180))%Ye(360),stops:n,type:i}:{size:s,shape:r,stops:n,position:o,type:i}},yd="closest-side",bd="farthest-side",Ud="closest-corner",Qd="farthest-corner",Ed="circle",Sd="ellipse",Td="cover",Fd="contain",Mv=function(t,e){var A=0,n=3,i=[],r=[];return yA(e).forEach(function(s,o){var a=!0;if(o===0){var c=!1;a=s.reduce(function(u,d){if(c)if(V(d))switch(d.value){case"center":return r.push(No),u;case"top":case"left":return r.push(Ee),u;case"right":case"bottom":return r.push(rt),u}else(ne(d)||it(d))&&r.push(d);else if(V(d))switch(d.value){case Ed:return A=0,!1;case Sd:return A=1,!1;case"at":return c=!0,!1;case yd:return n=0,!1;case Td:case bd:return n=1,!1;case Fd:case Ud:return n=2,!1;case Qd:return n=3,!1}else if(it(d)||ne(d))return Array.isArray(n)||(n=[]),n.push(d),!1;return u},a)}if(a){var l=mr(t,s);i.push(l)}}),{size:n,shape:A,stops:i,position:r,type:2}},vr=function(t,e){var A=0,n=3,i=[],r=[];return yA(e).forEach(function(s,o){var a=!0;if(o===0?a=s.reduce(function(l,u){if(V(u))switch(u.value){case"center":return r.push(No),!1;case"top":case"left":return r.push(Ee),!1;case"right":case"bottom":return r.push(rt),!1}else if(ne(u)||it(u))return r.push(u),!1;return l},a):o===1&&(a=s.reduce(function(l,u){if(V(u))switch(u.value){case Ed:return A=0,!1;case Sd:return A=1,!1;case Fd:case yd:return n=0,!1;case bd:return n=1,!1;case Ud:return n=2,!1;case Td:case Qd:return n=3,!1}else if(it(u)||ne(u))return Array.isArray(n)||(n=[]),n.push(u),!1;return l},a)),a){var c=mr(t,s);i.push(c)}}),{size:n,shape:A,stops:i,position:r,type:2}},Nv=function(t){return t.type===1},Kv=function(t){return t.type===2},Jo={name:"image",parse:function(t,e){if(e.type===22){var A={url:e.value,type:0};return t.cache.addImage(e.value),A}if(e.type===18){var n=kd[e.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported image function "'.concat(e.name,'"'));return n(t,e.values)}throw new Error("Unsupported image type ".concat(e.type))}};function Vv(t){return!(t.type===20&&t.value==="none")&&(t.type!==18||!!kd[t.name])}var kd={"linear-gradient":Hv,"-moz-linear-gradient":Br,"-ms-linear-gradient":Br,"-o-linear-gradient":Br,"-webkit-linear-gradient":Br,"radial-gradient":Mv,"-moz-radial-gradient":vr,"-ms-radial-gradient":vr,"-o-radial-gradient":vr,"-webkit-radial-gradient":vr,"-webkit-gradient":Ov},Gv={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var A=e[0];return A.type===20&&A.value==="none"?[]:e.filter(function(n){return Qe(n)&&Vv(n)}).map(function(n){return Jo.parse(t,n)})}},jv={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,e){return e.map(function(A){if(V(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Wv={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,e){return yA(e).map(function(A){return A.filter(ne)}).map(Ad)}},Jv={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,e){return yA(e).map(function(A){return A.filter(V).map(function(n){return n.value}).join(" ")}).map(Xv)}},Xv=function(t){switch(t){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},An;(function(t){t.AUTO="auto",t.CONTAIN="contain",t.COVER="cover"})(An||(An={}));var $v={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,e){return yA(e).map(function(A){return A.filter(Yv)})}},Yv=function(t){return V(t)||ne(t)},Cr=function(t){return{name:"border-".concat(t,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},qv=Cr("top"),zv=Cr("right"),Zv=Cr("bottom"),eC=Cr("left"),wr=function(t){return{name:"border-radius-".concat(t),initialValue:"0 0",prefix:!1,type:1,parse:function(e,A){return Ad(A.filter(ne))}}},AC=wr("top-left"),tC=wr("top-right"),nC=wr("bottom-right"),iC=wr("bottom-left"),yr=function(t){return{name:"border-".concat(t,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(e,A){switch(A){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},rC=yr("top"),sC=yr("right"),oC=yr("bottom"),aC=yr("left"),br=function(t){return{name:"border-".concat(t,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(e,A){return nt(A)?A.number:0}}},cC=br("top"),lC=br("right"),uC=br("bottom"),dC=br("left"),hC={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fC={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,e){switch(e){case"rtl":return 1;case"ltr":default:return 0}}},gC={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,e){return e.filter(V).reduce(function(A,n){return A|pC(n.value)},0)}},pC=function(t){switch(t){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},mC={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},BC={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,e){return e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0}},Ur;(function(t){t.NORMAL="normal",t.STRICT="strict"})(Ur||(Ur={}));var vC={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"strict":return Ur.STRICT;case"normal":default:return Ur.NORMAL}}},CC={name:"line-height",initialValue:"normal",prefix:!1,type:4},Id=function(t,e){return V(t)&&t.value==="normal"?1.2*e:t.type===17?e*t.number:ne(t)?Y(t,e):e},wC={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,e){return e.type===20&&e.value==="none"?null:Jo.parse(t,e)}},yC={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,e){switch(e){case"inside":return 0;case"outside":default:return 1}}},Xo={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},Qr=function(t){return{name:"margin-".concat(t),initialValue:"0",prefix:!1,type:4}},bC=Qr("top"),UC=Qr("right"),QC=Qr("bottom"),EC=Qr("left"),SC={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,e){return e.filter(V).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},TC={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-word":return"break-word";case"normal":default:return"normal"}}},Er=function(t){return{name:"padding-".concat(t),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},FC=Er("top"),kC=Er("right"),IC=Er("bottom"),RC=Er("left"),xC={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,e){switch(e){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},PC={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},LC={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.length===1&&Mo(e[0],"none")?[]:yA(e).map(function(A){for(var n={color:UA.TRANSPARENT,offsetX:Ee,offsetY:Ee,blur:Ee},i=0,r=0;r<A.length;r++){var s=A[r];it(s)?(i===0?n.offsetX=s:i===1?n.offsetY=s:n.blur=s,i++):n.color=at.parse(t,s)}return n})}},DC={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},_C={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(t,e){if(e.type===20&&e.value==="none")return null;if(e.type===18){var A=MC[e.name];if(typeof A>"u")throw new Error('Attempting to parse an unsupported transform function "'.concat(e.name,'"'));return A(e.values)}return null}},HC=function(t){var e=t.filter(function(A){return A.type===17}).map(function(A){return A.number});return e.length===6?e:null},OC=function(t){var e=t.filter(function(a){return a.type===17}).map(function(a){return a.number}),A=e[0],n=e[1];e[2],e[3];var i=e[4],r=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var s=e[12],o=e[13];return e[14],e[15],e.length===16?[A,n,i,r,s,o]:null},MC={matrix:HC,matrix3d:OC},Rd={type:16,number:50,flags:Dn},NC=[Rd,Rd],KC={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,e){var A=e.filter(ne);return A.length!==2?NC:[A[0],A[1]]}},VC={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,e){switch(e){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},Vn;(function(t){t.NORMAL="normal",t.BREAK_ALL="break-all",t.KEEP_ALL="keep-all"})(Vn||(Vn={}));for(var GC={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"break-all":return Vn.BREAK_ALL;case"keep-all":return Vn.KEEP_ALL;case"normal":default:return Vn.NORMAL}}},jC={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,e){if(e.type===20)return{auto:!0,order:0};if(pe(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},xd={name:"time",parse:function(t,e){if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},WC={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,e){return pe(e)?e.number:1}},JC={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},XC={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,e){return e.filter(V).map(function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(A){return A!==0})}},$C={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,e){var A=[],n=[];return e.forEach(function(i){switch(i.type){case 20:case 0:A.push(i.value);break;case 17:A.push(i.number.toString());break;case 4:n.push(A.join(" ")),A.length=0;break}}),A.length&&n.push(A.join(" ")),n.map(function(i){return i.indexOf(" ")===-1?i:"'".concat(i,"'")})}},YC={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},qC={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,e){if(pe(e))return e.number;if(V(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},zC={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.filter(V).map(function(A){return A.value})}},ZC={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},ve=function(t,e){return(t&e)!==0},ew={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(t,e){if(e.length===0)return[];var A=e[0];return A.type===20&&A.value==="none"?[]:e}},Aw={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return null;var A=e[0];if(A.type===20&&A.value==="none")return null;for(var n=[],i=e.filter(ed),r=0;r<i.length;r++){var s=i[r],o=i[r+1];if(s.type===20){var a=o&&pe(o)?o.number:1;n.push({counter:s.value,increment:a})}}return n}},tw={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return[];for(var A=[],n=e.filter(ed),i=0;i<n.length;i++){var r=n[i],s=n[i+1];if(V(r)&&r.value!=="none"){var o=s&&pe(s)?s.number:0;A.push({counter:r.value,reset:o})}}return A}},nw={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(t,e){return e.filter(nt).map(function(A){return xd.parse(t,A)})}},iw={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(t,e){if(e.length===0)return null;var A=e[0];if(A.type===20&&A.value==="none")return null;var n=[],i=e.filter(H0);if(i.length%2!==0)return null;for(var r=0;r<i.length;r+=2){var s=i[r].value,o=i[r+1].value;n.push({open:s,close:o})}return n}},Pd=function(t,e,A){if(!t)return"";var n=t[Math.min(e,t.length-1)];return n?A?n.open:n.close:""},rw={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,e){return e.length===1&&Mo(e[0],"none")?[]:yA(e).map(function(A){for(var n={color:255,offsetX:Ee,offsetY:Ee,blur:Ee,spread:Ee,inset:!1},i=0,r=0;r<A.length;r++){var s=A[r];Mo(s,"inset")?n.inset=!0:it(s)?(i===0?n.offsetX=s:i===1?n.offsetY=s:i===2?n.blur=s:n.spread=s,i++):n.color=at.parse(t,s)}return n})}},sw={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(t,e){var A=[0,1,2],n=[];return e.filter(V).forEach(function(i){switch(i.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2);break}}),A.forEach(function(i){n.indexOf(i)===-1&&n.push(i)}),n}},ow={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},aw={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(t,e){return nt(e)?e.number:0}},cw={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(t,e){return e.filter(V).reduce(function(A,n){return A|lw(n.value)},0)}},lw=function(t){switch(t){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},uw=function(){function t(e,A){var n,i;this.animationDuration=L(e,nw,A.animationDuration),this.backgroundClip=L(e,xv,A.backgroundClip),this.backgroundColor=L(e,Pv,A.backgroundColor),this.backgroundImage=L(e,Gv,A.backgroundImage),this.backgroundOrigin=L(e,jv,A.backgroundOrigin),this.backgroundPosition=L(e,Wv,A.backgroundPosition),this.backgroundRepeat=L(e,Jv,A.backgroundRepeat),this.backgroundSize=L(e,$v,A.backgroundSize),this.borderTopColor=L(e,qv,A.borderTopColor),this.borderRightColor=L(e,zv,A.borderRightColor),this.borderBottomColor=L(e,Zv,A.borderBottomColor),this.borderLeftColor=L(e,eC,A.borderLeftColor),this.borderTopLeftRadius=L(e,AC,A.borderTopLeftRadius),this.borderTopRightRadius=L(e,tC,A.borderTopRightRadius),this.borderBottomRightRadius=L(e,nC,A.borderBottomRightRadius),this.borderBottomLeftRadius=L(e,iC,A.borderBottomLeftRadius),this.borderTopStyle=L(e,rC,A.borderTopStyle),this.borderRightStyle=L(e,sC,A.borderRightStyle),this.borderBottomStyle=L(e,oC,A.borderBottomStyle),this.borderLeftStyle=L(e,aC,A.borderLeftStyle),this.borderTopWidth=L(e,cC,A.borderTopWidth),this.borderRightWidth=L(e,lC,A.borderRightWidth),this.borderBottomWidth=L(e,uC,A.borderBottomWidth),this.borderLeftWidth=L(e,dC,A.borderLeftWidth),this.boxShadow=L(e,rw,A.boxShadow),this.color=L(e,hC,A.color),this.direction=L(e,fC,A.direction),this.display=L(e,gC,A.display),this.float=L(e,mC,A.cssFloat),this.fontFamily=L(e,$C,A.fontFamily),this.fontSize=L(e,YC,A.fontSize),this.fontStyle=L(e,ZC,A.fontStyle),this.fontVariant=L(e,zC,A.fontVariant),this.fontWeight=L(e,qC,A.fontWeight),this.letterSpacing=L(e,BC,A.letterSpacing),this.lineBreak=L(e,vC,A.lineBreak),this.lineHeight=L(e,CC,A.lineHeight),this.listStyleImage=L(e,wC,A.listStyleImage),this.listStylePosition=L(e,yC,A.listStylePosition),this.listStyleType=L(e,Xo,A.listStyleType),this.marginTop=L(e,bC,A.marginTop),this.marginRight=L(e,UC,A.marginRight),this.marginBottom=L(e,QC,A.marginBottom),this.marginLeft=L(e,EC,A.marginLeft),this.opacity=L(e,WC,A.opacity);var r=L(e,SC,A.overflow);this.overflowX=r[0],this.overflowY=r[r.length>1?1:0],this.overflowWrap=L(e,TC,A.overflowWrap),this.paddingTop=L(e,FC,A.paddingTop),this.paddingRight=L(e,kC,A.paddingRight),this.paddingBottom=L(e,IC,A.paddingBottom),this.paddingLeft=L(e,RC,A.paddingLeft),this.paintOrder=L(e,sw,A.paintOrder),this.position=L(e,PC,A.position),this.textAlign=L(e,xC,A.textAlign),this.textDecorationColor=L(e,JC,(n=A.textDecorationColor)!==null&&n!==void 0?n:A.color),this.textDecorationLine=L(e,XC,(i=A.textDecorationLine)!==null&&i!==void 0?i:A.textDecoration),this.textShadow=L(e,LC,A.textShadow),this.textTransform=L(e,DC,A.textTransform),this.transform=L(e,_C,A.transform),this.transformOrigin=L(e,KC,A.transformOrigin),this.visibility=L(e,VC,A.visibility),this.webkitTextStrokeColor=L(e,ow,A.webkitTextStrokeColor),this.webkitTextStrokeWidth=L(e,aw,A.webkitTextStrokeWidth),this.wordBreak=L(e,GC,A.wordBreak),this.zIndex=L(e,jC,A.zIndex),this.objectFit=L(e,cw,A.objectFit)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},t.prototype.isTransparent=function(){return st(this.backgroundColor)},t.prototype.isTransformed=function(){return this.transform!==null},t.prototype.isPositioned=function(){return this.position!==0},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return this.float!==0},t.prototype.isInlineLevel=function(){return ve(this.display,4)||ve(this.display,33554432)||ve(this.display,268435456)||ve(this.display,536870912)||ve(this.display,67108864)||ve(this.display,134217728)},t}(),dw=function(){function t(e,A){this.content=L(e,ew,A.content),this.quotes=L(e,iw,A.quotes)}return t}(),Ld=function(){function t(e,A){this.counterIncrement=L(e,Aw,A.counterIncrement),this.counterReset=L(e,tw,A.counterReset)}return t}(),L=function(t,e,A){var n=new zu,i=A!==null&&typeof A<"u"?A.toString():e.initialValue;n.write(i);var r=new Zu(n.read());switch(e.type){case 2:var s=r.parseComponentValue();return e.parse(t,V(s)?s.value:e.initialValue);case 0:return e.parse(t,r.parseComponentValue());case 1:return e.parse(t,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return lr.parse(t,r.parseComponentValue());case"color":return at.parse(t,r.parseComponentValue());case"image":return Jo.parse(t,r.parseComponentValue());case"length":var o=r.parseComponentValue();return it(o)?o:Ee;case"length-percentage":var a=r.parseComponentValue();return ne(a)?a:Ee;case"time":return xd.parse(t,r.parseComponentValue())}break}},hw="data-html2canvas-debug",fw=function(t){var e=t.getAttribute(hw);switch(e){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},$o=function(t,e){var A=fw(t);return A===1||e===A},QA=function(){function t(e,A){if(this.context=e,this.textNodes=[],this.elements=[],this.flags=0,$o(A,3))debugger;this.styles=new uw(e,window.getComputedStyle(A,null)),ca(A)&&(this.styles.animationDuration.some(function(n){return n>0})&&(A.style.animationDuration="0s"),this.styles.transform!==null&&(A.style.transform="none")),this.bounds=Gi(this.context,A),$o(A,4)&&(this.flags|=16)}return t}(),gw="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Dd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Sr=0;Sr<Dd.length;Sr++)Gn[Dd.charCodeAt(Sr)]=Sr;for(var pw=function(t){var e=t.length*.75,A=t.length,n,i=0,r,s,o,a;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),l=Array.isArray(c)?c:new Uint8Array(c);for(n=0;n<A;n+=4)r=Gn[t.charCodeAt(n)],s=Gn[t.charCodeAt(n+1)],o=Gn[t.charCodeAt(n+2)],a=Gn[t.charCodeAt(n+3)],l[i++]=r<<2|s>>4,l[i++]=(s&15)<<4|o>>2,l[i++]=(o&3)<<6|a&63;return c},mw=function(t){for(var e=t.length,A=[],n=0;n<e;n+=2)A.push(t[n+1]<<8|t[n]);return A},Bw=function(t){for(var e=t.length,A=[],n=0;n<e;n+=4)A.push(t[n+3]<<24|t[n+2]<<16|t[n+1]<<8|t[n]);return A},Ft=5,Yo=6+5,qo=2,vw=Yo-Ft,_d=65536>>Ft,Cw=1<<Ft,zo=Cw-1,ww=1024>>Ft,yw=_d+ww,bw=yw,Uw=32,Qw=bw+Uw,Ew=65536>>Yo,Sw=1<<vw,Tw=Sw-1,Hd=function(t,e,A){return t.slice?t.slice(e,A):new Uint16Array(Array.prototype.slice.call(t,e,A))},Fw=function(t,e,A){return t.slice?t.slice(e,A):new Uint32Array(Array.prototype.slice.call(t,e,A))},kw=function(t,e){var A=pw(t),n=Array.isArray(A)?Bw(A):new Uint32Array(A),i=Array.isArray(A)?mw(A):new Uint16Array(A),r=24,s=Hd(i,r/2,n[4]/2),o=n[5]===2?Hd(i,(r+n[4])/2):Fw(n,Math.ceil((r+n[4])/4));return new Iw(n[0],n[1],n[2],n[3],s,o)},Iw=function(){function t(e,A,n,i,r,s){this.initialValue=e,this.errorValue=A,this.highStart=n,this.highValueIndex=i,this.index=r,this.data=s}return t.prototype.get=function(e){var A;if(e>=0){if(e<55296||e>56319&&e<=65535)return A=this.index[e>>Ft],A=(A<<qo)+(e&zo),this.data[A];if(e<=65535)return A=this.index[_d+(e-55296>>Ft)],A=(A<<qo)+(e&zo),this.data[A];if(e<this.highStart)return A=Qw-Ew+(e>>Yo),A=this.index[A],A+=e>>Ft&Tw,A=this.index[A],A=(A<<qo)+(e&zo),this.data[A];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),Od="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Rw=typeof Uint8Array>"u"?[]:new Uint8Array(256),Tr=0;Tr<Od.length;Tr++)Rw[Od.charCodeAt(Tr)]=Tr;var xw=1,Zo=2,ea=3,Md=4,Nd=5,Pw=7,Kd=8,Aa=9,ta=10,Vd=11,Gd=12,jd=13,Wd=14,na=15,Lw=function(t){for(var e=[],A=0,n=t.length;A<n;){var i=t.charCodeAt(A++);if(i>=55296&&i<=56319&&A<n){var r=t.charCodeAt(A++);(r&64512)===56320?e.push(((i&1023)<<10)+(r&1023)+65536):(e.push(i),A--)}else e.push(i)}return e},Dw=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var A=t.length;if(!A)return"";for(var n=[],i=-1,r="";++i<A;){var s=t[i];s<=65535?n.push(s):(s-=65536,n.push((s>>10)+55296,s%1024+56320)),(i+1===A||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},_w=kw(gw),qe="×",ia="÷",Hw=function(t){return _w.get(t)},Ow=function(t,e,A){var n=A-2,i=e[n],r=e[A-1],s=e[A];if(r===Zo&&s===ea)return qe;if(r===Zo||r===ea||r===Md||s===Zo||s===ea||s===Md)return ia;if(r===Kd&&[Kd,Aa,Vd,Gd].indexOf(s)!==-1||(r===Vd||r===Aa)&&(s===Aa||s===ta)||(r===Gd||r===ta)&&s===ta||s===jd||s===Nd||s===Pw||r===xw)return qe;if(r===jd&&s===Wd){for(;i===Nd;)i=e[--n];if(i===Wd)return qe}if(r===na&&s===na){for(var o=0;i===na;)o++,i=e[--n];if(o%2===0)return qe}return ia},Mw=function(t){var e=Lw(t),A=e.length,n=0,i=0,r=e.map(Hw);return{next:function(){if(n>=A)return{done:!0,value:null};for(var s=qe;n<A&&(s=Ow(e,r,++n))===qe;);if(s!==qe||n===A){var o=Dw.apply(null,e.slice(i,n));return i=n,{value:o,done:!1}}return{done:!0,value:null}}}},Nw=function(t){for(var e=Mw(t),A=[],n;!(n=e.next()).done;)n.value&&A.push(n.value.slice());return A},Kw=function(t){var e=123;if(t.createRange){var A=t.createRange();if(A.getBoundingClientRect){var n=t.createElement("boundtest");n.style.height="".concat(e,"px"),n.style.display="block",t.body.appendChild(n),A.selectNode(n);var i=A.getBoundingClientRect(),r=Math.round(i.height);if(t.body.removeChild(n),r===e)return!0}}return!1},Vw=function(t){var e=t.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",t.body.appendChild(e);var A=t.createRange();e.innerHTML=typeof"".repeat=="function"?"👨".repeat(10):"";var n=e.firstChild,i=ji(n.data).map(function(a){return he(a)}),r=0,s={},o=i.every(function(a,c){A.setStart(n,r),A.setEnd(n,r+a.length);var l=A.getBoundingClientRect();r+=a.length;var u=l.x>s.x||l.y>s.y;return s=l,c===0?!0:u});return t.body.removeChild(e),o},Gw=function(){return typeof new Image().crossOrigin<"u"},jw=function(){return typeof new XMLHttpRequest().responseType=="string"},Ww=function(t){var e=new Image,A=t.createElement("canvas"),n=A.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),A.toDataURL()}catch{return!1}return!0},Jd=function(t){return t[0]===0&&t[1]===255&&t[2]===0&&t[3]===255},Jw=function(t){var e=t.createElement("canvas"),A=100;e.width=A,e.height=A;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,A,A);var i=new Image,r=e.toDataURL();i.src=r;var s=ra(A,A,0,0,i);return n.fillStyle="red",n.fillRect(0,0,A,A),Xd(s).then(function(o){n.drawImage(o,0,0);var a=n.getImageData(0,0,A,A).data;n.fillStyle="red",n.fillRect(0,0,A,A);var c=t.createElement("div");return c.style.backgroundImage="url(".concat(r,")"),c.style.height="".concat(A,"px"),Jd(a)?Xd(ra(A,A,0,0,c)):Promise.reject(!1)}).then(function(o){return n.drawImage(o,0,0),Jd(n.getImageData(0,0,A,A).data)}).catch(function(){return!1})},ra=function(t,e,A,n,i){var r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return s.setAttributeNS(null,"width",t.toString()),s.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",A.toString()),o.setAttributeNS(null,"y",n.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(i),s},Xd=function(t){return new Promise(function(e,A){var n=new Image;n.onload=function(){return e(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(t)))})},Se={get SUPPORT_RANGE_BOUNDS(){var t=Kw(document);return Object.defineProperty(Se,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=Se.SUPPORT_RANGE_BOUNDS&&Vw(document);return Object.defineProperty(Se,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=Ww(document);return Object.defineProperty(Se,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t=typeof Array.from=="function"&&typeof window.fetch=="function"?Jw(document):Promise.resolve(!1);return Object.defineProperty(Se,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=Gw();return Object.defineProperty(Se,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t=jw();return Object.defineProperty(Se,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Se,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Se,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},jn=function(){function t(e,A){this.text=e,this.bounds=A}return t}(),Xw=function(t,e,A,n){var i=qw(e,A),r=[],s=0;return i.forEach(function(o){if(A.textDecorationLine.length||o.trim().length>0)if(Se.SUPPORT_RANGE_BOUNDS){var a=$d(n,s,o.length).getClientRects();if(a.length>1){var c=sa(o),l=0;c.forEach(function(d){r.push(new jn(d,RA.fromDOMRectList(t,$d(n,l+s,d.length).getClientRects()))),l+=d.length})}else r.push(new jn(o,RA.fromDOMRectList(t,a)))}else{var u=n.splitText(o.length);r.push(new jn(o,$w(t,n))),n=u}else Se.SUPPORT_RANGE_BOUNDS||(n=n.splitText(o.length));s+=o.length}),r},$w=function(t,e){var A=e.ownerDocument;if(A){var n=A.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var r=Gi(t,n);return n.firstChild&&i.replaceChild(n.firstChild,n),r}}return RA.EMPTY},$d=function(t,e,A){var n=t.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(t,e),i.setEnd(t,e+A),i},sa=function(t){if(Se.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(t)).map(function(A){return A.segment})}return Nw(t)},Yw=function(t,e){if(Se.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(A.segment(t)).map(function(n){return n.segment})}return Zw(t,e)},qw=function(t,e){return e.letterSpacing!==0?sa(t):Yw(t,e)},zw=[32,160,4961,65792,65793,4153,4241],Zw=function(t,e){for(var A=RB(t,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),n=[],i,r=function(){if(i.value){var s=i.value.slice(),o=ji(s),a="";o.forEach(function(c){zw.indexOf(c)===-1?a+=he(c):(a.length&&n.push(a),n.push(he(c)),a="")}),a.length&&n.push(a)}};!(i=A.next()).done;)r();return n},ey=function(){function t(e,A,n){this.text=Ay(A.data,n.textTransform),this.textBounds=Xw(e,this.text,n,A)}return t}(),Ay=function(t,e){switch(e){case 1:return t.toLowerCase();case 3:return t.replace(ty,ny);case 2:return t.toUpperCase();default:return t}},ty=/(^|\s|:|-|\(|\))([a-z])/g,ny=function(t,e,A){return t.length>0?e+A.toUpperCase():t},Yd=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.src=n.currentSrc||n.src,i.intrinsicWidth=n.naturalWidth,i.intrinsicHeight=n.naturalHeight,i.context.cache.addImage(i.src),i}return e}(QA),qd=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.canvas=n,i.intrinsicWidth=n.width,i.intrinsicHeight=n.height,i}return e}(QA),zd=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this,r=new XMLSerializer,s=Gi(A,n);return n.setAttribute("width","".concat(s.width,"px")),n.setAttribute("height","".concat(s.height,"px")),i.svg="data:image/svg+xml,".concat(encodeURIComponent(r.serializeToString(n))),i.intrinsicWidth=n.width.baseVal.value,i.intrinsicHeight=n.height.baseVal.value,i.context.cache.addImage(i.svg),i}return e}(QA),Zd=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.value=n.value,i}return e}(QA),oa=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.start=n.start,i.reversed=typeof n.reversed=="boolean"&&n.reversed===!0,i}return e}(QA),iy=[{type:15,flags:0,unit:"px",number:3}],ry=[{type:16,flags:0,number:50}],sy=function(t){return t.width>t.height?new RA(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width<t.height?new RA(t.left,t.top+(t.height-t.width)/2,t.width,t.width):t},oy=function(t){var e=t.type===ay?new Array(t.value.length+1).join("•"):t.value;return e.length===0?t.placeholder||"":e},Fr="checkbox",kr="radio",ay="password",eh=707406591,aa=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;switch(i.type=n.type.toLowerCase(),i.checked=n.checked,i.value=oy(n),(i.type===Fr||i.type===kr)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=sy(i.bounds)),i.type){case Fr:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=iy;break;case kr:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=ry;break}return i}return e}(QA),Ah=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this,r=n.options[n.selectedIndex||0];return i.value=r&&r.text||"",i}return e}(QA),th=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.value=n.value,i}return e}(QA),nh=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;i.src=n.src,i.width=parseInt(n.width,10)||0,i.height=parseInt(n.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){i.tree=rh(A,n.contentWindow.document.documentElement);var r=n.contentWindow.document.documentElement?en(A,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):UA.TRANSPARENT,s=n.contentWindow.document.body?en(A,getComputedStyle(n.contentWindow.document.body).backgroundColor):UA.TRANSPARENT;i.backgroundColor=st(r)?st(s)?i.styles.backgroundColor:s:r}}catch{}return i}return e}(QA),cy=["OL","UL","MENU"],Ir=function(t,e,A,n){for(var i=e.firstChild,r=void 0;i;i=r)if(r=i.nextSibling,sh(i)&&i.data.length>0)A.textNodes.push(new ey(t,i,A.styles));else if(tn(i))if(dh(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return Ir(t,o,A,n)});else{var s=ih(t,i);s.styles.isVisible()&&(ly(i,s,n)?s.flags|=4:uy(s.styles)&&(s.flags|=2),cy.indexOf(i.tagName)!==-1&&(s.flags|=8),A.elements.push(s),i.slot,i.shadowRoot?Ir(t,i.shadowRoot,s,n):!xr(i)&&!oh(i)&&!Pr(i)&&Ir(t,i,s,n))}},ih=function(t,e){return ua(e)?new Yd(t,e):ah(e)?new qd(t,e):oh(e)?new zd(t,e):dy(e)?new Zd(t,e):hy(e)?new oa(t,e):fy(e)?new aa(t,e):Pr(e)?new Ah(t,e):xr(e)?new th(t,e):lh(e)?new nh(t,e):new QA(t,e)},rh=function(t,e){var A=ih(t,e);return A.flags|=4,Ir(t,e,A,A),A},ly=function(t,e,A){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||la(t)&&A.styles.isTransparent()},uy=function(t){return t.isPositioned()||t.isFloating()},sh=function(t){return t.nodeType===Node.TEXT_NODE},tn=function(t){return t.nodeType===Node.ELEMENT_NODE},ca=function(t){return tn(t)&&typeof t.style<"u"&&!Rr(t)},Rr=function(t){return typeof t.className=="object"},dy=function(t){return t.tagName==="LI"},hy=function(t){return t.tagName==="OL"},fy=function(t){return t.tagName==="INPUT"},gy=function(t){return t.tagName==="HTML"},oh=function(t){return t.tagName==="svg"},la=function(t){return t.tagName==="BODY"},ah=function(t){return t.tagName==="CANVAS"},ch=function(t){return t.tagName==="VIDEO"},ua=function(t){return t.tagName==="IMG"},lh=function(t){return t.tagName==="IFRAME"},uh=function(t){return t.tagName==="STYLE"},py=function(t){return t.tagName==="SCRIPT"},xr=function(t){return t.tagName==="TEXTAREA"},Pr=function(t){return t.tagName==="SELECT"},dh=function(t){return t.tagName==="SLOT"},hh=function(t){return t.tagName.indexOf("-")>0},my=function(){function t(){this.counters={}}return t.prototype.getCounterValue=function(e){var A=this.counters[e];return A&&A.length?A[A.length-1]:1},t.prototype.getCounterValues=function(e){var A=this.counters[e];return A||[]},t.prototype.pop=function(e){var A=this;e.forEach(function(n){return A.counters[n].pop()})},t.prototype.parse=function(e){var A=this,n=e.counterIncrement,i=e.counterReset,r=!0;n!==null&&n.forEach(function(o){var a=A.counters[o.counter];a&&o.increment!==0&&(r=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=o.increment)});var s=[];return r&&i.forEach(function(o){var a=A.counters[o.counter];s.push(o.counter),a||(a=A.counters[o.counter]=[]),a.push(o.reset)}),s},t}(),fh={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},gh={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},By={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},vy={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},nn=function(t,e,A,n,i,r){return t<e||t>A?Jn(t,i,r.length>0):n.integers.reduce(function(s,o,a){for(;t>=o;)t-=o,s+=n.values[a];return s},"")+r},ph=function(t,e,A,n){var i="";do A||t--,i=n(t)+i,t/=e;while(t*e>=e);return i},fe=function(t,e,A,n,i){var r=A-e+1;return(t<0?"-":"")+(ph(Math.abs(t),r,n,function(s){return he(Math.floor(s%r)+e)})+i)},kt=function(t,e,A){A===void 0&&(A=". ");var n=e.length;return ph(Math.abs(t),n,!1,function(i){return e[Math.floor(i%n)]})+A},rn=1,ct=2,lt=4,Wn=8,PA=function(t,e,A,n,i,r){if(t<-9999||t>9999)return Jn(t,4,i.length>0);var s=Math.abs(t),o=i;if(s===0)return e[0]+o;for(var a=0;s>0&&a<=4;a++){var c=s%10;c===0&&ve(r,rn)&&o!==""?o=e[c]+o:c>1||c===1&&a===0||c===1&&a===1&&ve(r,ct)||c===1&&a===1&&ve(r,lt)&&t>100||c===1&&a>1&&ve(r,Wn)?o=e[c]+(a>0?A[a-1]:"")+o:c===1&&a>0&&(o=A[a-1]+o),s=Math.floor(s/10)}return(t<0?n:"")+o},mh="十百千萬",Bh="拾佰仟萬",vh="マイナス",da="마이너스",Jn=function(t,e,A){var n=A?". ":"",i=A?"、":"",r=A?", ":"",s=A?" ":"";switch(e){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=fe(t,48,57,!0,n);return o.length<4?"0".concat(o):o;case 4:return kt(t,"〇一二三四五六七八九",i);case 6:return nn(t,1,3999,fh,3,n).toLowerCase();case 7:return nn(t,1,3999,fh,3,n);case 8:return fe(t,945,969,!1,n);case 9:return fe(t,97,122,!1,n);case 10:return fe(t,65,90,!1,n);case 11:return fe(t,1632,1641,!0,n);case 12:case 49:return nn(t,1,9999,gh,3,n);case 35:return nn(t,1,9999,gh,3,n).toLowerCase();case 13:return fe(t,2534,2543,!0,n);case 14:case 30:return fe(t,6112,6121,!0,n);case 15:return kt(t,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return kt(t,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return PA(t,"零一二三四五六七八九",mh,"負",i,ct|lt|Wn);case 47:return PA(t,"零壹貳參肆伍陸柒捌玖",Bh,"負",i,rn|ct|lt|Wn);case 42:return PA(t,"零一二三四五六七八九",mh,"负",i,ct|lt|Wn);case 41:return PA(t,"零壹贰叁肆伍陆柒捌玖",Bh,"负",i,rn|ct|lt|Wn);case 26:return PA(t,"〇一二三四五六七八九","十百千万",vh,i,0);case 25:return PA(t,"零壱弐参四伍六七八九","拾百千万",vh,i,rn|ct|lt);case 31:return PA(t,"영일이삼사오육칠팔구","십백천만",da,r,rn|ct|lt);case 33:return PA(t,"零一二三四五六七八九","十百千萬",da,r,0);case 32:return PA(t,"零壹貳參四五六七八九","拾百千",da,r,rn|ct|lt);case 18:return fe(t,2406,2415,!0,n);case 20:return nn(t,1,19999,vy,3,n);case 21:return fe(t,2790,2799,!0,n);case 22:return fe(t,2662,2671,!0,n);case 52:return nn(t,1,10999,By,3,n);case 23:return kt(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return kt(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return fe(t,3302,3311,!0,n);case 28:return kt(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return kt(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return fe(t,3792,3801,!0,n);case 37:return fe(t,6160,6169,!0,n);case 38:return fe(t,4160,4169,!0,n);case 39:return fe(t,2918,2927,!0,n);case 40:return fe(t,1776,1785,!0,n);case 43:return fe(t,3046,3055,!0,n);case 44:return fe(t,3174,3183,!0,n);case 45:return fe(t,3664,3673,!0,n);case 46:return fe(t,3872,3881,!0,n);case 3:default:return fe(t,48,57,!0,n)}},Ch="data-html2canvas-ignore",wh=function(){function t(e,A,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=A,this.counters=new my,this.quoteDepth=0,!A.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(A.ownerDocument.documentElement,!1)}return t.prototype.toIFrame=function(e,A){var n=this,i=Cy(e,A);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var r=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,o=i.contentWindow,a=o.document,c=by(i).then(function(){return Re(n,void 0,void 0,function(){var u,d;return Fe(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(Sy),o&&(o.scrollTo(A.left,A.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==A.top||o.scrollX!==A.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-A.left,o.scrollY-A.top,0,0))),u=this.options.onclone,d=this.clonedReferenceElement,typeof d>"u"?[2,Promise.reject("Error finding the ".concat(this.referenceElement.nodeName," in the cloned document"))]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,yy(a)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof u=="function"?[2,Promise.resolve().then(function(){return u(a,d)}).then(function(){return i})]:[2,i]}})})}),l=a.adoptNode(this.documentElement);return Ry(l,a),a.open(),a.write("".concat(Qy(document.doctype),"<html></html>")),Ey(this.referenceElement.ownerDocument,r,s),a.replaceChild(l,a.documentElement),a.close(),c},t.prototype.createElementClone=function(e){if($o(e,2))debugger;if(ah(e))return this.createCanvasClone(e);if(ch(e))return this.createVideoClone(e);if(uh(e))return this.createStyleClone(e);var A=e.cloneNode(!1);return ua(A)&&(ua(e)&&e.currentSrc&&e.currentSrc!==e.src&&(A.src=e.currentSrc,A.srcset=""),A.loading==="lazy"&&(A.loading="eager")),hh(A)?this.createCustomElementClone(A):A},t.prototype.createCustomElementClone=function(e){var A=document.createElement("html2canvascustomelement");return ha(e.style,A),A},t.prototype.createStyleClone=function(e){try{var A=e.sheet;if(A&&A.cssRules){var n=[].slice.call(A.cssRules,0).reduce(function(r,s){return s&&typeof s.cssText=="string"?r+s.cssText:r},""),i=e.cloneNode(!1);return i.textContent=n,i}}catch(r){if(this.context.logger.error("Unable to access cssRules property",r),r.name!=="SecurityError")throw r}return e.cloneNode(!1)},t.prototype.createCanvasClone=function(e){var A;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var r=e.getContext("2d"),s=i.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&r)s.putImageData(r.getImageData(0,0,e.width,e.height),0,0);else{var o=(A=e.getContext("webgl2"))!==null&&A!==void 0?A:e.getContext("webgl");if(o){var a=o.getContextAttributes();(a==null?void 0:a.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}s.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},t.prototype.createVideoClone=function(e){var A=e.ownerDocument.createElement("canvas");A.width=e.offsetWidth,A.height=e.offsetHeight;var n=A.getContext("2d");try{return n&&(n.drawImage(e,0,0,A.width,A.height),this.options.allowTaint||n.getImageData(0,0,A.width,A.height)),A}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},t.prototype.appendChildNode=function(e,A,n){(!tn(A)||!py(A)&&!A.hasAttribute(Ch)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(A)))&&(!this.options.copyStyles||!tn(A)||!uh(A))&&e.appendChild(this.cloneNode(A,n))},t.prototype.cloneChildNodes=function(e,A,n){for(var i=this,r=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;r;r=r.nextSibling)if(tn(r)&&dh(r)&&typeof r.assignedNodes=="function"){var s=r.assignedNodes();s.length&&s.forEach(function(o){return i.appendChildNode(A,o,n)})}else this.appendChildNode(A,r,n)},t.prototype.cloneNode=function(e,A){if(sh(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&tn(e)&&(ca(e)||Rr(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var r=n.getComputedStyle(e),s=n.getComputedStyle(e,":before"),o=n.getComputedStyle(e,":after");this.referenceElement===e&&ca(i)&&(this.clonedReferenceElement=i),la(i)&&ky(i);var a=this.counters.parse(new Ld(this.context,r)),c=this.resolvePseudoContent(e,i,s,Xn.BEFORE);hh(e)&&(A=!0),ch(e)||this.cloneChildNodes(e,i,A),c&&i.insertBefore(c,i.firstChild);var l=this.resolvePseudoContent(e,i,o,Xn.AFTER);return l&&i.appendChild(l),this.counters.pop(a),(r&&(this.options.copyStyles||Rr(e))&&!lh(e)||A)&&ha(r,i),(e.scrollTop!==0||e.scrollLeft!==0)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(xr(e)||Pr(e))&&(xr(i)||Pr(i))&&(i.value=e.value),i}return e.cloneNode(!1)},t.prototype.resolvePseudoContent=function(e,A,n,i){var r=this;if(n){var s=n.content,o=A.ownerDocument;if(!(!o||!s||s==="none"||s==="-moz-alt-content"||n.display==="none")){this.counters.parse(new Ld(this.context,n));var a=new dw(this.context,n),c=o.createElement("html2canvaspseudoelement");ha(n,c),a.content.forEach(function(u){if(u.type===0)c.appendChild(o.createTextNode(u.value));else if(u.type===22){var d=o.createElement("img");d.src=u.value,d.style.opacity="1",c.appendChild(d)}else if(u.type===18){if(u.name==="attr"){var h=u.values.filter(V);h.length&&c.appendChild(o.createTextNode(e.getAttribute(h[0].value)||""))}else if(u.name==="counter"){var g=u.values.filter(Qe),f=g[0],p=g[1];if(f&&V(f)){var B=r.counters.getCounterValue(f.value),y=p&&V(p)?Xo.parse(r.context,p.value):3;c.appendChild(o.createTextNode(Jn(B,y,!1)))}}else if(u.name==="counters"){var b=u.values.filter(Qe),f=b[0],v=b[1],p=b[2];if(f&&V(f)){var C=r.counters.getCounterValues(f.value),w=p&&V(p)?Xo.parse(r.context,p.value):3,Q=v&&v.type===0?v.value:"",F=C.map(function(H){return Jn(H,w,!1)}).join(Q);c.appendChild(o.createTextNode(F))}}}else if(u.type===20)switch(u.value){case"open-quote":c.appendChild(o.createTextNode(Pd(a.quotes,r.quoteDepth++,!0)));break;case"close-quote":c.appendChild(o.createTextNode(Pd(a.quotes,--r.quoteDepth,!1)));break;default:c.appendChild(o.createTextNode(u.value))}}),c.className="".concat(fa," ").concat(ga);var l=i===Xn.BEFORE?" ".concat(fa):" ".concat(ga);return Rr(A)?A.className.baseValue+=l:A.className+=l,c}}},t.destroy=function(e){return e.parentNode?(e.parentNode.removeChild(e),!0):!1},t}(),Xn;(function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER"})(Xn||(Xn={}));var Cy=function(t,e){var A=t.createElement("iframe");return A.className="html2canvas-container",A.style.visibility="hidden",A.style.position="fixed",A.style.left="-10000px",A.style.top="0px",A.style.border="0",A.width=e.width.toString(),A.height=e.height.toString(),A.scrolling="no",A.setAttribute(Ch,"true"),t.body.appendChild(A),A},wy=function(t){return new Promise(function(e){if(t.complete){e();return}if(!t.src){e();return}t.onload=e,t.onerror=e})},yy=function(t){return Promise.all([].slice.call(t.images,0).map(wy))},by=function(t){return new Promise(function(e,A){var n=t.contentWindow;if(!n)return A("No window assigned for iframe");var i=n.document;n.onload=t.onload=function(){n.onload=t.onload=null;var r=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(r),e(t))},50)}})},Uy=["all","d","content"],ha=function(t,e){for(var A=t.length-1;A>=0;A--){var n=t.item(A);Uy.indexOf(n)===-1&&e.style.setProperty(n,t.getPropertyValue(n))}return e},Qy=function(t){var e="";return t&&(e+="<!DOCTYPE ",t.name&&(e+=t.name),t.internalSubset&&(e+=t.internalSubset),t.publicId&&(e+='"'.concat(t.publicId,'"')),t.systemId&&(e+='"'.concat(t.systemId,'"')),e+=">"),e},Ey=function(t,e,A){t&&t.defaultView&&(e!==t.defaultView.pageXOffset||A!==t.defaultView.pageYOffset)&&t.defaultView.scrollTo(e,A)},Sy=function(t){var e=t[0],A=t[1],n=t[2];e.scrollLeft=A,e.scrollTop=n},Ty=":before",Fy=":after",fa="___html2canvas___pseudoelement_before",ga="___html2canvas___pseudoelement_after",yh=`{
|
|
43
|
-
content: "" !important;
|
|
44
|
-
display: none !important;
|
|
45
|
-
}`,ky=function(t){Iy(t,".".concat(fa).concat(Ty).concat(yh,`
|
|
46
|
-
.`).concat(ga).concat(Fy).concat(yh))},Iy=function(t,e){var A=t.ownerDocument;if(A){var n=A.createElement("style");n.textContent=e,t.appendChild(n)}},Ry=function(t,e){var A,n=e.createElement("base");n.href=e.baseURI;var i=t.getElementsByTagName("head").item(0);i==null||i.insertBefore(n,(A=i==null?void 0:i.firstChild)!==null&&A!==void 0?A:null)},pa=function(){function t(){}return t.getOrigin=function(e){var A=t._link;return A?(A.href=e,A.href=A.href,A.protocol+A.hostname+A.port):"about:blank"},t.isSameOrigin=function(e){return t.getOrigin(e)===t._origin},t.setContext=function(e){t._link=e.document.createElement("a"),t._origin=t.getOrigin(e.location.href)},t._origin="about:blank",t}(),xy=function(){function t(e,A){this.context=e,this._options=A,this._cache={}}return t.prototype.addImage=function(e){var A=Promise.resolve();return this.has(e)||(Ba(e)||_y(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),A},t.prototype.match=function(e){return this._cache[e]},t.prototype.loadImage=function(e){return Re(this,void 0,void 0,function(){var A,n,i,r,s,o=this;return Fe(this,function(a){switch(a.label){case 0:return typeof this._options.customIsSameOrigin!="function"?[3,2]:[4,this._options.customIsSameOrigin(e,pa.isSameOrigin)];case 1:return n=a.sent(),[3,3];case 2:n=pa.isSameOrigin(e),a.label=3;case 3:return A=n,i=!ma(e)&&this._options.useCORS===!0&&Se.SUPPORT_CORS_IMAGES&&!A,r=!ma(e)&&!A&&!Ba(e)&&typeof this._options.proxy=="string"&&Se.SUPPORT_CORS_XHR&&!i,!A&&this._options.allowTaint===!1&&!ma(e)&&!Ba(e)&&!r&&!i?[2]:(s=e,r?[4,this.proxy(s)]:[3,5]);case 4:s=a.sent(),a.label=5;case 5:return this.context.logger.debug("Added image ".concat(e.substring(0,256))),[4,new Promise(function(c,l){var u=new Image;u.onload=function(){return c(u)},u.onerror=l,(Hy(s)||i)&&(u.crossOrigin="anonymous"),u.src=s,u.complete===!0&&setTimeout(function(){return c(u)},500),o._options.imageTimeout>0&&setTimeout(function(){return l("Timed out (".concat(o._options.imageTimeout,"ms) loading image"))},o._options.imageTimeout)})];case 6:return[2,a.sent()]}})})},t.prototype.has=function(e){return typeof this._cache[e]<"u"},t.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},t.prototype.proxy=function(e){var A=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise(function(r,s){var o=Se.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")r(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return r(u.result)},!1),u.addEventListener("error",function(d){return s(d)},!1),u.readAsDataURL(a.response)}else s("Failed to proxy resource ".concat(i," with status code ").concat(a.status))},a.onerror=s;var c=n.indexOf("?")>-1?"&":"?";if(a.open("GET","".concat(n).concat(c,"url=").concat(encodeURIComponent(e),"&responseType=").concat(o)),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),A._options.imageTimeout){var l=A._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return s("Timed out (".concat(l,"ms) proxying ").concat(i))}}a.send()})},t}(),Py=/^data:image\/svg\+xml/i,Ly=/^data:image\/.*;base64,/i,Dy=/^data:image\/.*/i,_y=function(t){return Se.SUPPORT_SVG_DRAWING||!Oy(t)},ma=function(t){return Dy.test(t)},Hy=function(t){return Ly.test(t)},Ba=function(t){return t.substr(0,4)==="blob"},Oy=function(t){return t.substr(-3).toLowerCase()==="svg"||Py.test(t)},P=function(){function t(e,A){this.type=0,this.x=e,this.y=A}return t.prototype.add=function(e,A){return new t(this.x+e,this.y+A)},t}(),sn=function(t,e,A){return new P(t.x+(e.x-t.x)*A,t.y+(e.y-t.y)*A)},Lr=function(){function t(e,A,n,i){this.type=1,this.start=e,this.startControl=A,this.endControl=n,this.end=i}return t.prototype.subdivide=function(e,A){var n=sn(this.start,this.startControl,e),i=sn(this.startControl,this.endControl,e),r=sn(this.endControl,this.end,e),s=sn(n,i,e),o=sn(i,r,e),a=sn(s,o,e);return A?new t(this.start,n,s,a):new t(a,o,r,this.end)},t.prototype.add=function(e,A){return new t(this.start.add(e,A),this.startControl.add(e,A),this.endControl.add(e,A),this.end.add(e,A))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),ze=function(t){return t.type===1},My=function(){function t(e){var A=e.styles,n=e.bounds,i=Nn(A.borderTopLeftRadius,n.width,n.height),r=i[0],s=i[1],o=Nn(A.borderTopRightRadius,n.width,n.height),a=o[0],c=o[1],l=Nn(A.borderBottomRightRadius,n.width,n.height),u=l[0],d=l[1],h=Nn(A.borderBottomLeftRadius,n.width,n.height),g=h[0],f=h[1],p=[];p.push((r+a)/n.width),p.push((g+u)/n.width),p.push((s+f)/n.height),p.push((c+d)/n.height);var B=Math.max.apply(Math,p);B>1&&(r/=B,s/=B,a/=B,c/=B,u/=B,d/=B,g/=B,f/=B);var y=n.width-a,b=n.height-d,v=n.width-u,C=n.height-f,w=A.borderTopWidth,Q=A.borderRightWidth,F=A.borderBottomWidth,R=A.borderLeftWidth,D=Y(A.paddingTop,e.bounds.width),H=Y(A.paddingRight,e.bounds.width),M=Y(A.paddingBottom,e.bounds.width),ee=Y(A.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||s>0?se(n.left+R/3,n.top+w/3,r-R/3,s-w/3,$.TOP_LEFT):new P(n.left+R/3,n.top+w/3),this.topRightBorderDoubleOuterBox=r>0||s>0?se(n.left+y,n.top+w/3,a-Q/3,c-w/3,$.TOP_RIGHT):new P(n.left+n.width-Q/3,n.top+w/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?se(n.left+v,n.top+b,u-Q/3,d-F/3,$.BOTTOM_RIGHT):new P(n.left+n.width-Q/3,n.top+n.height-F/3),this.bottomLeftBorderDoubleOuterBox=g>0||f>0?se(n.left+R/3,n.top+C,g-R/3,f-F/3,$.BOTTOM_LEFT):new P(n.left+R/3,n.top+n.height-F/3),this.topLeftBorderDoubleInnerBox=r>0||s>0?se(n.left+R*2/3,n.top+w*2/3,r-R*2/3,s-w*2/3,$.TOP_LEFT):new P(n.left+R*2/3,n.top+w*2/3),this.topRightBorderDoubleInnerBox=r>0||s>0?se(n.left+y,n.top+w*2/3,a-Q*2/3,c-w*2/3,$.TOP_RIGHT):new P(n.left+n.width-Q*2/3,n.top+w*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?se(n.left+v,n.top+b,u-Q*2/3,d-F*2/3,$.BOTTOM_RIGHT):new P(n.left+n.width-Q*2/3,n.top+n.height-F*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||f>0?se(n.left+R*2/3,n.top+C,g-R*2/3,f-F*2/3,$.BOTTOM_LEFT):new P(n.left+R*2/3,n.top+n.height-F*2/3),this.topLeftBorderStroke=r>0||s>0?se(n.left+R/2,n.top+w/2,r-R/2,s-w/2,$.TOP_LEFT):new P(n.left+R/2,n.top+w/2),this.topRightBorderStroke=r>0||s>0?se(n.left+y,n.top+w/2,a-Q/2,c-w/2,$.TOP_RIGHT):new P(n.left+n.width-Q/2,n.top+w/2),this.bottomRightBorderStroke=u>0||d>0?se(n.left+v,n.top+b,u-Q/2,d-F/2,$.BOTTOM_RIGHT):new P(n.left+n.width-Q/2,n.top+n.height-F/2),this.bottomLeftBorderStroke=g>0||f>0?se(n.left+R/2,n.top+C,g-R/2,f-F/2,$.BOTTOM_LEFT):new P(n.left+R/2,n.top+n.height-F/2),this.topLeftBorderBox=r>0||s>0?se(n.left,n.top,r,s,$.TOP_LEFT):new P(n.left,n.top),this.topRightBorderBox=a>0||c>0?se(n.left+y,n.top,a,c,$.TOP_RIGHT):new P(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||d>0?se(n.left+v,n.top+b,u,d,$.BOTTOM_RIGHT):new P(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=g>0||f>0?se(n.left,n.top+C,g,f,$.BOTTOM_LEFT):new P(n.left,n.top+n.height),this.topLeftPaddingBox=r>0||s>0?se(n.left+R,n.top+w,Math.max(0,r-R),Math.max(0,s-w),$.TOP_LEFT):new P(n.left+R,n.top+w),this.topRightPaddingBox=a>0||c>0?se(n.left+Math.min(y,n.width-Q),n.top+w,y>n.width+Q?0:Math.max(0,a-Q),Math.max(0,c-w),$.TOP_RIGHT):new P(n.left+n.width-Q,n.top+w),this.bottomRightPaddingBox=u>0||d>0?se(n.left+Math.min(v,n.width-R),n.top+Math.min(b,n.height-F),Math.max(0,u-Q),Math.max(0,d-F),$.BOTTOM_RIGHT):new P(n.left+n.width-Q,n.top+n.height-F),this.bottomLeftPaddingBox=g>0||f>0?se(n.left+R,n.top+Math.min(C,n.height-F),Math.max(0,g-R),Math.max(0,f-F),$.BOTTOM_LEFT):new P(n.left+R,n.top+n.height-F),this.topLeftContentBox=r>0||s>0?se(n.left+R+ee,n.top+w+D,Math.max(0,r-(R+ee)),Math.max(0,s-(w+D)),$.TOP_LEFT):new P(n.left+R+ee,n.top+w+D),this.topRightContentBox=a>0||c>0?se(n.left+Math.min(y,n.width+R+ee),n.top+w+D,y>n.width+R+ee?0:a-R+ee,c-(w+D),$.TOP_RIGHT):new P(n.left+n.width-(Q+H),n.top+w+D),this.bottomRightContentBox=u>0||d>0?se(n.left+Math.min(v,n.width-(R+ee)),n.top+Math.min(b,n.height+w+D),Math.max(0,u-(Q+H)),d-(F+M),$.BOTTOM_RIGHT):new P(n.left+n.width-(Q+H),n.top+n.height-(F+M)),this.bottomLeftContentBox=g>0||f>0?se(n.left+R+ee,n.top+C,Math.max(0,g-(R+ee)),f-(F+M),$.BOTTOM_LEFT):new P(n.left+R+ee,n.top+n.height-(F+M))}return t}(),$;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})($||($={}));var se=function(t,e,A,n,i){var r=4*((Math.sqrt(2)-1)/3),s=A*r,o=n*r,a=t+A,c=e+n;switch(i){case $.TOP_LEFT:return new Lr(new P(t,c),new P(t,c-o),new P(a-s,e),new P(a,e));case $.TOP_RIGHT:return new Lr(new P(t,e),new P(t+s,e),new P(a,c-o),new P(a,c));case $.BOTTOM_RIGHT:return new Lr(new P(a,e),new P(a,e+o),new P(t+s,c),new P(t,c));case $.BOTTOM_LEFT:default:return new Lr(new P(a,c),new P(a-s,c),new P(t,e+o),new P(t,e))}},Dr=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},Ny=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},_r=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},Ky=function(){function t(e,A,n){this.offsetX=e,this.offsetY=A,this.matrix=n,this.type=0,this.target=6}return t}(),Hr=function(){function t(e,A){this.path=e,this.target=A,this.type=1}return t}(),Vy=function(){function t(e){this.opacity=e,this.type=2,this.target=6}return t}(),Gy=function(t){return t.type===0},bh=function(t){return t.type===1},jy=function(t){return t.type===2},Uh=function(t,e){return t.length===e.length?t.some(function(A,n){return A===e[n]}):!1},Wy=function(t,e,A,n,i){return t.map(function(r,s){switch(s){case 0:return r.add(e,A);case 1:return r.add(e+n,A);case 2:return r.add(e+n,A+i);case 3:return r.add(e,A+i)}return r})},Qh=function(){function t(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),Eh=function(){function t(e,A){if(this.container=e,this.parent=A,this.effects=[],this.curves=new My(this.container),this.container.styles.opacity<1&&this.effects.push(new Vy(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform;this.effects.push(new Ky(n,i,r))}if(this.container.styles.overflowX!==0){var s=Dr(this.curves),o=_r(this.curves);Uh(s,o)?this.effects.push(new Hr(s,6)):(this.effects.push(new Hr(s,2)),this.effects.push(new Hr(o,4)))}}return t.prototype.getEffects=function(e){for(var A=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,i=this.effects.slice(0);n;){var r=n.effects.filter(function(a){return!bh(a)});if(A||n.container.styles.position!==0||!n.parent){if(A=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var s=Dr(n.curves),o=_r(n.curves);Uh(s,o)||i.unshift(new Hr(o,6))}i.unshift.apply(i,r)}else i.unshift.apply(i,r);n=n.parent}return i.filter(function(a){return ve(a.target,e)})},t}(),va=function(t,e,A,n){t.container.elements.forEach(function(i){var r=ve(i.flags,4),s=ve(i.flags,2),o=new Eh(i,t);ve(i.styles.display,2048)&&n.push(o);var a=ve(i.flags,8)?[]:n;if(r||s){var c=r||i.styles.isPositioned()?A:e,l=new Qh(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some(function(g,f){return u>g.element.container.styles.zIndex.order?(d=f,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var h=0;c.positiveZIndex.some(function(g,f){return u>=g.element.container.styles.zIndex.order?(h=f+1,!1):h>0}),c.positiveZIndex.splice(h,0,l)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else i.styles.isFloating()?c.nonPositionedFloats.push(l):c.nonPositionedInlineLevel.push(l);va(o,l,r?l:A,a)}else i.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),va(o,e,A,a);ve(i.flags,8)&&Sh(i,a)})},Sh=function(t,e){for(var A=t instanceof oa?t.start:1,n=t instanceof oa?t.reversed:!1,i=0;i<e.length;i++){var r=e[i];r.container instanceof Zd&&typeof r.container.value=="number"&&r.container.value!==0&&(A=r.container.value),r.listValue=Jn(A,r.container.styles.listStyleType,!0),A+=n?-1:1}},Jy=function(t){var e=new Eh(t,null),A=new Qh(e),n=[];return va(e,A,A,n),Sh(e.container,n),A},Th=function(t,e){switch(e){case 0:return Ze(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return Ze(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return Ze(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return Ze(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},Xy=function(t,e){switch(e){case 0:return Ze(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return Ze(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return Ze(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return Ze(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},$y=function(t,e){switch(e){case 0:return Ze(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return Ze(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return Ze(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return Ze(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},Yy=function(t,e){switch(e){case 0:return Or(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return Or(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return Or(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return Or(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},Or=function(t,e){var A=[];return ze(t)?A.push(t.subdivide(.5,!1)):A.push(t),ze(e)?A.push(e.subdivide(.5,!0)):A.push(e),A},Ze=function(t,e,A,n){var i=[];return ze(t)?i.push(t.subdivide(.5,!1)):i.push(t),ze(A)?i.push(A.subdivide(.5,!0)):i.push(A),ze(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),ze(e)?i.push(e.subdivide(.5,!1).reverse()):i.push(e),i},Fh=function(t){var e=t.bounds,A=t.styles;return e.add(A.borderLeftWidth,A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth),-(A.borderTopWidth+A.borderBottomWidth))},Mr=function(t){var e=t.styles,A=t.bounds,n=Y(e.paddingLeft,A.width),i=Y(e.paddingRight,A.width),r=Y(e.paddingTop,A.width),s=Y(e.paddingBottom,A.width);return A.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+i),-(e.borderTopWidth+e.borderBottomWidth+r+s))},qy=function(t,e){return t===0?e.bounds:t===2?Mr(e):Fh(e)},zy=function(t,e){return t===0?e.bounds:t===2?Mr(e):Fh(e)},Ca=function(t,e,A){var n=qy(an(t.styles.backgroundOrigin,e),t),i=zy(an(t.styles.backgroundClip,e),t),r=Zy(an(t.styles.backgroundSize,e),A,n),s=r[0],o=r[1],a=Nn(an(t.styles.backgroundPosition,e),n.width-s,n.height-o),c=eb(an(t.styles.backgroundRepeat,e),a,r,n,i),l=Math.round(n.left+a[0]),u=Math.round(n.top+a[1]);return s=Math.max(1,s),o=Math.max(1,o),[c,l,u,s,o]},on=function(t){return V(t)&&t.value===An.AUTO},Nr=function(t){return typeof t=="number"},Zy=function(t,e,A){var n=e[0],i=e[1],r=e[2],s=t[0],o=t[1];if(!s)return[0,0];if(ne(s)&&o&&ne(o))return[Y(s,A.width),Y(o,A.height)];var a=Nr(r);if(V(s)&&(s.value===An.CONTAIN||s.value===An.COVER)){if(Nr(r)){var c=A.width/A.height;return c<r!=(s.value===An.COVER)?[A.width,A.width/r]:[A.height*r,A.height]}return[A.width,A.height]}var l=Nr(n),u=Nr(i),d=l||u;if(on(s)&&(!o||on(o))){if(l&&u)return[n,i];if(!a&&!d)return[A.width,A.height];if(d&&a){var h=l?n:i*r,g=u?i:n/r;return[h,g]}var f=l?n:A.width,p=u?i:A.height;return[f,p]}if(a){var B=0,y=0;return ne(s)?B=Y(s,A.width):ne(o)&&(y=Y(o,A.height)),on(s)?B=y*r:(!o||on(o))&&(y=B/r),[B,y]}var b=null,v=null;if(ne(s)?b=Y(s,A.width):o&&ne(o)&&(v=Y(o,A.height)),b!==null&&(!o||on(o))&&(v=l&&u?b/n*i:A.height),v!==null&&on(s)&&(b=l&&u?v/i*n:A.width),b!==null&&v!==null)return[b,v];throw new Error("Unable to calculate background-size for element")},an=function(t,e){var A=t[e];return typeof A>"u"?t[0]:A},eb=function(t,e,A,n,i){var r=e[0],s=e[1],o=A[0],a=A[1];switch(t){case 2:return[new P(Math.round(n.left),Math.round(n.top+s)),new P(Math.round(n.left+n.width),Math.round(n.top+s)),new P(Math.round(n.left+n.width),Math.round(a+n.top+s)),new P(Math.round(n.left),Math.round(a+n.top+s))];case 3:return[new P(Math.round(n.left+r),Math.round(n.top)),new P(Math.round(n.left+r+o),Math.round(n.top)),new P(Math.round(n.left+r+o),Math.round(n.height+n.top)),new P(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new P(Math.round(n.left+r),Math.round(n.top+s)),new P(Math.round(n.left+r+o),Math.round(n.top+s)),new P(Math.round(n.left+r+o),Math.round(n.top+s+a)),new P(Math.round(n.left+r),Math.round(n.top+s+a))];default:return[new P(Math.round(i.left),Math.round(i.top)),new P(Math.round(i.left+i.width),Math.round(i.top)),new P(Math.round(i.left+i.width),Math.round(i.height+i.top)),new P(Math.round(i.left),Math.round(i.height+i.top))]}},Ab="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",kh="Hidden Text",tb=function(){function t(e){this._data={},this._document=e}return t.prototype.parseMetrics=function(e,A){var n=this._document.createElement("div"),i=this._document.createElement("img"),r=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=A,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",s.appendChild(n),i.src=Ab,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",r.style.fontFamily=e,r.style.fontSize=A,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(kh)),n.appendChild(r),n.appendChild(i);var o=i.offsetTop-r.offsetTop+2;n.removeChild(r),n.appendChild(this._document.createTextNode(kh)),n.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:o,middle:a}},t.prototype.getMetrics=function(e,A){var n="".concat(e," ").concat(A);return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(e,A)),this._data[n]},t}(),Ih=function(){function t(e,A){this.context=e,this.options=A}return t}(),nb=1e4,ib=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width="".concat(n.width,"px"),i.canvas.style.height="".concat(n.height,"px")),i.fontMetrics=new tb(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized (".concat(n.width,"x").concat(n.height,") with scale ").concat(n.scale)),i}return e.prototype.applyEffects=function(A){for(var n=this;this._activeEffects.length;)this.popEffect();A.forEach(function(i){return n.applyEffect(i)})},e.prototype.applyEffect=function(A){this.ctx.save(),jy(A)&&(this.ctx.globalAlpha=A.opacity),Gy(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),bh(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(A){return Re(this,void 0,void 0,function(){var n;return Fe(this,function(i){switch(i.label){case 0:return n=A.element.container.styles,n.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(A){return Re(this,void 0,void 0,function(){return Fe(this,function(n){switch(n.label){case 0:if(ve(A.container.flags,16))debugger;return A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(A)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(A,n,i){var r=this;if(n===0)navigator.userAgent.indexOf("Firefox")===-1?(this.ctx.textBaseline="ideographic",this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)):this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+i);else{var s=sa(A.text);s.reduce(function(o,a){return r.ctx.fillText(a,o,A.bounds.top+i),o+r.ctx.measureText(a).width},A.bounds.left)}},e.prototype.createFontStyle=function(A){var n=A.fontVariant.filter(function(s){return s==="normal"||s==="small-caps"}).join(""),i=cb(A.fontFamily).join(", "),r=nt(A.fontSize)?"".concat(A.fontSize.number).concat(A.fontSize.unit):"".concat(A.fontSize.number,"px");return[[A.fontStyle,n,A.fontWeight,r,i].join(" "),i,r]},e.prototype.renderTextNode=function(A,n){return Re(this,void 0,void 0,function(){var i,r,s=this;return Fe(this,function(o){return i=this.createFontStyle(n)[0],this.ctx.font=i,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",r=n.paintOrder,A.textBounds.forEach(function(a){r.forEach(function(c){switch(c){case 0:s.ctx.fillStyle=we(n.color),s.renderTextWithLetterSpacing(a,n.letterSpacing,n.fontSize.number);var l=n.textShadow;if(l.length&&a.text.trim().length&&(l.slice(0).reverse().forEach(function(d){s.ctx.shadowColor=we(d.color),s.ctx.shadowOffsetX=d.offsetX.number*s.options.scale,s.ctx.shadowOffsetY=d.offsetY.number*s.options.scale,s.ctx.shadowBlur=d.blur.number,s.renderTextWithLetterSpacing(a,n.letterSpacing,n.fontSize.number)}),s.ctx.shadowColor="",s.ctx.shadowOffsetX=0,s.ctx.shadowOffsetY=0,s.ctx.shadowBlur=0),n.textDecorationLine.length){s.ctx.fillStyle=we(n.textDecorationColor||n.color);var u=1;n.textDecorationLine.forEach(function(d){switch(d){case 1:s.ctx.fillRect(a.bounds.left,a.bounds.top+a.bounds.height-u,a.bounds.width,u);break;case 2:s.ctx.fillRect(a.bounds.left,a.bounds.top,a.bounds.width,u);break;case 3:s.ctx.fillRect(a.bounds.left,a.bounds.top+(a.bounds.height/2-u/2),a.bounds.width,u);break}})}break;case 1:n.webkitTextStrokeWidth&&a.text.trim().length&&(s.ctx.strokeStyle=we(n.webkitTextStrokeColor),s.ctx.lineWidth=n.webkitTextStrokeWidth,s.ctx.lineJoin=window.chrome?"miter":"round",s.ctx.strokeText(a.text,a.bounds.left,a.bounds.top+a.bounds.height)),s.ctx.strokeStyle="",s.ctx.lineWidth=0,s.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(A,n,i){var r=i.naturalWidth||A.intrinsicWidth,s=i.naturalHeight||A.intrinsicHeight;if(i&&r>0&&s>0){var o=Mr(A),a=_r(n);this.path(a),this.ctx.save(),this.ctx.clip();var c=0,l=0,u=r,d=s,h=o.left,g=o.top,f=o.width,p=o.height,B=A.styles.objectFit,y=f/p,b=u/d;if(B===2)b>y?(p=f/b,g+=(o.height-p)/2):(f=p*b,h+=(o.width-f)/2);else if(B===4)b>y?(u=d*y,c+=(r-u)/2):(d=u/y,l+=(s-d)/2);else if(B===8)u>f?(c+=(u-f)/2,u=f):(h+=(f-u)/2,f=u),d>p?(l+=(d-p)/2,d=p):(g+=(p-d)/2,p=d);else if(B===16){var v=b>y?f:p*b,C=u>f?u:f;v<C?b>y?(p=f/b,g+=(o.height-p)/2):(f=p*b,h+=(o.width-f)/2):(u>f?(c+=(u-f)/2,u=f):(h+=(f-u)/2,f=u),d>p?(l+=(d-p)/2,d=p):(g+=(p-d)/2,p=d))}this.ctx.drawImage(i,c,l,u,d,h,g,f,p),this.ctx.restore()}},e.prototype.renderNodeContent=function(A){return Re(this,void 0,void 0,function(){var n,i,r,s,o,a,b,b,c,l,u,d,C,h,g,f,w,p,B,y,b,v,C,w;return Fe(this,function(Q){switch(Q.label){case 0:this.applyEffects(A.getEffects(4)),n=A.container,i=A.curves,r=n.styles,s=0,o=n.textNodes,Q.label=1;case 1:return s<o.length?(a=o[s],[4,this.renderTextNode(a,r)]):[3,4];case 2:Q.sent(),Q.label=3;case 3:return s++,[3,1];case 4:if(!(n instanceof Yd))return[3,8];Q.label=5;case 5:return Q.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return b=Q.sent(),this.renderReplacedElement(n,i,b),[3,8];case 7:return Q.sent(),this.context.logger.error("Error loading image ".concat(n.src)),[3,8];case 8:if(n instanceof qd&&this.renderReplacedElement(n,i,n.canvas),!(n instanceof zd))return[3,12];Q.label=9;case 9:return Q.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return b=Q.sent(),this.renderReplacedElement(n,i,b),[3,12];case 11:return Q.sent(),this.context.logger.error("Error loading svg ".concat(n.svg.substring(0,255))),[3,12];case 12:return n instanceof nh&&n.tree?(c=new e(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,c.render(n.tree)]):[3,14];case 13:l=Q.sent(),n.width&&n.height&&this.ctx.drawImage(l,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),Q.label=14;case 14:if(n instanceof aa&&(u=Math.min(n.bounds.width,n.bounds.height),n.type===Fr?n.checked&&(this.ctx.save(),this.path([new P(n.bounds.left+u*.39363,n.bounds.top+u*.79),new P(n.bounds.left+u*.16,n.bounds.top+u*.5549),new P(n.bounds.left+u*.27347,n.bounds.top+u*.44071),new P(n.bounds.left+u*.39694,n.bounds.top+u*.5649),new P(n.bounds.left+u*.72983,n.bounds.top+u*.23),new P(n.bounds.left+u*.84,n.bounds.top+u*.34085),new P(n.bounds.left+u*.39363,n.bounds.top+u*.79)]),this.ctx.fillStyle=we(eh),this.ctx.fill(),this.ctx.restore()):n.type===kr&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+u/2,n.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=we(eh),this.ctx.fill(),this.ctx.restore())),rb(n)&&n.value.length){switch(d=this.createFontStyle(r),C=d[0],h=d[1],g=d[2],f=this.fontMetrics.getMetrics(h,g).baseline,this.ctx.font=C,this.ctx.fillStyle=we(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=ob(n.styles.textAlign),w=Mr(n),p=0,n.styles.textAlign){case 1:p+=w.width/2;break;case 2:p+=w.width;break}B=w.add(p,0,0,-w.height/2+1),this.ctx.save(),this.path([new P(w.left,w.top),new P(w.left+w.width,w.top),new P(w.left+w.width,w.top+w.height),new P(w.left,w.top+w.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new jn(n.value,B),r.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ve(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(y=n.styles.listStyleImage,y.type!==0)return[3,18];b=void 0,v=y.url,Q.label=15;case 15:return Q.trys.push([15,17,,18]),[4,this.context.cache.match(v)];case 16:return b=Q.sent(),this.ctx.drawImage(b,n.bounds.left-(b.width+10),n.bounds.top),[3,18];case 17:return Q.sent(),this.context.logger.error("Error loading list-style-image ".concat(v)),[3,18];case 18:return[3,20];case 19:A.listValue&&n.styles.listStyleType!==-1&&(C=this.createFontStyle(r)[0],this.ctx.font=C,this.ctx.fillStyle=we(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",w=new RA(n.bounds.left,n.bounds.top+Y(n.styles.paddingTop,n.bounds.width),n.bounds.width,Id(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new jn(A.listValue,w),r.letterSpacing,Id(r.lineHeight,r.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),Q.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(A){return Re(this,void 0,void 0,function(){var n,i,B,r,s,B,o,a,B,c,l,B,u,d,B,h,g,B,f,p,B;return Fe(this,function(y){switch(y.label){case 0:if(ve(A.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:y.sent(),n=0,i=A.negativeZIndex,y.label=2;case 2:return n<i.length?(B=i[n],[4,this.renderStack(B)]):[3,5];case 3:y.sent(),y.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:y.sent(),r=0,s=A.nonInlineLevel,y.label=7;case 7:return r<s.length?(B=s[r],[4,this.renderNode(B)]):[3,10];case 8:y.sent(),y.label=9;case 9:return r++,[3,7];case 10:o=0,a=A.nonPositionedFloats,y.label=11;case 11:return o<a.length?(B=a[o],[4,this.renderStack(B)]):[3,14];case 12:y.sent(),y.label=13;case 13:return o++,[3,11];case 14:c=0,l=A.nonPositionedInlineLevel,y.label=15;case 15:return c<l.length?(B=l[c],[4,this.renderStack(B)]):[3,18];case 16:y.sent(),y.label=17;case 17:return c++,[3,15];case 18:u=0,d=A.inlineLevel,y.label=19;case 19:return u<d.length?(B=d[u],[4,this.renderNode(B)]):[3,22];case 20:y.sent(),y.label=21;case 21:return u++,[3,19];case 22:h=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,y.label=23;case 23:return h<g.length?(B=g[h],[4,this.renderStack(B)]):[3,26];case 24:y.sent(),y.label=25;case 25:return h++,[3,23];case 26:f=0,p=A.positiveZIndex,y.label=27;case 27:return f<p.length?(B=p[f],[4,this.renderStack(B)]):[3,30];case 28:y.sent(),y.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},e.prototype.formatPath=function(A){var n=this;A.forEach(function(i,r){var s=ze(i)?i.start:i;r===0?n.ctx.moveTo(s.x,s.y):n.ctx.lineTo(s.x,s.y),ze(i)&&n.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},e.prototype.renderRepeat=function(A,n,i,r){this.path(A),this.ctx.fillStyle=n,this.ctx.translate(i,r),this.ctx.fill(),this.ctx.translate(-i,-r)},e.prototype.resizeImage=function(A,n,i){var r,s=(r=this.canvas.ownerDocument)!==null&&r!==void 0?r:document,o=s.createElement("canvas");o.width=Math.max(1,n),o.height=Math.max(1,i);var a=o.getContext("2d");return a.drawImage(A,0,0,A.width,A.height,0,0,n,i),o},e.prototype.renderBackgroundImage=function(A){return Re(this,void 0,void 0,function(){var n,i,r,s,o,a;return Fe(this,function(c){switch(c.label){case 0:n=A.styles.backgroundImage.length-1,i=function(l){var u,d,h,g,f,M,Ie,Te,oe,ie,D,p,M,Ie,Te,oe,ie,B,y,b,v,C,w,Q,F,R,D,H,M,ee,Xe,oe,ie,EA,Ie,Te,_A,eA,Pe,HA,fA,Le,hn,AA;return Fe(this,function(fn){switch(fn.label){case 0:if(l.type!==0)return[3,5];u=void 0,d=l.url,fn.label=1;case 1:return fn.trys.push([1,3,,4]),[4,r.context.cache.match(d)];case 2:return u=fn.sent(),[3,4];case 3:return fn.sent(),r.context.logger.error("Error loading background-image ".concat(d)),[3,4];case 4:return u&&(h=isNaN(u.width)||u.width===0?1:u.width,g=isNaN(u.height)||u.height===0?1:u.height,f=Ca(A,n,[h,g,h/g]),M=f[0],Ie=f[1],Te=f[2],oe=f[3],ie=f[4],D=r.ctx.createPattern(r.resizeImage(u,oe,ie),"repeat"),r.renderRepeat(M,D,Ie,Te)),[3,6];case 5:Nv(l)?(p=Ca(A,n,[null,null,null]),M=p[0],Ie=p[1],Te=p[2],oe=p[3],ie=p[4],B=Dv(l.angle,oe,ie),y=B[0],b=B[1],v=B[2],C=B[3],w=B[4],Q=document.createElement("canvas"),Q.width=oe,Q.height=ie,F=Q.getContext("2d"),R=F.createLinearGradient(b,C,v,w),Cd(l.stops,y||1).forEach(function(ii){return R.addColorStop(ii.stop,we(ii.color))}),F.fillStyle=R,F.fillRect(0,0,oe,ie),oe>0&&ie>0&&(D=r.ctx.createPattern(Q,"repeat"),r.renderRepeat(M,D,Ie,Te))):Kv(l)&&(H=Ca(A,n,[null,null,null]),M=H[0],ee=H[1],Xe=H[2],oe=H[3],ie=H[4],EA=l.position.length===0?[No]:l.position,Ie=Y(EA[0],oe),Te=Y(EA[EA.length-1],ie),_A=_v(l,Ie,Te,oe,ie),eA=_A[0],Pe=_A[1],eA>0&&Pe>0&&(HA=r.ctx.createRadialGradient(ee+Ie,Xe+Te,0,ee+Ie,Xe+Te,eA),Cd(l.stops,eA*2).forEach(function(ii){return HA.addColorStop(ii.stop,we(ii.color))}),r.path(M),r.ctx.fillStyle=HA,eA!==Pe?(fA=A.bounds.left+.5*A.bounds.width,Le=A.bounds.top+.5*A.bounds.height,hn=Pe/eA,AA=1/hn,r.ctx.save(),r.ctx.translate(fA,Le),r.ctx.transform(1,0,0,hn,0,0),r.ctx.translate(-fA,-Le),r.ctx.fillRect(ee,AA*(Xe-Le)+Le,oe,ie*AA),r.ctx.restore()):r.ctx.fill())),fn.label=6;case 6:return n--,[2]}})},r=this,s=0,o=A.styles.backgroundImage.slice(0).reverse(),c.label=1;case 1:return s<o.length?(a=o[s],[5,i(a)]):[3,4];case 2:c.sent(),c.label=3;case 3:return s++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(A,n,i){return Re(this,void 0,void 0,function(){return Fe(this,function(r){return this.path(Th(i,n)),this.ctx.fillStyle=we(A),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(A,n,i,r){return Re(this,void 0,void 0,function(){var s,o;return Fe(this,function(a){switch(a.label){case 0:return n<3?[4,this.renderSolidBorder(A,i,r)]:[3,2];case 1:return a.sent(),[2];case 2:return s=Xy(r,i),this.path(s),this.ctx.fillStyle=we(A),this.ctx.fill(),o=$y(r,i),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(A){return Re(this,void 0,void 0,function(){var n,i,r,s,o,a,c,l,u=this;return Fe(this,function(d){switch(d.label){case 0:return this.applyEffects(A.getEffects(2)),n=A.container.styles,i=!st(n.backgroundColor)||n.backgroundImage.length,r=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],s=sb(an(n.backgroundClip,0),A.curves),i||n.boxShadow.length?(this.ctx.save(),this.path(s),this.ctx.clip(),st(n.backgroundColor)||(this.ctx.fillStyle=we(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(h){u.ctx.save();var g=Dr(A.curves),f=h.inset?0:nb,p=Wy(g,-f+(h.inset?1:-1)*h.spread.number,(h.inset?1:-1)*h.spread.number,h.spread.number*(h.inset?-2:2),h.spread.number*(h.inset?-2:2));h.inset?(u.path(g),u.ctx.clip(),u.mask(p)):(u.mask(g),u.ctx.clip(),u.path(p)),u.ctx.shadowOffsetX=h.offsetX.number+f,u.ctx.shadowOffsetY=h.offsetY.number,u.ctx.shadowColor=we(h.color),u.ctx.shadowBlur=h.blur.number,u.ctx.fillStyle=h.inset?we(h.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),d.label=2;case 2:o=0,a=0,c=r,d.label=3;case 3:return a<c.length?(l=c[a],l.style!==0&&!st(l.color)&&l.width>0?l.style!==2?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,o,A.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return l.style!==3?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,o,A.curves,3)];case 6:return d.sent(),[3,11];case 7:return l.style!==4?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,o,A.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,A.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(A,n,i,r,s){return Re(this,void 0,void 0,function(){var o,a,c,l,u,d,h,g,f,p,B,y,b,v,C,w,C,w;return Fe(this,function(Q){return this.ctx.save(),o=Yy(r,i),a=Th(r,i),s===2&&(this.path(a),this.ctx.clip()),ze(a[0])?(c=a[0].start.x,l=a[0].start.y):(c=a[0].x,l=a[0].y),ze(a[1])?(u=a[1].end.x,d=a[1].end.y):(u=a[1].x,d=a[1].y),i===0||i===2?h=Math.abs(c-u):h=Math.abs(l-d),this.ctx.beginPath(),s===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=n<3?n*3:n*2,f=n<3?n*2:n,s===3&&(g=n,f=n),p=!0,h<=g*2?p=!1:h<=g*2+f?(B=h/(2*g+f),g*=B,f*=B):(y=Math.floor((h+f)/(g+f)),b=(h-y*g)/(y-1),v=(h-(y+1)*g)/y,f=v<=0||Math.abs(f-b)<Math.abs(f-v)?b:v),p&&(s===3?this.ctx.setLineDash([0,g+f]):this.ctx.setLineDash([g,f])),s===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=we(A),this.ctx.stroke(),this.ctx.setLineDash([]),s===2&&(ze(a[0])&&(C=a[3],w=a[0],this.ctx.beginPath(),this.formatPath([new P(C.end.x,C.end.y),new P(w.start.x,w.start.y)]),this.ctx.stroke()),ze(a[1])&&(C=a[1],w=a[2],this.ctx.beginPath(),this.formatPath([new P(C.end.x,C.end.y),new P(w.start.x,w.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(A){return Re(this,void 0,void 0,function(){var n;return Fe(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=we(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=Jy(A),[4,this.renderStack(n)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},e}(Ih),rb=function(t){return t instanceof th||t instanceof Ah?!0:t instanceof aa&&t.type!==kr&&t.type!==Fr},sb=function(t,e){switch(t){case 0:return Dr(e);case 2:return Ny(e);case 1:default:return _r(e)}},ob=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},ab=["-apple-system","system-ui"],cb=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(e){return ab.indexOf(e)===-1}):t},lb=function(t){uA(e,t);function e(A,n){var i=t.call(this,A,n)||this;return i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width="".concat(n.width,"px"),i.canvas.style.height="".concat(n.height,"px"),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(n.width,"x").concat(n.height," at ").concat(n.x,",").concat(n.y,") with scale ").concat(n.scale)),i}return e.prototype.render=function(A){return Re(this,void 0,void 0,function(){var n,i;return Fe(this,function(r){switch(r.label){case 0:return n=ra(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,ub(n)];case 1:return i=r.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=we(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e}(Ih),ub=function(t){return new Promise(function(e,A){var n=new Image;n.onload=function(){e(n)},n.onerror=A,n.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(t)))})},db=function(){function t(e){var A=e.id,n=e.enabled;this.id=A,this.enabled=n,this.start=Date.now()}return t.prototype.debug=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Vi([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},t.prototype.getTime=function(){return Date.now()-this.start},t.prototype.info=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Vi([this.id,"".concat(this.getTime(),"ms")],e,!1))},t.prototype.warn=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Vi([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},t.prototype.error=function(){for(var e=[],A=0;A<arguments.length;A++)e[A]=arguments[A];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Vi([this.id,"".concat(this.getTime(),"ms")],e,!1)):this.info.apply(this,e))},t.instances={},t}(),hb=function(){function t(e,A){var n;this.windowBounds=A,this.instanceName="#".concat(t.instanceCount++),this.logger=new db({id:this.instanceName,enabled:e.logging}),this.cache=(n=e.cache)!==null&&n!==void 0?n:new xy(this,e)}return t.instanceCount=1,t}(),fb=function(t,e){return e===void 0&&(e={}),gb(t,e)};typeof window<"u"&&pa.setContext(window);var gb=function(t,e){return Re(void 0,void 0,void 0,function(){var A,n,i,r,s,o,a,c,l,u,d,h,g,f,p,B,y,b,v,C,Q,w,Q,F,R,D,H,M,ee,Xe,oe,ie,EA,Ie,Te,_A,eA,Pe,HA,fA;return Fe(this,function(Le){switch(Le.label){case 0:if(!t||typeof t!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(A=t.ownerDocument,!A)throw new Error("Element is not attached to a Document");if(n=A.defaultView,!n)throw new Error("Document is not attached to a Window");return i={allowTaint:(F=e.allowTaint)!==null&&F!==void 0?F:!1,imageTimeout:(R=e.imageTimeout)!==null&&R!==void 0?R:15e3,proxy:e.proxy,useCORS:(D=e.useCORS)!==null&&D!==void 0?D:!1,customIsSameOrigin:e.customIsSameOrigin},r=Co({logging:(H=e.logging)!==null&&H!==void 0?H:!0,cache:e.cache},i),s={windowWidth:(M=e.windowWidth)!==null&&M!==void 0?M:n.innerWidth,windowHeight:(ee=e.windowHeight)!==null&&ee!==void 0?ee:n.innerHeight,scrollX:(Xe=e.scrollX)!==null&&Xe!==void 0?Xe:n.pageXOffset,scrollY:(oe=e.scrollY)!==null&&oe!==void 0?oe:n.pageYOffset},o=new RA(s.scrollX,s.scrollY,s.windowWidth,s.windowHeight),a=new hb(r,o),c=(ie=e.foreignObjectRendering)!==null&&ie!==void 0?ie:!1,l={allowTaint:(EA=e.allowTaint)!==null&&EA!==void 0?EA:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:c,copyStyles:c},a.logger.debug("Starting document clone with size ".concat(o.width,"x").concat(o.height," scrolled to ").concat(-o.left,",").concat(-o.top)),u=new wh(a,t,l),d=u.clonedReferenceElement,d?[4,u.toIFrame(A,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return h=Le.sent(),g=la(d)||gy(d)?qm(d.ownerDocument):Gi(a,d),f=g.width,p=g.height,B=g.left,y=g.top,b=pb(a,d,e.backgroundColor),v={canvas:e.canvas,backgroundColor:b,scale:(Te=(Ie=e.scale)!==null&&Ie!==void 0?Ie:n.devicePixelRatio)!==null&&Te!==void 0?Te:1,x:((_A=e.x)!==null&&_A!==void 0?_A:0)+B,y:((eA=e.y)!==null&&eA!==void 0?eA:0)+y,width:(Pe=e.width)!==null&&Pe!==void 0?Pe:Math.ceil(f),height:(HA=e.height)!==null&&HA!==void 0?HA:Math.ceil(p)},c?(a.logger.debug("Document cloned, using foreign object rendering"),Q=new lb(a,v),[4,Q.render(d)]):[3,3];case 2:return C=Le.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at ".concat(B,",").concat(y," with size ").concat(f,"x").concat(p," using computed rendering")),a.logger.debug("Starting DOM parsing"),w=rh(a,d),b===w.styles.backgroundColor&&(w.styles.backgroundColor=UA.TRANSPARENT),a.logger.debug("Starting renderer for element at ".concat(v.x,",").concat(v.y," with size ").concat(v.width,"x").concat(v.height)),Q=new ib(a,v),[4,Q.render(w)];case 4:C=Le.sent(),Le.label=5;case 5:return(!((fA=e.removeContainer)!==null&&fA!==void 0)||fA)&&(wh.destroy(h)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,C]}})})},pb=function(t,e,A){var n=e.ownerDocument,i=n.documentElement?en(t,getComputedStyle(n.documentElement).backgroundColor):UA.TRANSPARENT,r=n.body?en(t,getComputedStyle(n.body).backgroundColor):UA.TRANSPARENT,s=typeof A=="string"?en(t,A):A===null?UA.TRANSPARENT:4294967295;return e===n.documentElement?st(i)?st(r)?s:r:i:s};/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2019 Google LLC
|
|
49
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/const Kr=globalThis,wa=Kr.ShadowRoot&&(Kr.ShadyCSS===void 0||Kr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rh=Symbol(),xh=new WeakMap;let mb=class{constructor(e,A,n){if(this._$cssResult$=!0,n!==Rh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=A}get styleSheet(){let e=this.o;const A=this.t;if(wa&&e===void 0){const n=A!==void 0&&A.length===1;n&&(e=xh.get(A)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&xh.set(A,e))}return e}toString(){return this.cssText}};const Bb=t=>new mb(typeof t=="string"?t:t+"",void 0,Rh),vb=(t,e)=>{if(wa)t.adoptedStyleSheets=e.map(A=>A instanceof CSSStyleSheet?A:A.styleSheet);else for(const A of e){const n=document.createElement("style"),i=Kr.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=A.cssText,t.appendChild(n)}},Ph=wa?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let A="";for(const n of e.cssRules)A+=n.cssText;return Bb(A)})(t):t;/**
|
|
51
|
-
* @license
|
|
52
|
-
* Copyright 2017 Google LLC
|
|
53
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const{is:Cb,defineProperty:wb,getOwnPropertyDescriptor:yb,getOwnPropertyNames:bb,getOwnPropertySymbols:Ub,getPrototypeOf:Qb}=Object,ut=globalThis,Lh=ut.trustedTypes,Eb=Lh?Lh.emptyScript:"",ya=ut.reactiveElementPolyfillSupport,$n=(t,e)=>t,Vr={toAttribute(t,e){switch(e){case Boolean:t=t?Eb:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let A=t;switch(e){case Boolean:A=t!==null;break;case Number:A=t===null?null:Number(t);break;case Object:case Array:try{A=JSON.parse(t)}catch{A=null}}return A}},ba=(t,e)=>!Cb(t,e),Dh={attribute:!0,type:String,converter:Vr,reflect:!1,useDefault:!1,hasChanged:ba};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ut.litPropertyMetadata??(ut.litPropertyMetadata=new WeakMap);class Yn extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,A=Dh){if(A.state&&(A.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((A=Object.create(A)).wrapped=!0),this.elementProperties.set(e,A),!A.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,A);i!==void 0&&wb(this.prototype,e,i)}}static getPropertyDescriptor(e,A,n){const{get:i,set:r}=yb(this.prototype,e)??{get(){return this[A]},set(s){this[A]=s}};return{get:i,set(s){const o=i==null?void 0:i.call(this);r==null||r.call(this,s),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Dh}static _$Ei(){if(this.hasOwnProperty($n("elementProperties")))return;const e=Qb(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($n("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($n("properties"))){const A=this.properties,n=[...bb(A),...Ub(A)];for(const i of n)this.createProperty(i,A[i])}const e=this[Symbol.metadata];if(e!==null){const A=litPropertyMetadata.get(e);if(A!==void 0)for(const[n,i]of A)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[A,n]of this.elementProperties){const i=this._$Eu(A,n);i!==void 0&&this._$Eh.set(i,A)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const A=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)A.unshift(Ph(i))}else e!==void 0&&A.push(Ph(e));return A}static _$Eu(e,A){const n=A.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(A=>this.enableUpdating=A),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(A=>A(this))}addController(e){var A;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((A=e.hostConnected)==null||A.call(e))}removeController(e){var A;(A=this._$EO)==null||A.delete(e)}_$E_(){const e=new Map,A=this.constructor.elementProperties;for(const n of A.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return vb(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(A=>{var n;return(n=A.hostConnected)==null?void 0:n.call(A)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(A=>{var n;return(n=A.hostDisconnected)==null?void 0:n.call(A)})}attributeChangedCallback(e,A,n){this._$AK(e,n)}_$ET(e,A){var r;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const s=(((r=n.converter)==null?void 0:r.toAttribute)!==void 0?n.converter:Vr).toAttribute(A,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,A){var r,s;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Vr;this._$Em=i,this[i]=a.fromAttribute(A,o.type)??((s=this._$Ej)==null?void 0:s.get(i))??null,this._$Em=null}}requestUpdate(e,A,n){var i;if(e!==void 0){const r=this.constructor,s=this[e];if(n??(n=r.getPropertyOptions(e)),!((n.hasChanged??ba)(s,A)||n.useDefault&&n.reflect&&s===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,A,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,A,{useDefault:n,reflect:i,wrapped:r},s){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,s??A??this[e]),r!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(A=void 0),this._$AL.set(e,A)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(A){Promise.reject(A)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[r,s]of i){const{wrapped:o}=s,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,s,a)}}let e=!1;const A=this._$AL;try{e=this.shouldUpdate(A),e?(this.willUpdate(A),(n=this._$EO)==null||n.forEach(i=>{var r;return(r=i.hostUpdate)==null?void 0:r.call(i)}),this.update(A)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(A)}willUpdate(e){}_$AE(e){var A;(A=this._$EO)==null||A.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(A=>this._$ET(A,this[A]))),this._$EM()}updated(e){}firstUpdated(e){}}Yn.elementStyles=[],Yn.shadowRootOptions={mode:"open"},Yn[$n("elementProperties")]=new Map,Yn[$n("finalized")]=new Map,ya==null||ya({ReactiveElement:Yn}),(ut.reactiveElementVersions??(ut.reactiveElementVersions=[])).push("2.1.0");/**
|
|
55
|
-
* @license
|
|
56
|
-
* Copyright 2017 Google LLC
|
|
57
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const Sb={attribute:!0,type:String,converter:Vr,reflect:!1,hasChanged:ba},Tb=(t=Sb,e,A)=>{const{kind:n,metadata:i}=A;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),n==="setter"&&((t=Object.create(t)).wrapped=!0),r.set(A.name,t),n==="accessor"){const{name:s}=A;return{set(o){const a=e.get.call(this);e.set.call(this,o),this.requestUpdate(s,a,t)},init(o){return o!==void 0&&this.C(s,void 0,t,o),o}}}if(n==="setter"){const{name:s}=A;return function(o){const a=this[s];e.call(this,o),this.requestUpdate(s,a,t)}}throw Error("Unsupported decorator location: "+n)};function Z(t){return(e,A)=>typeof A=="object"?Tb(t,e,A):((n,i,r)=>{const s=i.hasOwnProperty(r);return i.constructor.createProperty(r,n),s?Object.getOwnPropertyDescriptor(i,r):void 0})(t,e,A)}/**
|
|
59
|
-
* @license
|
|
60
|
-
* Copyright 2017 Google LLC
|
|
61
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/function Ge(t){return Z({...t,state:!0,attribute:!1})}class Fb{constructor(e){this.namespace=e}getItem(e){return localStorage.getItem(`${this.namespace}.${e}`)}setItem(e,A){localStorage.setItem(`${this.namespace}.${e}`,A)}removeItem(e){localStorage.removeItem(`${this.namespace}.${e}`)}clear(){for(let e=0;e<localStorage.length;e++){const A=localStorage.key(e);A&&A.startsWith(`${this.namespace}.`)&&localStorage.removeItem(A)}}}const Ua={SESSION_DATA:"session_data"},Qa=new Fb("io.obi.widget");var kb=Object.defineProperty,Ib=Object.getOwnPropertyDescriptor,Gr=(t,e,A,n)=>{for(var i=n>1?void 0:n?Ib(e,A):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,A,i):s(i))||i);return n&&i&&kb(e,A,i),i};class cn extends _.LitElement{constructor(){super(...arguments),this.id="",this.isActive=!1,this.isSpecial=!1}handleClick(e){e.preventDefault(),e.stopPropagation();const A=new CustomEvent("click",{detail:{id:this.id,isActive:!this.isActive},bubbles:!0,composed:!0});this.dispatchEvent(A),this.onClick&&this.onClick(this.id,!this.isActive)}render(){return _.html`
|
|
1
|
+
var A,t;A=this,t=function(A,t){"use strict";const e={}.VITE_API_BASE_URL;function i(A){return A&&A.A&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var n={exports:{}};!function(A){var t=Object.prototype.hasOwnProperty,e="~";function i(){}function n(A,t,e){this.fn=A,this.context=t,this.once=e||!1}function s(A,t,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new n(i,s||A,r),a=e?e+t:t;return A.B[a]?A.B[a].fn?A.B[a]=[A.B[a],o]:A.B[a].push(o):(A.B[a]=o,A.U++),A}function r(A,t){0===--A.U?A.B=new i:delete A.B[t]}function o(){this.B=new i,this.U=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(e=!1)),o.prototype.eventNames=function(){var A,i,n=[];if(0===this.U)return n;for(i in A=this.B)t.call(A,i)&&n.push(e?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(A)):n},o.prototype.listeners=function(A){var t=e?e+A:A,i=this.B[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,r=new Array(s);n<s;n++)r[n]=i[n].fn;return r},o.prototype.listenerCount=function(A){var t=e?e+A:A,i=this.B[t];return i?i.fn?1:i.length:0},o.prototype.emit=function(A,t,i,n,s,r){var o=e?e+A:A;if(!this.B[o])return!1;var a,c,h=this.B[o],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(A,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,i),!0;case 4:return h.fn.call(h.context,t,i,n),!0;case 5:return h.fn.call(h.context,t,i,n,s),!0;case 6:return h.fn.call(h.context,t,i,n,s,r),!0}for(c=1,a=new Array(u-1);c<u;c++)a[c-1]=arguments[c];h.fn.apply(h.context,a)}else{var l,d=h.length;for(c=0;c<d;c++)switch(h[c].once&&this.removeListener(A,h[c].fn,void 0,!0),u){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,t);break;case 3:h[c].fn.call(h[c].context,t,i);break;case 4:h[c].fn.call(h[c].context,t,i,n);break;default:if(!a)for(l=1,a=new Array(u-1);l<u;l++)a[l-1]=arguments[l];h[c].fn.apply(h[c].context,a)}}return!0},o.prototype.on=function(A,t,e){return s(this,A,t,e,!1)},o.prototype.once=function(A,t,e){return s(this,A,t,e,!0)},o.prototype.removeListener=function(A,t,i,n){var s=e?e+A:A;if(!this.B[s])return this;if(!t)return r(this,s),this;var o=this.B[s];if(o.fn)o.fn!==t||n&&!o.once||i&&o.context!==i||r(this,s);else{for(var a=0,c=[],h=o.length;a<h;a++)(o[a].fn!==t||n&&!o[a].once||i&&o[a].context!==i)&&c.push(o[a]);c.length?this.B[s]=1===c.length?c[0]:c:r(this,s)}return this},o.prototype.removeAllListeners=function(A){var t;return A?(t=e?e+A:A,this.B[t]&&r(this,t)):(this.B=new i,this.U=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=e,o.EventEmitter=o,A.exports=o}(n);const s=i(n.exports);function r(A,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in A)){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(A,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(A)}var o=Object.defineProperty,a=(A,t,e)=>((A,t,e)=>t in A?o(A,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):A[t]=e)(A,"symbol"!=typeof t?t+"":t,e);let c=class{constructor(){a(this,"_locking"),a(this,"_locks"),this.F=Promise.resolve(),this.H=0}isLocked(){return this.H>0}lock(){let A;this.H+=1;const t=new Promise((t=>A=()=>{this.H-=1,t()})),e=this.F.then((()=>A));return this.F=this.F.then((()=>t)),e}};function h(A,t){if(!A)throw new Error(t)}function u(A){if("number"!=typeof A)throw new Error("invalid int 32: "+typeof A);if(!Number.isInteger(A)||A>2147483647||A<-2147483648)throw new Error("invalid int 32: "+A)}function l(A){if("number"!=typeof A)throw new Error("invalid uint 32: "+typeof A);if(!Number.isInteger(A)||A>4294967295||A<0)throw new Error("invalid uint 32: "+A)}function d(A){if("number"!=typeof A)throw new Error("invalid float 32: "+typeof A);if(Number.isFinite(A)&&(A>34028234663852886e22||A<-34028234663852886e22))throw new Error("invalid float 32: "+A)}const B=Symbol("@bufbuild/protobuf/enum-type");function w(A,t,e,i){A[B]=f(t,e.map((t=>({no:t.no,name:t.name,localName:A[t.no]}))))}function f(A,t,e){const i=Object.create(null),n=Object.create(null),s=[];for(const r of t){const A=g(r);s.push(A),i[r.name]=A,n[r.no]=A}return{typeName:A,values:s,findName:A=>i[A],findNumber:A=>n[A]}}function g(A){return"localName"in A?A:Object.assign(Object.assign({},A),{localName:A.name})}class Q{equals(A){return this.getType().runtime.util.equals(this.getType(),this,A)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(A,t){const e=this.getType().runtime.bin,i=e.makeReadOptions(t);return e.readMessage(this,i.readerFactory(A),A.byteLength,i),this}fromJson(A,t){const e=this.getType(),i=e.runtime.json,n=i.makeReadOptions(t);return i.readMessage(e,A,n,this),this}fromJsonString(A,t){let e;try{e=JSON.parse(A)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(e,t)}toBinary(A){const t=this.getType().runtime.bin,e=t.makeWriteOptions(A),i=e.writerFactory();return t.writeMessage(this,i,e),i.finish()}toJson(A){const t=this.getType().runtime.json,e=t.makeWriteOptions(A);return t.writeMessage(this,e)}toJsonString(A){var t;const e=this.toJson(A);return JSON.stringify(e,null,null!==(t=null==A?void 0:A.prettySpaces)&&void 0!==t?t:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function v(){let A=0,t=0;for(let i=0;i<28;i+=7){let e=this.buf[this.pos++];if(A|=(127&e)<<i,!(128&e))return this.assertBounds(),[A,t]}let e=this.buf[this.pos++];if(A|=(15&e)<<28,t=(112&e)>>4,!(128&e))return this.assertBounds(),[A,t];for(let i=3;i<=31;i+=7){let e=this.buf[this.pos++];if(t|=(127&e)<<i,!(128&e))return this.assertBounds(),[A,t]}throw new Error("invalid varint")}function m(A,t,e){for(let s=0;s<28;s+=7){const i=A>>>s,n=!(i>>>7==0&&0==t),r=255&(n?128|i:i);if(e.push(r),!n)return}const i=A>>>28&15|(7&t)<<4,n=!!(t>>3);if(e.push(255&(n?128|i:i)),n){for(let A=3;A<31;A+=7){const i=t>>>A,n=!(i>>>7==0),s=255&(n?128|i:i);if(e.push(s),!n)return}e.push(t>>>31&1)}}const p=4294967296;function U(A){const t="-"===A[0];t&&(A=A.slice(1));const e=1e6;let i=0,n=0;function s(t,s){const r=Number(A.slice(t,s));n*=e,i=i*e+r,i>=p&&(n+=i/p|0,i%=p)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),t?y(i,n):F(i,n)}function C(A,t){if(({lo:A,hi:t}=function(A,t){return{lo:A>>>0,hi:t>>>0}}(A,t)),t<=2097151)return String(p*t+A);const e=16777215&(A>>>24|t<<8),i=t>>16&65535;let n=(16777215&A)+6777216*e+6710656*i,s=e+8147497*i,r=2*i;const o=1e7;return n>=o&&(s+=Math.floor(n/o),n%=o),s>=o&&(r+=Math.floor(s/o),s%=o),r.toString()+b(s)+b(n)}function F(A,t){return{lo:0|A,hi:0|t}}function y(A,t){return t=~t,A?A=1+~A:t+=1,F(A,t)}const b=A=>{const t=String(A);return"0000000".slice(t.length)+t};function E(A,t){if(A>=0){for(;A>127;)t.push(127&A|128),A>>>=7;t.push(A)}else{for(let e=0;e<9;e++)t.push(127&A|128),A>>=7;t.push(1)}}function H(){let A=this.buf[this.pos++],t=127&A;if(!(128&A))return this.assertBounds(),t;if(A=this.buf[this.pos++],t|=(127&A)<<7,!(128&A))return this.assertBounds(),t;if(A=this.buf[this.pos++],t|=(127&A)<<14,!(128&A))return this.assertBounds(),t;if(A=this.buf[this.pos++],t|=(127&A)<<21,!(128&A))return this.assertBounds(),t;A=this.buf[this.pos++],t|=(15&A)<<28;for(let e=5;128&A&&e<10;e++)A=this.buf[this.pos++];if(128&A)throw new Error("invalid varint");return this.assertBounds(),t>>>0}const I=function(){const A=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof A.getBigInt64&&"function"==typeof A.getBigUint64&&"function"==typeof A.setBigInt64&&"function"==typeof A.setBigUint64&&("object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),e=BigInt("9223372036854775807"),i=BigInt("0"),n=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(A){const i="bigint"==typeof A?A:BigInt(A);if(i>e||i<t)throw new Error("int64 invalid: ".concat(A));return i},uParse(A){const t="bigint"==typeof A?A:BigInt(A);if(t>n||t<i)throw new Error("uint64 invalid: ".concat(A));return t},enc(t){return A.setBigInt64(0,this.parse(t),!0),{lo:A.getInt32(0,!0),hi:A.getInt32(4,!0)}},uEnc(t){return A.setBigInt64(0,this.uParse(t),!0),{lo:A.getInt32(0,!0),hi:A.getInt32(4,!0)}},dec:(t,e)=>(A.setInt32(0,t,!0),A.setInt32(4,e,!0),A.getBigInt64(0,!0)),uDec:(t,e)=>(A.setInt32(0,t,!0),A.setInt32(4,e,!0),A.getBigUint64(0,!0))}}const t=A=>h(/^-?[0-9]+$/.test(A),"int64 invalid: ".concat(A)),e=A=>h(/^[0-9]+$/.test(A),"uint64 invalid: ".concat(A));return{zero:"0",supported:!1,parse:A=>("string"!=typeof A&&(A=A.toString()),t(A),A),uParse:A=>("string"!=typeof A&&(A=A.toString()),e(A),A),enc:A=>("string"!=typeof A&&(A=A.toString()),t(A),U(A)),uEnc:A=>("string"!=typeof A&&(A=A.toString()),e(A),U(A)),dec:(A,t)=>function(A,t){let e=F(A,t);const i=2147483648&e.hi;i&&(e=y(e.lo,e.hi));const n=C(e.lo,e.hi);return i?"-"+n:n}(A,t),uDec:(A,t)=>C(A,t)}}();var k,T,S,K,O,D;function M(A,t,e){if(t===e)return!0;if(A==k.BYTES){if(!(t instanceof Uint8Array&&e instanceof Uint8Array))return!1;if(t.length!==e.length)return!1;for(let A=0;A<t.length;A++)if(t[A]!==e[A])return!1;return!0}switch(A){case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:return t==e}return!1}function L(A,t){switch(A){case k.BOOL:return!1;case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:return 0==t?I.zero:"0";case k.DOUBLE:case k.FLOAT:return 0;case k.BYTES:return new Uint8Array(0);case k.STRING:return"";default:return 0}}function R(A,t){switch(A){case k.BOOL:return!1===t;case k.STRING:return""===t;case k.BYTES:return t instanceof Uint8Array&&!t.byteLength;default:return 0==t}}(T=k||(k={}))[T.DOUBLE=1]="DOUBLE",T[T.FLOAT=2]="FLOAT",T[T.INT64=3]="INT64",T[T.UINT64=4]="UINT64",T[T.INT32=5]="INT32",T[T.FIXED64=6]="FIXED64",T[T.FIXED32=7]="FIXED32",T[T.BOOL=8]="BOOL",T[T.STRING=9]="STRING",T[T.BYTES=12]="BYTES",T[T.UINT32=13]="UINT32",T[T.SFIXED32=15]="SFIXED32",T[T.SFIXED64=16]="SFIXED64",T[T.SINT32=17]="SINT32",T[T.SINT64=18]="SINT64",(K=S||(S={}))[K.BIGINT=0]="BIGINT",K[K.STRING=1]="STRING",(D=O||(O={}))[D.Varint=0]="Varint",D[D.Bit64=1]="Bit64",D[D.LengthDelimited=2]="LengthDelimited",D[D.StartGroup=3]="StartGroup",D[D.EndGroup=4]="EndGroup",D[D.Bit32=5]="Bit32";class N{constructor(A){this.stack=[],this.textEncoder=null!=A?A:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let A=0;for(let i=0;i<this.chunks.length;i++)A+=this.chunks[i].length;let t=new Uint8Array(A),e=0;for(let i=0;i<this.chunks.length;i++)t.set(this.chunks[i],e),e+=this.chunks[i].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let A=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(A.byteLength),this.raw(A)}tag(A,t){return this.uint32((A<<3|t)>>>0)}raw(A){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(A),this}uint32(A){for(l(A);A>127;)this.buf.push(127&A|128),A>>>=7;return this.buf.push(A),this}int32(A){return u(A),E(A,this.buf),this}bool(A){return this.buf.push(A?1:0),this}bytes(A){return this.uint32(A.byteLength),this.raw(A)}string(A){let t=this.textEncoder.encode(A);return this.uint32(t.byteLength),this.raw(t)}float(A){d(A);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,A,!0),this.raw(t)}double(A){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,A,!0),this.raw(t)}fixed32(A){l(A);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,A,!0),this.raw(t)}sfixed32(A){u(A);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,A,!0),this.raw(t)}sint32(A){return u(A),E(A=(A<<1^A>>31)>>>0,this.buf),this}sfixed64(A){let t=new Uint8Array(8),e=new DataView(t.buffer),i=I.enc(A);return e.setInt32(0,i.lo,!0),e.setInt32(4,i.hi,!0),this.raw(t)}fixed64(A){let t=new Uint8Array(8),e=new DataView(t.buffer),i=I.uEnc(A);return e.setInt32(0,i.lo,!0),e.setInt32(4,i.hi,!0),this.raw(t)}int64(A){let t=I.enc(A);return m(t.lo,t.hi,this.buf),this}sint64(A){let t=I.enc(A),e=t.hi>>31;return m(t.lo<<1^e,(t.hi<<1|t.lo>>>31)^e,this.buf),this}uint64(A){let t=I.uEnc(A);return m(t.lo,t.hi,this.buf),this}}class G{constructor(A,t){this.varint64=v,this.uint32=H,this.buf=A,this.len=A.length,this.pos=0,this.view=new DataView(A.buffer,A.byteOffset,A.byteLength),this.textDecoder=null!=t?t:new TextDecoder}tag(){let A=this.uint32(),t=A>>>3,e=7&A;if(t<=0||e<0||e>5)throw new Error("illegal tag: field no "+t+" wire type "+e);return[t,e]}skip(A,t){let e=this.pos;switch(A){case O.Varint:for(;128&this.buf[this.pos++];);break;case O.Bit64:this.pos+=4;case O.Bit32:this.pos+=4;break;case O.LengthDelimited:let e=this.uint32();this.pos+=e;break;case O.StartGroup:for(;;){const[A,e]=this.tag();if(e===O.EndGroup){if(void 0!==t&&A!==t)throw new Error("invalid end group tag");break}this.skip(e,A)}break;default:throw new Error("cant skip wire type "+A)}return this.assertBounds(),this.buf.subarray(e,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let A=this.uint32();return A>>>1^-(1&A)}int64(){return I.dec(...this.varint64())}uint64(){return I.uDec(...this.varint64())}sint64(){let[A,t]=this.varint64(),e=-(1&A);return A=(A>>>1|(1&t)<<31)^e,t=t>>>1^e,I.dec(A,t)}bool(){let[A,t]=this.varint64();return 0!==A||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return I.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return I.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let A=this.uint32(),t=this.pos;return this.pos+=A,this.assertBounds(),this.buf.subarray(t,t+A)}string(){return this.textDecoder.decode(this.bytes())}}function x(A){const t=A.field.localName,e=Object.create(null);return e[t]=function(A){const t=A.field;if(t.repeated)return[];if(void 0!==t.default)return t.default;switch(t.kind){case"enum":return t.T.values[0].no;case"scalar":return L(t.T,t.L);case"message":const A=t.T,e=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(e):e;case"map":throw"map fields are not allowed to be extensions"}}(A),[e,()=>e[t]]}let V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),j=[];for(let MQ=0;MQ<V.length;MQ++)j[V[MQ].charCodeAt(0)]=MQ;j["-".charCodeAt(0)]=V.indexOf("+"),j["_".charCodeAt(0)]=V.indexOf("/");const P={dec(A){let t=3*A.length/4;"="==A[A.length-2]?t-=2:"="==A[A.length-1]&&(t-=1);let e,i=new Uint8Array(t),n=0,s=0,r=0;for(let o=0;o<A.length;o++){if(e=j[A.charCodeAt(o)],void 0===e)switch(A[o]){case"=":s=0;case"\n":case"\r":case"\t":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:r=e,s=1;break;case 1:i[n++]=r<<2|(48&e)>>4,r=e,s=2;break;case 2:i[n++]=(15&r)<<4|(60&e)>>2,r=e,s=3;break;case 3:i[n++]=(3&r)<<6|e,s=0}}if(1==s)throw Error("invalid base64 string.");return i.subarray(0,n)},enc(A){let t,e="",i=0,n=0;for(let s=0;s<A.length;s++)switch(t=A[s],i){case 0:e+=V[t>>2],n=(3&t)<<4,i=1;break;case 1:e+=V[n|t>>4],n=(15&t)<<2,i=2;break;case 2:e+=V[n|t>>6],e+=V[63&t],i=0}return i&&(e+=V[n],e+="=",1==i&&(e+="=")),e}};function _(A,t,e){Y(t,A);const i=t.runtime.bin.makeReadOptions(e),n=function(A,t){if(!t.repeated&&("enum"==t.kind||"scalar"==t.kind)){for(let e=A.length-1;e>=0;--e)if(A[e].no==t.no)return[A[e]];return[]}return A.filter((A=>A.no===t.no))}(A.getType().runtime.bin.listUnknownFields(A),t.field),[s,r]=x(t);for(const o of n)t.runtime.bin.readField(s,i.readerFactory(o.data),t.field,o.wireType,i);return r()}function J(A,t,e,i){Y(t,A);const n=t.runtime.bin.makeReadOptions(i),s=t.runtime.bin.makeWriteOptions(i);if(X(A,t)){const e=A.getType().runtime.bin.listUnknownFields(A).filter((A=>A.no!=t.field.no));A.getType().runtime.bin.discardUnknownFields(A);for(const t of e)A.getType().runtime.bin.onUnknownField(A,t.no,t.wireType,t.data)}const r=s.writerFactory();let o=t.field;o.opt||o.repeated||"enum"!=o.kind&&"scalar"!=o.kind||(o=Object.assign(Object.assign({},t.field),{opt:!0})),t.runtime.bin.writeField(o,e,r,s);const a=n.readerFactory(r.finish());for(;a.pos<a.len;){const[t,e]=a.tag(),i=a.skip(e,t);A.getType().runtime.bin.onUnknownField(A,t,e,i)}}function X(A,t){const e=A.getType();return t.extendee.typeName===e.typeName&&!!e.runtime.bin.listUnknownFields(A).find((A=>A.no==t.field.no))}function Y(A,t){h(A.extendee.typeName==t.getType().typeName,"extension ".concat(A.typeName," can only be applied to message ").concat(A.extendee.typeName))}function Z(A,t){const e=A.localName;if(A.repeated)return t[e].length>0;if(A.oneof)return t[A.oneof.localName].case===e;switch(A.kind){case"enum":case"scalar":return A.opt||A.req?void 0!==t[e]:"enum"==A.kind?t[e]!==A.T.values[0].no:!R(A.T,t[e]);case"message":return void 0!==t[e];case"map":return Object.keys(t[e]).length>0}}function W(A,t){const e=A.localName,i=!A.opt&&!A.req;if(A.repeated)t[e]=[];else if(A.oneof)t[A.oneof.localName]={case:void 0};else switch(A.kind){case"map":t[e]={};break;case"enum":t[e]=i?A.T.values[0].no:void 0;break;case"scalar":t[e]=i?L(A.T,A.L):void 0;break;case"message":t[e]=void 0}}function q(A,t){if(null===A||"object"!=typeof A)return!1;if(!Object.getOwnPropertyNames(Q.prototype).every((t=>t in A&&"function"==typeof A[t])))return!1;const e=A.getType();return null!==e&&"function"==typeof e&&"typeName"in e&&"string"==typeof e.typeName&&(void 0===t||e.typeName==t.typeName)}function z(A,t){return q(t)||!A.fieldWrapper?t:A.fieldWrapper.wrapField(t)}k.DOUBLE,k.FLOAT,k.INT64,k.UINT64,k.INT32,k.UINT32,k.BOOL,k.STRING,k.BYTES;const $={ignoreUnknownFields:!1},AA={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},tA=Symbol(),eA=Symbol();function iA(A){if(null===A)return"null";switch(typeof A){case"object":return Array.isArray(A)?"array":"object";case"string":return A.length>100?"string":'"'.concat(A.split('"').join('\\"'),'"');default:return String(A)}}function nA(A,t,e,i,n){let s=e.localName;if(e.repeated){if(h("map"!=e.kind),null===t)return;if(!Array.isArray(t))throw new Error("cannot decode field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(t)));const o=A[s];for(const A of t){if(null===A)throw new Error("cannot decode field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(A)));switch(e.kind){case"message":o.push(e.T.fromJson(A,i));break;case"enum":const t=oA(e.T,A,i.ignoreUnknownFields,!0);t!==eA&&o.push(t);break;case"scalar":try{o.push(rA(e.T,A,e.L,!0))}catch(r){let t="cannot decode field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(A));throw r instanceof Error&&r.message.length>0&&(t+=": ".concat(r.message)),new Error(t)}}}}else if("map"==e.kind){if(null===t)return;if("object"!=typeof t||Array.isArray(t))throw new Error("cannot decode field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(t)));const o=A[s];for(const[A,s]of Object.entries(t)){if(null===s)throw new Error("cannot decode field ".concat(n.typeName,".").concat(e.name," from JSON: map value null"));let a;try{a=sA(e.K,A)}catch(r){let A="cannot decode map key for field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(t));throw r instanceof Error&&r.message.length>0&&(A+=": ".concat(r.message)),new Error(A)}switch(e.V.kind){case"message":o[a]=e.V.T.fromJson(s,i);break;case"enum":const A=oA(e.V.T,s,i.ignoreUnknownFields,!0);A!==eA&&(o[a]=A);break;case"scalar":try{o[a]=rA(e.V.T,s,S.BIGINT,!0)}catch(r){let A="cannot decode map value for field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(t));throw r instanceof Error&&r.message.length>0&&(A+=": ".concat(r.message)),new Error(A)}}}}else switch(e.oneof&&(A=A[e.oneof.localName]={case:s},s="value"),e.kind){case"message":const o=e.T;if(null===t&&"google.protobuf.Value"!=o.typeName)return;let a=A[s];q(a)?a.fromJson(t,i):(A[s]=a=o.fromJson(t,i),o.fieldWrapper&&!e.oneof&&(A[s]=o.fieldWrapper.unwrapField(a)));break;case"enum":const c=oA(e.T,t,i.ignoreUnknownFields,!1);switch(c){case tA:W(e,A);break;case eA:break;default:A[s]=c}break;case"scalar":try{const i=rA(e.T,t,e.L,!1);i===tA?W(e,A):A[s]=i}catch(r){let A="cannot decode field ".concat(n.typeName,".").concat(e.name," from JSON: ").concat(iA(t));throw r instanceof Error&&r.message.length>0&&(A+=": ".concat(r.message)),new Error(A)}}}function sA(A,t){if(A===k.BOOL)switch(t){case"true":t=!0;break;case"false":t=!1}return rA(A,t,S.BIGINT,!0).toString()}function rA(A,t,e,i){if(null===t)return i?L(A,e):tA;switch(A){case k.DOUBLE:case k.FLOAT:if("NaN"===t)return Number.NaN;if("Infinity"===t)return Number.POSITIVE_INFINITY;if("-Infinity"===t)return Number.NEGATIVE_INFINITY;if(""===t)break;if("string"==typeof t&&t.trim().length!==t.length)break;if("string"!=typeof t&&"number"!=typeof t)break;const i=Number(t);if(Number.isNaN(i))break;if(!Number.isFinite(i))break;return A==k.FLOAT&&d(i),i;case k.INT32:case k.FIXED32:case k.SFIXED32:case k.SINT32:case k.UINT32:let s;if("number"==typeof t?s=t:"string"==typeof t&&t.length>0&&t.trim().length===t.length&&(s=Number(t)),void 0===s)break;return A==k.UINT32||A==k.FIXED32?l(s):u(s),s;case k.INT64:case k.SFIXED64:case k.SINT64:if("number"!=typeof t&&"string"!=typeof t)break;const r=I.parse(t);return e?r.toString():r;case k.FIXED64:case k.UINT64:if("number"!=typeof t&&"string"!=typeof t)break;const o=I.uParse(t);return e?o.toString():o;case k.BOOL:if("boolean"!=typeof t)break;return t;case k.STRING:if("string"!=typeof t)break;try{encodeURIComponent(t)}catch(n){throw new Error("invalid UTF8")}return t;case k.BYTES:if(""===t)return new Uint8Array(0);if("string"!=typeof t)break;return P.dec(t)}throw new Error}function oA(A,t,e,i){if(null===t)return"google.protobuf.NullValue"==A.typeName?0:i?A.values[0].no:tA;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const i=A.findName(t);if(void 0!==i)return i.no;if(e)return eA}throw new Error("cannot decode enum ".concat(A.typeName," from JSON: ").concat(iA(t)))}function aA(A){return!(!A.repeated&&"map"!=A.kind&&(A.oneof||"message"==A.kind||A.opt||A.req))}function cA(A,t,e){if("map"==A.kind){h("object"==typeof t&&null!=t);const i={},n=Object.entries(t);switch(A.V.kind){case"scalar":for(const[e,s]of n)i[e.toString()]=uA(A.V.T,s);break;case"message":for(const[A,s]of n)i[A.toString()]=s.toJson(e);break;case"enum":const t=A.V.T;for(const[A,s]of n)i[A.toString()]=hA(t,s,e.enumAsInteger)}return e.emitDefaultValues||n.length>0?i:void 0}if(A.repeated){h(Array.isArray(t));const i=[];switch(A.kind){case"scalar":for(let e=0;e<t.length;e++)i.push(uA(A.T,t[e]));break;case"enum":for(let n=0;n<t.length;n++)i.push(hA(A.T,t[n],e.enumAsInteger));break;case"message":for(let A=0;A<t.length;A++)i.push(t[A].toJson(e))}return e.emitDefaultValues||i.length>0?i:void 0}switch(A.kind){case"scalar":return uA(A.T,t);case"enum":return hA(A.T,t,e.enumAsInteger);case"message":return z(A.T,t).toJson(e)}}function hA(A,t,e){var i;if(h("number"==typeof t),"google.protobuf.NullValue"==A.typeName)return null;if(e)return t;const n=A.findNumber(t);return null!==(i=null==n?void 0:n.name)&&void 0!==i?i:t}function uA(A,t){switch(A){case k.INT32:case k.SFIXED32:case k.SINT32:case k.FIXED32:case k.UINT32:return h("number"==typeof t),t;case k.FLOAT:case k.DOUBLE:return h("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case k.STRING:return h("string"==typeof t),t;case k.BOOL:return h("boolean"==typeof t),t;case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:return h("bigint"==typeof t||"string"==typeof t||"number"==typeof t),t.toString();case k.BYTES:return h(t instanceof Uint8Array),P.enc(t)}}const lA=Symbol("@bufbuild/protobuf/unknown-fields"),dA={readUnknownFields:!0,readerFactory:A=>new G(A)},BA={writeUnknownFields:!0,writerFactory:()=>new N};function wA(A,t,e,i,n){let{repeated:s,localName:r}=e;switch(e.oneof&&((A=A[e.oneof.localName]).case!=r&&delete A.value,A.case=r,r="value"),e.kind){case"scalar":case"enum":const o="enum"==e.kind?k.INT32:e.T;let a=QA;if("scalar"==e.kind&&e.L>0&&(a=gA),s){let e=A[r];if(i==O.LengthDelimited&&o!=k.STRING&&o!=k.BYTES){let A=t.uint32()+t.pos;for(;t.pos<A;)e.push(a(t,o))}else e.push(a(t,o))}else A[r]=a(t,o);break;case"message":const c=e.T;s?A[r].push(fA(t,new c,n,e)):q(A[r])?fA(t,A[r],n,e):(A[r]=fA(t,new c,n,e),!c.fieldWrapper||e.oneof||e.repeated||(A[r]=c.fieldWrapper.unwrapField(A[r])));break;case"map":let[h,u]=function(A,t,e){const i=t.uint32(),n=t.pos+i;let s,r;for(;t.pos<n;){const[i]=t.tag();switch(i){case 1:s=QA(t,A.K);break;case 2:switch(A.V.kind){case"scalar":r=QA(t,A.V.T);break;case"enum":r=t.int32();break;case"message":r=fA(t,new A.V.T,e,void 0)}}}if(void 0===s&&(s=L(A.K,S.BIGINT)),"string"!=typeof s&&"number"!=typeof s&&(s=s.toString()),void 0===r)switch(A.V.kind){case"scalar":r=L(A.V.T,S.BIGINT);break;case"enum":r=A.V.T.values[0].no;break;case"message":r=new A.V.T}return[s,r]}(e,t,n);A[r][h]=u}}function fA(A,t,e,i){const n=t.getType().runtime.bin,s=null==i?void 0:i.delimited;return n.readMessage(t,A,s?i.no:A.uint32(),e,s),t}function gA(A,t){const e=QA(A,t);return"bigint"==typeof e?e.toString():e}function QA(A,t){switch(t){case k.STRING:return A.string();case k.BOOL:return A.bool();case k.DOUBLE:return A.double();case k.FLOAT:return A.float();case k.INT32:return A.int32();case k.INT64:return A.int64();case k.UINT64:return A.uint64();case k.FIXED64:return A.fixed64();case k.BYTES:return A.bytes();case k.FIXED32:return A.fixed32();case k.SFIXED32:return A.sfixed32();case k.SFIXED64:return A.sfixed64();case k.SINT64:return A.sint64();case k.UINT32:return A.uint32();case k.SINT32:return A.sint32()}}function vA(A,t,e,i){h(void 0!==t);const n=A.repeated;switch(A.kind){case"scalar":case"enum":let s="enum"==A.kind?k.INT32:A.T;if(n)if(h(Array.isArray(t)),A.packed)!function(A,t,e,i){if(!i.length)return;A.tag(e,O.LengthDelimited).fork();let[,n]=CA(t);for(let s=0;s<i.length;s++)A[n](i[s]);A.join()}(e,s,A.no,t);else for(const i of t)UA(e,s,A.no,i);else UA(e,s,A.no,t);break;case"message":if(n){h(Array.isArray(t));for(const n of t)pA(e,i,A,n)}else pA(e,i,A,t);break;case"map":h("object"==typeof t&&null!=t);for(const[n,r]of Object.entries(t))mA(e,i,A,n,r)}}function mA(A,t,e,i,n){A.tag(e.no,O.LengthDelimited),A.fork();let s=i;switch(e.K){case k.INT32:case k.FIXED32:case k.UINT32:case k.SFIXED32:case k.SINT32:s=Number.parseInt(i);break;case k.BOOL:h("true"==i||"false"==i),s="true"==i}switch(UA(A,e.K,1,s),e.V.kind){case"scalar":UA(A,e.V.T,2,n);break;case"enum":UA(A,k.INT32,2,n);break;case"message":h(void 0!==n),A.tag(2,O.LengthDelimited).bytes(n.toBinary(t))}A.join()}function pA(A,t,e,i){const n=z(e.T,i);e.delimited?A.tag(e.no,O.StartGroup).raw(n.toBinary(t)).tag(e.no,O.EndGroup):A.tag(e.no,O.LengthDelimited).bytes(n.toBinary(t))}function UA(A,t,e,i){h(void 0!==i);let[n,s]=CA(t);A.tag(e,n)[s](i)}function CA(A){let t=O.Varint;switch(A){case k.BYTES:case k.STRING:t=O.LengthDelimited;break;case k.DOUBLE:case k.FIXED64:case k.SFIXED64:t=O.Bit64;break;case k.FIXED32:case k.SFIXED32:case k.FLOAT:t=O.Bit32}return[t,k[A].toLowerCase()]}function FA(A){if(void 0===A)return A;if(q(A))return A.clone();if(A instanceof Uint8Array){const t=new Uint8Array(A.byteLength);return t.set(A),t}return A}function yA(A){return A instanceof Uint8Array?A:new Uint8Array(A)}class bA{constructor(A,t){this.I=A,this.S=t}findJsonName(A){if(!this.jsonNames){const A={};for(const t of this.list())A[t.jsonName]=A[t.name]=t;this.jsonNames=A}return this.jsonNames[A]}find(A){if(!this.numbers){const A={};for(const t of this.list())A[t.no]=t;this.numbers=A}return this.numbers[A]}list(){return this.all||(this.all=this.S(this.I)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort(((A,t)=>A.no-t.no))),this.numbersAsc}byMember(){if(!this.members){this.members=[];const A=this.members;let t;for(const e of this.list())e.oneof?e.oneof!==t&&(t=e.oneof,A.push(t)):A.push(e)}return this.members}}function EA(A,t){const e=IA(A);return t?e:OA(KA(e))}const HA=IA;function IA(A){let t=!1;const e=[];for(let i=0;i<A.length;i++){let n=A.charAt(i);switch(n){case"_":t=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":e.push(n),t=!1;break;default:t&&(t=!1,n=n.toUpperCase()),e.push(n)}}return e.join("")}const kA=new Set(["constructor","toString","toJSON","valueOf"]),TA=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),SA=A=>"".concat(A,"$"),KA=A=>TA.has(A)?SA(A):A,OA=A=>kA.has(A)?SA(A):A;class DA{constructor(A){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=A,this.localName=EA(A,!1)}addField(A){h(A.oneof===this,"field ".concat(A.name," not one of ").concat(this.name)),this.fields.push(A)}findField(A){if(!this.D){this.D=Object.create(null);for(let A=0;A<this.fields.length;A++)this.D[this.fields[A].localName]=this.fields[A]}return this.D[A]}}const MA=(LA=A=>new bA(A,(A=>function(A){var t,e,i,n,s,r;const o=[];let a;for(const c of"function"==typeof A?A():A){const A=c;if(A.localName=EA(c.name,void 0!==c.oneof),A.jsonName=null!==(t=c.jsonName)&&void 0!==t?t:HA(c.name),A.repeated=null!==(e=c.repeated)&&void 0!==e&&e,"scalar"==c.kind&&(A.L=null!==(i=c.L)&&void 0!==i?i:S.BIGINT),A.delimited=null!==(n=c.delimited)&&void 0!==n&&n,A.req=null!==(s=c.req)&&void 0!==s&&s,A.opt=null!==(r=c.opt)&&void 0!==r&&r,void 0===c.packed&&(A.packed="enum"==c.kind||"scalar"==c.kind&&c.T!=k.BYTES&&c.T!=k.STRING),void 0!==c.oneof){const t="string"==typeof c.oneof?c.oneof:c.oneof.name;a&&a.name==t||(a=new DA(t)),A.oneof=a,a.addField(A)}o.push(A)}return o}(A))),RA=A=>{for(const t of A.getType().fields.byMember()){if(t.opt)continue;const e=t.localName,i=A;if(t.repeated)i[e]=[];else switch(t.kind){case"oneof":i[e]={case:void 0};break;case"enum":i[e]=0;break;case"map":i[e]={};break;case"scalar":i[e]=L(t.T,t.L)}}},{syntax:"proto3",json:{makeReadOptions:function(A){return A?Object.assign(Object.assign({},$),A):$},makeWriteOptions:function(A){return A?Object.assign(Object.assign({},AA),A):AA},readMessage(A,t,e,i){if(null==t||Array.isArray(t)||"object"!=typeof t)throw new Error("cannot decode message ".concat(A.typeName," from JSON: ").concat(iA(t)));i=null!=i?i:new A;const n=new Map,s=e.typeRegistry;for(const[r,o]of Object.entries(t)){const t=A.fields.findJsonName(r);if(t){if(t.oneof){if(null===o&&"scalar"==t.kind)continue;const e=n.get(t.oneof);if(void 0!==e)throw new Error("cannot decode message ".concat(A.typeName,' from JSON: multiple keys for oneof "').concat(t.oneof.name,'" present: "').concat(e,'", "').concat(r,'"'));n.set(t.oneof,r)}nA(i,o,t,e,A)}else{let t=!1;if((null==s?void 0:s.findExtension)&&r.startsWith("[")&&r.endsWith("]")){const n=s.findExtension(r.substring(1,r.length-1));if(n&&n.extendee.typeName==A.typeName){t=!0;const[A,s]=x(n);nA(A,o,n.field,e,n),J(i,n,s(),e)}}if(!t&&!e.ignoreUnknownFields)throw new Error("cannot decode message ".concat(A.typeName,' from JSON: key "').concat(r,'" is unknown'))}}return i},writeMessage(A,t){const e=A.getType(),i={};let n;try{for(n of e.fields.byNumber()){if(!Z(n,A)){if(n.req)throw"required field not set";if(!t.emitDefaultValues)continue;if(!aA(n))continue}const e=cA(n,n.oneof?A[n.oneof.localName].value:A[n.localName],t);void 0!==e&&(i[t.useProtoFieldName?n.name:n.jsonName]=e)}const s=t.typeRegistry;if(null==s?void 0:s.findExtensionFor)for(const n of e.runtime.bin.listUnknownFields(A)){const r=s.findExtensionFor(e.typeName,n.no);if(r&&X(A,r)){const e=_(A,r,t),n=cA(r.field,e,t);void 0!==n&&(i[r.field.jsonName]=n)}}}catch(s){const A=n?"cannot encode field ".concat(e.typeName,".").concat(n.name," to JSON"):"cannot encode message ".concat(e.typeName," to JSON"),t=s instanceof Error?s.message:String(s);throw new Error(A+(t.length>0?": ".concat(t):""))}return i},readScalar:(A,t,e)=>rA(A,t,null!=e?e:S.BIGINT,!0),writeScalar(A,t,e){if(void 0!==t)return e||R(A,t)?uA(A,t):void 0},debug:iA},bin:{makeReadOptions:function(A){return A?Object.assign(Object.assign({},dA),A):dA},makeWriteOptions:function(A){return A?Object.assign(Object.assign({},BA),A):BA},listUnknownFields(A){var t;return null!==(t=A[lA])&&void 0!==t?t:[]},discardUnknownFields(A){delete A[lA]},writeUnknownFields(A,t){const e=A[lA];if(e)for(const i of e)t.tag(i.no,i.wireType).raw(i.data)},onUnknownField(A,t,e,i){const n=A;Array.isArray(n[lA])||(n[lA]=[]),n[lA].push({no:t,wireType:e,data:i})},readMessage(A,t,e,i,n){const s=A.getType(),r=n?t.len:t.pos+e;let o,a;for(;t.pos<r&&([o,a]=t.tag(),!0!==n||a!=O.EndGroup);){const e=s.fields.find(o);if(e)wA(A,t,e,a,i);else{const e=t.skip(a,o);i.readUnknownFields&&this.onUnknownField(A,o,a,e)}}if(n&&(a!=O.EndGroup||o!==e))throw new Error("invalid end group tag")},readField:wA,writeMessage(A,t,e){const i=A.getType();for(const n of i.fields.byNumber())if(Z(n,A))vA(n,n.oneof?A[n.oneof.localName].value:A[n.localName],t,e);else if(n.req)throw new Error("cannot encode field ".concat(i.typeName,".").concat(n.name," to binary: required field not set"));return e.writeUnknownFields&&this.writeUnknownFields(A,t),t},writeField(A,t,e,i){void 0!==t&&vA(A,t,e,i)}},util:Object.assign(Object.assign({},{setEnumType:w,initPartial(A,t){if(void 0===A)return;const e=t.getType();for(const i of e.fields.byMember()){const e=i.localName,n=t,s=A;if(null!=s[e])switch(i.kind){case"oneof":const A=s[e].case;if(void 0===A)continue;const t=i.findField(A);let r=s[e].value;t&&"message"==t.kind&&!q(r,t.T)?r=new t.T(r):t&&"scalar"===t.kind&&t.T===k.BYTES&&(r=yA(r)),n[e]={case:A,value:r};break;case"scalar":case"enum":let o=s[e];i.T===k.BYTES&&(o=i.repeated?o.map(yA):yA(o)),n[e]=o;break;case"map":switch(i.V.kind){case"scalar":case"enum":if(i.V.T===k.BYTES)for(const[t,i]of Object.entries(s[e]))n[e][t]=yA(i);else Object.assign(n[e],s[e]);break;case"message":const A=i.V.T;for(const t of Object.keys(s[e])){let i=s[e][t];A.fieldWrapper||(i=new A(i)),n[e][t]=i}}break;case"message":const a=i.T;if(i.repeated)n[e]=s[e].map((A=>q(A,a)?A:new a(A)));else{const A=s[e];a.fieldWrapper?"google.protobuf.BytesValue"===a.typeName?n[e]=yA(A):n[e]=A:n[e]=q(A,a)?A:new a(A)}}}},equals:(A,t,e)=>t===e||!(!t||!e)&&A.fields.byMember().every((A=>{const i=t[A.localName],n=e[A.localName];if(A.repeated){if(i.length!==n.length)return!1;switch(A.kind){case"message":return i.every(((t,e)=>A.T.equals(t,n[e])));case"scalar":return i.every(((t,e)=>M(A.T,t,n[e])));case"enum":return i.every(((A,t)=>M(k.INT32,A,n[t])))}throw new Error("repeated cannot contain ".concat(A.kind))}switch(A.kind){case"message":return A.T.equals(i,n);case"enum":return M(k.INT32,i,n);case"scalar":return M(A.T,i,n);case"oneof":if(i.case!==n.case)return!1;const t=A.findField(i.case);if(void 0===t)return!0;switch(t.kind){case"message":return t.T.equals(i.value,n.value);case"enum":return M(k.INT32,i.value,n.value);case"scalar":return M(t.T,i.value,n.value)}throw new Error("oneof cannot contain ".concat(t.kind));case"map":const e=Object.keys(i).concat(Object.keys(n));switch(A.V.kind){case"message":const t=A.V.T;return e.every((A=>t.equals(i[A],n[A])));case"enum":return e.every((A=>M(k.INT32,i[A],n[A])));case"scalar":const s=A.V.T;return e.every((A=>M(s,i[A],n[A])))}}})),clone(A){const t=A.getType(),e=new t,i=e;for(const n of t.fields.byMember()){const t=A[n.localName];let e;if(n.repeated)e=t.map(FA);else if("map"==n.kind){e=i[n.localName];for(const[A,i]of Object.entries(t))e[A]=FA(i)}else e="oneof"==n.kind?n.findField(t.case)?{case:t.case,value:FA(t.value)}:{case:void 0}:FA(t);i[n.localName]=e}for(const n of t.runtime.bin.listUnknownFields(A))t.runtime.bin.onUnknownField(i,n.no,n.wireType,n.data);return e}}),{newFieldList:LA,initFields:RA}),makeMessageType(A,t,e){return function(A,t,e,i){var n;const s=null!==(n=null==i?void 0:i.localName)&&void 0!==n?n:t.substring(t.lastIndexOf(".")+1),r={[s]:function(t){A.util.initFields(this),A.util.initPartial(t,this)}}[s];return Object.setPrototypeOf(r.prototype,new Q),Object.assign(r,{runtime:A,typeName:t,fields:A.util.newFieldList(e),fromBinary:(A,t)=>(new r).fromBinary(A,t),fromJson:(A,t)=>(new r).fromJson(A,t),fromJsonString:(A,t)=>(new r).fromJsonString(A,t),equals:(t,e)=>A.util.equals(r,t,e)}),r}(this,A,t,e)},makeEnum:function(A,t,e){const i={};for(const n of t){const A=g(n);i[A.localName]=A.no,i[A.no]=A.localName}return w(i,A,t),i},makeEnumType:f,getEnumType:function(A){const t=A[B];return h(t,"missing enum type on enum object"),t},makeExtension(A,t,e){return function(A,t,e,i){let n;return{typeName:t,extendee:e,get field(){if(!n){const e="function"==typeof i?i():i;e.name=t.split(".").pop(),e.jsonName="[".concat(t,"]"),n=A.util.newFieldList([e]).list()[0]}return n},runtime:A}}(this,A,t,e)}});var LA,RA;class NA extends Q{constructor(A){super(),this.seconds=I.zero,this.nanos=0,MA.util.initPartial(A,this)}fromJson(A,t){if("string"!=typeof A)throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(MA.json.debug(A)));const e=A.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!e)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(e[1]+"-"+e[2]+"-"+e[3]+"T"+e[4]+":"+e[5]+":"+e[6]+(e[8]?e[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=I.parse(i/1e3),this.nanos=0,e[7]&&(this.nanos=parseInt("1"+e[7]+"0".repeat(9-e[7].length))-1e9),this}toJson(A){const t=1e3*Number(this.seconds);if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let e="Z";if(this.nanos>0){const A=(this.nanos+1e9).toString().substring(1);e="000000"===A.substring(3)?"."+A.substring(0,3)+"Z":"000"===A.substring(6)?"."+A.substring(0,6)+"Z":"."+A+"Z"}return new Date(t).toISOString().replace(".000Z",e)}toDate(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}static now(){return NA.fromDate(new Date)}static fromDate(A){const t=A.getTime();return new NA({seconds:I.parse(Math.floor(t/1e3)),nanos:t%1e3*1e6})}static fromBinary(A,t){return(new NA).fromBinary(A,t)}static fromJson(A,t){return(new NA).fromJson(A,t)}static fromJsonString(A,t){return(new NA).fromJsonString(A,t)}static equals(A,t){return MA.util.equals(NA,A,t)}}NA.runtime=MA,NA.typeName="google.protobuf.Timestamp",NA.fields=MA.util.newFieldList((()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]));const GA=MA.makeMessageType("livekit.MetricsBatch",(()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:NA},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:xA,repeated:!0},{no:5,name:"events",kind:"message",T:jA,repeated:!0}])),xA=MA.makeMessageType("livekit.TimeSeriesMetric",(()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:VA,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}])),VA=MA.makeMessageType("livekit.MetricSample",(()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:NA},{no:3,name:"value",kind:"scalar",T:2}])),jA=MA.makeMessageType("livekit.EventMetric",(()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:NA},{no:7,name:"normalized_end_timestamp",kind:"message",T:NA,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}])),PA=MA.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),_A=MA.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),JA=MA.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),XA=MA.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),YA=MA.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),ZA=MA.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),WA=MA.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),qA=MA.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),zA=MA.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),$A=MA.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),At=MA.makeMessageType("livekit.Room",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:tt,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:St}])),tt=MA.makeMessageType("livekit.Codec",(()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}])),et=MA.makeMessageType("livekit.ParticipantPermission",(()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:MA.getEnumType(JA),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}])),it=MA.makeMessageType("livekit.ParticipantInfo",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:MA.getEnumType(nt)},{no:4,name:"tracks",kind:"message",T:ct,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:et},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:MA.getEnumType(st)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:MA.getEnumType(WA)},{no:18,name:"kind_details",kind:"enum",T:MA.getEnumType(rt),repeated:!0}])),nt=MA.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),st=MA.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),rt=MA.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),ot=MA.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),at=MA.makeMessageType("livekit.SimulcastCodecInfo",(()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:ht,repeated:!0}])),ct=MA.makeMessageType("livekit.TrackInfo",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:MA.getEnumType(_A)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:MA.getEnumType(JA)},{no:10,name:"layers",kind:"message",T:ht,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:at,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:MA.getEnumType(ot)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:St},{no:19,name:"audio_features",kind:"enum",T:MA.getEnumType($A),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:MA.getEnumType(PA)}])),ht=MA.makeMessageType("livekit.VideoLayer",(()=>[{no:1,name:"quality",kind:"enum",T:MA.getEnumType(XA)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}])),ut=MA.makeMessageType("livekit.DataPacket",(()=>[{no:1,name:"kind",kind:"enum",T:MA.getEnumType(lt)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:wt,oneof:"value"},{no:3,name:"speaker",kind:"message",T:dt,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:ft,oneof:"value"},{no:7,name:"transcription",kind:"message",T:gt,oneof:"value"},{no:8,name:"metrics",kind:"message",T:GA,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:vt,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:mt,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:pt,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:Ut,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:Mt,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:Lt,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:Rt,oneof:"value"}])),lt=MA.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),dt=MA.makeMessageType("livekit.ActiveSpeakerUpdate",(()=>[{no:1,name:"speakers",kind:"message",T:Bt,repeated:!0}])),Bt=MA.makeMessageType("livekit.SpeakerInfo",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}])),wt=MA.makeMessageType("livekit.UserPacket",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}])),ft=MA.makeMessageType("livekit.SipDTMF",(()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}])),gt=MA.makeMessageType("livekit.Transcription",(()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:Qt,repeated:!0}])),Qt=MA.makeMessageType("livekit.TranscriptionSegment",(()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}])),vt=MA.makeMessageType("livekit.ChatMessage",(()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}])),mt=MA.makeMessageType("livekit.RpcRequest",(()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}])),pt=MA.makeMessageType("livekit.RpcAck",(()=>[{no:1,name:"request_id",kind:"scalar",T:9}])),Ut=MA.makeMessageType("livekit.RpcResponse",(()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Ct,oneof:"value"}])),Ct=MA.makeMessageType("livekit.RpcError",(()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}])),Ft=MA.makeMessageType("livekit.ParticipantTracks",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}])),yt=MA.makeMessageType("livekit.ServerInfo",(()=>[{no:1,name:"edition",kind:"enum",T:MA.getEnumType(bt)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}])),bt=MA.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),Et=MA.makeMessageType("livekit.ClientInfo",(()=>[{no:1,name:"sdk",kind:"enum",T:MA.getEnumType(Ht)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}])),Ht=MA.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),It=MA.makeMessageType("livekit.ClientConfiguration",(()=>[{no:1,name:"video",kind:"message",T:kt},{no:2,name:"screen",kind:"message",T:kt},{no:3,name:"resume_connection",kind:"enum",T:MA.getEnumType(ZA)},{no:4,name:"disabled_codecs",kind:"message",T:Tt},{no:5,name:"force_relay",kind:"enum",T:MA.getEnumType(ZA)}])),kt=MA.makeMessageType("livekit.VideoConfiguration",(()=>[{no:1,name:"hardware_encoder",kind:"enum",T:MA.getEnumType(ZA)}])),Tt=MA.makeMessageType("livekit.DisabledCodecs",(()=>[{no:1,name:"codecs",kind:"message",T:tt,repeated:!0},{no:2,name:"publish",kind:"message",T:tt,repeated:!0}])),St=MA.makeMessageType("livekit.TimedVersion",(()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}])),Kt=MA.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Ot=MA.makeMessageType("livekit.DataStream.TextHeader",(()=>[{no:1,name:"operation_type",kind:"enum",T:MA.getEnumType(Kt)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}]),{localName:"DataStream_TextHeader"}),Dt=MA.makeMessageType("livekit.DataStream.ByteHeader",(()=>[{no:1,name:"name",kind:"scalar",T:9}]),{localName:"DataStream_ByteHeader"}),Mt=MA.makeMessageType("livekit.DataStream.Header",(()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:MA.getEnumType(ot)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Ot,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Dt,oneof:"content_header"}]),{localName:"DataStream_Header"}),Lt=MA.makeMessageType("livekit.DataStream.Chunk",(()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}]),{localName:"DataStream_Chunk"}),Rt=MA.makeMessageType("livekit.DataStream.Trailer",(()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}]),{localName:"DataStream_Trailer"}),Nt=MA.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),Gt=MA.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),xt=MA.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),Vt=MA.makeMessageType("livekit.SignalRequest",(()=>[{no:1,name:"offer",kind:"message",T:zt,oneof:"message"},{no:2,name:"answer",kind:"message",T:zt,oneof:"message"},{no:3,name:"trickle",kind:"message",T:Jt,oneof:"message"},{no:4,name:"add_track",kind:"message",T:_t,oneof:"message"},{no:5,name:"mute",kind:"message",T:Xt,oneof:"message"},{no:6,name:"subscription",kind:"message",T:Ae,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:te,oneof:"message"},{no:8,name:"leave",kind:"message",T:ne,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:re,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:ve,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Ue,oneof:"message"},{no:13,name:"simulate",kind:"message",T:Fe,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:oe,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:ye,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:ee,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:ie,oneof:"message"}])),jt=MA.makeMessageType("livekit.SignalResponse",(()=>[{no:1,name:"join",kind:"message",T:Yt,oneof:"message"},{no:2,name:"answer",kind:"message",T:zt,oneof:"message"},{no:3,name:"offer",kind:"message",T:zt,oneof:"message"},{no:4,name:"trickle",kind:"message",T:Jt,oneof:"message"},{no:5,name:"update",kind:"message",T:$t,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Wt,oneof:"message"},{no:8,name:"leave",kind:"message",T:ne,oneof:"message"},{no:9,name:"mute",kind:"message",T:Xt,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:ce,oneof:"message"},{no:11,name:"room_update",kind:"message",T:he,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:le,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:Be,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:ge,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:me,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:qt,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:Zt,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:be,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:Ie,oneof:"message"},{no:22,name:"request_response",kind:"message",T:ke,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:Se,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:pe,oneof:"message"}])),Pt=MA.makeMessageType("livekit.SimulcastCodec",(()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}])),_t=MA.makeMessageType("livekit.AddTrackRequest",(()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:MA.getEnumType(_A)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:MA.getEnumType(JA)},{no:9,name:"layers",kind:"message",T:ht,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:Pt,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:MA.getEnumType(ot)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:MA.getEnumType(PA)},{no:17,name:"audio_features",kind:"enum",T:MA.getEnumType($A),repeated:!0}])),Jt=MA.makeMessageType("livekit.TrickleRequest",(()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:MA.getEnumType(Nt)},{no:3,name:"final",kind:"scalar",T:8}])),Xt=MA.makeMessageType("livekit.MuteTrackRequest",(()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}])),Yt=MA.makeMessageType("livekit.JoinResponse",(()=>[{no:1,name:"room",kind:"message",T:At},{no:2,name:"participant",kind:"message",T:it},{no:3,name:"other_participants",kind:"message",T:it,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:ae,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:It},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:yt},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:tt,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}])),Zt=MA.makeMessageType("livekit.ReconnectResponse",(()=>[{no:1,name:"ice_servers",kind:"message",T:ae,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:It}])),Wt=MA.makeMessageType("livekit.TrackPublishedResponse",(()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:ct}])),qt=MA.makeMessageType("livekit.TrackUnpublishedResponse",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9}])),zt=MA.makeMessageType("livekit.SessionDescription",(()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}])),$t=MA.makeMessageType("livekit.ParticipantUpdate",(()=>[{no:1,name:"participants",kind:"message",T:it,repeated:!0}])),Ae=MA.makeMessageType("livekit.UpdateSubscription",(()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Ft,repeated:!0}])),te=MA.makeMessageType("livekit.UpdateTrackSettings",(()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:MA.getEnumType(XA)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}])),ee=MA.makeMessageType("livekit.UpdateLocalAudioTrack",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:MA.getEnumType($A),repeated:!0}])),ie=MA.makeMessageType("livekit.UpdateLocalVideoTrack",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}])),ne=MA.makeMessageType("livekit.LeaveRequest",(()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:MA.getEnumType(WA)},{no:3,name:"action",kind:"enum",T:MA.getEnumType(se)},{no:4,name:"regions",kind:"message",T:Ee}])),se=MA.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),re=MA.makeMessageType("livekit.UpdateVideoLayers",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:ht,repeated:!0}])),oe=MA.makeMessageType("livekit.UpdateParticipantMetadata",(()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}])),ae=MA.makeMessageType("livekit.ICEServer",(()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}])),ce=MA.makeMessageType("livekit.SpeakersChanged",(()=>[{no:1,name:"speakers",kind:"message",T:Bt,repeated:!0}])),he=MA.makeMessageType("livekit.RoomUpdate",(()=>[{no:1,name:"room",kind:"message",T:At}])),ue=MA.makeMessageType("livekit.ConnectionQualityInfo",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:MA.getEnumType(YA)},{no:3,name:"score",kind:"scalar",T:2}])),le=MA.makeMessageType("livekit.ConnectionQualityUpdate",(()=>[{no:1,name:"updates",kind:"message",T:ue,repeated:!0}])),de=MA.makeMessageType("livekit.StreamStateInfo",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:MA.getEnumType(Gt)}])),Be=MA.makeMessageType("livekit.StreamStateUpdate",(()=>[{no:1,name:"stream_states",kind:"message",T:de,repeated:!0}])),we=MA.makeMessageType("livekit.SubscribedQuality",(()=>[{no:1,name:"quality",kind:"enum",T:MA.getEnumType(XA)},{no:2,name:"enabled",kind:"scalar",T:8}])),fe=MA.makeMessageType("livekit.SubscribedCodec",(()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:we,repeated:!0}])),ge=MA.makeMessageType("livekit.SubscribedQualityUpdate",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:we,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:fe,repeated:!0}])),Qe=MA.makeMessageType("livekit.TrackPermission",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}])),ve=MA.makeMessageType("livekit.SubscriptionPermission",(()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Qe,repeated:!0}])),me=MA.makeMessageType("livekit.SubscriptionPermissionUpdate",(()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}])),pe=MA.makeMessageType("livekit.RoomMovedResponse",(()=>[{no:1,name:"room",kind:"message",T:At},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:it},{no:4,name:"other_participants",kind:"message",T:it,repeated:!0}])),Ue=MA.makeMessageType("livekit.SyncState",(()=>[{no:1,name:"answer",kind:"message",T:zt},{no:2,name:"subscription",kind:"message",T:Ae},{no:3,name:"publish_tracks",kind:"message",T:Wt,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Ce,repeated:!0},{no:5,name:"offer",kind:"message",T:zt},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}])),Ce=MA.makeMessageType("livekit.DataChannelInfo",(()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:MA.getEnumType(Nt)}])),Fe=MA.makeMessageType("livekit.SimulateScenario",(()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:MA.getEnumType(xt),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}])),ye=MA.makeMessageType("livekit.Ping",(()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}])),be=MA.makeMessageType("livekit.Pong",(()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}])),Ee=MA.makeMessageType("livekit.RegionSettings",(()=>[{no:1,name:"regions",kind:"message",T:He,repeated:!0}])),He=MA.makeMessageType("livekit.RegionInfo",(()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}])),Ie=MA.makeMessageType("livekit.SubscriptionResponse",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:MA.getEnumType(zA)}])),ke=MA.makeMessageType("livekit.RequestResponse",(()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:MA.getEnumType(Te)},{no:3,name:"message",kind:"scalar",T:9}])),Te=MA.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),Se=MA.makeMessageType("livekit.TrackSubscribed",(()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]));function Ke(A){return A&&A.A&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var Oe,De,Me,Le,Re,Ne,Ge,xe,Ve={exports:{}},je=(Oe||(Oe=1,Me=Ve.exports,Le=function(){var A=function(){},t="undefined",e=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],n={},s=null;function r(A,t){var e=A[t];if("function"==typeof e.bind)return e.bind(A);try{return Function.prototype.bind.call(e,A)}catch(i){return function(){return Function.prototype.apply.apply(e,[A,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(){for(var e=this.getLevel(),n=0;n<i.length;n++){var s=i[n];this[s]=n<e?A:this.methodFactory(s,e,this.name)}if(this.log=this.debug,typeof console===t&&e<this.levels.SILENT)return"No console available for logging"}function c(A){return function(){typeof console!==t&&(a.call(this),this[A].apply(this,arguments))}}function h(i,n,s){return function(i){return"debug"===i&&(i="log"),typeof console!==t&&("trace"===i&&e?o:void 0!==console[i]?r(console,i):void 0!==console.log?r(console,"log"):A)}(i)||c.apply(this,arguments)}function u(A,e){var r,o,c,u=this,l="loglevel";function d(){var A;if(typeof window!==t&&l){try{A=window.localStorage[l]}catch(s){}if(typeof A===t)try{var e=window.document.cookie,i=encodeURIComponent(l),n=e.indexOf(i+"=");-1!==n&&(A=/^([^;]+)/.exec(e.slice(n+i.length+1))[1])}catch(s){}return void 0===u.levels[A]&&(A=void 0),A}}function B(A){var t=A;if("string"==typeof t&&void 0!==u.levels[t.toUpperCase()]&&(t=u.levels[t.toUpperCase()]),"number"==typeof t&&t>=0&&t<=u.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+A)}"string"==typeof A?l+=":"+A:"symbol"==typeof A&&(l=void 0),u.name=A,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=e||h,u.getLevel=function(){return null!=c?c:null!=o?o:r},u.setLevel=function(A,e){return c=B(A),!1!==e&&function(A){var e=(i[A]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=e)}catch(n){}try{window.document.cookie=encodeURIComponent(l)+"="+e+";"}catch(n){}}}(c),a.call(u)},u.setDefaultLevel=function(A){o=B(A),d()||u.setLevel(A,!1)},u.resetLevel=function(){c=null,function(){if(typeof window!==t&&l){try{window.localStorage.removeItem(l)}catch(A){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(A){}}}(),a.call(u)},u.enableAll=function(A){u.setLevel(u.levels.TRACE,A)},u.disableAll=function(A){u.setLevel(u.levels.SILENT,A)},u.rebuild=function(){if(s!==u&&(r=B(s.getLevel())),a.call(u),s===u)for(var A in n)n[A].rebuild()},r=B(s?s.getLevel():"WARN");var w=d();null!=w&&(c=B(w)),a.call(u)}(s=new u).getLogger=function(A){if("symbol"!=typeof A&&"string"!=typeof A||""===A)throw new TypeError("You must supply a name when creating a logger.");var t=n[A];return t||(t=n[A]=new u(A,s.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return s.noConflict=function(){return typeof window!==t&&window.log===s&&(window.log=l),s},s.getLoggers=function(){return n},s.default=s,s},(De=Ve).exports?De.exports=Le():Me.log=Le()),Ve.exports);(Ne=Re||(Re={}))[Ne.trace=0]="trace",Ne[Ne.debug=1]="debug",Ne[Ne.info=2]="info",Ne[Ne.warn=3]="warn",Ne[Ne.error=4]="error",Ne[Ne.silent=5]="silent",(xe=Ge||(Ge={})).Default="livekit",xe.Room="livekit-room",xe.Participant="livekit-participant",xe.Track="livekit-track",xe.Publication="livekit-track-publication",xe.Engine="livekit-engine",xe.Signal="livekit-signal",xe.PCManager="livekit-pc-manager",xe.PCTransport="livekit-pc-transport",xe.E2EE="lk-e2ee";let Pe=je.getLogger("livekit");function _e(A){const t=je.getLogger(A);return t.setDefaultLevel(Pe.getLevel()),t}Object.values(Ge).map((A=>je.getLogger(A))),Pe.setDefaultLevel(Re.info);const Je=je.getLogger("lk-e2ee"),Xe=7e3,Ye=[0,300,1200,2700,4800,Xe,Xe,Xe,Xe,Xe];function Ze(A,t,e,i){return new(e||(e=Promise))((function(n,s){function r(A){try{a(i.next(A))}catch(t){s(t)}}function o(A){try{a(i.throw(A))}catch(t){s(t)}}function a(A){var t;A.done?n(A.value):(t=A.value,t instanceof e?t:new e((function(A){A(t)}))).then(r,o)}a((i=i.apply(A,t||[])).next())}))}function We(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,e=A[Symbol.asyncIterator];return e?e.call(A):(A=function(A){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&A[t],i=0;if(e)return e.call(A);if(A&&"number"==typeof A.length)return{next:function(){return A&&i>=A.length&&(A=void 0),{value:A&&A[i++],done:!A}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(A),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(e){t[e]=A[e]&&function(t){return new Promise((function(i,n){!function(A,t,e,i){Promise.resolve(i).then((function(t){A({value:t,done:e})}),t)}(i,n,(t=A[e](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var qe,ze={exports:{}},$e=function(){if(qe)return ze.exports;qe=1;var A,t="object"==typeof Reflect?Reflect:null,e=t&&"function"==typeof t.apply?t.apply:function(A,t,e){return Function.prototype.apply.call(A,t,e)};A=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:function(A){return Object.getOwnPropertyNames(A)};var i=Number.isNaN||function(A){return A!=A};function n(){n.init.call(this)}ze.exports=n,ze.exports.once=function(A,t){return new Promise((function(e,i){function n(e){A.removeListener(t,s),i(e)}function s(){"function"==typeof A.removeListener&&A.removeListener("error",n),e([].slice.call(arguments))}B(A,t,s,{once:!0}),"error"!==t&&function(A,t){"function"==typeof A.on&&B(A,"error",t,{once:!0})}(A,n)}))},n.EventEmitter=n,n.prototype.B=void 0,n.prototype.U=0,n.prototype.M=void 0;var s=10;function r(A){if("function"!=typeof A)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof A)}function o(A){return void 0===A.M?n.defaultMaxListeners:A.M}function a(A,t,e,i){var n,s,a,c;if(r(e),void 0===(s=A.B)?(s=A.B=Object.create(null),A.U=0):(void 0!==s.newListener&&(A.emit("newListener",t,e.listener?e.listener:e),s=A.B),a=s[t]),void 0===a)a=s[t]=e,++A.U;else if("function"==typeof a?a=s[t]=i?[e,a]:[a,e]:i?a.unshift(e):a.push(e),(n=o(A))>0&&a.length>n&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=A,h.type=t,h.count=a.length,c=h,console&&console.warn&&console.warn(c)}return A}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(A,t,e){var i={fired:!1,wrapFn:void 0,target:A,type:t,listener:e},n=c.bind(i);return n.listener=e,i.wrapFn=n,n}function u(A,t,e){var i=A.B;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?e?[n.listener||n]:[n]:e?function(A){for(var t=new Array(A.length),e=0;e<t.length;++e)t[e]=A[e].listener||A[e];return t}(n):d(n,n.length)}function l(A){var t=this.B;if(void 0!==t){var e=t[A];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function d(A,t){for(var e=new Array(t),i=0;i<t;++i)e[i]=A[i];return e}function B(A,t,e,i){if("function"==typeof A.on)i.once?A.once(t,e):A.on(t,e);else{if("function"!=typeof A.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof A);A.addEventListener(t,(function n(s){i.once&&A.removeEventListener(t,n),e(s)}))}}return Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(A){if("number"!=typeof A||A<0||i(A))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+A+".");s=A}}),n.init=function(){void 0!==this.B&&this.B!==Object.getPrototypeOf(this).B||(this.B=Object.create(null),this.U=0),this.M=this.M||void 0},n.prototype.setMaxListeners=function(A){if("number"!=typeof A||A<0||i(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this.M=A,this},n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(A){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===A,s=this.B;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var r;if(t.length>0&&(r=t[0]),r instanceof Error)throw r;var o=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw o.context=r,o}var a=s[A];if(void 0===a)return!1;if("function"==typeof a)e(a,this,t);else{var c=a.length,h=d(a,c);for(i=0;i<c;++i)e(h[i],this,t)}return!0},n.prototype.addListener=function(A,t){return a(this,A,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(A,t){return a(this,A,t,!0)},n.prototype.once=function(A,t){return r(t),this.on(A,h(this,A,t)),this},n.prototype.prependOnceListener=function(A,t){return r(t),this.prependListener(A,h(this,A,t)),this},n.prototype.removeListener=function(A,t){var e,i,n,s,o;if(r(t),void 0===(i=this.B))return this;if(void 0===(e=i[A]))return this;if(e===t||e.listener===t)0===--this.U?this.B=Object.create(null):(delete i[A],i.removeListener&&this.emit("removeListener",A,e.listener||t));else if("function"!=typeof e){for(n=-1,s=e.length-1;s>=0;s--)if(e[s]===t||e[s].listener===t){o=e[s].listener,n=s;break}if(n<0)return this;0===n?e.shift():function(A,t){for(;t+1<A.length;t++)A[t]=A[t+1];A.pop()}(e,n),1===e.length&&(i[A]=e[0]),void 0!==i.removeListener&&this.emit("removeListener",A,o||t)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(A){var t,e,i;if(void 0===(e=this.B))return this;if(void 0===e.removeListener)return 0===arguments.length?(this.B=Object.create(null),this.U=0):void 0!==e[A]&&(0===--this.U?this.B=Object.create(null):delete e[A]),this;if(0===arguments.length){var n,s=Object.keys(e);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this.B=Object.create(null),this.U=0,this}if("function"==typeof(t=e[A]))this.removeListener(A,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(A,t[i]);return this},n.prototype.listeners=function(A){return u(this,A,!0)},n.prototype.rawListeners=function(A){return u(this,A,!1)},n.listenerCount=function(A,t){return"function"==typeof A.listenerCount?A.listenerCount(t):l.call(A,t)},n.prototype.listenerCount=l,n.prototype.eventNames=function(){return this.U>0?A(this.B):[]},ze.exports}();let Ai=!0,ti=!0;function ei(A,t,e){const i=A.match(t);return i&&i.length>=e&&parseInt(i[e],10)}function ii(A,t,e){if(!A.RTCPeerConnection)return;const i=A.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(A,i){if(A!==t)return n.apply(this,arguments);const s=A=>{const t=e(A);t&&(i.handleEvent?i.handleEvent(t):i(t))};return this.R=this.R||{},this.R[t]||(this.R[t]=new Map),this.R[t].set(i,s),n.apply(this,[A,s])};const s=i.removeEventListener;i.removeEventListener=function(A,e){if(A!==t||!this.R||!this.R[t])return s.apply(this,arguments);if(!this.R[t].has(e))return s.apply(this,arguments);const i=this.R[t].get(e);return this.R[t].delete(e),0===this.R[t].size&&delete this.R[t],0===Object.keys(this.R).length&&delete this.R,s.apply(this,[A,i])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(A){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),A&&this.addEventListener(t,this["_on"+t]=A)},enumerable:!0,configurable:!0})}function ni(A){return"boolean"!=typeof A?new Error("Argument type: "+typeof A+". Please use a boolean."):(Ai=A,A?"adapter.js logging disabled":"adapter.js logging enabled")}function si(A){return"boolean"!=typeof A?new Error("Argument type: "+typeof A+". Please use a boolean."):(ti=!A,"adapter.js deprecation warnings "+(A?"disabled":"enabled"))}function ri(){if("object"==typeof window){if(Ai)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function oi(A,t){ti&&console.warn(A+" is deprecated, please use "+t+" instead.")}function ai(A){return"[object Object]"===Object.prototype.toString.call(A)}function ci(A){return ai(A)?Object.keys(A).reduce((function(t,e){const i=ai(A[e]),n=i?ci(A[e]):A[e],s=i&&!Object.keys(n).length;return void 0===n||s?t:Object.assign(t,{[e]:n})}),{}):A}function hi(A,t,e){t&&!e.has(t.id)&&(e.set(t.id,t),Object.keys(t).forEach((i=>{i.endsWith("Id")?hi(A,A.get(t[i]),e):i.endsWith("Ids")&&t[i].forEach((t=>{hi(A,A.get(t),e)}))})))}function ui(A,t,e){const i=e?"outbound-rtp":"inbound-rtp",n=new Map;if(null===t)return n;const s=[];return A.forEach((A=>{"track"===A.type&&A.trackIdentifier===t.id&&s.push(A)})),s.forEach((t=>{A.forEach((e=>{e.type===i&&e.trackId===t.id&&hi(A,e,n)}))})),n}const li=ri;function di(A,t){const e=A&&A.navigator;if(!e.mediaDevices)return;const i=function(A){if("object"!=typeof A||A.mandatory||A.optional)return A;const t={};return Object.keys(A).forEach((e=>{if("require"===e||"advanced"===e||"mediaSource"===e)return;const i="object"==typeof A[e]?A[e]:{ideal:A[e]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);const n=function(A,t){return A?A+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];let A={};"number"==typeof i.ideal?(A[n("min",e)]=i.ideal,t.optional.push(A),A={},A[n("max",e)]=i.ideal,t.optional.push(A)):(A[n("",e)]=i.ideal,t.optional.push(A))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[n("",e)]=i.exact):["min","max"].forEach((A=>{void 0!==i[A]&&(t.mandatory=t.mandatory||{},t.mandatory[n(A,e)]=i[A])}))})),A.advanced&&(t.optional=(t.optional||[]).concat(A.advanced)),t},n=function(A,n){if(t.version>=61)return n(A);if((A=JSON.parse(JSON.stringify(A)))&&"object"==typeof A.audio){const t=function(A,t,e){t in A&&!(e in A)&&(A[e]=A[t],delete A[t])};t((A=JSON.parse(JSON.stringify(A))).audio,"autoGainControl","googAutoGainControl"),t(A.audio,"noiseSuppression","googNoiseSuppression"),A.audio=i(A.audio)}if(A&&"object"==typeof A.video){let s=A.video.facingMode;s=s&&("object"==typeof s?s:{ideal:s});const r=t.version<66;if(s&&("user"===s.exact||"environment"===s.exact||"user"===s.ideal||"environment"===s.ideal)&&(!e.mediaDevices.getSupportedConstraints||!e.mediaDevices.getSupportedConstraints().facingMode||r)){let t;if(delete A.video.facingMode,"environment"===s.exact||"environment"===s.ideal?t=["back","rear"]:"user"!==s.exact&&"user"!==s.ideal||(t=["front"]),t)return e.mediaDevices.enumerateDevices().then((e=>{let r=(e=e.filter((A=>"videoinput"===A.kind))).find((A=>t.some((t=>A.label.toLowerCase().includes(t)))));return!r&&e.length&&t.includes("back")&&(r=e[e.length-1]),r&&(A.video.deviceId=s.exact?{exact:r.deviceId}:{ideal:r.deviceId}),A.video=i(A.video),li("chrome: "+JSON.stringify(A)),n(A)}))}A.video=i(A.video)}return li("chrome: "+JSON.stringify(A)),n(A)},s=function(A){return t.version>=64?A:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[A.name]||A.name,message:A.message,constraint:A.constraint||A.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(e.getUserMedia=function(A,t,i){n(A,(A=>{e.webkitGetUserMedia(A,t,(A=>{i&&i(s(A))}))}))}.bind(e),e.mediaDevices.getUserMedia){const A=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(t){return n(t,(t=>A(t).then((A=>{if(t.audio&&!A.getAudioTracks().length||t.video&&!A.getVideoTracks().length)throw A.getTracks().forEach((A=>{A.stop()})),new DOMException("","NotFoundError");return A}),(A=>Promise.reject(s(A))))))}}}function Bi(A){A.MediaStream=A.MediaStream||A.webkitMediaStream}function wi(A){if("object"==typeof A&&A.RTCPeerConnection&&!("ontrack"in A.RTCPeerConnection.prototype)){Object.defineProperty(A.RTCPeerConnection.prototype,"ontrack",{get(){return this.N},set(A){this.N&&this.removeEventListener("track",this.N),this.addEventListener("track",this.N=A)},enumerable:!0,configurable:!0});const t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){return this.P||(this.P=t=>{t.stream.addEventListener("addtrack",(e=>{let i;i=A.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((A=>A.track&&A.track.id===e.track.id)):{track:e.track};const n=new Event("track");n.track=e.track,n.receiver=i,n.transceiver={receiver:i},n.streams=[t.stream],this.dispatchEvent(n)})),t.stream.getTracks().forEach((e=>{let i;i=A.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find((A=>A.track&&A.track.id===e.id)):{track:e};const n=new Event("track");n.track=e,n.receiver=i,n.transceiver={receiver:i},n.streams=[t.stream],this.dispatchEvent(n)}))},this.addEventListener("addstream",this.P)),t.apply(this,arguments)}}else ii(A,"track",(A=>(A.transceiver||Object.defineProperty(A,"transceiver",{value:{receiver:A.receiver}}),A)))}function fi(A){if("object"==typeof A&&A.RTCPeerConnection&&!("getSenders"in A.RTCPeerConnection.prototype)&&"createDTMFSender"in A.RTCPeerConnection.prototype){const t=function(A,t){return{track:t,get dtmf(){return void 0===this._&&("audio"===t.kind?this._=A.createDTMFSender(t):this._=null),this._},J:A}};if(!A.RTCPeerConnection.prototype.getSenders){A.RTCPeerConnection.prototype.getSenders=function(){return this.X=this.X||[],this.X.slice()};const e=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,i){let n=e.apply(this,arguments);return n||(n=t(this,A),this.X.push(n)),n};const i=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){i.apply(this,arguments);const t=this.X.indexOf(A);-1!==t&&this.X.splice(t,1)}}const e=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){this.X=this.X||[],e.apply(this,[A]),A.getTracks().forEach((A=>{this.X.push(t(this,A))}))};const i=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){this.X=this.X||[],i.apply(this,[A]),A.getTracks().forEach((A=>{const t=this.X.find((t=>t.track===A));t&&this.X.splice(this.X.indexOf(t),1)}))}}else if("object"==typeof A&&A.RTCPeerConnection&&"getSenders"in A.RTCPeerConnection.prototype&&"createDTMFSender"in A.RTCPeerConnection.prototype&&A.RTCRtpSender&&!("dtmf"in A.RTCRtpSender.prototype)){const t=A.RTCPeerConnection.prototype.getSenders;A.RTCPeerConnection.prototype.getSenders=function(){const A=t.apply(this,[]);return A.forEach((A=>A.J=this)),A},Object.defineProperty(A.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._&&("audio"===this.track.kind?this._=this.J.createDTMFSender(this.track):this._=null),this._}})}}function gi(A){if(!("object"==typeof A&&A.RTCPeerConnection&&A.RTCRtpSender&&A.RTCRtpReceiver))return;if(!("getStats"in A.RTCRtpSender.prototype)){const t=A.RTCPeerConnection.prototype.getSenders;t&&(A.RTCPeerConnection.prototype.getSenders=function(){const A=t.apply(this,[]);return A.forEach((A=>A.J=this)),A});const e=A.RTCPeerConnection.prototype.addTrack;e&&(A.RTCPeerConnection.prototype.addTrack=function(){const A=e.apply(this,arguments);return A.J=this,A}),A.RTCRtpSender.prototype.getStats=function(){const A=this;return this.J.getStats().then((t=>ui(t,A.track,!0)))}}if(!("getStats"in A.RTCRtpReceiver.prototype)){const t=A.RTCPeerConnection.prototype.getReceivers;t&&(A.RTCPeerConnection.prototype.getReceivers=function(){const A=t.apply(this,[]);return A.forEach((A=>A.J=this)),A}),ii(A,"track",(A=>(A.receiver.J=A.srcElement,A))),A.RTCRtpReceiver.prototype.getStats=function(){const A=this;return this.J.getStats().then((t=>ui(t,A.track,!1)))}}if(!("getStats"in A.RTCRtpSender.prototype)||!("getStats"in A.RTCRtpReceiver.prototype))return;const t=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof A.MediaStreamTrack){const A=arguments[0];let t,e,i;return this.getSenders().forEach((e=>{e.track===A&&(t?i=!0:t=e)})),this.getReceivers().forEach((t=>(t.track===A&&(e?i=!0:e=t),t.track===A))),i||t&&e?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():e?e.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function Qi(A){A.RTCPeerConnection.prototype.getLocalStreams=function(){return this.Y=this.Y||{},Object.keys(this.Y).map((A=>this.Y[A][0]))};const t=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addTrack=function(A,e){if(!e)return t.apply(this,arguments);this.Y=this.Y||{};const i=t.apply(this,arguments);return this.Y[e.id]?-1===this.Y[e.id].indexOf(i)&&this.Y[e.id].push(i):this.Y[e.id]=[e,i],i};const e=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(A){this.Y=this.Y||{},A.getTracks().forEach((A=>{if(this.getSenders().find((t=>t.track===A)))throw new DOMException("Track already exists.","InvalidAccessError")}));const t=this.getSenders();e.apply(this,arguments);const i=this.getSenders().filter((A=>-1===t.indexOf(A)));this.Y[A.id]=[A].concat(i)};const i=A.RTCPeerConnection.prototype.removeStream;A.RTCPeerConnection.prototype.removeStream=function(A){return this.Y=this.Y||{},delete this.Y[A.id],i.apply(this,arguments)};const n=A.RTCPeerConnection.prototype.removeTrack;A.RTCPeerConnection.prototype.removeTrack=function(A){return this.Y=this.Y||{},A&&Object.keys(this.Y).forEach((t=>{const e=this.Y[t].indexOf(A);-1!==e&&this.Y[t].splice(e,1),1===this.Y[t].length&&delete this.Y[t]})),n.apply(this,arguments)}}function vi(A,t){if(!A.RTCPeerConnection)return;if(A.RTCPeerConnection.prototype.addTrack&&t.version>=65)return Qi(A);const e=A.RTCPeerConnection.prototype.getLocalStreams;A.RTCPeerConnection.prototype.getLocalStreams=function(){const A=e.apply(this);return this.Z=this.Z||{},A.map((A=>this.Z[A.id]))};const i=A.RTCPeerConnection.prototype.addStream;A.RTCPeerConnection.prototype.addStream=function(t){if(this.W=this.W||{},this.Z=this.Z||{},t.getTracks().forEach((A=>{if(this.getSenders().find((t=>t.track===A)))throw new DOMException("Track already exists.","InvalidAccessError")})),!this.Z[t.id]){const e=new A.MediaStream(t.getTracks());this.W[t.id]=e,this.Z[e.id]=t,t=e}i.apply(this,[t])};const n=A.RTCPeerConnection.prototype.removeStream;function s(A,t){let e=t.sdp;return Object.keys(A.Z||[]).forEach((t=>{const i=A.Z[t],n=A.W[i.id];e=e.replace(new RegExp(n.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:e})}A.RTCPeerConnection.prototype.removeStream=function(A){this.W=this.W||{},this.Z=this.Z||{},n.apply(this,[this.W[A.id]||A]),delete this.Z[this.W[A.id]?this.W[A.id].id:A.id],delete this.W[A.id]},A.RTCPeerConnection.prototype.addTrack=function(t,e){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((A=>A===t)))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((A=>A.track===t)))throw new DOMException("Track already exists.","InvalidAccessError");this.W=this.W||{},this.Z=this.Z||{};const n=this.W[e.id];if(n)n.addTrack(t),Promise.resolve().then((()=>{this.dispatchEvent(new Event("negotiationneeded"))}));else{const i=new A.MediaStream([t]);this.W[e.id]=i,this.Z[i.id]=e,this.addStream(i)}return this.getSenders().find((A=>A.track===t))},["createOffer","createAnswer"].forEach((function(t){const e=A.RTCPeerConnection.prototype[t],i={[t](){const A=arguments;return arguments.length&&"function"==typeof arguments[0]?e.apply(this,[t=>{const e=s(this,t);A[0].apply(null,[e])},t=>{A[1]&&A[1].apply(null,t)},arguments[2]]):e.apply(this,arguments).then((A=>s(this,A)))}};A.RTCPeerConnection.prototype[t]=i[t]}));const r=A.RTCPeerConnection.prototype.setLocalDescription;A.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(A,t){let e=t.sdp;return Object.keys(A.Z||[]).forEach((t=>{const i=A.Z[t],n=A.W[i.id];e=e.replace(new RegExp(i.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:e})}(this,arguments[0]),r.apply(this,arguments)):r.apply(this,arguments)};const o=Object.getOwnPropertyDescriptor(A.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(A.RTCPeerConnection.prototype,"localDescription",{get(){const A=o.get.apply(this);return""===A.type?A:s(this,A)}}),A.RTCPeerConnection.prototype.removeTrack=function(A){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!A.J)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(A.J!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let t;this.W=this.W||{},Object.keys(this.W).forEach((e=>{this.W[e].getTracks().find((t=>A.track===t))&&(t=this.W[e])})),t&&(1===t.getTracks().length?this.removeStream(this.Z[t.id]):t.removeTrack(A.track),this.dispatchEvent(new Event("negotiationneeded")))}}function mi(A,t){!A.RTCPeerConnection&&A.webkitRTCPeerConnection&&(A.RTCPeerConnection=A.webkitRTCPeerConnection),A.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const e=A.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),e.apply(this,arguments)}};A.RTCPeerConnection.prototype[t]=i[t]}))}function pi(A,t){ii(A,"negotiationneeded",(A=>{const e=A.target;if(!(t.version<72||e.getConfiguration&&"plan-b"===e.getConfiguration().sdpSemantics)||"stable"===e.signalingState)return A}))}var Ui=Object.freeze({__proto__:null,fixNegotiationNeeded:pi,shimAddTrackRemoveTrack:vi,shimAddTrackRemoveTrackWithNative:Qi,shimGetSendersWithDtmf:fi,shimGetUserMedia:di,shimMediaStream:Bi,shimOnTrack:wi,shimPeerConnection:mi,shimSenderReceiverGetStats:gi});function Ci(A,t){const e=A&&A.navigator,i=A&&A.MediaStreamTrack;if(e.getUserMedia=function(A,t,i){oi("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),e.mediaDevices.getUserMedia(A).then(t,i)},!(t.version>55&&"autoGainControl"in e.mediaDevices.getSupportedConstraints())){const A=function(A,t,e){t in A&&!(e in A)&&(A[e]=A[t],delete A[t])},t=e.mediaDevices.getUserMedia.bind(e.mediaDevices);if(e.mediaDevices.getUserMedia=function(e){return"object"==typeof e&&"object"==typeof e.audio&&(e=JSON.parse(JSON.stringify(e)),A(e.audio,"autoGainControl","mozAutoGainControl"),A(e.audio,"noiseSuppression","mozNoiseSuppression")),t(e)},i&&i.prototype.getSettings){const t=i.prototype.getSettings;i.prototype.getSettings=function(){const e=t.apply(this,arguments);return A(e,"mozAutoGainControl","autoGainControl"),A(e,"mozNoiseSuppression","noiseSuppression"),e}}if(i&&i.prototype.applyConstraints){const t=i.prototype.applyConstraints;i.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"==typeof e&&(e=JSON.parse(JSON.stringify(e)),A(e,"autoGainControl","mozAutoGainControl"),A(e,"noiseSuppression","mozNoiseSuppression")),t.apply(this,[e])}}}}function Fi(A){"object"==typeof A&&A.RTCTrackEvent&&"receiver"in A.RTCTrackEvent.prototype&&!("transceiver"in A.RTCTrackEvent.prototype)&&Object.defineProperty(A.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function yi(A,t){if("object"!=typeof A||!A.RTCPeerConnection&&!A.mozRTCPeerConnection)return;!A.RTCPeerConnection&&A.mozRTCPeerConnection&&(A.RTCPeerConnection=A.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const e=A.RTCPeerConnection.prototype[t],i={[t](){return arguments[0]=new("addIceCandidate"===t?A.RTCIceCandidate:A.RTCSessionDescription)(arguments[0]),e.apply(this,arguments)}};A.RTCPeerConnection.prototype[t]=i[t]}));const e={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=A.RTCPeerConnection.prototype.getStats;A.RTCPeerConnection.prototype.getStats=function(){const[A,n,s]=arguments;return i.apply(this,[A||null]).then((A=>{if(t.version<53&&!n)try{A.forEach((A=>{A.type=e[A.type]||A.type}))}catch(i){if("TypeError"!==i.name)throw i;A.forEach(((t,i)=>{A.set(i,Object.assign({},t,{type:e[t.type]||t.type}))}))}return A})).then(n,s)}}function bi(A){if("object"!=typeof A||!A.RTCPeerConnection||!A.RTCRtpSender)return;if(A.RTCRtpSender&&"getStats"in A.RTCRtpSender.prototype)return;const t=A.RTCPeerConnection.prototype.getSenders;t&&(A.RTCPeerConnection.prototype.getSenders=function(){const A=t.apply(this,[]);return A.forEach((A=>A.J=this)),A});const e=A.RTCPeerConnection.prototype.addTrack;e&&(A.RTCPeerConnection.prototype.addTrack=function(){const A=e.apply(this,arguments);return A.J=this,A}),A.RTCRtpSender.prototype.getStats=function(){return this.track?this.J.getStats(this.track):Promise.resolve(new Map)}}function Ei(A){if("object"!=typeof A||!A.RTCPeerConnection||!A.RTCRtpSender)return;if(A.RTCRtpSender&&"getStats"in A.RTCRtpReceiver.prototype)return;const t=A.RTCPeerConnection.prototype.getReceivers;t&&(A.RTCPeerConnection.prototype.getReceivers=function(){const A=t.apply(this,[]);return A.forEach((A=>A.J=this)),A}),ii(A,"track",(A=>(A.receiver.J=A.srcElement,A))),A.RTCRtpReceiver.prototype.getStats=function(){return this.J.getStats(this.track)}}function Hi(A){A.RTCPeerConnection&&!("removeStream"in A.RTCPeerConnection.prototype)&&(A.RTCPeerConnection.prototype.removeStream=function(A){oi("removeStream","removeTrack"),this.getSenders().forEach((t=>{t.track&&A.getTracks().includes(t.track)&&this.removeTrack(t)}))})}function Ii(A){A.DataChannel&&!A.RTCDataChannel&&(A.RTCDataChannel=A.DataChannel)}function ki(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const t=A.RTCPeerConnection.prototype.addTransceiver;t&&(A.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let A=arguments[1]&&arguments[1].sendEncodings;void 0===A&&(A=[]),A=[...A];const e=A.length>0;e&&A.forEach((A=>{if("rid"in A&&!/^[a-z0-9]{0,16}$/i.test(A.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in A&&!(parseFloat(A.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in A&&!(parseFloat(A.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const i=t.apply(this,arguments);if(e){const{sender:t}=i,e=t.getParameters();(!("encodings"in e)||1===e.encodings.length&&0===Object.keys(e.encodings[0]).length)&&(e.encodings=A,t.sendEncodings=A,this.setParametersPromises.push(t.setParameters(e).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return i})}function Ti(A){if("object"!=typeof A||!A.RTCRtpSender)return;const t=A.RTCRtpSender.prototype.getParameters;t&&(A.RTCRtpSender.prototype.getParameters=function(){const A=t.apply(this,arguments);return"encodings"in A||(A.encodings=[].concat(this.sendEncodings||[{}])),A})}function Si(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const t=A.RTCPeerConnection.prototype.createOffer;A.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}function Ki(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const t=A.RTCPeerConnection.prototype.createAnswer;A.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}}var Oi=Object.freeze({__proto__:null,shimAddTransceiver:ki,shimCreateAnswer:Ki,shimCreateOffer:Si,shimGetDisplayMedia:function(A,t){A.navigator.mediaDevices&&"getDisplayMedia"in A.navigator.mediaDevices||A.navigator.mediaDevices&&(A.navigator.mediaDevices.getDisplayMedia=function(e){if(!e||!e.video){const A=new DOMException("getDisplayMedia without video constraints is undefined");return A.name="NotFoundError",A.code=8,Promise.reject(A)}return!0===e.video?e.video={mediaSource:t}:e.video.mediaSource=t,A.navigator.mediaDevices.getUserMedia(e)})},shimGetParameters:Ti,shimGetUserMedia:Ci,shimOnTrack:Fi,shimPeerConnection:yi,shimRTCDataChannel:Ii,shimReceiverGetStats:Ei,shimRemoveStream:Hi,shimSenderGetStats:bi});function Di(A){if("object"==typeof A&&A.RTCPeerConnection){if("getLocalStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getLocalStreams=function(){return this.AA||(this.AA=[]),this.AA}),!("addStream"in A.RTCPeerConnection.prototype)){const t=A.RTCPeerConnection.prototype.addTrack;A.RTCPeerConnection.prototype.addStream=function(A){this.AA||(this.AA=[]),this.AA.includes(A)||this.AA.push(A),A.getAudioTracks().forEach((e=>t.call(this,e,A))),A.getVideoTracks().forEach((e=>t.call(this,e,A)))},A.RTCPeerConnection.prototype.addTrack=function(A){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i&&i.forEach((A=>{this.AA?this.AA.includes(A)||this.AA.push(A):this.AA=[A]})),t.apply(this,arguments)}}"removeStream"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.removeStream=function(A){this.AA||(this.AA=[]);const t=this.AA.indexOf(A);if(-1===t)return;this.AA.splice(t,1);const e=A.getTracks();this.getSenders().forEach((A=>{e.includes(A.track)&&this.removeTrack(A)}))})}}function Mi(A){if("object"==typeof A&&A.RTCPeerConnection&&("getRemoteStreams"in A.RTCPeerConnection.prototype||(A.RTCPeerConnection.prototype.getRemoteStreams=function(){return this.tA?this.tA:[]}),!("onaddstream"in A.RTCPeerConnection.prototype))){Object.defineProperty(A.RTCPeerConnection.prototype,"onaddstream",{get(){return this.eA},set(A){this.eA&&(this.removeEventListener("addstream",this.eA),this.removeEventListener("track",this.iA)),this.addEventListener("addstream",this.eA=A),this.addEventListener("track",this.iA=A=>{A.streams.forEach((A=>{if(this.tA||(this.tA=[]),this.tA.includes(A))return;this.tA.push(A);const t=new Event("addstream");t.stream=A,this.dispatchEvent(t)}))})}});const t=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){const A=this;return this.iA||this.addEventListener("track",this.iA=function(t){t.streams.forEach((t=>{if(A.tA||(A.tA=[]),A.tA.indexOf(t)>=0)return;A.tA.push(t);const e=new Event("addstream");e.stream=t,A.dispatchEvent(e)}))}),t.apply(A,arguments)}}}function Li(A){if("object"!=typeof A||!A.RTCPeerConnection)return;const t=A.RTCPeerConnection.prototype,e=t.createOffer,i=t.createAnswer,n=t.setLocalDescription,s=t.setRemoteDescription,r=t.addIceCandidate;t.createOffer=function(A,t){const i=arguments.length>=2?arguments[2]:arguments[0],n=e.apply(this,[i]);return t?(n.then(A,t),Promise.resolve()):n},t.createAnswer=function(A,t){const e=arguments.length>=2?arguments[2]:arguments[0],n=i.apply(this,[e]);return t?(n.then(A,t),Promise.resolve()):n};let o=function(A,t,e){const i=n.apply(this,[A]);return e?(i.then(t,e),Promise.resolve()):i};t.setLocalDescription=o,o=function(A,t,e){const i=s.apply(this,[A]);return e?(i.then(t,e),Promise.resolve()):i},t.setRemoteDescription=o,o=function(A,t,e){const i=r.apply(this,[A]);return e?(i.then(t,e),Promise.resolve()):i},t.addIceCandidate=o}function Ri(A){const t=A&&A.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){const A=t.mediaDevices,e=A.getUserMedia.bind(A);t.mediaDevices.getUserMedia=A=>e(Ni(A))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(A,e,i){t.mediaDevices.getUserMedia(A).then(e,i)}.bind(t))}function Ni(A){return A&&void 0!==A.video?Object.assign({},A,{video:ci(A.video)}):A}function Gi(A){if(!A.RTCPeerConnection)return;const t=A.RTCPeerConnection;A.RTCPeerConnection=function(A,e){if(A&&A.iceServers){const t=[];for(let e=0;e<A.iceServers.length;e++){let i=A.iceServers[e];void 0===i.urls&&i.url?(oi("RTCIceServer.url","RTCIceServer.urls"),i=JSON.parse(JSON.stringify(i)),i.urls=i.url,delete i.url,t.push(i)):t.push(A.iceServers[e])}A.iceServers=t}return new t(A,e)},A.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(A.RTCPeerConnection,"generateCertificate",{get:()=>t.generateCertificate})}function xi(A){"object"==typeof A&&A.RTCTrackEvent&&"receiver"in A.RTCTrackEvent.prototype&&!("transceiver"in A.RTCTrackEvent.prototype)&&Object.defineProperty(A.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Vi(A){const t=A.RTCPeerConnection.prototype.createOffer;A.RTCPeerConnection.prototype.createOffer=function(A){if(A){void 0!==A.offerToReceiveAudio&&(A.offerToReceiveAudio=!!A.offerToReceiveAudio);const t=this.getTransceivers().find((A=>"audio"===A.receiver.track.kind));!1===A.offerToReceiveAudio&&t?"sendrecv"===t.direction?t.setDirection?t.setDirection("sendonly"):t.direction="sendonly":"recvonly"===t.direction&&(t.setDirection?t.setDirection("inactive"):t.direction="inactive"):!0!==A.offerToReceiveAudio||t||this.addTransceiver("audio",{direction:"recvonly"}),void 0!==A.offerToReceiveVideo&&(A.offerToReceiveVideo=!!A.offerToReceiveVideo);const e=this.getTransceivers().find((A=>"video"===A.receiver.track.kind));!1===A.offerToReceiveVideo&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==A.offerToReceiveVideo||e||this.addTransceiver("video",{direction:"recvonly"})}return t.apply(this,arguments)}}function ji(A){"object"!=typeof A||A.AudioContext||(A.AudioContext=A.webkitAudioContext)}var Pi,_i=Object.freeze({__proto__:null,shimAudioContext:ji,shimCallbacksAPI:Li,shimConstraints:Ni,shimCreateOfferLegacy:Vi,shimGetUserMedia:Ri,shimLocalStreamsAPI:Di,shimRTCIceServerUrls:Gi,shimRemoteStreamsAPI:Mi,shimTrackEventTransceiver:xi}),Ji={exports:{}},Xi=(Pi||(Pi=1,function(A){const t={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};t.localCName=t.generateIdentifier(),t.splitLines=function(A){return A.trim().split("\n").map((A=>A.trim()))},t.splitSections=function(A){return A.split("\nm=").map(((A,t)=>(t>0?"m="+A:A).trim()+"\r\n"))},t.getDescription=function(A){const e=t.splitSections(A);return e&&e[0]},t.getMediaSections=function(A){const e=t.splitSections(A);return e.shift(),e},t.matchPrefix=function(A,e){return t.splitLines(A).filter((A=>0===A.indexOf(e)))},t.parseCandidate=function(A){let t;t=0===A.indexOf("a=candidate:")?A.substring(12).split(" "):A.substring(10).split(" ");const e={foundation:t[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let i=8;i<t.length;i+=2)switch(t[i]){case"raddr":e.relatedAddress=t[i+1];break;case"rport":e.relatedPort=parseInt(t[i+1],10);break;case"tcptype":e.tcpType=t[i+1];break;case"ufrag":e.ufrag=t[i+1],e.usernameFragment=t[i+1];break;default:void 0===e[t[i]]&&(e[t[i]]=t[i+1])}return e},t.writeCandidate=function(A){const t=[];t.push(A.foundation);const e=A.component;"rtp"===e?t.push(1):"rtcp"===e?t.push(2):t.push(e),t.push(A.protocol.toUpperCase()),t.push(A.priority),t.push(A.address||A.ip),t.push(A.port);const i=A.type;return t.push("typ"),t.push(i),"host"!==i&&A.relatedAddress&&A.relatedPort&&(t.push("raddr"),t.push(A.relatedAddress),t.push("rport"),t.push(A.relatedPort)),A.tcpType&&"tcp"===A.protocol.toLowerCase()&&(t.push("tcptype"),t.push(A.tcpType)),(A.usernameFragment||A.ufrag)&&(t.push("ufrag"),t.push(A.usernameFragment||A.ufrag)),"candidate:"+t.join(" ")},t.parseIceOptions=function(A){return A.substring(14).split(" ")},t.parseRtpMap=function(A){let t=A.substring(9).split(" ");const e={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),e.name=t[0],e.clockRate=parseInt(t[1],10),e.channels=3===t.length?parseInt(t[2],10):1,e.numChannels=e.channels,e},t.writeRtpMap=function(A){let t=A.payloadType;void 0!==A.preferredPayloadType&&(t=A.preferredPayloadType);const e=A.channels||A.numChannels||1;return"a=rtpmap:"+t+" "+A.name+"/"+A.clockRate+(1!==e?"/"+e:"")+"\r\n"},t.parseExtmap=function(A){const t=A.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},t.writeExtmap=function(A){return"a=extmap:"+(A.id||A.preferredId)+(A.direction&&"sendrecv"!==A.direction?"/"+A.direction:"")+" "+A.uri+(A.attributes?" "+A.attributes:"")+"\r\n"},t.parseFmtp=function(A){const t={};let e;const i=A.substring(A.indexOf(" ")+1).split(";");for(let n=0;n<i.length;n++)e=i[n].trim().split("="),t[e[0].trim()]=e[1];return t},t.writeFmtp=function(A){let t="",e=A.payloadType;if(void 0!==A.preferredPayloadType&&(e=A.preferredPayloadType),A.parameters&&Object.keys(A.parameters).length){const i=[];Object.keys(A.parameters).forEach((t=>{void 0!==A.parameters[t]?i.push(t+"="+A.parameters[t]):i.push(t)})),t+="a=fmtp:"+e+" "+i.join(";")+"\r\n"}return t},t.parseRtcpFb=function(A){const t=A.substring(A.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},t.writeRtcpFb=function(A){let t="",e=A.payloadType;return void 0!==A.preferredPayloadType&&(e=A.preferredPayloadType),A.rtcpFeedback&&A.rtcpFeedback.length&&A.rtcpFeedback.forEach((A=>{t+="a=rtcp-fb:"+e+" "+A.type+(A.parameter&&A.parameter.length?" "+A.parameter:"")+"\r\n"})),t},t.parseSsrcMedia=function(A){const t=A.indexOf(" "),e={ssrc:parseInt(A.substring(7,t),10)},i=A.indexOf(":",t);return i>-1?(e.attribute=A.substring(t+1,i),e.value=A.substring(i+1)):e.attribute=A.substring(t+1),e},t.parseSsrcGroup=function(A){const t=A.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((A=>parseInt(A,10)))}},t.getMid=function(A){const e=t.matchPrefix(A,"a=mid:")[0];if(e)return e.substring(6)},t.parseFingerprint=function(A){const t=A.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},t.getDtlsParameters=function(A,e){return{role:"auto",fingerprints:t.matchPrefix(A+e,"a=fingerprint:").map(t.parseFingerprint)}},t.writeDtlsParameters=function(A,t){let e="a=setup:"+t+"\r\n";return A.fingerprints.forEach((A=>{e+="a=fingerprint:"+A.algorithm+" "+A.value+"\r\n"})),e},t.parseCryptoLine=function(A){const t=A.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},t.writeCryptoLine=function(A){return"a=crypto:"+A.tag+" "+A.cryptoSuite+" "+("object"==typeof A.keyParams?t.writeCryptoKeyParams(A.keyParams):A.keyParams)+(A.sessionParams?" "+A.sessionParams.join(" "):"")+"\r\n"},t.parseCryptoKeyParams=function(A){if(0!==A.indexOf("inline:"))return null;const t=A.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},t.writeCryptoKeyParams=function(A){return A.keyMethod+":"+A.keySalt+(A.lifeTime?"|"+A.lifeTime:"")+(A.mkiValue&&A.mkiLength?"|"+A.mkiValue+":"+A.mkiLength:"")},t.getCryptoParameters=function(A,e){return t.matchPrefix(A+e,"a=crypto:").map(t.parseCryptoLine)},t.getIceParameters=function(A,e){const i=t.matchPrefix(A+e,"a=ice-ufrag:")[0],n=t.matchPrefix(A+e,"a=ice-pwd:")[0];return i&&n?{usernameFragment:i.substring(12),password:n.substring(10)}:null},t.writeIceParameters=function(A){let t="a=ice-ufrag:"+A.usernameFragment+"\r\na=ice-pwd:"+A.password+"\r\n";return A.iceLite&&(t+="a=ice-lite\r\n"),t},t.parseRtpParameters=function(A){const e={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},i=t.splitLines(A)[0].split(" ");e.profile=i[2];for(let s=3;s<i.length;s++){const n=i[s],r=t.matchPrefix(A,"a=rtpmap:"+n+" ")[0];if(r){const i=t.parseRtpMap(r),s=t.matchPrefix(A,"a=fmtp:"+n+" ");switch(i.parameters=s.length?t.parseFmtp(s[0]):{},i.rtcpFeedback=t.matchPrefix(A,"a=rtcp-fb:"+n+" ").map(t.parseRtcpFb),e.codecs.push(i),i.name.toUpperCase()){case"RED":case"ULPFEC":e.fecMechanisms.push(i.name.toUpperCase())}}}t.matchPrefix(A,"a=extmap:").forEach((A=>{e.headerExtensions.push(t.parseExtmap(A))}));const n=t.matchPrefix(A,"a=rtcp-fb:* ").map(t.parseRtcpFb);return e.codecs.forEach((A=>{n.forEach((t=>{A.rtcpFeedback.find((A=>A.type===t.type&&A.parameter===t.parameter))||A.rtcpFeedback.push(t)}))})),e},t.writeRtpDescription=function(A,e){let i="";i+="m="+A+" ",i+=e.codecs.length>0?"9":"0",i+=" "+(e.profile||"UDP/TLS/RTP/SAVPF")+" ",i+=e.codecs.map((A=>void 0!==A.preferredPayloadType?A.preferredPayloadType:A.payloadType)).join(" ")+"\r\n",i+="c=IN IP4 0.0.0.0\r\n",i+="a=rtcp:9 IN IP4 0.0.0.0\r\n",e.codecs.forEach((A=>{i+=t.writeRtpMap(A),i+=t.writeFmtp(A),i+=t.writeRtcpFb(A)}));let n=0;return e.codecs.forEach((A=>{A.maxptime>n&&(n=A.maxptime)})),n>0&&(i+="a=maxptime:"+n+"\r\n"),e.headerExtensions&&e.headerExtensions.forEach((A=>{i+=t.writeExtmap(A)})),i},t.parseRtpEncodingParameters=function(A){const e=[],i=t.parseRtpParameters(A),n=-1!==i.fecMechanisms.indexOf("RED"),s=-1!==i.fecMechanisms.indexOf("ULPFEC"),r=t.matchPrefix(A,"a=ssrc:").map((A=>t.parseSsrcMedia(A))).filter((A=>"cname"===A.attribute)),o=r.length>0&&r[0].ssrc;let a;const c=t.matchPrefix(A,"a=ssrc-group:FID").map((A=>A.substring(17).split(" ").map((A=>parseInt(A,10)))));c.length>0&&c[0].length>1&&c[0][0]===o&&(a=c[0][1]),i.codecs.forEach((A=>{if("RTX"===A.name.toUpperCase()&&A.parameters.apt){let t={ssrc:o,codecPayloadType:parseInt(A.parameters.apt,10)};o&&a&&(t.rtx={ssrc:a}),e.push(t),n&&(t=JSON.parse(JSON.stringify(t)),t.fec={ssrc:o,mechanism:s?"red+ulpfec":"red"},e.push(t))}})),0===e.length&&o&&e.push({ssrc:o});let h=t.matchPrefix(A,"b=");return h.length&&(h=0===h[0].indexOf("b=TIAS:")?parseInt(h[0].substring(7),10):0===h[0].indexOf("b=AS:")?1e3*parseInt(h[0].substring(5),10)*.95-16e3:void 0,e.forEach((A=>{A.maxBitrate=h}))),e},t.parseRtcpParameters=function(A){const e={},i=t.matchPrefix(A,"a=ssrc:").map((A=>t.parseSsrcMedia(A))).filter((A=>"cname"===A.attribute))[0];i&&(e.cname=i.value,e.ssrc=i.ssrc);const n=t.matchPrefix(A,"a=rtcp-rsize");e.reducedSize=n.length>0,e.compound=0===n.length;const s=t.matchPrefix(A,"a=rtcp-mux");return e.mux=s.length>0,e},t.writeRtcpParameters=function(A){let t="";return A.reducedSize&&(t+="a=rtcp-rsize\r\n"),A.mux&&(t+="a=rtcp-mux\r\n"),void 0!==A.ssrc&&A.cname&&(t+="a=ssrc:"+A.ssrc+" cname:"+A.cname+"\r\n"),t},t.parseMsid=function(A){let e;const i=t.matchPrefix(A,"a=msid:");if(1===i.length)return e=i[0].substring(7).split(" "),{stream:e[0],track:e[1]};const n=t.matchPrefix(A,"a=ssrc:").map((A=>t.parseSsrcMedia(A))).filter((A=>"msid"===A.attribute));return n.length>0?(e=n[0].value.split(" "),{stream:e[0],track:e[1]}):void 0},t.parseSctpDescription=function(A){const e=t.parseMLine(A),i=t.matchPrefix(A,"a=max-message-size:");let n;i.length>0&&(n=parseInt(i[0].substring(19),10)),isNaN(n)&&(n=65536);const s=t.matchPrefix(A,"a=sctp-port:");if(s.length>0)return{port:parseInt(s[0].substring(12),10),protocol:e.fmt,maxMessageSize:n};const r=t.matchPrefix(A,"a=sctpmap:");if(r.length>0){const A=r[0].substring(10).split(" ");return{port:parseInt(A[0],10),protocol:A[1],maxMessageSize:n}}},t.writeSctpDescription=function(A,t){let e=[];return e="DTLS/SCTP"!==A.protocol?["m="+A.kind+" 9 "+A.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+A.kind+" 9 "+A.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&e.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),e.join("")},t.generateSessionId=function(){return Math.random().toString().substr(2,22)},t.writeSessionBoilerplate=function(A,e,i){let n;const s=void 0!==e?e:2;return n=A||t.generateSessionId(),"v=0\r\no="+(i||"thisisadapterortc")+" "+n+" "+s+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},t.getDirection=function(A,e){const i=t.splitLines(A);for(let t=0;t<i.length;t++)switch(i[t]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return i[t].substring(2)}return e?t.getDirection(e):"sendrecv"},t.getKind=function(A){return t.splitLines(A)[0].split(" ")[0].substring(2)},t.isRejected=function(A){return"0"===A.split(" ",2)[1]},t.parseMLine=function(A){const e=t.splitLines(A)[0].substring(2).split(" ");return{kind:e[0],port:parseInt(e[1],10),protocol:e[2],fmt:e.slice(3).join(" ")}},t.parseOLine=function(A){const e=t.matchPrefix(A,"o=")[0].substring(2).split(" ");return{username:e[0],sessionId:e[1],sessionVersion:parseInt(e[2],10),netType:e[3],addressType:e[4],address:e[5]}},t.isValidSDP=function(A){if("string"!=typeof A||0===A.length)return!1;const e=t.splitLines(A);for(let t=0;t<e.length;t++)if(e[t].length<2||"="!==e[t].charAt(1))return!1;return!0},A.exports=t}(Ji)),Ji.exports),Yi=Ke(Xi),Zi=r({__proto__:null,default:Yi},[Xi]);function Wi(A){if(!A.RTCIceCandidate||A.RTCIceCandidate&&"foundation"in A.RTCIceCandidate.prototype)return;const t=A.RTCIceCandidate;A.RTCIceCandidate=function(A){if("object"==typeof A&&A.candidate&&0===A.candidate.indexOf("a=")&&((A=JSON.parse(JSON.stringify(A))).candidate=A.candidate.substring(2)),A.candidate&&A.candidate.length){const e=new t(A),i=Yi.parseCandidate(A.candidate);for(const A in i)A in e||Object.defineProperty(e,A,{value:i[A]});return e.toJSON=function(){return{candidate:e.candidate,sdpMid:e.sdpMid,sdpMLineIndex:e.sdpMLineIndex,usernameFragment:e.usernameFragment}},e}return new t(A)},A.RTCIceCandidate.prototype=t.prototype,ii(A,"icecandidate",(t=>(t.candidate&&Object.defineProperty(t,"candidate",{value:new A.RTCIceCandidate(t.candidate),writable:"false"}),t)))}function qi(A){!A.RTCIceCandidate||A.RTCIceCandidate&&"relayProtocol"in A.RTCIceCandidate.prototype||ii(A,"icecandidate",(A=>{if(A.candidate){const t=Yi.parseCandidate(A.candidate.candidate);"relay"===t.type&&(A.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return A}))}function zi(A,t){if(!A.RTCPeerConnection)return;"sctp"in A.RTCPeerConnection.prototype||Object.defineProperty(A.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this.nA?null:this.nA}});const e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this.nA=null,"chrome"===t.browser&&t.version>=76){const{sdpSemantics:A}=this.getConfiguration();"plan-b"===A&&Object.defineProperty(this,"sctp",{get(){return void 0===this.nA?null:this.nA},enumerable:!0,configurable:!0})}if(function(A){if(!A||!A.sdp)return!1;const t=Yi.splitSections(A.sdp);return t.shift(),t.some((A=>{const t=Yi.parseMLine(A);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){const A=function(A){const t=A.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const e=parseInt(t[1],10);return e!=e?-1:e}(arguments[0]),e=function(A){let e=65536;return"firefox"===t.browser&&(e=t.version<57?-1===A?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),e}(A),i=function(A,e){let i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);const n=Yi.matchPrefix(A.sdp,"a=max-message-size:");return n.length>0?i=parseInt(n[0].substring(19),10):"firefox"===t.browser&&-1!==e&&(i=2147483637),i}(arguments[0],A);let n;n=0===e&&0===i?Number.POSITIVE_INFINITY:0===e||0===i?Math.max(e,i):Math.min(e,i);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>n}),this.nA=s}return e.apply(this,arguments)}}function $i(A){if(!A.RTCPeerConnection||!("createDataChannel"in A.RTCPeerConnection.prototype))return;function t(A,t){const e=A.send;A.send=function(){const i=arguments[0],n=i.length||i.size||i.byteLength;if("open"===A.readyState&&t.sctp&&n>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return e.apply(A,arguments)}}const e=A.RTCPeerConnection.prototype.createDataChannel;A.RTCPeerConnection.prototype.createDataChannel=function(){const A=e.apply(this,arguments);return t(A,this),A},ii(A,"datachannel",(A=>(t(A.channel,A.target),A)))}function An(A){if(!A.RTCPeerConnection||"connectionState"in A.RTCPeerConnection.prototype)return;const t=A.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this.sA||null},set(A){this.sA&&(this.removeEventListener("connectionstatechange",this.sA),delete this.sA),A&&this.addEventListener("connectionstatechange",this.sA=A)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((A=>{const e=t[A];t[A]=function(){return this.rA||(this.rA=A=>{const t=A.target;if(t.oA!==t.connectionState){t.oA=t.connectionState;const e=new Event("connectionstatechange",A);t.dispatchEvent(e)}return A},this.addEventListener("iceconnectionstatechange",this.rA)),e.apply(this,arguments)}}))}function tn(A,t){if(!A.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const e=A.RTCPeerConnection.prototype.setRemoteDescription;A.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const e=t.sdp.split("\n").filter((A=>"a=extmap-allow-mixed"!==A.trim())).join("\n");A.RTCSessionDescription&&t instanceof A.RTCSessionDescription?arguments[0]=new A.RTCSessionDescription({type:t.type,sdp:e}):t.sdp=e}return e.apply(this,arguments)}}function en(A,t){if(!A.RTCPeerConnection||!A.RTCPeerConnection.prototype)return;const e=A.RTCPeerConnection.prototype.addIceCandidate;e&&0!==e.length&&(A.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():e.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function nn(A,t){if(!A.RTCPeerConnection||!A.RTCPeerConnection.prototype)return;const e=A.RTCPeerConnection.prototype.setLocalDescription;e&&0!==e.length&&(A.RTCPeerConnection.prototype.setLocalDescription=function(){let A=arguments[0]||{};if("object"!=typeof A||A.type&&A.sdp)return e.apply(this,arguments);if(A={type:A.type,sdp:A.sdp},!A.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":A.type="offer";break;default:A.type="answer"}return A.sdp||"offer"!==A.type&&"answer"!==A.type?e.apply(this,[A]):("offer"===A.type?this.createOffer:this.createAnswer).apply(this).then((A=>e.apply(this,[A])))})}var sn=Object.freeze({__proto__:null,removeExtmapAllowMixed:tn,shimAddIceCandidateNullOrEmpty:en,shimConnectionState:An,shimMaxMessageSize:zi,shimParameterlessSetLocalDescription:nn,shimRTCIceCandidate:Wi,shimRTCIceCandidateRelayProtocol:qi,shimSendThrowTypeError:$i});!function(){let{window:A}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const e=ri,i=function(A){const t={browser:null,version:null};if(void 0===A||!A.navigator||!A.navigator.userAgent)return t.browser="Not a browser.",t;const{navigator:e}=A;if(e.userAgentData&&e.userAgentData.brands){const A=e.userAgentData.brands.find((A=>"Chromium"===A.brand));if(A)return{browser:"chrome",version:parseInt(A.version,10)}}if(e.mozGetUserMedia)t.browser="firefox",t.version=ei(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia||!1===A.isSecureContext&&A.webkitRTCPeerConnection)t.browser="chrome",t.version=ei(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!A.RTCPeerConnection||!e.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=ei(e.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=A.RTCRtpTransceiver&&"currentDirection"in A.RTCRtpTransceiver.prototype}return t}(A),n={browserDetails:i,commonShim:sn,extractVersion:ei,disableLog:ni,disableWarnings:si,sdp:Zi};switch(i.browser){case"chrome":if(!Ui||!mi||!t.shimChrome)return e("Chrome shim is not included in this adapter release."),n;if(null===i.version)return e("Chrome shim can not determine version, not shimming."),n;e("adapter.js shimming chrome."),n.browserShim=Ui,en(A,i),nn(A),di(A,i),Bi(A),mi(A,i),wi(A),vi(A,i),fi(A),gi(A),pi(A,i),Wi(A),qi(A),An(A),zi(A,i),$i(A),tn(A,i);break;case"firefox":if(!Oi||!yi||!t.shimFirefox)return e("Firefox shim is not included in this adapter release."),n;e("adapter.js shimming firefox."),n.browserShim=Oi,en(A,i),nn(A),Ci(A,i),yi(A,i),Fi(A),Hi(A),bi(A),Ei(A),Ii(A),ki(A),Ti(A),Si(A),Ki(A),Wi(A),An(A),zi(A,i),$i(A);break;case"safari":if(!_i||!t.shimSafari)return e("Safari shim is not included in this adapter release."),n;e("adapter.js shimming safari."),n.browserShim=_i,en(A,i),nn(A),Gi(A),Vi(A),Li(A),Di(A),Mi(A),xi(A),Ri(A),ji(A),Wi(A),qi(A),zi(A,i),$i(A),tn(A,i);break;default:e("Unsupported browser!")}}({window:"undefined"==typeof window?void 0:window});const rn="lk_e2ee";var on,an,cn,hn,un,ln,dn,Bn,wn,fn,gn,Qn,vn,mn,pn,Un,Cn,Fn,yn,bn;function En(){return void 0!==window.RTCRtpScriptTransform}(an=on||(on={})).SetKey="setKey",an.RatchetRequest="ratchetRequest",an.KeyRatcheted="keyRatcheted",(cn||(cn={})).KeyRatcheted="keyRatcheted",(un=hn||(hn={})).ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",un.EncryptionError="encryptionError",(ln||(ln={})).Error="cryptorError",$e.EventEmitter;class Hn extends Error{constructor(A,t){super(t||"an error has occured"),this.name="LiveKitError",this.code=A}}(Bn=dn||(dn={}))[Bn.NotAllowed=0]="NotAllowed",Bn[Bn.ServerUnreachable=1]="ServerUnreachable",Bn[Bn.InternalError=2]="InternalError",Bn[Bn.Cancelled=3]="Cancelled",Bn[Bn.LeaveRequest=4]="LeaveRequest";class In extends Hn{constructor(A,t,e,i){super(1,A),this.name="ConnectionError",this.status=e,this.reason=t,this.context=i,this.reasonName=dn[t]}}class kn extends Hn{constructor(A){super(21,null!=A?A:"device is unsupported"),this.name="DeviceUnsupportedError"}}class Tn extends Hn{constructor(A){super(20,null!=A?A:"track is invalid"),this.name="TrackInvalidError"}}class Sn extends Hn{constructor(A){super(10,null!=A?A:"unsupported server"),this.name="UnsupportedServer"}}class Kn extends Hn{constructor(A){super(12,null!=A?A:"unexpected connection state"),this.name="UnexpectedConnectionState"}}class On extends Hn{constructor(A){super(13,null!=A?A:"unable to negotiate"),this.name="NegotiationError"}}class Dn extends Hn{constructor(A,t){super(15,A),this.name="PublishTrackError",this.status=t}}class Mn extends Hn{constructor(A,t){super(15,A),this.reason=t,this.reasonName="string"==typeof t?t:Te[t]}}(fn=wn||(wn={})).PermissionDenied="PermissionDenied",fn.NotFound="NotFound",fn.DeviceInUse="DeviceInUse",fn.Other="Other",function(A){A.getFailure=function(t){if(t&&"name"in t)return"NotFoundError"===t.name||"DevicesNotFoundError"===t.name?A.NotFound:"NotAllowedError"===t.name||"PermissionDeniedError"===t.name?A.PermissionDenied:"NotReadableError"===t.name||"TrackStartError"===t.name?A.DeviceInUse:A.Other}}(wn||(wn={})),(Qn=gn||(gn={}))[Qn.InvalidKey=0]="InvalidKey",Qn[Qn.MissingKey=1]="MissingKey",Qn[Qn.InternalError=2]="InternalError",(mn=vn||(vn={})).Connected="connected",mn.Reconnecting="reconnecting",mn.SignalReconnecting="signalReconnecting",mn.Reconnected="reconnected",mn.Disconnected="disconnected",mn.ConnectionStateChanged="connectionStateChanged",mn.Moved="moved",mn.MediaDevicesChanged="mediaDevicesChanged",mn.ParticipantConnected="participantConnected",mn.ParticipantDisconnected="participantDisconnected",mn.TrackPublished="trackPublished",mn.TrackSubscribed="trackSubscribed",mn.TrackSubscriptionFailed="trackSubscriptionFailed",mn.TrackUnpublished="trackUnpublished",mn.TrackUnsubscribed="trackUnsubscribed",mn.TrackMuted="trackMuted",mn.TrackUnmuted="trackUnmuted",mn.LocalTrackPublished="localTrackPublished",mn.LocalTrackUnpublished="localTrackUnpublished",mn.LocalAudioSilenceDetected="localAudioSilenceDetected",mn.ActiveSpeakersChanged="activeSpeakersChanged",mn.ParticipantMetadataChanged="participantMetadataChanged",mn.ParticipantNameChanged="participantNameChanged",mn.ParticipantAttributesChanged="participantAttributesChanged",mn.ParticipantActive="participantActive",mn.RoomMetadataChanged="roomMetadataChanged",mn.DataReceived="dataReceived",mn.SipDTMFReceived="sipDTMFReceived",mn.TranscriptionReceived="transcriptionReceived",mn.ConnectionQualityChanged="connectionQualityChanged",mn.TrackStreamStateChanged="trackStreamStateChanged",mn.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",mn.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",mn.AudioPlaybackStatusChanged="audioPlaybackChanged",mn.VideoPlaybackStatusChanged="videoPlaybackChanged",mn.MediaDevicesError="mediaDevicesError",mn.ParticipantPermissionsChanged="participantPermissionsChanged",mn.SignalConnected="signalConnected",mn.RecordingStatusChanged="recordingStatusChanged",mn.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",mn.EncryptionError="encryptionError",mn.DCBufferStatusChanged="dcBufferStatusChanged",mn.ActiveDeviceChanged="activeDeviceChanged",mn.ChatMessage="chatMessage",mn.LocalTrackSubscribed="localTrackSubscribed",mn.MetricsReceived="metricsReceived",(Un=pn||(pn={})).TrackPublished="trackPublished",Un.TrackSubscribed="trackSubscribed",Un.TrackSubscriptionFailed="trackSubscriptionFailed",Un.TrackUnpublished="trackUnpublished",Un.TrackUnsubscribed="trackUnsubscribed",Un.TrackMuted="trackMuted",Un.TrackUnmuted="trackUnmuted",Un.LocalTrackPublished="localTrackPublished",Un.LocalTrackUnpublished="localTrackUnpublished",Un.ParticipantMetadataChanged="participantMetadataChanged",Un.ParticipantNameChanged="participantNameChanged",Un.DataReceived="dataReceived",Un.SipDTMFReceived="sipDTMFReceived",Un.TranscriptionReceived="transcriptionReceived",Un.IsSpeakingChanged="isSpeakingChanged",Un.ConnectionQualityChanged="connectionQualityChanged",Un.TrackStreamStateChanged="trackStreamStateChanged",Un.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",Un.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",Un.MediaDevicesError="mediaDevicesError",Un.AudioStreamAcquired="audioStreamAcquired",Un.ParticipantPermissionsChanged="participantPermissionsChanged",Un.PCTrackAdded="pcTrackAdded",Un.AttributesChanged="attributesChanged",Un.LocalTrackSubscribed="localTrackSubscribed",Un.ChatMessage="chatMessage",Un.Active="active",(Fn=Cn||(Cn={})).TransportsCreated="transportsCreated",Fn.Connected="connected",Fn.Disconnected="disconnected",Fn.Resuming="resuming",Fn.Resumed="resumed",Fn.Restarting="restarting",Fn.Restarted="restarted",Fn.SignalResumed="signalResumed",Fn.SignalRestarted="signalRestarted",Fn.Closing="closing",Fn.MediaTrackAdded="mediaTrackAdded",Fn.ActiveSpeakersUpdate="activeSpeakersUpdate",Fn.DataPacketReceived="dataPacketReceived",Fn.RTPVideoMapUpdate="rtpVideoMapUpdate",Fn.DCBufferStatusChanged="dcBufferStatusChanged",Fn.ParticipantUpdate="participantUpdate",Fn.RoomUpdate="roomUpdate",Fn.SpeakersChanged="speakersChanged",Fn.StreamStateChanged="streamStateChanged",Fn.ConnectionQualityUpdate="connectionQualityUpdate",Fn.SubscriptionError="subscriptionError",Fn.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",Fn.RemoteMute="remoteMute",Fn.SubscribedQualityUpdate="subscribedQualityUpdate",Fn.LocalTrackUnpublished="localTrackUnpublished",Fn.LocalTrackSubscribed="localTrackSubscribed",Fn.Offline="offline",Fn.SignalRequestResponse="signalRequestResponse",Fn.SignalConnected="signalConnected",Fn.RoomMoved="roomMoved",(bn=yn||(yn={})).Message="message",bn.Muted="muted",bn.Unmuted="unmuted",bn.Restarted="restarted",bn.Ended="ended",bn.Subscribed="subscribed",bn.Unsubscribed="unsubscribed",bn.UpdateSettings="updateSettings",bn.UpdateSubscription="updateSubscription",bn.AudioPlaybackStarted="audioPlaybackStarted",bn.AudioPlaybackFailed="audioPlaybackFailed",bn.AudioSilenceDetected="audioSilenceDetected",bn.VisibilityChanged="visibilityChanged",bn.VideoDimensionsChanged="videoDimensionsChanged",bn.VideoPlaybackStarted="videoPlaybackStarted",bn.VideoPlaybackFailed="videoPlaybackFailed",bn.ElementAttached="elementAttached",bn.ElementDetached="elementDetached",bn.UpstreamPaused="upstreamPaused",bn.UpstreamResumed="upstreamResumed",bn.SubscriptionPermissionChanged="subscriptionPermissionChanged",bn.SubscriptionStatusChanged="subscriptionStatusChanged",bn.SubscriptionFailed="subscriptionFailed",bn.TrackProcessorUpdate="trackProcessorUpdate",bn.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",bn.TranscriptionReceived="transcriptionReceived",bn.TimeSyncUpdate="timeSyncUpdate";const Ln=/version\/(\d+(\.?_?\d+)+)/i;let Rn;function Nn(A){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===A&&"undefined"==typeof navigator)return;const e=(null!=A?A:navigator.userAgent).toLowerCase();if(void 0===Rn||t){const A=Gn.find((A=>{let{test:t}=A;return t.test(e)}));Rn=null==A?void 0:A.describe(e)}return Rn}const Gn=[{test:/firefox|iceweasel|fxios/i,describe:A=>({name:"Firefox",version:xn(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,A),os:A.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Vn(A)})},{test:/chrom|crios|crmo/i,describe:A=>({name:"Chrome",version:xn(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,A),os:A.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Vn(A)})},{test:/safari|applewebkit/i,describe:A=>({name:"Safari",version:xn(Ln,A),os:A.includes("mobile/")?"iOS":"macOS",osVersion:Vn(A)})}];function xn(A,t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const i=t.match(A);return i&&i.length>=e&&i[e]||""}function Vn(A){return A.includes("mac os")?xn(/\(.+?(\d+_\d+(:?_\d+)?)/,A,1).replace(/_/g,"."):void 0}class jn{}jn.setTimeout=function(){return setTimeout(...arguments)},jn.setInterval=function(){return setInterval(...arguments)},jn.clearTimeout=function(){return clearTimeout(...arguments)},jn.clearInterval=function(){return clearInterval(...arguments)};const Pn=[];var _n,Jn;(Jn=_n||(_n={}))[Jn.LOW=0]="LOW",Jn[Jn.MEDIUM=1]="MEDIUM",Jn[Jn.HIGH=2]="HIGH";class Xn extends $e.EventEmitter{constructor(A,t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var i;super(),this.attachedElements=[],this.isMuted=!1,this.streamState=Xn.StreamState.Active,this.isInBackground=!1,this.aA=0,this.log=Pe,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),"hidden"===document.visibilityState?this.backgroundTimeout=setTimeout((()=>this.handleAppVisibilityChanged()),5e3):this.handleAppVisibilityChanged()},this.log=_e(null!==(i=e.loggerName)&&void 0!==i?i:Ge.Track),this.loggerContextCb=e.loggerContextCb,this.setMaxListeners(100),this.kind=t,this.cA=A,this.hA=A.id,this.source=Xn.Source.Unknown}get logContext(){var A;return Object.assign(Object.assign({},null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this)),Ar(this))}get currentBitrate(){return this.aA}get mediaStreamTrack(){return this.cA}get mediaStreamID(){return this.hA}attach(A){let t="audio";this.kind===Xn.Kind.Video&&(t="video"),0===this.attachedElements.length&&this.kind===Xn.Kind.Video&&this.addAppVisibilityListener(),A||("audio"===t&&(Pn.forEach((t=>{null!==t.parentElement||A||(A=t)})),A&&Pn.splice(Pn.indexOf(A),1)),A||(A=document.createElement(t))),this.attachedElements.includes(A)||this.attachedElements.push(A),Yn(this.mediaStreamTrack,A);const e=A.srcObject.getTracks(),i=e.some((A=>"audio"===A.kind));return A.play().then((()=>{this.emit(i?yn.AudioPlaybackStarted:yn.VideoPlaybackStarted)})).catch((t=>{"NotAllowedError"===t.name?this.emit(i?yn.AudioPlaybackFailed:yn.VideoPlaybackFailed,t):"AbortError"===t.name?Pe.debug("".concat(i?"audio":"video"," playback aborted, likely due to new play request")):Pe.warn("could not playback ".concat(i?"audio":"video"),t),i&&A&&e.some((A=>"video"===A.kind))&&"NotAllowedError"===t.name&&(A.muted=!0,A.play().catch((()=>{})))})),this.emit(yn.ElementAttached,A),A}detach(A){try{if(A){Zn(this.mediaStreamTrack,A);const t=this.attachedElements.indexOf(A);return t>=0&&(this.attachedElements.splice(t,1),this.recycleElement(A),this.emit(yn.ElementDetached,A)),A}const t=[];return this.attachedElements.forEach((A=>{Zn(this.mediaStreamTrack,A),t.push(A),this.recycleElement(A),this.emit(yn.ElementDetached,A)})),this.attachedElements=[],t}finally{0===this.attachedElements.length&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this.cA.stop()}enable(){this.cA.enabled=!0}disable(){this.cA.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(A){A.loggerName&&(this.log=_e(A.loggerName)),A.loggerContextCb&&(this.loggerContextCb=A.loggerContextCb)}recycleElement(A){if(A instanceof HTMLAudioElement){let t=!0;A.pause(),Pn.forEach((A=>{A.parentElement||(t=!1)})),t&&Pn.push(A)}}handleAppVisibilityChanged(){return Ze(this,void 0,void 0,(function*(){this.isInBackground="hidden"===document.visibilityState,this.isInBackground||this.kind!==Xn.Kind.Video||setTimeout((()=>this.attachedElements.forEach((A=>A.play().catch((()=>{}))))),0)}))}addAppVisibilityListener(){fs()?(this.isInBackground="hidden"===document.visibilityState,document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){fs()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Yn(A,t){let e,i;e=t.srcObject instanceof MediaStream?t.srcObject:new MediaStream,i="audio"===A.kind?e.getAudioTracks():e.getVideoTracks(),i.includes(A)||(i.forEach((A=>{e.removeTrack(A)})),e.addTrack(A)),Bs()&&t instanceof HTMLVideoElement||(t.autoplay=!0),t.muted=0===e.getAudioTracks().length,t instanceof HTMLVideoElement&&(t.playsInline=!0),t.srcObject!==e&&(t.srcObject=e,(Bs()||ds())&&t instanceof HTMLVideoElement&&setTimeout((()=>{t.srcObject=e,t.play().catch((()=>{}))}),0))}function Zn(A,t){if(t.srcObject instanceof MediaStream){const e=t.srcObject;e.removeTrack(A),e.getTracks().length>0?t.srcObject=e:t.srcObject=null}}!function(A){let t;var e;let i;var n;let s;var r;(e=t=A.Kind||(A.Kind={})).Audio="audio",e.Video="video",e.Unknown="unknown",(n=i=A.Source||(A.Source={})).Camera="camera",n.Microphone="microphone",n.ScreenShare="screen_share",n.ScreenShareAudio="screen_share_audio",n.Unknown="unknown",(r=s=A.StreamState||(A.StreamState={})).Active="active",r.Paused="paused",r.Unknown="unknown",A.kindToProto=function(A){switch(A){case t.Audio:return _A.AUDIO;case t.Video:return _A.VIDEO;default:return _A.DATA}},A.kindFromProto=function(A){switch(A){case _A.AUDIO:return t.Audio;case _A.VIDEO:return t.Video;default:return t.Unknown}},A.sourceToProto=function(A){switch(A){case i.Camera:return JA.CAMERA;case i.Microphone:return JA.MICROPHONE;case i.ScreenShare:return JA.SCREEN_SHARE;case i.ScreenShareAudio:return JA.SCREEN_SHARE_AUDIO;default:return JA.UNKNOWN}},A.sourceFromProto=function(A){switch(A){case JA.CAMERA:return i.Camera;case JA.MICROPHONE:return i.Microphone;case JA.SCREEN_SHARE:return i.ScreenShare;case JA.SCREEN_SHARE_AUDIO:return i.ScreenShareAudio;default:return i.Unknown}},A.streamStateFromProto=function(A){switch(A){case Gt.ACTIVE:return s.Active;case Gt.PAUSED:return s.Paused;default:return s.Unknown}}}(Xn||(Xn={}));class Wn{constructor(A,t,e,i,n){if("object"==typeof A)this.width=A.width,this.height=A.height,this.aspectRatio=A.aspectRatio,this.encoding={maxBitrate:A.maxBitrate,maxFramerate:A.maxFramerate,priority:A.priority};else{if(void 0===t||void 0===e)throw new TypeError("Unsupported options: provide at least width, height and maxBitrate");this.width=A,this.height=t,this.aspectRatio=A/t,this.encoding={maxBitrate:e,maxFramerate:i,priority:n}}}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const qn=["vp8","h264"],zn=["vp8","h264","vp9","av1"];function $n(A){return!!qn.find((t=>t===A))}var As,ts,es,is;(ts=As||(As={}))[ts.PREFER_REGRESSION=0]="PREFER_REGRESSION",ts[ts.SIMULCAST=1]="SIMULCAST",ts[ts.REGRESSION=2]="REGRESSION",(is=es||(es={})).telephone={maxBitrate:12e3},is.speech={maxBitrate:24e3},is.music={maxBitrate:48e3},is.musicStereo={maxBitrate:64e3},is.musicHighQuality={maxBitrate:96e3},is.musicHighQualityStereo={maxBitrate:128e3};const ns={h90:new Wn(160,90,9e4,20),h180:new Wn(320,180,16e4,20),h216:new Wn(384,216,18e4,20),h360:new Wn(640,360,45e4,20),h540:new Wn(960,540,8e5,25),h720:new Wn(1280,720,17e5,30),h1080:new Wn(1920,1080,3e6,30),h1440:new Wn(2560,1440,5e6,30),h2160:new Wn(3840,2160,8e6,30)},ss={h120:new Wn(160,120,7e4,20),h180:new Wn(240,180,125e3,20),h240:new Wn(320,240,14e4,20),h360:new Wn(480,360,33e4,20),h480:new Wn(640,480,5e5,20),h540:new Wn(720,540,6e5,25),h720:new Wn(960,720,13e5,30),h1080:new Wn(1440,1080,23e5,30),h1440:new Wn(1920,1440,38e5,30)},rs={h360fps3:new Wn(640,360,2e5,3,"medium"),h360fps15:new Wn(640,360,4e5,15,"medium"),h720fps5:new Wn(1280,720,8e5,5,"medium"),h720fps15:new Wn(1280,720,15e5,15,"medium"),h720fps30:new Wn(1280,720,2e6,30,"medium"),h1080fps15:new Wn(1920,1080,25e5,15,"medium"),h1080fps30:new Wn(1920,1080,5e6,30,"medium"),original:new Wn(0,0,7e6,30,"medium")},os="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function as(A){return Ze(this,void 0,void 0,(function*(){return new Promise((t=>jn.setTimeout(t,A)))}))}function cs(){return"addTransceiver"in RTCPeerConnection.prototype}function hs(){return"addTrack"in RTCPeerConnection.prototype}function us(A){return"av1"===A||"vp9"===A}function ls(A){return!!document&&(A||(A=document.createElement("audio")),"setSinkId"in A)}function ds(){var A;return"Firefox"===(null===(A=Nn())||void 0===A?void 0:A.name)}function Bs(){var A;return"Safari"===(null===(A=Nn())||void 0===A?void 0:A.name)}function ws(){var A,t;return!!fs()&&(null!==(t=null===(A=navigator.userAgentData)||void 0===A?void 0:A.mobile)&&void 0!==t?t:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent))}function fs(){return"undefined"!=typeof document}function gs(){return"ReactNative"==navigator.product}function Qs(A){return A.hostname.endsWith(".livekit.cloud")||A.hostname.endsWith(".livekit.run")}function vs(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function ms(){if(!gs())return;let A=vs();return A?A.platform:void 0}function ps(){if(fs())return window.devicePixelRatio;if(gs()){let A=vs();if(A)return A.devicePixelRatio}return 1}function Us(A,t){const e=A.split("."),i=t.split("."),n=Math.min(e.length,i.length);for(let s=0;s<n;++s){const A=parseInt(e[s],10),t=parseInt(i[s],10);if(A>t)return 1;if(A<t)return-1;if(s===n-1&&A===t)return 0}return""===A&&""!==t?-1:""===t?1:e.length==i.length?0:e.length<i.length?-1:1}function Cs(A){for(const t of A)t.target.handleResize(t)}function Fs(A){for(const t of A)t.target.handleVisibilityChanged(t)}let ys=null;const bs=()=>(ys||(ys=new ResizeObserver(Cs)),ys);let Es=null;const Hs=()=>(Es||(Es=new IntersectionObserver(Fs,{root:null,rootMargin:"0px"})),Es);function Is(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=document.createElement("canvas");n.width=A,n.height=t;const s=n.getContext("2d");null==s||s.fillRect(0,0,n.width,n.height),i&&s&&(s.beginPath(),s.arc(A/2,t/2,50,0,2*Math.PI,!0),s.closePath(),s.fillStyle="grey",s.fill());const r=n.captureStream(),[o]=r.getTracks();if(!o)throw Error("Could not get empty media stream video track");return o.enabled=e,o}let ks;function Ts(){if(!ks){const A=new AudioContext,t=A.createOscillator(),e=A.createGain();e.gain.setValueAtTime(0,0);const i=A.createMediaStreamDestination();if(t.connect(e),e.connect(i),t.start(),[ks]=i.stream.getAudioTracks(),!ks)throw Error("Could not get empty media stream audio track");ks.enabled=!1}return ks.clone()}class Ss{constructor(A,t){this.onFinally=t,this.promise=new Promise(((t,e)=>Ze(this,void 0,void 0,(function*(){this.resolve=t,this.reject=e,A&&(yield A(t,e))})))).finally((()=>{var A;return null===(A=this.onFinally)||void 0===A?void 0:A.call(this)}))}}function Ks(A){if("string"==typeof A||"number"==typeof A)return A;if(Array.isArray(A))return A[0];if(A.exact)return Array.isArray(A.exact)?A.exact[0]:A.exact;if(A.ideal)return Array.isArray(A.ideal)?A.ideal[0]:A.ideal;throw Error("could not unwrap constraint")}function Os(A){return A.startsWith("ws")?A.replace(/^(ws)/,"http"):A}function Ds(A){switch(A.reason){case dn.LeaveRequest:return A.context;case dn.Cancelled:return WA.CLIENT_INITIATED;case dn.NotAllowed:return WA.USER_REJECTED;case dn.ServerUnreachable:return WA.JOIN_FAILURE;default:return WA.UNKNOWN_REASON}}function Ms(A){return void 0!==A?Number(A):void 0}function Ls(A){return void 0!==A?BigInt(A):void 0}function Rs(A){return!!A&&!(A instanceof MediaStreamTrack)&&A.isLocal}function Ns(A){return!!A&&A.kind==Xn.Kind.Audio}function Gs(A){return!!A&&A.kind==Xn.Kind.Video}function xs(A){return Rs(A)&&Gs(A)}function Vs(A){return Rs(A)&&Ns(A)}function js(A){return!!A&&!A.isLocal}function Ps(A){return!!A&&!A.isLocal}function _s(A){return js(A)&&Gs(A)}function Js(A,t,e){var i,n,s,r;const{optionsWithoutProcessor:o,audioProcessor:a,videoProcessor:c}=tr(null!=A?A:{}),h=null==t?void 0:t.processor,u=null==e?void 0:e.processor,l=null!=o?o:{};return!0===l.audio&&(l.audio={}),!0===l.video&&(l.video={}),l.audio&&(Xs(l.audio,t),null!==(i=(s=l.audio).deviceId)&&void 0!==i||(s.deviceId={ideal:"default"}),(a||h)&&(l.audio.processor=null!=a?a:h)),l.video&&(Xs(l.video,e),null!==(n=(r=l.video).deviceId)&&void 0!==n||(r.deviceId={ideal:"default"}),(c||u)&&(l.video.processor=null!=c?c:u)),l}function Xs(A,t){return Object.keys(t).forEach((e=>{void 0===A[e]&&(A[e]=t[e])})),A}function Ys(A){var t,e,i,n;const s={};if(A.video)if("object"==typeof A.video){const e={},n=e,r=A.video;Object.keys(r).forEach((A=>{"resolution"===A?Xs(n,r.resolution):n[A]=r[A]})),s.video=e,null!==(t=(i=s.video).deviceId)&&void 0!==t||(i.deviceId={ideal:"default"})}else s.video=!!A.video&&{deviceId:{ideal:"default"}};else s.video=!1;return A.audio?"object"==typeof A.audio?(s.audio=A.audio,null!==(e=(n=s.audio).deviceId)&&void 0!==e||(n.deviceId={ideal:"default"})):s.audio={deviceId:{ideal:"default"}}:s.audio=!1,s}function Zs(){var A;const t="undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext);if(t){const e=new t({latencyHint:"interactive"});if("suspended"===e.state&&"undefined"!=typeof window&&(null===(A=window.document)||void 0===A?void 0:A.body)){const A=()=>Ze(this,void 0,void 0,(function*(){var t;try{"suspended"===e.state&&(yield e.resume())}catch(i){console.warn("Error trying to auto-resume audio context",i)}null===(t=window.document.body)||void 0===t||t.removeEventListener("click",A)}));window.document.body.addEventListener("click",A)}return e}}function Ws(A){return"audioinput"===A?Xn.Source.Microphone:"videoinput"===A?Xn.Source.Camera:Xn.Source.Unknown}function qs(A){return A===Xn.Source.Microphone?"audioinput":A===Xn.Source.Camera?"videoinput":void 0}function zs(A){return A.split("/")[1].toLowerCase()}function $s(A){const t=[];return A.forEach((A=>{void 0!==A.track&&t.push(new Wt({cid:A.track.mediaStreamID,track:A.trackInfo}))})),t}function Ar(A){return"mediaStreamTrack"in A?{trackID:A.sid,source:A.source,muted:A.isMuted,enabled:A.mediaStreamTrack.enabled,kind:A.kind,streamID:A.mediaStreamID,streamTrackID:A.mediaStreamTrack.id}:{trackID:A.trackSid,enabled:A.isEnabled,muted:A.isMuted,trackInfo:Object.assign({mimeType:A.mimeType,name:A.trackName,encrypted:A.isEncrypted,kind:A.kind,source:A.source},A.track?Ar(A.track):{})}}function tr(A){const t=Object.assign({},A);let e,i;return"object"==typeof t.audio&&t.audio.processor&&(e=t.audio.processor,t.audio=Object.assign(Object.assign({},t.audio),{processor:void 0})),"object"==typeof t.video&&t.video.processor&&(i=t.video.processor,t.video=Object.assign(Object.assign({},t.video),{processor:void 0})),{audioProcessor:e,videoProcessor:i,optionsWithoutProcessor:(n=t,void 0===n?n:"function"==typeof structuredClone?structuredClone(n):JSON.parse(JSON.stringify(n)))};var n}class er extends $e.EventEmitter{constructor(A){super(),this.onWorkerMessage=A=>{var t,e;const{kind:i,data:n}=A.data;switch(i){case"error":Pe.error(n.error.message),this.emit(hn.EncryptionError,n.error);break;case"initAck":n.enabled&&this.keyProvider.getKeys().forEach((A=>{this.postKey(A)}));break;case"enable":if(n.enabled&&this.keyProvider.getKeys().forEach((A=>{this.postKey(A)})),this.encryptionEnabled!==n.enabled&&n.participantIdentity===(null===(t=this.room)||void 0===t?void 0:t.localParticipant.identity))this.emit(hn.ParticipantEncryptionStatusChanged,n.enabled,this.room.localParticipant),this.encryptionEnabled=n.enabled;else if(n.participantIdentity){const A=null===(e=this.room)||void 0===e?void 0:e.getParticipantByIdentity(n.participantIdentity);if(!A)throw TypeError("couldn't set encryption status, participant not found".concat(n.participantIdentity));this.emit(hn.ParticipantEncryptionStatusChanged,n.enabled,A)}break;case"ratchetKey":this.keyProvider.emit(on.KeyRatcheted,n.ratchetResult,n.participantIdentity,n.keyIndex)}},this.onWorkerError=A=>{Pe.error("e2ee worker encountered an error:",{error:A.error}),this.emit(hn.EncryptionError,A.error)},this.keyProvider=A.keyProvider,this.worker=A.worker,this.encryptionEnabled=!1}setup(A){if(!(void 0!==window.RTCRtpSender&&void 0!==window.RTCRtpSender.prototype.createEncodedStreams||En()))throw new kn("tried to setup end-to-end encryption on an unsupported browser");if(Pe.info("setting up e2ee"),A!==this.room){this.room=A,this.setupEventListeners(A,this.keyProvider);const t={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:Je.getLevel()}};this.worker&&(Pe.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(t))}}setParticipantCryptorEnabled(A,t){Pe.debug("set e2ee to ".concat(A," for participant ").concat(t)),this.postEnable(A,t)}setSifTrailer(A){A&&0!==A.length?this.postSifTrailer(A):Pe.warn("ignoring server sent trailer as it's empty")}setupEngine(A){A.on(Cn.RTPVideoMapUpdate,(A=>{this.postRTPMap(A)}))}setupEventListeners(A,t){A.on(vn.TrackPublished,((A,t)=>this.setParticipantCryptorEnabled(A.trackInfo.encryption!==ot.NONE,t.identity))),A.on(vn.ConnectionStateChanged,(t=>{t===po.Connected&&A.remoteParticipants.forEach((A=>{A.trackPublications.forEach((t=>{this.setParticipantCryptorEnabled(t.trackInfo.encryption!==ot.NONE,A.identity)}))}))})).on(vn.TrackUnsubscribed,((A,t,e)=>{var i;const n={kind:"removeTransform",data:{participantIdentity:e.identity,trackId:A.mediaStreamID}};null===(i=this.worker)||void 0===i||i.postMessage(n)})).on(vn.TrackSubscribed,((A,t,e)=>{this.setupE2EEReceiver(A,e.identity,t.trackInfo)})).on(vn.SignalConnected,(()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");t.getKeys().forEach((A=>{this.postKey(A)})),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)})),A.localParticipant.on(pn.LocalTrackPublished,(A=>Ze(this,void 0,void 0,(function*(){this.setupE2EESender(A.track,A.track.sender)})))),t.on(on.SetKey,(A=>this.postKey(A))).on(on.RatchetRequest,((A,t)=>this.postRatchetRequest(A,t)))}postRatchetRequest(A,t){if(!this.worker)throw Error("could not ratchet key, worker is missing");const e={kind:"ratchetRequest",data:{participantIdentity:A,keyIndex:t}};this.worker.postMessage(e)}postKey(A){let{key:t,participantIdentity:e,keyIndex:i}=A;var n;if(!this.worker)throw Error("could not set key, worker is missing");const s={kind:"setKey",data:{participantIdentity:e,isPublisher:e===(null===(n=this.room)||void 0===n?void 0:n.localParticipant.identity),key:t,keyIndex:i}};this.worker.postMessage(s)}postEnable(A,t){if(!this.worker)throw new ReferenceError("failed to enable e2ee, worker is not ready");{const e={kind:"enable",data:{enabled:A,participantIdentity:t}};this.worker.postMessage(e)}}postRTPMap(A){var t;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(null===(t=this.room)||void 0===t?void 0:t.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const e={kind:"setRTPMap",data:{map:A,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(e)}postSifTrailer(A){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const t={kind:"setSifTrailer",data:{trailer:A}};this.worker.postMessage(t)}setupE2EEReceiver(A,t,e){if(A.receiver){if(!(null==e?void 0:e.mimeType)||""===e.mimeType)throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(A.receiver,A.mediaStreamID,t,"video"===A.kind?zs(e.mimeType):void 0)}}setupE2EESender(A,t){Rs(A)&&t?this.handleSender(t,A.mediaStreamID,void 0):t||Pe.warn("early return because sender is not ready")}handleReceiver(A,t,e,i){return Ze(this,void 0,void 0,(function*(){if(this.worker){if(En()){const n={kind:"decode",participantIdentity:e,trackId:t,codec:i};A.transform=new RTCRtpScriptTransform(this.worker,n)}else{if(rn in A&&i){const A={kind:"updateCodec",data:{trackId:t,codec:i,participantIdentity:e}};return void this.worker.postMessage(A)}let n=A.writableStream,s=A.readableStream;if(!n||!s){const t=A.createEncodedStreams();A.writableStream=t.writable,n=t.writable,A.readableStream=t.readable,s=t.readable}const r={kind:"decode",data:{readableStream:s,writableStream:n,trackId:t,codec:i,participantIdentity:e}};this.worker.postMessage(r,[s,n])}A[rn]=!0}}))}handleSender(A,t,e){var i;if(!(rn in A)&&this.worker){if(!(null===(i=this.room)||void 0===i?void 0:i.localParticipant.identity)||""===this.room.localParticipant.identity)throw TypeError("local identity needs to be known in order to set up encrypted sender");if(En()){Pe.info("initialize script transform");const i={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:t,codec:e};A.transform=new RTCRtpScriptTransform(this.worker,i)}else{Pe.info("initialize encoded streams");const i=A.createEncodedStreams(),n={kind:"encode",data:{readableStream:i.readable,writableStream:i.writable,codec:e,trackId:t,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(n,[i.readable,i.writable])}A[rn]=!0}}}const ir="default";class nr{constructor(){this.uA=[]}static getInstance(){return void 0===this.instance&&(this.instance=new nr),this.instance}get previousDevices(){return this.uA}getDevices(A){return Ze(this,arguments,void 0,(function(A){var t=this;let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var i;if((null===(i=nr.userMediaPromiseMap)||void 0===i?void 0:i.size)>0){Pe.debug("awaiting getUserMedia promise");try{A?yield nr.userMediaPromiseMap.get(A):yield Promise.all(nr.userMediaPromiseMap.values())}catch(s){Pe.warn("error waiting for media permissons")}}let n=yield navigator.mediaDevices.enumerateDevices();if(e&&(!Bs()||!t.hasDeviceInUse(A))&&(0===n.filter((t=>t.kind===A)).length||n.some((t=>{const e=""===t.label,i=!A||t.kind===A;return e&&i})))){const t={video:"audioinput"!==A&&"audiooutput"!==A,audio:"videoinput"!==A&&{deviceId:{ideal:"default"}}},e=yield navigator.mediaDevices.getUserMedia(t);n=yield navigator.mediaDevices.enumerateDevices(),e.getTracks().forEach((A=>{A.stop()}))}return t.uA=n,A&&(n=n.filter((t=>t.kind===A))),n}()}))}normalizeDeviceId(A,t,e){return Ze(this,void 0,void 0,(function*(){if(t!==ir)return t;const i=yield this.getDevices(A),n=i.find((A=>A.deviceId===ir));if(!n)return void Pe.warn("could not reliably determine default device");const s=i.find((A=>A.deviceId!==ir&&A.groupId===(null!=e?e:n.groupId)));if(s)return null==s?void 0:s.deviceId;Pe.warn("could not reliably determine default device")}))}hasDeviceInUse(A){return A?nr.userMediaPromiseMap.has(A):nr.userMediaPromiseMap.size>0}}var sr,rr;nr.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],nr.userMediaPromiseMap=new Map,(rr=sr||(sr={}))[rr.WAITING=0]="WAITING",rr[rr.RUNNING=1]="RUNNING",rr[rr.COMPLETED=2]="COMPLETED";class or{constructor(){this.pendingTasks=new Map,this.taskMutex=new c,this.nextTaskIndex=0}run(A){return Ze(this,void 0,void 0,(function*(){const t={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:sr.WAITING};this.pendingTasks.set(t.id,t);const e=yield this.taskMutex.lock();try{return t.executedAt=Date.now(),t.status=sr.RUNNING,yield A()}finally{t.status=sr.COMPLETED,this.pendingTasks.delete(t.id),e()}}))}flush(){return Ze(this,void 0,void 0,(function*(){return this.run((()=>Ze(this,void 0,void 0,(function*(){}))))}))}snapshot(){return Array.from(this.pendingTasks.values())}}function ar(A,t){return A.pathname="".concat(function(A){return A.endsWith("/")?A:"".concat(A,"/")}(A.pathname)).concat(t),A.toString()}const cr=["syncState","trickle","offer","answer","simulate","leave"];var hr,ur;(ur=hr||(hr={}))[ur.CONNECTING=0]="CONNECTING",ur[ur.CONNECTED=1]="CONNECTED",ur[ur.RECONNECTING=2]="RECONNECTING",ur[ur.DISCONNECTING=3]="DISCONNECTING",ur[ur.DISCONNECTED=4]="DISCONNECTED";class lr{get currentState(){return this.state}get isDisconnected(){return this.state===hr.DISCONNECTING||this.state===hr.DISCONNECTED}get isEstablishingConnection(){return this.state===hr.CONNECTING||this.state===hr.RECONNECTING}getNextRequestId(){return this.lA+=1,this.lA}constructor(){let A=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var e;this.rtt=0,this.state=hr.DISCONNECTED,this.log=Pe,this.lA=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=_e(null!==(e=t.loggerName)&&void 0!==e?e:Ge.Signal),this.loggerContextCb=t.loggerContextCb,this.useJSON=A,this.requestQueue=new or,this.queuedRequests=[],this.closingLock=new c,this.connectionLock=new c,this.state=hr.DISCONNECTED}get logContext(){var A,t;return null!==(t=null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this))&&void 0!==t?t:{}}join(A,t,e,i){return Ze(this,void 0,void 0,(function*(){return this.state=hr.CONNECTING,this.options=e,yield this.connect(A,t,e,i)}))}reconnect(A,t,e,i){return Ze(this,void 0,void 0,(function*(){if(this.options)return this.state=hr.RECONNECTING,this.clearPingInterval(),yield this.connect(A,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:e,reconnectReason:i}));this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext)}))}connect(A,t,e,i){this.connectOptions=e;const n=function(A,t,e){var i;const n=new URLSearchParams;return n.set("access_token",A),e.reconnect&&(n.set("reconnect","1"),e.sid&&n.set("sid",e.sid)),n.set("auto_subscribe",e.autoSubscribe?"1":"0"),n.set("sdk",gs()?"reactnative":"js"),n.set("version",t.version),n.set("protocol",t.protocol.toString()),t.deviceModel&&n.set("device_model",t.deviceModel),t.os&&n.set("os",t.os),t.osVersion&&n.set("os_version",t.osVersion),t.browser&&n.set("browser",t.browser),t.browserVersion&&n.set("browser_version",t.browserVersion),e.adaptiveStream&&n.set("adaptive_stream","1"),e.reconnectReason&&n.set("reconnect_reason",e.reconnectReason.toString()),(null===(i=navigator.connection)||void 0===i?void 0:i.type)&&n.set("network",navigator.connection.type),n}(t,function(){var A;const t=new Et({sdk:Ht.JS,protocol:16,version:"2.13.0"});return gs()&&(t.os=null!==(A=ms())&&void 0!==A?A:""),t}(),e),s=function(A,t){const e=new URL(function(A){return A.startsWith("http")?A.replace(/^(http)/,"ws"):A}(A));return t.forEach(((A,t)=>{e.searchParams.set(t,A)})),ar(e,"rtc")}(A,n),r=ar(new URL(Os(s)),"validate");return new Promise(((A,t)=>Ze(this,void 0,void 0,(function*(){const n=yield this.connectionLock.lock();try{const n=()=>Ze(this,void 0,void 0,(function*(){this.close(),clearTimeout(o),t(new In("room connection has been cancelled (signal)",dn.Cancelled))})),o=setTimeout((()=>{this.close(),t(new In("room connection has timed out (signal)",dn.ServerUnreachable))}),e.websocketTimeout);(null==i?void 0:i.aborted)&&n(),null==i||i.addEventListener("abort",n);const a=new URL(s);a.searchParams.has("access_token")&&a.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(a),Object.assign({reconnect:e.reconnect,reconnectReason:e.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(s),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(o)},this.ws.onerror=A=>Ze(this,void 0,void 0,(function*(){if(this.state===hr.CONNECTED)this.handleWSError(A);else{this.state=hr.DISCONNECTED,clearTimeout(o);try{const e=yield fetch(r);if(e.status.toFixed(0).startsWith("4")){const A=yield e.text();t(new In(A,dn.NotAllowed,e.status))}else t(new In("Encountered unknown websocket error during connection: ".concat(A.toString()),dn.InternalError,e.status))}catch(e){t(new In(e instanceof Error?e.message:"server was not reachable",dn.ServerUnreachable))}}})),this.ws.onmessage=s=>Ze(this,void 0,void 0,(function*(){var r,o,a;let c;if("string"==typeof s.data){const A=JSON.parse(s.data);c=jt.fromJson(A,{ignoreUnknownFields:!0})}else{if(!(s.data instanceof ArrayBuffer))return void this.log.error("could not decode websocket message: ".concat(typeof s.data),this.logContext);c=jt.fromBinary(new Uint8Array(s.data))}if(this.state!==hr.CONNECTED){let s=!1;if("join"===(null===(r=c.message)||void 0===r?void 0:r.case)?(this.state=hr.CONNECTED,null==i||i.removeEventListener("abort",n),this.pingTimeoutDuration=c.message.value.pingTimeout,this.pingIntervalDuration=c.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),A(c.message.value)):this.state===hr.RECONNECTING&&"leave"!==c.message.case?(this.state=hr.CONNECTED,null==i||i.removeEventListener("abort",n),this.startPingInterval(),"reconnect"===(null===(o=c.message)||void 0===o?void 0:o.case)?A(c.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),A(void 0),s=!0)):this.isEstablishingConnection&&"leave"===c.message.case?t(new In("Received leave request while trying to (re)connect",dn.LeaveRequest,void 0,c.message.value.reason)):e.reconnect||t(new In("did not receive join response, got ".concat(null===(a=c.message)||void 0===a?void 0:a.case," instead"),dn.InternalError)),!s)return}this.signalLatency&&(yield as(this.signalLatency)),this.handleSignalResponse(c)})),this.ws.onclose=A=>{this.isEstablishingConnection&&t(new In("Websocket got closed during a (re)connection attempt",dn.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:A.reason,code:A.code,wasClean:A.wasClean,state:this.state})),this.handleOnClose(A.reason)}}finally{n()}}))))}close(){return Ze(this,arguments,void 0,(function(){var A=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){const e=yield A.closingLock.lock();try{if(A.clearPingInterval(),t&&(A.state=hr.DISCONNECTING),A.ws){A.ws.onmessage=null,A.ws.onopen=null,A.ws.onclose=null;const t=new Promise((t=>{A.ws?A.ws.onclose=()=>{t()}:t()}));A.ws.readyState<A.ws.CLOSING&&(A.ws.close(),yield Promise.race([t,as(250)])),A.ws=void 0}}finally{t&&(A.state=hr.DISCONNECTED),e()}}()}))}sendOffer(A){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:A.sdp})),this.sendRequest({case:"offer",value:Br(A)})}sendAnswer(A){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:A.sdp})),this.sendRequest({case:"answer",value:Br(A)})}sendIceCandidate(A,t){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:A})),this.sendRequest({case:"trickle",value:new Jt({candidateInit:JSON.stringify(A),target:t})})}sendMuteTrack(A,t){return this.sendRequest({case:"mute",value:new Xt({sid:A,muted:t})})}sendAddTrack(A){return this.sendRequest({case:"addTrack",value:A})}sendUpdateLocalMetadata(A,t){return Ze(this,arguments,void 0,(function(A,t){var e=this;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){const n=e.getNextRequestId();return yield e.sendRequest({case:"updateMetadata",value:new oe({requestId:n,metadata:A,name:t,attributes:i})}),n}()}))}sendUpdateTrackSettings(A){this.sendRequest({case:"trackSetting",value:A})}sendUpdateSubscription(A){return this.sendRequest({case:"subscription",value:A})}sendSyncState(A){return this.sendRequest({case:"syncState",value:A})}sendUpdateVideoLayers(A,t){return this.sendRequest({case:"updateLayers",value:new re({trackSid:A,layers:t})})}sendUpdateSubscriptionPermissions(A,t){return this.sendRequest({case:"subscriptionPermission",value:new ve({allParticipants:A,trackPermissions:t})})}sendSimulateScenario(A){return this.sendRequest({case:"simulate",value:A})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:I.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new ye({timestamp:I.parse(Date.now()),rtt:I.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(A,t){return this.sendRequest({case:"updateAudioTrack",value:new ee({trackSid:A,features:t})})}sendLeave(){return this.sendRequest({case:"leave",value:new ne({reason:WA.CLIENT_INITIATED,action:se.DISCONNECT})})}sendRequest(A){return Ze(this,arguments,void 0,(function(A){var t=this;let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){const i=!e&&!function(A){const t=cr.indexOf(A.case)>=0;return Pe.trace("request allowed to bypass queue:",{canPass:t,req:A}),t}(A);if(i&&t.state===hr.RECONNECTING)return void t.queuedRequests.push((()=>Ze(t,void 0,void 0,(function*(){yield this.sendRequest(A,!0)}))));if(e||(yield t.requestQueue.flush()),t.signalLatency&&(yield as(t.signalLatency)),!t.ws||t.ws.readyState!==t.ws.OPEN)return void t.log.error("cannot send signal request before connected, type: ".concat(null==A?void 0:A.case),t.logContext);const n=new Vt({message:A});try{t.useJSON?t.ws.send(n.toJsonString()):t.ws.send(n.toBinary())}catch(s){t.log.error("error sending signal message",Object.assign(Object.assign({},t.logContext),{error:s}))}}()}))}handleSignalResponse(A){var t,e;const i=A.message;if(null==i)return void this.log.debug("received unsupported message",this.logContext);let n=!1;if("answer"===i.case){const A=dr(i.value);this.onAnswer&&this.onAnswer(A)}else if("offer"===i.case){const A=dr(i.value);this.onOffer&&this.onOffer(A)}else if("trickle"===i.case){const A=JSON.parse(i.value.candidateInit);this.onTrickle&&this.onTrickle(A,i.value.target)}else"update"===i.case?this.onParticipantUpdate&&this.onParticipantUpdate(null!==(t=i.value.participants)&&void 0!==t?t:[]):"trackPublished"===i.case?this.onLocalTrackPublished&&this.onLocalTrackPublished(i.value):"speakersChanged"===i.case?this.onSpeakersChanged&&this.onSpeakersChanged(null!==(e=i.value.speakers)&&void 0!==e?e:[]):"leave"===i.case?this.onLeave&&this.onLeave(i.value):"mute"===i.case?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(i.value.sid,i.value.muted):"roomUpdate"===i.case?this.onRoomUpdate&&i.value.room&&this.onRoomUpdate(i.value.room):"connectionQuality"===i.case?this.onConnectionQuality&&this.onConnectionQuality(i.value):"streamStateUpdate"===i.case?this.onStreamStateUpdate&&this.onStreamStateUpdate(i.value):"subscribedQualityUpdate"===i.case?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(i.value):"subscriptionPermissionUpdate"===i.case?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(i.value):"refreshToken"===i.case?this.onTokenRefresh&&this.onTokenRefresh(i.value):"trackUnpublished"===i.case?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(i.value):"subscriptionResponse"===i.case?this.onSubscriptionError&&this.onSubscriptionError(i.value):"pong"===i.case||("pongResp"===i.case?(this.rtt=Date.now()-Number.parseInt(i.value.lastPingTimestamp.toString()),this.resetPingTimeout(),n=!0):"requestResponse"===i.case?this.onRequestResponse&&this.onRequestResponse(i.value):"trackSubscribed"===i.case?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(i.value.trackSid):"roomMoved"===i.case?(this.onTokenRefresh&&this.onTokenRefresh(i.value.token),this.onRoomMoved&&this.onRoomMoved(i.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:i.case})));n||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const A=this.queuedRequests.shift();A&&this.requestQueue.run(A)}}handleOnClose(A){return Ze(this,void 0,void 0,(function*(){if(this.state===hr.DISCONNECTED)return;const t=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(A),Object.assign(Object.assign({},this.logContext),{reason:A})),t&&t(A)}))}handleWSError(A){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:A}))}resetPingTimeout(){this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=jn.setTimeout((()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-1e3*this.pingTimeoutDuration).toUTCString()),this.logContext),this.handleOnClose("ping timeout")}),1e3*this.pingTimeoutDuration):this.log.warn("ping timeout duration not set",this.logContext)}clearPingTimeout(){this.pingTimeout&&jn.clearTimeout(this.pingTimeout)}startPingInterval(){this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(this.log.debug("start ping interval",this.logContext),this.pingInterval=jn.setInterval((()=>{this.sendPing()}),1e3*this.pingIntervalDuration)):this.log.warn("ping interval duration not set",this.logContext)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&jn.clearInterval(this.pingInterval)}}function dr(A){const t={type:"offer",sdp:A.sdp};switch(A.type){case"answer":case"offer":case"pranswer":case"rollback":t.type=A.type}return t}function Br(A){return new zt({sdp:A.sdp,type:A.type})}var wr,fr,gr,Qr,vr,mr={},pr={},Ur={exports:{}};function Cr(){if(wr)return Ur.exports;wr=1;var A=Ur.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(A){return A.encoding?"rtpmap:%d %s/%s/%s":A.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(A){return null!=A.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(A){return null!=A.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(A){return"extmap:%d"+(A.direction?"/%s":"%v")+(A["encrypt-uri"]?" %s":"%v")+" %s"+(A.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(A){return null!=A.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(A){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=A.raddr?" raddr %s rport %d":"%v%v",t+=null!=A.tcptype?" tcptype %s":"%v",null!=A.generation&&(t+=" generation %d"),(t+=null!=A["network-id"]?" network-id %d":"%v")+(null!=A["network-cost"]?" network-cost %d":"%v")}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(A){var t="ssrc:%d";return null!=A.attribute&&(t+=" %s",null!=A.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(A){return null!=A.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(A){return A.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(A){return"imageattr:%s %s %s"+(A.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(A){return"simulcast:%s %s"+(A.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(A){return"ts-refclk:%s"+(null!=A.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(A){var t="mediaclk:";return t+=null!=A.id?"id=%s %s":"%v%s",t+=null!=A.mediaClockValue?"=%s":"",(t+=null!=A.rateNumerator?" rate=%s":"")+(null!=A.rateDenominator?"/%s":"")}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(A).forEach((function(t){A[t].forEach((function(A){A.reg||(A.reg=/(.*)/),A.format||(A.format="%s")}))})),Ur.exports}function Fr(){if(Qr)return gr;Qr=1;var A=Cr(),t=/%[sdv%]/g,e=function(A){var e=1,i=arguments,n=i.length;return A.replace(t,(function(A){if(e>=n)return A;var t=i[e];switch(e+=1,A){case"%%":return"%";case"%s":return String(t);case"%d":return Number(t);case"%v":return""}}))},i=function(A,t,i){var n=[A+"="+(t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format)];if(t.names)for(var s=0;s<t.names.length;s+=1){var r=t.names[s];t.name?n.push(i[t.name][r]):n.push(i[t.names[s]])}else n.push(i[t.name]);return e.apply(null,n)},n=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];return gr=function(t,e){e=e||{},null==t.version&&(t.version=0),null==t.name&&(t.name=" "),t.media.forEach((function(A){null==A.payloads&&(A.payloads="")}));var r=e.outerOrder||n,o=e.innerOrder||s,a=[];return r.forEach((function(e){A[e].forEach((function(A){A.name in t&&null!=t[A.name]?a.push(i(e,A,t)):A.push in t&&null!=t[A.push]&&t[A.push].forEach((function(t){a.push(i(e,A,t))}))}))})),t.media.forEach((function(t){a.push(i("m",A.m[0],t)),o.forEach((function(e){A[e].forEach((function(A){A.name in t&&null!=t[A.name]?a.push(i(e,A,t)):A.push in t&&null!=t[A.push]&&t[A.push].forEach((function(t){a.push(i(e,A,t))}))}))}))})),a.join("\r\n")+"\r\n"}}var yr=function(){if(vr)return mr;vr=1;var A=(fr||(fr=1,function(A){var t=function(A){return String(Number(A))===A?Number(A):A},e=function(A,e,i){var n=A.name&&A.names;A.push&&!e[A.push]?e[A.push]=[]:n&&!e[A.name]&&(e[A.name]={});var s=A.push?{}:n?e[A.name]:e;!function(A,e,i,n){if(n&&!i)e[n]=t(A[1]);else for(var s=0;s<i.length;s+=1)null!=A[s+1]&&(e[i[s]]=t(A[s+1]))}(i.match(A.reg),s,A.names,A.name),A.push&&e[A.push].push(s)},i=Cr(),n=RegExp.prototype.test.bind(/^([a-z])=(.*)/);A.parse=function(A){var t={},s=[],r=t;return A.split(/(\r\n|\r|\n)/).filter(n).forEach((function(A){var t=A[0],n=A.slice(2);"m"===t&&(s.push({rtp:[],fmtp:[]}),r=s[s.length-1]);for(var o=0;o<(i[t]||[]).length;o+=1){var a=i[t][o];if(a.reg.test(n))return e(a,r,n)}})),t.media=s,t};var s=function(A,e){var i=e.split(/=(.+)/,2);return 2===i.length?A[i[0]]=t(i[1]):1===i.length&&e.length>1&&(A[i[0]]=void 0),A};A.parseParams=function(A){return A.split(/;\s?/).reduce(s,{})},A.parseFmtpConfig=A.parseParams,A.parsePayloads=function(A){return A.toString().split(" ").map(Number)},A.parseRemoteCandidates=function(A){for(var e=[],i=A.split(" ").map(t),n=0;n<i.length;n+=3)e.push({component:i[n],ip:i[n+1],port:i[n+2]});return e},A.parseImageAttributes=function(A){return A.split(" ").map((function(A){return A.substring(1,A.length-1).split(",").reduce(s,{})}))},A.parseSimulcastStreamList=function(A){return A.split(";").map((function(A){return A.split(",").map((function(A){var e,i=!1;return"~"!==A[0]?e=t(A):(e=t(A.substring(1,A.length)),i=!0),{scid:e,paused:i}}))}))}}(pr)),pr),t=Fr(),e=Cr();return mr.grammar=e,mr.write=t,mr.parse=A.parse,mr.parseParams=A.parseParams,mr.parseFmtpConfig=A.parseFmtpConfig,mr.parsePayloads=A.parsePayloads,mr.parseRemoteCandidates=A.parseRemoteCandidates,mr.parseImageAttributes=A.parseImageAttributes,mr.parseSimulcastStreamList=A.parseSimulcastStreamList,mr}();function br(A,t,e){var i,n,s;void 0===t&&(t=50),void 0===e&&(e={});var r=null!=(i=e.isImmediate)&&i,o=null!=(n=e.callback)&&n,a=e.maxWait,c=Date.now(),h=[],u=function(){var e=[].slice.call(arguments),i=this;return new Promise((function(n,u){var l=r&&void 0===s;if(void 0!==s&&clearTimeout(s),s=setTimeout((function(){if(s=void 0,c=Date.now(),!r){var t=A.apply(i,e);o&&o(t),h.forEach((function(A){return(0,A.resolve)(t)})),h=[]}}),function(){if(void 0!==a){var A=Date.now()-c;if(A+t>=a)return a-A}return t}()),l){var d=A.apply(i,e);return o&&o(d),n(d)}h.push({resolve:n,reject:u})}))};return u.cancel=function(A){void 0!==s&&clearTimeout(s),h.forEach((function(t){return(0,t.reject)(A)})),h=[]},u}const Er="negotiationStarted",Hr="negotiationComplete",Ir="rtpVideoPayloadTypes";class kr extends $e.EventEmitter{get pc(){return this.J||(this.J=this.createPC()),this.J}constructor(A){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var e;super(),this.log=Pe,this.ddExtID=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=br((A=>Ze(this,void 0,void 0,(function*(){this.emit(Er);try{yield this.createAndSendOffer()}catch(t){if(!A)throw t;A(t)}}))),20),this.close=()=>{this.J&&(this.J.close(),this.J.onconnectionstatechange=null,this.J.oniceconnectionstatechange=null,this.J.onicegatheringstatechange=null,this.J.ondatachannel=null,this.J.onnegotiationneeded=null,this.J.onsignalingstatechange=null,this.J.onicecandidate=null,this.J.ondatachannel=null,this.J.ontrack=null,this.J.onconnectionstatechange=null,this.J.oniceconnectionstatechange=null,this.J=null)},this.log=_e(null!==(e=t.loggerName)&&void 0!==e?e:Ge.PCTransport),this.loggerOptions=t,this.config=A,this.J=this.createPC()}createPC(){const A=new RTCPeerConnection(this.config);return A.onicecandidate=A=>{var t;A.candidate&&(null===(t=this.onIceCandidate)||void 0===t||t.call(this,A.candidate))},A.onicecandidateerror=A=>{var t;null===(t=this.onIceCandidateError)||void 0===t||t.call(this,A)},A.oniceconnectionstatechange=()=>{var t;null===(t=this.onIceConnectionStateChange)||void 0===t||t.call(this,A.iceConnectionState)},A.onsignalingstatechange=()=>{var t;null===(t=this.onSignalingStatechange)||void 0===t||t.call(this,A.signalingState)},A.onconnectionstatechange=()=>{var t;null===(t=this.onConnectionStateChange)||void 0===t||t.call(this,A.connectionState)},A.ondatachannel=A=>{var t;null===(t=this.onDataChannel)||void 0===t||t.call(this,A)},A.ontrack=A=>{var t;null===(t=this.onTrack)||void 0===t||t.call(this,A)},A}get logContext(){var A,t;return Object.assign({},null===(t=(A=this.loggerOptions).loggerContextCb)||void 0===t?void 0:t.call(A))}get isICEConnected(){return null!==this.J&&("connected"===this.pc.iceConnectionState||"completed"===this.pc.iceConnectionState)}addIceCandidate(A){return Ze(this,void 0,void 0,(function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(A);this.pendingCandidates.push(A)}))}setRemoteDescription(A){return Ze(this,void 0,void 0,(function*(){var t;let e;if("offer"===A.type){let{stereoMids:t,nackMids:e}=function(A){var t;const e=[],i=[],n=yr.parse(null!==(t=A.sdp)&&void 0!==t?t:"");let s=0;return n.media.forEach((A=>{var t;"audio"===A.type&&(A.rtp.some((A=>"opus"===A.codec&&(s=A.payload,!0))),(null===(t=A.rtcpFb)||void 0===t?void 0:t.some((A=>A.payload===s&&"nack"===A.type)))&&i.push(A.mid),A.fmtp.some((t=>t.payload===s&&(t.config.includes("sprop-stereo=1")&&e.push(A.mid),!0))))})),{stereoMids:e,nackMids:i}}(A);this.remoteStereoMids=t,this.remoteNackMids=e}else if("answer"===A.type){const i=yr.parse(null!==(t=A.sdp)&&void 0!==t?t:"");i.media.forEach((A=>{"audio"===A.type&&this.trackBitrates.some((t=>{if(!t.transceiver||A.mid!=t.transceiver.mid)return!1;let e=0;if(A.rtp.some((A=>A.codec.toUpperCase()===t.codec.toUpperCase()&&(e=A.payload,!0))),0===e)return!0;let i=!1;for(const n of A.fmtp)if(n.payload===e){n.config=n.config.split(";").filter((A=>!A.includes("maxaveragebitrate"))).join(";"),t.maxbr>0&&(n.config+=";maxaveragebitrate=".concat(1e3*t.maxbr)),i=!0;break}return i||t.maxbr>0&&A.fmtp.push({payload:e,config:"maxaveragebitrate=".concat(1e3*t.maxbr)}),!0}))})),e=yr.write(i)}yield this.setMungedSDP(A,e,!0),this.pendingCandidates.forEach((A=>{this.pc.addIceCandidate(A)})),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):"answer"===A.type&&(this.emit(Hr),A.sdp)&&yr.parse(A.sdp).media.forEach((A=>{"video"===A.type&&this.emit(Ir,A.rtp)}))}))}createAndSendOffer(A){return Ze(this,void 0,void 0,(function*(){var t;if(void 0===this.onOffer)return;if((null==A?void 0:A.iceRestart)&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this.J&&"have-local-offer"===this.J.signalingState){const t=this.J.remoteDescription;if(!(null==A?void 0:A.iceRestart)||!t)return void(this.renegotiate=!0);yield this.J.setRemoteDescription(t)}else if(!this.J||"closed"===this.J.signalingState)return void this.log.warn("could not createOffer with closed peer connection",this.logContext);this.log.debug("starting to negotiate",this.logContext);const e=yield this.pc.createOffer(A);this.log.debug("original offer",Object.assign({sdp:e.sdp},this.logContext));const i=yr.parse(null!==(t=e.sdp)&&void 0!==t?t:"");i.media.forEach((A=>{Sr(A),"audio"===A.type?Tr(A,[],[]):"video"===A.type&&this.trackBitrates.some((t=>{if(!A.msid||!t.cid||!A.msid.includes(t.cid))return!1;let e=0;if(A.rtp.some((A=>A.codec.toUpperCase()===t.codec.toUpperCase()&&(e=A.payload,!0))),0===e)return!0;if(us(t.codec)&&this.ensureVideoDDExtensionForSVC(A,i),"av1"!==t.codec)return!0;const n=Math.round(.7*t.maxbr);for(const i of A.fmtp)if(i.payload===e){i.config.includes("x-google-start-bitrate")||(i.config+=";x-google-start-bitrate=".concat(n));break}return!0}))})),yield this.setMungedSDP(e,yr.write(i)),this.onOffer(e)}))}createAndSetAnswer(){return Ze(this,void 0,void 0,(function*(){var A;const t=yield this.pc.createAnswer(),e=yr.parse(null!==(A=t.sdp)&&void 0!==A?A:"");return e.media.forEach((A=>{Sr(A),"audio"===A.type&&Tr(A,this.remoteStereoMids,this.remoteNackMids)})),yield this.setMungedSDP(t,yr.write(e)),t}))}createDataChannel(A,t){return this.pc.createDataChannel(A,t)}addTransceiver(A,t){return this.pc.addTransceiver(A,t)}addTrack(A){if(!this.J)throw new Kn("PC closed, cannot add track");return this.J.addTrack(A)}setTrackCodecBitrate(A){this.trackBitrates.push(A)}setConfiguration(A){var t;if(!this.J)throw new Kn("PC closed, cannot configure");return null===(t=this.J)||void 0===t?void 0:t.setConfiguration(A)}canRemoveTrack(){var A;return!!(null===(A=this.J)||void 0===A?void 0:A.removeTrack)}removeTrack(A){var t;return null===(t=this.J)||void 0===t?void 0:t.removeTrack(A)}getConnectionState(){var A,t;return null!==(t=null===(A=this.J)||void 0===A?void 0:A.connectionState)&&void 0!==t?t:"closed"}getICEConnectionState(){var A,t;return null!==(t=null===(A=this.J)||void 0===A?void 0:A.iceConnectionState)&&void 0!==t?t:"closed"}getSignallingState(){var A,t;return null!==(t=null===(A=this.J)||void 0===A?void 0:A.signalingState)&&void 0!==t?t:"closed"}getTransceivers(){var A,t;return null!==(t=null===(A=this.J)||void 0===A?void 0:A.getTransceivers())&&void 0!==t?t:[]}getSenders(){var A,t;return null!==(t=null===(A=this.J)||void 0===A?void 0:A.getSenders())&&void 0!==t?t:[]}getLocalDescription(){var A;return null===(A=this.J)||void 0===A?void 0:A.localDescription}getRemoteDescription(){var A;return null===(A=this.pc)||void 0===A?void 0:A.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return Ze(this,void 0,void 0,(function*(){var A;if(!this.J)return;let t="";const e=new Map,i=new Map;if((yield this.J.getStats()).forEach((A=>{switch(A.type){case"transport":t=A.selectedCandidatePairId;break;case"candidate-pair":""===t&&A.selected&&(t=A.id),e.set(A.id,A);break;case"remote-candidate":i.set(A.id,"".concat(A.address,":").concat(A.port))}})),""===t)return;const n=null===(A=e.get(t))||void 0===A?void 0:A.remoteCandidateId;return void 0!==n?i.get(n):void 0}))}setMungedSDP(A,t,e){return Ze(this,void 0,void 0,(function*(){if(t){const n=A.sdp;A.sdp=t;try{return this.log.debug("setting munged ".concat(e?"remote":"local"," description"),this.logContext),void(e?yield this.pc.setRemoteDescription(A):yield this.pc.setLocalDescription(A))}catch(i){this.log.warn("not able to set ".concat(A.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:i,sdp:t})),A.sdp=n}}try{e?yield this.pc.setRemoteDescription(A):yield this.pc.setLocalDescription(A)}catch(i){let t="unknown error";i instanceof Error?t=i.message:"string"==typeof i&&(t=i);const n={error:t,sdp:A.sdp};throw!e&&this.pc.remoteDescription&&(n.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(A.type),Object.assign(Object.assign({},this.logContext),{fields:n})),new On(t)}}))}ensureVideoDDExtensionForSVC(A,t){var e,i;if(!(null===(e=A.ext)||void 0===e?void 0:e.some((A=>A.uri===os)))){if(0===this.ddExtID){let A=0;t.media.forEach((t=>{var e;"video"===t.type&&(null===(e=t.ext)||void 0===e||e.forEach((t=>{t.value>A&&(A=t.value)})))})),this.ddExtID=A+1}null===(i=A.ext)||void 0===i||i.push({value:this.ddExtID,uri:os})}}}function Tr(A,t,e){let i=0;A.rtp.some((A=>"opus"===A.codec&&(i=A.payload,!0))),i>0&&(A.rtcpFb||(A.rtcpFb=[]),e.includes(A.mid)&&!A.rtcpFb.some((A=>A.payload===i&&"nack"===A.type))&&A.rtcpFb.push({payload:i,type:"nack"}),t.includes(A.mid)&&A.fmtp.some((A=>A.payload===i&&(A.config.includes("stereo=1")||(A.config+=";stereo=1"),!0))))}function Sr(A){if(A.connection){const t=A.connection.ip.indexOf(":")>=0;(4===A.connection.version&&t||6===A.connection.version&&!t)&&(A.connection.ip="0.0.0.0",A.connection.version=4)}}const Kr="vp8",Or={audioPreset:es.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:rs.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Kr,backupCodec:!0},Dr={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},Mr={deviceId:{ideal:"default"},resolution:ns.h720.resolution},Lr={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new class{constructor(A){this.dA=void 0!==A?[...A]:Ye}nextRetryDelayInMs(A){if(A.retryCount>=this.dA.length)return null;const t=this.dA[A.retryCount];return A.retryCount<=1?t:t+1e3*Math.random()}},disconnectOnPageLeave:!0,webAudioMix:!1},Rr={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var Nr,Gr;(Gr=Nr||(Nr={}))[Gr.NEW=0]="NEW",Gr[Gr.CONNECTING=1]="CONNECTING",Gr[Gr.CONNECTED=2]="CONNECTED",Gr[Gr.FAILED=3]="FAILED",Gr[Gr.CLOSING=4]="CLOSING",Gr[Gr.CLOSED=5]="CLOSED";class xr{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(A,t,e){var i;this.peerConnectionTimeout=Rr.peerConnectionTimeout,this.log=Pe,this.updateState=()=>{var A;const t=this.state,e=this.requiredTransports.map((A=>A.getConnectionState()));e.every((A=>"connected"===A))?this.state=Nr.CONNECTED:e.some((A=>"failed"===A))?this.state=Nr.FAILED:e.some((A=>"connecting"===A))?this.state=Nr.CONNECTING:e.every((A=>"closed"===A))?this.state=Nr.CLOSED:e.some((A=>"closed"===A))?this.state=Nr.CLOSING:e.every((A=>"new"===A))&&(this.state=Nr.NEW),t!==this.state&&(this.log.debug("pc state change: from ".concat(Nr[t]," to ").concat(Nr[this.state]),this.logContext),null===(A=this.onStateChange)||void 0===A||A.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=_e(null!==(i=e.loggerName)&&void 0!==i?i:Ge.PCManager),this.loggerOptions=e,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new kr(A,e),this.subscriber=new kr(A,e),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=A=>{var t;null===(t=this.onIceCandidate)||void 0===t||t.call(this,A,Nt.PUBLISHER)},this.subscriber.onIceCandidate=A=>{var t;null===(t=this.onIceCandidate)||void 0===t||t.call(this,A,Nt.SUBSCRIBER)},this.subscriber.onDataChannel=A=>{var t;null===(t=this.onDataChannel)||void 0===t||t.call(this,A)},this.subscriber.onTrack=A=>{var t;null===(t=this.onTrack)||void 0===t||t.call(this,A)},this.publisher.onOffer=A=>{var t;null===(t=this.onPublisherOffer)||void 0===t||t.call(this,A)},this.state=Nr.NEW,this.connectionLock=new c,this.remoteOfferLock=new c}get logContext(){var A,t;return Object.assign({},null===(t=(A=this.loggerOptions).loggerContextCb)||void 0===t?void 0:t.call(A))}requirePublisher(){let A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isPublisherConnectionRequired=A,this.updateState()}requireSubscriber(){let A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isSubscriberConnectionRequired=A,this.updateState()}createAndSendPublisherOffer(A){return this.publisher.createAndSendOffer(A)}setPublisherAnswer(A){return this.publisher.setRemoteDescription(A)}removeTrack(A){return this.publisher.removeTrack(A)}close(){return Ze(this,void 0,void 0,(function*(){if(this.publisher&&"closed"!==this.publisher.getSignallingState()){const t=this.publisher;for(const e of t.getSenders())try{t.canRemoveTrack()&&t.removeTrack(e)}catch(A){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:A}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()}))}triggerIceRestart(){return Ze(this,void 0,void 0,(function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))}))}addIceCandidate(A,t){return Ze(this,void 0,void 0,(function*(){t===Nt.PUBLISHER?yield this.publisher.addIceCandidate(A):yield this.subscriber.addIceCandidate(A)}))}createSubscriberAnswerFromOffer(A){return Ze(this,void 0,void 0,(function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:A.type,sdp:A.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const t=yield this.remoteOfferLock.lock();try{return yield this.subscriber.setRemoteDescription(A),yield this.subscriber.createAndSetAnswer()}finally{t()}}))}updateConfiguration(A,t){this.publisher.setConfiguration(A),this.subscriber.setConfiguration(A),t&&this.triggerIceRestart()}ensurePCTransportConnection(A,t){return Ze(this,void 0,void 0,(function*(){var e;const i=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&"connected"!==this.publisher.getConnectionState()&&"connecting"!==this.publisher.getConnectionState()&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all(null===(e=this.requiredTransports)||void 0===e?void 0:e.map((e=>this.ensureTransportConnected(e,A,t))))}finally{i()}}))}negotiate(A){return Ze(this,void 0,void 0,(function*(){return new Promise(((t,e)=>Ze(this,void 0,void 0,(function*(){const i=setTimeout((()=>{e("negotiation timed out")}),this.peerConnectionTimeout);A.signal.addEventListener("abort",(()=>{clearTimeout(i),e("negotiation aborted")})),this.publisher.once(Er,(()=>{A.signal.aborted||this.publisher.once(Hr,(()=>{clearTimeout(i),t()}))})),yield this.publisher.negotiate((A=>{clearTimeout(i),e(A)}))}))))}))}addPublisherTransceiver(A,t){return this.publisher.addTransceiver(A,t)}addPublisherTrack(A){return this.publisher.addTrack(A)}createPublisherDataChannel(A,t){return this.publisher.createDataChannel(A,t)}getConnectedAddress(A){return A===Nt.PUBLISHER||A===Nt.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const A=[];return this.isPublisherConnectionRequired&&A.push(this.publisher),this.isSubscriberConnectionRequired&&A.push(this.subscriber),A}ensureTransportConnected(A,t){return Ze(this,arguments,void 0,(function(A,t){var e=this;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.peerConnectionTimeout;return function*(){if("connected"!==A.getConnectionState())return new Promise(((A,n)=>Ze(e,void 0,void 0,(function*(){const e=()=>{this.log.warn("abort transport connection",this.logContext),jn.clearTimeout(s),n(new In("room connection has been cancelled",dn.Cancelled))};(null==t?void 0:t.signal.aborted)&&e(),null==t||t.signal.addEventListener("abort",e);const s=jn.setTimeout((()=>{null==t||t.signal.removeEventListener("abort",e),n(new In("could not establish pc connection",dn.InternalError))}),i);for(;this.state!==Nr.CONNECTED;)if(yield as(50),null==t?void 0:t.signal.aborted)return void n(new In("room connection has been cancelled",dn.Cancelled));jn.clearTimeout(s),null==t||t.signal.removeEventListener("abort",e),A()}))))}()}))}}class Vr extends Error{constructor(A,t,e){super(t),this.code=A,this.message=Pr(t,Vr.MAX_MESSAGE_BYTES),this.data=e?Pr(e,Vr.MAX_DATA_BYTES):void 0}static fromProto(A){return new Vr(A.code,A.message,A.data)}toProto(){return new Ct({code:this.code,message:this.message,data:this.data})}static builtIn(A,t){return new Vr(Vr.ErrorCode[A],Vr.ErrorMessage[A],t)}}function jr(A){return(new TextEncoder).encode(A).length}function Pr(A,t){if(jr(A)<=t)return A;let e=0,i=A.length;const n=new TextEncoder;for(;e<i;){const s=Math.floor((e+i+1)/2);n.encode(A.slice(0,s)).length<=t?e=s:i=s-1}return A.slice(0,e)}Vr.MAX_MESSAGE_BYTES=256,Vr.MAX_DATA_BYTES=15360,Vr.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404},Vr.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const _r=2e3;function Jr(A,t){if(!t)return 0;let e,i;return"bytesReceived"in A?(e=A.bytesReceived,i=t.bytesReceived):"bytesSent"in A&&(e=A.bytesSent,i=t.bytesSent),void 0===e||void 0===i||void 0===A.timestamp||void 0===t.timestamp?0:8*(e-i)*1e3/(A.timestamp-t.timestamp)}class Xr extends Xn{get sender(){return this.BA}set sender(A){this.BA=A}get constraints(){return this.wA}constructor(A,t,e){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];super(A,t,arguments.length>4?arguments[4]:void 0),this.manuallyStopped=!1,this.fA=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch((()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext))),this.debouncedTrackMuteHandler=br((()=>Ze(this,void 0,void 0,(function*(){yield this.pauseUpstream()}))),5e3),this.handleTrackUnmuteEvent=()=>Ze(this,void 0,void 0,(function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()})),this.handleEnded=()=>{this.isInBackground&&(this.reacquireTrack=!0),this.cA.removeEventListener("mute",this.handleTrackMuteEvent),this.cA.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit(yn.Ended,this)},this.reacquireTrack=!1,this.providedByUser=i,this.muteLock=new c,this.pauseUpstreamLock=new c,this.processorLock=new c,this.restartLock=new c,this.setMediaStreamTrack(A,!0),this.wA=A.getConstraints(),e&&(this.wA=e)}get id(){return this.cA.id}get dimensions(){if(this.kind!==Xn.Kind.Video)return;const{width:A,height:t}=this.cA.getSettings();return A&&t?{width:A,height:t}:void 0}get isUpstreamPaused(){return this.fA}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var A,t;return null!==(t=null===(A=this.processor)||void 0===A?void 0:A.processedTrack)&&void 0!==t?t:this.cA}get isLocal(){return!0}getSourceTrackSettings(){return this.cA.getSettings()}setMediaStreamTrack(A,t){return Ze(this,void 0,void 0,(function*(){var e;if(A===this.cA&&!t)return;let i;if(this.cA&&(this.attachedElements.forEach((A=>{Zn(this.cA,A)})),this.debouncedTrackMuteHandler.cancel("new-track"),this.cA.removeEventListener("ended",this.handleEnded),this.cA.removeEventListener("mute",this.handleTrackMuteEvent),this.cA.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([A]),A&&(A.addEventListener("ended",this.handleEnded),A.addEventListener("mute",this.handleTrackMuteEvent),A.addEventListener("unmute",this.handleTrackUnmuteEvent),this.wA=A.getConstraints()),this.processor&&A){const t=yield this.processorLock.lock();try{if(this.log.debug("restarting processor",this.logContext),"unknown"===this.kind)throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Yn(A,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:A,kind:this.kind,element:this.processorElement}),i=this.processor.processedTrack}finally{t()}}this.sender&&"closed"!==(null===(e=this.sender.transport)||void 0===e?void 0:e.state)&&(yield this.sender.replaceTrack(null!=i?i:A)),this.providedByUser||this.cA===A||this.cA.stop(),this.cA=A,A&&(this.cA.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach((t=>{Yn(null!=i?i:A,t)})))}))}waitForDimensions(){return Ze(this,arguments,void 0,(function(){var A=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return function*(){var e;if(A.kind===Xn.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");"iOS"===(null===(e=Nn())||void 0===e?void 0:e.os)&&(yield as(10));const i=Date.now();for(;Date.now()-i<t;){const t=A.dimensions;if(t)return t;yield as(50)}throw new Tn("unable to get track dimensions after timeout")}()}))}setDeviceId(A){return Ze(this,void 0,void 0,(function*(){return this.wA.deviceId===A&&this.cA.getSettings().deviceId===Ks(A)||(this.wA.deviceId=A,!!this.isMuted||(yield this.restartTrack(),Ks(A)===this.cA.getSettings().deviceId))}))}getDeviceId(){return Ze(this,arguments,void 0,(function(){var A=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){if(A.source===Xn.Source.ScreenShare)return;const{deviceId:e,groupId:i}=A.cA.getSettings(),n=A.kind===Xn.Kind.Audio?"audioinput":"videoinput";return t?nr.getInstance().normalizeDeviceId(n,e,i):e}()}))}mute(){return Ze(this,void 0,void 0,(function*(){return this.setTrackMuted(!0),this}))}unmute(){return Ze(this,void 0,void 0,(function*(){return this.setTrackMuted(!1),this}))}replaceTrack(A,t){return Ze(this,void 0,void 0,(function*(){if(!this.sender)throw new Tn("unable to replace an unpublished track");let e,i;return"boolean"==typeof t?e=t:void 0!==t&&(e=t.userProvidedTrack,i=t.stopProcessor),this.providedByUser=null==e||e,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(A),i&&this.processor&&(yield this.stopProcessor()),this}))}restart(A){return Ze(this,void 0,void 0,(function*(){this.manuallyStopped=!1;const t=yield this.restartLock.lock();try{A||(A=this.wA);const{deviceId:t,facingMode:e}=A,i=function(A,t){var e={};for(var i in A)Object.prototype.hasOwnProperty.call(A,i)&&t.indexOf(i)<0&&(e[i]=A[i]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(A);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(A,i[n])&&(e[i[n]]=A[i[n]])}return e}(A,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:A}));const n={audio:!1,video:!1};this.kind===Xn.Kind.Video?n.video=!t&&!e||{deviceId:t,facingMode:e}:n.audio=!t||{deviceId:t},this.attachedElements.forEach((A=>{Zn(this.mediaStreamTrack,A)})),this.cA.removeEventListener("ended",this.handleEnded),this.cA.stop();const s=(yield navigator.mediaDevices.getUserMedia(n)).getTracks()[0];return yield s.applyConstraints(i),s.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(s),this.wA=A,this.emit(yn.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{t()}}))}setTrackMuted(A){this.log.debug("setting ".concat(this.kind," track ").concat(A?"muted":"unmuted"),this.logContext),this.isMuted===A&&this.cA.enabled!==A||(this.isMuted=A,this.cA.enabled=!A,this.emit(A?yn.Muted:yn.Unmuted,this))}get needsReAcquisition(){return"live"!==this.cA.readyState||this.cA.muted||!this.cA.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Ze(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),ws()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),this.isInBackground||!this.needsReAcquisition||this.isUserProvided||this.isMuted||(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))}))}stop(){var A;this.manuallyStopped=!0,super.stop(),this.cA.removeEventListener("ended",this.handleEnded),this.cA.removeEventListener("mute",this.handleTrackMuteEvent),this.cA.removeEventListener("unmute",this.handleTrackUnmuteEvent),null===(A=this.processor)||void 0===A||A.destroy(),this.processor=void 0}pauseUpstream(){return Ze(this,void 0,void 0,(function*(){var A;const t=yield this.pauseUpstreamLock.lock();try{if(!0===this.fA)return;if(!this.sender)return void this.log.warn("unable to pause upstream for an unpublished track",this.logContext);this.fA=!0,this.emit(yn.UpstreamPaused,this);const t=Nn();if("Safari"===(null==t?void 0:t.name)&&Us(t.version,"12.0")<0)throw new kn("pauseUpstream is not supported on Safari < 12.");"closed"!==(null===(A=this.sender.transport)||void 0===A?void 0:A.state)&&(yield this.sender.replaceTrack(null))}finally{t()}}))}resumeUpstream(){return Ze(this,void 0,void 0,(function*(){var A;const t=yield this.pauseUpstreamLock.lock();try{if(!1===this.fA)return;if(!this.sender)return void this.log.warn("unable to resume upstream for an unpublished track",this.logContext);this.fA=!1,this.emit(yn.UpstreamResumed,this),"closed"!==(null===(A=this.sender.transport)||void 0===A?void 0:A.state)&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{t()}}))}getRTCStatsReport(){return Ze(this,void 0,void 0,(function*(){var A;if(null===(A=this.sender)||void 0===A?void 0:A.getStats)return yield this.sender.getStats()}))}setProcessor(A){return Ze(this,arguments,void 0,(function(A){var t=this;let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var i;const n=yield t.processorLock.lock();try{t.log.debug("setting up processor",t.logContext);const n=document.createElement(t.kind),s={kind:t.kind,track:t.cA,element:n,audioContext:t.audioContext};if(yield A.init(s),t.log.debug("processor initialized",t.logContext),t.processor&&(yield t.stopProcessor()),"unknown"===t.kind)throw TypeError("cannot set processor on track of unknown kind");if(Yn(t.cA,n),n.muted=!0,n.play().catch((A=>t.log.error("failed to play processor element",Object.assign(Object.assign({},t.logContext),{error:A})))),t.processor=A,t.processorElement=n,t.processor.processedTrack){for(const A of t.attachedElements)A!==t.processorElement&&e&&(Zn(t.cA,A),Yn(t.processor.processedTrack,A));yield null===(i=t.sender)||void 0===i?void 0:i.replaceTrack(t.processor.processedTrack)}t.emit(yn.TrackProcessorUpdate,t.processor)}finally{n()}}()}))}getProcessor(){return this.processor}stopProcessor(){return Ze(this,arguments,void 0,(function(){var A=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var e,i;A.processor&&(A.log.debug("stopping processor",A.logContext),null===(e=A.processor.processedTrack)||void 0===e||e.stop(),yield A.processor.destroy(),A.processor=void 0,t||(null===(i=A.processorElement)||void 0===i||i.remove(),A.processorElement=void 0),yield A.cA.applyConstraints(A.wA),yield A.setMediaStreamTrack(A.cA,!0),A.emit(yn.TrackProcessorUpdate))}()}))}}class Yr extends Xr{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(A,t){let e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;super(A,Xn.Kind.Audio,t,e,n),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>Ze(this,void 0,void 0,(function*(){if(!this.sender)return void(this.aA=0);let A;try{A=yield this.getSenderStats()}catch(t){return void this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:t}))}A&&this.prevStats&&(this.aA=Jr(A,this.prevStats)),this.prevStats=A})),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit(yn.AudioTrackFeatureUpdate,this,$A.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit(yn.AudioTrackFeatureUpdate,this,$A.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=i,this.checkForSilence()}mute(){const A=Object.create(null,{mute:{get:()=>super.mute}});return Ze(this,void 0,void 0,(function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===Xn.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this.cA.stop()),yield A.mute.call(this),this)}finally{t()}}))}unmute(){const A=Object.create(null,{unmute:{get:()=>super.unmute}});return Ze(this,void 0,void 0,(function*(){const t=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const t=this.wA.deviceId&&this.cA.getSettings().deviceId!==Ks(this.wA.deviceId);return this.source!==Xn.Source.Microphone||!this.stopOnMute&&"ended"!==this.cA.readyState&&!t||this.isUserProvided||(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield A.unmute.call(this),this}finally{t()}}))}restartTrack(A){return Ze(this,void 0,void 0,(function*(){let t;if(A){const e=Ys({audio:A});"boolean"!=typeof e.audio&&(t=e.audio)}yield this.restart(t)}))}restart(A){const t=Object.create(null,{restart:{get:()=>super.restart}});return Ze(this,void 0,void 0,(function*(){const e=yield t.restart.call(this,A);return this.checkForSilence(),e}))}startMonitor(){fs()&&(this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),_r)))}setProcessor(A){return Ze(this,void 0,void 0,(function*(){var t;const e=yield this.processorLock.lock();try{if(!gs()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.stopProcessor());const e={kind:this.kind,track:this.cA,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(A.name),this.logContext),yield A.init(e),this.processor=A,this.processor.processedTrack&&(yield null===(t=this.sender)||void 0===t?void 0:t.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit(yn.TrackProcessorUpdate,this.processor)}finally{e()}}))}setAudioContext(A){this.audioContext=A}getSenderStats(){return Ze(this,void 0,void 0,(function*(){var A;if(!(null===(A=this.sender)||void 0===A?void 0:A.getStats))return;let t;return(yield this.sender.getStats()).forEach((A=>{"outbound-rtp"===A.type&&(t={type:"audio",streamId:A.id,packetsSent:A.packetsSent,packetsLost:A.packetsLost,bytesSent:A.bytesSent,timestamp:A.timestamp,roundTripTime:A.roundTripTime,jitter:A.jitter})})),t}))}checkForSilence(){return Ze(this,void 0,void 0,(function*(){const A=yield function(A){return Ze(this,arguments,void 0,(function(A){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return function*(){const e=Zs();if(e){const i=e.createAnalyser();i.fftSize=2048;const n=i.frequencyBinCount,s=new Uint8Array(n);e.createMediaStreamSource(new MediaStream([A.mediaStreamTrack])).connect(i),yield as(t),i.getByteTimeDomainData(s);const r=s.some((A=>128!==A&&0!==A));return e.close(),!r}return!1}()}))}(this);return A&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(yn.AudioSilenceDetected)),A}))}}const Zr=Object.values(ns),Wr=Object.values(ss),qr=Object.values(rs),zr=[ns.h180,ns.h360],$r=[ss.h180,ss.h360],Ao=["q","h","f"];function to(A,t,e,i){var n,s;let r=null==i?void 0:i.videoEncoding;A&&(r=null==i?void 0:i.screenShareEncoding);const o=null==i?void 0:i.simulcast,a=null==i?void 0:i.scalabilityMode,c=null==i?void 0:i.videoCodec;if(!r&&!o&&!a||!t||!e)return[{}];r||(r=function(A,t,e,i){const n=function(A,t,e){if(A)return qr;const i=t>e?t/e:e/t;return Math.abs(i-16/9)<Math.abs(i-4/3)?Zr:Wr}(A,t,e);let{encoding:s}=n[0];const r=Math.max(t,e);for(let o=0;o<n.length;o+=1){const A=n[o];if(s=A.encoding,A.width>=r)break}if(i)switch(i){case"av1":s=Object.assign({},s),s.maxBitrate=.7*s.maxBitrate;break;case"vp9":s=Object.assign({},s),s.maxBitrate=.85*s.maxBitrate}return s}(A,t,e,c),Pe.debug("using video encoding",r));const h=r.maxFramerate,u=new Wn(t,e,r.maxBitrate,r.maxFramerate,r.priority);if(a&&us(c)){const A=new so(a),t=[];if(A.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(a));const e=Nn();if(Bs()||gs()||"Chrome"===(null==e?void 0:e.name)&&Us(null==e?void 0:e.version,"113")<0){const e="h"==A.suffix?2:3;for(let i=0;i<A.spatial;i+=1)t.push({rid:Ao[2-i],maxBitrate:r.maxBitrate/Math.pow(e,i),maxFramerate:u.encoding.maxFramerate});t[0].scalabilityMode=a}else t.push({maxBitrate:r.maxBitrate,maxFramerate:u.encoding.maxFramerate,scalabilityMode:a});return u.encoding.priority&&(t[0].priority=u.encoding.priority,t[0].networkPriority=u.encoding.priority),Pe.debug("using svc encoding",{encodings:t}),t}if(!o)return[r];let l,d=[];if(d=A?null!==(n=no(null==i?void 0:i.screenShareSimulcastLayers))&&void 0!==n?n:eo(A,u):null!==(s=no(null==i?void 0:i.videoSimulcastLayers))&&void 0!==s?s:eo(A,u),d.length>0){const A=d[0];d.length>1&&([,l]=d);const i=Math.max(t,e);if(i>=960&&l)return io(t,e,[A,l,u],h);if(i>=480)return io(t,e,[A,u],h)}return io(t,e,[u])}function eo(A,t){if(A)return[{scaleResolutionDownBy:2,fps:(e=t).encoding.maxFramerate}].map((A=>{var t,i;return new Wn(Math.floor(e.width/A.scaleResolutionDownBy),Math.floor(e.height/A.scaleResolutionDownBy),Math.max(15e4,Math.floor(e.encoding.maxBitrate/(Math.pow(A.scaleResolutionDownBy,2)*((null!==(t=e.encoding.maxFramerate)&&void 0!==t?t:30)/(null!==(i=A.fps)&&void 0!==i?i:30))))),A.fps,e.encoding.priority)}));var e;const{width:i,height:n}=t,s=i>n?i/n:n/i;return Math.abs(s-16/9)<Math.abs(s-4/3)?zr:$r}function io(A,t,e,i){const n=[];if(e.forEach(((e,s)=>{if(s>=Ao.length)return;const r=Math.min(A,t),o={rid:Ao[s],scaleResolutionDownBy:Math.max(1,r/Math.min(e.width,e.height)),maxBitrate:e.encoding.maxBitrate},a=i&&e.encoding.maxFramerate?Math.min(i,e.encoding.maxFramerate):e.encoding.maxFramerate;a&&(o.maxFramerate=a);const c=ds()||0===s;e.encoding.priority&&c&&(o.priority=e.encoding.priority,o.networkPriority=e.encoding.priority),n.push(o)})),gs()&&"ios"===ms()){let A;n.forEach((t=>{A?t.maxFramerate&&t.maxFramerate>A&&(A=t.maxFramerate):A=t.maxFramerate}));let t=!0;n.forEach((e=>{var i;e.maxFramerate!=A&&(t&&(t=!1,Pe.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),Pe.info('Setting framerate of encoding "'.concat(null!==(i=e.rid)&&void 0!==i?i:"",'" to ').concat(A)),e.maxFramerate=A)}))}return n}function no(A){if(A)return A.sort(((A,t)=>{const{encoding:e}=A,{encoding:i}=t;return e.maxBitrate>i.maxBitrate?1:e.maxBitrate<i.maxBitrate?-1:e.maxBitrate===i.maxBitrate&&e.maxFramerate&&i.maxFramerate?e.maxFramerate>i.maxFramerate?1:-1:0}))}class so{constructor(A){const t=A.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}toString(){var A;return"L".concat(this.spatial,"T").concat(this.temporal).concat(null!==(A=this.suffix)&&void 0!==A?A:"")}}class ro extends Xr{get sender(){return this.BA}set sender(A){this.BA=A,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(A,t){let e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;super(A,Xn.Kind.Video,t,e,i),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.monitorSender=()=>Ze(this,void 0,void 0,(function*(){if(!this.sender)return void(this.aA=0);let A;try{A=yield this.getSenderStats()}catch(e){return void this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:e}))}const t=new Map(A.map((A=>[A.rid,A])));if(this.prevStats){let A=0;t.forEach(((t,e)=>{var i;const n=null===(i=this.prevStats)||void 0===i?void 0:i.get(e);A+=Jr(t,n)})),this.aA=A}this.prevStats=t})),this.senderLock=new c}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(A){var t;if(this.signalClient=A,!fs())return;const e=null===(t=this.sender)||void 0===t?void 0:t.getParameters();e&&(this.encodings=e.encodings),this.monitorInterval||(this.monitorInterval=setInterval((()=>{this.monitorSender()}),_r))}stop(){this.cA.getConstraints(),this.simulcastCodecs.forEach((A=>{A.mediaStreamTrack.stop()})),super.stop()}pauseUpstream(){const A=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return Ze(this,void 0,void 0,(function*(){var t,e,i,n,s;yield A.pauseUpstream.call(this);try{for(var r,o=!0,a=We(this.simulcastCodecs.values());!(t=(r=yield a.next()).done);o=!0){n=r.value,o=!1;const A=n;yield null===(s=A.sender)||void 0===s?void 0:s.replaceTrack(null)}}catch(c){e={error:c}}finally{try{o||t||!(i=a.return)||(yield i.call(a))}finally{if(e)throw e.error}}}))}resumeUpstream(){const A=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return Ze(this,void 0,void 0,(function*(){var t,e,i,n,s;yield A.resumeUpstream.call(this);try{for(var r,o=!0,a=We(this.simulcastCodecs.values());!(t=(r=yield a.next()).done);o=!0){n=r.value,o=!1;const A=n;yield null===(s=A.sender)||void 0===s?void 0:s.replaceTrack(A.mediaStreamTrack)}}catch(c){e={error:c}}finally{try{o||t||!(i=a.return)||(yield i.call(a))}finally{if(e)throw e.error}}}))}mute(){const A=Object.create(null,{mute:{get:()=>super.mute}});return Ze(this,void 0,void 0,(function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source!==Xn.Source.Camera||this.isUserProvided||(this.log.debug("stopping camera track",this.logContext),this.cA.stop()),yield A.mute.call(this),this)}finally{t()}}))}unmute(){const A=Object.create(null,{unmute:{get:()=>super.unmute}});return Ze(this,void 0,void 0,(function*(){const t=yield this.muteLock.lock();try{return this.isMuted?(this.source!==Xn.Source.Camera||this.isUserProvided||(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield A.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{t()}}))}setTrackMuted(A){super.setTrackMuted(A);for(const t of this.simulcastCodecs.values())t.mediaStreamTrack.enabled=!A}getSenderStats(){return Ze(this,void 0,void 0,(function*(){var A;if(!(null===(A=this.sender)||void 0===A?void 0:A.getStats))return[];const t=[],e=yield this.sender.getStats();return e.forEach((A=>{var i;if("outbound-rtp"===A.type){const n={type:"video",streamId:A.id,frameHeight:A.frameHeight,frameWidth:A.frameWidth,framesPerSecond:A.framesPerSecond,framesSent:A.framesSent,firCount:A.firCount,pliCount:A.pliCount,nackCount:A.nackCount,packetsSent:A.packetsSent,bytesSent:A.bytesSent,qualityLimitationReason:A.qualityLimitationReason,qualityLimitationDurations:A.qualityLimitationDurations,qualityLimitationResolutionChanges:A.qualityLimitationResolutionChanges,rid:null!==(i=A.rid)&&void 0!==i?i:A.id,retransmittedPacketsSent:A.retransmittedPacketsSent,targetBitrate:A.targetBitrate,timestamp:A.timestamp},s=e.get(A.remoteId);s&&(n.jitter=s.jitter,n.packetsLost=s.packetsLost,n.roundTripTime=s.roundTripTime),t.push(n)}})),t.sort(((A,t)=>{var e,i;return(null!==(e=t.frameWidth)&&void 0!==e?e:0)-(null!==(i=A.frameWidth)&&void 0!==i?i:0)})),t}))}setPublishingQuality(A){const t=[];for(let e=_n.LOW;e<=_n.HIGH;e+=1)t.push(new we({quality:e,enabled:e<=A}));this.log.debug("setting publishing quality. max quality ".concat(A),this.logContext),this.setPublishingLayers(t)}restartTrack(A){return Ze(this,void 0,void 0,(function*(){var t,e,i,n,s;let r;if(A){const t=Ys({video:A});"boolean"!=typeof t.video&&(r=t.video)}yield this.restart(r);try{for(var o,a=!0,c=We(this.simulcastCodecs.values());!(t=(o=yield c.next()).done);a=!0){n=o.value,a=!1;const A=n;A.sender&&"closed"!==(null===(s=A.sender.transport)||void 0===s?void 0:s.state)&&(A.mediaStreamTrack=this.mediaStreamTrack.clone(),yield A.sender.replaceTrack(A.mediaStreamTrack))}}catch(h){e={error:h}}finally{try{a||t||!(i=c.return)||(yield i.call(c))}finally{if(e)throw e.error}}}))}setProcessor(A){const t=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return Ze(this,arguments,void 0,(function(A){var e=this;let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){var n,s,r,o,a,c;if(yield t.setProcessor.call(e,A,i),null===(a=e.processor)||void 0===a?void 0:a.processedTrack)try{for(var h,u=!0,l=We(e.simulcastCodecs.values());!(n=(h=yield l.next()).done);u=!0){o=h.value,u=!1;const A=o;yield null===(c=A.sender)||void 0===c?void 0:c.replaceTrack(e.processor.processedTrack)}}catch(d){s={error:d}}finally{try{u||n||!(r=l.return)||(yield r.call(l))}finally{if(s)throw s.error}}}()}))}setDegradationPreference(A){return Ze(this,void 0,void 0,(function*(){if(this.degradationPreference=A,this.sender)try{this.log.debug("setting degradationPreference to ".concat(A),this.logContext);const t=this.sender.getParameters();t.degradationPreference=A,this.sender.setParameters(t)}catch(t){this.log.warn("failed to set degradationPreference",Object.assign({error:t},this.logContext))}}))}addSimulcastTrack(A,t){if(this.simulcastCodecs.has(A))return void this.log.error("".concat(A," already added, skipping adding simulcast codec"),this.logContext);const e={codec:A,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:t};return this.simulcastCodecs.set(A,e),e}setSimulcastTrackSender(A,t){const e=this.simulcastCodecs.get(A);e&&(e.sender=t,setTimeout((()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)}),5e3))}setPublishingCodecs(A){return Ze(this,void 0,void 0,(function*(){var t,e,i,n,s,r,o;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:A,currentCodec:this.codec})),!this.codec&&A.length>0)return yield this.setPublishingLayers(A[0].qualities),[];this.subscribedCodecs=A;const a=[];try{for(t=!0,e=We(A);!(n=(i=yield e.next()).done);t=!0){o=i.value,t=!1;const A=o;if(this.codec&&this.codec!==A.codec){const t=this.simulcastCodecs.get(A.codec);if(this.log.debug("try setPublishingCodec for ".concat(A.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:t})),t&&t.sender)t.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(A.codec),this.logContext),yield oo(t.sender,t.encodings,A.qualities,this.senderLock,this.log,this.logContext));else for(const e of A.qualities)if(e.enabled){a.push(A.codec);break}}else yield this.setPublishingLayers(A.qualities)}}catch(c){s={error:c}}finally{try{t||n||!(r=e.return)||(yield r.call(e))}finally{if(s)throw s.error}}return a}))}setPublishingLayers(A){return Ze(this,void 0,void 0,(function*(){this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:A})),this.sender&&this.encodings&&(yield oo(this.sender,this.encodings,A,this.senderLock,this.log,this.logContext))}))}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Ze(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),ws()&&this.isInBackground&&this.source===Xn.Source.Camera&&(this.cA.enabled=!1)}))}}function oo(A,t,e,i,n,s){return Ze(this,void 0,void 0,(function*(){const r=yield i.lock();n.debug("setPublishingLayersForSender",Object.assign(Object.assign({},s),{sender:A,qualities:e,senderEncodings:t}));try{const i=A.getParameters(),{encodings:r}=i;if(!r)return;if(r.length!==t.length)return void n.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},s),{encodings:r,senderEncodings:t}));let o=!1;const a=Nn();if("Chrome"===(null==a?void 0:a.name)&&Us(null==a?void 0:a.version,"133")>0&&r[0].scalabilityMode){const A=r[0],i=new so(A.scalabilityMode);let n=XA.OFF;if(e.forEach((A=>{A.enabled&&(n===XA.OFF||A.quality>n)&&(n=A.quality)})),n===XA.OFF)A.active&&(A.active=!1,o=!0);else if(!A.active||i.spatial!==n+1){o=!0,A.active=!0;const e=new so(t[0].scalabilityMode);i.spatial=n+1,i.suffix=e.suffix,1===i.spatial&&(i.suffix=void 0),A.scalabilityMode=i.toString(),A.scaleResolutionDownBy=Math.pow(2,2-n),t[0].maxBitrate&&(A.maxBitrate=t[0].maxBitrate/(A.scaleResolutionDownBy*A.scaleResolutionDownBy))}}else r.forEach(((A,i)=>{var r;let a=null!==(r=A.rid)&&void 0!==r?r:"";""===a&&(a="q");const c=ao(a),h=e.find((A=>A.quality===c));h&&A.active!==h.enabled&&(o=!0,A.active=h.enabled,n.debug("setting layer ".concat(h.quality," to ").concat(A.active?"enabled":"disabled"),s),ds()&&(h.enabled?(A.scaleResolutionDownBy=t[i].scaleResolutionDownBy,A.maxBitrate=t[i].maxBitrate,A.maxFrameRate=t[i].maxFrameRate):(A.scaleResolutionDownBy=4,A.maxBitrate=10,A.maxFrameRate=2)))}));o&&(i.encodings=r,n.debug("setting encodings",Object.assign(Object.assign({},s),{encodings:i.encodings})),yield A.setParameters(i))}finally{r()}}))}function ao(A){switch(A){case"f":default:return _n.HIGH;case"h":return _n.MEDIUM;case"q":return _n.LOW}}function co(A,t,e,i){if(!e)return[new ht({quality:_n.HIGH,width:A,height:t,bitrate:0,ssrc:0})];if(i){const i=e[0].scalabilityMode,n=new so(i),s=[],r="h"==n.suffix?1.5:2,o="h"==n.suffix?2:3;for(let a=0;a<n.spatial;a+=1)s.push(new ht({quality:Math.min(_n.HIGH,n.spatial-1)-a,width:Math.ceil(A/Math.pow(r,a)),height:Math.ceil(t/Math.pow(r,a)),bitrate:e[0].maxBitrate?Math.ceil(e[0].maxBitrate/Math.pow(o,a)):0,ssrc:0}));return s}return e.map((e=>{var i,n,s;const r=null!==(i=e.scaleResolutionDownBy)&&void 0!==i?i:1;let o=ao(null!==(n=e.rid)&&void 0!==n?n:"");return new ht({quality:o,width:Math.ceil(A/r),height:Math.ceil(t/r),bitrate:null!==(s=e.maxBitrate)&&void 0!==s?s:0,ssrc:0})}))}const ho="_lossy",uo="_reliable",lo="leave-reconnect";var Bo,wo,fo,go,Qo,vo,mo,po,Uo,Co,Fo;(wo=Bo||(Bo={}))[wo.New=0]="New",wo[wo.Connected=1]="Connected",wo[wo.Disconnected=2]="Disconnected",wo[wo.Reconnecting=3]="Reconnecting",wo[wo.Closed=4]="Closed";class yo extends $e.EventEmitter{get isClosed(){return this.gA}get pendingReconnect(){return!!this.reconnectTimeout}constructor(A){var t;super(),this.options=A,this.rtcConfig={},this.peerConnectionTimeout=Rr.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.subscriberPrimary=!1,this.pcState=Bo.New,this.gA=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=Pe,this.handleDataChannel=A=>Ze(this,[A],void 0,(function(A){var t=this;let{channel:e}=A;return function*(){if(e){if(e.label===uo)t.reliableDCSub=e;else{if(e.label!==ho)return;t.lossyDCSub=e}t.log.debug("on data channel ".concat(e.id,", ").concat(e.label),t.logContext),e.onmessage=t.handleDataMessage}}()})),this.handleDataMessage=A=>Ze(this,void 0,void 0,(function*(){var t,e;const i=yield this.dataProcessLock.lock();try{let i;if(A.data instanceof ArrayBuffer)i=A.data;else{if(!(A.data instanceof Blob))return void this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:A.data}));i=yield A.data.arrayBuffer()}const n=ut.fromBinary(new Uint8Array(i));"speaker"===(null===(t=n.value)||void 0===t?void 0:t.case)?this.emit(Cn.ActiveSpeakersUpdate,n.value.value.speakers):("user"===(null===(e=n.value)||void 0===e?void 0:e.case)&&function(A,t){const e=A.participantIdentity?A.participantIdentity:t.participantIdentity;A.participantIdentity=e,t.participantIdentity=e;const i=0!==A.destinationIdentities.length?A.destinationIdentities:t.destinationIdentities;A.destinationIdentities=i,t.destinationIdentities=i}(n,n.value.value),this.emit(Cn.DataPacketReceived,n))}finally{i()}})),this.handleDataError=A=>{const t=0===A.currentTarget.maxRetransmits?"lossy":"reliable";if(A instanceof ErrorEvent&&A.error){const{error:e}=A.error;this.log.error("DataChannel error on ".concat(t,": ").concat(A.message),Object.assign(Object.assign({},this.logContext),{error:e}))}else this.log.error("Unknown DataChannel error on ".concat(t),Object.assign(Object.assign({},this.logContext),{event:A}))},this.handleBufferedAmountLow=A=>{const t=0===A.currentTarget.maxRetransmits?lt.LOSSY:lt.RELIABLE;this.updateAndEmitDCBufferStatus(t)},this.handleDisconnect=(A,t)=>{if(this.gA)return;this.log.warn("".concat(A," disconnected"),this.logContext),0===this.reconnectAttempts&&(this.reconnectStart=Date.now());const e=Date.now()-this.reconnectStart;let i=this.getNextRetryDelay({elapsedMs:e,retryCount:this.reconnectAttempts});null!==i?(A===lo&&(i=0),this.log.debug("reconnecting in ".concat(i,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=jn.setTimeout((()=>this.attemptReconnect(t).finally((()=>this.reconnectTimeout=void 0))),i)):(A=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(A,"ms. giving up"),this.logContext),this.emit(Cn.Disconnected),this.close()})(e)},this.waitForRestarted=()=>new Promise(((A,t)=>{this.pcState===Bo.Connected&&A();const e=()=>{this.off(Cn.Disconnected,i),A()},i=()=>{this.off(Cn.Restarted,e),t()};this.once(Cn.Restarted,e),this.once(Cn.Disconnected,i)})),this.updateAndEmitDCBufferStatus=A=>{const t=this.isBufferStatusLow(A);void 0!==t&&t!==this.dcBufferStatus.get(A)&&(this.dcBufferStatus.set(A,t),this.emit(Cn.DCBufferStatusChanged,t,A))},this.isBufferStatusLow=A=>{const t=this.dataChannelForKind(A);if(t)return t.bufferedAmount<=t.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===hr.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(qA.RR_SIGNAL_DISCONNECTED))},this.log=_e(null!==(t=A.loggerName)&&void 0!==t?t:Ge.Engine),this.loggerOptions={loggerName:A.loggerName,loggerContextCb:()=>this.logContext},this.client=new lr(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new c,this.dataProcessLock=new c,this.dcBufferStatus=new Map([[lt.LOSSY,!0],[lt.RELIABLE,!0]]),this.client.onParticipantUpdate=A=>this.emit(Cn.ParticipantUpdate,A),this.client.onConnectionQuality=A=>this.emit(Cn.ConnectionQualityUpdate,A),this.client.onRoomUpdate=A=>this.emit(Cn.RoomUpdate,A),this.client.onSubscriptionError=A=>this.emit(Cn.SubscriptionError,A),this.client.onSubscriptionPermissionUpdate=A=>this.emit(Cn.SubscriptionPermissionUpdate,A),this.client.onSpeakersChanged=A=>this.emit(Cn.SpeakersChanged,A),this.client.onStreamStateUpdate=A=>this.emit(Cn.StreamStateChanged,A),this.client.onRequestResponse=A=>this.emit(Cn.SignalRequestResponse,A)}get logContext(){var A,t,e,i,n,s,r,o;return{room:null===(t=null===(A=this.latestJoinResponse)||void 0===A?void 0:A.room)||void 0===t?void 0:t.name,roomID:null===(i=null===(e=this.latestJoinResponse)||void 0===e?void 0:e.room)||void 0===i?void 0:i.sid,participant:null===(s=null===(n=this.latestJoinResponse)||void 0===n?void 0:n.participant)||void 0===s?void 0:s.identity,pID:null===(o=null===(r=this.latestJoinResponse)||void 0===r?void 0:r.participant)||void 0===o?void 0:o.sid}}join(A,t,e,i){return Ze(this,void 0,void 0,(function*(){this.url=A,this.token=t,this.signalOpts=e,this.maxJoinAttempts=e.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const n=yield this.client.join(A,t,e,i);return this.gA=!1,this.latestJoinResponse=n,this.subscriberPrimary=n.subscriberPrimary,this.pcManager||(yield this.configure(n)),this.subscriberPrimary&&!n.fastPublish||this.negotiate(),this.clientConfiguration=n.clientConfiguration,setTimeout((()=>{this.emit(Cn.SignalConnected)}),10),n}catch(n){if(n instanceof In&&n.reason===dn.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(A,t,e,i);throw n}}))}close(){return Ze(this,void 0,void 0,(function*(){const A=yield this.closingLock.lock();if(this.isClosed)A();else try{this.gA=!0,this.joinAttempts=0,this.emit(Cn.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{A()}}))}cleanupPeerConnections(){return Ze(this,void 0,void 0,(function*(){var A;yield null===(A=this.pcManager)||void 0===A?void 0:A.close(),this.pcManager=void 0;const t=A=>{A&&(A.close(),A.onbufferedamountlow=null,A.onclose=null,A.onclosing=null,A.onerror=null,A.onmessage=null,A.onopen=null)};t(this.lossyDC),t(this.lossyDCSub),t(this.reliableDC),t(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0}))}cleanupClient(){return Ze(this,void 0,void 0,(function*(){yield this.client.close(),this.client.resetCallbacks()}))}addTrack(A){if(this.pendingTrackResolvers[A.cid])throw new Tn("a track with the same ID has already been published");return new Promise(((t,e)=>{const i=setTimeout((()=>{delete this.pendingTrackResolvers[A.cid],e(new In("publication of local track timed out, no response from server",dn.InternalError))}),1e4);this.pendingTrackResolvers[A.cid]={resolve:A=>{clearTimeout(i),t(A)},reject:()=>{clearTimeout(i),e(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(A)}))}removeTrack(A){if(A.track&&this.pendingTrackResolvers[A.track.id]){const{reject:t}=this.pendingTrackResolvers[A.track.id];t&&t(),delete this.pendingTrackResolvers[A.track.id]}try{return this.pcManager.removeTrack(A),!0}catch(t){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:t}))}return!1}updateMuteStatus(A,t){this.client.sendMuteTrack(A,t)}get dataSubscriberReadyState(){var A;return null===(A=this.reliableDCSub)||void 0===A?void 0:A.readyState}getConnectedServerAddress(){return Ze(this,void 0,void 0,(function*(){var A;return null===(A=this.pcManager)||void 0===A?void 0:A.getConnectedAddress()}))}setRegionUrlProvider(A){this.regionUrlProvider=A}configure(A){return Ze(this,void 0,void 0,(function*(){var t,e;if(this.pcManager&&this.pcManager.currentState!==Nr.NEW)return;this.participantSid=null===(t=A.participant)||void 0===t?void 0:t.sid;const i=this.makeRTCConfiguration(A);var n;this.pcManager=new xr(i,A.subscriberPrimary,this.loggerOptions),this.emit(Cn.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(A,t)=>{this.client.sendIceCandidate(A,t)},this.pcManager.onPublisherOffer=A=>{this.client.sendOffer(A)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(t,e,i)=>Ze(this,void 0,void 0,(function*(){if(this.log.debug("primary PC state changed ".concat(t),this.logContext),["closed","disconnected","failed"].includes(e)&&(this.publisherConnectionPromise=void 0),t===Nr.CONNECTED){const t=this.pcState===Bo.New;this.pcState=Bo.Connected,t&&this.emit(Cn.Connected,A)}else t===Nr.FAILED&&this.pcState===Bo.Connected&&(this.pcState=Bo.Disconnected,this.handleDisconnect("peerconnection failed","failed"===i?qA.RR_SUBSCRIBER_FAILED:qA.RR_PUBLISHER_FAILED));const n=this.client.isDisconnected||this.client.currentState===hr.RECONNECTING,s=[Nr.FAILED,Nr.CLOSING,Nr.CLOSED].includes(t);n&&s&&!this.gA&&this.emit(Cn.Offline)})),this.pcManager.onTrack=A=>{this.emit(Cn.MediaTrackAdded,A.track,A.streams[0],A.receiver)},void 0!==(n=null===(e=A.serverInfo)||void 0===e?void 0:e.protocol)&&n>13||this.createDataChannels()}))}setupSignalClientCallbacks(){this.client.onAnswer=A=>Ze(this,void 0,void 0,(function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:A.type})),yield this.pcManager.setPublisherAnswer(A))})),this.client.onTrickle=(A,t)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:A,target:t})),this.pcManager.addIceCandidate(A,t))},this.client.onOffer=A=>Ze(this,void 0,void 0,(function*(){if(!this.pcManager)return;const t=yield this.pcManager.createSubscriberAnswerFromOffer(A);this.client.sendAnswer(t)})),this.client.onLocalTrackPublished=A=>{var t;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:A.cid,track:null===(t=A.track)||void 0===t?void 0:t.sid})),!this.pendingTrackResolvers[A.cid])return void this.log.error("missing track resolver for ".concat(A.cid),Object.assign(Object.assign({},this.logContext),{cid:A.cid}));const{resolve:e}=this.pendingTrackResolvers[A.cid];delete this.pendingTrackResolvers[A.cid],e(A.track)},this.client.onLocalTrackUnpublished=A=>{this.emit(Cn.LocalTrackUnpublished,A)},this.client.onLocalTrackSubscribed=A=>{this.emit(Cn.LocalTrackSubscribed,A)},this.client.onTokenRefresh=A=>{this.token=A},this.client.onRemoteMuteChanged=(A,t)=>{this.emit(Cn.RemoteMute,A,t)},this.client.onSubscribedQualityUpdate=A=>{this.emit(Cn.SubscribedQualityUpdate,A)},this.client.onRoomMoved=A=>{var t;this.participantSid=null===(t=A.participant)||void 0===t?void 0:t.sid,this.emit(Cn.RoomMoved,A)},this.client.onClose=()=>{this.handleDisconnect("signal",qA.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=A=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:null==A?void 0:A.reason})),A.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(A.regions)),A.action){case se.DISCONNECT:this.emit(Cn.Disconnected,null==A?void 0:A.reason),this.close();break;case se.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(lo);break;case se.RESUME:this.handleDisconnect(lo)}}}makeRTCConfiguration(A){var t;const e=Object.assign({},this.rtcConfig);if((null===(t=this.signalOpts)||void 0===t?void 0:t.e2eeEnabled)&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),e.encodedInsertableStreams=!0),A.iceServers&&!e.iceServers){const t=[];A.iceServers.forEach((A=>{const e={urls:A.urls};A.username&&(e.username=A.username),A.credential&&(e.credential=A.credential),t.push(e)})),e.iceServers=t}return A.clientConfiguration&&A.clientConfiguration.forceRelay===ZA.ENABLED&&(e.iceTransportPolicy="relay"),e.sdpSemantics="unified-plan",e.continualGatheringPolicy="gather_continually",e}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(ho,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(uo,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(A,t,e){return Ze(this,void 0,void 0,(function*(){if(cs())return yield this.createTransceiverRTCRtpSender(A,t,e);if(hs())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(A.mediaStreamTrack);throw new Kn("Required webRTC APIs not supported on this device")}))}createSimulcastSender(A,t,e,i){return Ze(this,void 0,void 0,(function*(){if(cs())return this.createSimulcastTransceiverSender(A,t,e,i);if(hs())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(A.mediaStreamTrack);throw new Kn("Cannot stream on this device")}))}createTransceiverRTCRtpSender(A,t,e){return Ze(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Kn("publisher is closed");const i=[];A.mediaStream&&i.push(A.mediaStream),Gs(A)&&(A.codec=t.videoCodec);const n={direction:"sendonly",streams:i};return e&&(n.sendEncodings=e),(yield this.pcManager.addPublisherTransceiver(A.mediaStreamTrack,n)).sender}))}createSimulcastTransceiverSender(A,t,e,i){return Ze(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Kn("publisher is closed");const n={direction:"sendonly"};i&&(n.sendEncodings=i);const s=yield this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,n);if(e.videoCodec)return A.setSimulcastTrackSender(e.videoCodec,s.sender),s.sender}))}createRTCRtpSender(A){return Ze(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Kn("publisher is closed");return this.pcManager.addPublisherTrack(A)}))}attemptReconnect(A){return Ze(this,void 0,void 0,(function*(){var t,e,i;if(!this.gA)if(this.attemptingReconnect)Pe.warn("already attempting reconnect, returning early",this.logContext);else{(null===(t=this.clientConfiguration)||void 0===t?void 0:t.resumeConnection)!==ZA.DISABLED&&(null!==(i=null===(e=this.pcManager)||void 0===e?void 0:e.currentState)&&void 0!==i?i:Nr.NEW)!==Nr.NEW||(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(A),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(n){this.reconnectAttempts+=1;let A=!0;n instanceof Kn?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:n})),A=!1):n instanceof bo||(this.fullReconnectOnNext=!0),A?this.handleDisconnect("reconnect",qA.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(Cn.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}}))}getNextRetryDelay(A){try{return this.reconnectPolicy.nextRetryDelayInMs(A)}catch(t){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:t}))}return null}restartConnection(A){return Ze(this,void 0,void 0,(function*(){var t,e,i;try{if(!this.url||!this.token)throw new Kn("could not reconnect, url or token not saved");let e;this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(Cn.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new bo;e=yield this.join(null!=A?A:this.url,this.token,this.signalOpts)}catch(n){if(n instanceof In&&n.reason===dn.NotAllowed)throw new Kn("could not reconnect, token might be expired");throw new bo}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(Cn.SignalRestarted,e),yield this.waitForPCReconnected(),this.client.currentState!==hr.CONNECTED)throw new bo("Signal connection got severed during reconnect");null===(t=this.regionUrlProvider)||void 0===t||t.resetAttempts(),this.emit(Cn.Restarted)}catch(s){const A=yield null===(e=this.regionUrlProvider)||void 0===e?void 0:e.getNextBestRegionUrl();if(A)return void(yield this.restartConnection(A));throw null===(i=this.regionUrlProvider)||void 0===i||i.resetAttempts(),s}}))}resumeConnection(A){return Ze(this,void 0,void 0,(function*(){var t;if(!this.url||!this.token)throw new Kn("could not reconnect, url or token not saved");if(!this.pcManager)throw new Kn("publisher and subscriber connections unset");let e;this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(Cn.Resuming);try{this.setupSignalClientCallbacks(),e=yield this.client.reconnect(this.url,this.token,this.participantSid,A)}catch(i){let A="";if(i instanceof Error&&(A=i.message,this.log.error(i.message,Object.assign(Object.assign({},this.logContext),{error:i}))),i instanceof In&&i.reason===dn.NotAllowed)throw new Kn("could not reconnect, token might be expired");if(i instanceof In&&i.reason===dn.LeaveRequest)throw i;throw new bo(A)}if(this.emit(Cn.SignalResumed),e){const A=this.makeRTCConfiguration(e);this.pcManager.updateConfiguration(A)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==hr.CONNECTED)throw new bo("Signal connection got severed during reconnect");this.client.setReconnected(),"open"===(null===(t=this.reliableDC)||void 0===t?void 0:t.readyState)&&null===this.reliableDC.id&&this.createDataChannels(),this.emit(Cn.Resumed)}))}waitForPCInitialConnection(A,t){return Ze(this,void 0,void 0,(function*(){if(!this.pcManager)throw new Kn("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(t,A)}))}waitForPCReconnected(){return Ze(this,void 0,void 0,(function*(){this.pcState=Bo.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield as(2e3),!this.pcManager)throw new Kn("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=Bo.Connected}catch(A){throw this.pcState=Bo.Disconnected,new In("could not establish PC connection, ".concat(A.message),dn.InternalError)}}))}publishRpcResponse(A,t,e,i){return Ze(this,void 0,void 0,(function*(){const n=new ut({destinationIdentities:[A],kind:lt.RELIABLE,value:{case:"rpcResponse",value:new Ut({requestId:t,value:i?{case:"error",value:i.toProto()}:{case:"payload",value:null!=e?e:""}})}});yield this.sendDataPacket(n,lt.RELIABLE)}))}publishRpcAck(A,t){return Ze(this,void 0,void 0,(function*(){const e=new ut({destinationIdentities:[A],kind:lt.RELIABLE,value:{case:"rpcAck",value:new pt({requestId:t})}});yield this.sendDataPacket(e,lt.RELIABLE)}))}sendDataPacket(A,t){return Ze(this,void 0,void 0,(function*(){const e=A.toBinary();yield this.ensurePublisherConnected(t);const i=this.dataChannelForKind(t);i&&i.send(e),this.updateAndEmitDCBufferStatus(t)}))}waitForBufferStatusLow(A){return new Promise(((t,e)=>Ze(this,void 0,void 0,(function*(){if(this.isBufferStatusLow(A))t();else{const i=()=>e("Engine closed");for(this.once(Cn.Closing,i);!this.dcBufferStatus.get(A);)yield as(10);this.off(Cn.Closing,i),t()}}))))}ensureDataTransportConnected(A){return Ze(this,arguments,void 0,(function(A){var t=this;let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.subscriberPrimary;return function*(){var i;if(!t.pcManager)throw new Kn("PC manager is closed");const n=e?t.pcManager.subscriber:t.pcManager.publisher,s=e?"Subscriber":"Publisher";if(!n)throw new In("".concat(s," connection not set"),dn.InternalError);let r=!1;e||t.dataChannelForKind(A,e)||(t.createDataChannels(),r=!0),r||e||t.pcManager.publisher.isICEConnected||"checking"===t.pcManager.publisher.getICEConnectionState()||(r=!0),r&&t.negotiate();const o=t.dataChannelForKind(A,e);if("open"===(null==o?void 0:o.readyState))return;const a=(new Date).getTime()+t.peerConnectionTimeout;for(;(new Date).getTime()<a;){if(n.isICEConnected&&"open"===(null===(i=t.dataChannelForKind(A,e))||void 0===i?void 0:i.readyState))return;yield as(50)}throw new In("could not establish ".concat(s," connection, state: ").concat(n.getICEConnectionState()),dn.InternalError)}()}))}ensurePublisherConnected(A){return Ze(this,void 0,void 0,(function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(A,!1)),yield this.publisherConnectionPromise}))}verifyTransport(){return!!this.pcManager&&this.pcManager.currentState===Nr.CONNECTED&&!(!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return Ze(this,void 0,void 0,(function*(){return new Promise(((A,t)=>Ze(this,void 0,void 0,(function*(){if(!this.pcManager)return void t(new On("PC manager is closed"));this.pcManager.requirePublisher(),0!=this.pcManager.publisher.getTransceivers().length||this.lossyDC||this.reliableDC||this.createDataChannels();const e=new AbortController,i=()=>{e.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),A()};this.isClosed&&t("cannot negotiate on closed engine"),this.on(Cn.Closing,i),this.pcManager.publisher.once(Ir,(A=>{const t=new Map;A.forEach((A=>{const e=A.codec.toLowerCase();var i;i=e,zn.includes(i)&&t.set(A.payload,e)})),this.emit(Cn.RTPVideoMapUpdate,t)}));try{yield this.pcManager.negotiate(e),A()}catch(n){n instanceof On&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",qA.RR_UNKNOWN),t(n)}finally{this.off(Cn.Closing,i)}}))))}))}dataChannelForKind(A,t){if(t){if(A===lt.LOSSY)return this.lossyDCSub;if(A===lt.RELIABLE)return this.reliableDCSub}else{if(A===lt.LOSSY)return this.lossyDC;if(A===lt.RELIABLE)return this.reliableDC}}sendSyncState(A,t){var e,i;if(!this.pcManager)return void this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);const n=this.pcManager.subscriber.getLocalDescription(),s=this.pcManager.subscriber.getRemoteDescription(),r=null===(i=null===(e=this.signalOpts)||void 0===e?void 0:e.autoSubscribe)||void 0===i||i,o=new Array,a=new Array;A.forEach((A=>{A.isDesired!==r&&o.push(A.trackSid),A.isEnabled||a.push(A.trackSid)})),this.client.sendSyncState(new Ue({answer:n?Br({sdp:n.sdp,type:n.type}):void 0,offer:s?Br({sdp:s.sdp,type:s.type}):void 0,subscription:new Ae({trackSids:o,subscribe:!r,participantTracks:[]}),publishTracks:$s(t),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:a}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const A=[],t=(t,e)=>{void 0!==(null==t?void 0:t.id)&&null!==t.id&&A.push(new Ce({label:t.label,id:t.id,target:e}))};return t(this.dataChannelForKind(lt.LOSSY),Nt.PUBLISHER),t(this.dataChannelForKind(lt.RELIABLE),Nt.PUBLISHER),t(this.dataChannelForKind(lt.LOSSY,!0),Nt.SUBSCRIBER),t(this.dataChannelForKind(lt.RELIABLE,!0),Nt.SUBSCRIBER),A}clearReconnectTimeout(){this.reconnectTimeout&&jn.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){fs()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){fs()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class bo extends Error{}class Eo{constructor(A,t){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(A),this.token=t}updateToken(A){this.token=A}isCloud(){return Qs(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(A){return Ze(this,void 0,void 0,(function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(A));const t=this.regionSettings.regions.filter((A=>!this.attemptedRegions.find((t=>t.url===A.url))));if(t.length>0){const A=t[0];return this.attemptedRegions.push(A),Pe.debug("next region: ".concat(A.region)),A.url}return null}))}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(A){return Ze(this,void 0,void 0,(function*(){const t=yield fetch("".concat((e=this.serverUrl,"".concat(e.protocol.replace("ws","http"),"//").concat(e.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:A});var e;if(t.ok){const A=yield t.json();return this.lastUpdateAt=Date.now(),A}throw new In("Could not fetch region settings: ".concat(t.statusText),401===t.status?dn.NotAllowed:dn.InternalError,t.status)}))}setServerReportedRegions(A){this.regionSettings=A,this.lastUpdateAt=Date.now()}}class Ho{get info(){return this.QA}constructor(A,t,e){this.reader=t,this.totalByteSize=e,this.QA=A,this.bytesReceived=0}}class Io extends Ho{handleChunkReceived(A){var t;this.bytesReceived+=A.content.byteLength;const e=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(t=this.onProgress)||void 0===t||t.call(this,e)}[Symbol.asyncIterator](){const A=this.reader.getReader();return{next:()=>Ze(this,void 0,void 0,(function*(){try{const{done:t,value:e}=yield A.read();return t?{done:!0,value:void 0}:(this.handleChunkReceived(e),{done:!1,value:e.content})}catch(t){return{done:!0,value:void 0}}})),return(){return Ze(this,void 0,void 0,(function*(){return A.releaseLock(),{done:!0,value:void 0}}))}}}readAll(){return Ze(this,void 0,void 0,(function*(){var A,t,e,i;let n=new Set;try{for(var s,r=!0,o=We(this);!(A=(s=yield o.next()).done);r=!0){i=s.value,r=!1;const A=i;n.add(A)}}catch(a){t={error:a}}finally{try{r||A||!(e=o.return)||(yield e.call(o))}finally{if(t)throw t.error}}return Array.from(n)}))}}class ko extends Ho{constructor(A,t,e){super(A,t,e),this.receivedChunks=new Map}handleChunkReceived(A){var t;const e=Ms(A.chunkIndex),i=this.receivedChunks.get(e);if(i&&i.version>A.version)return;this.receivedChunks.set(e,A),this.bytesReceived+=A.content.byteLength;const n=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;null===(t=this.onProgress)||void 0===t||t.call(this,n)}[Symbol.asyncIterator](){const A=this.reader.getReader(),t=new TextDecoder;return{next:()=>Ze(this,void 0,void 0,(function*(){try{const{done:e,value:i}=yield A.read();return e?{done:!0,value:void 0}:(this.handleChunkReceived(i),{done:!1,value:t.decode(i.content)})}catch(e){return{done:!0,value:void 0}}})),return(){return Ze(this,void 0,void 0,(function*(){return A.releaseLock(),{done:!0,value:void 0}}))}}}readAll(){return Ze(this,void 0,void 0,(function*(){var A,t,e,i;let n="";try{for(var s,r=!0,o=We(this);!(A=(s=yield o.next()).done);r=!0)i=s.value,r=!1,n+=i}catch(a){t={error:a}}finally{try{r||A||!(e=o.return)||(yield e.call(o))}finally{if(t)throw t.error}}return n}))}}class To{constructor(A,t,e){this.writableStream=A,this.defaultWriter=A.getWriter(),this.onClose=e,this.info=t}write(A){return this.defaultWriter.write(A)}close(){return Ze(this,void 0,void 0,(function*(){var A;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),null===(A=this.onClose)||void 0===A||A.call(this)}))}}class So extends To{}class Ko extends To{}class Oo extends Xn{constructor(A,t,e,i,n){super(A,e,n),this.sid=t,this.receiver=i}get isLocal(){return!1}setMuted(A){this.isMuted!==A&&(this.isMuted=A,this.cA.enabled=!A,this.emit(A?yn.Muted:yn.Unmuted,this))}setMediaStream(A){this.mediaStream=A;const t=e=>{e.track===this.cA&&(A.removeEventListener("removetrack",t),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this.aA=0,this.emit(yn.Ended,this))};A.addEventListener("removetrack",t)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return Ze(this,void 0,void 0,(function*(){var A;if(null===(A=this.receiver)||void 0===A?void 0:A.getStats)return yield this.receiver.getStats()}))}setPlayoutDelay(A){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=A:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval((()=>this.monitorReceiver()),_r)),"undefined"!=typeof RTCRtpReceiver&&"getSynchronizationSources"in RTCRtpReceiver&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const A=()=>{var t;this.timeSyncHandle=requestAnimationFrame((()=>A()));const e=null===(t=this.receiver)||void 0===t?void 0:t.getSynchronizationSources()[0];if(e){const{timestamp:A,rtpTimestamp:t}=e;t&&this.rtpTimestamp!==t&&(this.emit(yn.TimeSyncUpdate,{timestamp:A,rtpTimestamp:t}),this.rtpTimestamp=t)}};A()}}class Do extends Oo{constructor(A,t,e,i,n,s){super(A,t,Xn.Kind.Audio,e,s),this.monitorReceiver=()=>Ze(this,void 0,void 0,(function*(){if(!this.receiver)return void(this.aA=0);const A=yield this.getReceiverStats();A&&this.prevStats&&this.receiver&&(this.aA=Jr(A,this.prevStats)),this.prevStats=A})),this.audioContext=i,this.webAudioPluginNodes=[],n&&(this.sinkId=n.deviceId)}setVolume(A){var t;for(const e of this.attachedElements)this.audioContext?null===(t=this.gainNode)||void 0===t||t.gain.setTargetAtTime(A,0,.1):e.volume=A;gs()&&this.cA.vA(A),this.elementVolume=A}getVolume(){if(this.elementVolume)return this.elementVolume;if(gs())return 1;let A=0;return this.attachedElements.forEach((t=>{t.volume>A&&(A=t.volume)})),A}setSinkId(A){return Ze(this,void 0,void 0,(function*(){this.sinkId=A,yield Promise.all(this.attachedElements.map((t=>{if(ls(t))return t.setSinkId(A)})))}))}attach(A){const t=0===this.attachedElements.length;return A?super.attach(A):A=super.attach(),this.sinkId&&ls(A)&&A.setSinkId(this.sinkId).catch((A=>{this.log.error("Failed to set sink id on remote audio track",A,this.logContext)})),this.audioContext&&t&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,A),A.volume=0,A.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),A}detach(A){let t;return A?(t=super.detach(A),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(t=super.detach(),this.disconnectWebAudio()),t}setAudioContext(A){this.audioContext=A,A&&this.attachedElements.length>0?this.connectWebAudio(A,this.attachedElements[0]):A||this.disconnectWebAudio()}setWebAudioPlugins(A){this.webAudioPluginNodes=A,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(A,t){this.disconnectWebAudio(),this.sourceNode=A.createMediaStreamSource(t.srcObject);let e=this.sourceNode;this.webAudioPluginNodes.forEach((A=>{e.connect(A),e=A})),this.gainNode=A.createGain(),e.connect(this.gainNode),this.gainNode.connect(A.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),"running"!==A.state&&A.resume().then((()=>{"running"!==A.state&&this.emit(yn.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))})).catch((A=>{this.emit(yn.AudioPlaybackFailed,A)}))}disconnectWebAudio(){var A,t;null===(A=this.gainNode)||void 0===A||A.disconnect(),null===(t=this.sourceNode)||void 0===t||t.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return Ze(this,void 0,void 0,(function*(){if(!this.receiver||!this.receiver.getStats)return;let A;return(yield this.receiver.getStats()).forEach((t=>{"inbound-rtp"===t.type&&(A={type:"audio",streamId:t.id,timestamp:t.timestamp,jitter:t.jitter,bytesReceived:t.bytesReceived,concealedSamples:t.concealedSamples,concealmentEvents:t.concealmentEvents,silentConcealedSamples:t.silentConcealedSamples,silentConcealmentEvents:t.silentConcealmentEvents,totalAudioEnergy:t.totalAudioEnergy,totalSamplesDuration:t.totalSamplesDuration})})),A}))}}class Mo extends Oo{constructor(A,t,e,i,n){super(A,t,Xn.Kind.Video,e,n),this.elementInfos=[],this.monitorReceiver=()=>Ze(this,void 0,void 0,(function*(){if(!this.receiver)return void(this.aA=0);const A=yield this.getReceiverStats();A&&this.prevStats&&this.receiver&&(this.aA=Jr(A,this.prevStats)),this.prevStats=A})),this.debouncedHandleResize=br((()=>{this.updateDimensions()}),100),this.adaptiveStreamSettings=i}get isAdaptiveStream(){return void 0!==this.adaptiveStreamSettings}get mediaStreamTrack(){return this.cA}setMuted(A){super.setMuted(A),this.attachedElements.forEach((t=>{A?Zn(this.cA,t):Yn(this.cA,t)}))}attach(A){if(A?super.attach(A):A=super.attach(),this.adaptiveStreamSettings&&void 0===this.elementInfos.find((t=>t.element===A))){const t=new Lo(A);this.observeElementInfo(t)}return A}observeElementInfo(A){this.adaptiveStreamSettings&&void 0===this.elementInfos.find((t=>t===A))?(A.handleResize=()=>{this.debouncedHandleResize()},A.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(A),A.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(A){if(!this.isAdaptiveStream)return void this.log.warn("stopObservingElementInfo ignored",this.logContext);const t=this.elementInfos.filter((t=>t===A));for(const e of t)e.stopObserving();this.elementInfos=this.elementInfos.filter((t=>t!==A)),this.updateVisibility(),this.debouncedHandleResize()}detach(A){let t=[];if(A)return this.stopObservingElement(A),super.detach(A);t=super.detach();for(const e of t)this.stopObservingElement(e);return t}getDecoderImplementation(){var A;return null===(A=this.prevStats)||void 0===A?void 0:A.decoderImplementation}getReceiverStats(){return Ze(this,void 0,void 0,(function*(){if(!this.receiver||!this.receiver.getStats)return;const A=yield this.receiver.getStats();let t,e="",i=new Map;return A.forEach((A=>{"inbound-rtp"===A.type?(e=A.codecId,t={type:"video",streamId:A.id,framesDecoded:A.framesDecoded,framesDropped:A.framesDropped,framesReceived:A.framesReceived,packetsReceived:A.packetsReceived,packetsLost:A.packetsLost,frameWidth:A.frameWidth,frameHeight:A.frameHeight,pliCount:A.pliCount,firCount:A.firCount,nackCount:A.nackCount,jitter:A.jitter,timestamp:A.timestamp,bytesReceived:A.bytesReceived,decoderImplementation:A.decoderImplementation}):"codec"===A.type&&i.set(A.id,A)})),t&&""!==e&&i.get(e)&&(t.mimeType=i.get(e).mimeType),t}))}stopObservingElement(A){const t=this.elementInfos.filter((t=>t.element===A));for(const e of t)this.stopObservingElementInfo(e)}handleAppVisibilityChanged(){const A=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return Ze(this,void 0,void 0,(function*(){yield A.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()}))}updateVisibility(){var A,t;const e=this.elementInfos.reduce(((A,t)=>Math.max(A,t.visibilityChangedAt||0)),0),i=!(null!==(t=null===(A=this.adaptiveStreamSettings)||void 0===A?void 0:A.pauseVideoInBackground)&&void 0!==t&&!t)&&this.isInBackground,n=this.elementInfos.some((A=>A.pictureInPicture)),s=this.elementInfos.some((A=>A.visible))&&!i||n;this.lastVisible!==s&&(!s&&Date.now()-e<100?jn.setTimeout((()=>{this.updateVisibility()}),100):(this.lastVisible=s,this.emit(yn.VisibilityChanged,s,this)))}updateDimensions(){var A,t;let e=0,i=0;const n=this.getPixelDensity();for(const s of this.elementInfos){const A=s.width()*n,t=s.height()*n;A+t>e+i&&(e=A,i=t)}(null===(A=this.lastDimensions)||void 0===A?void 0:A.width)===e&&(null===(t=this.lastDimensions)||void 0===t?void 0:t.height)===i||(this.lastDimensions={width:e,height:i},this.emit(yn.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var A;const t=null===(A=this.adaptiveStreamSettings)||void 0===A?void 0:A.pixelDensity;return"screen"===t?ps():t||(ps()>2?2:1)}}class Lo{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(A,t){this.onVisibilityChanged=A=>{var t;const{target:e,isIntersecting:i}=A;e===this.element&&(this.isIntersecting=i,this.isPiP=Ro(this.element),this.visibilityChangedAt=Date.now(),null===(t=this.handleVisibilityChanged)||void 0===t||t.call(this))},this.onEnterPiP=()=>{var A,t,e;null===(t=null===(A=window.documentPictureInPicture)||void 0===A?void 0:A.window)||void 0===t||t.addEventListener("pagehide",this.onLeavePiP),this.isPiP=Ro(this.element),null===(e=this.handleVisibilityChanged)||void 0===e||e.call(this)},this.onLeavePiP=()=>{var A;this.isPiP=Ro(this.element),null===(A=this.handleVisibilityChanged)||void 0===A||A.call(this)},this.element=A,this.isIntersecting=null!=t?t:No(A),this.isPiP=fs()&&Ro(A),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var A,t,e;this.isIntersecting=No(this.element),this.isPiP=Ro(this.element),this.element.handleResize=()=>{var A;null===(A=this.handleResize)||void 0===A||A.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,Hs().observe(this.element),bs().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),null===(A=window.documentPictureInPicture)||void 0===A||A.addEventListener("enter",this.onEnterPiP),null===(e=null===(t=window.documentPictureInPicture)||void 0===t?void 0:t.window)||void 0===e||e.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var A,t,e,i,n;null===(A=Hs())||void 0===A||A.unobserve(this.element),null===(t=bs())||void 0===t||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),null===(e=window.documentPictureInPicture)||void 0===e||e.removeEventListener("enter",this.onEnterPiP),null===(n=null===(i=window.documentPictureInPicture)||void 0===i?void 0:i.window)||void 0===n||n.removeEventListener("pagehide",this.onLeavePiP)}}function Ro(A){var t,e;return document.pictureInPictureElement===A||!!(null===(t=window.documentPictureInPicture)||void 0===t?void 0:t.window)&&No(A,null===(e=window.documentPictureInPicture)||void 0===e?void 0:e.window)}function No(A,t){const e=t||window;let i=A.offsetTop,n=A.offsetLeft;const s=A.offsetWidth,r=A.offsetHeight,{hidden:o}=A,{display:a}=getComputedStyle(A);for(;A.offsetParent;)i+=(A=A.offsetParent).offsetTop,n+=A.offsetLeft;return i<e.pageYOffset+e.innerHeight&&n<e.pageXOffset+e.innerWidth&&i+r>e.pageYOffset&&n+s>e.pageXOffset&&!o&&"none"!==a}class Go extends $e.EventEmitter{constructor(A,t,e,i){var n;super(),this.metadataMuted=!1,this.encryption=ot.NONE,this.log=Pe,this.handleMuted=()=>{this.emit(yn.Muted)},this.handleUnmuted=()=>{this.emit(yn.Unmuted)},this.log=_e(null!==(n=null==i?void 0:i.loggerName)&&void 0!==n?n:Ge.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=A,this.trackSid=t,this.trackName=e,this.source=Xn.Source.Unknown}setTrack(A){this.track&&(this.track.off(yn.Muted,this.handleMuted),this.track.off(yn.Unmuted,this.handleUnmuted)),this.track=A,A&&(A.on(yn.Muted,this.handleMuted),A.on(yn.Unmuted,this.handleUnmuted))}get logContext(){var A;return Object.assign(Object.assign({},null===(A=this.loggerContextCb)||void 0===A?void 0:A.call(this)),Ar(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return void 0!==this.track}get isEncrypted(){return this.encryption!==ot.NONE}get audioTrack(){if(Ns(this.track))return this.track}get videoTrack(){if(Gs(this.track))return this.track}updateInfo(A){this.trackSid=A.sid,this.trackName=A.name,this.source=Xn.sourceFromProto(A.source),this.mimeType=A.mimeType,this.kind===Xn.Kind.Video&&A.width>0&&(this.dimensions={width:A.width,height:A.height},this.simulcasted=A.simulcast),this.encryption=A.encryption,this.trackInfo=A,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:A}))}}(go=(fo=Go||(Go={})).SubscriptionStatus||(fo.SubscriptionStatus={})).Desired="desired",go.Subscribed="subscribed",go.Unsubscribed="unsubscribed",(Qo=fo.PermissionStatus||(fo.PermissionStatus={})).Allowed="allowed",Qo.NotAllowed="not_allowed";class xo extends Go{get isUpstreamPaused(){var A;return null===(A=this.track)||void 0===A?void 0:A.isUpstreamPaused}constructor(A,t,e,i){super(A,t.sid,t.name,i),this.track=void 0,this.handleTrackEnded=()=>{this.emit(yn.Ended)},this.updateInfo(t),this.setTrack(e)}setTrack(A){this.track&&this.track.off(yn.Ended,this.handleTrackEnded),super.setTrack(A),A&&A.on(yn.Ended,this.handleTrackEnded)}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return Ze(this,void 0,void 0,(function*(){var A;return null===(A=this.track)||void 0===A?void 0:A.mute()}))}unmute(){return Ze(this,void 0,void 0,(function*(){var A;return null===(A=this.track)||void 0===A?void 0:A.unmute()}))}pauseUpstream(){return Ze(this,void 0,void 0,(function*(){var A;yield null===(A=this.track)||void 0===A?void 0:A.pauseUpstream()}))}resumeUpstream(){return Ze(this,void 0,void 0,(function*(){var A;yield null===(A=this.track)||void 0===A?void 0:A.resumeUpstream()}))}getTrackFeatures(){var A;if(Ns(this.track)){const t=this.track.getSourceTrackSettings(),e=new Set;return t.autoGainControl&&e.add($A.TF_AUTO_GAIN_CONTROL),t.echoCancellation&&e.add($A.TF_ECHO_CANCELLATION),t.noiseSuppression&&e.add($A.TF_NOISE_SUPPRESSION),t.channelCount&&t.channelCount>1&&e.add($A.TF_STEREO),(null===(A=this.options)||void 0===A?void 0:A.dtx)||e.add($A.TF_NO_DTX),this.track.enhancedNoiseCancellation&&e.add($A.TF_ENHANCED_NOISE_CANCELLATION),Array.from(e.values())}return[]}}function Vo(A,t){return Ze(this,void 0,void 0,(function*(){null!=A||(A={});let e=!1;const{audioProcessor:i,videoProcessor:n,optionsWithoutProcessor:s}=tr(A);let r=s.audio,o=s.video;if(i&&"object"==typeof s.audio&&(s.audio.processor=i),n&&"object"==typeof s.video&&(s.video.processor=n),A.audio&&"object"==typeof s.audio&&"string"==typeof s.audio.deviceId){const A=s.audio.deviceId;s.audio.deviceId={exact:A},e=!0,r=Object.assign(Object.assign({},s.audio),{deviceId:{ideal:A}})}if(s.video&&"object"==typeof s.video&&"string"==typeof s.video.deviceId){const A=s.video.deviceId;s.video.deviceId={exact:A},e=!0,o=Object.assign(Object.assign({},s.video),{deviceId:{ideal:A}})}(!0===s.audio||"object"==typeof s.audio&&!s.audio.deviceId)&&(s.audio={deviceId:"default"}),!0===s.video?s.video={deviceId:"default"}:"object"!=typeof s.video||s.video.deviceId||(s.video.deviceId="default");const a=Js(s,Dr,Mr),c=Ys(a),h=navigator.mediaDevices.getUserMedia(c);s.audio&&(nr.userMediaPromiseMap.set("audioinput",h),h.catch((()=>nr.userMediaPromiseMap.delete("audioinput")))),s.video&&(nr.userMediaPromiseMap.set("videoinput",h),h.catch((()=>nr.userMediaPromiseMap.delete("videoinput"))));try{const A=yield h;return yield Promise.all(A.getTracks().map((e=>Ze(this,void 0,void 0,(function*(){const s="audio"===e.kind;let r,o=s?a.audio:a.video;"boolean"!=typeof o&&o||(o={});const h=s?c.audio:c.video;"boolean"!=typeof h&&(r=h);const u=e.getSettings().deviceId;(null==r?void 0:r.deviceId)&&Ks(r.deviceId)!==u?r.deviceId=u:r||(r={deviceId:u});const l=function(A,t,e){switch(A.kind){case"audio":return new Yr(A,t,!1,void 0,e);case"video":return new ro(A,t,!1,e);default:throw new Tn("unsupported track type: ".concat(A.kind))}}(e,r,t);return l.kind===Xn.Kind.Video?l.source=Xn.Source.Camera:l.kind===Xn.Kind.Audio&&(l.source=Xn.Source.Microphone),l.mediaStream=A,Ns(l)&&i?yield l.setProcessor(i):Gs(l)&&n&&(yield l.setProcessor(n)),l})))))}catch(u){if(!e)throw u;return Vo(Object.assign(Object.assign({},A),{audio:r,video:o}),t)}}))}(mo=vo||(vo={})).Excellent="excellent",mo.Good="good",mo.Poor="poor",mo.Lost="lost",mo.Unknown="unknown";class jo extends $e.EventEmitter{get logContext(){var A,t;return Object.assign({},null===(t=null===(A=this.loggerOptions)||void 0===A?void 0:A.loggerContextCb)||void 0===t?void 0:t.call(A))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every((A=>A.isEncrypted))}get isAgent(){var A;return(null===(A=this.permissions)||void 0===A?void 0:A.agent)||this.kind===st.AGENT}get isActive(){var A;return(null===(A=this.participantInfo)||void 0===A?void 0:A.state)===nt.ACTIVE}get kind(){return this.mA}get attributes(){return Object.freeze(Object.assign({},this.pA))}constructor(A,t,e,i,n,s){let r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:st.STANDARD;var o;super(),this.audioLevel=0,this.isSpeaking=!1,this.UA=vo.Unknown,this.log=Pe,this.log=_e(null!==(o=null==s?void 0:s.loggerName)&&void 0!==o?o:Ge.Participant),this.loggerOptions=s,this.setMaxListeners(100),this.sid=A,this.identity=t,this.name=e,this.metadata=i,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.mA=r,this.pA=null!=n?n:{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(A){for(const[,t]of this.trackPublications)if(t.source===A)return t}getTrackPublicationByName(A){for(const[,t]of this.trackPublications)if(t.trackName===A)return t}waitUntilActive(){return this.isActive?Promise.resolve():(this.activeFuture||(this.activeFuture=new Ss,this.once(pn.Active,(()=>{var A,t;null===(t=null===(A=this.activeFuture)||void 0===A?void 0:A.resolve)||void 0===t||t.call(A),this.activeFuture=void 0}))),this.activeFuture.promise)}get connectionQuality(){return this.UA}get isCameraEnabled(){var A;const t=this.getTrackPublication(Xn.Source.Camera);return!(null===(A=null==t?void 0:t.isMuted)||void 0===A||A)}get isMicrophoneEnabled(){var A;const t=this.getTrackPublication(Xn.Source.Microphone);return!(null===(A=null==t?void 0:t.isMuted)||void 0===A||A)}get isScreenShareEnabled(){return!!this.getTrackPublication(Xn.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(1e3*Number.parseInt(this.participantInfo.joinedAt.toString())):new Date}updateInfo(A){var t;return!(this.participantInfo&&this.participantInfo.sid===A.sid&&this.participantInfo.version>A.version||(this.identity=A.identity,this.sid=A.sid,this.CA(A.name),this.FA(A.metadata),this.yA(A.attributes),A.state===nt.ACTIVE&&(null===(t=this.participantInfo)||void 0===t?void 0:t.state)!==nt.ACTIVE&&this.emit(pn.Active),A.permission&&this.setPermissions(A.permission),this.participantInfo=A,0))}FA(A){const t=this.metadata!==A,e=this.metadata;this.metadata=A,t&&this.emit(pn.ParticipantMetadataChanged,e)}CA(A){const t=this.name!==A;this.name=A,t&&this.emit(pn.ParticipantNameChanged,A)}yA(A){const t=function(A,t){var e;void 0===A&&(A={}),void 0===t&&(t={});const i=[...Object.keys(t),...Object.keys(A)],n={};for(const s of i)A[s]!==t[s]&&(n[s]=null!==(e=t[s])&&void 0!==e?e:"");return n}(this.attributes,A);this.pA=A,Object.keys(t).length>0&&this.emit(pn.AttributesChanged,t)}setPermissions(A){var t,e,i,n,s,r;const o=this.permissions,a=A.canPublish!==(null===(t=this.permissions)||void 0===t?void 0:t.canPublish)||A.canSubscribe!==(null===(e=this.permissions)||void 0===e?void 0:e.canSubscribe)||A.canPublishData!==(null===(i=this.permissions)||void 0===i?void 0:i.canPublishData)||A.hidden!==(null===(n=this.permissions)||void 0===n?void 0:n.hidden)||A.recorder!==(null===(s=this.permissions)||void 0===s?void 0:s.recorder)||A.canPublishSources.length!==this.permissions.canPublishSources.length||A.canPublishSources.some(((A,t)=>{var e;return A!==(null===(e=this.permissions)||void 0===e?void 0:e.canPublishSources[t])}))||A.canSubscribeMetrics!==(null===(r=this.permissions)||void 0===r?void 0:r.canSubscribeMetrics);return this.permissions=A,a&&this.emit(pn.ParticipantPermissionsChanged,o),a}setIsSpeaking(A){A!==this.isSpeaking&&(this.isSpeaking=A,A&&(this.lastSpokeAt=new Date),this.emit(pn.IsSpeakingChanged,A))}setConnectionQuality(A){const t=this.UA;this.UA=function(A){switch(A){case YA.EXCELLENT:return vo.Excellent;case YA.GOOD:return vo.Good;case YA.POOR:return vo.Poor;case YA.LOST:return vo.Lost;default:return vo.Unknown}}(A),t!==this.UA&&this.emit(pn.ConnectionQualityChanged,this.UA)}setDisconnected(){var A,t;this.activeFuture&&(null===(t=(A=this.activeFuture).reject)||void 0===t||t.call(A,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(A){this.audioContext=A,this.audioTrackPublications.forEach((t=>Ns(t.track)&&t.track.setAudioContext(A)))}addTrackPublication(A){A.on(yn.Muted,(()=>{this.emit(pn.TrackMuted,A)})),A.on(yn.Unmuted,(()=>{this.emit(pn.TrackUnmuted,A)}));const t=A;switch(t.track&&(t.track.sid=A.trackSid),this.trackPublications.set(A.trackSid,A),A.kind){case Xn.Kind.Audio:this.audioTrackPublications.set(A.trackSid,A);break;case Xn.Kind.Video:this.videoTrackPublications.set(A.trackSid,A)}}}class Po extends jo{constructor(A,t,e,i,n){super(A,t,void 0,void 0,void 0,{loggerName:i.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=ot.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new Ss)},this.handleReconnected=()=>{var A,t;null===(t=null===(A=this.reconnectFuture)||void 0===A?void 0:A.resolve)||void 0===t||t.call(A),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleDisconnected=()=>{var A,t;this.reconnectFuture&&(this.reconnectFuture.promise.catch((A=>this.log.warn(A.message,this.logContext))),null===(t=null===(A=this.reconnectFuture)||void 0===A?void 0:A.reject)||void 0===t||t.call(A,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0)},this.handleSignalRequestResponse=A=>{const{requestId:t,reason:e,message:i}=A,n=this.pendingSignalRequests.get(t);n&&(e!==Te.OK&&n.reject(new Mn(i,e)),this.pendingSignalRequests.delete(t))},this.handleDataPacket=A=>{switch(A.value.case){case"rpcResponse":let t=A.value.value,e=null,i=null;"payload"===t.value.case?e=t.value.value:"error"===t.value.case&&(i=Vr.fromProto(t.value.value)),this.handleIncomingRpcResponse(t.requestId,e,i);break;case"rpcAck":let n=A.value.value;this.handleIncomingRpcAck(n.requestId)}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map((A=>function(A){var t,e,i;if(!A.participantSid&&!A.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Qe({participantIdentity:null!==(t=A.participantIdentity)&&void 0!==t?t:"",participantSid:null!==(e=A.participantSid)&&void 0!==e?e:"",allTracks:null!==(i=A.allowAll)&&void 0!==i&&i,trackSids:A.allowedTrackSids||[]})}(A))))},this.onTrackUnmuted=A=>{this.onTrackMuted(A,A.isUpstreamPaused)},this.onTrackMuted=(A,t)=>{void 0===t&&(t=!0),A.sid?this.engine.updateMuteStatus(A.sid,t):this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),Ar(A)))},this.onTrackUpstreamPaused=A=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),Ar(A))),this.onTrackMuted(A,!0)},this.onTrackUpstreamResumed=A=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),Ar(A))),this.onTrackMuted(A,A.isMuted)},this.onTrackFeatureUpdate=A=>{const t=this.audioTrackPublications.get(A.sid);t?this.engine.client.sendUpdateLocalAudioTrack(t.trackSid,t.getTrackFeatures()):this.log.warn("Could not update local audio track settings, missing publication for track ".concat(A.sid),this.logContext)},this.handleSubscribedQualityUpdate=A=>Ze(this,void 0,void 0,(function*(){var t,e,i,n,s,r;if(!(null===(s=this.roomOptions)||void 0===s?void 0:s.dynacast))return;const o=this.videoTrackPublications.get(A.trackSid);if(o)if(A.subscribedCodecs.length>0){if(!o.videoTrack)return;const s=yield o.videoTrack.setPublishingCodecs(A.subscribedCodecs);try{for(var a,c=!0,h=We(s);!(t=(a=yield h.next()).done);c=!0){n=a.value,c=!1;const A=n;$n(A)&&(this.log.debug("publish ".concat(A," for ").concat(o.videoTrack.sid),Object.assign(Object.assign({},this.logContext),Ar(o))),yield this.publishAdditionalCodecForTrack(o.videoTrack,A,o.options))}}catch(u){e={error:u}}finally{try{c||t||!(i=h.return)||(yield i.call(h))}finally{if(e)throw e.error}}}else A.subscribedQualities.length>0&&(yield null===(r=o.videoTrack)||void 0===r?void 0:r.setPublishingLayers(A.subscribedQualities));else this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:A.trackSid}))})),this.handleLocalTrackUnpublished=A=>{const t=this.trackPublications.get(A.trackSid);t?this.unpublishTrack(t.track):this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:A.trackSid}))},this.handleTrackEnded=A=>Ze(this,void 0,void 0,(function*(){if(A.source===Xn.Source.ScreenShare||A.source===Xn.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),Ar(A))),this.unpublishTrack(A);else if(A.isUserProvided)yield A.mute();else if(Vs(A)||xs(A))try{if(fs())try{const t=yield null===navigator||void 0===navigator?void 0:navigator.permissions.query({name:A.source===Xn.Source.Camera?"camera":"microphone"});if(t&&"denied"===t.state)throw this.log.warn("user has revoked access to ".concat(A.source),Object.assign(Object.assign({},this.logContext),Ar(A))),t.onchange=()=>{"denied"!==t.state&&(A.isMuted||A.restartTrack(),t.onchange=null)},new Error("GetUserMedia Permission denied")}catch(t){}A.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),Ar(A))),Vs(A)?yield A.restartTrack({deviceId:"default"}):yield A.restartTrack())}catch(t){this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),Ar(A))),yield A.mute()}})),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=e,this.roomOptions=i,this.setupEngine(e),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=n}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==ot.NONE}getTrackPublication(A){const t=super.getTrackPublication(A);if(t)return t}getTrackPublicationByName(A){const t=super.getTrackPublicationByName(A);if(t)return t}setupEngine(A){this.engine=A,this.engine.on(Cn.RemoteMute,((A,t)=>{const e=this.trackPublications.get(A);e&&e.track&&(t?e.mute():e.unmute())})),this.engine.on(Cn.Connected,this.handleReconnected).on(Cn.SignalRestarted,this.handleReconnected).on(Cn.SignalResumed,this.handleReconnected).on(Cn.Restarting,this.handleReconnecting).on(Cn.Resuming,this.handleReconnecting).on(Cn.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(Cn.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(Cn.Disconnected,this.handleDisconnected).on(Cn.SignalRequestResponse,this.handleSignalRequestResponse).on(Cn.DataPacketReceived,this.handleDataPacket)}setMetadata(A){return Ze(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({metadata:A})}))}setName(A){return Ze(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({name:A})}))}setAttributes(A){return Ze(this,void 0,void 0,(function*(){yield this.requestMetadataUpdate({attributes:A})}))}requestMetadataUpdate(A){return Ze(this,arguments,void 0,(function(A){var t=this;let{metadata:e,name:i,attributes:n}=A;return function*(){return new Promise(((A,s)=>Ze(t,void 0,void 0,(function*(){var t,r;try{let o=!1;const a=yield this.engine.client.sendUpdateLocalMetadata(null!==(t=null!=e?e:this.metadata)&&void 0!==t?t:"",null!==(r=null!=i?i:this.name)&&void 0!==r?r:"",n),c=performance.now();for(this.pendingSignalRequests.set(a,{resolve:A,reject:A=>{s(A),o=!0},values:{name:i,metadata:e,attributes:n}});performance.now()-c<5e3&&!o;){if((!i||this.name===i)&&(!e||this.metadata===e)&&(!n||Object.entries(n).every((A=>{let[t,e]=A;return this.attributes[t]===e||""===e&&!this.attributes[t]}))))return this.pendingSignalRequests.delete(a),void A();yield as(50)}s(new Mn("Request to update local metadata timed out","TimeoutError"))}catch(o){o instanceof Error&&s(o)}}))))}()}))}setCameraEnabled(A,t,e){return this.setTrackEnabled(Xn.Source.Camera,A,t,e)}setMicrophoneEnabled(A,t,e){return this.setTrackEnabled(Xn.Source.Microphone,A,t,e)}setScreenShareEnabled(A,t,e){return this.setTrackEnabled(Xn.Source.ScreenShare,A,t,e)}setPermissions(A){const t=this.permissions,e=super.setPermissions(A);return e&&t&&this.emit(pn.ParticipantPermissionsChanged,t),e}setE2EEEnabled(A){return Ze(this,void 0,void 0,(function*(){this.encryptionType=A?ot.GCM:ot.NONE,yield this.republishAllTracks(void 0,!1)}))}setTrackEnabled(A,t,e,i){return Ze(this,void 0,void 0,(function*(){var n,s;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:A,enabled:t})),this.republishPromise&&(yield this.republishPromise);let r=this.getTrackPublication(A);if(t)if(r)yield r.unmute();else{let t;if(this.pendingPublishing.has(A)){const t=yield this.waitForPendingPublicationOfSource(A);return t||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:A})),yield null==t?void 0:t.unmute(),t}this.pendingPublishing.add(A);try{switch(A){case Xn.Source.Camera:t=yield this.createTracks({video:null===(n=e)||void 0===n||n});break;case Xn.Source.Microphone:t=yield this.createTracks({audio:null===(s=e)||void 0===s||s});break;case Xn.Source.ScreenShare:t=yield this.createScreenTracks(Object.assign({},e));break;default:throw new Tn(A)}}catch(o){throw null==t||t.forEach((A=>{A.stop()})),o instanceof Error&&this.emit(pn.MediaDevicesError,o),this.pendingPublishing.delete(A),o}try{const A=[];for(const n of t)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),Ar(n))),A.push(this.publishTrack(n,i));const e=yield Promise.all(A);[r]=e}catch(o){throw null==t||t.forEach((A=>{A.stop()})),o}finally{this.pendingPublishing.delete(A)}}else if(!(null==r?void 0:r.track)&&this.pendingPublishing.has(A)&&(r=yield this.waitForPendingPublicationOfSource(A),r||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:A}))),r&&r.track)if(A===Xn.Source.ScreenShare){r=yield this.unpublishTrack(r.track);const A=this.getTrackPublication(Xn.Source.ScreenShareAudio);A&&A.track&&this.unpublishTrack(A.track)}else yield r.mute();return r}))}enableCameraAndMicrophone(){return Ze(this,void 0,void 0,(function*(){if(!this.pendingPublishing.has(Xn.Source.Camera)&&!this.pendingPublishing.has(Xn.Source.Microphone)){this.pendingPublishing.add(Xn.Source.Camera),this.pendingPublishing.add(Xn.Source.Microphone);try{const A=yield this.createTracks({audio:!0,video:!0});yield Promise.all(A.map((A=>this.publishTrack(A))))}finally{this.pendingPublishing.delete(Xn.Source.Camera),this.pendingPublishing.delete(Xn.Source.Microphone)}}}))}createTracks(A){return Ze(this,void 0,void 0,(function*(){var t,e;null!=A||(A={});const i=Js(A,null===(t=this.roomOptions)||void 0===t?void 0:t.audioCaptureDefaults,null===(e=this.roomOptions)||void 0===e?void 0:e.videoCaptureDefaults);try{return(yield Vo(i,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map((A=>(Ns(A)&&(this.microphoneError=void 0,A.setAudioContext(this.audioContext),A.source=Xn.Source.Microphone,this.emit(pn.AudioStreamAcquired)),Gs(A)&&(this.cameraError=void 0,A.source=Xn.Source.Camera),A)))}catch(n){throw n instanceof Error&&(A.audio&&(this.microphoneError=n),A.video&&(this.cameraError=n)),n}}))}createScreenTracks(A){return Ze(this,void 0,void 0,(function*(){if(void 0===A&&(A={}),void 0===navigator.mediaDevices.getDisplayMedia)throw new kn("getDisplayMedia not supported");void 0!==A.resolution||function(){const A=Nn();return"Safari"===(null==A?void 0:A.name)&&A.version.startsWith("17.")}()||(A.resolution=rs.h1080fps30.resolution);const t=function(A){var t,e;let i=null===(t=A.video)||void 0===t||t;return A.resolution&&A.resolution.width>0&&A.resolution.height>0&&(i="boolean"==typeof i?{}:i,i=Bs()?Object.assign(Object.assign({},i),{width:{max:A.resolution.width},height:{max:A.resolution.height},frameRate:A.resolution.frameRate}):Object.assign(Object.assign({},i),{width:{ideal:A.resolution.width},height:{ideal:A.resolution.height},frameRate:A.resolution.frameRate})),{audio:null!==(e=A.audio)&&void 0!==e&&e,video:i,controller:A.controller,selfBrowserSurface:A.selfBrowserSurface,surfaceSwitching:A.surfaceSwitching,systemAudio:A.systemAudio,preferCurrentTab:A.preferCurrentTab}}(A),e=yield navigator.mediaDevices.getDisplayMedia(t),i=e.getVideoTracks();if(0===i.length)throw new Tn("no video track found");const n=new ro(i[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});n.source=Xn.Source.ScreenShare,A.contentHint&&(n.mediaStreamTrack.contentHint=A.contentHint);const s=[n];if(e.getAudioTracks().length>0){this.emit(pn.AudioStreamAcquired);const A=new Yr(e.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});A.source=Xn.Source.ScreenShareAudio,s.push(A)}return s}))}publishTrack(A,t){return Ze(this,void 0,void 0,(function*(){return this.publishOrRepublishTrack(A,t)}))}publishOrRepublishTrack(A,t){return Ze(this,arguments,void 0,(function(A,t){var e=this;let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function*(){var n,s,r,o;let a,c;if(Vs(A)&&A.setAudioContext(e.audioContext),yield null===(n=e.reconnectFuture)||void 0===n?void 0:n.promise,e.republishPromise&&!i&&(yield e.republishPromise),Rs(A)&&e.pendingPublishPromises.has(A)&&(yield e.pendingPublishPromises.get(A)),A instanceof MediaStreamTrack)a=A.getConstraints();else{let t;switch(a=A.constraints,A.source){case Xn.Source.Microphone:t="audioinput";break;case Xn.Source.Camera:t="videoinput"}t&&e.activeDeviceMap.has(t)&&(a=Object.assign(Object.assign({},a),{deviceId:e.activeDeviceMap.get(t)}))}if(A instanceof MediaStreamTrack)switch(A.kind){case"audio":A=new Yr(A,a,!0,e.audioContext,{loggerName:e.roomOptions.loggerName,loggerContextCb:()=>e.logContext});break;case"video":A=new ro(A,a,!0,{loggerName:e.roomOptions.loggerName,loggerContextCb:()=>e.logContext});break;default:throw new Tn("unsupported MediaStreamTrack kind ".concat(A.kind))}else A.updateLoggerOptions({loggerName:e.roomOptions.loggerName,loggerContextCb:()=>e.logContext});if(e.trackPublications.forEach((t=>{t.track&&t.track===A&&(c=t)})),c)return e.log.warn("track has already been published, skipping",Object.assign(Object.assign({},e.logContext),Ar(c))),c;const h="channelCount"in A.mediaStreamTrack.getSettings()&&2===A.mediaStreamTrack.getSettings().channelCount||2===A.mediaStreamTrack.getConstraints().channelCount,u=null!==(s=null==t?void 0:t.forceStereo)&&void 0!==s?s:h;u&&(t||(t={}),void 0===t.dtx&&e.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},e.logContext),Ar(A))),void 0===t.red&&e.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),null!==(r=t.dtx)&&void 0!==r||(t.dtx=!1),null!==(o=t.red)&&void 0!==o||(t.red=!1));const l=Object.assign(Object.assign({},e.roomOptions.publishDefaults),t);!function(){const A=Nn(),t="17.2";if(A)return"Safari"!==A.name&&"iOS"!==A.os||!!("iOS"===A.os&&A.osVersion&&Us(t,A.osVersion)>=0)||"Safari"===A.name&&Us(t,A.version)>=0}()&&e.roomOptions.e2ee&&(e.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},e.logContext)),l.simulcast=!1),l.source&&(A.source=l.source);const d=new Promise(((t,i)=>Ze(e,void 0,void 0,(function*(){try{if(this.engine.client.currentState!==hr.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:Ar(A)}));const e=()=>Ze(this,void 0,void 0,(function*(){try{const e=yield this.publish(A,l,u);t(e)}catch(e){i(e)}}));setTimeout((()=>{this.engine.off(Cn.SignalConnected,e),i(new Dn("publishing rejected as engine not connected within timeout",408))}),15e3),this.engine.once(Cn.SignalConnected,e),this.engine.on(Cn.Closing,(()=>{this.engine.off(Cn.SignalConnected,e),i(new Dn("publishing rejected as engine closed",499))}))}else try{const e=yield this.publish(A,l,u);t(e)}catch(e){i(e)}}catch(e){i(e)}}))));e.pendingPublishPromises.set(A,d);try{return yield d}catch(B){throw B}finally{e.pendingPublishPromises.delete(A)}}()}))}hasPermissionsToPublish(A){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),Ar(A))),!1;const{canPublish:t,canPublishSources:e}=this.permissions;return!(!t||0!==e.length&&!e.map((A=>function(A){switch(A){case JA.CAMERA:return Xn.Source.Camera;case JA.MICROPHONE:return Xn.Source.Microphone;case JA.SCREEN_SHARE:return Xn.Source.ScreenShare;case JA.SCREEN_SHARE_AUDIO:return Xn.Source.ScreenShareAudio;default:return Xn.Source.Unknown}}(A))).includes(A.source))||(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),Ar(A))),!1)}publish(A,t,e){return Ze(this,void 0,void 0,(function*(){var i,n,s,r,o,a,c,h,u,l;if(!this.hasPermissionsToPublish(A))throw new Dn("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find((t=>Rs(A)&&t.source===A.source))&&A.source!==Xn.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(A.source),Object.assign(Object.assign({},this.logContext),Ar(A))),t.stopMicTrackOnMute&&Ns(A)&&(A.stopOnMute=!0),A.source===Xn.Source.ScreenShare&&ds()&&(t.simulcast=!1),"av1"!==t.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(Bs())return!1;const A=RTCRtpSender.getCapabilities("video");let t=!1;if(A)for(const e of A.codecs)if("video/AV1"===e.mimeType){t=!0;break}return t}()||(t.videoCodec=void 0),"vp9"!==t.videoCodec||function(){if(!("getCapabilities"in RTCRtpSender))return!1;if(ds())return!1;if(Bs()){const A=Nn();if((null==A?void 0:A.version)&&Us(A.version,"16")<0)return!1}const A=RTCRtpSender.getCapabilities("video");let t=!1;if(A)for(const e of A.codecs)if("video/VP9"===e.mimeType){t=!0;break}return t}()||(t.videoCodec=void 0),void 0===t.videoCodec&&(t.videoCodec=Kr),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some((A=>t.videoCodec===zs(A.mime)))||(t.videoCodec=zs(this.enabledPublishVideoCodecs[0].mime)));const d=t.videoCodec;A.on(yn.Muted,this.onTrackMuted),A.on(yn.Unmuted,this.onTrackUnmuted),A.on(yn.Ended,this.handleTrackEnded),A.on(yn.UpstreamPaused,this.onTrackUpstreamPaused),A.on(yn.UpstreamResumed,this.onTrackUpstreamResumed),A.on(yn.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const B=new _t({cid:A.mediaStreamTrack.id,name:t.name,type:Xn.kindToProto(A.kind),muted:A.isMuted,source:Xn.sourceToProto(A.source),disableDtx:!(null===(i=t.dtx)||void 0===i||i),encryption:this.encryptionType,stereo:e,disableRed:this.isE2EEEnabled||!(null===(n=t.red)||void 0===n||n),stream:null==t?void 0:t.stream,backupCodecPolicy:null==t?void 0:t.backupCodecPolicy});let w;if(A.kind===Xn.Kind.Video){let e={width:0,height:0};try{e=yield A.waitForDimensions()}catch(v){const t=null!==(r=null===(s=this.roomOptions.videoCaptureDefaults)||void 0===s?void 0:s.resolution)&&void 0!==r?r:ns.h720.resolution;e={width:t.width,height:t.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),Ar(A)),{dims:e}))}B.width=e.width,B.height=e.height,xs(A)&&(us(d)&&(A.source===Xn.Source.ScreenShare&&(t.scalabilityMode="L1T3","contentHint"in A.mediaStreamTrack&&(A.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),Ar(A))))),t.scalabilityMode=null!==(o=t.scalabilityMode)&&void 0!==o?o:"L3T3_KEY"),B.simulcastCodecs=[new Pt({codec:d,cid:A.mediaStreamTrack.id})],!0===t.backupCodec&&(t.backupCodec={codec:Kr}),t.backupCodec&&d!==t.backupCodec.codec&&B.encryption===ot.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),B.simulcastCodecs.push(new Pt({codec:t.backupCodec.codec,cid:""})))),w=to(A.source===Xn.Source.ScreenShare,B.width,B.height,t),B.layers=co(B.width,B.height,w,us(t.videoCodec))}else A.kind===Xn.Kind.Audio&&(w=[{maxBitrate:null===(a=t.audioPreset)||void 0===a?void 0:a.maxBitrate,priority:null!==(h=null===(c=t.audioPreset)||void 0===c?void 0:c.priority)&&void 0!==h?h:"high",networkPriority:null!==(l=null===(u=t.audioPreset)||void 0===u?void 0:u.priority)&&void 0!==l?l:"high"}]);if(!this.engine||this.engine.isClosed)throw new Kn("cannot publish track when not connected");const f=()=>Ze(this,void 0,void 0,(function*(){var e,i,n;if(!this.engine.pcManager)throw new Kn("pcManager is not ready");if(A.sender=yield this.engine.createSender(A,t,w),xs(A)&&(null!==(e=t.degradationPreference)&&void 0!==e||(t.degradationPreference=function(A){return A.source===Xn.Source.ScreenShare||A.constraints.height&&Ks(A.constraints.height)>=1080?"maintain-resolution":"balanced"}(A)),A.setDegradationPreference(t.degradationPreference)),w)if(ds()&&A.kind===Xn.Kind.Audio){let t;for(const e of this.engine.pcManager.publisher.getTransceivers())if(e.sender===A.sender){t=e;break}t&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:t,codec:"opus",maxbr:(null===(i=w[0])||void 0===i?void 0:i.maxBitrate)?w[0].maxBitrate/1e3:0})}else A.codec&&us(A.codec)&&(null===(n=w[0])||void 0===n?void 0:n.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:B.cid,codec:A.codec,maxbr:w[0].maxBitrate/1e3});yield this.engine.negotiate()}));let g;if(this.enabledPublishVideoCodecs.length>0)g=(yield Promise.all([this.engine.addTrack(B),f()]))[0];else{let e;if(g=yield this.engine.addTrack(B),g.codecs.forEach((A=>{void 0===e&&(e=A.mimeType)})),e&&A.kind===Xn.Kind.Video){const i=zs(e);i!==d&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),Ar(A)),{codec:i})),t.videoCodec=i,w=to(A.source===Xn.Source.ScreenShare,B.width,B.height,t))}yield f()}const Q=new xo(A.kind,g,A,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});return Q.options=t,A.sid=g.sid,this.log.debug("publishing ".concat(A.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:w,trackInfo:g})),xs(A)?A.startMonitor(this.engine.client):Vs(A)&&A.startMonitor(),this.addTrackPublication(Q),this.emit(pn.LocalTrackPublished,Q),Q}))}get isLocal(){return!0}publishAdditionalCodecForTrack(A,t,e){return Ze(this,void 0,void 0,(function*(){var i;if(this.encryptionType!==ot.NONE)return;let n;if(this.trackPublications.forEach((t=>{t.track&&t.track===A&&(n=t)})),!n)throw new Tn("track is not published");if(!xs(A))throw new Tn("track is not a video track");const s=Object.assign(Object.assign({},null===(i=this.roomOptions)||void 0===i?void 0:i.publishDefaults),e),r=function(A,t,e){var i,n,s,r;if(!e.backupCodec||!0===e.backupCodec||e.backupCodec.codec===e.videoCodec)return;t!==e.backupCodec.codec&&Pe.warn("requested a different codec than specified as backup",{serverRequested:t,backup:e.backupCodec.codec}),e.videoCodec=t,e.videoEncoding=e.backupCodec.encoding;const o=A.mediaStreamTrack.getSettings(),a=null!==(i=o.width)&&void 0!==i?i:null===(n=A.dimensions)||void 0===n?void 0:n.width,c=null!==(s=o.height)&&void 0!==s?s:null===(r=A.dimensions)||void 0===r?void 0:r.height;return A.source===Xn.Source.ScreenShare&&e.simulcast&&(e.simulcast=!1),to(A.source===Xn.Source.ScreenShare,a,c,e)}(A,t,s);if(!r)return void this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),Ar(A)));const o=A.addSimulcastTrack(t,r);if(!o)return;const a=new _t({cid:o.mediaStreamTrack.id,type:Xn.kindToProto(A.kind),muted:A.isMuted,source:Xn.sourceToProto(A.source),sid:A.sid,simulcastCodecs:[{codec:s.videoCodec,cid:o.mediaStreamTrack.id}]});if(a.layers=co(a.width,a.height,r),!this.engine||this.engine.isClosed)throw new Kn("cannot publish track when not connected");const c=(yield Promise.all([this.engine.addTrack(a),(()=>Ze(this,void 0,void 0,(function*(){yield this.engine.createSimulcastSender(A,o,s,r),yield this.engine.negotiate()})))()]))[0];this.log.debug("published ".concat(t," for track ").concat(A.sid),Object.assign(Object.assign({},this.logContext),{encodings:r,trackInfo:c}))}))}unpublishTrack(A,t){return Ze(this,void 0,void 0,(function*(){var e,i;if(Rs(A)){const t=this.pendingPublishPromises.get(A);t&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),Ar(A))),yield t)}const n=this.getPublicationForTrack(A),s=n?Ar(n):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),s)),!n||!n.track)return void this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),s));(A=n.track).off(yn.Muted,this.onTrackMuted),A.off(yn.Unmuted,this.onTrackUnmuted),A.off(yn.Ended,this.handleTrackEnded),A.off(yn.UpstreamPaused,this.onTrackUpstreamPaused),A.off(yn.UpstreamResumed,this.onTrackUpstreamResumed),A.off(yn.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),void 0===t&&(t=null===(i=null===(e=this.roomOptions)||void 0===e?void 0:e.stopLocalTrackOnUnpublish)||void 0===i||i),t?A.stop():A.stopMonitor();let r=!1;const o=A.sender;if(A.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<Nr.FAILED&&o)try{for(const A of this.engine.pcManager.publisher.getTransceivers())A.sender===o&&(A.direction="inactive",r=!0);if(this.engine.removeTrack(o)&&(r=!0),xs(A)){for(const[,t]of A.simulcastCodecs)t.sender&&(this.engine.removeTrack(t.sender)&&(r=!0),t.sender=void 0);A.simulcastCodecs.clear()}}catch(a){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),s),{error:a}))}switch(this.trackPublications.delete(n.trackSid),n.kind){case Xn.Kind.Audio:this.audioTrackPublications.delete(n.trackSid);break;case Xn.Kind.Video:this.videoTrackPublications.delete(n.trackSid)}return this.emit(pn.LocalTrackUnpublished,n),n.setTrack(void 0),r&&(yield this.engine.negotiate()),n}))}unpublishTracks(A){return Ze(this,void 0,void 0,(function*(){return(yield Promise.all(A.map((A=>this.unpublishTrack(A))))).filter((A=>!!A))}))}republishAllTracks(A){return Ze(this,arguments,void 0,(function(A){var t=this;let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return function*(){t.republishPromise&&(yield t.republishPromise),t.republishPromise=new Promise(((i,n)=>Ze(t,void 0,void 0,(function*(){try{const t=[];this.trackPublications.forEach((e=>{e.track&&(A&&(e.options=Object.assign(Object.assign({},e.options),A)),t.push(e))})),yield Promise.all(t.map((A=>Ze(this,void 0,void 0,(function*(){const t=A.track;yield this.unpublishTrack(t,!1),!e||t.isMuted||t.source===Xn.Source.ScreenShare||t.source===Xn.Source.ScreenShareAudio||!Vs(t)&&!xs(t)||t.isUserProvided||(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:A.trackSid})),yield t.restartTrack()),yield this.publishOrRepublishTrack(t,A.options,!0)}))))),i()}catch(t){n(t)}finally{this.republishPromise=void 0}})))),yield t.republishPromise}()}))}publishData(A){return Ze(this,arguments,void 0,(function(A){var t=this;let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const i=e.reliable?lt.RELIABLE:lt.LOSSY,n=e.destinationIdentities,s=e.topic,r=new ut({kind:i,value:{case:"user",value:new wt({participantIdentity:t.identity,payload:A,destinationIdentities:n,topic:s})}});yield t.engine.sendDataPacket(r,i)}()}))}publishDtmf(A,t){return Ze(this,void 0,void 0,(function*(){const e=new ut({kind:lt.RELIABLE,value:{case:"sipDtmf",value:new ft({code:A,digit:t})}});yield this.engine.sendDataPacket(e,lt.RELIABLE)}))}sendChatMessage(A,t){return Ze(this,void 0,void 0,(function*(){const e={id:crypto.randomUUID(),message:A,timestamp:Date.now(),attachedFiles:null==t?void 0:t.attachments},i=new ut({value:{case:"chatMessage",value:new vt(Object.assign(Object.assign({},e),{timestamp:I.parse(e.timestamp)}))}});return yield this.engine.sendDataPacket(i,lt.RELIABLE),this.emit(pn.ChatMessage,e),e}))}editChatMessage(A,t){return Ze(this,void 0,void 0,(function*(){const e=Object.assign(Object.assign({},t),{message:A,editTimestamp:Date.now()}),i=new ut({value:{case:"chatMessage",value:new vt(Object.assign(Object.assign({},e),{timestamp:I.parse(e.timestamp),editTimestamp:I.parse(e.editTimestamp)}))}});return yield this.engine.sendDataPacket(i,lt.RELIABLE),this.emit(pn.ChatMessage,e),e}))}sendText(A,t){return Ze(this,void 0,void 0,(function*(){var e;const i=crypto.randomUUID(),n=(new TextEncoder).encode(A).byteLength,s=null===(e=null==t?void 0:t.attachments)||void 0===e?void 0:e.map((()=>crypto.randomUUID())),r=new Array(s?s.length+1:1).fill(0),o=(A,e)=>{var i;r[e]=A;const n=r.reduce(((A,t)=>A+t),0);null===(i=null==t?void 0:t.onProgress)||void 0===i||i.call(t,n)},a=yield this.streamText({streamId:i,totalSize:n,destinationIdentities:null==t?void 0:t.destinationIdentities,topic:null==t?void 0:t.topic,attachedStreamIds:s,attributes:null==t?void 0:t.attributes});return yield a.write(A),o(1,0),yield a.close(),(null==t?void 0:t.attachments)&&s&&(yield Promise.all(t.attachments.map(((A,e)=>Ze(this,void 0,void 0,(function*(){return this.bA(s[e],A,{topic:t.topic,mimeType:A.type,onProgress:A=>{o(A,e+1)}})})))))),a.info}))}streamText(A){return Ze(this,void 0,void 0,(function*(){var t,e;const i=null!==(t=null==A?void 0:A.streamId)&&void 0!==t?t:crypto.randomUUID(),n={id:i,mimeType:"text/plain",timestamp:Date.now(),topic:null!==(e=null==A?void 0:A.topic)&&void 0!==e?e:"",size:null==A?void 0:A.totalSize,attributes:null==A?void 0:A.attributes},s=new Mt({streamId:i,mimeType:n.mimeType,topic:n.topic,timestamp:Ls(n.timestamp),totalLength:Ls(null==A?void 0:A.totalSize),attributes:n.attributes,contentHeader:{case:"textHeader",value:new Ot({version:null==A?void 0:A.version,attachedStreamIds:null==A?void 0:A.attachedStreamIds,replyToStreamId:null==A?void 0:A.replyToStreamId,operationType:"update"===(null==A?void 0:A.type)?Kt.UPDATE:Kt.CREATE})}}),r=null==A?void 0:A.destinationIdentities,o=new ut({destinationIdentities:r,value:{case:"streamHeader",value:s}});yield this.engine.sendDataPacket(o,lt.RELIABLE);let a=0;const c=this,h=new WritableStream({write(A){return Ze(this,void 0,void 0,(function*(){for(const t of function(A){const t=[];let e=(new TextEncoder).encode(A);for(;e.length>15e3;){let A=15e3;for(;A>0;){const t=e[A];if(void 0!==t&&128!=(192&t))break;A--}t.push(e.slice(0,A)),e=e.slice(A)}return e.length>0&&t.push(e),t}(A)){yield c.engine.waitForBufferStatusLow(lt.RELIABLE);const A=new Lt({content:t,streamId:i,chunkIndex:Ls(a)}),e=new ut({destinationIdentities:r,value:{case:"streamChunk",value:A}});yield c.engine.sendDataPacket(e,lt.RELIABLE),a+=1}}))},close(){return Ze(this,void 0,void 0,(function*(){const A=new Rt({streamId:i}),t=new ut({destinationIdentities:r,value:{case:"streamTrailer",value:A}});yield c.engine.sendDataPacket(t,lt.RELIABLE)}))},abort(A){console.log("Sink error:",A)}});let u=()=>Ze(this,void 0,void 0,(function*(){yield l.close()}));c.engine.once(Cn.Closing,u);const l=new So(h,n,(()=>this.engine.off(Cn.Closing,u)));return l}))}sendFile(A,t){return Ze(this,void 0,void 0,(function*(){const e=crypto.randomUUID();return yield this.bA(e,A,t),{id:e}}))}bA(A,t,e){return Ze(this,void 0,void 0,(function*(){var i;const n=yield this.streamBytes({streamId:A,totalSize:t.size,name:t.name,mimeType:null!==(i=null==e?void 0:e.mimeType)&&void 0!==i?i:t.type,topic:null==e?void 0:e.topic,destinationIdentities:null==e?void 0:e.destinationIdentities}),s=t.stream().getReader();for(;;){const{done:A,value:t}=yield s.read();if(A)break;yield n.write(t)}return yield n.close(),n.info}))}streamBytes(A){return Ze(this,void 0,void 0,(function*(){var t,e,i,n,s;const r=null!==(t=null==A?void 0:A.streamId)&&void 0!==t?t:crypto.randomUUID(),o=null==A?void 0:A.destinationIdentities,a={id:r,mimeType:null!==(e=null==A?void 0:A.mimeType)&&void 0!==e?e:"application/octet-stream",topic:null!==(i=null==A?void 0:A.topic)&&void 0!==i?i:"",timestamp:Date.now(),attributes:null==A?void 0:A.attributes,size:null==A?void 0:A.totalSize,name:null!==(n=null==A?void 0:A.name)&&void 0!==n?n:"unknown"},h=new Mt({totalLength:Ls(null!==(s=a.size)&&void 0!==s?s:0),mimeType:a.mimeType,streamId:r,topic:a.topic,timestamp:Ls(Date.now()),attributes:a.attributes,contentHeader:{case:"byteHeader",value:new Dt({name:a.name})}}),u=new ut({destinationIdentities:o,value:{case:"streamHeader",value:h}});yield this.engine.sendDataPacket(u,lt.RELIABLE);let l=0;const d=new c,B=this.engine,w=this.log,f=new WritableStream({write(A){return Ze(this,void 0,void 0,(function*(){const t=yield d.lock();let e=0;try{for(;e<A.byteLength;){const t=A.slice(e,e+15e3);yield B.waitForBufferStatusLow(lt.RELIABLE);const i=new ut({destinationIdentities:o,value:{case:"streamChunk",value:new Lt({content:t,streamId:r,chunkIndex:Ls(l)})}});yield B.sendDataPacket(i,lt.RELIABLE),l+=1,e+=t.byteLength}}finally{t()}}))},close(){return Ze(this,void 0,void 0,(function*(){const A=new Rt({streamId:r}),t=new ut({destinationIdentities:o,value:{case:"streamTrailer",value:A}});yield B.sendDataPacket(t,lt.RELIABLE)}))},abort(A){w.error("Sink error:",A)}});return new Ko(f,a)}))}performRpc(A){return Ze(this,arguments,void 0,(function(A){var t=this;let{destinationIdentity:e,method:i,payload:n,responseTimeout:s=1e4}=A;return function*(){return new Promise(((A,r)=>Ze(t,void 0,void 0,(function*(){var t,o,a,c;if(jr(n)>15360)return void r(Vr.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));if((null===(o=null===(t=this.engine.latestJoinResponse)||void 0===t?void 0:t.serverInfo)||void 0===o?void 0:o.version)&&Us(null===(c=null===(a=this.engine.latestJoinResponse)||void 0===a?void 0:a.serverInfo)||void 0===c?void 0:c.version,"1.8.0")<0)return void r(Vr.builtIn("UNSUPPORTED_SERVER"));const h=crypto.randomUUID();yield this.publishRpcRequest(e,h,i,n,s-2e3);const u=setTimeout((()=>{this.pendingAcks.delete(h),r(Vr.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(h),clearTimeout(l)}),2e3);this.pendingAcks.set(h,{resolve:()=>{clearTimeout(u)},participantIdentity:e});const l=setTimeout((()=>{this.pendingResponses.delete(h),r(Vr.builtIn("RESPONSE_TIMEOUT"))}),s);this.pendingResponses.set(h,{resolve:(t,e)=>{clearTimeout(l),this.pendingAcks.has(h)&&(console.warn("RPC response received before ack",h),this.pendingAcks.delete(h),clearTimeout(u)),e?r(e):A(null!=t?t:"")},participantIdentity:e})}))))}()}))}registerRpcMethod(A,t){this.rpcHandlers.has(A)&&this.log.warn("you're overriding the RPC handler for method ".concat(A,", in the future this will throw an error")),this.rpcHandlers.set(A,t)}unregisterRpcMethod(A){this.rpcHandlers.delete(A)}setTrackSubscriptionPermissions(A){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.participantTrackPermissions=t,this.allParticipantsAllowedToSubscribe=A,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(A){const t=this.pendingAcks.get(A);t?(t.resolve(),this.pendingAcks.delete(A)):console.error("Ack received for unexpected RPC request",A)}handleIncomingRpcResponse(A,t,e){const i=this.pendingResponses.get(A);i?(i.resolve(t,e),this.pendingResponses.delete(A)):console.error("Response received for unexpected RPC request",A)}publishRpcRequest(A,t,e,i,n){return Ze(this,void 0,void 0,(function*(){const s=new ut({destinationIdentities:[A],kind:lt.RELIABLE,value:{case:"rpcRequest",value:new mt({id:t,method:e,payload:i,responseTimeoutMs:n,version:1})}});yield this.engine.sendDataPacket(s,lt.RELIABLE)}))}handleParticipantDisconnected(A){for(const[t,{participantIdentity:e}]of this.pendingAcks)e===A&&this.pendingAcks.delete(t);for(const[t,{participantIdentity:e,resolve:i}]of this.pendingResponses)e===A&&(i(null,Vr.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(t))}setEnabledPublishCodecs(A){this.enabledPublishVideoCodecs=A.filter((A=>"video"===A.mime.split("/")[0].toLowerCase()))}updateInfo(A){return!!super.updateInfo(A)&&(A.tracks.forEach((A=>{var t,e;const i=this.trackPublications.get(A.sid);if(i){const n=i.isMuted||null!==(e=null===(t=i.track)||void 0===t?void 0:t.isUpstreamPaused)&&void 0!==e&&e;n!==A.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),Ar(i)),{mutedOnServer:n})),this.engine.client.sendMuteTrack(A.sid,n))}})),!0)}getPublicationForTrack(A){let t;return this.trackPublications.forEach((e=>{const i=e.track;i&&(A instanceof MediaStreamTrack?(Vs(i)||xs(i))&&i.mediaStreamTrack===A&&(t=e):A===i&&(t=e))})),t}waitForPendingPublicationOfSource(A){return Ze(this,void 0,void 0,(function*(){const t=Date.now();for(;Date.now()<t+1e4;){const t=Array.from(this.pendingPublishPromises.entries()).find((t=>{let[e]=t;return e.source===A}));if(t)return t[1];yield as(20)}}))}}class _o extends Go{constructor(A,t,e,i){super(A,t.sid,t.name,i),this.track=void 0,this.allowed=!0,this.disabled=!1,this.currentVideoQuality=_n.HIGH,this.handleEnded=A=>{this.setTrack(void 0),this.emit(yn.Ended,A)},this.handleVisibilityChange=A=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(A),this.logContext),this.disabled=!A,this.emitTrackUpdate()},this.handleVideoDimensionsChange=A=>{this.log.debug("adaptivestream video dimensions ".concat(A.width,"x").concat(A.height),this.logContext),this.videoDimensions=A,this.emitTrackUpdate()},this.subscribed=e,this.updateInfo(t)}setSubscribed(A){const t=this.subscriptionStatus,e=this.permissionStatus;this.subscribed=A,A&&(this.allowed=!0);const i=new Ae({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Ft({participantSid:"",trackSids:[this.trackSid]})]});this.emit(yn.UpdateSubscription,i),this.emitSubscriptionUpdateIfChanged(t),this.emitPermissionUpdateIfChanged(e)}get subscriptionStatus(){return!1===this.subscribed?Go.SubscriptionStatus.Unsubscribed:super.isSubscribed?Go.SubscriptionStatus.Subscribed:Go.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Go.PermissionStatus.Allowed:Go.PermissionStatus.NotAllowed}get isSubscribed(){return!1!==this.subscribed&&super.isSubscribed}get isDesired(){return!1!==this.subscribed}get isEnabled(){return!this.disabled}get isLocal(){return!1}setEnabled(A){this.isManualOperationAllowed()&&this.disabled!==!A&&(this.disabled=!A,this.emitTrackUpdate())}setVideoQuality(A){this.isManualOperationAllowed()&&this.currentVideoQuality!==A&&(this.currentVideoQuality=A,this.videoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(A){var t,e;this.isManualOperationAllowed()&&((null===(t=this.videoDimensions)||void 0===t?void 0:t.width)===A.width&&(null===(e=this.videoDimensions)||void 0===e?void 0:e.height)===A.height||(_s(this.track)&&(this.videoDimensions=A),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(A){this.isManualOperationAllowed()&&_s(this.track)&&this.fps!==A&&(this.fps=A,this.emitTrackUpdate())}get videoQuality(){return this.currentVideoQuality}setTrack(A){const t=this.subscriptionStatus,e=this.permissionStatus,i=this.track;i!==A&&(i&&(i.off(yn.VideoDimensionsChanged,this.handleVideoDimensionsChange),i.off(yn.VisibilityChanged,this.handleVisibilityChange),i.off(yn.Ended,this.handleEnded),i.detach(),i.stopMonitor(),this.emit(yn.Unsubscribed,i)),super.setTrack(A),A&&(A.sid=this.trackSid,A.on(yn.VideoDimensionsChanged,this.handleVideoDimensionsChange),A.on(yn.VisibilityChanged,this.handleVisibilityChange),A.on(yn.Ended,this.handleEnded),this.emit(yn.Subscribed,A)),this.emitPermissionUpdateIfChanged(e),this.emitSubscriptionUpdateIfChanged(t))}setAllowed(A){const t=this.subscriptionStatus,e=this.permissionStatus;this.allowed=A,this.emitPermissionUpdateIfChanged(e),this.emitSubscriptionUpdateIfChanged(t)}setSubscriptionError(A){this.emit(yn.SubscriptionFailed,A)}updateInfo(A){super.updateInfo(A);const t=this.metadataMuted;this.metadataMuted=A.muted,this.track?this.track.setMuted(A.muted):t!==A.muted&&this.emit(A.muted?yn.Muted:yn.Unmuted)}emitSubscriptionUpdateIfChanged(A){const t=this.subscriptionStatus;A!==t&&this.emit(yn.SubscriptionStatusChanged,t,A)}emitPermissionUpdateIfChanged(A){this.permissionStatus!==A&&this.emit(yn.SubscriptionPermissionChanged,this.permissionStatus,A)}isManualOperationAllowed(){return this.kind===Xn.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):!!this.isDesired||(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return _s(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const A=new te({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(A.width=Math.ceil(this.videoDimensions.width),A.height=Math.ceil(this.videoDimensions.height)):void 0!==this.currentVideoQuality?A.quality=this.currentVideoQuality:A.quality=_n.HIGH,this.emit(yn.UpdateSettings,A)}}class Jo extends jo{static fromParticipantInfo(A,t,e){return new Jo(A,t.sid,t.identity,t.name,t.metadata,t.attributes,e,t.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(A,t,e,i,n,s,r){super(t,e||"",i,n,s,r,arguments.length>7&&void 0!==arguments[7]?arguments[7]:st.STANDARD),this.signalClient=A,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(A){super.addTrackPublication(A),A.on(yn.UpdateSettings,(t=>{this.log.debug("send update settings",Object.assign(Object.assign({},this.logContext),Ar(A))),this.signalClient.sendUpdateTrackSettings(t)})),A.on(yn.UpdateSubscription,(A=>{A.participantTracks.forEach((A=>{A.participantSid=this.sid})),this.signalClient.sendUpdateSubscription(A)})),A.on(yn.SubscriptionPermissionChanged,(t=>{this.emit(pn.TrackSubscriptionPermissionChanged,A,t)})),A.on(yn.SubscriptionStatusChanged,(t=>{this.emit(pn.TrackSubscriptionStatusChanged,A,t)})),A.on(yn.Subscribed,(t=>{this.emit(pn.TrackSubscribed,t,A)})),A.on(yn.Unsubscribed,(t=>{this.emit(pn.TrackUnsubscribed,t,A)})),A.on(yn.SubscriptionFailed,(t=>{this.emit(pn.TrackSubscriptionFailed,A.trackSid,t)}))}getTrackPublication(A){const t=super.getTrackPublication(A);if(t)return t}getTrackPublicationByName(A){const t=super.getTrackPublicationByName(A);if(t)return t}setVolume(A){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xn.Source.Microphone;this.volumeMap.set(t,A);const e=this.getTrackPublication(t);e&&e.track&&e.track.setVolume(A)}getVolume(){let A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xn.Source.Microphone;const t=this.getTrackPublication(A);return t&&t.track?t.track.getVolume():this.volumeMap.get(A)}addSubscribedMediaTrack(A,t,e,i,n,s){let r,o=this.getTrackPublicationBySid(t);return o||t.startsWith("TR")||this.trackPublications.forEach((t=>{o||A.kind!==t.kind.toString()||(o=t)})),o?"ended"===A.readyState?(this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),Ar(o))),void this.emit(pn.TrackSubscriptionFailed,t)):(r="video"===A.kind?new Mo(A,t,i,n):new Do(A,t,i,this.audioContext,this.audioOutput),r.source=o.source,r.isMuted=o.isMuted,r.setMediaStream(e),r.start(),o.setTrack(r),this.volumeMap.has(o.source)&&js(r)&&Ns(r)&&r.setVolume(this.volumeMap.get(o.source)),o):0===s?(this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:t})),void this.emit(pn.TrackSubscriptionFailed,t)):(void 0===s&&(s=20),void setTimeout((()=>{this.addSubscribedMediaTrack(A,t,e,i,n,s-1)}),150))}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(A){return this.trackPublications.get(A)}updateInfo(A){if(!super.updateInfo(A))return!1;const t=new Map,e=new Map;return A.tracks.forEach((A=>{var i,n;let s=this.getTrackPublicationBySid(A.sid);if(s)s.updateInfo(A);else{const t=Xn.kindFromProto(A.type);if(!t)return;s=new _o(t,A,null===(i=this.signalClient.connectOptions)||void 0===i?void 0:i.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:null===(n=this.loggerOptions)||void 0===n?void 0:n.loggerName}),s.updateInfo(A),e.set(A.sid,s);const r=Array.from(this.trackPublications.values()).find((A=>A.source===(null==s?void 0:s.source)));r&&s.source!==Xn.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(s.source),Object.assign(Object.assign({},this.logContext),{oldTrack:Ar(r),newTrack:Ar(s)})),this.addTrackPublication(s)}t.set(A.sid,s)})),this.trackPublications.forEach((A=>{t.has(A.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),Ar(A))),this.unpublishTrack(A.trackSid,!0))})),e.forEach((A=>{this.emit(pn.TrackPublished,A)})),!0}unpublishTrack(A,t){const e=this.trackPublications.get(A);if(!e)return;const{track:i}=e;switch(i&&(i.stop(),e.setTrack(void 0)),this.trackPublications.delete(A),e.kind){case Xn.Kind.Audio:this.audioTrackPublications.delete(A);break;case Xn.Kind.Video:this.videoTrackPublications.delete(A)}t&&this.emit(pn.TrackUnpublished,e)}setAudioOutput(A){return Ze(this,void 0,void 0,(function*(){this.audioOutput=A;const t=[];this.audioTrackPublications.forEach((e=>{var i;Ns(e.track)&&js(e.track)&&t.push(e.track.setSinkId(null!==(i=A.deviceId)&&void 0!==i?i:"default"))})),yield Promise.all(t)}))}emit(A){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:A,args:e})),super.emit(A,...e)}}(Uo=po||(po={})).Disconnected="disconnected",Uo.Connecting="connecting",Uo.Connected="connected",Uo.Reconnecting="reconnecting",Uo.SignalReconnecting="signalReconnecting";class Xo extends $e.EventEmitter{constructor(A){var t,e,i,n;if(super(),t=this,this.state=po.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=Pe,this.bufferedEvents=[],this.isResuming=!1,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map,this.rpcHandlers=new Map,this.connect=(A,t,e)=>Ze(this,void 0,void 0,(function*(){var i;if("undefined"==typeof RTCPeerConnection||!cs()&&!hs())throw gs()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const n=yield this.disconnectLock.lock();if(this.state===po.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),n(),Promise.resolve();if(this.connectFuture)return n(),this.connectFuture.promise;this.setAndEmitConnectionState(po.Connecting),(null===(i=this.regionUrlProvider)||void 0===i?void 0:i.getServerUrl().toString())!==A&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Qs(new URL(A))&&(void 0===this.regionUrlProvider?this.regionUrlProvider=new Eo(A,t):this.regionUrlProvider.updateToken(t),this.regionUrlProvider.fetchRegionSettings().then((A=>{var t;null===(t=this.regionUrlProvider)||void 0===t||t.setServerReportedRegions(A)})).catch((A=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:A}))})));const s=(i,r,o)=>Ze(this,void 0,void 0,(function*(){var a,c;this.abortController&&this.abortController.abort();const h=new AbortController;this.abortController=h,null==n||n();try{yield this.attemptConnection(null!=o?o:A,t,e,h),this.abortController=void 0,i()}catch(u){if(this.regionUrlProvider&&u instanceof In&&u.reason!==dn.Cancelled&&u.reason!==dn.NotAllowed){let A=null;try{A=yield this.regionUrlProvider.getNextBestRegionUrl(null===(a=this.abortController)||void 0===a?void 0:a.signal)}catch(l){if(l instanceof In&&(401===l.status||l.reason===dn.Cancelled))return this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),void r(l)}A&&!(null===(c=this.abortController)||void 0===c?void 0:c.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(u.message,". Retrying with another region: ").concat(A),this.logContext),this.recreateEngine(),yield s(i,r,A)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Ds(u)),r(u))}else{let A=WA.UNKNOWN_REASON;u instanceof In&&(A=Ds(u)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,A),r(u)}}})),r=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new Ss(((A,t)=>{s(A,t,r)}),(()=>{this.clearConnectionFutures()})),this.connectFuture.promise})),this.connectSignal=(A,t,e,i,n,s)=>Ze(this,void 0,void 0,(function*(){var r,o,a;const c=yield e.join(A,t,{autoSubscribe:i.autoSubscribe,adaptiveStream:"object"==typeof n.adaptiveStream||n.adaptiveStream,maxRetries:i.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:i.websocketTimeout},s.signal);let h=c.serverInfo;if(h||(h={version:c.serverVersion,region:c.serverRegion}),this.serverInfo=h,this.log.debug("connected to Livekit Server ".concat(Object.entries(h).map((A=>{let[t,e]=A;return"".concat(t,": ").concat(e)})).join(", ")),{room:null===(r=c.room)||void 0===r?void 0:r.name,roomSid:null===(o=c.room)||void 0===o?void 0:o.sid,identity:null===(a=c.participant)||void 0===a?void 0:a.identity}),!h.version)throw new Sn("unknown server version");return"0.15.1"===h.version&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),n.dynacast=!1),c})),this.applyJoinResponse=A=>{const t=A.participant;if(this.localParticipant.sid=t.sid,this.localParticipant.identity=t.identity,this.localParticipant.setEnabledPublishCodecs(A.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(A.sifTrailer)}catch(e){this.log.error(e instanceof Error?e.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:e}))}this.handleParticipantUpdates([t,...A.otherParticipants]),A.room&&this.handleRoomUpdate(A.room)},this.attemptConnection=(A,t,e,i)=>Ze(this,void 0,void 0,(function*(){var n,s;this.state===po.Reconnecting||this.isResuming||(null===(n=this.engine)||void 0===n?void 0:n.pendingReconnect)?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),(null===(s=this.regionUrlProvider)||void 0===s?void 0:s.isCloud())&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Rr),e),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const e=yield this.connectSignal(A,t,this.engine,this.connOptions,this.options,i);this.applyJoinResponse(e),this.setupLocalParticipantEvents(),this.emit(vn.SignalConnected)}catch(r){yield this.engine.close(),this.recreateEngine();const A=new In("could not establish signal connection",dn.ServerUnreachable);throw r instanceof Error&&(A.message="".concat(A.message,": ").concat(r.message)),r instanceof In&&(A.reason=r.reason,A.status=r.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:r})),A}if(i.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new In("Connection attempt aborted",dn.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,i)}catch(o){throw yield this.engine.close(),this.recreateEngine(),o}fs()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),fs()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(po.Connected),this.emit(vn.Connected),this.registerConnectionReconcile()})),this.disconnect=function(){for(var A=arguments.length,e=new Array(A),i=0;i<A;i++)e[i]=arguments[i];return Ze(t,[...e],void 0,(function(){var A=this;let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function*(){var e,i,n,s;const r=yield A.disconnectLock.lock();try{if(A.state===po.Disconnected)return void A.log.debug("already disconnected",A.logContext);A.log.info("disconnect from room",Object.assign({},A.logContext)),(A.state===po.Connecting||A.state===po.Reconnecting||A.isResuming)&&(A.log.warn("abort connection attempt",A.logContext),null===(e=A.abortController)||void 0===e||e.abort(),null===(n=null===(i=A.connectFuture)||void 0===i?void 0:i.reject)||void 0===n||n.call(i,new In("Client initiated disconnect",dn.Cancelled)),A.connectFuture=void 0),(null===(s=A.engine)||void 0===s?void 0:s.client.isDisconnected)||(yield A.engine.client.sendLeave()),A.engine&&(yield A.engine.close()),A.handleDisconnect(t,WA.CLIENT_INITIATED),A.engine=void 0}finally{r()}}()}))},this.onPageLeave=()=>Ze(this,void 0,void 0,(function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()})),this.startAudio=()=>Ze(this,void 0,void 0,(function*(){const A=[],t=Nn();if(t&&"iOS"===t.os){const t="livekit-dummy-audio-el";let e=document.getElementById(t);if(!e){e=document.createElement("audio"),e.id=t,e.autoplay=!0,e.hidden=!0;const A=Ts();A.enabled=!0;const i=new MediaStream([A]);e.srcObject=i,document.addEventListener("visibilitychange",(()=>{e&&(e.srcObject=document.hidden?null:i,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))})),document.body.append(e),this.once(vn.Disconnected,(()=>{null==e||e.remove(),e=null}))}A.push(e)}this.remoteParticipants.forEach((t=>{t.audioTrackPublications.forEach((t=>{t.track&&t.track.attachedElements.forEach((t=>{A.push(t)}))}))}));try{yield Promise.all([this.acquireAudioContext(),...A.map((A=>(A.muted=!1,A.play())))]),this.handleAudioPlaybackStarted()}catch(e){throw this.handleAudioPlaybackFailed(e),e}})),this.startVideo=()=>Ze(this,void 0,void 0,(function*(){const A=[];for(const t of this.remoteParticipants.values())t.videoTrackPublications.forEach((t=>{var e;null===(e=t.track)||void 0===e||e.attachedElements.forEach((t=>{A.includes(t)||A.push(t)}))}));yield Promise.all(A.map((A=>A.play()))).then((()=>{this.handleVideoPlaybackStarted()})).catch((A=>{"NotAllowedError"===A.name?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)}))})),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const A of this.remoteParticipants.values())this.handleParticipantDisconnected(A.identity,A);this.setAndEmitConnectionState(po.Reconnecting)&&this.emit(vn.Reconnecting)},this.handleSignalRestarted=A=>Ze(this,void 0,void 0,(function*(){this.log.debug("signal reconnected to server, region ".concat(A.serverRegion),Object.assign(Object.assign({},this.logContext),{region:A.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(A);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(t){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:t}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:A.serverRegion}))}catch(e){return}this.setAndEmitConnectionState(po.Connected),this.emit(vn.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()})),this.handleParticipantUpdates=A=>{A.forEach((A=>{var t;if(A.identity===this.localParticipant.identity)return void this.localParticipant.updateInfo(A);""===A.identity&&(A.identity=null!==(t=this.sidToIdentity.get(A.sid))&&void 0!==t?t:"");let e=this.remoteParticipants.get(A.identity);A.state===nt.DISCONNECTED?this.handleParticipantDisconnected(A.identity,e):e=this.getOrCreateParticipant(A.identity,A)}))},this.handleActiveSpeakersUpdate=A=>{const t=[],e={};A.forEach((A=>{if(e[A.sid]=!0,A.sid===this.localParticipant.sid)this.localParticipant.audioLevel=A.level,this.localParticipant.setIsSpeaking(!0),t.push(this.localParticipant);else{const e=this.getRemoteParticipantBySid(A.sid);e&&(e.audioLevel=A.level,e.setIsSpeaking(!0),t.push(e))}})),e[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach((A=>{e[A.sid]||(A.audioLevel=0,A.setIsSpeaking(!1))})),this.activeSpeakers=t,this.emitWhenConnected(vn.ActiveSpeakersChanged,t)},this.handleSpeakersChanged=A=>{const t=new Map;this.activeSpeakers.forEach((A=>{const e=this.remoteParticipants.get(A.identity);e&&e.sid!==A.sid||t.set(A.sid,A)})),A.forEach((A=>{let e=this.getRemoteParticipantBySid(A.sid);A.sid===this.localParticipant.sid&&(e=this.localParticipant),e&&(e.audioLevel=A.level,e.setIsSpeaking(A.active),A.active?t.set(A.sid,e):t.delete(A.sid))}));const e=Array.from(t.values());e.sort(((A,t)=>t.audioLevel-A.audioLevel)),this.activeSpeakers=e,this.emitWhenConnected(vn.ActiveSpeakersChanged,e)},this.handleStreamStateUpdate=A=>{A.streamStates.forEach((A=>{const t=this.getRemoteParticipantBySid(A.participantSid);if(!t)return;const e=t.getTrackPublicationBySid(A.trackSid);if(!e||!e.track)return;const i=Xn.streamStateFromProto(A.state);i!==e.track.streamState&&(e.track.streamState=i,t.emit(pn.TrackStreamStateChanged,e,e.track.streamState),this.emitWhenConnected(vn.TrackStreamStateChanged,e,e.track.streamState,t))}))},this.handleSubscriptionPermissionUpdate=A=>{const t=this.getRemoteParticipantBySid(A.participantSid);if(!t)return;const e=t.getTrackPublicationBySid(A.trackSid);e&&e.setAllowed(A.allowed)},this.handleSubscriptionError=A=>{const t=Array.from(this.remoteParticipants.values()).find((t=>t.trackPublications.has(A.trackSid)));if(!t)return;const e=t.getTrackPublicationBySid(A.trackSid);e&&e.setSubscriptionError(A.err)},this.handleDataPacket=A=>{const t=this.remoteParticipants.get(A.participantIdentity);if("user"===A.value.case)this.handleUserPacket(t,A.value.value,A.kind);else if("transcription"===A.value.case)this.handleTranscription(t,A.value.value);else if("sipDtmf"===A.value.case)this.handleSipDtmf(t,A.value.value);else if("chatMessage"===A.value.case)this.handleChatMessage(t,A.value.value);else if("metrics"===A.value.case)this.handleMetrics(A.value.value,t);else if("streamHeader"===A.value.case)this.handleStreamHeader(A.value.value,A.participantIdentity);else if("streamChunk"===A.value.case)this.handleStreamChunk(A.value.value);else if("streamTrailer"===A.value.case)this.handleStreamTrailer(A.value.value);else if("rpcRequest"===A.value.case){const t=A.value.value;this.handleIncomingRpcRequest(A.participantIdentity,t.id,t.method,t.payload,t.responseTimeoutMs,t.version)}},this.handleUserPacket=(A,t,e)=>{this.emit(vn.DataReceived,t.payload,A,e,t.topic),null==A||A.emit(pn.DataReceived,t.payload,e)},this.handleSipDtmf=(A,t)=>{this.emit(vn.SipDTMFReceived,t,A),null==A||A.emit(pn.SipDTMFReceived,t)},this.bufferedSegments=new Map,this.handleTranscription=(A,t)=>{const e=t.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(t.transcribedParticipantIdentity),i=null==e?void 0:e.trackPublications.get(t.trackId),n=function(A,t){return A.segments.map((A=>{let{id:e,text:i,language:n,startTime:s,endTime:r,final:o}=A;var a;const c=null!==(a=t.get(e))&&void 0!==a?a:Date.now(),h=Date.now();return o?t.delete(e):t.set(e,c),{id:e,text:i,startTime:Number.parseInt(s.toString()),endTime:Number.parseInt(r.toString()),final:o,language:n,firstReceivedTime:c,lastReceivedTime:h}}))}(t,this.transcriptionReceivedTimes);null==i||i.emit(yn.TranscriptionReceived,n),null==e||e.emit(pn.TranscriptionReceived,n,i),this.emit(vn.TranscriptionReceived,n,e,i)},this.handleChatMessage=(A,t)=>{const e=function(A){const{id:t,timestamp:e,message:i,editTimestamp:n}=A;return{id:t,timestamp:Number.parseInt(e.toString()),editTimestamp:n?Number.parseInt(n.toString()):void 0,message:i}}(t);this.emit(vn.ChatMessage,e,A)},this.handleMetrics=(A,t)=>{this.emit(vn.MetricsReceived,A,t)},this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(vn.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=A=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:A})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(vn.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(vn.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(vn.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>Ze(this,void 0,void 0,(function*(){var A,t,e;const i=nr.getInstance().previousDevices,n=yield nr.getInstance().getDevices(void 0,!1),s=Nn();if("Chrome"===(null==s?void 0:s.name)&&"iOS"!==s.os)for(let o of n){const A=i.find((A=>A.deviceId===o.deviceId));A&&""!==A.label&&A.kind===o.kind&&A.label!==o.label&&"default"===this.getActiveDevice(o.kind)&&this.emit(vn.ActiveDeviceChanged,o.kind,o.deviceId)}const r=["audiooutput","audioinput","videoinput"];for(let o of r){const s=Ws(o),r=this.localParticipant.getTrackPublication(s);if(r&&(null===(A=r.track)||void 0===A?void 0:A.isUserProvided))continue;const a=n.filter((A=>A.kind===o)),c=this.getActiveDevice(o);c===(null===(t=i.filter((A=>A.kind===o))[0])||void 0===t?void 0:t.deviceId)&&a.length>0&&(null===(e=a[0])||void 0===e?void 0:e.deviceId)!==c?yield this.switchActiveDevice(o,a[0].deviceId):"audioinput"===o&&!Bs()||"videoinput"===o||a.length>0&&!a.find((A=>A.deviceId===this.getActiveDevice(o)))&&(yield this.switchActiveDevice(o,a[0].deviceId))}this.emit(vn.MediaDevicesChanged)})),this.handleRoomUpdate=A=>{const t=this.roomInfo;this.roomInfo=A,t&&t.metadata!==A.metadata&&this.emitWhenConnected(vn.RoomMetadataChanged,A.metadata),(null==t?void 0:t.activeRecording)!==A.activeRecording&&this.emitWhenConnected(vn.RecordingStatusChanged,A.activeRecording)},this.handleConnectionQualityUpdate=A=>{A.updates.forEach((A=>{if(A.participantSid===this.localParticipant.sid)return void this.localParticipant.setConnectionQuality(A.quality);const t=this.getRemoteParticipantBySid(A.participantSid);t&&t.setConnectionQuality(A.quality)}))},this.onLocalParticipantMetadataChanged=A=>{this.emit(vn.ParticipantMetadataChanged,A,this.localParticipant)},this.onLocalParticipantNameChanged=A=>{this.emit(vn.ParticipantNameChanged,A,this.localParticipant)},this.onLocalAttributesChanged=A=>{this.emit(vn.ParticipantAttributesChanged,A,this.localParticipant)},this.onLocalTrackMuted=A=>{this.emit(vn.TrackMuted,A,this.localParticipant)},this.onLocalTrackUnmuted=A=>{this.emit(vn.TrackUnmuted,A,this.localParticipant)},this.onTrackProcessorUpdate=A=>{var t;null===(t=null==A?void 0:A.onPublish)||void 0===t||t.call(A,this)},this.onLocalTrackPublished=A=>Ze(this,void 0,void 0,(function*(){var t,e,i,n,s,r;null===(t=A.track)||void 0===t||t.on(yn.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(e=A.track)||void 0===e||e.on(yn.Restarted,this.onLocalTrackRestarted),null===(s=null===(n=null===(i=A.track)||void 0===i?void 0:i.getProcessor())||void 0===n?void 0:n.onPublish)||void 0===s||s.call(n,this),this.emit(vn.LocalTrackPublished,A,this.localParticipant),Vs(A.track)&&(yield A.track.checkForSilence())&&this.emit(vn.LocalAudioSilenceDetected,A);const o=yield null===(r=A.track)||void 0===r?void 0:r.getDeviceId(!1),a=qs(A.source);a&&o&&o!==this.localParticipant.activeDeviceMap.get(a)&&(this.localParticipant.activeDeviceMap.set(a,o),this.emit(vn.ActiveDeviceChanged,a,o))})),this.onLocalTrackUnpublished=A=>{var t,e;null===(t=A.track)||void 0===t||t.off(yn.TrackProcessorUpdate,this.onTrackProcessorUpdate),null===(e=A.track)||void 0===e||e.off(yn.Restarted,this.onLocalTrackRestarted),this.emit(vn.LocalTrackUnpublished,A,this.localParticipant)},this.onLocalTrackRestarted=A=>Ze(this,void 0,void 0,(function*(){const t=yield A.getDeviceId(!1),e=qs(A.source);e&&t&&t!==this.localParticipant.activeDeviceMap.get(e)&&(this.log.debug("local track restarted, setting ".concat(e," ").concat(t," active"),this.logContext),this.localParticipant.activeDeviceMap.set(e,t),this.emit(vn.ActiveDeviceChanged,e,t))})),this.onLocalConnectionQualityChanged=A=>{this.emit(vn.ConnectionQualityChanged,A,this.localParticipant)},this.onMediaDevicesError=A=>{this.emit(vn.MediaDevicesError,A)},this.onLocalParticipantPermissionsChanged=A=>{this.emit(vn.ParticipantPermissionsChanged,A,this.localParticipant)},this.onLocalChatMessageSent=A=>{this.emit(vn.ChatMessage,A,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},Lr),A),this.log=_e(null!==(e=this.options.loggerName)&&void 0!==e?e:Ge.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},Dr),null==A?void 0:A.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},Mr),null==A?void 0:A.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Or),null==A?void 0:A.publishDefaults),this.maybeCreateEngine(),this.disconnectLock=new c,this.localParticipant=new Po("","",this.engine,this.options,this.rpcHandlers),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",Ks(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",Ks(this.options.audioCaptureDefaults.deviceId)),(null===(i=this.options.audioOutput)||void 0===i?void 0:i.deviceId)&&this.switchActiveDevice("audiooutput",Ks(this.options.audioOutput.deviceId)).catch((A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext))),this.options.e2ee&&this.setupE2EE(),fs()){const A=new AbortController;null===(n=navigator.mediaDevices)||void 0===n||n.addEventListener("devicechange",this.handleDeviceChange,{signal:A.signal}),Xo.cleanupRegistry&&Xo.cleanupRegistry.register(this,(()=>{A.abort()}))}}registerTextStreamHandler(A,t){if(this.textStreamHandlers.has(A))throw new TypeError('A text stream handler for topic "'.concat(A,'" has already been set.'));this.textStreamHandlers.set(A,t)}unregisterTextStreamHandler(A){this.textStreamHandlers.delete(A)}registerByteStreamHandler(A,t){if(this.byteStreamHandlers.has(A))throw new TypeError('A byte stream handler for topic "'.concat(A,'" has already been set.'));this.byteStreamHandlers.set(A,t)}unregisterByteStreamHandler(A){this.byteStreamHandlers.delete(A)}registerRpcMethod(A,t){if(this.rpcHandlers.has(A))throw Error("RPC handler already registered for method ".concat(A,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(A,t)}unregisterRpcMethod(A){this.rpcHandlers.delete(A)}handleIncomingRpcRequest(A,t,e,i,n,s){return Ze(this,void 0,void 0,(function*(){if(yield this.engine.publishRpcAck(A,t),1!==s)return void(yield this.engine.publishRpcResponse(A,t,null,Vr.builtIn("UNSUPPORTED_VERSION")));const r=this.rpcHandlers.get(e);if(!r)return void(yield this.engine.publishRpcResponse(A,t,null,Vr.builtIn("UNSUPPORTED_METHOD")));let o=null,a=null;try{const s=yield r({requestId:t,callerIdentity:A,payload:i,responseTimeout:n});jr(s)>15360?(o=Vr.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(e))):a=s}catch(c){c instanceof Vr?o=c:(console.warn("Uncaught error returned by RPC handler for ".concat(e,". Returning APPLICATION_ERROR instead."),c),o=Vr.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(A,t,a,o)}))}setE2EEEnabled(A){return Ze(this,void 0,void 0,(function*(){if(!this.e2eeManager)throw Error("e2ee not configured, please set e2ee settings within the room options");yield Promise.all([this.localParticipant.setE2EEEnabled(A)]),""!==this.localParticipant.identity&&this.e2eeManager.setParticipantCryptorEnabled(A,this.localParticipant.identity)}))}setupE2EE(){var A;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new er(this.options.e2ee),this.e2eeManager.on(hn.ParticipantEncryptionStatusChanged,((A,t)=>{t.isLocal&&(this.isE2EEEnabled=A),this.emit(vn.ParticipantEncryptionStatusChanged,A,t)})),this.e2eeManager.on(hn.EncryptionError,(A=>this.emit(vn.EncryptionError,A))),null===(A=this.e2eeManager)||void 0===A||A.setup(this))}get logContext(){var A;return{room:this.name,roomID:null===(A=this.roomInfo)||void 0===A?void 0:A.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var A,t;return null!==(t=null===(A=this.roomInfo)||void 0===A?void 0:A.activeRecording)&&void 0!==t&&t}getSid(){return Ze(this,void 0,void 0,(function*(){return this.state===po.Disconnected?"":this.roomInfo&&""!==this.roomInfo.sid?this.roomInfo.sid:new Promise(((A,t)=>{const e=t=>{""!==t.sid&&(this.engine.off(Cn.RoomUpdate,e),A(t.sid))};this.engine.on(Cn.RoomUpdate,e),this.once(vn.Disconnected,(()=>{this.engine.off(Cn.RoomUpdate,e),t("Room disconnected before room server id was available")}))}))}))}get name(){var A,t;return null!==(t=null===(A=this.roomInfo)||void 0===A?void 0:A.name)&&void 0!==t?t:""}get metadata(){var A;return null===(A=this.roomInfo)||void 0===A?void 0:A.metadata}get numParticipants(){var A,t;return null!==(t=null===(A=this.roomInfo)||void 0===A?void 0:A.numParticipants)&&void 0!==t?t:0}get numPublishers(){var A,t;return null!==(t=null===(A=this.roomInfo)||void 0===A?void 0:A.numPublishers)&&void 0!==t?t:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new yo(this.options),this.engine.on(Cn.ParticipantUpdate,this.handleParticipantUpdates).on(Cn.RoomUpdate,this.handleRoomUpdate).on(Cn.SpeakersChanged,this.handleSpeakersChanged).on(Cn.StreamStateChanged,this.handleStreamStateUpdate).on(Cn.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(Cn.SubscriptionError,this.handleSubscriptionError).on(Cn.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(Cn.MediaTrackAdded,((A,t,e)=>{this.onTrackAdded(A,t,e)})).on(Cn.Disconnected,(A=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,A)})).on(Cn.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(Cn.DataPacketReceived,this.handleDataPacket).on(Cn.Resuming,(()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(po.SignalReconnecting)&&this.emit(vn.SignalReconnecting)})).on(Cn.Resumed,(()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(po.Connected)&&this.emit(vn.Reconnected)})).on(Cn.SignalResumed,(()=>{this.bufferedEvents=[],(this.state===po.Reconnecting||this.isResuming)&&this.sendSyncState()})).on(Cn.Restarting,this.handleRestarting).on(Cn.SignalRestarted,this.handleSignalRestarted).on(Cn.Offline,(()=>{this.setAndEmitConnectionState(po.Reconnecting)&&this.emit(vn.Reconnecting)})).on(Cn.DCBufferStatusChanged,((A,t)=>{this.emit(vn.DCBufferStatusChanged,A,t)})).on(Cn.LocalTrackSubscribed,(A=>{const t=this.localParticipant.getTrackPublications().find((t=>{let{trackSid:e}=t;return e===A}));t?(this.localParticipant.emit(pn.LocalTrackSubscribed,t),this.emitWhenConnected(vn.LocalTrackSubscribed,t,this.localParticipant)):this.log.warn("could not find local track subscription for subscribed event",this.logContext)})).on(Cn.RoomMoved,(A=>{this.log.debug("room moved",A),A.room&&this.handleRoomUpdate(A.room),this.remoteParticipants.forEach(((A,t)=>{this.handleParticipantDisconnected(t,A)})),this.emit(vn.Moved,A.room.name,A.token),A.participant?this.handleParticipantUpdates([A.participant,...A.otherParticipants]):this.handleParticipantUpdates(A.otherParticipants)})),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}static getLocalDevices(A){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return nr.getInstance().getDevices(A,t)}prepareConnection(A,t){return Ze(this,void 0,void 0,(function*(){if(this.state===po.Disconnected){this.log.debug("prepareConnection to ".concat(A),this.logContext);try{if(Qs(new URL(A))&&t){this.regionUrlProvider=new Eo(A,t);const e=yield this.regionUrlProvider.getNextBestRegionUrl();e&&this.state===po.Disconnected&&(this.regionUrl=e,yield fetch(Os(e),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(e),this.logContext))}else yield fetch(Os(A),{method:"HEAD"})}catch(e){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:e}))}}}))}getParticipantByIdentity(A){return this.localParticipant.identity===A?this.localParticipant:this.remoteParticipants.get(A)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(A,t){return Ze(this,void 0,void 0,(function*(){let e,i=()=>{};switch(A){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":e=new Fe({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":e=new Fe({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":e=new Fe({scenario:{case:"serverLeave",value:!0}});break;case"migration":e=new Fe({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":i=()=>Ze(this,void 0,void 0,(function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")})),e=new Fe({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":i=()=>Ze(this,void 0,void 0,(function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")})),e=new Fe({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":e=new Fe({scenario:{case:"switchCandidateProtocol",value:"force-tls"===A?2:1}}),i=()=>Ze(this,void 0,void 0,(function*(){const A=this.engine.client.onLeave;A&&A(new ne({reason:WA.CLIENT_INITIATED,action:se.RECONNECT}))}));break;case"subscriber-bandwidth":if(void 0===t||"number"!=typeof t)throw new Error("subscriber-bandwidth requires a number as argument");e=new Fe({scenario:{case:"subscriberBandwidth",value:Ls(t)}});break;case"leave-full-reconnect":e=new Fe({scenario:{case:"leaveRequestFullReconnect",value:!0}})}e&&(yield this.engine.client.sendSimulateScenario(e),yield i())}))}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(A){return this.localParticipant.activeDeviceMap.get(A)}switchActiveDevice(A,t){return Ze(this,arguments,void 0,(function(A,t){var e=this;let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function*(){var n,s,r,o,a,c,h,u;let l=!0,d=!1;const B=i?{exact:t}:t;if("audioinput"===A){d=0===e.localParticipant.audioTrackPublications.size;const t=null!==(n=e.getActiveDevice(A))&&void 0!==n?n:e.options.audioCaptureDefaults.deviceId;e.options.audioCaptureDefaults.deviceId=B;const i=Array.from(e.localParticipant.audioTrackPublications.values()).filter((A=>A.source===Xn.Source.Microphone));try{l=(yield Promise.all(i.map((A=>{var t;return null===(t=A.audioTrack)||void 0===t?void 0:t.setDeviceId(B)})))).every((A=>!0===A))}catch(w){throw e.options.audioCaptureDefaults.deviceId=t,w}}else if("videoinput"===A){d=0===e.localParticipant.videoTrackPublications.size;const t=null!==(s=e.getActiveDevice(A))&&void 0!==s?s:e.options.videoCaptureDefaults.deviceId;e.options.videoCaptureDefaults.deviceId=B;const i=Array.from(e.localParticipant.videoTrackPublications.values()).filter((A=>A.source===Xn.Source.Camera));try{l=(yield Promise.all(i.map((A=>{var t;return null===(t=A.videoTrack)||void 0===t?void 0:t.setDeviceId(B)})))).every((A=>!0===A))}catch(w){throw e.options.videoCaptureDefaults.deviceId=t,w}}else if("audiooutput"===A){if(!ls()&&!e.options.webAudioMix||e.options.webAudioMix&&e.audioContext&&!("setSinkId"in e.audioContext))throw new Error("cannot switch audio output, setSinkId not supported");e.options.webAudioMix&&(t=null!==(r=yield nr.getInstance().normalizeDeviceId("audiooutput",t))&&void 0!==r?r:""),null!==(o=(u=e.options).audioOutput)&&void 0!==o||(u.audioOutput={});const i=null!==(a=e.getActiveDevice(A))&&void 0!==a?a:e.options.audioOutput.deviceId;e.options.audioOutput.deviceId=t;try{e.options.webAudioMix&&(null===(c=e.audioContext)||void 0===c||c.setSinkId(t)),yield Promise.all(Array.from(e.remoteParticipants.values()).map((A=>A.setAudioOutput({deviceId:t}))))}catch(w){throw e.options.audioOutput.deviceId=i,w}}return(d||"audiooutput"===A)&&(e.localParticipant.activeDeviceMap.set(A,"audiooutput"===A&&(null===(h=e.options.audioOutput)||void 0===h?void 0:h.deviceId)||t),e.emit(vn.ActiveDeviceChanged,A,t)),l}()}))}setupLocalParticipantEvents(){this.localParticipant.on(pn.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(pn.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(pn.AttributesChanged,this.onLocalAttributesChanged).on(pn.TrackMuted,this.onLocalTrackMuted).on(pn.TrackUnmuted,this.onLocalTrackUnmuted).on(pn.LocalTrackPublished,this.onLocalTrackPublished).on(pn.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(pn.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(pn.MediaDevicesError,this.onMediaDevicesError).on(pn.AudioStreamAcquired,this.startAudio).on(pn.ChatMessage,this.onLocalChatMessageSent).on(pn.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var A;null===(A=this.engine)||void 0===A||A.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(A,t,e){if(this.state===po.Connecting||this.state===po.Reconnecting){const i=()=>{this.onTrackAdded(A,t,e),n()},n=()=>{this.off(vn.Reconnected,i),this.off(vn.Connected,i),this.off(vn.Disconnected,n)};return this.once(vn.Reconnected,i),this.once(vn.Connected,i),void this.once(vn.Disconnected,n)}if(this.state===po.Disconnected)return void this.log.warn("skipping incoming track after Room disconnected",this.logContext);if("ended"===A.readyState)return void this.log.info("skipping incoming track as it already ended",this.logContext);const i=function(A){const t=A.split("|");return t.length>1?[t[0],A.substr(t[0].length+1)]:[A,""]}(t.id),n=i[0];let s=i[1],r=A.id;if(s&&s.startsWith("TR")&&(r=s),n===this.localParticipant.sid)return void this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);const o=Array.from(this.remoteParticipants.values()).find((A=>A.sid===n));if(!o)return void this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(n),this.logContext);let a;this.options.adaptiveStream&&(a="object"==typeof this.options.adaptiveStream?this.options.adaptiveStream:{}),o.addSubscribedMediaTrack(A,r,t,e,a)}handleDisconnect(){let A=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;var e;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==po.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach((A=>{A.trackPublications.forEach((t=>{A.unpublishTrack(t.trackSid)}))})),this.localParticipant.trackPublications.forEach((t=>{var e,i,n;t.track&&this.localParticipant.unpublishTrack(t.track,A),A?(null===(e=t.track)||void 0===e||e.detach(),null===(i=t.track)||void 0===i||i.stop()):null===(n=t.track)||void 0===n||n.stopMonitor()})),this.localParticipant.off(pn.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(pn.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(pn.AttributesChanged,this.onLocalAttributesChanged).off(pn.TrackMuted,this.onLocalTrackMuted).off(pn.TrackUnmuted,this.onLocalTrackUnmuted).off(pn.LocalTrackPublished,this.onLocalTrackPublished).off(pn.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(pn.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(pn.MediaDevicesError,this.onMediaDevicesError).off(pn.AudioStreamAcquired,this.startAudio).off(pn.ChatMessage,this.onLocalChatMessageSent).off(pn.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&"boolean"==typeof this.options.webAudioMix&&(this.audioContext.close(),this.audioContext=void 0),fs()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),null===(e=navigator.mediaDevices)||void 0===e||e.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(po.Disconnected),this.emit(vn.Disconnected,t)}}}handleParticipantDisconnected(A,t){var e;this.remoteParticipants.delete(A),t&&(t.trackPublications.forEach((A=>{t.unpublishTrack(A.trackSid,!0)})),this.emit(vn.ParticipantDisconnected,t),t.setDisconnected(),null===(e=this.localParticipant)||void 0===e||e.handleParticipantDisconnected(t.identity))}handleStreamHeader(A,t){return Ze(this,void 0,void 0,(function*(){var e;if("byteHeader"===A.contentHeader.case){const i=this.byteStreamHandlers.get(A.topic);if(!i)return void this.log.debug("ignoring incoming byte stream due to no handler for topic",A.topic);let n;const s={id:A.streamId,name:null!==(e=A.contentHeader.value.name)&&void 0!==e?e:"unknown",mimeType:A.mimeType,size:A.totalLength?Number(A.totalLength):void 0,topic:A.topic,timestamp:Ms(A.timestamp),attributes:A.attributes},r=new ReadableStream({start:t=>{n=t,this.byteStreamControllers.set(A.streamId,{info:s,controller:n,startTime:Date.now()})}});i(new Io(s,r,Ms(A.totalLength)),{identity:t})}else if("textHeader"===A.contentHeader.case){const e=this.textStreamHandlers.get(A.topic);if(!e)return void this.log.debug("ignoring incoming text stream due to no handler for topic",A.topic);let i;const n={id:A.streamId,mimeType:A.mimeType,size:A.totalLength?Number(A.totalLength):void 0,topic:A.topic,timestamp:Number(A.timestamp),attributes:A.attributes},s=new ReadableStream({start:t=>{i=t,this.textStreamControllers.set(A.streamId,{info:n,controller:i,startTime:Date.now()})}});e(new ko(n,s,Ms(A.totalLength)),{identity:t})}}))}handleStreamChunk(A){const t=this.byteStreamControllers.get(A.streamId);t&&A.content.length>0&&t.controller.enqueue(A);const e=this.textStreamControllers.get(A.streamId);e&&A.content.length>0&&e.controller.enqueue(A)}handleStreamTrailer(A){const t=this.textStreamControllers.get(A.streamId);t&&(t.info.attributes=Object.assign(Object.assign({},t.info.attributes),A.attributes),t.controller.close(),this.textStreamControllers.delete(A.streamId));const e=this.byteStreamControllers.get(A.streamId);e&&(e.info.attributes=Object.assign(Object.assign({},e.info.attributes),A.attributes),e.controller.close(),this.byteStreamControllers.delete(A.streamId))}acquireAudioContext(){return Ze(this,void 0,void 0,(function*(){var A,t;if("boolean"!=typeof this.options.webAudioMix&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:this.audioContext&&"closed"!==this.audioContext.state||(this.audioContext=null!==(A=Zs())&&void 0!==A?A:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach((A=>A.setAudioContext(this.audioContext))),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&"suspended"===this.audioContext.state)try{yield Promise.race([this.audioContext.resume(),as(200)])}catch(i){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:i}))}const e="running"===(null===(t=this.audioContext)||void 0===t?void 0:t.state);e!==this.canPlaybackAudio&&(this.audioEnabled=e,this.emit(vn.AudioPlaybackStatusChanged,e))}))}createParticipant(A,t){var e;let i;return i=t?Jo.fromParticipantInfo(this.engine.client,t,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):new Jo(this.engine.client,"",A,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&i.setAudioContext(this.audioContext),(null===(e=this.options.audioOutput)||void 0===e?void 0:e.deviceId)&&i.setAudioOutput(this.options.audioOutput).catch((A=>this.log.warn("Could not set audio output: ".concat(A.message),this.logContext))),i}getOrCreateParticipant(A,t){if(this.remoteParticipants.has(A)){const e=this.remoteParticipants.get(A);return t&&e.updateInfo(t)&&this.sidToIdentity.set(t.sid,t.identity),e}const e=this.createParticipant(A,t);return this.remoteParticipants.set(A,e),this.sidToIdentity.set(t.sid,t.identity),this.emitWhenConnected(vn.ParticipantConnected,e),e.on(pn.TrackPublished,(A=>{this.emitWhenConnected(vn.TrackPublished,A,e)})).on(pn.TrackSubscribed,((A,t)=>{A.kind===Xn.Kind.Audio?(A.on(yn.AudioPlaybackStarted,this.handleAudioPlaybackStarted),A.on(yn.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):A.kind===Xn.Kind.Video&&(A.on(yn.VideoPlaybackFailed,this.handleVideoPlaybackFailed),A.on(yn.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(vn.TrackSubscribed,A,t,e)})).on(pn.TrackUnpublished,(A=>{this.emit(vn.TrackUnpublished,A,e)})).on(pn.TrackUnsubscribed,((A,t)=>{this.emit(vn.TrackUnsubscribed,A,t,e)})).on(pn.TrackMuted,(A=>{this.emitWhenConnected(vn.TrackMuted,A,e)})).on(pn.TrackUnmuted,(A=>{this.emitWhenConnected(vn.TrackUnmuted,A,e)})).on(pn.ParticipantMetadataChanged,(A=>{this.emitWhenConnected(vn.ParticipantMetadataChanged,A,e)})).on(pn.ParticipantNameChanged,(A=>{this.emitWhenConnected(vn.ParticipantNameChanged,A,e)})).on(pn.AttributesChanged,(A=>{this.emitWhenConnected(vn.ParticipantAttributesChanged,A,e)})).on(pn.ConnectionQualityChanged,(A=>{this.emitWhenConnected(vn.ConnectionQualityChanged,A,e)})).on(pn.ParticipantPermissionsChanged,(A=>{this.emitWhenConnected(vn.ParticipantPermissionsChanged,A,e)})).on(pn.TrackSubscriptionStatusChanged,((A,t)=>{this.emitWhenConnected(vn.TrackSubscriptionStatusChanged,A,t,e)})).on(pn.TrackSubscriptionFailed,((A,t)=>{this.emit(vn.TrackSubscriptionFailed,A,e,t)})).on(pn.TrackSubscriptionPermissionChanged,((A,t)=>{this.emitWhenConnected(vn.TrackSubscriptionPermissionChanged,A,t,e)})).on(pn.Active,(()=>{this.emitWhenConnected(vn.ParticipantActive,e)})),t&&e.updateInfo(t),e}sendSyncState(){const A=Array.from(this.remoteParticipants.values()).reduce(((A,t)=>(A.push(...t.getTrackPublications()),A)),[]),t=this.localParticipant.getTrackPublications();this.engine.sendSyncState(A,t)}updateSubscriptions(){for(const A of this.remoteParticipants.values())for(const t of A.videoTrackPublications.values())t.isSubscribed&&Ps(t)&&t.emitTrackUpdate()}getRemoteParticipantBySid(A){const t=this.sidToIdentity.get(A);if(t)return this.remoteParticipants.get(t)}registerConnectionReconcile(){this.clearConnectionReconcile();let A=0;this.connectionReconcileInterval=jn.setInterval((()=>{this.engine&&!this.engine.isClosed&&this.engine.verifyTransport()?A=0:(A++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:A,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),A>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,WA.STATE_MISMATCH)))}),4e3)}clearConnectionReconcile(){this.connectionReconcileInterval&&jn.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(A){return A!==this.state&&(this.state=A,this.emit(vn.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach((A=>{let[t,e]=A;this.emit(t,...e)})),this.bufferedEvents=[]}emitWhenConnected(A){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];if(this.state===po.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([A,e]);else if(this.state===po.Connected)return this.emit(A,...e);return!1}simulateParticipants(A){return Ze(this,void 0,void 0,(function*(){var t,e;const i=Object.assign({audio:!0,video:!0,useRealTracks:!1},A.publish),n=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},A.participants);if(this.handleDisconnect(),this.roomInfo=new At({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:I.parse((new Date).getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new it({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(vn.SignalConnected),this.emit(vn.Connected),this.setAndEmitConnectionState(po.Connected),i.video){const A=new xo(Xn.Kind.Video,new ct({source:JA.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:_A.AUDIO,name:"video-dummy"}),new ro(i.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:Is(160*(null!==(t=n.aspectRatios[0])&&void 0!==t?t:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(A),this.localParticipant.emit(pn.LocalTrackPublished,A)}if(i.audio){const A=new xo(Xn.Kind.Audio,new ct({source:JA.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:_A.AUDIO}),new Yr(i.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:Ts(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(A),this.localParticipant.emit(pn.LocalTrackPublished,A)}for(let A=0;A<n.count-1;A+=1){let t=new it({sid:Math.floor(1e4*Math.random()).toString(),identity:"simulated-".concat(A),state:nt.ACTIVE,tracks:[],joinedAt:I.parse(Date.now())});const i=this.getOrCreateParticipant(t.identity,t);if(n.video){const s=Is(160*(null!==(e=n.aspectRatios[A%n.aspectRatios.length])&&void 0!==e?e:1),160,!1,!0),r=new ct({source:JA.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:_A.AUDIO});i.addSubscribedMediaTrack(s,r.sid,new MediaStream([s]),new RTCRtpReceiver),t.tracks=[...t.tracks,r]}if(n.audio){const A=Ts(),e=new ct({source:JA.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:_A.AUDIO});i.addSubscribedMediaTrack(A,e.sid,new MediaStream([A]),new RTCRtpReceiver),t.tracks=[...t.tracks,e]}i.updateInfo(t)}}))}emit(A){for(var t=arguments.length,e=new Array(t>1?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];if(A!==vn.ActiveSpeakersChanged&&A!==vn.TranscriptionReceived){const t=Yo(e).filter((A=>void 0!==A));this.log.debug("room event ".concat(A),Object.assign(Object.assign({},this.logContext),{event:A,args:t}))}return super.emit(A,...e)}}function Yo(A){return A.map((A=>{if(A)return Array.isArray(A)?Yo(A):"object"==typeof A?"logContext"in A?A.logContext:void 0:A}))}Xo.cleanupRegistry="undefined"!=typeof FinalizationRegistry&&new FinalizationRegistry((A=>{A()})),(Fo=Co||(Co={}))[Fo.IDLE=0]="IDLE",Fo[Fo.RUNNING=1]="RUNNING",Fo[Fo.SKIPPED=2]="SKIPPED",Fo[Fo.SUCCESS=3]="SUCCESS",Fo[Fo.FAILED=4]="FAILED",$e.EventEmitter,$e.EventEmitter;const Zo=Symbol.for("@ts-pattern/matcher"),Wo=Symbol.for("@ts-pattern/isVariadic"),qo="@ts-pattern/anonymous-select-key",zo=A=>Boolean(A&&"object"==typeof A),$o=A=>A&&!!A[Zo],Aa=(A,t,e)=>{if($o(A)){const i=A[Zo](),{matched:n,selections:s}=i.match(t);return n&&s&&Object.keys(s).forEach((A=>e(A,s[A]))),n}if(zo(A)){if(!zo(t))return!1;if(Array.isArray(A)){if(!Array.isArray(t))return!1;let i=[],n=[],s=[];for(const t of A.keys()){const e=A[t];$o(e)&&e[Wo]?s.push(e):s.length?n.push(e):i.push(e)}if(s.length){if(s.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<i.length+n.length)return!1;const A=t.slice(0,i.length),r=0===n.length?[]:t.slice(-n.length),o=t.slice(i.length,0===n.length?1/0:-n.length);return i.every(((t,i)=>Aa(t,A[i],e)))&&n.every(((A,t)=>Aa(A,r[t],e)))&&(0===s.length||Aa(s[0],o,e))}return A.length===t.length&&A.every(((A,i)=>Aa(A,t[i],e)))}return Reflect.ownKeys(A).every((i=>{const n=A[i];return(i in t||$o(s=n)&&"optional"===s[Zo]().matcherType)&&Aa(n,t[i],e);var s}))}return Object.is(t,A)},ta=A=>{var t,e,i;return zo(A)?$o(A)?null!=(t=null==(e=(i=A[Zo]()).getSelectionKeys)?void 0:e.call(i))?t:[]:Array.isArray(A)?ea(A,ta):ea(Object.values(A),ta):[]},ea=(A,t)=>A.reduce(((A,e)=>A.concat(t(e))),[]);function ia(A){return Object.assign(A,{optional:()=>sa(A),and:t=>aa(A,t),or:t=>ca(A,t),select:t=>void 0===t?ua(A):ua(t,A)})}function na(A){return Object.assign((t=A,Object.assign(t,{[Symbol.iterator](){let A=0;const e=[{value:Object.assign(t,{[Wo]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var t;return null!=(t=e[A++])?t:e.at(-1)}}}})),{optional:()=>na(sa(A)),select:t=>na(void 0===t?ua(A):ua(t,A))});var t}function sa(A){return ia({[Zo]:()=>({match:t=>{let e={};const i=(A,t)=>{e[A]=t};return void 0===t?(ta(A).forEach((A=>i(A,void 0))),{matched:!0,selections:e}):{matched:Aa(A,t,i),selections:e}},getSelectionKeys:()=>ta(A),matcherType:"optional"})})}const ra=(A,t)=>{for(const e of A)if(!t(e))return!1;return!0},oa=(A,t)=>{for(const[e,i]of A.entries())if(!t(i,e))return!1;return!0};function aa(...A){return ia({[Zo]:()=>({match:t=>{let e={};const i=(A,t)=>{e[A]=t};return{matched:A.every((A=>Aa(A,t,i))),selections:e}},getSelectionKeys:()=>ea(A,ta),matcherType:"and"})})}function ca(...A){return ia({[Zo]:()=>({match:t=>{let e={};const i=(A,t)=>{e[A]=t};return ea(A,ta).forEach((A=>i(A,void 0))),{matched:A.some((A=>Aa(A,t,i))),selections:e}},getSelectionKeys:()=>ea(A,ta),matcherType:"or"})})}function ha(A){return{[Zo]:()=>({match:t=>({matched:Boolean(A(t))})})}}function ua(...A){const t="string"==typeof A[0]?A[0]:void 0,e=2===A.length?A[1]:"string"==typeof A[0]?void 0:A[0];return ia({[Zo]:()=>({match:A=>{let i={[null!=t?t:qo]:A};return{matched:void 0===e||Aa(e,A,((A,t)=>{i[A]=t})),selections:i}},getSelectionKeys:()=>[null!=t?t:qo].concat(void 0===e?[]:ta(e))})})}function la(A){return"number"==typeof A}function da(A){return"string"==typeof A}function Ba(A){return"bigint"==typeof A}const wa=ia(ha((function(A){return!0}))),fa=wa,ga=A=>Object.assign(ia(A),{startsWith:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&A.startsWith(e))))));var e},endsWith:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&A.endsWith(e))))));var e},minLength:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&A.length>=e)))));var e},length:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&A.length===e)))));var e},maxLength:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&A.length<=e)))));var e},includes:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&A.includes(e))))));var e},regex:t=>{return ga(aa(A,(e=t,ha((A=>da(A)&&Boolean(A.match(e)))))));var e}}),Qa=ga(ha(da)),va=A=>Object.assign(ia(A),{between:(t,e)=>{return va(aa(A,(i=t,n=e,ha((A=>la(A)&&i<=A&&n>=A)))));var i,n},lt:t=>{return va(aa(A,(e=t,ha((A=>la(A)&&A<e)))));var e},gt:t=>{return va(aa(A,(e=t,ha((A=>la(A)&&A>e)))));var e},lte:t=>{return va(aa(A,(e=t,ha((A=>la(A)&&A<=e)))));var e},gte:t=>{return va(aa(A,(e=t,ha((A=>la(A)&&A>=e)))));var e},int:()=>va(aa(A,ha((A=>la(A)&&Number.isInteger(A))))),finite:()=>va(aa(A,ha((A=>la(A)&&Number.isFinite(A))))),positive:()=>va(aa(A,ha((A=>la(A)&&A>0)))),negative:()=>va(aa(A,ha((A=>la(A)&&A<0))))}),ma=va(ha(la)),pa=A=>Object.assign(ia(A),{between:(t,e)=>{return pa(aa(A,(i=t,n=e,ha((A=>Ba(A)&&i<=A&&n>=A)))));var i,n},lt:t=>{return pa(aa(A,(e=t,ha((A=>Ba(A)&&A<e)))));var e},gt:t=>{return pa(aa(A,(e=t,ha((A=>Ba(A)&&A>e)))));var e},lte:t=>{return pa(aa(A,(e=t,ha((A=>Ba(A)&&A<=e)))));var e},gte:t=>{return pa(aa(A,(e=t,ha((A=>Ba(A)&&A>=e)))));var e},positive:()=>pa(aa(A,ha((A=>Ba(A)&&A>0)))),negative:()=>pa(aa(A,ha((A=>Ba(A)&&A<0))))}),Ua=pa(ha(Ba)),Ca=ia(ha((function(A){return"boolean"==typeof A}))),Fa=ia(ha((function(A){return"symbol"==typeof A}))),ya=ia(ha((function(A){return null==A}))),ba=ia(ha((function(A){return null!=A})));var Ea={__proto__:null,matcher:Zo,optional:sa,array:function(...A){return na({[Zo]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(0===A.length)return{matched:!0};const e=A[0];let i={};if(0===t.length)return ta(e).forEach((A=>{i[A]=[]})),{matched:!0,selections:i};const n=(A,t)=>{i[A]=(i[A]||[]).concat([t])};return{matched:t.every((A=>Aa(e,A,n))),selections:i}},getSelectionKeys:()=>0===A.length?[]:ta(A[0])})})},set:function(...A){return ia({[Zo]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let e={};if(0===t.size)return{matched:!0,selections:e};if(0===A.length)return{matched:!0};const i=(A,t)=>{e[A]=(e[A]||[]).concat([t])},n=A[0];return{matched:ra(t,(A=>Aa(n,A,i))),selections:e}},getSelectionKeys:()=>0===A.length?[]:ta(A[0])})})},map:function(...A){return ia({[Zo]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let e={};if(0===t.size)return{matched:!0,selections:e};const i=(A,t)=>{e[A]=(e[A]||[]).concat([t])};if(0===A.length)return{matched:!0};var n;if(1===A.length)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null==(n=A[0])?void 0:n.toString()}`);const[s,r]=A;return{matched:oa(t,((A,t)=>{const e=Aa(s,t,i),n=Aa(r,A,i);return e&&n})),selections:e}},getSelectionKeys:()=>0===A.length?[]:[...ta(A[0]),...ta(A[1])]})})},intersection:aa,union:ca,not:function(A){return ia({[Zo]:()=>({match:t=>({matched:!Aa(A,t,(()=>{}))}),getSelectionKeys:()=>[],matcherType:"not"})})},when:ha,select:ua,any:wa,EA:fa,string:Qa,number:ma,bigint:Ua,boolean:Ca,symbol:Fa,nullish:ya,nonNullable:ba,instanceOf:function(A){return ia(ha((t=A,A=>A instanceof t)));var t},shape:function(A){return ia(ha(function(...A){if(1===A.length){const[t]=A;return A=>Aa(t,A,(()=>{}))}if(2===A.length){const[t,e]=A;return Aa(t,e,(()=>{}))}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${A.length}.`)}(A)))}};class Ha extends Error{constructor(A){let t;try{t=JSON.stringify(A)}catch(e){t=A}super(`Pattern matching error: no pattern matches value ${t}`),this.input=void 0,this.input=A}}const Ia={matched:!1,value:void 0};function ka(A){return new Ta(A,Ia)}let Ta=class A{constructor(A,t){this.input=void 0,this.state=void 0,this.input=A,this.state=t}with(...t){if(this.state.matched)return this;const e=t[t.length-1],i=[t[0]];let n;3===t.length&&"function"==typeof t[1]?n=t[1]:t.length>2&&i.push(...t.slice(1,t.length-1));let s=!1,r={};const o=(A,t)=>{s=!0,r[A]=t},a=!i.some((A=>Aa(A,this.input,o)))||n&&!Boolean(n(this.input))?Ia:{matched:!0,value:e(s?qo in r?r[qo]:r:this.input,this.input)};return new A(this.input,a)}when(t,e){if(this.state.matched)return this;const i=Boolean(t(this.input));return new A(this.input,i?{matched:!0,value:e(this.input,this.input)}:Ia)}otherwise(A){return this.state.matched?this.state.value:A(this.input)}exhaustive(A=Sa){return this.state.matched?this.state.value:A(this.input)}run(){return this.exhaustive()}returnType(){return this}};function Sa(A){throw new Ha(A)}var Ka,Oa;(Oa=Ka||(Ka={})).READY="ready",Oa.ERROR="error",Oa.PAUSED="paused",Oa.LOADING="loading",Oa.THINKING="thinking",Oa.RESEARCHING="researching",Oa.AGENT_SPEAKING="agent_speaking",Oa.USER_SPEAKING="user_speaking",Oa.AWAITING_USER_INPUT="awaiting_user_input";class Da{constructor({sessionId:A,apiBaseUrl:t}){this.currentState=Ka.READY,this.assistantAudioContext=null,this.userAudioContext=null,this.HA=null,this.IA=null,this.sessionId=A,this.apiBaseUrl=t||"https://obi.getcor.io/api",this.emitter=new s}emit(A,t){this.emitter.emit(A,t)}on(A,t){this.emitter.on(A,t)}off(A,t){this.emitter.off(A,t)}setupRoomEventListeners(){this.room&&(this.room.on(vn.LocalTrackUnpublished,(A=>{A.source===Xn.Source.ScreenShare&&(this.screenStream=void 0)})),this.room.on(vn.Disconnected,(()=>{this.disconnect()})),this.room.on(vn.ParticipantDisconnected,(()=>{this.disconnect()})),this.room.on(vn.TrackSubscribed,((A,t,e)=>{if("audio"===A.kind&&A.attach(),A.source===Xn.Source.Microphone&&e.identity.includes("agent-")){const t=A.mediaStream;if(!t)return void console.error("No media stream available for assistant track");const e=new AudioContext,i=e.createAnalyser();e.createMediaStreamSource(t).connect(i),i.fftSize=2048;const n=new Uint8Array(i.frequencyBinCount);this.analyzeAudio(i,n,"ASSISTANT"),this.assistantAudioContext=e}})),this.room.on(vn.ParticipantAttributesChanged,(A=>{if(!A["lk.agent.state"])return;if(this.currentState===Ka.RESEARCHING||this.currentState===Ka.PAUSED)return;const t=ka(A["lk.agent.state"]).with("listening",(()=>Ka.USER_SPEAKING)).with("speaking",(()=>Ka.AGENT_SPEAKING)).with("thinking",(()=>Ka.AGENT_SPEAKING)).otherwise((()=>{}));t&&this.setState(t)})),this.room.on(vn.DataReceived,(async A=>{try{const t=JSON.parse((new TextDecoder).decode(A));ka(t.status||t.request).with("using_tool",(()=>{this.currentState=Ka.RESEARCHING,this.emitter.emit("stateChanged",Ka.RESEARCHING)})).with("using_tool_ended",(()=>{this.currentState=Ka.AGENT_SPEAKING,this.emitter.emit("stateChanged",Ka.AGENT_SPEAKING)})).with("share_screen",(()=>{this.shareScreen()})).with("prompt_user",(()=>{this.promptContinue()})).with("capture_page_html",(()=>{this.emitter.emit("capturePageHTML")})).with("fill",(()=>{this.emitter.emit("fill",t.value)})).otherwise((()=>{console.warn("Unknown data received:",t)}))}catch(t){console.error("Error parsing data:",t)}})),this.room.localParticipant.registerRpcMethod("screen_capture",(async A=>(this.emitter.emit("screenCaptureRequested"),new Promise((A=>{this.emitter.once("screenCaptureComplete",(async t=>{if("error"!==t)try{await this.room.localParticipant.sendFile(new File([t],"screen_capture.png",{type:"image/png"}),{mimeType:"image/png",topic:"screen_capture"}),A("ok")}catch(e){A("error")}else A("error")}))}))))))}async connect(){if(!this.sessionId)return console.error("No session ID found"),void this.emitter.emit("error",new Error("No session ID provided"));try{await this.requestMicrophone(),this.room=new Xo({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners();const A=new URLSearchParams({token:this.sessionId,skip_intro:"true"}),t=`${this.apiBaseUrl}/join-token?${A.toString()}`,e=await fetch(t).then((A=>A.json()));if(await this.room.connect(e.url,e.token),this.microphoneStream){const A=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(A,{name:"microphone",source:Xn.Source.Microphone})}return{url:e.url,token:e.token}}catch(A){throw console.error("Failed to connect to LiveKit:",A),this.disconnect(),this.emitter.emit("error",A instanceof Error?A:new Error(String(A))),A}}async disconnect(){this.room&&(this.room.disconnect(!0),this.room.removeAllListeners(),this.room=void 0),this.screenStream?.track&&this.screenStream.track.stop(),this.microphoneStream&&this.microphoneStream.getTracks().forEach((A=>A.stop())),this.IA&&(window.clearTimeout(this.IA),this.IA=null),this.HA&&(window.clearTimeout(this.HA),this.HA=null),await(this.userAudioContext?.close().catch((()=>{}))),this.userAudioContext=null,await(this.assistantAudioContext?.close().catch((()=>{}))),this.assistantAudioContext=null,this.setState(Ka.READY),this.emitter.emit("disconnected")}setState(A){A!==this.currentState&&(this.currentState=A,this.emitter.emit("stateChanged",A))}async requestMicrophone(){try{const A=await navigator.mediaDevices.getUserMedia({audio:!0});this.microphoneStream=A;const t=new AudioContext;this.userAudioContext=t;const e=t.createAnalyser(),i=t.createMediaStreamSource(A),n=t.createGain();n.gain.value=1.5,i.connect(n),n.connect(e),e.fftSize=2048;const s=new Uint8Array(e.frequencyBinCount);this.analyzeAudio(e,s,"USER")}catch(A){throw console.error("Microphone permission denied:",A),new Error("Microphone permission denied")}}async shareScreen(){if(this.room){this.emitter.emit("preScreenShare");try{if(this.screenStream=await this.room.localParticipant.setScreenShareEnabled(!0,{video:{displaySurface:"window"}}),!this.screenStream)return void console.warn("Failed to share screen");await this.room.localParticipant.publishData((new TextEncoder).encode(JSON.stringify({request:"share_screen",success:!0})),{reliable:!0})}catch(A){console.error("Error sharing screen:",A),this.emitter.emit("error",A instanceof Error?A:new Error(String(A)))}}else console.warn("[obi] shareScreen called while not connected")}pauseRecording(){this.room&&(this.setState(Ka.PAUSED),this.room.localParticipant.getTrackPublications().forEach((A=>{A.handleMuted(),A.track?.mediaStream?.getTracks().forEach((A=>A.enabled=!1))})),this.microphoneStream?.getTracks().forEach((A=>A.enabled=!1)),this.screenStream?.track?.mute())}resumeRecording(){this.room&&(this.setState(Ka.USER_SPEAKING),this.room.localParticipant.getTrackPublications().forEach((A=>{A.handleUnmuted(),A.track?.mediaStream?.getTracks().forEach((A=>A.enabled=!0))})),this.microphoneStream?.getTracks().forEach((A=>A.enabled=!0)),this.screenStream?.track?.unmute())}async promptContinue(){await this.room.localParticipant.publishData((new TextEncoder).encode(JSON.stringify({request:"prompt_user",success:!0})),{reliable:!0})}async analyzeAudio(A,t,e){if("USER"===e&&this.currentState===Ka.USER_SPEAKING||"ASSISTANT"===e&&this.currentState===Ka.AGENT_SPEAKING){A.getByteFrequencyData(t);const i=t.reduce(((A,t)=>A+t),0)/t.length,n=Math.max(.01,Math.min(1,i/128));let s;"USER"===e&&this.currentState===Ka.USER_SPEAKING?s="USER":"ASSISTANT"===e&&this.currentState===Ka.AGENT_SPEAKING&&(s="ASSISTANT"),s&&this.emitter.emit("volume",{speaker:s,spectrum:Array.from(t),volume:n})}"USER"===e?this.IA=window.setTimeout((()=>this.analyzeAudio(A,t,e)),200):this.HA=window.setTimeout((()=>this.analyzeAudio(A,t,e)),200)}async sendHTML(A){if(this.room)try{const t={type:"page_content",html:A,timestamp:(new Date).toISOString()},e=JSON.stringify(t),i=(new TextEncoder).encode(e);await this.room.localParticipant.publishData(i,{reliable:!0})}catch(t){console.error("Error sending HTML to LiveKit:",t),this.emitter.emit("error",t instanceof Error?t:new Error(String(t)))}else console.log("Cannot send HTML: Not connected to room")}async reconnect(A,t,e){try{if(!A||!t)return console.error("Missing room URL or token for reconnection"),this.emitter.emit("error",new Error("Missing room URL or token for reconnection")),!1;if(await this.requestMicrophone(),this.room=new Xo({adaptiveStream:!0,dynacast:!0}),this.setupRoomEventListeners(),await this.room.connect(A,t),this.microphoneStream){const A=this.microphoneStream.getAudioTracks()[0];await this.room.localParticipant.publishTrack(A,{name:"microphone",source:Xn.Source.Microphone})}return this.setState(e),e===Ka.PAUSED&&this.pauseRecording(),!0}catch(i){return console.error("Failed to reconnect to room:",i),this.disconnect(),this.emitter.emit("error",i instanceof Error?i:new Error(String(i))),!1}}}var Ma=function(A,t){return(Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,t){A.__proto__=t}||function(A,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(A[e]=t[e])})(A,t)};function La(A,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=A}Ma(A,t),A.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}var Ra=function(){return Ra=Object.assign||function(A){for(var t,e=1,i=arguments.length;e<i;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(A[n]=t[n]);return A},Ra.apply(this,arguments)};function Na(A,t,e,i){return new(e||(e=Promise))((function(n,s){function r(A){try{a(i.next(A))}catch(t){s(t)}}function o(A){try{a(i.throw(A))}catch(t){s(t)}}function a(A){var t;A.done?n(A.value):(t=A.value,t instanceof e?t:new e((function(A){A(t)}))).then(r,o)}a((i=i.apply(A,t||[])).next())}))}function Ga(A,t){var e,i,n,s,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(o){return function(a){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;s&&(s=0,o[0]&&(r=0)),r;)try{if(e=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(!((n=(n=r.trys).length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){r=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){r.label=o[1];break}if(6===o[0]&&r.label<n[1]){r.label=n[1],n=o;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(o);break}n[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(A,r)}catch(a){o=[6,a],i=0}finally{e=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function xa(A,t,e){if(e||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return A.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;for(var Va=function(){function A(A,t,e,i){this.left=A,this.top=t,this.width=e,this.height=i}return A.prototype.add=function(t,e,i,n){return new A(this.left+t,this.top+e,this.width+i,this.height+n)},A.fromClientRect=function(t,e){return new A(e.left+t.windowBounds.left,e.top+t.windowBounds.top,e.width,e.height)},A.fromDOMRectList=function(t,e){var i=Array.from(e).find((function(A){return 0!==A.width}));return i?new A(i.left+t.windowBounds.left,i.top+t.windowBounds.top,i.width,i.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),ja=function(A,t){return Va.fromClientRect(A,t.getBoundingClientRect())},Pa=function(A){for(var t=[],e=0,i=A.length;e<i;){var n=A.charCodeAt(e++);if(n>=55296&&n<=56319&&e<i){var s=A.charCodeAt(e++);56320==(64512&s)?t.push(((1023&n)<<10)+(1023&s)+65536):(t.push(n),e--)}else t.push(n)}return t},_a=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var e=A.length;if(!e)return"";for(var i=[],n=-1,s="";++n<e;){var r=A[n];r<=65535?i.push(r):(r-=65536,i.push(55296+(r>>10),r%1024+56320)),(n+1===e||i.length>16384)&&(s+=String.fromCharCode.apply(String,i),i.length=0)}return s},Ja="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xa=0;Xa<64;Xa++)Ja["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Xa)]=Xa;for(var Ya="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Za=0;Za<64;Za++)Ya["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Za)]=Za;for(var Wa=function(A,t,e){return A.slice?A.slice(t,e):new Uint16Array(Array.prototype.slice.call(A,t,e))},qa=function(){function A(A,t,e,i,n,s){this.initialValue=A,this.errorValue=t,this.highStart=e,this.highValueIndex=i,this.index=n,this.data=s}return A.prototype.get=function(A){var t;if(A>=0){if(A<55296||A>56319&&A<=65535)return t=((t=this.index[A>>5])<<2)+(31&A),this.data[t];if(A<=65535)return t=((t=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[t];if(A<this.highStart)return t=2080+(A>>11),t=this.index[t],t+=A>>5&63,t=((t=this.index[t])<<2)+(31&A),this.data[t];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),za="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$a=0;$a<64;$a++)za["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt($a)]=$a;var Ac,tc,ec,ic,nc,sc,rc,oc,ac,cc,hc=10,uc=13,lc=15,dc=17,Bc=18,wc=19,fc=20,gc=21,Qc=22,vc=24,mc=25,pc=26,Uc=27,Cc=28,Fc=30,yc=32,bc=33,Ec=34,Hc=35,Ic=37,kc=38,Tc=39,Sc=40,Kc=42,Oc=[9001,65288],Dc="×",Mc="÷",Lc=(ic=function(A){var t,e,i,n,s,r=39666,o=0;"="===A[52887]&&(r--,"="===A[52886]&&r--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),c=Array.isArray(a)?a:new Uint8Array(a);for(t=0;t<52888;t+=4)e=Ya[A.charCodeAt(t)],i=Ya[A.charCodeAt(t+1)],n=Ya[A.charCodeAt(t+2)],s=Ya[A.charCodeAt(t+3)],c[o++]=e<<2|i>>4,c[o++]=(15&i)<<4|n>>2,c[o++]=(3&n)<<6|63&s;return a}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),nc=Array.isArray(ic)?function(A){for(var t=A.length,e=[],i=0;i<t;i+=4)e.push(A[i+3]<<24|A[i+2]<<16|A[i+1]<<8|A[i]);return e}(ic):new Uint32Array(ic),rc=Wa(sc=Array.isArray(ic)?function(A){for(var t=A.length,e=[],i=0;i<t;i+=2)e.push(A[i+1]<<8|A[i]);return e}(ic):new Uint16Array(ic),12,nc[4]/2),oc=2===nc[5]?Wa(sc,(24+nc[4])/2):(Ac=nc,tc=Math.ceil((24+nc[4])/4),Ac.slice?Ac.slice(tc,ec):new Uint32Array(Array.prototype.slice.call(Ac,tc,ec))),new qa(nc[0],nc[1],nc[2],nc[3],rc,oc)),Rc=[Fc,36],Nc=[1,2,3,5],Gc=[hc,8],xc=[Uc,pc],Vc=Nc.concat(Gc),jc=[kc,Tc,Sc,Ec,Hc],Pc=[lc,uc],_c=function(A,t,e,i){var n=i[e];if(Array.isArray(A)?-1!==A.indexOf(n):A===n)for(var s=e;s<=i.length;){if((a=i[++s])===t)return!0;if(a!==hc)break}if(n===hc)for(s=e;s>0;){var r=i[--s];if(Array.isArray(A)?-1!==A.indexOf(r):A===r)for(var o=e;o<=i.length;){var a;if((a=i[++o])===t)return!0;if(a!==hc)break}if(r!==hc)break}return!1},Jc=function(A,t){for(var e=A;e>=0;){var i=t[e];if(i!==hc)return i;e--}return 0},Xc=function(A,t,e,i,n){if(0===e[i])return Dc;var s=i-1;if(Array.isArray(n)&&!0===n[s])return Dc;var r=s-1,o=s+1,a=t[s],c=r>=0?t[r]:0,h=t[o];if(2===a&&3===h)return Dc;if(-1!==Nc.indexOf(a))return"!";if(-1!==Nc.indexOf(h))return Dc;if(-1!==Gc.indexOf(h))return Dc;if(8===Jc(s,t))return Mc;if(11===Lc.get(A[s]))return Dc;if((a===yc||a===bc)&&11===Lc.get(A[o]))return Dc;if(7===a||7===h)return Dc;if(9===a)return Dc;if(-1===[hc,uc,lc].indexOf(a)&&9===h)return Dc;if(-1!==[dc,Bc,wc,vc,Cc].indexOf(h))return Dc;if(Jc(s,t)===Qc)return Dc;if(_c(23,Qc,s,t))return Dc;if(_c([dc,Bc],gc,s,t))return Dc;if(_c(12,12,s,t))return Dc;if(a===hc)return Mc;if(23===a||23===h)return Dc;if(16===h||16===a)return Mc;if(-1!==[uc,lc,gc].indexOf(h)||14===a)return Dc;if(36===c&&-1!==Pc.indexOf(a))return Dc;if(a===Cc&&36===h)return Dc;if(h===fc)return Dc;if(-1!==Rc.indexOf(h)&&a===mc||-1!==Rc.indexOf(a)&&h===mc)return Dc;if(a===Uc&&-1!==[Ic,yc,bc].indexOf(h)||-1!==[Ic,yc,bc].indexOf(a)&&h===pc)return Dc;if(-1!==Rc.indexOf(a)&&-1!==xc.indexOf(h)||-1!==xc.indexOf(a)&&-1!==Rc.indexOf(h))return Dc;if(-1!==[Uc,pc].indexOf(a)&&(h===mc||-1!==[Qc,lc].indexOf(h)&&t[o+1]===mc)||-1!==[Qc,lc].indexOf(a)&&h===mc||a===mc&&-1!==[mc,Cc,vc].indexOf(h))return Dc;if(-1!==[mc,Cc,vc,dc,Bc].indexOf(h))for(var u=s;u>=0;){if((l=t[u])===mc)return Dc;if(-1===[Cc,vc].indexOf(l))break;u--}if(-1!==[Uc,pc].indexOf(h))for(u=-1!==[dc,Bc].indexOf(a)?r:s;u>=0;){var l;if((l=t[u])===mc)return Dc;if(-1===[Cc,vc].indexOf(l))break;u--}if(kc===a&&-1!==[kc,Tc,Ec,Hc].indexOf(h)||-1!==[Tc,Ec].indexOf(a)&&-1!==[Tc,Sc].indexOf(h)||-1!==[Sc,Hc].indexOf(a)&&h===Sc)return Dc;if(-1!==jc.indexOf(a)&&-1!==[fc,pc].indexOf(h)||-1!==jc.indexOf(h)&&a===Uc)return Dc;if(-1!==Rc.indexOf(a)&&-1!==Rc.indexOf(h))return Dc;if(a===vc&&-1!==Rc.indexOf(h))return Dc;if(-1!==Rc.concat(mc).indexOf(a)&&h===Qc&&-1===Oc.indexOf(A[o])||-1!==Rc.concat(mc).indexOf(h)&&a===Bc)return Dc;if(41===a&&41===h){for(var d=e[s],B=1;d>0&&41===t[--d];)B++;if(B%2!=0)return Dc}return a===yc&&h===bc?Dc:Mc},Yc=function(){function A(A,t,e,i){this.codePoints=A,this.required="!"===t,this.start=e,this.end=i}return A.prototype.slice=function(){return _a.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),Zc=45,Wc=43,qc=-1,zc=function(A){return A>=48&&A<=57},$c=function(A){return zc(A)||A>=65&&A<=70||A>=97&&A<=102},Ah=function(A){return 10===A||9===A||32===A},th=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},eh=function(A){return th(A)||zc(A)||A===Zc},ih=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},nh=function(A,t){return 92===A&&10!==t},sh=function(A,t,e){return A===Zc?th(t)||nh(t,e):!!th(A)||!(92!==A||!nh(A,t))},rh=function(A,t,e){return A===Wc||A===Zc?!!zc(t)||46===t&&zc(e):zc(46===A?t:A)},oh=function(A){var t=0,e=1;A[t]!==Wc&&A[t]!==Zc||(A[t]===Zc&&(e=-1),t++);for(var i=[];zc(A[t]);)i.push(A[t++]);var n=i.length?parseInt(_a.apply(void 0,i),10):0;46===A[t]&&t++;for(var s=[];zc(A[t]);)s.push(A[t++]);var r=s.length,o=r?parseInt(_a.apply(void 0,s),10):0;69!==A[t]&&101!==A[t]||t++;var a=1;A[t]!==Wc&&A[t]!==Zc||(A[t]===Zc&&(a=-1),t++);for(var c=[];zc(A[t]);)c.push(A[t++]);var h=c.length?parseInt(_a.apply(void 0,c),10):0;return e*(n+o*Math.pow(10,-r))*Math.pow(10,a*h)},ah={type:2},ch={type:3},hh={type:4},uh={type:13},lh={type:8},dh={type:21},Bh={type:9},wh={type:10},fh={type:11},gh={type:12},Qh={type:14},vh={type:23},mh={type:1},ph={type:25},Uh={type:24},Ch={type:26},Fh={type:27},yh={type:28},bh={type:29},Eh={type:31},Hh={type:32},Ih=function(){function A(){this.kA=[]}return A.prototype.write=function(A){this.kA=this.kA.concat(Pa(A))},A.prototype.read=function(){for(var A=[],t=this.consumeToken();t!==Hh;)A.push(t),t=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),e=this.peekCodePoint(1),i=this.peekCodePoint(2);if(eh(t)||nh(e,i)){var n=sh(t,e,i)?2:1;return{type:5,value:this.consumeName(),flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),uh;break;case 39:return this.consumeStringToken(39);case 40:return ah;case 41:return ch;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Qh;break;case Wc:if(rh(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return hh;case Zc:var s=A,r=this.peekCodePoint(0),o=this.peekCodePoint(1);if(rh(s,r,o))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(sh(s,r,o))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(r===Zc&&62===o)return this.consumeCodePoint(),this.consumeCodePoint(),Uh;break;case 46:if(rh(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var a=this.consumeCodePoint();if(42===a&&47===(a=this.consumeCodePoint()))return this.consumeToken();if(a===qc)return this.consumeToken()}break;case 58:return Ch;case 59:return Fh;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===Zc&&this.peekCodePoint(2)===Zc)return this.consumeCodePoint(),this.consumeCodePoint(),ph;break;case 64:var c=this.peekCodePoint(0),h=this.peekCodePoint(1),u=this.peekCodePoint(2);if(sh(c,h,u))return{type:7,value:this.consumeName()};break;case 91:return yh;case 92:if(nh(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return bh;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),lh;break;case 123:return fh;case 125:return gh;case 117:case 85:var l=this.peekCodePoint(0),d=this.peekCodePoint(1);return l!==Wc||!$c(d)&&63!==d||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Bh;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),dh;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),wh;break;case qc:return Hh}return Ah(A)?(this.consumeWhiteSpace(),Eh):zc(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):th(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:_a(A)}},A.prototype.consumeCodePoint=function(){var A=this.kA.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this.kA.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this.kA.length?-1:this.kA[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],t=this.consumeCodePoint();$c(t)&&A.length<6;)A.push(t),t=this.consumeCodePoint();for(var e=!1;63===t&&A.length<6;)A.push(t),t=this.consumeCodePoint(),e=!0;if(e)return{type:30,start:parseInt(_a.apply(void 0,A.map((function(A){return 63===A?48:A}))),16),end:parseInt(_a.apply(void 0,A.map((function(A){return 63===A?70:A}))),16)};var i=parseInt(_a.apply(void 0,A),16);if(this.peekCodePoint(0)===Zc&&$c(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var n=[];$c(t)&&n.length<6;)n.push(t),t=this.consumeCodePoint();return{type:30,start:i,end:parseInt(_a.apply(void 0,n),16)}}return{type:30,start:i,end:i}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===qc)return{type:22,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var e=this.consumeStringToken(this.consumeCodePoint());return 0===e.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===qc||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:e.value}):(this.consumeBadUrlRemnants(),vh)}for(;;){var i=this.consumeCodePoint();if(i===qc||41===i)return{type:22,value:_a.apply(void 0,A)};if(Ah(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===qc||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:_a.apply(void 0,A)}):(this.consumeBadUrlRemnants(),vh);if(34===i||39===i||40===i||ih(i))return this.consumeBadUrlRemnants(),vh;if(92===i){if(!nh(i,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),vh;A.push(this.consumeEscapedCodePoint())}else A.push(i)}},A.prototype.consumeWhiteSpace=function(){for(;Ah(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===qc)return;nh(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var t="";A>0;){var e=Math.min(5e4,A);t+=_a.apply(void 0,this.kA.splice(0,e)),A-=e}return this.kA.shift(),t},A.prototype.consumeStringToken=function(A){for(var t="",e=0;;){var i=this.kA[e];if(i===qc||void 0===i||i===A)return{type:0,value:t+=this.consumeStringSlice(e)};if(10===i)return this.kA.splice(0,e),mh;if(92===i){var n=this.kA[e+1];n!==qc&&void 0!==n&&(10===n?(t+=this.consumeStringSlice(e),e=-1,this.kA.shift()):nh(i,n)&&(t+=this.consumeStringSlice(e),t+=_a(this.consumeEscapedCodePoint()),e=-1))}e++}},A.prototype.consumeNumber=function(){var A=[],t=4,e=this.peekCodePoint(0);for(e!==Wc&&e!==Zc||A.push(this.consumeCodePoint());zc(this.peekCodePoint(0));)A.push(this.consumeCodePoint());e=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(46===e&&zc(i))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;zc(this.peekCodePoint(0));)A.push(this.consumeCodePoint());e=this.peekCodePoint(0),i=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===e||101===e)&&((i===Wc||i===Zc)&&zc(n)||zc(i)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;zc(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[oh(A),t]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),t=A[0],e=A[1],i=this.peekCodePoint(0),n=this.peekCodePoint(1),s=this.peekCodePoint(2);return sh(i,n,s)?{type:15,number:t,flags:e,unit:this.consumeName()}:37===i?(this.consumeCodePoint(),{type:16,number:t,flags:e}):{type:17,number:t,flags:e}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if($c(A)){for(var t=_a(A);$c(this.peekCodePoint(0))&&t.length<6;)t+=_a(this.consumeCodePoint());Ah(this.peekCodePoint(0))&&this.consumeCodePoint();var e=parseInt(t,16);return 0===e||function(A){return A>=55296&&A<=57343}(e)||e>1114111?65533:e}return A===qc?65533:A},A.prototype.consumeName=function(){for(var A="";;){var t=this.consumeCodePoint();if(eh(t))A+=_a(t);else{if(!nh(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),A;A+=_a(this.consumeEscapedCodePoint())}}},A}(),kh=function(){function A(A){this.TA=A}return A.create=function(t){var e=new Ih;return e.write(t),new A(e.read())},A.parseValue=function(t){return A.create(t).parseComponentValue()},A.parseValues=function(t){return A.create(t).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var t=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var t=this.consumeComponentValue();if(32===t.type)return A;A.push(t),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var t={type:A,values:[]},e=this.consumeToken();;){if(32===e.type||Nh(e,A))return t;this.reconsumeToken(e),t.values.push(this.consumeComponentValue()),e=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var t={name:A.value,values:[],type:18};;){var e=this.consumeToken();if(32===e.type||3===e.type)return t;this.reconsumeToken(e),t.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this.TA.shift();return void 0===A?Hh:A},A.prototype.reconsumeToken=function(A){this.TA.unshift(A)},A}(),Th=function(A){return 15===A.type},Sh=function(A){return 17===A.type},Kh=function(A){return 20===A.type},Oh=function(A){return 0===A.type},Dh=function(A,t){return Kh(A)&&A.value===t},Mh=function(A){return 31!==A.type},Lh=function(A){return 31!==A.type&&4!==A.type},Rh=function(A){var t=[],e=[];return A.forEach((function(A){if(4===A.type){if(0===e.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(e),void(e=[])}31!==A.type&&e.push(A)})),e.length&&t.push(e),t},Nh=function(A,t){return 11===t&&12===A.type||28===t&&29===A.type||2===t&&3===A.type},Gh=function(A){return 17===A.type||15===A.type},xh=function(A){return 16===A.type||Gh(A)},Vh=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},jh={type:17,number:0,flags:4},Ph={type:16,number:50,flags:4},_h={type:16,number:100,flags:4},Jh=function(A,t,e){var i=A[0],n=A[1];return[Xh(i,t),Xh(void 0!==n?n:i,e)]},Xh=function(A,t){if(16===A.type)return A.number/100*t;if(Th(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Yh="grad",Zh="turn",Wh=function(A,t){if(15===t.type)switch(t.unit){case"deg":return Math.PI*t.number/180;case Yh:return Math.PI/200*t.number;case"rad":return t.number;case Zh:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")},qh=function(A){return 15===A.type&&("deg"===A.unit||A.unit===Yh||"rad"===A.unit||A.unit===Zh)},zh=function(A){switch(A.filter(Kh).map((function(A){return A.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[jh,jh];case"to top":case"bottom":return $h(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[jh,_h];case"to right":case"left":return $h(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[_h,_h];case"to bottom":case"top":return $h(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[_h,jh];case"to left":case"right":return $h(270)}return 0},$h=function(A){return Math.PI*A/180},Au=function(A){return!(255&A)},tu=function(A){var t=255&A,e=255&A>>8,i=255&A>>16,n=255&A>>24;return t<255?"rgba(".concat(n,",").concat(i,",").concat(e,",").concat(t/255,")"):"rgb(".concat(n,",").concat(i,",").concat(e,")")},eu=function(A,t,e,i){return(A<<24|t<<16|e<<8|Math.round(255*i))>>>0},iu=function(A,t){if(17===A.type)return A.number;if(16===A.type){var e=3===t?1:255;return 3===t?A.number/100*e:Math.round(A.number/100*e)}return 0},nu=function(A){return"from"===(20===A[0].type?A[0].value:"unknown")},su=function(A,t,e){return Math.min(Math.max(A,t),e)},ru=function(A,t){return[A[0]*t[0]+A[1]*t[1]+A[2]*t[2],A[3]*t[0]+A[4]*t[1]+A[5]*t[2],A[6]*t[0]+A[7]*t[1]+A[8]*t[2]]},ou=function(A){var t=A[0],e=A[1],i=A[2],n=A[3],s=yu([t,e,i]);return eu(su(Math.round(255*s[0]),0,255),su(Math.round(255*s[1]),0,255),su(Math.round(255*s[2]),0,255),n)},au=function(A){var t=Cu([A[0],A[1],A[2]]);return ou([t[0],t[1],t[2],A[3]])},cu=function(A,t){var e=t.filter(Lh),i=e[0],n=e[1],s=e[2],r=e[3];return[(17===i.type?$h(i.number):Wh(0,i))/(2*Math.PI),xh(n)?n.number/100:0,xh(s)?s.number/100:0,void 0!==r&&xh(r)?Xh(r,1):1]},hu=function(A,t){if(nu(t))throw new Error("Relative color not supported for hsl()");var e=cu(0,t),i=e[0],n=e[1],s=e[2],r=e[3],o=gu([i,n,s]);return eu(255*o[0],255*o[1],255*o[2],0===n?1:r)},uu=function(A){var t=A.filter(Lh);return[xh(t[0])?t[0].number:0,xh(t[1])?t[1].number:0,Sh(t[2])||Th(t[2])?t[2].number:0,void 0!==t[4]&&xh(t[4])?Xh(t[4],1):1]},lu=function(A){var t=A.filter(Lh);return[16===t[0].type?t[0].number/100:Sh(t[0])?t[0].number:0,16===t[1].type?t[1].number/100:Sh(t[1])?t[1].number:0,Sh(t[2])||Th(t[2])?t[2].number:0,void 0!==t[4]&&xh(t[4])?Xh(t[4],1):1]},du=function(A){var t=A.filter(Lh);return[16===t[0].type?t[0].number/100:Sh(t[0])?t[0].number:0,16===t[1].type?t[1].number/100:Sh(t[1])?t[1].number:0,Sh(t[2])||Th(t[2])?t[2].number:0,void 0!==t[4]&&xh(t[4])?Xh(t[4],1):1]},Bu=function(A){return ru([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A)},wu=function(A){return ru([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A)},fu=function(A,t,e){return e<0&&(e+=1),e>=1&&(e-=1),e<1/6?(t-A)*e*6+A:e<.5?t:e<2/3?6*(t-A)*(2/3-e)+A:A},gu=function(A){var t=A[0],e=A[1],i=A[2];if(0===e)return[255*i,255*i,255*i];var n=i<=.5?i*(e+1):i+e-i*e,s=2*i-n;return[fu(s,n,t+1/3),fu(s,n,t),fu(s,n,t-1/3)]},Qu=function(A){var t=A[0],e=A[1],i=A[2];return e<0&&(e=0),isNaN(i)&&(i=0),[t,e*Math.cos(i*Math.PI/180),e*Math.sin(i*Math.PI/180)]},vu=function(A){var t=ru([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map((function(A){return Math.pow(A,3)}));return ru([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],t)},mu=function(A){var t=(A[0]+16)/116,e=A[1]/500+t,i=t-A[2]/200,n=24389/27,s=24/116,r=[.3457*(e>s?Math.pow(e,3):(116*e-16)/n)/.3585,A[0]>8?Math.pow(t,3):A[0]/n,.2958*(i>s?Math.pow(i,3):(116*i-16)/n)/.3585];return wu([r[0],r[1],r[2]])},pu=function(A){return A},Uu=function(A){return au([A[0],A[1],A[2],A[3]])},Cu=function(A){return ru([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A)},Fu=function(A){return ru([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A)},yu=function(A){return A.map((function(A){var t=A<0?-1:1,e=Math.abs(A);return e>.0031308?t*(1.055*Math.pow(e,1/2.4)-.055):12.92*A}))},bu=function(A){return A.map((function(A){var t=A<0?-1:1,e=Math.abs(A);return e<=.04045?A/12.92:t*Math.pow((e+.055)/1.055,2.4)}))},Eu=1.09929682680944,Hu=.018053968510807,Iu=function(A,t){if(18===t.type){var e=Du[t.name];if(void 0===e)throw new Error('Attempting to parse an unsupported color function "'.concat(t.name,'"'));return e(A,t.values)}if(5===t.type){var i=ku(t),n=i[0],s=i[1],r=i[2],o=i[3];return eu(n,s,r,o)}if(20===t.type){var a=Lu[t.value.toUpperCase()];if(void 0!==a)return a}return Lu.TRANSPARENT},ku=function(A){if(3===A.value.length){var t=A.value.substring(0,1),e=A.value.substring(1,2),i=A.value.substring(2,3);return[parseInt(t+t,16),parseInt(e+e,16),parseInt(i+i,16),1]}if(4===A.value.length){t=A.value.substring(0,1),e=A.value.substring(1,2),i=A.value.substring(2,3);var n=A.value.substring(3,4);return[parseInt(t+t,16),parseInt(e+e,16),parseInt(i+i,16),parseInt(n+n,16)/255]}return 6===A.value.length?(t=A.value.substring(0,2),e=A.value.substring(2,4),i=A.value.substring(4,6),[parseInt(t,16),parseInt(e,16),parseInt(i,16),1]):8===A.value.length?(t=A.value.substring(0,2),e=A.value.substring(2,4),i=A.value.substring(4,6),n=A.value.substring(6,8),[parseInt(t,16),parseInt(e,16),parseInt(i,16),parseInt(n,16)/255]):[0,0,0,1]},Tu=function(A,t){var e=t.filter(Lh);if(nu(e))throw new Error("Relative color not supported for rgb()");if(3===e.length){var i=e.map(iu),n=i[0],s=i[1],r=i[2];return eu(n,s,r,1)}if(4===e.length){var o=e.map(iu),a=(n=o[0],s=o[1],r=o[2],o[3]);return eu(n,s,r,a)}return 0},Su={srgb:function(A){return eu(su(Math.round(255*A[0]),0,255),su(Math.round(255*A[1]),0,255),su(Math.round(255*A[2]),0,255),su(A[3],0,1))},"srgb-linear":ou,"display-p3":function(A){var t=function(A){var t,e=[A[0],A[1],A[2]].map((function(A){var t=A<0?-1:1;return A*t<=.04045?A/12.92:t*Math.pow((A+.055)/1.055,2.4)||0}));return t=[e[0],e[1],e[2]],ru([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],t)}([A[0],A[1],A[2]]);return au([t[0],t[1],t[2],A[3]])},"a98-rgb":function(A){var t,e,i=Cu((t=[(e=[A[0],A[1],A[2]].map((function(A){var t=A<0?-1:1,e=Math.abs(A);return t*Math.pow(e,563/256)})))[0],e[1],e[2]],ru([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],t)));return ou([i[0],i[1],i[2],A[3]])},"prophoto-rgb":function(A){var t=function(A){var t,e=[A[0],A[1],A[2]].map((function(A){return A<16/512?A/16:Math.pow(A,1.8)}));return wu((t=[e[0],e[1],e[2]],ru([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],t)))}([A[0],A[1],A[2]]);return au([t[0],t[1],t[2],A[3]])},xyz:Uu,"xyz-d50":function(A){var t=function(A){return wu([A[0],A[1],A[2]])}([A[0],A[1],A[2]]);return au([t[0],t[1],t[2],A[3]])},"xyz-d65":Uu,rec2020:function(A){var t=function(A){var t,e=[A[0],A[1],A[2]].map((function(A){return A<4.5*Hu?A/4.5:Math.pow((A+Eu-1)/Eu,1/.45)}));return t=[e[0],e[1],e[2]],ru([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],t)}([A[0],A[1],A[2]]);return au([t[0],t[1],t[2],A[3]])}},Ku={rgb:function(A,t){var e=t.filter(Lh);if(3===e.length){var i=e.map(iu),n=i[0],s=i[1],r=i[2],o=bu([n/255,s/255,r/255]),a=Fu([o[0],o[1],o[2]]);return[a[0],a[1],a[2],1]}if(4===e.length){var c=e.map(iu),h=(n=c[0],s=c[1],r=c[2],c[3]),u=(o=bu([n/255,s/255,r/255]),Fu([o[0],o[1],o[2]]));return[u[0],u[1],u[2],h]}return[0,0,0,1]},hsl:function(A,t){var e=cu(0,t),i=e[0],n=e[1],s=e[2],r=e[3],o=bu(gu([i,n,s])),a=Fu([o[0],o[1],o[2]]);return[a[0],a[1],a[2],r]},lab:function(A,t){var e=lu(t),i=e[0],n=e[1],s=e[2],r=e[3],o=mu([i,n,s]);return[o[0],o[1],o[2],r]},lch:function(A,t){var e=uu(t),i=e[0],n=e[1],s=e[2],r=e[3],o=mu(Qu([i,n,s]));return[o[0],o[1],o[2],r]},oklab:function(A,t){var e=lu(t),i=e[0],n=e[1],s=e[2],r=e[3],o=vu([i,n,s]);return[o[0],o[1],o[2],r]},oklch:function(A,t){var e=du(t),i=e[0],n=e[1],s=e[2],r=e[3],o=vu(Qu([i,n,s]));return[o[0],o[1],o[2],r]}},Ou={srgb:function(A){var t=yu(Cu([A[0],A[1],A[2]]));return[t[0],t[1],t[2],A[3]]},"srgb-linear":function(A){var t=Cu([A[0],A[1],A[2]]),e=t[0],i=t[1],n=t[2];return[su(Math.round(255*e),0,255),su(Math.round(255*i),0,255),su(Math.round(255*n),0,255),A[3]]},"display-p3":function(A){var t,e,i=(e=[A[0],A[1],A[2]],t=ru([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],e),yu(t));return[i[0],i[1],i[2],A[3]]},"a98-rgb":function(A){var t,e,i=(e=[A[0],A[1],A[2]],[(t=ru([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],e).map((function(A){var t=A<0?-1:1,e=Math.abs(A);return t*Math.pow(e,256/563)})))[0],t[1],t[2]]);return[i[0],i[1],i[2],A[3]]},"prophoto-rgb":function(A){var t,e=(t=Bu([A[0],A[1],A[2]]),ru([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],t).map((function(A){return A>1/512?Math.pow(A,1/1.8):16*A})));return[e[0],e[1],e[2],A[3]]},xyz:pu,"xyz-d50":function(A){var t=Bu([A[0],A[2],A[3]]);return[t[0],t[1],t[2],A[3]]},"xyz-d65":pu,rec2020:function(A){var t,e=(t=[A[0],A[1],A[2]],ru([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],t).map((function(A){return A>=Hu?Eu*Math.pow(A,.45)-(Eu-1):4.5*A})));return[e[0],e[1],e[2],A[3]]}},Du={hsl:hu,hsla:hu,rgb:Tu,rgba:Tu,lch:function(A,t){if(nu(t.filter(Lh)))throw new Error("Relative color not supported for lch()");var e=uu(t),i=e[0],n=e[1],s=e[2],r=e[3],o=yu(Cu(mu(Qu([i,n,s]))));return eu(su(Math.round(255*o[0]),0,255),su(Math.round(255*o[1]),0,255),su(Math.round(255*o[2]),0,255),r)},oklch:function(A,t){if(nu(t.filter(Lh)))throw new Error("Relative color not supported for oklch()");var e=du(t),i=e[0],n=e[1],s=e[2],r=e[3],o=yu(Cu(vu(Qu([i,n,s]))));return eu(su(Math.round(255*o[0]),0,255),su(Math.round(255*o[1]),0,255),su(Math.round(255*o[2]),0,255),r)},oklab:function(A,t){if(nu(t.filter(Lh)))throw new Error("Relative color not supported for oklab()");var e=lu(t),i=e[0],n=e[1],s=e[2],r=e[3],o=yu(Cu(vu([i,n,s])));return eu(su(Math.round(255*o[0]),0,255),su(Math.round(255*o[1]),0,255),su(Math.round(255*o[2]),0,255),r)},lab:function(A,t){if(nu(t.filter(Lh)))throw new Error("Relative color not supported for lab()");var e=lu(t),i=e[0],n=e[1],s=e[2],r=e[3],o=yu(Cu(mu([i,n,s])));return eu(su(Math.round(255*o[0]),0,255),su(Math.round(255*o[1]),0,255),su(Math.round(255*o[2]),0,255),r)},color:function(A,t){var e=t.filter(Lh),i=20===e[0].type?e[0].value:"unknown";if(!nu(e)){var n=Su[i];if(void 0===n)throw new Error('Attempting to parse an unsupported color space "'.concat(i,'" for color() function'));return n([f=Sh(e[1])?e[1].number:0,g=Sh(e[2])?e[2].number:0,Q=Sh(e[3])?e[3].number:0,v=e.length>4&&6===e[4].type&&"/"===e[4].value&&Sh(e[5])?e[5].number:1])}var s=function(A,t){if(Sh(t))return t.number;var e;if(Kh(t))return A["r"===(e=t.value)||"x"===e?0:"g"===e||"y"===e?1:2];var i=function(A){for(var t="(",e=0,n=A.filter(Lh);e<n.length;e++){var s=n[e];t+=18===s.type&&"calc"===s.name?i(s.values):Sh(s)?s.number:6===s.type||Kh(s)?s.value:""}return t+")"};if(18===t.type){var n=t.values.filter(Lh);if("calc"===t.name){var s=i(n).replace(/r|x/,A[0].toString()).replace(/g|y/,A[1].toString()).replace(/b|z/,A[2].toString());return new Function("return "+s)()}}return null},r=18===e[1].type?e[1].name:Kh(e[1])||5===e[1].type?"rgb":"unknown",o=Kh(e[2])?e[2].value:"unknown",a=18===e[1].type?e[1].values:Kh(e[1])?[e[1]]:[];if(Kh(e[1])){if(void 0===Lu[e[1].value.toUpperCase()])throw new Error("Attempting to use unknown color in relative color 'from'");var c=Mu(A,e[1].value);a=[{type:17,number:255&c>>24,flags:1},{type:17,number:255&c>>16,flags:1},{type:17,number:255&c>>8,flags:1},{type:17,number:(h=255&c)>1?h/255:h,flags:1}]}else if(5===e[1].type){var h,u=ku(e[1]);a=[{type:17,number:u[0],flags:1},{type:17,number:u[1],flags:1},{type:17,number:u[2],flags:1},{type:17,number:(h=u[3])>1?h/255:h,flags:1}]}if(0===a.length)throw new Error("Attempting to use unknown color in relative color 'from'");if("unknown"===o)throw new Error("Attempting to use unknown colorspace in relative color 'to'");var l=Ku[r],d=Ou[o],B=Su[o];if(void 0===l)throw new Error('Attempting to parse an unsupported color space "'.concat(r,'" for color() function'));if(void 0===d)throw new Error('Attempting to parse an unsupported color space "'.concat(o,'" for color() function'));var w=d(l(A,a)),f=s(w,e[3]),g=s(w,e[4]),Q=s(w,e[5]),v=e.length>6&&6===e[6].type&&"/"===e[6].value&&Sh(e[7])?e[7].number:1;if(null===f||null===g||null===Q)throw new Error("Invalid relative color in color() function");return B([f,g,Q,v])}},Mu=function(A,t){return Iu(A,kh.create(t).parseComponentValue())},Lu={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Ru={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,t){return t.map((function(A){if(Kh(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Nu={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Gu=function(A,t){var e=Iu(A,t[0]),i=t[1];return i&&xh(i)?{color:e,stop:i}:{color:e,stop:null}},xu=function(A,t){var e=A[0],i=A[A.length-1];null===e.stop&&(e.stop=jh),null===i.stop&&(i.stop=_h);for(var n=[],s=0,r=0;r<A.length;r++){var o=A[r].stop;if(null!==o){var a=Xh(o,t);a>s?n.push(a):n.push(s),s=a}else n.push(null)}var c=null;for(r=0;r<n.length;r++){var h=n[r];if(null===h)null===c&&(c=r);else if(null!==c){for(var u=r-c,l=(h-n[c-1])/(u+1),d=1;d<=u;d++)n[c+d-1]=l*d;c=null}}return A.map((function(A,e){return{color:A.color,stop:Math.max(Math.min(1,n[e]/t),0)}}))},Vu=function(A,t){return Math.sqrt(A*A+t*t)},ju=function(A,t,e,i,n){return[[0,0],[0,t],[A,0],[A,t]].reduce((function(A,t){var s=t[0],r=t[1],o=Vu(e-s,i-r);return(n?o<A.optimumDistance:o>A.optimumDistance)?{optimumCorner:t,optimumDistance:o}:A}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},Pu=function(A,t){var e=$h(180),i=[];return Rh(t).forEach((function(t,n){if(0===n){var s=t[0];if(20===s.type&&-1!==["top","left","right","bottom"].indexOf(s.value))return void(e=zh(t));if(qh(s))return void(e=(Wh(0,s)+$h(270))%$h(360))}var r=Gu(A,t);i.push(r)})),{angle:e,stops:i,type:1}},_u="closest-side",Ju="farthest-side",Xu="closest-corner",Yu="farthest-corner",Zu="circle",Wu="ellipse",qu="cover",zu="contain",$u=function(A,t){var e=0,i=3,n=[],s=[];return Rh(t).forEach((function(t,r){var o=!0;if(0===r?o=t.reduce((function(A,t){if(Kh(t))switch(t.value){case"center":return s.push(Ph),!1;case"top":case"left":return s.push(jh),!1;case"right":case"bottom":return s.push(_h),!1}else if(xh(t)||Gh(t))return s.push(t),!1;return A}),o):1===r&&(o=t.reduce((function(A,t){if(Kh(t))switch(t.value){case Zu:return e=0,!1;case Wu:return e=1,!1;case zu:case _u:return i=0,!1;case Ju:return i=1,!1;case Xu:return i=2,!1;case qu:case Yu:return i=3,!1}else if(Gh(t)||xh(t))return Array.isArray(i)||(i=[]),i.push(t),!1;return A}),o)),o){var a=Gu(A,t);n.push(a)}})),{size:i,shape:e,stops:n,position:s,type:2}},Al=function(A,t){if(22===t.type){var e={url:t.value,type:0};return A.cache.addImage(t.value),e}if(18===t.type){var i=tl[t.name];if(void 0===i)throw new Error('Attempting to parse an unsupported image function "'.concat(t.name,'"'));return i(A,t.values)}throw new Error("Unsupported image type ".concat(t.type))},tl={"linear-gradient":function(A,t){var e=$h(180),i=[];return Rh(t).forEach((function(t,n){if(0===n){var s=t[0];if(20===s.type&&"to"===s.value)return void(e=zh(t));if(qh(s))return void(e=Wh(0,s))}var r=Gu(A,t);i.push(r)})),{angle:e,stops:i,type:1}},"-moz-linear-gradient":Pu,"-ms-linear-gradient":Pu,"-o-linear-gradient":Pu,"-webkit-linear-gradient":Pu,"radial-gradient":function(A,t){var e=0,i=3,n=[],s=[];return Rh(t).forEach((function(t,r){var o=!0;if(0===r){var a=!1;o=t.reduce((function(A,t){if(a)if(Kh(t))switch(t.value){case"center":return s.push(Ph),A;case"top":case"left":return s.push(jh),A;case"right":case"bottom":return s.push(_h),A}else(xh(t)||Gh(t))&&s.push(t);else if(Kh(t))switch(t.value){case Zu:return e=0,!1;case Wu:return e=1,!1;case"at":return a=!0,!1;case _u:return i=0,!1;case qu:case Ju:return i=1,!1;case zu:case Xu:return i=2,!1;case Yu:return i=3,!1}else if(Gh(t)||xh(t))return Array.isArray(i)||(i=[]),i.push(t),!1;return A}),o)}if(o){var c=Gu(A,t);n.push(c)}})),{size:i,shape:e,stops:n,position:s,type:2}},"-moz-radial-gradient":$u,"-ms-radial-gradient":$u,"-o-radial-gradient":$u,"-webkit-radial-gradient":$u,"-webkit-gradient":function(A,t){var e=$h(180),i=[],n=1;return Rh(t).forEach((function(t,e){var s=t[0];if(0===e){if(Kh(s)&&"linear"===s.value)return void(n=1);if(Kh(s)&&"radial"===s.value)return void(n=2)}if(18===s.type)if("from"===s.name){var r=Iu(A,s.values[0]);i.push({stop:jh,color:r})}else if("to"===s.name)r=Iu(A,s.values[0]),i.push({stop:_h,color:r});else if("color-stop"===s.name){var o=s.values.filter(Lh);if(2===o.length){r=Iu(A,o[1]);var a=o[0];Sh(a)&&i.push({stop:{type:16,number:100*a.number,flags:a.flags},color:r})}}})),1===n?{angle:(e+$h(180))%$h(360),stops:i,type:n}:{size:3,shape:0,stops:i,position:[],type:n}}},el={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,t){if(0===t.length)return[];var e=t[0];return 20===e.type&&"none"===e.value?[]:t.filter((function(A){return Lh(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!tl[A.name])}(A)})).map((function(t){return Al(A,t)}))}},il={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,t){return t.map((function(A){if(Kh(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},nl={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,t){return Rh(t).map((function(A){return A.filter(xh)})).map(Vh)}},sl={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,t){return Rh(t).map((function(A){return A.filter(Kh).map((function(A){return A.value})).join(" ")})).map(rl)}},rl=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};(cc=ac||(ac={})).AUTO="auto",cc.CONTAIN="contain",cc.COVER="cover";var ol,al,cl={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,t){return Rh(t).map((function(A){return A.filter(hl)}))}},hl=function(A){return Kh(A)||xh(A)},ul=function(A){return{name:"border-".concat(A,"-color"),initialValue:"transparent",prefix:!1,type:3,format:"color"}},ll=ul("top"),dl=ul("right"),Bl=ul("bottom"),wl=ul("left"),fl=function(A){return{name:"border-radius-".concat(A),initialValue:"0 0",prefix:!1,type:1,parse:function(A,t){return Vh(t.filter(xh))}}},gl=fl("top-left"),Ql=fl("top-right"),vl=fl("bottom-right"),ml=fl("bottom-left"),pl=function(A){return{name:"border-".concat(A,"-style"),initialValue:"solid",prefix:!1,type:2,parse:function(A,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},Ul=pl("top"),Cl=pl("right"),Fl=pl("bottom"),yl=pl("left"),bl=function(A){return{name:"border-".concat(A,"-width"),initialValue:"0",type:0,prefix:!1,parse:function(A,t){return Th(t)?t.number:0}}},El=bl("top"),Hl=bl("right"),Il=bl("bottom"),kl=bl("left"),Tl={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Sl={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,t){return"rtl"===t?1:0}},Kl={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,t){return t.filter(Kh).reduce((function(A,t){return A|Ol(t.value)}),0)}},Ol=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Dl={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Ml={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};(al=ol||(ol={})).NORMAL="normal",al.STRICT="strict";var Ll,Rl,Nl={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,t){return"strict"===t?ol.STRICT:ol.NORMAL}},Gl={name:"line-height",initialValue:"normal",prefix:!1,type:4},xl=function(A,t){return Kh(A)&&"normal"===A.value?1.2*t:17===A.type?t*A.number:xh(A)?Xh(A,t):t},Vl={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,t){return 20===t.type&&"none"===t.value?null:Al(A,t)}},jl={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,t){return"inside"===t?0:1}},Pl={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},_l=function(A){return{name:"margin-".concat(A),initialValue:"0",prefix:!1,type:4}},Jl=_l("top"),Xl=_l("right"),Yl=_l("bottom"),Zl=_l("left"),Wl={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,t){return t.filter(Kh).map((function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},ql={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,t){return"break-word"===t?"break-word":"normal"}},zl=function(A){return{name:"padding-".concat(A),initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},$l=zl("top"),Ad=zl("right"),td=zl("bottom"),ed=zl("left"),id={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},nd={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},sd={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,t){return 1===t.length&&Dh(t[0],"none")?[]:Rh(t).map((function(t){for(var e={color:Lu.TRANSPARENT,offsetX:jh,offsetY:jh,blur:jh},i=0,n=0;n<t.length;n++){var s=t[n];Gh(s)?(0===i?e.offsetX=s:1===i?e.offsetY=s:e.blur=s,i++):e.color=Iu(A,s)}return e}))}},rd={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},od={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var e=ad[t.name];if(void 0===e)throw new Error('Attempting to parse an unsupported transform function "'.concat(t.name,'"'));return e(t.values)}return null}},ad={matrix:function(A){var t=A.filter((function(A){return 17===A.type})).map((function(A){return A.number}));return 6===t.length?t:null},matrix3d:function(A){var t=A.filter((function(A){return 17===A.type})).map((function(A){return A.number})),e=t[0],i=t[1];t[2],t[3];var n=t[4],s=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var r=t[12],o=t[13];return t[14],t[15],16===t.length?[e,i,n,s,r,o]:null}},cd={type:16,number:50,flags:4},hd=[cd,cd],ud={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,t){var e=t.filter(xh);return 2!==e.length?hd:[e[0],e[1]]}},ld={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};(Rl=Ll||(Ll={})).NORMAL="normal",Rl.BREAK_ALL="break-all",Rl.KEEP_ALL="keep-all";for(var dd={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,t){switch(t){case"break-all":return Ll.BREAK_ALL;case"keep-all":return Ll.KEEP_ALL;default:return Ll.NORMAL}}},Bd={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,t){if(20===t.type)return{auto:!0,order:0};if(Sh(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},wd=function(A,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")},fd={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,t){return Sh(t)?t.number:1}},gd={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Qd={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,t){return t.filter(Kh).map((function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(A){return 0!==A}))}},vd={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,t){var e=[],i=[];return t.forEach((function(A){switch(A.type){case 20:case 0:e.push(A.value);break;case 17:e.push(A.number.toString());break;case 4:i.push(e.join(" ")),e.length=0}})),e.length&&i.push(e.join(" ")),i.map((function(A){return-1===A.indexOf(" ")?A:"'".concat(A,"'")}))}},md={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},pd={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,t){return Sh(t)?t.number:Kh(t)&&"bold"===t.value?700:400}},Ud={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,t){return t.filter(Kh).map((function(A){return A.value}))}},Cd={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},Fd=function(A,t){return 0!==(A&t)},yd={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,t){if(0===t.length)return[];var e=t[0];return 20===e.type&&"none"===e.value?[]:t}},bd={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,t){if(0===t.length)return null;var e=t[0];if(20===e.type&&"none"===e.value)return null;for(var i=[],n=t.filter(Mh),s=0;s<n.length;s++){var r=n[s],o=n[s+1];if(20===r.type){var a=o&&Sh(o)?o.number:1;i.push({counter:r.value,increment:a})}}return i}},Ed={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,t){if(0===t.length)return[];for(var e=[],i=t.filter(Mh),n=0;n<i.length;n++){var s=i[n],r=i[n+1];if(Kh(s)&&"none"!==s.value){var o=r&&Sh(r)?r.number:0;e.push({counter:s.value,reset:o})}}return e}},Hd={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,t){return t.filter(Th).map((function(A){return wd(0,A)}))}},Id={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,t){if(0===t.length)return null;var e=t[0];if(20===e.type&&"none"===e.value)return null;var i=[],n=t.filter(Oh);if(n.length%2!=0)return null;for(var s=0;s<n.length;s+=2){var r=n[s].value,o=n[s+1].value;i.push({open:r,close:o})}return i}},kd=function(A,t,e){if(!A)return"";var i=A[Math.min(t,A.length-1)];return i?e?i.open:i.close:""},Td={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,t){return 1===t.length&&Dh(t[0],"none")?[]:Rh(t).map((function(t){for(var e={color:255,offsetX:jh,offsetY:jh,blur:jh,spread:jh,inset:!1},i=0,n=0;n<t.length;n++){var s=t[n];Dh(s,"inset")?e.inset=!0:Gh(s)?(0===i?e.offsetX=s:1===i?e.offsetY=s:2===i?e.blur=s:e.spread=s,i++):e.color=Iu(A,s)}return e}))}},Sd={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,t){var e=[];return t.filter(Kh).forEach((function(A){switch(A.value){case"stroke":e.push(1);break;case"fill":e.push(0);break;case"markers":e.push(2)}})),[0,1,2].forEach((function(A){-1===e.indexOf(A)&&e.push(A)})),e}},Kd={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Od={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,t){return Th(t)?t.number:0}},Dd={name:"objectFit",initialValue:"fill",prefix:!1,type:1,parse:function(A,t){return t.filter(Kh).reduce((function(A,t){return A|Md(t.value)}),0)}},Md=function(A){switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},Ld=function(){function A(A,t){var e,i;this.animationDuration=Gd(A,Hd,t.animationDuration),this.backgroundClip=Gd(A,Ru,t.backgroundClip),this.backgroundColor=Gd(A,Nu,t.backgroundColor),this.backgroundImage=Gd(A,el,t.backgroundImage),this.backgroundOrigin=Gd(A,il,t.backgroundOrigin),this.backgroundPosition=Gd(A,nl,t.backgroundPosition),this.backgroundRepeat=Gd(A,sl,t.backgroundRepeat),this.backgroundSize=Gd(A,cl,t.backgroundSize),this.borderTopColor=Gd(A,ll,t.borderTopColor),this.borderRightColor=Gd(A,dl,t.borderRightColor),this.borderBottomColor=Gd(A,Bl,t.borderBottomColor),this.borderLeftColor=Gd(A,wl,t.borderLeftColor),this.borderTopLeftRadius=Gd(A,gl,t.borderTopLeftRadius),this.borderTopRightRadius=Gd(A,Ql,t.borderTopRightRadius),this.borderBottomRightRadius=Gd(A,vl,t.borderBottomRightRadius),this.borderBottomLeftRadius=Gd(A,ml,t.borderBottomLeftRadius),this.borderTopStyle=Gd(A,Ul,t.borderTopStyle),this.borderRightStyle=Gd(A,Cl,t.borderRightStyle),this.borderBottomStyle=Gd(A,Fl,t.borderBottomStyle),this.borderLeftStyle=Gd(A,yl,t.borderLeftStyle),this.borderTopWidth=Gd(A,El,t.borderTopWidth),this.borderRightWidth=Gd(A,Hl,t.borderRightWidth),this.borderBottomWidth=Gd(A,Il,t.borderBottomWidth),this.borderLeftWidth=Gd(A,kl,t.borderLeftWidth),this.boxShadow=Gd(A,Td,t.boxShadow),this.color=Gd(A,Tl,t.color),this.direction=Gd(A,Sl,t.direction),this.display=Gd(A,Kl,t.display),this.float=Gd(A,Dl,t.cssFloat),this.fontFamily=Gd(A,vd,t.fontFamily),this.fontSize=Gd(A,md,t.fontSize),this.fontStyle=Gd(A,Cd,t.fontStyle),this.fontVariant=Gd(A,Ud,t.fontVariant),this.fontWeight=Gd(A,pd,t.fontWeight),this.letterSpacing=Gd(A,Ml,t.letterSpacing),this.lineBreak=Gd(A,Nl,t.lineBreak),this.lineHeight=Gd(A,Gl,t.lineHeight),this.listStyleImage=Gd(A,Vl,t.listStyleImage),this.listStylePosition=Gd(A,jl,t.listStylePosition),this.listStyleType=Gd(A,Pl,t.listStyleType),this.marginTop=Gd(A,Jl,t.marginTop),this.marginRight=Gd(A,Xl,t.marginRight),this.marginBottom=Gd(A,Yl,t.marginBottom),this.marginLeft=Gd(A,Zl,t.marginLeft),this.opacity=Gd(A,fd,t.opacity);var n=Gd(A,Wl,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0],this.overflowWrap=Gd(A,ql,t.overflowWrap),this.paddingTop=Gd(A,$l,t.paddingTop),this.paddingRight=Gd(A,Ad,t.paddingRight),this.paddingBottom=Gd(A,td,t.paddingBottom),this.paddingLeft=Gd(A,ed,t.paddingLeft),this.paintOrder=Gd(A,Sd,t.paintOrder),this.position=Gd(A,nd,t.position),this.textAlign=Gd(A,id,t.textAlign),this.textDecorationColor=Gd(A,gd,null!==(e=t.textDecorationColor)&&void 0!==e?e:t.color),this.textDecorationLine=Gd(A,Qd,null!==(i=t.textDecorationLine)&&void 0!==i?i:t.textDecoration),this.textShadow=Gd(A,sd,t.textShadow),this.textTransform=Gd(A,rd,t.textTransform),this.transform=Gd(A,od,t.transform),this.transformOrigin=Gd(A,ud,t.transformOrigin),this.visibility=Gd(A,ld,t.visibility),this.webkitTextStrokeColor=Gd(A,Kd,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Gd(A,Od,t.webkitTextStrokeWidth),this.wordBreak=Gd(A,dd,t.wordBreak),this.zIndex=Gd(A,Bd,t.zIndex),this.objectFit=Gd(A,Dd,t.objectFit)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return Au(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return Fd(this.display,4)||Fd(this.display,33554432)||Fd(this.display,268435456)||Fd(this.display,536870912)||Fd(this.display,67108864)||Fd(this.display,134217728)},A}(),Rd=function(A,t){this.content=Gd(A,yd,t.content),this.quotes=Gd(A,Id,t.quotes)},Nd=function(A,t){this.counterIncrement=Gd(A,bd,t.counterIncrement),this.counterReset=Gd(A,Ed,t.counterReset)},Gd=function(A,t,e){var i=new Ih,n=null!=e?e.toString():t.initialValue;i.write(n);var s=new kh(i.read());switch(t.type){case 2:var r=s.parseComponentValue();return t.parse(A,Kh(r)?r.value:t.initialValue);case 0:return t.parse(A,s.parseComponentValue());case 1:return t.parse(A,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(t.format){case"angle":return Wh(0,s.parseComponentValue());case"color":return Iu(A,s.parseComponentValue());case"image":return Al(A,s.parseComponentValue());case"length":var o=s.parseComponentValue();return Gh(o)?o:jh;case"length-percentage":var a=s.parseComponentValue();return xh(a)?a:jh;case"time":return wd(0,s.parseComponentValue())}}},xd=function(A,t){var e=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===e||t===e},Vd=function(A,t){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,xd(t,3),this.styles=new Ld(A,window.getComputedStyle(t,null)),xB(t)&&(this.styles.animationDuration.some((function(A){return A>0}))&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=ja(this.context,t),xd(t,4)&&(this.flags|=16)},jd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pd=0;Pd<64;Pd++)jd["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Pd)]=Pd;for(var _d=function(A,t,e){return A.slice?A.slice(t,e):new Uint16Array(Array.prototype.slice.call(A,t,e))},Jd=function(){function A(A,t,e,i,n,s){this.initialValue=A,this.errorValue=t,this.highStart=e,this.highValueIndex=i,this.index=n,this.data=s}return A.prototype.get=function(A){var t;if(A>=0){if(A<55296||A>56319&&A<=65535)return t=((t=this.index[A>>5])<<2)+(31&A),this.data[t];if(A<=65535)return t=((t=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[t];if(A<this.highStart)return t=2080+(A>>11),t=this.index[t],t+=A>>5&63,t=((t=this.index[t])<<2)+(31&A),this.data[t];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Xd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Yd=0;Yd<64;Yd++)Xd["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Yd)]=Yd;var Zd,Wd,qd=8,zd=9,$d=11,AB=12,tB=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var e=A.length;if(!e)return"";for(var i=[],n=-1,s="";++n<e;){var r=A[n];r<=65535?i.push(r):(r-=65536,i.push(55296+(r>>10),r%1024+56320)),(n+1===e||i.length>16384)&&(s+=String.fromCharCode.apply(String,i),i.length=0)}return s},eB=function(){var A=function(A){var t,e,i,n,s,r=19617,o=0;"="===A[26155]&&(r--,"="===A[26154]&&r--);var a="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),c=Array.isArray(a)?a:new Uint8Array(a);for(t=0;t<26156;t+=4)e=jd[A.charCodeAt(t)],i=jd[A.charCodeAt(t+1)],n=jd[A.charCodeAt(t+2)],s=jd[A.charCodeAt(t+3)],c[o++]=e<<2|i>>4,c[o++]=(15&i)<<4|n>>2,c[o++]=(3&n)<<6|63&s;return a}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),t=Array.isArray(A)?function(A){for(var t=A.length,e=[],i=0;i<t;i+=4)e.push(A[i+3]<<24|A[i+2]<<16|A[i+1]<<8|A[i]);return e}(A):new Uint32Array(A),e=Array.isArray(A)?function(A){for(var t=A.length,e=[],i=0;i<t;i+=2)e.push(A[i+1]<<8|A[i]);return e}(A):new Uint16Array(A),i=_d(e,12,t[4]/2),n=2===t[5]?_d(e,(24+t[4])/2):function(A,t,e){return A.slice?A.slice(t,e):new Uint32Array(Array.prototype.slice.call(A,t,e))}(t,Math.ceil((24+t[4])/4));return new Jd(t[0],t[1],t[2],t[3],i,n)}(),iB="×",nB=function(A){return eB.get(A)},sB=function(A,t,e){var i=e-2,n=t[i],s=t[e-1],r=t[e];if(2===s&&3===r)return iB;if(2===s||3===s||4===s)return"÷";if(2===r||3===r||4===r)return"÷";if(s===qd&&-1!==[qd,zd,$d,AB].indexOf(r))return iB;if(!(s!==$d&&s!==zd||r!==zd&&10!==r))return iB;if((s===AB||10===s)&&10===r)return iB;if(13===r||5===r)return iB;if(7===r)return iB;if(1===s)return iB;if(13===s&&14===r){for(;5===n;)n=t[--i];if(14===n)return iB}if(15===s&&15===r){for(var o=0;15===n;)o++,n=t[--i];if(o%2==0)return iB}return"÷"},rB=function(A){var t=function(A){for(var t=[],e=0,i=A.length;e<i;){var n=A.charCodeAt(e++);if(n>=55296&&n<=56319&&e<i){var s=A.charCodeAt(e++);56320==(64512&s)?t.push(((1023&n)<<10)+(1023&s)+65536):(t.push(n),e--)}else t.push(n)}return t}(A),e=t.length,i=0,n=0,s=t.map(nB);return{next:function(){if(i>=e)return{done:!0,value:null};for(var A=iB;i<e&&(A=sB(0,s,++i))===iB;);if(A!==iB||i===e){var r=tB.apply(null,t.slice(n,i));return n=i,{value:r,done:!1}}return{done:!0,value:null}}}},oB=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},aB=function(A,t,e,i,n){var s="http://www.w3.org/2000/svg",r=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return r.setAttributeNS(null,"width",A.toString()),r.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",e.toString()),o.setAttributeNS(null,"y",i.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),r.appendChild(o),o.appendChild(n),r},cB=function(A){return new Promise((function(t,e){var i=new Image;i.onload=function(){return t(i)},i.onerror=e,i.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))}))},hB={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var t=A.createRange();if(t.getBoundingClientRect){var e=A.createElement("boundtest");e.style.height="".concat(123,"px"),e.style.display="block",A.body.appendChild(e),t.selectNode(e);var i=t.getBoundingClientRect(),n=Math.round(i.height);if(A.body.removeChild(e),123===n)return!0}}return!1}(document);return Object.defineProperty(hB,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=hB.SUPPORT_RANGE_BOUNDS&&function(A){var t=A.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",A.body.appendChild(t);var e=A.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var i=t.firstChild,n=Pa(i.data).map((function(A){return _a(A)})),s=0,r={},o=n.every((function(A,t){e.setStart(i,s),e.setEnd(i,s+A.length);var n=e.getBoundingClientRect();s+=A.length;var o=n.x>r.x||n.y>r.y;return r=n,0===t||o}));return A.body.removeChild(t),o}(document);return Object.defineProperty(hB,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var t=new Image,e=A.createElement("canvas"),i=e.getContext("2d");if(!i)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{i.drawImage(t,0,0),e.toDataURL()}catch(n){return!1}return!0}(document);return Object.defineProperty(hB,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var t=A.createElement("canvas"),e=100;t.width=e,t.height=e;var i=t.getContext("2d");if(!i)return Promise.reject(!1);i.fillStyle="rgb(0, 255, 0)",i.fillRect(0,0,e,e);var n=new Image,s=t.toDataURL();n.src=s;var r=aB(e,e,0,0,n);return i.fillStyle="red",i.fillRect(0,0,e,e),cB(r).then((function(t){i.drawImage(t,0,0);var n=i.getImageData(0,0,e,e).data;i.fillStyle="red",i.fillRect(0,0,e,e);var r=A.createElement("div");return r.style.backgroundImage="url(".concat(s,")"),r.style.height="".concat(e,"px"),oB(n)?cB(aB(e,e,0,0,r)):Promise.reject(!1)})).then((function(A){return i.drawImage(A,0,0),oB(i.getImageData(0,0,e,e).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(hB,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(hB,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(hB,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(hB,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(hB,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},uB=function(A,t){this.text=A,this.bounds=t},lB=function(A,t,e){var i=A.ownerDocument;if(!i)throw new Error("Node has no owner document");var n=i.createRange();return n.setStart(A,t),n.setEnd(A,t+e),n},dB=function(A){if(hB.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(A)).map((function(A){return A.segment}))}return function(A){for(var t,e=rB(A),i=[];!(t=e.next()).done;)t.value&&i.push(t.value.slice());return i}(A)},BB=[32,160,4961,65792,65793,4153,4241],wB=function(A,t,e){this.text=fB(t.data,e.textTransform),this.textBounds=function(A,t,e,i){var n=function(A,t){return 0!==t.letterSpacing?dB(A):function(A,t){if(hB.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(e.segment(A)).map((function(A){return A.segment}))}return function(A,t){for(var e,i=function(A,t){var e=Pa(A),i=function(A,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var e=function(A,t){void 0===t&&(t="strict");var e=[],i=[],n=[];return A.forEach((function(A,s){var r=Lc.get(A);if(r>50?(n.push(!0),r-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(A))return i.push(s),e.push(16);if(4===r||11===r){if(0===s)return i.push(s),e.push(Fc);var o=e[s-1];return-1===Vc.indexOf(o)?(i.push(i[s-1]),e.push(o)):(i.push(s),e.push(Fc))}return i.push(s),31===r?e.push("strict"===t?gc:Ic):r===Kc||29===r?e.push(Fc):43===r?A>=131072&&A<=196605||A>=196608&&A<=262141?e.push(Ic):e.push(Fc):void e.push(r)})),[i,e,n]}(A,t.lineBreak),i=e[0],n=e[1],s=e[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(n=n.map((function(A){return-1!==[mc,Fc,Kc].indexOf(A)?Ic:A}))),[i,n,"keep-all"===t.wordBreak?s.map((function(t,e){return t&&A[e]>=19968&&A[e]<=40959})):void 0]}(e,t),n=i[0],s=i[1],r=i[2],o=e.length,a=0,c=0;return{next:function(){if(c>=o)return{done:!0,value:null};for(var A=Dc;c<o&&(A=Xc(e,s,n,++c,r))===Dc;);if(A!==Dc||c===o){var t=new Yc(e,A,a,c);return a=c,{value:t,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),n=[],s=function(){if(e.value){var A=e.value.slice(),t=Pa(A),i="";t.forEach((function(A){-1===BB.indexOf(A)?i+=_a(A):(i.length&&n.push(i),n.push(_a(A)),i="")})),i.length&&n.push(i)}};!(e=i.next()).done;)s();return n}(A,t)}(A,t)}(t,e),s=[],r=0;return n.forEach((function(t){if(e.textDecorationLine.length||t.trim().length>0)if(hB.SUPPORT_RANGE_BOUNDS){var n=lB(i,r,t.length).getClientRects();if(n.length>1){var o=dB(t),a=0;o.forEach((function(t){s.push(new uB(t,Va.fromDOMRectList(A,lB(i,a+r,t.length).getClientRects()))),a+=t.length}))}else s.push(new uB(t,Va.fromDOMRectList(A,n)))}else{var c=i.splitText(t.length);s.push(new uB(t,function(A,t){var e=t.ownerDocument;if(e){var i=e.createElement("html2canvaswrapper");i.appendChild(t.cloneNode(!0));var n=t.parentNode;if(n){n.replaceChild(i,t);var s=ja(A,i);return i.firstChild&&n.replaceChild(i.firstChild,i),s}}return Va.EMPTY}(A,i))),i=c}else hB.SUPPORT_RANGE_BOUNDS||(i=i.splitText(t.length));r+=t.length})),s}(A,this.text,e,t)},fB=function(A,t){switch(t){case 1:return A.toLowerCase();case 3:return A.replace(gB,QB);case 2:return A.toUpperCase();default:return A}},gB=/(^|\s|:|-|\(|\))([a-z])/g,QB=function(A,t,e){return A.length>0?t+e.toUpperCase():A},vB=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.src=e.currentSrc||e.src,i.intrinsicWidth=e.naturalWidth,i.intrinsicHeight=e.naturalHeight,i.context.cache.addImage(i.src),i}return La(t,A),t}(Vd),mB=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.canvas=e,i.intrinsicWidth=e.width,i.intrinsicHeight=e.height,i}return La(t,A),t}(Vd),pB=function(A){function t(t,e){var i=A.call(this,t,e)||this,n=new XMLSerializer,s=ja(t,e);return e.setAttribute("width","".concat(s.width,"px")),e.setAttribute("height","".concat(s.height,"px")),i.svg="data:image/svg+xml,".concat(encodeURIComponent(n.serializeToString(e))),i.intrinsicWidth=e.width.baseVal.value,i.intrinsicHeight=e.height.baseVal.value,i.context.cache.addImage(i.svg),i}return La(t,A),t}(Vd),UB=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.value=e.value,i}return La(t,A),t}(Vd),CB=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.start=e.start,i.reversed="boolean"==typeof e.reversed&&!0===e.reversed,i}return La(t,A),t}(Vd),FB=[{type:15,flags:0,unit:"px",number:3}],yB=[{type:16,flags:0,number:50}],bB="checkbox",EB="radio",HB=707406591,IB=function(A){function t(t,e){var i,n,s,r=A.call(this,t,e)||this;switch(r.type=e.type.toLowerCase(),r.checked=e.checked,r.value=0===(n="password"===(i=e).type?new Array(i.value.length+1).join("•"):i.value).length?i.placeholder||"":n,r.type!==bB&&r.type!==EB||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=1,r.styles.backgroundClip=[0],r.styles.backgroundOrigin=[0],r.bounds=(s=r.bounds).width>s.height?new Va(s.left+(s.width-s.height)/2,s.top,s.height,s.height):s.width<s.height?new Va(s.left,s.top+(s.height-s.width)/2,s.width,s.width):s),r.type){case bB:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=FB;break;case EB:r.styles.borderTopRightRadius=r.styles.borderTopLeftRadius=r.styles.borderBottomRightRadius=r.styles.borderBottomLeftRadius=yB}return r}return La(t,A),t}(Vd),kB=function(A){function t(t,e){var i=A.call(this,t,e)||this,n=e.options[e.selectedIndex||0];return i.value=n&&n.text||"",i}return La(t,A),t}(Vd),TB=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.value=e.value,i}return La(t,A),t}(Vd),SB=function(A){function t(t,e){var i=A.call(this,t,e)||this;i.src=e.src,i.width=parseInt(e.width,10)||0,i.height=parseInt(e.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement){i.tree=MB(t,e.contentWindow.document.documentElement);var n=e.contentWindow.document.documentElement?Mu(t,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):Lu.TRANSPARENT,s=e.contentWindow.document.body?Mu(t,getComputedStyle(e.contentWindow.document.body).backgroundColor):Lu.TRANSPARENT;i.backgroundColor=Au(n)?Au(s)?i.styles.backgroundColor:s:n}}catch(r){}return i}return La(t,A),t}(Vd),KB=["OL","UL","MENU"],OB=function(A,t,e,i){for(var n=t.firstChild,s=void 0;n;n=s)if(s=n.nextSibling,NB(n)&&n.data.length>0)e.textNodes.push(new wB(A,n,e.styles));else if(GB(n))if(tw(n)&&n.assignedNodes)n.assignedNodes().forEach((function(t){return OB(A,t,e,i)}));else{var r=DB(A,n);r.styles.isVisible()&&(LB(n,r,i)?r.flags|=4:RB(r.styles)&&(r.flags|=2),-1!==KB.indexOf(n.tagName)&&(r.flags|=8),e.elements.push(r),n.slot,n.shadowRoot?OB(A,n.shadowRoot,r,i):$B(n)||JB(n)||Aw(n)||OB(A,n,r,i))}},DB=function(A,t){return WB(t)?new vB(A,t):YB(t)?new mB(A,t):JB(t)?new pB(A,t):jB(t)?new UB(A,t):PB(t)?new CB(A,t):_B(t)?new IB(A,t):Aw(t)?new kB(A,t):$B(t)?new TB(A,t):qB(t)?new SB(A,t):new Vd(A,t)},MB=function(A,t){var e=DB(A,t);return e.flags|=4,OB(A,t,e,e),e},LB=function(A,t,e){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||XB(A)&&e.styles.isTransparent()},RB=function(A){return A.isPositioned()||A.isFloating()},NB=function(A){return A.nodeType===Node.TEXT_NODE},GB=function(A){return A.nodeType===Node.ELEMENT_NODE},xB=function(A){return GB(A)&&void 0!==A.style&&!VB(A)},VB=function(A){return"object"==typeof A.className},jB=function(A){return"LI"===A.tagName},PB=function(A){return"OL"===A.tagName},_B=function(A){return"INPUT"===A.tagName},JB=function(A){return"svg"===A.tagName},XB=function(A){return"BODY"===A.tagName},YB=function(A){return"CANVAS"===A.tagName},ZB=function(A){return"VIDEO"===A.tagName},WB=function(A){return"IMG"===A.tagName},qB=function(A){return"IFRAME"===A.tagName},zB=function(A){return"STYLE"===A.tagName},$B=function(A){return"TEXTAREA"===A.tagName},Aw=function(A){return"SELECT"===A.tagName},tw=function(A){return"SLOT"===A.tagName},ew=function(A){return A.tagName.indexOf("-")>0},iw=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var t=this.counters[A];return t&&t.length?t[t.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var t=this;A.forEach((function(A){return t.counters[A].pop()}))},A.prototype.parse=function(A){var t=this,e=A.counterIncrement,i=A.counterReset,n=!0;null!==e&&e.forEach((function(A){var e=t.counters[A.counter];e&&0!==A.increment&&(n=!1,e.length||e.push(1),e[Math.max(0,e.length-1)]+=A.increment)}));var s=[];return n&&i.forEach((function(A){var e=t.counters[A.counter];s.push(A.counter),e||(e=t.counters[A.counter]=[]),e.push(A.reset)})),s},A}(),nw={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},sw={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},rw={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},ow={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},aw=function(A,t,e,i,n,s){return A<t||A>e?gw(A,n,s.length>0):i.integers.reduce((function(t,e,n){for(;A>=e;)A-=e,t+=i.values[n];return t}),"")+s},cw=function(A,t,e,i){var n="";do{e||A--,n=i(A)+n,A/=t}while(A*t>=t);return n},hw=function(A,t,e,i,n){var s=e-t+1;return(A<0?"-":"")+(cw(Math.abs(A),s,i,(function(A){return _a(Math.floor(A%s)+t)}))+n)},uw=function(A,t,e){void 0===e&&(e=". ");var i=t.length;return cw(Math.abs(A),i,!1,(function(A){return t[Math.floor(A%i)]}))+e},lw=function(A,t,e,i,n,s){if(A<-9999||A>9999)return gw(A,4,n.length>0);var r=Math.abs(A),o=n;if(0===r)return t[0]+o;for(var a=0;r>0&&a<=4;a++){var c=r%10;0===c&&Fd(s,1)&&""!==o?o=t[c]+o:c>1||1===c&&0===a||1===c&&1===a&&Fd(s,2)||1===c&&1===a&&Fd(s,4)&&A>100||1===c&&a>1&&Fd(s,8)?o=t[c]+(a>0?e[a-1]:"")+o:1===c&&a>0&&(o=e[a-1]+o),r=Math.floor(r/10)}return(A<0?i:"")+o},dw="十百千萬",Bw="拾佰仟萬",ww="マイナス",fw="마이너스",gw=function(A,t,e){var i=e?". ":"",n=e?"、":"",s=e?", ":"",r=e?" ":"";switch(t){case 0:return"•"+r;case 1:return"◦"+r;case 2:return"◾"+r;case 5:var o=hw(A,48,57,!0,i);return o.length<4?"0".concat(o):o;case 4:return uw(A,"〇一二三四五六七八九",n);case 6:return aw(A,1,3999,nw,3,i).toLowerCase();case 7:return aw(A,1,3999,nw,3,i);case 8:return hw(A,945,969,!1,i);case 9:return hw(A,97,122,!1,i);case 10:return hw(A,65,90,!1,i);case 11:return hw(A,1632,1641,!0,i);case 12:case 49:return aw(A,1,9999,sw,3,i);case 35:return aw(A,1,9999,sw,3,i).toLowerCase();case 13:return hw(A,2534,2543,!0,i);case 14:case 30:return hw(A,6112,6121,!0,i);case 15:return uw(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return uw(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return lw(A,"零一二三四五六七八九",dw,"負",n,14);case 47:return lw(A,"零壹貳參肆伍陸柒捌玖",Bw,"負",n,15);case 42:return lw(A,"零一二三四五六七八九",dw,"负",n,14);case 41:return lw(A,"零壹贰叁肆伍陆柒捌玖",Bw,"负",n,15);case 26:return lw(A,"〇一二三四五六七八九","十百千万",ww,n,0);case 25:return lw(A,"零壱弐参四伍六七八九","拾百千万",ww,n,7);case 31:return lw(A,"영일이삼사오육칠팔구","십백천만",fw,s,7);case 33:return lw(A,"零一二三四五六七八九","十百千萬",fw,s,0);case 32:return lw(A,"零壹貳參四五六七八九","拾百千",fw,s,7);case 18:return hw(A,2406,2415,!0,i);case 20:return aw(A,1,19999,ow,3,i);case 21:return hw(A,2790,2799,!0,i);case 22:return hw(A,2662,2671,!0,i);case 52:return aw(A,1,10999,rw,3,i);case 23:return uw(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return uw(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return hw(A,3302,3311,!0,i);case 28:return uw(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return uw(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return hw(A,3792,3801,!0,i);case 37:return hw(A,6160,6169,!0,i);case 38:return hw(A,4160,4169,!0,i);case 39:return hw(A,2918,2927,!0,i);case 40:return hw(A,1776,1785,!0,i);case 43:return hw(A,3046,3055,!0,i);case 44:return hw(A,3174,3183,!0,i);case 45:return hw(A,3664,3673,!0,i);case 46:return hw(A,3872,3881,!0,i);default:return hw(A,48,57,!0,i)}},Qw="data-html2canvas-ignore",vw=function(){function A(A,t,e){if(this.context=A,this.options=e,this.scrolledElements=[],this.referenceElement=t,this.counters=new iw,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,t){var e=this,i=Uw(A,t);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var n=A.defaultView.pageXOffset,s=A.defaultView.pageYOffset,r=i.contentWindow,o=r.document,a=yw(i).then((function(){return Na(e,void 0,void 0,(function(){var A,e;return Ga(this,(function(n){switch(n.label){case 0:return this.scrolledElements.forEach(kw),r&&(r.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||r.scrollY===t.top&&r.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(r.scrollX-t.left,r.scrollY-t.top,0,0))),A=this.options.onclone,void 0===(e=this.clonedReferenceElement)?[2,Promise.reject("Error finding the ".concat(this.referenceElement.nodeName," in the cloned document"))]:o.fonts&&o.fonts.ready?[4,o.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Fw(o)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then((function(){return A(o,e)})).then((function(){return i}))]:[2,i]}}))}))})),c=o.adoptNode(this.documentElement);return Mw(c,o),o.open(),o.write("".concat(Hw(document.doctype),"<html></html>")),Iw(this.referenceElement.ownerDocument,n,s),o.replaceChild(c,o.documentElement),o.close(),a},A.prototype.createElementClone=function(A){if(xd(A,2),YB(A))return this.createCanvasClone(A);if(ZB(A))return this.createVideoClone(A);if(zB(A))return this.createStyleClone(A);var t=A.cloneNode(!1);return WB(t)&&(WB(A)&&A.currentSrc&&A.currentSrc!==A.src&&(t.src=A.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),ew(t)?this.createCustomElementClone(t):t},A.prototype.createCustomElementClone=function(A){var t=document.createElement("html2canvascustomelement");return Ew(A.style,t),t},A.prototype.createStyleClone=function(A){try{var t=A.sheet;if(t&&t.cssRules){var e=[].slice.call(t.cssRules,0).reduce((function(A,t){return t&&"string"==typeof t.cssText?A+t.cssText:A}),""),i=A.cloneNode(!1);return i.textContent=e,i}}catch(n){if(this.context.logger.error("Unable to access cssRules property",n),"SecurityError"!==n.name)throw n}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var t;if(this.options.inlineImages&&A.ownerDocument){var e=A.ownerDocument.createElement("img");try{return e.src=A.toDataURL(),e}catch(a){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var i=A.cloneNode(!1);try{i.width=A.width,i.height=A.height;var n=A.getContext("2d"),s=i.getContext("2d",{willReadFrequently:!0});if(s)if(!this.options.allowTaint&&n)s.putImageData(n.getImageData(0,0,A.width,A.height),0,0);else{var r=null!==(t=A.getContext("webgl2"))&&void 0!==t?t:A.getContext("webgl");if(r){var o=r.getContextAttributes();!1===(null==o?void 0:o.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}s.drawImage(A,0,0)}return i}catch(a){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return i},A.prototype.createVideoClone=function(A){var t=A.ownerDocument.createElement("canvas");t.width=A.offsetWidth,t.height=A.offsetHeight;var e=t.getContext("2d");try{return e&&(e.drawImage(A,0,0,t.width,t.height),this.options.allowTaint||e.getImageData(0,0,t.width,t.height)),t}catch(n){this.context.logger.info("Unable to clone video as it is tainted",A)}var i=A.ownerDocument.createElement("canvas");return i.width=A.offsetWidth,i.height=A.offsetHeight,i},A.prototype.appendChildNode=function(A,t,e){GB(t)&&("SCRIPT"===t.tagName||t.hasAttribute(Qw)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&GB(t)&&zB(t)||A.appendChild(this.cloneNode(t,e))},A.prototype.cloneChildNodes=function(A,t,e){for(var i=this,n=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;n;n=n.nextSibling)if(GB(n)&&tw(n)&&"function"==typeof n.assignedNodes){var s=n.assignedNodes();s.length&&s.forEach((function(A){return i.appendChildNode(t,A,e)}))}else this.appendChildNode(t,n,e)},A.prototype.cloneNode=function(A,t){if(NB(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var e=A.ownerDocument.defaultView;if(e&&GB(A)&&(xB(A)||VB(A))){var i=this.createElementClone(A);i.style.transitionProperty="none";var n=e.getComputedStyle(A),s=e.getComputedStyle(A,":before"),r=e.getComputedStyle(A,":after");this.referenceElement===A&&xB(i)&&(this.clonedReferenceElement=i),XB(i)&&Ow(i);var o=this.counters.parse(new Nd(this.context,n)),a=this.resolvePseudoContent(A,i,s,Zd.BEFORE);ew(A)&&(t=!0),ZB(A)||this.cloneChildNodes(A,i,t),a&&i.insertBefore(a,i.firstChild);var c=this.resolvePseudoContent(A,i,r,Zd.AFTER);return c&&i.appendChild(c),this.counters.pop(o),(n&&(this.options.copyStyles||VB(A))&&!qB(A)||t)&&Ew(n,i),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([i,A.scrollLeft,A.scrollTop]),($B(A)||Aw(A))&&($B(i)||Aw(i))&&(i.value=A.value),i}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,t,e,i){var n=this;if(e){var s=e.content,r=t.ownerDocument;if(r&&s&&"none"!==s&&"-moz-alt-content"!==s&&"none"!==e.display){this.counters.parse(new Nd(this.context,e));var o=new Rd(this.context,e),a=r.createElement("html2canvaspseudoelement");Ew(e,a),o.content.forEach((function(t){if(0===t.type)a.appendChild(r.createTextNode(t.value));else if(22===t.type){var e=r.createElement("img");e.src=t.value,e.style.opacity="1",a.appendChild(e)}else if(18===t.type){if("attr"===t.name){var i=t.values.filter(Kh);i.length&&a.appendChild(r.createTextNode(A.getAttribute(i[0].value)||""))}else if("counter"===t.name){var s=t.values.filter(Lh),c=s[0],h=s[1];if(c&&Kh(c)){var u=n.counters.getCounterValue(c.value),l=h&&Kh(h)?Pl.parse(n.context,h.value):3;a.appendChild(r.createTextNode(gw(u,l,!1)))}}else if("counters"===t.name){var d=t.values.filter(Lh),B=(c=d[0],d[1]);if(h=d[2],c&&Kh(c)){var w=n.counters.getCounterValues(c.value),f=h&&Kh(h)?Pl.parse(n.context,h.value):3,g=B&&0===B.type?B.value:"",Q=w.map((function(A){return gw(A,f,!1)})).join(g);a.appendChild(r.createTextNode(Q))}}}else if(20===t.type)switch(t.value){case"open-quote":a.appendChild(r.createTextNode(kd(o.quotes,n.quoteDepth++,!0)));break;case"close-quote":a.appendChild(r.createTextNode(kd(o.quotes,--n.quoteDepth,!1)));break;default:a.appendChild(r.createTextNode(t.value))}})),a.className="".concat(Tw," ").concat(Sw);var c=i===Zd.BEFORE?" ".concat(Tw):" ".concat(Sw);return VB(t)?t.className.baseValue+=c:t.className+=c,a}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();(Wd=Zd||(Zd={}))[Wd.BEFORE=0]="BEFORE",Wd[Wd.AFTER=1]="AFTER";var mw,pw,Uw=function(A,t){var e=A.createElement("iframe");return e.className="html2canvas-container",e.style.visibility="hidden",e.style.position="fixed",e.style.left="-10000px",e.style.top="0px",e.style.border="0",e.width=t.width.toString(),e.height=t.height.toString(),e.scrolling="no",e.setAttribute(Qw,"true"),A.body.appendChild(e),e},Cw=function(A){return new Promise((function(t){A.complete?t():A.src?(A.onload=t,A.onerror=t):t()}))},Fw=function(A){return Promise.all([].slice.call(A.images,0).map(Cw))},yw=function(A){return new Promise((function(t,e){var i=A.contentWindow;if(!i)return e("No window assigned for iframe");var n=i.document;i.onload=A.onload=function(){i.onload=A.onload=null;var e=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(e),t(A))}),50)}}))},bw=["all","d","content"],Ew=function(A,t){for(var e=A.length-1;e>=0;e--){var i=A.item(e);-1===bw.indexOf(i)&&t.style.setProperty(i,A.getPropertyValue(i))}return t},Hw=function(A){var t="";return A&&(t+="<!DOCTYPE ",A.name&&(t+=A.name),A.internalSubset&&(t+=A.internalSubset),A.publicId&&(t+='"'.concat(A.publicId,'"')),A.systemId&&(t+='"'.concat(A.systemId,'"')),t+=">"),t},Iw=function(A,t,e){A&&A.defaultView&&(t!==A.defaultView.pageXOffset||e!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(t,e)},kw=function(A){var t=A[0],e=A[1],i=A[2];t.scrollLeft=e,t.scrollTop=i},Tw="___html2canvas___pseudoelement_before",Sw="___html2canvas___pseudoelement_after",Kw='{\n content: "" !important;\n display: none !important;\n}',Ow=function(A){Dw(A,".".concat(Tw).concat(":before").concat(Kw,"\n .").concat(Sw).concat(":after").concat(Kw))},Dw=function(A,t){var e=A.ownerDocument;if(e){var i=e.createElement("style");i.textContent=t,A.appendChild(i)}},Mw=function(A,t){var e,i=t.createElement("base");i.href=t.baseURI;var n=A.getElementsByTagName("head").item(0);null==n||n.insertBefore(i,null!==(e=null==n?void 0:n.firstChild)&&void 0!==e?e:null)},Lw=function(){function A(){}return A.getOrigin=function(t){var e=A.SA;return e?(e.href=t,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},A.isSameOrigin=function(t){return A.getOrigin(t)===A.KA},A.setContext=function(t){A.SA=t.document.createElement("a"),A.KA=A.getOrigin(t.location.href)},A.KA="about:blank",A}(),Rw=function(){function A(A,t){this.context=A,this.OA=t,this.DA={}}return A.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)?t:_w(A)||Vw(A)?((this.DA[A]=this.loadImage(A)).catch((function(){})),t):t},A.prototype.match=function(A){return this.DA[A]},A.prototype.loadImage=function(A){return Na(this,void 0,void 0,(function(){var t,e,i,n,s,r=this;return Ga(this,(function(o){switch(o.label){case 0:return"function"!=typeof this.OA.customIsSameOrigin?[3,2]:[4,this.OA.customIsSameOrigin(A,Lw.isSameOrigin)];case 1:return e=o.sent(),[3,3];case 2:e=Lw.isSameOrigin(A),o.label=3;case 3:return t=e,i=!jw(A)&&!0===this.OA.useCORS&&hB.SUPPORT_CORS_IMAGES&&!t,n=!jw(A)&&!t&&!_w(A)&&"string"==typeof this.OA.proxy&&hB.SUPPORT_CORS_XHR&&!i,t||!1!==this.OA.allowTaint||jw(A)||_w(A)||n||i?(s=A,n?[4,this.proxy(s)]:[3,5]):[2];case 4:s=o.sent(),o.label=5;case 5:return this.context.logger.debug("Added image ".concat(A.substring(0,256))),[4,new Promise((function(A,t){var e=new Image;e.onload=function(){return A(e)},e.onerror=t,(Pw(s)||i)&&(e.crossOrigin="anonymous"),e.src=s,!0===e.complete&&setTimeout((function(){return A(e)}),500),r.OA.imageTimeout>0&&setTimeout((function(){return t("Timed out (".concat(r.OA.imageTimeout,"ms) loading image"))}),r.OA.imageTimeout)}))];case 6:return[2,o.sent()]}}))}))},A.prototype.has=function(A){return void 0!==this.DA[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this.DA))},A.prototype.proxy=function(A){var t=this,e=this.OA.proxy;if(!e)throw new Error("No proxy defined");var i=A.substring(0,256);return new Promise((function(n,s){var r=hB.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(200===o.status)if("text"===r)n(o.response);else{var A=new FileReader;A.addEventListener("load",(function(){return n(A.result)}),!1),A.addEventListener("error",(function(A){return s(A)}),!1),A.readAsDataURL(o.response)}else s("Failed to proxy resource ".concat(i," with status code ").concat(o.status))},o.onerror=s;var a=e.indexOf("?")>-1?"&":"?";if(o.open("GET","".concat(e).concat(a,"url=").concat(encodeURIComponent(A),"&responseType=").concat(r)),"text"!==r&&o instanceof XMLHttpRequest&&(o.responseType=r),t.OA.imageTimeout){var c=t.OA.imageTimeout;o.timeout=c,o.ontimeout=function(){return s("Timed out (".concat(c,"ms) proxying ").concat(i))}}o.send()}))},A}(),Nw=/^data:image\/svg\+xml/i,Gw=/^data:image\/.*;base64,/i,xw=/^data:image\/.*/i,Vw=function(A){return hB.SUPPORT_SVG_DRAWING||!Jw(A)},jw=function(A){return xw.test(A)},Pw=function(A){return Gw.test(A)},_w=function(A){return"blob"===A.substr(0,4)},Jw=function(A){return"svg"===A.substr(-3).toLowerCase()||Nw.test(A)},Xw=function(){function A(A,t){this.type=0,this.x=A,this.y=t}return A.prototype.add=function(t,e){return new A(this.x+t,this.y+e)},A}(),Yw=function(A,t,e){return new Xw(A.x+(t.x-A.x)*e,A.y+(t.y-A.y)*e)},Zw=function(){function A(A,t,e,i){this.type=1,this.start=A,this.startControl=t,this.endControl=e,this.end=i}return A.prototype.subdivide=function(t,e){var i=Yw(this.start,this.startControl,t),n=Yw(this.startControl,this.endControl,t),s=Yw(this.endControl,this.end,t),r=Yw(i,n,t),o=Yw(n,s,t),a=Yw(r,o,t);return e?new A(this.start,i,r,a):new A(a,o,s,this.end)},A.prototype.add=function(t,e){return new A(this.start.add(t,e),this.startControl.add(t,e),this.endControl.add(t,e),this.end.add(t,e))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Ww=function(A){return 1===A.type},qw=function(A){var t=A.styles,e=A.bounds,i=Jh(t.borderTopLeftRadius,e.width,e.height),n=i[0],s=i[1],r=Jh(t.borderTopRightRadius,e.width,e.height),o=r[0],a=r[1],c=Jh(t.borderBottomRightRadius,e.width,e.height),h=c[0],u=c[1],l=Jh(t.borderBottomLeftRadius,e.width,e.height),d=l[0],B=l[1],w=[];w.push((n+o)/e.width),w.push((d+h)/e.width),w.push((s+B)/e.height),w.push((a+u)/e.height);var f=Math.max.apply(Math,w);f>1&&(n/=f,s/=f,o/=f,a/=f,h/=f,u/=f,d/=f,B/=f);var g=e.width-o,Q=e.height-u,v=e.width-h,m=e.height-B,p=t.borderTopWidth,U=t.borderRightWidth,C=t.borderBottomWidth,F=t.borderLeftWidth,y=Xh(t.paddingTop,A.bounds.width),b=Xh(t.paddingRight,A.bounds.width),E=Xh(t.paddingBottom,A.bounds.width),H=Xh(t.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||s>0?zw(e.left+F/3,e.top+p/3,n-F/3,s-p/3,mw.TOP_LEFT):new Xw(e.left+F/3,e.top+p/3),this.topRightBorderDoubleOuterBox=n>0||s>0?zw(e.left+g,e.top+p/3,o-U/3,a-p/3,mw.TOP_RIGHT):new Xw(e.left+e.width-U/3,e.top+p/3),this.bottomRightBorderDoubleOuterBox=h>0||u>0?zw(e.left+v,e.top+Q,h-U/3,u-C/3,mw.BOTTOM_RIGHT):new Xw(e.left+e.width-U/3,e.top+e.height-C/3),this.bottomLeftBorderDoubleOuterBox=d>0||B>0?zw(e.left+F/3,e.top+m,d-F/3,B-C/3,mw.BOTTOM_LEFT):new Xw(e.left+F/3,e.top+e.height-C/3),this.topLeftBorderDoubleInnerBox=n>0||s>0?zw(e.left+2*F/3,e.top+2*p/3,n-2*F/3,s-2*p/3,mw.TOP_LEFT):new Xw(e.left+2*F/3,e.top+2*p/3),this.topRightBorderDoubleInnerBox=n>0||s>0?zw(e.left+g,e.top+2*p/3,o-2*U/3,a-2*p/3,mw.TOP_RIGHT):new Xw(e.left+e.width-2*U/3,e.top+2*p/3),this.bottomRightBorderDoubleInnerBox=h>0||u>0?zw(e.left+v,e.top+Q,h-2*U/3,u-2*C/3,mw.BOTTOM_RIGHT):new Xw(e.left+e.width-2*U/3,e.top+e.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=d>0||B>0?zw(e.left+2*F/3,e.top+m,d-2*F/3,B-2*C/3,mw.BOTTOM_LEFT):new Xw(e.left+2*F/3,e.top+e.height-2*C/3),this.topLeftBorderStroke=n>0||s>0?zw(e.left+F/2,e.top+p/2,n-F/2,s-p/2,mw.TOP_LEFT):new Xw(e.left+F/2,e.top+p/2),this.topRightBorderStroke=n>0||s>0?zw(e.left+g,e.top+p/2,o-U/2,a-p/2,mw.TOP_RIGHT):new Xw(e.left+e.width-U/2,e.top+p/2),this.bottomRightBorderStroke=h>0||u>0?zw(e.left+v,e.top+Q,h-U/2,u-C/2,mw.BOTTOM_RIGHT):new Xw(e.left+e.width-U/2,e.top+e.height-C/2),this.bottomLeftBorderStroke=d>0||B>0?zw(e.left+F/2,e.top+m,d-F/2,B-C/2,mw.BOTTOM_LEFT):new Xw(e.left+F/2,e.top+e.height-C/2),this.topLeftBorderBox=n>0||s>0?zw(e.left,e.top,n,s,mw.TOP_LEFT):new Xw(e.left,e.top),this.topRightBorderBox=o>0||a>0?zw(e.left+g,e.top,o,a,mw.TOP_RIGHT):new Xw(e.left+e.width,e.top),this.bottomRightBorderBox=h>0||u>0?zw(e.left+v,e.top+Q,h,u,mw.BOTTOM_RIGHT):new Xw(e.left+e.width,e.top+e.height),this.bottomLeftBorderBox=d>0||B>0?zw(e.left,e.top+m,d,B,mw.BOTTOM_LEFT):new Xw(e.left,e.top+e.height),this.topLeftPaddingBox=n>0||s>0?zw(e.left+F,e.top+p,Math.max(0,n-F),Math.max(0,s-p),mw.TOP_LEFT):new Xw(e.left+F,e.top+p),this.topRightPaddingBox=o>0||a>0?zw(e.left+Math.min(g,e.width-U),e.top+p,g>e.width+U?0:Math.max(0,o-U),Math.max(0,a-p),mw.TOP_RIGHT):new Xw(e.left+e.width-U,e.top+p),this.bottomRightPaddingBox=h>0||u>0?zw(e.left+Math.min(v,e.width-F),e.top+Math.min(Q,e.height-C),Math.max(0,h-U),Math.max(0,u-C),mw.BOTTOM_RIGHT):new Xw(e.left+e.width-U,e.top+e.height-C),this.bottomLeftPaddingBox=d>0||B>0?zw(e.left+F,e.top+Math.min(m,e.height-C),Math.max(0,d-F),Math.max(0,B-C),mw.BOTTOM_LEFT):new Xw(e.left+F,e.top+e.height-C),this.topLeftContentBox=n>0||s>0?zw(e.left+F+H,e.top+p+y,Math.max(0,n-(F+H)),Math.max(0,s-(p+y)),mw.TOP_LEFT):new Xw(e.left+F+H,e.top+p+y),this.topRightContentBox=o>0||a>0?zw(e.left+Math.min(g,e.width+F+H),e.top+p+y,g>e.width+F+H?0:o-F+H,a-(p+y),mw.TOP_RIGHT):new Xw(e.left+e.width-(U+b),e.top+p+y),this.bottomRightContentBox=h>0||u>0?zw(e.left+Math.min(v,e.width-(F+H)),e.top+Math.min(Q,e.height+p+y),Math.max(0,h-(U+b)),u-(C+E),mw.BOTTOM_RIGHT):new Xw(e.left+e.width-(U+b),e.top+e.height-(C+E)),this.bottomLeftContentBox=d>0||B>0?zw(e.left+F+H,e.top+m,Math.max(0,d-(F+H)),B-(C+E),mw.BOTTOM_LEFT):new Xw(e.left+F+H,e.top+e.height-(C+E))};(pw=mw||(mw={}))[pw.TOP_LEFT=0]="TOP_LEFT",pw[pw.TOP_RIGHT=1]="TOP_RIGHT",pw[pw.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",pw[pw.BOTTOM_LEFT=3]="BOTTOM_LEFT";var zw=function(A,t,e,i,n){var s=(Math.sqrt(2)-1)/3*4,r=e*s,o=i*s,a=A+e,c=t+i;switch(n){case mw.TOP_LEFT:return new Zw(new Xw(A,c),new Xw(A,c-o),new Xw(a-r,t),new Xw(a,t));case mw.TOP_RIGHT:return new Zw(new Xw(A,t),new Xw(A+r,t),new Xw(a,c-o),new Xw(a,c));case mw.BOTTOM_RIGHT:return new Zw(new Xw(a,t),new Xw(a,t+o),new Xw(A+r,c),new Xw(A,c));case mw.BOTTOM_LEFT:default:return new Zw(new Xw(a,c),new Xw(a-r,c),new Xw(A,t+o),new Xw(A,t))}},$w=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},Af=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},tf=function(A,t,e){this.offsetX=A,this.offsetY=t,this.matrix=e,this.type=0,this.target=6},ef=function(A,t){this.path=A,this.target=t,this.type=1},nf=function(A){this.opacity=A,this.type=2,this.target=6},sf=function(A){return 1===A.type},rf=function(A,t){return A.length===t.length&&A.some((function(A,e){return A===t[e]}))},of=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},af=function(){function A(A,t){if(this.container=A,this.parent=t,this.effects=[],this.curves=new qw(this.container),this.container.styles.opacity<1&&this.effects.push(new nf(this.container.styles.opacity)),null!==this.container.styles.transform){var e=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new tf(e,i,n))}if(0!==this.container.styles.overflowX){var s=$w(this.curves),r=Af(this.curves);rf(s,r)?this.effects.push(new ef(s,6)):(this.effects.push(new ef(s,2)),this.effects.push(new ef(r,4)))}}return A.prototype.getEffects=function(A){for(var t=-1===[2,3].indexOf(this.container.styles.position),e=this.parent,i=this.effects.slice(0);e;){var n=e.effects.filter((function(A){return!sf(A)}));if(t||0!==e.container.styles.position||!e.parent){if(t=-1===[2,3].indexOf(e.container.styles.position),0!==e.container.styles.overflowX){var s=$w(e.curves),r=Af(e.curves);rf(s,r)||i.unshift(new ef(r,6))}i.unshift.apply(i,n)}else i.unshift.apply(i,n);e=e.parent}return i.filter((function(t){return Fd(t.target,A)}))},A}(),cf=function(A,t,e,i){A.container.elements.forEach((function(n){var s=Fd(n.flags,4),r=Fd(n.flags,2),o=new af(n,A);Fd(n.styles.display,2048)&&i.push(o);var a=Fd(n.flags,8)?[]:i;if(s||r){var c=s||n.styles.isPositioned()?e:t,h=new of(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var l=0;c.negativeZIndex.some((function(A,t){return u>A.element.container.styles.zIndex.order?(l=t,!1):l>0})),c.negativeZIndex.splice(l,0,h)}else if(u>0){var d=0;c.positiveZIndex.some((function(A,t){return u>=A.element.container.styles.zIndex.order?(d=t+1,!1):d>0})),c.positiveZIndex.splice(d,0,h)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(h)}else n.styles.isFloating()?c.nonPositionedFloats.push(h):c.nonPositionedInlineLevel.push(h);cf(o,h,s?h:e,a)}else n.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),cf(o,t,e,a);Fd(n.flags,8)&&hf(n,a)}))},hf=function(A,t){for(var e=A instanceof CB?A.start:1,i=A instanceof CB&&A.reversed,n=0;n<t.length;n++){var s=t[n];s.container instanceof UB&&"number"==typeof s.container.value&&0!==s.container.value&&(e=s.container.value),s.listValue=gw(e,s.container.styles.listStyleType,!0),e+=i?-1:1}},uf=function(A,t){switch(t){case 0:return df(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return df(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return df(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return df(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},lf=function(A,t){var e=[];return Ww(A)?e.push(A.subdivide(.5,!1)):e.push(A),Ww(t)?e.push(t.subdivide(.5,!0)):e.push(t),e},df=function(A,t,e,i){var n=[];return Ww(A)?n.push(A.subdivide(.5,!1)):n.push(A),Ww(e)?n.push(e.subdivide(.5,!0)):n.push(e),Ww(i)?n.push(i.subdivide(.5,!0).reverse()):n.push(i),Ww(t)?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},Bf=function(A){var t=A.bounds,e=A.styles;return t.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},wf=function(A){var t=A.styles,e=A.bounds,i=Xh(t.paddingLeft,e.width),n=Xh(t.paddingRight,e.width),s=Xh(t.paddingTop,e.width),r=Xh(t.paddingBottom,e.width);return e.add(i+t.borderLeftWidth,s+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+i+n),-(t.borderTopWidth+t.borderBottomWidth+s+r))},ff=function(A,t,e){var i,n,s=(n=A,0===(i=mf(A.styles.backgroundOrigin,t))?n.bounds:2===i?wf(n):Bf(n)),r=function(A,t){return 0===A?t.bounds:2===A?wf(t):Bf(t)}(mf(A.styles.backgroundClip,t),A),o=vf(mf(A.styles.backgroundSize,t),e,s),a=o[0],c=o[1],h=Jh(mf(A.styles.backgroundPosition,t),s.width-a,s.height-c);return[pf(mf(A.styles.backgroundRepeat,t),h,o,s,r),Math.round(s.left+h[0]),Math.round(s.top+h[1]),a=Math.max(1,a),c=Math.max(1,c)]},gf=function(A){return Kh(A)&&A.value===ac.AUTO},Qf=function(A){return"number"==typeof A},vf=function(A,t,e){var i=t[0],n=t[1],s=t[2],r=A[0],o=A[1];if(!r)return[0,0];if(xh(r)&&o&&xh(o))return[Xh(r,e.width),Xh(o,e.height)];var a=Qf(s);if(Kh(r)&&(r.value===ac.CONTAIN||r.value===ac.COVER))return Qf(s)?e.width/e.height<s!=(r.value===ac.COVER)?[e.width,e.width/s]:[e.height*s,e.height]:[e.width,e.height];var c=Qf(i),h=Qf(n),u=c||h;if(gf(r)&&(!o||gf(o)))return c&&h?[i,n]:a||u?u&&a?[c?i:n*s,h?n:i/s]:[c?i:e.width,h?n:e.height]:[e.width,e.height];if(a){var l=0,d=0;return xh(r)?l=Xh(r,e.width):xh(o)&&(d=Xh(o,e.height)),gf(r)?l=d*s:o&&!gf(o)||(d=l/s),[l,d]}var B=null,w=null;if(xh(r)?B=Xh(r,e.width):o&&xh(o)&&(w=Xh(o,e.height)),null===B||o&&!gf(o)||(w=c&&h?B/i*n:e.height),null!==w&&gf(r)&&(B=c&&h?w/n*i:e.width),null!==B&&null!==w)return[B,w];throw new Error("Unable to calculate background-size for element")},mf=function(A,t){var e=A[t];return void 0===e?A[0]:e},pf=function(A,t,e,i,n){var s=t[0],r=t[1],o=e[0],a=e[1];switch(A){case 2:return[new Xw(Math.round(i.left),Math.round(i.top+r)),new Xw(Math.round(i.left+i.width),Math.round(i.top+r)),new Xw(Math.round(i.left+i.width),Math.round(a+i.top+r)),new Xw(Math.round(i.left),Math.round(a+i.top+r))];case 3:return[new Xw(Math.round(i.left+s),Math.round(i.top)),new Xw(Math.round(i.left+s+o),Math.round(i.top)),new Xw(Math.round(i.left+s+o),Math.round(i.height+i.top)),new Xw(Math.round(i.left+s),Math.round(i.height+i.top))];case 1:return[new Xw(Math.round(i.left+s),Math.round(i.top+r)),new Xw(Math.round(i.left+s+o),Math.round(i.top+r)),new Xw(Math.round(i.left+s+o),Math.round(i.top+r+a)),new Xw(Math.round(i.left+s),Math.round(i.top+r+a))];default:return[new Xw(Math.round(n.left),Math.round(n.top)),new Xw(Math.round(n.left+n.width),Math.round(n.top)),new Xw(Math.round(n.left+n.width),Math.round(n.height+n.top)),new Xw(Math.round(n.left),Math.round(n.height+n.top))]}},Uf="Hidden Text",Cf=function(){function A(A){this.MA={},this.LA=A}return A.prototype.parseMetrics=function(A,t){var e=this.LA.createElement("div"),i=this.LA.createElement("img"),n=this.LA.createElement("span"),s=this.LA.body;e.style.visibility="hidden",e.style.fontFamily=A,e.style.fontSize=t,e.style.margin="0",e.style.padding="0",e.style.whiteSpace="nowrap",s.appendChild(e),i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this.LA.createTextNode(Uf)),e.appendChild(n),e.appendChild(i);var r=i.offsetTop-n.offsetTop+2;e.removeChild(n),e.appendChild(this.LA.createTextNode(Uf)),e.style.lineHeight="normal",i.style.verticalAlign="super";var o=i.offsetTop-e.offsetTop+2;return s.removeChild(e),{baseline:r,middle:o}},A.prototype.getMetrics=function(A,t){var e="".concat(A," ").concat(t);return void 0===this.MA[e]&&(this.MA[e]=this.parseMetrics(A,t)),this.MA[e]},A}(),Ff=function(A,t){this.context=A,this.options=t},yf=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.RA=[],i.canvas=e.canvas?e.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),e.canvas||(i.canvas.width=Math.floor(e.width*e.scale),i.canvas.height=Math.floor(e.height*e.scale),i.canvas.style.width="".concat(e.width,"px"),i.canvas.style.height="".concat(e.height,"px")),i.fontMetrics=new Cf(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-e.x,-e.y),i.ctx.textBaseline="bottom",i.RA=[],i.context.logger.debug("Canvas renderer initialized (".concat(e.width,"x").concat(e.height,") with scale ").concat(e.scale)),i}return La(t,A),t.prototype.applyEffects=function(A){for(var t=this;this.RA.length;)this.popEffect();A.forEach((function(A){return t.applyEffect(A)}))},t.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 2===A.type}(A)&&(this.ctx.globalAlpha=A.opacity),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),sf(A)&&(this.path(A.path),this.ctx.clip()),this.RA.push(A)},t.prototype.popEffect=function(){this.RA.pop(),this.ctx.restore()},t.prototype.renderStack=function(A){return Na(this,void 0,void 0,(function(){return Ga(this,(function(t){switch(t.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.renderNode=function(A){return Na(this,void 0,void 0,(function(){return Ga(this,(function(t){switch(t.label){case 0:return Fd(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(A)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},t.prototype.renderTextWithLetterSpacing=function(A,t,e){var i=this;0===t?-1===navigator.userAgent.indexOf("Firefox")?(this.ctx.textBaseline="ideographic",this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)):this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+e):dB(A.text).reduce((function(t,n){return i.ctx.fillText(n,t,A.bounds.top+e),t+i.ctx.measureText(n).width}),A.bounds.left)},t.prototype.createFontStyle=function(A){var t=A.fontVariant.filter((function(A){return"normal"===A||"small-caps"===A})).join(""),e=kf(A.fontFamily).join(", "),i=Th(A.fontSize)?"".concat(A.fontSize.number).concat(A.fontSize.unit):"".concat(A.fontSize.number,"px");return[[A.fontStyle,t,A.fontWeight,i,e].join(" "),e,i]},t.prototype.renderTextNode=function(A,t){return Na(this,void 0,void 0,(function(){var e,i,n=this;return Ga(this,(function(s){return e=this.createFontStyle(t)[0],this.ctx.font=e,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",i=t.paintOrder,A.textBounds.forEach((function(A){i.forEach((function(e){switch(e){case 0:n.ctx.fillStyle=tu(t.color),n.renderTextWithLetterSpacing(A,t.letterSpacing,t.fontSize.number);var i=t.textShadow;i.length&&A.text.trim().length&&(i.slice(0).reverse().forEach((function(e){n.ctx.shadowColor=tu(e.color),n.ctx.shadowOffsetX=e.offsetX.number*n.options.scale,n.ctx.shadowOffsetY=e.offsetY.number*n.options.scale,n.ctx.shadowBlur=e.blur.number,n.renderTextWithLetterSpacing(A,t.letterSpacing,t.fontSize.number)})),n.ctx.shadowColor="",n.ctx.shadowOffsetX=0,n.ctx.shadowOffsetY=0,n.ctx.shadowBlur=0),t.textDecorationLine.length&&(n.ctx.fillStyle=tu(t.textDecorationColor||t.color),t.textDecorationLine.forEach((function(t){switch(t){case 1:n.ctx.fillRect(A.bounds.left,A.bounds.top+A.bounds.height-1,A.bounds.width,1);break;case 2:n.ctx.fillRect(A.bounds.left,A.bounds.top,A.bounds.width,1);break;case 3:n.ctx.fillRect(A.bounds.left,A.bounds.top+(A.bounds.height/2-.5),A.bounds.width,1)}})));break;case 1:t.webkitTextStrokeWidth&&A.text.trim().length&&(n.ctx.strokeStyle=tu(t.webkitTextStrokeColor),n.ctx.lineWidth=t.webkitTextStrokeWidth,n.ctx.lineJoin=window.chrome?"miter":"round",n.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+A.bounds.height)),n.ctx.strokeStyle="",n.ctx.lineWidth=0,n.ctx.lineJoin="miter"}}))})),[2]}))}))},t.prototype.renderReplacedElement=function(A,t,e){var i=e.naturalWidth||A.intrinsicWidth,n=e.naturalHeight||A.intrinsicHeight;if(e&&i>0&&n>0){var s=wf(A),r=Af(t);this.path(r),this.ctx.save(),this.ctx.clip();var o=0,a=0,c=i,h=n,u=s.left,l=s.top,d=s.width,B=s.height,w=A.styles.objectFit,f=d/B,g=c/h;2===w?g>f?(B=d/g,l+=(s.height-B)/2):(d=B*g,u+=(s.width-d)/2):4===w?g>f?o+=(i-(c=h*f))/2:a+=(n-(h=c/f))/2:8===w?(c>d?(o+=(c-d)/2,c=d):(u+=(d-c)/2,d=c),h>B?(a+=(h-B)/2,h=B):(l+=(B-h)/2,B=h)):16===w&&((g>f?d:B*g)<(c>d?c:d)?g>f?(B=d/g,l+=(s.height-B)/2):(d=B*g,u+=(s.width-d)/2):(c>d?(o+=(c-d)/2,c=d):(u+=(d-c)/2,d=c),h>B?(a+=(h-B)/2,h=B):(l+=(B-h)/2,B=h))),this.ctx.drawImage(e,o,a,c,h,u,l,d,B),this.ctx.restore()}},t.prototype.renderNodeContent=function(A){return Na(this,void 0,void 0,(function(){var e,i,n,s,r,o,a,c,h,u,l,d,B,w,f,g,Q,v,m;return Ga(this,(function(p){switch(p.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,i=A.curves,n=e.styles,s=0,r=e.textNodes,p.label=1;case 1:return s<r.length?(o=r[s],[4,this.renderTextNode(o,n)]):[3,4];case 2:p.sent(),p.label=3;case 3:return s++,[3,1];case 4:if(!(e instanceof vB))return[3,8];p.label=5;case 5:return p.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return g=p.sent(),this.renderReplacedElement(e,i,g),[3,8];case 7:return p.sent(),this.context.logger.error("Error loading image ".concat(e.src)),[3,8];case 8:if(e instanceof mB&&this.renderReplacedElement(e,i,e.canvas),!(e instanceof pB))return[3,12];p.label=9;case 9:return p.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return g=p.sent(),this.renderReplacedElement(e,i,g),[3,12];case 11:return p.sent(),this.context.logger.error("Error loading svg ".concat(e.svg.substring(0,255))),[3,12];case 12:return e instanceof SB&&e.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:a=p.sent(),e.width&&e.height&&this.ctx.drawImage(a,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),p.label=14;case 14:if(e instanceof IB&&(c=Math.min(e.bounds.width,e.bounds.height),e.type===bB?e.checked&&(this.ctx.save(),this.path([new Xw(e.bounds.left+.39363*c,e.bounds.top+.79*c),new Xw(e.bounds.left+.16*c,e.bounds.top+.5549*c),new Xw(e.bounds.left+.27347*c,e.bounds.top+.44071*c),new Xw(e.bounds.left+.39694*c,e.bounds.top+.5649*c),new Xw(e.bounds.left+.72983*c,e.bounds.top+.23*c),new Xw(e.bounds.left+.84*c,e.bounds.top+.34085*c),new Xw(e.bounds.left+.39363*c,e.bounds.top+.79*c)]),this.ctx.fillStyle=tu(HB),this.ctx.fill(),this.ctx.restore()):e.type===EB&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+c/2,e.bounds.top+c/2,c/4,0,2*Math.PI,!0),this.ctx.fillStyle=tu(HB),this.ctx.fill(),this.ctx.restore())),bf(e)&&e.value.length){switch(h=this.createFontStyle(n),v=h[0],u=h[1],l=h[2],d=this.fontMetrics.getMetrics(u,l).baseline,this.ctx.font=v,this.ctx.fillStyle=tu(n.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Hf(e.styles.textAlign),m=wf(e),B=0,e.styles.textAlign){case 1:B+=m.width/2;break;case 2:B+=m.width}w=m.add(B,0,0,-m.height/2+1),this.ctx.save(),this.path([new Xw(m.left,m.top),new Xw(m.left+m.width,m.top),new Xw(m.left+m.width,m.top+m.height),new Xw(m.left,m.top+m.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new uB(e.value,w),n.letterSpacing,d),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Fd(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(f=e.styles.listStyleImage).type)return[3,18];g=void 0,Q=f.url,p.label=15;case 15:return p.trys.push([15,17,,18]),[4,this.context.cache.match(Q)];case 16:return g=p.sent(),this.ctx.drawImage(g,e.bounds.left-(g.width+10),e.bounds.top),[3,18];case 17:return p.sent(),this.context.logger.error("Error loading list-style-image ".concat(Q)),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(v=this.createFontStyle(n)[0],this.ctx.font=v,this.ctx.fillStyle=tu(n.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",m=new Va(e.bounds.left,e.bounds.top+Xh(e.styles.paddingTop,e.bounds.width),e.bounds.width,xl(n.lineHeight,n.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new uB(A.listValue,m),n.letterSpacing,xl(n.lineHeight,n.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),p.label=20;case 20:return[2]}}))}))},t.prototype.renderStackContent=function(A){return Na(this,void 0,void 0,(function(){var t,e,i,n,s,r,o,a,c,h,u,l,d,B,w;return Ga(this,(function(f){switch(f.label){case 0:return Fd(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:f.sent(),t=0,e=A.negativeZIndex,f.label=2;case 2:return t<e.length?(w=e[t],[4,this.renderStack(w)]):[3,5];case 3:f.sent(),f.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:f.sent(),i=0,n=A.nonInlineLevel,f.label=7;case 7:return i<n.length?(w=n[i],[4,this.renderNode(w)]):[3,10];case 8:f.sent(),f.label=9;case 9:return i++,[3,7];case 10:s=0,r=A.nonPositionedFloats,f.label=11;case 11:return s<r.length?(w=r[s],[4,this.renderStack(w)]):[3,14];case 12:f.sent(),f.label=13;case 13:return s++,[3,11];case 14:o=0,a=A.nonPositionedInlineLevel,f.label=15;case 15:return o<a.length?(w=a[o],[4,this.renderStack(w)]):[3,18];case 16:f.sent(),f.label=17;case 17:return o++,[3,15];case 18:c=0,h=A.inlineLevel,f.label=19;case 19:return c<h.length?(w=h[c],[4,this.renderNode(w)]):[3,22];case 20:f.sent(),f.label=21;case 21:return c++,[3,19];case 22:u=0,l=A.zeroOrAutoZIndexOrTransformedOrOpacity,f.label=23;case 23:return u<l.length?(w=l[u],[4,this.renderStack(w)]):[3,26];case 24:f.sent(),f.label=25;case 25:return u++,[3,23];case 26:d=0,B=A.positiveZIndex,f.label=27;case 27:return d<B.length?(w=B[d],[4,this.renderStack(w)]):[3,30];case 28:f.sent(),f.label=29;case 29:return d++,[3,27];case 30:return[2]}}))}))},t.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},t.prototype.formatPath=function(A){var t=this;A.forEach((function(A,e){var i=Ww(A)?A.start:A;0===e?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),Ww(A)&&t.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)}))},t.prototype.renderRepeat=function(A,t,e,i){this.path(A),this.ctx.fillStyle=t,this.ctx.translate(e,i),this.ctx.fill(),this.ctx.translate(-e,-i)},t.prototype.resizeImage=function(A,t,e){var i,n=(null!==(i=this.canvas.ownerDocument)&&void 0!==i?i:document).createElement("canvas");return n.width=Math.max(1,t),n.height=Math.max(1,e),n.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,t,e),n},t.prototype.renderBackgroundImage=function(A){return Na(this,void 0,void 0,(function(){var t,e,i,n,s,r;return Ga(this,(function(o){switch(o.label){case 0:t=A.styles.backgroundImage.length-1,e=function(e){var n,s,r,o,a,c,h,u,l,d,B,w,f,g,Q,v,m,p,U,C,F,y,b,E,H,I,k,T,S,K,O,D,M;return Ga(this,(function(L){switch(L.label){case 0:if(0!==e.type)return[3,5];n=void 0,s=e.url,L.label=1;case 1:return L.trys.push([1,3,,4]),[4,i.context.cache.match(s)];case 2:return n=L.sent(),[3,4];case 3:return L.sent(),i.context.logger.error("Error loading background-image ".concat(s)),[3,4];case 4:return n&&(r=isNaN(n.width)||0===n.width?1:n.width,o=isNaN(n.height)||0===n.height?1:n.height,a=ff(A,t,[r,o,r/o]),p=a[0],E=a[1],H=a[2],F=a[3],y=a[4],v=i.ctx.createPattern(i.resizeImage(n,F,y),"repeat"),i.renderRepeat(p,v,E,H)),[3,6];case 5:1===e.type?(c=ff(A,t,[null,null,null]),p=c[0],E=c[1],H=c[2],F=c[3],y=c[4],h=function(A,t,e){var i="number"==typeof A?A:function(A,t,e){var i=t/2,n=e/2,s=Xh(A[0],t)-i,r=n-Xh(A[1],e);return(Math.atan2(r,s)+2*Math.PI)%(2*Math.PI)}(A,t,e),n=Math.abs(t*Math.sin(i))+Math.abs(e*Math.cos(i)),s=t/2,r=e/2,o=n/2,a=Math.sin(i-Math.PI/2)*o,c=Math.cos(i-Math.PI/2)*o;return[n,s-c,s+c,r-a,r+a]}(e.angle,F,y),u=h[0],l=h[1],d=h[2],B=h[3],w=h[4],(f=document.createElement("canvas")).width=F,f.height=y,g=f.getContext("2d"),Q=g.createLinearGradient(l,B,d,w),xu(e.stops,u||1).forEach((function(A){return Q.addColorStop(A.stop,tu(A.color))})),g.fillStyle=Q,g.fillRect(0,0,F,y),F>0&&y>0&&(v=i.ctx.createPattern(f,"repeat"),i.renderRepeat(p,v,E,H))):2===e.type&&(m=ff(A,t,[null,null,null]),p=m[0],U=m[1],C=m[2],F=m[3],y=m[4],b=0===e.position.length?[Ph]:e.position,E=Xh(b[0],F),H=Xh(b[b.length-1],y),I=function(A,t,e,i,n){var s=0,r=0;switch(A.size){case 0:0===A.shape?s=r=Math.min(Math.abs(t),Math.abs(t-i),Math.abs(e),Math.abs(e-n)):1===A.shape&&(s=Math.min(Math.abs(t),Math.abs(t-i)),r=Math.min(Math.abs(e),Math.abs(e-n)));break;case 2:if(0===A.shape)s=r=Math.min(Vu(t,e),Vu(t,e-n),Vu(t-i,e),Vu(t-i,e-n));else if(1===A.shape){var o=Math.min(Math.abs(e),Math.abs(e-n))/Math.min(Math.abs(t),Math.abs(t-i)),a=ju(i,n,t,e,!0),c=a[0],h=a[1];r=o*(s=Vu(c-t,(h-e)/o))}break;case 1:0===A.shape?s=r=Math.max(Math.abs(t),Math.abs(t-i),Math.abs(e),Math.abs(e-n)):1===A.shape&&(s=Math.max(Math.abs(t),Math.abs(t-i)),r=Math.max(Math.abs(e),Math.abs(e-n)));break;case 3:if(0===A.shape)s=r=Math.max(Vu(t,e),Vu(t,e-n),Vu(t-i,e),Vu(t-i,e-n));else if(1===A.shape){o=Math.max(Math.abs(e),Math.abs(e-n))/Math.max(Math.abs(t),Math.abs(t-i));var u=ju(i,n,t,e,!1);c=u[0],h=u[1],r=o*(s=Vu(c-t,(h-e)/o))}}return Array.isArray(A.size)&&(s=Xh(A.size[0],i),r=2===A.size.length?Xh(A.size[1],n):s),[s,r]}(e,E,H,F,y),k=I[0],T=I[1],k>0&&T>0&&(S=i.ctx.createRadialGradient(U+E,C+H,0,U+E,C+H,k),xu(e.stops,2*k).forEach((function(A){return S.addColorStop(A.stop,tu(A.color))})),i.path(p),i.ctx.fillStyle=S,k!==T?(K=A.bounds.left+.5*A.bounds.width,O=A.bounds.top+.5*A.bounds.height,M=1/(D=T/k),i.ctx.save(),i.ctx.translate(K,O),i.ctx.transform(1,0,0,D,0,0),i.ctx.translate(-K,-O),i.ctx.fillRect(U,M*(C-O)+O,F,y*M),i.ctx.restore()):i.ctx.fill())),L.label=6;case 6:return t--,[2]}}))},i=this,n=0,s=A.styles.backgroundImage.slice(0).reverse(),o.label=1;case 1:return n<s.length?(r=s[n],[5,e(r)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.renderSolidBorder=function(A,t,e){return Na(this,void 0,void 0,(function(){return Ga(this,(function(i){return this.path(uf(e,t)),this.ctx.fillStyle=tu(A),this.ctx.fill(),[2]}))}))},t.prototype.renderDoubleBorder=function(A,t,e,i){return Na(this,void 0,void 0,(function(){var n,s;return Ga(this,(function(r){switch(r.label){case 0:return t<3?[4,this.renderSolidBorder(A,e,i)]:[3,2];case 1:return r.sent(),[2];case 2:return n=function(A,t){switch(t){case 0:return df(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return df(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return df(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return df(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(i,e),this.path(n),this.ctx.fillStyle=tu(A),this.ctx.fill(),s=function(A,t){switch(t){case 0:return df(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return df(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return df(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return df(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(i,e),this.path(s),this.ctx.fill(),[2]}}))}))},t.prototype.renderNodeBackgroundAndBorders=function(A){return Na(this,void 0,void 0,(function(){var t,e,i,n,s,r,o,a,c=this;return Ga(this,(function(h){switch(h.label){case 0:return this.applyEffects(A.getEffects(2)),t=A.container.styles,e=!Au(t.backgroundColor)||t.backgroundImage.length,i=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],n=Ef(mf(t.backgroundClip,0),A.curves),e||t.boxShadow.length?(this.ctx.save(),this.path(n),this.ctx.clip(),Au(t.backgroundColor)||(this.ctx.fillStyle=tu(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:h.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach((function(t){c.ctx.save();var e,i,n,s,r,o=$w(A.curves),a=t.inset?0:1e4,h=(e=o,i=-a+(t.inset?1:-1)*t.spread.number,n=(t.inset?1:-1)*t.spread.number,s=t.spread.number*(t.inset?-2:2),r=t.spread.number*(t.inset?-2:2),e.map((function(A,t){switch(t){case 0:return A.add(i,n);case 1:return A.add(i+s,n);case 2:return A.add(i+s,n+r);case 3:return A.add(i,n+r)}return A})));t.inset?(c.path(o),c.ctx.clip(),c.mask(h)):(c.mask(o),c.ctx.clip(),c.path(h)),c.ctx.shadowOffsetX=t.offsetX.number+a,c.ctx.shadowOffsetY=t.offsetY.number,c.ctx.shadowColor=tu(t.color),c.ctx.shadowBlur=t.blur.number,c.ctx.fillStyle=t.inset?tu(t.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),h.label=2;case 2:s=0,r=0,o=i,h.label=3;case 3:return r<o.length?0!==(a=o[r]).style&&!Au(a.color)&&a.width>0?2!==a.style?[3,5]:[4,this.renderDashedDottedBorder(a.color,a.width,s,A.curves,2)]:[3,11]:[3,13];case 4:return h.sent(),[3,11];case 5:return 3!==a.style?[3,7]:[4,this.renderDashedDottedBorder(a.color,a.width,s,A.curves,3)];case 6:return h.sent(),[3,11];case 7:return 4!==a.style?[3,9]:[4,this.renderDoubleBorder(a.color,a.width,s,A.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(a.color,s,A.curves)];case 10:h.sent(),h.label=11;case 11:s++,h.label=12;case 12:return r++,[3,3];case 13:return[2]}}))}))},t.prototype.renderDashedDottedBorder=function(A,t,e,i,n){return Na(this,void 0,void 0,(function(){var s,r,o,a,c,h,u,l,d,B,w,f,g,Q,v,m;return Ga(this,(function(p){return this.ctx.save(),s=function(A,t){switch(t){case 0:return lf(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return lf(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return lf(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return lf(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(i,e),r=uf(i,e),2===n&&(this.path(r),this.ctx.clip()),Ww(r[0])?(o=r[0].start.x,a=r[0].start.y):(o=r[0].x,a=r[0].y),Ww(r[1])?(c=r[1].end.x,h=r[1].end.y):(c=r[1].x,h=r[1].y),u=0===e||2===e?Math.abs(o-c):Math.abs(a-h),this.ctx.beginPath(),3===n?this.formatPath(s):this.formatPath(r.slice(0,2)),l=t<3?3*t:2*t,d=t<3?2*t:t,3===n&&(l=t,d=t),B=!0,u<=2*l?B=!1:u<=2*l+d?(l*=w=u/(2*l+d),d*=w):(f=Math.floor((u+d)/(l+d)),g=(u-f*l)/(f-1),d=(Q=(u-(f+1)*l)/f)<=0||Math.abs(d-g)<Math.abs(d-Q)?g:Q),B&&(3===n?this.ctx.setLineDash([0,l+d]):this.ctx.setLineDash([l,d])),3===n?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=tu(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===n&&(Ww(r[0])&&(v=r[3],m=r[0],this.ctx.beginPath(),this.formatPath([new Xw(v.end.x,v.end.y),new Xw(m.start.x,m.start.y)]),this.ctx.stroke()),Ww(r[1])&&(v=r[1],m=r[2],this.ctx.beginPath(),this.formatPath([new Xw(v.end.x,v.end.y),new Xw(m.start.x,m.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},t.prototype.render=function(A){return Na(this,void 0,void 0,(function(){var t;return Ga(this,(function(e){switch(e.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=tu(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=function(A){var t=new af(A,null),e=new of(t),i=[];return cf(t,e,e,i),hf(t.container,i),e}(A),[4,this.renderStack(t)];case 1:return e.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},t}(Ff),bf=function(A){return A instanceof TB||A instanceof kB||A instanceof IB&&A.type!==EB&&A.type!==bB},Ef=function(A,t){switch(A){case 0:return $w(t);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(t);default:return Af(t)}},Hf=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},If=["-apple-system","system-ui"],kf=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter((function(A){return-1===If.indexOf(A)})):A},Tf=function(A){function t(t,e){var i=A.call(this,t,e)||this;return i.canvas=e.canvas?e.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=e,i.canvas.width=Math.floor(e.width*e.scale),i.canvas.height=Math.floor(e.height*e.scale),i.canvas.style.width="".concat(e.width,"px"),i.canvas.style.height="".concat(e.height,"px"),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-e.x,-e.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (".concat(e.width,"x").concat(e.height," at ").concat(e.x,",").concat(e.y,") with scale ").concat(e.scale)),i}return La(t,A),t.prototype.render=function(A){return Na(this,void 0,void 0,(function(){var t,e;return Ga(this,(function(i){switch(i.label){case 0:return t=aB(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,Sf(t)];case 1:return e=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=tu(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},t}(Ff),Sf=function(A){return new Promise((function(t,e){var i=new Image;i.onload=function(){t(i)},i.onerror=e,i.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(A)))}))},Kf=function(){function A(A){var t=A.id,e=A.enabled;this.id=t,this.enabled=e,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,xa([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,xa([this.id,"".concat(this.getTime(),"ms")],A,!1))},A.prototype.warn=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,xa([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,xa([this.id,"".concat(this.getTime(),"ms")],A,!1)):this.info.apply(this,A))},A.instances={},A}(),Of=function(){function A(t,e){var i;this.windowBounds=e,this.instanceName="#".concat(A.instanceCount++),this.logger=new Kf({id:this.instanceName,enabled:t.logging}),this.cache=null!==(i=t.cache)&&void 0!==i?i:new Rw(this,t)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Lw.setContext(window);const Df=globalThis,Mf=Df.ShadowRoot&&(void 0===Df.ShadyCSS||Df.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lf=Symbol(),Rf=new WeakMap;let Nf=class{constructor(A,t,e){if(this.NA=!0,e!==Lf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=A,this.t=t}get styleSheet(){let A=this.o;const t=this.t;if(Mf&&void 0===A){const e=void 0!==t&&1===t.length;e&&(A=Rf.get(t)),void 0===A&&((this.o=A=new CSSStyleSheet).replaceSync(this.cssText),e&&Rf.set(t,A))}return A}toString(){return this.cssText}};const Gf=Mf?A=>A:A=>A instanceof CSSStyleSheet?(A=>{let t="";for(const e of A.cssRules)t+=e.cssText;return(A=>new Nf("string"==typeof A?A:A+"",void 0,Lf))(t)})(A):A,{is:xf,defineProperty:Vf,getOwnPropertyDescriptor:jf,getOwnPropertyNames:Pf,getOwnPropertySymbols:_f,getPrototypeOf:Jf}=Object,Xf=globalThis,Yf=Xf.trustedTypes,Zf=Yf?Yf.emptyScript:"",Wf=Xf.reactiveElementPolyfillSupport,qf=(A,t)=>A,zf={toAttribute(A,t){switch(t){case Boolean:A=A?Zf:null;break;case Object:case Array:A=null==A?A:JSON.stringify(A)}return A},fromAttribute(A,t){let e=A;switch(t){case Boolean:e=null!==A;break;case Number:e=null===A?null:Number(A);break;case Object:case Array:try{e=JSON.parse(A)}catch(i){e=null}}return e}},$f=(A,t)=>!xf(A,t),Ag={attribute:!0,type:String,converter:zf,reflect:!1,useDefault:!1,hasChanged:$f};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Xf.litPropertyMetadata??(Xf.litPropertyMetadata=new WeakMap);class tg extends HTMLElement{static addInitializer(A){this.GA(),(this.l??(this.l=[])).push(A)}static get observedAttributes(){return this.finalize(),this.xA&&[...this.xA.keys()]}static createProperty(A,t=Ag){if(t.state&&(t.attribute=!1),this.GA(),this.prototype.hasOwnProperty(A)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(A,t),!t.noAccessor){const e=Symbol(),i=this.getPropertyDescriptor(A,e,t);void 0!==i&&Vf(this.prototype,A,i)}}static getPropertyDescriptor(A,t,e){const{get:i,set:n}=jf(this.prototype,A)??{get(){return this[t]},set(A){this[t]=A}};return{get:i,set(t){const s=i?.call(this);n?.call(this,t),this.requestUpdate(A,s,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(A){return this.elementProperties.get(A)??Ag}static GA(){if(this.hasOwnProperty(qf("elementProperties")))return;const A=Jf(this);A.finalize(),void 0!==A.l&&(this.l=[...A.l]),this.elementProperties=new Map(A.elementProperties)}static finalize(){if(this.hasOwnProperty(qf("finalized")))return;if(this.finalized=!0,this.GA(),this.hasOwnProperty(qf("properties"))){const A=this.properties,t=[...Pf(A),..._f(A)];for(const e of t)this.createProperty(e,A[e])}const A=this[Symbol.metadata];if(null!==A){const t=litPropertyMetadata.get(A);if(void 0!==t)for(const[A,e]of t)this.elementProperties.set(A,e)}this.xA=new Map;for(const[t,e]of this.elementProperties){const A=this.VA(t,e);void 0!==A&&this.xA.set(A,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(A){const t=[];if(Array.isArray(A)){const e=new Set(A.flat(1/0).reverse());for(const A of e)t.unshift(Gf(A))}else void 0!==A&&t.push(Gf(A));return t}static VA(A,t){const e=t.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof A?A.toLowerCase():void 0}constructor(){super(),this.jA=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.PA=null,this._A()}_A(){this.JA=new Promise((A=>this.enableUpdating=A)),this.XA=new Map,this.YA(),this.requestUpdate(),this.constructor.l?.forEach((A=>A(this)))}addController(A){(this.ZA??(this.ZA=new Set)).add(A),void 0!==this.renderRoot&&this.isConnected&&A.hostConnected?.()}removeController(A){this.ZA?.delete(A)}YA(){const A=new Map,t=this.constructor.elementProperties;for(const e of t.keys())this.hasOwnProperty(e)&&(A.set(e,this[e]),delete this[e]);A.size>0&&(this.jA=A)}createRenderRoot(){const A=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((A,t)=>{if(Mf)A.adoptedStyleSheets=t.map((A=>A instanceof CSSStyleSheet?A:A.styleSheet));else for(const e of t){const t=document.createElement("style"),i=Df.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=e.cssText,A.appendChild(t)}})(A,this.constructor.elementStyles),A}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this.ZA?.forEach((A=>A.hostConnected?.()))}enableUpdating(A){}disconnectedCallback(){this.ZA?.forEach((A=>A.hostDisconnected?.()))}attributeChangedCallback(A,t,e){this.WA(A,e)}qA(A,t){const e=this.constructor.elementProperties.get(A),i=this.constructor.VA(A,e);if(void 0!==i&&!0===e.reflect){const n=(void 0!==e.converter?.toAttribute?e.converter:zf).toAttribute(t,e.type);this.PA=A,null==n?this.removeAttribute(i):this.setAttribute(i,n),this.PA=null}}WA(A,t){const e=this.constructor,i=e.xA.get(A);if(void 0!==i&&this.PA!==i){const A=e.getPropertyOptions(i),n="function"==typeof A.converter?{fromAttribute:A.converter}:void 0!==A.converter?.fromAttribute?A.converter:zf;this.PA=i,this[i]=n.fromAttribute(t,A.type)??this.zA?.get(i)??null,this.PA=null}}requestUpdate(A,t,e){if(void 0!==A){const i=this.constructor,n=this[A];if(e??(e=i.getPropertyOptions(A)),!((e.hasChanged??$f)(n,t)||e.useDefault&&e.reflect&&n===this.zA?.get(A)&&!this.hasAttribute(i.VA(A,e))))return;this.C(A,t,e)}!1===this.isUpdatePending&&(this.JA=this.$A())}C(A,t,{useDefault:e,reflect:i,wrapped:n},s){e&&!(this.zA??(this.zA=new Map)).has(A)&&(this.zA.set(A,s??t??this[A]),!0!==n||void 0!==s)||(this.XA.has(A)||(this.hasUpdated||e||(t=void 0),this.XA.set(A,t)),!0===i&&this.PA!==A&&(this.At??(this.At=new Set)).add(A))}async $A(){this.isUpdatePending=!0;try{await this.JA}catch(t){Promise.reject(t)}const A=this.scheduleUpdate();return null!=A&&await A,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.jA){for(const[A,t]of this.jA)this[A]=t;this.jA=void 0}const A=this.constructor.elementProperties;if(A.size>0)for(const[t,e]of A){const{wrapped:A}=e,i=this[t];!0!==A||this.XA.has(t)||void 0===i||this.C(t,void 0,e,i)}}let A=!1;const t=this.XA;try{A=this.shouldUpdate(t),A?(this.willUpdate(t),this.ZA?.forEach((A=>A.hostUpdate?.())),this.update(t)):this.tt()}catch(e){throw A=!1,this.tt(),e}A&&this.et(t)}willUpdate(A){}et(A){this.ZA?.forEach((A=>A.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(A)),this.updated(A)}tt(){this.XA=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.JA}shouldUpdate(A){return!0}update(A){this.At&&(this.At=this.At.forEach((A=>this.qA(A,this[A])))),this.tt()}updated(A){}firstUpdated(A){}}tg.elementStyles=[],tg.shadowRootOptions={mode:"open"},tg[qf("elementProperties")]=new Map,tg[qf("finalized")]=new Map,Wf?.({ReactiveElement:tg}),(Xf.reactiveElementVersions??(Xf.reactiveElementVersions=[])).push("2.1.0");const eg={attribute:!0,type:String,converter:zf,reflect:!1,hasChanged:$f},ig=(A=eg,t,e)=>{const{kind:i,metadata:n}=e;let s=globalThis.litPropertyMetadata.get(n);if(void 0===s&&globalThis.litPropertyMetadata.set(n,s=new Map),"setter"===i&&((A=Object.create(A)).wrapped=!0),s.set(e.name,A),"accessor"===i){const{name:i}=e;return{set(e){const n=t.get.call(this);t.set.call(this,e),this.requestUpdate(i,n,A)},init(t){return void 0!==t&&this.C(i,void 0,A,t),t}}}if("setter"===i){const{name:i}=e;return function(e){const n=this[i];t.call(this,e),this.requestUpdate(i,n,A)}}throw Error("Unsupported decorator location: "+i)};function ng(A){return(t,e)=>"object"==typeof e?ig(A,t,e):((A,t,e)=>{const i=t.hasOwnProperty(e);return t.constructor.createProperty(e,A),i?Object.getOwnPropertyDescriptor(t,e):void 0})(A,t,e)}function sg(A){return ng({...A,state:!0,attribute:!1})}const rg="session_data",og=new class{constructor(A){this.namespace=A}getItem(A){return localStorage.getItem(`${this.namespace}.${A}`)}setItem(A,t){localStorage.setItem(`${this.namespace}.${A}`,t)}removeItem(A){localStorage.removeItem(`${this.namespace}.${A}`)}clear(){for(let A=0;A<localStorage.length;A++){const t=localStorage.key(A);t&&t.startsWith(`${this.namespace}.`)&&localStorage.removeItem(t)}}}("io.obi.widget");var ag=Object.defineProperty,cg=Object.getOwnPropertyDescriptor,hg=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?cg(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&ag(t,e,s),s};class ug extends t.LitElement{constructor(){super(...arguments),this.id="",this.isActive=!1,this.isSpecial=!1}handleClick(A){A.preventDefault(),A.stopPropagation();const t=new CustomEvent("click",{detail:{id:this.id,isActive:!this.isActive},bubbles:!0,composed:!0});this.dispatchEvent(t),this.onClick&&this.onClick(this.id,!this.isActive)}render(){return t.html`
|
|
63
2
|
<button
|
|
64
3
|
id="obi-nav-${this.id}"
|
|
65
4
|
class=${this.isSpecial?"special":""}
|
|
@@ -69,7 +8,7 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
69
8
|
>
|
|
70
9
|
<slot></slot>
|
|
71
10
|
</button>
|
|
72
|
-
`}}
|
|
11
|
+
`}}ug.styles=t.css`
|
|
73
12
|
:host {
|
|
74
13
|
display: block;
|
|
75
14
|
}
|
|
@@ -121,7 +60,7 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
121
60
|
width: 18px;
|
|
122
61
|
height: 18px;
|
|
123
62
|
}
|
|
124
|
-
`,
|
|
63
|
+
`,hg([ng({type:String})],ug.prototype,"id",2),hg([ng({type:Boolean})],ug.prototype,"isActive",2),hg([ng({type:Boolean})],ug.prototype,"isSpecial",2),hg([ng({type:Function})],ug.prototype,"onClick",2),customElements.get("obi-nav-icon")||customElements.define("obi-nav-icon",ug);const lg=A=>t.html`
|
|
125
64
|
<svg
|
|
126
65
|
xmlns="http://www.w3.org/2000/svg"
|
|
127
66
|
width="24"
|
|
@@ -135,36 +74,33 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
135
74
|
class="lucide"
|
|
136
75
|
style="display: block;"
|
|
137
76
|
>
|
|
138
|
-
${
|
|
77
|
+
${A}
|
|
139
78
|
</svg>
|
|
140
|
-
`,
|
|
79
|
+
`,dg=lg(t.svg`
|
|
141
80
|
<rect x="14" y="4" width="4" height="16" rx="1"/><rect x="6" y="4" width="4" height="16" rx="1"/>
|
|
142
|
-
`),
|
|
81
|
+
`),Bg=lg(t.svg`<polygon points="6 3 20 12 6 21 6 3"/>`),wg=lg(t.svg`
|
|
143
82
|
<path d="M12 2v10"/><path d="M18.4 6.6a9 9 0 1 1-12.77.04"/>
|
|
144
|
-
`),
|
|
83
|
+
`),fg=lg(t.svg`
|
|
145
84
|
<path d="M18 6 6 18"/><path d="m6 6 12 12"/>
|
|
146
|
-
`),
|
|
85
|
+
`),gg=lg(t.svg`
|
|
147
86
|
<path d="M12 7v14" />
|
|
148
87
|
<path
|
|
149
88
|
d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"
|
|
150
89
|
/>
|
|
151
|
-
`),
|
|
90
|
+
`),Qg=t.html`
|
|
152
91
|
<img
|
|
153
92
|
class="widget-icon"
|
|
154
|
-
src="data:image/svg+xml;base64,${btoa(
|
|
155
|
-
<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
156
|
-
<path d="M158.803 0L160.352 0.0399439C176.267 0.844061 188.922 13.9634 188.922 30.0311C188.922 46.6174 175.438 60.0653 158.803 60.0656H99.0263L98.9061 60.0722C78.8071 61.4795 62.6269 77.004 60.2644 96.7673L60.241 96.9704V158.93L60.2644 159.13C62.7406 179.86 80.4234 195.934 101.881 195.935H153.842C176.993 195.935 195.759 177.223 195.759 154.14V96.9138L195.799 95.3693C196.606 79.5009 209.766 66.8827 225.881 66.8827C242.515 66.8834 256 80.328 256 96.9138V159.086L255.963 160.564C255.225 175.748 243.176 187.971 228.038 189.038V189.214C207.121 190.591 190.4 207.263 189.019 228.119H188.842C187.738 243.7 174.712 256 158.803 256H96.4491C79.8147 256 66.3309 242.555 66.3302 225.969C66.3302 225.673 66.3349 225.375 66.3436 225.077H66.3503H66.3035C63.3344 206.008 47.4427 190.589 27.8321 189.231L27.8354 189.031C12.2702 187.868 0.000167669 174.905 0 159.086V96.9138L0.0367222 95.4192C0.791087 80.0787 13.0909 67.7634 28.453 66.9293C47.7697 65.3039 63.3522 50.3234 66.2969 31.4658L66.3469 31.1595L66.3369 30.85C66.3301 30.5933 66.3302 30.3238 66.3302 30.0311C66.3309 13.4454 79.8148 0.000165137 96.4491 0H158.803Z" fill="white"/>
|
|
157
|
-
</svg>`)}"
|
|
93
|
+
src="data:image/svg+xml;base64,${btoa('<?xml version="1.0" encoding="UTF-8"?>\n <svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M158.803 0L160.352 0.0399439C176.267 0.844061 188.922 13.9634 188.922 30.0311C188.922 46.6174 175.438 60.0653 158.803 60.0656H99.0263L98.9061 60.0722C78.8071 61.4795 62.6269 77.004 60.2644 96.7673L60.241 96.9704V158.93L60.2644 159.13C62.7406 179.86 80.4234 195.934 101.881 195.935H153.842C176.993 195.935 195.759 177.223 195.759 154.14V96.9138L195.799 95.3693C196.606 79.5009 209.766 66.8827 225.881 66.8827C242.515 66.8834 256 80.328 256 96.9138V159.086L255.963 160.564C255.225 175.748 243.176 187.971 228.038 189.038V189.214C207.121 190.591 190.4 207.263 189.019 228.119H188.842C187.738 243.7 174.712 256 158.803 256H96.4491C79.8147 256 66.3309 242.555 66.3302 225.969C66.3302 225.673 66.3349 225.375 66.3436 225.077H66.3503H66.3035C63.3344 206.008 47.4427 190.589 27.8321 189.231L27.8354 189.031C12.2702 187.868 0.000167669 174.905 0 159.086V96.9138L0.0367222 95.4192C0.791087 80.0787 13.0909 67.7634 28.453 66.9293C47.7697 65.3039 63.3522 50.3234 66.2969 31.4658L66.3469 31.1595L66.3369 30.85C66.3301 30.5933 66.3302 30.3238 66.3302 30.0311C66.3309 13.4454 79.8148 0.000165137 96.4491 0H158.803Z" fill="white"/>\n </svg>')}"
|
|
158
94
|
alt="Obi Icon"
|
|
159
95
|
/>
|
|
160
|
-
`;var
|
|
161
|
-
${this.isActive?
|
|
96
|
+
`;var vg=Object.defineProperty,mg=Object.getOwnPropertyDescriptor,pg=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?mg(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&vg(t,e,s),s};class Ug extends t.LitElement{constructor(){super(),this.isActive=!1,this.isScreenActive=!1,this.position={top:0,left:0},this.currentState=Ka.READY,this.direction="up"}connectedCallback(){super.connectedCallback()}handleIconClick(A,t){this.onItemSelect&&this.onItemSelect(A,t)}render(){return t.html`
|
|
97
|
+
${this.isActive?t.html`
|
|
162
98
|
<obi-nav-icon
|
|
163
99
|
id="pause"
|
|
164
|
-
?isActive=${this.currentState===
|
|
165
|
-
@click=${()=>this.handleIconClick("pause",this.currentState!==
|
|
100
|
+
?isActive=${this.currentState===Ka.PAUSED}
|
|
101
|
+
@click=${()=>this.handleIconClick("pause",this.currentState!==Ka.PAUSED)}
|
|
166
102
|
>
|
|
167
|
-
${this.currentState===
|
|
103
|
+
${this.currentState===Ka.PAUSED?Bg:dg}
|
|
168
104
|
</obi-nav-icon>
|
|
169
105
|
<obi-nav-icon
|
|
170
106
|
id="activate"
|
|
@@ -172,17 +108,17 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
172
108
|
?isSpecial=${!0}
|
|
173
109
|
@click=${()=>this.handleIconClick("activate",!this.isActive)}
|
|
174
110
|
>
|
|
175
|
-
${this.isActive?
|
|
111
|
+
${this.isActive?fg:wg}
|
|
176
112
|
</obi-nav-icon>
|
|
177
|
-
`:
|
|
113
|
+
`:t.html`
|
|
178
114
|
<obi-nav-icon
|
|
179
115
|
id="experiences"
|
|
180
116
|
@click=${()=>this.handleIconClick("experiences",!0)}
|
|
181
117
|
>
|
|
182
|
-
${
|
|
118
|
+
${gg}
|
|
183
119
|
</obi-nav-icon>
|
|
184
120
|
`}
|
|
185
|
-
`}}
|
|
121
|
+
`}}Ug.styles=t.css`
|
|
186
122
|
:host {
|
|
187
123
|
display: flex;
|
|
188
124
|
position: absolute;
|
|
@@ -206,13 +142,13 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
206
142
|
bottom: auto;
|
|
207
143
|
flex-direction: column;
|
|
208
144
|
}
|
|
209
|
-
`,
|
|
145
|
+
`,pg([ng({type:Boolean})],Ug.prototype,"isActive",2),pg([ng({type:Boolean})],Ug.prototype,"isScreenActive",2),pg([ng({type:Object})],Ug.prototype,"position",2),pg([ng({type:String})],Ug.prototype,"currentState",2),pg([ng({type:String})],Ug.prototype,"direction",2),pg([ng({type:Function})],Ug.prototype,"onItemSelect",2),customElements.get("obi-navigation-bar")||customElements.define("obi-navigation-bar",Ug);var Cg=Object.defineProperty,Fg=Object.getOwnPropertyDescriptor,yg=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?Fg(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&Cg(t,e,s),s};class bg extends t.LitElement{constructor(){super(...arguments),this.id="",this.name="",this.description="",this.imageSrc=""}handleClick(){this.onSelect&&this.onSelect(this.id),this.dispatchEvent(new CustomEvent("course-select",{detail:{id:this.id},bubbles:!0,composed:!0}))}render(){return t.html`
|
|
210
146
|
<div class="course-container" @click=${this.handleClick}>
|
|
211
147
|
<img src=${this.imageSrc} alt="Course Preview" class="course-image" />
|
|
212
148
|
<h2 class="course-title">${this.name}</h2>
|
|
213
|
-
${this.description?
|
|
149
|
+
${this.description?t.html`<p class="course-description">${this.description}</p>`:""}
|
|
214
150
|
</div>
|
|
215
|
-
`}}
|
|
151
|
+
`}}bg.styles=t.css`
|
|
216
152
|
:host {
|
|
217
153
|
display: block;
|
|
218
154
|
}
|
|
@@ -257,9 +193,9 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
257
193
|
color: #71717a;
|
|
258
194
|
margin: 0;
|
|
259
195
|
}
|
|
260
|
-
`,
|
|
261
|
-
<div class="course-grid ${
|
|
262
|
-
${this.courses.map(A=>
|
|
196
|
+
`,yg([ng({type:String})],bg.prototype,"id",2),yg([ng({type:String})],bg.prototype,"name",2),yg([ng({type:String})],bg.prototype,"description",2),yg([ng({type:String})],bg.prototype,"imageSrc",2),yg([ng({type:Function})],bg.prototype,"onSelect",2);class Eg extends t.LitElement{constructor(){super(...arguments),this.courses=[],this.loading=!1,this.error=""}handleCourseSelect(A){this.onCourseSelect&&this.onCourseSelect(A.detail.id)}render(){if(this.loading)return t.html`<div class="loading">Loading...</div>`;if(this.error)return t.html`<div class="error">${this.error}</div>`;if(!this.courses||0===this.courses.length)return t.html`<div class="empty">No courses available</div>`;const A=1===this.courses.length?"grid-cols-1":2===this.courses.length?"grid-cols-2":"grid-cols-3";return t.html`
|
|
197
|
+
<div class="course-grid ${A}">
|
|
198
|
+
${this.courses.map((A=>t.html`
|
|
263
199
|
<obi-course
|
|
264
200
|
id=${A.id}
|
|
265
201
|
name=${A.name}
|
|
@@ -267,9 +203,9 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
267
203
|
imageSrc=${A.imageSrc}
|
|
268
204
|
@course-select=${this.handleCourseSelect}
|
|
269
205
|
></obi-course>
|
|
270
|
-
`)}
|
|
206
|
+
`))}
|
|
271
207
|
</div>
|
|
272
|
-
`}}
|
|
208
|
+
`}}Eg.styles=t.css`
|
|
273
209
|
:host {
|
|
274
210
|
display: block;
|
|
275
211
|
}
|
|
@@ -304,7 +240,7 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
304
240
|
.error {
|
|
305
241
|
color: #ef4444;
|
|
306
242
|
}
|
|
307
|
-
`,
|
|
243
|
+
`,yg([ng({type:Array})],Eg.prototype,"courses",2),yg([ng({type:Boolean})],Eg.prototype,"loading",2),yg([ng({type:String})],Eg.prototype,"error",2),yg([ng({type:Function})],Eg.prototype,"onCourseSelect",2),customElements.get("obi-course")||customElements.define("obi-course",bg),customElements.get("obi-course-list")||customElements.define("obi-course-list",Eg);var Hg=Object.defineProperty,Ig=Object.getOwnPropertyDescriptor,kg=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?Ig(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&Hg(t,e,s),s};class Tg extends t.LitElement{constructor(){super(...arguments),this.courses=[],this.loading=!0,this.error="",this.apiKey="",this.apiBaseUrl=""}handleCourseSelect(A){this.onCourseSelect&&this.onCourseSelect(A.detail.id)}handleClose(){this.onClose&&this.onClose()}async fetchCourses(){try{this.loading=!0;const A=await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`),t=await A.json(),e=t.sessions?.map((A=>({id:A.uuid,name:A.onboarding_plan.name,description:A.onboarding_plan.description,imageSrc:A.onboarding_plan.screen_url||"https://corproductionsydney-storagebucket5cb7c8ea-atg4gmftc6sk.s3.amazonaws.com/static/generic-course.png"}))),i=e.filter((A=>!!A.name));this.courses=[...i],this.requestUpdate()}catch(A){console.error("Fetch error:",A),this.error="Failed to fetch courses"}finally{this.loading=!1,this.requestUpdate()}}connectedCallback(){super.connectedCallback(),window.obiWidgetConfig?.apiKey&&(this.apiKey=window.obiWidgetConfig.apiKey),this.apiBaseUrl=e,this.apiBaseUrl&&this.apiKey?this.fetchCourses():(this.loading=!1,this.error="API base URL or API key is missing")}render(){return t.html`
|
|
308
244
|
<div class="backdrop" @click=${this.handleClose}></div>
|
|
309
245
|
<div class="container">
|
|
310
246
|
<button class="close-button" @click=${this.handleClose}>×</button>
|
|
@@ -320,7 +256,7 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
320
256
|
@course-select=${this.handleCourseSelect}
|
|
321
257
|
></obi-course-list>
|
|
322
258
|
</div>
|
|
323
|
-
`}}
|
|
259
|
+
`}}Tg.styles=t.css`
|
|
324
260
|
:host {
|
|
325
261
|
display: block;
|
|
326
262
|
font-family: "Syne", sans-serif;
|
|
@@ -403,29 +339,7 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
403
339
|
font-size: 24px;
|
|
404
340
|
color: #6b7280;
|
|
405
341
|
}
|
|
406
|
-
`,Rt([Z({type:Array})],DA.prototype,"courses",2),Rt([Z({type:Boolean})],DA.prototype,"loading",2),Rt([Z({type:String})],DA.prototype,"error",2),Rt([Z({type:String})],DA.prototype,"apiKey",2),Rt([Z({type:Function})],DA.prototype,"onCourseSelect",2),Rt([Z({type:Function})],DA.prototype,"onClose",2),Rt([Ge()],DA.prototype,"apiBaseUrl",2),customElements.get("obi-course-modal")||customElements.define("obi-course-modal",DA);/**
|
|
407
|
-
* @license
|
|
408
|
-
* Copyright 2017 Google LLC
|
|
409
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
410
|
-
*/const zn=globalThis,jr=zn.trustedTypes,Hh=jr?jr.createPolicy("lit-html",{createHTML:t=>t}):void 0,Oh="$lit$",ht=`lit$${Math.random().toFixed(9).slice(2)}$`,Mh="?"+ht,Vb=`<${Mh}>`,xt=document,Wr=()=>xt.createComment(""),Zn=t=>t===null||typeof t!="object"&&typeof t!="function",Ea=Array.isArray,Gb=t=>Ea(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",Sa=`[
|
|
411
|
-
\f\r]`,ei=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nh=/-->/g,Kh=/>/g,Pt=RegExp(`>|${Sa}(?:([^\\s"'>=/]+)(${Sa}*=${Sa}*(?:[^
|
|
412
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vh=/'/g,Gh=/"/g,jh=/^(?:script|style|textarea|title)$/i,Ai=Symbol.for("lit-noChange"),me=Symbol.for("lit-nothing"),Wh=new WeakMap,Lt=xt.createTreeWalker(xt,129);function Jh(t,e){if(!Ea(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hh!==void 0?Hh.createHTML(e):e}const jb=(t,e)=>{const A=t.length-1,n=[];let i,r=e===2?"<svg>":e===3?"<math>":"",s=ei;for(let o=0;o<A;o++){const a=t[o];let c,l,u=-1,d=0;for(;d<a.length&&(s.lastIndex=d,l=s.exec(a),l!==null);)d=s.lastIndex,s===ei?l[1]==="!--"?s=Nh:l[1]!==void 0?s=Kh:l[2]!==void 0?(jh.test(l[2])&&(i=RegExp("</"+l[2],"g")),s=Pt):l[3]!==void 0&&(s=Pt):s===Pt?l[0]===">"?(s=i??ei,u=-1):l[1]===void 0?u=-2:(u=s.lastIndex-l[2].length,c=l[1],s=l[3]===void 0?Pt:l[3]==='"'?Gh:Vh):s===Gh||s===Vh?s=Pt:s===Nh||s===Kh?s=ei:(s=Pt,i=void 0);const h=s===Pt&&t[o+1].startsWith("/>")?" ":"";r+=s===ei?a+Vb:u>=0?(n.push(c),a.slice(0,u)+Oh+a.slice(u)+ht+h):a+ht+(u===-2?o:h)}return[Jh(t,r+(t[A]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class ti{constructor({strings:e,_$litType$:A},n){let i;this.parts=[];let r=0,s=0;const o=e.length-1,a=this.parts,[c,l]=jb(e,A);if(this.el=ti.createElement(c,n),Lt.currentNode=this.el.content,A===2||A===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(i=Lt.nextNode())!==null&&a.length<o;){if(i.nodeType===1){if(i.hasAttributes())for(const u of i.getAttributeNames())if(u.endsWith(Oh)){const d=l[s++],h=i.getAttribute(u).split(ht),g=/([.?@])?(.*)/.exec(d);a.push({type:1,index:r,name:g[2],strings:h,ctor:g[1]==="."?Jb:g[1]==="?"?Xb:g[1]==="@"?$b:Xr}),i.removeAttribute(u)}else u.startsWith(ht)&&(a.push({type:6,index:r}),i.removeAttribute(u));if(jh.test(i.tagName)){const u=i.textContent.split(ht),d=u.length-1;if(d>0){i.textContent=jr?jr.emptyScript:"";for(let h=0;h<d;h++)i.append(u[h],Wr()),Lt.nextNode(),a.push({type:2,index:++r});i.append(u[d],Wr())}}}else if(i.nodeType===8)if(i.data===Mh)a.push({type:2,index:r});else{let u=-1;for(;(u=i.data.indexOf(ht,u+1))!==-1;)a.push({type:7,index:r}),u+=ht.length-1}r++}}static createElement(e,A){const n=xt.createElement("template");return n.innerHTML=e,n}}function dn(t,e,A=t,n){var s,o;if(e===Ai)return e;let i=n!==void 0?(s=A._$Co)==null?void 0:s[n]:A._$Cl;const r=Zn(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==r&&((o=i==null?void 0:i._$AO)==null||o.call(i,!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,A,n)),n!==void 0?(A._$Co??(A._$Co=[]))[n]=i:A._$Cl=i),i!==void 0&&(e=dn(t,i._$AS(t,e.values),i,n)),e}class Wb{constructor(e,A){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=A}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:A},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??xt).importNode(A,!0);Lt.currentNode=i;let r=Lt.nextNode(),s=0,o=0,a=n[0];for(;a!==void 0;){if(s===a.index){let c;a.type===2?c=new Jr(r,r.nextSibling,this,e):a.type===1?c=new a.ctor(r,a.name,a.strings,this,e):a.type===6&&(c=new Yb(r,this,e)),this._$AV.push(c),a=n[++o]}s!==(a==null?void 0:a.index)&&(r=Lt.nextNode(),s++)}return Lt.currentNode=xt,i}p(e){let A=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,A),A+=n.strings.length-2):n._$AI(e[A])),A++}}class Jr{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,A,n,i){this.type=2,this._$AH=me,this._$AN=void 0,this._$AA=e,this._$AB=A,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const A=this._$AM;return A!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=A.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,A=this){e=dn(this,e,A),Zn(e)?e===me||e==null||e===""?(this._$AH!==me&&this._$AR(),this._$AH=me):e!==this._$AH&&e!==Ai&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Gb(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==me&&Zn(this._$AH)?this._$AA.nextSibling.data=e:this.T(xt.createTextNode(e)),this._$AH=e}$(e){var r;const{values:A,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ti.createElement(Jh(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)==null?void 0:r._$AD)===i)this._$AH.p(A);else{const s=new Wb(i,this),o=s.u(this.options);s.p(A),this.T(o),this._$AH=s}}_$AC(e){let A=Wh.get(e.strings);return A===void 0&&Wh.set(e.strings,A=new ti(e)),A}k(e){Ea(this._$AH)||(this._$AH=[],this._$AR());const A=this._$AH;let n,i=0;for(const r of e)i===A.length?A.push(n=new Jr(this.O(Wr()),this.O(Wr()),this,this.options)):n=A[i],n._$AI(r),i++;i<A.length&&(this._$AR(n&&n._$AB.nextSibling,i),A.length=i)}_$AR(e=this._$AA.nextSibling,A){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,A);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var A;this._$AM===void 0&&(this._$Cv=e,(A=this._$AP)==null||A.call(this,e))}}class Xr{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,A,n,i,r){this.type=1,this._$AH=me,this._$AN=void 0,this.element=e,this.name=A,this._$AM=i,this.options=r,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=me}_$AI(e,A=this,n,i){const r=this.strings;let s=!1;if(r===void 0)e=dn(this,e,A,0),s=!Zn(e)||e!==this._$AH&&e!==Ai,s&&(this._$AH=e);else{const o=e;let a,c;for(e=r[0],a=0;a<r.length-1;a++)c=dn(this,o[n+a],A,a),c===Ai&&(c=this._$AH[a]),s||(s=!Zn(c)||c!==this._$AH[a]),c===me?e=me:e!==me&&(e+=(c??"")+r[a+1]),this._$AH[a]=c}s&&!i&&this.j(e)}j(e){e===me?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Jb extends Xr{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===me?void 0:e}}class Xb extends Xr{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==me)}}class $b extends Xr{constructor(e,A,n,i,r){super(e,A,n,i,r),this.type=5}_$AI(e,A=this){if((e=dn(this,e,A,0)??me)===Ai)return;const n=this._$AH,i=e===me&&n!==me||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,r=e!==me&&(n===me||i);i&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var A;typeof this._$AH=="function"?this._$AH.call(((A=this.options)==null?void 0:A.host)??this.element,e):this._$AH.handleEvent(e)}}class Yb{constructor(e,A,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=A,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){dn(this,e)}}const Ta=zn.litHtmlPolyfillSupport;Ta==null||Ta(ti,Jr),(zn.litHtmlVersions??(zn.litHtmlVersions=[])).push("3.3.0");/**
|
|
413
|
-
* @license
|
|
414
|
-
* Copyright 2020 Google LLC
|
|
415
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
416
|
-
*/const qb=t=>t.strings===void 0;/**
|
|
417
|
-
* @license
|
|
418
|
-
* Copyright 2017 Google LLC
|
|
419
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
420
|
-
*/const zb={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Zb=t=>(...e)=>({_$litDirective$:t,values:e});class eU{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,A,n){this._$Ct=e,this._$AM=A,this._$Ci=n}_$AS(e,A){return this.update(e,A)}update(e,A){return this.render(...A)}}/**
|
|
421
|
-
* @license
|
|
422
|
-
* Copyright 2017 Google LLC
|
|
423
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
424
|
-
*/const ni=(t,e)=>{var n;const A=t._$AN;if(A===void 0)return!1;for(const i of A)(n=i._$AO)==null||n.call(i,e,!1),ni(i,e);return!0},$r=t=>{let e,A;do{if((e=t._$AM)===void 0)break;A=e._$AN,A.delete(t),t=e}while((A==null?void 0:A.size)===0)},Xh=t=>{for(let e;e=t._$AM;t=e){let A=e._$AN;if(A===void 0)e._$AN=A=new Set;else if(A.has(t))break;A.add(t),nU(e)}};function AU(t){this._$AN!==void 0?($r(this),this._$AM=t,Xh(this)):this._$AM=t}function tU(t,e=!1,A=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(n))for(let r=A;r<n.length;r++)ni(n[r],!1),$r(n[r]);else n!=null&&(ni(n,!1),$r(n));else ni(this,t)}const nU=t=>{t.type==zb.CHILD&&(t._$AP??(t._$AP=tU),t._$AQ??(t._$AQ=AU))};class iU extends eU{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,A,n){super._$AT(e,A,n),Xh(this),this.isConnected=e._$AU}_$AO(e,A=!0){var n,i;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),A&&(ni(this,e),$r(this))}setValue(e){if(qb(this._$Ct))this._$Ct._$AI(e,this);else{const A=[...this._$Ct._$AH];A[this._$Ci]=e,this._$Ct._$AI(A,this,0)}}disconnected(){}reconnected(){}}/**
|
|
425
|
-
* @license
|
|
426
|
-
* Copyright 2020 Google LLC
|
|
427
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
428
|
-
*/const rU=()=>new sU;class sU{}const Fa=new WeakMap,oU=Zb(class extends iU{render(t){return me}update(t,[e]){var n;const A=e!==this.G;return A&&this.G!==void 0&&this.rt(void 0),(A||this.lt!==this.ct)&&(this.G=e,this.ht=(n=t.options)==null?void 0:n.host,this.rt(this.ct=t.element)),me}rt(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let A=Fa.get(e);A===void 0&&(A=new WeakMap,Fa.set(e,A)),A.get(this.G)!==void 0&&this.G.call(this.ht,void 0),A.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,e;return typeof this.G=="function"?(t=Fa.get(this.ht??globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var aU=Object.defineProperty,cU=Object.getOwnPropertyDescriptor,$h=(t,e,A,n)=>{for(var i=n>1?void 0:n?cU(e,A):e,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=(n?s(e,A,i):s(i))||i);return n&&i&&aU(e,A,i),i};class Yr extends _.LitElement{constructor(){super(...arguments),this.volume={speaker:"ASSISTANT",volume:0,spectrum:[]},this.canvasRef=rU(),this.barCount=8,this.animationFrame=null}connectedCallback(){super.connectedCallback(),this.startAnimation()}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){const e=()=>{this.drawEqualizer(),this.animationFrame=requestAnimationFrame(e)};this.animationFrame=requestAnimationFrame(e)}stopAnimation(){this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=null)}drawEqualizer(){const e=this.canvasRef.value;if(!e)return;const A=e.getContext("2d");if(!A)return;const n=window.devicePixelRatio||1,i=e.clientWidth,r=e.clientHeight;e.width=i*n,e.height=r*n,A.scale(n,n),A.clearRect(0,0,i,r);const s=3,o=Math.max(1,(i-(this.barCount-1)*s)/this.barCount),a=r/2,c=this.volume.speaker==="USER"?this.volume.volume:this.volume.volume,l=this.volume.speaker==="USER"?this.volume.spectrum:this.volume.spectrum;if(c===0)return;let u=[];if(l&&l.length>0){const d=l.length,h=Math.ceil(d/10);let g=[];for(let v=0;v<10;v++){const C=v*h,w=Math.min((v+1)*h,d);let Q=0;for(let F=C;F<w;F++)Q+=l[F]||0;g.push({region:v,startIdx:C,endIdx:w,energy:Q})}g.sort((v,C)=>C.energy-v.energy);const f=g.slice(0,3),p=Math.min(...f.map(v=>v.startIdx)),B=Math.max(...f.map(v=>v.endIdx));if(B>p)for(let v=0;v<this.barCount;v++){const C=p+v/(this.barCount-1)*(B-p),w=Math.min(d-1,Math.floor(C));u[v]=l[w]||0}else for(let v=0;v<this.barCount;v++){const C=v/(this.barCount-1)*(d/2),w=Math.min(d-1,Math.floor(C));u[v]=l[w]||0}const y=Math.max(...u,1),b=this.volume.speaker==="USER"?.7:.6;u=u.map((v,C)=>{const w=v/y,Q=b+C/(this.barCount-1)*.3;return Math.min(1,w*Q)})}else if(this.volume.speaker!=="USER")for(let d=0;d<this.barCount;d++){const h=Date.now()*.002,g=.3+.2*Math.sin(h+d*.7);u[d]=g}for(let d=0;d<this.barCount;d++){const h=u.length>0&&u[d]!==void 0?u[d]:c;if(this.volume.speaker==="USER"){const B=Math.floor((h*.5+.5)*255).toString(16).padStart(2,"0");A.fillStyle=`var(--obi-primary)${B}`}else{const B=Math.floor((h*.5+.5)*255).toString(16).padStart(2,"0");A.fillStyle=`#FFFFFF${B}`}const g=Math.max(2,h*.8*a),f=i-(this.barCount-d)*(o+s),p=o/2;A.beginPath(),A.moveTo(f+p,r/2-g),A.lineTo(f+o-p,r/2-g),A.quadraticCurveTo(f+o,r/2-g,f+o,r/2-g+p),A.lineTo(f+o,r/2),A.lineTo(f,r/2),A.lineTo(f,r/2-g+p),A.quadraticCurveTo(f,r/2-g,f+p,r/2-g),A.fill(),A.beginPath(),A.moveTo(f,r/2),A.lineTo(f+o,r/2),A.lineTo(f+o,r/2+g-p),A.quadraticCurveTo(f+o,r/2+g,f+o-p,r/2+g),A.lineTo(f+p,r/2+g),A.quadraticCurveTo(f,r/2+g,f,r/2+g-p),A.lineTo(f,r/2),A.fill()}}render(){return _.html` <canvas ${oU(this.canvasRef)} width="52" height="52"></canvas> `}}Yr.styles=_.css`
|
|
342
|
+
`,kg([ng({type:Array})],Tg.prototype,"courses",2),kg([ng({type:Boolean})],Tg.prototype,"loading",2),kg([ng({type:String})],Tg.prototype,"error",2),kg([ng({type:String})],Tg.prototype,"apiKey",2),kg([ng({type:Function})],Tg.prototype,"onCourseSelect",2),kg([ng({type:Function})],Tg.prototype,"onClose",2),kg([sg()],Tg.prototype,"apiBaseUrl",2),customElements.get("obi-course-modal")||customElements.define("obi-course-modal",Tg);const Sg=globalThis,Kg=Sg.trustedTypes,Og=Kg?Kg.createPolicy("lit-html",{createHTML:A=>A}):void 0,Dg="$lit$",Mg=`lit$${Math.random().toFixed(9).slice(2)}$`,Lg="?"+Mg,Rg=`<${Lg}>`,Ng=document,Gg=()=>Ng.createComment(""),xg=A=>null===A||"object"!=typeof A&&"function"!=typeof A,Vg=Array.isArray,jg="[ \t\n\f\r]",Pg=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_g=/-->/g,Jg=/>/g,Xg=RegExp(`>|${jg}(?:([^\\s"'>=/]+)(${jg}*=${jg}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Yg=/'/g,Zg=/"/g,Wg=/^(?:script|style|textarea|title)$/i,qg=Symbol.for("lit-noChange"),zg=Symbol.for("lit-nothing"),$g=new WeakMap,AQ=Ng.createTreeWalker(Ng,129);function tQ(A,t){if(!Vg(A)||!A.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Og?Og.createHTML(t):t}class eQ{constructor({strings:A,it:t},e){let i;this.parts=[];let n=0,s=0;const r=A.length-1,o=this.parts,[a,c]=((A,t)=>{const e=A.length-1,i=[];let n,s=2===t?"<svg>":3===t?"<math>":"",r=Pg;for(let o=0;o<e;o++){const t=A[o];let e,a,c=-1,h=0;for(;h<t.length&&(r.lastIndex=h,a=r.exec(t),null!==a);)h=r.lastIndex,r===Pg?"!--"===a[1]?r=_g:void 0!==a[1]?r=Jg:void 0!==a[2]?(Wg.test(a[2])&&(n=RegExp("</"+a[2],"g")),r=Xg):void 0!==a[3]&&(r=Xg):r===Xg?">"===a[0]?(r=n??Pg,c=-1):void 0===a[1]?c=-2:(c=r.lastIndex-a[2].length,e=a[1],r=void 0===a[3]?Xg:'"'===a[3]?Zg:Yg):r===Zg||r===Yg?r=Xg:r===_g||r===Jg?r=Pg:(r=Xg,n=void 0);const u=r===Xg&&A[o+1].startsWith("/>")?" ":"";s+=r===Pg?t+Rg:c>=0?(i.push(e),t.slice(0,c)+Dg+t.slice(c)+Mg+u):t+Mg+(-2===c?o:u)}return[tQ(A,s+(A[e]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]})(A,t);if(this.el=eQ.createElement(a,e),AQ.currentNode=this.el.content,2===t||3===t){const A=this.el.content.firstChild;A.replaceWith(...A.childNodes)}for(;null!==(i=AQ.nextNode())&&o.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const A of i.getAttributeNames())if(A.endsWith(Dg)){const t=c[s++],e=i.getAttribute(A).split(Mg),r=/([.?@])?(.*)/.exec(t);o.push({type:1,index:n,name:r[2],strings:e,ctor:"."===r[1]?oQ:"?"===r[1]?aQ:"@"===r[1]?cQ:rQ}),i.removeAttribute(A)}else A.startsWith(Mg)&&(o.push({type:6,index:n}),i.removeAttribute(A));if(Wg.test(i.tagName)){const A=i.textContent.split(Mg),t=A.length-1;if(t>0){i.textContent=Kg?Kg.emptyScript:"";for(let e=0;e<t;e++)i.append(A[e],Gg()),AQ.nextNode(),o.push({type:2,index:++n});i.append(A[t],Gg())}}}else if(8===i.nodeType)if(i.data===Lg)o.push({type:2,index:n});else{let A=-1;for(;-1!==(A=i.data.indexOf(Mg,A+1));)o.push({type:7,index:n}),A+=Mg.length-1}n++}}static createElement(A,t){const e=Ng.createElement("template");return e.innerHTML=A,e}}function iQ(A,t,e=A,i){if(t===qg)return t;let n=void 0!==i?e.nt?.[i]:e.st;const s=xg(t)?void 0:t.ot;return n?.constructor!==s&&(n?.ut?.(!1),void 0===s?n=void 0:(n=new s(A),n.dt(A,e,i)),void 0!==i?(e.nt??(e.nt=[]))[i]=n:e.st=n),void 0!==n&&(t=iQ(A,n.Bt(A,t.values),n,i)),t}class nQ{constructor(A,t){this.wt=[],this.ft=void 0,this.Qt=A,this.vt=t}get parentNode(){return this.vt.parentNode}get Ut(){return this.vt.Ut}u(A){const{el:{content:t},parts:e}=this.Qt,i=(A?.creationScope??Ng).importNode(t,!0);AQ.currentNode=i;let n=AQ.nextNode(),s=0,r=0,o=e[0];for(;void 0!==o;){if(s===o.index){let t;2===o.type?t=new sQ(n,n.nextSibling,this,A):1===o.type?t=new o.ctor(n,o.name,o.strings,this,A):6===o.type&&(t=new hQ(n,this,A)),this.wt.push(t),o=e[++r]}s!==o?.index&&(n=AQ.nextNode(),s++)}return AQ.currentNode=Ng,i}p(A){let t=0;for(const e of this.wt)void 0!==e&&(void 0!==e.strings?(e.Ct(A,e,t),t+=e.strings.length-2):e.Ct(A[t])),t++}}class sQ{get Ut(){return this.vt?.Ut??this.Ft}constructor(A,t,e,i){this.type=2,this.yt=zg,this.ft=void 0,this.bt=A,this.Et=t,this.vt=e,this.options=i,this.Ft=i?.isConnected??!0}get parentNode(){let A=this.bt.parentNode;const t=this.vt;return void 0!==t&&11===A?.nodeType&&(A=t.parentNode),A}get startNode(){return this.bt}get endNode(){return this.Et}Ct(A,t=this){A=iQ(this,A,t),xg(A)?A===zg||null==A||""===A?(this.yt!==zg&&this.Ht(),this.yt=zg):A!==this.yt&&A!==qg&&this.EA(A):void 0!==A.it?this.$(A):void 0!==A.nodeType?this.T(A):(A=>Vg(A)||"function"==typeof A?.[Symbol.iterator])(A)?this.k(A):this.EA(A)}O(A){return this.bt.parentNode.insertBefore(A,this.Et)}T(A){this.yt!==A&&(this.Ht(),this.yt=this.O(A))}EA(A){this.yt!==zg&&xg(this.yt)?this.bt.nextSibling.data=A:this.T(Ng.createTextNode(A)),this.yt=A}$(A){const{values:t,it:e}=A,i="number"==typeof e?this.It(A):(void 0===e.el&&(e.el=eQ.createElement(tQ(e.h,e.h[0]),this.options)),e);if(this.yt?.Qt===i)this.yt.p(t);else{const A=new nQ(i,this),e=A.u(this.options);A.p(t),this.T(e),this.yt=A}}It(A){let t=$g.get(A.strings);return void 0===t&&$g.set(A.strings,t=new eQ(A)),t}k(A){Vg(this.yt)||(this.yt=[],this.Ht());const t=this.yt;let e,i=0;for(const n of A)i===t.length?t.push(e=new sQ(this.O(Gg()),this.O(Gg()),this,this.options)):e=t[i],e.Ct(n),i++;i<t.length&&(this.Ht(e&&e.Et.nextSibling,i),t.length=i)}Ht(A=this.bt.nextSibling,t){for(this.kt?.(!1,!0,t);A&&A!==this.Et;){const t=A.nextSibling;A.remove(),A=t}}setConnected(A){void 0===this.vt&&(this.Ft=A,this.kt?.(A))}}class rQ{get tagName(){return this.element.tagName}get Ut(){return this.vt.Ut}constructor(A,t,e,i,n){this.type=1,this.yt=zg,this.ft=void 0,this.element=A,this.name=t,this.vt=i,this.options=n,e.length>2||""!==e[0]||""!==e[1]?(this.yt=Array(e.length-1).fill(new String),this.strings=e):this.yt=zg}Ct(A,t=this,e,i){const n=this.strings;let s=!1;if(void 0===n)A=iQ(this,A,t,0),s=!xg(A)||A!==this.yt&&A!==qg,s&&(this.yt=A);else{const i=A;let r,o;for(A=n[0],r=0;r<n.length-1;r++)o=iQ(this,i[e+r],t,r),o===qg&&(o=this.yt[r]),s||(s=!xg(o)||o!==this.yt[r]),o===zg?A=zg:A!==zg&&(A+=(o??"")+n[r+1]),this.yt[r]=o}s&&!i&&this.j(A)}j(A){A===zg?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,A??"")}}class oQ extends rQ{constructor(){super(...arguments),this.type=3}j(A){this.element[this.name]=A===zg?void 0:A}}class aQ extends rQ{constructor(){super(...arguments),this.type=4}j(A){this.element.toggleAttribute(this.name,!!A&&A!==zg)}}class cQ extends rQ{constructor(A,t,e,i,n){super(A,t,e,i,n),this.type=5}Ct(A,t=this){if((A=iQ(this,A,t,0)??zg)===qg)return;const e=this.yt,i=A===zg&&e!==zg||A.capture!==e.capture||A.once!==e.once||A.passive!==e.passive,n=A!==zg&&(e===zg||i);i&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,A),this.yt=A}handleEvent(A){"function"==typeof this.yt?this.yt.call(this.options?.host??this.element,A):this.yt.handleEvent(A)}}class hQ{constructor(A,t,e){this.element=A,this.type=6,this.ft=void 0,this.vt=t,this.options=e}get Ut(){return this.vt.Ut}Ct(A){iQ(this,A)}}const uQ=Sg.litHtmlPolyfillSupport;uQ?.(eQ,sQ),(Sg.litHtmlVersions??(Sg.litHtmlVersions=[])).push("3.3.0");class lQ{constructor(A){}get Ut(){return this.vt.Ut}dt(A,t,e){this.Tt=A,this.vt=t,this.St=e}Bt(A,t){return this.update(A,t)}update(A,t){return this.render(...t)}}const dQ=(A,t)=>{const e=A.ft;if(void 0===e)return!1;for(const i of e)i.ut?.(t,!1),dQ(i,t);return!0},BQ=A=>{let t,e;do{if(void 0===(t=A.vt))break;e=t.ft,e.delete(A),A=t}while(0===e?.size)},wQ=A=>{for(let t;t=A.vt;A=t){let e=t.ft;if(void 0===e)t.ft=e=new Set;else if(e.has(A))break;e.add(A),QQ(t)}};function fQ(A){void 0!==this.ft?(BQ(this),this.vt=A,wQ(this)):this.vt=A}function gQ(A,t=!1,e=0){const i=this.yt,n=this.ft;if(void 0!==n&&0!==n.size)if(t)if(Array.isArray(i))for(let s=e;s<i.length;s++)dQ(i[s],!1),BQ(i[s]);else null!=i&&(dQ(i,!1),BQ(i));else dQ(this,A)}const QQ=A=>{2==A.type&&(A.kt??(A.kt=gQ),A.Kt??(A.Kt=fQ))};class vQ extends lQ{constructor(){super(...arguments),this.ft=void 0}dt(A,t,e){super.dt(A,t,e),wQ(this),this.isConnected=A.Ut}ut(A,t=!0){A!==this.isConnected&&(this.isConnected=A,A?this.reconnected?.():this.disconnected?.()),t&&(dQ(this,A),BQ(this))}setValue(A){if(void 0===this.Tt.strings)this.Tt.Ct(A,this);else{const t=[...this.Tt.yt];t[this.St]=A,this.Tt.Ct(t,this,0)}}disconnected(){}reconnected(){}}class mQ{}const pQ=new WeakMap,UQ=(CQ=class extends vQ{render(A){return zg}update(A,[t]){const e=t!==this.G;return e&&void 0!==this.G&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=A.options?.host,this.rt(this.ct=A.element)),zg}rt(A){if(this.isConnected||(A=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let e=pQ.get(t);void 0===e&&(e=new WeakMap,pQ.set(t,e)),void 0!==e.get(this.G)&&this.G.call(this.ht,void 0),e.set(this.G,A),void 0!==A&&this.G.call(this.ht,A)}else this.G.value=A}get lt(){return"function"==typeof this.G?pQ.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}},(...A)=>({ot:CQ,values:A}));var CQ,FQ=Object.defineProperty,yQ=Object.getOwnPropertyDescriptor,bQ=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?yQ(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&FQ(t,e,s),s};class EQ extends t.LitElement{constructor(){super(...arguments),this.volume={speaker:"ASSISTANT",volume:0,spectrum:[]},this.canvasRef=new mQ,this.barCount=8,this.animationFrame=null}connectedCallback(){super.connectedCallback(),this.startAnimation()}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){const A=()=>{this.drawEqualizer(),this.animationFrame=requestAnimationFrame(A)};this.animationFrame=requestAnimationFrame(A)}stopAnimation(){this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=null)}drawEqualizer(){const A=this.canvasRef.value;if(!A)return;const t=A.getContext("2d");if(!t)return;const e=window.devicePixelRatio||1,i=A.clientWidth,n=A.clientHeight;A.width=i*e,A.height=n*e,t.scale(e,e),t.clearRect(0,0,i,n);const s=Math.max(1,(i-3*(this.barCount-1))/this.barCount),r=n/2,o=(this.volume.speaker,this.volume.volume),a=(this.volume.speaker,this.volume.spectrum);if(0===o)return;let c=[];if(a&&a.length>0){const A=a.length,t=Math.ceil(A/10);let e=[];for(let c=0;c<10;c++){const i=c*t,n=Math.min((c+1)*t,A);let s=0;for(let A=i;A<n;A++)s+=a[A]||0;e.push({region:c,startIdx:i,endIdx:n,energy:s})}e.sort(((A,t)=>t.energy-A.energy));const i=e.slice(0,3),n=Math.min(...i.map((A=>A.startIdx))),s=Math.max(...i.map((A=>A.endIdx)));if(s>n)for(let h=0;h<this.barCount;h++){const t=n+h/(this.barCount-1)*(s-n),e=Math.min(A-1,Math.floor(t));c[h]=a[e]||0}else for(let h=0;h<this.barCount;h++){const t=h/(this.barCount-1)*(A/2),e=Math.min(A-1,Math.floor(t));c[h]=a[e]||0}const r=Math.max(...c,1),o="USER"===this.volume.speaker?.7:.6;c=c.map(((A,t)=>{const e=A/r,i=o+t/(this.barCount-1)*.3;return Math.min(1,e*i)}))}else if("USER"!==this.volume.speaker)for(let h=0;h<this.barCount;h++){const A=.002*Date.now(),t=.3+.2*Math.sin(A+.7*h);c[h]=t}for(let h=0;h<this.barCount;h++){const A=c.length>0&&void 0!==c[h]?c[h]:o;if("USER"===this.volume.speaker){const e=Math.floor(255*(.5*A+.5)).toString(16).padStart(2,"0");t.fillStyle=`var(--obi-primary)${e}`}else{const e=Math.floor(255*(.5*A+.5)).toString(16).padStart(2,"0");t.fillStyle=`#FFFFFF${e}`}const e=Math.max(2,.8*A*r),a=i-(this.barCount-h)*(s+3),u=s/2;t.beginPath(),t.moveTo(a+u,n/2-e),t.lineTo(a+s-u,n/2-e),t.quadraticCurveTo(a+s,n/2-e,a+s,n/2-e+u),t.lineTo(a+s,n/2),t.lineTo(a,n/2),t.lineTo(a,n/2-e+u),t.quadraticCurveTo(a,n/2-e,a+u,n/2-e),t.fill(),t.beginPath(),t.moveTo(a,n/2),t.lineTo(a+s,n/2),t.lineTo(a+s,n/2+e-u),t.quadraticCurveTo(a+s,n/2+e,a+s-u,n/2+e),t.lineTo(a+u,n/2+e),t.quadraticCurveTo(a,n/2+e,a,n/2+e-u),t.lineTo(a,n/2),t.fill()}}render(){return t.html` <canvas ${UQ(this.canvasRef)} width="52" height="52"></canvas> `}}EQ.styles=t.css`
|
|
429
343
|
:host {
|
|
430
344
|
display: block;
|
|
431
345
|
width: 40px;
|
|
@@ -437,16 +351,16 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
437
351
|
width: 100%;
|
|
438
352
|
height: 100%;
|
|
439
353
|
}
|
|
440
|
-
|
|
354
|
+
`,bQ([ng({type:Object})],EQ.prototype,"volume",2),bQ([sg()],EQ.prototype,"canvasRef",2),customElements.get("obi-audio-equalizer")||customElements.define("obi-audio-equalizer",EQ);var HQ=Object.defineProperty;Object.getOwnPropertyDescriptor;class IQ extends t.LitElement{constructor(){super(...arguments),this.activeDots=Array(5).fill(!1),this.numDots=5,this.containerWidth=32,this.dotSize=2,this.bounceHeight=12,this.animationDuration=200,this.pauseDuration=300,this.overlapFactor=.7,this.color="#FFF",this.timeoutIds=[]}connectedCallback(){super.connectedCallback(),this.startAnimation(),this.style.setProperty("--dot-loader-width",`${this.containerWidth}px`),this.style.setProperty("--dot-size",`${this.dotSize}px`),this.style.setProperty("--dot-color",this.color)}disconnectedCallback(){super.disconnectedCallback(),this.stopAnimation()}startAnimation(){this.animateSequence()}stopAnimation(){this.timeoutIds.forEach((A=>window.clearTimeout(A))),this.timeoutIds=[]}animateSequence(){this.activeDots=Array(this.numDots).fill(!1);for(let t=0;t<this.numDots;t++){const A=t*(this.animationDuration*this.overlapFactor),e=window.setTimeout((()=>{this.activeDots=[...this.activeDots],this.activeDots[t]=!0;const A=window.setTimeout((()=>{this.activeDots=[...this.activeDots],this.activeDots[t]=!1}),this.animationDuration);this.timeoutIds.push(A)}),A);this.timeoutIds.push(e)}const A=window.setTimeout((()=>{this.animateSequence()}),this.numDots*this.animationDuration*this.overlapFactor+this.pauseDuration);this.timeoutIds.push(A)}render(){return t.html`
|
|
441
355
|
<div class="dot-loader">
|
|
442
|
-
${this.activeDots.map(
|
|
356
|
+
${this.activeDots.map((A=>t.html`
|
|
443
357
|
<div
|
|
444
358
|
class="dot"
|
|
445
|
-
style="transform: ${
|
|
359
|
+
style="transform: ${A?`translateY(-${this.bounceHeight}px)`:"translateY(0)"}"
|
|
446
360
|
></div>
|
|
447
|
-
`)}
|
|
361
|
+
`))}
|
|
448
362
|
</div>
|
|
449
|
-
`}}
|
|
363
|
+
`}}IQ.styles=t.css`
|
|
450
364
|
:host {
|
|
451
365
|
display: block;
|
|
452
366
|
}
|
|
@@ -473,10 +387,10 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
473
387
|
transition: transform 0.2s ease-in-out;
|
|
474
388
|
opacity: 1;
|
|
475
389
|
}
|
|
476
|
-
`,
|
|
390
|
+
`,((A,t,e)=>{for(var i,n=void 0,s=A.length-1;s>=0;s--)(i=A[s])&&(n=i(t,e,n)||n);n&&HQ(t,e,n)})([sg()],IQ.prototype,"activeDots"),customElements.get("obi-dot-loader")||customElements.define("obi-dot-loader",IQ);class kQ extends t.LitElement{render(){return t.html`
|
|
477
391
|
<obi-dot-loader loading style="margin-left: 2px"></obi-dot-loader>
|
|
478
392
|
<span class="text">Searching the knowledge base</span>
|
|
479
|
-
`}}
|
|
393
|
+
`}}kQ.styles=t.css`
|
|
480
394
|
:host {
|
|
481
395
|
display: flex;
|
|
482
396
|
align-items: center;
|
|
@@ -491,29 +405,29 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
491
405
|
font-weight: 500;
|
|
492
406
|
font-size: 14px;
|
|
493
407
|
}
|
|
494
|
-
`,customElements.get("obi-searching-loader")||customElements.define("obi-searching-loader",
|
|
408
|
+
`,customElements.get("obi-searching-loader")||customElements.define("obi-searching-loader",kQ);var TQ=Object.defineProperty,SQ=Object.getOwnPropertyDescriptor,KQ=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?SQ(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&TQ(t,e,s),s};const OQ="49206C6F7665204F6269_session";class DQ extends t.LitElement{constructor(){super(),this.apiKey="",this.isActive=!0,this.position="bottom-right",this.user=null,this.state=Ka.READY,this.storedActiveState=void 0,this.showCourseModal=!1,this.isHovering=!1,this.navVisible=!1,this.activeSession=null,this.volume={speaker:"ASSISTANT",volume:0,spectrum:[]},this.sessionToken=null,this.roomToken=null,this.roomUrl=null,this.boundSaveSessionData=null,this.closeNavTimeoutRef=null;const A=()=>{this.activeSession&&this.sessionToken&&this.roomToken&&this.roomUrl&&this.saveSessionData()};window.addEventListener("beforeunload",A),window.addEventListener("pagehide",A)}updateFromConfig(){window.obiWidgetConfig&&(this.apiKey=window.obiWidgetConfig.apiKey||this.apiKey,this.position=window.obiWidgetConfig.position||this.position,this.user=window.obiWidgetConfig.user||this.user,void 0!==window.obiWidgetConfig.isActive&&(this.isActive=window.obiWidgetConfig.isActive),this.style.setProperty("--obi-primary",window.obiWidgetConfig?.primaryColor||"#9500ff"),this.style.setProperty("--obi-secondary",window.obiWidgetConfig?.secondaryColor||"#c4b5fd"))}removeSessionFromUrl(){const A=new URL(window.location.href);A.searchParams.delete(OQ),window.history.replaceState({},"",A.toString())}async connectObi(A){if(this.activeSession)console.log("Connection already exists");else try{const t=new Da({sessionId:A,apiBaseUrl:e});if(!t)return console.error("Failed to create session"),this.state=Ka.ERROR,this.activeSession=null,void this.removeSessionFromUrl();t.on("stateChanged",(A=>{this.state=A,A!==Ka.READY&&(this.storedActiveState=A)})),t.on("volume",(({speaker:A,spectrum:t,volume:e})=>{this.volume={speaker:A,spectrum:t,volume:e}})),t.on("screenCaptureRequested",(async()=>{try{const e=(await(A=document.documentElement,t={useCORS:!0,allowTaint:!0,foreignObjectRendering:!0},void 0===t&&(t={}),function(A,t){return Na(void 0,void 0,void 0,(function(){var e,i,n,s,r,o,a,c,h,u,l,d,B,w,f,g,Q,v,m,p,U,C,F,y,b,E,H,I,k,T,S,K,O,D,M,L,R,N;return Ga(this,(function(G){switch(G.label){case 0:if(!A||"object"!=typeof A)return[2,Promise.reject("Invalid element provided as first argument")];if(!(e=A.ownerDocument))throw new Error("Element is not attached to a Document");if(!(i=e.defaultView))throw new Error("Document is not attached to a Window");return n={allowTaint:null!==(C=t.allowTaint)&&void 0!==C&&C,imageTimeout:null!==(F=t.imageTimeout)&&void 0!==F?F:15e3,proxy:t.proxy,useCORS:null!==(y=t.useCORS)&&void 0!==y&&y,customIsSameOrigin:t.customIsSameOrigin},s=Ra({logging:null===(b=t.logging)||void 0===b||b,cache:t.cache},n),r={windowWidth:null!==(E=t.windowWidth)&&void 0!==E?E:i.innerWidth,windowHeight:null!==(H=t.windowHeight)&&void 0!==H?H:i.innerHeight,scrollX:null!==(I=t.scrollX)&&void 0!==I?I:i.pageXOffset,scrollY:null!==(k=t.scrollY)&&void 0!==k?k:i.pageYOffset},o=new Va(r.scrollX,r.scrollY,r.windowWidth,r.windowHeight),a=new Of(s,o),c=null!==(T=t.foreignObjectRendering)&&void 0!==T&&T,h={allowTaint:null!==(S=t.allowTaint)&&void 0!==S&&S,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:c,copyStyles:c},a.logger.debug("Starting document clone with size ".concat(o.width,"x").concat(o.height," scrolled to ").concat(-o.left,",").concat(-o.top)),u=new vw(a,A,h),(l=u.clonedReferenceElement)?[4,u.toIFrame(e,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return d=G.sent(),B=XB(l)||"HTML"===l.tagName?function(A){var t=A.body,e=A.documentElement;if(!t||!e)throw new Error("Unable to get document size");var i=Math.max(Math.max(t.scrollWidth,e.scrollWidth),Math.max(t.offsetWidth,e.offsetWidth),Math.max(t.clientWidth,e.clientWidth)),n=Math.max(Math.max(t.scrollHeight,e.scrollHeight),Math.max(t.offsetHeight,e.offsetHeight),Math.max(t.clientHeight,e.clientHeight));return new Va(0,0,i,n)}(l.ownerDocument):ja(a,l),w=B.width,f=B.height,g=B.left,Q=B.top,v=function(A,t,e){var i=t.ownerDocument,n=i.documentElement?Mu(A,getComputedStyle(i.documentElement).backgroundColor):Lu.TRANSPARENT,s=i.body?Mu(A,getComputedStyle(i.body).backgroundColor):Lu.TRANSPARENT,r="string"==typeof e?Mu(A,e):null===e?Lu.TRANSPARENT:4294967295;return t===i.documentElement?Au(n)?Au(s)?r:s:n:r}(a,l,t.backgroundColor),m={canvas:t.canvas,backgroundColor:v,scale:null!==(O=null!==(K=t.scale)&&void 0!==K?K:i.devicePixelRatio)&&void 0!==O?O:1,x:(null!==(D=t.x)&&void 0!==D?D:0)+g,y:(null!==(M=t.y)&&void 0!==M?M:0)+Q,width:null!==(L=t.width)&&void 0!==L?L:Math.ceil(w),height:null!==(R=t.height)&&void 0!==R?R:Math.ceil(f)},c?(a.logger.debug("Document cloned, using foreign object rendering"),[4,new Tf(a,m).render(l)]):[3,3];case 2:return p=G.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at ".concat(g,",").concat(Q," with size ").concat(w,"x").concat(f," using computed rendering")),a.logger.debug("Starting DOM parsing"),U=MB(a,l),v===U.styles.backgroundColor&&(U.styles.backgroundColor=Lu.TRANSPARENT),a.logger.debug("Starting renderer for element at ".concat(m.x,",").concat(m.y," with size ").concat(m.width,"x").concat(m.height)),[4,new yf(a,m).render(U)];case 4:p=G.sent(),G.label=5;case 5:return(null===(N=t.removeContainer)||void 0===N||N)&&(vw.destroy(d)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,p]}}))}))}(A,t))).toDataURL("image/png");this.activeSession.emit("screenCaptureComplete",e)}catch(e){console.error("[obi] error capturing screen:",e),this.activeSession.emit("screenCaptureComplete","error")}var A,t})),t.on("error",(A=>{console.error("Session error:",A),this.state=Ka.ERROR,this.activeSession=null,this.removeSessionFromUrl()}));const i=await t.connect();i&&(this.sessionToken=A,this.roomToken=i.token,this.roomUrl=i.url,this.removeSessionFromUrl()),this.activeSession=t}catch(t){console.error("Failed to start session:",t),this.state=Ka.ERROR,this.activeSession=null,this.removeSessionFromUrl()}}async handleSessionStart(A){this.activeSession?console.log("Connection already in progress or active session exists"):(this.showCourseModal=!1,this.state=Ka.LOADING,await this.connectObi(A))}async checkExistingSession(){try{const A=JSON.parse(og.getItem(rg)||"{}"),{sessionToken:t,roomToken:i,roomUrl:n,sessionExpiry:s,obiState:r}=A;if(!t||!i||!n)return;if(s&&new Date(s)<new Date)return void this.clearSessionStorage();this.state=Ka.LOADING;const o=new Da({sessionId:t,apiBaseUrl:e});if(!o)return console.error("Failed to create session"),this.state=Ka.ERROR,void this.clearSessionStorage();o.on("stateChanged",(A=>{this.state=A,A!==Ka.READY&&(this.storedActiveState=A)})),o.on("volume",(({speaker:A,spectrum:t,volume:e})=>{this.volume={speaker:A,spectrum:t,volume:e}})),o.on("error",(A=>{console.error("Session error:",A),this.state=Ka.ERROR,this.activeSession=null,this.clearSessionStorage()})),await o.reconnect(n,i,r)?(this.activeSession=o,this.sessionToken=t,this.roomToken=i,this.roomUrl=n,this.state=r,this.storedActiveState=r):this.clearSessionStorage()}catch(A){console.error("Error reconnecting to session:",A),this.state=Ka.ERROR,this.clearSessionStorage()}}clearSessionStorage(){og.removeItem(rg)}saveSessionData(){if(this.activeSession&&this.sessionToken&&this.roomToken&&this.roomUrl){const A=new Date;A.setMinutes(A.getMinutes()+5);const t={sessionToken:this.sessionToken,roomToken:this.roomToken,roomUrl:this.roomUrl,obiState:this.storedActiveState??this.state,sessionExpiry:A.toISOString()};og.setItem(rg,JSON.stringify(t))}}async sessionConnectionCheck(){if(await this.checkExistingSession(),!this.activeSession){const A=new URLSearchParams(window.location.search).get(OQ);A&&this.handleSessionStart(A)}}connectedCallback(){super.connectedCallback(),this.updateFromConfig(),this.setAttribute("position",this.position),this.boundSaveSessionData=this.saveSessionData.bind(this),window.addEventListener("beforeunload",this.boundSaveSessionData),window.addEventListener("pagehide",this.boundSaveSessionData),this.sessionConnectionCheck()}disconnectedCallback(){null!==this.closeNavTimeoutRef&&window.clearTimeout(this.closeNavTimeoutRef),this.boundSaveSessionData&&(window.removeEventListener("beforeunload",this.boundSaveSessionData),window.removeEventListener("pagehide",this.boundSaveSessionData)),this.removeSessionFromUrl(),super.disconnectedCallback()}handleMouseEnter(){this.isHovering=!0,this.navVisible=!0}handleMouseLeave(){this.isHovering=!1,null!==this.closeNavTimeoutRef&&window.clearTimeout(this.closeNavTimeoutRef),this.closeNavTimeoutRef=window.setTimeout((()=>{this.isHovering||(this.navVisible=!1),this.closeNavTimeoutRef=null}),300)}terminateSession(){this.clearSessionStorage(),this.sessionToken=null,this.roomToken=null,this.roomUrl=null,this.activeSession&&(this.activeSession.disconnect(),this.activeSession=null),this.state=Ka.READY}handleItemSelect(A,t){"experiences"!==A?ka([A,t]).with(["pause",!0],(()=>{this.activeSession?.pauseRecording()})).with(["pause",!1],(()=>{this.activeSession?.resumeRecording()})).with(["activate",!1],(()=>{this.terminateSession()})).otherwise((()=>{})):this.showCourseModal=!0}render(){if(!this.isActive)return t.nothing;const A=ka(this.state).with(Ka.LOADING,(()=>t.html`<obi-dot-loader></obi-dot-loader>`)).with(Ka.RESEARCHING,(()=>t.html`<obi-searching-loader></obi-searching-loader>`)).with(Ea.union(Ka.USER_SPEAKING,Ka.AGENT_SPEAKING),(()=>t.html`<obi-audio-equalizer .volume=${this.volume}></obi-audio-equalizer>`)).with(Ka.PAUSED,(()=>Qg)).otherwise((()=>Qg));return t.html`
|
|
495
409
|
<div
|
|
496
|
-
class="widget-container ${this.state===
|
|
410
|
+
class="widget-container ${this.state===Ka.USER_SPEAKING||this.state===Ka.AGENT_SPEAKING?"pulse":""} ${this.state!==Ka.READY||this.navVisible?"rounded":""} ${this.state===Ka.RESEARCHING?"researching":""} ${this.state===Ka.USER_SPEAKING?"user-speaking":""}"
|
|
497
411
|
@mouseenter=${this.handleMouseEnter}
|
|
498
412
|
@mouseleave=${this.handleMouseLeave}
|
|
499
413
|
>
|
|
500
|
-
${
|
|
501
|
-
${this.navVisible&&this.state!==
|
|
414
|
+
${A}
|
|
415
|
+
${this.navVisible&&this.state!==Ka.RESEARCHING?t.html`
|
|
502
416
|
<obi-navigation-bar
|
|
503
|
-
?isActive=${this.state!==
|
|
417
|
+
?isActive=${this.state!==Ka.READY}
|
|
504
418
|
.position=${this.position}
|
|
505
419
|
data-direction="up"
|
|
506
420
|
.currentState=${this.state}
|
|
507
421
|
.onItemSelect=${this.handleItemSelect.bind(this)}
|
|
508
422
|
></obi-navigation-bar>
|
|
509
|
-
`:
|
|
423
|
+
`:t.nothing}
|
|
510
424
|
</div>
|
|
511
|
-
${this.showCourseModal?
|
|
425
|
+
${this.showCourseModal?t.html`<obi-course-modal
|
|
512
426
|
.onClose=${()=>this.showCourseModal=!1}
|
|
513
427
|
.onCourseSelect=${this.handleSessionStart.bind(this)}
|
|
514
428
|
.apiKey=${this.apiKey}
|
|
515
|
-
></obi-course-modal>`:
|
|
516
|
-
`}}
|
|
429
|
+
></obi-course-modal>`:t.nothing}
|
|
430
|
+
`}}DQ.styles=t.css`
|
|
517
431
|
:host {
|
|
518
432
|
display: block;
|
|
519
433
|
position: fixed;
|
|
@@ -644,4 +558,4 @@ a=extmap-allow-mixed`)!==-1){const r=i.sdp.split(`
|
|
|
644
558
|
.pulse {
|
|
645
559
|
animation: pulse-shadow 2s ease-in-out infinite;
|
|
646
560
|
}
|
|
647
|
-
`,
|
|
561
|
+
`,KQ([sg()],DQ.prototype,"apiKey",2),KQ([sg()],DQ.prototype,"isActive",2),KQ([sg()],DQ.prototype,"position",2),KQ([sg()],DQ.prototype,"user",2),KQ([sg()],DQ.prototype,"state",2),KQ([sg()],DQ.prototype,"storedActiveState",2),KQ([sg()],DQ.prototype,"showCourseModal",2),KQ([sg()],DQ.prototype,"isHovering",2),KQ([sg()],DQ.prototype,"navVisible",2),KQ([sg()],DQ.prototype,"activeSession",2),KQ([sg()],DQ.prototype,"volume",2),customElements.get("obi-widget")||customElements.define("obi-widget",DQ),customElements.get("obi-widget")||customElements.define("obi-widget",DQ),function(){const A=document.createElement("link");A.href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Syne:wght@400..800&display=swap",A.rel="stylesheet",document.head.appendChild(A)}(),function(){const A=window;"function"!=typeof A.ObiSDK&&"object"!=typeof A.ObiSDK&&(A.ObiSDK=function(t,e){"update"===t&&e&&(A.obiWidgetConfig={...A.obiWidgetConfig,...e})},A.ObiSDK.q=[])}(),function(){if(!document.querySelector("obi-widget")){const A=document.createElement("obi-widget");document.body.appendChild(A),console.log("Obi Widget mounted")}}(),function(){const A=window;A.ObiSDK&&Array.isArray(A.ObiSDK.q)&&(A.ObiSDK.q.forEach((t=>{const[e,i]=t;"update"===e&&i&&(A.obiWidgetConfig={...A.obiWidgetConfig,...i})})),A.ObiSDK.q=[])}(),A.ObiWidget=DQ,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lit")):"function"==typeof define&&define.amd?define(["exports","lit"],t):t((A="undefined"!=typeof globalThis?globalThis:A||self).ObiSDK={},A.lit);//# sourceMappingURL=obi-sdk.umd.js.map
|